Add IO timer channel mode for RPM and also sync up rpi configuration to work with all these drivers

This commit is contained in:
Matthias Grob 2024-12-12 15:35:18 +01:00
parent b85ad98a98
commit 077ade4f8f
9 changed files with 18 additions and 7 deletions

View File

@ -40,6 +40,7 @@ exception_list = [
'DRIVERS_DISTANCE_SENSOR_SRF05', # Requires hardcoded GPIO_ULTRASOUND
'DRIVERS_PPS_CAPTURE', # Requires PPS GPIO config
'DRIVERS_PWM_INPUT', # Requires PWM config
'DRIVERS_RPM_CAPTURE', # Requires PPS GPIO config
'DRIVERS_TEST_PPM', # PIN config not portable
'DRIVERS_TATTU_CAN', # Broken needs fixing
'MODULES_REPLAY', # Fails on NuttX targets maybe force POSIX dependency?

View File

@ -68,7 +68,8 @@ typedef enum io_timer_channel_mode_t {
IOTimerChanMode_Dshot = 6,
IOTimerChanMode_LED = 7,
IOTimerChanMode_PPS = 8,
IOTimerChanMode_Other = 9,
IOTimerChanMode_RPM = 9,
IOTimerChanMode_Other = 10,
IOTimerChanModeSize
} io_timer_channel_mode_t;

View File

@ -67,7 +67,8 @@ typedef enum io_timer_channel_mode_t {
IOTimerChanMode_Dshot = 6,
IOTimerChanMode_LED = 7,
IOTimerChanMode_PPS = 8,
IOTimerChanMode_Other = 9,
IOTimerChanMode_RPM = 9,
IOTimerChanMode_Other = 10,
IOTimerChanModeSize
} io_timer_channel_mode_t;

View File

@ -68,7 +68,8 @@ typedef enum io_timer_channel_mode_t {
IOTimerChanMode_Dshot = 6,
IOTimerChanMode_LED = 7,
IOTimerChanMode_PPS = 8,
IOTimerChanMode_Other = 9,
IOTimerChanMode_RPM = 9,
IOTimerChanMode_Other = 10,
IOTimerChanModeSize
} io_timer_channel_mode_t;

View File

@ -63,7 +63,8 @@ typedef enum io_timer_channel_mode_t {
IOTimerChanMode_Dshot = 6,
IOTimerChanMode_LED = 7,
IOTimerChanMode_PPS = 8,
IOTimerChanMode_Other = 9,
IOTimerChanMode_RPM = 9,
IOTimerChanMode_Other = 10,
IOTimerChanModeSize
} io_timer_channel_mode_t;

View File

@ -63,7 +63,8 @@ typedef enum io_timer_channel_mode_t {
IOTimerChanMode_Dshot = 6,
IOTimerChanMode_LED = 7,
IOTimerChanMode_PPS = 8,
IOTimerChanMode_Other = 9,
IOTimerChanMode_RPM = 9,
IOTimerChanMode_Other = 10,
IOTimerChanModeSize
} io_timer_channel_mode_t;

View File

@ -73,6 +73,10 @@ typedef enum io_timer_channel_mode_t {
IOTimerChanMode_OneShot = 4,
IOTimerChanMode_Trigger = 5,
IOTimerChanMode_Dshot = 6,
IOTimerChanMode_LED = 7,
IOTimerChanMode_PPS = 8,
IOTimerChanMode_RPM = 9,
IOTimerChanMode_Other = 10,
IOTimerChanModeSize
} io_timer_channel_mode_t;

View File

@ -79,7 +79,8 @@ typedef enum io_timer_channel_mode_t {
IOTimerChanMode_Dshot = 6,
IOTimerChanMode_LED = 7,
IOTimerChanMode_PPS = 8,
IOTimerChanMode_Other = 9,
IOTimerChanMode_RPM = 9,
IOTimerChanMode_Other = 10,
IOTimerChanModeSize
} io_timer_channel_mode_t;

View File

@ -77,7 +77,7 @@ bool RPMCapture::init()
return false;
}
int ret = io_timer_allocate_channel(_channel, IOTimerChanMode_Other); // TODO: add IOTimerChanMode_RPM
int ret = io_timer_allocate_channel(_channel, IOTimerChanMode_RPM);
if (ret != PX4_OK) {
PX4_ERR("gpio alloc failed (%i) for RPM at channel (%d)", ret, _channel);