arch/arm/src/xmc4/xmc4_gpio.c: Add a specific bit encoding for openprain GPIO pin.

This commit is contained in:
Alan Carvalho de Assis
2018-07-02 10:56:58 -06:00
committed by Gregory Nutt
parent f3229cc00a
commit 8a1f3d6fa1
2 changed files with 7 additions and 4 deletions
+4 -1
View File
@@ -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
+3 -3
View File
@@ -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: