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 2020-08-08 14:24:58 -04:00
parent cee4016665
commit 3fff512ec0
127 changed files with 863 additions and 1017 deletions

View File

@ -12,9 +12,8 @@ if bst start -X
then
fi
if board_adc start
then
fi
board_adc start
system_power start
if sdp3x_airspeed start -X
then

View File

@ -45,6 +45,7 @@ px4_add_board(
pwm_out
rc_input
roboclaw
system_power
tap_esc
telemetry # all available telemetry drivers
test_ppm

View File

@ -4,6 +4,7 @@
#------------------------------------------------------------------------------
board_adc start
system_power start
# Internal I2C bus
hmc5883 -T -I -R 12 start

View File

@ -72,39 +72,24 @@
#define ADC_RC_RSSI_CHANNEL 11
#define ADC_AIRSPEED_VOLTAGE_CHANNEL 15
/* Define Battery 1 Voltage Divider and A per V
*/
/* Define Battery 1 Voltage Divider and A per V */
#define BOARD_BATTERY1_V_DIV (10.177939394f)
#define BOARD_BATTERY1_A_PER_V (15.391030303f)
/* Power supply control and monitoring GPIOs */
// #define GPIO_VDD_5V_PERIPH_EN (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTA|GPIO_PIN8)
// #define GPIO_VDD_BRICK_VALID (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTB|GPIO_PIN5)
// #define GPIO_VDD_SERVO_VALID (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTB|GPIO_PIN7)
// #define GPIO_VDD_3V3_SENSORS_EN (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTE|GPIO_PIN3)
// #define GPIO_VDD_5V_HIPOWER_OC (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTE|GPIO_PIN10)
// #define GPIO_VDD_5V_PERIPH_OC (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTE|GPIO_PIN15)
/* Tone alarm output */
#define TONE_ALARM_TIMER 14 /* timer 14 */
#define TONE_ALARM_CHANNEL 1 /* channel 1 */
#define GPIO_TONE_ALARM_IDLE (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTA|GPIO_PIN7)
#define GPIO_TONE_ALARM (GPIO_ALT|GPIO_AF9|GPIO_SPEED_2MHz|GPIO_PUSHPULL|GPIO_PORTA|GPIO_PIN7)
/* AUX PWMs
*/
/* AUX PWMs */
#define DIRECT_PWM_OUTPUT_CHANNELS 8
#define DIRECT_INPUT_TIMER_CHANNELS 8
/* USB OTG FS
*
* PA9 OTG_FS_VBUS VBUS sensing
*/
/* USB OTG FS */
#define GPIO_OTGFS_VBUS (GPIO_INPUT|GPIO_FLOAT|GPIO_SPEED_100MHz|GPIO_OPENDRAIN|GPIO_PORTA|GPIO_PIN9)
/* High-resolution timer */
#define HRT_TIMER 8 /* use timer8 for the HRT */
#define HRT_TIMER_CHANNEL 2 /* use capture/compare channel */
@ -143,46 +128,24 @@
#define SPEKTRUM_RX_AS_UART() px4_arch_configgpio(GPIO_USART1_RX)
#define SPEKTRUM_OUT(_one_true) px4_arch_gpiowrite(GPIO_PPM_IN_AS_OUT, (_one_true))
/* By Providing BOARD_ADC_USB_CONNECTED (using the px4_arch abstraction)
* this board support the ADC system_power interface, and therefore
* provides the true logic GPIO BOARD_ADC_xxxx macros.
*/
#define BOARD_ADC_USB_CONNECTED (px4_arch_gpioread(GPIO_OTGFS_VBUS))
#define BOARD_ADC_BRICK_VALID (1)
#define BOARD_ADC_SERVO_VALID (1)
#define BOARD_ADC_PERIPH_5V_OC (0)
#define BOARD_ADC_HIPOWER_5V_OC (0)
#define BOARD_HAS_PWM DIRECT_PWM_OUTPUT_CHANNELS
/* This board provides a DMA pool and APIs */
#define BOARD_DMA_ALLOC_POOL_SIZE 5120
/* This board provides the board_on_reset interface */
#define BOARD_HAS_ON_RESET 1
__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.
* Called to configure SPI chip select GPIO pins for the board.
*
****************************************************************************************************/
@ -190,10 +153,8 @@ extern void stm32_spiinitialize(void);
extern void stm32_usbinitialize(void);
#define board_peripheral_reset(ms)
#include <px4_platform_common/board_common.h>
#endif /* __ASSEMBLY__ */

View File

@ -49,11 +49,6 @@
#include <stm32_gpio.h>
/* Configuration ************************************************************************************/
#define BOARD_HAS_NBAT_V 1 // Only one Vbat to ADC
#define BOARD_HAS_NBAT_I 0 // No Ibat ADC
/*
* ADC channels
*
@ -88,18 +83,14 @@
#define ADC_CHANNELS \
((1 << ADC_BATTERY1_VOLTAGE_CHANNEL))
/* Define Battery 1 Voltage Divider and A per V
*/
/* Define Battery 1 Voltage Divider and A per V */
#define BOARD_BATTERY1_V_DIV (10.133333333f)
#define BOARD_BATTERY1_A_PER_V (36.367515152f)
/* HW has to large of R termination on ADC todo:change when HW value is chosen */
#define BOARD_ADC_OPEN_CIRCUIT_V (5.6f)
/* PWM
*/
/* PWM */
#define DIRECT_PWM_OUTPUT_CHANNELS 9
#define DIRECT_INPUT_TIMER_CHANNELS 9
@ -110,7 +101,6 @@
#define HRT_TIMER_CHANNEL 1 /* use capture/compare channel 3 */
/* RC Serial port */
#define RC_SERIAL_PORT "/dev/ttyS4"
/* Power switch controls ******************************************************/
@ -118,27 +108,9 @@
#define SDIO_SLOTNO 0 /* Only one slot */
#define SDIO_MINOR 0
/* SD card bringup does not work if performed on the IDLE thread because it
* will cause waiting. Use either:
*
* CONFIG_LIB_BOARDCTL=y, OR
* CONFIG_BOARD_INITIALIZE=y && CONFIG_BOARD_INITTHREAD=y
*/
#if defined(CONFIG_BOARD_INITIALIZE) && !defined(CONFIG_LIB_BOARDCTL) && !defined(CONFIG_BOARD_INITTHREAD)
# warning SDIO initialization cannot be perfomed on the IDLE thread
#endif
/* AV-X_V1 never powers off the Servo rail */
#define BOARD_ADC_SERVO_VALID (1)
#define ADC_BATTERY_VOLTAGE_CHANNEL 0
#define ADC_BATTERY_CURRENT_CHANNEL 1 // TODO: review
#define BOARD_ADC_PERIPH_5V_OC (!px4_arch_gpioread(GPIO_nVDD_5V_PERIPH_OC))
#define BOARD_ADC_HIPOWER_5V_OC (!px4_arch_gpioread(GPIO_nVDD_5V_HIPOWER_OC))
#define BOARD_HAS_PWM DIRECT_PWM_OUTPUT_CHANNELS
/* This board provides a DMA pool and APIs */

View File

@ -109,13 +109,6 @@
*/
#define GPIO_OTGFS_VBUS (GPIO_INPUT|GPIO_FLOAT|GPIO_SPEED_100MHz|GPIO_OPENDRAIN|GPIO_PORTA|GPIO_PIN9)
/*
* ADC channels
*
* These are the channel numbers of the ADCs of the microcontroller that can be used by the Px4 Firmware in the adc driver
*/
#define ADC_CHANNELS 0
/* Tone alarm output : These are only applicable when the buzzer deck is attached */
#define TONE_ALARM_TIMER 5 /* timer 5 */
#define TONE_ALARM_CHANNEL 3 /* channel 3 */
@ -123,9 +116,7 @@
#define GPIO_TONE_ALARM (GPIO_ALT|GPIO_AF2|GPIO_SPEED_2MHz|GPIO_PUSHPULL|GPIO_PORTA|GPIO_PIN2)
#define GPIO_TONE_ALARM_NEG (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_OUTPUT_CLEAR|GPIO_PORTA|GPIO_PIN3)
/* PWM
*/
/* PWM */
#define DIRECT_PWM_OUTPUT_CHANNELS 4
/* This board overrides the defaults by providing

View File

@ -50,6 +50,7 @@ px4_add_board(
rc_input
roboclaw
safety_button
system_power
tap_esc
telemetry # all available telemetry drivers
test_ppm

View File

@ -3,6 +3,7 @@
# board specific sensors init
#------------------------------------------------------------------------------
board_adc start
system_power start
# SPI1 (internal)
rm3100 -s start

View File

@ -110,8 +110,6 @@
#define DIRECT_PWM_OUTPUT_CHANNELS 8
/* Power supply control and monitoring GPIOs */
#define BOARD_NUMBER_BRICKS 2
#define GPIO_nPOWER_IN_ADC /* PG1 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTG|GPIO_PIN1)
#define GPIO_nPOWER_IN_CAN /* PG2 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTG|GPIO_PIN2)
#define GPIO_nPOWER_IN_C /* PG0 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTG|GPIO_PIN0)

View File

@ -53,6 +53,7 @@ px4_add_board(
rc_input
roboclaw
safety_button
system_power
tap_esc
telemetry # all available telemetry drivers
test_ppm

View File

@ -3,6 +3,7 @@
# CUAV X7Pro specific board sensors init
#------------------------------------------------------------------------------
board_adc start
system_power start
# SPI1 (internal)
#adis16470 -s start

View File

@ -110,8 +110,6 @@
#define DIRECT_PWM_OUTPUT_CHANNELS 8
/* Power supply control and monitoring GPIOs */
#define BOARD_NUMBER_BRICKS 2
#define GPIO_nPOWER_IN_ADC /* PG1 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTG|GPIO_PIN1)
#define GPIO_nPOWER_IN_CAN /* PG2 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTG|GPIO_PIN2)
#define GPIO_nPOWER_IN_C /* PG0 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTG|GPIO_PIN0)
@ -179,10 +177,7 @@
#define GPIO_LED_SAFETY FMU_LED_AMBER
/* By Providing BOARD_ADC_USB_CONNECTED (using the px4_arch abstraction)
* this board support the ADC system_power interface, and therefore
* provides the true logic GPIO BOARD_ADC_xxxx macros.
*/
#define BOARD_ADC_USB_CONNECTED (px4_arch_gpioread(GPIO_OTGFS_VBUS))
#define BOARD_ADC_USB_VALID (!px4_arch_gpioread(GPIO_nVDD_USB_VALID))
#define BOARD_ADC_BRICK1_VALID (!px4_arch_gpioread(GPIO_nVDD_BRICK1_VALID))

View File

@ -52,6 +52,7 @@ px4_add_board(
px4io
roboclaw
rpm
system_power
tap_esc
telemetry # all available telemetry drivers
test_ppm

View File

@ -52,6 +52,7 @@ px4_add_board(
px4io
roboclaw
rpm
system_power
tap_esc
telemetry # all available telemetry drivers
test_ppm

View File

@ -3,6 +3,7 @@
# Board specific sensors init
#------------------------------------------------------------------------------
board_adc start
system_power start
# SPI4
ms5611 -s -b 4 start

View File

@ -97,7 +97,6 @@
#define GPIO_PWM_VOLT_SEL /* PB4 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTB|GPIO_PIN4)
/* Power supply control and monitoring GPIOs */
#define BOARD_NUMBER_BRICKS 2
#define GPIO_nVDD_BRICK1_VALID /* PB5 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTB|GPIO_PIN5) // VDD_BRICK_VALID
#define GPIO_nVDD_BRICK2_VALID /* PB7 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTB|GPIO_PIN7) // VDD_BACKUP_VALID
#define GPIO_nVDD_USB_VALID /* PC0 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTC|GPIO_PIN0) // VBUS_VALID
@ -124,10 +123,7 @@
#define HRT_TIMER 8 /* use timer8 for the HRT */
#define HRT_TIMER_CHANNEL 3 /* use capture/compare channel 3 */
/* By Providing BOARD_ADC_USB_CONNECTED (using the px4_arch abstraction)
* this board support the ADC system_power interface, and therefore
* provides the true logic GPIO BOARD_ADC_xxxx macros.
*/
#define BOARD_ADC_USB_CONNECTED (px4_arch_gpioread(GPIO_OTGFS_VBUS))
#define BOARD_ADC_USB_VALID (!px4_arch_gpioread(GPIO_nVDD_USB_VALID))
#define BOARD_ADC_BRICK1_VALID (!px4_arch_gpioread(GPIO_nVDD_BRICK1_VALID))

View File

@ -51,6 +51,7 @@ px4_add_board(
px4io
roboclaw
rpm
system_power
tap_esc
telemetry # all available telemetry drivers
test_ppm

View File

@ -51,6 +51,7 @@ px4_add_board(
px4io
roboclaw
rpm
system_power
tap_esc
telemetry # all available telemetry drivers
test_ppm

View File

@ -3,6 +3,7 @@
# Board specific sensors init
#------------------------------------------------------------------------------
board_adc start
system_power start
# SPI4
ms5611 -s -b 4 start

View File

@ -97,7 +97,6 @@
#define GPIO_PWM_VOLT_SEL /* PB4 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTB|GPIO_PIN4)
/* Power supply control and monitoring GPIOs */
#define BOARD_NUMBER_BRICKS 2
#define GPIO_nVDD_BRICK1_VALID /* PB5 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTB|GPIO_PIN5) // VDD_BRICK_VALID
#define GPIO_nVDD_BRICK2_VALID /* PB7 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTB|GPIO_PIN7) // VDD_BACKUP_VALID
#define GPIO_nVDD_USB_VALID /* PC0 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTC|GPIO_PIN0) // VBUS_VALID
@ -124,10 +123,7 @@
#define HRT_TIMER 8 /* use timer8 for the HRT */
#define HRT_TIMER_CHANNEL 3 /* use capture/compare channel 3 */
/* By Providing BOARD_ADC_USB_CONNECTED (using the px4_arch abstraction)
* this board support the ADC system_power interface, and therefore
* provides the true logic GPIO BOARD_ADC_xxxx macros.
*/
#define BOARD_ADC_USB_CONNECTED (px4_arch_gpioread(GPIO_OTGFS_VBUS))
#define BOARD_ADC_USB_VALID (!px4_arch_gpioread(GPIO_nVDD_USB_VALID))
#define BOARD_ADC_BRICK1_VALID (!px4_arch_gpioread(GPIO_nVDD_BRICK1_VALID))

View File

@ -30,6 +30,7 @@ px4_add_board(
magnetometer/lsm9ds1_mag
pwm_out_sim
rc_input
system_power
#telemetry # all available telemetry drivers
MODULES
airspeed_selector

View File

@ -47,11 +47,9 @@
#define BOARD_MAX_LEDS 1 // Number of external LED's this board has
// I2C
#define PX4_NUMBER_I2C_BUSES 1
// ADC channels:
// A0 - board voltage (shows 5V)
// A1 - servo rail voltage

View File

@ -51,6 +51,7 @@ px4_add_board(
pwm_out
px4io
roboclaw
system_power
tap_esc
telemetry # all available telemetry drivers
test_ppm

View File

@ -3,6 +3,7 @@
# Holybro Durandal V1 specific board sensors init
#------------------------------------------------------------------------------
board_adc start
system_power start
# Internal SPI bus ICM-20689
icm20689 -R 2 -s start

View File

@ -70,11 +70,6 @@
/* Configuration ************************************************************************************/
# define BOARD_HAS_LTC44XX_VALIDS 2 // No LTC or N Bricks
# define BOARD_HAS_USB_VALID 1 // LTC Has No USB valid
# define BOARD_HAS_NBAT_V 2 // Only one Vbat to ADC
# define BOARD_HAS_NBAT_I 2 // No Ibat ADC
/* Holybro Durandal V1 GPIOs ************************************************************************/
/* LEDs are driven with push open drain to support Anode to 5V or 3.3V */
@ -95,11 +90,9 @@
*/
/* ADC defines to be used in sensors.cpp to read from a particular channel */
#define ADC1_CH(n) (n)
/* Define GPIO pins used as ADC N.B. Channel numbers must match below */
#define PX4_ADC_GPIO \
/* PA0 */ GPIO_ADC1_INP16, \
/* PA1 */ GPIO_ADC1_INP17, \
@ -213,7 +206,6 @@
#define GPIO_nVDD_BRICK1_VALID GPIO_nPOWER_IN_A /* Brick 1 Is Chosen */
#define GPIO_nVDD_BRICK2_VALID GPIO_nPOWER_IN_B /* Brick 2 Is Chosen */
#define BOARD_NUMBER_BRICKS 2
#define GPIO_nVDD_USB_VALID GPIO_nPOWER_IN_C /* USB Is Chosen */
#define GPIO_nVDD_5V_PERIPH_EN /* PG4 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTG|GPIO_PIN4)
@ -314,17 +306,10 @@
# warning SDIO initialization cannot be perfomed on the IDLE thread
#endif
/* By Providing BOARD_ADC_USB_CONNECTED (using the px4_arch abstraction)
* this board support the ADC system_power interface, and therefore
* provides the true logic GPIO BOARD_ADC_xxxx macros.
*/
#define BOARD_ADC_USB_CONNECTED (px4_arch_gpioread(GPIO_OTGFS_VBUS))
#define BOARD_ADC_USB_VALID (!px4_arch_gpioread(GPIO_nVDD_USB_VALID))
/* Board never powers off the Servo rail */
#define BOARD_ADC_SERVO_VALID (1)
#define BOARD_ADC_BRICK1_VALID (!px4_arch_gpioread(GPIO_nVDD_BRICK1_VALID))
#define BOARD_ADC_BRICK2_VALID (!px4_arch_gpioread(GPIO_nVDD_BRICK2_VALID))

View File

@ -49,12 +49,6 @@
#include <stm32_gpio.h>
/****************************************************************************************************
* Definitions
****************************************************************************************************/
/* GPIOs ***********************************************************************************/
/* LEDs are driven with push open drain to support Anode to 5V or 3.3V */
#define GPIO_nLED_BLUE /* PA2 */ (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTA|GPIO_PIN2)
@ -64,7 +58,6 @@
#define FLASH_BASED_PARAMS
/*
* ADC channels
*
@ -92,13 +85,11 @@
(1 << ADC_BATTERY_CURRENT_CHANNEL) | \
(1 << ADC_RSSI_IN_CHANNEL))
/* Define Battery 1 Voltage Divider and A per V
*/
/* Define Battery 1 Voltage Divider and A per V. */
#define BOARD_BATTERY1_V_DIV (10.9f)
#define BOARD_BATTERY1_A_PER_V (17.f)
/* PWM
*/
/* PWM */
#define DIRECT_PWM_OUTPUT_CHANNELS 6
#define DIRECT_INPUT_TIMER_CHANNELS 6
@ -106,10 +97,7 @@
#define GPIO_TONE_ALARM_IDLE /* PD15 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTD|GPIO_PIN15)
#define GPIO_TONE_ALARM_GPIO /* PD15 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTD|GPIO_PIN15)
/* USB OTG FS
*
* PA8 OTG_FS_VBUS VBUS sensing
*/
/* USB OTG FS PA8 OTG_FS_VBUS VBUS sensing */
#define GPIO_OTGFS_VBUS /* PA8 */ (GPIO_INPUT|GPIO_PULLDOWN|GPIO_SPEED_100MHz|GPIO_PORTA|GPIO_PIN8)
/* High-resolution timer */
@ -117,8 +105,7 @@
#define HRT_TIMER_CHANNEL 1 /* use capture/compare channel 1 */
/* RC Serial port */
#define RC_SERIAL_PORT "/dev/ttyS4"
#define RC_SERIAL_PORT "/dev/ttyS4"
#define GPIO_RSSI_IN /* PC5 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTC|GPIO_PIN5)
@ -142,20 +129,8 @@
__BEGIN_DECLS
/****************************************************************************************************
* Public Types
****************************************************************************************************/
/****************************************************************************************************
* Public data
****************************************************************************************************/
#ifndef __ASSEMBLY__
/****************************************************************************************************
* Public Functions
****************************************************************************************************/
/****************************************************************************************************
* Name: stm32_spiinitialize
*

View File

@ -55,6 +55,7 @@ px4_add_board(
roboclaw
rpm
safety_button
system_power
tap_esc
telemetry # all available telemetry drivers
test_ppm

View File

@ -4,6 +4,7 @@
#------------------------------------------------------------------------------
board_adc start
system_power start
# Internal SPI bus ICM-20602
icm20602 -s -R 2 start

View File

@ -68,26 +68,8 @@
#define PX4IO_SERIAL_CLOCK STM32_PCLK1_FREQUENCY
#define PX4IO_SERIAL_BITRATE 1500000 /* 1.5Mbps -> max rate for IO */
/* Configuration ************************************************************************************/
#define BOARD_HAS_LTC4417
#if defined(BOARD_HAS_LTC4417)
# define BOARD_HAS_LTC44XX_VALIDS 2 // No LTC or N Bricks
# define BOARD_HAS_USB_VALID 1 // LTC Has No USB valid
# define BOARD_HAS_NBAT_V 2 // Only one Vbat to ADC
# define BOARD_HAS_NBAT_I 2 // No Ibat ADC
#else
# define BOARD_HAS_LTC44XX_VALIDS 0 // No LTC or N Bricks
# define BOARD_HAS_USB_VALID 0 // LTC Has No USB valid
# define BOARD_HAS_NBAT_V 1 // Only one Vbat to ADC
# define BOARD_HAS_NBAT_I 0 // No Ibat ADC
#endif
/* PX4FMU GPIOs ***********************************************************************************/
/* LEDs are driven with push open drain to support Anode to 5V or 3.3V */
#define GPIO_nLED_RED /* PB1 */ (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTB|GPIO_PIN1)
#define GPIO_nLED_GREEN /* PC6 */ (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTC|GPIO_PIN6)
#define GPIO_nLED_BLUE /* PC7 */ (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTC|GPIO_PIN7)
@ -137,7 +119,6 @@
#define ADC_HW_REV_SENSE_CHANNEL /* PC3 */ ADC1_CH(13)
#define ADC1_SPARE_1_CHANNEL /* PC4 */ ADC1_CH(14)
#if BOARD_HAS_NBAT_V == 2 && BOARD_HAS_NBAT_I == 2
#define ADC_CHANNELS \
((1 << ADC_BATTERY1_VOLTAGE_CHANNEL) | \
(1 << ADC_BATTERY1_CURRENT_CHANNEL) | \
@ -150,41 +131,15 @@
(1 << ADC_HW_VER_SENSE_CHANNEL) | \
(1 << ADC_HW_REV_SENSE_CHANNEL) | \
(1 << ADC1_SPARE_1_CHANNEL))
#elif BOARD_HAS_NBAT_V == 1 && BOARD_HAS_NBAT_I == 1
#define ADC_CHANNELS \
((1 << ADC_BATTERY1_VOLTAGE_CHANNEL) | \
(1 << ADC_BATTERY1_CURRENT_CHANNEL) | \
(1 << ADC1_SPARE_2_CHANNEL) | \
(1 << ADC_RSSI_IN_CHANNEL) | \
(1 << ADC_SCALED_V5_CHANNEL) | \
(1 << ADC_SCALED_VDD_3V3_SENSORS_CHANNEL) | \
(1 << ADC_HW_VER_SENSE_CHANNEL) | \
(1 << ADC_HW_REV_SENSE_CHANNEL) | \
(1 << ADC1_SPARE_1_CHANNEL))
#elif BOARD_HAS_NBAT_V == 1 && BOARD_HAS_NBAT_I == 0
#define ADC_CHANNELS \
((1 << ADC_BATTERY1_VOLTAGE_CHANNEL) | \
(1 << ADC1_SPARE_2_CHANNEL) | \
(1 << ADC_RSSI_IN_CHANNEL) | \
(1 << ADC_SCALED_V5_CHANNEL) | \
(1 << ADC_SCALED_VDD_3V3_SENSORS_CHANNEL) | \
(1 << ADC_HW_VER_SENSE_CHANNEL) | \
(1 << ADC_HW_REV_SENSE_CHANNEL) | \
(1 << ADC1_SPARE_1_CHANNEL))
#endif
/* Define Battery 1 Voltage Divider and A per V
*/
/* Define Battery 1 Voltage Divider and A per V */
#define BOARD_BATTERY1_V_DIV (18.1f) /* measured with the provided PM board */
#define BOARD_BATTERY1_A_PER_V (36.367515152f)
/* HW has to large of R termination on ADC todo:change when HW value is chosen */
#define BOARD_ADC_OPEN_CIRCUIT_V (5.6f)
/* HW Version and Revision drive signals Default to 1 to detect */
#define BOARD_HAS_HW_VERSIONING
#define GPIO_HW_REV_DRIVE /* PH14 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTH|GPIO_PIN14)
@ -256,7 +211,6 @@
#define GPIO_nVDD_BRICK1_VALID GPIO_nPOWER_IN_A /* Brick 1 Is Chosen */
#define GPIO_nVDD_BRICK2_VALID GPIO_nPOWER_IN_B /* Brick 2 Is Chosen */
#define BOARD_NUMBER_BRICKS 2
#define GPIO_nVDD_USB_VALID GPIO_nPOWER_IN_C /* USB Is Chosen */
#define GPIO_nVDD_5V_PERIPH_EN /* PG4 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTG|GPIO_PIN4)
@ -380,43 +334,11 @@
# warning SDIO initialization cannot be perfomed on the IDLE thread
#endif
/* By Providing BOARD_ADC_USB_CONNECTED (using the px4_arch abstraction)
* this board support the ADC system_power interface, and therefore
* provides the true logic GPIO BOARD_ADC_xxxx macros.
*/
#define BOARD_ADC_USB_CONNECTED (px4_arch_gpioread(GPIO_OTGFS_VBUS))
#if BOARD_HAS_USB_VALID == 1
# define BOARD_ADC_USB_VALID (!px4_arch_gpioread(GPIO_nVDD_USB_VALID))
#else
# define BOARD_ADC_USB_VALID BOARD_ADC_USB_CONNECTED
#endif
/* FMUv5 never powers odd the Servo rail */
#define BOARD_ADC_SERVO_VALID (1)
#if !defined(BOARD_HAS_LTC44XX_VALIDS) || BOARD_HAS_LTC44XX_VALIDS == 0
# define BOARD_ADC_BRICK1_VALID (1)
# define BOARD_ADC_BRICK2_VALID (0)
#elif BOARD_HAS_LTC44XX_VALIDS == 1
# define BOARD_ADC_BRICK1_VALID (!px4_arch_gpioread(GPIO_nVDD_BRICK1_VALID))
# define BOARD_ADC_BRICK2_VALID (0)
#elif BOARD_HAS_LTC44XX_VALIDS == 2
# define BOARD_ADC_BRICK1_VALID (!px4_arch_gpioread(GPIO_nVDD_BRICK1_VALID))
# define BOARD_ADC_BRICK2_VALID (!px4_arch_gpioread(GPIO_nVDD_BRICK2_VALID))
#elif BOARD_HAS_LTC44XX_VALIDS == 3
# define BOARD_ADC_BRICK1_VALID (!px4_arch_gpioread(GPIO_nVDD_BRICK1_VALID))
# define BOARD_ADC_BRICK2_VALID (!px4_arch_gpioread(GPIO_nVDD_BRICK2_VALID))
# define BOARD_ADC_BRICK3_VALID (!px4_arch_gpioread(GPIO_nVDD_BRICK3_VALID))
#elif BOARD_HAS_LTC44XX_VALIDS == 4
# define BOARD_ADC_BRICK1_VALID (!px4_arch_gpioread(GPIO_nVDD_BRICK1_VALID))
# define BOARD_ADC_BRICK2_VALID (!px4_arch_gpioread(GPIO_nVDD_BRICK2_VALID))
# define BOARD_ADC_BRICK3_VALID (!px4_arch_gpioread(GPIO_nVDD_BRICK3_VALID))
# define BOARD_ADC_BRICK4_VALID (!px4_arch_gpioread(GPIO_nVDD_BRICK4_VALID))
#else
# error Unsupported BOARD_HAS_LTC44XX_VALIDS value
#endif
#define BOARD_ADC_USB_VALID (!px4_arch_gpioread(GPIO_nVDD_USB_VALID))
#define BOARD_ADC_BRICK1_VALID (!px4_arch_gpioread(GPIO_nVDD_BRICK1_VALID))
#define BOARD_ADC_BRICK2_VALID (!px4_arch_gpioread(GPIO_nVDD_BRICK2_VALID))
#define BOARD_ADC_PERIPH_5V_OC (!px4_arch_gpioread(GPIO_nVDD_5V_PERIPH_OC))
#define BOARD_ADC_HIPOWER_5V_OC (!px4_arch_gpioread(GPIO_nVDD_5V_HIPOWER_OC))

View File

@ -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;
}

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__ */

View File

@ -45,6 +45,7 @@ px4_add_board(
rc_input
roboclaw
safety_button
system_power
tap_esc
telemetry # all available telemetry drivers
test_ppm

View File

@ -4,6 +4,7 @@
#------------------------------------------------------------------------------
board_adc start
system_power start
# Start Digital power monitors
voxlpm -X -b 3 -k -T VBATT start

View File

@ -223,18 +223,6 @@
# warning SDIO initialization cannot be perfomed on the IDLE thread
#endif
/* By Providing BOARD_ADC_USB_CONNECTED (using the px4_arch abstraction)
* this board support the ADC system_power interface, and therefore
* provides the true logic GPIO BOARD_ADC_xxxx macros.
*/
#define BOARD_ADC_USB_CONNECTED (px4_arch_gpioread(GPIO_OTGFS_VBUS))
/* ModalAI FC-v1 never powers off the Servo rail */
#define BOARD_ADC_SERVO_VALID (1)
#define BOARD_ADC_BRICK_VALID (1)
#define BOARD_HAS_PWM DIRECT_PWM_OUTPUT_CHANNELS
/* This board provides a DMA pool and APIs */

View File

@ -49,6 +49,7 @@ px4_add_board(
rc_input
roboclaw
safety_button
system_power
tap_esc
telemetry # all available telemetry drivers
test_ppm

View File

@ -4,6 +4,7 @@
#------------------------------------------------------------------------------
board_adc start
system_power start
# Internal ICM-20602
icm20602 -s -b 1 -R 8 start

View File

@ -113,7 +113,6 @@
#define GPIO_nPOWER_IN_A /* PB5 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTB|GPIO_PIN5)
#define GPIO_nVDD_BRICK1_VALID GPIO_nPOWER_IN_A /* Brick 1 Is Chosen */
#define BOARD_NUMBER_BRICKS 1
#define GPIO_VDD_3V3_SPEKTRUM_POWER_EN /* PE4 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTE|GPIO_PIN4)
@ -168,13 +167,8 @@
#define SDIO_SLOTNO 0 /* Only one slot */
#define SDIO_MINOR 0
/* By Providing BOARD_ADC_USB_CONNECTED (using the px4_arch abstraction)
* this board support the ADC system_power interface, and therefore
* provides the true logic GPIO BOARD_ADC_xxxx macros.
*/
#define BOARD_ADC_USB_CONNECTED (px4_arch_gpioread(GPIO_OTGFS_VBUS))
#define BOARD_ADC_USB_VALID BOARD_ADC_USB_CONNECTED
#define BOARD_ADC_SERVO_VALID (1) /* never powers off the Servo rail */
#define BOARD_ADC_BRICK_VALID (!px4_arch_gpioread(GPIO_nVDD_BRICK1_VALID))
#define BOARD_HAS_PWM DIRECT_PWM_OUTPUT_CHANNELS

View File

@ -49,6 +49,7 @@ px4_add_board(
rc_input
roboclaw
rpm
system_power
tap_esc
telemetry # all available telemetry drivers
test_ppm

View File

@ -3,6 +3,7 @@
# Board specific sensors init
#------------------------------------------------------------------------------
board_adc start
system_power start
# Internal ICM-20602
icm20602 -s -b 1 -R 8 start

View File

@ -90,7 +90,6 @@
#define GPIO_nPOWER_IN_A /* PB5 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTB|GPIO_PIN5)
#define GPIO_nVDD_BRICK1_VALID GPIO_nPOWER_IN_A /* Brick 1 Is Chosen */
#define BOARD_NUMBER_BRICKS 1
#define GPIO_VDD_3V3_SPEKTRUM_POWER_EN /* PE4 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTE|GPIO_PIN4)
@ -142,8 +141,6 @@
* provides the true logic GPIO BOARD_ADC_xxxx macros.
*/
#define BOARD_ADC_USB_CONNECTED (px4_arch_gpioread(GPIO_OTGFS_VBUS))
#define BOARD_ADC_USB_VALID BOARD_ADC_USB_CONNECTED
#define BOARD_ADC_SERVO_VALID (1) /* never powers off the Servo rail */
#define BOARD_ADC_BRICK_VALID (!px4_arch_gpioread(GPIO_nVDD_BRICK1_VALID))
#define BOARD_HAS_PWM DIRECT_PWM_OUTPUT_CHANNELS

View File

@ -49,6 +49,7 @@ px4_add_board(
px4io
roboclaw
rpm
system_power
tap_esc
telemetry # all available telemetry drivers
test_ppm

View File

@ -3,6 +3,7 @@
# Board specific sensors init
#------------------------------------------------------------------------------
board_adc start
system_power start
# SPI1
ms5611 -s -b 1 start

View File

@ -108,15 +108,10 @@
#define PWMIN_TIMER_CHANNEL 2
#define GPIO_PWM_IN GPIO_TIM4_CH2IN_2
/* By Providing BOARD_ADC_USB_CONNECTED this board support the ADC
* system_power interface, and therefore provides the true logic
* GPIO BOARD_ADC_xxxx macros.
*/
#define BOARD_ADC_USB_CONNECTED (px4_arch_gpioread(GPIO_OTGFS_VBUS))
#define BOARD_ADC_BRICK_VALID (!px4_arch_gpioread(GPIO_VDD_BRICK_VALID))
#define BOARD_ADC_SERVO_VALID (1)
#define BOARD_ADC_PERIPH_5V_OC (!px4_arch_gpioread(GPIO_VDD_5V_PERIPH_OC))
#define BOARD_ADC_HIPOWER_5V_OC (0)
#define BOARD_HAS_PWM DIRECT_PWM_OUTPUT_CHANNELS

View File

@ -46,6 +46,7 @@ px4_add_board(
pwm_out
px4io
roboclaw
system_power
tap_esc
telemetry # all available telemetry drivers
test_ppm

View File

@ -4,6 +4,7 @@
#------------------------------------------------------------------------------
board_adc start
system_power start
# Internal SPI bus ICM-20608-G
icm20608g -s -R 8 start

View File

@ -119,15 +119,10 @@
#define PWMIN_TIMER_CHANNEL 2
#define GPIO_PWM_IN GPIO_TIM4_CH2IN_2
/* By Providing BOARD_ADC_USB_CONNECTED this board support the ADC
* system_power interface, and therefore provides the true logic
* GPIO BOARD_ADC_xxxx macros.
*/
#define BOARD_ADC_USB_CONNECTED (px4_arch_gpioread(GPIO_OTGFS_VBUS))
#define BOARD_ADC_BRICK_VALID (!px4_arch_gpioread(GPIO_VDD_BRICK_VALID))
#define BOARD_ADC_SERVO_VALID (1)
#define BOARD_ADC_PERIPH_5V_OC (!px4_arch_gpioread(GPIO_VDD_5V_PERIPH_OC))
#define BOARD_ADC_HIPOWER_5V_OC (0)
#define BOARD_HAS_PWM DIRECT_PWM_OUTPUT_CHANNELS

View File

@ -46,6 +46,7 @@ px4_add_board(
rc_input
roboclaw
safety_button
system_power
tap_esc
telemetry # all available telemetry drivers
#test_ppm # NOT Portable YET

View File

@ -4,6 +4,7 @@
#------------------------------------------------------------------------------
board_adc start
system_power start
# Internal Mag I2C bus roll 180, yaw 90
bmm150 -I -R 10 start

View File

@ -45,6 +45,7 @@ px4_add_board(
rc_input
roboclaw
safety_button
system_power
tap_esc
telemetry # all available telemetry drivers
#test_ppm # NOT Portable YET

View File

@ -275,11 +275,6 @@ __END_DECLS
#define GPIO_ULTRASOUND_TRIGGER /* PTD0 */ (GPIO_LOWDRIVE | GPIO_OUTPUT_ZERO | PIN_PORTD | PIN0)
#define GPIO_ULTRASOUND_ECHO /* PTA10 */ (GPIO_PULLUP | PIN_INT_BOTH | PIN_PORTA | PIN10)
/* Power supply control and monitoring GPIOs */
// None
#define GPIO_PERIPH_3V3_EN 0
/* Tone alarm output PTA11 - TMP 2_CH1 is On +P12-4, -P12-5
* It is driving a NPN
@ -318,17 +313,7 @@ __END_DECLS
#define SPEKTRUM_POWER(on_true) VDD_3V3_SPEKTRUM_POWER_EN((on_true))
/*
* By Providing BOARD_ADC_USB_CONNECTED (using the px4_arch abstraction)
* this board support the ADC system_power interface, and therefore
* provides the true logic GPIO BOARD_ADC_xxxx macros.
*/
#define BOARD_ADC_USB_CONNECTED (px4_arch_gpioread(GPIO_USB_VBUS_VALID))
#define BOARD_ADC_BRICK_VALID (1)
#define BOARD_ADC_SERVO_VALID (1)
#define BOARD_ADC_PERIPH_5V_OC (0)
#define BOARD_ADC_HIPOWER_5V_OC (0)
#define BOARD_HAS_PWM DIRECT_PWM_OUTPUT_CHANNELS

View File

@ -46,6 +46,7 @@ px4_add_board(
rc_input
roboclaw
safety_button
system_power
tap_esc
telemetry # all available telemetry drivers
#test_ppm # NOT Portable YET

View File

@ -11,4 +11,3 @@ fi
rgbled_pwm start
safety_button start

View File

@ -4,6 +4,7 @@
#------------------------------------------------------------------------------
board_adc start
system_power start
# Internal Mag I2C bus roll 180, yaw 90
bmm150 -I -R 10 start

View File

@ -45,6 +45,7 @@ px4_add_board(
rc_input
roboclaw
safety_button
system_power
tap_esc
telemetry # all available telemetry drivers
#test_ppm # NOT Portable YET

View File

@ -45,6 +45,7 @@ px4_add_board(
rc_input
roboclaw
safety_button
system_power
tap_esc
telemetry # all available telemetry drivers
#test_ppm # NOT Portable YET

View File

@ -39,9 +39,6 @@
#pragma once
/****************************************************************************************************
* Included Files
****************************************************************************************************/
#include <px4_platform_common/px4_config.h>
#include <nuttx/compiler.h>
#include <stdint.h>
@ -55,7 +52,6 @@ __BEGIN_DECLS
__END_DECLS
/* FMUK66 GPIOs ***********************************************************************************/
/* LEDs */
/* An RGB LED is connected through GPIO as shown below:
* TBD (no makring on schematic)
@ -96,9 +92,7 @@ __END_DECLS
#define HRT_TIMER 1 /* TPM1 timer for the HRT */
#define HRT_TIMER_CHANNEL 0 /* Use capture/compare channel 0 */
/* PPM IN
*/
/* PPM IN */
#define HRT_PPM_CHANNEL 1 /* Use TPM1 capture/compare channel 1 */
#define GPIO_PPM_IN PIN_TPM1_CH1_1 /* PTC3 USART1 RX and PTA9 and PIN_TPM1_CH1 AKA FrSky_IN_RC_IN */
@ -123,7 +117,6 @@ __END_DECLS
* as an input Therefore we drive are UARTx_RX (normaly an input) as an
* output
*/
#define GPIO_PPM_IN_AS_OUT (GPIO_HIGHDRIVE | GPIO_OUTPUT_ONE | PIN_PORTC | PIN3)
#define SPEKTRUM_RX_AS_GPIO_OUTPUT() px4_arch_configgpio(GPIO_PPM_IN_AS_OUT)
@ -131,7 +124,6 @@ __END_DECLS
#define SPEKTRUM_OUT(_one_true) px4_arch_gpiowrite(GPIO_PPM_IN_AS_OUT, (_one_true))
/* RC input */
#define RC_SERIAL_PORT "/dev/ttyS2" /* UART1 */
#define GPIO_RSSI_IN PIN_ADC1_SE13
@ -140,7 +132,6 @@ __END_DECLS
* Uninitialized to Reset Disabled and Inhibited
* All pins driven low to not back feed when power is off
*/
#define nGPIO_ETHERNET_P_EN (GPIO_LOWDRIVE | GPIO_OUTPUT_ONE | PIN_PORTB | PIN3)
#define GPIO_ENET_RST (GPIO_LOWDRIVE | GPIO_OUTPUT_ZERO | PIN_PORTA | PIN28)
#define GPIO_ENET_EN (GPIO_LOWDRIVE | GPIO_OUTPUT_ZERO | PIN_PORTA | PIN29)
@ -200,7 +191,6 @@ __END_DECLS
#define GPIO_A_RST (GPIO_LOWDRIVE | GPIO_OUTPUT_ONE | PIN_PORTA | PIN25)
/* Sensor interrupts */
#define GPIO_EXTI_GYRO_INT1 (GPIO_PULLUP | PIN_INT_BOTH | PIN_PORTE | PIN7)
#define GPIO_EXTI_GYRO_INT2 (GPIO_PULLUP | PIN_INT_BOTH | PIN_PORTE | PIN6)
#define GPIO_EXTI_ACCEL_MAG_INT1 (GPIO_PULLUP | PIN_INT_BOTH | PIN_PORTE | PIN9)
@ -218,12 +208,10 @@ __END_DECLS
* Only ADC1 is used
* Bits 31:0 are ADC1 channels 31:0
*/
#define ADC1_CH(c) (((c) & 0x1f)) /* Define ADC number Channel number */
#define ADC1_GPIO(n) PIN_ADC1_SE##n
/* ADC defines to be used in sensors.cpp to read from a particular channel */
#define ADC_USB_VBUS_VALID ADC1_CH(0) /* USB_VBUS_VALID 29 - ADC1_DP0 */
#define ADC_BATTERY_VOLTAGE_CHANNEL ADC1_CH(10) /* BAT_VSENS 85 PTB4 ADC1_SE10 */
#define ADC_BATTERY_CURRENT_CHANNEL ADC1_CH(11) /* BAT_ISENS 86 PTB5 ADC1_SE11 */
@ -234,7 +222,6 @@ __END_DECLS
#define ADC_AD3 ADC1_CH(23) /* AD3 39 - ADC1_SE23 */
/* Mask use to initialize the ADC driver */
#define ADC_CHANNELS ((1 << ADC_USB_VBUS_VALID) | \
(1 << ADC_BATTERY_VOLTAGE_CHANNEL) | \
(1 << ADC_BATTERY_CURRENT_CHANNEL) | \
@ -253,15 +240,9 @@ __END_DECLS
/* PTB6 ADC1_SE12 */ ADC1_GPIO(12), \
/* PTB7 ADC1_SE13 */ ADC1_GPIO(13)
#define BOARD_BATTERY1_V_DIV (10.177939394f)
#define BOARD_BATTERY1_A_PER_V (15.391030303f)
/* User GPIOs
*
*/
/* Define Battery 1 Voltage Divider and A per V. */
#define BOARD_BATTERY1_V_DIV (10.177939394f)
#define BOARD_BATTERY1_A_PER_V (15.391030303f)
/* Timer I/O PWM and capture
*
@ -279,11 +260,6 @@ __END_DECLS
#define GPIO_ULTRASOUND_TRIGGER /* PTD0 */ (GPIO_LOWDRIVE | GPIO_OUTPUT_ZERO | PIN_PORTD | PIN0)
#define GPIO_ULTRASOUND_ECHO /* PTA10 */ (GPIO_PULLUP | PIN_INT_BOTH | PIN_PORTA | PIN10)
/* Power supply control and monitoring GPIOs */
// None
#define GPIO_PERIPH_3V3_EN 0
/* Tone alarm output PTA11 - TMP 2_CH1 is On +P12-4, -P12-5
* It is driving a NPN
@ -322,17 +298,7 @@ __END_DECLS
#define SPEKTRUM_POWER(on_true) VDD_3V3_SPEKTRUM_POWER_EN((on_true))
/*
* By Providing BOARD_ADC_USB_CONNECTED (using the px4_arch abstraction)
* this board support the ADC system_power interface, and therefore
* provides the true logic GPIO BOARD_ADC_xxxx macros.
*/
#define BOARD_ADC_USB_CONNECTED (px4_arch_gpioread(GPIO_USB_VBUS_VALID))
#define BOARD_ADC_BRICK_VALID (1)
#define BOARD_ADC_SERVO_VALID (1)
#define BOARD_ADC_PERIPH_5V_OC (0)
#define BOARD_ADC_HIPOWER_5V_OC (0)
#define BOARD_HAS_PWM DIRECT_PWM_OUTPUT_CHANNELS
@ -421,18 +387,10 @@ __END_DECLS
#define BOARD_NUM_IO_TIMERS 3
/************************************************************************************
* Public data
************************************************************************************/
__BEGIN_DECLS
#ifndef __ASSEMBLY__
/************************************************************************************
* Public Functions
************************************************************************************/
/************************************************************************************
* Name: fmuk66_spidev_initialize
*

View File

@ -45,6 +45,7 @@ px4_add_board(
rc_input
roboclaw
safety_button
#system_power # REVIEW
tap_esc
telemetry # all available telemetry drivers
tone_alarm

View File

@ -16,6 +16,7 @@
#------------------------------------------------------------------------------
board_adc start
system_power start
# Internal SPI bus ICM-20602
icm20602 -R 2 -s start

View File

@ -265,7 +265,6 @@
#define GPIO_nVDD_BRICK1_VALID GPIO_nPOWER_IN_A /* Brick 1 Is Chosen */
#define GPIO_nVDD_BRICK2_VALID GPIO_nPOWER_IN_B /* Brick 2 Is Chosen */
#define BOARD_NUMBER_BRICKS 2
#define GPIO_nVDD_USB_VALID GPIO_nPOWER_IN_C /* USB Is Chosen */
#define OC_INPUT_IOMUX (IOMUX_CMOS_INPUT | IOMUX_PULL_NONE | IOMUX_DRIVE_HIZ)
@ -372,18 +371,10 @@
# warning SDIO initialization cannot be perfomed on the IDLE thread
#endif
/* By Providing BOARD_ADC_USB_CONNECTED (using the px4_arch abstraction)
* this board support the ADC system_power interface, and therefore
* provides the true logic GPIO BOARD_ADC_xxxx macros.
*/
#define BOARD_ADC_USB_VALID (!px4_arch_gpioread(GPIO_nVDD_USB_VALID))
#define BOARD_ADC_USB_CONNECTED (board_read_VBUS_state() == 0)
/* FMUv5 never powers odd the Servo rail */
#define BOARD_ADC_SERVO_VALID (1)
#define BOARD_ADC_BRICK1_VALID (!px4_arch_gpioread(GPIO_nVDD_BRICK1_VALID))
#define BOARD_ADC_BRICK2_VALID (!px4_arch_gpioread(GPIO_nVDD_BRICK2_VALID))

View File

@ -47,12 +47,6 @@
#include <nuttx/compiler.h>
#include <stdint.h>
/****************************************************************************************************
* Definitions
****************************************************************************************************/
/* Configuration ************************************************************************************/
/* omnibusf4sd GPIOs ***********************************************************************************/
/* LEDs */
// power - green
// LED1 - PB5 - blue
@ -63,9 +57,8 @@
#define FLASH_BASED_PARAMS
/*
* ADC channels
*
/**
* ADC channels:
* These are the channel numbers of the ADCs of the microcontroller that can be used by the Px4 Firmware in the adc driver
*/
#define ADC_CHANNELS (1 << 0) | (1 << 11) | (1 << 12)
@ -74,8 +67,7 @@
#define ADC_BATTERY_CURRENT_CHANNEL 11
#define ADC_RC_RSSI_CHANNEL 0
/* Define Battery 1 Voltage Divider and A per V
*/
/* Define Battery 1 Voltage Divider and A per V */
#define BOARD_BATTERY1_V_DIV (11.12f)
#define BOARD_BATTERY1_A_PER_V (31.f)
@ -108,16 +100,10 @@
//#define GPIO_GPIO4_OUTPUT _MK_GPIO_OUTPUT(GPIO_TIM5_CH2OUT)
//#define GPIO_GPIO5_OUTPUT _MK_GPIO_OUTPUT(GPIO_TIM1_CH1OUT)
/* USB OTG FS
*
* PA9 OTG_FS_VBUS VBUS sensing
*/
/* USB OTG FS PA9 OTG_FS_VBUS VBUS sensing */
#define GPIO_OTGFS_VBUS (GPIO_INPUT|GPIO_FLOAT|GPIO_SPEED_100MHz|GPIO_OPENDRAIN|GPIO_PORTC|GPIO_PIN5)
/* PWM
*
* Alternatively CH3/CH4 could be assigned to UART6_TX/RX
*/
/* PWM Alternatively CH3/CH4 could be assigned to UART6_TX/RX */
#define DIRECT_PWM_OUTPUT_CHANNELS 4
#define DIRECT_INPUT_TIMER_CHANNELS 4
@ -160,20 +146,8 @@
__BEGIN_DECLS
/****************************************************************************************************
* Public Types
****************************************************************************************************/
/****************************************************************************************************
* Public data
****************************************************************************************************/
#ifndef __ASSEMBLY__
/****************************************************************************************************
* Public Functions
****************************************************************************************************/
/****************************************************************************************************
* Name: stm32_spiinitialize
*
@ -184,15 +158,6 @@ __BEGIN_DECLS
extern void stm32_spiinitialize(void);
/****************************************************************************************************
* Name: stm32_usbinitialize
*
* Description:
* Called to configure USB IO.
*
****************************************************************************************************/
extern void stm32_usbinitialize(void);
extern void board_peripheral_reset(int ms);

View File

@ -61,6 +61,7 @@ px4_add_board(
pwm_out
px4io
#roboclaw
system_power
#tap_esc
#telemetry # all available telemetry drivers
#test_ppm

View File

@ -7,6 +7,7 @@ rgbled start -I
rgbled_ncp5623c start -I
board_adc start
system_power start
# Internal I2C bus
hmc5883 -T -I -R 4 start

View File

@ -108,9 +108,7 @@
#define ADC_5V_RAIL_SENSE 4
#define ADC_AIRSPEED_VOLTAGE_CHANNEL 15
/* Define Battery 1 Voltage Divider and A per V
*/
/* Define Battery 1 Voltage Divider and A per V */
#define BOARD_BATTERY1_V_DIV (10.177939394f)
#define BOARD_BATTERY1_A_PER_V (15.391030303f)
@ -148,10 +146,7 @@
#define PWMIN_TIMER_CHANNEL 2
#define GPIO_PWM_IN GPIO_TIM4_CH2IN_2
/* By Providing BOARD_ADC_USB_CONNECTED (using the px4_arch abstraction)
* this board support the ADC system_power interface, and therefore
* provides the true logic GPIO BOARD_ADC_xxxx macros.
*/
#define BOARD_ADC_USB_CONNECTED (px4_arch_gpioread(GPIO_OTGFS_VBUS))
#define BOARD_ADC_BRICK_VALID (!px4_arch_gpioread(GPIO_VDD_BRICK_VALID))
#define BOARD_ADC_SERVO_VALID (!px4_arch_gpioread(GPIO_VDD_SERVO_VALID))

View File

@ -56,6 +56,7 @@ px4_add_board(
pwm_out
px4io
#roboclaw
system_power
#tap_esc
#telemetry # all available telemetry drivers
#test_ppm

View File

@ -57,6 +57,7 @@ px4_add_board(
pwm_out
px4io
roboclaw
system_power
tap_esc
telemetry # all available telemetry drivers
test_ppm

View File

@ -7,6 +7,7 @@ rgbled start -I
rgbled_ncp5623c start -I
board_adc start
system_power start
# Internal I2C bus
hmc5883 -T -I -R 4 start

View File

@ -55,6 +55,7 @@ px4_add_board(
pwm_out
px4io
roboclaw
system_power
tap_esc
telemetry # all available telemetry drivers
test_ppm

View File

@ -108,9 +108,7 @@
#define ADC_5V_RAIL_SENSE 4
#define ADC_AIRSPEED_VOLTAGE_CHANNEL 15
/* Define Battery 1 Voltage Divider and A per V
*/
/* Define Battery 1 Voltage Divider and A per V */
#define BOARD_BATTERY1_V_DIV (10.177939394f)
#define BOARD_BATTERY1_A_PER_V (15.391030303f)
@ -148,10 +146,7 @@
#define PWMIN_TIMER_CHANNEL 2
#define GPIO_PWM_IN GPIO_TIM4_CH2IN_2
/* By Providing BOARD_ADC_USB_CONNECTED (using the px4_arch abstraction)
* this board support the ADC system_power interface, and therefore
* provides the true logic GPIO BOARD_ADC_xxxx macros.
*/
#define BOARD_ADC_USB_CONNECTED (px4_arch_gpioread(GPIO_OTGFS_VBUS))
#define BOARD_ADC_BRICK_VALID (!px4_arch_gpioread(GPIO_VDD_BRICK_VALID))
#define BOARD_ADC_SERVO_VALID (!px4_arch_gpioread(GPIO_VDD_SERVO_VALID))

View File

@ -51,6 +51,7 @@ px4_add_board(
pwm_out
px4io
roboclaw
system_power
tap_esc
telemetry # all available telemetry drivers
test_ppm

View File

@ -53,6 +53,7 @@ px4_add_board(
rc_input
roboclaw
safety_button
system_power
tap_esc
telemetry # all available telemetry drivers
test_ppm

View File

@ -4,6 +4,7 @@
#------------------------------------------------------------------------------
board_adc start
system_power start
# We know there are sketchy boards out there
# as chinese companies produce Pixracers without

View File

@ -49,6 +49,7 @@ px4_add_board(
rc_input
roboclaw
safety_button
system_power
tap_esc
telemetry # all available telemetry drivers
test_ppm

View File

@ -39,20 +39,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_LED1 (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN11)
#define GPIO_LED2 (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTB|GPIO_PIN1)
@ -98,18 +88,11 @@
#define GPIO_TONE_ALARM_IDLE (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTA|GPIO_PIN15)
#define GPIO_TONE_ALARM (GPIO_ALT|GPIO_AF1|GPIO_SPEED_2MHz|GPIO_PUSHPULL|GPIO_PORTA|GPIO_PIN15)
/**
* PWM:
*
* Six PWM outputs are configured.
*/
/* PWM: Six PWM outputs are configured */
#define DIRECT_PWM_OUTPUT_CHANNELS 6
#define DIRECT_INPUT_TIMER_CHANNELS 6
/**
* USB OTG FS:
* PA9 OTG_FS_VBUS VBUS sensing.
*/
/* USB OTG FS: PA9 OTG_FS_VBUS VBUS sensing. */
#define GPIO_OTGFS_VBUS (GPIO_INPUT|GPIO_FLOAT|GPIO_SPEED_100MHz|GPIO_OPENDRAIN|GPIO_PORTA|GPIO_PIN9)
/* High-resolution timer */
@ -120,7 +103,6 @@
#define GPIO_PPM_IN (GPIO_ALT|GPIO_AF2|GPIO_PULLUP|GPIO_PORTB|GPIO_PIN0)
/* RC Serial port */
#define RC_SERIAL_PORT "/dev/ttyS4"
/* PWM input driver. Use FMU AUX5 pins attached to timer4 channel 2. */
@ -149,7 +131,6 @@
#define GPIO_HEATER_OUTPUT (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTC|GPIO_PIN6)
/* Power switch controls */
#define SPEKTRUM_POWER(_on_true) px4_arch_gpiowrite(GPIO_SPEKTRUM_PWR_EN, (!_on_true))
/**
@ -166,17 +147,9 @@
#define SPEKTRUM_RX_AS_UART() /* Can be left as uart */
#define SPEKTRUM_OUT(_one_true) px4_arch_gpiowrite(GPIO_PPM_IN_AS_OUT, (_one_true))
/**
* By Providing BOARD_ADC_USB_CONNECTED (using the px4_arch abstraction)
* this board support the ADC system_power interface, and therefore
* provides the true logic GPIO BOARD_ADC_xxxx macros.
*/
#define BOARD_ADC_USB_CONNECTED (px4_arch_gpioread(GPIO_OTGFS_VBUS))
#define BOARD_ADC_BRICK_VALID (px4_arch_gpioread(GPIO_VDD_BRICK_VALID))
#define BOARD_ADC_USB_VALID (px4_arch_gpioread(GPIO_VDD_USB_VALID))
#define BOARD_ADC_SERVO_VALID (1)
#define BOARD_ADC_PERIPH_5V_OC (0)
#define BOARD_ADC_HIPOWER_5V_OC (0)
#define BOARD_HAS_PWM DIRECT_PWM_OUTPUT_CHANNELS
@ -189,25 +162,13 @@
__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.
* Called to configure SPI chip select GPIO pins for the board.
*
****************************************************************************************************/

View File

@ -49,6 +49,7 @@ px4_add_board(
rc_input
#roboclaw
safety_button
system_power
tap_esc
telemetry # all available telemetry drivers
test_ppm

View File

@ -50,6 +50,7 @@ px4_add_board(
pwm_out
px4io
roboclaw
system_power
tap_esc
telemetry # all available telemetry drivers
test_ppm

View File

@ -7,6 +7,7 @@ rgbled start -I
rgbled_ncp5623c start -I
board_adc start
system_power start
# Internal SPI bus ICM-20602 or ICM-20608-G
if ! icm20602 -s -R 8 start

View File

@ -48,6 +48,7 @@ px4_add_board(
pwm_out
px4io
roboclaw
system_power
tap_esc
telemetry # all available telemetry drivers
test_ppm

View File

@ -104,7 +104,7 @@
#define ADC_BATTERY1_VOLTAGE_CHANNEL 2 // PA2
#define ADC_BATTERY1_CURRENT_CHANNEL 3 // PA3
#define ADC_5V_RAIL_SENSE 4 // PA4
#define ADC_5V_RAIL_SENSE 4 // PA4
#define ADC_BATTERY2_VOLTAGE_CHANNEL 11 // PC1
#define ADC_BATTERY2_CURRENT_CHANNEL 13 // PC3
@ -131,8 +131,7 @@
/* Power supply control and monitoring GPIOs */
#define GPIO_nVDD_BRICK1_VALID (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTB|GPIO_PIN5)
#define GPIO_nVDD_BRICK2_VALID (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTG|GPIO_PIN5)
#define BOARD_NUMBER_BRICKS 2
#define GPIO_nVDD_USB_VALID (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTC|GPIO_PIN0)
#define GPIO_nVDD_USB_VALID (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTC|GPIO_PIN0)
#define GPIO_VDD_3V3_PERIPH_EN (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTC|GPIO_PIN5)
#define GPIO_VDD_5V_PERIPH_EN (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTG|GPIO_PIN10)
#define GPIO_VDD_5V_HIPOWER_EN (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTF|GPIO_PIN4)
@ -145,8 +144,7 @@
#define GPIO_TONE_ALARM_IDLE (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTA|GPIO_PIN15)
#define GPIO_TONE_ALARM (GPIO_ALT|GPIO_AF1|GPIO_SPEED_2MHz|GPIO_PUSHPULL|GPIO_PORTA|GPIO_PIN15)
/* PWM
*/
/* PWM */
#define DIRECT_PWM_OUTPUT_CHANNELS 6
#define DIRECT_INPUT_TIMER_CHANNELS 6
@ -184,15 +182,11 @@
* the connector interface and Spektrum requires VDD 3v3 to be controllable
*/
/* By Providing BOARD_ADC_USB_CONNECTED (using the px4_arch abstraction)
* this board support the ADC system_power interface, and therefore
* provides the true logic GPIO BOARD_ADC_xxxx macros.
*/
#define BOARD_ADC_USB_CONNECTED (px4_arch_gpioread(GPIO_OTGFS_VBUS))
#define BOARD_ADC_BRICK1_VALID (!px4_arch_gpioread(GPIO_nVDD_BRICK1_VALID))
#define BOARD_ADC_BRICK2_VALID (!px4_arch_gpioread(GPIO_nVDD_BRICK2_VALID))
#define BOARD_ADC_USB_VALID (!px4_arch_gpioread(GPIO_nVDD_USB_VALID))
#define BOARD_ADC_SERVO_VALID (1)
#define BOARD_ADC_PERIPH_5V_OC (!px4_arch_gpioread(GPIO_VDD_5V_PERIPH_OC))
#define BOARD_ADC_HIPOWER_5V_OC (!px4_arch_gpioread(GPIO_VDD_5V_HIPOWER_OC))

View File

@ -53,6 +53,7 @@ px4_add_board(
rc_input
roboclaw
safety_button
system_power
tap_esc
telemetry # all available telemetry drivers
test_ppm

View File

@ -56,6 +56,7 @@ px4_add_board(
#roboclaw
rpm
safety_button
system_power
#tap_esc
telemetry # all available telemetry drivers
test_ppm

View File

@ -56,6 +56,7 @@ px4_add_board(
roboclaw
rpm
safety_button
system_power
tap_esc
telemetry # all available telemetry drivers
test_ppm

View File

@ -41,6 +41,7 @@ px4_add_board(
px4io
rc_input
safety_button
system_power
telemetry # all available telemetry drivers
tone_alarm
uavcan

View File

@ -4,6 +4,7 @@
#------------------------------------------------------------------------------
board_adc start
system_power start
# Internal SPI bus ICM-20602
icm20602 -s -R 2 -q start

View File

@ -54,6 +54,7 @@ px4_add_board(
roboclaw
rpm
safety_button
system_power
tap_esc
telemetry # all available telemetry drivers
test_ppm

View File

@ -46,6 +46,7 @@ px4_add_board(
rc_input
roboclaw
safety_button
system_power
tap_esc
telemetry # all available telemetry drivers
tone_alarm

View File

@ -49,6 +49,7 @@ px4_add_board(
rc_input
#roboclaw
safety_button
system_power
#tap_esc
#telemetry # all available telemetry drivers
test_ppm

View File

@ -54,6 +54,7 @@ px4_add_board(
roboclaw
rpm
safety_button
system_power
tap_esc
telemetry # all available telemetry drivers
test_ppm

View File

@ -173,18 +173,14 @@
(1 << ADC1_SPARE_1_CHANNEL))
#endif
/* Define Battery 1 Voltage Divider and A per V
*/
/* Define Battery 1 Voltage Divider and A per V */
#define BOARD_BATTERY1_V_DIV (18.1f) /* measured with the provided PM board */
#define BOARD_BATTERY1_A_PER_V (36.367515152f)
/* HW has to large of R termination on ADC todo:change when HW value is chosen */
#define BOARD_ADC_OPEN_CIRCUIT_V (5.6f)
/* HW Version and Revision drive signals Default to 1 to detect */
#define BOARD_HAS_HW_VERSIONING
#define GPIO_HW_REV_DRIVE /* PH14 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTH|GPIO_PIN14)
@ -194,20 +190,15 @@
#define HW_INFO_INIT {'V','5','x', 'x',0}
#define HW_INFO_INIT_VER 2
#define HW_INFO_INIT_REV 3
/* CAN Silence
*
* Silent mode control \ ESC Mux select
*/
/* CAN Silence Silent mode control \ ESC Mux select */
#define GPIO_CAN1_SILENT_S0 /* PH2 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTH|GPIO_PIN2)
#define GPIO_CAN2_SILENT_S1 /* PH3 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTH|GPIO_PIN3)
#define GPIO_CAN3_SILENT_S2 /* PH4 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTH|GPIO_PIN4)
#define UAVCAN_NUM_IFACES_RUNTIME 1
/* HEATER
* PWM in future
*/
/* HEATER PWM in future */
#define GPIO_HEATER_OUTPUT /* PA7 T14CH1 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTA|GPIO_PIN7)
/* PWM Capture
@ -256,7 +247,6 @@
#define GPIO_nVDD_BRICK1_VALID GPIO_nPOWER_IN_A /* Brick 1 Is Chosen */
#define GPIO_nVDD_BRICK2_VALID GPIO_nPOWER_IN_B /* Brick 2 Is Chosen */
#define BOARD_NUMBER_BRICKS 2
#define GPIO_nVDD_USB_VALID GPIO_nPOWER_IN_C /* USB Is Chosen */
#define GPIO_nVDD_5V_PERIPH_EN /* PG4 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTG|GPIO_PIN4)
@ -304,7 +294,6 @@
#define GPIO_PPM_IN /* PI5 T8C1 */ GPIO_TIM8_CH1IN_2
/* RC Serial port */
#define RC_SERIAL_PORT "/dev/ttyS4"
#define RC_SERIAL_SINGLEWIRE
@ -371,40 +360,16 @@
#define SDIO_SLOTNO 0 /* Only one slot */
#define SDIO_MINOR 0
/* SD card bringup does not work if performed on the IDLE thread because it
* will cause waiting. Use either:
*
* CONFIG_LIB_BOARDCTL=y, OR
* CONFIG_BOARD_INITIALIZE=y && CONFIG_BOARD_INITTHREAD=y
*/
#if defined(CONFIG_BOARD_INITIALIZE) && !defined(CONFIG_LIB_BOARDCTL) && \
!defined(CONFIG_BOARD_INITTHREAD)
# warning SDIO initialization cannot be perfomed on the IDLE thread
#endif
/* By Providing BOARD_ADC_USB_CONNECTED (using the px4_arch abstraction)
* this board support the ADC system_power interface, and therefore
* provides the true logic GPIO BOARD_ADC_xxxx macros.
*/
#define BOARD_ADC_USB_CONNECTED (px4_arch_gpioread(GPIO_OTGFS_VBUS))
#if BOARD_HAS_USB_VALID == 1
#if defined(GPIO_nVDD_USB_VALID)
# define BOARD_ADC_USB_VALID (!px4_arch_gpioread(GPIO_nVDD_USB_VALID))
#else
# define BOARD_ADC_USB_VALID BOARD_ADC_USB_CONNECTED
#endif
/* FMUv5 never powers odd the Servo rail */
#define BOARD_ADC_SERVO_VALID (1)
#if !defined(BOARD_HAS_LTC44XX_VALIDS) || BOARD_HAS_LTC44XX_VALIDS == 0
# define BOARD_ADC_BRICK1_VALID (1)
# define BOARD_ADC_BRICK2_VALID (0)
#elif BOARD_HAS_LTC44XX_VALIDS == 1
# define BOARD_ADC_BRICK1_VALID (!px4_arch_gpioread(GPIO_nVDD_BRICK1_VALID))
# define BOARD_ADC_BRICK2_VALID (0)
#elif BOARD_HAS_LTC44XX_VALIDS == 2
# define BOARD_ADC_BRICK1_VALID (!px4_arch_gpioread(GPIO_nVDD_BRICK1_VALID))
# define BOARD_ADC_BRICK2_VALID (!px4_arch_gpioread(GPIO_nVDD_BRICK2_VALID))

View File

@ -56,6 +56,7 @@ px4_add_board(
#roboclaw
#rpm
safety_button
system_power
#tap_esc
telemetry # all available telemetry drivers
#test_ppm

View File

@ -53,6 +53,7 @@ px4_add_board(
roboclaw
rpm
safety_button
system_power
tap_esc
telemetry # all available telemetry drivers
test_ppm

View File

@ -55,6 +55,7 @@ px4_add_board(
roboclaw
rpm
safety_button
system_power
tap_esc
telemetry # all available telemetry drivers
test_ppm

View File

@ -3,6 +3,7 @@
# PX4 FMUv5X specific board sensors init
#------------------------------------------------------------------------------
board_adc start
system_power start
# Start Digital power monitors
ina226 -X -b 1 -t 1 -k start

View File

@ -71,9 +71,6 @@
/* Configuration ************************************************************************************/
#define BOARD_HAS_LTC44XX_VALIDS 2 // N Bricks
#define BOARD_HAS_USB_VALID 1 // LTC Has USB valid
#define BOARD_HAS_NBAT_V 2d // 2 Digital Voltage
#define BOARD_HAS_NBAT_I 2d // 2 Digital Current
/* PX4FMU GPIOs ***********************************************************************************/
@ -230,8 +227,6 @@
#define GPIO_nVDD_BRICK1_VALID GPIO_nPOWER_IN_A /* Brick 1 Is Chosen */
#define GPIO_nVDD_BRICK2_VALID GPIO_nPOWER_IN_B /* Brick 2 Is Chosen */
#define BOARD_NUMBER_BRICKS 2
#define BOARD_NUMBER_DIGITAL_BRICKS 2
#define GPIO_nVDD_USB_VALID GPIO_nPOWER_IN_C /* USB Is Chosen */
#define GPIO_VDD_5V_PERIPH_nEN /* PG4 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTG|GPIO_PIN4)
@ -343,35 +338,13 @@
#define SDIO_SLOTNO 0 /* Only one slot */
#define SDIO_MINOR 0
/* SD card bringup does not work if performed on the IDLE thread because it
* will cause waiting. Use either:
*
* CONFIG_LIB_BOARDCTL=y, OR
* CONFIG_BOARD_INITIALIZE=y && CONFIG_BOARD_INITTHREAD=y
*/
#if defined(CONFIG_BOARD_INITIALIZE) && !defined(CONFIG_LIB_BOARDCTL) && \
!defined(CONFIG_BOARD_INITTHREAD)
# warning SDIO initialization cannot be perfomed on the IDLE thread
#endif
/* By Providing BOARD_ADC_USB_CONNECTED (using the px4_arch abstraction)
* this board support the ADC system_power interface, and therefore
* provides the true logic GPIO BOARD_ADC_xxxx macros.
*/
#define BOARD_ADC_USB_CONNECTED (px4_arch_gpioread(GPIO_OTGFS_VBUS))
#define BOARD_ADC_USB_VALID (!px4_arch_gpioread(GPIO_nVDD_USB_VALID))
/* FMUv5X never powers off the Servo rail */
#define BOARD_ADC_SERVO_VALID (1)
#if !defined(BOARD_HAS_LTC44XX_VALIDS) || BOARD_HAS_LTC44XX_VALIDS == 0
# define BOARD_ADC_BRICK1_VALID (1)
# define BOARD_ADC_BRICK2_VALID (0)
#elif BOARD_HAS_LTC44XX_VALIDS == 1
# define BOARD_ADC_BRICK1_VALID (!px4_arch_gpioread(GPIO_nVDD_BRICK1_VALID))
# define BOARD_ADC_BRICK2_VALID (0)
#elif BOARD_HAS_LTC44XX_VALIDS == 2
# define BOARD_ADC_BRICK1_VALID (!px4_arch_gpioread(GPIO_nVDD_BRICK1_VALID))
# define BOARD_ADC_BRICK2_VALID (!px4_arch_gpioread(GPIO_nVDD_BRICK2_VALID))

View File

@ -54,6 +54,7 @@ px4_add_board(
roboclaw
rpm
safety_button
system_power
tap_esc
telemetry # all available telemetry drivers
test_ppm

View File

@ -3,6 +3,7 @@
# PX4 FMUv6X specific board sensors init
#------------------------------------------------------------------------------
board_adc start
system_power start
# Start Digital power monitors
ina226 -X -b 1 -t 1 -k start

View File

@ -74,9 +74,6 @@
/* Configuration ************************************************************************************/
#define BOARD_HAS_LTC44XX_VALIDS 2 // N Bricks
#define BOARD_HAS_USB_VALID 1 // LTC Has USB valid
#define BOARD_HAS_NBAT_V 2d // 2 Digital Voltage
#define BOARD_HAS_NBAT_I 2d // 2 Digital Current
/* PX4FMU GPIOs ***********************************************************************************/
@ -268,8 +265,6 @@
#define GPIO_nVDD_BRICK1_VALID GPIO_nPOWER_IN_A /* Brick 1 Is Chosen */
#define GPIO_nVDD_BRICK2_VALID GPIO_nPOWER_IN_B /* Brick 2 Is Chosen */
#define BOARD_NUMBER_BRICKS 2
#define BOARD_NUMBER_DIGITAL_BRICKS 2
#define GPIO_nVDD_USB_VALID GPIO_nPOWER_IN_C /* USB Is Chosen */
#define GPIO_VDD_5V_PERIPH_nEN /* PG4 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTG|GPIO_PIN4)
@ -390,17 +385,10 @@
# warning SDIO initialization cannot be perfomed on the IDLE thread
#endif
/* By Providing BOARD_ADC_USB_CONNECTED (using the px4_arch abstraction)
* this board support the ADC system_power interface, and therefore
* provides the true logic GPIO BOARD_ADC_xxxx macros.
*/
#define BOARD_ADC_USB_CONNECTED (px4_arch_gpioread(GPIO_OTGFS_VBUS))
#define BOARD_ADC_USB_VALID (!px4_arch_gpioread(GPIO_nVDD_USB_VALID))
/* FMUv6X never powers off the Servo rail */
#define BOARD_ADC_SERVO_VALID (1)
#if !defined(BOARD_HAS_LTC44XX_VALIDS) || BOARD_HAS_LTC44XX_VALIDS == 0
# define BOARD_ADC_BRICK1_VALID (1)
# define BOARD_ADC_BRICK2_VALID (0)

View File

@ -54,6 +54,7 @@ px4_add_board(
roboclaw
rpm
safety_button
system_power
tap_esc
telemetry # all available telemetry drivers
test_ppm

View File

@ -50,7 +50,6 @@
#define PX4_NUMBER_I2C_BUSES 1
#define BOARD_NUMBER_BRICKS 0
#define BOARD_HAS_CONTROL_STATUS_LEDS 1
#define BOARD_OVERLOAD_LED LED_RED
#define BOARD_ARMED_LED LED_BLUE

View File

@ -49,6 +49,7 @@ px4_add_board(
#roboclaw
#tap_esc
rc_input
system_power
telemetry # all available telemetry drivers
#test_ppm
tone_alarm

View File

@ -50,17 +50,10 @@
#include <stm32_gpio.h>
/****************************************************************************************************
* Definitions
****************************************************************************************************/
#define FLASH_BASED_PARAMS
#define BOARD_USE_EXTERNAL_FLASH //Configuration and firmware are in external flash
#define BOARD_HAS_USB_VALID 1 // LTC Has No USB valid
/* LEDs are driven with push open drain to support Anode to 5V or 3.3V */
#define GPIO_nLED_RED /* PE3 */ (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTE|GPIO_PIN3)
#define BOARD_HAS_CONTROL_STATUS_LEDS 1
@ -80,7 +73,6 @@
/* PC1 */ GPIO_ADC123_INP11, \
/* PC0 */ GPIO_ADC123_INP10
/* Define Channel numbers must match above GPIO pin IN(n)*/
#define ADC_RSSI_IN_CHANNEL /* PC4 */ 4
#define ADC_BATTERY_VOLTAGE_CHANNEL /* PC1 */ 11
@ -88,13 +80,11 @@
#define ADC_CHANNELS (1 << 4) | (1 << 10) | (1 << 11)
/* Define Battery 1 Voltage Divider and A per V
*/
/* Define Battery 1 Voltage Divider and A per V */
#define BOARD_BATTERY1_V_DIV (10.9f)
#define BOARD_BATTERY1_A_PER_V (17.f)
/* PWM
*/
/* PWM */
#define DIRECT_PWM_OUTPUT_CHANNELS 8
#define DIRECT_INPUT_TIMER_CHANNELS 8
@ -102,19 +92,14 @@
#define GPIO_TONE_ALARM_IDLE /* PE5 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTE|GPIO_PIN5)
#define GPIO_TONE_ALARM_GPIO /* PE5 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTE|GPIO_PIN5)
/* USB OTG FS
*
* PA8 OTG_FS_VBUS VBUS sensing
*/
/* USB OTG FS PA8 OTG_FS_VBUS VBUS sensing */
#define GPIO_OTGFS_VBUS /* PA9 */ (GPIO_INPUT|GPIO_PULLDOWN|GPIO_SPEED_100MHz|GPIO_PORTA|GPIO_PIN9)
/* High-resolution timer */
#define HRT_TIMER 2 /* use timer2 for the HRT */
#define HRT_TIMER_CHANNEL 3 /* use capture/compare channel 3 */
/* RC Serial port */
#define RC_SERIAL_PORT "/dev/ttyS0"
#define GPIO_RSSI_IN /* PC5 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTC|GPIO_PIN5)
@ -131,8 +116,8 @@
#define BOARD_HAS_ON_RESET 1
#define PX4_GPIO_INIT_LIST { \
PX4_ADC_GPIO, \
GPIO_TONE_ALARM_IDLE, \
PX4_ADC_GPIO, \
GPIO_TONE_ALARM_IDLE, \
GPIO_RSSI_IN, \
}
@ -144,20 +129,8 @@
__BEGIN_DECLS
/****************************************************************************************************
* Public Types
****************************************************************************************************/
/****************************************************************************************************
* Public data
****************************************************************************************************/
#ifndef __ASSEMBLY__
/****************************************************************************************************
* Public Functions
****************************************************************************************************/
/****************************************************************************
* Name: stm32_sdio_initialize
*

Some files were not shown because too many files have changed in this diff Show More