diff --git a/arch/arm/src/xmc4/xmc4_gpio.c b/arch/arm/src/xmc4/xmc4_gpio.c index d88e73c7adc..70bc6257560 100644 --- a/arch/arm/src/xmc4/xmc4_gpio.c +++ b/arch/arm/src/xmc4/xmc4_gpio.c @@ -350,7 +350,10 @@ static inline bool xmc4_gpio_inverted(gpioconfig_t pinconfig) * ****************************************************************************/ -#define xmc4_gpio_opendrain(p) xmc4_gpio_inverted(p) +static inline bool xmc4_gpio_opendrain(gpioconfig_t pinconfig) +{ + return ((pinconfig & GPIO_OUTPUT_OPENDRAIN) != 0); +} /**************************************************************************** * Public Functions diff --git a/arch/arm/src/xmc4/xmc4_gpio.h b/arch/arm/src/xmc4/xmc4_gpio.h index eebc6e88fb3..ef6ad3b46df 100644 --- a/arch/arm/src/xmc4/xmc4_gpio.h +++ b/arch/arm/src/xmc4/xmc4_gpio.h @@ -50,7 +50,7 @@ /* 32-bit GIO encoding: * - * TTTT TMPD DDCC V.... .... .... PPPP BBBB + * TTTT TMPD DDCC VO... .... .... PPPP BBBB */ @@ -84,12 +84,12 @@ /* Pin type modifier: * - * .... .M.. .... .... .... .... .... .... + * .... .M.. .... .O.. .... .... .... .... */ #define GPIO_INPUT_INVERT (1 << 26) /* Bit 26: Inverted direct input modifier */ -#define GPIO_OUTPUT_OPENDRAIN (1 << 26) /* Bit 26: Output drain output modifier */ +#define GPIO_OUTPUT_OPENDRAIN (1 << 18) /* Bit 18: Output drain output modifier */ #define GPIO_OUTPUT_PUSHPULL (0) /* Push-pull output is the default */ /* Disable PAD: