stm32 io_timer: add support for 16 PWM outputs

This commit is contained in:
Beat Küng
2020-01-07 18:55:52 +01:00
committed by David Sidrane
parent 2b0f7e514e
commit 6cdf368776
2 changed files with 6 additions and 2 deletions

View File

@@ -49,7 +49,11 @@ __BEGIN_DECLS
#else
#define MAX_IO_TIMERS 2
#endif
#if DIRECT_PWM_OUTPUT_CHANNELS > 8
#define MAX_TIMER_IO_CHANNELS DIRECT_PWM_OUTPUT_CHANNELS
#else
#define MAX_TIMER_IO_CHANNELS 8
#endif
#define MAX_LED_TIMERS 2
#define MAX_TIMER_LED_CHANNELS 6
@@ -73,7 +77,7 @@ typedef enum io_timer_channel_mode_t {
IOTimerChanModeSize
} io_timer_channel_mode_t;
typedef uint8_t io_timer_channel_allocation_t; /* big enough to hold MAX_TIMER_IO_CHANNELS */
typedef uint16_t io_timer_channel_allocation_t; /* big enough to hold MAX_TIMER_IO_CHANNELS */
/* array of timers dedicated to PWM in and out and capture use
*** Note that the clock_freq is set to the source in the clock tree that

View File

@@ -150,7 +150,7 @@ static int io_timer_handler7(int irq, void *context, void *arg);
#define TIM_DMABURSTLENGTH_4TRANSFERS 0x00000300U
// NotUsed PWMOut PWMIn Capture OneShot Trigger Dshot
io_timer_channel_allocation_t channel_allocations[IOTimerChanModeSize] = { UINT8_MAX, 0, 0, 0, 0, 0, 0 };
io_timer_channel_allocation_t channel_allocations[IOTimerChanModeSize] = { UINT16_MAX, 0, 0, 0, 0, 0, 0 };
typedef uint8_t io_timer_allocation_t; /* big enough to hold MAX_IO_TIMERS */