43 #define GPIO_PIN(port, pin) (gpio_t)((port << 5) | pin)
49 #define PIN_DIR_IN (0x00 << 0)
50 #define PIN_DIR_OUT (0x01 << 0)
51 #define PIN_MODE_PU (0x00 << 1)
52 #define PIN_MODE_PD (0x02 << 1)
53 #define PIN_MODE_NONE (0x03 << 1)
54 #define PIN_MODE_OD (0x01 << 3)
56 #define HAVE_GPIO_MODE_T
58 GPIO_IN = (PIN_DIR_IN | PIN_MODE_NONE),
61 GPIO_OUT = (PIN_DIR_OUT | PIN_MODE_NONE),
62 GPIO_OD = (PIN_DIR_OUT | PIN_MODE_OD),
63 GPIO_OD_PU = (PIN_DIR_OUT | PIN_MODE_OD | PIN_MODE_PU)
71 #define PROVIDES_PM_LAYERED_OFF
76 #define PM_NUM_MODES (3U)
82 LPC_UART_TypeDef *
dev;
@ GPIO_OUT
select GPIO MASK as output
@ GPIO_IN
select GPIO MASK as input
gpio_mode_t
Available pin modes.
unsigned int gpio_t
GPIO type identifier.
@ GPIO_OD
configure as output in open-drain mode without pull resistor
@ GPIO_IN_PU
configure as input with pull-up resistor
@ GPIO_OD_PU
configure as output in open-drain mode with pull resistor enabled
@ GPIO_IN_PD
configure as input with pull-down resistor
UART device configuration.
uint8_t pinsel_shift
TX/RX bitshift of the PINSEL# register.
uint8_t pinsel
PINSEL# of the RX and TX pin.
LPC_UART_TypeDef * dev
pointer to the UART device
uint8_t irq_rx
RX IRQ number.
uint8_t clk_offset
The offset of the periph in the clk sel.
uint8_t pinsel_af
Alternate function of the PINSEL# register.