ruuvi.drivers.c  ${PROJECT_VERSION}
Drivers for external sensors and peripherals on embedded systems.
ruuvi_task_gpio.c
Go to the documentation of this file.
2 #if RT_GPIO_ENABLED
3 #include "ruuvi_task_gpio.h"
4 #include "ruuvi_interface_gpio.h"
6 
8  = {0};
9 
11 {
12  rd_status_t err_code = RD_SUCCESS;
13 
14  if (!rt_gpio_is_init())
15  {
16  err_code |= ri_gpio_init();
17  err_code |= ri_gpio_interrupt_init (interrupt_table, sizeof (interrupt_table));
18  }
19 
20  return err_code;
21 }
22 
23 bool rt_gpio_is_init()
24 {
26 }
27 #endif
uint32_t rd_status_t
bitfield for representing errors
#define RD_SUCCESS
Internal Error.
bool ri_gpio_is_init(void)
return true if GPIO is init, false otherwise.
rd_status_t ri_gpio_interrupt_init(ri_gpio_interrupt_fp_t *const interrupt_table, const uint16_t max_interrupts)
Initialize interrupt functionality to GPIO. Takes address of interrupt table as a pointer to avoid ty...
void(* ri_gpio_interrupt_fp_t)(const ri_gpio_evt_t)
rd_status_t ri_gpio_init(void)
Initializes GPIO module. Call this before other GPIO functions. After initialization all GPIO pins sh...
bool ri_gpio_interrupt_is_init(void)
Check if interrupt module is initialized.
Header to enable and disable module compilation.
#define RT_GPIO_INT_TABLE_SIZE
Conserve RAM for led task variables.
bool rt_gpio_is_init(void)
check that GPIO is initialized.
rd_status_t rt_gpio_init(void)
initialise GPIO. Pins are in high-Z state by default.