49 #define LOG_MODULE "GPIO HAL" 50 #define LOG_LEVEL LOG_LEVEL_NONE 65 for(
this =
list_head(handlers);
this != NULL;
this = this->next) {
66 if(pins & this->pin_mask) {
67 if(this->handler != NULL) {
68 this->handler(pins & this->pin_mask);
81 #if GPIO_HAL_ARCH_SW_TOGGLE 86 if(pin >= GPIO_HAL_PIN_COUNT) {
87 LOG_ERR(
"Pin %u out of bounds\n", pin);
91 gpio_hal_arch_write_pin(pin, gpio_hal_arch_read_pin(pin) ^ 1);
Datatype for GPIO event handlers.
gpio_hal_pin_mask_t gpio_hal_arch_read_pins(gpio_hal_pin_mask_t pins)
Read multiple pins.
void gpio_hal_init()
Initialise the GPIO HAL.
void gpio_hal_event_handler(gpio_hal_pin_mask_t pins)
The platform-independent GPIO event handler.
void gpio_hal_register_handler(gpio_hal_event_handler_t *handler)
Register a function to be called whenever a pin triggers an event.
Linked list manipulation routines.
void * list_head(list_t list)
Get a pointer to the first element of a list.
void gpio_hal_arch_toggle_pin(gpio_hal_pin_t pin)
Toggle a GPIO pin.
void gpio_hal_arch_toggle_pins(gpio_hal_pin_mask_t pins)
Toggle multiple pins.
uint8_t gpio_hal_pin_t
GPIO pin number representation.
void list_add(list_t list, void *item)
Add an item at the end of a list.
uint32_t gpio_hal_pin_mask_t
GPIO pin mask representation.
void list_init(list_t list)
Initialize a list.
#define LIST(name)
Declare a linked list.
Header file for the GPIO HAL.
Header file for the logging system