272 #ifndef ti_drivers_GPIO__include 273 #define ti_drivers_GPIO__include 299 #define GPIO_STATUS_RESERVED (-32) 307 #define GPIO_STATUS_SUCCESS (0) 315 #define GPIO_STATUS_ERROR (-1) 333 #define GPIO_CFG_IO_MASK 0x00ff0000 334 #define GPIO_CFG_IO_LSB 16 335 #define GPIO_CFG_OUT_TYPE_MASK 0x00060000 336 #define GPIO_CFG_OUT_TYPE_LSB 17 337 #define GPIO_CFG_IN_TYPE_MASK 0x00060000 338 #define GPIO_CFG_IN_TYPE_LSB 17 339 #define GPIO_CFG_OUT_STRENGTH_MASK 0x00f00000 340 #define GPIO_CFG_OUT_STRENGTH_LSB 20 341 #define GPIO_CFG_INT_MASK 0x07000000 342 #define GPIO_CFG_INT_LSB 24 343 #define GPIO_CFG_OUT_BIT 19 353 #define GPIO_CFG_OUTPUT (((uint32_t) 0) << GPIO_CFG_IO_LSB) 354 #define GPIO_CFG_OUT_STD (((uint32_t) 0) << GPIO_CFG_IO_LSB) 355 #define GPIO_CFG_OUT_OD_NOPULL (((uint32_t) 2) << GPIO_CFG_IO_LSB) 356 #define GPIO_CFG_OUT_OD_PU (((uint32_t) 4) << GPIO_CFG_IO_LSB) 357 #define GPIO_CFG_OUT_OD_PD (((uint32_t) 6) << GPIO_CFG_IO_LSB) 359 #define GPIO_CFG_OUT_STR_LOW (((uint32_t) 0) << GPIO_CFG_OUT_STRENGTH_LSB) 360 #define GPIO_CFG_OUT_STR_MED (((uint32_t) 1) << GPIO_CFG_OUT_STRENGTH_LSB) 361 #define GPIO_CFG_OUT_STR_HIGH (((uint32_t) 2) << GPIO_CFG_OUT_STRENGTH_LSB) 363 #define GPIO_CFG_OUT_HIGH (((uint32_t) 1) << GPIO_CFG_OUT_BIT) 364 #define GPIO_CFG_OUT_LOW (((uint32_t) 0) << GPIO_CFG_OUT_BIT) 370 #define GPIO_CFG_INPUT (((uint32_t) 1) << GPIO_CFG_IO_LSB) 371 #define GPIO_CFG_IN_NOPULL (((uint32_t) 1) << GPIO_CFG_IO_LSB) 372 #define GPIO_CFG_IN_PU (((uint32_t) 3) << GPIO_CFG_IO_LSB) 373 #define GPIO_CFG_IN_PD (((uint32_t) 5) << GPIO_CFG_IO_LSB) 379 #define GPIO_CFG_IN_INT_NONE (((uint32_t) 0) << GPIO_CFG_INT_LSB) 380 #define GPIO_CFG_IN_INT_FALLING (((uint32_t) 1) << GPIO_CFG_INT_LSB) 381 #define GPIO_CFG_IN_INT_RISING (((uint32_t) 2) << GPIO_CFG_INT_LSB) 382 #define GPIO_CFG_IN_INT_BOTH_EDGES (((uint32_t) 3) << GPIO_CFG_INT_LSB) 383 #define GPIO_CFG_IN_INT_LOW (((uint32_t) 4) << GPIO_CFG_INT_LSB) 384 #define GPIO_CFG_IN_INT_HIGH (((uint32_t) 5) << GPIO_CFG_INT_LSB) 395 #define GPIO_CFG_IN_INT_ONLY (((uint32_t) 1) << 27) 401 #define GPIO_DO_NOT_CONFIG 0x40000000 415 typedef void (*GPIO_CallbackFxn)(uint_least8_t index); 464 extern void GPIO_getConfig(uint_least8_t index, GPIO_PinConfig *pinConfig);
488 extern uint_fast8_t
GPIO_read(uint_least8_t index);
527 GPIO_PinConfig pinConfig);
542 extern void GPIO_write(uint_least8_t index,
unsigned int value);
void GPIO_write(uint_least8_t index, unsigned int value)
Writes the value to a GPIO pin.
void GPIO_clearInt(uint_least8_t index)
Clear a GPIO pin interrupt flag.
void GPIO_toggle(uint_least8_t index)
Toggles the current state of a GPIO.
void GPIO_enableInt(uint_least8_t index)
Enable a GPIO pin interrupt.
uint32_t GPIO_PinConfig
GPIO pin configuration settings.
Definition: GPIO.h:327
void GPIO_getConfig(uint_least8_t index, GPIO_PinConfig *pinConfig)
Get the current configuration for a gpio pin.
void GPIO_init()
Initializes the GPIO module.
int_fast16_t GPIO_setConfig(uint_least8_t index, GPIO_PinConfig pinConfig)
Configure the gpio pin.
void GPIO_setCallback(uint_least8_t index, GPIO_CallbackFxn callback)
Bind a callback function to a GPIO pin interrupt.
uint_fast8_t GPIO_read(uint_least8_t index)
Reads the value of a GPIO pin.
void GPIO_disableInt(uint_least8_t index)
Disable a GPIO pin interrupt.
void(* GPIO_CallbackFxn)(uint_least8_t index)
GPIO callback function type.
Definition: GPIO.h:415