#include "legato.h"
Go to the source code of this file.
Typedefs | |
typedef struct le_gpio_ChangeEventHandler * | le_gpio_ChangeEventHandlerRef_t |
typedef void(* | le_gpio_ChangeCallbackFunc_t) (bool state, void *contextPtr) |
Enumerations | |
enum | le_gpio_Polarity_t { LE_GPIO_ACTIVE_HIGH, LE_GPIO_ACTIVE_LOW } |
enum | le_gpio_Edge_t { LE_GPIO_EDGE_NONE, LE_GPIO_EDGE_RISING, LE_GPIO_EDGE_FALLING, LE_GPIO_EDGE_BOTH } |
Functions | |
void | le_gpio_ConnectService (void) |
void | le_gpio_DisconnectService (void) |
le_result_t | le_gpio_SetInput (le_gpio_Polarity_t polarity) |
le_result_t | le_gpio_SetPushPullOutput (le_gpio_Polarity_t polarity, bool value) |
le_result_t | le_gpio_SetTriStateOutput (le_gpio_Polarity_t polarity) |
le_result_t | le_gpio_SetOpenDrainOutput (le_gpio_Polarity_t polarity, bool value) |
le_result_t | le_gpio_EnablePullUp (void) |
le_result_t | le_gpio_EnablePullDown (void) |
le_result_t | le_gpio_DisableResistors (void) |
le_result_t | le_gpio_Activate (void) |
le_result_t | le_gpio_Deactivate (void) |
le_result_t | le_gpio_SetHighZ (void) |
bool | le_gpio_Read (void) |
le_gpio_ChangeEventHandlerRef_t | le_gpio_AddChangeEventHandler (le_gpio_Edge_t trigger, le_gpio_ChangeCallbackFunc_t handlerPtr, void *contextPtr, int32_t sampleMs) |
void | le_gpio_RemoveChangeEventHandler (le_gpio_ChangeEventHandlerRef_t addHandlerRef) |
Legato GPIO include file.
Copyright (C) Sierra Wireless Inc. Use of this work is subject to license.
typedef void(* le_gpio_ChangeCallbackFunc_t) (bool state, void *contextPtr) |
State change event handler (callback).
state | New state of pin (true = active, false = inactive). |
contextPtr |
typedef struct le_gpio_ChangeEventHandler* le_gpio_ChangeEventHandlerRef_t |
Reference type used by Add/Remove functions for EVENT 'le_gpio_ChangeEvent'
enum le_gpio_Edge_t |
enum le_gpio_Polarity_t |
le_result_t le_gpio_Activate | ( | void | ) |
Set output pin to active state.
le_gpio_ChangeEventHandlerRef_t le_gpio_AddChangeEventHandler | ( | le_gpio_Edge_t | trigger, |
le_gpio_ChangeCallbackFunc_t | handlerPtr, | ||
void * | contextPtr, | ||
int32_t | sampleMs | ||
) |
Add handler function for EVENT 'le_gpio_ChangeEvent'
Register a callback function to be called when an input pin changes state.
If the pin is not capable of interrupt-driven operation, then it will be sampled every sampleMs milliseconds. Otherwise, sampleMs will be ignored.
[in] | trigger | Change(s) that should trigger the callback to be called. |
[in] | handlerPtr | |
[in] | contextPtr | |
[in] | sampleMs | If not interrupt capable, sample the input this often (ms). |
void le_gpio_ConnectService | ( | void | ) |
Connect the client to the service
le_result_t le_gpio_Deactivate | ( | void | ) |
Set output pin to inactive state.
le_result_t le_gpio_DisableResistors | ( | void | ) |
Disable the pull-up and pull-down resistors. Does nothing if both are already disabled.
void le_gpio_DisconnectService | ( | void | ) |
Disconnect the client from the service
le_result_t le_gpio_EnablePullDown | ( | void | ) |
Enable the pull-down resistor (disables pull-up if previously enabled).
le_result_t le_gpio_EnablePullUp | ( | void | ) |
Enable the pull-up resistor (disables pull-down if previously enabled).
bool le_gpio_Read | ( | void | ) |
Read value of GPIO input pin.
void le_gpio_RemoveChangeEventHandler | ( | le_gpio_ChangeEventHandlerRef_t | addHandlerRef | ) |
Remove handler function for EVENT 'le_gpio_ChangeEvent'
[in] | addHandlerRef |
le_result_t le_gpio_SetHighZ | ( | void | ) |
Set output pin to high impedance state.
le_result_t le_gpio_SetInput | ( | le_gpio_Polarity_t | polarity | ) |
Configure the pin as an input pin.
[in] | polarity | Active-high or active-low. |
le_result_t le_gpio_SetOpenDrainOutput | ( | le_gpio_Polarity_t | polarity, |
bool | value | ||
) |
Configure the pin as an open-drain output pin. "High" is a high-impedance state, while "Low" pulls the pin to ground.
[in] | polarity | Active-high or active-low. |
[in] | value | Initial value to drive (true = active, false = inactive) |
le_result_t le_gpio_SetPushPullOutput | ( | le_gpio_Polarity_t | polarity, |
bool | value | ||
) |
Configure the pin as a push-pull output pin.
[in] | polarity | Active-high or active-low. |
[in] | value | Initial value to drive (true = active, false = inactive) |
le_result_t le_gpio_SetTriStateOutput | ( | le_gpio_Polarity_t | polarity | ) |
Configure the pin as a tri-state output pin.
[in] | polarity | Active-high or active-low. |