AP_HAL_ChibiOS: add second battery sensor to KakuteH7v2

correct BATT2 hwdefs for various boards
This commit is contained in:
Andy Piper 2023-03-08 07:51:00 +00:00 committed by Andrew Tridgell
parent 4a2cbf17f9
commit 7a85121daf
6 changed files with 31 additions and 25 deletions

View File

@ -43,6 +43,19 @@ PC9 TIM8_CH4 TIM8 PWM(8) GPIO(57)
PB11 VTX_PWR OUTPUT HIGH GPIO(81)
define RELAY2_PIN_DEFAULT 81
define HAL_BATT_MONITOR_DEFAULT 4
# second battery sensor on second ESC connector
PA1 BATT2_VOLTAGE_SENS ADC1 SCALE(1)
PC4 BATT2_CURRENT_SENS ADC1 SCALE(1)
# second battery setup (note external current sensor required)
define HAL_BATT2_VOLT_PIN 17
define HAL_BATT2_CURR_PIN 4
define HAL_BATT2_VOLT_SCALE 11.0
define HAL_BATT2_CURR_SCALE 59.5
define HAL_BATT2_MONITOR_DEFAULT 4
SPIDEV dataflash SPI1 DEVID1 SDCARD_CS MODE3 104*MHZ 104*MHZ
SPIDEV bmi270 SPI4 DEVID1 ICM20689_CS MODE3 1*MHZ 10*MHZ # Clock is 100Mhz so highest clock <= 10Mhz is 100Mhz/16

View File

@ -75,13 +75,6 @@ define HAL_BATT_CURR_SCALE 40.0
PB0 BATT2_VOLTAGE_SENS ADC1 SCALE(1)
PB1 BATT2_CURRENT_SENS ADC1 SCALE(1)
define HAL_BATT2_MONITOR_DEFAULT 0
define HAL_BATT2_VOLT_PIN 15
define HAL_BATT2_VOLT_SCALE 21.0
define HAL_BATT2_CURR_PIN 16
define HAL_BATT2_CURR_SCALE 40.0
# -------------------- Buzzer+NeoPixels --------------d------
define HAL_PERIPH_ENABLE_RC_OUT
define HAL_PERIPH_ENABLE_NOTIFY

View File

@ -212,10 +212,6 @@ PC1 SCALED_V3V3 ADC1 SCALE(2)
# setup scaling defaults
define HAL_BATT_VOLT_SCALE 18.0
define HAL_BATT_CURR_SCALE 24.0
define HAL_BATT_VOLT_PIN 0
define HAL_BATT_CURR_PIN 1
define HAL_BATT2_VOLT_PIN 2
define HAL_BATT2_CURR_PIN 3
# CAN bus
PI9 CAN1_RX CAN1

View File

@ -198,14 +198,17 @@ PB1 BATT2_VOLTAGE_SENS ADC1 SCALE(2)
PC4 VDD_5V_SENS ADC1 SCALE(2)
PC5 FMU_SERVORAIL_VCC_SENS ADC1 SCALE(12)
define HAL_BATT_MONITOR 4
define HAL_BATT_VOLT_PIN 13
define HAL_BATT_CURR_PIN 12
define HAL_BATT_VOLT_SCALE 20
define HAL_BATT_CURR_SCALE 61
# not enabled by default
# define HAL_BATT2_MONITOR 4
define HAL_BATT2_VOLT_PIN 9
define HAL_BATT2_CURR_PIN 8
define HAL_BATT_VOLT_SCALE 20
define HAL_BATT_CURR_SCALE 17
define HAL_BATT2_VOLT_SCALE 20
define HAL_BATT2_CURR_SCALE 17
define HAL_BATT2_CURR_SCALE 61
define HAL_HAVE_IMU_HEATER 1

View File

@ -4,17 +4,6 @@ BRD_HEAT_TARG 45
# setup serial2 port defaults for ESP8266
SERIAL2_BAUD 921600
# setup the parameter for the ADC power module
BATT_MONITOR 4
BATT_VOLT_PIN 16
BATT_CURR_PIN 17
BATT_VOLT_MULT 20.000
BATT_AMP_PERVLT 17.000
BATT2_VOLT_PIN 10
BATT2_CURR_PIN 11
BATT2_VOLT_MULT 20.000
BATT2_AMP_PERVLT 17.000
# setup the parameter for the two Relays GPIO others for reserve
RELAY_PIN 1
RELAY_PIN2 2

View File

@ -134,6 +134,18 @@ PC4 FMU_SERVORAIL_VCC_SENS ADC1 SCALE(12)
PC5 PRESSURE_SENS ADC1 SCALE(2)
PB1 RSSI_IN ADC1 SCALE(2)
# setup the parameter for the ADC power module
define HAL_BATT_MONITOR 4
define HAL_BATT_VOLT_PIN 16
define HAL_BATT_CURR_PIN 17
define HAL_BATT_VOLT_SCALE 20.000
define HAL_BATT_CURR_SCALE 61.000
# not enabled by default
# define HAL_BATT2_MONITOR 4
define HAL_BATT2_VOLT_PIN 10
define HAL_BATT2_CURR_PIN 11
define HAL_BATT2_VOLT_SCALE 20.000
define HAL_BATT2_CURR_SCALE 61.000
# CAN bus
PD0 CAN1_RX CAN1