Skip to content

Commit

Permalink
AP_HAL_ChibiOS: Add Bat Mon to L431-GPS
Browse files Browse the repository at this point in the history
  • Loading branch information
MattKear committed Jan 9, 2025
1 parent 6efe210 commit d5683f4
Showing 1 changed file with 19 additions and 11 deletions.
30 changes: 19 additions & 11 deletions libraries/AP_HAL_ChibiOS/hwdef/MatekL431-GPS/hwdef.dat
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@ undef PB11
PB10 USART3_TX USART3 SPEED_HIGH
PB11 USART3_RX USART3 SPEED_HIGH

# no ADC pins
define HAL_USE_ADC FALSE

# disable unnecessary threads
define HAL_NO_RCOUT_THREAD
define HAL_NO_TIMER_THREAD
Expand All @@ -49,12 +46,23 @@ SERIAL_ORDER EMPTY USART2 USART3
undef HAL_CAN_POOL_SIZE
define HAL_CAN_POOL_SIZE 12000

# -------------------- MSP --------------------------------
define HAL_PERIPH_ENABLE_MSP
define HAL_MSP_ENABLED 1
define AP_PERIPH_MSP_PORT_DEFAULT 1

undef PB10
undef PB11
PB10 USART3_TX USART3 SPEED_HIGH
PB11 USART3_RX USART3 SPEED_HIGH
# ------------------ BATTERY Monitor -----------------------
define HAL_PERIPH_ENABLE_BATTERY
define AP_BATTERY_ANALOG_ENABLED 1

define HAL_USE_ADC TRUE
define STM32_ADC_USE_ADC1 TRUE

PA0 BATT_VOLTAGE_SENS ADC1 SCALE(1)
PA1 BATT_CURRENT_SENS ADC1 SCALE(1)

define HAL_BATT_MONITOR_DEFAULT 0
define HAL_BATT_VOLT_PIN 5
define HAL_BATT_VOLT_SCALE 21.0
define HAL_BATT_CURR_PIN 6
define HAL_BATT_CURR_SCALE 40.0


PB0 BATT2_VOLTAGE_SENS ADC1 SCALE(1)
PB1 BATT2_CURRENT_SENS ADC1 SCALE(1)

0 comments on commit d5683f4

Please sign in to comment.