aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorWill Puckett <willpuckett@gmail.com>2023-12-05 14:44:51 -0800
committerGitHub <noreply@github.com>2023-12-05 17:44:51 -0500
commitfc102edc242a7c5e9b8c6415f447bf1a6a022ea7 (patch)
tree6623844363ecb5cf922f750c560cf12762762a25 /src
parent05d5451347e665e211662009837ee861a62dc372 (diff)
downloadkutter-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')
-rw-r--r--src/stm32/Kconfig2
-rw-r--r--src/stm32/hard_pwm.c65
2 files changed, 65 insertions, 2 deletions
diff --git a/src/stm32/Kconfig b/src/stm32/Kconfig
index 7f50ea3c..c06bb6ff 100644
--- a/src/stm32/Kconfig
+++ b/src/stm32/Kconfig
@@ -10,7 +10,7 @@ config STM32_SELECT
select HAVE_GPIO_I2C if !MACH_STM32F031
select HAVE_GPIO_SPI if !MACH_STM32F031
select HAVE_GPIO_SDIO if MACH_STM32F4
- select HAVE_GPIO_HARD_PWM if MACH_STM32F1 || MACH_STM32F4 || MACH_STM32F7 || MACH_STM32G0 || MACH_STM32H7
+ select HAVE_GPIO_HARD_PWM if MACH_STM32F070 || MACH_STM32F072 || MACH_STM32F1 || MACH_STM32F4 || MACH_STM32F7 || MACH_STM32G0 || MACH_STM32H7
select HAVE_STRICT_TIMING
select HAVE_CHIPID
select HAVE_STEPPER_BOTH_EDGE
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)},