diff options
author | Will Puckett <willpuckett@gmail.com> | 2023-12-05 14:44:51 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-05 17:44:51 -0500 |
commit | fc102edc242a7c5e9b8c6415f447bf1a6a022ea7 (patch) | |
tree | 6623844363ecb5cf922f750c560cf12762762a25 /src/stm32/hard_pwm.c | |
parent | 05d5451347e665e211662009837ee861a62dc372 (diff) | |
download | kutter-fc102edc242a7c5e9b8c6415f447bf1a6a022ea7.tar.gz kutter-fc102edc242a7c5e9b8c6415f447bf1a6a022ea7.tar.xz kutter-fc102edc242a7c5e9b8c6415f447bf1a6a022ea7.zip |
hard_pwm: Add pin defs for STM32F070 and STM32F072 (#6409)
Define hard_pwm pins for STM32F070 and STM32F072, and update KConfig accordingly.
Signed-off-by: Will Puckett <willpuckett@gmail.com>
Diffstat (limited to 'src/stm32/hard_pwm.c')
-rw-r--r-- | src/stm32/hard_pwm.c | 65 |
1 files changed, 64 insertions, 1 deletions
diff --git a/src/stm32/hard_pwm.c b/src/stm32/hard_pwm.c index ad30051f..bbdd18b2 100644 --- a/src/stm32/hard_pwm.c +++ b/src/stm32/hard_pwm.c @@ -20,7 +20,70 @@ struct gpio_pwm_info { }; static const struct gpio_pwm_info pwm_regs[] = { -#if CONFIG_MACH_STM32F1 +#if CONFIG_MACH_STM32F0 + #if CONFIG_MACH_STM32F070 + {TIM15, GPIO('A', 2), 1, GPIO_FUNCTION(0)}, + {TIM15, GPIO('A', 3), 2, GPIO_FUNCTION(0)}, + {TIM14, GPIO('A', 4), 1, GPIO_FUNCTION(4)}, + {TIM3, GPIO('A', 6), 1, GPIO_FUNCTION(1)}, + {TIM3, GPIO('A', 7), 2, GPIO_FUNCTION(1)}, + {TIM1, GPIO('A', 8), 1, GPIO_FUNCTION(2)}, + {TIM1, GPIO('A', 9), 2, GPIO_FUNCTION(2)}, + {TIM1, GPIO('A', 10), 3, GPIO_FUNCTION(2)}, + {TIM1, GPIO('A', 11), 4, GPIO_FUNCTION(2)}, + {TIM3, GPIO('B', 0), 3, GPIO_FUNCTION(1)}, + {TIM3, GPIO('B', 1), 4, GPIO_FUNCTION(1)}, + {TIM3, GPIO('B', 4), 1, GPIO_FUNCTION(1)}, + {TIM3, GPIO('B', 5), 2, GPIO_FUNCTION(1)}, + {TIM16, GPIO('B', 8), 1, GPIO_FUNCTION(2)}, + {TIM17, GPIO('B', 9), 1, GPIO_FUNCTION(2)}, + {TIM15, GPIO('B', 14), 1, GPIO_FUNCTION(1)}, + {TIM15, GPIO('B', 15), 2, GPIO_FUNCTION(1)}, + {TIM3, GPIO('C', 6), 1, GPIO_FUNCTION(0)}, + {TIM3, GPIO('C', 7), 2, GPIO_FUNCTION(0)}, + {TIM3, GPIO('C', 8), 3, GPIO_FUNCTION(0)}, + {TIM3, GPIO('C', 9), 4, GPIO_FUNCTION(0)} + #endif + #if CONFIG_MACH_STM32F072 + {TIM2, GPIO('A', 1), 2, GPIO_FUNCTION(2)}, + {TIM2, GPIO('A', 2), 3, GPIO_FUNCTION(2)}, + {TIM2, GPIO('A', 3), 4, GPIO_FUNCTION(2)}, + {TIM14, GPIO('A', 4), 1, GPIO_FUNCTION(4)}, + {TIM3, GPIO('A', 6), 1, GPIO_FUNCTION(1)}, + {TIM3, GPIO('A', 7), 2, GPIO_FUNCTION(1)}, + {TIM1, GPIO('A', 8), 1, GPIO_FUNCTION(2)}, + {TIM1, GPIO('A', 9), 2, GPIO_FUNCTION(2)}, + {TIM1, GPIO('A', 10), 3, GPIO_FUNCTION(2)}, + {TIM1, GPIO('A', 11), 4, GPIO_FUNCTION(2)}, + {TIM3, GPIO('B', 0), 3, GPIO_FUNCTION(1)}, + {TIM3, GPIO('B', 1), 4, GPIO_FUNCTION(1)}, + {TIM2, GPIO('B', 3), 2, GPIO_FUNCTION(2)}, + {TIM3, GPIO('B', 4), 1, GPIO_FUNCTION(1)}, + {TIM3, GPIO('B', 5), 2, GPIO_FUNCTION(1)}, + {TIM16, GPIO('B', 8), 1, GPIO_FUNCTION(2)}, + {TIM17, GPIO('B', 9), 1, GPIO_FUNCTION(2)}, + {TIM2, GPIO('B', 10), 3, GPIO_FUNCTION(2)}, + {TIM2, GPIO('B', 11), 4, GPIO_FUNCTION(2)}, + {TIM15, GPIO('B', 14), 1, GPIO_FUNCTION(1)}, + {TIM15, GPIO('B', 15), 2, GPIO_FUNCTION(1)}, + {TIM3, GPIO('C', 6), 1, GPIO_FUNCTION(0)}, + {TIM3, GPIO('C', 7), 2, GPIO_FUNCTION(0)}, + {TIM3, GPIO('C', 8), 3, GPIO_FUNCTION(0)}, + {TIM3, GPIO('C', 9), 4, GPIO_FUNCTION(0)}, + {TIM16, GPIO('E', 0), 1, GPIO_FUNCTION(0)}, + {TIM17, GPIO('E', 1), 1, GPIO_FUNCTION(0)}, + {TIM3, GPIO('E', 3), 1, GPIO_FUNCTION(0)}, + {TIM3, GPIO('E', 4), 2, GPIO_FUNCTION(0)}, + {TIM3, GPIO('E', 5), 3, GPIO_FUNCTION(0)}, + {TIM3, GPIO('E', 6), 4, GPIO_FUNCTION(0)}, + {TIM1, GPIO('E', 9), 1, GPIO_FUNCTION(0)}, + {TIM1, GPIO('E', 11), 2, GPIO_FUNCTION(0)}, + {TIM1, GPIO('E', 13), 3, GPIO_FUNCTION(0)}, + {TIM1, GPIO('E', 14), 4, GPIO_FUNCTION(0)}, + {TIM15, GPIO('F', 9), 1, GPIO_FUNCTION(0)}, + {TIM15, GPIO('F', 10), 2, GPIO_FUNCTION(0)} + #endif +#elif CONFIG_MACH_STM32F1 {TIM2, GPIO('A', 0), 1, GPIO_FUNCTION(2)}, {TIM2, GPIO('A', 1), 2, GPIO_FUNCTION(2)}, {TIM2, GPIO('A', 2), 3, GPIO_FUNCTION(2)}, |