mirror of
https://github.com/apache/nuttx.git
synced 2026-06-04 06:42:32 +08:00
arch/arm/src/xmc4/xmc4_gpio.c: Add a specific bit encoding for openprain GPIO pin.
This commit is contained in:
committed by
Gregory Nutt
parent
f3229cc00a
commit
8a1f3d6fa1
@@ -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
|
* Public Functions
|
||||||
|
|||||||
@@ -50,7 +50,7 @@
|
|||||||
|
|
||||||
/* 32-bit GIO encoding:
|
/* 32-bit GIO encoding:
|
||||||
*
|
*
|
||||||
* TTTT TMPD DDCC V.... .... .... PPPP BBBB
|
* TTTT TMPD DDCC VO... .... .... PPPP BBBB
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
@@ -84,12 +84,12 @@
|
|||||||
|
|
||||||
/* Pin type modifier:
|
/* Pin type modifier:
|
||||||
*
|
*
|
||||||
* .... .M.. .... .... .... .... .... ....
|
* .... .M.. .... .O.. .... .... .... ....
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define GPIO_INPUT_INVERT (1 << 26) /* Bit 26: Inverted direct input modifier */
|
#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 */
|
#define GPIO_OUTPUT_PUSHPULL (0) /* Push-pull output is the default */
|
||||||
|
|
||||||
/* Disable PAD:
|
/* Disable PAD:
|
||||||
|
|||||||
Reference in New Issue
Block a user