![]() |
![]() |
TI-RTOS Drivers
tidrivers_full_2_20_01_10
|
CC3200 GPIO driver.
============================================================================
The GPIO header file should be included in an application as follows:
Refer to GPIO.h for a complete description of APIs.
The GPIO module allows you to manage General Purpose I/O pins via simple and portable APIs. The application is required to supply a GPIOCC3200_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 CC3200 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 | GPIOCC3200_Config |
GPIO device specific driver configuration structure. More... | |
Macros | |
#define | GPIOCC3200_EMPTY_PIN 0x0000 |
Device specific port/pin definition macros. More... | |
#define | GPIOCC3200_GPIO_00 0x0001 |
#define | GPIOCC3200_GPIO_01 0x0002 |
#define | GPIOCC3200_GPIO_02 0x0004 |
#define | GPIOCC3200_GPIO_03 0x0008 |
#define | GPIOCC3200_GPIO_04 0x0010 |
#define | GPIOCC3200_GPIO_05 0x0020 |
#define | GPIOCC3200_GPIO_06 0x0040 |
#define | GPIOCC3200_GPIO_07 0x0080 |
#define | GPIOCC3200_GPIO_08 0x0101 |
#define | GPIOCC3200_GPIO_09 0x0102 |
#define | GPIOCC3200_GPIO_10 0x0104 |
#define | GPIOCC3200_GPIO_11 0x0108 |
#define | GPIOCC3200_GPIO_12 0x0110 |
#define | GPIOCC3200_GPIO_13 0x0120 |
#define | GPIOCC3200_GPIO_14 0x0140 |
#define | GPIOCC3200_GPIO_15 0x0180 |
#define | GPIOCC3200_GPIO_16 0x0201 |
#define | GPIOCC3200_GPIO_17 0x0202 |
#define | GPIOCC3200_GPIO_18 0x0204 |
#define | GPIOCC3200_GPIO_19 0x0208 |
#define | GPIOCC3200_GPIO_20 0x0210 |
#define | GPIOCC3200_GPIO_21 0x0220 |
#define | GPIOCC3200_GPIO_22 0x0240 |
#define | GPIOCC3200_GPIO_23 0x0280 |
#define | GPIOCC3200_GPIO_24 0x0301 |
#define | GPIOCC3200_GPIO_25 0x0302 |
#define | GPIOCC3200_GPIO_26 0x0304 |
#define | GPIOCC3200_GPIO_27 0x0308 |
#define | GPIOCC3200_GPIO_28 0x0310 |
#define | GPIOCC3200_GPIO_29 0x0320 |
#define | GPIOCC3200_GPIO_30 0x0340 |
#define | GPIOCC3200_GPIO_31 0x0380 |
#define | GPIOCC3200_USE_STATIC 0x8000 /* use statically-defined parking state */ |
Typedefs | |
typedef struct GPIOCC3200_Config | GPIOCC3200_Config |
GPIO device specific driver configuration structure. More... | |
#define GPIOCC3200_EMPTY_PIN 0x0000 |
Device specific port/pin definition macros.
Below are the port/pin definitions to be used within the board's pin configuration table.
#define GPIOCC3200_GPIO_00 0x0001 |
#define GPIOCC3200_GPIO_01 0x0002 |
#define GPIOCC3200_GPIO_02 0x0004 |
#define GPIOCC3200_GPIO_03 0x0008 |
#define GPIOCC3200_GPIO_04 0x0010 |
#define GPIOCC3200_GPIO_05 0x0020 |
#define GPIOCC3200_GPIO_06 0x0040 |
#define GPIOCC3200_GPIO_07 0x0080 |
#define GPIOCC3200_GPIO_08 0x0101 |
#define GPIOCC3200_GPIO_09 0x0102 |
#define GPIOCC3200_GPIO_10 0x0104 |
#define GPIOCC3200_GPIO_11 0x0108 |
#define GPIOCC3200_GPIO_12 0x0110 |
#define GPIOCC3200_GPIO_13 0x0120 |
#define GPIOCC3200_GPIO_14 0x0140 |
#define GPIOCC3200_GPIO_15 0x0180 |
#define GPIOCC3200_GPIO_16 0x0201 |
#define GPIOCC3200_GPIO_17 0x0202 |
#define GPIOCC3200_GPIO_18 0x0204 |
#define GPIOCC3200_GPIO_19 0x0208 |
#define GPIOCC3200_GPIO_20 0x0210 |
#define GPIOCC3200_GPIO_21 0x0220 |
#define GPIOCC3200_GPIO_22 0x0240 |
#define GPIOCC3200_GPIO_23 0x0280 |
#define GPIOCC3200_GPIO_24 0x0301 |
#define GPIOCC3200_GPIO_25 0x0302 |
#define GPIOCC3200_GPIO_26 0x0304 |
#define GPIOCC3200_GPIO_27 0x0308 |
#define GPIOCC3200_GPIO_28 0x0310 |
#define GPIOCC3200_GPIO_29 0x0320 |
#define GPIOCC3200_GPIO_30 0x0340 |
#define GPIOCC3200_GPIO_31 0x0380 |
#define GPIOCC3200_USE_STATIC 0x8000 /* use statically-defined parking state */ |
typedef struct GPIOCC3200_Config GPIOCC3200_Config |
GPIO device specific driver configuration structure.