![]() |
![]() |
TI-RTOS Drivers
tidrivers_full_2_20_01_10
|
CC26XX GPIO driver.
============================================================================
The GPIO header file should be included in an application as follows:
The GPIO module allows you to manage General Purpose I/O pins via simple and portable APIs. The application is required to supply a GPIOCC26XX_Config structure to the module (see example below). This structure communicates to the GPIO module how to configure the pins used by the application (See the description of GPIO_PinConfig in the GPIO.h file).
The application is required to call GPIO_init(). This function will initialize all the GPIO pins defined in the GPIO_PinConfig table to the configurations specified. Once completed the other APIs can be used to access the pins.
Asserts are used to verify that the driver has been initialized, and is reading/writing a valid index.
The following is an example of the code required to use the 2 switches and 4 LEDs on the CC26XX Launchpad board.
Board header:
Board initialization code:
Keep in mind that the callback functions will be called in the context of an interrupt service routine and should be designed accordingly. When an interrupt is triggered, the interrupt status of all (interrupt enabled) pins on a port will be read, cleared, and the respective callbacks will be executed. Callbacks will be called in order from least significant bit to most significant bit.
The GPIO driver interface produces log statements if instrumentation is enabled.
Diagnostics Mask | Log details |
---|---|
Diags_USER1 | basic operations performed |
Go to the source code of this file.
Data Structures | |
struct | GPIOCC26XX_Config |
GPIO device specific driver configuration structure. More... | |
Macros | |
#define | GPIOCC26XX_EMPTY_PIN 0xffff |
Device specific port/pin definition macros. More... | |
#define | GPIOCC26XX_DIO_00 IOID_0 |
#define | GPIOCC26XX_DIO_01 IOID_1 |
#define | GPIOCC26XX_DIO_02 IOID_2 |
#define | GPIOCC26XX_DIO_03 IOID_3 |
#define | GPIOCC26XX_DIO_04 IOID_4 |
#define | GPIOCC26XX_DIO_05 IOID_5 |
#define | GPIOCC26XX_DIO_06 IOID_6 |
#define | GPIOCC26XX_DIO_07 IOID_7 |
#define | GPIOCC26XX_DIO_08 IOID_8 |
#define | GPIOCC26XX_DIO_09 IOID_9 |
#define | GPIOCC26XX_DIO_10 IOID_10 |
#define | GPIOCC26XX_DIO_11 IOID_11 |
#define | GPIOCC26XX_DIO_12 IOID_12 |
#define | GPIOCC26XX_DIO_13 IOID_13 |
#define | GPIOCC26XX_DIO_14 IOID_14 |
#define | GPIOCC26XX_DIO_15 IOID_15 |
#define | GPIOCC26XX_DIO_16 IOID_16 |
#define | GPIOCC26XX_DIO_17 IOID_17 |
#define | GPIOCC26XX_DIO_18 IOID_18 |
#define | GPIOCC26XX_DIO_19 IOID_19 |
#define | GPIOCC26XX_DIO_20 IOID_20 |
#define | GPIOCC26XX_DIO_21 IOID_21 |
#define | GPIOCC26XX_DIO_22 IOID_22 |
#define | GPIOCC26XX_DIO_23 IOID_23 |
#define | GPIOCC26XX_DIO_24 IOID_24 |
#define | GPIOCC26XX_DIO_25 IOID_25 |
#define | GPIOCC26XX_DIO_26 IOID_26 |
#define | GPIOCC26XX_DIO_27 IOID_27 |
#define | GPIOCC26XX_DIO_28 IOID_28 |
#define | GPIOCC26XX_DIO_29 IOID_29 |
#define | GPIOCC26XX_DIO_30 IOID_30 |
#define | GPIOCC26XX_DIO_31 IOID_31 |
Typedefs | |
typedef struct GPIOCC26XX_Config | GPIOCC26XX_Config |
GPIO device specific driver configuration structure. More... | |
Functions | |
void | GPIOCC26xx_release (int index) |
Un-oonfigure a GPIO pin. More... | |
#define GPIOCC26XX_EMPTY_PIN 0xffff |
Device specific port/pin definition macros.
Below are the port/pin definitions to be used within the board's pin configuration table.
#define GPIOCC26XX_DIO_00 IOID_0 |
#define GPIOCC26XX_DIO_01 IOID_1 |
#define GPIOCC26XX_DIO_02 IOID_2 |
#define GPIOCC26XX_DIO_03 IOID_3 |
#define GPIOCC26XX_DIO_04 IOID_4 |
#define GPIOCC26XX_DIO_05 IOID_5 |
#define GPIOCC26XX_DIO_06 IOID_6 |
#define GPIOCC26XX_DIO_07 IOID_7 |
#define GPIOCC26XX_DIO_08 IOID_8 |
#define GPIOCC26XX_DIO_09 IOID_9 |
#define GPIOCC26XX_DIO_10 IOID_10 |
#define GPIOCC26XX_DIO_11 IOID_11 |
#define GPIOCC26XX_DIO_12 IOID_12 |
#define GPIOCC26XX_DIO_13 IOID_13 |
#define GPIOCC26XX_DIO_14 IOID_14 |
#define GPIOCC26XX_DIO_15 IOID_15 |
#define GPIOCC26XX_DIO_16 IOID_16 |
#define GPIOCC26XX_DIO_17 IOID_17 |
#define GPIOCC26XX_DIO_18 IOID_18 |
#define GPIOCC26XX_DIO_19 IOID_19 |
#define GPIOCC26XX_DIO_20 IOID_20 |
#define GPIOCC26XX_DIO_21 IOID_21 |
#define GPIOCC26XX_DIO_22 IOID_22 |
#define GPIOCC26XX_DIO_23 IOID_23 |
#define GPIOCC26XX_DIO_24 IOID_24 |
#define GPIOCC26XX_DIO_25 IOID_25 |
#define GPIOCC26XX_DIO_26 IOID_26 |
#define GPIOCC26XX_DIO_27 IOID_27 |
#define GPIOCC26XX_DIO_28 IOID_28 |
#define GPIOCC26XX_DIO_29 IOID_29 |
#define GPIOCC26XX_DIO_30 IOID_30 |
#define GPIOCC26XX_DIO_31 IOID_31 |
typedef struct GPIOCC26XX_Config GPIOCC26XX_Config |
GPIO device specific driver configuration structure.
void GPIOCC26xx_release | ( | int | index | ) |
Un-oonfigure a GPIO pin.
Disables pin interrupt, clears callback, restores pin to default setting, removes pin from PIN object
index | GPIO index |