view Documentations/OSTC4_CPU2_F411.ioc @ 471:73da921869d9 fix-bat-2

bugfix: implement battery charge percentage in dive header This commit is (much) less trivial than the related 919e5cb51c92. First, rename the CCRmode attribute (corresponding to byte Ox59) of the SLogbookHeaderOSTC3. This byte (according to the hwOS interface document) does not contain any CCR related value, but it contains "battery information". Already since 2017, this byte is used from libdivecomputer to interface the charge percentage. So, its renamed from CCRmode to batteryCharge, to reflect its true purpose. Now, simply add a batteryCharge attribute to the SLogbookHeader (and see below why that is possible, without breaking things). The remaining changes are trivial to implement battery charge percentage in dive header. Caveat: do not get confused by the exact role of the individual logbook header types. SLogbookHeaderOSTC3 is the formal type of the logbook format that the OSTC4 produces. This format is supposed to identical to the format, as is used in hwOS for the series of small OSTCs. Only some values of attributes are different. For example, the OSTC4 supports VPM, so byte 0x79 (deco model used for this dive) also has a value for VPM. But the SLogbookHeader type, despite its name and structure, is *not* a true logbook header, as it includes attributes that are not available in the SLogbookHeaderOSTC3 formal header type. Signed-off-by: Jan Mulder <jan@jlmulder.nl>
author Jan Mulder <jlmulder@xs4all.nl>
date Wed, 22 Apr 2020 13:08:57 +0200
parents 7d1b61176708
children
line wrap: on
line source

#MicroXplorer Configuration settings - do not modify
#Fri May 22 12:37:15 CEST 2015
ADC1.Channel-0\#ChannelRegularConversion=ADC_CHANNEL_8
ADC1.IPParameters=Channel-0\#ChannelRegularConversion,SamplingTime-0\#ChannelRegularConversion,Rank-0\#ChannelRegularConversion,master
ADC1.Rank-0\#ChannelRegularConversion=1
ADC1.SamplingTime-0\#ChannelRegularConversion=ADC_SAMPLETIME_3CYCLES
ADC1.master=1
Dma.Request0=SPI1_RX
Dma.Request1=SPI1_TX
Dma.RequestsNb=2
Dma.SPI1_RX.0.Channel=DMA_CHANNEL_3
Dma.SPI1_RX.0.Direction=DMA_PERIPH_TO_MEMORY
Dma.SPI1_RX.0.FIFOMode=DMA_FIFOMODE_DISABLE
Dma.SPI1_RX.0.Instance=DMA2_Stream0
Dma.SPI1_RX.0.MemDataAlignment=DMA_MDATAALIGN_BYTE
Dma.SPI1_RX.0.MemInc=DMA_MINC_DISABLE
Dma.SPI1_RX.0.Mode=DMA_NORMAL
Dma.SPI1_RX.0.PeriphDataAlignment=DMA_PDATAALIGN_BYTE
Dma.SPI1_RX.0.PeriphInc=DMA_PINC_DISABLE
Dma.SPI1_RX.0.Priority=DMA_PRIORITY_HIGH
Dma.SPI1_RX.0.RequestParameters=Instance,Channel,Direction,PeriphInc,MemInc,PeriphDataAlignment,MemDataAlignment,Mode,Priority,FIFOMode
Dma.SPI1_TX.1.Channel=DMA_CHANNEL_2
Dma.SPI1_TX.1.Direction=DMA_MEMORY_TO_PERIPH
Dma.SPI1_TX.1.FIFOMode=DMA_FIFOMODE_DISABLE
Dma.SPI1_TX.1.Instance=DMA2_Stream2
Dma.SPI1_TX.1.MemDataAlignment=DMA_MDATAALIGN_BYTE
Dma.SPI1_TX.1.MemInc=DMA_MINC_DISABLE
Dma.SPI1_TX.1.Mode=DMA_NORMAL
Dma.SPI1_TX.1.PeriphDataAlignment=DMA_PDATAALIGN_BYTE
Dma.SPI1_TX.1.PeriphInc=DMA_PINC_DISABLE
Dma.SPI1_TX.1.Priority=DMA_PRIORITY_HIGH
Dma.SPI1_TX.1.RequestParameters=Instance,Channel,Direction,PeriphInc,MemInc,PeriphDataAlignment,MemDataAlignment,Mode,Priority,FIFOMode
File.Version=5
KeepUserPlacement=false
Mcu.Family=STM32F4
Mcu.IP0=ADC1
Mcu.IP1=CRC
Mcu.IP2=DMA
Mcu.IP3=I2C1
Mcu.IP4=NVIC
Mcu.IP5=RCC
Mcu.IP6=RTC
Mcu.IP7=SPI1
Mcu.IP8=SPI3
Mcu.IP9=SYS
Mcu.IPNb=10
Mcu.Name=STM32F411R(C-E)Tx
Mcu.Package=LQFP64
Mcu.Pin0=PC14-OSC32_IN
Mcu.Pin1=PC15-OSC32_OUT
Mcu.Pin10=PA6
Mcu.Pin11=PA7
Mcu.Pin12=PB0
Mcu.Pin13=PB12
Mcu.Pin14=PB13
Mcu.Pin15=PB14
Mcu.Pin16=PB15
Mcu.Pin17=PA9
Mcu.Pin18=PA10
Mcu.Pin19=PA13
Mcu.Pin2=PC0
Mcu.Pin20=PA14
Mcu.Pin21=PA15
Mcu.Pin22=PC10
Mcu.Pin23=PC11
Mcu.Pin24=PC12
Mcu.Pin25=PB3
Mcu.Pin26=PB8
Mcu.Pin27=PB9
Mcu.Pin28=VP_CRC_VS_CRC
Mcu.Pin29=VP_RTC_VS_RTC_Alarm_A_Intern
Mcu.Pin3=PC1
Mcu.Pin4=PC2
Mcu.Pin5=PC3
Mcu.Pin6=PA0-WKUP
Mcu.Pin7=PA1
Mcu.Pin8=PA4
Mcu.Pin9=PA5
Mcu.PinsNb=30
Mcu.UserName=STM32F411RETx
MxCube.Version=4.7.1
MxDb.Version=DB.4.0.71
NVIC.DMA2_Stream0_IRQn=true\:0\:0\:false
NVIC.DMA2_Stream2_IRQn=true\:0\:0\:false
NVIC.PriorityGroup=NVIC_PRIORITYGROUP_0
NVIC.SysTick_IRQn=true\:0\:0\:true
PA0-WKUP.Locked=true
PA0-WKUP.Signal=GPIO_Input
PA1.Locked=true
PA1.Signal=GPIO_Analog
PA10.Signal=USART1_RX
PA13.Mode=Trace-Asynchronous_SW
PA13.Signal=SYS_JTMS-SWDIO
PA14.Mode=Trace-Asynchronous_SW
PA14.Signal=SYS_JTCK-SWCLK
PA15.Mode=NSS_Signal_Hard
PA15.Signal=SPI3_NSS
PA4.Locked=true
PA4.Mode=NSS_Signal_Hard
PA4.Signal=SPI1_NSS
PA5.Mode=Full_Duplex_Slave
PA5.Signal=SPI1_SCK
PA6.Mode=Full_Duplex_Slave
PA6.Signal=SPI1_MISO
PA7.Mode=Full_Duplex_Slave
PA7.Signal=SPI1_MOSI
PA9.Signal=USART1_TX
PB0.Locked=true
PB0.Signal=ADCx_IN8
PB12.Locked=true
PB12.Signal=GPIO_Analog
PB13.Locked=true
PB13.Signal=GPIO_Input
PB14.Locked=true
PB14.Signal=GPIO_Analog
PB15.Locked=true
PB15.Signal=GPIO_Output
PB3.Mode=Trace-Asynchronous_SW
PB3.Signal=SYS_JTDO-SWO
PB8.Locked=true
PB8.Mode=I2C
PB8.Signal=I2C1_SCL
PB9.Locked=true
PB9.Mode=I2C
PB9.Signal=I2C1_SDA
PC0.Locked=true
PC0.Signal=GPIO_Output
PC1.Locked=true
PC1.Signal=GPIO_Output
PC10.Mode=Full_Duplex_Master
PC10.Signal=SPI3_SCK
PC11.Mode=Full_Duplex_Master
PC11.Signal=SPI3_MISO
PC12.Mode=Full_Duplex_Master
PC12.Signal=SPI3_MOSI
PC14-OSC32_IN.Mode=LSE-External-Oscillator
PC14-OSC32_IN.Signal=RCC_OSC32_IN
PC15-OSC32_OUT.Mode=LSE-External-Oscillator
PC15-OSC32_OUT.Signal=RCC_OSC32_OUT
PC2.Locked=true
PC2.Signal=GPIO_Input
PC3.Locked=true
PC3.Signal=GPIO_Output
PCC.Battery=Li-SOCL2(A3400)
PCC.Battery.Capacity=3400.0
PCC.Battery.Compatibility=Yes
PCC.Battery.InParallel=1
PCC.Battery.InSeries=1
PCC.Battery.MaxContinuous=100.0
PCC.Battery.MaxPulseCurrent=200.0
PCC.Battery.NominalVoltage=3.6
PCC.Battery.SelfDischarge=0.08
PCC.Checker=false
PCC.Family=STM32F4
PCC.MCU=STM32F411R(C-E)Tx
PCC.MXVersion=4.7.1
PCC.PartNumber=STM32F411RETx
PCC.Seq0=3
PCC.Seq0.Step0.Average_Current=19 \u00B5A
PCC.Seq0.Step0.CPU_Frequency=0 Hz
PCC.Seq0.Step0.DMIPS=0.0
PCC.Seq0.Step0.Duration=2 s
PCC.Seq0.Step0.Frequency=0 Hz
PCC.Seq0.Step0.Memory=n/a
PCC.Seq0.Step0.Mode=STOP
PCC.Seq0.Step0.Oscillator=Regulator_LP Flash-PwrDwn
PCC.Seq0.Step0.Peripherals=PVD* RTC*
PCC.Seq0.Step0.User's_Consumption=5 \u00B5A
PCC.Seq0.Step0.Vcore=No Scale
PCC.Seq0.Step0.Vdd=3.6
PCC.Seq0.Step0.Voltage_Source=Battery
PCC.Seq0.Step1.Average_Current=20.83 mA
PCC.Seq0.Step1.CPU_Frequency=100.0 MHz
PCC.Seq0.Step1.DMIPS=125.0
PCC.Seq0.Step1.Duration=2 ms
PCC.Seq0.Step1.Frequency=4.0 MHz
PCC.Seq0.Step1.Memory=FLASH
PCC.Seq0.Step1.Mode=RUN
PCC.Seq0.Step1.Oscillator=HSE PLL
PCC.Seq0.Step1.Peripherals=GPIOB I2C1
PCC.Seq0.Step1.User's_Consumption=120 \u00B5A
PCC.Seq0.Step1.Vcore=Scale1-Medium
PCC.Seq0.Step1.Vdd=3.6
PCC.Seq0.Step1.Voltage_Source=Battery
PCC.Seq0.Step2.Average_Current=3.31 mA
PCC.Seq0.Step2.CPU_Frequency=100.0 MHz
PCC.Seq0.Step2.DMIPS=125.0
PCC.Seq0.Step2.Duration=22 ms
PCC.Seq0.Step2.Frequency=4.0 MHz
PCC.Seq0.Step2.Memory=RAM/FLASH
PCC.Seq0.Step2.Mode=SLEEP
PCC.Seq0.Step2.Oscillator=HSE PLL
PCC.Seq0.Step2.Peripherals=GPIOB I2C1
PCC.Seq0.Step2.User's_Consumption=0 mA
PCC.Seq0.Step2.Vcore=Scale1-Medium
PCC.Seq0.Step2.Vdd=3.6
PCC.Seq0.Step2.Voltage_Source=Battery
PCC.SubFamily=STM32F411
PCC.Temperature=25
PCC.Vdd=3.6
ProjectManager.AskForMigrate=true
ProjectManager.BackupPrevious=false
ProjectManager.CompilerOptimize=2
ProjectManager.ComputerToolchain=false
ProjectManager.CoupleFile=false
ProjectManager.DeletePrevious=true
ProjectManager.DeviceId=STM32F411RETx
ProjectManager.FirmwarePackage=STM32Cube FW_F4 V1.5.0
ProjectManager.FreePins=true
ProjectManager.HalAssertFull=false
ProjectManager.KeepUserCode=true
ProjectManager.LastFirmware=true
ProjectManager.LibraryCopy=0
ProjectManager.ProjectBuild=false
ProjectManager.ProjectFileName=OSTC4 CPU2 F411.ioc
ProjectManager.ProjectName=OSTC4 CPU2 F411
ProjectManager.TargetToolchain=MDK-ARM 4.73
ProjectManager.ToolChainLocation=
RCC.48MHZClocksFreq_Value=100000000
RCC.AHBFreq_Value=100000000
RCC.APB1CLKDivider=RCC_HCLK_DIV2
RCC.APB1Freq_Value=50000000
RCC.APB1TimFreq_Value=100000000
RCC.APB2Freq_Value=100000000
RCC.APB2TimFreq_Value=100000000
RCC.CortexFreq_Value=12500000
RCC.EthernetFreq_Value=100000000
RCC.FCLKCortexFreq_Value=100000000
RCC.FamilyName=M
RCC.HCLKFreq_Value=100000000
RCC.HSE_VALUE=25000000
RCC.HSI_VALUE=16000000
RCC.I2SClocksFreq_Value=96000000
RCC.IPParameters=LSI_VALUE,APB1TimFreq_Value,APB2Freq_Value,MCO2PinFreq_Value,APB1CLKDivider,FCLKCortexFreq_Value,RCC_RTC_Clock_SourceVirtual,AHBFreq_Value,48MHZClocksFreq_Value,VCOInputFreq_Value,I2SClocksFreq_Value,SYSCLKFreq_VALUE,SYSCLKSource,PLLP,HSE_VALUE,HSI_VALUE,VCOI2SOutputFreq_Value,PLLCLKFreq_Value,VCOInputMFreq_Value,RTCFreq_Value,FamilyName,HCLKFreq_Value,EthernetFreq_Value,PLLN,VCOOutputFreq_Value,VcooutputI2S,CortexFreq_Value,APB1Freq_Value,RTCHSEDivFreq_Value,APB2TimFreq_Value
RCC.LSI_VALUE=32000
RCC.MCO2PinFreq_Value=100000000
RCC.PLLCLKFreq_Value=100000000
RCC.PLLN=400
RCC.PLLP=RCC_PLLP_DIV4
RCC.RCC_RTC_Clock_SourceVirtual=RCC_RTCCLKSOURCE_LSE
RCC.RTCFreq_Value=32768
RCC.RTCHSEDivFreq_Value=12500000
RCC.SYSCLKFreq_VALUE=100000000
RCC.SYSCLKSource=RCC_SYSCLKSOURCE_PLLCLK
RCC.VCOI2SOutputFreq_Value=192000000
RCC.VCOInputFreq_Value=1000000
RCC.VCOInputMFreq_Value=1000000
RCC.VCOOutputFreq_Value=400000000
RCC.VcooutputI2S=96000000
SH.ADCx_IN8.0=ADC1_IN8,IN8
SH.ADCx_IN8.ConfNb=1
SPI1.BaudRatePrescaler=SPI_BAUDRATEPRESCALER_2
SPI1.CalculateBaudRate=50.0 MBits/s
SPI1.IPParameters=BaudRatePrescaler,NSS-Full_Duplex_Slave,VirtualNSS,VirtualType,CalculateBaudRate
SPI1.NSS-Full_Duplex_Slave=SPI_NSS_SOFT
SPI1.VirtualNSS=VM_NSSHARD
SPI1.VirtualType=VM_SLAVE
SPI3.CalculateBaudRate=25.0 MBits/s
SPI3.IPParameters=VirtualNSS,Mode,CalculateBaudRate
SPI3.Mode=SPI_MODE_MASTER
SPI3.VirtualNSS=VM_NSSHARD
VP_CRC_VS_CRC.Mode=CRC_Activate
VP_CRC_VS_CRC.Signal=CRC_VS_CRC
VP_RTC_VS_RTC_Alarm_A_Intern.Mode=Alarm A
VP_RTC_VS_RTC_Alarm_A_Intern.Signal=RTC_VS_RTC_Alarm_A_Intern