mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-28 02:36:37 +08:00
stm32 io_timer: add support for 16 PWM outputs
This commit is contained in:
@@ -49,7 +49,11 @@ __BEGIN_DECLS
|
|||||||
#else
|
#else
|
||||||
#define MAX_IO_TIMERS 2
|
#define MAX_IO_TIMERS 2
|
||||||
#endif
|
#endif
|
||||||
|
#if DIRECT_PWM_OUTPUT_CHANNELS > 8
|
||||||
|
#define MAX_TIMER_IO_CHANNELS DIRECT_PWM_OUTPUT_CHANNELS
|
||||||
|
#else
|
||||||
#define MAX_TIMER_IO_CHANNELS 8
|
#define MAX_TIMER_IO_CHANNELS 8
|
||||||
|
#endif
|
||||||
|
|
||||||
#define MAX_LED_TIMERS 2
|
#define MAX_LED_TIMERS 2
|
||||||
#define MAX_TIMER_LED_CHANNELS 6
|
#define MAX_TIMER_LED_CHANNELS 6
|
||||||
@@ -73,7 +77,7 @@ typedef enum io_timer_channel_mode_t {
|
|||||||
IOTimerChanModeSize
|
IOTimerChanModeSize
|
||||||
} io_timer_channel_mode_t;
|
} 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
|
/* 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
|
*** Note that the clock_freq is set to the source in the clock tree that
|
||||||
|
|||||||
@@ -150,7 +150,7 @@ static int io_timer_handler7(int irq, void *context, void *arg);
|
|||||||
#define TIM_DMABURSTLENGTH_4TRANSFERS 0x00000300U
|
#define TIM_DMABURSTLENGTH_4TRANSFERS 0x00000300U
|
||||||
|
|
||||||
// NotUsed PWMOut PWMIn Capture OneShot Trigger Dshot
|
// 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 */
|
typedef uint8_t io_timer_allocation_t; /* big enough to hold MAX_IO_TIMERS */
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user