5.11.0.0R3
Software Development Kit
 
Loading...
Searching...
No Matches

Functions

wiced_result_t wiced_gpio_deepsleep_wakeup_enable (wiced_gpio_t gpio, wiced_gpio_irq_trigger_t trigger)
 
wiced_result_t wiced_gpio_deinit (wiced_gpio_t gpio)
 
wiced_result_t wiced_gpio_init (wiced_gpio_t gpio, wiced_gpio_config_t configuration)
 
wiced_bool_t wiced_gpio_input_get (wiced_gpio_t gpio)
 
wiced_result_t wiced_gpio_input_get_bool (wiced_gpio_t gpio, wiced_bool_t *value)
 
wiced_result_t wiced_gpio_input_irq_disable (wiced_gpio_t gpio)
 
wiced_result_t wiced_gpio_input_irq_enable (wiced_gpio_t gpio, wiced_gpio_irq_trigger_t trigger, wiced_gpio_irq_handler_t handler, void *arg)
 
wiced_result_t wiced_gpio_output_high (wiced_gpio_t gpio)
 
wiced_result_t wiced_gpio_output_low (wiced_gpio_t gpio)
 
wiced_result_t wiced_led_set_state (wiced_led_index_t led_index, wiced_led_state_t off_on)
 

Detailed Description

General Purpose Input/Output pin (GPIO) Functions

The WICED GPIO functions can be divided into the following categories

 // Initialization/De-Initialization functions
 wiced_gpio_init();
 wiced_gpio_deinit();

 // GPIO I/O functions
 wiced_gpio_output_high()
 wiced_gpio_output_low()
 wiced_gpio_input_get()

 // Manage interrupt from GPIO pins
 wiced_gpio_input_irq_enable()
 wiced_gpio_input_irq_disable()

wiced_gpio_t : Refers to the GPIO Pin, for details refer to <WICED_SDK>/platforms/<platform_name>/platform.h <WICED_SDK>/platforms/<platform_name>/platform.c

wiced_gpio_config_t : GPIO configuration, refer to : <WICED_SDK>/platform/include/platform_peripheral.h : platform_pin_config_t

Function Documentation

◆ wiced_gpio_deepsleep_wakeup_enable()

wiced_result_t wiced_gpio_deepsleep_wakeup_enable ( wiced_gpio_t gpio,
wiced_gpio_irq_trigger_t trigger )

Enables an input GPIO pin to wakeup from Deep-Sleep

Parameters
[in]gpio: The gpio pin which will provide the interrupt trigger
[in]trigger: The type of trigger (rising/falling edge, high/low level) interrupt handler
Returns
WICED_SUCCESS : on success.
WICED_ERROR : if an error occurred with any step

◆ wiced_gpio_deinit()

wiced_result_t wiced_gpio_deinit ( wiced_gpio_t gpio)

De-initializes a GPIO pin

Clears a GPIO pin from use.

Parameters
[in]gpio: The gpio pin which should be de-initialized
Returns
WICED_SUCCESS : on success.
WICED_ERROR : if an error occurred with any step

◆ wiced_gpio_init()

wiced_result_t wiced_gpio_init ( wiced_gpio_t gpio,
wiced_gpio_config_t configuration )

Initializes a GPIO pin

Prepares a GPIO pin for use.

Parameters
[in]gpio: The gpio pin which should be initialized
[in]configuration: A structure containing the required gpio configuration
Returns
WICED_SUCCESS : on success.
WICED_ERROR : if an error occurred with any step

◆ wiced_gpio_input_get()

wiced_bool_t wiced_gpio_input_get ( wiced_gpio_t gpio)

Get the state of an input GPIO pin

Get the state of an input GPIO pin. Using this function on a gpio pin which is set to output mode will return an undefined value.

NOTE: Use wiced_gpio_input_get_bool() to get error information

Parameters
[in]gpio: The gpio pin which should be read
Returns
WICED_TRUE : if high
WICED_FALSE : if low

◆ wiced_gpio_input_get_bool()

wiced_result_t wiced_gpio_input_get_bool ( wiced_gpio_t gpio,
wiced_bool_t * value )

Get the boolean state of an input GPIO pin with error reporting

Get the state of an input GPIO pin. Using this function on a gpio pin which is set to output mode will return an undefined value.

Parameters
[in]gpio: The gpio pin which should be read
[out]value: pointer to store gpio value of WICED_TRUE or WICED_FALSE (only valid when result is WICED_SUCCESS)
Returns
wiced_result_t WICED_SUCCESS
wiced_result_t error WICED_UNINITIALISED WICED_UNSUPPORTED

◆ wiced_gpio_input_irq_disable()

wiced_result_t wiced_gpio_input_irq_disable ( wiced_gpio_t gpio)

Disables an interrupt trigger for an input GPIO pin

Disables an interrupt trigger for an input GPIO pin. Using this function on a gpio pin which has not been set up using wiced_gpio_input_irq_enable is undefined.

Parameters
[in]gpio: The gpio pin which provided the interrupt trigger
Returns
WICED_SUCCESS : on success.
WICED_ERROR : if an error occurred with any step

◆ wiced_gpio_input_irq_enable()

wiced_result_t wiced_gpio_input_irq_enable ( wiced_gpio_t gpio,
wiced_gpio_irq_trigger_t trigger,
wiced_gpio_irq_handler_t handler,
void * arg )

Enables an interrupt trigger for an input GPIO pin

Enables an interrupt trigger for an input GPIO pin. Using this function on an uninitialized gpio pin or a gpio pin which is set to output mode is undefined.

Parameters
[in]gpio: The gpio pin which will provide the interrupt trigger
[in]trigger: The type of trigger (rising/falling edge, high/low level)
[in]handler: A function pointer to the interrupt handler
[in]arg: An argument that will be passed to the interrupt handler
Returns
WICED_SUCCESS : on success.
WICED_ERROR : if an error occurred with any step

◆ wiced_gpio_output_high()

wiced_result_t wiced_gpio_output_high ( wiced_gpio_t gpio)

Sets an output GPIO pin high

Sets an output GPIO pin high. Using this function on a gpio pin which is set to input mode is undefined.

Parameters
[in]gpio: The gpio pin which should be set high
Returns
WICED_SUCCESS : on success.
WICED_ERROR : if an error occurred with any step

◆ wiced_gpio_output_low()

wiced_result_t wiced_gpio_output_low ( wiced_gpio_t gpio)

Sets an output GPIO pin low

Sets an output GPIO pin low. Using this function on a gpio pin which is set to input mode is undefined.

Parameters
[in]gpio: The gpio pin which should be set low
Returns
WICED_SUCCESS : on success.
WICED_ERROR : if an error occurred with any step

◆ wiced_led_set_state()

wiced_result_t wiced_led_set_state ( wiced_led_index_t led_index,
wiced_led_state_t off_on )

Set status of an LED (Off or On)

NOTES: LED initialization is done in platform_init_external_devices() in each platform.c file Platform code knows the polarity of the LEDs and sets the output high/low as appropriate. If there are no LEDs on a platform, provide a dummy function in platform.c.

Parameters
[in]led_index: wiced_led_t LED
[in]off_on: WICED_LED_OFF or WICED_LED_ON
Returns
WICED_SUCCESS WICED_BADARG