253 #ifndef ti_drivers_GPIO__include 254 #define ti_drivers_GPIO__include 258 #include <ti/devices/DeviceFamily.h> 264 #if (DeviceFamily_PARENT == DeviceFamily_PARENT_CC13X0_CC26X0 || \ 265 DeviceFamily_PARENT == DeviceFamily_PARENT_CC13X1_CC26X1 || \ 266 DeviceFamily_PARENT == DeviceFamily_PARENT_CC13X2_CC26X2 || \ 267 DeviceFamily_PARENT == DeviceFamily_PARENT_CC13X4_CC26X3_CC26X4) 269 #elif (DeviceFamily_ID == DeviceFamily_ID_CC3220 || DeviceFamily_ID == DeviceFamily_ID_CC3200) 270 #include <ti/drivers/gpio/GPIOCC32XX.h> 271 #elif (DeviceFamily_PARENT == DeviceFamily_PARENT_CC23X0 || DeviceFamily_PARENT == DeviceFamily_PARENT_CC27XX) 272 #include <ti/drivers/gpio/GPIOLPF3.h> 273 #elif (DeviceFamily_PARENT == DeviceFamily_PARENT_CC35XX) 274 #include <ti/drivers/gpio/GPIOWFF3.h> 282 #if defined(__IAR_SYSTEMS_ICC__) 283 #include <intrinsics.h> 284 #define GPIO_MASK_TO_PIN(pinmask) (31 - __CLZ(pinmask)) 285 #elif defined(__TI_COMPILER_VERSION__) 286 #include <arm_acle.h> 287 #define GPIO_MASK_TO_PIN(pinmask) (31 - __clz(pinmask)) 288 #elif defined(__GNUC__) && !defined(__TI_COMPILER_VERSION__) 289 #include <arm_acle.h> 290 #define GPIO_MASK_TO_PIN(pinmask) (31 - __builtin_clz(pinmask)) 293 #define GPIO_PIN_TO_MASK(pin) (1 << (pin)) 310 #define GPIO_STATUS_SUCCESS (0) 318 #define GPIO_STATUS_ERROR (-1) 340 #define GPIO_INVALID_INDEX 0xFF 350 #define GPIO_CFG_OUTPUT GPIO_CFG_OUTPUT_INTERNAL | GPIO_CFG_PULL_NONE_INTERNAL 352 #define GPIO_CFG_OUT_STD GPIO_CFG_OUTPUT_INTERNAL | GPIO_CFG_PULL_NONE_INTERNAL 354 #define GPIO_CFG_OUT_OD_NOPULL GPIO_CFG_OUTPUT_OPEN_DRAIN_INTERNAL | GPIO_CFG_PULL_NONE_INTERNAL 356 #define GPIO_CFG_OUT_OD_PU GPIO_CFG_OUTPUT_OPEN_DRAIN_INTERNAL | GPIO_CFG_PULL_UP_INTERNAL 358 #define GPIO_CFG_OUT_OD_PD GPIO_CFG_OUTPUT_OPEN_DRAIN_INTERNAL | GPIO_CFG_PULL_DOWN_INTERNAL 361 #define GPIO_CFG_OUT_STR_LOW GPIO_CFG_DRVSTR_LOW_INTERNAL 363 #define GPIO_CFG_OUT_STR_MED GPIO_CFG_DRVSTR_MED_INTERNAL 365 #define GPIO_CFG_OUT_STR_HIGH GPIO_CFG_DRVSTR_HIGH_INTERNAL 368 #define GPIO_CFG_OUT_HIGH GPIO_CFG_OUTPUT_DEFAULT_HIGH_INTERNAL 370 #define GPIO_CFG_OUT_LOW GPIO_CFG_OUTPUT_DEFAULT_LOW_INTERNAL 377 #define GPIO_CFG_INPUT GPIO_CFG_INPUT_INTERNAL | GPIO_CFG_PULL_NONE_INTERNAL 379 #define GPIO_CFG_IN_NOPULL GPIO_CFG_INPUT_INTERNAL | GPIO_CFG_PULL_NONE_INTERNAL 381 #define GPIO_CFG_IN_PU GPIO_CFG_INPUT_INTERNAL | GPIO_CFG_PULL_UP_INTERNAL 383 #define GPIO_CFG_IN_PD GPIO_CFG_INPUT_INTERNAL | GPIO_CFG_PULL_DOWN_INTERNAL 390 #define GPIO_CFG_NO_DIR GPIO_CFG_NO_DIR_INTERNAL | GPIO_CFG_PULL_NONE_INTERNAL 397 #define GPIO_CFG_INVERT_OFF GPIO_CFG_INVERT_OFF_INTERNAL 399 #define GPIO_CFG_INVERT_ON GPIO_CFG_INVERT_ON_INTERNAL 406 #define GPIO_CFG_HYSTERESIS_OFF GPIO_CFG_HYSTERESIS_OFF_INTERNAL 408 #define GPIO_CFG_HYSTERESIS_ON GPIO_CFG_HYSTERESIS_ON_INTERNAL 415 #define GPIO_CFG_SLEW_NORMAL GPIO_CFG_SLEW_NORMAL_INTERNAL 417 #define GPIO_CFG_SLEW_REDUCED GPIO_CFG_SLEW_REDUCED_INTERNAL 424 #define GPIO_CFG_IN_INT_NONE GPIO_CFG_INT_NONE_INTERNAL 426 #define GPIO_CFG_IN_INT_FALLING GPIO_CFG_INT_FALLING_INTERNAL 428 #define GPIO_CFG_IN_INT_RISING GPIO_CFG_INT_RISING_INTERNAL 430 #define GPIO_CFG_IN_INT_BOTH_EDGES GPIO_CFG_INT_BOTH_EDGES_INTERNAL 432 #define GPIO_CFG_IN_INT_LOW GPIO_CFG_INT_LOW_INTERNAL 434 #define GPIO_CFG_IN_INT_HIGH GPIO_CFG_INT_HIGH_INTERNAL 437 #define GPIO_CFG_INT_DISABLE GPIO_CFG_INT_DISABLE_INTERNAL 439 #define GPIO_CFG_INT_ENABLE GPIO_CFG_INT_ENABLE_INTERNAL 451 #define GPIO_CFG_SHUTDOWN_WAKE_OFF GPIO_CFG_SHUTDOWN_WAKE_OFF_INTERNAL 453 #define GPIO_CFG_SHUTDOWN_WAKE_HIGH GPIO_CFG_SHUTDOWN_WAKE_HIGH_INTERNAL 455 #define GPIO_CFG_SHUTDOWN_WAKE_LOW GPIO_CFG_SHUTDOWN_WAKE_LOW_INTERNAL 464 #define GPIO_MUX_GPIO GPIO_MUX_GPIO_INTERNAL 557 extern uint_fast8_t
GPIO_read(uint_least8_t index);
572 extern void GPIO_write(uint_least8_t index,
unsigned int value);
621 extern int_fast16_t
GPIO_setConfig(uint_least8_t index, GPIO_PinConfig pinConfig);
652 extern void GPIO_getConfig(uint_least8_t index, GPIO_PinConfig *pinConfig);
696 extern int_fast16_t
GPIO_setConfigAndMux(uint_least8_t index, GPIO_PinConfig pinConfig, uint32_t mux);
uint32_t intPriority
Definition: GPIO.h:496
void GPIO_write(uint_least8_t index, unsigned int value)
Writes the value to a GPIO pin.
GPIO_CallbackFxn * callbacks
Definition: GPIO.h:494
uint32_t GPIO_getMux(uint_least8_t index)
Get the current mux for a gpio pin.
GPIO driver configuration structure.
Definition: GPIO.h:491
void GPIO_init(void)
Initializes the GPIO module.
void GPIO_resetConfig(uint_least8_t index)
Resets the configuration for a gpio pin to the default value.
GPIO_PinConfig * configs
Definition: GPIO.h:493
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.
void * GPIO_getUserArg(uint_least8_t index)
Get the user argument for a gpio pin.
GPIO_CallbackFxn GPIO_getCallback(uint_least8_t index)
Gets the callback associated with a GPIO pin.
void GPIO_setInterruptConfig(uint_least8_t index, GPIO_PinConfig config)
Configure the gpio pin.
uint32_t GPIO_PinConfig
GPIO pin configuration settings.
Definition: GPIO.h:330
void GPIO_getConfig(uint_least8_t index, GPIO_PinConfig *pinConfig)
Get the current configuration for a gpio pin.
void GPIO_setUserArg(uint_least8_t index, void *arg)
Set the user argument for a gpio pin.
int_fast16_t GPIO_setConfigAndMux(uint_least8_t index, GPIO_PinConfig pinConfig, uint32_t mux)
Configure the gpio pin's config and mux in a single write.
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.
void ** userArgs
Definition: GPIO.h:495
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.
GPIO driver implementation for CC26xx devices.
void(* GPIO_CallbackFxn)(uint_least8_t index)
GPIO callback function type.
Definition: GPIO.h:477