diff options
author | Josh Rahm <joshuarahm@gmail.com> | 2025-09-30 13:06:16 -0600 |
---|---|---|
committer | Josh Rahm <joshuarahm@gmail.com> | 2025-09-30 13:06:16 -0600 |
commit | 290d784950b6248782b049cd9831bd6e034fd538 (patch) | |
tree | c231c02e92ed83a02b234a85b3c07bcc5e44b168 /include/gpio.h | |
parent | f89f75b5616de99865448f41b068a2783cd3648e (diff) | |
download | ch573-main.tar.gz ch573-main.tar.bz2 ch573-main.zip |
Add many different patterns, and organize it.
Add a voltage discovery subsystem to allow the ch573 to detect if it's
on 12v or 5v lights.
Diffstat (limited to 'include/gpio.h')
-rw-r--r-- | include/gpio.h | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/include/gpio.h b/include/gpio.h index ab793f1..99b6e5f 100644 --- a/include/gpio.h +++ b/include/gpio.h @@ -66,23 +66,25 @@ typedef enum { typedef void (*gpio_callback_t)(gpio_pin_t pin); #define On_Gpio(arg) \ - static void __local_on_gpio__(gpio_pin_t pin); \ + static void __local_on_gpio__(gpio_pin_t pin); \ __attribute__((__section__( \ ".gpio_callbacks"))) static volatile gpio_callback_t __gpio__position = \ __local_on_gpio__; \ static void __local_on_gpio__(arg) +void gpio_init(); + /** Configure the given gpio pin for .*/ -void configure_gpio(gpio_pin_t pin, gpio_config_t); +void gpio_configure_pin(gpio_pin_t pin, gpio_config_t); /** Read the input value of the gpio. */ -int read_gpio(gpio_pin_t pin); +int gpio_read(gpio_pin_t pin); /** Sets the gpio pin. */ -void set_gpio(gpio_pin_t pin, int high); +void gpio_set(gpio_pin_t pin, int high); /** Set or unset the peripheral to the alternate set of pins. */ -void enable_alternate_funciton(alternate_function_t af, int enable); +void gpio_enable_alternate_function(alternate_function_t af, int enable); /** Enables the interrupt for a with the provided interrupt mode. */ -void enable_gpio_interrupt(gpio_pin_t pin, interrupt_mode_t int_mode); +void gpio_enable_interrupt(gpio_pin_t pin, interrupt_mode_t int_mode); |