Infineon Logo AIROC BTSDK v4.9 - Documentation
 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages

Defines a driver to facilitate interfacing with the GPIO pins. More...

Macros

#define WICED_PCM_IN_I2S_DI   WICED_PCM_IN
 Aliases for compatibility with UDD signal definitions.
 
#define WICED_PCM_OUT_I2S_DO   WICED_PCM_OUT
 
#define WICED_PCM_SYNC_I2S_WS   WICED_PCM_SYNC
 
#define WICED_PCM_CLK_I2S_CLK   WICED_PCM_CLK
 
#define WICED_PDM_DATA   WICED_GPIO
 Alias for compatibility with WICED_PDM_DATA until PDM handled.
 
#define WICED_GPIO_ACTIVE_HIGH   1
 GPIO Active Level HIGH.
 
#define WICED_GPIO_ACTIVE_LOW   0
 GPIO Active Level LOW.
 
#define WICED_HAL_GPIO_PIN_UNUSED   0xFF
 Invalid GPIO pin.
 

Typedefs

typedef enum GPIO_STATUS_e wiced_bt_gpio_select_status_t
 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.
 

Enumerations

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...
 

Functions

void wiced_hal_gpio_init (void)
 Initializes the GPIO driver and its private values. More...
 
void wiced_hal_gpio_configure_pin (uint32_t pin, uint32_t config, uint32_t outputVal)
 Configures a GPIO pin. More...
 
uint16_t wiced_hal_gpio_get_pin_config (uint32_t pin)
 Retrieve the current configuration of the specified pin. More...
 
void wiced_hal_gpio_set_pin_output (uint32_t pin, uint32_t val)
 Sets the output value of a pin. More...
 
uint32_t wiced_hal_gpio_get_pin_output (uint32_t pin)
 Get the programmed output value of a pin. More...
 
uint32_t wiced_hal_gpio_get_pin_input_status (uint32_t pin)
 Read the current value at a pin. More...
 
uint32_t wiced_hal_gpio_get_pin_interrupt_status (uint32_t pin)
 Get the interrupt status of a pin. More...
 
void wiced_hal_gpio_register_pin_for_interrupt (uint16_t pin, void(*userfn)(void *, uint8_t), void *userdata)
 Register a function for notification of changes to a pin (via interrupt). More...
 
uint32_t wiced_hal_gpio_clear_pin_interrupt_status (uint32_t pin)
 Clear the interrupt status of a pin manually. More...
 
void wiced_hal_gpio_disable_all_inputs (void)
 Configures all GPIOs except P26 to be INPUT DISABLED. More...
 
BOOL32 wiced_hal_gpio_slimboot_reenforce_cfg (uint8_t pin, uint16_t config)
 Save the LHL GPIO configuration in AON memeory to reenforce in slimboot This is a must if we want to wake up in SDS by external LHL GPIO interrupts. More...
 
wiced_bt_gpio_select_status_t wiced_hal_gpio_select_function (wiced_bt_gpio_numbers_t pin, wiced_bt_gpio_function_t function)
 Configure a GPIO pin to have the chosen functionality. More...
 
void wiced_hal_unassign_gpio_function (uint32_t pin, uint32_t function)
 Unassign a GPIO pin functionality. More...
 

Detailed Description

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.

Enumeration Type Documentation

anonymous enum

Defines the constant values used for configuration by the GPIO driver.

Each GPIO has a set of configuration signals

  • bit 0 - Edge Trigger
  • bit 1 - Trigger polarity
  • bit 2 - Dual edge trigger
  • bit 3 - Interrupt enable
  • bit 6 - Global input disable
  • bit 9:10 - pull up/down
  • bit 11 - Drive strength
  • bit 13 - Input hysteresis
  • bit 14 - Output enable
Enumerator
GPIO_EDGE_TRIGGER_MASK 

GPIO configuration bit 0 mask.

GPIO_EDGE_TRIGGER 

Edge triggered.

GPIO_LEVEL_TRIGGER 

Level triggered.

GPIO_TRIGGER_POLARITY_MASK 

GPIO configuration bit 1 mask.

GPIO_TRIGGER_NEG 

Negative interrupt polarity (Falling Edge)

GPIO_DUAL_EDGE_TRIGGER_MASK 

GPIO configuration bit 2 mask.

GPIO_EDGE_TRIGGER_BOTH 

Trigger on both edges.

GPIO_EDGE_TRIGGER_SINGLE 

Trigger on single edge.

GPIO_INTERRUPT_ENABLE_MASK 

GPIO configuration bit 3 mask.

GPIO_INTERRUPT_ENABLE 

Interrupt Enabled.

GPIO_INTERRUPT_DISABLE 

Interrupt Disabled.

GPIO_EN_INT_LEVEL_HIGH 

Interrupt on level HIGH.

GPIO_EN_INT_LEVEL_LOW 

Interrupt on level LOW.

GPIO_EN_INT_RISING_EDGE 

Interrupt on rising edge.

GPIO_EN_INT_FALLING_EDGE 

Interrupt on falling edge.

GPIO_EN_INT_BOTH_EDGE 

Interrupt on both edges.

GPIO_INPUT_ENABLE 

Input enable.

GPIO_OUTPUT_DISABLE 

Output disable.

GPIO_OUTPUT_ENABLE 

Output enable.

GPIO_KS_OUTPUT_ENABLE 

Keyscan output enable.

GPIO_OUTPUT_FN_SEL_MASK 

Output function select mask.

GPIO_GLOBAL_INPUT_ENABLE 

Global input enable.

GPIO_GLOBAL_INPUT_DISABLE 

Global input disable.

GPIO_PULL_UP_DOWN_NONE 

No pull [0,0].

GPIO_PULL_UP 

Pull up [1,0].

GPIO_PULL_DOWN 

Pull down [0,1].

GPIO_INPUT_DISABLE 

Input disable [1,1] (input disabled the GPIO)

GPIO_DRIVE_SEL_MASK 

GPIO configuration bit 11 mask.

GPIO_DRIVE_SEL_LOWEST 

Drive strength lowest - 2mA @ 1.8V.

GPIO_DRIVE_SEL_MIDDLE_0 

Drive strength middle_0 - 4mA @ 3.3V.

GPIO_DRIVE_SEL_MIDDLE_1 

Drive strength middle_1 - 4mA @ 1.8V.

GPIO_DRIVE_SEL_HIGHEST 

Drive strength highest - 8mA @ 3.3V.

GPIO_HYSTERESIS_MASK 

GPIO configuration bit 13 mask.

GPIO_HYSTERESIS_ON 

GPIO hysteresis on.

GPIO_HYSTERESIS_OFF 

GPIO hysteresis off.

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.

Enumerator
GPIO_FAILURE 

The requested pin and function mapping is not supported by hardware.

GPIO_SUCCESS 

The requested pin and function mapping is complete, The pin was previously not used and the function was previously not mapped.

GPIO_REMAPPED 

The requested pin and function mapping is complete, The pin was previously used by another function, that function was disabled and the new function applied.

GPIO_MOVED 

The requested pin and function mapping is complete, The requested function was already mapped to a different pin, that pin was disabled and the function moved to the new pin.

Enum used to configure pin output configuration.

Enumerator
GPIO_PIN_OUTPUT_LOW 

Output low (0)

GPIO_PIN_OUTPUT_HIGH 

Outout high (1)

possible functions to be brought out through LHL GPIO's

Enumerator
WICED_GPIO 

LHL GPIO (default functionality)

WICED_I2C_1_SCL 

I2C 1 Clock.

WICED_I2C_1_SDA 

I2C 1 Data.

WICED_I2C_2_SCL 

I2C 2 Clock.

WICED_I2C_2_SDA 

I2C 2 Data.

WICED_SPI_1_CLK 

SPI 1 Clock.

WICED_SPI_1_CS 

SPI 1 Chip Select.

WICED_SPI_1_MOSI 

SPI 1 Master Out Slave In.

WICED_SPI_1_MISO 

SPI 1 Slave In Master Out.

WICED_SPI_1_IO2 

SPI 1 IO2.

WICED_SPI_1_IO3 

SPI 1 IO3.

WICED_SPI_1_INT 

SPI 1 INT.

WICED_SPI_1_DCX 

SPI 1 DCX.

WICED_SPI_2_CLK 

SPI 2 Clock.

WICED_SPI_2_CS 

SPI 2 Chip Select.

WICED_SPI_2_MOSI 

SPI 2 Master Out Slave In.

WICED_SPI_2_MISO 

SPI 2 Slave In Master Out.

WICED_SPI_2_IO2 

SPI 2 IO2.

WICED_SPI_2_IO3 

SPI 2 IO2.

WICED_SPI_2_INT 

SPI 2 INT.

WICED_SPI_2_DCX 

SPI 2 DCX.

WICED_SPI_3_CLK 

SPI 3 Clock.

WICED_SPI_3_CS 

SPI 3 Chip Select.

WICED_SPI_3_MOSI 

SPI 3 Master Out Slave In.

WICED_SPI_3_MISO 

SPI 3 Slave In Master Out.

WICED_SPI_3_INT 

SPI 3 INT.

WICED_SWDCK 

SWD Clock.

WICED_SWDIO 

SWD Data.

WICED_UART_1_TXD 

HCI UART TX.

WICED_UART_1_RXD 

HCI UART RX.

WICED_UART_1_CTS 

HCI UART CTS.

WICED_UART_1_RTS 

HCI UART RTS.

WICED_UART_2_TXD 

PUART TX.

WICED_UART_2_RXD 

PUART RX.

WICED_UART_2_CTS 

PUART CTS.

WICED_UART_2_RTS 

PUART RTS.

WICED_AOA_0 

AOA 0.

WICED_AOA_1 

AOA 1.

WICED_AOA_2 

AOA 2.

WICED_AOD_0 

AOD 0.

WICED_I2S_MASTER_CLK 

I2S Master Clock.

WICED_I2S_MASTER_WS 

I2S Master Word Select.

WICED_I2S_MASTER_DO 

I2S Master DATA OUT.

WICED_I2S_MASTER_DI 

I2S Master DATA IN.

WICED_I2S_SLAVE_CLK 

I2S Slave Clock.

WICED_I2S_SLAVE_WS 

I2S Slave Word Select.

WICED_I2S_SLAVE_DO 

I2S Slave DATA OUT.

WICED_I2S_SLAVE_DI 

I2S Slave DATA IN.

WICED_PCM_CLK 

PCM Clock.

WICED_PCM_SYNC 

PCM SYNC.

WICED_PCM_OUT 

PCM OUT.

WICED_PCM_IN 

PCM IN.

WICED_GCI_SECI_IN 

GCI.

WICED_GCI_SECI_OUT 

GCI.

WICED_ACLK_0 

ACLK_0 Clock.

WICED_ACLK_1 

ACLK_1 Clock.

WICED_KSO0 

Keyscan Output 00.

WICED_KSO1 

Keyscan Output 01.

WICED_KSO2 

Keyscan Output 02.

WICED_KSO3 

Keyscan Output 03.

WICED_KSO4 

Keyscan Output 04.

WICED_KSO5 

Keyscan Output 05.

WICED_KSO6 

Keyscan Output 06.

WICED_KSO7 

Keyscan Output 07.

WICED_KSO8 

Keyscan Output 08.

WICED_KSO9 

Keyscan Output 09.

WICED_KSO10 

Keyscan Output 10.

WICED_KSO11 

Keyscan Output 11.

WICED_KSO12 

Keyscan Output 12.

WICED_KSO13 

Keyscan Output 13.

WICED_KSO14 

Keyscan Output 14.

WICED_KSO15 

Keyscan Output 15.

WICED_KSO16 

Keyscan Output 16.

WICED_KSO17 

Keyscan Output 17.

WICED_KSO18 

Keyscan Output 18.

WICED_KSO19 

Keyscan Output 19.

WICED_TX_PD 

TX PD.

WICED_TX_PD_TILDA 

TX PD TILDA.

WICED_PA_RAMP 

PA Ramp.

WICED_BT_GPIO_00 

ARM GPIO 0.

WICED_BT_GPIO_01 

ARM GPIO 1.

WICED_BT_GPIO_02 

ARM GPIO 2.

WICED_BT_GPIO_03 

ARM GPIO 3.

WICED_BT_GPIO_04 

ARM GPIO 4.

WICED_BT_GPIO_05 

ARM GPIO 5.

WICED_BT_GPIO_06 

ARM GPIO 6.

WICED_BT_GPIO_07 

ARM GPIO 7.

WICED_PWM0 

PWM 0.

WICED_PWM1 

PWM 1.

WICED_PWM2 

PWM 2.

WICED_PWM3 

PWM 3.

WICED_PWM4 

PWM 4.

WICED_PWM5 

PWM 5.

WICED_TX_FSM 

TX FSM.

WICED_RX_FSM 

RX FSM.

WICED_RX_PU 

RX PU.

WICED_TX_PU 

TX PU.

WICED_UNAVAILABLE 

Invalid functionality for error check.

GPIO Numbers : last 8 are ARM GPIOs and rest are LHL GPIOs.

Enumerator
WICED_P00 

LHL GPIO 0.

WICED_P01 

LHL GPIO 1.

WICED_P02 

LHL GPIO 2.

WICED_P03 

LHL GPIO 3.

WICED_P04 

LHL GPIO 4.

WICED_P05 

LHL GPIO 5.

WICED_P06 

LHL GPIO 6.

WICED_P07 

LHL GPIO 7.

WICED_P08 

LHL GPIO 8.

WICED_P09 

LHL GPIO 9.

WICED_P10 

LHL GPIO 10.

WICED_P11 

LHL GPIO 11.

WICED_P12 

LHL GPIO 12.

WICED_P13 

LHL GPIO 13.

WICED_P14 

LHL GPIO 14.

WICED_P15 

LHL GPIO 15.

WICED_P16 

LHL GPIO 16.

WICED_P17 

LHL GPIO 17.

WICED_P18 

LHL GPIO 18.

WICED_P19 

LHL GPIO 19.

WICED_P20 

LHL GPIO 20.

WICED_P21 

LHL GPIO 21.

WICED_P22 

LHL GPIO 22.

WICED_P23 

LHL GPIO 23.

WICED_P24 

LHL GPIO 24.

WICED_P25 

LHL GPIO 25.

WICED_P26 

LHL GPIO 26.

WICED_P27 

LHL GPIO 27.

WICED_P28 

LHL GPIO 28.

WICED_P29 

LHL GPIO 29.

WICED_P30 

LHL GPIO 30.

WICED_P31 

LHL GPIO 31.

WICED_P32 

LHL GPIO 32.

WICED_P33 

LHL GPIO 33.

WICED_P34 

LHL GPIO 34.

WICED_P35 

LHL GPIO 35.

WICED_P36 

LHL GPIO 36.

WICED_P37 

LHL GPIO 37.

WICED_P38 

LHL GPIO 38.

WICED_P39 

LHL GPIO 39.

WICED_GPIO_00 

ARM GPIO 0 - 40.

WICED_GPIO_01 

ARM GPIO 1 - 41.

WICED_GPIO_02 

ARM GPIO 2 - 42.

WICED_GPIO_03 

ARM GPIO 3 - 43.

WICED_GPIO_04 

ARM GPIO 4 - 44.

WICED_GPIO_05 

ARM GPIO 5 - 45.

WICED_GPIO_06 

ARM GPIO 6 - 46.

WICED_GPIO_07 

ARM GPIO 7 - 47.

Function Documentation

uint32_t wiced_hal_gpio_clear_pin_interrupt_status ( uint32_t  pin)

Clear the interrupt status of a pin manually.

Parameters
[in]pinThe pin number from the schematic. Range [0-39] Ex: P<pin>
Returns
The interrupt status of the pin
  • 1 If clearing the interrupt was successful
  • 0xFF If the input parameter is out of range
void wiced_hal_gpio_configure_pin ( uint32_t  pin,
uint32_t  config,
uint32_t  outputVal 
)

Configures a GPIO pin.

For example, to enable interrupts for all edges, with a pull-down, you could use the config: GPIO_EDGE_TRIGGER | GPIO_EDGE_TRIGGER_BOTH | GPIO_INTERRUPT_ENABLE_MASK | GPIO_PULL_DOWN_MASK

Parameters
[in]pinThe pin number from the schematic. Range [0-39] Ex: P<pin>
[in]configGPIO configuration. See the parameters section
[in]outputValThe value of the output pin (tGPIO_PIN_OUTPUT_CONFIG)
Returns
None
Note
Note that the GPIO output value is programmed before the GPIO is configured. This ensures that the GPIO will activate with the correct external value. Also note that the output value is always written to the output register regardless of whether the GPIO is configured as input or output.
Enabling interrupts here isn't sufficient; you also need to register the interrupt handler with wiced_hal_gpio_register_pin_for_interrupt().
void wiced_hal_gpio_disable_all_inputs ( void  )

Configures all GPIOs except P26 to be INPUT DISABLED.

Parameters
none
Returns
none
uint16_t wiced_hal_gpio_get_pin_config ( uint32_t  pin)

Retrieve the current configuration of the specified pin.

Parameters
[in]pinThe pin number from the schematic. Range [0-39] Ex: P<pin>
Returns
Configuration of specified pin. See the parameters section
  • 0xFF if input parameter is invalid
Note
All input parameter values must be in range or the function will have no effect.
uint32_t wiced_hal_gpio_get_pin_input_status ( uint32_t  pin)

Read the current value at a pin.

Parameters
[in]pinThe pin number from the schematic. Range [0-39] Ex: P<pin>
Returns
The input value of the pin
  • 0 If the pin is low
  • 1 If the pin is high
  • 0xFF If the input parameter is out of range
Note
For this to be valid, the pin must be configured with input enabled.
uint32_t wiced_hal_gpio_get_pin_interrupt_status ( uint32_t  pin)

Get the interrupt status of a pin.

Parameters
[in]pinThe pin number from the schematic. Range [0-39] Ex: P<pin>
Returns
The interrupt status of the pin
  • 0 If an interrupt (programmed edge) was not detected at the pin
  • 1 If an interrupt (programmed edge) was detected at the pin
  • 0xFF If the input parameter is out of range
uint32_t wiced_hal_gpio_get_pin_output ( uint32_t  pin)

Get the programmed output value of a pin.

Parameters
[in]pinThe pin number from the schematic. Range [0-39] Ex: P<pin>
Returns
The programmed output value of the pin
  • 0 If the output port of the pin is set to 0
  • 1 If the output port of the pin is set to 0
  • 0xFF If the input parameter is out of range
Note
This does not return the current pin value. It returns the value that the pin would attempt to drive if it is configured as output.
void wiced_hal_gpio_init ( void  )

Initializes the GPIO driver and its private values.

Also programs all GPIOs to be ready for use. This must be invoked before accessing any GPIO driver services, typically at boot. This is independent of other drivers and must be one of the first to be initialized.

Parameters
none
Returns
none
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]pinThe pin number from the schematic. Range [0-39] Ex: P<pin>
[in]userfnPointer 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]userdataPointer 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);

wiced_bt_gpio_select_status_t wiced_hal_gpio_select_function ( wiced_bt_gpio_numbers_t  pin,
wiced_bt_gpio_function_t  function 
)

Configure a GPIO pin to have the chosen functionality.

Parameters
[in]pinThe pin number from the schematic. Range [0-39] Ex: P<pin>
[in]functionThe pin functionality; refer to wiced_bt_gpio_function_t for valid options
Returns
The result of selecting the pin function. Refer to wiced_bt_gpio_select_status_t for possible return states
void wiced_hal_gpio_set_pin_output ( uint32_t  pin,
uint32_t  val 
)

Sets the output value of a pin.

Parameters
[in]pinThe pin number from the schematic. Range [0-39] Ex: P<pin>
[in]valThe output value
  • 0 the pin will be set to 0
  • non-zero the pin will be set to 1
Returns
none
Note
The pin must already be configured as output or this will have no visible effect.
All input parameter values must be in range or the function will have no effect.
BOOL32 wiced_hal_gpio_slimboot_reenforce_cfg ( uint8_t  pin,
uint16_t  config 
)

Save the LHL GPIO configuration in AON memeory to reenforce in slimboot This is a must if we want to wake up in SDS by external LHL GPIO interrupts.

Parameters
[in]pinThe pin number from the schematic. Range [0-39] Ex: P<pin>
[in]configGpio configuration.
Returns
TRUE - successful save/update; FALSE - run out of entries, not able to save or invalid pin
void wiced_hal_unassign_gpio_function ( uint32_t  pin,
uint32_t  function 
)

Unassign a GPIO pin functionality.

Parameters
[in]pinThe pin number from the schematic. Range [0-39] Ex: P<pin>
[in]functionThe pin functionality to remove; refer to wiced_bt_gpio_function_t for valid options
Returns
none