Merged in raiden00/nuttx_f334 (pull request #974)
Master
* Revert "Merged in yanqil-br/feature-multi_chan_pwm (pull request #973)"
This reverts commit aef0e0b538
.
* arch/arm/src/{stm32/stm32f7/stm32h7/stm32l4}/stm32_pwm.c: configure multi-channel duty only if channel specified. This allows you to update duty cycle for a single channel
* nucleo-f303re/configs: add basic NSH configuration
* nucleo-f303re/configs/pwm: enable console on UART2 and set entry point to nsh_main
Approved-by: Gregory Nutt <gnutt@nuttx.org>
This commit is contained in:
parent
0ed1a06016
commit
5ed743d58a
@ -3244,7 +3244,7 @@ config STM32_TIM1_DEADTIME
|
||||
---help---
|
||||
Timer 1 initial dead-time
|
||||
|
||||
if STM32_PWM_MULTICHAN || STM32_PWM_MULTICHAN_SELECT
|
||||
if STM32_PWM_MULTICHAN
|
||||
|
||||
config STM32_TIM1_CHANNEL1
|
||||
bool "TIM1 Channel 1"
|
||||
@ -3408,9 +3408,9 @@ config STM32_TIM1_CH6OUT
|
||||
|
||||
endif # STM32_TIM1_CHANNEL6
|
||||
|
||||
endif # STM32_PWM_MULTICHAN || STM32_PWM_MULTICHAN_SELECT
|
||||
endif # STM32_PWM_MULTICHAN
|
||||
|
||||
if !(STM32_PWM_MULTICHAN || STM32_PWM_MULTICHAN_SELECT)
|
||||
if !STM32_PWM_MULTICHAN
|
||||
|
||||
config STM32_TIM1_CHANNEL
|
||||
int "TIM1 PWM Output Channel"
|
||||
@ -3486,7 +3486,7 @@ config STM32_TIM1_CHMODE
|
||||
---help---
|
||||
Specifies the channel mode. See enum stm32_pwm_chanmode_e in stm32_pwm.h.
|
||||
|
||||
endif # !(STM32_PWM_MULTICHAN || STM32_PWM_MULTICHAN_SELECT)
|
||||
endif # !STM32_PWM_MULTICHAN
|
||||
|
||||
endif # STM32_TIM1_PWM
|
||||
|
||||
@ -3513,7 +3513,7 @@ config STM32_TIM2_MODE
|
||||
---help---
|
||||
Specifies the timer mode.
|
||||
|
||||
if STM32_PWM_MULTICHAN || STM32_PWM_MULTICHAN_SELECT
|
||||
if STM32_PWM_MULTICHAN
|
||||
|
||||
config STM32_TIM2_CHANNEL1
|
||||
bool "TIM2 Channel 1"
|
||||
@ -3611,9 +3611,9 @@ config STM32_TIM2_CH4OUT
|
||||
|
||||
endif # STM32_TIM2_CHANNEL4
|
||||
|
||||
endif # STM32_PWM_MULTICHAN || STM32_PWM_MULTICHAN_SELECT
|
||||
endif # STM32_PWM_MULTICHAN
|
||||
|
||||
if !(STM32_PWM_MULTICHAN || STM32_PWM_MULTICHAN_SELECT)
|
||||
if !STM32_PWM_MULTICHAN
|
||||
|
||||
config STM32_TIM2_CHANNEL
|
||||
int "TIM2 PWM Output Channel"
|
||||
@ -3671,7 +3671,7 @@ config STM32_TIM2_CHMODE
|
||||
---help---
|
||||
Specifies the channel mode. See enum stm32_pwm_chanmode_e in stm32_pwm.h.
|
||||
|
||||
endif # !(STM32_PWM_MULTICHAN || STM32_PWM_MULTICHAN_SELECT)
|
||||
endif # !STM32_PWM_MULTICHAN
|
||||
|
||||
endif # STM32_TIM2_PWM
|
||||
|
||||
@ -3698,7 +3698,7 @@ config STM32_TIM3_MODE
|
||||
---help---
|
||||
Specifies the timer mode.
|
||||
|
||||
if STM32_PWM_MULTICHAN || STM32_PWM_MULTICHAN_SELECT
|
||||
if STM32_PWM_MULTICHAN
|
||||
|
||||
config STM32_TIM3_CHANNEL1
|
||||
bool "TIM3 Channel 1"
|
||||
@ -3796,9 +3796,9 @@ config STM32_TIM3_CH4OUT
|
||||
|
||||
endif # STM32_TIM3_CHANNEL4
|
||||
|
||||
endif # STM32_PWM_MULTICHAN || STM32_PWM_MULTICHAN_SELECT
|
||||
endif # STM32_PWM_MULTICHAN
|
||||
|
||||
if !(STM32_PWM_MULTICHAN || STM32_PWM_MULTICHAN_SELECT)
|
||||
if !STM32_PWM_MULTICHAN
|
||||
|
||||
config STM32_TIM3_CHANNEL
|
||||
int "TIM3 PWM Output Channel"
|
||||
@ -3856,7 +3856,7 @@ config STM32_TIM3_CHMODE
|
||||
---help---
|
||||
Specifies the channel mode. See enum stm32_pwm_chanmode_e in stm32_pwm.h.
|
||||
|
||||
endif # !(STM32_PWM_MULTICHAN || STM32_PWM_MULTICHAN_SELECT)
|
||||
endif # !STM32_PWM_MULTICHAN
|
||||
|
||||
endif # STM32_TIM3_PWM
|
||||
|
||||
@ -3883,7 +3883,7 @@ config STM32_TIM4_MODE
|
||||
---help---
|
||||
Specifies the timer mode.
|
||||
|
||||
if STM32_PWM_MULTICHAN || STM32_PWM_MULTICHAN_SELECT
|
||||
if STM32_PWM_MULTICHAN
|
||||
|
||||
config STM32_TIM4_CHANNEL1
|
||||
bool "TIM4 Channel 1"
|
||||
@ -3981,9 +3981,9 @@ config STM32_TIM4_CH4OUT
|
||||
|
||||
endif # STM32_TIM4_CHANNEL4
|
||||
|
||||
endif # STM32_PWM_MULTICHAN || STM32_PWM_MULTICHAN_SELECT
|
||||
endif # STM32_PWM_MULTICHAN
|
||||
|
||||
if !(STM32_PWM_MULTICHAN || STM32_PWM_MULTICHAN_SELECT)
|
||||
if !STM32_PWM_MULTICHAN
|
||||
|
||||
config STM32_TIM4_CHANNEL
|
||||
int "TIM4 PWM Output Channel"
|
||||
@ -4041,7 +4041,7 @@ config STM32_TIM4_CHMODE
|
||||
---help---
|
||||
Specifies the channel mode. See enum stm32_pwm_chanmode_e in stm32_pwm.h.
|
||||
|
||||
endif # !(STM32_PWM_MULTICHAN || STM32_PWM_MULTICHAN_SELECT)
|
||||
endif # !STM32_PWM_MULTICHAN
|
||||
|
||||
endif # STM32_TIM4_PWM
|
||||
|
||||
@ -4068,7 +4068,7 @@ config STM32_TIM5_MODE
|
||||
---help---
|
||||
Specifies the timer mode.
|
||||
|
||||
if STM32_PWM_MULTICHAN || STM32_PWM_MULTICHAN_SELECT
|
||||
if STM32_PWM_MULTICHAN
|
||||
|
||||
config STM32_TIM5_CHANNEL1
|
||||
bool "TIM5 Channel 1"
|
||||
@ -4166,9 +4166,9 @@ config STM32_TIM5_CH4OUT
|
||||
|
||||
endif # STM32_TIM5_CHANNEL4
|
||||
|
||||
endif # STM32_PWM_MULTICHAN || STM32_PWM_MULTICHAN_SELECT
|
||||
endif # STM32_PWM_MULTICHAN
|
||||
|
||||
if !(STM32_PWM_MULTICHAN || STM32_PWM_MULTICHAN_SELECT)
|
||||
if !STM32_PWM_MULTICHAN
|
||||
|
||||
config STM32_TIM5_CHANNEL
|
||||
int "TIM5 PWM Output Channel"
|
||||
@ -4226,7 +4226,7 @@ config STM32_TIM5_CHMODE
|
||||
---help---
|
||||
Specifies the channel mode. See enum stm32_pwm_chanmode_e in stm32_pwm.h.
|
||||
|
||||
endif # !(STM32_PWM_MULTICHAN || STM32_PWM_MULTICHAN_SELECT)
|
||||
endif # !STM32_PWM_MULTICHAN
|
||||
|
||||
endif # STM32_TIM5_PWM
|
||||
|
||||
@ -4274,7 +4274,7 @@ config STM32_TIM8_TDTS
|
||||
---help---
|
||||
Timer 8 dead-time and sampling clock (t_DTS) division
|
||||
|
||||
if STM32_PWM_MULTICHAN || STM32_PWM_MULTICHAN_SELECT
|
||||
if STM32_PWM_MULTICHAN
|
||||
|
||||
config STM32_TIM8_CHANNEL1
|
||||
bool "TIM8 Channel 1"
|
||||
@ -4438,9 +4438,9 @@ config STM32_TIM8_CH6OUT
|
||||
|
||||
endif # STM32_TIM8_CHANNEL6
|
||||
|
||||
endif # STM32_PWM_MULTICHAN || STM32_PWM_MULTICHAN_SELECT
|
||||
endif # STM32_PWM_MULTICHAN
|
||||
|
||||
if !(STM32_PWM_MULTICHAN || STM32_PWM_MULTICHAN_SELECT)
|
||||
if !STM32_PWM_MULTICHAN
|
||||
|
||||
config STM32_TIM8_CHANNEL
|
||||
int "TIM8 PWM Output Channel"
|
||||
@ -4516,7 +4516,7 @@ config STM32_TIM8_CHMODE
|
||||
---help---
|
||||
Specifies the channel mode. See enum stm32_pwm_chanmode_e in stm32_pwm.h.
|
||||
|
||||
endif # !(STM32_PWM_MULTICHAN || STM32_PWM_MULTICHAN_SELECT)
|
||||
endif # !STM32_PWM_MULTICHAN
|
||||
|
||||
endif # STM32_TIM8_PWM
|
||||
|
||||
@ -4536,7 +4536,7 @@ config STM32_TIM9_PWM
|
||||
|
||||
if STM32_TIM9_PWM
|
||||
|
||||
if STM32_PWM_MULTICHAN || STM32_PWM_MULTICHAN_SELECT
|
||||
if STM32_PWM_MULTICHAN
|
||||
|
||||
config STM32_TIM9_CHANNEL1
|
||||
bool "TIM9 Channel 1"
|
||||
@ -4586,9 +4586,9 @@ config STM32_TIM9_CH2OUT
|
||||
|
||||
endif # STM32_TIM9_CHANNEL2
|
||||
|
||||
endif # STM32_PWM_MULTICHAN || STM32_PWM_MULTICHAN_SELECT
|
||||
endif # STM32_PWM_MULTICHAN
|
||||
|
||||
if !(STM32_PWM_MULTICHAN || STM32_PWM_MULTICHAN_SELECT)
|
||||
if !STM32_PWM_MULTICHAN
|
||||
|
||||
config STM32_TIM9_CHANNEL
|
||||
int "TIM9 PWM Output Channel"
|
||||
@ -4626,7 +4626,7 @@ config STM32_TIM9_CHMODE
|
||||
---help---
|
||||
Specifies the channel mode. See enum stm32_pwm_chanmode_e in stm32_pwm.h.
|
||||
|
||||
endif # !(STM32_PWM_MULTICHAN || STM32_PWM_MULTICHAN_SELECT)
|
||||
endif # !STM32_PWM_MULTICHAN
|
||||
|
||||
endif # STM32_TIM9_PWM
|
||||
|
||||
@ -4646,7 +4646,7 @@ config STM32_TIM10_PWM
|
||||
|
||||
if STM32_TIM10_PWM
|
||||
|
||||
if STM32_PWM_MULTICHAN || STM32_PWM_MULTICHAN_SELECT
|
||||
if STM32_PWM_MULTICHAN
|
||||
|
||||
config STM32_TIM10_CHANNEL1
|
||||
bool "TIM10 Channel 1"
|
||||
@ -4672,9 +4672,9 @@ config STM32_TIM10_CH1OUT
|
||||
|
||||
endif # STM32_TIM10_CHANNEL1
|
||||
|
||||
endif # STM32_PWM_MULTICHAN || STM32_PWM_MULTICHAN_SELECT
|
||||
endif # STM32_PWM_MULTICHAN
|
||||
|
||||
if !(STM32_PWM_MULTICHAN || STM32_PWM_MULTICHAN_SELECT)
|
||||
if !STM32_PWM_MULTICHAN
|
||||
|
||||
config STM32_TIM10_CHANNEL
|
||||
int "TIM10 PWM Output Channel"
|
||||
@ -4702,7 +4702,7 @@ config STM32_TIM10_CHMODE
|
||||
---help---
|
||||
Specifies the channel mode. See enum stm32_pwm_chanmode_e in stm32_pwm.h.
|
||||
|
||||
endif # !(STM32_PWM_MULTICHAN || STM32_PWM_MULTICHAN_SELECT)
|
||||
endif # !STM32_PWM_MULTICHAN
|
||||
|
||||
endif # STM32_TIM10_PWM
|
||||
|
||||
@ -4722,7 +4722,7 @@ config STM32_TIM11_PWM
|
||||
|
||||
if STM32_TIM11_PWM
|
||||
|
||||
if STM32_PWM_MULTICHAN || STM32_PWM_MULTICHAN_SELECT
|
||||
if STM32_PWM_MULTICHAN
|
||||
|
||||
config STM32_TIM11_CHANNEL1
|
||||
bool "TIM11 Channel 1"
|
||||
@ -4748,9 +4748,9 @@ config STM32_TIM11_CH1OUT
|
||||
|
||||
endif # STM32_TIM11_CHANNEL1
|
||||
|
||||
endif # STM32_PWM_MULTICHAN || STM32_PWM_MULTICHAN_SELECT
|
||||
endif # STM32_PWM_MULTICHAN
|
||||
|
||||
if !(STM32_PWM_MULTICHAN || STM32_PWM_MULTICHAN_SELECT)
|
||||
if !STM32_PWM_MULTICHAN
|
||||
|
||||
config STM32_TIM11_CHANNEL
|
||||
int "TIM11 PWM Output Channel"
|
||||
@ -4778,7 +4778,7 @@ config STM32_TIM11_CHMODE
|
||||
---help---
|
||||
Specifies the channel mode. See enum stm32_pwm_chanmode_e in stm32_pwm.h.
|
||||
|
||||
endif # !(STM32_PWM_MULTICHAN || STM32_PWM_MULTICHAN_SELECT)
|
||||
endif # !STM32_PWM_MULTICHAN
|
||||
|
||||
endif # STM32_TIM11_PWM
|
||||
|
||||
@ -4798,7 +4798,7 @@ config STM32_TIM12_PWM
|
||||
|
||||
if STM32_TIM12_PWM
|
||||
|
||||
if STM32_PWM_MULTICHAN || STM32_PWM_MULTICHAN_SELECT
|
||||
if STM32_PWM_MULTICHAN
|
||||
|
||||
config STM32_TIM12_CHANNEL1
|
||||
bool "TIM12 Channel 1"
|
||||
@ -4848,9 +4848,9 @@ config STM32_TIM12_CH2OUT
|
||||
|
||||
endif # STM32_TIM12_CHANNEL2
|
||||
|
||||
endif # STM32_PWM_MULTICHAN || STM32_PWM_MULTICHAN_SELECT
|
||||
endif # STM32_PWM_MULTICHAN
|
||||
|
||||
if !(STM32_PWM_MULTICHAN || STM32_PWM_MULTICHAN_SELECT)
|
||||
if !STM32_PWM_MULTICHAN
|
||||
|
||||
config STM32_TIM12_CHANNEL
|
||||
int "TIM12 PWM Output Channel"
|
||||
@ -4888,7 +4888,7 @@ config STM32_TIM12_CHMODE
|
||||
---help---
|
||||
Specifies the channel mode. See enum stm32_pwm_chanmode_e in stm32_pwm.h.
|
||||
|
||||
endif # !(STM32_PWM_MULTICHAN || STM32_PWM_MULTICHAN_SELECT)
|
||||
endif # !STM32_PWM_MULTICHAN
|
||||
|
||||
endif # STM32_TIM12_PWM
|
||||
|
||||
@ -4908,7 +4908,7 @@ config STM32_TIM13_PWM
|
||||
|
||||
if STM32_TIM13_PWM
|
||||
|
||||
if STM32_PWM_MULTICHAN || STM32_PWM_MULTICHAN_SELECT
|
||||
if STM32_PWM_MULTICHAN
|
||||
|
||||
config STM32_TIM13_CHANNEL1
|
||||
bool "TIM13 Channel 1"
|
||||
@ -4934,9 +4934,9 @@ config STM32_TIM13_CH1OUT
|
||||
|
||||
endif # STM32_TIM13_CHANNEL1
|
||||
|
||||
endif # STM32_PWM_MULTICHAN || STM32_PWM_MULTICHAN_SELECT
|
||||
endif # STM32_PWM_MULTICHAN
|
||||
|
||||
if !(STM32_PWM_MULTICHAN || STM32_PWM_MULTICHAN_SELECT)
|
||||
if !STM32_PWM_MULTICHAN
|
||||
|
||||
config STM32_TIM13_CHANNEL
|
||||
int "TIM13 PWM Output Channel"
|
||||
@ -4964,7 +4964,7 @@ config STM32_TIM13_CHMODE
|
||||
---help---
|
||||
Specifies the channel mode. See enum stm32_pwm_chanmode_e in stm32_pwm.h.
|
||||
|
||||
endif # !(STM32_PWM_MULTICHAN || STM32_PWM_MULTICHAN_SELECT)
|
||||
endif # !STM32_PWM_MULTICHAN
|
||||
|
||||
endif # STM32_TIM13_PWM
|
||||
|
||||
@ -4984,7 +4984,7 @@ config STM32_TIM14_PWM
|
||||
|
||||
if STM32_TIM14_PWM
|
||||
|
||||
if STM32_PWM_MULTICHAN || STM32_PWM_MULTICHAN_SELECT
|
||||
if STM32_PWM_MULTICHAN
|
||||
|
||||
config STM32_TIM14_CHANNEL1
|
||||
bool "TIM14 Channel 1"
|
||||
@ -5010,9 +5010,9 @@ config STM32_TIM14_CH1OUT
|
||||
|
||||
endif # STM32_TIM14_CHANNEL1
|
||||
|
||||
endif # STM32_PWM_MULTICHAN || STM32_PWM_MULTICHAN_SELECT
|
||||
endif # STM32_PWM_MULTICHAN
|
||||
|
||||
if !(STM32_PWM_MULTICHAN || STM32_PWM_MULTICHAN_SELECT)
|
||||
if !STM32_PWM_MULTICHAN
|
||||
|
||||
config STM32_TIM14_CHANNEL
|
||||
int "TIM14 PWM Output Channel"
|
||||
@ -5040,7 +5040,7 @@ config STM32_TIM14_CHMODE
|
||||
---help---
|
||||
Specifies the channel mode. See enum stm32_pwm_chanmode_e in stm32_pwm.h.
|
||||
|
||||
endif # !(STM32_PWM_MULTICHAN || STM32_PWM_MULTICHAN_SELECT)
|
||||
endif # !STM32_PWM_MULTICHAN
|
||||
|
||||
endif # STM32_TIM14_PWM
|
||||
|
||||
@ -5080,7 +5080,7 @@ config STM32_TIM15_DEADTIME
|
||||
---help---
|
||||
Timer 15 initial dead-time
|
||||
|
||||
if STM32_PWM_MULTICHAN || STM32_PWM_MULTICHAN_SELECT
|
||||
if STM32_PWM_MULTICHAN
|
||||
|
||||
config STM32_TIM15_CHANNEL1
|
||||
bool "TIM15 Channel 1"
|
||||
@ -5136,9 +5136,9 @@ config STM32_TIM15_CH2OUT
|
||||
|
||||
endif # STM32_TIM15_CHANNEL2
|
||||
|
||||
endif # STM32_PWM_MULTICHAN || STM32_PWM_MULTICHAN_SELECT
|
||||
endif # STM32_PWM_MULTICHAN
|
||||
|
||||
if !(STM32_PWM_MULTICHAN || STM32_PWM_MULTICHAN_SELECT)
|
||||
if !STM32_PWM_MULTICHAN
|
||||
|
||||
config STM32_TIM15_CHANNEL
|
||||
int "TIM15 PWM Output Channel"
|
||||
@ -5188,7 +5188,7 @@ config STM32_TIM15_CHMODE
|
||||
---help---
|
||||
Specifies the channel mode. See enum stm32_pwm_chanmode_e in stm32_pwm.h.
|
||||
|
||||
endif # !(STM32_PWM_MULTICHAN || STM32_PWM_MULTICHAN_SELECT)
|
||||
endif # !STM32_PWM_MULTICHAN
|
||||
|
||||
endif # STM32_TIM15_PWM
|
||||
|
||||
@ -5228,7 +5228,7 @@ config STM32_TIM16_DEADTIME
|
||||
---help---
|
||||
Timer 16 initial dead-time
|
||||
|
||||
if STM32_PWM_MULTICHAN || STM32_PWM_MULTICHAN_SELECT
|
||||
if STM32_PWM_MULTICHAN
|
||||
|
||||
config STM32_TIM16_CHANNEL1
|
||||
bool "TIM16 Channel 1"
|
||||
@ -5253,9 +5253,9 @@ config STM32_TIM16_CH1OUT
|
||||
|
||||
endif # STM32_TIM16_CHANNEL1
|
||||
|
||||
endif # STM32_PWM_MULTICHAN || STM32_PWM_MULTICHAN_SELECT
|
||||
endif # STM32_PWM_MULTICHAN
|
||||
|
||||
if !(STM32_PWM_MULTICHAN || STM32_PWM_MULTICHAN_SELECT)
|
||||
if !STM32_PWM_MULTICHAN
|
||||
|
||||
config STM32_TIM16_CHANNEL
|
||||
int "TIM16 PWM Output Channel"
|
||||
@ -5282,7 +5282,7 @@ config STM32_TIM16_CHMODE
|
||||
---help---
|
||||
Specifies the channel mode. See enum stm32_pwm_chanmode_e in stm32_pwm.h.
|
||||
|
||||
endif # !(STM32_PWM_MULTICHAN || STM32_PWM_MULTICHAN_SELECT)
|
||||
endif # !STM32_PWM_MULTICHAN
|
||||
|
||||
endif # STM32_TIM16_PWM
|
||||
|
||||
@ -5322,7 +5322,7 @@ config STM32_TIM17_DEADTIME
|
||||
---help---
|
||||
Timer 17 initial dead-time
|
||||
|
||||
if STM32_PWM_MULTICHAN || STM32_PWM_MULTICHAN_SELECT
|
||||
if STM32_PWM_MULTICHAN
|
||||
|
||||
config STM32_TIM17_CHANNEL1
|
||||
bool "TIM17 Channel 1"
|
||||
@ -5347,9 +5347,9 @@ config STM32_TIM17_CH1OUT
|
||||
|
||||
endif # STM32_TIM17_CHANNEL1
|
||||
|
||||
endif # STM32_PWM_MULTICHAN || STM32_PWM_MULTICHAN_SELECT
|
||||
endif # STM32_PWM_MULTICHAN
|
||||
|
||||
if !(STM32_PWM_MULTICHAN || STM32_PWM_MULTICHAN_SELECT)
|
||||
if !STM32_PWM_MULTICHAN
|
||||
|
||||
config STM32_TIM17_CHANNEL
|
||||
int "TIM17 PWM Output Channel"
|
||||
@ -5376,7 +5376,7 @@ config STM32_TIM17_CHMODE
|
||||
---help---
|
||||
Specifies the channel mode. See enum stm32_pwm_chanmode_e in stm32_pwm.h.
|
||||
|
||||
endif # !(STM32_PWM_MULTICHAN || STM32_PWM_MULTICHAN_SELECT)
|
||||
endif # !STM32_PWM_MULTICHAN
|
||||
|
||||
endif # STM32_TIM17_PWM
|
||||
|
||||
@ -5389,15 +5389,6 @@ config STM32_PWM_MULTICHAN
|
||||
Specifies that the PWM driver supports multiple output
|
||||
channels per timer.
|
||||
|
||||
config STM32_PWM_MULTICHAN_SELECT
|
||||
bool "PWM Multiple Output Channels with unit selection"
|
||||
default n
|
||||
depends on STM32_TIM1_PWM || STM32_TIM2_PWM || STM32_TIM3_PWM || STM32_TIM4_PWM || STM32_TIM5_PWM || STM32_TIM8_PWM || STM32_TIM9_PWM || STM32_TIM10_PWM || STM32_TIM11_PWM || STM32_TIM12_PWM || STM32_TIM13_PWM || STM32_TIM14_PWM || STM32_TIM15_PWM || STM32_TIM16_PWM || STM32_TIM17_PWM
|
||||
select ARCH_HAVE_PWM_MULTICHAN
|
||||
---help---
|
||||
Specifies that the PWM driver supports multiple output
|
||||
channels per timer and each output is individually configurable.
|
||||
|
||||
config STM32_PWM_TRGO
|
||||
bool "TIM PWM TRGO support"
|
||||
default n
|
||||
|
@ -2293,10 +2293,10 @@ static int pwm_duty_update(FAR struct pwm_lowerhalf_s *dev, uint8_t channel,
|
||||
pwminfo("TIM%u channel: %u duty: %08x\n",
|
||||
priv->timid, channel, duty);
|
||||
|
||||
#if (!defined(CONFIG_PWM_MULTICHAN) && !defined(CONFIG_PWM_MULTICHAN_SELECT))
|
||||
#ifndef CONFIG_PWM_MULTICHAN
|
||||
DEBUGASSERT(channel == priv->channels[0].channel);
|
||||
DEBUGASSERT(duty >= 0 && duty < uitoub16(100));
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* Get the reload values */
|
||||
|
||||
@ -3583,9 +3583,7 @@ errout:
|
||||
static int pwm_duty_channels_update(FAR struct pwm_lowerhalf_s *dev,
|
||||
FAR const struct pwm_info_s *info)
|
||||
{
|
||||
#ifndef CONFIG_PWM_MULTICHAN_SELECT
|
||||
FAR struct stm32_pwmtimer_s *priv = (FAR struct stm32_pwmtimer_s *)dev;
|
||||
#endif
|
||||
uint8_t channel = 0;
|
||||
ub16_t duty = 0;
|
||||
int ret = OK;
|
||||
@ -3626,12 +3624,8 @@ static int pwm_duty_channels_update(FAR struct pwm_lowerhalf_s *dev,
|
||||
}
|
||||
#else
|
||||
duty = info->duty;
|
||||
#ifdef CONFIG_PWM_MULTICHAN_SELECT
|
||||
channel = info->chan_num; /* only update specified PWM channel */
|
||||
#else
|
||||
channel = priv->channels[0].channel;
|
||||
#endif /* CONFIG_PWM_MULTICHAN_SELECT */
|
||||
#endif /* CONFIG_PWM_MULTICHAN */
|
||||
#endif
|
||||
|
||||
/* Update duty cycle */
|
||||
|
||||
@ -3676,15 +3670,11 @@ static int pwm_timer(FAR struct pwm_lowerhalf_s *dev,
|
||||
#if defined(CONFIG_PWM_MULTICHAN)
|
||||
pwminfo("TIM%u frequency: %u\n",
|
||||
priv->timid, info->frequency);
|
||||
#elif defined(CONFIG_PWM_MULTICHAN_SELECT)
|
||||
pwminfo("TIM%u channel: %u frequency: %u duty: %08x\n",
|
||||
priv->timid, info->channel,
|
||||
info->frequency, info->duty);
|
||||
#else /* !CONFIG_PWM_MULTICHAN && !CONFIG_PWM_MULTICHAN_SELECT */
|
||||
#else
|
||||
pwminfo("TIM%u channel: %u frequency: %u duty: %08x\n",
|
||||
priv->timid, priv->channels[0].channel,
|
||||
info->frequency, info->duty);
|
||||
#endif /* CONFIG_PWM_MULTICHAN */
|
||||
#endif
|
||||
|
||||
DEBUGASSERT(info->frequency > 0);
|
||||
#ifndef CONFIG_PWM_MULTICHAN
|
||||
@ -4305,32 +4295,7 @@ static int pwm_start(FAR struct pwm_lowerhalf_s *dev,
|
||||
|
||||
return pwm_pulsecount_timer(dev, info);
|
||||
}
|
||||
#elif defined(CONFIG_PWM_MULTICHAN_SELECT)
|
||||
static int pwm_start(FAR struct pwm_lowerhalf_s *dev,
|
||||
FAR const struct pwm_info_s *info)
|
||||
{
|
||||
FAR struct stm32_pwmtimer_s *priv = (FAR struct stm32_pwmtimer_s *)dev;
|
||||
int ret = OK;
|
||||
|
||||
/* if frequency has not changed we just update duty for specified channel */
|
||||
if (info->frequency == priv->frequency)
|
||||
{
|
||||
ret = pwm_duty_update(dev, info->chan_num, info->duty);
|
||||
}
|
||||
else
|
||||
{
|
||||
ret = pwm_timer(dev, info);
|
||||
|
||||
/* Save current frequency */
|
||||
if (ret == OK)
|
||||
{
|
||||
priv->frequency = info->frequency;
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
#else /* !CONFIG_PWM_PULSECOUNT && !CONFIG_PWM_MULTICHAN_SELECT */
|
||||
#else /* !CONFIG_PWM_PULSECOUNT */
|
||||
static int pwm_start(FAR struct pwm_lowerhalf_s *dev,
|
||||
FAR const struct pwm_info_s *info)
|
||||
{
|
||||
@ -4344,12 +4309,15 @@ static int pwm_start(FAR struct pwm_lowerhalf_s *dev,
|
||||
#ifdef CONFIG_PWM_MULTICHAN
|
||||
int i;
|
||||
|
||||
/* REVISIT: */
|
||||
|
||||
for (i = 0; ret == OK && i < CONFIG_PWM_NCHANNELS; i++)
|
||||
{
|
||||
ret = pwm_duty_update(dev, info->channels[i].channel,
|
||||
info->channels[i].duty);
|
||||
/* Set output if channel configured */
|
||||
|
||||
if (info->channels[i].channel != 0)
|
||||
{
|
||||
ret = pwm_duty_update(dev, info->channels[i].channel,
|
||||
info->channels[i].duty);
|
||||
}
|
||||
}
|
||||
#else
|
||||
ret = pwm_duty_update(dev, priv->channels[0].channel, info->duty);
|
||||
|
@ -125,7 +125,7 @@
|
||||
|
||||
/* PWM driver channels configuration */
|
||||
|
||||
#if defined(CONFIG_STM32_PWM_MULTICHAN) || defined(CONFIG_STM32_PWM_MULTICHAN_SELECT)
|
||||
#ifdef CONFIG_STM32_PWM_MULTICHAN
|
||||
|
||||
#ifdef CONFIG_STM32_TIM1_CHANNEL1
|
||||
# define PWM_TIM1_CHANNEL1 1
|
||||
@ -365,7 +365,7 @@
|
||||
#endif
|
||||
#define PWM_TIM17_NCHANNELS PWM_TIM17_CHANNEL1
|
||||
|
||||
#else /* !(CONFIG_STM32_PWM_MULTICHAN || CONFIG_STM32_PWM_MULTICHAN_SELECT) */
|
||||
#else /* !CONFIG_PWM_MULTICHAN */
|
||||
|
||||
/* For each timer that is enabled for PWM usage, we need the following additional
|
||||
* configuration settings:
|
||||
|
@ -2166,8 +2166,13 @@ static int pwm_start(FAR struct pwm_lowerhalf_s *dev,
|
||||
|
||||
for (i = 0; ret == OK && i < CONFIG_PWM_NCHANNELS; i++)
|
||||
{
|
||||
ret = pwm_update_duty(priv, info->channels[i].channel,
|
||||
info->channels[i].duty);
|
||||
/* Set output if channel configured */
|
||||
|
||||
if (info->channels[i].channel != 0)
|
||||
{
|
||||
ret = pwm_update_duty(priv, info->channels[i].channel,
|
||||
info->channels[i].duty);
|
||||
}
|
||||
}
|
||||
#else
|
||||
ret = pwm_update_duty(priv, priv->channels[0].channel,
|
||||
|
@ -4000,12 +4000,15 @@ static int pwm_start(FAR struct pwm_lowerhalf_s *dev,
|
||||
#ifdef CONFIG_PWM_MULTICHAN
|
||||
int i;
|
||||
|
||||
/* REVISIT: */
|
||||
|
||||
for (i = 0; ret == OK && i < CONFIG_PWM_NCHANNELS; i++)
|
||||
{
|
||||
ret = pwm_duty_update(dev, info->channels[i].channel,
|
||||
info->channels[i].duty);
|
||||
/* Set output if channel configured */
|
||||
|
||||
if (info->channels[i].channel != 0)
|
||||
{
|
||||
ret = pwm_duty_update(dev, info->channels[i].channel,
|
||||
info->channels[i].duty);
|
||||
}
|
||||
}
|
||||
#else
|
||||
ret = pwm_duty_update(dev, priv->channels[0].channel, info->duty);
|
||||
|
@ -1871,8 +1871,13 @@ static int stm32l4pwm_start(FAR struct pwm_lowerhalf_s *dev,
|
||||
|
||||
for (i = 0; ret == OK && i < CONFIG_PWM_NCHANNELS; i++)
|
||||
{
|
||||
ret = stm32l4pwm_update_duty(priv,info->channels[i].channel,
|
||||
info->channels[i].duty);
|
||||
/* Set output if channel configured */
|
||||
|
||||
if (info->channels[i].channel != 0)
|
||||
{
|
||||
ret = stm32l4pwm_update_duty(priv,info->channels[i].channel,
|
||||
info->channels[i].duty);
|
||||
}
|
||||
}
|
||||
#else
|
||||
ret = stm32l4pwm_update_duty(priv,priv->channels[0].channel,info->duty);
|
||||
|
44
boards/arm/stm32/nucleo-f303re/configs/nsh/defconfig
Normal file
44
boards/arm/stm32/nucleo-f303re/configs/nsh/defconfig
Normal file
@ -0,0 +1,44 @@
|
||||
#
|
||||
# This file is autogenerated: PLEASE DO NOT EDIT IT.
|
||||
#
|
||||
# You can use "make menuconfig" to make any modifications to the installed .config file.
|
||||
# You can then do "make savedefconfig" to generate a new defconfig file that includes your
|
||||
# modifications.
|
||||
#
|
||||
# CONFIG_ARCH_FPU is not set
|
||||
CONFIG_ARCH="arm"
|
||||
CONFIG_ARCH_BOARD="nucleo-f303re"
|
||||
CONFIG_ARCH_BOARD_NUCLEO_F303RE=y
|
||||
CONFIG_ARCH_BUTTONS=y
|
||||
CONFIG_ARCH_CHIP="stm32"
|
||||
CONFIG_ARCH_CHIP_STM32=y
|
||||
CONFIG_ARCH_CHIP_STM32F303RE=y
|
||||
CONFIG_ARCH_STACKDUMP=y
|
||||
CONFIG_BOARD_LOOPSPERMSEC=6522
|
||||
CONFIG_DEBUG_SYMBOLS=y
|
||||
CONFIG_IDLETHREAD_STACKSIZE=2048
|
||||
CONFIG_INTELHEX_BINARY=y
|
||||
CONFIG_MAX_TASKS=16
|
||||
CONFIG_MAX_WDOGPARMS=2
|
||||
CONFIG_MM_REGIONS=2
|
||||
CONFIG_NFILE_DESCRIPTORS=8
|
||||
CONFIG_NFILE_STREAMS=8
|
||||
CONFIG_PREALLOC_MQ_MSGS=4
|
||||
CONFIG_PREALLOC_TIMERS=4
|
||||
CONFIG_PREALLOC_WDOGS=8
|
||||
CONFIG_RAM_SIZE=65536
|
||||
CONFIG_RAM_START=0x20000000
|
||||
CONFIG_RAW_BINARY=y
|
||||
CONFIG_RR_INTERVAL=200
|
||||
CONFIG_SCHED_WAITPID=y
|
||||
CONFIG_SDCLONE_DISABLE=y
|
||||
CONFIG_START_DAY=27
|
||||
CONFIG_START_YEAR=2013
|
||||
CONFIG_STM32_JTAG_SW_ENABLE=y
|
||||
CONFIG_STM32_USART2=y
|
||||
CONFIG_SYSLOG_NONE=y
|
||||
CONFIG_SYSTEM_NSH=y
|
||||
CONFIG_TASK_NAME_SIZE=0
|
||||
CONFIG_USART2_SERIAL_CONSOLE=y
|
||||
CONFIG_USER_ENTRYPOINT="nsh_main"
|
||||
CONFIG_WDOG_INTRESERVE=1
|
@ -6,10 +6,6 @@
|
||||
# modifications.
|
||||
#
|
||||
# CONFIG_ARCH_FPU is not set
|
||||
# CONFIG_DEV_CONSOLE is not set
|
||||
# CONFIG_NSH_DISABLE_IFCONFIG is not set
|
||||
# CONFIG_NSH_DISABLE_PS is not set
|
||||
# CONFIG_SERIAL is not set
|
||||
CONFIG_ARCH="arm"
|
||||
CONFIG_ARCH_BOARD="nucleo-f303re"
|
||||
CONFIG_ARCH_BOARD_NUCLEO_F303RE=y
|
||||
@ -23,22 +19,19 @@ CONFIG_BUILTIN=y
|
||||
CONFIG_EXAMPLES_PWM=y
|
||||
CONFIG_IDLETHREAD_STACKSIZE=2048
|
||||
CONFIG_INTELHEX_BINARY=y
|
||||
CONFIG_LIB_BOARDCTL=y
|
||||
CONFIG_MAX_TASKS=16
|
||||
CONFIG_MAX_WDOGPARMS=2
|
||||
CONFIG_MM_REGIONS=2
|
||||
CONFIG_NFILE_DESCRIPTORS=8
|
||||
CONFIG_NFILE_STREAMS=8
|
||||
CONFIG_NSH_ARCHINIT=y
|
||||
CONFIG_NSH_BUILTIN_APPS=y
|
||||
CONFIG_NSH_LIBRARY=y
|
||||
CONFIG_PREALLOC_MQ_MSGS=4
|
||||
CONFIG_PREALLOC_TIMERS=4
|
||||
CONFIG_PREALLOC_WDOGS=8
|
||||
CONFIG_PWM=y
|
||||
CONFIG_PWM_MULTICHAN=y
|
||||
CONFIG_PWM_NCHANNELS=2
|
||||
CONFIG_RAMLOG=y
|
||||
CONFIG_RAMLOG_SYSLOG=y
|
||||
CONFIG_RAM_SIZE=65536
|
||||
CONFIG_RAM_START=0x20000000
|
||||
CONFIG_RAW_BINARY=y
|
||||
@ -55,6 +48,10 @@ CONFIG_STM32_TIM3_CH2OUT=y
|
||||
CONFIG_STM32_TIM3_CHANNEL1=y
|
||||
CONFIG_STM32_TIM3_CHANNEL2=y
|
||||
CONFIG_STM32_TIM3_PWM=y
|
||||
CONFIG_STM32_USART2=y
|
||||
CONFIG_SYSLOG_NONE=y
|
||||
CONFIG_SYSTEM_NSH=y
|
||||
CONFIG_TASK_NAME_SIZE=0
|
||||
CONFIG_USER_ENTRYPOINT="pwm_main"
|
||||
CONFIG_USART2_SERIAL_CONSOLE=y
|
||||
CONFIG_USER_ENTRYPOINT="nsh_main"
|
||||
CONFIG_WDOG_INTRESERVE=1
|
||||
|
@ -23,15 +23,6 @@ config PWM_MULTICHAN
|
||||
---help---
|
||||
Enables support for multiple output channels per timer.
|
||||
|
||||
config PWM_MULTICHAN_SELECT
|
||||
bool "PWM Multiple Output Channel Support"
|
||||
default n
|
||||
depends on ARCH_HAVE_PWM_MULTICHAN
|
||||
depends on !PWM_PULSECOUNT
|
||||
---help---
|
||||
Enables support for multiple output channels per timer with
|
||||
ability to set timers individually.
|
||||
|
||||
if PWM_MULTICHAN
|
||||
|
||||
config PWM_NCHANNELS
|
||||
|
@ -154,9 +154,6 @@ struct pwm_info_s
|
||||
uint32_t count; /* The number of pulse to generate. 0 means to
|
||||
* generate an indefinite number of pulses */
|
||||
# endif
|
||||
# ifdef CONFIG_PWM_MULTICHAN_SELECT
|
||||
uint8_t chan_num; /* Selects the PWM channel number to modify */
|
||||
#endif
|
||||
#endif /* CONFIG_PWM_MULTICHAN */
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user