Index: ctrl/firmware/Main/CubeMX/charger.ioc
===================================================================
--- ctrl/firmware/Main/CubeMX/charger.ioc	(revision 95)
+++ ctrl/firmware/Main/CubeMX/charger.ioc	(revision 96)
@@ -1,5 +1,7 @@
 #MicroXplorer Configuration settings - do not modify
 ADC3.Channel-0\#ChannelRegularConversion=ADC_CHANNEL_10
-ADC3.Channel-1\#ChannelRegularConversion=ADC_CHANNEL_TEMPSENSOR
+ADC3.Channel-1\#ChannelRegularConversion=ADC_CHANNEL_VBAT
+ADC3.Channel-2\#ChannelRegularConversion=ADC_CHANNEL_TEMPSENSOR
+ADC3.Channel-4\#ChannelRegularConversion=ADC_CHANNEL_VREFINT
 ADC3.ClockPrescalerADC3=ADC_CLOCK_ASYNC_DIV256
 ADC3.ContinuousConvMode=ENABLE
@@ -7,19 +9,27 @@
 ADC3.DMAContinuousRequests=ENABLE
 ADC3.EOCSelection=ADC_EOC_SEQ_CONV
-ADC3.IPParameters=Rank-0\#ChannelRegularConversion,Channel-0\#ChannelRegularConversion,SamplingTime-0\#ChannelRegularConversion,OffsetNumber-0\#ChannelRegularConversion,OffsetSign-0\#ChannelRegularConversion,NbrOfConversionFlag,ContinuousConvMode,DMAContinuousRequests,EOCSelection,Overrun,OversamplingMode,ClockPrescalerADC3,Ratio,NbrOfConversion,RightBitShift,ConversionDataManagement,Rank-1\#ChannelRegularConversion,Channel-1\#ChannelRegularConversion,SamplingTime-1\#ChannelRegularConversion,OffsetNumber-1\#ChannelRegularConversion,OffsetSign-1\#ChannelRegularConversion
-ADC3.NbrOfConversion=2
+ADC3.IPParameters=Rank-0\#ChannelRegularConversion,Channel-0\#ChannelRegularConversion,SamplingTime-0\#ChannelRegularConversion,OffsetNumber-0\#ChannelRegularConversion,OffsetSign-0\#ChannelRegularConversion,NbrOfConversionFlag,ContinuousConvMode,DMAContinuousRequests,EOCSelection,Overrun,OversamplingMode,ClockPrescalerADC3,Ratio,NbrOfConversion,RightBitShift,ConversionDataManagement,Rank-1\#ChannelRegularConversion,Channel-1\#ChannelRegularConversion,SamplingTime-1\#ChannelRegularConversion,OffsetNumber-1\#ChannelRegularConversion,OffsetSign-1\#ChannelRegularConversion,Rank-2\#ChannelRegularConversion,Channel-2\#ChannelRegularConversion,SamplingTime-2\#ChannelRegularConversion,OffsetNumber-2\#ChannelRegularConversion,OffsetSign-2\#ChannelRegularConversion,Rank-4\#ChannelRegularConversion,Channel-4\#ChannelRegularConversion,SamplingTime-4\#ChannelRegularConversion,OffsetNumber-4\#ChannelRegularConversion,OffsetSign-4\#ChannelRegularConversion
+ADC3.NbrOfConversion=4
 ADC3.NbrOfConversionFlag=1
 ADC3.OffsetNumber-0\#ChannelRegularConversion=ADC_OFFSET_NONE
 ADC3.OffsetNumber-1\#ChannelRegularConversion=ADC_OFFSET_NONE
+ADC3.OffsetNumber-2\#ChannelRegularConversion=ADC_OFFSET_NONE
+ADC3.OffsetNumber-4\#ChannelRegularConversion=ADC_OFFSET_NONE
 ADC3.OffsetSign-0\#ChannelRegularConversion=ADC3_OFFSET_SIGN_NEGATIVE
 ADC3.OffsetSign-1\#ChannelRegularConversion=ADC3_OFFSET_SIGN_NEGATIVE
+ADC3.OffsetSign-2\#ChannelRegularConversion=ADC3_OFFSET_SIGN_NEGATIVE
+ADC3.OffsetSign-4\#ChannelRegularConversion=ADC3_OFFSET_SIGN_NEGATIVE
 ADC3.Overrun=ADC_OVR_DATA_OVERWRITTEN
 ADC3.OversamplingMode=ENABLE
 ADC3.Rank-0\#ChannelRegularConversion=1
 ADC3.Rank-1\#ChannelRegularConversion=2
+ADC3.Rank-2\#ChannelRegularConversion=3
+ADC3.Rank-4\#ChannelRegularConversion=4
 ADC3.Ratio=ADC3_OVERSAMPLING_RATIO_256
 ADC3.RightBitShift=ADC_RIGHTBITSHIFT_8
 ADC3.SamplingTime-0\#ChannelRegularConversion=ADC3_SAMPLETIME_640CYCLES_5
 ADC3.SamplingTime-1\#ChannelRegularConversion=ADC3_SAMPLETIME_640CYCLES_5
+ADC3.SamplingTime-2\#ChannelRegularConversion=ADC3_SAMPLETIME_640CYCLES_5
+ADC3.SamplingTime-4\#ChannelRegularConversion=ADC3_SAMPLETIME_640CYCLES_5
 Bdma.ADC3.0.Direction=DMA_PERIPH_TO_MEMORY
 Bdma.ADC3.0.EventEnable=DISABLE
@@ -344,22 +354,24 @@
 Mcu.Pin56=PB9
 Mcu.Pin57=VP_ADC3_TempSens_Input
-Mcu.Pin58=VP_DTS_VS-DTS
-Mcu.Pin59=VP_FATFS_VS_SDIO
+Mcu.Pin58=VP_ADC3_Vref_Input
+Mcu.Pin59=VP_ADC3_Vbat_Input
 Mcu.Pin6=PF1
-Mcu.Pin60=VP_FREERTOS_VS_CMSIS_V2
-Mcu.Pin61=VP_RTC_VS_RTC_Activate
-Mcu.Pin62=VP_RTC_VS_RTC_Calendar
-Mcu.Pin63=VP_SYS_VS_tim7
-Mcu.Pin64=VP_TIM3_VS_ClockSourceINT
-Mcu.Pin65=VP_TIM6_VS_ClockSourceINT
-Mcu.Pin66=VP_TIM8_VS_ControllerModeReset
-Mcu.Pin67=VP_TIM8_VS_ClockSourceINT
-Mcu.Pin68=VP_VREFBUF_V_VREFBUF
-Mcu.Pin69=VP_MEMORYMAP_VS_MEMORYMAP
+Mcu.Pin60=VP_DTS_VS-DTS
+Mcu.Pin61=VP_FATFS_VS_SDIO
+Mcu.Pin62=VP_FREERTOS_VS_CMSIS_V2
+Mcu.Pin63=VP_RTC_VS_RTC_Activate
+Mcu.Pin64=VP_RTC_VS_RTC_Calendar
+Mcu.Pin65=VP_SYS_VS_tim7
+Mcu.Pin66=VP_TIM3_VS_ClockSourceINT
+Mcu.Pin67=VP_TIM6_VS_ClockSourceINT
+Mcu.Pin68=VP_TIM8_VS_ControllerModeReset
+Mcu.Pin69=VP_TIM8_VS_ClockSourceINT
 Mcu.Pin7=PH0-OSC_IN
-Mcu.Pin70=VP_STMicroelectronics.X-CUBE-EEPRMA1_VS_BoardOoPartJjEEPROM_5.1.0_5.1.0
+Mcu.Pin70=VP_VREFBUF_V_VREFBUF
+Mcu.Pin71=VP_MEMORYMAP_VS_MEMORYMAP
+Mcu.Pin72=VP_STMicroelectronics.X-CUBE-EEPRMA1_VS_BoardOoPartJjEEPROM_5.1.0_5.1.0
 Mcu.Pin8=PH1-OSC_OUT
 Mcu.Pin9=PC0
-Mcu.PinsNb=71
+Mcu.PinsNb=73
 Mcu.ThirdParty0=STMicroelectronics.X-CUBE-AZRTOS-H7.3.3.0
 Mcu.ThirdParty1=STMicroelectronics.X-CUBE-EEPRMA1.5.1.0
@@ -653,5 +665,5 @@
 ProjectManager.UAScriptBeforePath=
 ProjectManager.UnderRoot=true
-ProjectManager.functionlistsort=1-MX_GPIO_Init-GPIO-false-HAL-true,2-MX_DMA_Init-DMA-false-HAL-true,3-MX_BDMA_Init-BDMA-false-HAL-true,4-MX_RTC_Init-RTC-false-HAL-true,5-MX_SPI4_Init-SPI4-false-HAL-true,6-MX_SDMMC1_SD_Init-SDMMC1-false-HAL-true,7-SystemClock_Config-RCC-false-HAL-false,8-MX_FATFS_Init-FATFS-false-HAL-false,9-MX_TIM8_Init-TIM8-false-HAL-true,10-MX_SPI2_Init-SPI2-false-HAL-true,11-MX_USART2_UART_Init-USART2-false-HAL-true,12-MX_USART10_UART_Init-USART10-false-HAL-true,13-MX_TIM6_Init-TIM6-false-HAL-true,14-MX_I2C2_Init-I2C2-false-HAL-true,15-MX_ADC3_Init-ADC3-false-HAL-true,16-MX_TIM3_Init-TIM3-false-HAL-true,17-MX_I2C1_Init-I2C1-false-HAL-true,18-MX_USART3_UART_Init-USART3-false-HAL-true,0-MX_CORTEX_M7_Init-CORTEX_M7-false-HAL-true,0-MX_VREFBUF_Init-VREFBUF-false-HAL-true
+ProjectManager.functionlistsort=1-MX_GPIO_Init-GPIO-false-HAL-true,2-MX_DMA_Init-DMA-false-HAL-true,3-MX_BDMA_Init-BDMA-false-HAL-true,4-MX_RTC_Init-RTC-false-HAL-true,5-MX_SPI4_Init-SPI4-false-HAL-true,6-MX_SDMMC1_SD_Init-SDMMC1-false-HAL-true,7-SystemClock_Config-RCC-false-HAL-false,8-MX_FATFS_Init-FATFS-false-HAL-false,9-MX_TIM8_Init-TIM8-false-HAL-true,10-MX_SPI2_Init-SPI2-false-HAL-true,11-MX_USART2_UART_Init-USART2-false-HAL-true,12-MX_USART10_UART_Init-USART10-false-HAL-true,13-MX_TIM6_Init-TIM6-false-HAL-true,14-MX_I2C2_Init-I2C2-false-HAL-true,15-MX_ADC3_Init-ADC3-false-HAL-true,16-MX_TIM3_Init-TIM3-false-HAL-true,17-MX_I2C1_Init-I2C1-false-HAL-true,18-MX_USART3_UART_Init-USART3-false-HAL-true,19-MX_DTS_Init-DTS-false-HAL-true,0-MX_CORTEX_M7_Init-CORTEX_M7-false-HAL-true,0-MX_VREFBUF_Init-VREFBUF-false-HAL-true
 RCC.ADCCLockSelection=RCC_ADCCLKSOURCE_PLL3
 RCC.ADCFreq_Value=60000000
@@ -830,4 +842,8 @@
 VP_ADC3_TempSens_Input.Mode=IN-TempSens
 VP_ADC3_TempSens_Input.Signal=ADC3_TempSens_Input
+VP_ADC3_Vbat_Input.Mode=IN-Vbat
+VP_ADC3_Vbat_Input.Signal=ADC3_Vbat_Input
+VP_ADC3_Vref_Input.Mode=IN-Vrefint
+VP_ADC3_Vref_Input.Signal=ADC3_Vref_Input
 VP_DTS_VS-DTS.Mode=DTS
 VP_DTS_VS-DTS.Signal=DTS_VS-DTS
