diff options
author | Michael Kurz <michi.kurz@gmail.com> | 2021-03-25 20:39:53 +0100 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2021-03-26 12:04:51 -0400 |
commit | 59c4c498938f2c85c735034ed8f7b188725f07c9 (patch) | |
tree | 2f164d8a1ed33e75028158058dc3d9b1f3a9d0ca /src/stm32/gpio.h | |
parent | 39188e1cf3f84a8bbf039be4b327a032f551d3bd (diff) | |
download | kutter-59c4c498938f2c85c735034ed8f7b188725f07c9.tar.gz kutter-59c4c498938f2c85c735034ed8f7b188725f07c9.tar.xz kutter-59c4c498938f2c85c735034ed8f7b188725f07c9.zip |
stm32: Add hardware PWM support for STM32F1
This adds hardware PWM support for STM32F1 processors.
This should also work for STM32 F0/F2/F4 processors, but I
don't have one of those to test it.
Signed-off-by: Michael Kurz <michi.kurz@gmail.com>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'src/stm32/gpio.h')
-rw-r--r-- | src/stm32/gpio.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/stm32/gpio.h b/src/stm32/gpio.h index 13ab74bd..281e3a8d 100644 --- a/src/stm32/gpio.h +++ b/src/stm32/gpio.h @@ -21,6 +21,12 @@ struct gpio_in gpio_in_setup(uint32_t pin, int32_t pull_up); void gpio_in_reset(struct gpio_in g, int32_t pull_up); uint8_t gpio_in_read(struct gpio_in g); +struct gpio_pwm { + void *reg; +}; +struct gpio_pwm gpio_pwm_setup(uint8_t pin, uint32_t cycle_time, uint8_t val); +void gpio_pwm_write(struct gpio_pwm g, uint32_t val); + struct gpio_adc { void *adc; uint32_t chan; |