Index: ctrl/firmware/Main/CubeMX/charger.ioc
===================================================================
--- ctrl/firmware/Main/CubeMX/charger.ioc	(revision 90)
+++ ctrl/firmware/Main/CubeMX/charger.ioc	(revision 91)
@@ -1,3 +1,19 @@
 #MicroXplorer Configuration settings - do not modify
+ADC1.Channel-0\#ChannelRegularConversion=ADC_CHANNEL_10
+ADC1.ClockPrescaler=ADC_CLOCK_ASYNC_DIV256
+ADC1.ContinuousConvMode=ENABLE
+ADC1.EOCSelection=ADC_EOC_SEQ_CONV
+ADC1.IPParameters=Rank-0\#ChannelRegularConversion,master,Channel-0\#ChannelRegularConversion,SamplingTime-0\#ChannelRegularConversion,OffsetNumber-0\#ChannelRegularConversion,OffsetSignedSaturation-0\#ChannelRegularConversion,NbrOfConversionFlag,ContinuousConvMode,EOCSelection,Overrun,OversamplingMode,RightBitShift,Ratio,NbrOfConversion,ClockPrescaler
+ADC1.NbrOfConversion=1
+ADC1.NbrOfConversionFlag=1
+ADC1.OffsetNumber-0\#ChannelRegularConversion=ADC_OFFSET_NONE
+ADC1.OffsetSignedSaturation-0\#ChannelRegularConversion=DISABLE
+ADC1.Overrun=ADC_OVR_DATA_OVERWRITTEN
+ADC1.OversamplingMode=ENABLE
+ADC1.Rank-0\#ChannelRegularConversion=1
+ADC1.Ratio=1024
+ADC1.RightBitShift=ADC_RIGHTBITSHIFT_11
+ADC1.SamplingTime-0\#ChannelRegularConversion=ADC_SAMPLETIME_810CYCLES_5
+ADC1.master=1
 CAD.formats=[]
 CAD.pinconfig=Dual
@@ -13,4 +29,22 @@
 CORTEX_M7.TypeExtField_S-Cortex_Memory_Protection_Unit_Region1_Settings_S=MPU_TEX_LEVEL1
 CORTEX_M7.default_mode_Activation=1
+Dma.ADC1.5.Direction=DMA_PERIPH_TO_MEMORY
+Dma.ADC1.5.EventEnable=DISABLE
+Dma.ADC1.5.FIFOMode=DMA_FIFOMODE_DISABLE
+Dma.ADC1.5.Instance=DMA1_Stream5
+Dma.ADC1.5.MemDataAlignment=DMA_MDATAALIGN_HALFWORD
+Dma.ADC1.5.MemInc=DMA_MINC_ENABLE
+Dma.ADC1.5.Mode=DMA_CIRCULAR
+Dma.ADC1.5.PeriphDataAlignment=DMA_PDATAALIGN_HALFWORD
+Dma.ADC1.5.PeriphInc=DMA_PINC_DISABLE
+Dma.ADC1.5.Polarity=HAL_DMAMUX_REQ_GEN_RISING
+Dma.ADC1.5.Priority=DMA_PRIORITY_LOW
+Dma.ADC1.5.RequestNumber=1
+Dma.ADC1.5.RequestParameters=Instance,Direction,PeriphInc,MemInc,PeriphDataAlignment,MemDataAlignment,Mode,Priority,FIFOMode,SignalID,Polarity,RequestNumber,SyncSignalID,SyncPolarity,SyncEnable,EventEnable,SyncRequestNumber
+Dma.ADC1.5.SignalID=NONE
+Dma.ADC1.5.SyncEnable=DISABLE
+Dma.ADC1.5.SyncPolarity=HAL_DMAMUX_SYNC_NO_EVENT
+Dma.ADC1.5.SyncRequestNumber=1
+Dma.ADC1.5.SyncSignalID=NONE
 Dma.Request0=SPI4_TX
 Dma.Request1=USART3_RX
@@ -18,5 +52,6 @@
 Dma.Request3=SPI2_RX
 Dma.Request4=SPI2_TX
-Dma.RequestsNb=5
+Dma.Request5=ADC1
+Dma.RequestsNb=6
 Dma.SPI2_RX.3.Direction=DMA_PERIPH_TO_MEMORY
 Dma.SPI2_RX.3.EventEnable=DISABLE
@@ -212,97 +247,99 @@
 Mcu.CPN=STM32H723ZET6
 Mcu.Family=STM32H7
-Mcu.IP0=CORTEX_M7
-Mcu.IP1=DEBUG
-Mcu.IP10=RCC
-Mcu.IP11=RTC
-Mcu.IP12=SDMMC1
-Mcu.IP13=SPI2
-Mcu.IP14=SPI4
-Mcu.IP15=SYS
-Mcu.IP16=TIM3
-Mcu.IP17=TIM6
-Mcu.IP18=TIM8
-Mcu.IP19=USART2
-Mcu.IP2=DMA
-Mcu.IP20=USART3
-Mcu.IP21=USART10
-Mcu.IP3=FATFS
-Mcu.IP4=FREERTOS
-Mcu.IP5=I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C_VS_RTC_Calendar
+Mcu.Pin50=PG14
+Mcu.Pin51=PG15
+Mcu.Pin52=PB4(NJTRST)
+Mcu.Pin53=PB6
+Mcu.Pin54=PB7
+Mcu.Pin55=PB8
+Mcu.Pin56=PB9
+Mcu.Pin57=VP_FATFS_VS_SDIO
+Mcu.Pin58=VP_FREERTOS_VS_CMSIS_V2
+Mcu.Pin59=VP_RTC_VS_RTC_Activate
 Mcu.Pin6=PF1
-Mcu.Pin60=VP_SYS_VS_tim7
-Mcu.Pin61=VP_TIM3_VS_ClockSourceINT
-Mcu.Pin62=VP_TIM6_VS_ClockSourceINT
-Mcu.Pin63=VP_TIM8_VS_ControllerModeReset
-Mcu.Pin64=VP_TIM8_VS_ClockSourceINT
-Mcu.Pin65=VP_MEMORYMAP_VS_MEMORYMAP
-Mcu.Pin66=VP_STMicroelectronics.X-CUBE-EEPRMA1_VS_BoardOoPartJjEEPROM_5.1.0_5.1.0
+Mcu.Pin60=VP_RTC_VS_RTC_Calendar
+Mcu.Pin61=VP_SYS_VS_tim7
+Mcu.Pin62=VP_TIM3_VS_ClockSourceINT
+Mcu.Pin63=VP_TIM6_VS_ClockSourceINT
+Mcu.Pin64=VP_TIM8_VS_ControllerModeReset
+Mcu.Pin65=VP_TIM8_VS_ClockSourceINT
+Mcu.Pin66=VP_MEMORYMAP_VS_MEMORYMAP
+Mcu.Pin67=VP_STMicroelectronics.X-CUBE-EEPRMA1_VS_BoardOoPartJjEEPROM_5.1.0_5.1.0
 Mcu.Pin7=PH0-OSC_IN
 Mcu.Pin8=PH1-OSC_OUT
-Mcu.Pin9=PF15
-Mcu.PinsNb=67
+Mcu.Pin9=PC0
+Mcu.PinsNb=68
 Mcu.ThirdParty0=STMicroelectronics.X-CUBE-AZRTOS-H7.3.3.0
 Mcu.ThirdParty1=STMicroelectronics.X-CUBE-EEPRMA1.5.1.0
@@ -345,4 +382,5 @@
 NVIC.DMA1_Stream3_IRQn=true\:5\:0\:false\:false\:true\:true\:false\:true\:true
 NVIC.DMA1_Stream4_IRQn=true\:5\:0\:false\:false\:true\:true\:false\:true\:true
+NVIC.DMA1_Stream5_IRQn=true\:5\:0\:false\:false\:true\:true\:false\:true\:true
 NVIC.DebugMonitor_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false\:false
 NVIC.EXTI9_5_IRQn=true\:5\:0\:false\:false\:true\:true\:true\:true\:true
@@ -426,4 +464,6 @@
 PB9.Locked=true
 PB9.Signal=GPIO_Output
+PC0.Locked=true
+PC0.Signal=ADCx_INP10
 PC10.Mode=SD_4_bits_Wide_bus
 PC10.Signal=SDMMC1_D2
@@ -619,6 +659,7 @@
 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_MDMA_Init-MDMA-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-MX_USART3_UART_Init-USART3-false-HAL-true,8-MX_TIM3_Init-TIM3-false-HAL-true,9-SystemClock_Config-RCC-false-HAL-false,10-MX_FATFS_Init-FATFS-false-HAL-false,11-MX_TIM8_Init-TIM8-false-HAL-true,12-MX_SPI2_Init-SPI2-false-HAL-true,13-MX_USART2_UART_Init-USART2-false-HAL-true,14-MX_USART10_UART_Init-USART10-false-HAL-true,15-MX_TIM6_Init-TIM6-false-HAL-true,16-MX_I2C1_Init-I2C1-false-HAL-true,17-MX_I2C2_Init-I2C2-false-HAL-true,0-MX_CORTEX_M7_Init-CORTEX_M7-false-HAL-true
-RCC.ADCFreq_Value=125000000
+ProjectManager.functionlistsort=1-MX_GPIO_Init-GPIO-false-HAL-true,2-MX_DMA_Init-DMA-false-HAL-true,3-MX_MDMA_Init-MDMA-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-MX_USART3_UART_Init-USART3-false-HAL-true,8-MX_TIM3_Init-TIM3-false-HAL-true,9-SystemClock_Config-RCC-false-HAL-false,10-MX_FATFS_Init-FATFS-false-HAL-false,11-MX_TIM8_Init-TIM8-false-HAL-true,12-MX_SPI2_Init-SPI2-false-HAL-true,13-MX_USART2_UART_Init-USART2-false-HAL-true,14-MX_USART10_UART_Init-USART10-false-HAL-true,15-MX_TIM6_Init-TIM6-false-HAL-true,16-MX_I2C1_Init-I2C1-false-HAL-true,17-MX_I2C2_Init-I2C2-false-HAL-true,18-MX_ADC1_Init-ADC1-false-HAL-true,0-MX_CORTEX_M7_Init-CORTEX_M7-false-HAL-true
+RCC.ADCCLockSelection=RCC_ADCCLKSOURCE_PLL3
+RCC.ADCFreq_Value=60000000
 RCC.AHB12Freq_Value=100000000
 RCC.AHB4Freq_Value=100000000
@@ -640,18 +681,18 @@
 RCC.DIVN1=40
 RCC.DIVN2=20
-RCC.DIVN3=200
+RCC.DIVN3=180
 RCC.DIVP1Freq_Value=100000000
 RCC.DIVP2Freq_Value=125000000
-RCC.DIVP3Freq_Value=100000000
+RCC.DIVP3Freq_Value=90000000
 RCC.DIVQ1Freq_Value=100000000
 RCC.DIVQ2=11
 RCC.DIVQ2Freq_Value=22727272.727272727
 RCC.DIVQ3=8
-RCC.DIVQ3Freq_Value=25000000
+RCC.DIVQ3Freq_Value=22500000
 RCC.DIVR1Freq_Value=100000000
 RCC.DIVR2=10
 RCC.DIVR2Freq_Value=25000000
-RCC.DIVR3=4
-RCC.DIVR3Freq_Value=50000000
+RCC.DIVR3=3
+RCC.DIVR3Freq_Value=60000000
 RCC.FDCANFreq_Value=100000000
 RCC.FMCFreq_Value=100000000
@@ -662,10 +703,10 @@
 RCC.I2C123Freq_Value=64000000
 RCC.I2C4Freq_Value=100000000
-RCC.IPParameters=ADCFreq_Value,AHB12Freq_Value,AHB4Freq_Value,APB1Freq_Value,APB2Freq_Value,APB3Freq_Value,APB4Freq_Value,AXIClockFreq_Value,CECFreq_Value,CKPERFreq_Value,CortexFreq_Value,CpuClockFreq_Value,D1CPREFreq_Value,DFSDMACLkFreq_Value,DFSDMFreq_Value,DIVM1,DIVM2,DIVM3,DIVN1,DIVN2,DIVN3,DIVP1Freq_Value,DIVP2Freq_Value,DIVP3Freq_Value,DIVQ1Freq_Value,DIVQ2,DIVQ2Freq_Value,DIVQ3,DIVQ3Freq_Value,DIVR1Freq_Value,DIVR2,DIVR2Freq_Value,DIVR3,DIVR3Freq_Value,FDCANFreq_Value,FMCFreq_Value,FamilyName,HCLK3ClockFreq_Value,HCLKFreq_Value,I2C123CLockSelection,I2C123Freq_Value,I2C4Freq_Value,LPTIM1Freq_Value,LPTIM2Freq_Value,LPTIM345Freq_Value,LPUART1Freq_Value,LTDCFreq_Value,MCO1PinFreq_Value,MCO2PinFreq_Value,PLL2FRACN,PLL2_VCI_Range-AdvancedSettings,PLLFRACN,PLLSourceVirtual,QSPIFreq_Value,RNGFreq_Value,RTCClockSelection,RTCFreq_Value,SAI1Freq_Value,SAI4AFreq_Value,SAI4BFreq_Value,SDMMCFreq_Value,SPDIFRXFreq_Value,SPI123CLockSelection,SPI123Freq_Value,SPI45Freq_Value,SPI6Freq_Value,SWPMI1Freq_Value,SYSCLKFreq_VALUE,SYSCLKSource,Spi45ClockSelection,Tim1OutputFreq_Value,Tim2OutputFreq_Value,TraceFreq_Value,USART16CLockSelection,USART16Freq_Value,USART234578CLockSelection,USART234578Freq_Value,USBFreq_Value,VCO1OutputFreq_Value,VCO2OutputFreq_Value,VCO3OutputFreq_Value,VCOInput1Freq_Value,VCOInput2Freq_Value,VCOInput3Freq_Value
+RCC.IPParameters=ADCCLockSelection,ADCFreq_Value,AHB12Freq_Value,AHB4Freq_Value,APB1Freq_Value,APB2Freq_Value,APB3Freq_Value,APB4Freq_Value,AXIClockFreq_Value,CECFreq_Value,CKPERFreq_Value,CortexFreq_Value,CpuClockFreq_Value,D1CPREFreq_Value,DFSDMACLkFreq_Value,DFSDMFreq_Value,DIVM1,DIVM2,DIVM3,DIVN1,DIVN2,DIVN3,DIVP1Freq_Value,DIVP2Freq_Value,DIVP3Freq_Value,DIVQ1Freq_Value,DIVQ2,DIVQ2Freq_Value,DIVQ3,DIVQ3Freq_Value,DIVR1Freq_Value,DIVR2,DIVR2Freq_Value,DIVR3,DIVR3Freq_Value,FDCANFreq_Value,FMCFreq_Value,FamilyName,HCLK3ClockFreq_Value,HCLKFreq_Value,I2C123CLockSelection,I2C123Freq_Value,I2C4Freq_Value,LPTIM1Freq_Value,LPTIM2Freq_Value,LPTIM345Freq_Value,LPUART1Freq_Value,LTDCFreq_Value,MCO1PinFreq_Value,MCO2PinFreq_Value,PLL2FRACN,PLL2_VCI_Range-AdvancedSettings,PLLFRACN,PLLSourceVirtual,QSPIFreq_Value,RNGFreq_Value,RTCClockSelection,RTCFreq_Value,SAI1Freq_Value,SAI4AFreq_Value,SAI4BFreq_Value,SDMMCFreq_Value,SPDIFRXFreq_Value,SPI123CLockSelection,SPI123Freq_Value,SPI45Freq_Value,SPI6Freq_Value,SWPMI1Freq_Value,SYSCLKFreq_VALUE,SYSCLKSource,Spi45ClockSelection,Tim1OutputFreq_Value,Tim2OutputFreq_Value,TraceFreq_Value,USART16CLockSelection,USART16Freq_Value,USART234578CLockSelection,USART234578Freq_Value,USBFreq_Value,VCO1OutputFreq_Value,VCO2OutputFreq_Value,VCO3OutputFreq_Value,VCOInput1Freq_Value,VCOInput2Freq_Value,VCOInput3Freq_Value
 RCC.LPTIM1Freq_Value=100000000
 RCC.LPTIM2Freq_Value=100000000
 RCC.LPTIM345Freq_Value=100000000
 RCC.LPUART1Freq_Value=100000000
-RCC.LTDCFreq_Value=50000000
+RCC.LTDCFreq_Value=60000000
 RCC.MCO1PinFreq_Value=64000000
 RCC.MCO2PinFreq_Value=100000000
@@ -695,11 +736,11 @@
 RCC.TraceFreq_Value=100000000
 RCC.USART16CLockSelection=RCC_USART16910CLKSOURCE_PLL3
-RCC.USART16Freq_Value=25000000
+RCC.USART16Freq_Value=22500000
 RCC.USART234578CLockSelection=RCC_USART234578CLKSOURCE_PLL3
-RCC.USART234578Freq_Value=25000000
+RCC.USART234578Freq_Value=22500000
 RCC.USBFreq_Value=100000000
 RCC.VCO1OutputFreq_Value=200000000
 RCC.VCO2OutputFreq_Value=250000000
-RCC.VCO3OutputFreq_Value=200000000
+RCC.VCO3OutputFreq_Value=180000000
 RCC.VCOInput1Freq_Value=5000000
 RCC.VCOInput2Freq_Value=12500000
@@ -713,4 +754,6 @@
 SDMMC1.HardwareFlowControl=SDMMC_HARDWARE_FLOW_CONTROL_ENABLE
 SDMMC1.IPParameters=ClockPowerSave,HardwareFlowControl,ClockDiv
+SH.ADCx_INP10.0=ADC1_INP10,IN10-Single-Ended
+SH.ADCx_INP10.ConfNb=1
 SH.GPXTI8.0=GPIO_EXTI8
 SH.GPXTI8.ConfNb=1
