Skip to content

Commit 6cc89ef

Browse files
committed
[DISCO_F429ZI] added a description why there are commented pwm config lines
Some text to explain the commented pwm pin config. Remove some Timer5 based pwm config. The Timer5 lines are not allowed as pwm configs because the timer is used by the us_ticker as mentioned at the start of the block. I've overseen to remove these lines.
1 parent 79e2ebf commit 6cc89ef

File tree

1 file changed

+11
-4
lines changed
  • libraries/mbed/targets/hal/TARGET_STM/TARGET_DISCO_F429ZI

1 file changed

+11
-4
lines changed

libraries/mbed/targets/hal/TARGET_STM/TARGET_DISCO_F429ZI/pwmout_api.c

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,17 @@
3737

3838
// TIM5 cannot be used because already used by the us_ticker
3939
static const PinMap PinMap_PWM[] = {
40+
/*
41+
* The lines below show all combinations to conect a port pin with a timer. Commented
42+
* lines are alternative possibilities not used per default. But they can be changed
43+
* manually instead of the suggested configuration. For example you can see that on
44+
* PA_5 you can have a PWM using either Timer2/Channel1 or Timer8/Channel1N. Today I
45+
* have decided to use Timer2/Channel1. But you can also notice that Timer2/Channel1
46+
* is also used on PA_0. That means that today you cannot output two different PWM
47+
* signals on PA_0 and PA_5 at the same time. If someone wants this, he will need to
48+
* change the timer that is used on PA_5. This is why the other possibilities are
49+
* commented to make this change easier without looking deeply into the mcu datasheet.
50+
*/
4051
{PA_0, PWM_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2)}, // TIM2_CH1
4152
{PA_1, PWM_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2)}, // TIM2_CH2
4253
{PA_2, PWM_2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2)}, // TIM2_CH3
@@ -103,14 +114,10 @@ static const PinMap PinMap_PWM[] = {
103114
{PE_13, PWM_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1)}, // TIM1_CH3
104115
{PE_14, PWM_1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1)}, // TIM1_CH4
105116

106-
{PH_10, PWM_5, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM5)}, // TIM5_CH1
107-
{PH_11, PWM_5, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM5)}, // TIM5_CH2
108-
{PH_12, PWM_5, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM5)}, // TIM5_CH3
109117
{PH_13, PWM_8, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8)}, // TIM8_CH1N
110118
{PH_14, PWM_8, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8)}, // TIM8_CH2N
111119
{PH_15, PWM_8, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8)}, // TIM8_CH3N
112120

113-
{PI_0, PWM_5, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM5)}, // TIM5_CH4
114121
{PI_2, PWM_8, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8)}, // TIM8_CH4
115122
{PI_5, PWM_8, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8)}, // TIM8_CH1
116123
{PI_6, PWM_8, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM8)}, // TIM8_CH2

0 commit comments

Comments
 (0)