ruuvi.drivers.c
${PROJECT_VERSION}
Drivers for external sensors and peripherals on embedded systems.
|
Go to the source code of this file.
Functions | |
rd_status_t | rt_button_init (const rt_button_init_t *const rt_init) |
Button initialization function. More... | |
rd_status_t | rt_button_uninit (const rt_button_init_t *const rt_init) |
Button uninitialization function. More... | |
Definition in file ruuvi_task_button.c.
rd_status_t rt_button_init | ( | const rt_button_init_t *const | rt_init | ) |
Button initialization function.
Requires GPIO and interrupts to be initialized. Configures GPIO as pullup/-down according to button active state.
[in] | rt_init | Initialization structure for button task. |
RD_SUCCESS | If buttons were initialized. |
RD_ERROR_NULL | If any array of rt_init is NULL or any element of p_button_pins or p_button_active is NULL. |
RD_ERROR_INVALID_STATE | if GPIO or GPIO interrupts aren't initialized. |
RD_ERROR_INVALID_PARAM | if the GPIOs arent useable, e.g. pin 48 on board with 32 GPIO pins or invalid active state. |
RD_ERROR_NOT_ENABLED | if the driver module is not enabled at compile time. |
Definition at line 113 of file ruuvi_task_button.c.
rd_status_t rt_button_uninit | ( | const rt_button_init_t *const | rt_init | ) |
Button uninitialization function.
After calling this function the given button pins are configured as High-Z and their interrupts are disabled.
RD_SUCCESS | |
RD_ERROR_NULL | If any array of rt_init is NULL or any element of p_button_pins NULL. |
Definition at line 118 of file ruuvi_task_button.c.