diff options
author | Josh Rahm <joshuarahm@gmail.com> | 2021-10-26 00:10:06 -0600 |
---|---|---|
committer | Josh Rahm <joshuarahm@gmail.com> | 2021-10-26 00:10:06 -0600 |
commit | f9b12f748b557994b958115c04fd1591b322248e (patch) | |
tree | 7d80680edadf5b0018944966af64f8773bfa8f1a /include/kern/exti | |
parent | dbbe83bd8882fe18e26f6305a1f425145bfea8db (diff) | |
parent | 90eb3a0b79bfef67c70dc545b49c48928eea05f4 (diff) | |
download | stm32l4-f9b12f748b557994b958115c04fd1591b322248e.tar.gz stm32l4-f9b12f748b557994b958115c04fd1591b322248e.tar.bz2 stm32l4-f9b12f748b557994b958115c04fd1591b322248e.zip |
Merge branch 'christmas' into HEAD
Diffstat (limited to 'include/kern/exti')
-rw-r--r-- | include/kern/exti/exti_manager.h | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/include/kern/exti/exti_manager.h b/include/kern/exti/exti_manager.h new file mode 100644 index 0000000..aa39b4f --- /dev/null +++ b/include/kern/exti/exti_manager.h @@ -0,0 +1,32 @@ +#ifndef _KERN_EXTI_EXTI_MANAGER_H_ +#define _KERN_EXTI_EXTI_MANAGER_H_ + +#include "kern/common.h" +#include "kern/gpio/gpio_manager.h" +#include "shared/linked_list.h" + +#define EXTI_ERROR_ALREADY_IN_USE 1 + +struct EXTI_HANDLE; + + +typedef struct { + void (*fn)(struct EXTI_HANDLE, void*); + void* closure; +} exti_callback_t; + +LINKED_LIST_DECL(exti_callback_t); +typedef struct EXTI_HANDLE { + uint8_t id; + linked_list_t(exti_callback_t)* callbacks; +} exti_handle_t; + +exti_handle_t* enable_exti_for_gpio(gpio_pin_t gpio_pin, int* ec); + +exti_handle_t* exti_add_callback(exti_handle_t*, exti_callback_t* callback); + +gpio_pin_t exti_gpio_pin(exti_handle_t* handle); + + + +#endif /* _KERN_EXTI_EXTI_MANAGER_H_ */ |