Skip to content

Commit 31e89b2

Browse files
Mani-SadhasivamMaureenHelm
authored andcommitted
boards: arm: 96b_stm32_sensor_mez: Enable on-board PWM
Enable PWM channels exposed on 96b_stm32_sensor_mez board via Arduino connector. Signed-off-by: Manivannan Sadhasivam <[email protected]>
1 parent 3807c9a commit 31e89b2

File tree

4 files changed

+63
-0
lines changed

4 files changed

+63
-0
lines changed

boards/arm/96b_stm32_sensor_mez/96b_stm32_sensor_mez.dts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,30 @@
8686
status = "ok";
8787
};
8888

89+
&timers3 {
90+
status = "ok";
91+
92+
pwm {
93+
status = "ok";
94+
};
95+
};
96+
97+
&timers4 {
98+
status = "ok";
99+
100+
pwm {
101+
status = "ok";
102+
};
103+
};
104+
105+
&timers9 {
106+
status = "ok";
107+
108+
pwm {
109+
status = "ok";
110+
};
111+
};
112+
89113
&usart1 {
90114
current-speed = <115200>;
91115
pinctrl-0 = <&usart1_pins_b>;

boards/arm/96b_stm32_sensor_mez/Kconfig.defconfig

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,17 @@ config SPI_STM32_INTERRUPT
4343

4444
endif # SPI
4545

46+
if PWM
47+
48+
config PWM_STM32_3
49+
default y
50+
51+
config PWM_STM32_4
52+
default y
53+
54+
config PWM_STM32_9
55+
default y
56+
57+
endif # PWM
58+
4659
endif # BOARD_96B_STM32_SENSOR_MEZ

boards/arm/96b_stm32_sensor_mez/doc/96b_stm32_sensor_mez.rst

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ hardware features:
7171
+-----------+------------+-------------------------------------+
7272
| I2C | on-chip | i2c |
7373
+-----------+------------+-------------------------------------+
74+
| PWM | on-chip | pwm |
75+
+-----------+------------+-------------------------------------+
7476

7577
The default board configuration can be found in the defconfig file:
7678

@@ -135,6 +137,18 @@ the LSM6DS3H sensor. The default SPI mapping is:
135137
- SPI2_MISO : PB14
136138
- SPI2_MOSI : PB15
137139

140+
PWM
141+
---
142+
96Boards STM32 Sensor Mezzanine board exposes 6 PWM channels on the Arduino
143+
connector. The default PWM mapping is:
144+
145+
- PWM3_CH1 : PB4 : D9
146+
- PWM3_CH3 : PC8 : D3
147+
- PWM4_CH3 : PD14 : D6
148+
- PWM4_CH4 : PD15 : D5
149+
- PWM9_CH1 : PE5 : D12
150+
- PWM9_CH2 : PE6 : D11
151+
138152
Programming and Debugging
139153
*************************
140154

boards/arm/96b_stm32_sensor_mez/pinmux.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,18 @@ static const struct pin_config pinconf[] = {
5959
STM32_OSPEEDR_VERY_HIGH_SPEED},
6060
{STM32_PIN_PC1, STM32F4_PINMUX_FUNC_PC1_I2S2_SD},
6161
#endif /* CONFIG_I2S_2 */
62+
#ifdef CONFIG_PWM_STM32_3
63+
{ STM32_PIN_PB4, STM32F4_PINMUX_FUNC_PB4_PWM3_CH1 },
64+
{ STM32_PIN_PC8, STM32F4_PINMUX_FUNC_PC8_PWM3_CH3 },
65+
#endif /* CONFIG_PWM_STM32_3 */
66+
#ifdef CONFIG_PWM_STM32_4
67+
{ STM32_PIN_PD14, STM32F4_PINMUX_FUNC_PD14_PWM4_CH3 },
68+
{ STM32_PIN_PD15, STM32F4_PINMUX_FUNC_PD15_PWM4_CH4 },
69+
#endif /* CONFIG_PWM_STM32_4 */
70+
#ifdef CONFIG_PWM_STM32_9
71+
{ STM32_PIN_PE5, STM32F4_PINMUX_FUNC_PE5_PWM9_CH1 },
72+
{ STM32_PIN_PE6, STM32F4_PINMUX_FUNC_PE6_PWM9_CH2 },
73+
#endif /* CONFIG_PWM_STM32_9 */
6274
};
6375

6476
static int pinmux_stm32_init(struct device *port)

0 commit comments

Comments
 (0)