|
FreeRTOS:
Common I/O
AWS IoT Common I/O library
|
| Return to main page ↑ |
Macros | |
| #define | IOT_GPIO_SUCCESS ( 0 ) |
| Error codes. More... | |
| #define | IOT_GPIO_INVALID_VALUE ( 1 ) |
| #define | IOT_GPIO_READ_FAILED ( 2 ) |
| #define | IOT_GPIO_WRITE_FAILED ( 3 ) |
| #define | IOT_GPIO_FUNCTION_NOT_SUPPORTED ( 4 ) |
Typedefs | |
| typedef struct IotGpioDescriptor * | IotGpioHandle_t |
| IotGpioHandle_t type is the GPIO handle returned by calling iot_gpio_open() this is initialized in open and returned to caller. Caller must pass this pointer to the rest of the APIs. | |
| typedef void(* | IotGpioCallback_t) (uint8_t ucPinState, void *pvUserContext) |
| GPIO interrupt callback type. This callback is passed to the driver by using iot_gpio_set_callback API. More... | |
Enumerations | |
| enum | IotGpioDirection_t { eGpioDirectionInput, eGpioDirectionOutput } |
| enum for configuring GPIO input/output direction. More... | |
| enum | IotGpioOutputMode_t { eGpioOpenDrain, eGpioPushPull } |
| enum for configuring GPIO output type. More... | |
| enum | IotGpioPull_t { eGpioPullNone, eGpioPullUp, eGpioPullDown } |
| GPIO pin internal pull state. Sets the default state for output pins. More... | |
| enum | IotGpioInterrupt_t { eGpioInterruptNone, eGpioInterruptRising, eGpioInterruptFalling, eGpioInterruptEdge, eGpioInterruptLow, eGpioInterruptHigh } |
| GPIO pin interrupt config types. More... | |
| enum | IotGpioIoctlRequest_t { eSetGpioFunction, eSetGpioDirection, eSetGpioPull, eSetGpioOutputMode, eSetGpioInterrupt, eSetGpioSpeed, eSetGpioDriveStrength, eGetGpioFunction, eGetGpioDirection, eGetGpioPull, eGetGpioOutputType, eGetGpioInterrupt, eGetGpioSpeed, eGetGpioDriveStrength } |
| Ioctl request types. More... | |
Functions | |
| IotGpioHandle_t | iot_gpio_open (int32_t lGpioNumber) |
| iot_gpio_open is used to open the GPIO handle. The application must call this function to open desired GPIO and use other functions. More... | |
| void | iot_gpio_set_callback (IotGpioHandle_t const pxGpio, IotGpioCallback_t xGpioCallback, void *pvUserContext) |
| iot_gpio_set_callback is used to set the callback to be called when an interrupt is tirggered. More... | |
| int32_t | iot_gpio_read_sync (IotGpioHandle_t const pxGpio, uint8_t *pucPinState) |
| iot_gpio_read_sync is used to read data from GPIO pin in blocking mode. More... | |
| int32_t | iot_gpio_write_sync (IotGpioHandle_t const pxGpio, uint8_t ucPinState) |
| iot_gpio_write_sync is used to write data into the GPIO pin in blocking mode. More... | |
| int32_t | iot_gpio_close (IotGpioHandle_t const pxGpio) |
| iot_gpio_close is used to deinitializes the GPIO pin to default value and close the handle. The application should call this function to reset and deinitialize the GPIO pin. More... | |
| int32_t | iot_gpio_ioctl (IotGpioHandle_t const pxGpio, IotGpioIoctlRequest_t xRequest, void *const pvBuffer) |
| iot_gpio_ioctl is used to configure GPIO pin options. The application should call this function to configure various GPIO pin options: pin function, I/O direction, pin internal pull mode, drive strength, slew rate etc More... | |
| #define IOT_GPIO_SUCCESS ( 0 ) |
Error codes.
GPIO operation completed succesfully.
| #define IOT_GPIO_INVALID_VALUE ( 1 ) |
At least one parameter is invalid.
| #define IOT_GPIO_READ_FAILED ( 2 ) |
GPIO read operation failed.
| #define IOT_GPIO_WRITE_FAILED ( 3 ) |
GPIO write operation failed.
| #define IOT_GPIO_FUNCTION_NOT_SUPPORTED ( 4 ) |
GPIO operation not supported.
| typedef void( * IotGpioCallback_t) (uint8_t ucPinState, void *pvUserContext) |
GPIO interrupt callback type. This callback is passed to the driver by using iot_gpio_set_callback API.
| [out] | ucPinState | The variable which has state of the GPIO pin. |
| [in] | pvUserContext | User Context passed when setting the callback. This is not used by the driver, but just passed back to the user in the callback. |
| enum IotGpioDirection_t |
| enum IotGpioOutputMode_t |
| enum IotGpioPull_t |
| enum IotGpioInterrupt_t |
GPIO pin interrupt config types.
Ioctl request types.
| IotGpioHandle_t iot_gpio_open | ( | int32_t | lGpioNumber | ) |
iot_gpio_open is used to open the GPIO handle. The application must call this function to open desired GPIO and use other functions.
| [in] | lGpioNumber | The logical GPIO number to open. It depends on the implementation to map logical GPIO number to physical GPIO port and pin. |
| void iot_gpio_set_callback | ( | IotGpioHandle_t const | pxGpio, |
| IotGpioCallback_t | xGpioCallback, | ||
| void * | pvUserContext | ||
| ) |
iot_gpio_set_callback is used to set the callback to be called when an interrupt is tirggered.
| [in] | pxGpio | The GPIO handle returned in the open() call. |
| [in] | xGpioCallback | The callback function to be called on interrupt. |
| [in] | pvUserContext | The user context to be passed back when callback is called. |
| int32_t iot_gpio_read_sync | ( | IotGpioHandle_t const | pxGpio, |
| uint8_t * | pucPinState | ||
| ) |
iot_gpio_read_sync is used to read data from GPIO pin in blocking mode.
| [in] | pxGpio | The GPIO handle returned in the open() call. |
| [out] | pucPinState | The variable which reads state of the GPIO pin. |
| int32_t iot_gpio_write_sync | ( | IotGpioHandle_t const | pxGpio, |
| uint8_t | ucPinState | ||
| ) |
iot_gpio_write_sync is used to write data into the GPIO pin in blocking mode.
| [in] | pxGpio | The GPIO handle returned in the open() call. |
| [in] | ucState | The value to write into the GPIO pin. |
| int32_t iot_gpio_close | ( | IotGpioHandle_t const | pxGpio | ) |
iot_gpio_close is used to deinitializes the GPIO pin to default value and close the handle. The application should call this function to reset and deinitialize the GPIO pin.
| [in] | pxGpio | The GPIO handle returned in the open() call. |
| int32_t iot_gpio_ioctl | ( | IotGpioHandle_t const | pxGpio, |
| IotGpioIoctlRequest_t | xRequest, | ||
| void *const | pvBuffer | ||
| ) |
iot_gpio_ioctl is used to configure GPIO pin options. The application should call this function to configure various GPIO pin options: pin function, I/O direction, pin internal pull mode, drive strength, slew rate etc
| [in] | pxGpio | The GPIO handle returned in the open() call. |
| [in] | xRequest | One of IotGpioIoctlRequest_t enum |
| [in/out] | pvBuffer Buffer holding GPIO set or get values. |