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) 272 #include <ti/drivers/gpio/GPIOCC23XX.h> 280 #if defined(__IAR_SYSTEMS_ICC__) 281 #include <intrinsics.h> 282 #define GPIO_MASK_TO_PIN(pinmask) (31 - __CLZ(pinmask)) 283 #elif defined(__TI_COMPILER_VERSION__) 284 #include <arm_acle.h> 285 #define GPIO_MASK_TO_PIN(pinmask) (31 - __clz(pinmask)) 286 #elif defined(__GNUC__) && !defined(__TI_COMPILER_VERSION__) 287 #include <arm_acle.h> 288 #define GPIO_MASK_TO_PIN(pinmask) (31 - __builtin_clz(pinmask)) 291 #define GPIO_PIN_TO_MASK(pin) (1 << (pin)) 308 #define GPIO_STATUS_SUCCESS (0) 316 #define GPIO_STATUS_ERROR (-1) 338 #define GPIO_INVALID_INDEX 0xFF 348 #define GPIO_CFG_OUTPUT GPIO_CFG_OUTPUT_INTERNAL | GPIO_CFG_PULL_NONE_INTERNAL 350 #define GPIO_CFG_OUT_STD GPIO_CFG_OUTPUT_INTERNAL | GPIO_CFG_PULL_NONE_INTERNAL 352 #define GPIO_CFG_OUT_OD_NOPULL GPIO_CFG_OUTPUT_OPEN_DRAIN_INTERNAL | GPIO_CFG_PULL_NONE_INTERNAL 354 #define GPIO_CFG_OUT_OD_PU GPIO_CFG_OUTPUT_OPEN_DRAIN_INTERNAL | GPIO_CFG_PULL_UP_INTERNAL 356 #define GPIO_CFG_OUT_OD_PD GPIO_CFG_OUTPUT_OPEN_DRAIN_INTERNAL | GPIO_CFG_PULL_DOWN_INTERNAL 359 #define GPIO_CFG_OUT_STR_LOW GPIO_CFG_DRVSTR_LOW_INTERNAL 361 #define GPIO_CFG_OUT_STR_MED GPIO_CFG_DRVSTR_MED_INTERNAL 363 #define GPIO_CFG_OUT_STR_HIGH GPIO_CFG_DRVSTR_HIGH_INTERNAL 366 #define GPIO_CFG_OUT_HIGH GPIO_CFG_OUTPUT_DEFAULT_HIGH_INTERNAL 368 #define GPIO_CFG_OUT_LOW GPIO_CFG_OUTPUT_DEFAULT_LOW_INTERNAL 375 #define GPIO_CFG_INPUT GPIO_CFG_INPUT_INTERNAL | GPIO_CFG_PULL_NONE_INTERNAL 377 #define GPIO_CFG_IN_NOPULL GPIO_CFG_INPUT_INTERNAL | GPIO_CFG_PULL_NONE_INTERNAL 379 #define GPIO_CFG_IN_PU GPIO_CFG_INPUT_INTERNAL | GPIO_CFG_PULL_UP_INTERNAL 381 #define GPIO_CFG_IN_PD GPIO_CFG_INPUT_INTERNAL | GPIO_CFG_PULL_DOWN_INTERNAL 388 #define GPIO_CFG_NO_DIR GPIO_CFG_NO_DIR_INTERNAL | GPIO_CFG_PULL_NONE_INTERNAL 395 #define GPIO_CFG_INVERT_OFF GPIO_CFG_INVERT_OFF_INTERNAL 397 #define GPIO_CFG_INVERT_ON GPIO_CFG_INVERT_ON_INTERNAL 404 #define GPIO_CFG_HYSTERESIS_OFF GPIO_CFG_HYSTERESIS_OFF_INTERNAL 406 #define GPIO_CFG_HYSTERESIS_ON GPIO_CFG_HYSTERESIS_ON_INTERNAL 413 #define GPIO_CFG_SLEW_NORMAL GPIO_CFG_SLEW_NORMAL_INTERNAL 415 #define GPIO_CFG_SLEW_REDUCED GPIO_CFG_SLEW_REDUCED_INTERNAL 422 #define GPIO_CFG_IN_INT_NONE GPIO_CFG_INT_NONE_INTERNAL 424 #define GPIO_CFG_IN_INT_FALLING GPIO_CFG_INT_FALLING_INTERNAL 426 #define GPIO_CFG_IN_INT_RISING GPIO_CFG_INT_RISING_INTERNAL 428 #define GPIO_CFG_IN_INT_BOTH_EDGES GPIO_CFG_INT_BOTH_EDGES_INTERNAL 430 #define GPIO_CFG_IN_INT_LOW GPIO_CFG_INT_LOW_INTERNAL 432 #define GPIO_CFG_IN_INT_HIGH GPIO_CFG_INT_HIGH_INTERNAL 435 #define GPIO_CFG_INT_DISABLE GPIO_CFG_INT_DISABLE_INTERNAL 437 #define GPIO_CFG_INT_ENABLE GPIO_CFG_INT_ENABLE_INTERNAL 449 #define GPIO_CFG_SHUTDOWN_WAKE_OFF GPIO_CFG_SHUTDOWN_WAKE_OFF_INTERNAL 451 #define GPIO_CFG_SHUTDOWN_WAKE_HIGH GPIO_CFG_SHUTDOWN_WAKE_HIGH_INTERNAL 453 #define GPIO_CFG_SHUTDOWN_WAKE_LOW GPIO_CFG_SHUTDOWN_WAKE_LOW_INTERNAL 462 #define GPIO_MUX_GPIO GPIO_MUX_GPIO_INTERNAL 555 extern uint_fast8_t
GPIO_read(uint_least8_t index);
570 extern void GPIO_write(uint_least8_t index,
unsigned int value);
619 extern int_fast16_t
GPIO_setConfig(uint_least8_t index, GPIO_PinConfig pinConfig);
650 extern void GPIO_getConfig(uint_least8_t index, GPIO_PinConfig *pinConfig);
679 extern void GPIO_setMux(uint_least8_t index, uint32_t mux);
710 extern int_fast16_t
GPIO_setConfigAndMux(uint_least8_t index, GPIO_PinConfig pinConfig, uint32_t mux);
uint32_t intPriority
Definition: GPIO.h:494
void GPIO_write(uint_least8_t index, unsigned int value)
Writes the value to a GPIO pin.
GPIO_CallbackFxn * callbacks
Definition: GPIO.h:492
uint32_t GPIO_getMux(uint_least8_t index)
Get the current mux for a gpio pin.
GPIO driver configuration structure.
Definition: GPIO.h:489
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.
void GPIO_setMux(uint_least8_t index, uint32_t mux)
Sets the mux for a gpio pin.
GPIO_PinConfig * configs
Definition: GPIO.h:491
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:328
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:493
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:475