|
enum | tGPIO_PIN_OUTPUT_CONFIG { GPIO_PIN_OUTPUT_LOW,
GPIO_PIN_OUTPUT_HIGH
} |
| Enum used to configure pin output configuration. More...
|
|
enum | {
GPIO_EDGE_TRIGGER_MASK = 0x0001,
GPIO_EDGE_TRIGGER = 0x0001,
GPIO_LEVEL_TRIGGER = 0x0000,
GPIO_TRIGGER_POLARITY_MASK = 0x0002,
GPIO_TRIGGER_NEG = 0x0002,
GPIO_DUAL_EDGE_TRIGGER_MASK = 0x0004,
GPIO_EDGE_TRIGGER_BOTH = 0x0004,
GPIO_EDGE_TRIGGER_SINGLE = 0x0000,
GPIO_INTERRUPT_ENABLE_MASK = 0x0008,
GPIO_INTERRUPT_ENABLE = 0x0008,
GPIO_INTERRUPT_DISABLE = 0x0000,
GPIO_EN_INT_MASK = GPIO_EDGE_TRIGGER_MASK | GPIO_TRIGGER_POLARITY_MASK | GPIO_DUAL_EDGE_TRIGGER_MASK | GPIO_INTERRUPT_ENABLE_MASK,
GPIO_EN_INT_LEVEL_HIGH = GPIO_INTERRUPT_ENABLE | GPIO_LEVEL_TRIGGER,
GPIO_EN_INT_LEVEL_LOW = GPIO_INTERRUPT_ENABLE | GPIO_LEVEL_TRIGGER | GPIO_TRIGGER_NEG,
GPIO_EN_INT_RISING_EDGE = GPIO_INTERRUPT_ENABLE | GPIO_EDGE_TRIGGER,
GPIO_EN_INT_FALLING_EDGE = GPIO_INTERRUPT_ENABLE | GPIO_EDGE_TRIGGER | GPIO_TRIGGER_NEG,
GPIO_EN_INT_BOTH_EDGE = GPIO_INTERRUPT_ENABLE | GPIO_EDGE_TRIGGER | GPIO_EDGE_TRIGGER_BOTH,
GPIO_INPUT_ENABLE = 0x0000,
GPIO_OUTPUT_DISABLE = 0x0000,
GPIO_OUTPUT_ENABLE = 0x4000,
GPIO_KS_OUTPUT_ENABLE = 0x0001,
GPIO_OUTPUT_FN_SEL_MASK = 0x0000,
GPIO_OUTPUT_FN_SEL_SHIFT = 0,
GPIO_GLOBAL_INPUT_ENABLE = 0x0000,
GPIO_GLOBAL_INPUT_DISABLE = 0x0040,
GPIO_PULL_UP_DOWN_NONE = 0x0000,
GPIO_PULL_UP = 0x0400,
GPIO_PULL_DOWN = 0x0200,
GPIO_INPUT_DISABLE = 0x0600,
GPIO_DRIVE_SEL_MASK = 0x0800,
GPIO_DRIVE_SEL_LOWEST = 0x0000,
GPIO_DRIVE_SEL_MIDDLE_0 = 0x0000,
GPIO_DRIVE_SEL_MIDDLE_1 = 0x0800,
GPIO_DRIVE_SEL_HIGHEST = 0x0800,
GPIO_HYSTERESIS_MASK = 0x2000,
GPIO_HYSTERESIS_ON = 0x2000,
GPIO_HYSTERESIS_OFF = 0x0000
} |
| Defines the constant values used for configuration by the GPIO driver. More...
|
|
enum | wiced_bt_gpio_numbers_t {
WICED_P00 = 0,
WICED_P01,
WICED_P02,
WICED_P03,
WICED_P04,
WICED_P05,
WICED_P06,
WICED_P07,
WICED_P08,
WICED_P09,
WICED_P10,
WICED_P11,
WICED_P12,
WICED_P13,
WICED_P14,
WICED_P15,
WICED_P16,
WICED_P17,
WICED_P18,
WICED_P19,
WICED_P20,
WICED_P21,
WICED_P22,
WICED_P23,
WICED_P24,
WICED_P25,
WICED_P26,
WICED_P27,
WICED_P28,
WICED_P29,
WICED_P30,
WICED_P31,
WICED_P32,
WICED_P33,
WICED_P34,
WICED_P35,
WICED_P36,
WICED_P37,
WICED_P38,
WICED_P39,
WICED_GPIO_00,
WICED_GPIO_01,
WICED_GPIO_02,
WICED_GPIO_03,
WICED_GPIO_04,
WICED_GPIO_05,
WICED_GPIO_06,
WICED_GPIO_07,
MAX_NUM_OF_GPIO
} |
| GPIO Numbers : last 8 are ARM GPIOs and rest are LHL GPIOs. More...
|
|
enum | wiced_bt_gpio_function_t {
WICED_GPIO = 0,
WICED_I2C_1_SCL,
WICED_I2C_1_SDA,
WICED_I2C_2_SCL,
WICED_I2C_2_SDA,
WICED_SPI_1_CLK,
WICED_SPI_1_CS,
WICED_SPI_1_MOSI,
WICED_SPI_1_MISO,
WICED_SPI_1_IO2,
WICED_SPI_1_IO3,
WICED_SPI_1_INT,
WICED_SPI_1_DCX,
WICED_SPI_2_CLK,
WICED_SPI_2_CS,
WICED_SPI_2_MOSI,
WICED_SPI_2_MISO,
WICED_SPI_2_IO2,
WICED_SPI_2_IO3,
WICED_SPI_2_INT,
WICED_SPI_2_DCX,
WICED_SPI_3_CLK,
WICED_SPI_3_CS,
WICED_SPI_3_MOSI,
WICED_SPI_3_MISO,
WICED_SPI_3_INT,
WICED_SWDCK,
WICED_SWDIO,
WICED_UART_1_TXD,
WICED_UART_1_RXD,
WICED_UART_1_CTS,
WICED_UART_1_RTS,
WICED_UART_2_TXD,
WICED_UART_2_RXD,
WICED_UART_2_CTS,
WICED_UART_2_RTS,
WICED_AOA_0,
WICED_AOA_1,
WICED_AOA_2,
WICED_AOD_0,
WICED_I2S_MASTER_CLK,
WICED_I2S_MASTER_WS,
WICED_I2S_MASTER_DO,
WICED_I2S_MASTER_DI,
WICED_I2S_SLAVE_CLK,
WICED_I2S_SLAVE_WS,
WICED_I2S_SLAVE_DO,
WICED_I2S_SLAVE_DI,
WICED_PCM_CLK,
WICED_PCM_SYNC,
WICED_PCM_OUT,
WICED_PCM_IN,
WICED_GCI_SECI_IN,
WICED_GCI_SECI_OUT,
WICED_ACLK_0,
WICED_ACLK_1,
WICED_KSO0,
WICED_KSO1,
WICED_KSO2,
WICED_KSO3,
WICED_KSO4,
WICED_KSO5,
WICED_KSO6,
WICED_KSO7,
WICED_KSO8,
WICED_KSO9,
WICED_KSO10,
WICED_KSO11,
WICED_KSO12,
WICED_KSO13,
WICED_KSO14,
WICED_KSO15,
WICED_KSO16,
WICED_KSO17,
WICED_KSO18,
WICED_KSO19,
WICED_TX_PD,
WICED_TX_PD_TILDA,
WICED_PA_RAMP,
WICED_BT_GPIO_00,
WICED_BT_GPIO_01,
WICED_BT_GPIO_02,
WICED_BT_GPIO_03,
WICED_BT_GPIO_04,
WICED_BT_GPIO_05,
WICED_BT_GPIO_06,
WICED_BT_GPIO_07,
WICED_PWM0,
WICED_PWM1,
WICED_PWM2,
WICED_PWM3,
WICED_PWM4,
WICED_PWM5,
WICED_TX_FSM = 128,
WICED_RX_FSM,
WICED_RX_PU,
WICED_TX_PU,
BT_GPIO_2_I2S_DI = 4,
BT_GPIO_3_I2S_MWS = 3,
BT_GPIO_3_I2S_SWS = 4,
BT_GPIO_4_I2S_MDO = 3,
BT_GPIO_4_I2S_SDO = 4,
BT_GPIO_4_UART2_RTS = 11,
BT_GPIO_4_I2C_SDA = 15,
BT_GPIO_5_I2S_MCK = 3,
BT_GPIO_5_I2S_SCK = 4,
BT_GPIO_5_UART2_CTS = 11,
BT_GPIO_5_I2C_SCL = 15,
WICED_UNAVAILABLE = 0xFF
} |
| possible functions to be brought out through LHL GPIO's More...
|
|
enum | GPIO_STATUS_e { GPIO_FAILURE,
GPIO_SUCCESS,
GPIO_REMAPPED,
GPIO_MOVED
} |
| Possible return values from wiced_hal_gpio_select_function(...), Callers only need to check for the GPIO_FAILURE case since any other status means success. More...
|
|
Defines a driver to facilitate interfacing with the GPIO pins.
Use this driver to control the behavior of any desired pin, such as driving a 1 or a 0, or as part of other drivers such as controlling the chip-select (CS) line for the SPI driver.
void wiced_hal_gpio_register_pin_for_interrupt |
( |
uint16_t |
pin, |
|
|
void(*)(void *, uint8_t) |
userfn, |
|
|
void * |
userdata |
|
) |
| |
Register a function for notification of changes to a pin (via interrupt).
- Parameters
-
[in] | pin | The pin number from the schematic. Range [0-39] Ex: P<pin> |
[in] | userfn | Pointer to the function to call when the interrupt is triggered Below is the description of the arguments received by the call back. void* user_data - User data provided when interrupt is being registered using wiced_hal_gpio_register_pin_for_interrupt(...) uint8_t value - Number of the pin causing the interrupt |
[in] | userdata | Pointer that will be passed back to userfn as-is. Typically NULL. |
- Returns
- none
- Note
- This function is independent of configuring the pin for interrupts; a call to wiced_hal_gpio_configure_pin() is also required.
-
Also note that once registered, you CANNOT unregister; registration is meant to be a startup activity. To stop receiving notifications, re-configure the pin and disable the interrupt using wiced_hal_gpio_configure_pin()
-
(!) Note that the function does not need to clear the interrupt status; this will be done automatically.
-
(!) Note that the function will be called ONCE per interrupt, not once per pin (this makes a difference if multiple pins toggle at the same time).
Example:
void gpio_int_test_cb(void *data);
wiced_hal_gpio_configurePin(WICED_P01, (GPIO_INPUT_ENABLE|GPIO_PULL_DOWN|GPIO_EN_INT_RISING_EDGE), GPIO_PIN_OUTPUT_LOW);
wiced_hal_gpio_register_pin_for_interrupt(WICED_P01, gpio_int_test_cb, NULL);