Skip to content

Commit

Permalink
AP_HAL_ChibiOS: add support for MCU monitoring on H750 based boards
Browse files Browse the repository at this point in the history
  • Loading branch information
bugobliterator authored and andyp1per committed May 16, 2023
1 parent 30d71e4 commit 8e961f9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
12 changes: 9 additions & 3 deletions libraries/AP_HAL_ChibiOS/AnalogIn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,15 @@ const AnalogIn::pin_info AnalogIn::pin_config[] = { HAL_ANALOG_PINS };
#if defined(HAL_ANALOG3_PINS) || HAL_WITH_MCU_MONITORING
#if HAL_WITH_MCU_MONITORING
// internal ADC channels (from H7 reference manual)
#define ADC3_VSENSE_CHAN 18
#define ADC3_VREFINT_CHAN 19
#define ADC3_VBAT4_CHAN 17
#ifndef ADC3_VSENSE_CHAN
#define ADC3_VSENSE_CHAN 18
#endif
#ifndef ADC3_VREFINT_CHAN
#define ADC3_VREFINT_CHAN 19
#endif
#ifndef ADC3_VBAT4_CHAN
#define ADC3_VBAT4_CHAN 17
#endif
#define HAL_MCU_MONITORING_PINS {ADC3_VBAT4_CHAN, 252, 3.30/4096}, {ADC3_VSENSE_CHAN, 253, 3.30/4096}, {ADC3_VREFINT_CHAN, 254, 3.30/4096}
#else
#define HAL_MCU_MONITORING_PINS
Expand Down
4 changes: 4 additions & 0 deletions libraries/AP_HAL_ChibiOS/hwdef/scripts/STM32H750xx.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@

'DEFINES' : {
'HAL_HAVE_HARDWARE_DOUBLE' : '1',
'HAL_WITH_MCU_MONITORING' : '1',
'ADC3_VSENSE_CHAN' : 17,
'ADC3_VREFINT_CHAN' : 18,
'ADC3_VBAT4_CHAN' : 16,
'STM32H7' : '1',
},

Expand Down

0 comments on commit 8e961f9

Please sign in to comment.