diff --git a/.cproject b/.cproject
new file mode 100644
index 0000000..521f111
--- /dev/null
+++ b/.cproject
@@ -0,0 +1,174 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.mxproject b/.mxproject
new file mode 100644
index 0000000..ed1ca5a
--- /dev/null
+++ b/.mxproject
@@ -0,0 +1,25 @@
+[PreviousLibFiles]
+LibFiles=Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_spi.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_spi.h;Drivers\STM32F1xx_HAL_Driver\Inc\Legacy\stm32_hal_legacy.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_def.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_rcc.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_rcc_ex.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_bus.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_rcc.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_system.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_utils.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_gpio.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_gpio_ex.h;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_gpio_ex.c;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_gpio.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_dma_ex.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_dma.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_dma.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_cortex.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_cortex.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_pwr.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_pwr.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_flash.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_flash_ex.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_exti.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_exti.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_tim.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_tim_ex.h;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_spi.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_rcc.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_rcc_ex.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_gpio.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_dma.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_cortex.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_pwr.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_flash.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_flash_ex.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_exti.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_tim.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_tim_ex.c;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_spi.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_spi.h;Drivers\STM32F1xx_HAL_Driver\Inc\Legacy\stm32_hal_legacy.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_def.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_rcc.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_rcc_ex.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_bus.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_rcc.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_system.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_utils.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_gpio.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_gpio_ex.h;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_gpio_ex.c;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_gpio.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_dma_ex.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_dma.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_dma.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_cortex.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_cortex.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_pwr.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_pwr.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_flash.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_flash_ex.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_exti.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_ll_exti.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_tim.h;Drivers\STM32F1xx_HAL_Driver\Inc\stm32f1xx_hal_tim_ex.h;Drivers\CMSIS\Device\ST\STM32F1xx\Include\stm32f103x6.h;Drivers\CMSIS\Device\ST\STM32F1xx\Include\stm32f1xx.h;Drivers\CMSIS\Device\ST\STM32F1xx\Include\system_stm32f1xx.h;Drivers\CMSIS\Device\ST\STM32F1xx\Include\system_stm32f1xx.h;Drivers\CMSIS\Device\ST\STM32F1xx\Source\Templates\system_stm32f1xx.c;Drivers\CMSIS\Include\cmsis_armcc.h;Drivers\CMSIS\Include\cmsis_armclang.h;Drivers\CMSIS\Include\cmsis_compiler.h;Drivers\CMSIS\Include\cmsis_gcc.h;Drivers\CMSIS\Include\cmsis_iccarm.h;Drivers\CMSIS\Include\cmsis_version.h;Drivers\CMSIS\Include\core_armv8mbl.h;Drivers\CMSIS\Include\core_armv8mml.h;Drivers\CMSIS\Include\core_cm0.h;Drivers\CMSIS\Include\core_cm0plus.h;Drivers\CMSIS\Include\core_cm1.h;Drivers\CMSIS\Include\core_cm23.h;Drivers\CMSIS\Include\core_cm3.h;Drivers\CMSIS\Include\core_cm33.h;Drivers\CMSIS\Include\core_cm4.h;Drivers\CMSIS\Include\core_cm7.h;Drivers\CMSIS\Include\core_sc000.h;Drivers\CMSIS\Include\core_sc300.h;Drivers\CMSIS\Include\mpu_armv7.h;Drivers\CMSIS\Include\mpu_armv8.h;Drivers\CMSIS\Include\tz_context.h;
+
+[PreviousUsedCubeIDEFiles]
+SourceFiles=Core\Src\main.c;Core\Src\stm32f1xx_it.c;Core\Src\stm32f1xx_hal_msp.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_gpio_ex.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_spi.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_rcc.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_rcc_ex.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_gpio.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_dma.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_cortex.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_pwr.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_flash.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_flash_ex.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_exti.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_tim.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_tim_ex.c;Drivers\CMSIS\Device\ST\STM32F1xx\Source\Templates\system_stm32f1xx.c;Core\Src\system_stm32f1xx.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_gpio_ex.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_spi.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_rcc.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_rcc_ex.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_gpio.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_dma.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_cortex.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_pwr.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_flash.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_flash_ex.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_exti.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_tim.c;Drivers\STM32F1xx_HAL_Driver\Src\stm32f1xx_hal_tim_ex.c;Drivers\CMSIS\Device\ST\STM32F1xx\Source\Templates\system_stm32f1xx.c;Core\Src\system_stm32f1xx.c;;;
+HeaderPath=Drivers\STM32F1xx_HAL_Driver\Inc;Drivers\STM32F1xx_HAL_Driver\Inc\Legacy;Drivers\CMSIS\Device\ST\STM32F1xx\Include;Drivers\CMSIS\Include;Core\Inc;
+CDefines=USE_HAL_DRIVER;STM32F103x6;USE_HAL_DRIVER;USE_HAL_DRIVER;
+
+[PreviousGenFiles]
+AdvancedFolderStructure=true
+HeaderFileListSize=3
+HeaderFiles#0=..\Core\Inc\stm32f1xx_it.h
+HeaderFiles#1=..\Core\Inc\stm32f1xx_hal_conf.h
+HeaderFiles#2=..\Core\Inc\main.h
+HeaderFolderListSize=1
+HeaderPath#0=..\Core\Inc
+HeaderFiles=;
+SourceFileListSize=3
+SourceFiles#0=..\Core\Src\stm32f1xx_it.c
+SourceFiles#1=..\Core\Src\stm32f1xx_hal_msp.c
+SourceFiles#2=..\Core\Src\main.c
+SourceFolderListSize=1
+SourcePath#0=..\Core\Src
+SourceFiles=;
+
diff --git a/.project b/.project
new file mode 100644
index 0000000..868c31d
--- /dev/null
+++ b/.project
@@ -0,0 +1,39 @@
+
+
+ ADAS
+
+
+
+
+
+ org.eclipse.cdt.managedbuilder.core.genmakebuilder
+ clean,full,incremental,
+
+
+
+
+ org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder
+ full,incremental,
+
+
+
+
+
+ com.st.stm32cube.ide.mcu.MCUProjectNature
+ com.st.stm32cube.ide.mcu.MCUCubeProjectNature
+ org.eclipse.cdt.core.cnature
+ com.st.stm32cube.ide.mcu.MCUCubeIdeServicesRevAev2ProjectNature
+ com.st.stm32cube.ide.mcu.MCUAdvancedStructureProjectNature
+ com.st.stm32cube.ide.mcu.MCUSingleCpuProjectNature
+ com.st.stm32cube.ide.mcu.MCURootProjectNature
+ org.eclipse.cdt.managedbuilder.core.managedBuildNature
+ org.eclipse.cdt.managedbuilder.core.ScannerConfigNature
+
+
+
+ Core/Inc/MCP3008.h
+ 1
+ D:/Work/Chandrima project -ADAS/STM32_code_workspace/ADAS/Core/Inc/MCP3008.h
+
+
+
diff --git a/.settings/language.settings.xml b/.settings/language.settings.xml
new file mode 100644
index 0000000..553d992
--- /dev/null
+++ b/.settings/language.settings.xml
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.settings/org.eclipse.core.resources.prefs b/.settings/org.eclipse.core.resources.prefs
new file mode 100644
index 0000000..99f26c0
--- /dev/null
+++ b/.settings/org.eclipse.core.resources.prefs
@@ -0,0 +1,2 @@
+eclipse.preferences.version=1
+encoding/=UTF-8
diff --git a/.settings/stm32cubeide.project.prefs b/.settings/stm32cubeide.project.prefs
new file mode 100644
index 0000000..0a16368
--- /dev/null
+++ b/.settings/stm32cubeide.project.prefs
@@ -0,0 +1,4 @@
+66BE74F758C12D739921AEA421D593D3=1
+8DF89ED150041C4CBC7CB9A9CAA90856=D231413A6B4853FB36E3A215E8CA1BF3
+DC22A860405A8BF2F2C095E5B6529F12=D231413A6B4853FB36E3A215E8CA1BF3
+eclipse.preferences.version=1
diff --git a/ADAS.ioc b/ADAS.ioc
new file mode 100644
index 0000000..e182ba3
--- /dev/null
+++ b/ADAS.ioc
@@ -0,0 +1,153 @@
+#MicroXplorer Configuration settings - do not modify
+CAD.formats=
+CAD.pinconfig=
+CAD.provider=
+File.Version=6
+KeepUserPlacement=false
+Mcu.CPN=STM32F103C6T6A
+Mcu.Family=STM32F1
+Mcu.IP0=NVIC
+Mcu.IP1=RCC
+Mcu.IP2=SPI1
+Mcu.IP3=SYS
+Mcu.IPNb=4
+Mcu.Name=STM32F103C(4-6)Tx
+Mcu.Package=LQFP48
+Mcu.Pin0=PA5
+Mcu.Pin1=PA6
+Mcu.Pin10=PA10
+Mcu.Pin11=PA11
+Mcu.Pin12=PA12
+Mcu.Pin13=PA13
+Mcu.Pin14=PA14
+Mcu.Pin15=PA15
+Mcu.Pin16=PB3
+Mcu.Pin17=PB4
+Mcu.Pin18=PB5
+Mcu.Pin19=PB6
+Mcu.Pin2=PA7
+Mcu.Pin20=PB7
+Mcu.Pin21=PB8
+Mcu.Pin22=PB9
+Mcu.Pin23=VP_SYS_VS_ND
+Mcu.Pin24=VP_SYS_VS_Systick
+Mcu.Pin3=PB10
+Mcu.Pin4=PB11
+Mcu.Pin5=PB12
+Mcu.Pin6=PB13
+Mcu.Pin7=PB14
+Mcu.Pin8=PB15
+Mcu.Pin9=PA8
+Mcu.PinsNb=25
+Mcu.ThirdPartyNb=0
+Mcu.UserConstants=
+Mcu.UserName=STM32F103C6Tx
+MxCube.Version=6.12.0
+MxDb.Version=DB.6.0.120
+NVIC.BusFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
+NVIC.DebugMonitor_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
+NVIC.ForceEnableDMAVector=true
+NVIC.HardFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
+NVIC.MemoryManagement_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
+NVIC.NonMaskableInt_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
+NVIC.PendSV_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
+NVIC.PriorityGroup=NVIC_PRIORITYGROUP_4
+NVIC.SVCall_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
+NVIC.SysTick_IRQn=true\:15\:0\:false\:false\:true\:false\:true\:false
+NVIC.UsageFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false\:false
+PA10.Locked=true
+PA10.Signal=GPIO_Output
+PA11.Locked=true
+PA11.Signal=GPIO_Output
+PA12.Locked=true
+PA12.Signal=GPIO_Output
+PA13.Locked=true
+PA13.Signal=GPIO_Output
+PA14.Locked=true
+PA14.Signal=GPIO_Output
+PA15.Locked=true
+PA15.Signal=GPIO_Output
+PA5.Mode=Full_Duplex_Master
+PA5.Signal=SPI1_SCK
+PA6.Mode=Full_Duplex_Master
+PA6.Signal=SPI1_MISO
+PA7.Mode=Full_Duplex_Master
+PA7.Signal=SPI1_MOSI
+PA8.Locked=true
+PA8.Signal=GPIO_Output
+PB10.Locked=true
+PB10.Signal=GPIO_Output
+PB11.Locked=true
+PB11.Signal=GPIO_Output
+PB12.Locked=true
+PB12.Signal=GPIO_Output
+PB13.Locked=true
+PB13.Signal=GPIO_Output
+PB14.Locked=true
+PB14.Signal=GPIO_Output
+PB15.Locked=true
+PB15.Signal=GPIO_Output
+PB3.Locked=true
+PB3.Signal=GPIO_Output
+PB4.Locked=true
+PB4.Signal=GPIO_Output
+PB5.Locked=true
+PB5.Signal=GPIO_Output
+PB6.Locked=true
+PB6.Signal=GPIO_Output
+PB7.Locked=true
+PB7.Signal=GPIO_Output
+PB8.Locked=true
+PB8.Signal=GPIO_Output
+PB9.Locked=true
+PB9.Signal=GPIO_Output
+PinOutPanel.RotationAngle=0
+ProjectManager.AskForMigrate=true
+ProjectManager.BackupPrevious=false
+ProjectManager.CompilerOptimize=6
+ProjectManager.ComputerToolchain=false
+ProjectManager.CoupleFile=false
+ProjectManager.CustomerFirmwarePackage=
+ProjectManager.DefaultFWLocation=true
+ProjectManager.DeletePrevious=true
+ProjectManager.DeviceId=STM32F103C6Tx
+ProjectManager.FirmwarePackage=STM32Cube FW_F1 V1.8.5
+ProjectManager.FreePins=false
+ProjectManager.HalAssertFull=false
+ProjectManager.HeapSize=0x200
+ProjectManager.KeepUserCode=true
+ProjectManager.LastFirmware=true
+ProjectManager.LibraryCopy=1
+ProjectManager.MainLocation=Core/Src
+ProjectManager.NoMain=false
+ProjectManager.PreviousToolchain=
+ProjectManager.ProjectBuild=false
+ProjectManager.ProjectFileName=ADAS.ioc
+ProjectManager.ProjectName=ADAS
+ProjectManager.ProjectStructure=
+ProjectManager.RegisterCallBack=
+ProjectManager.StackSize=0x400
+ProjectManager.TargetToolchain=STM32CubeIDE
+ProjectManager.ToolChainLocation=
+ProjectManager.UAScriptAfterPath=
+ProjectManager.UAScriptBeforePath=
+ProjectManager.UnderRoot=true
+ProjectManager.functionlistsort=1-SystemClock_Config-RCC-false-HAL-false,2-MX_GPIO_Init-GPIO-false-HAL-true,3-MX_SPI1_Init-SPI1-false-HAL-true
+RCC.APB1Freq_Value=8000000
+RCC.APB2Freq_Value=8000000
+RCC.FamilyName=M
+RCC.IPParameters=APB1Freq_Value,APB2Freq_Value,FamilyName,PLLCLKFreq_Value,PLLMCOFreq_Value,TimSysFreq_Value
+RCC.PLLCLKFreq_Value=8000000
+RCC.PLLMCOFreq_Value=4000000
+RCC.TimSysFreq_Value=8000000
+SPI1.CalculateBaudRate=4.0 MBits/s
+SPI1.Direction=SPI_DIRECTION_2LINES
+SPI1.IPParameters=VirtualType,Mode,Direction,CalculateBaudRate
+SPI1.Mode=SPI_MODE_MASTER
+SPI1.VirtualType=VM_MASTER
+VP_SYS_VS_ND.Mode=No_Debug
+VP_SYS_VS_ND.Signal=SYS_VS_ND
+VP_SYS_VS_Systick.Mode=SysTick
+VP_SYS_VS_Systick.Signal=SYS_VS_Systick
+board=custom
+isbadioc=false
diff --git a/Core/Inc/LiquidCrystal.h b/Core/Inc/LiquidCrystal.h
new file mode 100644
index 0000000..ab92198
--- /dev/null
+++ b/Core/Inc/LiquidCrystal.h
@@ -0,0 +1,91 @@
+/*
+ * LiquidCrystal.h
+ *
+ * Created on: Jul 6, 2024
+ * Author: sujit
+ */
+
+#ifndef INC_LIQUIDCRYSTAL_H_
+#define INC_LIQUIDCRYSTAL_H_
+
+// commands
+#define LCD_CLEARDISPLAY 0x01
+#define LCD_RETURNHOME 0x02
+#define LCD_ENTRYMODESET 0x04
+#define LCD_DISPLAYCONTROL 0x08
+#define LCD_CURSORSHIFT 0x10
+#define LCD_FUNCTIONSET 0x20
+#define LCD_SETCGRAMADDR 0x40
+#define LCD_SETDDRAMADDR 0x80
+
+// flags for display entry mode
+#define LCD_ENTRYRIGHT 0x00
+#define LCD_ENTRYLEFT 0x02
+#define LCD_ENTRYSHIFTINCREMENT 0x01
+#define LCD_ENTRYSHIFTDECREMENT 0x00
+
+// flags for display on/off control
+#define LCD_DISPLAYON 0x04
+#define LCD_DISPLAYOFF 0x00
+#define LCD_CURSORON 0x02
+#define LCD_CURSOROFF 0x00
+#define LCD_BLINKON 0x01
+#define LCD_BLINKOFF 0x00
+
+// flags for display/cursor shift
+#define LCD_DISPLAYMOVE 0x08
+#define LCD_CURSORMOVE 0x00
+#define LCD_MOVERIGHT 0x04
+#define LCD_MOVELEFT 0x00
+
+// flags for function set
+#define LCD_8BITMODE 0x10
+#define LCD_4BITMODE 0x00
+#define LCD_2LINE 0x08
+#define LCD_1LINE 0x00
+#define LCD_5x10DOTS 0x04
+#define LCD_5x8DOTS 0x00
+
+
+// low-level functions
+void send(uint8_t, GPIO_PinState);
+void write4bits(uint8_t);
+void write8bits(uint8_t);
+void pulseEnable(void);
+
+// initializers
+void LiquidCrystal(GPIO_TypeDef *gpioport, uint16_t rs, uint16_t rw, uint16_t enable,
+ uint16_t d0, uint16_t d1, uint16_t d2, uint16_t d3);
+
+void init(uint8_t fourbitmode, GPIO_TypeDef *gpioport, uint16_t rs, uint16_t rw, uint16_t enable,
+ uint16_t d0, uint16_t d1, uint16_t d2, uint16_t d3,
+ uint16_t d4, uint16_t d5, uint16_t d6, uint16_t d7);
+
+void begin(uint8_t cols, uint8_t rows);
+void enableClock(void);
+
+// high-level functions
+void clear(void);
+void home(void);
+
+void noDisplay(void);
+void display(void);
+void noBlink(void);
+void blink(void);
+void noCursor(void);
+void cursor(void);
+void scrollDisplayLeft(void);
+void scrollDisplayRight(void);
+void leftToRight(void);
+void rightToLeft(void);
+void autoscroll(void);
+void noAutoscroll(void);
+size_t print(const char []);
+
+void setRowOffsets(int row1, int row2, int row3, int row4);
+void createChar(uint8_t, uint8_t[]);
+void setCursor(uint8_t, uint8_t);
+size_t write(uint8_t);
+void command(uint8_t);
+
+#endif /* INC_LIQUIDCRYSTAL_H_ */
diff --git a/Core/Inc/MCP3008.h b/Core/Inc/MCP3008.h
new file mode 100644
index 0000000..26ddc56
--- /dev/null
+++ b/Core/Inc/MCP3008.h
@@ -0,0 +1,81 @@
+/*
+ * MCP3008.h
+ *
+ * Created on: May 23, 2024
+ * Author: Ben Francis
+ */
+
+#ifndef __MCP3008_H_
+#define __MCP3008_H_
+
+#include
+#include "main.h"
+/* Bit Manipulation Macros */
+#define SHIFT_4 4
+#define SHIFT_8 8
+#define FIRST_10_BITS_MASK 0x03FF
+
+/* Limits and Commonly used conversion Macro*/
+#define MCP3008_NUM_CHANNELS 8
+#define MCP3008_ADC_MAX 1023
+#define MCP3008_SPI_TIMEOUT 1 //1 msec timeout
+
+/**
+ * @brief MCP3008 Driver Handle struct
+ */
+typedef struct
+{
+
+ GPIO_TypeDef *CS_Port;
+
+ uint16_t CS_Pin;
+
+ SPI_HandleTypeDef *hspi;
+
+}MCP3008_Handle_t;
+
+/**
+ * @brief Error mapping for driver functions
+ */
+typedef enum
+{
+ MCP3008_ERROR_INVALID_ARG = -1,
+ MCP3008_ERROR_SPI = -2
+
+}MCP3008_STATUS;
+
+/**
+ * @brief Initializes the MCP3008 driver handle and enable the outputs
+ *
+ * @param handle - handle for MCP3008 driver
+ * @param cs_port - CS pin GPIO port
+ * @param cs_pin - CS GPIO pin number
+ * @param hspi - STM32x SPI peripheral handle
+ *
+ * @return None
+ */
+void MCP3008_handle_init(MCP3008_Handle_t *handle, GPIO_TypeDef *cs_port, uint16_t cs_pin, SPI_HandleTypeDef *hspi);
+
+
+/**
+ * @brief Reads the ADC input for a specified channel
+ *
+ * @param handle - handle for MCP3008 driver
+ * @param chan - channel number to read (0 - 7)
+ *
+ * @return the ADC input in ADC units; MCP3008_ERROR_SPI or MCP3008_ERROR_INVALID_ARG in case of error
+ */
+int16_t MCP3008_read(MCP3008_Handle_t *handle, uint8_t chan);
+
+/**
+ * @brief Reads the ADC input for a specified channel and converts to volts
+ *
+ * @param handle - handle for MCP3008 driver
+ * @param chan - channel number to read (0 - 7)
+ * @param vref - MCP3008 reference voltage (Vref)
+ *
+ * @return the ADC input in volts; MCP3008_ERROR_SPI or MCP3008_ERROR_INVALID_ARG in case of error
+ */
+float MCP3008_read_volts(MCP3008_Handle_t *handle, uint8_t chan, float vref);
+
+#endif /* __MCP3008_H_ */
diff --git a/Core/Inc/main.h b/Core/Inc/main.h
new file mode 100644
index 0000000..218d3a3
--- /dev/null
+++ b/Core/Inc/main.h
@@ -0,0 +1,69 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * @file : main.h
+ * @brief : Header for main.c file.
+ * This file contains the common defines of the application.
+ ******************************************************************************
+ * @attention
+ *
+ * Copyright (c) 2024 STMicroelectronics.
+ * All rights reserved.
+ *
+ * This software is licensed under terms that can be found in the LICENSE file
+ * in the root directory of this software component.
+ * If no LICENSE file comes with this software, it is provided AS-IS.
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef __MAIN_H
+#define __MAIN_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Includes ------------------------------------------------------------------*/
+#include "stm32f1xx_hal.h"
+
+/* Private includes ----------------------------------------------------------*/
+/* USER CODE BEGIN Includes */
+
+/* USER CODE END Includes */
+
+/* Exported types ------------------------------------------------------------*/
+/* USER CODE BEGIN ET */
+
+/* USER CODE END ET */
+
+/* Exported constants --------------------------------------------------------*/
+/* USER CODE BEGIN EC */
+
+/* USER CODE END EC */
+
+/* Exported macro ------------------------------------------------------------*/
+/* USER CODE BEGIN EM */
+
+/* USER CODE END EM */
+
+/* Exported functions prototypes ---------------------------------------------*/
+void Error_Handler(void);
+
+/* USER CODE BEGIN EFP */
+
+/* USER CODE END EFP */
+
+/* Private defines -----------------------------------------------------------*/
+
+/* USER CODE BEGIN Private defines */
+
+/* USER CODE END Private defines */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __MAIN_H */
diff --git a/Core/Inc/stm32f1xx_hal_conf.h b/Core/Inc/stm32f1xx_hal_conf.h
new file mode 100644
index 0000000..a817017
--- /dev/null
+++ b/Core/Inc/stm32f1xx_hal_conf.h
@@ -0,0 +1,391 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * @file stm32f1xx_hal_conf.h
+ * @brief HAL configuration file.
+ ******************************************************************************
+ * @attention
+ *
+ * Copyright (c) 2017 STMicroelectronics.
+ * All rights reserved.
+ *
+ * This software is licensed under terms that can be found in the LICENSE file
+ * in the root directory of this software component.
+ * If no LICENSE file comes with this software, it is provided AS-IS.
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef __STM32F1xx_HAL_CONF_H
+#define __STM32F1xx_HAL_CONF_H
+
+#ifdef __cplusplus
+ extern "C" {
+#endif
+
+/* Exported types ------------------------------------------------------------*/
+/* Exported constants --------------------------------------------------------*/
+
+/* ########################## Module Selection ############################## */
+/**
+ * @brief This is the list of modules to be used in the HAL driver
+ */
+
+#define HAL_MODULE_ENABLED
+ /*#define HAL_ADC_MODULE_ENABLED */
+/*#define HAL_CRYP_MODULE_ENABLED */
+/*#define HAL_CAN_MODULE_ENABLED */
+/*#define HAL_CAN_LEGACY_MODULE_ENABLED */
+/*#define HAL_CEC_MODULE_ENABLED */
+/*#define HAL_CORTEX_MODULE_ENABLED */
+/*#define HAL_CRC_MODULE_ENABLED */
+/*#define HAL_DAC_MODULE_ENABLED */
+/*#define HAL_DMA_MODULE_ENABLED */
+/*#define HAL_ETH_MODULE_ENABLED */
+/*#define HAL_FLASH_MODULE_ENABLED */
+#define HAL_GPIO_MODULE_ENABLED
+/*#define HAL_I2C_MODULE_ENABLED */
+/*#define HAL_I2S_MODULE_ENABLED */
+/*#define HAL_IRDA_MODULE_ENABLED */
+/*#define HAL_IWDG_MODULE_ENABLED */
+/*#define HAL_NOR_MODULE_ENABLED */
+/*#define HAL_NAND_MODULE_ENABLED */
+/*#define HAL_PCCARD_MODULE_ENABLED */
+/*#define HAL_PCD_MODULE_ENABLED */
+/*#define HAL_HCD_MODULE_ENABLED */
+/*#define HAL_PWR_MODULE_ENABLED */
+/*#define HAL_RCC_MODULE_ENABLED */
+/*#define HAL_RTC_MODULE_ENABLED */
+/*#define HAL_SD_MODULE_ENABLED */
+/*#define HAL_MMC_MODULE_ENABLED */
+/*#define HAL_SDRAM_MODULE_ENABLED */
+/*#define HAL_SMARTCARD_MODULE_ENABLED */
+#define HAL_SPI_MODULE_ENABLED
+/*#define HAL_SRAM_MODULE_ENABLED */
+/*#define HAL_TIM_MODULE_ENABLED */
+/*#define HAL_UART_MODULE_ENABLED */
+/*#define HAL_USART_MODULE_ENABLED */
+/*#define HAL_WWDG_MODULE_ENABLED */
+
+#define HAL_CORTEX_MODULE_ENABLED
+#define HAL_DMA_MODULE_ENABLED
+#define HAL_FLASH_MODULE_ENABLED
+#define HAL_EXTI_MODULE_ENABLED
+#define HAL_GPIO_MODULE_ENABLED
+#define HAL_PWR_MODULE_ENABLED
+#define HAL_RCC_MODULE_ENABLED
+
+/* ########################## Oscillator Values adaptation ####################*/
+/**
+ * @brief Adjust the value of External High Speed oscillator (HSE) used in your application.
+ * This value is used by the RCC HAL module to compute the system frequency
+ * (when HSE is used as system clock source, directly or through the PLL).
+ */
+#if !defined (HSE_VALUE)
+ #define HSE_VALUE 8000000U /*!< Value of the External oscillator in Hz */
+#endif /* HSE_VALUE */
+
+#if !defined (HSE_STARTUP_TIMEOUT)
+ #define HSE_STARTUP_TIMEOUT 100U /*!< Time out for HSE start up, in ms */
+#endif /* HSE_STARTUP_TIMEOUT */
+
+/**
+ * @brief Internal High Speed oscillator (HSI) value.
+ * This value is used by the RCC HAL module to compute the system frequency
+ * (when HSI is used as system clock source, directly or through the PLL).
+ */
+#if !defined (HSI_VALUE)
+ #define HSI_VALUE 8000000U /*!< Value of the Internal oscillator in Hz*/
+#endif /* HSI_VALUE */
+
+/**
+ * @brief Internal Low Speed oscillator (LSI) value.
+ */
+#if !defined (LSI_VALUE)
+ #define LSI_VALUE 40000U /*!< LSI Typical Value in Hz */
+#endif /* LSI_VALUE */ /*!< Value of the Internal Low Speed oscillator in Hz
+ The real value may vary depending on the variations
+ in voltage and temperature. */
+
+/**
+ * @brief External Low Speed oscillator (LSE) value.
+ * This value is used by the UART, RTC HAL module to compute the system frequency
+ */
+#if !defined (LSE_VALUE)
+ #define LSE_VALUE 32768U /*!< Value of the External oscillator in Hz*/
+#endif /* LSE_VALUE */
+
+#if !defined (LSE_STARTUP_TIMEOUT)
+ #define LSE_STARTUP_TIMEOUT 5000U /*!< Time out for LSE start up, in ms */
+#endif /* LSE_STARTUP_TIMEOUT */
+
+/* Tip: To avoid modifying this file each time you need to use different HSE,
+ === you can define the HSE value in your toolchain compiler preprocessor. */
+
+/* ########################### System Configuration ######################### */
+/**
+ * @brief This is the HAL system configuration section
+ */
+#define VDD_VALUE 3300U /*!< Value of VDD in mv */
+#define TICK_INT_PRIORITY 15U /*!< tick interrupt priority (lowest by default) */
+#define USE_RTOS 0U
+#define PREFETCH_ENABLE 1U
+
+#define USE_HAL_ADC_REGISTER_CALLBACKS 0U /* ADC register callback disabled */
+#define USE_HAL_CAN_REGISTER_CALLBACKS 0U /* CAN register callback disabled */
+#define USE_HAL_CEC_REGISTER_CALLBACKS 0U /* CEC register callback disabled */
+#define USE_HAL_DAC_REGISTER_CALLBACKS 0U /* DAC register callback disabled */
+#define USE_HAL_ETH_REGISTER_CALLBACKS 0U /* ETH register callback disabled */
+#define USE_HAL_HCD_REGISTER_CALLBACKS 0U /* HCD register callback disabled */
+#define USE_HAL_I2C_REGISTER_CALLBACKS 0U /* I2C register callback disabled */
+#define USE_HAL_I2S_REGISTER_CALLBACKS 0U /* I2S register callback disabled */
+#define USE_HAL_MMC_REGISTER_CALLBACKS 0U /* MMC register callback disabled */
+#define USE_HAL_NAND_REGISTER_CALLBACKS 0U /* NAND register callback disabled */
+#define USE_HAL_NOR_REGISTER_CALLBACKS 0U /* NOR register callback disabled */
+#define USE_HAL_PCCARD_REGISTER_CALLBACKS 0U /* PCCARD register callback disabled */
+#define USE_HAL_PCD_REGISTER_CALLBACKS 0U /* PCD register callback disabled */
+#define USE_HAL_RTC_REGISTER_CALLBACKS 0U /* RTC register callback disabled */
+#define USE_HAL_SD_REGISTER_CALLBACKS 0U /* SD register callback disabled */
+#define USE_HAL_SMARTCARD_REGISTER_CALLBACKS 0U /* SMARTCARD register callback disabled */
+#define USE_HAL_IRDA_REGISTER_CALLBACKS 0U /* IRDA register callback disabled */
+#define USE_HAL_SRAM_REGISTER_CALLBACKS 0U /* SRAM register callback disabled */
+#define USE_HAL_SPI_REGISTER_CALLBACKS 0U /* SPI register callback disabled */
+#define USE_HAL_TIM_REGISTER_CALLBACKS 0U /* TIM register callback disabled */
+#define USE_HAL_UART_REGISTER_CALLBACKS 0U /* UART register callback disabled */
+#define USE_HAL_USART_REGISTER_CALLBACKS 0U /* USART register callback disabled */
+#define USE_HAL_WWDG_REGISTER_CALLBACKS 0U /* WWDG register callback disabled */
+
+/* ########################## Assert Selection ############################## */
+/**
+ * @brief Uncomment the line below to expanse the "assert_param" macro in the
+ * HAL drivers code
+ */
+/* #define USE_FULL_ASSERT 1U */
+
+/* ################## Ethernet peripheral configuration ##################### */
+
+/* Section 1 : Ethernet peripheral configuration */
+
+/* MAC ADDRESS: MAC_ADDR0:MAC_ADDR1:MAC_ADDR2:MAC_ADDR3:MAC_ADDR4:MAC_ADDR5 */
+#define MAC_ADDR0 2U
+#define MAC_ADDR1 0U
+#define MAC_ADDR2 0U
+#define MAC_ADDR3 0U
+#define MAC_ADDR4 0U
+#define MAC_ADDR5 0U
+
+/* Definition of the Ethernet driver buffers size and count */
+#define ETH_RX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for receive */
+#define ETH_TX_BUF_SIZE ETH_MAX_PACKET_SIZE /* buffer size for transmit */
+#define ETH_RXBUFNB 8U /* 4 Rx buffers of size ETH_RX_BUF_SIZE */
+#define ETH_TXBUFNB 4U /* 4 Tx buffers of size ETH_TX_BUF_SIZE */
+
+/* Section 2: PHY configuration section */
+
+/* DP83848_PHY_ADDRESS Address*/
+#define DP83848_PHY_ADDRESS 0x01U
+/* PHY Reset delay these values are based on a 1 ms Systick interrupt*/
+#define PHY_RESET_DELAY 0x000000FFU
+/* PHY Configuration delay */
+#define PHY_CONFIG_DELAY 0x00000FFFU
+
+#define PHY_READ_TO 0x0000FFFFU
+#define PHY_WRITE_TO 0x0000FFFFU
+
+/* Section 3: Common PHY Registers */
+
+#define PHY_BCR ((uint16_t)0x00) /*!< Transceiver Basic Control Register */
+#define PHY_BSR ((uint16_t)0x01) /*!< Transceiver Basic Status Register */
+
+#define PHY_RESET ((uint16_t)0x8000) /*!< PHY Reset */
+#define PHY_LOOPBACK ((uint16_t)0x4000) /*!< Select loop-back mode */
+#define PHY_FULLDUPLEX_100M ((uint16_t)0x2100) /*!< Set the full-duplex mode at 100 Mb/s */
+#define PHY_HALFDUPLEX_100M ((uint16_t)0x2000) /*!< Set the half-duplex mode at 100 Mb/s */
+#define PHY_FULLDUPLEX_10M ((uint16_t)0x0100) /*!< Set the full-duplex mode at 10 Mb/s */
+#define PHY_HALFDUPLEX_10M ((uint16_t)0x0000) /*!< Set the half-duplex mode at 10 Mb/s */
+#define PHY_AUTONEGOTIATION ((uint16_t)0x1000) /*!< Enable auto-negotiation function */
+#define PHY_RESTART_AUTONEGOTIATION ((uint16_t)0x0200) /*!< Restart auto-negotiation function */
+#define PHY_POWERDOWN ((uint16_t)0x0800) /*!< Select the power down mode */
+#define PHY_ISOLATE ((uint16_t)0x0400) /*!< Isolate PHY from MII */
+
+#define PHY_AUTONEGO_COMPLETE ((uint16_t)0x0020) /*!< Auto-Negotiation process completed */
+#define PHY_LINKED_STATUS ((uint16_t)0x0004) /*!< Valid link established */
+#define PHY_JABBER_DETECTION ((uint16_t)0x0002) /*!< Jabber condition detected */
+
+/* Section 4: Extended PHY Registers */
+#define PHY_SR ((uint16_t)0x10U) /*!< PHY status register Offset */
+
+#define PHY_SPEED_STATUS ((uint16_t)0x0002U) /*!< PHY Speed mask */
+#define PHY_DUPLEX_STATUS ((uint16_t)0x0004U) /*!< PHY Duplex mask */
+
+/* ################## SPI peripheral configuration ########################## */
+
+/* CRC FEATURE: Use to activate CRC feature inside HAL SPI Driver
+* Activated: CRC code is present inside driver
+* Deactivated: CRC code cleaned from driver
+*/
+
+#define USE_SPI_CRC 0U
+
+/* Includes ------------------------------------------------------------------*/
+/**
+ * @brief Include module's header file
+ */
+
+#ifdef HAL_RCC_MODULE_ENABLED
+#include "stm32f1xx_hal_rcc.h"
+#endif /* HAL_RCC_MODULE_ENABLED */
+
+#ifdef HAL_GPIO_MODULE_ENABLED
+#include "stm32f1xx_hal_gpio.h"
+#endif /* HAL_GPIO_MODULE_ENABLED */
+
+#ifdef HAL_EXTI_MODULE_ENABLED
+#include "stm32f1xx_hal_exti.h"
+#endif /* HAL_EXTI_MODULE_ENABLED */
+
+#ifdef HAL_DMA_MODULE_ENABLED
+#include "stm32f1xx_hal_dma.h"
+#endif /* HAL_DMA_MODULE_ENABLED */
+
+#ifdef HAL_ETH_MODULE_ENABLED
+#include "stm32f1xx_hal_eth.h"
+#endif /* HAL_ETH_MODULE_ENABLED */
+
+#ifdef HAL_CAN_MODULE_ENABLED
+#include "stm32f1xx_hal_can.h"
+#endif /* HAL_CAN_MODULE_ENABLED */
+
+#ifdef HAL_CAN_LEGACY_MODULE_ENABLED
+ #include "Legacy/stm32f1xx_hal_can_legacy.h"
+#endif /* HAL_CAN_LEGACY_MODULE_ENABLED */
+
+#ifdef HAL_CEC_MODULE_ENABLED
+#include "stm32f1xx_hal_cec.h"
+#endif /* HAL_CEC_MODULE_ENABLED */
+
+#ifdef HAL_CORTEX_MODULE_ENABLED
+#include "stm32f1xx_hal_cortex.h"
+#endif /* HAL_CORTEX_MODULE_ENABLED */
+
+#ifdef HAL_ADC_MODULE_ENABLED
+#include "stm32f1xx_hal_adc.h"
+#endif /* HAL_ADC_MODULE_ENABLED */
+
+#ifdef HAL_CRC_MODULE_ENABLED
+#include "stm32f1xx_hal_crc.h"
+#endif /* HAL_CRC_MODULE_ENABLED */
+
+#ifdef HAL_DAC_MODULE_ENABLED
+#include "stm32f1xx_hal_dac.h"
+#endif /* HAL_DAC_MODULE_ENABLED */
+
+#ifdef HAL_FLASH_MODULE_ENABLED
+#include "stm32f1xx_hal_flash.h"
+#endif /* HAL_FLASH_MODULE_ENABLED */
+
+#ifdef HAL_SRAM_MODULE_ENABLED
+#include "stm32f1xx_hal_sram.h"
+#endif /* HAL_SRAM_MODULE_ENABLED */
+
+#ifdef HAL_NOR_MODULE_ENABLED
+#include "stm32f1xx_hal_nor.h"
+#endif /* HAL_NOR_MODULE_ENABLED */
+
+#ifdef HAL_I2C_MODULE_ENABLED
+#include "stm32f1xx_hal_i2c.h"
+#endif /* HAL_I2C_MODULE_ENABLED */
+
+#ifdef HAL_I2S_MODULE_ENABLED
+#include "stm32f1xx_hal_i2s.h"
+#endif /* HAL_I2S_MODULE_ENABLED */
+
+#ifdef HAL_IWDG_MODULE_ENABLED
+#include "stm32f1xx_hal_iwdg.h"
+#endif /* HAL_IWDG_MODULE_ENABLED */
+
+#ifdef HAL_PWR_MODULE_ENABLED
+#include "stm32f1xx_hal_pwr.h"
+#endif /* HAL_PWR_MODULE_ENABLED */
+
+#ifdef HAL_RTC_MODULE_ENABLED
+#include "stm32f1xx_hal_rtc.h"
+#endif /* HAL_RTC_MODULE_ENABLED */
+
+#ifdef HAL_PCCARD_MODULE_ENABLED
+#include "stm32f1xx_hal_pccard.h"
+#endif /* HAL_PCCARD_MODULE_ENABLED */
+
+#ifdef HAL_SD_MODULE_ENABLED
+#include "stm32f1xx_hal_sd.h"
+#endif /* HAL_SD_MODULE_ENABLED */
+
+#ifdef HAL_NAND_MODULE_ENABLED
+#include "stm32f1xx_hal_nand.h"
+#endif /* HAL_NAND_MODULE_ENABLED */
+
+#ifdef HAL_SPI_MODULE_ENABLED
+#include "stm32f1xx_hal_spi.h"
+#endif /* HAL_SPI_MODULE_ENABLED */
+
+#ifdef HAL_TIM_MODULE_ENABLED
+#include "stm32f1xx_hal_tim.h"
+#endif /* HAL_TIM_MODULE_ENABLED */
+
+#ifdef HAL_UART_MODULE_ENABLED
+#include "stm32f1xx_hal_uart.h"
+#endif /* HAL_UART_MODULE_ENABLED */
+
+#ifdef HAL_USART_MODULE_ENABLED
+#include "stm32f1xx_hal_usart.h"
+#endif /* HAL_USART_MODULE_ENABLED */
+
+#ifdef HAL_IRDA_MODULE_ENABLED
+#include "stm32f1xx_hal_irda.h"
+#endif /* HAL_IRDA_MODULE_ENABLED */
+
+#ifdef HAL_SMARTCARD_MODULE_ENABLED
+#include "stm32f1xx_hal_smartcard.h"
+#endif /* HAL_SMARTCARD_MODULE_ENABLED */
+
+#ifdef HAL_WWDG_MODULE_ENABLED
+#include "stm32f1xx_hal_wwdg.h"
+#endif /* HAL_WWDG_MODULE_ENABLED */
+
+#ifdef HAL_PCD_MODULE_ENABLED
+#include "stm32f1xx_hal_pcd.h"
+#endif /* HAL_PCD_MODULE_ENABLED */
+
+#ifdef HAL_HCD_MODULE_ENABLED
+#include "stm32f1xx_hal_hcd.h"
+#endif /* HAL_HCD_MODULE_ENABLED */
+
+#ifdef HAL_MMC_MODULE_ENABLED
+#include "stm32f1xx_hal_mmc.h"
+#endif /* HAL_MMC_MODULE_ENABLED */
+
+/* Exported macro ------------------------------------------------------------*/
+#ifdef USE_FULL_ASSERT
+/**
+ * @brief The assert_param macro is used for function's parameters check.
+ * @param expr If expr is false, it calls assert_failed function
+ * which reports the name of the source file and the source
+ * line number of the call that failed.
+ * If expr is true, it returns no value.
+ * @retval None
+ */
+#define assert_param(expr) ((expr) ? (void)0U : assert_failed((uint8_t *)__FILE__, __LINE__))
+/* Exported functions ------------------------------------------------------- */
+void assert_failed(uint8_t* file, uint32_t line);
+#else
+#define assert_param(expr) ((void)0U)
+#endif /* USE_FULL_ASSERT */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __STM32F1xx_HAL_CONF_H */
+
diff --git a/Core/Inc/stm32f1xx_it.h b/Core/Inc/stm32f1xx_it.h
new file mode 100644
index 0000000..10d53b9
--- /dev/null
+++ b/Core/Inc/stm32f1xx_it.h
@@ -0,0 +1,66 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * @file stm32f1xx_it.h
+ * @brief This file contains the headers of the interrupt handlers.
+ ******************************************************************************
+ * @attention
+ *
+ * Copyright (c) 2024 STMicroelectronics.
+ * All rights reserved.
+ *
+ * This software is licensed under terms that can be found in the LICENSE file
+ * in the root directory of this software component.
+ * If no LICENSE file comes with this software, it is provided AS-IS.
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Define to prevent recursive inclusion -------------------------------------*/
+#ifndef __STM32F1xx_IT_H
+#define __STM32F1xx_IT_H
+
+#ifdef __cplusplus
+ extern "C" {
+#endif
+
+/* Private includes ----------------------------------------------------------*/
+/* USER CODE BEGIN Includes */
+
+/* USER CODE END Includes */
+
+/* Exported types ------------------------------------------------------------*/
+/* USER CODE BEGIN ET */
+
+/* USER CODE END ET */
+
+/* Exported constants --------------------------------------------------------*/
+/* USER CODE BEGIN EC */
+
+/* USER CODE END EC */
+
+/* Exported macro ------------------------------------------------------------*/
+/* USER CODE BEGIN EM */
+
+/* USER CODE END EM */
+
+/* Exported functions prototypes ---------------------------------------------*/
+void NMI_Handler(void);
+void HardFault_Handler(void);
+void MemManage_Handler(void);
+void BusFault_Handler(void);
+void UsageFault_Handler(void);
+void SVC_Handler(void);
+void DebugMon_Handler(void);
+void PendSV_Handler(void);
+void SysTick_Handler(void);
+/* USER CODE BEGIN EFP */
+
+/* USER CODE END EFP */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __STM32F1xx_IT_H */
diff --git a/Core/Src/LiquidCrystal.c b/Core/Src/LiquidCrystal.c
new file mode 100644
index 0000000..7f01f30
--- /dev/null
+++ b/Core/Src/LiquidCrystal.c
@@ -0,0 +1,352 @@
+/*
+ * LiquidCrystal.c
+ *
+ * Created on: Jul 6, 2024
+ * Author: Chandrima Asok
+ */
+
+#include "stm32f1xx_hal.h" // change this line accordingly
+#include "LiquidCrystal.h"
+#include
+#include
+
+// change this to 0 if you want to use 8-bit mode
+uint8_t _fourbit_mode = 1;
+
+// change this to LCD_5x10DOTS for some 1 line displays that can select a 10 pixel high font
+uint8_t dotsize = LCD_5x8DOTS;
+
+// pin definitions and other LCD variables
+uint16_t _rs_pin; // LOW: command. HIGH: character.
+uint16_t _rw_pin; // LOW: write to LCD. HIGH: read from LCD.
+uint16_t _enable_pin; // activated by a HIGH pulse.
+uint16_t _data_pins[8];
+GPIO_TypeDef *_port;
+
+uint8_t _displayfunction;
+uint8_t _displaycontrol;
+uint8_t _displaymode;
+
+uint8_t _initialized;
+
+uint8_t _numlines;
+uint8_t _row_offsets[4];
+
+void LiquidCrystal(GPIO_TypeDef *gpioport, uint16_t rs, uint16_t rw, uint16_t enable,
+ uint16_t d0, uint16_t d1, uint16_t d2, uint16_t d3)
+{
+ if(_fourbit_mode)
+ init(1, gpioport, rs, rw, enable, d0, d1, d2, d3, 0, 0, 0, 0);
+ else
+ init(0, gpioport, rs, rw, enable, d0, d1, d2, d3, 0, 0, 0, 0);
+}
+
+void init(uint8_t fourbitmode, GPIO_TypeDef *gpioport, uint16_t rs, uint16_t rw, uint16_t enable,
+ uint16_t d0, uint16_t d1, uint16_t d2, uint16_t d3,
+ uint16_t d4, uint16_t d5, uint16_t d6, uint16_t d7)
+{
+ _rs_pin = rs;
+ _rw_pin = rw;
+ _enable_pin = enable;
+ _port = gpioport;
+
+ _data_pins[0] = d0;
+ _data_pins[1] = d1;
+ _data_pins[2] = d2;
+ _data_pins[3] = d3;
+ _data_pins[4] = d4;
+ _data_pins[5] = d5;
+ _data_pins[6] = d6;
+ _data_pins[7] = d7;
+
+ if (fourbitmode)
+ _displayfunction = LCD_4BITMODE | LCD_1LINE | LCD_5x8DOTS;
+ else
+ _displayfunction = LCD_8BITMODE | LCD_1LINE | LCD_5x8DOTS;
+
+ // begin(16, 2);
+}
+
+void begin(uint8_t cols, uint8_t lines) {
+ if (lines > 1) {
+ _displayfunction |= LCD_2LINE;
+ }
+ _numlines = lines;
+
+ setRowOffsets(0x00, 0x40, 0x00 + cols, 0x40 + cols);
+
+ // for some 1 line displays you can select a 10 pixel high font
+ if ((dotsize != LCD_5x8DOTS) && (lines == 1)) {
+ _displayfunction |= LCD_5x10DOTS;
+ }
+
+ //Initializing GPIO Pins
+ enableClock();
+
+ GPIO_InitTypeDef gpio_init;
+ gpio_init.Speed = GPIO_SPEED_FREQ_HIGH;
+ gpio_init.Mode = GPIO_MODE_OUTPUT_PP;
+
+ if(_fourbit_mode)
+ gpio_init.Pin = _rs_pin | _rw_pin | _enable_pin | _data_pins[0] | _data_pins[1] | _data_pins[2] | _data_pins[3];
+ else
+ gpio_init.Pin = _rs_pin | _rw_pin | _enable_pin | _data_pins[0] | _data_pins[1] | _data_pins[2] | _data_pins[3] |
+ _data_pins[4] | _data_pins[5] | _data_pins[6] | _data_pins[7];
+// SEE PAGE 45/46 FOR INITIALIZATION SPECIFICATION!
+// according to datasheet, we need at least 40ms after power rises above 2.7V
+// so we'll wait 50 just to make sure
+ HAL_Delay(50);
+
+ // Now we pull both RS and R/W low to begin commands
+ HAL_GPIO_WritePin(_port, _rs_pin, GPIO_PIN_RESET);
+ HAL_GPIO_WritePin(_port, _enable_pin, GPIO_PIN_RESET);
+
+ if (_rw_pin != 255) {
+ HAL_GPIO_WritePin(_port, _rw_pin, GPIO_PIN_RESET);
+ }
+
+ //put the LCD into 4 bit or 8 bit mode
+ if (! (_displayfunction & LCD_8BITMODE)) {
+ // this is according to the hitachi HD44780 datasheet
+ // figure 24, pg 46
+
+ // we start in 8bit mode, try to set 4 bit mode
+ write4bits(0x03);
+ HAL_Delay(5); // wait min 4.1ms
+
+ // second try
+ write4bits(0x03);
+ HAL_Delay(5); // wait min 4.1ms
+
+ // third go!
+ write4bits(0x03);
+ HAL_Delay(1);
+
+ // finally, set to 4-bit interface
+ write4bits(0x02);
+ } else {
+ // this is according to the hitachi HD44780 datasheet
+ // page 45 figure 23
+
+ // Send function set command sequence
+ command(LCD_FUNCTIONSET | _displayfunction);
+ HAL_Delay(5); // wait more than 4.1ms
+
+ // second try
+ command(LCD_FUNCTIONSET | _displayfunction);
+ HAL_Delay(1);
+
+ // third go
+ command(LCD_FUNCTIONSET | _displayfunction);
+ }
+
+ // finally, set # lines, font size, etc.
+ command(LCD_FUNCTIONSET | _displayfunction);
+
+ // turn the display on with no cursor or blinking default
+ _displaycontrol = LCD_DISPLAYON | LCD_CURSOROFF | LCD_BLINKOFF;
+ display();
+
+ // clear it off
+ clear();
+
+ // Initialize to default text direction (for romance languages)
+ _displaymode = LCD_ENTRYLEFT | LCD_ENTRYSHIFTDECREMENT;
+ // set the entry mode
+ command(LCD_ENTRYMODESET | _displaymode);
+
+}
+
+// enables GPIO RCC Clock
+void enableClock(void)
+{
+ if(_port == GPIOA)
+ __HAL_RCC_GPIOA_CLK_ENABLE();
+ else if(_port == GPIOB)
+ __HAL_RCC_GPIOB_CLK_ENABLE();
+ else if(_port == GPIOB)
+ __HAL_RCC_GPIOB_CLK_ENABLE();
+ else if(_port == GPIOC)
+ __HAL_RCC_GPIOC_CLK_ENABLE();
+ else if(_port == GPIOD)
+ __HAL_RCC_GPIOD_CLK_ENABLE();
+
+ // if you have a port that is not listed add it below the other else ifs
+}
+
+void setRowOffsets(int row0, int row1, int row2, int row3)
+{
+ _row_offsets[0] = row0;
+ _row_offsets[1] = row1;
+ _row_offsets[2] = row2;
+ _row_offsets[3] = row3;
+}
+
+/********** high level commands, for the user! */
+void clear(void)
+{
+ command(LCD_CLEARDISPLAY); // clear display, set cursor position to zero
+ HAL_Delay(2); // this command takes a long time!
+}
+
+void home(void)
+{
+ command(LCD_RETURNHOME); // set cursor position to zero
+ HAL_Delay(2); // this command takes a long time!
+}
+
+void setCursor(uint8_t col, uint8_t row)
+{
+ const size_t max_lines = sizeof(_row_offsets) / sizeof(*_row_offsets);
+ if ( row >= max_lines ) {
+ row = max_lines - 1; // we count rows starting w/0
+ }
+ if ( row >= _numlines ) {
+ row = _numlines - 1; // we count rows starting w/0
+ }
+
+ command(LCD_SETDDRAMADDR | (col + _row_offsets[row]));
+}
+
+// Turn the display on/off (quickly)
+void noDisplay(void) {
+ _displaycontrol &= ~LCD_DISPLAYON;
+ command(LCD_DISPLAYCONTROL | _displaycontrol);
+}
+void display(void) {
+ _displaycontrol |= LCD_DISPLAYON;
+ command(LCD_DISPLAYCONTROL | _displaycontrol);
+}
+
+// Turns the underline cursor on/off
+void noCursor(void) {
+ _displaycontrol &= ~LCD_CURSORON;
+ command(LCD_DISPLAYCONTROL | _displaycontrol);
+}
+void cursor(void) {
+ _displaycontrol |= LCD_CURSORON;
+ command(LCD_DISPLAYCONTROL | _displaycontrol);
+}
+
+// Turn on and off the blinking cursor
+void noBlink(void) {
+ _displaycontrol &= ~LCD_BLINKON;
+ command(LCD_DISPLAYCONTROL | _displaycontrol);
+}
+void blink(void) {
+ _displaycontrol |= LCD_BLINKON;
+ command(LCD_DISPLAYCONTROL | _displaycontrol);
+}
+
+// These commands scroll the display without changing the RAM
+void scrollDisplayLeft(void) {
+ command(LCD_CURSORSHIFT | LCD_DISPLAYMOVE | LCD_MOVELEFT);
+}
+void scrollDisplayRight(void) {
+ command(LCD_CURSORSHIFT | LCD_DISPLAYMOVE | LCD_MOVERIGHT);
+}
+
+// This is for text that flows Left to Right
+void leftToRight(void) {
+ _displaymode |= LCD_ENTRYLEFT;
+ command(LCD_ENTRYMODESET | _displaymode);
+}
+
+// This is for text that flows Right to Left
+void rightToLeft(void) {
+ _displaymode &= ~LCD_ENTRYLEFT;
+ command(LCD_ENTRYMODESET | _displaymode);
+}
+
+// This will 'right justify' text from the cursor
+void autoscroll(void) {
+ _displaymode |= LCD_ENTRYSHIFTINCREMENT;
+ command(LCD_ENTRYMODESET | _displaymode);
+}
+
+// This will 'left justify' text from the cursor
+void noAutoscroll(void) {
+ _displaymode &= ~LCD_ENTRYSHIFTINCREMENT;
+ command(LCD_ENTRYMODESET | _displaymode);
+}
+
+// This will print character string to the LCD
+size_t print(const char str[]) {
+ if (str == NULL) return 0;
+
+ const uint8_t *buffer = (const uint8_t *)str;
+ size_t size = strlen(str);
+ size_t n = 0;
+
+ while (size--) {
+ if (write(*buffer++)) n++;
+ else break;
+ }
+ return n;
+}
+
+// Allows us to fill the first 8 CGRAM locations
+// with custom characters
+void createChar(uint8_t location, uint8_t charmap[]) {
+ location &= 0x7; // we only have 8 locations 0-7
+ command(LCD_SETCGRAMADDR | (location << 3));
+ for (int i=0; i<8; i++) {
+ write(charmap[i]);
+ }
+}
+
+/*********** mid level commands, for sending data/cmds */
+
+inline void command(uint8_t value) {
+ send(value, GPIO_PIN_RESET);
+}
+
+inline size_t write(uint8_t value) {
+ send(value, GPIO_PIN_SET);
+ return 1; // assume sucess
+}
+
+/************ low level data pushing commands **********/
+
+// write either command or data, with automatic 4/8-bit selection
+void send(uint8_t value, GPIO_PinState mode) {
+ HAL_GPIO_WritePin(_port, _rs_pin, mode);
+
+ // if there is a RW pin indicated, set it low to Write
+ if (_rw_pin != 255) {
+ HAL_GPIO_WritePin(_port, _rw_pin, GPIO_PIN_RESET);
+ }
+
+ if (_displayfunction & LCD_8BITMODE) {
+ write8bits(value);
+ } else {
+ write4bits(value>>4);
+ write4bits(value);
+ }
+}
+
+void pulseEnable(void) {
+ HAL_GPIO_WritePin(_port, _enable_pin, GPIO_PIN_RESET);
+ HAL_Delay(1);
+ HAL_GPIO_WritePin(_port, _enable_pin, GPIO_PIN_SET);
+ HAL_Delay(1); // enable pulse must be >450ns
+ HAL_GPIO_WritePin(_port, _enable_pin, GPIO_PIN_RESET);
+ HAL_Delay(1); // commands need > 37us to settle
+}
+
+void write4bits(uint8_t value) {
+ for (int i = 0; i < 4; i++) {
+ HAL_GPIO_WritePin(_port, _data_pins[i], ((value >> i) & 0x01)?GPIO_PIN_SET:GPIO_PIN_RESET);
+ }
+
+ pulseEnable();
+}
+
+void write8bits(uint8_t value) {
+ for (int i = 0; i < 8; i++) {
+ HAL_GPIO_WritePin(_port, _data_pins[i], ((value >> i) & 0x01)?GPIO_PIN_SET:GPIO_PIN_RESET);
+ }
+
+ pulseEnable();
+}
+
diff --git a/Core/Src/MCP3008.c b/Core/Src/MCP3008.c
new file mode 100644
index 0000000..a580e98
--- /dev/null
+++ b/Core/Src/MCP3008.c
@@ -0,0 +1,60 @@
+/*
+ * MCP3008.c
+ *
+ * Created on: May 23, 2024
+ * Author: chandrima
+ */
+#include "MCP3008.h"
+
+void MCP3008_handle_init(MCP3008_Handle_t *handle, GPIO_TypeDef *cs_port, uint16_t cs_pin, SPI_HandleTypeDef *hspi){
+ //Assign the port and pins for the SPI CS pin
+ handle->CS_Port = cs_port;
+ handle->CS_Pin = cs_pin;
+
+ handle->hspi = hspi;
+}
+
+int16_t MCP3008_read(MCP3008_Handle_t *handle, uint8_t chan){
+ //Limit chan to max number of channels
+ if(chan >= MCP3008_NUM_CHANNELS){
+ return MCP3008_ERROR_INVALID_ARG;
+ }
+
+ //Initialize the tx and rx buffers
+ uint8_t tx_data[3];
+ uint8_t rx_data[3] = {0};
+
+ tx_data[0] = 0x01; //Start bit
+ tx_data[2] = 0x00;
+ tx_data[1] = 0x80 | (chan << SHIFT_4);
+
+ HAL_GPIO_WritePin(handle->CS_Port, handle->CS_Pin, GPIO_PIN_RESET);
+ HAL_StatusTypeDef spi_status = HAL_SPI_TransmitReceive(handle->hspi, tx_data, rx_data, sizeof(tx_data), MCP3008_SPI_TIMEOUT);
+ HAL_GPIO_WritePin(handle->CS_Port, handle->CS_Pin, GPIO_PIN_SET);
+
+ if(spi_status != HAL_OK){
+ return MCP3008_ERROR_SPI;
+ }
+
+ //Extract 10-bit ADC reading from rx buffer
+ int16_t adc_reading = (int16_t)((rx_data[1] << SHIFT_8) | rx_data[2]) & FIRST_10_BITS_MASK;
+
+ return adc_reading;
+}
+
+float MCP3008_read_volts(MCP3008_Handle_t *handle, uint8_t chan, float vref){
+ //Verify positive voltage for vref
+ if(vref < 0){
+ return MCP3008_ERROR_INVALID_ARG;
+ }
+
+ //Read ADC input from the channel
+ int16_t adc_reading = MCP3008_read(handle, chan);
+
+ if(adc_reading == MCP3008_ERROR_INVALID_ARG || adc_reading == MCP3008_ERROR_SPI){
+ return adc_reading;
+ }
+
+ //Convert reading to volts and return value
+ return ((uint16_t)adc_reading * vref)/MCP3008_ADC_MAX;
+}
diff --git a/Core/Src/main.c b/Core/Src/main.c
new file mode 100644
index 0000000..b418b96
--- /dev/null
+++ b/Core/Src/main.c
@@ -0,0 +1,572 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * @file : main.c
+ * @brief : Main program body
+ ******************************************************************************
+ * @attention
+ *
+ * Copyright (c) 2024 STMicroelectronics.
+ * All rights reserved.
+ *
+ * This software is licensed under terms that can be found in the LICENSE file
+ * in the root directory of this software component.
+ * If no LICENSE file comes with this software, it is provided AS-IS.
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+/* Includes ------------------------------------------------------------------*/
+#include "main.h"
+
+/* Private includes ----------------------------------------------------------*/
+/* USER CODE BEGIN Includes */
+#include "MCP3008.h"
+#include "LiquidCrystal.h"
+#include "stdio.h"
+/* USER CODE END Includes */
+
+/* Private typedef -----------------------------------------------------------*/
+/* USER CODE BEGIN PTD */
+SPI_HandleTypeDef hspi1;
+/* USER CODE END PTD */
+
+/* Private define ------------------------------------------------------------*/
+/* USER CODE BEGIN PD */
+#define ADAS_SPEED 80
+#define LANE_CHANGE_SPEED 50
+/* USER CODE END PD */
+
+/* Private macro -------------------------------------------------------------*/
+/* USER CODE BEGIN PM */
+
+/* USER CODE END PM */
+
+/* Private variables ---------------------------------------------------------*/
+SPI_HandleTypeDef hspi1;
+
+/* USER CODE BEGIN PV */
+MCP3008_Handle_t spi_mpc3008;
+volatile uint16_t adc0,adc1,adc2,adc3,adc4,adc5,adc6,speed;
+char MSG_0[20];
+char MSG_1[20];
+char MSG_2[20];
+char MSG_3[20];
+char MSG_4[20];
+char MSG_5[20];
+/* USER CODE END PV */
+
+/* Private function prototypes -----------------------------------------------*/
+void SystemClock_Config(void);
+static void MX_GPIO_Init(void);
+static void MX_SPI1_Init(void);
+/* USER CODE BEGIN PFP */
+
+/* USER CODE END PFP */
+
+/* Private user code ---------------------------------------------------------*/
+/* USER CODE BEGIN 0 */
+void Sensor_DataRead();
+void Emergency_breaking();
+void move_left();
+void move_right();
+int Check_left_lane_free();
+int Check_right_lane_free();
+void breaking();
+void break2stop();
+void ADAS_Speed();
+void Lane_change_Speed();
+/* USER CODE END 0 */
+
+/**
+ * @brief The application entry point.
+ * @retval int
+ */
+int main(void)
+{
+
+ /* USER CODE BEGIN 1 */
+
+ /* USER CODE END 1 */
+
+ /* MCU Configuration--------------------------------------------------------*/
+
+ /* Reset of all peripherals, Initializes the Flash interface and the Systick. */
+ HAL_Init();
+
+ /* USER CODE BEGIN Init */
+
+ /* USER CODE END Init */
+
+ /* Configure the system clock */
+ SystemClock_Config();
+
+ /* USER CODE BEGIN SysInit */
+
+ /* USER CODE END SysInit */
+
+ /* Initialize all configured peripherals */
+ MX_GPIO_Init();
+ MX_SPI1_Init();
+ /* USER CODE BEGIN 2 */
+ MCP3008_handle_init(&spi_mpc3008, GPIOA, GPIO_PIN_8, &hspi1);
+ LiquidCrystal(GPIOB, GPIO_PIN_3,GPIO_PIN_4,GPIO_PIN_5,GPIO_PIN_6 ,GPIO_PIN_7,GPIO_PIN_8,GPIO_PIN_9);
+ begin(16, 4);
+ /* USER CODE END 2 */
+
+ /* Infinite loop */
+ /* USER CODE BEGIN WHILE */
+ clear();
+ setCursor(0,0);
+ print("......ADAS......");
+ setCursor(0,1);
+ print(".....SYSTEM.....");
+ setCursor(0,3);
+ print("ADAS starting..");
+ HAL_Delay(1000);
+ clear();
+ while (1)
+ {
+ /* USER CODE END WHILE */
+ Sensor_DataRead();
+ if (speed > 90 && adc0 > 600)
+ {
+ clear();
+ setCursor(0,0);
+ print("On ADAS speed");
+ ADAS_Speed();
+ HAL_Delay(1000);
+ clear();
+ }
+ while (adc0 < 600 && adc0 > 340)
+ {
+ clear();
+ setCursor(0,0);
+ print("Breaking");
+ clear();
+ while (Check_right_lane_free() == 0)
+ {
+ clear();
+ move_right();
+ setCursor(0,0);
+ print("Waiting for ");
+ setCursor(0,1);
+ print("speed lane free ");
+ HAL_Delay(1000);
+ adc6 = MCP3008_read(&spi_mpc3008, 6);
+ while (adc6 < 500)
+ {
+ adc6 = MCP3008_read(&spi_mpc3008, 6);
+ };
+ while (Check_left_lane_free() == 0)
+ {
+
+ clear();
+ move_left();
+ }
+ }
+ adc0 = MCP3008_read(&spi_mpc3008, 0);
+ adc1 = MCP3008_read(&spi_mpc3008, 1);
+ }
+ while (adc0 < 340)
+ {
+ Emergency_breaking();
+ }
+ /* USER CODE BEGIN 3 */
+ }
+
+ /* USER CODE END 3 */
+}
+
+/**
+ * @brief System Clock Configuration
+ * @retval None
+ */
+void SystemClock_Config(void)
+{
+ RCC_OscInitTypeDef RCC_OscInitStruct = {0};
+ RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};
+
+ /** Initializes the RCC Oscillators according to the specified parameters
+ * in the RCC_OscInitTypeDef structure.
+ */
+ RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI;
+ RCC_OscInitStruct.HSIState = RCC_HSI_ON;
+ RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT;
+ RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE;
+ if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)
+ {
+ Error_Handler();
+ }
+
+ /** Initializes the CPU, AHB and APB buses clocks
+ */
+ RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK
+ |RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2;
+ RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_HSI;
+ RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
+ RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV1;
+ RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1;
+
+ if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_0) != HAL_OK)
+ {
+ Error_Handler();
+ }
+}
+
+/**
+ * @brief SPI1 Initialization Function
+ * @param None
+ * @retval None
+ */
+static void MX_SPI1_Init(void)
+{
+
+ /* USER CODE BEGIN SPI1_Init 0 */
+
+ /* USER CODE END SPI1_Init 0 */
+
+ /* USER CODE BEGIN SPI1_Init 1 */
+
+ /* USER CODE END SPI1_Init 1 */
+ /* SPI1 parameter configuration*/
+ hspi1.Instance = SPI1;
+ hspi1.Init.Mode = SPI_MODE_MASTER;
+ hspi1.Init.Direction = SPI_DIRECTION_2LINES;
+ hspi1.Init.DataSize = SPI_DATASIZE_8BIT;
+ hspi1.Init.CLKPolarity = SPI_POLARITY_LOW;
+ hspi1.Init.CLKPhase = SPI_PHASE_1EDGE;
+ hspi1.Init.NSS = SPI_NSS_SOFT;
+ hspi1.Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_2;
+ hspi1.Init.FirstBit = SPI_FIRSTBIT_MSB;
+ hspi1.Init.TIMode = SPI_TIMODE_DISABLE;
+ hspi1.Init.CRCCalculation = SPI_CRCCALCULATION_DISABLE;
+ hspi1.Init.CRCPolynomial = 10;
+ if (HAL_SPI_Init(&hspi1) != HAL_OK)
+ {
+ Error_Handler();
+ }
+ /* USER CODE BEGIN SPI1_Init 2 */
+
+ /* USER CODE END SPI1_Init 2 */
+
+}
+
+/**
+ * @brief GPIO Initialization Function
+ * @param None
+ * @retval None
+ */
+static void MX_GPIO_Init(void)
+{
+ GPIO_InitTypeDef GPIO_InitStruct = {0};
+/* USER CODE BEGIN MX_GPIO_Init_1 */
+/* USER CODE END MX_GPIO_Init_1 */
+
+ /* GPIO Ports Clock Enable */
+ __HAL_RCC_GPIOA_CLK_ENABLE();
+ __HAL_RCC_GPIOB_CLK_ENABLE();
+
+ /*Configure GPIO pin Output Level */
+ HAL_GPIO_WritePin(GPIOB, GPIO_PIN_10|GPIO_PIN_11|GPIO_PIN_12|GPIO_PIN_13
+ |GPIO_PIN_14|GPIO_PIN_15|GPIO_PIN_3|GPIO_PIN_4
+ |GPIO_PIN_5|GPIO_PIN_6|GPIO_PIN_7|GPIO_PIN_8
+ |GPIO_PIN_9, GPIO_PIN_RESET);
+
+ /*Configure GPIO pin Output Level */
+ HAL_GPIO_WritePin(GPIOA, GPIO_PIN_8|GPIO_PIN_10|GPIO_PIN_11|GPIO_PIN_12
+ |GPIO_PIN_13|GPIO_PIN_14|GPIO_PIN_15, GPIO_PIN_RESET);
+
+ /*Configure GPIO pins : PB10 PB11 PB12 PB13
+ PB14 PB15 PB3 PB4
+ PB5 PB6 PB7 PB8
+ PB9 */
+ GPIO_InitStruct.Pin = GPIO_PIN_10|GPIO_PIN_11|GPIO_PIN_12|GPIO_PIN_13
+ |GPIO_PIN_14|GPIO_PIN_15|GPIO_PIN_3|GPIO_PIN_4
+ |GPIO_PIN_5|GPIO_PIN_6|GPIO_PIN_7|GPIO_PIN_8
+ |GPIO_PIN_9;
+ GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
+ GPIO_InitStruct.Pull = GPIO_NOPULL;
+ GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
+ HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
+
+ /*Configure GPIO pins : PA8 PA10 PA11 PA12
+ PA13 PA14 PA15 */
+ GPIO_InitStruct.Pin = GPIO_PIN_8|GPIO_PIN_10|GPIO_PIN_11|GPIO_PIN_12
+ |GPIO_PIN_13|GPIO_PIN_14|GPIO_PIN_15;
+ GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
+ GPIO_InitStruct.Pull = GPIO_NOPULL;
+ GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
+ HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
+
+/* USER CODE BEGIN MX_GPIO_Init_2 */
+/* USER CODE END MX_GPIO_Init_2 */
+}
+
+/* USER CODE BEGIN 4 */
+void Sensor_DataRead()
+{
+ setCursor(0,0);
+ print("Reading.........");
+ setCursor(0,1);
+ print("Sensor Data ");
+ HAL_Delay(500);
+ adc0 = MCP3008_read(&spi_mpc3008, 0); // Channel 0
+ adc1 = MCP3008_read(&spi_mpc3008, 1); // Channel 1
+ adc2 = MCP3008_read(&spi_mpc3008, 2); // Channel 2
+ adc3 = MCP3008_read(&spi_mpc3008, 3); // Channel 3
+ adc4 = MCP3008_read(&spi_mpc3008, 4); // Channel 4
+ adc5 = MCP3008_read(&spi_mpc3008, 5); // Channel 5
+ adc6 = MCP3008_read(&spi_mpc3008, 6); // Channel 6
+ speed = (adc6/10)+1;
+ clear();
+ sprintf(MSG_0,"USF Sensor = %d",adc0);
+ setCursor(0,0);
+ print(MSG_0);
+ sprintf(MSG_1,"USB Sensor = %d",adc1);
+ setCursor(0,1);
+ print(MSG_1);
+ sprintf(MSG_1,"Speed = %d KM/H",speed);
+ setCursor(0,3);
+ print(MSG_1);
+ HAL_Delay(1000);
+ clear();
+ sprintf(MSG_2,"IRLF Sensor= %d",adc2);
+ setCursor(0,0);
+ print(MSG_2);
+ sprintf(MSG_3,"IRRF Sensor= %d",adc3);
+ setCursor(0,1);
+ print(MSG_3);
+ sprintf(MSG_1,"Speed = %d KM/H",speed);
+ setCursor(0,3);
+ print(MSG_1);
+ HAL_Delay(1000);
+ clear();
+ sprintf(MSG_4,"IRLB Sensor= %d",adc4);
+ setCursor(0,0);
+ print(MSG_4);
+ sprintf(MSG_5,"IRRB Sensor= %d",adc5);
+ setCursor(0,1);
+ print(MSG_5);
+ sprintf(MSG_1,"Speed = %d KM/H",speed);
+ setCursor(0,3);
+ print(MSG_1);
+ HAL_Delay(1000);
+ clear();
+}
+void Emergency_breaking()
+{
+ while(adc0 < 320)
+ {
+ setCursor(0,0);
+ print("xxxxxxxxxxxxxxxx");
+ setCursor(0,1);
+ print("Emergency xxxxxxx");
+ setCursor(0,2);
+ print("xxxxxxx breaking ");
+ setCursor(0,3);
+ print("xxxxxxxxxxxxxxxxx");
+ break2stop();
+ adc0 = MCP3008_read(&spi_mpc3008, 0);
+ }
+ clear();
+ setCursor(0,3);
+ print("ADAS restarting");
+ HAL_Delay(1000);
+ clear();
+}
+void move_left()
+{
+ while(adc2 > 800 )
+ {
+ adc2 = MCP3008_read(&spi_mpc3008, 2);
+ };
+ if(adc2 < 800 )
+ {
+ HAL_GPIO_WritePin(GPIOA, GPIO_PIN_10, GPIO_PIN_SET);//1
+ HAL_GPIO_WritePin(GPIOA, GPIO_PIN_11, GPIO_PIN_RESET);//0
+ HAL_Delay(1000);
+ HAL_GPIO_WritePin(GPIOA, GPIO_PIN_10, GPIO_PIN_RESET);//0
+ HAL_GPIO_WritePin(GPIOA, GPIO_PIN_11, GPIO_PIN_RESET);//0
+ adc2 = MCP3008_read(&spi_mpc3008, 2);
+ }
+ clear();
+ setCursor(0,0);
+ print("Moved to left");
+ HAL_Delay(1000);
+ clear();
+}
+void move_right()
+{
+ Lane_change_Speed();
+ setCursor(0,0);
+ print("Moving to right");
+ while (adc6 > 500)
+ {
+ adc6 = MCP3008_read(&spi_mpc3008, 6);
+ };
+ setCursor(0,1);
+ print("Check right lane");
+ if (Check_right_lane_free() == 0 )
+ {
+ while(adc3 > 800 )
+ {
+ adc3 = MCP3008_read(&spi_mpc3008, 3);
+ };
+ HAL_Delay(1000);
+ if(adc3 < 800 )
+ {
+ HAL_GPIO_WritePin(GPIOA, GPIO_PIN_12, GPIO_PIN_SET);
+ HAL_GPIO_WritePin(GPIOA, GPIO_PIN_13, GPIO_PIN_RESET);
+ HAL_Delay(1000);
+ HAL_GPIO_WritePin(GPIOA, GPIO_PIN_12, GPIO_PIN_RESET);
+ HAL_GPIO_WritePin(GPIOA, GPIO_PIN_13, GPIO_PIN_RESET);
+ adc3 = MCP3008_read(&spi_mpc3008, 3);
+ }
+ clear();
+ setCursor(0,0);
+ print("Moved to right");
+ HAL_Delay(1000);
+ }
+}
+int Check_left_lane_free()
+{
+ int ret = 1;
+ adc1 = MCP3008_read(&spi_mpc3008, 1);
+ if (adc1 < 600)
+ ret = 0;
+ return ret;
+}
+int Check_right_lane_free()
+{
+ int ret = 1;
+ adc1 = MCP3008_read(&spi_mpc3008, 1);
+ if (adc1 < 600)
+ ret = 0;
+ return ret;
+}
+void break2stop()
+{
+ //reducing accelerator
+ HAL_GPIO_WritePin(GPIOB, GPIO_PIN_14, GPIO_PIN_RESET);
+ HAL_GPIO_WritePin(GPIOB, GPIO_PIN_15, GPIO_PIN_SET);
+ HAL_Delay(1000);
+ HAL_GPIO_WritePin(GPIOB, GPIO_PIN_14, GPIO_PIN_RESET);
+ HAL_GPIO_WritePin(GPIOB, GPIO_PIN_15, GPIO_PIN_RESET);
+ //applying front break
+ HAL_GPIO_WritePin(GPIOB, GPIO_PIN_10, GPIO_PIN_SET);//1
+ HAL_GPIO_WritePin(GPIOB, GPIO_PIN_11, GPIO_PIN_RESET);//0
+ HAL_Delay(1000);
+ HAL_GPIO_WritePin(GPIOB, GPIO_PIN_10, GPIO_PIN_RESET);//0
+ HAL_GPIO_WritePin(GPIOB, GPIO_PIN_11, GPIO_PIN_RESET);//0
+ //applying back break
+ HAL_GPIO_WritePin(GPIOB, GPIO_PIN_12, GPIO_PIN_SET);
+ HAL_GPIO_WritePin(GPIOB, GPIO_PIN_13, GPIO_PIN_RESET);
+ HAL_Delay(1000);
+ HAL_GPIO_WritePin(GPIOB, GPIO_PIN_12, GPIO_PIN_RESET);
+ HAL_GPIO_WritePin(GPIOB, GPIO_PIN_13, GPIO_PIN_RESET);
+}
+void breaking()
+{
+ //reducing accelerator
+ HAL_GPIO_WritePin(GPIOB, GPIO_PIN_14, GPIO_PIN_RESET);
+ HAL_GPIO_WritePin(GPIOB, GPIO_PIN_15, GPIO_PIN_SET);
+ HAL_Delay(200);
+ HAL_GPIO_WritePin(GPIOB, GPIO_PIN_14, GPIO_PIN_RESET);
+ HAL_GPIO_WritePin(GPIOB, GPIO_PIN_15, GPIO_PIN_RESET);
+ //applying front break
+ HAL_GPIO_WritePin(GPIOB, GPIO_PIN_10, GPIO_PIN_SET);//1
+ HAL_GPIO_WritePin(GPIOB, GPIO_PIN_11, GPIO_PIN_RESET);//0
+ HAL_Delay(200);
+ HAL_GPIO_WritePin(GPIOB, GPIO_PIN_10, GPIO_PIN_RESET);//0
+ HAL_GPIO_WritePin(GPIOB, GPIO_PIN_11, GPIO_PIN_RESET);//0
+ //applying back break
+ HAL_GPIO_WritePin(GPIOB, GPIO_PIN_12, GPIO_PIN_SET);
+ HAL_GPIO_WritePin(GPIOB, GPIO_PIN_13, GPIO_PIN_RESET);
+ HAL_Delay(200);
+ HAL_GPIO_WritePin(GPIOB, GPIO_PIN_12, GPIO_PIN_RESET);
+ HAL_GPIO_WritePin(GPIOB, GPIO_PIN_13, GPIO_PIN_RESET);
+}
+void ADAS_Speed()
+{
+ if(adc0 > 600)
+ {
+ //release break
+ HAL_GPIO_WritePin(GPIOB, GPIO_PIN_10, GPIO_PIN_RESET);//0
+ HAL_GPIO_WritePin(GPIOB, GPIO_PIN_11, GPIO_PIN_RESET);//0
+ //increasing accelerator till ADAS speed
+ while(speed < ADAS_SPEED)
+ {
+ HAL_GPIO_WritePin(GPIOB, GPIO_PIN_14, GPIO_PIN_RESET);
+ HAL_GPIO_WritePin(GPIOB, GPIO_PIN_15, GPIO_PIN_SET);
+ HAL_Delay(1000);
+ HAL_GPIO_WritePin(GPIOB, GPIO_PIN_14, GPIO_PIN_RESET);
+ HAL_GPIO_WritePin(GPIOB, GPIO_PIN_15, GPIO_PIN_RESET);
+ adc6 = MCP3008_read(&spi_mpc3008, 6);
+ speed = (adc6/10)+1;
+ }
+ clear();
+ setCursor(0,0);
+ print("speed = 90 KM/H");
+ HAL_Delay(1000);
+ clear();
+ }
+}
+void Lane_change_Speed()
+{
+ if(adc0 > 340)
+ {
+ //release break
+ HAL_GPIO_WritePin(GPIOB, GPIO_PIN_10, GPIO_PIN_RESET);//0
+ HAL_GPIO_WritePin(GPIOB, GPIO_PIN_11, GPIO_PIN_RESET);//0
+ //increasing accelerator till ADAS speed
+ while(speed < LANE_CHANGE_SPEED)
+ {
+ HAL_GPIO_WritePin(GPIOB, GPIO_PIN_14, GPIO_PIN_RESET);
+ HAL_GPIO_WritePin(GPIOB, GPIO_PIN_15, GPIO_PIN_SET);
+ HAL_Delay(1000);
+ HAL_GPIO_WritePin(GPIOB, GPIO_PIN_14, GPIO_PIN_RESET);
+ HAL_GPIO_WritePin(GPIOB, GPIO_PIN_15, GPIO_PIN_RESET);
+ adc6 = MCP3008_read(&spi_mpc3008, 6);
+ speed = (adc6/10)+1;
+ }
+ clear();
+ setCursor(0,0);
+ print("speed = 50 KM/H");
+ HAL_Delay(1000);
+ clear();
+ }
+}
+/* USER CODE END 4 */
+
+/**
+ * @brief This function is executed in case of error occurrence.
+ * @retval None
+ */
+void Error_Handler(void)
+{
+ /* USER CODE BEGIN Error_Handler_Debug */
+ /* User can add his own implementation to report the HAL error return state */
+ __disable_irq();
+ while (1)
+ {
+ }
+ /* USER CODE END Error_Handler_Debug */
+}
+
+#ifdef USE_FULL_ASSERT
+/**
+ * @brief Reports the name of the source file and the source line number
+ * where the assert_param error has occurred.
+ * @param file: pointer to the source file name
+ * @param line: assert_param error line source number
+ * @retval None
+ */
+void assert_failed(uint8_t *file, uint32_t line)
+{
+ /* USER CODE BEGIN 6 */
+ /* User can add his own implementation to report the file name and line number,
+ ex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */
+ /* USER CODE END 6 */
+}
+#endif /* USE_FULL_ASSERT */
diff --git a/Core/Src/stm32f1xx_hal_msp.c b/Core/Src/stm32f1xx_hal_msp.c
new file mode 100644
index 0000000..434678d
--- /dev/null
+++ b/Core/Src/stm32f1xx_hal_msp.c
@@ -0,0 +1,158 @@
+
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * @file stm32f1xx_hal_msp.c
+ * @brief This file provides code for the MSP Initialization
+ * and de-Initialization codes.
+ ******************************************************************************
+ * @attention
+ *
+ * Copyright (c) 2024 STMicroelectronics.
+ * All rights reserved.
+ *
+ * This software is licensed under terms that can be found in the LICENSE file
+ * in the root directory of this software component.
+ * If no LICENSE file comes with this software, it is provided AS-IS.
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Includes ------------------------------------------------------------------*/
+#include "main.h"
+/* USER CODE BEGIN Includes */
+
+/* USER CODE END Includes */
+
+/* Private typedef -----------------------------------------------------------*/
+/* USER CODE BEGIN TD */
+
+/* USER CODE END TD */
+
+/* Private define ------------------------------------------------------------*/
+/* USER CODE BEGIN Define */
+
+/* USER CODE END Define */
+
+/* Private macro -------------------------------------------------------------*/
+/* USER CODE BEGIN Macro */
+
+/* USER CODE END Macro */
+
+/* Private variables ---------------------------------------------------------*/
+/* USER CODE BEGIN PV */
+
+/* USER CODE END PV */
+
+/* Private function prototypes -----------------------------------------------*/
+/* USER CODE BEGIN PFP */
+
+/* USER CODE END PFP */
+
+/* External functions --------------------------------------------------------*/
+/* USER CODE BEGIN ExternalFunctions */
+
+/* USER CODE END ExternalFunctions */
+
+/* USER CODE BEGIN 0 */
+
+/* USER CODE END 0 */
+/**
+ * Initializes the Global MSP.
+ */
+void HAL_MspInit(void)
+{
+
+ /* USER CODE BEGIN MspInit 0 */
+
+ /* USER CODE END MspInit 0 */
+
+ __HAL_RCC_AFIO_CLK_ENABLE();
+ __HAL_RCC_PWR_CLK_ENABLE();
+
+ /* System interrupt init*/
+
+ /** DISABLE: JTAG-DP Disabled and SW-DP Disabled
+ */
+ __HAL_AFIO_REMAP_SWJ_DISABLE();
+
+ /* USER CODE BEGIN MspInit 1 */
+
+ /* USER CODE END MspInit 1 */
+}
+
+/**
+* @brief SPI MSP Initialization
+* This function configures the hardware resources used in this example
+* @param hspi: SPI handle pointer
+* @retval None
+*/
+void HAL_SPI_MspInit(SPI_HandleTypeDef* hspi)
+{
+ GPIO_InitTypeDef GPIO_InitStruct = {0};
+ if(hspi->Instance==SPI1)
+ {
+ /* USER CODE BEGIN SPI1_MspInit 0 */
+
+ /* USER CODE END SPI1_MspInit 0 */
+ /* Peripheral clock enable */
+ __HAL_RCC_SPI1_CLK_ENABLE();
+
+ __HAL_RCC_GPIOA_CLK_ENABLE();
+ /**SPI1 GPIO Configuration
+ PA5 ------> SPI1_SCK
+ PA6 ------> SPI1_MISO
+ PA7 ------> SPI1_MOSI
+ */
+ GPIO_InitStruct.Pin = GPIO_PIN_5|GPIO_PIN_7;
+ GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
+ GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
+ HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
+
+ GPIO_InitStruct.Pin = GPIO_PIN_6;
+ GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
+ GPIO_InitStruct.Pull = GPIO_NOPULL;
+ HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
+
+ /* USER CODE BEGIN SPI1_MspInit 1 */
+
+ /* USER CODE END SPI1_MspInit 1 */
+
+ }
+
+}
+
+/**
+* @brief SPI MSP De-Initialization
+* This function freeze the hardware resources used in this example
+* @param hspi: SPI handle pointer
+* @retval None
+*/
+void HAL_SPI_MspDeInit(SPI_HandleTypeDef* hspi)
+{
+ if(hspi->Instance==SPI1)
+ {
+ /* USER CODE BEGIN SPI1_MspDeInit 0 */
+
+ /* USER CODE END SPI1_MspDeInit 0 */
+ /* Peripheral clock disable */
+ __HAL_RCC_SPI1_CLK_DISABLE();
+
+ /**SPI1 GPIO Configuration
+ PA5 ------> SPI1_SCK
+ PA6 ------> SPI1_MISO
+ PA7 ------> SPI1_MOSI
+ */
+ HAL_GPIO_DeInit(GPIOA, GPIO_PIN_5|GPIO_PIN_6|GPIO_PIN_7);
+
+ /* USER CODE BEGIN SPI1_MspDeInit 1 */
+
+ /* USER CODE END SPI1_MspDeInit 1 */
+ }
+
+}
+
+/* USER CODE BEGIN 1 */
+
+/* USER CODE END 1 */
diff --git a/Core/Src/stm32f1xx_it.c b/Core/Src/stm32f1xx_it.c
new file mode 100644
index 0000000..3800a9f
--- /dev/null
+++ b/Core/Src/stm32f1xx_it.c
@@ -0,0 +1,203 @@
+/* USER CODE BEGIN Header */
+/**
+ ******************************************************************************
+ * @file stm32f1xx_it.c
+ * @brief Interrupt Service Routines.
+ ******************************************************************************
+ * @attention
+ *
+ * Copyright (c) 2024 STMicroelectronics.
+ * All rights reserved.
+ *
+ * This software is licensed under terms that can be found in the LICENSE file
+ * in the root directory of this software component.
+ * If no LICENSE file comes with this software, it is provided AS-IS.
+ *
+ ******************************************************************************
+ */
+/* USER CODE END Header */
+
+/* Includes ------------------------------------------------------------------*/
+#include "main.h"
+#include "stm32f1xx_it.h"
+/* Private includes ----------------------------------------------------------*/
+/* USER CODE BEGIN Includes */
+/* USER CODE END Includes */
+
+/* Private typedef -----------------------------------------------------------*/
+/* USER CODE BEGIN TD */
+
+/* USER CODE END TD */
+
+/* Private define ------------------------------------------------------------*/
+/* USER CODE BEGIN PD */
+
+/* USER CODE END PD */
+
+/* Private macro -------------------------------------------------------------*/
+/* USER CODE BEGIN PM */
+
+/* USER CODE END PM */
+
+/* Private variables ---------------------------------------------------------*/
+/* USER CODE BEGIN PV */
+
+/* USER CODE END PV */
+
+/* Private function prototypes -----------------------------------------------*/
+/* USER CODE BEGIN PFP */
+
+/* USER CODE END PFP */
+
+/* Private user code ---------------------------------------------------------*/
+/* USER CODE BEGIN 0 */
+
+/* USER CODE END 0 */
+
+/* External variables --------------------------------------------------------*/
+
+/* USER CODE BEGIN EV */
+
+/* USER CODE END EV */
+
+/******************************************************************************/
+/* Cortex-M3 Processor Interruption and Exception Handlers */
+/******************************************************************************/
+/**
+ * @brief This function handles Non maskable interrupt.
+ */
+void NMI_Handler(void)
+{
+ /* USER CODE BEGIN NonMaskableInt_IRQn 0 */
+
+ /* USER CODE END NonMaskableInt_IRQn 0 */
+ /* USER CODE BEGIN NonMaskableInt_IRQn 1 */
+ while (1)
+ {
+ }
+ /* USER CODE END NonMaskableInt_IRQn 1 */
+}
+
+/**
+ * @brief This function handles Hard fault interrupt.
+ */
+void HardFault_Handler(void)
+{
+ /* USER CODE BEGIN HardFault_IRQn 0 */
+
+ /* USER CODE END HardFault_IRQn 0 */
+ while (1)
+ {
+ /* USER CODE BEGIN W1_HardFault_IRQn 0 */
+ /* USER CODE END W1_HardFault_IRQn 0 */
+ }
+}
+
+/**
+ * @brief This function handles Memory management fault.
+ */
+void MemManage_Handler(void)
+{
+ /* USER CODE BEGIN MemoryManagement_IRQn 0 */
+
+ /* USER CODE END MemoryManagement_IRQn 0 */
+ while (1)
+ {
+ /* USER CODE BEGIN W1_MemoryManagement_IRQn 0 */
+ /* USER CODE END W1_MemoryManagement_IRQn 0 */
+ }
+}
+
+/**
+ * @brief This function handles Prefetch fault, memory access fault.
+ */
+void BusFault_Handler(void)
+{
+ /* USER CODE BEGIN BusFault_IRQn 0 */
+
+ /* USER CODE END BusFault_IRQn 0 */
+ while (1)
+ {
+ /* USER CODE BEGIN W1_BusFault_IRQn 0 */
+ /* USER CODE END W1_BusFault_IRQn 0 */
+ }
+}
+
+/**
+ * @brief This function handles Undefined instruction or illegal state.
+ */
+void UsageFault_Handler(void)
+{
+ /* USER CODE BEGIN UsageFault_IRQn 0 */
+
+ /* USER CODE END UsageFault_IRQn 0 */
+ while (1)
+ {
+ /* USER CODE BEGIN W1_UsageFault_IRQn 0 */
+ /* USER CODE END W1_UsageFault_IRQn 0 */
+ }
+}
+
+/**
+ * @brief This function handles System service call via SWI instruction.
+ */
+void SVC_Handler(void)
+{
+ /* USER CODE BEGIN SVCall_IRQn 0 */
+
+ /* USER CODE END SVCall_IRQn 0 */
+ /* USER CODE BEGIN SVCall_IRQn 1 */
+
+ /* USER CODE END SVCall_IRQn 1 */
+}
+
+/**
+ * @brief This function handles Debug monitor.
+ */
+void DebugMon_Handler(void)
+{
+ /* USER CODE BEGIN DebugMonitor_IRQn 0 */
+
+ /* USER CODE END DebugMonitor_IRQn 0 */
+ /* USER CODE BEGIN DebugMonitor_IRQn 1 */
+
+ /* USER CODE END DebugMonitor_IRQn 1 */
+}
+
+/**
+ * @brief This function handles Pendable request for system service.
+ */
+void PendSV_Handler(void)
+{
+ /* USER CODE BEGIN PendSV_IRQn 0 */
+
+ /* USER CODE END PendSV_IRQn 0 */
+ /* USER CODE BEGIN PendSV_IRQn 1 */
+
+ /* USER CODE END PendSV_IRQn 1 */
+}
+
+/**
+ * @brief This function handles System tick timer.
+ */
+void SysTick_Handler(void)
+{
+ /* USER CODE BEGIN SysTick_IRQn 0 */
+
+ /* USER CODE END SysTick_IRQn 0 */
+ HAL_IncTick();
+ /* USER CODE BEGIN SysTick_IRQn 1 */
+
+ /* USER CODE END SysTick_IRQn 1 */
+}
+
+/******************************************************************************/
+/* STM32F1xx Peripheral Interrupt Handlers */
+/* Add here the Interrupt Handlers for the used peripherals. */
+/* For the available peripheral interrupt handler names, */
+/* please refer to the startup file (startup_stm32f1xx.s). */
+/******************************************************************************/
+
+/* USER CODE BEGIN 1 */
+
+/* USER CODE END 1 */
diff --git a/Core/Src/syscalls.c b/Core/Src/syscalls.c
new file mode 100644
index 0000000..f3462a0
--- /dev/null
+++ b/Core/Src/syscalls.c
@@ -0,0 +1,176 @@
+/**
+ ******************************************************************************
+ * @file syscalls.c
+ * @author Auto-generated by STM32CubeIDE
+ * @brief STM32CubeIDE Minimal System calls file
+ *
+ * For more information about which c-functions
+ * need which of these lowlevel functions
+ * please consult the Newlib libc-manual
+ ******************************************************************************
+ * @attention
+ *
+ * Copyright (c) 2020-2024 STMicroelectronics.
+ * All rights reserved.
+ *
+ * This software is licensed under terms that can be found in the LICENSE file
+ * in the root directory of this software component.
+ * If no LICENSE file comes with this software, it is provided AS-IS.
+ *
+ ******************************************************************************
+ */
+
+/* Includes */
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+
+/* Variables */
+extern int __io_putchar(int ch) __attribute__((weak));
+extern int __io_getchar(void) __attribute__((weak));
+
+
+char *__env[1] = { 0 };
+char **environ = __env;
+
+
+/* Functions */
+void initialise_monitor_handles()
+{
+}
+
+int _getpid(void)
+{
+ return 1;
+}
+
+int _kill(int pid, int sig)
+{
+ (void)pid;
+ (void)sig;
+ errno = EINVAL;
+ return -1;
+}
+
+void _exit (int status)
+{
+ _kill(status, -1);
+ while (1) {} /* Make sure we hang here */
+}
+
+__attribute__((weak)) int _read(int file, char *ptr, int len)
+{
+ (void)file;
+ int DataIdx;
+
+ for (DataIdx = 0; DataIdx < len; DataIdx++)
+ {
+ *ptr++ = __io_getchar();
+ }
+
+ return len;
+}
+
+__attribute__((weak)) int _write(int file, char *ptr, int len)
+{
+ (void)file;
+ int DataIdx;
+
+ for (DataIdx = 0; DataIdx < len; DataIdx++)
+ {
+ __io_putchar(*ptr++);
+ }
+ return len;
+}
+
+int _close(int file)
+{
+ (void)file;
+ return -1;
+}
+
+
+int _fstat(int file, struct stat *st)
+{
+ (void)file;
+ st->st_mode = S_IFCHR;
+ return 0;
+}
+
+int _isatty(int file)
+{
+ (void)file;
+ return 1;
+}
+
+int _lseek(int file, int ptr, int dir)
+{
+ (void)file;
+ (void)ptr;
+ (void)dir;
+ return 0;
+}
+
+int _open(char *path, int flags, ...)
+{
+ (void)path;
+ (void)flags;
+ /* Pretend like we always fail */
+ return -1;
+}
+
+int _wait(int *status)
+{
+ (void)status;
+ errno = ECHILD;
+ return -1;
+}
+
+int _unlink(char *name)
+{
+ (void)name;
+ errno = ENOENT;
+ return -1;
+}
+
+int _times(struct tms *buf)
+{
+ (void)buf;
+ return -1;
+}
+
+int _stat(char *file, struct stat *st)
+{
+ (void)file;
+ st->st_mode = S_IFCHR;
+ return 0;
+}
+
+int _link(char *old, char *new)
+{
+ (void)old;
+ (void)new;
+ errno = EMLINK;
+ return -1;
+}
+
+int _fork(void)
+{
+ errno = EAGAIN;
+ return -1;
+}
+
+int _execve(char *name, char **argv, char **env)
+{
+ (void)name;
+ (void)argv;
+ (void)env;
+ errno = ENOMEM;
+ return -1;
+}
diff --git a/Core/Src/sysmem.c b/Core/Src/sysmem.c
new file mode 100644
index 0000000..6122419
--- /dev/null
+++ b/Core/Src/sysmem.c
@@ -0,0 +1,79 @@
+/**
+ ******************************************************************************
+ * @file sysmem.c
+ * @author Generated by STM32CubeIDE
+ * @brief STM32CubeIDE System Memory calls file
+ *
+ * For more information about which C functions
+ * need which of these lowlevel functions
+ * please consult the newlib libc manual
+ ******************************************************************************
+ * @attention
+ *
+ * Copyright (c) 2024 STMicroelectronics.
+ * All rights reserved.
+ *
+ * This software is licensed under terms that can be found in the LICENSE file
+ * in the root directory of this software component.
+ * If no LICENSE file comes with this software, it is provided AS-IS.
+ *
+ ******************************************************************************
+ */
+
+/* Includes */
+#include
+#include
+
+/**
+ * Pointer to the current high watermark of the heap usage
+ */
+static uint8_t *__sbrk_heap_end = NULL;
+
+/**
+ * @brief _sbrk() allocates memory to the newlib heap and is used by malloc
+ * and others from the C library
+ *
+ * @verbatim
+ * ############################################################################
+ * # .data # .bss # newlib heap # MSP stack #
+ * # # # # Reserved by _Min_Stack_Size #
+ * ############################################################################
+ * ^-- RAM start ^-- _end _estack, RAM end --^
+ * @endverbatim
+ *
+ * This implementation starts allocating at the '_end' linker symbol
+ * The '_Min_Stack_Size' linker symbol reserves a memory for the MSP stack
+ * The implementation considers '_estack' linker symbol to be RAM end
+ * NOTE: If the MSP stack, at any point during execution, grows larger than the
+ * reserved size, please increase the '_Min_Stack_Size'.
+ *
+ * @param incr Memory size
+ * @return Pointer to allocated memory
+ */
+void *_sbrk(ptrdiff_t incr)
+{
+ extern uint8_t _end; /* Symbol defined in the linker script */
+ extern uint8_t _estack; /* Symbol defined in the linker script */
+ extern uint32_t _Min_Stack_Size; /* Symbol defined in the linker script */
+ const uint32_t stack_limit = (uint32_t)&_estack - (uint32_t)&_Min_Stack_Size;
+ const uint8_t *max_heap = (uint8_t *)stack_limit;
+ uint8_t *prev_heap_end;
+
+ /* Initialize heap end at first call */
+ if (NULL == __sbrk_heap_end)
+ {
+ __sbrk_heap_end = &_end;
+ }
+
+ /* Protect heap from growing into the reserved MSP stack */
+ if (__sbrk_heap_end + incr > max_heap)
+ {
+ errno = ENOMEM;
+ return (void *)-1;
+ }
+
+ prev_heap_end = __sbrk_heap_end;
+ __sbrk_heap_end += incr;
+
+ return (void *)prev_heap_end;
+}
diff --git a/Core/Src/system_stm32f1xx.c b/Core/Src/system_stm32f1xx.c
new file mode 100644
index 0000000..3e277e6
--- /dev/null
+++ b/Core/Src/system_stm32f1xx.c
@@ -0,0 +1,406 @@
+/**
+ ******************************************************************************
+ * @file system_stm32f1xx.c
+ * @author MCD Application Team
+ * @brief CMSIS Cortex-M3 Device Peripheral Access Layer System Source File.
+ *
+ * 1. This file provides two functions and one global variable to be called from
+ * user application:
+ * - SystemInit(): Setups the system clock (System clock source, PLL Multiplier
+ * factors, AHB/APBx prescalers and Flash settings).
+ * This function is called at startup just after reset and
+ * before branch to main program. This call is made inside
+ * the "startup_stm32f1xx_xx.s" file.
+ *
+ * - SystemCoreClock variable: Contains the core clock (HCLK), it can be used
+ * by the user application to setup the SysTick
+ * timer or configure other parameters.
+ *
+ * - SystemCoreClockUpdate(): Updates the variable SystemCoreClock and must
+ * be called whenever the core clock is changed
+ * during program execution.
+ *
+ * 2. After each device reset the HSI (8 MHz) is used as system clock source.
+ * Then SystemInit() function is called, in "startup_stm32f1xx_xx.s" file, to
+ * configure the system clock before to branch to main program.
+ *
+ * 4. The default value of HSE crystal is set to 8 MHz (or 25 MHz, depending on
+ * the product used), refer to "HSE_VALUE".
+ * When HSE is used as system clock source, directly or through PLL, and you
+ * are using different crystal you have to adapt the HSE value to your own
+ * configuration.
+ *
+ ******************************************************************************
+ * @attention
+ *
+ * Copyright (c) 2017-2021 STMicroelectronics.
+ * All rights reserved.
+ *
+ * This software is licensed under terms that can be found in the LICENSE file
+ * in the root directory of this software component.
+ * If no LICENSE file comes with this software, it is provided AS-IS.
+ *
+ ******************************************************************************
+ */
+
+/** @addtogroup CMSIS
+ * @{
+ */
+
+/** @addtogroup stm32f1xx_system
+ * @{
+ */
+
+/** @addtogroup STM32F1xx_System_Private_Includes
+ * @{
+ */
+
+#include "stm32f1xx.h"
+
+/**
+ * @}
+ */
+
+/** @addtogroup STM32F1xx_System_Private_TypesDefinitions
+ * @{
+ */
+
+/**
+ * @}
+ */
+
+/** @addtogroup STM32F1xx_System_Private_Defines
+ * @{
+ */
+
+#if !defined (HSE_VALUE)
+ #define HSE_VALUE 8000000U /*!< Default value of the External oscillator in Hz.
+ This value can be provided and adapted by the user application. */
+#endif /* HSE_VALUE */
+
+#if !defined (HSI_VALUE)
+ #define HSI_VALUE 8000000U /*!< Default value of the Internal oscillator in Hz.
+ This value can be provided and adapted by the user application. */
+#endif /* HSI_VALUE */
+
+/*!< Uncomment the following line if you need to use external SRAM */
+#if defined(STM32F100xE) || defined(STM32F101xE) || defined(STM32F101xG) || defined(STM32F103xE) || defined(STM32F103xG)
+/* #define DATA_IN_ExtSRAM */
+#endif /* STM32F100xE || STM32F101xE || STM32F101xG || STM32F103xE || STM32F103xG */
+
+/* Note: Following vector table addresses must be defined in line with linker
+ configuration. */
+/*!< Uncomment the following line if you need to relocate the vector table
+ anywhere in Flash or Sram, else the vector table is kept at the automatic
+ remap of boot address selected */
+/* #define USER_VECT_TAB_ADDRESS */
+
+#if defined(USER_VECT_TAB_ADDRESS)
+/*!< Uncomment the following line if you need to relocate your vector Table
+ in Sram else user remap will be done in Flash. */
+/* #define VECT_TAB_SRAM */
+#if defined(VECT_TAB_SRAM)
+#define VECT_TAB_BASE_ADDRESS SRAM_BASE /*!< Vector Table base address field.
+ This value must be a multiple of 0x200. */
+#define VECT_TAB_OFFSET 0x00000000U /*!< Vector Table base offset field.
+ This value must be a multiple of 0x200. */
+#else
+#define VECT_TAB_BASE_ADDRESS FLASH_BASE /*!< Vector Table base address field.
+ This value must be a multiple of 0x200. */
+#define VECT_TAB_OFFSET 0x00000000U /*!< Vector Table base offset field.
+ This value must be a multiple of 0x200. */
+#endif /* VECT_TAB_SRAM */
+#endif /* USER_VECT_TAB_ADDRESS */
+
+/******************************************************************************/
+
+/**
+ * @}
+ */
+
+/** @addtogroup STM32F1xx_System_Private_Macros
+ * @{
+ */
+
+/**
+ * @}
+ */
+
+/** @addtogroup STM32F1xx_System_Private_Variables
+ * @{
+ */
+
+ /* This variable is updated in three ways:
+ 1) by calling CMSIS function SystemCoreClockUpdate()
+ 2) by calling HAL API function HAL_RCC_GetHCLKFreq()
+ 3) each time HAL_RCC_ClockConfig() is called to configure the system clock frequency
+ Note: If you use this function to configure the system clock; then there
+ is no need to call the 2 first functions listed above, since SystemCoreClock
+ variable is updated automatically.
+ */
+uint32_t SystemCoreClock = 16000000;
+const uint8_t AHBPrescTable[16U] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 6, 7, 8, 9};
+const uint8_t APBPrescTable[8U] = {0, 0, 0, 0, 1, 2, 3, 4};
+
+/**
+ * @}
+ */
+
+/** @addtogroup STM32F1xx_System_Private_FunctionPrototypes
+ * @{
+ */
+
+#if defined(STM32F100xE) || defined(STM32F101xE) || defined(STM32F101xG) || defined(STM32F103xE) || defined(STM32F103xG)
+#ifdef DATA_IN_ExtSRAM
+ static void SystemInit_ExtMemCtl(void);
+#endif /* DATA_IN_ExtSRAM */
+#endif /* STM32F100xE || STM32F101xE || STM32F101xG || STM32F103xE || STM32F103xG */
+
+/**
+ * @}
+ */
+
+/** @addtogroup STM32F1xx_System_Private_Functions
+ * @{
+ */
+
+/**
+ * @brief Setup the microcontroller system
+ * Initialize the Embedded Flash Interface, the PLL and update the
+ * SystemCoreClock variable.
+ * @note This function should be used only after reset.
+ * @param None
+ * @retval None
+ */
+void SystemInit (void)
+{
+#if defined(STM32F100xE) || defined(STM32F101xE) || defined(STM32F101xG) || defined(STM32F103xE) || defined(STM32F103xG)
+ #ifdef DATA_IN_ExtSRAM
+ SystemInit_ExtMemCtl();
+ #endif /* DATA_IN_ExtSRAM */
+#endif
+
+ /* Configure the Vector Table location -------------------------------------*/
+#if defined(USER_VECT_TAB_ADDRESS)
+ SCB->VTOR = VECT_TAB_BASE_ADDRESS | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal SRAM. */
+#endif /* USER_VECT_TAB_ADDRESS */
+}
+
+/**
+ * @brief Update SystemCoreClock variable according to Clock Register Values.
+ * The SystemCoreClock variable contains the core clock (HCLK), it can
+ * be used by the user application to setup the SysTick timer or configure
+ * other parameters.
+ *
+ * @note Each time the core clock (HCLK) changes, this function must be called
+ * to update SystemCoreClock variable value. Otherwise, any configuration
+ * based on this variable will be incorrect.
+ *
+ * @note - The system frequency computed by this function is not the real
+ * frequency in the chip. It is calculated based on the predefined
+ * constant and the selected clock source:
+ *
+ * - If SYSCLK source is HSI, SystemCoreClock will contain the HSI_VALUE(*)
+ *
+ * - If SYSCLK source is HSE, SystemCoreClock will contain the HSE_VALUE(**)
+ *
+ * - If SYSCLK source is PLL, SystemCoreClock will contain the HSE_VALUE(**)
+ * or HSI_VALUE(*) multiplied by the PLL factors.
+ *
+ * (*) HSI_VALUE is a constant defined in stm32f1xx.h file (default value
+ * 8 MHz) but the real value may vary depending on the variations
+ * in voltage and temperature.
+ *
+ * (**) HSE_VALUE is a constant defined in stm32f1xx.h file (default value
+ * 8 MHz or 25 MHz, depending on the product used), user has to ensure
+ * that HSE_VALUE is same as the real frequency of the crystal used.
+ * Otherwise, this function may have wrong result.
+ *
+ * - The result of this function could be not correct when using fractional
+ * value for HSE crystal.
+ * @param None
+ * @retval None
+ */
+void SystemCoreClockUpdate (void)
+{
+ uint32_t tmp = 0U, pllmull = 0U, pllsource = 0U;
+
+#if defined(STM32F105xC) || defined(STM32F107xC)
+ uint32_t prediv1source = 0U, prediv1factor = 0U, prediv2factor = 0U, pll2mull = 0U;
+#endif /* STM32F105xC */
+
+#if defined(STM32F100xB) || defined(STM32F100xE)
+ uint32_t prediv1factor = 0U;
+#endif /* STM32F100xB or STM32F100xE */
+
+ /* Get SYSCLK source -------------------------------------------------------*/
+ tmp = RCC->CFGR & RCC_CFGR_SWS;
+
+ switch (tmp)
+ {
+ case 0x00U: /* HSI used as system clock */
+ SystemCoreClock = HSI_VALUE;
+ break;
+ case 0x04U: /* HSE used as system clock */
+ SystemCoreClock = HSE_VALUE;
+ break;
+ case 0x08U: /* PLL used as system clock */
+
+ /* Get PLL clock source and multiplication factor ----------------------*/
+ pllmull = RCC->CFGR & RCC_CFGR_PLLMULL;
+ pllsource = RCC->CFGR & RCC_CFGR_PLLSRC;
+
+#if !defined(STM32F105xC) && !defined(STM32F107xC)
+ pllmull = ( pllmull >> 18U) + 2U;
+
+ if (pllsource == 0x00U)
+ {
+ /* HSI oscillator clock divided by 2 selected as PLL clock entry */
+ SystemCoreClock = (HSI_VALUE >> 1U) * pllmull;
+ }
+ else
+ {
+ #if defined(STM32F100xB) || defined(STM32F100xE)
+ prediv1factor = (RCC->CFGR2 & RCC_CFGR2_PREDIV1) + 1U;
+ /* HSE oscillator clock selected as PREDIV1 clock entry */
+ SystemCoreClock = (HSE_VALUE / prediv1factor) * pllmull;
+ #else
+ /* HSE selected as PLL clock entry */
+ if ((RCC->CFGR & RCC_CFGR_PLLXTPRE) != (uint32_t)RESET)
+ {/* HSE oscillator clock divided by 2 */
+ SystemCoreClock = (HSE_VALUE >> 1U) * pllmull;
+ }
+ else
+ {
+ SystemCoreClock = HSE_VALUE * pllmull;
+ }
+ #endif
+ }
+#else
+ pllmull = pllmull >> 18U;
+
+ if (pllmull != 0x0DU)
+ {
+ pllmull += 2U;
+ }
+ else
+ { /* PLL multiplication factor = PLL input clock * 6.5 */
+ pllmull = 13U / 2U;
+ }
+
+ if (pllsource == 0x00U)
+ {
+ /* HSI oscillator clock divided by 2 selected as PLL clock entry */
+ SystemCoreClock = (HSI_VALUE >> 1U) * pllmull;
+ }
+ else
+ {/* PREDIV1 selected as PLL clock entry */
+
+ /* Get PREDIV1 clock source and division factor */
+ prediv1source = RCC->CFGR2 & RCC_CFGR2_PREDIV1SRC;
+ prediv1factor = (RCC->CFGR2 & RCC_CFGR2_PREDIV1) + 1U;
+
+ if (prediv1source == 0U)
+ {
+ /* HSE oscillator clock selected as PREDIV1 clock entry */
+ SystemCoreClock = (HSE_VALUE / prediv1factor) * pllmull;
+ }
+ else
+ {/* PLL2 clock selected as PREDIV1 clock entry */
+
+ /* Get PREDIV2 division factor and PLL2 multiplication factor */
+ prediv2factor = ((RCC->CFGR2 & RCC_CFGR2_PREDIV2) >> 4U) + 1U;
+ pll2mull = ((RCC->CFGR2 & RCC_CFGR2_PLL2MUL) >> 8U) + 2U;
+ SystemCoreClock = (((HSE_VALUE / prediv2factor) * pll2mull) / prediv1factor) * pllmull;
+ }
+ }
+#endif /* STM32F105xC */
+ break;
+
+ default:
+ SystemCoreClock = HSI_VALUE;
+ break;
+ }
+
+ /* Compute HCLK clock frequency ----------------*/
+ /* Get HCLK prescaler */
+ tmp = AHBPrescTable[((RCC->CFGR & RCC_CFGR_HPRE) >> 4U)];
+ /* HCLK clock frequency */
+ SystemCoreClock >>= tmp;
+}
+
+#if defined(STM32F100xE) || defined(STM32F101xE) || defined(STM32F101xG) || defined(STM32F103xE) || defined(STM32F103xG)
+/**
+ * @brief Setup the external memory controller. Called in startup_stm32f1xx.s
+ * before jump to __main
+ * @param None
+ * @retval None
+ */
+#ifdef DATA_IN_ExtSRAM
+/**
+ * @brief Setup the external memory controller.
+ * Called in startup_stm32f1xx_xx.s/.c before jump to main.
+ * This function configures the external SRAM mounted on STM3210E-EVAL
+ * board (STM32 High density devices). This SRAM will be used as program
+ * data memory (including heap and stack).
+ * @param None
+ * @retval None
+ */
+void SystemInit_ExtMemCtl(void)
+{
+ __IO uint32_t tmpreg;
+ /*!< FSMC Bank1 NOR/SRAM3 is used for the STM3210E-EVAL, if another Bank is
+ required, then adjust the Register Addresses */
+
+ /* Enable FSMC clock */
+ RCC->AHBENR = 0x00000114U;
+
+ /* Delay after an RCC peripheral clock enabling */
+ tmpreg = READ_BIT(RCC->AHBENR, RCC_AHBENR_FSMCEN);
+
+ /* Enable GPIOD, GPIOE, GPIOF and GPIOG clocks */
+ RCC->APB2ENR = 0x000001E0U;
+
+ /* Delay after an RCC peripheral clock enabling */
+ tmpreg = READ_BIT(RCC->APB2ENR, RCC_APB2ENR_IOPDEN);
+
+ (void)(tmpreg);
+
+/* --------------- SRAM Data lines, NOE and NWE configuration ---------------*/
+/*---------------- SRAM Address lines configuration -------------------------*/
+/*---------------- NOE and NWE configuration --------------------------------*/
+/*---------------- NE3 configuration ----------------------------------------*/
+/*---------------- NBL0, NBL1 configuration ---------------------------------*/
+
+ GPIOD->CRL = 0x44BB44BBU;
+ GPIOD->CRH = 0xBBBBBBBBU;
+
+ GPIOE->CRL = 0xB44444BBU;
+ GPIOE->CRH = 0xBBBBBBBBU;
+
+ GPIOF->CRL = 0x44BBBBBBU;
+ GPIOF->CRH = 0xBBBB4444U;
+
+ GPIOG->CRL = 0x44BBBBBBU;
+ GPIOG->CRH = 0x444B4B44U;
+
+/*---------------- FSMC Configuration ---------------------------------------*/
+/*---------------- Enable FSMC Bank1_SRAM Bank ------------------------------*/
+
+ FSMC_Bank1->BTCR[4U] = 0x00001091U;
+ FSMC_Bank1->BTCR[5U] = 0x00110212U;
+}
+#endif /* DATA_IN_ExtSRAM */
+#endif /* STM32F100xE || STM32F101xE || STM32F101xG || STM32F103xE || STM32F103xG */
+
+/**
+ * @}
+ */
+
+/**
+ * @}
+ */
+
+/**
+ * @}
+ */
diff --git a/Core/Startup/startup_stm32f103c6tx.s b/Core/Startup/startup_stm32f103c6tx.s
new file mode 100644
index 0000000..87ca9ca
--- /dev/null
+++ b/Core/Startup/startup_stm32f103c6tx.s
@@ -0,0 +1,348 @@
+/**
+ *************** (C) COPYRIGHT 2017 STMicroelectronics ************************
+ * @file startup_stm32f103x6.s
+ * @author MCD Application Team
+ * @brief STM32F103x6 Devices vector table for Atollic toolchain.
+ * This module performs:
+ * - Set the initial SP
+ * - Set the initial PC == Reset_Handler,
+ * - Set the vector table entries with the exceptions ISR address
+ * - Configure the clock system
+ * - Branches to main in the C library (which eventually
+ * calls main()).
+ * After Reset the Cortex-M3 processor is in Thread mode,
+ * priority is Privileged, and the Stack is set to Main.
+ ******************************************************************************
+ * @attention
+ *
+ * Copyright (c) 2017-2021 STMicroelectronics.
+ * All rights reserved.
+ *
+ * This software is licensed under terms that can be found in the LICENSE file
+ * in the root directory of this software component.
+ * If no LICENSE file comes with this software, it is provided AS-IS.
+ *
+ ******************************************************************************
+ */
+
+ .syntax unified
+ .cpu cortex-m3
+ .fpu softvfp
+ .thumb
+
+.global g_pfnVectors
+.global Default_Handler
+
+/* start address for the initialization values of the .data section.
+defined in linker script */
+.word _sidata
+/* start address for the .data section. defined in linker script */
+.word _sdata
+/* end address for the .data section. defined in linker script */
+.word _edata
+/* start address for the .bss section. defined in linker script */
+.word _sbss
+/* end address for the .bss section. defined in linker script */
+.word _ebss
+
+.equ BootRAM, 0xF108F85F
+/**
+ * @brief This is the code that gets called when the processor first
+ * starts execution following a reset event. Only the absolutely
+ * necessary set is performed, after which the application
+ * supplied main() routine is called.
+ * @param None
+ * @retval : None
+*/
+
+ .section .text.Reset_Handler
+ .weak Reset_Handler
+ .type Reset_Handler, %function
+Reset_Handler:
+
+/* Call the clock system initialization function.*/
+ bl SystemInit
+
+/* Copy the data segment initializers from flash to SRAM */
+ ldr r0, =_sdata
+ ldr r1, =_edata
+ ldr r2, =_sidata
+ movs r3, #0
+ b LoopCopyDataInit
+
+CopyDataInit:
+ ldr r4, [r2, r3]
+ str r4, [r0, r3]
+ adds r3, r3, #4
+
+LoopCopyDataInit:
+ adds r4, r0, r3
+ cmp r4, r1
+ bcc CopyDataInit
+
+/* Zero fill the bss segment. */
+ ldr r2, =_sbss
+ ldr r4, =_ebss
+ movs r3, #0
+ b LoopFillZerobss
+
+FillZerobss:
+ str r3, [r2]
+ adds r2, r2, #4
+
+LoopFillZerobss:
+ cmp r2, r4
+ bcc FillZerobss
+
+/* Call static constructors */
+ bl __libc_init_array
+/* Call the application's entry point.*/
+ bl main
+ bx lr
+.size Reset_Handler, .-Reset_Handler
+
+/**
+ * @brief This is the code that gets called when the processor receives an
+ * unexpected interrupt. This simply enters an infinite loop, preserving
+ * the system state for examination by a debugger.
+ *
+ * @param None
+ * @retval : None
+*/
+ .section .text.Default_Handler,"ax",%progbits
+Default_Handler:
+Infinite_Loop:
+ b Infinite_Loop
+ .size Default_Handler, .-Default_Handler
+/******************************************************************************
+*
+* The minimal vector table for a Cortex M3. Note that the proper constructs
+* must be placed on this to ensure that it ends up at physical address
+* 0x0000.0000.
+*
+******************************************************************************/
+ .section .isr_vector,"a",%progbits
+ .type g_pfnVectors, %object
+ .size g_pfnVectors, .-g_pfnVectors
+
+
+g_pfnVectors:
+
+ .word _estack
+ .word Reset_Handler
+ .word NMI_Handler
+ .word HardFault_Handler
+ .word MemManage_Handler
+ .word BusFault_Handler
+ .word UsageFault_Handler
+ .word 0
+ .word 0
+ .word 0
+ .word 0
+ .word SVC_Handler
+ .word DebugMon_Handler
+ .word 0
+ .word PendSV_Handler
+ .word SysTick_Handler
+ .word WWDG_IRQHandler
+ .word PVD_IRQHandler
+ .word TAMPER_IRQHandler
+ .word RTC_IRQHandler
+ .word FLASH_IRQHandler
+ .word RCC_IRQHandler
+ .word EXTI0_IRQHandler
+ .word EXTI1_IRQHandler
+ .word EXTI2_IRQHandler
+ .word EXTI3_IRQHandler
+ .word EXTI4_IRQHandler
+ .word DMA1_Channel1_IRQHandler
+ .word DMA1_Channel2_IRQHandler
+ .word DMA1_Channel3_IRQHandler
+ .word DMA1_Channel4_IRQHandler
+ .word DMA1_Channel5_IRQHandler
+ .word DMA1_Channel6_IRQHandler
+ .word DMA1_Channel7_IRQHandler
+ .word ADC1_2_IRQHandler
+ .word USB_HP_CAN1_TX_IRQHandler
+ .word USB_LP_CAN1_RX0_IRQHandler
+ .word CAN1_RX1_IRQHandler
+ .word CAN1_SCE_IRQHandler
+ .word EXTI9_5_IRQHandler
+ .word TIM1_BRK_IRQHandler
+ .word TIM1_UP_IRQHandler
+ .word TIM1_TRG_COM_IRQHandler
+ .word TIM1_CC_IRQHandler
+ .word TIM2_IRQHandler
+ .word TIM3_IRQHandler
+ .word 0
+ .word I2C1_EV_IRQHandler
+ .word I2C1_ER_IRQHandler
+ .word 0
+ .word 0
+ .word SPI1_IRQHandler
+ .word 0
+ .word USART1_IRQHandler
+ .word USART2_IRQHandler
+ .word 0
+ .word EXTI15_10_IRQHandler
+ .word RTC_Alarm_IRQHandler
+ .word USBWakeUp_IRQHandler
+ .word 0
+ .word 0
+ .word 0
+ .word 0
+ .word 0
+ .word 0
+ .word 0
+ .word BootRAM /* @0x108. This is for boot in RAM mode for
+ STM32F10x Low Density devices.*/
+
+/*******************************************************************************
+*
+* Provide weak aliases for each Exception handler to the Default_Handler.
+* As they are weak aliases, any function with the same name will override
+* this definition.
+*
+*******************************************************************************/
+
+ .weak NMI_Handler
+ .thumb_set NMI_Handler,Default_Handler
+
+ .weak HardFault_Handler
+ .thumb_set HardFault_Handler,Default_Handler
+
+ .weak MemManage_Handler
+ .thumb_set MemManage_Handler,Default_Handler
+
+ .weak BusFault_Handler
+ .thumb_set BusFault_Handler,Default_Handler
+
+ .weak UsageFault_Handler
+ .thumb_set UsageFault_Handler,Default_Handler
+
+ .weak SVC_Handler
+ .thumb_set SVC_Handler,Default_Handler
+
+ .weak DebugMon_Handler
+ .thumb_set DebugMon_Handler,Default_Handler
+
+ .weak PendSV_Handler
+ .thumb_set PendSV_Handler,Default_Handler
+
+ .weak SysTick_Handler
+ .thumb_set SysTick_Handler,Default_Handler
+
+ .weak WWDG_IRQHandler
+ .thumb_set WWDG_IRQHandler,Default_Handler
+
+ .weak PVD_IRQHandler
+ .thumb_set PVD_IRQHandler,Default_Handler
+
+ .weak TAMPER_IRQHandler
+ .thumb_set TAMPER_IRQHandler,Default_Handler
+
+ .weak RTC_IRQHandler
+ .thumb_set RTC_IRQHandler,Default_Handler
+
+ .weak FLASH_IRQHandler
+ .thumb_set FLASH_IRQHandler,Default_Handler
+
+ .weak RCC_IRQHandler
+ .thumb_set RCC_IRQHandler,Default_Handler
+
+ .weak EXTI0_IRQHandler
+ .thumb_set EXTI0_IRQHandler,Default_Handler
+
+ .weak EXTI1_IRQHandler
+ .thumb_set EXTI1_IRQHandler,Default_Handler
+
+ .weak EXTI2_IRQHandler
+ .thumb_set EXTI2_IRQHandler,Default_Handler
+
+ .weak EXTI3_IRQHandler
+ .thumb_set EXTI3_IRQHandler,Default_Handler
+
+ .weak EXTI4_IRQHandler
+ .thumb_set EXTI4_IRQHandler,Default_Handler
+
+ .weak DMA1_Channel1_IRQHandler
+ .thumb_set DMA1_Channel1_IRQHandler,Default_Handler
+
+ .weak DMA1_Channel2_IRQHandler
+ .thumb_set DMA1_Channel2_IRQHandler,Default_Handler
+
+ .weak DMA1_Channel3_IRQHandler
+ .thumb_set DMA1_Channel3_IRQHandler,Default_Handler
+
+ .weak DMA1_Channel4_IRQHandler
+ .thumb_set DMA1_Channel4_IRQHandler,Default_Handler
+
+ .weak DMA1_Channel5_IRQHandler
+ .thumb_set DMA1_Channel5_IRQHandler,Default_Handler
+
+ .weak DMA1_Channel6_IRQHandler
+ .thumb_set DMA1_Channel6_IRQHandler,Default_Handler
+
+ .weak DMA1_Channel7_IRQHandler
+ .thumb_set DMA1_Channel7_IRQHandler,Default_Handler
+
+ .weak ADC1_2_IRQHandler
+ .thumb_set ADC1_2_IRQHandler,Default_Handler
+
+ .weak USB_HP_CAN1_TX_IRQHandler
+ .thumb_set USB_HP_CAN1_TX_IRQHandler,Default_Handler
+
+ .weak USB_LP_CAN1_RX0_IRQHandler
+ .thumb_set USB_LP_CAN1_RX0_IRQHandler,Default_Handler
+
+ .weak CAN1_RX1_IRQHandler
+ .thumb_set CAN1_RX1_IRQHandler,Default_Handler
+
+ .weak CAN1_SCE_IRQHandler
+ .thumb_set CAN1_SCE_IRQHandler,Default_Handler
+
+ .weak EXTI9_5_IRQHandler
+ .thumb_set EXTI9_5_IRQHandler,Default_Handler
+
+ .weak TIM1_BRK_IRQHandler
+ .thumb_set TIM1_BRK_IRQHandler,Default_Handler
+
+ .weak TIM1_UP_IRQHandler
+ .thumb_set TIM1_UP_IRQHandler,Default_Handler
+
+ .weak TIM1_TRG_COM_IRQHandler
+ .thumb_set TIM1_TRG_COM_IRQHandler,Default_Handler
+
+ .weak TIM1_CC_IRQHandler
+ .thumb_set TIM1_CC_IRQHandler,Default_Handler
+
+ .weak TIM2_IRQHandler
+ .thumb_set TIM2_IRQHandler,Default_Handler
+
+ .weak TIM3_IRQHandler
+ .thumb_set TIM3_IRQHandler,Default_Handler
+
+ .weak I2C1_EV_IRQHandler
+ .thumb_set I2C1_EV_IRQHandler,Default_Handler
+
+ .weak I2C1_ER_IRQHandler
+ .thumb_set I2C1_ER_IRQHandler,Default_Handler
+
+ .weak SPI1_IRQHandler
+ .thumb_set SPI1_IRQHandler,Default_Handler
+
+ .weak USART1_IRQHandler
+ .thumb_set USART1_IRQHandler,Default_Handler
+
+ .weak USART2_IRQHandler
+ .thumb_set USART2_IRQHandler,Default_Handler
+
+ .weak EXTI15_10_IRQHandler
+ .thumb_set EXTI15_10_IRQHandler,Default_Handler
+
+ .weak RTC_Alarm_IRQHandler
+ .thumb_set RTC_Alarm_IRQHandler,Default_Handler
+
+ .weak USBWakeUp_IRQHandler
+ .thumb_set USBWakeUp_IRQHandler,Default_Handler
+
diff --git a/Debug/ADAS.elf b/Debug/ADAS.elf
new file mode 100644
index 0000000..5d49cd3
Binary files /dev/null and b/Debug/ADAS.elf differ
diff --git a/Debug/ADAS.hex b/Debug/ADAS.hex
new file mode 100644
index 0000000..068b1ab
--- /dev/null
+++ b/Debug/ADAS.hex
@@ -0,0 +1,865 @@
+:020000040800F2
+:1000000000280020D5150008051500080D1500086A
+:10001000151500081D150008251500080000000032
+:100020000000000000000000000000002D15000886
+:10003000391500080000000045150008511500089A
+:100040001D1600081D1600081D1600081D160008C4
+:100050001D1600081D1600081D1600081D160008B4
+:100060001D1600081D1600081D1600081D160008A4
+:100070001D1600081D1600081D1600081D16000894
+:100080001D1600081D1600081D1600081D16000884
+:100090001D1600081D1600081D1600081D16000874
+:1000A0001D1600081D1600081D1600081D16000864
+:1000B0001D1600081D160008000000001D1600088F
+:1000C0001D16000800000000000000001D160008BA
+:1000D000000000001D1600081D16000800000000AA
+:1000E0001D1600081D1600081D160008000000005F
+:1000F0000000000000000000000000000000000000
+:0C01000000000000000000005FF808F1A3
+:10010C0010B5054C237833B9044B13B10448AFF345
+:10011C0000800123237010BD60000020000000004F
+:10012C00EC32000808B5034B1BB103490348AFF38D
+:10013C00008008BD0000000064000020EC320008C4
+:10014C00034613F8012B002AFBD1181A013870470B
+:10015C0080B58EB00AAFF860084611461A460346C1
+:10016C007B810B463B811346FB801D4B1B78002B80
+:10017C0019D039897A890023089300230793002327
+:10018C00069300230593BB8C04933B8C0393BB8B8E
+:10019C0002933B8B0193FB8800930B46F96801207B
+:1001AC0000F020F818E039897A890023089300239D
+:1001BC0007930023069300230593BB8C04933B8C7D
+:1001CC000393BB8B02933B8B0193FB8800930B46F1
+:1001DC00F968002000F006F800BF1037BD4680BD5E
+:1001EC000000002080B485B000AFB96011461A46FB
+:1001FC000346FB730B46BB811346FB80194ABB8934
+:10020C001380194AFB881380184A3B8B1380184AB9
+:10021C00BB681360174ABB8B1380164A3B8C538008
+:10022C00144ABB8C9380134A3B8DD380114ABB8DEF
+:10023C001381104A3B8E53810E4ABB8E93810D4A1B
+:10024C003B8FD381FB7B002B03D00B4B00221A700E
+:10025C0002E0094B10221A7000BF1437BD4680BC57
+:10026C00704700BF7E00002080000020820000202C
+:10027C0094000020840000209800002080B586B0F7
+:10028C0000AF03460A46FB711346BB71BB79012BC9
+:10029C0006D9734B1B7843F00803DAB2704B1A7013
+:1002AC00704ABB791370FA79FB79403340210020F6
+:1002BC0000F05AF96C4B1B78002B09D0BB79012B41
+:1002CC0006D1674B1B7843F00403DAB2644B1A7007
+:1002DC0000F0DCF803237B610123FB60634B1B788C
+:1002EC00002B1BD0624B1A88624B1B8813439AB2AB
+:1002FC00614B1B8813439AB2604B1B8813439AB211
+:10030C005E4B5B8813439AB25C4B9B8813439AB247
+:10031C005A4BDB8813439BB2BB602AE0544B1A88C0
+:10032C00544B1B8813439AB2534B1B8813439AB2FA
+:10033C00524B1B8813439AB2504B5B8813439AB2AF
+:10034C004E4B9B8813439AB24C4BDB8813439AB2A7
+:10035C004A4B1B8913439AB2484B5B8913439AB29D
+:10036C00464B9B8913439AB2444BDB8913439BB294
+:10037C00BB60322001F0B0F9414B1B683C4A11883C
+:10038C000022184601F02CFC3D4B1B683A4A1188A0
+:10039C000022184601F024FC364B1B88FF2B07D09B
+:1003AC00374B1B68334A11880022184601F018FCA1
+:1003BC002B4B1B7803F01003002B15D1032000F0FE
+:1003CC00F3F9052001F088F9032000F0EDF9052080
+:1003DC0001F082F9032000F0E7F9012001F07CF92B
+:1003EC00022000F0E1F91DE01D4B1B7843F02003C7
+:1003FC00DBB2184600F053F9052001F06DF9184BEB
+:10040C001B7843F02003DBB2184600F048F90120BA
+:10041C0001F062F9124B1B7843F02003DBB2184653
+:10042C0000F03DF90E4B1B7843F02003DBB218466D
+:10043C0000F035F9134B04221A7000F0EFF800F0BD
+:10044C00B1F8114B02221A700F4B1B7843F00403C6
+:10045C00DBB2184600F023F900BF1837BD4680BD4B
+:10046C00980000209B0000207C0000200000002051
+:10047C007E000020800000208200002084000020EC
+:10048C0094000020990000209A00002080B487B0CE
+:10049C0000AF2F4B1B682F4A93420CD12E4B9B69FC
+:1004AC002D4A43F0040393612B4B9B6903F0040327
+:1004BC007B617B6946E0264B1B68284A93420CD132
+:1004CC00254B9B69244A43F008039361224B9B699B
+:1004DC0003F008033B613B6934E01D4B1B681F4A6A
+:1004EC0093420CD11C4B9B691B4A43F0080393614C
+:1004FC00194B9B6903F00803FB60FB6822E0144B6B
+:10050C001B68174A93420CD1134B9B69124A43F058
+:10051C0010039361104B9B6903F01003BB60BB6825
+:10052C0010E00B4B1B680F4A93420BD10A4B9B6993
+:10053C00094A43F020039361074B9B6903F02003A6
+:10054C007B607B6800BF1C37BD4680BC704700BF1A
+:10055C00940000200008014000100240000C0140F3
+:10056C00001001400014014080B485B000AFF86069
+:10057C00B9607A603B60FB68DAB2094B1A70BB68F1
+:10058C00DAB2074B5A707B68DAB2054B9A703B684B
+:10059C00DAB2034BDA7000BF1437BD4680BC70472B
+:1005AC009C00002080B500AF012000F078F80220FC
+:1005BC0001F092F800BF80BD80B584B000AF034657
+:1005CC000A46FB711346BB710423FB60BB79FA68C6
+:1005DC009A4203D8FB68DBB2013BBB710D4B1B7815
+:1005EC00BA799A4203D30B4B1B78013BBB71BB7995
+:1005FC00094AD25CFB791344DBB25BB263F07F0334
+:10060C005BB2DBB2184600F04AF800BF1037BD46AB
+:10061C0080BD00BF9B0000209C00002080B500AF77
+:10062C00084B1B7843F00403DAB2064B1A70054BE7
+:10063C001B7843F00803DBB2184600F030F800BF1B
+:10064C0080BD00BF9900002080B586B000AF7860F7
+:10065C007B68002B01D100231DE07B687B617868EF
+:10066C00FFF76EFD38610023FB600CE07B695A1CC0
+:10067C007A611B78184600F020F80346002B08D04E
+:10068C00FB680133FB603B695A1E3A61002BEDD1CC
+:10069C0000E000BFFB6818461837BD4680BD80B52A
+:1006AC0082B000AF0346FB71FB790021184600F0C5
+:1006BC0013F800BF0837BD4680BD80B582B000AFCF
+:1006CC000346FB71FB790121184600F005F8012364
+:1006DC0018460837BD4680BD80B582B000AF0346D2
+:1006EC000A46FB711346BB71164B1B68164A1188E0
+:1006FC00BA79184601F074FA144B1B88FF2B07D0FB
+:10070C00104B1B68114A11880022184601F068FA38
+:10071C000F4B1B7803F01003002B04D0FB79184609
+:10072C0000F06CF809E0FB791B09DBB2184600F00D
+:10073C003BF8FB79184600F037F800BF0837BD4688
+:10074C0080BD00BF940000207E00002080000020AF
+:10075C009800002080B500AF114B1B68114A11881E
+:10076C000022184601F03CFA012000F0B5FF0C4BBA
+:10077C001B680C4A11880122184601F031FA01203D
+:10078C0000F0AAFF064B1B68064A11880022184687
+:10079C0001F026FA012000F09FFF00BF80BD00BFD2
+:1007AC00940000208200002080B584B000AF034686
+:1007BC00FB710023FB6013E00E4B18680E4AFB68BC
+:1007CC0032F81310FA79FB6842FA03F3DBB203F048
+:1007DC000103DBB21A4601F003FAFB680133FB603C
+:1007EC00FB68032BE8DDFFF7B5FF00BF1037BD46F4
+:1007FC0080BD00BF940000208400002080B584B030
+:10080C0000AF0346FB710023FB6013E00E4B18682E
+:10081C000E4AFB6832F81310FA79FB6842FA03F3BC
+:10082C00DBB203F00103DBB21A4601F0D9F9FB6825
+:10083C000133FB60FB68072BE8DDFFF78BFF00BF84
+:10084C001037BD4680BD00BF9400002084000020FE
+:10085C0080B485B000AFF860B9603B601346FB8094
+:10086C00FB68BA681A60FB68FA889A80FB683A6879
+:10087C009A6000BF1437BD4680BC704780B588B005
+:10088C0002AF78600B46FB70FB78072B02D94FF058
+:10089C00FF333FE0214B1B88BB810023BB7301233B
+:1008AC003B740023BB74FB781B015BB263F07F03CA
+:1008BC005BB2DBB27B747B6818687B689B88002218
+:1008CC00194601F08DF97B68986807F10C0207F165
+:1008DC00100101230093032301F0FCFD0346FB757B
+:1008EC007B6818687B689B880122194601F078F9AF
+:1008FC00FB7D002B02D06FF001030BE07B7B1B0216
+:10090C001AB2BB7B1BB213431BB2C3F30903BB82EA
+:10091C00B7F9143018461837BD4680BD04330008AB
+:10092C0080B584B004AF00F075FE00F0E7F800F07D
+:10093C0057F900F01FF9624B4FF48072614962481D
+:10094C00FFF786FF4FF4007303934FF48073029309
+:10095C0080230193402300932023102208215B481D
+:10096C00FFF7F6FB04211020FFF788FCFFF71AFEB7
+:10097C0000210020FFF720FE5548FFF765FE0121FE
+:10098C000020FFF719FE5348FFF75EFE03210020FD
+:10099C00FFF712FE5048FFF757FE4FF47A7000F045
+:1009AC009BFEFFF7FFFD00F071F94C4B1B889BB2CF
+:1009BC005A2B6FD94A4B1B889BB2B3F5167F69D95A
+:1009CC00FFF7F0FD00210020FFF7F6FD4548FFF78B
+:1009DC003BFE00F03BFC4FF47A7000F07DFEFFF71D
+:1009EC00E1FD57E0FFF7DEFD00210020FFF7E4FDFD
+:1009FC003D48FFF729FEFFF7D5FD36E0FFF7D2FDA6
+:100A0C0000F00EFB00210020FFF7D6FD3748FFF762
+:100A1C001BFE01210020FFF7CFFD3548FFF714FE28
+:100A2C004FF47A7000F058FE06212748FFF726FF96
+:100A3C0003469AB22F4B1A8007E006212248FFF793
+:100A4C001DFF03469AB22B4B1A802A4B1B889BB274
+:100A5C00B3F5FA7FF1D303E0FFF7A4FD00F08CFAB5
+:100A6C0000F05EFB0346002BF6D000F077FB03464C
+:100A7C00002BC3D000211448FFF700FF03469AB2A5
+:100A8C00174B1A8001211048FFF7F8FE03469AB263
+:100A9C00194B1A80124B1B889BB2B3F5167F08D2E8
+:100AAC000F4B1B889BB2B3F5AA7F9BD801E000F0DB
+:100ABC0015FA0B4B1B889BB2B3F5AA7FF7D372E7E1
+:100ACC00A000002000080140F8000020000C0140AC
+:100ADC00083300081C3300083033000812010020D2
+:100AEC000401002040330008503300085C33000838
+:100AFC0070330008100100200601002080B590B072
+:100B0C0000AF07F1180328220021184601F058FF06
+:100B1C003B1D00221A605A609A60DA601A61022347
+:100B2C00BB610123BB621023FB6200237B6307F1D3
+:100B3C001803184601F06CF80346002B01D000F0A6
+:100B4C0059FC0F237B600023BB600023FB60002358
+:100B5C003B6100237B613B1D0021184601F0DAFA52
+:100B6C000346002B01D000F045FC00BF4037BD46CA
+:100B7C0080BD000080B500AF174B184A1A60164BA9
+:100B8C004FF482725A60144B00229A60124B00226E
+:100B9C00DA60114B00221A610F4B00225A610E4B86
+:100BAC004FF400729A610C4B0022DA610A4B00225E
+:100BBC001A62094B00225A62074B00229A62064BBA
+:100BCC000A22DA62044801F001FC0346002B01D032
+:100BDC0000F010FC00BF80BDA000002000300140E0
+:100BEC0080B586B000AF07F1080300221A605A6086
+:100BFC009A60DA60224B9B69214A43F004039361AB
+:100C0C001F4B9B6903F004037B607B681C4B9B6947
+:100C1C001B4A43F008039361194B9B6903F00803CB
+:100C2C003B603B6800224FF6F871164800F0D8FF85
+:100C3C0000224FF47D41144800F0D2FF4FF6F873B8
+:100C4C00BB600123FB6000233B6102237B6107F146
+:100C5C00080319460B4800F047FE4FF47D43BB6078
+:100C6C000123FB6000233B6102237B6107F1080336
+:100C7C001946054800F038FE00BF1837BD4680BD48
+:100C8C0000100240000C01400008014080B500AF8C
+:100C9C0000210020FFF790FC7748FFF7D5FC0121DD
+:100CAC000020FFF789FC7548FFF7CEFC4FF4FA7073
+:100CBC0000F012FD00217248FFF7E0FD03469AB2E6
+:100CCC00704B1A8001216E48FFF7D8FD03469AB28B
+:100CDC006D4B1A8002216A48FFF7D0FD03469AB289
+:100CEC006A4B1A8003216648FFF7C8FD03469AB287
+:100CFC00674B1A8004216248FFF7C0FD03469AB285
+:100D0C00644B1A8005215E48FFF7B8FD03469AB282
+:100D1C00614B1A8006215A48FFF7B0FD03469AB280
+:100D2C005E4B1A805D4B1B889BB25D4AA2FB032372
+:100D3C00DB089BB201339AB25A4B1A80FFF732FC94
+:100D4C00504B1B889BB21A465749584801F018FE65
+:100D5C0000210020FFF730FC5448FFF775FC4A4B8C
+:100D6C001B889BB21A465249524801F009FE0121D8
+:100D7C000020FFF721FC4F48FFF766FC494B1B880E
+:100D8C009BB21A464C494B4801F0FAFD0321002056
+:100D9C00FFF712FC4748FFF757FC4FF47A7000F04E
+:100DAC009BFCFFF7FFFB394B1B889BB21A46434950
+:100DBC00434801F0E5FD00210020FFF7FDFB404812
+:100DCC00FFF742FC324B1B889BB21A463D493E480A
+:100DDC0001F0D6FD01210020FFF7EEFB3A48FFF7AA
+:100DEC0033FC304B1B889BB21A463349314801F017
+:100DFC00C7FD03210020FFF7DFFB2E48FFF724FC83
+:100E0C004FF47A7000F068FCFFF7CCFB214B1B8889
+:100E1C009BB21A462D492E4801F0B2FD002100204C
+:100E2C00FFF7CAFB2A48FFF70FFC1B4B1B889BB232
+:100E3C001A462849284801F0A3FD01210020FFF79C
+:100E4C00BBFB2548FFF700FC164B1B889BB21A46D0
+:100E5C001949184801F094FD03210020FFF7ACFB61
+:100E6C001448FFF7F1FB4FF47A7000F035FCFFF7F4
+:100E7C0099FB00BF80BD00BF843300089833000885
+:100E8C00F8000020040100200601002008010020C9
+:100E9C000A0100200C0100200E010020100100208E
+:100EAC00CDCCCCCC12010020AC33000814010020B6
+:100EBC00BC33000828010020CC330008DC330008C8
+:100ECC003C010020EC33000850010020FC330008EA
+:100EDC00640100200C3400087801002080B500AFBC
+:100EEC0025E000210020FFF767FB1C48FFF7ACFB57
+:100EFC0001210020FFF760FB1948FFF7A5FB022139
+:100F0C000020FFF759FB1748FFF79EFB0321002039
+:100F1C00FFF752FB1448FFF797FB00F03DF9002157
+:100F2C001248FFF7ABFC03469AB2114B1A80104BD8
+:100F3C001B889BB2B3F5A07FD3D3FFF733FB032100
+:100F4C000020FFF739FB0B48FFF77EFB4FF47A705C
+:100F5C0000F0C2FBFFF726FB00BF80BD1C3400086D
+:100F6C00303400084434000858340008F8000020DD
+:100F7C00040100206C34000880B500AF07E00221AA
+:100F8C002348FFF77BFC03469AB2224B1A80214B75
+:100F9C001B889BB2B3F5487FF1D81E4B1B889BB2C4
+:100FAC00B3F5487F23D201224FF480611A4800F038
+:100FBC0017FE00224FF40061174800F011FE4FF4A9
+:100FCC007A7000F089FB00224FF48061124800F027
+:100FDC0007FE00224FF400610F4800F001FE0221D1
+:100FEC000B48FFF74BFC03469AB20A4B1A80FFF7EB
+:100FFC00D9FA00210020FFF7DFFA0848FFF724FB9D
+:10100C004FF47A7000F068FBFFF7CCFA00BF80BD9C
+:10101C00F800002008010020000801407C34000882
+:10102C0080B500AF00F07CF900210020FFF7C4FA76
+:10103C003448FFF709FB07E006213348FFF71EFC95
+:10104C0003469AB2314B1A80304B1B889BB2B3F5D6
+:10105C00FA7FF1D801210020FFF7AEFA2C48FFF7F8
+:10106C00F3FA00F07BF80346002B49D107E003218B
+:10107C002548FFF703FC03469AB2264B1A80254BF2
+:10108C001B889BB2B3F5487FF1D84FF47A7000F00F
+:10109C0023FB204B1B889BB2B3F5487F23D2012244
+:1010AC004FF480511C4800F09BFD00224FF400517E
+:1010BC00194800F095FD4FF47A7000F00DFB0022FA
+:1010CC004FF48051144800F08BFD00224FF4005176
+:1010DC00114800F085FD03210B48FFF7CFFB0346B9
+:1010EC009AB20C4B1A80FFF75DFA00210020FFF733
+:1010FC0063FA0A48FFF7A8FA4FF47A7000F0ECFA9A
+:10110C0000BF80BD8C340008F800002010010020C6
+:10111C009C3400080A01002000080140B03400088B
+:10112C0080B582B000AF01237B6001210948FFF735
+:10113C00A5FB03469AB2084B1A80074B1B889BB23F
+:10114C00B3F5167F01D200237B607B681846083705
+:10115C00BD4680BDF80000200601002080B582B09D
+:10116C0000AF01237B6001210948FFF787FB034691
+:10117C009AB2084B1A80074B1B889BB2B3F5167FAB
+:10118C0001D200237B607B6818460837BD4680BDC2
+:10119C00F80000200601002080B500AF00224FF4BB
+:1011AC008041294800F01CFD01224FF400412648E3
+:1011BC0000F016FD4FF47A7000F08EFA00224FF416
+:1011CC008041214800F00CFD00224FF400411E48E4
+:1011DC0000F006FD01224FF480611B4800F000FD79
+:1011EC0000224FF40061184800F0FAFC4FF47A70BA
+:1011FC0000F072FA00224FF48061134800F0F0FC0A
+:10120C0000224FF40061104800F0EAFC01224FF478
+:10121C0080510D4800F0E4FC00224FF400510A48C4
+:10122C0000F0DEFC4FF47A7000F056FA00224FF416
+:10123C008051054800F0D4FC00224FF400510248C4
+:10124C0000F0CEFC00BF80BD000C014080B500AFAB
+:10125C002C4B1B889BB2B3F5167F50D900224FF450
+:10126C008061294800F0BCFC00224FF40061264844
+:10127C0000F0B6FC2FE000224FF48041224800F031
+:10128C00AFFC01224FF400411F4800F0A9FC4FF4C1
+:10129C007A7000F021FA00224FF480411A4800F0D5
+:1012AC009FFC00224FF40041174800F099FC0621E6
+:1012BC001648FFF7E3FA03469AB2154B1A80144B03
+:1012CC001B889BB2134AA2FB0323DB089BB201339E
+:1012DC009AB2114B1A80104B1B889BB24F2BCAD958
+:1012EC00FFF760F900210020FFF766F90B48FFF7C4
+:1012FC00ABF94FF47A7000F0EFF9FFF753F900BF38
+:10130C0080BD00BF04010020000C0140F80000204B
+:10131C0010010020CDCCCCCC12010020C034000830
+:10132C0080B500AF2C4B1B889BB2B3F5AA7F50D96C
+:10133C0000224FF48061294800F052FC00224FF447
+:10134C000061264800F04CFC2FE000224FF4804155
+:10135C00224800F045FC01224FF400411F4800F0E8
+:10136C003FFC4FF47A7000F0B7F900224FF4804143
+:10137C001A4800F035FC00224FF40041174800F0E9
+:10138C002FFC06211648FFF779FA03469AB2154B43
+:10139C001A80144B1B889BB2134AA2FB0323DB0855
+:1013AC009BB201339AB2114B1A80104B1B889BB223
+:1013BC00312BCAD9FFF7F6F800210020FFF7FCF813
+:1013CC000B48FFF741F94FF47A7000F085F9FFF7FD
+:1013DC00E9F800BF80BD00BF04010020000C0140F3
+:1013EC00F800002010010020CDCCCCCC1201002044
+:1013FC00D034000880B400AF72B600BF00BFFDE768
+:10140C0080B485B000AF154B9B69144A43F00103BF
+:10141C009361124B9B6903F00103BB60BB680F4BDC
+:10142C00DB690E4A43F08053D3610C4BDB6903F04C
+:10143C0080537B607B680A4B5B68FB60FB6823F026
+:10144C00E063FB60FB6843F08063FB60044AFB686D
+:10145C00536000BF1437BD4680BC7047001002407B
+:10146C000000014080B588B000AF786007F1100330
+:10147C0000221A605A609A60DA607B681B681B4A0B
+:10148C0093422FD11A4B9B69194A43F480539361B1
+:10149C00174B9B6903F48053FB60FB68144B9B69EF
+:1014AC00134A43F004039361114B9B6903F004034B
+:1014BC00BB60BB68A0233B6102237B610323FB6100
+:1014CC0007F1100319460B4800F00EFA40233B615C
+:1014DC0000237B610023BB6107F11003194605480B
+:1014EC0000F002FA00BF2037BD4680BD003001403D
+:1014FC00001002400008014080B400AF00BFFDE7BF
+:10150C0080B400AF00BFFDE780B400AF00BFFDE7C3
+:10151C0080B400AF00BFFDE780B400AF00BFFDE7B3
+:10152C0080B400AF00BFBD4680BC704780B400AF34
+:10153C0000BFBD4680BC704780B400AF00BFBD4645
+:10154C0080BC704780B500AF00F0AAF800BF80BD2A
+:10155C0080B586B000AF7860144A154BD31A7B6106
+:10156C007B693B61134B1B68002B02D1114B124A58
+:10157C001A60104B1A687B6813443A699A4207D276
+:10158C0001F026FA03460C221A604FF0FF3309E0F3
+:10159C00084B1B68FB60074B1A687B681344054AB1
+:1015AC001360FB6818461837BD4680BD0028002024
+:1015BC00000400008C010020E002002080B400AF89
+:1015CC0000BFBD4680BC7047FFF7F8FF0B480C49C5
+:1015DC000C4A002302E0D458C4500433C4188C4283
+:1015EC00F9D3094A094C002301E013600432A242EA
+:1015FC00FBD301F0F3F9FFF793F9704700000020DB
+:10160C00600000204835000860000020DC0200204B
+:10161C00FEE7000080B500AF084B1B68074A43F09B
+:10162C0010031360032000F02BF90F2000F008F8D2
+:10163C00FFF7E6FE0023184680BD00BF00200240E5
+:10164C0080B582B000AF7860124B1A68124B1B78D1
+:10165C0019464FF47A73B3FBF1F3B2FBF3F318466C
+:10166C0000F035F90346002B01D001230EE07B6816
+:10167C000F2B0AD8002279684FF0FF3000F00BF9DD
+:10168C00064A7B681360002300E0012318460837E4
+:10169C00BD4680BD040000200C0000200800002086
+:1016AC0080B400AF054B1B781A46054B1B681344DE
+:1016BC00034A136000BFBD4680BC70470C0000207D
+:1016CC009001002080B400AF024B1B681846BD4649
+:1016DC0080BC70479001002080B584B000AF78606A
+:1016EC00FFF7F0FFB8607B68FB60FB68B3F1FF3F6E
+:1016FC0005D00A4B1B781A46FB681344FB6000BFED
+:10170C00FFF7E0FF0246BB68D31AFA689A42F7D893
+:10171C0000BF00BF1037BD4680BD00BF0C000020CD
+:10172C0080B485B000AF78607B6803F00703FB6082
+:10173C000C4BDB68BB60BA684FF6FF031340BB6011
+:10174C00FB681A02BB68134343F0BF6343F40033D6
+:10175C00BB60044ABB68D36000BF1437BD4680BC75
+:10176C00704700BF00ED00E080B400AF044BDB68B5
+:10177C001B0A03F007031846BD4680BC704700BF28
+:10178C0000ED00E080B483B000AF03463960FB711C
+:10179C0097F90730002B0ADB3B68DAB20C4997F952
+:1017AC0007301201D2B20B4483F800230AE03B68E5
+:1017BC00DAB20849FB7903F00F03043B1201D2B2F1
+:1017CC000B441A7600BF0C37BD4680BC704700BF77
+:1017DC0000E100E000ED00E080B489B000AFF860FB
+:1017EC00B9607A60FB6803F00703FB61FB69C3F126
+:1017FC000703042B28BF0423BB61FB690433062BAE
+:10180C0002D9FB69033B00E000237B614FF0FF3200
+:10181C00BB6902FA03F3DA43BB681A407B699A404E
+:10182C004FF0FF317B6901FA03F3D9437B680B401E
+:10183C00134318462437BD4680BC704780B582B030
+:10184C0000AF78607B68013BB3F1807F01D301234B
+:10185C000FE00A4A7B68013B53600F214FF0FF30C9
+:10186C00FFF790FF054B00229A60044B07221A6089
+:10187C00002318460837BD4680BD00BF10E000E0CD
+:10188C0080B582B000AF78607868FFF749FF00BF81
+:10189C000837BD4680BD80B586B000AF0346B96041
+:1018AC007A60FB7300237B61FFF75EFF78617A68D7
+:1018BC00B9687869FFF790FF024697F90F30114627
+:1018CC001846FFF75FFF00BF1837BD4680BD80B5D7
+:1018DC0082B000AF78607868FFF7B0FF0346184617
+:1018EC000837BD4680BD000080B48BB000AF786077
+:1018FC00396000237B6200233B6261E101227B6A39
+:10190C0002FA03F3FB613B681B68FA691340BB6185
+:10191C00BA69FB699A4240F050813B685B68974A10
+:10192C0093425ED0954A934275D8954A934258D0CB
+:10193C00934A93426FD8934A934252D0914A93421E
+:10194C0069D8914A93424CD08F4A934263D88F4ABC
+:10195C00934246D08D4A93425DD8122B2AD8122B33
+:10196C0059D801A252F823F0EF190008C919000840
+:10197C00DB1900081D1A0008231A0008231A000896
+:10198C00231A0008231A0008231A0008231A000837
+:10199C00231A0008231A0008231A0008231A000827
+:1019AC00231A0008231A0008231A0008D11900086A
+:1019BC00E5190008764A934213D02CE03B68DB68AB
+:1019CC003B6229E03B68DB6804333B6224E03B6804
+:1019DC00DB6808333B621FE03B68DB680C333B621F
+:1019EC001AE03B689B68002B02D104233B6213E096
+:1019FC003B689B68012B05D108233B627B68FA6925
+:101A0C001A6109E008233B627B68FA695A6103E0BA
+:101A1C0000233B6200E000BFBB69FF2B01D87B6851
+:101A2C0001E07B6804337B61BB69FF2B02D87B6AC6
+:101A3C009B0002E07B6A083B9B003B617B691A6858
+:101A4C000F213B6901FA03F3DB431A40396A3B6906
+:101A5C0001FA03F31A437B691A603B685B6803F075
+:101A6C008053002B00F0A9804A4B9B69494A43F0F4
+:101A7C0001039361474B9B6903F00103BB60BB6897
+:101A8C00454A7B6A9B08023352F82330FB607B6A21
+:101A9C0003F003039B000F2202FA03F3DB43FA6803
+:101AAC001340FB607B683D4A93420DD07B683C4AF7
+:101ABC00934207D07B683B4A934201D1022304E056
+:101ACC00032302E0012300E000237A6A02F0030200
+:101ADC0092009340FA681343FB602F497B6A9B0882
+:101AEC000233FA6841F823203B685B6803F48013E7
+:101AFC00002B06D02C4B9A682B49BB6913438B6087
+:101B0C0006E0294B9A68BB69DB43274913408B607D
+:101B1C003B685B6803F40013002B06D0224BDA6899
+:101B2C002149BB691343CB6006E01F4BDA68BB69E4
+:101B3C00DB431D491340CB603B685B6803F4003307
+:101B4C00002B06D0184B5A681749BB6913434B60DE
+:101B5C0006E0154B5A68BB69DB43134913404B60D5
+:101B6C003B685B6803F48033002B1FD00E4B1A6864
+:101B7C000D49BB6913430B601FE000BF000032101E
+:101B8C000000311000002210000021100000121083
+:101B9C00000011100010024000000140000801403C
+:101BAC00000C014000100140000401400B4B1A686E
+:101BBC00BB69DB43094913400B607B6A01337B62D1
+:101BCC003B681A687B6A22FA03F3002B7FF496AE0B
+:101BDC0000BF00BF2C37BD4680BC704700040140DD
+:101BEC0080B483B000AF78600B467B8013467B706B
+:101BFC007B78002B03D07A887B681A6103E07B88A2
+:101C0C001A047B681A6100BF0C37BD4680BC704754
+:101C1C0080B586B000AF78607B68002B01D10123C2
+:101C2C0072E27B681B6803F00103002B00F08780D5
+:101C3C00924B5B6803F00C03042B0CD08F4B5B684E
+:101C4C0003F00C03082B12D18C4B5B6803F480332C
+:101C5C00B3F5803F0BD1894B1B6803F40033002B89
+:101C6C006CD07B685B68002B68D101234CE27B68ED
+:101C7C005B68B3F5803F06D1804B1B687F4A43F409
+:101C8C00803313602EE07B685B68002B0CD17B4BA0
+:101C9C001B687A4A23F480331360784B1B68774AAD
+:101CAC0023F4802313601DE07B685B68B3F5A02FE1
+:101CBC000CD1724B1B68714A43F4802313606F4B39
+:101CCC001B686E4A43F4803313600BE06B4B1B684C
+:101CDC006A4A23F480331360684B1B68674A23F409
+:101CEC00802313607B685B68002B13D0FFF7EAFC42
+:101CFC00386108E0FFF7E6FC02463B69D31A642B17
+:101D0C0001D9032300E25D4B1B6803F40033002B65
+:101D1C00F0D014E0FFF7D6FC386108E0FFF7D2FCF6
+:101D2C0002463B69D31A642B01D90323ECE1534BD4
+:101D3C001B6803F40033002BF0D100E000BF7B687C
+:101D4C001B6803F00203002B63D04C4B5B6803F061
+:101D5C000C03002B0BD0494B5B6803F00C03082BD6
+:101D6C001CD1464B5B6803F48033002B16D1434BDC
+:101D7C001B6803F00203002B05D07B681B69012B49
+:101D8C0001D00123C0E13D4B1B6823F0F8027B68B6
+:101D9C005B69DB00394913430B603AE07B681B69D4
+:101DAC00002B20D0364B01221A60FFF78BFC3861D8
+:101DBC0008E0FFF787FC02463B69D31A022B01D9D6
+:101DCC000323A1E12D4B1B6803F00203002BF0D081
+:101DDC002A4B1B6823F0F8027B685B69DB00274900
+:101DEC0013430B6015E0264B00221A60FFF76AFCC8
+:101DFC00386108E0FFF766FC02463B69D31A022BF8
+:101E0C0001D9032380E11D4B1B6803F00203002B57
+:101E1C00F0D17B681B6803F00803002B3AD07B6879
+:101E2C009B69002B19D0174B01221A60FFF74AFC53
+:101E3C00386108E0FFF746FC02463B69D31A022BD7
+:101E4C0001D9032360E10D4B5B6A03F00203002B05
+:101E5C00F0D0012000F09CFA1CE00A4B00221A6022
+:101E6C00FFF730FC38610FE0FFF72CFC02463B69B2
+:101E7C00D31A022B08D9032346E100BF00100240FD
+:101E8C000000424280044242924B5B6A03F0020320
+:101E9C00002BE9D17B681B6803F00403002B00F0D6
+:101EAC00A6800023FB758B4BDB6903F08053002B62
+:101EBC000DD1884BDB69874A43F08053D361854B46
+:101ECC00DB6903F08053BB60BB680123FB75824B5D
+:101EDC001B6803F48073002B18D17F4B1B687E4A60
+:101EEC0043F480731360FFF7EDFB386108E0FFF7F4
+:101EFC00E9FB02463B69D31A642B01D9032303E1A6
+:101F0C00754B1B6803F48073002BF0D07B68DB6887
+:101F1C00012B06D16F4B1B6A6E4A43F0010313620F
+:101F2C002DE07B68DB68002B0CD16A4B1B6A694A7D
+:101F3C0023F001031362674B1B6A664A23F0040308
+:101F4C0013621CE07B68DB68052B0CD1614B1B6AB0
+:101F5C00604A43F0040313625E4B1B6A5D4A43F014
+:101F6C00010313620BE05B4B1B6A5A4A23F001031B
+:101F7C001362584B1B6A574A23F0040313627B68A5
+:101F8C00DB68002B15D0FFF79DFB38610AE0FFF7EB
+:101F9C0099FB02463B69D31A41F28832934201D92C
+:101FAC000323B1E04B4B1B6A03F00203002BEED072
+:101FBC0014E0FFF787FB38610AE0FFF783FB02466A
+:101FCC003B69D31A41F28832934201D903239BE037
+:101FDC00404B1B6A03F00203002BEED1FB7D012B5F
+:101FEC0005D13C4BDB693B4A23F08053D3617B68C2
+:101FFC00DB69002B00F08780364B5B6803F00C0329
+:10200C00082B61D07B68DB69022B46D1334B002255
+:10201C001A60FFF757FB386108E0FFF753FB0246E5
+:10202C003B69D31A022B01D903236DE0294B1B68A2
+:10203C0003F00073002BF0D17B681B6AB3F5803F73
+:10204C0008D1244B5B6823F400327B689B682149E0
+:10205C0013434B601F4B5B6823F474127B68196A43
+:10206C007B685B6A0B431B4913434B601B4B012280
+:10207C001A60FFF727FB386108E0FFF723FB0246E5
+:10208C003B69D31A022B01D903233DE0114B1B688A
+:10209C0003F00073002BF0D035E0104B00221A60D7
+:1020AC00FFF710FB386108E0FFF70CFB02463B69B9
+:1020BC00D31A022B01D9032326E0064B1B6803F02D
+:1020CC000073002BF0D11EE07B68DB69012B07D17C
+:1020DC00012319E0001002400070004060004242F1
+:1020EC000B4B5B68FB60FB6803F480327B681B6AFC
+:1020FC009A4206D1FB6803F470127B685B6A9A42C1
+:10210C0001D0012300E0002318461837BD4680BDDE
+:10211C000010024080B584B000AF786039607B68F5
+:10212C00002B01D10123D0E06A4B1B6803F007039D
+:10213C003A689A4210D9674B1B6823F0070265492D
+:10214C003B6813430B60634B1B6803F007033A684F
+:10215C009A4201D00123B8E07B681B6803F00203AC
+:10216C00002B20D07B681B6803F00403002B05D0E8
+:10217C00594B5B68584A43F4E06353607B681B68B7
+:10218C0003F00803002B05D0534B5B68524A43F411
+:10219C0060535360504B5B6823F0F0027B689B6884
+:1021AC004D4913434B607B681B6803F00103002B04
+:1021BC0040D07B685B68012B07D1474B1B6803F44D
+:1021CC000033002B15D101237FE07B685B68022B69
+:1021DC0007D1414B1B6803F00073002B09D101237D
+:1021EC0073E03D4B1B6803F00203002B01D101236C
+:1021FC006BE0394B5B6823F003027B685B68364904
+:10220C0013434B60FFF75EFAF8600AE0FFF75AFAE7
+:10221C000246FB68D31A41F28832934201D9032358
+:10222C0053E02D4B5B6803F00C027B685B689B00F2
+:10223C009A42EBD1274B1B6803F007033A689A428A
+:10224C0010D2244B1B6823F0070222493B6813432E
+:10225C000B60204B1B6803F007033A689A4201D0CD
+:10226C00012332E07B681B6803F00403002B08D0C9
+:10227C00194B5B6823F4E0627B68DB6816491343F7
+:10228C004B607B681B6803F00803002B09D0124BD2
+:10229C005B6823F460527B681B69DB000E491343B7
+:1022AC004B6000F021F802460B4B5B681B0903F0F6
+:1022BC000F030A49CB5C22FA03F3094A1360094B5A
+:1022CC001B681846FFF7BCF9002318461037BD46AB
+:1022DC0080BD00BF0020024000100240E034000826
+:1022EC00040000200800002080B487B000AF002359
+:1022FC00FB600023BB6000237B6100237B60002319
+:10230C003B611E4B5B68FB60FB6803F00C03042B0A
+:10231C0002D0082B03D027E0194B3B6127E0FB6868
+:10232C009B0C03F00F03174AD35C7B60FB6803F430
+:10233C008033002B10D0114B5B685B0C03F0010356
+:10234C00114AD35CBB607B680D4A03FB02F2BB688D
+:10235C00B2FBF3F37B6104E07B680C4A02FB03F3F2
+:10236C007B617B693B6102E0054B3B6100BF3B69D4
+:10237C0018461C37BD4680BC704700BF0010024099
+:10238C0000127A00F03400080035000800093D0006
+:10239C0080B485B000AF78600A4B1B680A4AA2FB78
+:1023AC0003235B0A7A6802FB03F3FB6000BFFB6844
+:1023BC005A1EFA60002BF9D100BF00BF1437BD467E
+:1023CC0080BC704704000020D34D621080B582B0F1
+:1023DC0000AF78607B68002B01D1012376E07B682D
+:1023EC005B6A002B08D17B685B68B3F5827F09D0F0
+:1023FC007B680022DA6105E07B6800221A617B6849
+:10240C0000225A617B6800229A627B6893F85130F3
+:10241C00DBB2002B06D17B68002283F85020786851
+:10242C00FFF720F87B68022283F851207B681B6839
+:10243C001A687B681B6822F040021A607B685B6834
+:10244C0003F482727B689B6803F404431A437B6831
+:10245C00DB6803F400631A437B681B6903F0020317
+:10246C001A437B685B6903F001031A437B689B6921
+:10247C0003F400731A437B68DB6903F038031A43D7
+:10248C007B681B6A03F0800342EA03017B689B6A4A
+:10249C0003F400527B681B680A431A607B689B69D3
+:1024AC001A0C7B681B6802F004025A607B681B687C
+:1024BC00DA697B681B6822F40062DA617B680022AF
+:1024CC005A657B68012283F851200023184608378F
+:1024DC00BD4680BD80B58CB000AFF860B9607A6045
+:1024EC007B800123FB62002387F82B30FB6893F879
+:1024FC005030012B01D1022398E1FB68012283F8B3
+:10250C005020FFF7DFF87862FB6893F8513087F8BA
+:10251C002330FB685B68FB617B887B8397F82330F7
+:10252C00012B0FD0FB69B3F5827F07D1FB689B6849
+:10253C00002B03D197F82330042B03D0022387F808
+:10254C002B306DE1BB68002B05D07B68002B02D0D3
+:10255C007B88002B03D1012387F82B3060E1FB68CB
+:10256C0093F85130DBB2042B03D0FB68052283F8BF
+:10257C005120FB6800225A65FB687A689A63FB68F5
+:10258C007A88DA87FB687A889A87FB68BA681A6354
+:10259C00FB687A88DA86FB687A889A86FB68002260
+:1025AC001A64FB6800225A64FB681B681B6803F002
+:1025BC004003402B07D0FB681B681A68FB681B683C
+:1025CC0042F040021A60FB68DB68B3F5006F7CD107
+:1025DC00FB685B68002B02D07B8B012B6AD1FB68FC
+:1025EC001B6B1A88FB681B68DA60FB681B6B9A1CF8
+:1025FC00FB681A63FB68DB8E9BB2013B9AB2FB68EB
+:10260C00DA8657E0FB681B689B6803F00203022B19
+:10261C001BD1FB68DB8E9BB2002B16D0FB6A012B07
+:10262C0013D1FB681B6B1A88FB681B68DA60FB68AC
+:10263C001B6B9A1CFB681A63FB68DB8E9BB2013B1D
+:10264C009AB2FB68DA860023FB62FB681B689B6806
+:10265C0003F00103012B19D1FB68DB8F9BB2002B1C
+:10266C0014D0FB681B68DA68FB689B6B92B21A800B
+:10267C00FB689B6B9A1CFB689A63FB68DB8F9BB2B5
+:10268C00013B9AB2FB68DA870123FB62FFF71AF869
+:10269C0002467B6AD31ABA6B9A420BD8BB6BB3F166
+:1026AC00FF3F07D0032387F82B30FB68012283F808
+:1026BC005120B5E0FB68DB8E9BB2002BA2D1FB68EE
+:1026CC00DB8F9BB2002B9DD180E0FB685B68002BFD
+:1026DC0002D07B8B012B6FD1FB681A6BFB681B68DC
+:1026EC000C3312781A70FB681B6B5A1CFB681A634C
+:1026FC00FB68DB8E9BB2013B9AB2FB68DA865BE02F
+:10270C00FB681B689B6803F00203022B1CD1FB685F
+:10271C00DB8E9BB2002B17D0FB6A012B14D1FB680C
+:10272C001A6BFB681B680C3312781A70FB681B6BF6
+:10273C005A1CFB681A63FB68DB8E9BB2013B9AB296
+:10274C00FB68DA860023FB62FB681B689B6803F05E
+:10275C000103012B19D1FB68DB8F9BB2002B14D02A
+:10276C00FB681B68DA68FB689B6BD2B21A70FB685B
+:10277C009B6B5A1CFB689A63FB68DB8F9BB2013B1B
+:10278C009AB2FB68DA870123FB62FEF79BFF0246D5
+:10279C007B6AD31ABA6B9A4203D8BB6BB3F1FF3F77
+:1027AC0002D1BB6B002B07D1032387F82B30FB68BE
+:1027BC00012283F8512033E0FB68DB8E9BB2002BA7
+:1027CC009ED1FB68DB8F9BB2002B99D17A6AB96BD7
+:1027DC00F86800F0B7F80346002B06D0012387F801
+:1027EC002B30FB6820225A651AE0FB689B68002B93
+:1027FC000AD100237B61FB681B68DB687B61FB688B
+:10280C001B689B687B617B69FB685B6D002B03D04D
+:10281C00012387F82B3003E0FB68012283F8512059
+:10282C00FB68002283F8502097F82B30184630377D
+:10283C00BD4680BD80B588B000AFF860B9603B6024
+:10284C001346FB71FEF73EFF0246BB6A9B1A3A68C1
+:10285C001344FB61FEF736FFB861394B1B685B0113
+:10286C001B0DFA6902FB03F37B6154E03B68B3F187
+:10287C00FF3F50D0FEF726FF0246BB69D31AFA6918
+:10288C009A4202D9FB69002B3DD1FB681B685A6840
+:10289C00FB681B6822F0E0025A60FB685B68B3F5CA
+:1028AC00827F11D1FB689B68B3F5004F04D0FB68A5
+:1028BC009B68B3F5806F07D1FB681B681A68FB68CF
+:1028CC001B6822F040021A60FB689B6AB3F5005F3C
+:1028DC000FD1FB681B681A68FB681B6822F4005256
+:1028EC001A60FB681B681A68FB681B6842F400528C
+:1028FC001A60FB68012283F85120FB68002283F8E0
+:10290C005020032317E07B69002B01D10023FB61CE
+:10291C007B69013B7B61FB681B689A68BB68134051
+:10292C00BA689A420CBF01230023DBB21A46FB792A
+:10293C009A429BD1002318462037BD4680BD00BF6C
+:10294C000400002080B586B002AFF860B9607A60F0
+:10295C007B680093BB6800228021F868FFF76AFF50
+:10296C000346002B07D0FB685B6D43F02002FB682D
+:10297C005A65032300E0002318461037BD4680BD7E
+:10298C000EB46FF0004100B59CB01DAB02900690E8
+:10299C00079104910848094953F8042B05910068E4
+:1029AC0002A9019300F092F90022029B1A701CB04C
+:1029BC005DF804EB03B07047100000200802FFFF25
+:1029CC0003460244934200D1704703F8011BF9E718
+:1029DC00014B1868704700BF1000002070B500262E
+:1029EC000C4D0D4C641BA410A64209D100F078FCD0
+:1029FC0000260A4D0A4C641BA410A64205D170BDDA
+:102A0C0055F8043B98470136EEE755F8043B9847D8
+:102A1C000136F2E740350008403500084035000823
+:102A2C00443500087047704738B50546002940D03A
+:102A3C0051F8043C0C1F002BB8BFE41800F0DEF872
+:102A4C001C4A136833B9636014602846BDE83840EB
+:102A5C0000F0DAB8A34208D9206821188B4201BFD4
+:102A6C0019685B6809182160EDE71A465B680BB1C1
+:102A7C00A342FAD911685018A0420BD12068014426
+:102A8C00501883421160E0D118685B6808441060EC
+:102A9C005360DAE702D90C232B60D6E720682118A3
+:102AAC008B4201BF19685B68091821606360546030
+:102ABC00CBE738BDD802002070B50F4E0C463168FC
+:102ACC00054611B900F0AAFB30602146284600F0FB
+:102ADC00A5FB431C03D14FF0FF34204670BDC41C32
+:102AEC0024F00304A042F8D0211A284600F096FBEB
+:102AFC000130F2D1EFE700BFD40200202DE9F843FA
+:102B0C00CD1C25F0030508350C2D38BF0C25002DE8
+:102B1C00064601DBA94204D90C2333600020BDE832
+:102B2C00F883DFF8D48000F069F8D8F800301C4640
+:102B3C0044BB29463046FFF7BFFF431C044658D11F
+:102B4C00D8F800402746002F43D1002C4BD02368E7
+:102B5C003946304604EB030900F060FB814542D155
+:102B6C00216830466D1A2946FFF7A6FF01303AD08E
+:102B7C0023682B442360D8F800305A6862BBC8F82D
+:102B8C0000700FE02268521B20D40B2A17D9611950
+:102B9C00A342256018BF5960636808BFC8F80010CD
+:102BAC0062514B60304600F02FF804F10B00231DEE
+:102BBC0020F00700C21A1CBF1B1AA350AFE76268B3
+:102BCC00A3420CBFC8F800205A60EBE723466468A8
+:102BDC00AEE73C467F68B6E71A465B68A342FBD17A
+:102BEC0000235360DEE70C233046336000F00CF812
+:102BFC0094E70560D6E700BFD80200200148FFF734
+:102C0C0011BF00BFD00200200148FFF70CBF00BF6E
+:102C1C00D00200202DE9F0471F468E688246BE4246
+:102C2C000C4690460B682DD8B1F90C2012F4906F1D
+:102C3C0026D06569096905EB4505A3EB010905EB90
+:102C4C00D5757B1C4B446D109D4238BF1D465305FA
+:102C5C0027D52946FFF752FF064660B34A4621693D
+:102C6C0000F0FAFAA38923F4906343F08003A38164
+:102C7C0026614E4426603E466561A5EB0905A560BC
+:102C8C00BE4200D93E4632464146206800F0ACFABE
+:102C9C000020A3689B1BA360236833442360BDE81A
+:102CAC00F0872A4600F0E6FA06460028E0D15046A6
+:102CBC002169FFF7B9FE0C23CAF80030A3894FF045
+:102CCC00FF3043F04003A381E9E700002DE9F04F0A
+:102CDC0098468B8907461B060D4614469DB010D5A9
+:102CEC000B6973B94021FFF709FF2860286130B9DF
+:102CFC000C233B604FF0FF301DB0BDE8F08F40233C
+:102D0C006B610023099320238DF8293030234FF079
+:102D1C000109CDF80C80DFF898818DF82A30234614
+:102D2C009A4613F8012B0AB1252AF9D1BAEB040BF8
+:102D3C000BD05B46224629463846FFF76BFF013025
+:102D4C0000F0A780099A5A4409929AF80030002B97
+:102D5C0000F09F8000234FF0FF32CDE905230AF1EC
+:102D6C00010A049307938DF853301A9354460522A5
+:102D7C0014F8011B4E4800F061FA049AD8B9D00639
+:102D8C0044BF20238DF85330110744BF2B238DF8FB
+:102D9C0053309AF800302A2B15D0544600204FF0AF
+:102DAC000A0C079A214611F8013B303B092B4BD9F1
+:102DBC00B0B1079214E0A0EB080309FA03F3134334
+:102DCC00A2460493D2E7039B191D1B680391002BA9
+:102DDC00BBBF5B4242F0020207930793B8BF049259
+:102DEC0023782E2B0AD163782A2B32D1039B023401
+:102DFC001A1D1B68039243EAE3730593DFF8B4A032
+:102E0C0003225046217800F019FA38B14022049B75
+:102E1C00A0EB0A00824013430134049314F8011B05
+:102E2C00062225488DF8281000F008FA002836D024
+:102E3C00224B1BBB039B073323F00703083303937D
+:102E4C00099B334409936AE70C4601200CFB0232C0
+:102E5C00A8E700234FF00A0C1946013405932046CD
+:102E6C0010F8012B303A092A03D9002BC6D0059152
+:102E7C00C4E7044601230CFB0121F0E703AB0093EC
+:102E8C002A4638460E4B04A9AFF30080421C064676
+:102E9C00D6D1AB895B063FF52DAF09982CE703AB78
+:102EAC0000932A463846064B04A900F07DF8EDE75E
+:102EBC0002350008083500080C3500080000000039
+:102ECC00212C00082DE9F047164698468A680B69B4
+:102EDC0007469342B8BF1346336091F843200C4623
+:102EEC00DDF820900AB1013333602368990642BFA4
+:102EFC00336802333360256815F0060506D104F1FA
+:102F0C00190AE36832689B1AAB422BDC94F8433005
+:102F1C002268003B18BF0123920630D44146384644
+:102F2C0004F14302C847013023D02368226903F01F
+:102F3C000603042B14BF002533684FF0000608BFAE
+:102F4C00E56804F11A0408BFED1A54F8123C08BFE6
+:102F5C0025EAE5759342C4BF9B1AED18B5421AD108
+:102F6C00002008E00123524641463846C84701304C
+:102F7C0003D14FF0FF30BDE8F0870135C1E73020B9
+:102F8C00E11881F843005A1C94F84510224402338E
+:102F9C0082F84310C2E70123224641463846C8470F
+:102FAC000130E6D00136D9E72DE9FF470F7E914677
+:102FBC00782F80460C469A460C9E01F1430207D8A6
+:102FCC00622F0AD8002F00F0D380582F00F0BA805F
+:102FDC0004F1420684F842703AE0A7F16303152B22
+:102FEC00F6D801A151F823F04D30000861300008EB
+:102FFC00DD2F0008DD2F0008DD2F0008DD2F000875
+:10300C0061300008DD2F0008DD2F0008DD2F0008DF
+:10301C00DD2F0008633100088B3000081D310008DB
+:10302C00DD2F0008DD2F000885310008DD2F00089A
+:10303C008B300008DD2F0008DD2F0008253100083B
+:10304C0033681A1D1B68326004F1420684F8423062
+:10305C0001239EE033682068191D3160060601D5F6
+:10306C001D6803E04506FBD5B3F90050002D03DACB
+:10307C002D236D4284F843300A23594811E021680E
+:10308C003368080653F8045B02D4490648BFADB256
+:10309C006F2F336014BF0A2308235148002184F892
+:1030AC0043106668002EA8BF2168A660A4BF21F05B
+:1030BC00040121600DB9002E4BD01646B5FBF3F17F
+:1030CC0003FB1157C75D06F8017D2F46BB420D4629
+:1030DC00F4D9082B0BD12368DF0708D52369616865
+:1030EC009942DEBF302306F8013C06F1FF36921BF5
+:1030FC0022614B4621464046CDF800A003AAFFF7BB
+:10310C00E1FE01304AD14FF0FF3004B0BDE8F0874A
+:10311C00236843F0200323607827324884F84570F5
+:10312C00236831681F0651F8045B02D45F0648BF60
+:10313C00ADB23160D90744BF43F0200323601DB109
+:10314C001023ABE72648E9E7236823F0200323602C
+:10315C00F6E71646BDE733682568181D61693060CF
+:10316C002E061B6801D5196002E06806FBD5198094
+:10317C00002316462361BCE7336800211A1D326018
+:10318C001E686268304600F059F808B1801B606018
+:10319C0063682361002384F84330AAE7324649462A
+:1031AC0040462369D0470130ADD023689B0713D428
+:1031BC00E068039B9842B8BF1846A6E70123324645
+:1031CC0049464046D04701309DD00135E36803990C
+:1031DC005B1AAB42F2DCEBE7002504F11906F5E7CC
+:1031EC001335000824350008884210B501EB0204A1
+:1031FC0002D98442234607D8431EA14208D011F8B5
+:10320C00012B03F8012FF8E7014602448A4200D152
+:10321C0010BD13F8014D02F8014DF7E738B5002346
+:10322C00054D044608462B60FEF792F9431C02D16B
+:10323C002B6803B1236038BDCC020020034610B5C7
+:10324C00C9B202449342184601D1002003E004782D
+:10325C0001338C42F6D110BD0A44914200F1FF3388
+:10326C0000D1704710B511F8014B914203F8014F92
+:10327C00F9D110BD2DE9F041804615460C4621B917
+:10328C001146BDE8F041FFF739BC2AB9FFF7CCFB7A
+:10329C0000242046BDE8F08100F01AF8854206466D
+:1032AC0002D8B5EB500FF4D829464046FFF726FC60
+:1032BC0007460028ECD0B5422A46214628BF3246A4
+:1032CC00FFF7CAFF21464046FFF7AEFB3C46E0E75E
+:1032DC0051F8043C181F002BBCBF0B58C01870478A
+:1032EC00F8B500BFF8BC08BC9E467047F8B500BFE7
+:0832FC00F8BC08BC9E467047B7
+:10330400000000002E2E2E2E2E2E414441532E2E30
+:103314002E2E2E2E000000002E2E2E2E2E5359530C
+:1033240054454D2E2E2E2E2E0000000041444153B4
+:10333400207374617274696E672E2E004F6E204183
+:1033440044415320737065656400000042726561F6
+:103354006B696E670000000057616974696E6720CD
+:10336400666F7220202020200000000073706565C5
+:1033740064206C616E652066726565200000000043
+:1033840052656164696E672E2E2E2E2E2E2E2E2EE1
+:103394000000000053656E736F72204461746120F5
+:1033A40020202020000000005553462053656E73F2
+:1033B4006F72203D202564005553422053656E737F
+:1033C4006F72203D202564005370656564203D20A4
+:1033D4002564204B4D2F480049524C462053656EBE
+:1033E400736F723D20256400495252462053656E26
+:1033F400736F723D2025640049524C422053656E20
+:10340400736F723D20256400495252422053656E09
+:10341400736F723D202564007878787878787878AE
+:10342400787878787878787800000000456D65724F
+:1034340067656E637920787878787878780000000A
+:103444007878787878787820627265616B696E67CD
+:1034540020000000787878787878787878787878A8
+:10346400787878787800000041444153207265737D
+:1034740074617274696E67004D6F76656420746F51
+:10348400206C6566740000004D6F76696E67207469
+:103494006F20726967687400436865636B207269A2
+:1034A400676874206C616E65000000004D6F76657E
+:1034B4006420746F207269676874000073706565B6
+:1034C40064203D203930204B4D2F480073706565D2
+:1034D40064203D203530204B4D2F48000000000073
+:1034E40000000000010203040607080902030405A2
+:1034F400060708090A0B0C0D0E0F10100102232DEC
+:10350400302B2000686C4C006566674546470030E8
+:103514003132333435363738394142434445460035
+:103524003031323334353637383961626364656635
+:043534000000000093
+:0835380014CCFF7F010000002C
+:04354000310100084D
+:043544000D0100086D
+:10354800010000000024F400100000000100000049
+:10355800140000200000000094010020FC0100205D
+:1035680064020020000000000000000000000000CD
+:103578000000000000000000000000000000000043
+:103588000000000000000000000000000000000033
+:103598000000000000000000000000000000000023
+:04000005080015D505
+:00000001FF
diff --git a/Debug/ADAS.hex.asm b/Debug/ADAS.hex.asm
new file mode 100644
index 0000000..8d78017
--- /dev/null
+++ b/Debug/ADAS.hex.asm
@@ -0,0 +1 @@
+; Disassembled code
diff --git a/Debug/ADAS.list b/Debug/ADAS.list
new file mode 100644
index 0000000..4423c23
--- /dev/null
+++ b/Debug/ADAS.list
@@ -0,0 +1,7874 @@
+
+ADAS.elf: file format elf32-littlearm
+
+Sections:
+Idx Name Size VMA LMA File off Algn
+ 0 .isr_vector 0000010c 08000000 08000000 00001000 2**0
+ CONTENTS, ALLOC, LOAD, READONLY, DATA
+ 1 .text 000031f8 0800010c 0800010c 0000110c 2**2
+ CONTENTS, ALLOC, LOAD, READONLY, CODE
+ 2 .rodata 00000234 08003304 08003304 00004304 2**2
+ CONTENTS, ALLOC, LOAD, READONLY, DATA
+ 3 .ARM.extab 00000000 08003538 08003538 00005060 2**0
+ CONTENTS
+ 4 .ARM 00000008 08003538 08003538 00004538 2**2
+ CONTENTS, ALLOC, LOAD, READONLY, DATA
+ 5 .preinit_array 00000000 08003540 08003540 00005060 2**0
+ CONTENTS, ALLOC, LOAD, DATA
+ 6 .init_array 00000004 08003540 08003540 00004540 2**2
+ CONTENTS, ALLOC, LOAD, READONLY, DATA
+ 7 .fini_array 00000004 08003544 08003544 00004544 2**2
+ CONTENTS, ALLOC, LOAD, READONLY, DATA
+ 8 .data 00000060 20000000 08003548 00005000 2**2
+ CONTENTS, ALLOC, LOAD, DATA
+ 9 .bss 0000027c 20000060 080035a8 00005060 2**2
+ ALLOC
+ 10 ._user_heap_stack 00000604 200002dc 080035a8 000052dc 2**0
+ ALLOC
+ 11 .ARM.attributes 00000029 00000000 00000000 00005060 2**0
+ CONTENTS, READONLY
+ 12 .debug_info 00005e3b 00000000 00000000 00005089 2**0
+ CONTENTS, READONLY, DEBUGGING, OCTETS
+ 13 .debug_abbrev 00001771 00000000 00000000 0000aec4 2**0
+ CONTENTS, READONLY, DEBUGGING, OCTETS
+ 14 .debug_aranges 00000750 00000000 00000000 0000c638 2**3
+ CONTENTS, READONLY, DEBUGGING, OCTETS
+ 15 .debug_rnglists 0000056b 00000000 00000000 0000cd88 2**0
+ CONTENTS, READONLY, DEBUGGING, OCTETS
+ 16 .debug_macro 000170cc 00000000 00000000 0000d2f3 2**0
+ CONTENTS, READONLY, DEBUGGING, OCTETS
+ 17 .debug_line 000086aa 00000000 00000000 000243bf 2**0
+ CONTENTS, READONLY, DEBUGGING, OCTETS
+ 18 .debug_str 0007f928 00000000 00000000 0002ca69 2**0
+ CONTENTS, READONLY, DEBUGGING, OCTETS
+ 19 .comment 00000086 00000000 00000000 000ac391 2**0
+ CONTENTS, READONLY
+ 20 .debug_frame 00002090 00000000 00000000 000ac418 2**2
+ CONTENTS, READONLY, DEBUGGING, OCTETS
+ 21 .debug_line_str 000000b5 00000000 00000000 000ae4a8 2**0
+ CONTENTS, READONLY, DEBUGGING, OCTETS
+
+Disassembly of section .text:
+
+0800010c <__do_global_dtors_aux>:
+ 800010c: b510 push {r4, lr}
+ 800010e: 4c05 ldr r4, [pc, #20] @ (8000124 <__do_global_dtors_aux+0x18>)
+ 8000110: 7823 ldrb r3, [r4, #0]
+ 8000112: b933 cbnz r3, 8000122 <__do_global_dtors_aux+0x16>
+ 8000114: 4b04 ldr r3, [pc, #16] @ (8000128 <__do_global_dtors_aux+0x1c>)
+ 8000116: b113 cbz r3, 800011e <__do_global_dtors_aux+0x12>
+ 8000118: 4804 ldr r0, [pc, #16] @ (800012c <__do_global_dtors_aux+0x20>)
+ 800011a: f3af 8000 nop.w
+ 800011e: 2301 movs r3, #1
+ 8000120: 7023 strb r3, [r4, #0]
+ 8000122: bd10 pop {r4, pc}
+ 8000124: 20000060 .word 0x20000060
+ 8000128: 00000000 .word 0x00000000
+ 800012c: 080032ec .word 0x080032ec
+
+08000130 :
+ 8000130: b508 push {r3, lr}
+ 8000132: 4b03 ldr r3, [pc, #12] @ (8000140 )
+ 8000134: b11b cbz r3, 800013e
+ 8000136: 4903 ldr r1, [pc, #12] @ (8000144 )
+ 8000138: 4803 ldr r0, [pc, #12] @ (8000148 )
+ 800013a: f3af 8000 nop.w
+ 800013e: bd08 pop {r3, pc}
+ 8000140: 00000000 .word 0x00000000
+ 8000144: 20000064 .word 0x20000064
+ 8000148: 080032ec .word 0x080032ec
+
+0800014c :
+ 800014c: 4603 mov r3, r0
+ 800014e: f813 2b01 ldrb.w r2, [r3], #1
+ 8000152: 2a00 cmp r2, #0
+ 8000154: d1fb bne.n 800014e
+ 8000156: 1a18 subs r0, r3, r0
+ 8000158: 3801 subs r0, #1
+ 800015a: 4770 bx lr
+
+0800015c :
+uint8_t _numlines;
+uint8_t _row_offsets[4];
+
+void LiquidCrystal(GPIO_TypeDef *gpioport, uint16_t rs, uint16_t rw, uint16_t enable,
+ uint16_t d0, uint16_t d1, uint16_t d2, uint16_t d3)
+{
+ 800015c: b580 push {r7, lr}
+ 800015e: b08e sub sp, #56 @ 0x38
+ 8000160: af0a add r7, sp, #40 @ 0x28
+ 8000162: 60f8 str r0, [r7, #12]
+ 8000164: 4608 mov r0, r1
+ 8000166: 4611 mov r1, r2
+ 8000168: 461a mov r2, r3
+ 800016a: 4603 mov r3, r0
+ 800016c: 817b strh r3, [r7, #10]
+ 800016e: 460b mov r3, r1
+ 8000170: 813b strh r3, [r7, #8]
+ 8000172: 4613 mov r3, r2
+ 8000174: 80fb strh r3, [r7, #6]
+ if(_fourbit_mode)
+ 8000176: 4b1d ldr r3, [pc, #116] @ (80001ec )
+ 8000178: 781b ldrb r3, [r3, #0]
+ 800017a: 2b00 cmp r3, #0
+ 800017c: d019 beq.n 80001b2
+ init(1, gpioport, rs, rw, enable, d0, d1, d2, d3, 0, 0, 0, 0);
+ 800017e: 8939 ldrh r1, [r7, #8]
+ 8000180: 897a ldrh r2, [r7, #10]
+ 8000182: 2300 movs r3, #0
+ 8000184: 9308 str r3, [sp, #32]
+ 8000186: 2300 movs r3, #0
+ 8000188: 9307 str r3, [sp, #28]
+ 800018a: 2300 movs r3, #0
+ 800018c: 9306 str r3, [sp, #24]
+ 800018e: 2300 movs r3, #0
+ 8000190: 9305 str r3, [sp, #20]
+ 8000192: 8cbb ldrh r3, [r7, #36] @ 0x24
+ 8000194: 9304 str r3, [sp, #16]
+ 8000196: 8c3b ldrh r3, [r7, #32]
+ 8000198: 9303 str r3, [sp, #12]
+ 800019a: 8bbb ldrh r3, [r7, #28]
+ 800019c: 9302 str r3, [sp, #8]
+ 800019e: 8b3b ldrh r3, [r7, #24]
+ 80001a0: 9301 str r3, [sp, #4]
+ 80001a2: 88fb ldrh r3, [r7, #6]
+ 80001a4: 9300 str r3, [sp, #0]
+ 80001a6: 460b mov r3, r1
+ 80001a8: 68f9 ldr r1, [r7, #12]
+ 80001aa: 2001 movs r0, #1
+ 80001ac: f000 f820 bl 80001f0
+ else
+ init(0, gpioport, rs, rw, enable, d0, d1, d2, d3, 0, 0, 0, 0);
+}
+ 80001b0: e018 b.n 80001e4
+ init(0, gpioport, rs, rw, enable, d0, d1, d2, d3, 0, 0, 0, 0);
+ 80001b2: 8939 ldrh r1, [r7, #8]
+ 80001b4: 897a ldrh r2, [r7, #10]
+ 80001b6: 2300 movs r3, #0
+ 80001b8: 9308 str r3, [sp, #32]
+ 80001ba: 2300 movs r3, #0
+ 80001bc: 9307 str r3, [sp, #28]
+ 80001be: 2300 movs r3, #0
+ 80001c0: 9306 str r3, [sp, #24]
+ 80001c2: 2300 movs r3, #0
+ 80001c4: 9305 str r3, [sp, #20]
+ 80001c6: 8cbb ldrh r3, [r7, #36] @ 0x24
+ 80001c8: 9304 str r3, [sp, #16]
+ 80001ca: 8c3b ldrh r3, [r7, #32]
+ 80001cc: 9303 str r3, [sp, #12]
+ 80001ce: 8bbb ldrh r3, [r7, #28]
+ 80001d0: 9302 str r3, [sp, #8]
+ 80001d2: 8b3b ldrh r3, [r7, #24]
+ 80001d4: 9301 str r3, [sp, #4]
+ 80001d6: 88fb ldrh r3, [r7, #6]
+ 80001d8: 9300 str r3, [sp, #0]
+ 80001da: 460b mov r3, r1
+ 80001dc: 68f9 ldr r1, [r7, #12]
+ 80001de: 2000 movs r0, #0
+ 80001e0: f000 f806 bl 80001f0
+}
+ 80001e4: bf00 nop
+ 80001e6: 3710 adds r7, #16
+ 80001e8: 46bd mov sp, r7
+ 80001ea: bd80 pop {r7, pc}
+ 80001ec: 20000000 .word 0x20000000
+
+080001f0 :
+
+void init(uint8_t fourbitmode, GPIO_TypeDef *gpioport, uint16_t rs, uint16_t rw, uint16_t enable,
+ uint16_t d0, uint16_t d1, uint16_t d2, uint16_t d3,
+ uint16_t d4, uint16_t d5, uint16_t d6, uint16_t d7)
+{
+ 80001f0: b480 push {r7}
+ 80001f2: b085 sub sp, #20
+ 80001f4: af00 add r7, sp, #0
+ 80001f6: 60b9 str r1, [r7, #8]
+ 80001f8: 4611 mov r1, r2
+ 80001fa: 461a mov r2, r3
+ 80001fc: 4603 mov r3, r0
+ 80001fe: 73fb strb r3, [r7, #15]
+ 8000200: 460b mov r3, r1
+ 8000202: 81bb strh r3, [r7, #12]
+ 8000204: 4613 mov r3, r2
+ 8000206: 80fb strh r3, [r7, #6]
+ _rs_pin = rs;
+ 8000208: 4a19 ldr r2, [pc, #100] @ (8000270 )
+ 800020a: 89bb ldrh r3, [r7, #12]
+ 800020c: 8013 strh r3, [r2, #0]
+ _rw_pin = rw;
+ 800020e: 4a19 ldr r2, [pc, #100] @ (8000274 )
+ 8000210: 88fb ldrh r3, [r7, #6]
+ 8000212: 8013 strh r3, [r2, #0]
+ _enable_pin = enable;
+ 8000214: 4a18 ldr r2, [pc, #96] @ (8000278 )
+ 8000216: 8b3b ldrh r3, [r7, #24]
+ 8000218: 8013 strh r3, [r2, #0]
+ _port = gpioport;
+ 800021a: 4a18 ldr r2, [pc, #96] @ (800027c )
+ 800021c: 68bb ldr r3, [r7, #8]
+ 800021e: 6013 str r3, [r2, #0]
+
+ _data_pins[0] = d0;
+ 8000220: 4a17 ldr r2, [pc, #92] @ (8000280 )
+ 8000222: 8bbb ldrh r3, [r7, #28]
+ 8000224: 8013 strh r3, [r2, #0]
+ _data_pins[1] = d1;
+ 8000226: 4a16 ldr r2, [pc, #88] @ (8000280 )
+ 8000228: 8c3b ldrh r3, [r7, #32]
+ 800022a: 8053 strh r3, [r2, #2]
+ _data_pins[2] = d2;
+ 800022c: 4a14 ldr r2, [pc, #80] @ (8000280 )
+ 800022e: 8cbb ldrh r3, [r7, #36] @ 0x24
+ 8000230: 8093 strh r3, [r2, #4]
+ _data_pins[3] = d3;
+ 8000232: 4a13 ldr r2, [pc, #76] @ (8000280 )
+ 8000234: 8d3b ldrh r3, [r7, #40] @ 0x28
+ 8000236: 80d3 strh r3, [r2, #6]
+ _data_pins[4] = d4;
+ 8000238: 4a11 ldr r2, [pc, #68] @ (8000280 )
+ 800023a: 8dbb ldrh r3, [r7, #44] @ 0x2c
+ 800023c: 8113 strh r3, [r2, #8]
+ _data_pins[5] = d5;
+ 800023e: 4a10 ldr r2, [pc, #64] @ (8000280 )
+ 8000240: 8e3b ldrh r3, [r7, #48] @ 0x30
+ 8000242: 8153 strh r3, [r2, #10]
+ _data_pins[6] = d6;
+ 8000244: 4a0e ldr r2, [pc, #56] @ (8000280 )
+ 8000246: 8ebb ldrh r3, [r7, #52] @ 0x34
+ 8000248: 8193 strh r3, [r2, #12]
+ _data_pins[7] = d7;
+ 800024a: 4a0d ldr r2, [pc, #52] @ (8000280 )
+ 800024c: 8f3b ldrh r3, [r7, #56] @ 0x38
+ 800024e: 81d3 strh r3, [r2, #14]
+
+ if (fourbitmode)
+ 8000250: 7bfb ldrb r3, [r7, #15]
+ 8000252: 2b00 cmp r3, #0
+ 8000254: d003 beq.n 800025e
+ _displayfunction = LCD_4BITMODE | LCD_1LINE | LCD_5x8DOTS;
+ 8000256: 4b0b ldr r3, [pc, #44] @ (8000284 )
+ 8000258: 2200 movs r2, #0
+ 800025a: 701a strb r2, [r3, #0]
+ else
+ _displayfunction = LCD_8BITMODE | LCD_1LINE | LCD_5x8DOTS;
+
+ // begin(16, 2);
+}
+ 800025c: e002 b.n 8000264
+ _displayfunction = LCD_8BITMODE | LCD_1LINE | LCD_5x8DOTS;
+ 800025e: 4b09 ldr r3, [pc, #36] @ (8000284 )
+ 8000260: 2210 movs r2, #16
+ 8000262: 701a strb r2, [r3, #0]
+}
+ 8000264: bf00 nop
+ 8000266: 3714 adds r7, #20
+ 8000268: 46bd mov sp, r7
+ 800026a: bc80 pop {r7}
+ 800026c: 4770 bx lr
+ 800026e: bf00 nop
+ 8000270: 2000007e .word 0x2000007e
+ 8000274: 20000080 .word 0x20000080
+ 8000278: 20000082 .word 0x20000082
+ 800027c: 20000094 .word 0x20000094
+ 8000280: 20000084 .word 0x20000084
+ 8000284: 20000098 .word 0x20000098
+
+08000288 :
+
+void begin(uint8_t cols, uint8_t lines) {
+ 8000288: b580 push {r7, lr}
+ 800028a: b086 sub sp, #24
+ 800028c: af00 add r7, sp, #0
+ 800028e: 4603 mov r3, r0
+ 8000290: 460a mov r2, r1
+ 8000292: 71fb strb r3, [r7, #7]
+ 8000294: 4613 mov r3, r2
+ 8000296: 71bb strb r3, [r7, #6]
+ if (lines > 1) {
+ 8000298: 79bb ldrb r3, [r7, #6]
+ 800029a: 2b01 cmp r3, #1
+ 800029c: d906 bls.n 80002ac
+ _displayfunction |= LCD_2LINE;
+ 800029e: 4b73 ldr r3, [pc, #460] @ (800046c )
+ 80002a0: 781b ldrb r3, [r3, #0]
+ 80002a2: f043 0308 orr.w r3, r3, #8
+ 80002a6: b2da uxtb r2, r3
+ 80002a8: 4b70 ldr r3, [pc, #448] @ (800046c )
+ 80002aa: 701a strb r2, [r3, #0]
+ }
+ _numlines = lines;
+ 80002ac: 4a70 ldr r2, [pc, #448] @ (8000470 )
+ 80002ae: 79bb ldrb r3, [r7, #6]
+ 80002b0: 7013 strb r3, [r2, #0]
+
+ setRowOffsets(0x00, 0x40, 0x00 + cols, 0x40 + cols);
+ 80002b2: 79fa ldrb r2, [r7, #7]
+ 80002b4: 79fb ldrb r3, [r7, #7]
+ 80002b6: 3340 adds r3, #64 @ 0x40
+ 80002b8: 2140 movs r1, #64 @ 0x40
+ 80002ba: 2000 movs r0, #0
+ 80002bc: f000 f95a bl 8000574
+
+ // for some 1 line displays you can select a 10 pixel high font
+ if ((dotsize != LCD_5x8DOTS) && (lines == 1)) {
+ 80002c0: 4b6c ldr r3, [pc, #432] @ (8000474 )
+ 80002c2: 781b ldrb r3, [r3, #0]
+ 80002c4: 2b00 cmp r3, #0
+ 80002c6: d009 beq.n 80002dc
+ 80002c8: 79bb ldrb r3, [r7, #6]
+ 80002ca: 2b01 cmp r3, #1
+ 80002cc: d106 bne.n 80002dc
+ _displayfunction |= LCD_5x10DOTS;
+ 80002ce: 4b67 ldr r3, [pc, #412] @ (800046c )
+ 80002d0: 781b ldrb r3, [r3, #0]
+ 80002d2: f043 0304 orr.w r3, r3, #4
+ 80002d6: b2da uxtb r2, r3
+ 80002d8: 4b64 ldr r3, [pc, #400] @ (800046c )
+ 80002da: 701a strb r2, [r3, #0]
+ }
+
+ //Initializing GPIO Pins
+ enableClock();
+ 80002dc: f000 f8dc bl 8000498
+
+ GPIO_InitTypeDef gpio_init;
+ gpio_init.Speed = GPIO_SPEED_FREQ_HIGH;
+ 80002e0: 2303 movs r3, #3
+ 80002e2: 617b str r3, [r7, #20]
+ gpio_init.Mode = GPIO_MODE_OUTPUT_PP;
+ 80002e4: 2301 movs r3, #1
+ 80002e6: 60fb str r3, [r7, #12]
+
+ if(_fourbit_mode)
+ 80002e8: 4b63 ldr r3, [pc, #396] @ (8000478 )
+ 80002ea: 781b ldrb r3, [r3, #0]
+ 80002ec: 2b00 cmp r3, #0
+ 80002ee: d01b beq.n 8000328
+ gpio_init.Pin = _rs_pin | _rw_pin | _enable_pin | _data_pins[0] | _data_pins[1] | _data_pins[2] | _data_pins[3];
+ 80002f0: 4b62 ldr r3, [pc, #392] @ (800047c )
+ 80002f2: 881a ldrh r2, [r3, #0]
+ 80002f4: 4b62 ldr r3, [pc, #392] @ (8000480 )
+ 80002f6: 881b ldrh r3, [r3, #0]
+ 80002f8: 4313 orrs r3, r2
+ 80002fa: b29a uxth r2, r3
+ 80002fc: 4b61 ldr r3, [pc, #388] @ (8000484 )
+ 80002fe: 881b ldrh r3, [r3, #0]
+ 8000300: 4313 orrs r3, r2
+ 8000302: b29a uxth r2, r3
+ 8000304: 4b60 ldr r3, [pc, #384] @ (8000488 )
+ 8000306: 881b ldrh r3, [r3, #0]
+ 8000308: 4313 orrs r3, r2
+ 800030a: b29a uxth r2, r3
+ 800030c: 4b5e ldr r3, [pc, #376] @ (8000488 )
+ 800030e: 885b ldrh r3, [r3, #2]
+ 8000310: 4313 orrs r3, r2
+ 8000312: b29a uxth r2, r3
+ 8000314: 4b5c ldr r3, [pc, #368] @ (8000488 )
+ 8000316: 889b ldrh r3, [r3, #4]
+ 8000318: 4313 orrs r3, r2
+ 800031a: b29a uxth r2, r3
+ 800031c: 4b5a ldr r3, [pc, #360] @ (8000488 )
+ 800031e: 88db ldrh r3, [r3, #6]
+ 8000320: 4313 orrs r3, r2
+ 8000322: b29b uxth r3, r3
+ 8000324: 60bb str r3, [r7, #8]
+ 8000326: e02a b.n 800037e
+ else
+ gpio_init.Pin = _rs_pin | _rw_pin | _enable_pin | _data_pins[0] | _data_pins[1] | _data_pins[2] | _data_pins[3] |
+ _data_pins[4] | _data_pins[5] | _data_pins[6] | _data_pins[7];
+ 8000328: 4b54 ldr r3, [pc, #336] @ (800047c )
+ 800032a: 881a ldrh r2, [r3, #0]
+ 800032c: 4b54 ldr r3, [pc, #336] @ (8000480 )
+ 800032e: 881b ldrh r3, [r3, #0]
+ 8000330: 4313 orrs r3, r2
+ 8000332: b29a uxth r2, r3
+ 8000334: 4b53 ldr r3, [pc, #332] @ (8000484 )
+ 8000336: 881b ldrh r3, [r3, #0]
+ 8000338: 4313 orrs r3, r2
+ 800033a: b29a uxth r2, r3
+ gpio_init.Pin = _rs_pin | _rw_pin | _enable_pin | _data_pins[0] | _data_pins[1] | _data_pins[2] | _data_pins[3] |
+ 800033c: 4b52 ldr r3, [pc, #328] @ (8000488 )
+ 800033e: 881b ldrh r3, [r3, #0]
+ _data_pins[4] | _data_pins[5] | _data_pins[6] | _data_pins[7];
+ 8000340: 4313 orrs r3, r2
+ 8000342: b29a uxth r2, r3
+ gpio_init.Pin = _rs_pin | _rw_pin | _enable_pin | _data_pins[0] | _data_pins[1] | _data_pins[2] | _data_pins[3] |
+ 8000344: 4b50 ldr r3, [pc, #320] @ (8000488 )
+ 8000346: 885b ldrh r3, [r3, #2]
+ _data_pins[4] | _data_pins[5] | _data_pins[6] | _data_pins[7];
+ 8000348: 4313 orrs r3, r2
+ 800034a: b29a uxth r2, r3
+ gpio_init.Pin = _rs_pin | _rw_pin | _enable_pin | _data_pins[0] | _data_pins[1] | _data_pins[2] | _data_pins[3] |
+ 800034c: 4b4e ldr r3, [pc, #312] @ (8000488 )
+ 800034e: 889b ldrh r3, [r3, #4]
+ _data_pins[4] | _data_pins[5] | _data_pins[6] | _data_pins[7];
+ 8000350: 4313 orrs r3, r2
+ 8000352: b29a uxth r2, r3
+ gpio_init.Pin = _rs_pin | _rw_pin | _enable_pin | _data_pins[0] | _data_pins[1] | _data_pins[2] | _data_pins[3] |
+ 8000354: 4b4c ldr r3, [pc, #304] @ (8000488 )
+ 8000356: 88db ldrh r3, [r3, #6]
+ _data_pins[4] | _data_pins[5] | _data_pins[6] | _data_pins[7];
+ 8000358: 4313 orrs r3, r2
+ 800035a: b29a uxth r2, r3
+ 800035c: 4b4a ldr r3, [pc, #296] @ (8000488 )
+ 800035e: 891b ldrh r3, [r3, #8]
+ 8000360: 4313 orrs r3, r2
+ 8000362: b29a uxth r2, r3
+ 8000364: 4b48 ldr r3, [pc, #288] @ (8000488 )
+ 8000366: 895b ldrh r3, [r3, #10]
+ 8000368: 4313 orrs r3, r2
+ 800036a: b29a uxth r2, r3
+ 800036c: 4b46 ldr r3, [pc, #280] @ (8000488 )
+ 800036e: 899b ldrh r3, [r3, #12]
+ 8000370: 4313 orrs r3, r2
+ 8000372: b29a uxth r2, r3
+ 8000374: 4b44 ldr r3, [pc, #272] @ (8000488 )
+ 8000376: 89db ldrh r3, [r3, #14]
+ 8000378: 4313 orrs r3, r2
+ 800037a: b29b uxth r3, r3
+ gpio_init.Pin = _rs_pin | _rw_pin | _enable_pin | _data_pins[0] | _data_pins[1] | _data_pins[2] | _data_pins[3] |
+ 800037c: 60bb str r3, [r7, #8]
+// SEE PAGE 45/46 FOR INITIALIZATION SPECIFICATION!
+// according to datasheet, we need at least 40ms after power rises above 2.7V
+// so we'll wait 50 just to make sure
+ HAL_Delay(50);
+ 800037e: 2032 movs r0, #50 @ 0x32
+ 8000380: f001 f9b0 bl 80016e4
+
+ // Now we pull both RS and R/W low to begin commands
+ HAL_GPIO_WritePin(_port, _rs_pin, GPIO_PIN_RESET);
+ 8000384: 4b41 ldr r3, [pc, #260] @ (800048c )
+ 8000386: 681b ldr r3, [r3, #0]
+ 8000388: 4a3c ldr r2, [pc, #240] @ (800047c )
+ 800038a: 8811 ldrh r1, [r2, #0]
+ 800038c: 2200 movs r2, #0
+ 800038e: 4618 mov r0, r3
+ 8000390: f001 fc2c bl 8001bec
+ HAL_GPIO_WritePin(_port, _enable_pin, GPIO_PIN_RESET);
+ 8000394: 4b3d ldr r3, [pc, #244] @ (800048c )
+ 8000396: 681b ldr r3, [r3, #0]
+ 8000398: 4a3a ldr r2, [pc, #232] @ (8000484 )
+ 800039a: 8811 ldrh r1, [r2, #0]
+ 800039c: 2200 movs r2, #0
+ 800039e: 4618 mov r0, r3
+ 80003a0: f001 fc24 bl 8001bec
+
+ if (_rw_pin != 255) {
+ 80003a4: 4b36 ldr r3, [pc, #216] @ (8000480 )
+ 80003a6: 881b ldrh r3, [r3, #0]
+ 80003a8: 2bff cmp r3, #255 @ 0xff
+ 80003aa: d007 beq.n 80003bc
+ HAL_GPIO_WritePin(_port, _rw_pin, GPIO_PIN_RESET);
+ 80003ac: 4b37 ldr r3, [pc, #220] @ (800048c )
+ 80003ae: 681b ldr r3, [r3, #0]
+ 80003b0: 4a33 ldr r2, [pc, #204] @ (8000480 )
+ 80003b2: 8811 ldrh r1, [r2, #0]
+ 80003b4: 2200 movs r2, #0
+ 80003b6: 4618 mov r0, r3
+ 80003b8: f001 fc18 bl 8001bec
+ }
+
+ //put the LCD into 4 bit or 8 bit mode
+ if (! (_displayfunction & LCD_8BITMODE)) {
+ 80003bc: 4b2b ldr r3, [pc, #172] @ (800046c )
+ 80003be: 781b ldrb r3, [r3, #0]
+ 80003c0: f003 0310 and.w r3, r3, #16
+ 80003c4: 2b00 cmp r3, #0
+ 80003c6: d115 bne.n 80003f4
+ // this is according to the hitachi HD44780 datasheet
+ // figure 24, pg 46
+
+ // we start in 8bit mode, try to set 4 bit mode
+ write4bits(0x03);
+ 80003c8: 2003 movs r0, #3
+ 80003ca: f000 f9f3 bl 80007b4
+ HAL_Delay(5); // wait min 4.1ms
+ 80003ce: 2005 movs r0, #5
+ 80003d0: f001 f988 bl 80016e4
+
+ // second try
+ write4bits(0x03);
+ 80003d4: 2003 movs r0, #3
+ 80003d6: f000 f9ed bl 80007b4
+ HAL_Delay(5); // wait min 4.1ms
+ 80003da: 2005 movs r0, #5
+ 80003dc: f001 f982 bl 80016e4
+
+ // third go!
+ write4bits(0x03);
+ 80003e0: 2003 movs r0, #3
+ 80003e2: f000 f9e7 bl 80007b4
+ HAL_Delay(1);
+ 80003e6: 2001 movs r0, #1
+ 80003e8: f001 f97c bl 80016e4
+
+ // finally, set to 4-bit interface
+ write4bits(0x02);
+ 80003ec: 2002 movs r0, #2
+ 80003ee: f000 f9e1 bl 80007b4
+ 80003f2: e01d b.n 8000430
+ } else {
+ // this is according to the hitachi HD44780 datasheet
+ // page 45 figure 23
+
+ // Send function set command sequence
+ command(LCD_FUNCTIONSET | _displayfunction);
+ 80003f4: 4b1d ldr r3, [pc, #116] @ (800046c )
+ 80003f6: 781b ldrb r3, [r3, #0]
+ 80003f8: f043 0320 orr.w r3, r3, #32
+ 80003fc: b2db uxtb r3, r3
+ 80003fe: 4618 mov r0, r3
+ 8000400: f000 f953 bl 80006aa
+ HAL_Delay(5); // wait more than 4.1ms
+ 8000404: 2005 movs r0, #5
+ 8000406: f001 f96d bl 80016e4
+
+ // second try
+ command(LCD_FUNCTIONSET | _displayfunction);
+ 800040a: 4b18 ldr r3, [pc, #96] @ (800046c )
+ 800040c: 781b ldrb r3, [r3, #0]
+ 800040e: f043 0320 orr.w r3, r3, #32
+ 8000412: b2db uxtb r3, r3
+ 8000414: 4618 mov r0, r3
+ 8000416: f000 f948 bl 80006aa
+ HAL_Delay(1);
+ 800041a: 2001 movs r0, #1
+ 800041c: f001 f962 bl 80016e4
+
+ // third go
+ command(LCD_FUNCTIONSET | _displayfunction);
+ 8000420: 4b12 ldr r3, [pc, #72] @ (800046c )
+ 8000422: 781b ldrb r3, [r3, #0]
+ 8000424: f043 0320 orr.w r3, r3, #32
+ 8000428: b2db uxtb r3, r3
+ 800042a: 4618 mov r0, r3
+ 800042c: f000 f93d bl 80006aa
+ }
+
+ // finally, set # lines, font size, etc.
+ command(LCD_FUNCTIONSET | _displayfunction);
+ 8000430: 4b0e ldr r3, [pc, #56] @ (800046c )
+ 8000432: 781b ldrb r3, [r3, #0]
+ 8000434: f043 0320 orr.w r3, r3, #32
+ 8000438: b2db uxtb r3, r3
+ 800043a: 4618 mov r0, r3
+ 800043c: f000 f935 bl 80006aa
+
+ // turn the display on with no cursor or blinking default
+ _displaycontrol = LCD_DISPLAYON | LCD_CURSOROFF | LCD_BLINKOFF;
+ 8000440: 4b13 ldr r3, [pc, #76] @ (8000490 )
+ 8000442: 2204 movs r2, #4
+ 8000444: 701a strb r2, [r3, #0]
+ display();
+ 8000446: f000 f8ef bl 8000628
+
+ // clear it off
+ clear();
+ 800044a: f000 f8b1 bl 80005b0
+
+ // Initialize to default text direction (for romance languages)
+ _displaymode = LCD_ENTRYLEFT | LCD_ENTRYSHIFTDECREMENT;
+ 800044e: 4b11 ldr r3, [pc, #68] @ (8000494 )
+ 8000450: 2202 movs r2, #2
+ 8000452: 701a strb r2, [r3, #0]
+ // set the entry mode
+ command(LCD_ENTRYMODESET | _displaymode);
+ 8000454: 4b0f ldr r3, [pc, #60] @ (8000494 )
+ 8000456: 781b ldrb r3, [r3, #0]
+ 8000458: f043 0304 orr.w r3, r3, #4
+ 800045c: b2db uxtb r3, r3
+ 800045e: 4618 mov r0, r3
+ 8000460: f000 f923 bl 80006aa
+
+}
+ 8000464: bf00 nop
+ 8000466: 3718 adds r7, #24
+ 8000468: 46bd mov sp, r7
+ 800046a: bd80 pop {r7, pc}
+ 800046c: 20000098 .word 0x20000098
+ 8000470: 2000009b .word 0x2000009b
+ 8000474: 2000007c .word 0x2000007c
+ 8000478: 20000000 .word 0x20000000
+ 800047c: 2000007e .word 0x2000007e
+ 8000480: 20000080 .word 0x20000080
+ 8000484: 20000082 .word 0x20000082
+ 8000488: 20000084 .word 0x20000084
+ 800048c: 20000094 .word 0x20000094
+ 8000490: 20000099 .word 0x20000099
+ 8000494: 2000009a .word 0x2000009a
+
+08000498 :
+
+// enables GPIO RCC Clock
+void enableClock(void)
+{
+ 8000498: b480 push {r7}
+ 800049a: b087 sub sp, #28
+ 800049c: af00 add r7, sp, #0
+ if(_port == GPIOA)
+ 800049e: 4b2f ldr r3, [pc, #188] @ (800055c )
+ 80004a0: 681b ldr r3, [r3, #0]
+ 80004a2: 4a2f ldr r2, [pc, #188] @ (8000560 )
+ 80004a4: 4293 cmp r3, r2
+ 80004a6: d10c bne.n 80004c2
+ __HAL_RCC_GPIOA_CLK_ENABLE();
+ 80004a8: 4b2e ldr r3, [pc, #184] @ (8000564 )
+ 80004aa: 699b ldr r3, [r3, #24]
+ 80004ac: 4a2d ldr r2, [pc, #180] @ (8000564 )
+ 80004ae: f043 0304 orr.w r3, r3, #4
+ 80004b2: 6193 str r3, [r2, #24]
+ 80004b4: 4b2b ldr r3, [pc, #172] @ (8000564 )
+ 80004b6: 699b ldr r3, [r3, #24]
+ 80004b8: f003 0304 and.w r3, r3, #4
+ 80004bc: 617b str r3, [r7, #20]
+ 80004be: 697b ldr r3, [r7, #20]
+ __HAL_RCC_GPIOC_CLK_ENABLE();
+ else if(_port == GPIOD)
+ __HAL_RCC_GPIOD_CLK_ENABLE();
+
+ // if you have a port that is not listed add it below the other else ifs
+}
+ 80004c0: e046 b.n 8000550
+ else if(_port == GPIOB)
+ 80004c2: 4b26 ldr r3, [pc, #152] @ (800055c )
+ 80004c4: 681b ldr r3, [r3, #0]
+ 80004c6: 4a28 ldr r2, [pc, #160] @ (8000568 )
+ 80004c8: 4293 cmp r3, r2
+ 80004ca: d10c bne.n 80004e6
+ __HAL_RCC_GPIOB_CLK_ENABLE();
+ 80004cc: 4b25 ldr r3, [pc, #148] @ (8000564 )
+ 80004ce: 699b ldr r3, [r3, #24]
+ 80004d0: 4a24 ldr r2, [pc, #144] @ (8000564 )
+ 80004d2: f043 0308 orr.w r3, r3, #8
+ 80004d6: 6193 str r3, [r2, #24]
+ 80004d8: 4b22 ldr r3, [pc, #136] @ (8000564 )
+ 80004da: 699b ldr r3, [r3, #24]
+ 80004dc: f003 0308 and.w r3, r3, #8
+ 80004e0: 613b str r3, [r7, #16]
+ 80004e2: 693b ldr r3, [r7, #16]
+}
+ 80004e4: e034 b.n 8000550
+ else if(_port == GPIOB)
+ 80004e6: 4b1d ldr r3, [pc, #116] @ (800055c )
+ 80004e8: 681b ldr r3, [r3, #0]
+ 80004ea: 4a1f ldr r2, [pc, #124] @ (8000568 )
+ 80004ec: 4293 cmp r3, r2
+ 80004ee: d10c bne.n 800050a
+ __HAL_RCC_GPIOB_CLK_ENABLE();
+ 80004f0: 4b1c ldr r3, [pc, #112] @ (8000564 )
+ 80004f2: 699b ldr r3, [r3, #24]
+ 80004f4: 4a1b ldr r2, [pc, #108] @ (8000564 )
+ 80004f6: f043 0308 orr.w r3, r3, #8
+ 80004fa: 6193 str r3, [r2, #24]
+ 80004fc: 4b19 ldr r3, [pc, #100] @ (8000564 )
+ 80004fe: 699b ldr r3, [r3, #24]
+ 8000500: f003 0308 and.w r3, r3, #8
+ 8000504: 60fb str r3, [r7, #12]
+ 8000506: 68fb ldr r3, [r7, #12]
+}
+ 8000508: e022 b.n 8000550
+ else if(_port == GPIOC)
+ 800050a: 4b14 ldr r3, [pc, #80] @ (800055c )
+ 800050c: 681b ldr r3, [r3, #0]
+ 800050e: 4a17 ldr r2, [pc, #92] @ (800056c )
+ 8000510: 4293 cmp r3, r2
+ 8000512: d10c bne.n 800052e
+ __HAL_RCC_GPIOC_CLK_ENABLE();
+ 8000514: 4b13 ldr r3, [pc, #76] @ (8000564 )
+ 8000516: 699b ldr r3, [r3, #24]
+ 8000518: 4a12 ldr r2, [pc, #72] @ (8000564 )
+ 800051a: f043 0310 orr.w r3, r3, #16
+ 800051e: 6193 str r3, [r2, #24]
+ 8000520: 4b10 ldr r3, [pc, #64] @ (8000564 )
+ 8000522: 699b ldr r3, [r3, #24]
+ 8000524: f003 0310 and.w r3, r3, #16
+ 8000528: 60bb str r3, [r7, #8]
+ 800052a: 68bb ldr r3, [r7, #8]
+}
+ 800052c: e010 b.n 8000550
+ else if(_port == GPIOD)
+ 800052e: 4b0b ldr r3, [pc, #44] @ (800055c )
+ 8000530: 681b ldr r3, [r3, #0]
+ 8000532: 4a0f ldr r2, [pc, #60] @ (8000570 )
+ 8000534: 4293 cmp r3, r2
+ 8000536: d10b bne.n 8000550
+ __HAL_RCC_GPIOD_CLK_ENABLE();
+ 8000538: 4b0a ldr r3, [pc, #40] @ (8000564 )
+ 800053a: 699b ldr r3, [r3, #24]
+ 800053c: 4a09 ldr r2, [pc, #36] @ (8000564 )
+ 800053e: f043 0320 orr.w r3, r3, #32
+ 8000542: 6193 str r3, [r2, #24]
+ 8000544: 4b07 ldr r3, [pc, #28] @ (8000564 )
+ 8000546: 699b ldr r3, [r3, #24]
+ 8000548: f003 0320 and.w r3, r3, #32
+ 800054c: 607b str r3, [r7, #4]
+ 800054e: 687b ldr r3, [r7, #4]
+}
+ 8000550: bf00 nop
+ 8000552: 371c adds r7, #28
+ 8000554: 46bd mov sp, r7
+ 8000556: bc80 pop {r7}
+ 8000558: 4770 bx lr
+ 800055a: bf00 nop
+ 800055c: 20000094 .word 0x20000094
+ 8000560: 40010800 .word 0x40010800
+ 8000564: 40021000 .word 0x40021000
+ 8000568: 40010c00 .word 0x40010c00
+ 800056c: 40011000 .word 0x40011000
+ 8000570: 40011400 .word 0x40011400
+
+08000574 :
+
+void setRowOffsets(int row0, int row1, int row2, int row3)
+{
+ 8000574: b480 push {r7}
+ 8000576: b085 sub sp, #20
+ 8000578: af00 add r7, sp, #0
+ 800057a: 60f8 str r0, [r7, #12]
+ 800057c: 60b9 str r1, [r7, #8]
+ 800057e: 607a str r2, [r7, #4]
+ 8000580: 603b str r3, [r7, #0]
+ _row_offsets[0] = row0;
+ 8000582: 68fb ldr r3, [r7, #12]
+ 8000584: b2da uxtb r2, r3
+ 8000586: 4b09 ldr r3, [pc, #36] @ (80005ac )
+ 8000588: 701a strb r2, [r3, #0]
+ _row_offsets[1] = row1;
+ 800058a: 68bb ldr r3, [r7, #8]
+ 800058c: b2da uxtb r2, r3
+ 800058e: 4b07 ldr r3, [pc, #28] @ (80005ac )
+ 8000590: 705a strb r2, [r3, #1]
+ _row_offsets[2] = row2;
+ 8000592: 687b ldr r3, [r7, #4]
+ 8000594: b2da uxtb r2, r3
+ 8000596: 4b05 ldr r3, [pc, #20] @ (80005ac )
+ 8000598: 709a strb r2, [r3, #2]
+ _row_offsets[3] = row3;
+ 800059a: 683b ldr r3, [r7, #0]
+ 800059c: b2da uxtb r2, r3
+ 800059e: 4b03 ldr r3, [pc, #12] @ (80005ac )
+ 80005a0: 70da strb r2, [r3, #3]
+}
+ 80005a2: bf00 nop
+ 80005a4: 3714 adds r7, #20
+ 80005a6: 46bd mov sp, r7
+ 80005a8: bc80 pop {r7}
+ 80005aa: 4770 bx lr
+ 80005ac: 2000009c .word 0x2000009c
+
+080005b0 :
+
+/********** high level commands, for the user! */
+void clear(void)
+{
+ 80005b0: b580 push {r7, lr}
+ 80005b2: af00 add r7, sp, #0
+ command(LCD_CLEARDISPLAY); // clear display, set cursor position to zero
+ 80005b4: 2001 movs r0, #1
+ 80005b6: f000 f878 bl 80006aa
+ HAL_Delay(2); // this command takes a long time!
+ 80005ba: 2002 movs r0, #2
+ 80005bc: f001 f892 bl 80016e4
+}
+ 80005c0: bf00 nop
+ 80005c2: bd80 pop {r7, pc}
+
+080005c4 :
+ command(LCD_RETURNHOME); // set cursor position to zero
+ HAL_Delay(2); // this command takes a long time!
+}
+
+void setCursor(uint8_t col, uint8_t row)
+{
+ 80005c4: b580 push {r7, lr}
+ 80005c6: b084 sub sp, #16
+ 80005c8: af00 add r7, sp, #0
+ 80005ca: 4603 mov r3, r0
+ 80005cc: 460a mov r2, r1
+ 80005ce: 71fb strb r3, [r7, #7]
+ 80005d0: 4613 mov r3, r2
+ 80005d2: 71bb strb r3, [r7, #6]
+ const size_t max_lines = sizeof(_row_offsets) / sizeof(*_row_offsets);
+ 80005d4: 2304 movs r3, #4
+ 80005d6: 60fb str r3, [r7, #12]
+ if ( row >= max_lines ) {
+ 80005d8: 79bb ldrb r3, [r7, #6]
+ 80005da: 68fa ldr r2, [r7, #12]
+ 80005dc: 429a cmp r2, r3
+ 80005de: d803 bhi.n 80005e8
+ row = max_lines - 1; // we count rows starting w/0
+ 80005e0: 68fb ldr r3, [r7, #12]
+ 80005e2: b2db uxtb r3, r3
+ 80005e4: 3b01 subs r3, #1
+ 80005e6: 71bb strb r3, [r7, #6]
+ }
+ if ( row >= _numlines ) {
+ 80005e8: 4b0d ldr r3, [pc, #52] @ (8000620 )
+ 80005ea: 781b ldrb r3, [r3, #0]
+ 80005ec: 79ba ldrb r2, [r7, #6]
+ 80005ee: 429a cmp r2, r3
+ 80005f0: d303 bcc.n 80005fa
+ row = _numlines - 1; // we count rows starting w/0
+ 80005f2: 4b0b ldr r3, [pc, #44] @ (8000620 )
+ 80005f4: 781b ldrb r3, [r3, #0]
+ 80005f6: 3b01 subs r3, #1
+ 80005f8: 71bb strb r3, [r7, #6]
+ }
+
+ command(LCD_SETDDRAMADDR | (col + _row_offsets[row]));
+ 80005fa: 79bb ldrb r3, [r7, #6]
+ 80005fc: 4a09 ldr r2, [pc, #36] @ (8000624 )
+ 80005fe: 5cd2 ldrb r2, [r2, r3]
+ 8000600: 79fb ldrb r3, [r7, #7]
+ 8000602: 4413 add r3, r2
+ 8000604: b2db uxtb r3, r3
+ 8000606: b25b sxtb r3, r3
+ 8000608: f063 037f orn r3, r3, #127 @ 0x7f
+ 800060c: b25b sxtb r3, r3
+ 800060e: b2db uxtb r3, r3
+ 8000610: 4618 mov r0, r3
+ 8000612: f000 f84a bl 80006aa
+}
+ 8000616: bf00 nop
+ 8000618: 3710 adds r7, #16
+ 800061a: 46bd mov sp, r7
+ 800061c: bd80 pop {r7, pc}
+ 800061e: bf00 nop
+ 8000620: 2000009b .word 0x2000009b
+ 8000624: 2000009c .word 0x2000009c
+
+08000628 :
+// Turn the display on/off (quickly)
+void noDisplay(void) {
+ _displaycontrol &= ~LCD_DISPLAYON;
+ command(LCD_DISPLAYCONTROL | _displaycontrol);
+}
+void display(void) {
+ 8000628: b580 push {r7, lr}
+ 800062a: af00 add r7, sp, #0
+ _displaycontrol |= LCD_DISPLAYON;
+ 800062c: 4b08 ldr r3, [pc, #32] @ (8000650 )
+ 800062e: 781b ldrb r3, [r3, #0]
+ 8000630: f043 0304 orr.w r3, r3, #4
+ 8000634: b2da uxtb r2, r3
+ 8000636: 4b06 ldr r3, [pc, #24] @ (8000650 )
+ 8000638: 701a strb r2, [r3, #0]
+ command(LCD_DISPLAYCONTROL | _displaycontrol);
+ 800063a: 4b05 ldr r3, [pc, #20] @ (8000650 )
+ 800063c: 781b ldrb r3, [r3, #0]
+ 800063e: f043 0308 orr.w r3, r3, #8
+ 8000642: b2db uxtb r3, r3
+ 8000644: 4618 mov r0, r3
+ 8000646: f000 f830 bl 80006aa
+}
+ 800064a: bf00 nop
+ 800064c: bd80 pop {r7, pc}
+ 800064e: bf00 nop
+ 8000650: 20000099 .word 0x20000099
+
+08000654 :
+ _displaymode &= ~LCD_ENTRYSHIFTINCREMENT;
+ command(LCD_ENTRYMODESET | _displaymode);
+}
+
+// This will print character string to the LCD
+size_t print(const char str[]) {
+ 8000654: b580 push {r7, lr}
+ 8000656: b086 sub sp, #24
+ 8000658: af00 add r7, sp, #0
+ 800065a: 6078 str r0, [r7, #4]
+ if (str == NULL) return 0;
+ 800065c: 687b ldr r3, [r7, #4]
+ 800065e: 2b00 cmp r3, #0
+ 8000660: d101 bne.n 8000666
+ 8000662: 2300 movs r3, #0
+ 8000664: e01d b.n 80006a2
+
+ const uint8_t *buffer = (const uint8_t *)str;
+ 8000666: 687b ldr r3, [r7, #4]
+ 8000668: 617b str r3, [r7, #20]
+ size_t size = strlen(str);
+ 800066a: 6878 ldr r0, [r7, #4]
+ 800066c: f7ff fd6e bl 800014c
+ 8000670: 6138 str r0, [r7, #16]
+ size_t n = 0;
+ 8000672: 2300 movs r3, #0
+ 8000674: 60fb str r3, [r7, #12]
+
+ while (size--) {
+ 8000676: e00c b.n 8000692
+ if (write(*buffer++)) n++;
+ 8000678: 697b ldr r3, [r7, #20]
+ 800067a: 1c5a adds r2, r3, #1
+ 800067c: 617a str r2, [r7, #20]
+ 800067e: 781b ldrb r3, [r3, #0]
+ 8000680: 4618 mov r0, r3
+ 8000682: f000 f820 bl 80006c6
+ 8000686: 4603 mov r3, r0
+ 8000688: 2b00 cmp r3, #0
+ 800068a: d008 beq.n 800069e
+ 800068c: 68fb ldr r3, [r7, #12]
+ 800068e: 3301 adds r3, #1
+ 8000690: 60fb str r3, [r7, #12]
+ while (size--) {
+ 8000692: 693b ldr r3, [r7, #16]
+ 8000694: 1e5a subs r2, r3, #1
+ 8000696: 613a str r2, [r7, #16]
+ 8000698: 2b00 cmp r3, #0
+ 800069a: d1ed bne.n 8000678
+ 800069c: e000 b.n 80006a0
+ else break;
+ 800069e: bf00 nop
+ }
+ return n;
+ 80006a0: 68fb ldr r3, [r7, #12]
+}
+ 80006a2: 4618 mov r0, r3
+ 80006a4: 3718 adds r7, #24
+ 80006a6: 46bd mov sp, r7
+ 80006a8: bd80 pop {r7, pc}
+
+080006aa :
+ }
+}
+
+/*********** mid level commands, for sending data/cmds */
+
+inline void command(uint8_t value) {
+ 80006aa: b580 push {r7, lr}
+ 80006ac: b082 sub sp, #8
+ 80006ae: af00 add r7, sp, #0
+ 80006b0: 4603 mov r3, r0
+ 80006b2: 71fb strb r3, [r7, #7]
+ send(value, GPIO_PIN_RESET);
+ 80006b4: 79fb ldrb r3, [r7, #7]
+ 80006b6: 2100 movs r1, #0
+ 80006b8: 4618 mov r0, r3
+ 80006ba: f000 f813 bl 80006e4
+}
+ 80006be: bf00 nop
+ 80006c0: 3708 adds r7, #8
+ 80006c2: 46bd mov sp, r7
+ 80006c4: bd80 pop {r7, pc}
+
+080006c6 :
+
+inline size_t write(uint8_t value) {
+ 80006c6: b580 push {r7, lr}
+ 80006c8: b082 sub sp, #8
+ 80006ca: af00 add r7, sp, #0
+ 80006cc: 4603 mov r3, r0
+ 80006ce: 71fb strb r3, [r7, #7]
+ send(value, GPIO_PIN_SET);
+ 80006d0: 79fb ldrb r3, [r7, #7]
+ 80006d2: 2101 movs r1, #1
+ 80006d4: 4618 mov r0, r3
+ 80006d6: f000 f805 bl 80006e4
+ return 1; // assume sucess
+ 80006da: 2301 movs r3, #1
+}
+ 80006dc: 4618 mov r0, r3
+ 80006de: 3708 adds r7, #8
+ 80006e0: 46bd mov sp, r7
+ 80006e2: bd80 pop {r7, pc}
+
+080006e4 :
+
+/************ low level data pushing commands **********/
+
+// write either command or data, with automatic 4/8-bit selection
+void send(uint8_t value, GPIO_PinState mode) {
+ 80006e4: b580 push {r7, lr}
+ 80006e6: b082 sub sp, #8
+ 80006e8: af00 add r7, sp, #0
+ 80006ea: 4603 mov r3, r0
+ 80006ec: 460a mov r2, r1
+ 80006ee: 71fb strb r3, [r7, #7]
+ 80006f0: 4613 mov r3, r2
+ 80006f2: 71bb strb r3, [r7, #6]
+ HAL_GPIO_WritePin(_port, _rs_pin, mode);
+ 80006f4: 4b16 ldr r3, [pc, #88] @ (8000750 )
+ 80006f6: 681b ldr r3, [r3, #0]
+ 80006f8: 4a16 ldr r2, [pc, #88] @ (8000754 )
+ 80006fa: 8811 ldrh r1, [r2, #0]
+ 80006fc: 79ba ldrb r2, [r7, #6]
+ 80006fe: 4618 mov r0, r3
+ 8000700: f001 fa74 bl 8001bec
+
+ // if there is a RW pin indicated, set it low to Write
+ if (_rw_pin != 255) {
+ 8000704: 4b14 ldr r3, [pc, #80] @ (8000758 )
+ 8000706: 881b ldrh r3, [r3, #0]
+ 8000708: 2bff cmp r3, #255 @ 0xff
+ 800070a: d007 beq.n 800071c
+ HAL_GPIO_WritePin(_port, _rw_pin, GPIO_PIN_RESET);
+ 800070c: 4b10 ldr r3, [pc, #64] @ (8000750 )
+ 800070e: 681b ldr r3, [r3, #0]
+ 8000710: 4a11 ldr r2, [pc, #68] @ (8000758 )
+ 8000712: 8811 ldrh r1, [r2, #0]
+ 8000714: 2200 movs r2, #0
+ 8000716: 4618 mov r0, r3
+ 8000718: f001 fa68 bl 8001bec
+ }
+
+ if (_displayfunction & LCD_8BITMODE) {
+ 800071c: 4b0f ldr r3, [pc, #60] @ (800075c )
+ 800071e: 781b ldrb r3, [r3, #0]
+ 8000720: f003 0310 and.w r3, r3, #16
+ 8000724: 2b00 cmp r3, #0
+ 8000726: d004 beq.n 8000732
+ write8bits(value);
+ 8000728: 79fb ldrb r3, [r7, #7]
+ 800072a: 4618 mov r0, r3
+ 800072c: f000 f86c bl 8000808
+ } else {
+ write4bits(value>>4);
+ write4bits(value);
+ }
+}
+ 8000730: e009 b.n 8000746
+ write4bits(value>>4);
+ 8000732: 79fb ldrb r3, [r7, #7]
+ 8000734: 091b lsrs r3, r3, #4
+ 8000736: b2db uxtb r3, r3
+ 8000738: 4618 mov r0, r3
+ 800073a: f000 f83b bl 80007b4
+ write4bits(value);
+ 800073e: 79fb ldrb r3, [r7, #7]
+ 8000740: 4618 mov r0, r3
+ 8000742: f000 f837 bl 80007b4
+}
+ 8000746: bf00 nop
+ 8000748: 3708 adds r7, #8
+ 800074a: 46bd mov sp, r7
+ 800074c: bd80 pop {r7, pc}
+ 800074e: bf00 nop
+ 8000750: 20000094 .word 0x20000094
+ 8000754: 2000007e .word 0x2000007e
+ 8000758: 20000080 .word 0x20000080
+ 800075c: 20000098 .word 0x20000098
+
+08000760 :
+
+void pulseEnable(void) {
+ 8000760: b580 push {r7, lr}
+ 8000762: af00 add r7, sp, #0
+ HAL_GPIO_WritePin(_port, _enable_pin, GPIO_PIN_RESET);
+ 8000764: 4b11 ldr r3, [pc, #68] @ (80007ac )
+ 8000766: 681b ldr r3, [r3, #0]
+ 8000768: 4a11 ldr r2, [pc, #68] @ (80007b0 )
+ 800076a: 8811 ldrh r1, [r2, #0]
+ 800076c: 2200 movs r2, #0
+ 800076e: 4618 mov r0, r3
+ 8000770: f001 fa3c bl 8001bec
+ HAL_Delay(1);
+ 8000774: 2001 movs r0, #1
+ 8000776: f000 ffb5 bl 80016e4
+ HAL_GPIO_WritePin(_port, _enable_pin, GPIO_PIN_SET);
+ 800077a: 4b0c ldr r3, [pc, #48] @ (80007ac )
+ 800077c: 681b ldr r3, [r3, #0]
+ 800077e: 4a0c ldr r2, [pc, #48] @ (80007b0 )
+ 8000780: 8811 ldrh r1, [r2, #0]
+ 8000782: 2201 movs r2, #1
+ 8000784: 4618 mov r0, r3
+ 8000786: f001 fa31 bl 8001bec
+ HAL_Delay(1); // enable pulse must be >450ns
+ 800078a: 2001 movs r0, #1
+ 800078c: f000 ffaa bl 80016e4
+ HAL_GPIO_WritePin(_port, _enable_pin, GPIO_PIN_RESET);
+ 8000790: 4b06 ldr r3, [pc, #24] @ (80007ac )
+ 8000792: 681b ldr r3, [r3, #0]
+ 8000794: 4a06 ldr r2, [pc, #24] @ (80007b0 )
+ 8000796: 8811 ldrh r1, [r2, #0]
+ 8000798: 2200 movs r2, #0
+ 800079a: 4618 mov r0, r3
+ 800079c: f001 fa26 bl 8001bec
+ HAL_Delay(1); // commands need > 37us to settle
+ 80007a0: 2001 movs r0, #1
+ 80007a2: f000 ff9f bl 80016e4
+}
+ 80007a6: bf00 nop
+ 80007a8: bd80 pop {r7, pc}
+ 80007aa: bf00 nop
+ 80007ac: 20000094 .word 0x20000094
+ 80007b0: 20000082 .word 0x20000082
+
+080007b4 :
+
+void write4bits(uint8_t value) {
+ 80007b4: b580 push {r7, lr}
+ 80007b6: b084 sub sp, #16
+ 80007b8: af00 add r7, sp, #0
+ 80007ba: 4603 mov r3, r0
+ 80007bc: 71fb strb r3, [r7, #7]
+ for (int i = 0; i < 4; i++) {
+ 80007be: 2300 movs r3, #0
+ 80007c0: 60fb str r3, [r7, #12]
+ 80007c2: e013 b.n 80007ec
+ HAL_GPIO_WritePin(_port, _data_pins[i], ((value >> i) & 0x01)?GPIO_PIN_SET:GPIO_PIN_RESET);
+ 80007c4: 4b0e ldr r3, [pc, #56] @ (8000800 )
+ 80007c6: 6818 ldr r0, [r3, #0]
+ 80007c8: 4a0e ldr r2, [pc, #56] @ (8000804 )
+ 80007ca: 68fb ldr r3, [r7, #12]
+ 80007cc: f832 1013 ldrh.w r1, [r2, r3, lsl #1]
+ 80007d0: 79fa ldrb r2, [r7, #7]
+ 80007d2: 68fb ldr r3, [r7, #12]
+ 80007d4: fa42 f303 asr.w r3, r2, r3
+ 80007d8: b2db uxtb r3, r3
+ 80007da: f003 0301 and.w r3, r3, #1
+ 80007de: b2db uxtb r3, r3
+ 80007e0: 461a mov r2, r3
+ 80007e2: f001 fa03 bl 8001bec
+ for (int i = 0; i < 4; i++) {
+ 80007e6: 68fb ldr r3, [r7, #12]
+ 80007e8: 3301 adds r3, #1
+ 80007ea: 60fb str r3, [r7, #12]
+ 80007ec: 68fb ldr r3, [r7, #12]
+ 80007ee: 2b03 cmp r3, #3
+ 80007f0: dde8 ble.n 80007c4
+ }
+
+ pulseEnable();
+ 80007f2: f7ff ffb5 bl 8000760
+}
+ 80007f6: bf00 nop
+ 80007f8: 3710 adds r7, #16
+ 80007fa: 46bd mov sp, r7
+ 80007fc: bd80 pop {r7, pc}
+ 80007fe: bf00 nop
+ 8000800: 20000094 .word 0x20000094
+ 8000804: 20000084 .word 0x20000084
+
+08000808 :
+
+void write8bits(uint8_t value) {
+ 8000808: b580 push {r7, lr}
+ 800080a: b084 sub sp, #16
+ 800080c: af00 add r7, sp, #0
+ 800080e: 4603 mov r3, r0
+ 8000810: 71fb strb r3, [r7, #7]
+ for (int i = 0; i < 8; i++) {
+ 8000812: 2300 movs r3, #0
+ 8000814: 60fb str r3, [r7, #12]
+ 8000816: e013 b.n 8000840
+ HAL_GPIO_WritePin(_port, _data_pins[i], ((value >> i) & 0x01)?GPIO_PIN_SET:GPIO_PIN_RESET);
+ 8000818: 4b0e ldr r3, [pc, #56] @ (8000854 )
+ 800081a: 6818 ldr r0, [r3, #0]
+ 800081c: 4a0e ldr r2, [pc, #56] @ (8000858 )
+ 800081e: 68fb ldr r3, [r7, #12]
+ 8000820: f832 1013 ldrh.w r1, [r2, r3, lsl #1]
+ 8000824: 79fa ldrb r2, [r7, #7]
+ 8000826: 68fb ldr r3, [r7, #12]
+ 8000828: fa42 f303 asr.w r3, r2, r3
+ 800082c: b2db uxtb r3, r3
+ 800082e: f003 0301 and.w r3, r3, #1
+ 8000832: b2db uxtb r3, r3
+ 8000834: 461a mov r2, r3
+ 8000836: f001 f9d9 bl 8001bec
+ for (int i = 0; i < 8; i++) {
+ 800083a: 68fb ldr r3, [r7, #12]
+ 800083c: 3301 adds r3, #1
+ 800083e: 60fb str r3, [r7, #12]
+ 8000840: 68fb ldr r3, [r7, #12]
+ 8000842: 2b07 cmp r3, #7
+ 8000844: dde8 ble.n 8000818
+ }
+
+ pulseEnable();
+ 8000846: f7ff ff8b bl 8000760
+}
+ 800084a: bf00 nop
+ 800084c: 3710 adds r7, #16
+ 800084e: 46bd mov sp, r7
+ 8000850: bd80 pop {r7, pc}
+ 8000852: bf00 nop
+ 8000854: 20000094 .word 0x20000094
+ 8000858: 20000084 .word 0x20000084
+
+0800085c :
+ * Created on: May 23, 2024
+ * Author: chandrima
+ */
+#include "MCP3008.h"
+
+void MCP3008_handle_init(MCP3008_Handle_t *handle, GPIO_TypeDef *cs_port, uint16_t cs_pin, SPI_HandleTypeDef *hspi){
+ 800085c: b480 push {r7}
+ 800085e: b085 sub sp, #20
+ 8000860: af00 add r7, sp, #0
+ 8000862: 60f8 str r0, [r7, #12]
+ 8000864: 60b9 str r1, [r7, #8]
+ 8000866: 603b str r3, [r7, #0]
+ 8000868: 4613 mov r3, r2
+ 800086a: 80fb strh r3, [r7, #6]
+ //Assign the port and pins for the SPI CS pin
+ handle->CS_Port = cs_port;
+ 800086c: 68fb ldr r3, [r7, #12]
+ 800086e: 68ba ldr r2, [r7, #8]
+ 8000870: 601a str r2, [r3, #0]
+ handle->CS_Pin = cs_pin;
+ 8000872: 68fb ldr r3, [r7, #12]
+ 8000874: 88fa ldrh r2, [r7, #6]
+ 8000876: 809a strh r2, [r3, #4]
+
+ handle->hspi = hspi;
+ 8000878: 68fb ldr r3, [r7, #12]
+ 800087a: 683a ldr r2, [r7, #0]
+ 800087c: 609a str r2, [r3, #8]
+}
+ 800087e: bf00 nop
+ 8000880: 3714 adds r7, #20
+ 8000882: 46bd mov sp, r7
+ 8000884: bc80 pop {r7}
+ 8000886: 4770 bx lr
+
+08000888 :
+
+int16_t MCP3008_read(MCP3008_Handle_t *handle, uint8_t chan){
+ 8000888: b580 push {r7, lr}
+ 800088a: b088 sub sp, #32
+ 800088c: af02 add r7, sp, #8
+ 800088e: 6078 str r0, [r7, #4]
+ 8000890: 460b mov r3, r1
+ 8000892: 70fb strb r3, [r7, #3]
+ //Limit chan to max number of channels
+ if(chan >= MCP3008_NUM_CHANNELS){
+ 8000894: 78fb ldrb r3, [r7, #3]
+ 8000896: 2b07 cmp r3, #7
+ 8000898: d902 bls.n 80008a0
+ return MCP3008_ERROR_INVALID_ARG;
+ 800089a: f04f 33ff mov.w r3, #4294967295
+ 800089e: e03f b.n 8000920
+ }
+
+ //Initialize the tx and rx buffers
+ uint8_t tx_data[3];
+ uint8_t rx_data[3] = {0};
+ 80008a0: 4b21 ldr r3, [pc, #132] @ (8000928 )
+ 80008a2: 881b ldrh r3, [r3, #0]
+ 80008a4: 81bb strh r3, [r7, #12]
+ 80008a6: 2300 movs r3, #0
+ 80008a8: 73bb strb r3, [r7, #14]
+
+ tx_data[0] = 0x01; //Start bit
+ 80008aa: 2301 movs r3, #1
+ 80008ac: 743b strb r3, [r7, #16]
+ tx_data[2] = 0x00;
+ 80008ae: 2300 movs r3, #0
+ 80008b0: 74bb strb r3, [r7, #18]
+ tx_data[1] = 0x80 | (chan << SHIFT_4);
+ 80008b2: 78fb ldrb r3, [r7, #3]
+ 80008b4: 011b lsls r3, r3, #4
+ 80008b6: b25b sxtb r3, r3
+ 80008b8: f063 037f orn r3, r3, #127 @ 0x7f
+ 80008bc: b25b sxtb r3, r3
+ 80008be: b2db uxtb r3, r3
+ 80008c0: 747b strb r3, [r7, #17]
+
+ HAL_GPIO_WritePin(handle->CS_Port, handle->CS_Pin, GPIO_PIN_RESET);
+ 80008c2: 687b ldr r3, [r7, #4]
+ 80008c4: 6818 ldr r0, [r3, #0]
+ 80008c6: 687b ldr r3, [r7, #4]
+ 80008c8: 889b ldrh r3, [r3, #4]
+ 80008ca: 2200 movs r2, #0
+ 80008cc: 4619 mov r1, r3
+ 80008ce: f001 f98d bl 8001bec
+ HAL_StatusTypeDef spi_status = HAL_SPI_TransmitReceive(handle->hspi, tx_data, rx_data, sizeof(tx_data), MCP3008_SPI_TIMEOUT);
+ 80008d2: 687b ldr r3, [r7, #4]
+ 80008d4: 6898 ldr r0, [r3, #8]
+ 80008d6: f107 020c add.w r2, r7, #12
+ 80008da: f107 0110 add.w r1, r7, #16
+ 80008de: 2301 movs r3, #1
+ 80008e0: 9300 str r3, [sp, #0]
+ 80008e2: 2303 movs r3, #3
+ 80008e4: f001 fdfc bl 80024e0
+ 80008e8: 4603 mov r3, r0
+ 80008ea: 75fb strb r3, [r7, #23]
+ HAL_GPIO_WritePin(handle->CS_Port, handle->CS_Pin, GPIO_PIN_SET);
+ 80008ec: 687b ldr r3, [r7, #4]
+ 80008ee: 6818 ldr r0, [r3, #0]
+ 80008f0: 687b ldr r3, [r7, #4]
+ 80008f2: 889b ldrh r3, [r3, #4]
+ 80008f4: 2201 movs r2, #1
+ 80008f6: 4619 mov r1, r3
+ 80008f8: f001 f978 bl 8001bec
+
+ if(spi_status != HAL_OK){
+ 80008fc: 7dfb ldrb r3, [r7, #23]
+ 80008fe: 2b00 cmp r3, #0
+ 8000900: d002 beq.n 8000908
+ return MCP3008_ERROR_SPI;
+ 8000902: f06f 0301 mvn.w r3, #1
+ 8000906: e00b b.n 8000920
+ }
+
+ //Extract 10-bit ADC reading from rx buffer
+ int16_t adc_reading = (int16_t)((rx_data[1] << SHIFT_8) | rx_data[2]) & FIRST_10_BITS_MASK;
+ 8000908: 7b7b ldrb r3, [r7, #13]
+ 800090a: 021b lsls r3, r3, #8
+ 800090c: b21a sxth r2, r3
+ 800090e: 7bbb ldrb r3, [r7, #14]
+ 8000910: b21b sxth r3, r3
+ 8000912: 4313 orrs r3, r2
+ 8000914: b21b sxth r3, r3
+ 8000916: f3c3 0309 ubfx r3, r3, #0, #10
+ 800091a: 82bb strh r3, [r7, #20]
+
+ return adc_reading;
+ 800091c: f9b7 3014 ldrsh.w r3, [r7, #20]
+}
+ 8000920: 4618 mov r0, r3
+ 8000922: 3718 adds r7, #24
+ 8000924: 46bd mov sp, r7
+ 8000926: bd80 pop {r7, pc}
+ 8000928: 08003304 .word 0x08003304
+
+0800092c :
+/**
+ * @brief The application entry point.
+ * @retval int
+ */
+int main(void)
+{
+ 800092c: b580 push {r7, lr}
+ 800092e: b084 sub sp, #16
+ 8000930: af04 add r7, sp, #16
+ /* USER CODE END 1 */
+
+ /* MCU Configuration--------------------------------------------------------*/
+
+ /* Reset of all peripherals, Initializes the Flash interface and the Systick. */
+ HAL_Init();
+ 8000932: f000 fe75 bl 8001620
+ /* USER CODE BEGIN Init */
+
+ /* USER CODE END Init */
+
+ /* Configure the system clock */
+ SystemClock_Config();
+ 8000936: f000 f8e7 bl 8000b08
+ /* USER CODE BEGIN SysInit */
+
+ /* USER CODE END SysInit */
+
+ /* Initialize all configured peripherals */
+ MX_GPIO_Init();
+ 800093a: f000 f957 bl 8000bec
+ MX_SPI1_Init();
+ 800093e: f000 f91f bl 8000b80
+ /* USER CODE BEGIN 2 */
+ MCP3008_handle_init(&spi_mpc3008, GPIOA, GPIO_PIN_8, &hspi1);
+ 8000942: 4b62 ldr r3, [pc, #392] @ (8000acc )
+ 8000944: f44f 7280 mov.w r2, #256 @ 0x100
+ 8000948: 4961 ldr r1, [pc, #388] @ (8000ad0 )
+ 800094a: 4862 ldr r0, [pc, #392] @ (8000ad4 )
+ 800094c: f7ff ff86 bl 800085c
+ LiquidCrystal(GPIOB, GPIO_PIN_3,GPIO_PIN_4,GPIO_PIN_5,GPIO_PIN_6 ,GPIO_PIN_7,GPIO_PIN_8,GPIO_PIN_9);
+ 8000950: f44f 7300 mov.w r3, #512 @ 0x200
+ 8000954: 9303 str r3, [sp, #12]
+ 8000956: f44f 7380 mov.w r3, #256 @ 0x100
+ 800095a: 9302 str r3, [sp, #8]
+ 800095c: 2380 movs r3, #128 @ 0x80
+ 800095e: 9301 str r3, [sp, #4]
+ 8000960: 2340 movs r3, #64 @ 0x40
+ 8000962: 9300 str r3, [sp, #0]
+ 8000964: 2320 movs r3, #32
+ 8000966: 2210 movs r2, #16
+ 8000968: 2108 movs r1, #8
+ 800096a: 485b ldr r0, [pc, #364] @ (8000ad8 )
+ 800096c: f7ff fbf6 bl 800015c
+ begin(16, 4);
+ 8000970: 2104 movs r1, #4
+ 8000972: 2010 movs r0, #16
+ 8000974: f7ff fc88 bl 8000288
+ /* USER CODE END 2 */
+
+ /* Infinite loop */
+ /* USER CODE BEGIN WHILE */
+ clear();
+ 8000978: f7ff fe1a bl 80005b0
+ setCursor(0,0);
+ 800097c: 2100 movs r1, #0
+ 800097e: 2000 movs r0, #0
+ 8000980: f7ff fe20 bl 80005c4
+ print("......ADAS......");
+ 8000984: 4855 ldr r0, [pc, #340] @ (8000adc )
+ 8000986: f7ff fe65 bl 8000654
+ setCursor(0,1);
+ 800098a: 2101 movs r1, #1
+ 800098c: 2000 movs r0, #0
+ 800098e: f7ff fe19 bl 80005c4
+ print(".....SYSTEM.....");
+ 8000992: 4853 ldr r0, [pc, #332] @ (8000ae0 )
+ 8000994: f7ff fe5e bl 8000654
+ setCursor(0,3);
+ 8000998: 2103 movs r1, #3
+ 800099a: 2000 movs r0, #0
+ 800099c: f7ff fe12 bl 80005c4