new standalone drivers/system_power (split out of adc)

- system_power portion of drivers/adc split into a new standalone module (drivers/system_power)
 - additional availability flags added to system_power.msg so we know what boards even support (previously certain flags were faked if not available)
 - drivers/system_power scheduled at minimum rate by default, but now also scheduled immediately on any relevant GPIO events
 - now instead of running at 100 Hz with heavily reduced logging we can run at a minimal rate, log at full rate, and catch relevant changes immediately
This commit is contained in:
Daniel Agar
2021-01-16 14:20:54 -05:00
parent cee4016665
commit 3fff512ec0
127 changed files with 863 additions and 1017 deletions
@@ -123,7 +123,7 @@ void AEROFC_ADC::RunImpl()
adc_report.raw_data[i] = (buffer[i * 2] | (buffer[i * 2 + 1] << 8));
}
for (; i < PX4_MAX_ADC_CHANNELS; ++i) { // set unused channel id to -1
for (; i < adc_report_s::MAX_ADC_CHANNELS; ++i) { // set unused channel id to -1
adc_report.channel_id[i] = -1;
}
+5 -56
View File
@@ -42,20 +42,10 @@
#pragma once
/****************************************************************************************************
* Included Files
****************************************************************************************************/
#include <px4_platform_common/px4_config.h>
#include <nuttx/compiler.h>
#include <stdint.h>
/****************************************************************************************************
* Definitions
****************************************************************************************************/
/* Configuration ************************************************************************************/
/* PX4FMU GPIOs ***********************************************************************************/
/* LEDs */
#define GPIO_LED0 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTE|GPIO_PIN9)
#define GPIO_LED1 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTE|GPIO_PIN10)
@@ -89,34 +79,23 @@
#define ADC_BATTERY_VOLTAGE_CHANNEL 1
#define ADC_BATTERY_CURRENT_CHANNEL ((uint8_t)(-1))
/*
* Define Battery 1 Voltage Divider, using default for A/V
*/
/* Define Battery 1 Voltage Divider, using default for A/V */
#define BOARD_BATTERY1_V_DIV (9.0f)
#define DIRECT_PWM_OUTPUT_CHANNELS 1
#define BOARD_HAS_PWM 0
/*
* USB OTG FS
*/
/*
* RC Serial port
*/
/* RC Serial port */
#define RC_SERIAL_PORT "/dev/ttyS2" /* No HW invert support */
/*
* High-resolution timer
*/
/* High-resolution timer */
#define HRT_TIMER 3 /* use timer3 for the HRT */
#define HRT_TIMER_CHANNEL 4 /* use capture/compare channel */
#define FLASH_BASED_PARAMS
#define FLASH_BASED_DATAMAN
/*
* ESCs do not respond
*/
/* ESCs do not respond */
#define BOARD_TAP_ESC_MODE 1
#define MEMORY_CONSTRAINED_SYSTEM
@@ -125,42 +104,12 @@
__BEGIN_DECLS
/****************************************************************************************************
* Public Types
****************************************************************************************************/
/****************************************************************************************************
* Public data
****************************************************************************************************/
#ifndef __ASSEMBLY__
/****************************************************************************************************
* Public Functions
****************************************************************************************************/
/****************************************************************************************************
* Name: stm32_spiinitialize
*
* Description:
* Called to configure SPI chip select GPIO pins for the PX4FMU board.
*
****************************************************************************************************/
extern void stm32_spiinitialize(void);
#define board_peripheral_reset(ms)
/************************************************************************************
* Name: board_sdio_initialize
*
* Description:
* Called to configure SDIO.
*
************************************************************************************/
extern int board_sdio_initialize(void);
#include <px4_platform_common/board_common.h>
#endif /* __ASSEMBLY__ */