[FMUv6s] Convert unused PPM pin to PPS input

This commit is contained in:
Niklas Hauser 2025-10-23 18:05:57 +02:00 committed by Niklas Hauser
parent 67ace35182
commit 676fa8a883
5 changed files with 26 additions and 8 deletions

View File

@ -14,6 +14,7 @@ CONFIG_COMMON_DISTANCE_SENSOR=y
CONFIG_DRIVERS_DSHOT=y
CONFIG_DRIVERS_GNSS_SEPTENTRIO=y
CONFIG_DRIVERS_GPS=y
CONFIG_DRIVERS_PPS_CAPTURE=y
CONFIG_DRIVERS_IMU_BOSCH_BMI088=y
CONFIG_BMI088_ACCELEROMETER_INT2=y
CONFIG_COMMON_LIGHT=y

View File

@ -19,6 +19,13 @@ param set-default SDLOG_BACKEND 2
# 200kOhm/10kOhm voltage divider on V_BAT
param set-default BAT1_V_DIV 21
# Uncomment to use PWM9 as Analog input
# param set-default PWM_MAIN_TIM2 -2
# Uncomment to use PWM10 as PPS input
# param set-default PWM_MAIN_TIM3 -2
# param set-default PWM_MAIN_FUNC10 2064
# Skynode: use the "custom participant", IP=10.41.10.1 config for uxrce_dds_client
param set-default UXRCE_DDS_PTCFG 2
param set-default UXRCE_DDS_AG_IP 170461697

View File

@ -238,9 +238,12 @@ CONFIG_STM32H7_SPI3_DMA_BUFFER=1024
CONFIG_STM32H7_SPI4=y
CONFIG_STM32H7_SPI4_DMA=y
CONFIG_STM32H7_SPI4_DMA_BUFFER=4096
CONFIG_STM32H7_TIM12=y
CONFIG_STM32H7_TIM1=y
CONFIG_STM32H7_TIM2=y
CONFIG_STM32H7_TIM3=y
CONFIG_STM32H7_TIM4=y
CONFIG_STM32H7_TIM5=y
CONFIG_STM32H7_TIM8=y
CONFIG_STM32H7_UART4=y
CONFIG_STM32H7_UART5=y
CONFIG_STM32H7_UART7=y

View File

@ -135,15 +135,14 @@
/* PWM Timers */
#define BOARD_NUM_IO_TIMERS 2
#define DIRECT_PWM_OUTPUT_CHANNELS 8
/* 3 for PWM outputs, 1 for input capture */
#define BOARD_NUM_IO_TIMERS 4
/* 9 for PWM outputs, 1 for input capture */
#define DIRECT_PWM_OUTPUT_CHANNELS 10
/* High-resolution timer */
#define HRT_TIMER 8 /* use timer8 for the HRT */
#define HRT_TIMER_CHANNEL 3 /* use capture/compare channel 3 */
#define HRT_PPM_CHANNEL /* T8C2 */ 2 /* use capture/compare channel 1 */
#define GPIO_PPM_IN /* PC7 */ GPIO_TIM8_CH2IN_1
#define HRT_TIMER 4 /* use timer4 for the HRT */
#define HRT_TIMER_CHANNEL 1 /* use capture/compare channel 1 */
/* This board provides a DMA pool and APIs */
#define BOARD_DMA_ALLOC_POOL_SIZE 5120

View File

@ -44,11 +44,17 @@
* TIM3_CH2 T FMU_CH6
* TIM3_CH3 T FMU_CH7
* TIM3_CH4 T FMU_CH8
*
* TIM5_CH1 T FMU_CH9
*
* TIM8_CH2 T FMU_CAP1 < Input Capture
*/
constexpr io_timers_t io_timers[MAX_IO_TIMERS] = {
initIOTimer(Timer::Timer1, DMA{DMA::Index1}),
initIOTimer(Timer::Timer3, DMA{DMA::Index1}),
initIOTimer(Timer::Timer5),
initIOTimer(Timer::Timer8),
};
constexpr timer_io_channels_t timer_io_channels[MAX_TIMER_IO_CHANNELS] = {
@ -60,6 +66,8 @@ constexpr timer_io_channels_t timer_io_channels[MAX_TIMER_IO_CHANNELS] = {
initIOTimerChannel(io_timers, {Timer::Timer3, Timer::Channel2}, {GPIO::PortB, GPIO::Pin5}),
initIOTimerChannel(io_timers, {Timer::Timer3, Timer::Channel3}, {GPIO::PortB, GPIO::Pin0}),
initIOTimerChannel(io_timers, {Timer::Timer3, Timer::Channel4}, {GPIO::PortC, GPIO::Pin9}),
initIOTimerChannel(io_timers, {Timer::Timer5, Timer::Channel1}, {GPIO::PortA, GPIO::Pin0}),
initIOTimerChannelCapture(io_timers, {Timer::Timer8, Timer::Channel2}, {GPIO::PortC, GPIO::Pin7}),
};
constexpr io_timers_channel_mapping_t io_timers_channel_mapping =