diff --git a/CHANGELOG.md b/CHANGELOG.md
new file mode 100644
index 0000000..d73f1b8
--- /dev/null
+++ b/CHANGELOG.md
@@ -0,0 +1,7 @@
+# Eleph changelog
+**Legend:** _"Hardware version/Software version"_
+
+
+
+#### v1/1.0 - February 14, 2021
+- Initial release
\ No newline at end of file
diff --git a/Firmware/CubeIDE/.cproject b/Firmware/CubeIDE/.cproject
new file mode 100644
index 0000000..a13076e
--- /dev/null
+++ b/Firmware/CubeIDE/.cproject
@@ -0,0 +1,175 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Firmware/CubeIDE/.project b/Firmware/CubeIDE/.project
new file mode 100644
index 0000000..fb0c81c
--- /dev/null
+++ b/Firmware/CubeIDE/.project
@@ -0,0 +1,31 @@
+
+
+ Eleph
+
+
+
+
+
+ org.eclipse.cdt.managedbuilder.core.genmakebuilder
+ clean,full,incremental,
+
+
+
+
+ org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder
+ full,incremental,
+
+
+
+
+
+ com.st.stm32cube.ide.mcu.MCUProjectNature
+ org.eclipse.cdt.core.cnature
+ com.st.stm32cube.ide.mcu.MCUCubeIdeServicesRevAev2ProjectNature
+ com.st.stm32cube.ide.mcu.MCUManagedMakefileProjectNature
+ com.st.stm32cube.ide.mcu.MCUSingleCpuProjectNature
+ com.st.stm32cube.ide.mcu.MCURootProjectNature
+ org.eclipse.cdt.managedbuilder.core.managedBuildNature
+ org.eclipse.cdt.managedbuilder.core.ScannerConfigNature
+
+
diff --git a/Firmware/CubeIDE/.settings/language.settings.xml b/Firmware/CubeIDE/.settings/language.settings.xml
new file mode 100644
index 0000000..8f7f220
--- /dev/null
+++ b/Firmware/CubeIDE/.settings/language.settings.xml
@@ -0,0 +1,27 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Firmware/CubeIDE/.settings/org.eclipse.cdt.core.prefs b/Firmware/CubeIDE/.settings/org.eclipse.cdt.core.prefs
new file mode 100644
index 0000000..4025163
--- /dev/null
+++ b/Firmware/CubeIDE/.settings/org.eclipse.cdt.core.prefs
@@ -0,0 +1,6 @@
+doxygen/doxygen_new_line_after_brief=true
+doxygen/doxygen_use_brief_tag=false
+doxygen/doxygen_use_javadoc_tags=true
+doxygen/doxygen_use_pre_tag=false
+doxygen/doxygen_use_structural_commands=false
+eclipse.preferences.version=1
diff --git a/Firmware/CubeIDE/CMSIS/inc/core_cm3.h b/Firmware/CubeIDE/CMSIS/inc/core_cm3.h
new file mode 100644
index 0000000..2b6b51a
--- /dev/null
+++ b/Firmware/CubeIDE/CMSIS/inc/core_cm3.h
@@ -0,0 +1,1818 @@
+/**************************************************************************//**
+ * @file core_cm3.h
+ * @brief CMSIS Cortex-M3 Core Peripheral Access Layer Header File
+ * @version V1.30
+ * @date 30. October 2009
+ *
+ * @note
+ * Copyright (C) 2009 ARM Limited. All rights reserved.
+ *
+ * @par
+ * ARM Limited (ARM) is supplying this software for use with Cortex-M
+ * processor based microcontrollers. This file can be freely distributed
+ * within development tools that are supporting such ARM based processors.
+ *
+ * @par
+ * THIS SOFTWARE IS PROVIDED "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED
+ * OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE.
+ * ARM SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR
+ * CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
+ *
+ ******************************************************************************/
+
+#ifndef __CM3_CORE_H__
+#define __CM3_CORE_H__
+
+/** @addtogroup CMSIS_CM3_core_LintCinfiguration CMSIS CM3 Core Lint Configuration
+ *
+ * List of Lint messages which will be suppressed and not shown:
+ * - Error 10: \n
+ * register uint32_t __regBasePri __asm("basepri"); \n
+ * Error 10: Expecting ';'
+ * .
+ * - Error 530: \n
+ * return(__regBasePri); \n
+ * Warning 530: Symbol '__regBasePri' (line 264) not initialized
+ * .
+ * - Error 550: \n
+ * __regBasePri = (basePri & 0x1ff); \n
+ * Warning 550: Symbol '__regBasePri' (line 271) not accessed
+ * .
+ * - Error 754: \n
+ * uint32_t RESERVED0[24]; \n
+ * Info 754: local structure member '' (line 109, file ./cm3_core.h) not referenced
+ * .
+ * - Error 750: \n
+ * #define __CM3_CORE_H__ \n
+ * Info 750: local macro '__CM3_CORE_H__' (line 43, file./cm3_core.h) not referenced
+ * .
+ * - Error 528: \n
+ * static __INLINE void NVIC_DisableIRQ(uint32_t IRQn) \n
+ * Warning 528: Symbol 'NVIC_DisableIRQ(unsigned int)' (line 419, file ./cm3_core.h) not referenced
+ * .
+ * - Error 751: \n
+ * } InterruptType_Type; \n
+ * Info 751: local typedef 'InterruptType_Type' (line 170, file ./cm3_core.h) not referenced
+ * .
+ * Note: To re-enable a Message, insert a space before 'lint' *
+ *
+ */
+
+/*lint -save */
+/*lint -e10 */
+/*lint -e530 */
+/*lint -e550 */
+/*lint -e754 */
+/*lint -e750 */
+/*lint -e528 */
+/*lint -e751 */
+
+
+/** @addtogroup CMSIS_CM3_core_definitions CM3 Core Definitions
+ This file defines all structures and symbols for CMSIS core:
+ - CMSIS version number
+ - Cortex-M core registers and bitfields
+ - Cortex-M core peripheral base address
+ @{
+ */
+
+#ifdef __cplusplus
+ extern "C" {
+#endif
+
+#define __CM3_CMSIS_VERSION_MAIN (0x01) /*!< [31:16] CMSIS HAL main version */
+#define __CM3_CMSIS_VERSION_SUB (0x30) /*!< [15:0] CMSIS HAL sub version */
+#define __CM3_CMSIS_VERSION ((__CM3_CMSIS_VERSION_MAIN << 16) | __CM3_CMSIS_VERSION_SUB) /*!< CMSIS HAL version number */
+
+#define __CORTEX_M (0x03) /*!< Cortex core */
+
+#include /* Include standard types */
+
+#if defined (__ICCARM__)
+ #include /* IAR Intrinsics */
+#endif
+
+
+#ifndef __NVIC_PRIO_BITS
+ #define __NVIC_PRIO_BITS 4 /*!< standard definition for NVIC Priority Bits */
+#endif
+
+
+
+
+/**
+ * IO definitions
+ *
+ * define access restrictions to peripheral registers
+ */
+
+#ifdef __cplusplus
+ #define __I volatile /*!< defines 'read only' permissions */
+#else
+ #define __I volatile const /*!< defines 'read only' permissions */
+#endif
+#define __O volatile /*!< defines 'write only' permissions */
+#define __IO volatile /*!< defines 'read / write' permissions */
+
+
+
+/*******************************************************************************
+ * Register Abstraction
+ ******************************************************************************/
+/** @addtogroup CMSIS_CM3_core_register CMSIS CM3 Core Register
+ @{
+*/
+
+
+/** @addtogroup CMSIS_CM3_NVIC CMSIS CM3 NVIC
+ memory mapped structure for Nested Vectored Interrupt Controller (NVIC)
+ @{
+ */
+typedef struct
+{
+ __IO uint32_t ISER[8]; /*!< Offset: 0x000 Interrupt Set Enable Register */
+ uint32_t RESERVED0[24];
+ __IO uint32_t ICER[8]; /*!< Offset: 0x080 Interrupt Clear Enable Register */
+ uint32_t RSERVED1[24];
+ __IO uint32_t ISPR[8]; /*!< Offset: 0x100 Interrupt Set Pending Register */
+ uint32_t RESERVED2[24];
+ __IO uint32_t ICPR[8]; /*!< Offset: 0x180 Interrupt Clear Pending Register */
+ uint32_t RESERVED3[24];
+ __IO uint32_t IABR[8]; /*!< Offset: 0x200 Interrupt Active bit Register */
+ uint32_t RESERVED4[56];
+ __IO uint8_t IP[240]; /*!< Offset: 0x300 Interrupt Priority Register (8Bit wide) */
+ uint32_t RESERVED5[644];
+ __O uint32_t STIR; /*!< Offset: 0xE00 Software Trigger Interrupt Register */
+} NVIC_Type;
+/*@}*/ /* end of group CMSIS_CM3_NVIC */
+
+
+/** @addtogroup CMSIS_CM3_SCB CMSIS CM3 SCB
+ memory mapped structure for System Control Block (SCB)
+ @{
+ */
+typedef struct
+{
+ __I uint32_t CPUID; /*!< Offset: 0x00 CPU ID Base Register */
+ __IO uint32_t ICSR; /*!< Offset: 0x04 Interrupt Control State Register */
+ __IO uint32_t VTOR; /*!< Offset: 0x08 Vector Table Offset Register */
+ __IO uint32_t AIRCR; /*!< Offset: 0x0C Application Interrupt / Reset Control Register */
+ __IO uint32_t SCR; /*!< Offset: 0x10 System Control Register */
+ __IO uint32_t CCR; /*!< Offset: 0x14 Configuration Control Register */
+ __IO uint8_t SHP[12]; /*!< Offset: 0x18 System Handlers Priority Registers (4-7, 8-11, 12-15) */
+ __IO uint32_t SHCSR; /*!< Offset: 0x24 System Handler Control and State Register */
+ __IO uint32_t CFSR; /*!< Offset: 0x28 Configurable Fault Status Register */
+ __IO uint32_t HFSR; /*!< Offset: 0x2C Hard Fault Status Register */
+ __IO uint32_t DFSR; /*!< Offset: 0x30 Debug Fault Status Register */
+ __IO uint32_t MMFAR; /*!< Offset: 0x34 Mem Manage Address Register */
+ __IO uint32_t BFAR; /*!< Offset: 0x38 Bus Fault Address Register */
+ __IO uint32_t AFSR; /*!< Offset: 0x3C Auxiliary Fault Status Register */
+ __I uint32_t PFR[2]; /*!< Offset: 0x40 Processor Feature Register */
+ __I uint32_t DFR; /*!< Offset: 0x48 Debug Feature Register */
+ __I uint32_t ADR; /*!< Offset: 0x4C Auxiliary Feature Register */
+ __I uint32_t MMFR[4]; /*!< Offset: 0x50 Memory Model Feature Register */
+ __I uint32_t ISAR[5]; /*!< Offset: 0x60 ISA Feature Register */
+} SCB_Type;
+
+/* SCB CPUID Register Definitions */
+#define SCB_CPUID_IMPLEMENTER_Pos 24 /*!< SCB CPUID: IMPLEMENTER Position */
+#define SCB_CPUID_IMPLEMENTER_Msk (0xFFul << SCB_CPUID_IMPLEMENTER_Pos) /*!< SCB CPUID: IMPLEMENTER Mask */
+
+#define SCB_CPUID_VARIANT_Pos 20 /*!< SCB CPUID: VARIANT Position */
+#define SCB_CPUID_VARIANT_Msk (0xFul << SCB_CPUID_VARIANT_Pos) /*!< SCB CPUID: VARIANT Mask */
+
+#define SCB_CPUID_PARTNO_Pos 4 /*!< SCB CPUID: PARTNO Position */
+#define SCB_CPUID_PARTNO_Msk (0xFFFul << SCB_CPUID_PARTNO_Pos) /*!< SCB CPUID: PARTNO Mask */
+
+#define SCB_CPUID_REVISION_Pos 0 /*!< SCB CPUID: REVISION Position */
+#define SCB_CPUID_REVISION_Msk (0xFul << SCB_CPUID_REVISION_Pos) /*!< SCB CPUID: REVISION Mask */
+
+/* SCB Interrupt Control State Register Definitions */
+#define SCB_ICSR_NMIPENDSET_Pos 31 /*!< SCB ICSR: NMIPENDSET Position */
+#define SCB_ICSR_NMIPENDSET_Msk (1ul << SCB_ICSR_NMIPENDSET_Pos) /*!< SCB ICSR: NMIPENDSET Mask */
+
+#define SCB_ICSR_PENDSVSET_Pos 28 /*!< SCB ICSR: PENDSVSET Position */
+#define SCB_ICSR_PENDSVSET_Msk (1ul << SCB_ICSR_PENDSVSET_Pos) /*!< SCB ICSR: PENDSVSET Mask */
+
+#define SCB_ICSR_PENDSVCLR_Pos 27 /*!< SCB ICSR: PENDSVCLR Position */
+#define SCB_ICSR_PENDSVCLR_Msk (1ul << SCB_ICSR_PENDSVCLR_Pos) /*!< SCB ICSR: PENDSVCLR Mask */
+
+#define SCB_ICSR_PENDSTSET_Pos 26 /*!< SCB ICSR: PENDSTSET Position */
+#define SCB_ICSR_PENDSTSET_Msk (1ul << SCB_ICSR_PENDSTSET_Pos) /*!< SCB ICSR: PENDSTSET Mask */
+
+#define SCB_ICSR_PENDSTCLR_Pos 25 /*!< SCB ICSR: PENDSTCLR Position */
+#define SCB_ICSR_PENDSTCLR_Msk (1ul << SCB_ICSR_PENDSTCLR_Pos) /*!< SCB ICSR: PENDSTCLR Mask */
+
+#define SCB_ICSR_ISRPREEMPT_Pos 23 /*!< SCB ICSR: ISRPREEMPT Position */
+#define SCB_ICSR_ISRPREEMPT_Msk (1ul << SCB_ICSR_ISRPREEMPT_Pos) /*!< SCB ICSR: ISRPREEMPT Mask */
+
+#define SCB_ICSR_ISRPENDING_Pos 22 /*!< SCB ICSR: ISRPENDING Position */
+#define SCB_ICSR_ISRPENDING_Msk (1ul << SCB_ICSR_ISRPENDING_Pos) /*!< SCB ICSR: ISRPENDING Mask */
+
+#define SCB_ICSR_VECTPENDING_Pos 12 /*!< SCB ICSR: VECTPENDING Position */
+#define SCB_ICSR_VECTPENDING_Msk (0x1FFul << SCB_ICSR_VECTPENDING_Pos) /*!< SCB ICSR: VECTPENDING Mask */
+
+#define SCB_ICSR_RETTOBASE_Pos 11 /*!< SCB ICSR: RETTOBASE Position */
+#define SCB_ICSR_RETTOBASE_Msk (1ul << SCB_ICSR_RETTOBASE_Pos) /*!< SCB ICSR: RETTOBASE Mask */
+
+#define SCB_ICSR_VECTACTIVE_Pos 0 /*!< SCB ICSR: VECTACTIVE Position */
+#define SCB_ICSR_VECTACTIVE_Msk (0x1FFul << SCB_ICSR_VECTACTIVE_Pos) /*!< SCB ICSR: VECTACTIVE Mask */
+
+/* SCB Interrupt Control State Register Definitions */
+#define SCB_VTOR_TBLBASE_Pos 29 /*!< SCB VTOR: TBLBASE Position */
+#define SCB_VTOR_TBLBASE_Msk (0x1FFul << SCB_VTOR_TBLBASE_Pos) /*!< SCB VTOR: TBLBASE Mask */
+
+#define SCB_VTOR_TBLOFF_Pos 7 /*!< SCB VTOR: TBLOFF Position */
+#define SCB_VTOR_TBLOFF_Msk (0x3FFFFFul << SCB_VTOR_TBLOFF_Pos) /*!< SCB VTOR: TBLOFF Mask */
+
+/* SCB Application Interrupt and Reset Control Register Definitions */
+#define SCB_AIRCR_VECTKEY_Pos 16 /*!< SCB AIRCR: VECTKEY Position */
+#define SCB_AIRCR_VECTKEY_Msk (0xFFFFul << SCB_AIRCR_VECTKEY_Pos) /*!< SCB AIRCR: VECTKEY Mask */
+
+#define SCB_AIRCR_VECTKEYSTAT_Pos 16 /*!< SCB AIRCR: VECTKEYSTAT Position */
+#define SCB_AIRCR_VECTKEYSTAT_Msk (0xFFFFul << SCB_AIRCR_VECTKEYSTAT_Pos) /*!< SCB AIRCR: VECTKEYSTAT Mask */
+
+#define SCB_AIRCR_ENDIANESS_Pos 15 /*!< SCB AIRCR: ENDIANESS Position */
+#define SCB_AIRCR_ENDIANESS_Msk (1ul << SCB_AIRCR_ENDIANESS_Pos) /*!< SCB AIRCR: ENDIANESS Mask */
+
+#define SCB_AIRCR_PRIGROUP_Pos 8 /*!< SCB AIRCR: PRIGROUP Position */
+#define SCB_AIRCR_PRIGROUP_Msk (7ul << SCB_AIRCR_PRIGROUP_Pos) /*!< SCB AIRCR: PRIGROUP Mask */
+
+#define SCB_AIRCR_SYSRESETREQ_Pos 2 /*!< SCB AIRCR: SYSRESETREQ Position */
+#define SCB_AIRCR_SYSRESETREQ_Msk (1ul << SCB_AIRCR_SYSRESETREQ_Pos) /*!< SCB AIRCR: SYSRESETREQ Mask */
+
+#define SCB_AIRCR_VECTCLRACTIVE_Pos 1 /*!< SCB AIRCR: VECTCLRACTIVE Position */
+#define SCB_AIRCR_VECTCLRACTIVE_Msk (1ul << SCB_AIRCR_VECTCLRACTIVE_Pos) /*!< SCB AIRCR: VECTCLRACTIVE Mask */
+
+#define SCB_AIRCR_VECTRESET_Pos 0 /*!< SCB AIRCR: VECTRESET Position */
+#define SCB_AIRCR_VECTRESET_Msk (1ul << SCB_AIRCR_VECTRESET_Pos) /*!< SCB AIRCR: VECTRESET Mask */
+
+/* SCB System Control Register Definitions */
+#define SCB_SCR_SEVONPEND_Pos 4 /*!< SCB SCR: SEVONPEND Position */
+#define SCB_SCR_SEVONPEND_Msk (1ul << SCB_SCR_SEVONPEND_Pos) /*!< SCB SCR: SEVONPEND Mask */
+
+#define SCB_SCR_SLEEPDEEP_Pos 2 /*!< SCB SCR: SLEEPDEEP Position */
+#define SCB_SCR_SLEEPDEEP_Msk (1ul << SCB_SCR_SLEEPDEEP_Pos) /*!< SCB SCR: SLEEPDEEP Mask */
+
+#define SCB_SCR_SLEEPONEXIT_Pos 1 /*!< SCB SCR: SLEEPONEXIT Position */
+#define SCB_SCR_SLEEPONEXIT_Msk (1ul << SCB_SCR_SLEEPONEXIT_Pos) /*!< SCB SCR: SLEEPONEXIT Mask */
+
+/* SCB Configuration Control Register Definitions */
+#define SCB_CCR_STKALIGN_Pos 9 /*!< SCB CCR: STKALIGN Position */
+#define SCB_CCR_STKALIGN_Msk (1ul << SCB_CCR_STKALIGN_Pos) /*!< SCB CCR: STKALIGN Mask */
+
+#define SCB_CCR_BFHFNMIGN_Pos 8 /*!< SCB CCR: BFHFNMIGN Position */
+#define SCB_CCR_BFHFNMIGN_Msk (1ul << SCB_CCR_BFHFNMIGN_Pos) /*!< SCB CCR: BFHFNMIGN Mask */
+
+#define SCB_CCR_DIV_0_TRP_Pos 4 /*!< SCB CCR: DIV_0_TRP Position */
+#define SCB_CCR_DIV_0_TRP_Msk (1ul << SCB_CCR_DIV_0_TRP_Pos) /*!< SCB CCR: DIV_0_TRP Mask */
+
+#define SCB_CCR_UNALIGN_TRP_Pos 3 /*!< SCB CCR: UNALIGN_TRP Position */
+#define SCB_CCR_UNALIGN_TRP_Msk (1ul << SCB_CCR_UNALIGN_TRP_Pos) /*!< SCB CCR: UNALIGN_TRP Mask */
+
+#define SCB_CCR_USERSETMPEND_Pos 1 /*!< SCB CCR: USERSETMPEND Position */
+#define SCB_CCR_USERSETMPEND_Msk (1ul << SCB_CCR_USERSETMPEND_Pos) /*!< SCB CCR: USERSETMPEND Mask */
+
+#define SCB_CCR_NONBASETHRDENA_Pos 0 /*!< SCB CCR: NONBASETHRDENA Position */
+#define SCB_CCR_NONBASETHRDENA_Msk (1ul << SCB_CCR_NONBASETHRDENA_Pos) /*!< SCB CCR: NONBASETHRDENA Mask */
+
+/* SCB System Handler Control and State Register Definitions */
+#define SCB_SHCSR_USGFAULTENA_Pos 18 /*!< SCB SHCSR: USGFAULTENA Position */
+#define SCB_SHCSR_USGFAULTENA_Msk (1ul << SCB_SHCSR_USGFAULTENA_Pos) /*!< SCB SHCSR: USGFAULTENA Mask */
+
+#define SCB_SHCSR_BUSFAULTENA_Pos 17 /*!< SCB SHCSR: BUSFAULTENA Position */
+#define SCB_SHCSR_BUSFAULTENA_Msk (1ul << SCB_SHCSR_BUSFAULTENA_Pos) /*!< SCB SHCSR: BUSFAULTENA Mask */
+
+#define SCB_SHCSR_MEMFAULTENA_Pos 16 /*!< SCB SHCSR: MEMFAULTENA Position */
+#define SCB_SHCSR_MEMFAULTENA_Msk (1ul << SCB_SHCSR_MEMFAULTENA_Pos) /*!< SCB SHCSR: MEMFAULTENA Mask */
+
+#define SCB_SHCSR_SVCALLPENDED_Pos 15 /*!< SCB SHCSR: SVCALLPENDED Position */
+#define SCB_SHCSR_SVCALLPENDED_Msk (1ul << SCB_SHCSR_SVCALLPENDED_Pos) /*!< SCB SHCSR: SVCALLPENDED Mask */
+
+#define SCB_SHCSR_BUSFAULTPENDED_Pos 14 /*!< SCB SHCSR: BUSFAULTPENDED Position */
+#define SCB_SHCSR_BUSFAULTPENDED_Msk (1ul << SCB_SHCSR_BUSFAULTPENDED_Pos) /*!< SCB SHCSR: BUSFAULTPENDED Mask */
+
+#define SCB_SHCSR_MEMFAULTPENDED_Pos 13 /*!< SCB SHCSR: MEMFAULTPENDED Position */
+#define SCB_SHCSR_MEMFAULTPENDED_Msk (1ul << SCB_SHCSR_MEMFAULTPENDED_Pos) /*!< SCB SHCSR: MEMFAULTPENDED Mask */
+
+#define SCB_SHCSR_USGFAULTPENDED_Pos 12 /*!< SCB SHCSR: USGFAULTPENDED Position */
+#define SCB_SHCSR_USGFAULTPENDED_Msk (1ul << SCB_SHCSR_USGFAULTPENDED_Pos) /*!< SCB SHCSR: USGFAULTPENDED Mask */
+
+#define SCB_SHCSR_SYSTICKACT_Pos 11 /*!< SCB SHCSR: SYSTICKACT Position */
+#define SCB_SHCSR_SYSTICKACT_Msk (1ul << SCB_SHCSR_SYSTICKACT_Pos) /*!< SCB SHCSR: SYSTICKACT Mask */
+
+#define SCB_SHCSR_PENDSVACT_Pos 10 /*!< SCB SHCSR: PENDSVACT Position */
+#define SCB_SHCSR_PENDSVACT_Msk (1ul << SCB_SHCSR_PENDSVACT_Pos) /*!< SCB SHCSR: PENDSVACT Mask */
+
+#define SCB_SHCSR_MONITORACT_Pos 8 /*!< SCB SHCSR: MONITORACT Position */
+#define SCB_SHCSR_MONITORACT_Msk (1ul << SCB_SHCSR_MONITORACT_Pos) /*!< SCB SHCSR: MONITORACT Mask */
+
+#define SCB_SHCSR_SVCALLACT_Pos 7 /*!< SCB SHCSR: SVCALLACT Position */
+#define SCB_SHCSR_SVCALLACT_Msk (1ul << SCB_SHCSR_SVCALLACT_Pos) /*!< SCB SHCSR: SVCALLACT Mask */
+
+#define SCB_SHCSR_USGFAULTACT_Pos 3 /*!< SCB SHCSR: USGFAULTACT Position */
+#define SCB_SHCSR_USGFAULTACT_Msk (1ul << SCB_SHCSR_USGFAULTACT_Pos) /*!< SCB SHCSR: USGFAULTACT Mask */
+
+#define SCB_SHCSR_BUSFAULTACT_Pos 1 /*!< SCB SHCSR: BUSFAULTACT Position */
+#define SCB_SHCSR_BUSFAULTACT_Msk (1ul << SCB_SHCSR_BUSFAULTACT_Pos) /*!< SCB SHCSR: BUSFAULTACT Mask */
+
+#define SCB_SHCSR_MEMFAULTACT_Pos 0 /*!< SCB SHCSR: MEMFAULTACT Position */
+#define SCB_SHCSR_MEMFAULTACT_Msk (1ul << SCB_SHCSR_MEMFAULTACT_Pos) /*!< SCB SHCSR: MEMFAULTACT Mask */
+
+/* SCB Configurable Fault Status Registers Definitions */
+#define SCB_CFSR_USGFAULTSR_Pos 16 /*!< SCB CFSR: Usage Fault Status Register Position */
+#define SCB_CFSR_USGFAULTSR_Msk (0xFFFFul << SCB_CFSR_USGFAULTSR_Pos) /*!< SCB CFSR: Usage Fault Status Register Mask */
+
+#define SCB_CFSR_BUSFAULTSR_Pos 8 /*!< SCB CFSR: Bus Fault Status Register Position */
+#define SCB_CFSR_BUSFAULTSR_Msk (0xFFul << SCB_CFSR_BUSFAULTSR_Pos) /*!< SCB CFSR: Bus Fault Status Register Mask */
+
+#define SCB_CFSR_MEMFAULTSR_Pos 0 /*!< SCB CFSR: Memory Manage Fault Status Register Position */
+#define SCB_CFSR_MEMFAULTSR_Msk (0xFFul << SCB_CFSR_MEMFAULTSR_Pos) /*!< SCB CFSR: Memory Manage Fault Status Register Mask */
+
+/* SCB Hard Fault Status Registers Definitions */
+#define SCB_HFSR_DEBUGEVT_Pos 31 /*!< SCB HFSR: DEBUGEVT Position */
+#define SCB_HFSR_DEBUGEVT_Msk (1ul << SCB_HFSR_DEBUGEVT_Pos) /*!< SCB HFSR: DEBUGEVT Mask */
+
+#define SCB_HFSR_FORCED_Pos 30 /*!< SCB HFSR: FORCED Position */
+#define SCB_HFSR_FORCED_Msk (1ul << SCB_HFSR_FORCED_Pos) /*!< SCB HFSR: FORCED Mask */
+
+#define SCB_HFSR_VECTTBL_Pos 1 /*!< SCB HFSR: VECTTBL Position */
+#define SCB_HFSR_VECTTBL_Msk (1ul << SCB_HFSR_VECTTBL_Pos) /*!< SCB HFSR: VECTTBL Mask */
+
+/* SCB Debug Fault Status Register Definitions */
+#define SCB_DFSR_EXTERNAL_Pos 4 /*!< SCB DFSR: EXTERNAL Position */
+#define SCB_DFSR_EXTERNAL_Msk (1ul << SCB_DFSR_EXTERNAL_Pos) /*!< SCB DFSR: EXTERNAL Mask */
+
+#define SCB_DFSR_VCATCH_Pos 3 /*!< SCB DFSR: VCATCH Position */
+#define SCB_DFSR_VCATCH_Msk (1ul << SCB_DFSR_VCATCH_Pos) /*!< SCB DFSR: VCATCH Mask */
+
+#define SCB_DFSR_DWTTRAP_Pos 2 /*!< SCB DFSR: DWTTRAP Position */
+#define SCB_DFSR_DWTTRAP_Msk (1ul << SCB_DFSR_DWTTRAP_Pos) /*!< SCB DFSR: DWTTRAP Mask */
+
+#define SCB_DFSR_BKPT_Pos 1 /*!< SCB DFSR: BKPT Position */
+#define SCB_DFSR_BKPT_Msk (1ul << SCB_DFSR_BKPT_Pos) /*!< SCB DFSR: BKPT Mask */
+
+#define SCB_DFSR_HALTED_Pos 0 /*!< SCB DFSR: HALTED Position */
+#define SCB_DFSR_HALTED_Msk (1ul << SCB_DFSR_HALTED_Pos) /*!< SCB DFSR: HALTED Mask */
+/*@}*/ /* end of group CMSIS_CM3_SCB */
+
+
+/** @addtogroup CMSIS_CM3_SysTick CMSIS CM3 SysTick
+ memory mapped structure for SysTick
+ @{
+ */
+typedef struct
+{
+ __IO uint32_t CTRL; /*!< Offset: 0x00 SysTick Control and Status Register */
+ __IO uint32_t LOAD; /*!< Offset: 0x04 SysTick Reload Value Register */
+ __IO uint32_t VAL; /*!< Offset: 0x08 SysTick Current Value Register */
+ __I uint32_t CALIB; /*!< Offset: 0x0C SysTick Calibration Register */
+} SysTick_Type;
+
+/* SysTick Control / Status Register Definitions */
+#define SysTick_CTRL_COUNTFLAG_Pos 16 /*!< SysTick CTRL: COUNTFLAG Position */
+#define SysTick_CTRL_COUNTFLAG_Msk (1ul << SysTick_CTRL_COUNTFLAG_Pos) /*!< SysTick CTRL: COUNTFLAG Mask */
+
+#define SysTick_CTRL_CLKSOURCE_Pos 2 /*!< SysTick CTRL: CLKSOURCE Position */
+#define SysTick_CTRL_CLKSOURCE_Msk (1ul << SysTick_CTRL_CLKSOURCE_Pos) /*!< SysTick CTRL: CLKSOURCE Mask */
+
+#define SysTick_CTRL_TICKINT_Pos 1 /*!< SysTick CTRL: TICKINT Position */
+#define SysTick_CTRL_TICKINT_Msk (1ul << SysTick_CTRL_TICKINT_Pos) /*!< SysTick CTRL: TICKINT Mask */
+
+#define SysTick_CTRL_ENABLE_Pos 0 /*!< SysTick CTRL: ENABLE Position */
+#define SysTick_CTRL_ENABLE_Msk (1ul << SysTick_CTRL_ENABLE_Pos) /*!< SysTick CTRL: ENABLE Mask */
+
+/* SysTick Reload Register Definitions */
+#define SysTick_LOAD_RELOAD_Pos 0 /*!< SysTick LOAD: RELOAD Position */
+#define SysTick_LOAD_RELOAD_Msk (0xFFFFFFul << SysTick_LOAD_RELOAD_Pos) /*!< SysTick LOAD: RELOAD Mask */
+
+/* SysTick Current Register Definitions */
+#define SysTick_VAL_CURRENT_Pos 0 /*!< SysTick VAL: CURRENT Position */
+#define SysTick_VAL_CURRENT_Msk (0xFFFFFFul << SysTick_VAL_CURRENT_Pos) /*!< SysTick VAL: CURRENT Mask */
+
+/* SysTick Calibration Register Definitions */
+#define SysTick_CALIB_NOREF_Pos 31 /*!< SysTick CALIB: NOREF Position */
+#define SysTick_CALIB_NOREF_Msk (1ul << SysTick_CALIB_NOREF_Pos) /*!< SysTick CALIB: NOREF Mask */
+
+#define SysTick_CALIB_SKEW_Pos 30 /*!< SysTick CALIB: SKEW Position */
+#define SysTick_CALIB_SKEW_Msk (1ul << SysTick_CALIB_SKEW_Pos) /*!< SysTick CALIB: SKEW Mask */
+
+#define SysTick_CALIB_TENMS_Pos 0 /*!< SysTick CALIB: TENMS Position */
+#define SysTick_CALIB_TENMS_Msk (0xFFFFFFul << SysTick_VAL_CURRENT_Pos) /*!< SysTick CALIB: TENMS Mask */
+/*@}*/ /* end of group CMSIS_CM3_SysTick */
+
+
+/** @addtogroup CMSIS_CM3_ITM CMSIS CM3 ITM
+ memory mapped structure for Instrumentation Trace Macrocell (ITM)
+ @{
+ */
+typedef struct
+{
+ __O union
+ {
+ __O uint8_t u8; /*!< Offset: ITM Stimulus Port 8-bit */
+ __O uint16_t u16; /*!< Offset: ITM Stimulus Port 16-bit */
+ __O uint32_t u32; /*!< Offset: ITM Stimulus Port 32-bit */
+ } PORT [32]; /*!< Offset: 0x00 ITM Stimulus Port Registers */
+ uint32_t RESERVED0[864];
+ __IO uint32_t TER; /*!< Offset: ITM Trace Enable Register */
+ uint32_t RESERVED1[15];
+ __IO uint32_t TPR; /*!< Offset: ITM Trace Privilege Register */
+ uint32_t RESERVED2[15];
+ __IO uint32_t TCR; /*!< Offset: ITM Trace Control Register */
+ uint32_t RESERVED3[29];
+ __IO uint32_t IWR; /*!< Offset: ITM Integration Write Register */
+ __IO uint32_t IRR; /*!< Offset: ITM Integration Read Register */
+ __IO uint32_t IMCR; /*!< Offset: ITM Integration Mode Control Register */
+ uint32_t RESERVED4[43];
+ __IO uint32_t LAR; /*!< Offset: ITM Lock Access Register */
+ __IO uint32_t LSR; /*!< Offset: ITM Lock Status Register */
+ uint32_t RESERVED5[6];
+ __I uint32_t PID4; /*!< Offset: ITM Peripheral Identification Register #4 */
+ __I uint32_t PID5; /*!< Offset: ITM Peripheral Identification Register #5 */
+ __I uint32_t PID6; /*!< Offset: ITM Peripheral Identification Register #6 */
+ __I uint32_t PID7; /*!< Offset: ITM Peripheral Identification Register #7 */
+ __I uint32_t PID0; /*!< Offset: ITM Peripheral Identification Register #0 */
+ __I uint32_t PID1; /*!< Offset: ITM Peripheral Identification Register #1 */
+ __I uint32_t PID2; /*!< Offset: ITM Peripheral Identification Register #2 */
+ __I uint32_t PID3; /*!< Offset: ITM Peripheral Identification Register #3 */
+ __I uint32_t CID0; /*!< Offset: ITM Component Identification Register #0 */
+ __I uint32_t CID1; /*!< Offset: ITM Component Identification Register #1 */
+ __I uint32_t CID2; /*!< Offset: ITM Component Identification Register #2 */
+ __I uint32_t CID3; /*!< Offset: ITM Component Identification Register #3 */
+} ITM_Type;
+
+/* ITM Trace Privilege Register Definitions */
+#define ITM_TPR_PRIVMASK_Pos 0 /*!< ITM TPR: PRIVMASK Position */
+#define ITM_TPR_PRIVMASK_Msk (0xFul << ITM_TPR_PRIVMASK_Pos) /*!< ITM TPR: PRIVMASK Mask */
+
+/* ITM Trace Control Register Definitions */
+#define ITM_TCR_BUSY_Pos 23 /*!< ITM TCR: BUSY Position */
+#define ITM_TCR_BUSY_Msk (1ul << ITM_TCR_BUSY_Pos) /*!< ITM TCR: BUSY Mask */
+
+#define ITM_TCR_ATBID_Pos 16 /*!< ITM TCR: ATBID Position */
+#define ITM_TCR_ATBID_Msk (0x7Ful << ITM_TCR_ATBID_Pos) /*!< ITM TCR: ATBID Mask */
+
+#define ITM_TCR_TSPrescale_Pos 8 /*!< ITM TCR: TSPrescale Position */
+#define ITM_TCR_TSPrescale_Msk (3ul << ITM_TCR_TSPrescale_Pos) /*!< ITM TCR: TSPrescale Mask */
+
+#define ITM_TCR_SWOENA_Pos 4 /*!< ITM TCR: SWOENA Position */
+#define ITM_TCR_SWOENA_Msk (1ul << ITM_TCR_SWOENA_Pos) /*!< ITM TCR: SWOENA Mask */
+
+#define ITM_TCR_DWTENA_Pos 3 /*!< ITM TCR: DWTENA Position */
+#define ITM_TCR_DWTENA_Msk (1ul << ITM_TCR_DWTENA_Pos) /*!< ITM TCR: DWTENA Mask */
+
+#define ITM_TCR_SYNCENA_Pos 2 /*!< ITM TCR: SYNCENA Position */
+#define ITM_TCR_SYNCENA_Msk (1ul << ITM_TCR_SYNCENA_Pos) /*!< ITM TCR: SYNCENA Mask */
+
+#define ITM_TCR_TSENA_Pos 1 /*!< ITM TCR: TSENA Position */
+#define ITM_TCR_TSENA_Msk (1ul << ITM_TCR_TSENA_Pos) /*!< ITM TCR: TSENA Mask */
+
+#define ITM_TCR_ITMENA_Pos 0 /*!< ITM TCR: ITM Enable bit Position */
+#define ITM_TCR_ITMENA_Msk (1ul << ITM_TCR_ITMENA_Pos) /*!< ITM TCR: ITM Enable bit Mask */
+
+/* ITM Integration Write Register Definitions */
+#define ITM_IWR_ATVALIDM_Pos 0 /*!< ITM IWR: ATVALIDM Position */
+#define ITM_IWR_ATVALIDM_Msk (1ul << ITM_IWR_ATVALIDM_Pos) /*!< ITM IWR: ATVALIDM Mask */
+
+/* ITM Integration Read Register Definitions */
+#define ITM_IRR_ATREADYM_Pos 0 /*!< ITM IRR: ATREADYM Position */
+#define ITM_IRR_ATREADYM_Msk (1ul << ITM_IRR_ATREADYM_Pos) /*!< ITM IRR: ATREADYM Mask */
+
+/* ITM Integration Mode Control Register Definitions */
+#define ITM_IMCR_INTEGRATION_Pos 0 /*!< ITM IMCR: INTEGRATION Position */
+#define ITM_IMCR_INTEGRATION_Msk (1ul << ITM_IMCR_INTEGRATION_Pos) /*!< ITM IMCR: INTEGRATION Mask */
+
+/* ITM Lock Status Register Definitions */
+#define ITM_LSR_ByteAcc_Pos 2 /*!< ITM LSR: ByteAcc Position */
+#define ITM_LSR_ByteAcc_Msk (1ul << ITM_LSR_ByteAcc_Pos) /*!< ITM LSR: ByteAcc Mask */
+
+#define ITM_LSR_Access_Pos 1 /*!< ITM LSR: Access Position */
+#define ITM_LSR_Access_Msk (1ul << ITM_LSR_Access_Pos) /*!< ITM LSR: Access Mask */
+
+#define ITM_LSR_Present_Pos 0 /*!< ITM LSR: Present Position */
+#define ITM_LSR_Present_Msk (1ul << ITM_LSR_Present_Pos) /*!< ITM LSR: Present Mask */
+/*@}*/ /* end of group CMSIS_CM3_ITM */
+
+
+/** @addtogroup CMSIS_CM3_InterruptType CMSIS CM3 Interrupt Type
+ memory mapped structure for Interrupt Type
+ @{
+ */
+typedef struct
+{
+ uint32_t RESERVED0;
+ __I uint32_t ICTR; /*!< Offset: 0x04 Interrupt Control Type Register */
+#if ((defined __CM3_REV) && (__CM3_REV >= 0x200))
+ __IO uint32_t ACTLR; /*!< Offset: 0x08 Auxiliary Control Register */
+#else
+ uint32_t RESERVED1;
+#endif
+} InterruptType_Type;
+
+/* Interrupt Controller Type Register Definitions */
+#define InterruptType_ICTR_INTLINESNUM_Pos 0 /*!< InterruptType ICTR: INTLINESNUM Position */
+#define InterruptType_ICTR_INTLINESNUM_Msk (0x1Ful << InterruptType_ICTR_INTLINESNUM_Pos) /*!< InterruptType ICTR: INTLINESNUM Mask */
+
+/* Auxiliary Control Register Definitions */
+#define InterruptType_ACTLR_DISFOLD_Pos 2 /*!< InterruptType ACTLR: DISFOLD Position */
+#define InterruptType_ACTLR_DISFOLD_Msk (1ul << InterruptType_ACTLR_DISFOLD_Pos) /*!< InterruptType ACTLR: DISFOLD Mask */
+
+#define InterruptType_ACTLR_DISDEFWBUF_Pos 1 /*!< InterruptType ACTLR: DISDEFWBUF Position */
+#define InterruptType_ACTLR_DISDEFWBUF_Msk (1ul << InterruptType_ACTLR_DISDEFWBUF_Pos) /*!< InterruptType ACTLR: DISDEFWBUF Mask */
+
+#define InterruptType_ACTLR_DISMCYCINT_Pos 0 /*!< InterruptType ACTLR: DISMCYCINT Position */
+#define InterruptType_ACTLR_DISMCYCINT_Msk (1ul << InterruptType_ACTLR_DISMCYCINT_Pos) /*!< InterruptType ACTLR: DISMCYCINT Mask */
+/*@}*/ /* end of group CMSIS_CM3_InterruptType */
+
+
+#if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1)
+/** @addtogroup CMSIS_CM3_MPU CMSIS CM3 MPU
+ memory mapped structure for Memory Protection Unit (MPU)
+ @{
+ */
+typedef struct
+{
+ __I uint32_t TYPE; /*!< Offset: 0x00 MPU Type Register */
+ __IO uint32_t CTRL; /*!< Offset: 0x04 MPU Control Register */
+ __IO uint32_t RNR; /*!< Offset: 0x08 MPU Region RNRber Register */
+ __IO uint32_t RBAR; /*!< Offset: 0x0C MPU Region Base Address Register */
+ __IO uint32_t RASR; /*!< Offset: 0x10 MPU Region Attribute and Size Register */
+ __IO uint32_t RBAR_A1; /*!< Offset: 0x14 MPU Alias 1 Region Base Address Register */
+ __IO uint32_t RASR_A1; /*!< Offset: 0x18 MPU Alias 1 Region Attribute and Size Register */
+ __IO uint32_t RBAR_A2; /*!< Offset: 0x1C MPU Alias 2 Region Base Address Register */
+ __IO uint32_t RASR_A2; /*!< Offset: 0x20 MPU Alias 2 Region Attribute and Size Register */
+ __IO uint32_t RBAR_A3; /*!< Offset: 0x24 MPU Alias 3 Region Base Address Register */
+ __IO uint32_t RASR_A3; /*!< Offset: 0x28 MPU Alias 3 Region Attribute and Size Register */
+} MPU_Type;
+
+/* MPU Type Register */
+#define MPU_TYPE_IREGION_Pos 16 /*!< MPU TYPE: IREGION Position */
+#define MPU_TYPE_IREGION_Msk (0xFFul << MPU_TYPE_IREGION_Pos) /*!< MPU TYPE: IREGION Mask */
+
+#define MPU_TYPE_DREGION_Pos 8 /*!< MPU TYPE: DREGION Position */
+#define MPU_TYPE_DREGION_Msk (0xFFul << MPU_TYPE_DREGION_Pos) /*!< MPU TYPE: DREGION Mask */
+
+#define MPU_TYPE_SEPARATE_Pos 0 /*!< MPU TYPE: SEPARATE Position */
+#define MPU_TYPE_SEPARATE_Msk (1ul << MPU_TYPE_SEPARATE_Pos) /*!< MPU TYPE: SEPARATE Mask */
+
+/* MPU Control Register */
+#define MPU_CTRL_PRIVDEFENA_Pos 2 /*!< MPU CTRL: PRIVDEFENA Position */
+#define MPU_CTRL_PRIVDEFENA_Msk (1ul << MPU_CTRL_PRIVDEFENA_Pos) /*!< MPU CTRL: PRIVDEFENA Mask */
+
+#define MPU_CTRL_HFNMIENA_Pos 1 /*!< MPU CTRL: HFNMIENA Position */
+#define MPU_CTRL_HFNMIENA_Msk (1ul << MPU_CTRL_HFNMIENA_Pos) /*!< MPU CTRL: HFNMIENA Mask */
+
+#define MPU_CTRL_ENABLE_Pos 0 /*!< MPU CTRL: ENABLE Position */
+#define MPU_CTRL_ENABLE_Msk (1ul << MPU_CTRL_ENABLE_Pos) /*!< MPU CTRL: ENABLE Mask */
+
+/* MPU Region Number Register */
+#define MPU_RNR_REGION_Pos 0 /*!< MPU RNR: REGION Position */
+#define MPU_RNR_REGION_Msk (0xFFul << MPU_RNR_REGION_Pos) /*!< MPU RNR: REGION Mask */
+
+/* MPU Region Base Address Register */
+#define MPU_RBAR_ADDR_Pos 5 /*!< MPU RBAR: ADDR Position */
+#define MPU_RBAR_ADDR_Msk (0x7FFFFFFul << MPU_RBAR_ADDR_Pos) /*!< MPU RBAR: ADDR Mask */
+
+#define MPU_RBAR_VALID_Pos 4 /*!< MPU RBAR: VALID Position */
+#define MPU_RBAR_VALID_Msk (1ul << MPU_RBAR_VALID_Pos) /*!< MPU RBAR: VALID Mask */
+
+#define MPU_RBAR_REGION_Pos 0 /*!< MPU RBAR: REGION Position */
+#define MPU_RBAR_REGION_Msk (0xFul << MPU_RBAR_REGION_Pos) /*!< MPU RBAR: REGION Mask */
+
+/* MPU Region Attribute and Size Register */
+#define MPU_RASR_XN_Pos 28 /*!< MPU RASR: XN Position */
+#define MPU_RASR_XN_Msk (1ul << MPU_RASR_XN_Pos) /*!< MPU RASR: XN Mask */
+
+#define MPU_RASR_AP_Pos 24 /*!< MPU RASR: AP Position */
+#define MPU_RASR_AP_Msk (7ul << MPU_RASR_AP_Pos) /*!< MPU RASR: AP Mask */
+
+#define MPU_RASR_TEX_Pos 19 /*!< MPU RASR: TEX Position */
+#define MPU_RASR_TEX_Msk (7ul << MPU_RASR_TEX_Pos) /*!< MPU RASR: TEX Mask */
+
+#define MPU_RASR_S_Pos 18 /*!< MPU RASR: Shareable bit Position */
+#define MPU_RASR_S_Msk (1ul << MPU_RASR_S_Pos) /*!< MPU RASR: Shareable bit Mask */
+
+#define MPU_RASR_C_Pos 17 /*!< MPU RASR: Cacheable bit Position */
+#define MPU_RASR_C_Msk (1ul << MPU_RASR_C_Pos) /*!< MPU RASR: Cacheable bit Mask */
+
+#define MPU_RASR_B_Pos 16 /*!< MPU RASR: Bufferable bit Position */
+#define MPU_RASR_B_Msk (1ul << MPU_RASR_B_Pos) /*!< MPU RASR: Bufferable bit Mask */
+
+#define MPU_RASR_SRD_Pos 8 /*!< MPU RASR: Sub-Region Disable Position */
+#define MPU_RASR_SRD_Msk (0xFFul << MPU_RASR_SRD_Pos) /*!< MPU RASR: Sub-Region Disable Mask */
+
+#define MPU_RASR_SIZE_Pos 1 /*!< MPU RASR: Region Size Field Position */
+#define MPU_RASR_SIZE_Msk (0x1Ful << MPU_RASR_SIZE_Pos) /*!< MPU RASR: Region Size Field Mask */
+
+#define MPU_RASR_ENA_Pos 0 /*!< MPU RASR: Region enable bit Position */
+#define MPU_RASR_ENA_Msk (0x1Ful << MPU_RASR_ENA_Pos) /*!< MPU RASR: Region enable bit Disable Mask */
+
+/*@}*/ /* end of group CMSIS_CM3_MPU */
+#endif
+
+
+/** @addtogroup CMSIS_CM3_CoreDebug CMSIS CM3 Core Debug
+ memory mapped structure for Core Debug Register
+ @{
+ */
+typedef struct
+{
+ __IO uint32_t DHCSR; /*!< Offset: 0x00 Debug Halting Control and Status Register */
+ __O uint32_t DCRSR; /*!< Offset: 0x04 Debug Core Register Selector Register */
+ __IO uint32_t DCRDR; /*!< Offset: 0x08 Debug Core Register Data Register */
+ __IO uint32_t DEMCR; /*!< Offset: 0x0C Debug Exception and Monitor Control Register */
+} CoreDebug_Type;
+
+/* Debug Halting Control and Status Register */
+#define CoreDebug_DHCSR_DBGKEY_Pos 16 /*!< CoreDebug DHCSR: DBGKEY Position */
+#define CoreDebug_DHCSR_DBGKEY_Msk (0xFFFFul << CoreDebug_DHCSR_DBGKEY_Pos) /*!< CoreDebug DHCSR: DBGKEY Mask */
+
+#define CoreDebug_DHCSR_S_RESET_ST_Pos 25 /*!< CoreDebug DHCSR: S_RESET_ST Position */
+#define CoreDebug_DHCSR_S_RESET_ST_Msk (1ul << CoreDebug_DHCSR_S_RESET_ST_Pos) /*!< CoreDebug DHCSR: S_RESET_ST Mask */
+
+#define CoreDebug_DHCSR_S_RETIRE_ST_Pos 24 /*!< CoreDebug DHCSR: S_RETIRE_ST Position */
+#define CoreDebug_DHCSR_S_RETIRE_ST_Msk (1ul << CoreDebug_DHCSR_S_RETIRE_ST_Pos) /*!< CoreDebug DHCSR: S_RETIRE_ST Mask */
+
+#define CoreDebug_DHCSR_S_LOCKUP_Pos 19 /*!< CoreDebug DHCSR: S_LOCKUP Position */
+#define CoreDebug_DHCSR_S_LOCKUP_Msk (1ul << CoreDebug_DHCSR_S_LOCKUP_Pos) /*!< CoreDebug DHCSR: S_LOCKUP Mask */
+
+#define CoreDebug_DHCSR_S_SLEEP_Pos 18 /*!< CoreDebug DHCSR: S_SLEEP Position */
+#define CoreDebug_DHCSR_S_SLEEP_Msk (1ul << CoreDebug_DHCSR_S_SLEEP_Pos) /*!< CoreDebug DHCSR: S_SLEEP Mask */
+
+#define CoreDebug_DHCSR_S_HALT_Pos 17 /*!< CoreDebug DHCSR: S_HALT Position */
+#define CoreDebug_DHCSR_S_HALT_Msk (1ul << CoreDebug_DHCSR_S_HALT_Pos) /*!< CoreDebug DHCSR: S_HALT Mask */
+
+#define CoreDebug_DHCSR_S_REGRDY_Pos 16 /*!< CoreDebug DHCSR: S_REGRDY Position */
+#define CoreDebug_DHCSR_S_REGRDY_Msk (1ul << CoreDebug_DHCSR_S_REGRDY_Pos) /*!< CoreDebug DHCSR: S_REGRDY Mask */
+
+#define CoreDebug_DHCSR_C_SNAPSTALL_Pos 5 /*!< CoreDebug DHCSR: C_SNAPSTALL Position */
+#define CoreDebug_DHCSR_C_SNAPSTALL_Msk (1ul << CoreDebug_DHCSR_C_SNAPSTALL_Pos) /*!< CoreDebug DHCSR: C_SNAPSTALL Mask */
+
+#define CoreDebug_DHCSR_C_MASKINTS_Pos 3 /*!< CoreDebug DHCSR: C_MASKINTS Position */
+#define CoreDebug_DHCSR_C_MASKINTS_Msk (1ul << CoreDebug_DHCSR_C_MASKINTS_Pos) /*!< CoreDebug DHCSR: C_MASKINTS Mask */
+
+#define CoreDebug_DHCSR_C_STEP_Pos 2 /*!< CoreDebug DHCSR: C_STEP Position */
+#define CoreDebug_DHCSR_C_STEP_Msk (1ul << CoreDebug_DHCSR_C_STEP_Pos) /*!< CoreDebug DHCSR: C_STEP Mask */
+
+#define CoreDebug_DHCSR_C_HALT_Pos 1 /*!< CoreDebug DHCSR: C_HALT Position */
+#define CoreDebug_DHCSR_C_HALT_Msk (1ul << CoreDebug_DHCSR_C_HALT_Pos) /*!< CoreDebug DHCSR: C_HALT Mask */
+
+#define CoreDebug_DHCSR_C_DEBUGEN_Pos 0 /*!< CoreDebug DHCSR: C_DEBUGEN Position */
+#define CoreDebug_DHCSR_C_DEBUGEN_Msk (1ul << CoreDebug_DHCSR_C_DEBUGEN_Pos) /*!< CoreDebug DHCSR: C_DEBUGEN Mask */
+
+/* Debug Core Register Selector Register */
+#define CoreDebug_DCRSR_REGWnR_Pos 16 /*!< CoreDebug DCRSR: REGWnR Position */
+#define CoreDebug_DCRSR_REGWnR_Msk (1ul << CoreDebug_DCRSR_REGWnR_Pos) /*!< CoreDebug DCRSR: REGWnR Mask */
+
+#define CoreDebug_DCRSR_REGSEL_Pos 0 /*!< CoreDebug DCRSR: REGSEL Position */
+#define CoreDebug_DCRSR_REGSEL_Msk (0x1Ful << CoreDebug_DCRSR_REGSEL_Pos) /*!< CoreDebug DCRSR: REGSEL Mask */
+
+/* Debug Exception and Monitor Control Register */
+#define CoreDebug_DEMCR_TRCENA_Pos 24 /*!< CoreDebug DEMCR: TRCENA Position */
+#define CoreDebug_DEMCR_TRCENA_Msk (1ul << CoreDebug_DEMCR_TRCENA_Pos) /*!< CoreDebug DEMCR: TRCENA Mask */
+
+#define CoreDebug_DEMCR_MON_REQ_Pos 19 /*!< CoreDebug DEMCR: MON_REQ Position */
+#define CoreDebug_DEMCR_MON_REQ_Msk (1ul << CoreDebug_DEMCR_MON_REQ_Pos) /*!< CoreDebug DEMCR: MON_REQ Mask */
+
+#define CoreDebug_DEMCR_MON_STEP_Pos 18 /*!< CoreDebug DEMCR: MON_STEP Position */
+#define CoreDebug_DEMCR_MON_STEP_Msk (1ul << CoreDebug_DEMCR_MON_STEP_Pos) /*!< CoreDebug DEMCR: MON_STEP Mask */
+
+#define CoreDebug_DEMCR_MON_PEND_Pos 17 /*!< CoreDebug DEMCR: MON_PEND Position */
+#define CoreDebug_DEMCR_MON_PEND_Msk (1ul << CoreDebug_DEMCR_MON_PEND_Pos) /*!< CoreDebug DEMCR: MON_PEND Mask */
+
+#define CoreDebug_DEMCR_MON_EN_Pos 16 /*!< CoreDebug DEMCR: MON_EN Position */
+#define CoreDebug_DEMCR_MON_EN_Msk (1ul << CoreDebug_DEMCR_MON_EN_Pos) /*!< CoreDebug DEMCR: MON_EN Mask */
+
+#define CoreDebug_DEMCR_VC_HARDERR_Pos 10 /*!< CoreDebug DEMCR: VC_HARDERR Position */
+#define CoreDebug_DEMCR_VC_HARDERR_Msk (1ul << CoreDebug_DEMCR_VC_HARDERR_Pos) /*!< CoreDebug DEMCR: VC_HARDERR Mask */
+
+#define CoreDebug_DEMCR_VC_INTERR_Pos 9 /*!< CoreDebug DEMCR: VC_INTERR Position */
+#define CoreDebug_DEMCR_VC_INTERR_Msk (1ul << CoreDebug_DEMCR_VC_INTERR_Pos) /*!< CoreDebug DEMCR: VC_INTERR Mask */
+
+#define CoreDebug_DEMCR_VC_BUSERR_Pos 8 /*!< CoreDebug DEMCR: VC_BUSERR Position */
+#define CoreDebug_DEMCR_VC_BUSERR_Msk (1ul << CoreDebug_DEMCR_VC_BUSERR_Pos) /*!< CoreDebug DEMCR: VC_BUSERR Mask */
+
+#define CoreDebug_DEMCR_VC_STATERR_Pos 7 /*!< CoreDebug DEMCR: VC_STATERR Position */
+#define CoreDebug_DEMCR_VC_STATERR_Msk (1ul << CoreDebug_DEMCR_VC_STATERR_Pos) /*!< CoreDebug DEMCR: VC_STATERR Mask */
+
+#define CoreDebug_DEMCR_VC_CHKERR_Pos 6 /*!< CoreDebug DEMCR: VC_CHKERR Position */
+#define CoreDebug_DEMCR_VC_CHKERR_Msk (1ul << CoreDebug_DEMCR_VC_CHKERR_Pos) /*!< CoreDebug DEMCR: VC_CHKERR Mask */
+
+#define CoreDebug_DEMCR_VC_NOCPERR_Pos 5 /*!< CoreDebug DEMCR: VC_NOCPERR Position */
+#define CoreDebug_DEMCR_VC_NOCPERR_Msk (1ul << CoreDebug_DEMCR_VC_NOCPERR_Pos) /*!< CoreDebug DEMCR: VC_NOCPERR Mask */
+
+#define CoreDebug_DEMCR_VC_MMERR_Pos 4 /*!< CoreDebug DEMCR: VC_MMERR Position */
+#define CoreDebug_DEMCR_VC_MMERR_Msk (1ul << CoreDebug_DEMCR_VC_MMERR_Pos) /*!< CoreDebug DEMCR: VC_MMERR Mask */
+
+#define CoreDebug_DEMCR_VC_CORERESET_Pos 0 /*!< CoreDebug DEMCR: VC_CORERESET Position */
+#define CoreDebug_DEMCR_VC_CORERESET_Msk (1ul << CoreDebug_DEMCR_VC_CORERESET_Pos) /*!< CoreDebug DEMCR: VC_CORERESET Mask */
+/*@}*/ /* end of group CMSIS_CM3_CoreDebug */
+
+
+/* Memory mapping of Cortex-M3 Hardware */
+#define SCS_BASE (0xE000E000) /*!< System Control Space Base Address */
+#define ITM_BASE (0xE0000000) /*!< ITM Base Address */
+#define CoreDebug_BASE (0xE000EDF0) /*!< Core Debug Base Address */
+#define SysTick_BASE (SCS_BASE + 0x0010) /*!< SysTick Base Address */
+#define NVIC_BASE (SCS_BASE + 0x0100) /*!< NVIC Base Address */
+#define SCB_BASE (SCS_BASE + 0x0D00) /*!< System Control Block Base Address */
+
+#define InterruptType ((InterruptType_Type *) SCS_BASE) /*!< Interrupt Type Register */
+#define SCB ((SCB_Type *) SCB_BASE) /*!< SCB configuration struct */
+#define SysTick ((SysTick_Type *) SysTick_BASE) /*!< SysTick configuration struct */
+#define NVIC ((NVIC_Type *) NVIC_BASE) /*!< NVIC configuration struct */
+#define ITM ((ITM_Type *) ITM_BASE) /*!< ITM configuration struct */
+#define CoreDebug ((CoreDebug_Type *) CoreDebug_BASE) /*!< Core Debug configuration struct */
+
+#if defined (__MPU_PRESENT) && (__MPU_PRESENT == 1)
+ #define MPU_BASE (SCS_BASE + 0x0D90) /*!< Memory Protection Unit */
+ #define MPU ((MPU_Type*) MPU_BASE) /*!< Memory Protection Unit */
+#endif
+
+/*@}*/ /* end of group CMSIS_CM3_core_register */
+
+
+/*******************************************************************************
+ * Hardware Abstraction Layer
+ ******************************************************************************/
+
+#if defined ( __CC_ARM )
+ #define __ASM __asm /*!< asm keyword for ARM Compiler */
+ #define __INLINE __inline /*!< inline keyword for ARM Compiler */
+
+#elif defined ( __ICCARM__ )
+ #define __ASM __asm /*!< asm keyword for IAR Compiler */
+ #define __INLINE inline /*!< inline keyword for IAR Compiler. Only avaiable in High optimization mode! */
+
+#elif defined ( __GNUC__ )
+ #define __ASM __asm /*!< asm keyword for GNU Compiler */
+ #define __INLINE inline /*!< inline keyword for GNU Compiler */
+
+#elif defined ( __TASKING__ )
+ #define __ASM __asm /*!< asm keyword for TASKING Compiler */
+ #define __INLINE inline /*!< inline keyword for TASKING Compiler */
+
+#endif
+
+
+/* ################### Compiler specific Intrinsics ########################### */
+
+#if defined ( __CC_ARM ) /*------------------RealView Compiler -----------------*/
+/* ARM armcc specific functions */
+
+#define __enable_fault_irq __enable_fiq
+#define __disable_fault_irq __disable_fiq
+
+#define __NOP __nop
+#define __WFI __wfi
+#define __WFE __wfe
+#define __SEV __sev
+#define __ISB() __isb(0)
+#define __DSB() __dsb(0)
+#define __DMB() __dmb(0)
+#define __REV __rev
+#define __RBIT __rbit
+#define __LDREXB(ptr) ((unsigned char ) __ldrex(ptr))
+#define __LDREXH(ptr) ((unsigned short) __ldrex(ptr))
+#define __LDREXW(ptr) ((unsigned int ) __ldrex(ptr))
+#define __STREXB(value, ptr) __strex(value, ptr)
+#define __STREXH(value, ptr) __strex(value, ptr)
+#define __STREXW(value, ptr) __strex(value, ptr)
+
+
+/* intrinsic unsigned long long __ldrexd(volatile void *ptr) */
+/* intrinsic int __strexd(unsigned long long val, volatile void *ptr) */
+/* intrinsic void __enable_irq(); */
+/* intrinsic void __disable_irq(); */
+
+
+/**
+ * @brief Return the Process Stack Pointer
+ *
+ * @return ProcessStackPointer
+ *
+ * Return the actual process stack pointer
+ */
+extern uint32_t __get_PSP(void);
+
+/**
+ * @brief Set the Process Stack Pointer
+ *
+ * @param topOfProcStack Process Stack Pointer
+ *
+ * Assign the value ProcessStackPointer to the MSP
+ * (process stack pointer) Cortex processor register
+ */
+extern void __set_PSP(uint32_t topOfProcStack);
+
+/**
+ * @brief Return the Main Stack Pointer
+ *
+ * @return Main Stack Pointer
+ *
+ * Return the current value of the MSP (main stack pointer)
+ * Cortex processor register
+ */
+extern uint32_t __get_MSP(void);
+
+/**
+ * @brief Set the Main Stack Pointer
+ *
+ * @param topOfMainStack Main Stack Pointer
+ *
+ * Assign the value mainStackPointer to the MSP
+ * (main stack pointer) Cortex processor register
+ */
+extern void __set_MSP(uint32_t topOfMainStack);
+
+/**
+ * @brief Reverse byte order in unsigned short value
+ *
+ * @param value value to reverse
+ * @return reversed value
+ *
+ * Reverse byte order in unsigned short value
+ */
+extern uint32_t __REV16(uint16_t value);
+
+/**
+ * @brief Reverse byte order in signed short value with sign extension to integer
+ *
+ * @param value value to reverse
+ * @return reversed value
+ *
+ * Reverse byte order in signed short value with sign extension to integer
+ */
+extern int32_t __REVSH(int16_t value);
+
+
+#if (__ARMCC_VERSION < 400000)
+
+/**
+ * @brief Remove the exclusive lock created by ldrex
+ *
+ * Removes the exclusive lock which is created by ldrex.
+ */
+extern void __CLREX(void);
+
+/**
+ * @brief Return the Base Priority value
+ *
+ * @return BasePriority
+ *
+ * Return the content of the base priority register
+ */
+extern uint32_t __get_BASEPRI(void);
+
+/**
+ * @brief Set the Base Priority value
+ *
+ * @param basePri BasePriority
+ *
+ * Set the base priority register
+ */
+extern void __set_BASEPRI(uint32_t basePri);
+
+/**
+ * @brief Return the Priority Mask value
+ *
+ * @return PriMask
+ *
+ * Return state of the priority mask bit from the priority mask register
+ */
+extern uint32_t __get_PRIMASK(void);
+
+/**
+ * @brief Set the Priority Mask value
+ *
+ * @param priMask PriMask
+ *
+ * Set the priority mask bit in the priority mask register
+ */
+extern void __set_PRIMASK(uint32_t priMask);
+
+/**
+ * @brief Return the Fault Mask value
+ *
+ * @return FaultMask
+ *
+ * Return the content of the fault mask register
+ */
+extern uint32_t __get_FAULTMASK(void);
+
+/**
+ * @brief Set the Fault Mask value
+ *
+ * @param faultMask faultMask value
+ *
+ * Set the fault mask register
+ */
+extern void __set_FAULTMASK(uint32_t faultMask);
+
+/**
+ * @brief Return the Control Register value
+ *
+ * @return Control value
+ *
+ * Return the content of the control register
+ */
+extern uint32_t __get_CONTROL(void);
+
+/**
+ * @brief Set the Control Register value
+ *
+ * @param control Control value
+ *
+ * Set the control register
+ */
+extern void __set_CONTROL(uint32_t control);
+
+#else /* (__ARMCC_VERSION >= 400000) */
+
+/**
+ * @brief Remove the exclusive lock created by ldrex
+ *
+ * Removes the exclusive lock which is created by ldrex.
+ */
+#define __CLREX __clrex
+
+/**
+ * @brief Return the Base Priority value
+ *
+ * @return BasePriority
+ *
+ * Return the content of the base priority register
+ */
+static __INLINE uint32_t __get_BASEPRI(void)
+{
+ register uint32_t __regBasePri __ASM("basepri");
+ return(__regBasePri);
+}
+
+/**
+ * @brief Set the Base Priority value
+ *
+ * @param basePri BasePriority
+ *
+ * Set the base priority register
+ */
+static __INLINE void __set_BASEPRI(uint32_t basePri)
+{
+ register uint32_t __regBasePri __ASM("basepri");
+ __regBasePri = (basePri & 0xff);
+}
+
+/**
+ * @brief Return the Priority Mask value
+ *
+ * @return PriMask
+ *
+ * Return state of the priority mask bit from the priority mask register
+ */
+static __INLINE uint32_t __get_PRIMASK(void)
+{
+ register uint32_t __regPriMask __ASM("primask");
+ return(__regPriMask);
+}
+
+/**
+ * @brief Set the Priority Mask value
+ *
+ * @param priMask PriMask
+ *
+ * Set the priority mask bit in the priority mask register
+ */
+static __INLINE void __set_PRIMASK(uint32_t priMask)
+{
+ register uint32_t __regPriMask __ASM("primask");
+ __regPriMask = (priMask);
+}
+
+/**
+ * @brief Return the Fault Mask value
+ *
+ * @return FaultMask
+ *
+ * Return the content of the fault mask register
+ */
+static __INLINE uint32_t __get_FAULTMASK(void)
+{
+ register uint32_t __regFaultMask __ASM("faultmask");
+ return(__regFaultMask);
+}
+
+/**
+ * @brief Set the Fault Mask value
+ *
+ * @param faultMask faultMask value
+ *
+ * Set the fault mask register
+ */
+static __INLINE void __set_FAULTMASK(uint32_t faultMask)
+{
+ register uint32_t __regFaultMask __ASM("faultmask");
+ __regFaultMask = (faultMask & 1);
+}
+
+/**
+ * @brief Return the Control Register value
+ *
+ * @return Control value
+ *
+ * Return the content of the control register
+ */
+static __INLINE uint32_t __get_CONTROL(void)
+{
+ register uint32_t __regControl __ASM("control");
+ return(__regControl);
+}
+
+/**
+ * @brief Set the Control Register value
+ *
+ * @param control Control value
+ *
+ * Set the control register
+ */
+static __INLINE void __set_CONTROL(uint32_t control)
+{
+ register uint32_t __regControl __ASM("control");
+ __regControl = control;
+}
+
+#endif /* __ARMCC_VERSION */
+
+
+
+#elif (defined (__ICCARM__)) /*------------------ ICC Compiler -------------------*/
+/* IAR iccarm specific functions */
+
+#define __enable_irq __enable_interrupt /*!< global Interrupt enable */
+#define __disable_irq __disable_interrupt /*!< global Interrupt disable */
+
+static __INLINE void __enable_fault_irq() { __ASM ("cpsie f"); }
+static __INLINE void __disable_fault_irq() { __ASM ("cpsid f"); }
+
+#define __NOP __no_operation /*!< no operation intrinsic in IAR Compiler */
+static __INLINE void __WFI() { __ASM ("wfi"); }
+static __INLINE void __WFE() { __ASM ("wfe"); }
+static __INLINE void __SEV() { __ASM ("sev"); }
+static __INLINE void __CLREX() { __ASM ("clrex"); }
+
+/* intrinsic void __ISB(void) */
+/* intrinsic void __DSB(void) */
+/* intrinsic void __DMB(void) */
+/* intrinsic void __set_PRIMASK(); */
+/* intrinsic void __get_PRIMASK(); */
+/* intrinsic void __set_FAULTMASK(); */
+/* intrinsic void __get_FAULTMASK(); */
+/* intrinsic uint32_t __REV(uint32_t value); */
+/* intrinsic uint32_t __REVSH(uint32_t value); */
+/* intrinsic unsigned long __STREX(unsigned long, unsigned long); */
+/* intrinsic unsigned long __LDREX(unsigned long *); */
+
+
+/**
+ * @brief Return the Process Stack Pointer
+ *
+ * @return ProcessStackPointer
+ *
+ * Return the actual process stack pointer
+ */
+extern uint32_t __get_PSP(void);
+
+/**
+ * @brief Set the Process Stack Pointer
+ *
+ * @param topOfProcStack Process Stack Pointer
+ *
+ * Assign the value ProcessStackPointer to the MSP
+ * (process stack pointer) Cortex processor register
+ */
+extern void __set_PSP(uint32_t topOfProcStack);
+
+/**
+ * @brief Return the Main Stack Pointer
+ *
+ * @return Main Stack Pointer
+ *
+ * Return the current value of the MSP (main stack pointer)
+ * Cortex processor register
+ */
+extern uint32_t __get_MSP(void);
+
+/**
+ * @brief Set the Main Stack Pointer
+ *
+ * @param topOfMainStack Main Stack Pointer
+ *
+ * Assign the value mainStackPointer to the MSP
+ * (main stack pointer) Cortex processor register
+ */
+extern void __set_MSP(uint32_t topOfMainStack);
+
+/**
+ * @brief Reverse byte order in unsigned short value
+ *
+ * @param value value to reverse
+ * @return reversed value
+ *
+ * Reverse byte order in unsigned short value
+ */
+extern uint32_t __REV16(uint16_t value);
+
+/**
+ * @brief Reverse bit order of value
+ *
+ * @param value value to reverse
+ * @return reversed value
+ *
+ * Reverse bit order of value
+ */
+extern uint32_t __RBIT(uint32_t value);
+
+/**
+ * @brief LDR Exclusive (8 bit)
+ *
+ * @param *addr address pointer
+ * @return value of (*address)
+ *
+ * Exclusive LDR command for 8 bit values)
+ */
+extern uint8_t __LDREXB(uint8_t *addr);
+
+/**
+ * @brief LDR Exclusive (16 bit)
+ *
+ * @param *addr address pointer
+ * @return value of (*address)
+ *
+ * Exclusive LDR command for 16 bit values
+ */
+extern uint16_t __LDREXH(uint16_t *addr);
+
+/**
+ * @brief LDR Exclusive (32 bit)
+ *
+ * @param *addr address pointer
+ * @return value of (*address)
+ *
+ * Exclusive LDR command for 32 bit values
+ */
+extern uint32_t __LDREXW(uint32_t *addr);
+
+/**
+ * @brief STR Exclusive (8 bit)
+ *
+ * @param value value to store
+ * @param *addr address pointer
+ * @return successful / failed
+ *
+ * Exclusive STR command for 8 bit values
+ */
+extern uint32_t __STREXB(uint8_t value, uint8_t *addr);
+
+/**
+ * @brief STR Exclusive (16 bit)
+ *
+ * @param value value to store
+ * @param *addr address pointer
+ * @return successful / failed
+ *
+ * Exclusive STR command for 16 bit values
+ */
+extern uint32_t __STREXH(uint16_t value, uint16_t *addr);
+
+/**
+ * @brief STR Exclusive (32 bit)
+ *
+ * @param value value to store
+ * @param *addr address pointer
+ * @return successful / failed
+ *
+ * Exclusive STR command for 32 bit values
+ */
+extern uint32_t __STREXW(uint32_t value, uint32_t *addr);
+
+
+
+#elif (defined (__GNUC__)) /*------------------ GNU Compiler ---------------------*/
+/* GNU gcc specific functions */
+
+static __INLINE void __enable_irq() { __ASM volatile ("cpsie i"); }
+static __INLINE void __disable_irq() { __ASM volatile ("cpsid i"); }
+
+static __INLINE void __enable_fault_irq() { __ASM volatile ("cpsie f"); }
+static __INLINE void __disable_fault_irq() { __ASM volatile ("cpsid f"); }
+
+static __INLINE void __NOP() { __ASM volatile ("nop"); }
+static __INLINE void __WFI() { __ASM volatile ("wfi"); }
+static __INLINE void __WFE() { __ASM volatile ("wfe"); }
+static __INLINE void __SEV() { __ASM volatile ("sev"); }
+static __INLINE void __ISB() { __ASM volatile ("isb"); }
+static __INLINE void __DSB() { __ASM volatile ("dsb"); }
+static __INLINE void __DMB() { __ASM volatile ("dmb"); }
+static __INLINE void __CLREX() { __ASM volatile ("clrex"); }
+
+
+/**
+ * @brief Return the Process Stack Pointer
+ *
+ * @return ProcessStackPointer
+ *
+ * Return the actual process stack pointer
+ */
+extern uint32_t __get_PSP(void);
+
+/**
+ * @brief Set the Process Stack Pointer
+ *
+ * @param topOfProcStack Process Stack Pointer
+ *
+ * Assign the value ProcessStackPointer to the MSP
+ * (process stack pointer) Cortex processor register
+ */
+extern void __set_PSP(uint32_t topOfProcStack);
+
+/**
+ * @brief Return the Main Stack Pointer
+ *
+ * @return Main Stack Pointer
+ *
+ * Return the current value of the MSP (main stack pointer)
+ * Cortex processor register
+ */
+extern uint32_t __get_MSP(void);
+
+/**
+ * @brief Set the Main Stack Pointer
+ *
+ * @param topOfMainStack Main Stack Pointer
+ *
+ * Assign the value mainStackPointer to the MSP
+ * (main stack pointer) Cortex processor register
+ */
+extern void __set_MSP(uint32_t topOfMainStack);
+
+/**
+ * @brief Return the Base Priority value
+ *
+ * @return BasePriority
+ *
+ * Return the content of the base priority register
+ */
+extern uint32_t __get_BASEPRI(void);
+
+/**
+ * @brief Set the Base Priority value
+ *
+ * @param basePri BasePriority
+ *
+ * Set the base priority register
+ */
+extern void __set_BASEPRI(uint32_t basePri);
+
+/**
+ * @brief Return the Priority Mask value
+ *
+ * @return PriMask
+ *
+ * Return state of the priority mask bit from the priority mask register
+ */
+extern uint32_t __get_PRIMASK(void);
+
+/**
+ * @brief Set the Priority Mask value
+ *
+ * @param priMask PriMask
+ *
+ * Set the priority mask bit in the priority mask register
+ */
+extern void __set_PRIMASK(uint32_t priMask);
+
+/**
+ * @brief Return the Fault Mask value
+ *
+ * @return FaultMask
+ *
+ * Return the content of the fault mask register
+ */
+extern uint32_t __get_FAULTMASK(void);
+
+/**
+ * @brief Set the Fault Mask value
+ *
+ * @param faultMask faultMask value
+ *
+ * Set the fault mask register
+ */
+extern void __set_FAULTMASK(uint32_t faultMask);
+
+/**
+ * @brief Return the Control Register value
+*
+* @return Control value
+ *
+ * Return the content of the control register
+ */
+extern uint32_t __get_CONTROL(void);
+
+/**
+ * @brief Set the Control Register value
+ *
+ * @param control Control value
+ *
+ * Set the control register
+ */
+extern void __set_CONTROL(uint32_t control);
+
+/**
+ * @brief Reverse byte order in integer value
+ *
+ * @param value value to reverse
+ * @return reversed value
+ *
+ * Reverse byte order in integer value
+ */
+extern uint32_t __REV(uint32_t value);
+
+/**
+ * @brief Reverse byte order in unsigned short value
+ *
+ * @param value value to reverse
+ * @return reversed value
+ *
+ * Reverse byte order in unsigned short value
+ */
+extern uint32_t __REV16(uint16_t value);
+
+/**
+ * @brief Reverse byte order in signed short value with sign extension to integer
+ *
+ * @param value value to reverse
+ * @return reversed value
+ *
+ * Reverse byte order in signed short value with sign extension to integer
+ */
+extern int32_t __REVSH(int16_t value);
+
+/**
+ * @brief Reverse bit order of value
+ *
+ * @param value value to reverse
+ * @return reversed value
+ *
+ * Reverse bit order of value
+ */
+extern uint32_t __RBIT(uint32_t value);
+
+/**
+ * @brief LDR Exclusive (8 bit)
+ *
+ * @param *addr address pointer
+ * @return value of (*address)
+ *
+ * Exclusive LDR command for 8 bit value
+ */
+extern uint8_t __LDREXB(uint8_t *addr);
+
+/**
+ * @brief LDR Exclusive (16 bit)
+ *
+ * @param *addr address pointer
+ * @return value of (*address)
+ *
+ * Exclusive LDR command for 16 bit values
+ */
+extern uint16_t __LDREXH(uint16_t *addr);
+
+/**
+ * @brief LDR Exclusive (32 bit)
+ *
+ * @param *addr address pointer
+ * @return value of (*address)
+ *
+ * Exclusive LDR command for 32 bit values
+ */
+extern uint32_t __LDREXW(uint32_t *addr);
+
+/**
+ * @brief STR Exclusive (8 bit)
+ *
+ * @param value value to store
+ * @param *addr address pointer
+ * @return successful / failed
+ *
+ * Exclusive STR command for 8 bit values
+ */
+extern uint32_t __STREXB(uint8_t value, uint8_t *addr);
+
+/**
+ * @brief STR Exclusive (16 bit)
+ *
+ * @param value value to store
+ * @param *addr address pointer
+ * @return successful / failed
+ *
+ * Exclusive STR command for 16 bit values
+ */
+extern uint32_t __STREXH(uint16_t value, uint16_t *addr);
+
+/**
+ * @brief STR Exclusive (32 bit)
+ *
+ * @param value value to store
+ * @param *addr address pointer
+ * @return successful / failed
+ *
+ * Exclusive STR command for 32 bit values
+ */
+extern uint32_t __STREXW(uint32_t value, uint32_t *addr);
+
+
+#elif (defined (__TASKING__)) /*------------------ TASKING Compiler ---------------------*/
+/* TASKING carm specific functions */
+
+/*
+ * The CMSIS functions have been implemented as intrinsics in the compiler.
+ * Please use "carm -?i" to get an up to date list of all instrinsics,
+ * Including the CMSIS ones.
+ */
+
+#endif
+
+
+/** @addtogroup CMSIS_CM3_Core_FunctionInterface CMSIS CM3 Core Function Interface
+ Core Function Interface containing:
+ - Core NVIC Functions
+ - Core SysTick Functions
+ - Core Reset Functions
+*/
+/*@{*/
+
+/* ########################## NVIC functions #################################### */
+
+/**
+ * @brief Set the Priority Grouping in NVIC Interrupt Controller
+ *
+ * @param PriorityGroup is priority grouping field
+ *
+ * Set the priority grouping field using the required unlock sequence.
+ * The parameter priority_grouping is assigned to the field
+ * SCB->AIRCR [10:8] PRIGROUP field. Only values from 0..7 are used.
+ * In case of a conflict between priority grouping and available
+ * priority bits (__NVIC_PRIO_BITS) the smallest possible priority group is set.
+ */
+static __INLINE void NVIC_SetPriorityGrouping(uint32_t PriorityGroup)
+{
+ uint32_t reg_value;
+ uint32_t PriorityGroupTmp = (PriorityGroup & 0x07); /* only values 0..7 are used */
+
+ reg_value = SCB->AIRCR; /* read old register configuration */
+ reg_value &= ~(SCB_AIRCR_VECTKEY_Msk | SCB_AIRCR_PRIGROUP_Msk); /* clear bits to change */
+ reg_value = (reg_value |
+ (0x5FA << SCB_AIRCR_VECTKEY_Pos) |
+ (PriorityGroupTmp << 8)); /* Insert write key and priorty group */
+ SCB->AIRCR = reg_value;
+}
+
+/**
+ * @brief Get the Priority Grouping from NVIC Interrupt Controller
+ *
+ * @return priority grouping field
+ *
+ * Get the priority grouping from NVIC Interrupt Controller.
+ * priority grouping is SCB->AIRCR [10:8] PRIGROUP field.
+ */
+static __INLINE uint32_t NVIC_GetPriorityGrouping(void)
+{
+ return ((SCB->AIRCR & SCB_AIRCR_PRIGROUP_Msk) >> SCB_AIRCR_PRIGROUP_Pos); /* read priority grouping field */
+}
+
+/**
+ * @brief Enable Interrupt in NVIC Interrupt Controller
+ *
+ * @param IRQn The positive number of the external interrupt to enable
+ *
+ * Enable a device specific interupt in the NVIC interrupt controller.
+ * The interrupt number cannot be a negative value.
+ */
+static __INLINE void NVIC_EnableIRQ(IRQn_Type IRQn)
+{
+ NVIC->ISER[((uint32_t)(IRQn) >> 5)] = (1 << ((uint32_t)(IRQn) & 0x1F)); /* enable interrupt */
+}
+
+/**
+ * @brief Disable the interrupt line for external interrupt specified
+ *
+ * @param IRQn The positive number of the external interrupt to disable
+ *
+ * Disable a device specific interupt in the NVIC interrupt controller.
+ * The interrupt number cannot be a negative value.
+ */
+static __INLINE void NVIC_DisableIRQ(IRQn_Type IRQn)
+{
+ NVIC->ICER[((uint32_t)(IRQn) >> 5)] = (1 << ((uint32_t)(IRQn) & 0x1F)); /* disable interrupt */
+}
+
+/**
+ * @brief Read the interrupt pending bit for a device specific interrupt source
+ *
+ * @param IRQn The number of the device specifc interrupt
+ * @return 1 = interrupt pending, 0 = interrupt not pending
+ *
+ * Read the pending register in NVIC and return 1 if its status is pending,
+ * otherwise it returns 0
+ */
+static __INLINE uint32_t NVIC_GetPendingIRQ(IRQn_Type IRQn)
+{
+ return((uint32_t) ((NVIC->ISPR[(uint32_t)(IRQn) >> 5] & (1 << ((uint32_t)(IRQn) & 0x1F)))?1:0)); /* Return 1 if pending else 0 */
+}
+
+/**
+ * @brief Set the pending bit for an external interrupt
+ *
+ * @param IRQn The number of the interrupt for set pending
+ *
+ * Set the pending bit for the specified interrupt.
+ * The interrupt number cannot be a negative value.
+ */
+static __INLINE void NVIC_SetPendingIRQ(IRQn_Type IRQn)
+{
+ NVIC->ISPR[((uint32_t)(IRQn) >> 5)] = (1 << ((uint32_t)(IRQn) & 0x1F)); /* set interrupt pending */
+}
+
+/**
+ * @brief Clear the pending bit for an external interrupt
+ *
+ * @param IRQn The number of the interrupt for clear pending
+ *
+ * Clear the pending bit for the specified interrupt.
+ * The interrupt number cannot be a negative value.
+ */
+static __INLINE void NVIC_ClearPendingIRQ(IRQn_Type IRQn)
+{
+ NVIC->ICPR[((uint32_t)(IRQn) >> 5)] = (1 << ((uint32_t)(IRQn) & 0x1F)); /* Clear pending interrupt */
+}
+
+/**
+ * @brief Read the active bit for an external interrupt
+ *
+ * @param IRQn The number of the interrupt for read active bit
+ * @return 1 = interrupt active, 0 = interrupt not active
+ *
+ * Read the active register in NVIC and returns 1 if its status is active,
+ * otherwise it returns 0.
+ */
+static __INLINE uint32_t NVIC_GetActive(IRQn_Type IRQn)
+{
+ return((uint32_t)((NVIC->IABR[(uint32_t)(IRQn) >> 5] & (1 << ((uint32_t)(IRQn) & 0x1F)))?1:0)); /* Return 1 if active else 0 */
+}
+
+/**
+ * @brief Set the priority for an interrupt
+ *
+ * @param IRQn The number of the interrupt for set priority
+ * @param priority The priority to set
+ *
+ * Set the priority for the specified interrupt. The interrupt
+ * number can be positive to specify an external (device specific)
+ * interrupt, or negative to specify an internal (core) interrupt.
+ *
+ * Note: The priority cannot be set for every core interrupt.
+ */
+static __INLINE void NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority)
+{
+ if(IRQn < 0) {
+ SCB->SHP[((uint32_t)(IRQn) & 0xF)-4] = ((priority << (8 - __NVIC_PRIO_BITS)) & 0xff); } /* set Priority for Cortex-M3 System Interrupts */
+ else {
+ NVIC->IP[(uint32_t)(IRQn)] = ((priority << (8 - __NVIC_PRIO_BITS)) & 0xff); } /* set Priority for device specific Interrupts */
+}
+
+/**
+ * @brief Read the priority for an interrupt
+ *
+ * @param IRQn The number of the interrupt for get priority
+ * @return The priority for the interrupt
+ *
+ * Read the priority for the specified interrupt. The interrupt
+ * number can be positive to specify an external (device specific)
+ * interrupt, or negative to specify an internal (core) interrupt.
+ *
+ * The returned priority value is automatically aligned to the implemented
+ * priority bits of the microcontroller.
+ *
+ * Note: The priority cannot be set for every core interrupt.
+ */
+static __INLINE uint32_t NVIC_GetPriority(IRQn_Type IRQn)
+{
+
+ if(IRQn < 0) {
+ return((uint32_t)(SCB->SHP[((uint32_t)(IRQn) & 0xF)-4] >> (8 - __NVIC_PRIO_BITS))); } /* get priority for Cortex-M3 system interrupts */
+ else {
+ return((uint32_t)(NVIC->IP[(uint32_t)(IRQn)] >> (8 - __NVIC_PRIO_BITS))); } /* get priority for device specific interrupts */
+}
+
+
+/**
+ * @brief Encode the priority for an interrupt
+ *
+ * @param PriorityGroup The used priority group
+ * @param PreemptPriority The preemptive priority value (starting from 0)
+ * @param SubPriority The sub priority value (starting from 0)
+ * @return The encoded priority for the interrupt
+ *
+ * Encode the priority for an interrupt with the given priority group,
+ * preemptive priority value and sub priority value.
+ * In case of a conflict between priority grouping and available
+ * priority bits (__NVIC_PRIO_BITS) the samllest possible priority group is set.
+ *
+ * The returned priority value can be used for NVIC_SetPriority(...) function
+ */
+static __INLINE uint32_t NVIC_EncodePriority (uint32_t PriorityGroup, uint32_t PreemptPriority, uint32_t SubPriority)
+{
+ uint32_t PriorityGroupTmp = (PriorityGroup & 0x07); /* only values 0..7 are used */
+ uint32_t PreemptPriorityBits;
+ uint32_t SubPriorityBits;
+
+ PreemptPriorityBits = ((7 - PriorityGroupTmp) > __NVIC_PRIO_BITS) ? __NVIC_PRIO_BITS : 7 - PriorityGroupTmp;
+ SubPriorityBits = ((PriorityGroupTmp + __NVIC_PRIO_BITS) < 7) ? 0 : PriorityGroupTmp - 7 + __NVIC_PRIO_BITS;
+
+ return (
+ ((PreemptPriority & ((1 << (PreemptPriorityBits)) - 1)) << SubPriorityBits) |
+ ((SubPriority & ((1 << (SubPriorityBits )) - 1)))
+ );
+}
+
+
+/**
+ * @brief Decode the priority of an interrupt
+ *
+ * @param Priority The priority for the interrupt
+ * @param PriorityGroup The used priority group
+ * @param pPreemptPriority The preemptive priority value (starting from 0)
+ * @param pSubPriority The sub priority value (starting from 0)
+ *
+ * Decode an interrupt priority value with the given priority group to
+ * preemptive priority value and sub priority value.
+ * In case of a conflict between priority grouping and available
+ * priority bits (__NVIC_PRIO_BITS) the samllest possible priority group is set.
+ *
+ * The priority value can be retrieved with NVIC_GetPriority(...) function
+ */
+static __INLINE void NVIC_DecodePriority (uint32_t Priority, uint32_t PriorityGroup, uint32_t* pPreemptPriority, uint32_t* pSubPriority)
+{
+ uint32_t PriorityGroupTmp = (PriorityGroup & 0x07); /* only values 0..7 are used */
+ uint32_t PreemptPriorityBits;
+ uint32_t SubPriorityBits;
+
+ PreemptPriorityBits = ((7 - PriorityGroupTmp) > __NVIC_PRIO_BITS) ? __NVIC_PRIO_BITS : 7 - PriorityGroupTmp;
+ SubPriorityBits = ((PriorityGroupTmp + __NVIC_PRIO_BITS) < 7) ? 0 : PriorityGroupTmp - 7 + __NVIC_PRIO_BITS;
+
+ *pPreemptPriority = (Priority >> SubPriorityBits) & ((1 << (PreemptPriorityBits)) - 1);
+ *pSubPriority = (Priority ) & ((1 << (SubPriorityBits )) - 1);
+}
+
+
+
+/* ################################## SysTick function ############################################ */
+
+#if (!defined (__Vendor_SysTickConfig)) || (__Vendor_SysTickConfig == 0)
+
+/**
+ * @brief Initialize and start the SysTick counter and its interrupt.
+ *
+ * @param ticks number of ticks between two interrupts
+ * @return 1 = failed, 0 = successful
+ *
+ * Initialise the system tick timer and its interrupt and start the
+ * system tick timer / counter in free running mode to generate
+ * periodical interrupts.
+ */
+static __INLINE uint32_t SysTick_Config(uint32_t ticks)
+{
+ if (ticks > SysTick_LOAD_RELOAD_Msk) return (1); /* Reload value impossible */
+
+ SysTick->LOAD = (ticks & SysTick_LOAD_RELOAD_Msk) - 1; /* set reload register */
+ NVIC_SetPriority (SysTick_IRQn, (1<<__NVIC_PRIO_BITS) - 1); /* set Priority for Cortex-M0 System Interrupts */
+ SysTick->VAL = 0; /* Load the SysTick Counter Value */
+ SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk |
+ SysTick_CTRL_TICKINT_Msk |
+ SysTick_CTRL_ENABLE_Msk; /* Enable SysTick IRQ and SysTick Timer */
+ return (0); /* Function successful */
+}
+
+#endif
+
+
+
+
+/* ################################## Reset function ############################################ */
+
+/**
+ * @brief Initiate a system reset request.
+ *
+ * Initiate a system reset request to reset the MCU
+ */
+static __INLINE void NVIC_SystemReset(void)
+{
+ SCB->AIRCR = ((0x5FA << SCB_AIRCR_VECTKEY_Pos) |
+ (SCB->AIRCR & SCB_AIRCR_PRIGROUP_Msk) |
+ SCB_AIRCR_SYSRESETREQ_Msk); /* Keep priority group unchanged */
+ __DSB(); /* Ensure completion of memory access */
+ while(1); /* wait until reset */
+}
+
+/*@}*/ /* end of group CMSIS_CM3_Core_FunctionInterface */
+
+
+
+/* ##################################### Debug In/Output function ########################################### */
+
+/** @addtogroup CMSIS_CM3_CoreDebugInterface CMSIS CM3 Core Debug Interface
+ Core Debug Interface containing:
+ - Core Debug Receive / Transmit Functions
+ - Core Debug Defines
+ - Core Debug Variables
+*/
+/*@{*/
+
+extern volatile int ITM_RxBuffer; /*!< variable to receive characters */
+#define ITM_RXBUFFER_EMPTY 0x5AA55AA5 /*!< value identifying ITM_RxBuffer is ready for next character */
+
+
+/**
+ * @brief Outputs a character via the ITM channel 0
+ *
+ * @param ch character to output
+ * @return character to output
+ *
+ * The function outputs a character via the ITM channel 0.
+ * The function returns when no debugger is connected that has booked the output.
+ * It is blocking when a debugger is connected, but the previous character send is not transmitted.
+ */
+static __INLINE uint32_t ITM_SendChar (uint32_t ch)
+{
+ if ((CoreDebug->DEMCR & CoreDebug_DEMCR_TRCENA_Msk) && /* Trace enabled */
+ (ITM->TCR & ITM_TCR_ITMENA_Msk) && /* ITM enabled */
+ (ITM->TER & (1ul << 0) ) ) /* ITM Port #0 enabled */
+ {
+ while (ITM->PORT[0].u32 == 0);
+ ITM->PORT[0].u8 = (uint8_t) ch;
+ }
+ return (ch);
+}
+
+
+/**
+ * @brief Inputs a character via variable ITM_RxBuffer
+ *
+ * @return received character, -1 = no character received
+ *
+ * The function inputs a character via variable ITM_RxBuffer.
+ * The function returns when no debugger is connected that has booked the output.
+ * It is blocking when a debugger is connected, but the previous character send is not transmitted.
+ */
+static __INLINE int ITM_ReceiveChar (void) {
+ int ch = -1; /* no character available */
+
+ if (ITM_RxBuffer != ITM_RXBUFFER_EMPTY) {
+ ch = ITM_RxBuffer;
+ ITM_RxBuffer = ITM_RXBUFFER_EMPTY; /* ready for next character */
+ }
+
+ return (ch);
+}
+
+
+/**
+ * @brief Check if a character via variable ITM_RxBuffer is available
+ *
+ * @return 1 = character available, 0 = no character available
+ *
+ * The function checks variable ITM_RxBuffer whether a character is available or not.
+ * The function returns '1' if a character is available and '0' if no character is available.
+ */
+static __INLINE int ITM_CheckChar (void) {
+
+ if (ITM_RxBuffer == ITM_RXBUFFER_EMPTY) {
+ return (0); /* no character available */
+ } else {
+ return (1); /* character available */
+ }
+}
+
+/*@}*/ /* end of group CMSIS_CM3_core_DebugInterface */
+
+
+#ifdef __cplusplus
+}
+#endif
+
+/*@}*/ /* end of group CMSIS_CM3_core_definitions */
+
+#endif /* __CM3_CORE_H__ */
+
+/*lint -restore */
diff --git a/Firmware/CubeIDE/CMSIS/inc/stm32f10x.h b/Firmware/CubeIDE/CMSIS/inc/stm32f10x.h
new file mode 100644
index 0000000..561b84d
--- /dev/null
+++ b/Firmware/CubeIDE/CMSIS/inc/stm32f10x.h
@@ -0,0 +1,8336 @@
+/**
+ ******************************************************************************
+ * @file stm32f10x.h
+ * @author MCD Application Team
+ * @version V3.5.0
+ * @date 11-March-2011
+ * @brief CMSIS Cortex-M3 Device Peripheral Access Layer Header File.
+ * This file contains all the peripheral register's definitions, bits
+ * definitions and memory mapping for STM32F10x Connectivity line,
+ * High density, High density value line, Medium density,
+ * Medium density Value line, Low density, Low density Value line
+ * and XL-density devices.
+ *
+ * The file is the unique include file that the application programmer
+ * is using in the C source code, usually in main.c. This file contains:
+ * - Configuration section that allows to select:
+ * - The device used in the target application
+ * - To use or not the peripheral’s drivers in application code(i.e.
+ * code will be based on direct access to peripheral’s registers
+ * rather than drivers API), this option is controlled by
+ * "#define USE_STDPERIPH_DRIVER"
+ * - To change few application-specific parameters such as the HSE
+ * crystal frequency
+ * - Data structures and the address mapping for all peripherals
+ * - Peripheral's registers declarations and bits definition
+ * - Macros to access peripheral’s registers hardware
+ *
+ ******************************************************************************
+ * @attention
+ *
+ * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
+ * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
+ * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY
+ * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
+ * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
+ * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
+ *
+ * © COPYRIGHT 2011 STMicroelectronics
+ ******************************************************************************
+ */
+
+/** @addtogroup CMSIS
+ * @{
+ */
+
+/** @addtogroup stm32f10x
+ * @{
+ */
+
+#ifndef __STM32F10x_H
+#define __STM32F10x_H
+
+#ifdef __cplusplus
+ extern "C" {
+#endif
+
+/** @addtogroup Library_configuration_section
+ * @{
+ */
+
+/* Uncomment the line below according to the target STM32 device used in your
+ application
+ */
+
+#if !defined (STM32F10X_LD) && !defined (STM32F10X_LD_VL) && !defined (STM32F10X_MD) && !defined (STM32F10X_MD_VL) && !defined (STM32F10X_HD) && !defined (STM32F10X_HD_VL) && !defined (STM32F10X_XL) && !defined (STM32F10X_CL)
+ /* #define STM32F10X_LD */ /*!< STM32F10X_LD: STM32 Low density devices */
+ /* #define STM32F10X_LD_VL */ /*!< STM32F10X_LD_VL: STM32 Low density Value Line devices */
+ #define STM32F10X_MD /*!< STM32F10X_MD: STM32 Medium density devices */
+ /* #define STM32F10X_MD_VL */ /*!< STM32F10X_MD_VL: STM32 Medium density Value Line devices */
+ /* #define STM32F10X_HD */ /*!< STM32F10X_HD: STM32 High density devices */
+ /* #define STM32F10X_HD_VL */ /*!< STM32F10X_HD_VL: STM32 High density value line devices */
+ /* #define STM32F10X_XL */ /*!< STM32F10X_XL: STM32 XL-density devices */
+ /* #define STM32F10X_CL */ /*!< STM32F10X_CL: STM32 Connectivity line devices */
+#endif
+/* Tip: To avoid modifying this file each time you need to switch between these
+ devices, you can define the device in your toolchain compiler preprocessor.
+
+ - Low-density devices are STM32F101xx, STM32F102xx and STM32F103xx microcontrollers
+ where the Flash memory density ranges between 16 and 32 Kbytes.
+ - Low-density value line devices are STM32F100xx microcontrollers where the Flash
+ memory density ranges between 16 and 32 Kbytes.
+ - Medium-density devices are STM32F101xx, STM32F102xx and STM32F103xx microcontrollers
+ where the Flash memory density ranges between 64 and 128 Kbytes.
+ - Medium-density value line devices are STM32F100xx microcontrollers where the
+ Flash memory density ranges between 64 and 128 Kbytes.
+ - High-density devices are STM32F101xx and STM32F103xx microcontrollers where
+ the Flash memory density ranges between 256 and 512 Kbytes.
+ - High-density value line devices are STM32F100xx microcontrollers where the
+ Flash memory density ranges between 256 and 512 Kbytes.
+ - XL-density devices are STM32F101xx and STM32F103xx microcontrollers where
+ the Flash memory density ranges between 512 and 1024 Kbytes.
+ - Connectivity line devices are STM32F105xx and STM32F107xx microcontrollers.
+ */
+
+#if !defined (STM32F10X_LD) && !defined (STM32F10X_LD_VL) && !defined (STM32F10X_MD) && !defined (STM32F10X_MD_VL) && !defined (STM32F10X_HD) && !defined (STM32F10X_HD_VL) && !defined (STM32F10X_XL) && !defined (STM32F10X_CL)
+ #error "Please select first the target STM32F10x device used in your application (in stm32f10x.h file)"
+#endif
+
+#if !defined USE_STDPERIPH_DRIVER
+/**
+ * @brief Comment the line below if you will not use the peripherals drivers.
+ In this case, these drivers will not be included and the application code will
+ be based on direct access to peripherals registers
+ */
+ /*#define USE_STDPERIPH_DRIVER*/
+#endif
+
+/**
+ * @brief In the following line adjust the value of External High Speed oscillator (HSE)
+ used in your application
+
+ 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.
+ */
+#if !defined HSE_VALUE
+ #ifdef STM32F10X_CL
+ #define HSE_VALUE ((uint32_t)25000000) /*!< Value of the External oscillator in Hz */
+ #else
+ #define HSE_VALUE ((uint32_t)8000000) /*!< Value of the External oscillator in Hz */
+ #endif /* STM32F10X_CL */
+#endif /* HSE_VALUE */
+
+
+/**
+ * @brief In the following line adjust the External High Speed oscillator (HSE) Startup
+ Timeout value
+ */
+#define HSE_STARTUP_TIMEOUT ((uint16_t)0x0500) /*!< Time out for HSE start up */
+
+#define HSI_VALUE ((uint32_t)8000000) /*!< Value of the Internal oscillator in Hz*/
+
+/**
+ * @brief STM32F10x Standard Peripheral Library version number
+ */
+#define __STM32F10X_STDPERIPH_VERSION_MAIN (0x03) /*!< [31:24] main version */
+#define __STM32F10X_STDPERIPH_VERSION_SUB1 (0x05) /*!< [23:16] sub1 version */
+#define __STM32F10X_STDPERIPH_VERSION_SUB2 (0x00) /*!< [15:8] sub2 version */
+#define __STM32F10X_STDPERIPH_VERSION_RC (0x00) /*!< [7:0] release candidate */
+#define __STM32F10X_STDPERIPH_VERSION ( (__STM32F10X_STDPERIPH_VERSION_MAIN << 24)\
+ |(__STM32F10X_STDPERIPH_VERSION_SUB1 << 16)\
+ |(__STM32F10X_STDPERIPH_VERSION_SUB2 << 8)\
+ |(__STM32F10X_STDPERIPH_VERSION_RC))
+
+/**
+ * @}
+ */
+
+/** @addtogroup Configuration_section_for_CMSIS
+ * @{
+ */
+
+/**
+ * @brief Configuration of the Cortex-M3 Processor and Core Peripherals
+ */
+#ifdef STM32F10X_XL
+ #define __MPU_PRESENT 1 /*!< STM32 XL-density devices provide an MPU */
+#else
+ #define __MPU_PRESENT 0 /*!< Other STM32 devices does not provide an MPU */
+#endif /* STM32F10X_XL */
+#define __NVIC_PRIO_BITS 4 /*!< STM32 uses 4 Bits for the Priority Levels */
+#define __Vendor_SysTickConfig 0 /*!< Set to 1 if different SysTick Config is used */
+
+/**
+ * @brief STM32F10x Interrupt Number Definition, according to the selected device
+ * in @ref Library_configuration_section
+ */
+typedef enum IRQn
+{
+/****** Cortex-M3 Processor Exceptions Numbers ***************************************************/
+ NonMaskableInt_IRQn = -14, /*!< 2 Non Maskable Interrupt */
+ MemoryManagement_IRQn = -12, /*!< 4 Cortex-M3 Memory Management Interrupt */
+ BusFault_IRQn = -11, /*!< 5 Cortex-M3 Bus Fault Interrupt */
+ UsageFault_IRQn = -10, /*!< 6 Cortex-M3 Usage Fault Interrupt */
+ SVCall_IRQn = -5, /*!< 11 Cortex-M3 SV Call Interrupt */
+ DebugMonitor_IRQn = -4, /*!< 12 Cortex-M3 Debug Monitor Interrupt */
+ PendSV_IRQn = -2, /*!< 14 Cortex-M3 Pend SV Interrupt */
+ SysTick_IRQn = -1, /*!< 15 Cortex-M3 System Tick Interrupt */
+
+/****** STM32 specific Interrupt Numbers *********************************************************/
+ WWDG_IRQn = 0, /*!< Window WatchDog Interrupt */
+ PVD_IRQn = 1, /*!< PVD through EXTI Line detection Interrupt */
+ TAMPER_IRQn = 2, /*!< Tamper Interrupt */
+ RTC_IRQn = 3, /*!< RTC global Interrupt */
+ FLASH_IRQn = 4, /*!< FLASH global Interrupt */
+ RCC_IRQn = 5, /*!< RCC global Interrupt */
+ EXTI0_IRQn = 6, /*!< EXTI Line0 Interrupt */
+ EXTI1_IRQn = 7, /*!< EXTI Line1 Interrupt */
+ EXTI2_IRQn = 8, /*!< EXTI Line2 Interrupt */
+ EXTI3_IRQn = 9, /*!< EXTI Line3 Interrupt */
+ EXTI4_IRQn = 10, /*!< EXTI Line4 Interrupt */
+ DMA1_Channel1_IRQn = 11, /*!< DMA1 Channel 1 global Interrupt */
+ DMA1_Channel2_IRQn = 12, /*!< DMA1 Channel 2 global Interrupt */
+ DMA1_Channel3_IRQn = 13, /*!< DMA1 Channel 3 global Interrupt */
+ DMA1_Channel4_IRQn = 14, /*!< DMA1 Channel 4 global Interrupt */
+ DMA1_Channel5_IRQn = 15, /*!< DMA1 Channel 5 global Interrupt */
+ DMA1_Channel6_IRQn = 16, /*!< DMA1 Channel 6 global Interrupt */
+ DMA1_Channel7_IRQn = 17, /*!< DMA1 Channel 7 global Interrupt */
+
+#ifdef STM32F10X_LD
+ ADC1_2_IRQn = 18, /*!< ADC1 and ADC2 global Interrupt */
+ USB_HP_CAN1_TX_IRQn = 19, /*!< USB Device High Priority or CAN1 TX Interrupts */
+ USB_LP_CAN1_RX0_IRQn = 20, /*!< USB Device Low Priority or CAN1 RX0 Interrupts */
+ CAN1_RX1_IRQn = 21, /*!< CAN1 RX1 Interrupt */
+ CAN1_SCE_IRQn = 22, /*!< CAN1 SCE Interrupt */
+ EXTI9_5_IRQn = 23, /*!< External Line[9:5] Interrupts */
+ TIM1_BRK_IRQn = 24, /*!< TIM1 Break Interrupt */
+ TIM1_UP_IRQn = 25, /*!< TIM1 Update Interrupt */
+ TIM1_TRG_COM_IRQn = 26, /*!< TIM1 Trigger and Commutation Interrupt */
+ TIM1_CC_IRQn = 27, /*!< TIM1 Capture Compare Interrupt */
+ TIM2_IRQn = 28, /*!< TIM2 global Interrupt */
+ TIM3_IRQn = 29, /*!< TIM3 global Interrupt */
+ I2C1_EV_IRQn = 31, /*!< I2C1 Event Interrupt */
+ I2C1_ER_IRQn = 32, /*!< I2C1 Error Interrupt */
+ SPI1_IRQn = 35, /*!< SPI1 global Interrupt */
+ USART1_IRQn = 37, /*!< USART1 global Interrupt */
+ USART2_IRQn = 38, /*!< USART2 global Interrupt */
+ EXTI15_10_IRQn = 40, /*!< External Line[15:10] Interrupts */
+ RTCAlarm_IRQn = 41, /*!< RTC Alarm through EXTI Line Interrupt */
+ USBWakeUp_IRQn = 42 /*!< USB Device WakeUp from suspend through EXTI Line Interrupt */
+#endif /* STM32F10X_LD */
+
+#ifdef STM32F10X_LD_VL
+ ADC1_IRQn = 18, /*!< ADC1 global Interrupt */
+ EXTI9_5_IRQn = 23, /*!< External Line[9:5] Interrupts */
+ TIM1_BRK_TIM15_IRQn = 24, /*!< TIM1 Break and TIM15 Interrupts */
+ TIM1_UP_TIM16_IRQn = 25, /*!< TIM1 Update and TIM16 Interrupts */
+ TIM1_TRG_COM_TIM17_IRQn = 26, /*!< TIM1 Trigger and Commutation and TIM17 Interrupt */
+ TIM1_CC_IRQn = 27, /*!< TIM1 Capture Compare Interrupt */
+ TIM2_IRQn = 28, /*!< TIM2 global Interrupt */
+ TIM3_IRQn = 29, /*!< TIM3 global Interrupt */
+ I2C1_EV_IRQn = 31, /*!< I2C1 Event Interrupt */
+ I2C1_ER_IRQn = 32, /*!< I2C1 Error Interrupt */
+ SPI1_IRQn = 35, /*!< SPI1 global Interrupt */
+ USART1_IRQn = 37, /*!< USART1 global Interrupt */
+ USART2_IRQn = 38, /*!< USART2 global Interrupt */
+ EXTI15_10_IRQn = 40, /*!< External Line[15:10] Interrupts */
+ RTCAlarm_IRQn = 41, /*!< RTC Alarm through EXTI Line Interrupt */
+ CEC_IRQn = 42, /*!< HDMI-CEC Interrupt */
+ TIM6_DAC_IRQn = 54, /*!< TIM6 and DAC underrun Interrupt */
+ TIM7_IRQn = 55 /*!< TIM7 Interrupt */
+#endif /* STM32F10X_LD_VL */
+
+#ifdef STM32F10X_MD
+ ADC1_2_IRQn = 18, /*!< ADC1 and ADC2 global Interrupt */
+ USB_HP_CAN1_TX_IRQn = 19, /*!< USB Device High Priority or CAN1 TX Interrupts */
+ USB_LP_CAN1_RX0_IRQn = 20, /*!< USB Device Low Priority or CAN1 RX0 Interrupts */
+ CAN1_RX1_IRQn = 21, /*!< CAN1 RX1 Interrupt */
+ CAN1_SCE_IRQn = 22, /*!< CAN1 SCE Interrupt */
+ EXTI9_5_IRQn = 23, /*!< External Line[9:5] Interrupts */
+ TIM1_BRK_IRQn = 24, /*!< TIM1 Break Interrupt */
+ TIM1_UP_IRQn = 25, /*!< TIM1 Update Interrupt */
+ TIM1_TRG_COM_IRQn = 26, /*!< TIM1 Trigger and Commutation Interrupt */
+ TIM1_CC_IRQn = 27, /*!< TIM1 Capture Compare Interrupt */
+ TIM2_IRQn = 28, /*!< TIM2 global Interrupt */
+ TIM3_IRQn = 29, /*!< TIM3 global Interrupt */
+ TIM4_IRQn = 30, /*!< TIM4 global Interrupt */
+ I2C1_EV_IRQn = 31, /*!< I2C1 Event Interrupt */
+ I2C1_ER_IRQn = 32, /*!< I2C1 Error Interrupt */
+ I2C2_EV_IRQn = 33, /*!< I2C2 Event Interrupt */
+ I2C2_ER_IRQn = 34, /*!< I2C2 Error Interrupt */
+ SPI1_IRQn = 35, /*!< SPI1 global Interrupt */
+ SPI2_IRQn = 36, /*!< SPI2 global Interrupt */
+ USART1_IRQn = 37, /*!< USART1 global Interrupt */
+ USART2_IRQn = 38, /*!< USART2 global Interrupt */
+ USART3_IRQn = 39, /*!< USART3 global Interrupt */
+ EXTI15_10_IRQn = 40, /*!< External Line[15:10] Interrupts */
+ RTCAlarm_IRQn = 41, /*!< RTC Alarm through EXTI Line Interrupt */
+ USBWakeUp_IRQn = 42 /*!< USB Device WakeUp from suspend through EXTI Line Interrupt */
+#endif /* STM32F10X_MD */
+
+#ifdef STM32F10X_MD_VL
+ ADC1_IRQn = 18, /*!< ADC1 global Interrupt */
+ EXTI9_5_IRQn = 23, /*!< External Line[9:5] Interrupts */
+ TIM1_BRK_TIM15_IRQn = 24, /*!< TIM1 Break and TIM15 Interrupts */
+ TIM1_UP_TIM16_IRQn = 25, /*!< TIM1 Update and TIM16 Interrupts */
+ TIM1_TRG_COM_TIM17_IRQn = 26, /*!< TIM1 Trigger and Commutation and TIM17 Interrupt */
+ TIM1_CC_IRQn = 27, /*!< TIM1 Capture Compare Interrupt */
+ TIM2_IRQn = 28, /*!< TIM2 global Interrupt */
+ TIM3_IRQn = 29, /*!< TIM3 global Interrupt */
+ TIM4_IRQn = 30, /*!< TIM4 global Interrupt */
+ I2C1_EV_IRQn = 31, /*!< I2C1 Event Interrupt */
+ I2C1_ER_IRQn = 32, /*!< I2C1 Error Interrupt */
+ I2C2_EV_IRQn = 33, /*!< I2C2 Event Interrupt */
+ I2C2_ER_IRQn = 34, /*!< I2C2 Error Interrupt */
+ SPI1_IRQn = 35, /*!< SPI1 global Interrupt */
+ SPI2_IRQn = 36, /*!< SPI2 global Interrupt */
+ USART1_IRQn = 37, /*!< USART1 global Interrupt */
+ USART2_IRQn = 38, /*!< USART2 global Interrupt */
+ USART3_IRQn = 39, /*!< USART3 global Interrupt */
+ EXTI15_10_IRQn = 40, /*!< External Line[15:10] Interrupts */
+ RTCAlarm_IRQn = 41, /*!< RTC Alarm through EXTI Line Interrupt */
+ CEC_IRQn = 42, /*!< HDMI-CEC Interrupt */
+ TIM6_DAC_IRQn = 54, /*!< TIM6 and DAC underrun Interrupt */
+ TIM7_IRQn = 55 /*!< TIM7 Interrupt */
+#endif /* STM32F10X_MD_VL */
+
+#ifdef STM32F10X_HD
+ ADC1_2_IRQn = 18, /*!< ADC1 and ADC2 global Interrupt */
+ USB_HP_CAN1_TX_IRQn = 19, /*!< USB Device High Priority or CAN1 TX Interrupts */
+ USB_LP_CAN1_RX0_IRQn = 20, /*!< USB Device Low Priority or CAN1 RX0 Interrupts */
+ CAN1_RX1_IRQn = 21, /*!< CAN1 RX1 Interrupt */
+ CAN1_SCE_IRQn = 22, /*!< CAN1 SCE Interrupt */
+ EXTI9_5_IRQn = 23, /*!< External Line[9:5] Interrupts */
+ TIM1_BRK_IRQn = 24, /*!< TIM1 Break Interrupt */
+ TIM1_UP_IRQn = 25, /*!< TIM1 Update Interrupt */
+ TIM1_TRG_COM_IRQn = 26, /*!< TIM1 Trigger and Commutation Interrupt */
+ TIM1_CC_IRQn = 27, /*!< TIM1 Capture Compare Interrupt */
+ TIM2_IRQn = 28, /*!< TIM2 global Interrupt */
+ TIM3_IRQn = 29, /*!< TIM3 global Interrupt */
+ TIM4_IRQn = 30, /*!< TIM4 global Interrupt */
+ I2C1_EV_IRQn = 31, /*!< I2C1 Event Interrupt */
+ I2C1_ER_IRQn = 32, /*!< I2C1 Error Interrupt */
+ I2C2_EV_IRQn = 33, /*!< I2C2 Event Interrupt */
+ I2C2_ER_IRQn = 34, /*!< I2C2 Error Interrupt */
+ SPI1_IRQn = 35, /*!< SPI1 global Interrupt */
+ SPI2_IRQn = 36, /*!< SPI2 global Interrupt */
+ USART1_IRQn = 37, /*!< USART1 global Interrupt */
+ USART2_IRQn = 38, /*!< USART2 global Interrupt */
+ USART3_IRQn = 39, /*!< USART3 global Interrupt */
+ EXTI15_10_IRQn = 40, /*!< External Line[15:10] Interrupts */
+ RTCAlarm_IRQn = 41, /*!< RTC Alarm through EXTI Line Interrupt */
+ USBWakeUp_IRQn = 42, /*!< USB Device WakeUp from suspend through EXTI Line Interrupt */
+ TIM8_BRK_IRQn = 43, /*!< TIM8 Break Interrupt */
+ TIM8_UP_IRQn = 44, /*!< TIM8 Update Interrupt */
+ TIM8_TRG_COM_IRQn = 45, /*!< TIM8 Trigger and Commutation Interrupt */
+ TIM8_CC_IRQn = 46, /*!< TIM8 Capture Compare Interrupt */
+ ADC3_IRQn = 47, /*!< ADC3 global Interrupt */
+ FSMC_IRQn = 48, /*!< FSMC global Interrupt */
+ SDIO_IRQn = 49, /*!< SDIO global Interrupt */
+ TIM5_IRQn = 50, /*!< TIM5 global Interrupt */
+ SPI3_IRQn = 51, /*!< SPI3 global Interrupt */
+ UART4_IRQn = 52, /*!< UART4 global Interrupt */
+ UART5_IRQn = 53, /*!< UART5 global Interrupt */
+ TIM6_IRQn = 54, /*!< TIM6 global Interrupt */
+ TIM7_IRQn = 55, /*!< TIM7 global Interrupt */
+ DMA2_Channel1_IRQn = 56, /*!< DMA2 Channel 1 global Interrupt */
+ DMA2_Channel2_IRQn = 57, /*!< DMA2 Channel 2 global Interrupt */
+ DMA2_Channel3_IRQn = 58, /*!< DMA2 Channel 3 global Interrupt */
+ DMA2_Channel4_5_IRQn = 59 /*!< DMA2 Channel 4 and Channel 5 global Interrupt */
+#endif /* STM32F10X_HD */
+
+#ifdef STM32F10X_HD_VL
+ ADC1_IRQn = 18, /*!< ADC1 global Interrupt */
+ EXTI9_5_IRQn = 23, /*!< External Line[9:5] Interrupts */
+ TIM1_BRK_TIM15_IRQn = 24, /*!< TIM1 Break and TIM15 Interrupts */
+ TIM1_UP_TIM16_IRQn = 25, /*!< TIM1 Update and TIM16 Interrupts */
+ TIM1_TRG_COM_TIM17_IRQn = 26, /*!< TIM1 Trigger and Commutation and TIM17 Interrupt */
+ TIM1_CC_IRQn = 27, /*!< TIM1 Capture Compare Interrupt */
+ TIM2_IRQn = 28, /*!< TIM2 global Interrupt */
+ TIM3_IRQn = 29, /*!< TIM3 global Interrupt */
+ TIM4_IRQn = 30, /*!< TIM4 global Interrupt */
+ I2C1_EV_IRQn = 31, /*!< I2C1 Event Interrupt */
+ I2C1_ER_IRQn = 32, /*!< I2C1 Error Interrupt */
+ I2C2_EV_IRQn = 33, /*!< I2C2 Event Interrupt */
+ I2C2_ER_IRQn = 34, /*!< I2C2 Error Interrupt */
+ SPI1_IRQn = 35, /*!< SPI1 global Interrupt */
+ SPI2_IRQn = 36, /*!< SPI2 global Interrupt */
+ USART1_IRQn = 37, /*!< USART1 global Interrupt */
+ USART2_IRQn = 38, /*!< USART2 global Interrupt */
+ USART3_IRQn = 39, /*!< USART3 global Interrupt */
+ EXTI15_10_IRQn = 40, /*!< External Line[15:10] Interrupts */
+ RTCAlarm_IRQn = 41, /*!< RTC Alarm through EXTI Line Interrupt */
+ CEC_IRQn = 42, /*!< HDMI-CEC Interrupt */
+ TIM12_IRQn = 43, /*!< TIM12 global Interrupt */
+ TIM13_IRQn = 44, /*!< TIM13 global Interrupt */
+ TIM14_IRQn = 45, /*!< TIM14 global Interrupt */
+ TIM5_IRQn = 50, /*!< TIM5 global Interrupt */
+ SPI3_IRQn = 51, /*!< SPI3 global Interrupt */
+ UART4_IRQn = 52, /*!< UART4 global Interrupt */
+ UART5_IRQn = 53, /*!< UART5 global Interrupt */
+ TIM6_DAC_IRQn = 54, /*!< TIM6 and DAC underrun Interrupt */
+ TIM7_IRQn = 55, /*!< TIM7 Interrupt */
+ DMA2_Channel1_IRQn = 56, /*!< DMA2 Channel 1 global Interrupt */
+ DMA2_Channel2_IRQn = 57, /*!< DMA2 Channel 2 global Interrupt */
+ DMA2_Channel3_IRQn = 58, /*!< DMA2 Channel 3 global Interrupt */
+ DMA2_Channel4_5_IRQn = 59, /*!< DMA2 Channel 4 and Channel 5 global Interrupt */
+ DMA2_Channel5_IRQn = 60 /*!< DMA2 Channel 5 global Interrupt (DMA2 Channel 5 is
+ mapped at position 60 only if the MISC_REMAP bit in
+ the AFIO_MAPR2 register is set) */
+#endif /* STM32F10X_HD_VL */
+
+#ifdef STM32F10X_XL
+ ADC1_2_IRQn = 18, /*!< ADC1 and ADC2 global Interrupt */
+ USB_HP_CAN1_TX_IRQn = 19, /*!< USB Device High Priority or CAN1 TX Interrupts */
+ USB_LP_CAN1_RX0_IRQn = 20, /*!< USB Device Low Priority or CAN1 RX0 Interrupts */
+ CAN1_RX1_IRQn = 21, /*!< CAN1 RX1 Interrupt */
+ CAN1_SCE_IRQn = 22, /*!< CAN1 SCE Interrupt */
+ EXTI9_5_IRQn = 23, /*!< External Line[9:5] Interrupts */
+ TIM1_BRK_TIM9_IRQn = 24, /*!< TIM1 Break Interrupt and TIM9 global Interrupt */
+ TIM1_UP_TIM10_IRQn = 25, /*!< TIM1 Update Interrupt and TIM10 global Interrupt */
+ TIM1_TRG_COM_TIM11_IRQn = 26, /*!< TIM1 Trigger and Commutation Interrupt and TIM11 global interrupt */
+ TIM1_CC_IRQn = 27, /*!< TIM1 Capture Compare Interrupt */
+ TIM2_IRQn = 28, /*!< TIM2 global Interrupt */
+ TIM3_IRQn = 29, /*!< TIM3 global Interrupt */
+ TIM4_IRQn = 30, /*!< TIM4 global Interrupt */
+ I2C1_EV_IRQn = 31, /*!< I2C1 Event Interrupt */
+ I2C1_ER_IRQn = 32, /*!< I2C1 Error Interrupt */
+ I2C2_EV_IRQn = 33, /*!< I2C2 Event Interrupt */
+ I2C2_ER_IRQn = 34, /*!< I2C2 Error Interrupt */
+ SPI1_IRQn = 35, /*!< SPI1 global Interrupt */
+ SPI2_IRQn = 36, /*!< SPI2 global Interrupt */
+ USART1_IRQn = 37, /*!< USART1 global Interrupt */
+ USART2_IRQn = 38, /*!< USART2 global Interrupt */
+ USART3_IRQn = 39, /*!< USART3 global Interrupt */
+ EXTI15_10_IRQn = 40, /*!< External Line[15:10] Interrupts */
+ RTCAlarm_IRQn = 41, /*!< RTC Alarm through EXTI Line Interrupt */
+ USBWakeUp_IRQn = 42, /*!< USB Device WakeUp from suspend through EXTI Line Interrupt */
+ TIM8_BRK_TIM12_IRQn = 43, /*!< TIM8 Break Interrupt and TIM12 global Interrupt */
+ TIM8_UP_TIM13_IRQn = 44, /*!< TIM8 Update Interrupt and TIM13 global Interrupt */
+ TIM8_TRG_COM_TIM14_IRQn = 45, /*!< TIM8 Trigger and Commutation Interrupt and TIM14 global interrupt */
+ TIM8_CC_IRQn = 46, /*!< TIM8 Capture Compare Interrupt */
+ ADC3_IRQn = 47, /*!< ADC3 global Interrupt */
+ FSMC_IRQn = 48, /*!< FSMC global Interrupt */
+ SDIO_IRQn = 49, /*!< SDIO global Interrupt */
+ TIM5_IRQn = 50, /*!< TIM5 global Interrupt */
+ SPI3_IRQn = 51, /*!< SPI3 global Interrupt */
+ UART4_IRQn = 52, /*!< UART4 global Interrupt */
+ UART5_IRQn = 53, /*!< UART5 global Interrupt */
+ TIM6_IRQn = 54, /*!< TIM6 global Interrupt */
+ TIM7_IRQn = 55, /*!< TIM7 global Interrupt */
+ DMA2_Channel1_IRQn = 56, /*!< DMA2 Channel 1 global Interrupt */
+ DMA2_Channel2_IRQn = 57, /*!< DMA2 Channel 2 global Interrupt */
+ DMA2_Channel3_IRQn = 58, /*!< DMA2 Channel 3 global Interrupt */
+ DMA2_Channel4_5_IRQn = 59 /*!< DMA2 Channel 4 and Channel 5 global Interrupt */
+#endif /* STM32F10X_XL */
+
+#ifdef STM32F10X_CL
+ ADC1_2_IRQn = 18, /*!< ADC1 and ADC2 global Interrupt */
+ CAN1_TX_IRQn = 19, /*!< USB Device High Priority or CAN1 TX Interrupts */
+ CAN1_RX0_IRQn = 20, /*!< USB Device Low Priority or CAN1 RX0 Interrupts */
+ CAN1_RX1_IRQn = 21, /*!< CAN1 RX1 Interrupt */
+ CAN1_SCE_IRQn = 22, /*!< CAN1 SCE Interrupt */
+ EXTI9_5_IRQn = 23, /*!< External Line[9:5] Interrupts */
+ TIM1_BRK_IRQn = 24, /*!< TIM1 Break Interrupt */
+ TIM1_UP_IRQn = 25, /*!< TIM1 Update Interrupt */
+ TIM1_TRG_COM_IRQn = 26, /*!< TIM1 Trigger and Commutation Interrupt */
+ TIM1_CC_IRQn = 27, /*!< TIM1 Capture Compare Interrupt */
+ TIM2_IRQn = 28, /*!< TIM2 global Interrupt */
+ TIM3_IRQn = 29, /*!< TIM3 global Interrupt */
+ TIM4_IRQn = 30, /*!< TIM4 global Interrupt */
+ I2C1_EV_IRQn = 31, /*!< I2C1 Event Interrupt */
+ I2C1_ER_IRQn = 32, /*!< I2C1 Error Interrupt */
+ I2C2_EV_IRQn = 33, /*!< I2C2 Event Interrupt */
+ I2C2_ER_IRQn = 34, /*!< I2C2 Error Interrupt */
+ SPI1_IRQn = 35, /*!< SPI1 global Interrupt */
+ SPI2_IRQn = 36, /*!< SPI2 global Interrupt */
+ USART1_IRQn = 37, /*!< USART1 global Interrupt */
+ USART2_IRQn = 38, /*!< USART2 global Interrupt */
+ USART3_IRQn = 39, /*!< USART3 global Interrupt */
+ EXTI15_10_IRQn = 40, /*!< External Line[15:10] Interrupts */
+ RTCAlarm_IRQn = 41, /*!< RTC Alarm through EXTI Line Interrupt */
+ OTG_FS_WKUP_IRQn = 42, /*!< USB OTG FS WakeUp from suspend through EXTI Line Interrupt */
+ TIM5_IRQn = 50, /*!< TIM5 global Interrupt */
+ SPI3_IRQn = 51, /*!< SPI3 global Interrupt */
+ UART4_IRQn = 52, /*!< UART4 global Interrupt */
+ UART5_IRQn = 53, /*!< UART5 global Interrupt */
+ TIM6_IRQn = 54, /*!< TIM6 global Interrupt */
+ TIM7_IRQn = 55, /*!< TIM7 global Interrupt */
+ DMA2_Channel1_IRQn = 56, /*!< DMA2 Channel 1 global Interrupt */
+ DMA2_Channel2_IRQn = 57, /*!< DMA2 Channel 2 global Interrupt */
+ DMA2_Channel3_IRQn = 58, /*!< DMA2 Channel 3 global Interrupt */
+ DMA2_Channel4_IRQn = 59, /*!< DMA2 Channel 4 global Interrupt */
+ DMA2_Channel5_IRQn = 60, /*!< DMA2 Channel 5 global Interrupt */
+ ETH_IRQn = 61, /*!< Ethernet global Interrupt */
+ ETH_WKUP_IRQn = 62, /*!< Ethernet Wakeup through EXTI line Interrupt */
+ CAN2_TX_IRQn = 63, /*!< CAN2 TX Interrupt */
+ CAN2_RX0_IRQn = 64, /*!< CAN2 RX0 Interrupt */
+ CAN2_RX1_IRQn = 65, /*!< CAN2 RX1 Interrupt */
+ CAN2_SCE_IRQn = 66, /*!< CAN2 SCE Interrupt */
+ OTG_FS_IRQn = 67 /*!< USB OTG FS global Interrupt */
+#endif /* STM32F10X_CL */
+} IRQn_Type;
+
+/**
+ * @}
+ */
+
+#include "core_cm3.h"
+#include "system_stm32f10x.h"
+#include
+
+/** @addtogroup Exported_types
+ * @{
+ */
+
+/*!< STM32F10x Standard Peripheral Library old types (maintained for legacy purpose) */
+typedef int32_t s32;
+typedef int16_t s16;
+typedef int8_t s8;
+
+typedef const int32_t sc32; /*!< Read Only */
+typedef const int16_t sc16; /*!< Read Only */
+typedef const int8_t sc8; /*!< Read Only */
+
+typedef __IO int32_t vs32;
+typedef __IO int16_t vs16;
+typedef __IO int8_t vs8;
+
+typedef __I int32_t vsc32; /*!< Read Only */
+typedef __I int16_t vsc16; /*!< Read Only */
+typedef __I int8_t vsc8; /*!< Read Only */
+
+typedef uint32_t u32;
+typedef uint16_t u16;
+typedef uint8_t u8;
+
+typedef const uint32_t uc32; /*!< Read Only */
+typedef const uint16_t uc16; /*!< Read Only */
+typedef const uint8_t uc8; /*!< Read Only */
+
+typedef __IO uint32_t vu32;
+typedef __IO uint16_t vu16;
+typedef __IO uint8_t vu8;
+
+typedef __I uint32_t vuc32; /*!< Read Only */
+typedef __I uint16_t vuc16; /*!< Read Only */
+typedef __I uint8_t vuc8; /*!< Read Only */
+
+typedef enum {RESET = 0, SET = !RESET} FlagStatus, ITStatus;
+
+typedef enum {DISABLE = 0, ENABLE = !DISABLE} FunctionalState;
+#define IS_FUNCTIONAL_STATE(STATE) (((STATE) == DISABLE) || ((STATE) == ENABLE))
+
+typedef enum {ERROR = 0, SUCCESS = !ERROR} ErrorStatus;
+
+/*!< STM32F10x Standard Peripheral Library old definitions (maintained for legacy purpose) */
+#define HSEStartUp_TimeOut HSE_STARTUP_TIMEOUT
+#define HSE_Value HSE_VALUE
+#define HSI_Value HSI_VALUE
+/**
+ * @}
+ */
+
+/** @addtogroup Peripheral_registers_structures
+ * @{
+ */
+
+/**
+ * @brief Analog to Digital Converter
+ */
+
+typedef struct
+{
+ __IO uint32_t SR;
+ __IO uint32_t CR1;
+ __IO uint32_t CR2;
+ __IO uint32_t SMPR1;
+ __IO uint32_t SMPR2;
+ __IO uint32_t JOFR1;
+ __IO uint32_t JOFR2;
+ __IO uint32_t JOFR3;
+ __IO uint32_t JOFR4;
+ __IO uint32_t HTR;
+ __IO uint32_t LTR;
+ __IO uint32_t SQR1;
+ __IO uint32_t SQR2;
+ __IO uint32_t SQR3;
+ __IO uint32_t JSQR;
+ __IO uint32_t JDR1;
+ __IO uint32_t JDR2;
+ __IO uint32_t JDR3;
+ __IO uint32_t JDR4;
+ __IO uint32_t DR;
+} ADC_TypeDef;
+
+/**
+ * @brief Backup Registers
+ */
+
+typedef struct
+{
+ uint32_t RESERVED0;
+ __IO uint16_t DR1;
+ uint16_t RESERVED1;
+ __IO uint16_t DR2;
+ uint16_t RESERVED2;
+ __IO uint16_t DR3;
+ uint16_t RESERVED3;
+ __IO uint16_t DR4;
+ uint16_t RESERVED4;
+ __IO uint16_t DR5;
+ uint16_t RESERVED5;
+ __IO uint16_t DR6;
+ uint16_t RESERVED6;
+ __IO uint16_t DR7;
+ uint16_t RESERVED7;
+ __IO uint16_t DR8;
+ uint16_t RESERVED8;
+ __IO uint16_t DR9;
+ uint16_t RESERVED9;
+ __IO uint16_t DR10;
+ uint16_t RESERVED10;
+ __IO uint16_t RTCCR;
+ uint16_t RESERVED11;
+ __IO uint16_t CR;
+ uint16_t RESERVED12;
+ __IO uint16_t CSR;
+ uint16_t RESERVED13[5];
+ __IO uint16_t DR11;
+ uint16_t RESERVED14;
+ __IO uint16_t DR12;
+ uint16_t RESERVED15;
+ __IO uint16_t DR13;
+ uint16_t RESERVED16;
+ __IO uint16_t DR14;
+ uint16_t RESERVED17;
+ __IO uint16_t DR15;
+ uint16_t RESERVED18;
+ __IO uint16_t DR16;
+ uint16_t RESERVED19;
+ __IO uint16_t DR17;
+ uint16_t RESERVED20;
+ __IO uint16_t DR18;
+ uint16_t RESERVED21;
+ __IO uint16_t DR19;
+ uint16_t RESERVED22;
+ __IO uint16_t DR20;
+ uint16_t RESERVED23;
+ __IO uint16_t DR21;
+ uint16_t RESERVED24;
+ __IO uint16_t DR22;
+ uint16_t RESERVED25;
+ __IO uint16_t DR23;
+ uint16_t RESERVED26;
+ __IO uint16_t DR24;
+ uint16_t RESERVED27;
+ __IO uint16_t DR25;
+ uint16_t RESERVED28;
+ __IO uint16_t DR26;
+ uint16_t RESERVED29;
+ __IO uint16_t DR27;
+ uint16_t RESERVED30;
+ __IO uint16_t DR28;
+ uint16_t RESERVED31;
+ __IO uint16_t DR29;
+ uint16_t RESERVED32;
+ __IO uint16_t DR30;
+ uint16_t RESERVED33;
+ __IO uint16_t DR31;
+ uint16_t RESERVED34;
+ __IO uint16_t DR32;
+ uint16_t RESERVED35;
+ __IO uint16_t DR33;
+ uint16_t RESERVED36;
+ __IO uint16_t DR34;
+ uint16_t RESERVED37;
+ __IO uint16_t DR35;
+ uint16_t RESERVED38;
+ __IO uint16_t DR36;
+ uint16_t RESERVED39;
+ __IO uint16_t DR37;
+ uint16_t RESERVED40;
+ __IO uint16_t DR38;
+ uint16_t RESERVED41;
+ __IO uint16_t DR39;
+ uint16_t RESERVED42;
+ __IO uint16_t DR40;
+ uint16_t RESERVED43;
+ __IO uint16_t DR41;
+ uint16_t RESERVED44;
+ __IO uint16_t DR42;
+ uint16_t RESERVED45;
+} BKP_TypeDef;
+
+/**
+ * @brief Controller Area Network TxMailBox
+ */
+
+typedef struct
+{
+ __IO uint32_t TIR;
+ __IO uint32_t TDTR;
+ __IO uint32_t TDLR;
+ __IO uint32_t TDHR;
+} CAN_TxMailBox_TypeDef;
+
+/**
+ * @brief Controller Area Network FIFOMailBox
+ */
+
+typedef struct
+{
+ __IO uint32_t RIR;
+ __IO uint32_t RDTR;
+ __IO uint32_t RDLR;
+ __IO uint32_t RDHR;
+} CAN_FIFOMailBox_TypeDef;
+
+/**
+ * @brief Controller Area Network FilterRegister
+ */
+
+typedef struct
+{
+ __IO uint32_t FR1;
+ __IO uint32_t FR2;
+} CAN_FilterRegister_TypeDef;
+
+/**
+ * @brief Controller Area Network
+ */
+
+typedef struct
+{
+ __IO uint32_t MCR;
+ __IO uint32_t MSR;
+ __IO uint32_t TSR;
+ __IO uint32_t RF0R;
+ __IO uint32_t RF1R;
+ __IO uint32_t IER;
+ __IO uint32_t ESR;
+ __IO uint32_t BTR;
+ uint32_t RESERVED0[88];
+ CAN_TxMailBox_TypeDef sTxMailBox[3];
+ CAN_FIFOMailBox_TypeDef sFIFOMailBox[2];
+ uint32_t RESERVED1[12];
+ __IO uint32_t FMR;
+ __IO uint32_t FM1R;
+ uint32_t RESERVED2;
+ __IO uint32_t FS1R;
+ uint32_t RESERVED3;
+ __IO uint32_t FFA1R;
+ uint32_t RESERVED4;
+ __IO uint32_t FA1R;
+ uint32_t RESERVED5[8];
+#ifndef STM32F10X_CL
+ CAN_FilterRegister_TypeDef sFilterRegister[14];
+#else
+ CAN_FilterRegister_TypeDef sFilterRegister[28];
+#endif /* STM32F10X_CL */
+} CAN_TypeDef;
+
+/**
+ * @brief Consumer Electronics Control (CEC)
+ */
+typedef struct
+{
+ __IO uint32_t CFGR;
+ __IO uint32_t OAR;
+ __IO uint32_t PRES;
+ __IO uint32_t ESR;
+ __IO uint32_t CSR;
+ __IO uint32_t TXD;
+ __IO uint32_t RXD;
+} CEC_TypeDef;
+
+/**
+ * @brief CRC calculation unit
+ */
+
+typedef struct
+{
+ __IO uint32_t DR;
+ __IO uint8_t IDR;
+ uint8_t RESERVED0;
+ uint16_t RESERVED1;
+ __IO uint32_t CR;
+} CRC_TypeDef;
+
+/**
+ * @brief Digital to Analog Converter
+ */
+
+typedef struct
+{
+ __IO uint32_t CR;
+ __IO uint32_t SWTRIGR;
+ __IO uint32_t DHR12R1;
+ __IO uint32_t DHR12L1;
+ __IO uint32_t DHR8R1;
+ __IO uint32_t DHR12R2;
+ __IO uint32_t DHR12L2;
+ __IO uint32_t DHR8R2;
+ __IO uint32_t DHR12RD;
+ __IO uint32_t DHR12LD;
+ __IO uint32_t DHR8RD;
+ __IO uint32_t DOR1;
+ __IO uint32_t DOR2;
+#if defined (STM32F10X_LD_VL) || defined (STM32F10X_MD_VL) || defined (STM32F10X_HD_VL)
+ __IO uint32_t SR;
+#endif
+} DAC_TypeDef;
+
+/**
+ * @brief Debug MCU
+ */
+
+typedef struct
+{
+ __IO uint32_t IDCODE;
+ __IO uint32_t CR;
+}DBGMCU_TypeDef;
+
+/**
+ * @brief DMA Controller
+ */
+
+typedef struct
+{
+ __IO uint32_t CCR;
+ __IO uint32_t CNDTR;
+ __IO uint32_t CPAR;
+ __IO uint32_t CMAR;
+} DMA_Channel_TypeDef;
+
+typedef struct
+{
+ __IO uint32_t ISR;
+ __IO uint32_t IFCR;
+} DMA_TypeDef;
+
+/**
+ * @brief Ethernet MAC
+ */
+
+typedef struct
+{
+ __IO uint32_t MACCR;
+ __IO uint32_t MACFFR;
+ __IO uint32_t MACHTHR;
+ __IO uint32_t MACHTLR;
+ __IO uint32_t MACMIIAR;
+ __IO uint32_t MACMIIDR;
+ __IO uint32_t MACFCR;
+ __IO uint32_t MACVLANTR; /* 8 */
+ uint32_t RESERVED0[2];
+ __IO uint32_t MACRWUFFR; /* 11 */
+ __IO uint32_t MACPMTCSR;
+ uint32_t RESERVED1[2];
+ __IO uint32_t MACSR; /* 15 */
+ __IO uint32_t MACIMR;
+ __IO uint32_t MACA0HR;
+ __IO uint32_t MACA0LR;
+ __IO uint32_t MACA1HR;
+ __IO uint32_t MACA1LR;
+ __IO uint32_t MACA2HR;
+ __IO uint32_t MACA2LR;
+ __IO uint32_t MACA3HR;
+ __IO uint32_t MACA3LR; /* 24 */
+ uint32_t RESERVED2[40];
+ __IO uint32_t MMCCR; /* 65 */
+ __IO uint32_t MMCRIR;
+ __IO uint32_t MMCTIR;
+ __IO uint32_t MMCRIMR;
+ __IO uint32_t MMCTIMR; /* 69 */
+ uint32_t RESERVED3[14];
+ __IO uint32_t MMCTGFSCCR; /* 84 */
+ __IO uint32_t MMCTGFMSCCR;
+ uint32_t RESERVED4[5];
+ __IO uint32_t MMCTGFCR;
+ uint32_t RESERVED5[10];
+ __IO uint32_t MMCRFCECR;
+ __IO uint32_t MMCRFAECR;
+ uint32_t RESERVED6[10];
+ __IO uint32_t MMCRGUFCR;
+ uint32_t RESERVED7[334];
+ __IO uint32_t PTPTSCR;
+ __IO uint32_t PTPSSIR;
+ __IO uint32_t PTPTSHR;
+ __IO uint32_t PTPTSLR;
+ __IO uint32_t PTPTSHUR;
+ __IO uint32_t PTPTSLUR;
+ __IO uint32_t PTPTSAR;
+ __IO uint32_t PTPTTHR;
+ __IO uint32_t PTPTTLR;
+ uint32_t RESERVED8[567];
+ __IO uint32_t DMABMR;
+ __IO uint32_t DMATPDR;
+ __IO uint32_t DMARPDR;
+ __IO uint32_t DMARDLAR;
+ __IO uint32_t DMATDLAR;
+ __IO uint32_t DMASR;
+ __IO uint32_t DMAOMR;
+ __IO uint32_t DMAIER;
+ __IO uint32_t DMAMFBOCR;
+ uint32_t RESERVED9[9];
+ __IO uint32_t DMACHTDR;
+ __IO uint32_t DMACHRDR;
+ __IO uint32_t DMACHTBAR;
+ __IO uint32_t DMACHRBAR;
+} ETH_TypeDef;
+
+/**
+ * @brief External Interrupt/Event Controller
+ */
+
+typedef struct
+{
+ __IO uint32_t IMR;
+ __IO uint32_t EMR;
+ __IO uint32_t RTSR;
+ __IO uint32_t FTSR;
+ __IO uint32_t SWIER;
+ __IO uint32_t PR;
+} EXTI_TypeDef;
+
+/**
+ * @brief FLASH Registers
+ */
+
+typedef struct
+{
+ __IO uint32_t ACR;
+ __IO uint32_t KEYR;
+ __IO uint32_t OPTKEYR;
+ __IO uint32_t SR;
+ __IO uint32_t CR;
+ __IO uint32_t AR;
+ __IO uint32_t RESERVED;
+ __IO uint32_t OBR;
+ __IO uint32_t WRPR;
+#ifdef STM32F10X_XL
+ uint32_t RESERVED1[8];
+ __IO uint32_t KEYR2;
+ uint32_t RESERVED2;
+ __IO uint32_t SR2;
+ __IO uint32_t CR2;
+ __IO uint32_t AR2;
+#endif /* STM32F10X_XL */
+} FLASH_TypeDef;
+
+/**
+ * @brief Option Bytes Registers
+ */
+
+typedef struct
+{
+ __IO uint16_t RDP;
+ __IO uint16_t USER;
+ __IO uint16_t Data0;
+ __IO uint16_t Data1;
+ __IO uint16_t WRP0;
+ __IO uint16_t WRP1;
+ __IO uint16_t WRP2;
+ __IO uint16_t WRP3;
+} OB_TypeDef;
+
+/**
+ * @brief Flexible Static Memory Controller
+ */
+
+typedef struct
+{
+ __IO uint32_t BTCR[8];
+} FSMC_Bank1_TypeDef;
+
+/**
+ * @brief Flexible Static Memory Controller Bank1E
+ */
+
+typedef struct
+{
+ __IO uint32_t BWTR[7];
+} FSMC_Bank1E_TypeDef;
+
+/**
+ * @brief Flexible Static Memory Controller Bank2
+ */
+
+typedef struct
+{
+ __IO uint32_t PCR2;
+ __IO uint32_t SR2;
+ __IO uint32_t PMEM2;
+ __IO uint32_t PATT2;
+ uint32_t RESERVED0;
+ __IO uint32_t ECCR2;
+} FSMC_Bank2_TypeDef;
+
+/**
+ * @brief Flexible Static Memory Controller Bank3
+ */
+
+typedef struct
+{
+ __IO uint32_t PCR3;
+ __IO uint32_t SR3;
+ __IO uint32_t PMEM3;
+ __IO uint32_t PATT3;
+ uint32_t RESERVED0;
+ __IO uint32_t ECCR3;
+} FSMC_Bank3_TypeDef;
+
+/**
+ * @brief Flexible Static Memory Controller Bank4
+ */
+
+typedef struct
+{
+ __IO uint32_t PCR4;
+ __IO uint32_t SR4;
+ __IO uint32_t PMEM4;
+ __IO uint32_t PATT4;
+ __IO uint32_t PIO4;
+} FSMC_Bank4_TypeDef;
+
+/**
+ * @brief General Purpose I/O
+ */
+
+typedef struct
+{
+ __IO uint32_t CRL;
+ __IO uint32_t CRH;
+ __IO uint32_t IDR;
+ __IO uint32_t ODR;
+ __IO uint32_t BSRR;
+ __IO uint32_t BRR;
+ __IO uint32_t LCKR;
+} GPIO_TypeDef;
+
+/**
+ * @brief Alternate Function I/O
+ */
+
+typedef struct
+{
+ __IO uint32_t EVCR;
+ __IO uint32_t MAPR;
+ __IO uint32_t EXTICR[4];
+ uint32_t RESERVED0;
+ __IO uint32_t MAPR2;
+} AFIO_TypeDef;
+/**
+ * @brief Inter Integrated Circuit Interface
+ */
+
+typedef struct
+{
+ __IO uint16_t CR1;
+ uint16_t RESERVED0;
+ __IO uint16_t CR2;
+ uint16_t RESERVED1;
+ __IO uint16_t OAR1;
+ uint16_t RESERVED2;
+ __IO uint16_t OAR2;
+ uint16_t RESERVED3;
+ __IO uint16_t DR;
+ uint16_t RESERVED4;
+ __IO uint16_t SR1;
+ uint16_t RESERVED5;
+ __IO uint16_t SR2;
+ uint16_t RESERVED6;
+ __IO uint16_t CCR;
+ uint16_t RESERVED7;
+ __IO uint16_t TRISE;
+ uint16_t RESERVED8;
+} I2C_TypeDef;
+
+/**
+ * @brief Independent WATCHDOG
+ */
+
+typedef struct
+{
+ __IO uint32_t KR;
+ __IO uint32_t PR;
+ __IO uint32_t RLR;
+ __IO uint32_t SR;
+} IWDG_TypeDef;
+
+/**
+ * @brief Power Control
+ */
+
+typedef struct
+{
+ __IO uint32_t CR;
+ __IO uint32_t CSR;
+} PWR_TypeDef;
+
+/**
+ * @brief Reset and Clock Control
+ */
+
+typedef struct
+{
+ __IO uint32_t CR;
+ __IO uint32_t CFGR;
+ __IO uint32_t CIR;
+ __IO uint32_t APB2RSTR;
+ __IO uint32_t APB1RSTR;
+ __IO uint32_t AHBENR;
+ __IO uint32_t APB2ENR;
+ __IO uint32_t APB1ENR;
+ __IO uint32_t BDCR;
+ __IO uint32_t CSR;
+
+#ifdef STM32F10X_CL
+ __IO uint32_t AHBRSTR;
+ __IO uint32_t CFGR2;
+#endif /* STM32F10X_CL */
+
+#if defined (STM32F10X_LD_VL) || defined (STM32F10X_MD_VL) || defined (STM32F10X_HD_VL)
+ uint32_t RESERVED0;
+ __IO uint32_t CFGR2;
+#endif /* STM32F10X_LD_VL || STM32F10X_MD_VL || STM32F10X_HD_VL */
+} RCC_TypeDef;
+
+/**
+ * @brief Real-Time Clock
+ */
+
+typedef struct
+{
+ __IO uint16_t CRH;
+ uint16_t RESERVED0;
+ __IO uint16_t CRL;
+ uint16_t RESERVED1;
+ __IO uint16_t PRLH;
+ uint16_t RESERVED2;
+ __IO uint16_t PRLL;
+ uint16_t RESERVED3;
+ __IO uint16_t DIVH;
+ uint16_t RESERVED4;
+ __IO uint16_t DIVL;
+ uint16_t RESERVED5;
+ __IO uint16_t CNTH;
+ uint16_t RESERVED6;
+ __IO uint16_t CNTL;
+ uint16_t RESERVED7;
+ __IO uint16_t ALRH;
+ uint16_t RESERVED8;
+ __IO uint16_t ALRL;
+ uint16_t RESERVED9;
+} RTC_TypeDef;
+
+/**
+ * @brief SD host Interface
+ */
+
+typedef struct
+{
+ __IO uint32_t POWER;
+ __IO uint32_t CLKCR;
+ __IO uint32_t ARG;
+ __IO uint32_t CMD;
+ __I uint32_t RESPCMD;
+ __I uint32_t RESP1;
+ __I uint32_t RESP2;
+ __I uint32_t RESP3;
+ __I uint32_t RESP4;
+ __IO uint32_t DTIMER;
+ __IO uint32_t DLEN;
+ __IO uint32_t DCTRL;
+ __I uint32_t DCOUNT;
+ __I uint32_t STA;
+ __IO uint32_t ICR;
+ __IO uint32_t MASK;
+ uint32_t RESERVED0[2];
+ __I uint32_t FIFOCNT;
+ uint32_t RESERVED1[13];
+ __IO uint32_t FIFO;
+} SDIO_TypeDef;
+
+/**
+ * @brief Serial Peripheral Interface
+ */
+
+typedef struct
+{
+ __IO uint16_t CR1;
+ uint16_t RESERVED0;
+ __IO uint16_t CR2;
+ uint16_t RESERVED1;
+ __IO uint16_t SR;
+ uint16_t RESERVED2;
+ __IO uint16_t DR;
+ uint16_t RESERVED3;
+ __IO uint16_t CRCPR;
+ uint16_t RESERVED4;
+ __IO uint16_t RXCRCR;
+ uint16_t RESERVED5;
+ __IO uint16_t TXCRCR;
+ uint16_t RESERVED6;
+ __IO uint16_t I2SCFGR;
+ uint16_t RESERVED7;
+ __IO uint16_t I2SPR;
+ uint16_t RESERVED8;
+} SPI_TypeDef;
+
+/**
+ * @brief TIM
+ */
+
+typedef struct
+{
+ __IO uint16_t CR1;
+ uint16_t RESERVED0;
+ __IO uint16_t CR2;
+ uint16_t RESERVED1;
+ __IO uint16_t SMCR;
+ uint16_t RESERVED2;
+ __IO uint16_t DIER;
+ uint16_t RESERVED3;
+ __IO uint16_t SR;
+ uint16_t RESERVED4;
+ __IO uint16_t EGR;
+ uint16_t RESERVED5;
+ __IO uint16_t CCMR1;
+ uint16_t RESERVED6;
+ __IO uint16_t CCMR2;
+ uint16_t RESERVED7;
+ __IO uint16_t CCER;
+ uint16_t RESERVED8;
+ __IO uint16_t CNT;
+ uint16_t RESERVED9;
+ __IO uint16_t PSC;
+ uint16_t RESERVED10;
+ __IO uint16_t ARR;
+ uint16_t RESERVED11;
+ __IO uint16_t RCR;
+ uint16_t RESERVED12;
+ __IO uint16_t CCR1;
+ uint16_t RESERVED13;
+ __IO uint16_t CCR2;
+ uint16_t RESERVED14;
+ __IO uint16_t CCR3;
+ uint16_t RESERVED15;
+ __IO uint16_t CCR4;
+ uint16_t RESERVED16;
+ __IO uint16_t BDTR;
+ uint16_t RESERVED17;
+ __IO uint16_t DCR;
+ uint16_t RESERVED18;
+ __IO uint16_t DMAR;
+ uint16_t RESERVED19;
+} TIM_TypeDef;
+
+/**
+ * @brief Universal Synchronous Asynchronous Receiver Transmitter
+ */
+
+typedef struct
+{
+ __IO uint16_t SR;
+ uint16_t RESERVED0;
+ __IO uint16_t DR;
+ uint16_t RESERVED1;
+ __IO uint16_t BRR;
+ uint16_t RESERVED2;
+ __IO uint16_t CR1;
+ uint16_t RESERVED3;
+ __IO uint16_t CR2;
+ uint16_t RESERVED4;
+ __IO uint16_t CR3;
+ uint16_t RESERVED5;
+ __IO uint16_t GTPR;
+ uint16_t RESERVED6;
+} USART_TypeDef;
+
+/**
+ * @brief Window WATCHDOG
+ */
+
+typedef struct
+{
+ __IO uint32_t CR;
+ __IO uint32_t CFR;
+ __IO uint32_t SR;
+} WWDG_TypeDef;
+
+/**
+ * @}
+ */
+
+/** @addtogroup Peripheral_memory_map
+ * @{
+ */
+
+
+#define FLASH_BASE ((uint32_t)0x08000000) /*!< FLASH base address in the alias region */
+#define SRAM_BASE ((uint32_t)0x20000000) /*!< SRAM base address in the alias region */
+#define PERIPH_BASE ((uint32_t)0x40000000) /*!< Peripheral base address in the alias region */
+
+#define SRAM_BB_BASE ((uint32_t)0x22000000) /*!< SRAM base address in the bit-band region */
+#define PERIPH_BB_BASE ((uint32_t)0x42000000) /*!< Peripheral base address in the bit-band region */
+
+#define FSMC_R_BASE ((uint32_t)0xA0000000) /*!< FSMC registers base address */
+
+/*!< Peripheral memory map */
+#define APB1PERIPH_BASE PERIPH_BASE
+#define APB2PERIPH_BASE (PERIPH_BASE + 0x10000)
+#define AHBPERIPH_BASE (PERIPH_BASE + 0x20000)
+
+#define TIM2_BASE (APB1PERIPH_BASE + 0x0000)
+#define TIM3_BASE (APB1PERIPH_BASE + 0x0400)
+#define TIM4_BASE (APB1PERIPH_BASE + 0x0800)
+#define TIM5_BASE (APB1PERIPH_BASE + 0x0C00)
+#define TIM6_BASE (APB1PERIPH_BASE + 0x1000)
+#define TIM7_BASE (APB1PERIPH_BASE + 0x1400)
+#define TIM12_BASE (APB1PERIPH_BASE + 0x1800)
+#define TIM13_BASE (APB1PERIPH_BASE + 0x1C00)
+#define TIM14_BASE (APB1PERIPH_BASE + 0x2000)
+#define RTC_BASE (APB1PERIPH_BASE + 0x2800)
+#define WWDG_BASE (APB1PERIPH_BASE + 0x2C00)
+#define IWDG_BASE (APB1PERIPH_BASE + 0x3000)
+#define SPI2_BASE (APB1PERIPH_BASE + 0x3800)
+#define SPI3_BASE (APB1PERIPH_BASE + 0x3C00)
+#define USART2_BASE (APB1PERIPH_BASE + 0x4400)
+#define USART3_BASE (APB1PERIPH_BASE + 0x4800)
+#define UART4_BASE (APB1PERIPH_BASE + 0x4C00)
+#define UART5_BASE (APB1PERIPH_BASE + 0x5000)
+#define I2C1_BASE (APB1PERIPH_BASE + 0x5400)
+#define I2C2_BASE (APB1PERIPH_BASE + 0x5800)
+#define CAN1_BASE (APB1PERIPH_BASE + 0x6400)
+#define CAN2_BASE (APB1PERIPH_BASE + 0x6800)
+#define BKP_BASE (APB1PERIPH_BASE + 0x6C00)
+#define PWR_BASE (APB1PERIPH_BASE + 0x7000)
+#define DAC_BASE (APB1PERIPH_BASE + 0x7400)
+#define CEC_BASE (APB1PERIPH_BASE + 0x7800)
+
+#define AFIO_BASE (APB2PERIPH_BASE + 0x0000)
+#define EXTI_BASE (APB2PERIPH_BASE + 0x0400)
+#define GPIOA_BASE (APB2PERIPH_BASE + 0x0800)
+#define GPIOB_BASE (APB2PERIPH_BASE + 0x0C00)
+#define GPIOC_BASE (APB2PERIPH_BASE + 0x1000)
+#define GPIOD_BASE (APB2PERIPH_BASE + 0x1400)
+#define GPIOE_BASE (APB2PERIPH_BASE + 0x1800)
+#define GPIOF_BASE (APB2PERIPH_BASE + 0x1C00)
+#define GPIOG_BASE (APB2PERIPH_BASE + 0x2000)
+#define ADC1_BASE (APB2PERIPH_BASE + 0x2400)
+#define ADC2_BASE (APB2PERIPH_BASE + 0x2800)
+#define TIM1_BASE (APB2PERIPH_BASE + 0x2C00)
+#define SPI1_BASE (APB2PERIPH_BASE + 0x3000)
+#define TIM8_BASE (APB2PERIPH_BASE + 0x3400)
+#define USART1_BASE (APB2PERIPH_BASE + 0x3800)
+#define ADC3_BASE (APB2PERIPH_BASE + 0x3C00)
+#define TIM15_BASE (APB2PERIPH_BASE + 0x4000)
+#define TIM16_BASE (APB2PERIPH_BASE + 0x4400)
+#define TIM17_BASE (APB2PERIPH_BASE + 0x4800)
+#define TIM9_BASE (APB2PERIPH_BASE + 0x4C00)
+#define TIM10_BASE (APB2PERIPH_BASE + 0x5000)
+#define TIM11_BASE (APB2PERIPH_BASE + 0x5400)
+
+#define SDIO_BASE (PERIPH_BASE + 0x18000)
+
+#define DMA1_BASE (AHBPERIPH_BASE + 0x0000)
+#define DMA1_Channel1_BASE (AHBPERIPH_BASE + 0x0008)
+#define DMA1_Channel2_BASE (AHBPERIPH_BASE + 0x001C)
+#define DMA1_Channel3_BASE (AHBPERIPH_BASE + 0x0030)
+#define DMA1_Channel4_BASE (AHBPERIPH_BASE + 0x0044)
+#define DMA1_Channel5_BASE (AHBPERIPH_BASE + 0x0058)
+#define DMA1_Channel6_BASE (AHBPERIPH_BASE + 0x006C)
+#define DMA1_Channel7_BASE (AHBPERIPH_BASE + 0x0080)
+#define DMA2_BASE (AHBPERIPH_BASE + 0x0400)
+#define DMA2_Channel1_BASE (AHBPERIPH_BASE + 0x0408)
+#define DMA2_Channel2_BASE (AHBPERIPH_BASE + 0x041C)
+#define DMA2_Channel3_BASE (AHBPERIPH_BASE + 0x0430)
+#define DMA2_Channel4_BASE (AHBPERIPH_BASE + 0x0444)
+#define DMA2_Channel5_BASE (AHBPERIPH_BASE + 0x0458)
+#define RCC_BASE (AHBPERIPH_BASE + 0x1000)
+#define CRC_BASE (AHBPERIPH_BASE + 0x3000)
+
+#define FLASH_R_BASE (AHBPERIPH_BASE + 0x2000) /*!< Flash registers base address */
+#define OB_BASE ((uint32_t)0x1FFFF800) /*!< Flash Option Bytes base address */
+
+#define ETH_BASE (AHBPERIPH_BASE + 0x8000)
+#define ETH_MAC_BASE (ETH_BASE)
+#define ETH_MMC_BASE (ETH_BASE + 0x0100)
+#define ETH_PTP_BASE (ETH_BASE + 0x0700)
+#define ETH_DMA_BASE (ETH_BASE + 0x1000)
+
+#define FSMC_Bank1_R_BASE (FSMC_R_BASE + 0x0000) /*!< FSMC Bank1 registers base address */
+#define FSMC_Bank1E_R_BASE (FSMC_R_BASE + 0x0104) /*!< FSMC Bank1E registers base address */
+#define FSMC_Bank2_R_BASE (FSMC_R_BASE + 0x0060) /*!< FSMC Bank2 registers base address */
+#define FSMC_Bank3_R_BASE (FSMC_R_BASE + 0x0080) /*!< FSMC Bank3 registers base address */
+#define FSMC_Bank4_R_BASE (FSMC_R_BASE + 0x00A0) /*!< FSMC Bank4 registers base address */
+
+#define DBGMCU_BASE ((uint32_t)0xE0042000) /*!< Debug MCU registers base address */
+
+/**
+ * @}
+ */
+
+/** @addtogroup Peripheral_declaration
+ * @{
+ */
+
+#define TIM2 ((TIM_TypeDef *) TIM2_BASE)
+#define TIM3 ((TIM_TypeDef *) TIM3_BASE)
+#define TIM4 ((TIM_TypeDef *) TIM4_BASE)
+#define TIM5 ((TIM_TypeDef *) TIM5_BASE)
+#define TIM6 ((TIM_TypeDef *) TIM6_BASE)
+#define TIM7 ((TIM_TypeDef *) TIM7_BASE)
+#define TIM12 ((TIM_TypeDef *) TIM12_BASE)
+#define TIM13 ((TIM_TypeDef *) TIM13_BASE)
+#define TIM14 ((TIM_TypeDef *) TIM14_BASE)
+#define RTC ((RTC_TypeDef *) RTC_BASE)
+#define WWDG ((WWDG_TypeDef *) WWDG_BASE)
+#define IWDG ((IWDG_TypeDef *) IWDG_BASE)
+#define SPI2 ((SPI_TypeDef *) SPI2_BASE)
+#define SPI3 ((SPI_TypeDef *) SPI3_BASE)
+#define USART2 ((USART_TypeDef *) USART2_BASE)
+#define USART3 ((USART_TypeDef *) USART3_BASE)
+#define UART4 ((USART_TypeDef *) UART4_BASE)
+#define UART5 ((USART_TypeDef *) UART5_BASE)
+#define I2C1 ((I2C_TypeDef *) I2C1_BASE)
+#define I2C2 ((I2C_TypeDef *) I2C2_BASE)
+#define CAN1 ((CAN_TypeDef *) CAN1_BASE)
+#define CAN2 ((CAN_TypeDef *) CAN2_BASE)
+#define BKP ((BKP_TypeDef *) BKP_BASE)
+#define PWR ((PWR_TypeDef *) PWR_BASE)
+#define DAC ((DAC_TypeDef *) DAC_BASE)
+#define CEC ((CEC_TypeDef *) CEC_BASE)
+#define AFIO ((AFIO_TypeDef *) AFIO_BASE)
+#define EXTI ((EXTI_TypeDef *) EXTI_BASE)
+#define GPIOA ((GPIO_TypeDef *) GPIOA_BASE)
+#define GPIOB ((GPIO_TypeDef *) GPIOB_BASE)
+#define GPIOC ((GPIO_TypeDef *) GPIOC_BASE)
+#define GPIOD ((GPIO_TypeDef *) GPIOD_BASE)
+#define GPIOE ((GPIO_TypeDef *) GPIOE_BASE)
+#define GPIOF ((GPIO_TypeDef *) GPIOF_BASE)
+#define GPIOG ((GPIO_TypeDef *) GPIOG_BASE)
+#define ADC1 ((ADC_TypeDef *) ADC1_BASE)
+#define ADC2 ((ADC_TypeDef *) ADC2_BASE)
+#define TIM1 ((TIM_TypeDef *) TIM1_BASE)
+#define SPI1 ((SPI_TypeDef *) SPI1_BASE)
+#define TIM8 ((TIM_TypeDef *) TIM8_BASE)
+#define USART1 ((USART_TypeDef *) USART1_BASE)
+#define ADC3 ((ADC_TypeDef *) ADC3_BASE)
+#define TIM15 ((TIM_TypeDef *) TIM15_BASE)
+#define TIM16 ((TIM_TypeDef *) TIM16_BASE)
+#define TIM17 ((TIM_TypeDef *) TIM17_BASE)
+#define TIM9 ((TIM_TypeDef *) TIM9_BASE)
+#define TIM10 ((TIM_TypeDef *) TIM10_BASE)
+#define TIM11 ((TIM_TypeDef *) TIM11_BASE)
+#define SDIO ((SDIO_TypeDef *) SDIO_BASE)
+#define DMA1 ((DMA_TypeDef *) DMA1_BASE)
+#define DMA2 ((DMA_TypeDef *) DMA2_BASE)
+#define DMA1_Channel1 ((DMA_Channel_TypeDef *) DMA1_Channel1_BASE)
+#define DMA1_Channel2 ((DMA_Channel_TypeDef *) DMA1_Channel2_BASE)
+#define DMA1_Channel3 ((DMA_Channel_TypeDef *) DMA1_Channel3_BASE)
+#define DMA1_Channel4 ((DMA_Channel_TypeDef *) DMA1_Channel4_BASE)
+#define DMA1_Channel5 ((DMA_Channel_TypeDef *) DMA1_Channel5_BASE)
+#define DMA1_Channel6 ((DMA_Channel_TypeDef *) DMA1_Channel6_BASE)
+#define DMA1_Channel7 ((DMA_Channel_TypeDef *) DMA1_Channel7_BASE)
+#define DMA2_Channel1 ((DMA_Channel_TypeDef *) DMA2_Channel1_BASE)
+#define DMA2_Channel2 ((DMA_Channel_TypeDef *) DMA2_Channel2_BASE)
+#define DMA2_Channel3 ((DMA_Channel_TypeDef *) DMA2_Channel3_BASE)
+#define DMA2_Channel4 ((DMA_Channel_TypeDef *) DMA2_Channel4_BASE)
+#define DMA2_Channel5 ((DMA_Channel_TypeDef *) DMA2_Channel5_BASE)
+#define RCC ((RCC_TypeDef *) RCC_BASE)
+#define CRC ((CRC_TypeDef *) CRC_BASE)
+#define FLASH ((FLASH_TypeDef *) FLASH_R_BASE)
+#define OB ((OB_TypeDef *) OB_BASE)
+#define ETH ((ETH_TypeDef *) ETH_BASE)
+#define FSMC_Bank1 ((FSMC_Bank1_TypeDef *) FSMC_Bank1_R_BASE)
+#define FSMC_Bank1E ((FSMC_Bank1E_TypeDef *) FSMC_Bank1E_R_BASE)
+#define FSMC_Bank2 ((FSMC_Bank2_TypeDef *) FSMC_Bank2_R_BASE)
+#define FSMC_Bank3 ((FSMC_Bank3_TypeDef *) FSMC_Bank3_R_BASE)
+#define FSMC_Bank4 ((FSMC_Bank4_TypeDef *) FSMC_Bank4_R_BASE)
+#define DBGMCU ((DBGMCU_TypeDef *) DBGMCU_BASE)
+
+/**
+ * @}
+ */
+
+/** @addtogroup Exported_constants
+ * @{
+ */
+
+ /** @addtogroup Peripheral_Registers_Bits_Definition
+ * @{
+ */
+
+/******************************************************************************/
+/* Peripheral Registers_Bits_Definition */
+/******************************************************************************/
+
+/******************************************************************************/
+/* */
+/* CRC calculation unit */
+/* */
+/******************************************************************************/
+
+/******************* Bit definition for CRC_DR register *********************/
+#define CRC_DR_DR ((uint32_t)0xFFFFFFFF) /*!< Data register bits */
+
+
+/******************* Bit definition for CRC_IDR register ********************/
+#define CRC_IDR_IDR ((uint8_t)0xFF) /*!< General-purpose 8-bit data register bits */
+
+
+/******************** Bit definition for CRC_CR register ********************/
+#define CRC_CR_RESET ((uint8_t)0x01) /*!< RESET bit */
+
+/******************************************************************************/
+/* */
+/* Power Control */
+/* */
+/******************************************************************************/
+
+/******************** Bit definition for PWR_CR register ********************/
+#define PWR_CR_LPDS ((uint16_t)0x0001) /*!< Low-Power Deepsleep */
+#define PWR_CR_PDDS ((uint16_t)0x0002) /*!< Power Down Deepsleep */
+#define PWR_CR_CWUF ((uint16_t)0x0004) /*!< Clear Wakeup Flag */
+#define PWR_CR_CSBF ((uint16_t)0x0008) /*!< Clear Standby Flag */
+#define PWR_CR_PVDE ((uint16_t)0x0010) /*!< Power Voltage Detector Enable */
+
+#define PWR_CR_PLS ((uint16_t)0x00E0) /*!< PLS[2:0] bits (PVD Level Selection) */
+#define PWR_CR_PLS_0 ((uint16_t)0x0020) /*!< Bit 0 */
+#define PWR_CR_PLS_1 ((uint16_t)0x0040) /*!< Bit 1 */
+#define PWR_CR_PLS_2 ((uint16_t)0x0080) /*!< Bit 2 */
+
+/*!< PVD level configuration */
+#define PWR_CR_PLS_2V2 ((uint16_t)0x0000) /*!< PVD level 2.2V */
+#define PWR_CR_PLS_2V3 ((uint16_t)0x0020) /*!< PVD level 2.3V */
+#define PWR_CR_PLS_2V4 ((uint16_t)0x0040) /*!< PVD level 2.4V */
+#define PWR_CR_PLS_2V5 ((uint16_t)0x0060) /*!< PVD level 2.5V */
+#define PWR_CR_PLS_2V6 ((uint16_t)0x0080) /*!< PVD level 2.6V */
+#define PWR_CR_PLS_2V7 ((uint16_t)0x00A0) /*!< PVD level 2.7V */
+#define PWR_CR_PLS_2V8 ((uint16_t)0x00C0) /*!< PVD level 2.8V */
+#define PWR_CR_PLS_2V9 ((uint16_t)0x00E0) /*!< PVD level 2.9V */
+
+#define PWR_CR_DBP ((uint16_t)0x0100) /*!< Disable Backup Domain write protection */
+
+
+/******************* Bit definition for PWR_CSR register ********************/
+#define PWR_CSR_WUF ((uint16_t)0x0001) /*!< Wakeup Flag */
+#define PWR_CSR_SBF ((uint16_t)0x0002) /*!< Standby Flag */
+#define PWR_CSR_PVDO ((uint16_t)0x0004) /*!< PVD Output */
+#define PWR_CSR_EWUP ((uint16_t)0x0100) /*!< Enable WKUP pin */
+
+/******************************************************************************/
+/* */
+/* Backup registers */
+/* */
+/******************************************************************************/
+
+/******************* Bit definition for BKP_DR1 register ********************/
+#define BKP_DR1_D ((uint16_t)0xFFFF) /*!< Backup data */
+
+/******************* Bit definition for BKP_DR2 register ********************/
+#define BKP_DR2_D ((uint16_t)0xFFFF) /*!< Backup data */
+
+/******************* Bit definition for BKP_DR3 register ********************/
+#define BKP_DR3_D ((uint16_t)0xFFFF) /*!< Backup data */
+
+/******************* Bit definition for BKP_DR4 register ********************/
+#define BKP_DR4_D ((uint16_t)0xFFFF) /*!< Backup data */
+
+/******************* Bit definition for BKP_DR5 register ********************/
+#define BKP_DR5_D ((uint16_t)0xFFFF) /*!< Backup data */
+
+/******************* Bit definition for BKP_DR6 register ********************/
+#define BKP_DR6_D ((uint16_t)0xFFFF) /*!< Backup data */
+
+/******************* Bit definition for BKP_DR7 register ********************/
+#define BKP_DR7_D ((uint16_t)0xFFFF) /*!< Backup data */
+
+/******************* Bit definition for BKP_DR8 register ********************/
+#define BKP_DR8_D ((uint16_t)0xFFFF) /*!< Backup data */
+
+/******************* Bit definition for BKP_DR9 register ********************/
+#define BKP_DR9_D ((uint16_t)0xFFFF) /*!< Backup data */
+
+/******************* Bit definition for BKP_DR10 register *******************/
+#define BKP_DR10_D ((uint16_t)0xFFFF) /*!< Backup data */
+
+/******************* Bit definition for BKP_DR11 register *******************/
+#define BKP_DR11_D ((uint16_t)0xFFFF) /*!< Backup data */
+
+/******************* Bit definition for BKP_DR12 register *******************/
+#define BKP_DR12_D ((uint16_t)0xFFFF) /*!< Backup data */
+
+/******************* Bit definition for BKP_DR13 register *******************/
+#define BKP_DR13_D ((uint16_t)0xFFFF) /*!< Backup data */
+
+/******************* Bit definition for BKP_DR14 register *******************/
+#define BKP_DR14_D ((uint16_t)0xFFFF) /*!< Backup data */
+
+/******************* Bit definition for BKP_DR15 register *******************/
+#define BKP_DR15_D ((uint16_t)0xFFFF) /*!< Backup data */
+
+/******************* Bit definition for BKP_DR16 register *******************/
+#define BKP_DR16_D ((uint16_t)0xFFFF) /*!< Backup data */
+
+/******************* Bit definition for BKP_DR17 register *******************/
+#define BKP_DR17_D ((uint16_t)0xFFFF) /*!< Backup data */
+
+/****************** Bit definition for BKP_DR18 register ********************/
+#define BKP_DR18_D ((uint16_t)0xFFFF) /*!< Backup data */
+
+/******************* Bit definition for BKP_DR19 register *******************/
+#define BKP_DR19_D ((uint16_t)0xFFFF) /*!< Backup data */
+
+/******************* Bit definition for BKP_DR20 register *******************/
+#define BKP_DR20_D ((uint16_t)0xFFFF) /*!< Backup data */
+
+/******************* Bit definition for BKP_DR21 register *******************/
+#define BKP_DR21_D ((uint16_t)0xFFFF) /*!< Backup data */
+
+/******************* Bit definition for BKP_DR22 register *******************/
+#define BKP_DR22_D ((uint16_t)0xFFFF) /*!< Backup data */
+
+/******************* Bit definition for BKP_DR23 register *******************/
+#define BKP_DR23_D ((uint16_t)0xFFFF) /*!< Backup data */
+
+/******************* Bit definition for BKP_DR24 register *******************/
+#define BKP_DR24_D ((uint16_t)0xFFFF) /*!< Backup data */
+
+/******************* Bit definition for BKP_DR25 register *******************/
+#define BKP_DR25_D ((uint16_t)0xFFFF) /*!< Backup data */
+
+/******************* Bit definition for BKP_DR26 register *******************/
+#define BKP_DR26_D ((uint16_t)0xFFFF) /*!< Backup data */
+
+/******************* Bit definition for BKP_DR27 register *******************/
+#define BKP_DR27_D ((uint16_t)0xFFFF) /*!< Backup data */
+
+/******************* Bit definition for BKP_DR28 register *******************/
+#define BKP_DR28_D ((uint16_t)0xFFFF) /*!< Backup data */
+
+/******************* Bit definition for BKP_DR29 register *******************/
+#define BKP_DR29_D ((uint16_t)0xFFFF) /*!< Backup data */
+
+/******************* Bit definition for BKP_DR30 register *******************/
+#define BKP_DR30_D ((uint16_t)0xFFFF) /*!< Backup data */
+
+/******************* Bit definition for BKP_DR31 register *******************/
+#define BKP_DR31_D ((uint16_t)0xFFFF) /*!< Backup data */
+
+/******************* Bit definition for BKP_DR32 register *******************/
+#define BKP_DR32_D ((uint16_t)0xFFFF) /*!< Backup data */
+
+/******************* Bit definition for BKP_DR33 register *******************/
+#define BKP_DR33_D ((uint16_t)0xFFFF) /*!< Backup data */
+
+/******************* Bit definition for BKP_DR34 register *******************/
+#define BKP_DR34_D ((uint16_t)0xFFFF) /*!< Backup data */
+
+/******************* Bit definition for BKP_DR35 register *******************/
+#define BKP_DR35_D ((uint16_t)0xFFFF) /*!< Backup data */
+
+/******************* Bit definition for BKP_DR36 register *******************/
+#define BKP_DR36_D ((uint16_t)0xFFFF) /*!< Backup data */
+
+/******************* Bit definition for BKP_DR37 register *******************/
+#define BKP_DR37_D ((uint16_t)0xFFFF) /*!< Backup data */
+
+/******************* Bit definition for BKP_DR38 register *******************/
+#define BKP_DR38_D ((uint16_t)0xFFFF) /*!< Backup data */
+
+/******************* Bit definition for BKP_DR39 register *******************/
+#define BKP_DR39_D ((uint16_t)0xFFFF) /*!< Backup data */
+
+/******************* Bit definition for BKP_DR40 register *******************/
+#define BKP_DR40_D ((uint16_t)0xFFFF) /*!< Backup data */
+
+/******************* Bit definition for BKP_DR41 register *******************/
+#define BKP_DR41_D ((uint16_t)0xFFFF) /*!< Backup data */
+
+/******************* Bit definition for BKP_DR42 register *******************/
+#define BKP_DR42_D ((uint16_t)0xFFFF) /*!< Backup data */
+
+/****************** Bit definition for BKP_RTCCR register *******************/
+#define BKP_RTCCR_CAL ((uint16_t)0x007F) /*!< Calibration value */
+#define BKP_RTCCR_CCO ((uint16_t)0x0080) /*!< Calibration Clock Output */
+#define BKP_RTCCR_ASOE ((uint16_t)0x0100) /*!< Alarm or Second Output Enable */
+#define BKP_RTCCR_ASOS ((uint16_t)0x0200) /*!< Alarm or Second Output Selection */
+
+/******************** Bit definition for BKP_CR register ********************/
+#define BKP_CR_TPE ((uint8_t)0x01) /*!< TAMPER pin enable */
+#define BKP_CR_TPAL ((uint8_t)0x02) /*!< TAMPER pin active level */
+
+/******************* Bit definition for BKP_CSR register ********************/
+#define BKP_CSR_CTE ((uint16_t)0x0001) /*!< Clear Tamper event */
+#define BKP_CSR_CTI ((uint16_t)0x0002) /*!< Clear Tamper Interrupt */
+#define BKP_CSR_TPIE ((uint16_t)0x0004) /*!< TAMPER Pin interrupt enable */
+#define BKP_CSR_TEF ((uint16_t)0x0100) /*!< Tamper Event Flag */
+#define BKP_CSR_TIF ((uint16_t)0x0200) /*!< Tamper Interrupt Flag */
+
+/******************************************************************************/
+/* */
+/* Reset and Clock Control */
+/* */
+/******************************************************************************/
+
+/******************** Bit definition for RCC_CR register ********************/
+#define RCC_CR_HSION ((uint32_t)0x00000001) /*!< Internal High Speed clock enable */
+#define RCC_CR_HSIRDY ((uint32_t)0x00000002) /*!< Internal High Speed clock ready flag */
+#define RCC_CR_HSITRIM ((uint32_t)0x000000F8) /*!< Internal High Speed clock trimming */
+#define RCC_CR_HSICAL ((uint32_t)0x0000FF00) /*!< Internal High Speed clock Calibration */
+#define RCC_CR_HSEON ((uint32_t)0x00010000) /*!< External High Speed clock enable */
+#define RCC_CR_HSERDY ((uint32_t)0x00020000) /*!< External High Speed clock ready flag */
+#define RCC_CR_HSEBYP ((uint32_t)0x00040000) /*!< External High Speed clock Bypass */
+#define RCC_CR_CSSON ((uint32_t)0x00080000) /*!< Clock Security System enable */
+#define RCC_CR_PLLON ((uint32_t)0x01000000) /*!< PLL enable */
+#define RCC_CR_PLLRDY ((uint32_t)0x02000000) /*!< PLL clock ready flag */
+
+#ifdef STM32F10X_CL
+ #define RCC_CR_PLL2ON ((uint32_t)0x04000000) /*!< PLL2 enable */
+ #define RCC_CR_PLL2RDY ((uint32_t)0x08000000) /*!< PLL2 clock ready flag */
+ #define RCC_CR_PLL3ON ((uint32_t)0x10000000) /*!< PLL3 enable */
+ #define RCC_CR_PLL3RDY ((uint32_t)0x20000000) /*!< PLL3 clock ready flag */
+#endif /* STM32F10X_CL */
+
+/******************* Bit definition for RCC_CFGR register *******************/
+/*!< SW configuration */
+#define RCC_CFGR_SW ((uint32_t)0x00000003) /*!< SW[1:0] bits (System clock Switch) */
+#define RCC_CFGR_SW_0 ((uint32_t)0x00000001) /*!< Bit 0 */
+#define RCC_CFGR_SW_1 ((uint32_t)0x00000002) /*!< Bit 1 */
+
+#define RCC_CFGR_SW_HSI ((uint32_t)0x00000000) /*!< HSI selected as system clock */
+#define RCC_CFGR_SW_HSE ((uint32_t)0x00000001) /*!< HSE selected as system clock */
+#define RCC_CFGR_SW_PLL ((uint32_t)0x00000002) /*!< PLL selected as system clock */
+
+/*!< SWS configuration */
+#define RCC_CFGR_SWS ((uint32_t)0x0000000C) /*!< SWS[1:0] bits (System Clock Switch Status) */
+#define RCC_CFGR_SWS_0 ((uint32_t)0x00000004) /*!< Bit 0 */
+#define RCC_CFGR_SWS_1 ((uint32_t)0x00000008) /*!< Bit 1 */
+
+#define RCC_CFGR_SWS_HSI ((uint32_t)0x00000000) /*!< HSI oscillator used as system clock */
+#define RCC_CFGR_SWS_HSE ((uint32_t)0x00000004) /*!< HSE oscillator used as system clock */
+#define RCC_CFGR_SWS_PLL ((uint32_t)0x00000008) /*!< PLL used as system clock */
+
+/*!< HPRE configuration */
+#define RCC_CFGR_HPRE ((uint32_t)0x000000F0) /*!< HPRE[3:0] bits (AHB prescaler) */
+#define RCC_CFGR_HPRE_0 ((uint32_t)0x00000010) /*!< Bit 0 */
+#define RCC_CFGR_HPRE_1 ((uint32_t)0x00000020) /*!< Bit 1 */
+#define RCC_CFGR_HPRE_2 ((uint32_t)0x00000040) /*!< Bit 2 */
+#define RCC_CFGR_HPRE_3 ((uint32_t)0x00000080) /*!< Bit 3 */
+
+#define RCC_CFGR_HPRE_DIV1 ((uint32_t)0x00000000) /*!< SYSCLK not divided */
+#define RCC_CFGR_HPRE_DIV2 ((uint32_t)0x00000080) /*!< SYSCLK divided by 2 */
+#define RCC_CFGR_HPRE_DIV4 ((uint32_t)0x00000090) /*!< SYSCLK divided by 4 */
+#define RCC_CFGR_HPRE_DIV8 ((uint32_t)0x000000A0) /*!< SYSCLK divided by 8 */
+#define RCC_CFGR_HPRE_DIV16 ((uint32_t)0x000000B0) /*!< SYSCLK divided by 16 */
+#define RCC_CFGR_HPRE_DIV64 ((uint32_t)0x000000C0) /*!< SYSCLK divided by 64 */
+#define RCC_CFGR_HPRE_DIV128 ((uint32_t)0x000000D0) /*!< SYSCLK divided by 128 */
+#define RCC_CFGR_HPRE_DIV256 ((uint32_t)0x000000E0) /*!< SYSCLK divided by 256 */
+#define RCC_CFGR_HPRE_DIV512 ((uint32_t)0x000000F0) /*!< SYSCLK divided by 512 */
+
+/*!< PPRE1 configuration */
+#define RCC_CFGR_PPRE1 ((uint32_t)0x00000700) /*!< PRE1[2:0] bits (APB1 prescaler) */
+#define RCC_CFGR_PPRE1_0 ((uint32_t)0x00000100) /*!< Bit 0 */
+#define RCC_CFGR_PPRE1_1 ((uint32_t)0x00000200) /*!< Bit 1 */
+#define RCC_CFGR_PPRE1_2 ((uint32_t)0x00000400) /*!< Bit 2 */
+
+#define RCC_CFGR_PPRE1_DIV1 ((uint32_t)0x00000000) /*!< HCLK not divided */
+#define RCC_CFGR_PPRE1_DIV2 ((uint32_t)0x00000400) /*!< HCLK divided by 2 */
+#define RCC_CFGR_PPRE1_DIV4 ((uint32_t)0x00000500) /*!< HCLK divided by 4 */
+#define RCC_CFGR_PPRE1_DIV8 ((uint32_t)0x00000600) /*!< HCLK divided by 8 */
+#define RCC_CFGR_PPRE1_DIV16 ((uint32_t)0x00000700) /*!< HCLK divided by 16 */
+
+/*!< PPRE2 configuration */
+#define RCC_CFGR_PPRE2 ((uint32_t)0x00003800) /*!< PRE2[2:0] bits (APB2 prescaler) */
+#define RCC_CFGR_PPRE2_0 ((uint32_t)0x00000800) /*!< Bit 0 */
+#define RCC_CFGR_PPRE2_1 ((uint32_t)0x00001000) /*!< Bit 1 */
+#define RCC_CFGR_PPRE2_2 ((uint32_t)0x00002000) /*!< Bit 2 */
+
+#define RCC_CFGR_PPRE2_DIV1 ((uint32_t)0x00000000) /*!< HCLK not divided */
+#define RCC_CFGR_PPRE2_DIV2 ((uint32_t)0x00002000) /*!< HCLK divided by 2 */
+#define RCC_CFGR_PPRE2_DIV4 ((uint32_t)0x00002800) /*!< HCLK divided by 4 */
+#define RCC_CFGR_PPRE2_DIV8 ((uint32_t)0x00003000) /*!< HCLK divided by 8 */
+#define RCC_CFGR_PPRE2_DIV16 ((uint32_t)0x00003800) /*!< HCLK divided by 16 */
+
+/*!< ADCPPRE configuration */
+#define RCC_CFGR_ADCPRE ((uint32_t)0x0000C000) /*!< ADCPRE[1:0] bits (ADC prescaler) */
+#define RCC_CFGR_ADCPRE_0 ((uint32_t)0x00004000) /*!< Bit 0 */
+#define RCC_CFGR_ADCPRE_1 ((uint32_t)0x00008000) /*!< Bit 1 */
+
+#define RCC_CFGR_ADCPRE_DIV2 ((uint32_t)0x00000000) /*!< PCLK2 divided by 2 */
+#define RCC_CFGR_ADCPRE_DIV4 ((uint32_t)0x00004000) /*!< PCLK2 divided by 4 */
+#define RCC_CFGR_ADCPRE_DIV6 ((uint32_t)0x00008000) /*!< PCLK2 divided by 6 */
+#define RCC_CFGR_ADCPRE_DIV8 ((uint32_t)0x0000C000) /*!< PCLK2 divided by 8 */
+
+#define RCC_CFGR_PLLSRC ((uint32_t)0x00010000) /*!< PLL entry clock source */
+
+#define RCC_CFGR_PLLXTPRE ((uint32_t)0x00020000) /*!< HSE divider for PLL entry */
+
+/*!< PLLMUL configuration */
+#define RCC_CFGR_PLLMULL ((uint32_t)0x003C0000) /*!< PLLMUL[3:0] bits (PLL multiplication factor) */
+#define RCC_CFGR_PLLMULL_0 ((uint32_t)0x00040000) /*!< Bit 0 */
+#define RCC_CFGR_PLLMULL_1 ((uint32_t)0x00080000) /*!< Bit 1 */
+#define RCC_CFGR_PLLMULL_2 ((uint32_t)0x00100000) /*!< Bit 2 */
+#define RCC_CFGR_PLLMULL_3 ((uint32_t)0x00200000) /*!< Bit 3 */
+
+#ifdef STM32F10X_CL
+ #define RCC_CFGR_PLLSRC_HSI_Div2 ((uint32_t)0x00000000) /*!< HSI clock divided by 2 selected as PLL entry clock source */
+ #define RCC_CFGR_PLLSRC_PREDIV1 ((uint32_t)0x00010000) /*!< PREDIV1 clock selected as PLL entry clock source */
+
+ #define RCC_CFGR_PLLXTPRE_PREDIV1 ((uint32_t)0x00000000) /*!< PREDIV1 clock not divided for PLL entry */
+ #define RCC_CFGR_PLLXTPRE_PREDIV1_Div2 ((uint32_t)0x00020000) /*!< PREDIV1 clock divided by 2 for PLL entry */
+
+ #define RCC_CFGR_PLLMULL4 ((uint32_t)0x00080000) /*!< PLL input clock * 4 */
+ #define RCC_CFGR_PLLMULL5 ((uint32_t)0x000C0000) /*!< PLL input clock * 5 */
+ #define RCC_CFGR_PLLMULL6 ((uint32_t)0x00100000) /*!< PLL input clock * 6 */
+ #define RCC_CFGR_PLLMULL7 ((uint32_t)0x00140000) /*!< PLL input clock * 7 */
+ #define RCC_CFGR_PLLMULL8 ((uint32_t)0x00180000) /*!< PLL input clock * 8 */
+ #define RCC_CFGR_PLLMULL9 ((uint32_t)0x001C0000) /*!< PLL input clock * 9 */
+ #define RCC_CFGR_PLLMULL6_5 ((uint32_t)0x00340000) /*!< PLL input clock * 6.5 */
+
+ #define RCC_CFGR_OTGFSPRE ((uint32_t)0x00400000) /*!< USB OTG FS prescaler */
+
+/*!< MCO configuration */
+ #define RCC_CFGR_MCO ((uint32_t)0x0F000000) /*!< MCO[3:0] bits (Microcontroller Clock Output) */
+ #define RCC_CFGR_MCO_0 ((uint32_t)0x01000000) /*!< Bit 0 */
+ #define RCC_CFGR_MCO_1 ((uint32_t)0x02000000) /*!< Bit 1 */
+ #define RCC_CFGR_MCO_2 ((uint32_t)0x04000000) /*!< Bit 2 */
+ #define RCC_CFGR_MCO_3 ((uint32_t)0x08000000) /*!< Bit 3 */
+
+ #define RCC_CFGR_MCO_NOCLOCK ((uint32_t)0x00000000) /*!< No clock */
+ #define RCC_CFGR_MCO_SYSCLK ((uint32_t)0x04000000) /*!< System clock selected as MCO source */
+ #define RCC_CFGR_MCO_HSI ((uint32_t)0x05000000) /*!< HSI clock selected as MCO source */
+ #define RCC_CFGR_MCO_HSE ((uint32_t)0x06000000) /*!< HSE clock selected as MCO source */
+ #define RCC_CFGR_MCO_PLLCLK_Div2 ((uint32_t)0x07000000) /*!< PLL clock divided by 2 selected as MCO source */
+ #define RCC_CFGR_MCO_PLL2CLK ((uint32_t)0x08000000) /*!< PLL2 clock selected as MCO source*/
+ #define RCC_CFGR_MCO_PLL3CLK_Div2 ((uint32_t)0x09000000) /*!< PLL3 clock divided by 2 selected as MCO source*/
+ #define RCC_CFGR_MCO_Ext_HSE ((uint32_t)0x0A000000) /*!< XT1 external 3-25 MHz oscillator clock selected as MCO source */
+ #define RCC_CFGR_MCO_PLL3CLK ((uint32_t)0x0B000000) /*!< PLL3 clock selected as MCO source */
+#elif defined (STM32F10X_LD_VL) || defined (STM32F10X_MD_VL) || defined (STM32F10X_HD_VL)
+ #define RCC_CFGR_PLLSRC_HSI_Div2 ((uint32_t)0x00000000) /*!< HSI clock divided by 2 selected as PLL entry clock source */
+ #define RCC_CFGR_PLLSRC_PREDIV1 ((uint32_t)0x00010000) /*!< PREDIV1 clock selected as PLL entry clock source */
+
+ #define RCC_CFGR_PLLXTPRE_PREDIV1 ((uint32_t)0x00000000) /*!< PREDIV1 clock not divided for PLL entry */
+ #define RCC_CFGR_PLLXTPRE_PREDIV1_Div2 ((uint32_t)0x00020000) /*!< PREDIV1 clock divided by 2 for PLL entry */
+
+ #define RCC_CFGR_PLLMULL2 ((uint32_t)0x00000000) /*!< PLL input clock*2 */
+ #define RCC_CFGR_PLLMULL3 ((uint32_t)0x00040000) /*!< PLL input clock*3 */
+ #define RCC_CFGR_PLLMULL4 ((uint32_t)0x00080000) /*!< PLL input clock*4 */
+ #define RCC_CFGR_PLLMULL5 ((uint32_t)0x000C0000) /*!< PLL input clock*5 */
+ #define RCC_CFGR_PLLMULL6 ((uint32_t)0x00100000) /*!< PLL input clock*6 */
+ #define RCC_CFGR_PLLMULL7 ((uint32_t)0x00140000) /*!< PLL input clock*7 */
+ #define RCC_CFGR_PLLMULL8 ((uint32_t)0x00180000) /*!< PLL input clock*8 */
+ #define RCC_CFGR_PLLMULL9 ((uint32_t)0x001C0000) /*!< PLL input clock*9 */
+ #define RCC_CFGR_PLLMULL10 ((uint32_t)0x00200000) /*!< PLL input clock10 */
+ #define RCC_CFGR_PLLMULL11 ((uint32_t)0x00240000) /*!< PLL input clock*11 */
+ #define RCC_CFGR_PLLMULL12 ((uint32_t)0x00280000) /*!< PLL input clock*12 */
+ #define RCC_CFGR_PLLMULL13 ((uint32_t)0x002C0000) /*!< PLL input clock*13 */
+ #define RCC_CFGR_PLLMULL14 ((uint32_t)0x00300000) /*!< PLL input clock*14 */
+ #define RCC_CFGR_PLLMULL15 ((uint32_t)0x00340000) /*!< PLL input clock*15 */
+ #define RCC_CFGR_PLLMULL16 ((uint32_t)0x00380000) /*!< PLL input clock*16 */
+
+/*!< MCO configuration */
+ #define RCC_CFGR_MCO ((uint32_t)0x07000000) /*!< MCO[2:0] bits (Microcontroller Clock Output) */
+ #define RCC_CFGR_MCO_0 ((uint32_t)0x01000000) /*!< Bit 0 */
+ #define RCC_CFGR_MCO_1 ((uint32_t)0x02000000) /*!< Bit 1 */
+ #define RCC_CFGR_MCO_2 ((uint32_t)0x04000000) /*!< Bit 2 */
+
+ #define RCC_CFGR_MCO_NOCLOCK ((uint32_t)0x00000000) /*!< No clock */
+ #define RCC_CFGR_MCO_SYSCLK ((uint32_t)0x04000000) /*!< System clock selected as MCO source */
+ #define RCC_CFGR_MCO_HSI ((uint32_t)0x05000000) /*!< HSI clock selected as MCO source */
+ #define RCC_CFGR_MCO_HSE ((uint32_t)0x06000000) /*!< HSE clock selected as MCO source */
+ #define RCC_CFGR_MCO_PLL ((uint32_t)0x07000000) /*!< PLL clock divided by 2 selected as MCO source */
+#else
+ #define RCC_CFGR_PLLSRC_HSI_Div2 ((uint32_t)0x00000000) /*!< HSI clock divided by 2 selected as PLL entry clock source */
+ #define RCC_CFGR_PLLSRC_HSE ((uint32_t)0x00010000) /*!< HSE clock selected as PLL entry clock source */
+
+ #define RCC_CFGR_PLLXTPRE_HSE ((uint32_t)0x00000000) /*!< HSE clock not divided for PLL entry */
+ #define RCC_CFGR_PLLXTPRE_HSE_Div2 ((uint32_t)0x00020000) /*!< HSE clock divided by 2 for PLL entry */
+
+ #define RCC_CFGR_PLLMULL2 ((uint32_t)0x00000000) /*!< PLL input clock*2 */
+ #define RCC_CFGR_PLLMULL3 ((uint32_t)0x00040000) /*!< PLL input clock*3 */
+ #define RCC_CFGR_PLLMULL4 ((uint32_t)0x00080000) /*!< PLL input clock*4 */
+ #define RCC_CFGR_PLLMULL5 ((uint32_t)0x000C0000) /*!< PLL input clock*5 */
+ #define RCC_CFGR_PLLMULL6 ((uint32_t)0x00100000) /*!< PLL input clock*6 */
+ #define RCC_CFGR_PLLMULL7 ((uint32_t)0x00140000) /*!< PLL input clock*7 */
+ #define RCC_CFGR_PLLMULL8 ((uint32_t)0x00180000) /*!< PLL input clock*8 */
+ #define RCC_CFGR_PLLMULL9 ((uint32_t)0x001C0000) /*!< PLL input clock*9 */
+ #define RCC_CFGR_PLLMULL10 ((uint32_t)0x00200000) /*!< PLL input clock10 */
+ #define RCC_CFGR_PLLMULL11 ((uint32_t)0x00240000) /*!< PLL input clock*11 */
+ #define RCC_CFGR_PLLMULL12 ((uint32_t)0x00280000) /*!< PLL input clock*12 */
+ #define RCC_CFGR_PLLMULL13 ((uint32_t)0x002C0000) /*!< PLL input clock*13 */
+ #define RCC_CFGR_PLLMULL14 ((uint32_t)0x00300000) /*!< PLL input clock*14 */
+ #define RCC_CFGR_PLLMULL15 ((uint32_t)0x00340000) /*!< PLL input clock*15 */
+ #define RCC_CFGR_PLLMULL16 ((uint32_t)0x00380000) /*!< PLL input clock*16 */
+ #define RCC_CFGR_USBPRE ((uint32_t)0x00400000) /*!< USB Device prescaler */
+
+/*!< MCO configuration */
+ #define RCC_CFGR_MCO ((uint32_t)0x07000000) /*!< MCO[2:0] bits (Microcontroller Clock Output) */
+ #define RCC_CFGR_MCO_0 ((uint32_t)0x01000000) /*!< Bit 0 */
+ #define RCC_CFGR_MCO_1 ((uint32_t)0x02000000) /*!< Bit 1 */
+ #define RCC_CFGR_MCO_2 ((uint32_t)0x04000000) /*!< Bit 2 */
+
+ #define RCC_CFGR_MCO_NOCLOCK ((uint32_t)0x00000000) /*!< No clock */
+ #define RCC_CFGR_MCO_SYSCLK ((uint32_t)0x04000000) /*!< System clock selected as MCO source */
+ #define RCC_CFGR_MCO_HSI ((uint32_t)0x05000000) /*!< HSI clock selected as MCO source */
+ #define RCC_CFGR_MCO_HSE ((uint32_t)0x06000000) /*!< HSE clock selected as MCO source */
+ #define RCC_CFGR_MCO_PLL ((uint32_t)0x07000000) /*!< PLL clock divided by 2 selected as MCO source */
+#endif /* STM32F10X_CL */
+
+/*!<****************** Bit definition for RCC_CIR register ********************/
+#define RCC_CIR_LSIRDYF ((uint32_t)0x00000001) /*!< LSI Ready Interrupt flag */
+#define RCC_CIR_LSERDYF ((uint32_t)0x00000002) /*!< LSE Ready Interrupt flag */
+#define RCC_CIR_HSIRDYF ((uint32_t)0x00000004) /*!< HSI Ready Interrupt flag */
+#define RCC_CIR_HSERDYF ((uint32_t)0x00000008) /*!< HSE Ready Interrupt flag */
+#define RCC_CIR_PLLRDYF ((uint32_t)0x00000010) /*!< PLL Ready Interrupt flag */
+#define RCC_CIR_CSSF ((uint32_t)0x00000080) /*!< Clock Security System Interrupt flag */
+#define RCC_CIR_LSIRDYIE ((uint32_t)0x00000100) /*!< LSI Ready Interrupt Enable */
+#define RCC_CIR_LSERDYIE ((uint32_t)0x00000200) /*!< LSE Ready Interrupt Enable */
+#define RCC_CIR_HSIRDYIE ((uint32_t)0x00000400) /*!< HSI Ready Interrupt Enable */
+#define RCC_CIR_HSERDYIE ((uint32_t)0x00000800) /*!< HSE Ready Interrupt Enable */
+#define RCC_CIR_PLLRDYIE ((uint32_t)0x00001000) /*!< PLL Ready Interrupt Enable */
+#define RCC_CIR_LSIRDYC ((uint32_t)0x00010000) /*!< LSI Ready Interrupt Clear */
+#define RCC_CIR_LSERDYC ((uint32_t)0x00020000) /*!< LSE Ready Interrupt Clear */
+#define RCC_CIR_HSIRDYC ((uint32_t)0x00040000) /*!< HSI Ready Interrupt Clear */
+#define RCC_CIR_HSERDYC ((uint32_t)0x00080000) /*!< HSE Ready Interrupt Clear */
+#define RCC_CIR_PLLRDYC ((uint32_t)0x00100000) /*!< PLL Ready Interrupt Clear */
+#define RCC_CIR_CSSC ((uint32_t)0x00800000) /*!< Clock Security System Interrupt Clear */
+
+#ifdef STM32F10X_CL
+ #define RCC_CIR_PLL2RDYF ((uint32_t)0x00000020) /*!< PLL2 Ready Interrupt flag */
+ #define RCC_CIR_PLL3RDYF ((uint32_t)0x00000040) /*!< PLL3 Ready Interrupt flag */
+ #define RCC_CIR_PLL2RDYIE ((uint32_t)0x00002000) /*!< PLL2 Ready Interrupt Enable */
+ #define RCC_CIR_PLL3RDYIE ((uint32_t)0x00004000) /*!< PLL3 Ready Interrupt Enable */
+ #define RCC_CIR_PLL2RDYC ((uint32_t)0x00200000) /*!< PLL2 Ready Interrupt Clear */
+ #define RCC_CIR_PLL3RDYC ((uint32_t)0x00400000) /*!< PLL3 Ready Interrupt Clear */
+#endif /* STM32F10X_CL */
+
+/***************** Bit definition for RCC_APB2RSTR register *****************/
+#define RCC_APB2RSTR_AFIORST ((uint32_t)0x00000001) /*!< Alternate Function I/O reset */
+#define RCC_APB2RSTR_IOPARST ((uint32_t)0x00000004) /*!< I/O port A reset */
+#define RCC_APB2RSTR_IOPBRST ((uint32_t)0x00000008) /*!< I/O port B reset */
+#define RCC_APB2RSTR_IOPCRST ((uint32_t)0x00000010) /*!< I/O port C reset */
+#define RCC_APB2RSTR_IOPDRST ((uint32_t)0x00000020) /*!< I/O port D reset */
+#define RCC_APB2RSTR_ADC1RST ((uint32_t)0x00000200) /*!< ADC 1 interface reset */
+
+#if !defined (STM32F10X_LD_VL) && !defined (STM32F10X_MD_VL) && !defined (STM32F10X_HD_VL)
+#define RCC_APB2RSTR_ADC2RST ((uint32_t)0x00000400) /*!< ADC 2 interface reset */
+#endif
+
+#define RCC_APB2RSTR_TIM1RST ((uint32_t)0x00000800) /*!< TIM1 Timer reset */
+#define RCC_APB2RSTR_SPI1RST ((uint32_t)0x00001000) /*!< SPI 1 reset */
+#define RCC_APB2RSTR_USART1RST ((uint32_t)0x00004000) /*!< USART1 reset */
+
+#if defined (STM32F10X_LD_VL) || defined (STM32F10X_MD_VL) || defined (STM32F10X_HD_VL)
+#define RCC_APB2RSTR_TIM15RST ((uint32_t)0x00010000) /*!< TIM15 Timer reset */
+#define RCC_APB2RSTR_TIM16RST ((uint32_t)0x00020000) /*!< TIM16 Timer reset */
+#define RCC_APB2RSTR_TIM17RST ((uint32_t)0x00040000) /*!< TIM17 Timer reset */
+#endif
+
+#if !defined (STM32F10X_LD) && !defined (STM32F10X_LD_VL)
+ #define RCC_APB2RSTR_IOPERST ((uint32_t)0x00000040) /*!< I/O port E reset */
+#endif /* STM32F10X_LD && STM32F10X_LD_VL */
+
+#if defined (STM32F10X_HD) || defined (STM32F10X_XL)
+ #define RCC_APB2RSTR_IOPFRST ((uint32_t)0x00000080) /*!< I/O port F reset */
+ #define RCC_APB2RSTR_IOPGRST ((uint32_t)0x00000100) /*!< I/O port G reset */
+ #define RCC_APB2RSTR_TIM8RST ((uint32_t)0x00002000) /*!< TIM8 Timer reset */
+ #define RCC_APB2RSTR_ADC3RST ((uint32_t)0x00008000) /*!< ADC3 interface reset */
+#endif
+
+#if defined (STM32F10X_HD_VL)
+ #define RCC_APB2RSTR_IOPFRST ((uint32_t)0x00000080) /*!< I/O port F reset */
+ #define RCC_APB2RSTR_IOPGRST ((uint32_t)0x00000100) /*!< I/O port G reset */
+#endif
+
+#ifdef STM32F10X_XL
+ #define RCC_APB2RSTR_TIM9RST ((uint32_t)0x00080000) /*!< TIM9 Timer reset */
+ #define RCC_APB2RSTR_TIM10RST ((uint32_t)0x00100000) /*!< TIM10 Timer reset */
+ #define RCC_APB2RSTR_TIM11RST ((uint32_t)0x00200000) /*!< TIM11 Timer reset */
+#endif /* STM32F10X_XL */
+
+/***************** Bit definition for RCC_APB1RSTR register *****************/
+#define RCC_APB1RSTR_TIM2RST ((uint32_t)0x00000001) /*!< Timer 2 reset */
+#define RCC_APB1RSTR_TIM3RST ((uint32_t)0x00000002) /*!< Timer 3 reset */
+#define RCC_APB1RSTR_WWDGRST ((uint32_t)0x00000800) /*!< Window Watchdog reset */
+#define RCC_APB1RSTR_USART2RST ((uint32_t)0x00020000) /*!< USART 2 reset */
+#define RCC_APB1RSTR_I2C1RST ((uint32_t)0x00200000) /*!< I2C 1 reset */
+
+#if !defined (STM32F10X_LD_VL) && !defined (STM32F10X_MD_VL) && !defined (STM32F10X_HD_VL)
+#define RCC_APB1RSTR_CAN1RST ((uint32_t)0x02000000) /*!< CAN1 reset */
+#endif
+
+#define RCC_APB1RSTR_BKPRST ((uint32_t)0x08000000) /*!< Backup interface reset */
+#define RCC_APB1RSTR_PWRRST ((uint32_t)0x10000000) /*!< Power interface reset */
+
+#if !defined (STM32F10X_LD) && !defined (STM32F10X_LD_VL)
+ #define RCC_APB1RSTR_TIM4RST ((uint32_t)0x00000004) /*!< Timer 4 reset */
+ #define RCC_APB1RSTR_SPI2RST ((uint32_t)0x00004000) /*!< SPI 2 reset */
+ #define RCC_APB1RSTR_USART3RST ((uint32_t)0x00040000) /*!< USART 3 reset */
+ #define RCC_APB1RSTR_I2C2RST ((uint32_t)0x00400000) /*!< I2C 2 reset */
+#endif /* STM32F10X_LD && STM32F10X_LD_VL */
+
+#if defined (STM32F10X_HD) || defined (STM32F10X_MD) || defined (STM32F10X_LD) || defined (STM32F10X_XL)
+ #define RCC_APB1RSTR_USBRST ((uint32_t)0x00800000) /*!< USB Device reset */
+#endif
+
+#if defined (STM32F10X_HD) || defined (STM32F10X_CL) || defined (STM32F10X_XL)
+ #define RCC_APB1RSTR_TIM5RST ((uint32_t)0x00000008) /*!< Timer 5 reset */
+ #define RCC_APB1RSTR_TIM6RST ((uint32_t)0x00000010) /*!< Timer 6 reset */
+ #define RCC_APB1RSTR_TIM7RST ((uint32_t)0x00000020) /*!< Timer 7 reset */
+ #define RCC_APB1RSTR_SPI3RST ((uint32_t)0x00008000) /*!< SPI 3 reset */
+ #define RCC_APB1RSTR_UART4RST ((uint32_t)0x00080000) /*!< UART 4 reset */
+ #define RCC_APB1RSTR_UART5RST ((uint32_t)0x00100000) /*!< UART 5 reset */
+ #define RCC_APB1RSTR_DACRST ((uint32_t)0x20000000) /*!< DAC interface reset */
+#endif
+
+#if defined (STM32F10X_LD_VL) || defined (STM32F10X_MD_VL) || defined (STM32F10X_HD_VL)
+ #define RCC_APB1RSTR_TIM6RST ((uint32_t)0x00000010) /*!< Timer 6 reset */
+ #define RCC_APB1RSTR_TIM7RST ((uint32_t)0x00000020) /*!< Timer 7 reset */
+ #define RCC_APB1RSTR_DACRST ((uint32_t)0x20000000) /*!< DAC interface reset */
+ #define RCC_APB1RSTR_CECRST ((uint32_t)0x40000000) /*!< CEC interface reset */
+#endif
+
+#if defined (STM32F10X_HD_VL)
+ #define RCC_APB1RSTR_TIM5RST ((uint32_t)0x00000008) /*!< Timer 5 reset */
+ #define RCC_APB1RSTR_TIM12RST ((uint32_t)0x00000040) /*!< TIM12 Timer reset */
+ #define RCC_APB1RSTR_TIM13RST ((uint32_t)0x00000080) /*!< TIM13 Timer reset */
+ #define RCC_APB1RSTR_TIM14RST ((uint32_t)0x00000100) /*!< TIM14 Timer reset */
+ #define RCC_APB1RSTR_SPI3RST ((uint32_t)0x00008000) /*!< SPI 3 reset */
+ #define RCC_APB1RSTR_UART4RST ((uint32_t)0x00080000) /*!< UART 4 reset */
+ #define RCC_APB1RSTR_UART5RST ((uint32_t)0x00100000) /*!< UART 5 reset */
+#endif
+
+#ifdef STM32F10X_CL
+ #define RCC_APB1RSTR_CAN2RST ((uint32_t)0x04000000) /*!< CAN2 reset */
+#endif /* STM32F10X_CL */
+
+#ifdef STM32F10X_XL
+ #define RCC_APB1RSTR_TIM12RST ((uint32_t)0x00000040) /*!< TIM12 Timer reset */
+ #define RCC_APB1RSTR_TIM13RST ((uint32_t)0x00000080) /*!< TIM13 Timer reset */
+ #define RCC_APB1RSTR_TIM14RST ((uint32_t)0x00000100) /*!< TIM14 Timer reset */
+#endif /* STM32F10X_XL */
+
+/****************** Bit definition for RCC_AHBENR register ******************/
+#define RCC_AHBENR_DMA1EN ((uint16_t)0x0001) /*!< DMA1 clock enable */
+#define RCC_AHBENR_SRAMEN ((uint16_t)0x0004) /*!< SRAM interface clock enable */
+#define RCC_AHBENR_FLITFEN ((uint16_t)0x0010) /*!< FLITF clock enable */
+#define RCC_AHBENR_CRCEN ((uint16_t)0x0040) /*!< CRC clock enable */
+
+#if defined (STM32F10X_HD) || defined (STM32F10X_CL) || defined (STM32F10X_HD_VL)
+ #define RCC_AHBENR_DMA2EN ((uint16_t)0x0002) /*!< DMA2 clock enable */
+#endif
+
+#if defined (STM32F10X_HD) || defined (STM32F10X_XL)
+ #define RCC_AHBENR_FSMCEN ((uint16_t)0x0100) /*!< FSMC clock enable */
+ #define RCC_AHBENR_SDIOEN ((uint16_t)0x0400) /*!< SDIO clock enable */
+#endif
+
+#if defined (STM32F10X_HD_VL)
+ #define RCC_AHBENR_FSMCEN ((uint16_t)0x0100) /*!< FSMC clock enable */
+#endif
+
+#ifdef STM32F10X_CL
+ #define RCC_AHBENR_OTGFSEN ((uint32_t)0x00001000) /*!< USB OTG FS clock enable */
+ #define RCC_AHBENR_ETHMACEN ((uint32_t)0x00004000) /*!< ETHERNET MAC clock enable */
+ #define RCC_AHBENR_ETHMACTXEN ((uint32_t)0x00008000) /*!< ETHERNET MAC Tx clock enable */
+ #define RCC_AHBENR_ETHMACRXEN ((uint32_t)0x00010000) /*!< ETHERNET MAC Rx clock enable */
+#endif /* STM32F10X_CL */
+
+/****************** Bit definition for RCC_APB2ENR register *****************/
+#define RCC_APB2ENR_AFIOEN ((uint32_t)0x00000001) /*!< Alternate Function I/O clock enable */
+#define RCC_APB2ENR_IOPAEN ((uint32_t)0x00000004) /*!< I/O port A clock enable */
+#define RCC_APB2ENR_IOPBEN ((uint32_t)0x00000008) /*!< I/O port B clock enable */
+#define RCC_APB2ENR_IOPCEN ((uint32_t)0x00000010) /*!< I/O port C clock enable */
+#define RCC_APB2ENR_IOPDEN ((uint32_t)0x00000020) /*!< I/O port D clock enable */
+#define RCC_APB2ENR_ADC1EN ((uint32_t)0x00000200) /*!< ADC 1 interface clock enable */
+
+#if !defined (STM32F10X_LD_VL) && !defined (STM32F10X_MD_VL) && !defined (STM32F10X_HD_VL)
+#define RCC_APB2ENR_ADC2EN ((uint32_t)0x00000400) /*!< ADC 2 interface clock enable */
+#endif
+
+#define RCC_APB2ENR_TIM1EN ((uint32_t)0x00000800) /*!< TIM1 Timer clock enable */
+#define RCC_APB2ENR_SPI1EN ((uint32_t)0x00001000) /*!< SPI 1 clock enable */
+#define RCC_APB2ENR_USART1EN ((uint32_t)0x00004000) /*!< USART1 clock enable */
+
+#if defined (STM32F10X_LD_VL) || defined (STM32F10X_MD_VL) || defined (STM32F10X_HD_VL)
+#define RCC_APB2ENR_TIM15EN ((uint32_t)0x00010000) /*!< TIM15 Timer clock enable */
+#define RCC_APB2ENR_TIM16EN ((uint32_t)0x00020000) /*!< TIM16 Timer clock enable */
+#define RCC_APB2ENR_TIM17EN ((uint32_t)0x00040000) /*!< TIM17 Timer clock enable */
+#endif
+
+#if !defined (STM32F10X_LD) && !defined (STM32F10X_LD_VL)
+ #define RCC_APB2ENR_IOPEEN ((uint32_t)0x00000040) /*!< I/O port E clock enable */
+#endif /* STM32F10X_LD && STM32F10X_LD_VL */
+
+#if defined (STM32F10X_HD) || defined (STM32F10X_XL)
+ #define RCC_APB2ENR_IOPFEN ((uint32_t)0x00000080) /*!< I/O port F clock enable */
+ #define RCC_APB2ENR_IOPGEN ((uint32_t)0x00000100) /*!< I/O port G clock enable */
+ #define RCC_APB2ENR_TIM8EN ((uint32_t)0x00002000) /*!< TIM8 Timer clock enable */
+ #define RCC_APB2ENR_ADC3EN ((uint32_t)0x00008000) /*!< DMA1 clock enable */
+#endif
+
+#if defined (STM32F10X_HD_VL)
+ #define RCC_APB2ENR_IOPFEN ((uint32_t)0x00000080) /*!< I/O port F clock enable */
+ #define RCC_APB2ENR_IOPGEN ((uint32_t)0x00000100) /*!< I/O port G clock enable */
+#endif
+
+#ifdef STM32F10X_XL
+ #define RCC_APB2ENR_TIM9EN ((uint32_t)0x00080000) /*!< TIM9 Timer clock enable */
+ #define RCC_APB2ENR_TIM10EN ((uint32_t)0x00100000) /*!< TIM10 Timer clock enable */
+ #define RCC_APB2ENR_TIM11EN ((uint32_t)0x00200000) /*!< TIM11 Timer clock enable */
+#endif
+
+/***************** Bit definition for RCC_APB1ENR register ******************/
+#define RCC_APB1ENR_TIM2EN ((uint32_t)0x00000001) /*!< Timer 2 clock enabled*/
+#define RCC_APB1ENR_TIM3EN ((uint32_t)0x00000002) /*!< Timer 3 clock enable */
+#define RCC_APB1ENR_WWDGEN ((uint32_t)0x00000800) /*!< Window Watchdog clock enable */
+#define RCC_APB1ENR_USART2EN ((uint32_t)0x00020000) /*!< USART 2 clock enable */
+#define RCC_APB1ENR_I2C1EN ((uint32_t)0x00200000) /*!< I2C 1 clock enable */
+
+#if !defined (STM32F10X_LD_VL) && !defined (STM32F10X_MD_VL) && !defined (STM32F10X_HD_VL)
+#define RCC_APB1ENR_CAN1EN ((uint32_t)0x02000000) /*!< CAN1 clock enable */
+#endif
+
+#define RCC_APB1ENR_BKPEN ((uint32_t)0x08000000) /*!< Backup interface clock enable */
+#define RCC_APB1ENR_PWREN ((uint32_t)0x10000000) /*!< Power interface clock enable */
+
+#if !defined (STM32F10X_LD) && !defined (STM32F10X_LD_VL)
+ #define RCC_APB1ENR_TIM4EN ((uint32_t)0x00000004) /*!< Timer 4 clock enable */
+ #define RCC_APB1ENR_SPI2EN ((uint32_t)0x00004000) /*!< SPI 2 clock enable */
+ #define RCC_APB1ENR_USART3EN ((uint32_t)0x00040000) /*!< USART 3 clock enable */
+ #define RCC_APB1ENR_I2C2EN ((uint32_t)0x00400000) /*!< I2C 2 clock enable */
+#endif /* STM32F10X_LD && STM32F10X_LD_VL */
+
+#if defined (STM32F10X_HD) || defined (STM32F10X_MD) || defined (STM32F10X_LD)
+ #define RCC_APB1ENR_USBEN ((uint32_t)0x00800000) /*!< USB Device clock enable */
+#endif
+
+#if defined (STM32F10X_HD) || defined (STM32F10X_CL)
+ #define RCC_APB1ENR_TIM5EN ((uint32_t)0x00000008) /*!< Timer 5 clock enable */
+ #define RCC_APB1ENR_TIM6EN ((uint32_t)0x00000010) /*!< Timer 6 clock enable */
+ #define RCC_APB1ENR_TIM7EN ((uint32_t)0x00000020) /*!< Timer 7 clock enable */
+ #define RCC_APB1ENR_SPI3EN ((uint32_t)0x00008000) /*!< SPI 3 clock enable */
+ #define RCC_APB1ENR_UART4EN ((uint32_t)0x00080000) /*!< UART 4 clock enable */
+ #define RCC_APB1ENR_UART5EN ((uint32_t)0x00100000) /*!< UART 5 clock enable */
+ #define RCC_APB1ENR_DACEN ((uint32_t)0x20000000) /*!< DAC interface clock enable */
+#endif
+
+#if defined (STM32F10X_LD_VL) || defined (STM32F10X_MD_VL) || defined (STM32F10X_HD_VL)
+ #define RCC_APB1ENR_TIM6EN ((uint32_t)0x00000010) /*!< Timer 6 clock enable */
+ #define RCC_APB1ENR_TIM7EN ((uint32_t)0x00000020) /*!< Timer 7 clock enable */
+ #define RCC_APB1ENR_DACEN ((uint32_t)0x20000000) /*!< DAC interface clock enable */
+ #define RCC_APB1ENR_CECEN ((uint32_t)0x40000000) /*!< CEC interface clock enable */
+#endif
+
+#ifdef STM32F10X_HD_VL
+ #define RCC_APB1ENR_TIM5EN ((uint32_t)0x00000008) /*!< Timer 5 clock enable */
+ #define RCC_APB1ENR_TIM12EN ((uint32_t)0x00000040) /*!< TIM12 Timer clock enable */
+ #define RCC_APB1ENR_TIM13EN ((uint32_t)0x00000080) /*!< TIM13 Timer clock enable */
+ #define RCC_APB1ENR_TIM14EN ((uint32_t)0x00000100) /*!< TIM14 Timer clock enable */
+ #define RCC_APB1ENR_SPI3EN ((uint32_t)0x00008000) /*!< SPI 3 clock enable */
+ #define RCC_APB1ENR_UART4EN ((uint32_t)0x00080000) /*!< UART 4 clock enable */
+ #define RCC_APB1ENR_UART5EN ((uint32_t)0x00100000) /*!< UART 5 clock enable */
+#endif /* STM32F10X_HD_VL */
+
+#ifdef STM32F10X_CL
+ #define RCC_APB1ENR_CAN2EN ((uint32_t)0x04000000) /*!< CAN2 clock enable */
+#endif /* STM32F10X_CL */
+
+#ifdef STM32F10X_XL
+ #define RCC_APB1ENR_TIM12EN ((uint32_t)0x00000040) /*!< TIM12 Timer clock enable */
+ #define RCC_APB1ENR_TIM13EN ((uint32_t)0x00000080) /*!< TIM13 Timer clock enable */
+ #define RCC_APB1ENR_TIM14EN ((uint32_t)0x00000100) /*!< TIM14 Timer clock enable */
+#endif /* STM32F10X_XL */
+
+/******************* Bit definition for RCC_BDCR register *******************/
+#define RCC_BDCR_LSEON ((uint32_t)0x00000001) /*!< External Low Speed oscillator enable */
+#define RCC_BDCR_LSERDY ((uint32_t)0x00000002) /*!< External Low Speed oscillator Ready */
+#define RCC_BDCR_LSEBYP ((uint32_t)0x00000004) /*!< External Low Speed oscillator Bypass */
+
+#define RCC_BDCR_RTCSEL ((uint32_t)0x00000300) /*!< RTCSEL[1:0] bits (RTC clock source selection) */
+#define RCC_BDCR_RTCSEL_0 ((uint32_t)0x00000100) /*!< Bit 0 */
+#define RCC_BDCR_RTCSEL_1 ((uint32_t)0x00000200) /*!< Bit 1 */
+
+/*!< RTC congiguration */
+#define RCC_BDCR_RTCSEL_NOCLOCK ((uint32_t)0x00000000) /*!< No clock */
+#define RCC_BDCR_RTCSEL_LSE ((uint32_t)0x00000100) /*!< LSE oscillator clock used as RTC clock */
+#define RCC_BDCR_RTCSEL_LSI ((uint32_t)0x00000200) /*!< LSI oscillator clock used as RTC clock */
+#define RCC_BDCR_RTCSEL_HSE ((uint32_t)0x00000300) /*!< HSE oscillator clock divided by 128 used as RTC clock */
+
+#define RCC_BDCR_RTCEN ((uint32_t)0x00008000) /*!< RTC clock enable */
+#define RCC_BDCR_BDRST ((uint32_t)0x00010000) /*!< Backup domain software reset */
+
+/******************* Bit definition for RCC_CSR register ********************/
+#define RCC_CSR_LSION ((uint32_t)0x00000001) /*!< Internal Low Speed oscillator enable */
+#define RCC_CSR_LSIRDY ((uint32_t)0x00000002) /*!< Internal Low Speed oscillator Ready */
+#define RCC_CSR_RMVF ((uint32_t)0x01000000) /*!< Remove reset flag */
+#define RCC_CSR_PINRSTF ((uint32_t)0x04000000) /*!< PIN reset flag */
+#define RCC_CSR_PORRSTF ((uint32_t)0x08000000) /*!< POR/PDR reset flag */
+#define RCC_CSR_SFTRSTF ((uint32_t)0x10000000) /*!< Software Reset flag */
+#define RCC_CSR_IWDGRSTF ((uint32_t)0x20000000) /*!< Independent Watchdog reset flag */
+#define RCC_CSR_WWDGRSTF ((uint32_t)0x40000000) /*!< Window watchdog reset flag */
+#define RCC_CSR_LPWRRSTF ((uint32_t)0x80000000) /*!< Low-Power reset flag */
+
+#ifdef STM32F10X_CL
+/******************* Bit definition for RCC_AHBRSTR register ****************/
+ #define RCC_AHBRSTR_OTGFSRST ((uint32_t)0x00001000) /*!< USB OTG FS reset */
+ #define RCC_AHBRSTR_ETHMACRST ((uint32_t)0x00004000) /*!< ETHERNET MAC reset */
+
+/******************* Bit definition for RCC_CFGR2 register ******************/
+/*!< PREDIV1 configuration */
+ #define RCC_CFGR2_PREDIV1 ((uint32_t)0x0000000F) /*!< PREDIV1[3:0] bits */
+ #define RCC_CFGR2_PREDIV1_0 ((uint32_t)0x00000001) /*!< Bit 0 */
+ #define RCC_CFGR2_PREDIV1_1 ((uint32_t)0x00000002) /*!< Bit 1 */
+ #define RCC_CFGR2_PREDIV1_2 ((uint32_t)0x00000004) /*!< Bit 2 */
+ #define RCC_CFGR2_PREDIV1_3 ((uint32_t)0x00000008) /*!< Bit 3 */
+
+ #define RCC_CFGR2_PREDIV1_DIV1 ((uint32_t)0x00000000) /*!< PREDIV1 input clock not divided */
+ #define RCC_CFGR2_PREDIV1_DIV2 ((uint32_t)0x00000001) /*!< PREDIV1 input clock divided by 2 */
+ #define RCC_CFGR2_PREDIV1_DIV3 ((uint32_t)0x00000002) /*!< PREDIV1 input clock divided by 3 */
+ #define RCC_CFGR2_PREDIV1_DIV4 ((uint32_t)0x00000003) /*!< PREDIV1 input clock divided by 4 */
+ #define RCC_CFGR2_PREDIV1_DIV5 ((uint32_t)0x00000004) /*!< PREDIV1 input clock divided by 5 */
+ #define RCC_CFGR2_PREDIV1_DIV6 ((uint32_t)0x00000005) /*!< PREDIV1 input clock divided by 6 */
+ #define RCC_CFGR2_PREDIV1_DIV7 ((uint32_t)0x00000006) /*!< PREDIV1 input clock divided by 7 */
+ #define RCC_CFGR2_PREDIV1_DIV8 ((uint32_t)0x00000007) /*!< PREDIV1 input clock divided by 8 */
+ #define RCC_CFGR2_PREDIV1_DIV9 ((uint32_t)0x00000008) /*!< PREDIV1 input clock divided by 9 */
+ #define RCC_CFGR2_PREDIV1_DIV10 ((uint32_t)0x00000009) /*!< PREDIV1 input clock divided by 10 */
+ #define RCC_CFGR2_PREDIV1_DIV11 ((uint32_t)0x0000000A) /*!< PREDIV1 input clock divided by 11 */
+ #define RCC_CFGR2_PREDIV1_DIV12 ((uint32_t)0x0000000B) /*!< PREDIV1 input clock divided by 12 */
+ #define RCC_CFGR2_PREDIV1_DIV13 ((uint32_t)0x0000000C) /*!< PREDIV1 input clock divided by 13 */
+ #define RCC_CFGR2_PREDIV1_DIV14 ((uint32_t)0x0000000D) /*!< PREDIV1 input clock divided by 14 */
+ #define RCC_CFGR2_PREDIV1_DIV15 ((uint32_t)0x0000000E) /*!< PREDIV1 input clock divided by 15 */
+ #define RCC_CFGR2_PREDIV1_DIV16 ((uint32_t)0x0000000F) /*!< PREDIV1 input clock divided by 16 */
+
+/*!< PREDIV2 configuration */
+ #define RCC_CFGR2_PREDIV2 ((uint32_t)0x000000F0) /*!< PREDIV2[3:0] bits */
+ #define RCC_CFGR2_PREDIV2_0 ((uint32_t)0x00000010) /*!< Bit 0 */
+ #define RCC_CFGR2_PREDIV2_1 ((uint32_t)0x00000020) /*!< Bit 1 */
+ #define RCC_CFGR2_PREDIV2_2 ((uint32_t)0x00000040) /*!< Bit 2 */
+ #define RCC_CFGR2_PREDIV2_3 ((uint32_t)0x00000080) /*!< Bit 3 */
+
+ #define RCC_CFGR2_PREDIV2_DIV1 ((uint32_t)0x00000000) /*!< PREDIV2 input clock not divided */
+ #define RCC_CFGR2_PREDIV2_DIV2 ((uint32_t)0x00000010) /*!< PREDIV2 input clock divided by 2 */
+ #define RCC_CFGR2_PREDIV2_DIV3 ((uint32_t)0x00000020) /*!< PREDIV2 input clock divided by 3 */
+ #define RCC_CFGR2_PREDIV2_DIV4 ((uint32_t)0x00000030) /*!< PREDIV2 input clock divided by 4 */
+ #define RCC_CFGR2_PREDIV2_DIV5 ((uint32_t)0x00000040) /*!< PREDIV2 input clock divided by 5 */
+ #define RCC_CFGR2_PREDIV2_DIV6 ((uint32_t)0x00000050) /*!< PREDIV2 input clock divided by 6 */
+ #define RCC_CFGR2_PREDIV2_DIV7 ((uint32_t)0x00000060) /*!< PREDIV2 input clock divided by 7 */
+ #define RCC_CFGR2_PREDIV2_DIV8 ((uint32_t)0x00000070) /*!< PREDIV2 input clock divided by 8 */
+ #define RCC_CFGR2_PREDIV2_DIV9 ((uint32_t)0x00000080) /*!< PREDIV2 input clock divided by 9 */
+ #define RCC_CFGR2_PREDIV2_DIV10 ((uint32_t)0x00000090) /*!< PREDIV2 input clock divided by 10 */
+ #define RCC_CFGR2_PREDIV2_DIV11 ((uint32_t)0x000000A0) /*!< PREDIV2 input clock divided by 11 */
+ #define RCC_CFGR2_PREDIV2_DIV12 ((uint32_t)0x000000B0) /*!< PREDIV2 input clock divided by 12 */
+ #define RCC_CFGR2_PREDIV2_DIV13 ((uint32_t)0x000000C0) /*!< PREDIV2 input clock divided by 13 */
+ #define RCC_CFGR2_PREDIV2_DIV14 ((uint32_t)0x000000D0) /*!< PREDIV2 input clock divided by 14 */
+ #define RCC_CFGR2_PREDIV2_DIV15 ((uint32_t)0x000000E0) /*!< PREDIV2 input clock divided by 15 */
+ #define RCC_CFGR2_PREDIV2_DIV16 ((uint32_t)0x000000F0) /*!< PREDIV2 input clock divided by 16 */
+
+/*!< PLL2MUL configuration */
+ #define RCC_CFGR2_PLL2MUL ((uint32_t)0x00000F00) /*!< PLL2MUL[3:0] bits */
+ #define RCC_CFGR2_PLL2MUL_0 ((uint32_t)0x00000100) /*!< Bit 0 */
+ #define RCC_CFGR2_PLL2MUL_1 ((uint32_t)0x00000200) /*!< Bit 1 */
+ #define RCC_CFGR2_PLL2MUL_2 ((uint32_t)0x00000400) /*!< Bit 2 */
+ #define RCC_CFGR2_PLL2MUL_3 ((uint32_t)0x00000800) /*!< Bit 3 */
+
+ #define RCC_CFGR2_PLL2MUL8 ((uint32_t)0x00000600) /*!< PLL2 input clock * 8 */
+ #define RCC_CFGR2_PLL2MUL9 ((uint32_t)0x00000700) /*!< PLL2 input clock * 9 */
+ #define RCC_CFGR2_PLL2MUL10 ((uint32_t)0x00000800) /*!< PLL2 input clock * 10 */
+ #define RCC_CFGR2_PLL2MUL11 ((uint32_t)0x00000900) /*!< PLL2 input clock * 11 */
+ #define RCC_CFGR2_PLL2MUL12 ((uint32_t)0x00000A00) /*!< PLL2 input clock * 12 */
+ #define RCC_CFGR2_PLL2MUL13 ((uint32_t)0x00000B00) /*!< PLL2 input clock * 13 */
+ #define RCC_CFGR2_PLL2MUL14 ((uint32_t)0x00000C00) /*!< PLL2 input clock * 14 */
+ #define RCC_CFGR2_PLL2MUL16 ((uint32_t)0x00000E00) /*!< PLL2 input clock * 16 */
+ #define RCC_CFGR2_PLL2MUL20 ((uint32_t)0x00000F00) /*!< PLL2 input clock * 20 */
+
+/*!< PLL3MUL configuration */
+ #define RCC_CFGR2_PLL3MUL ((uint32_t)0x0000F000) /*!< PLL3MUL[3:0] bits */
+ #define RCC_CFGR2_PLL3MUL_0 ((uint32_t)0x00001000) /*!< Bit 0 */
+ #define RCC_CFGR2_PLL3MUL_1 ((uint32_t)0x00002000) /*!< Bit 1 */
+ #define RCC_CFGR2_PLL3MUL_2 ((uint32_t)0x00004000) /*!< Bit 2 */
+ #define RCC_CFGR2_PLL3MUL_3 ((uint32_t)0x00008000) /*!< Bit 3 */
+
+ #define RCC_CFGR2_PLL3MUL8 ((uint32_t)0x00006000) /*!< PLL3 input clock * 8 */
+ #define RCC_CFGR2_PLL3MUL9 ((uint32_t)0x00007000) /*!< PLL3 input clock * 9 */
+ #define RCC_CFGR2_PLL3MUL10 ((uint32_t)0x00008000) /*!< PLL3 input clock * 10 */
+ #define RCC_CFGR2_PLL3MUL11 ((uint32_t)0x00009000) /*!< PLL3 input clock * 11 */
+ #define RCC_CFGR2_PLL3MUL12 ((uint32_t)0x0000A000) /*!< PLL3 input clock * 12 */
+ #define RCC_CFGR2_PLL3MUL13 ((uint32_t)0x0000B000) /*!< PLL3 input clock * 13 */
+ #define RCC_CFGR2_PLL3MUL14 ((uint32_t)0x0000C000) /*!< PLL3 input clock * 14 */
+ #define RCC_CFGR2_PLL3MUL16 ((uint32_t)0x0000E000) /*!< PLL3 input clock * 16 */
+ #define RCC_CFGR2_PLL3MUL20 ((uint32_t)0x0000F000) /*!< PLL3 input clock * 20 */
+
+ #define RCC_CFGR2_PREDIV1SRC ((uint32_t)0x00010000) /*!< PREDIV1 entry clock source */
+ #define RCC_CFGR2_PREDIV1SRC_PLL2 ((uint32_t)0x00010000) /*!< PLL2 selected as PREDIV1 entry clock source */
+ #define RCC_CFGR2_PREDIV1SRC_HSE ((uint32_t)0x00000000) /*!< HSE selected as PREDIV1 entry clock source */
+ #define RCC_CFGR2_I2S2SRC ((uint32_t)0x00020000) /*!< I2S2 entry clock source */
+ #define RCC_CFGR2_I2S3SRC ((uint32_t)0x00040000) /*!< I2S3 clock source */
+#endif /* STM32F10X_CL */
+
+#if defined (STM32F10X_LD_VL) || defined (STM32F10X_MD_VL) || defined (STM32F10X_HD_VL)
+/******************* Bit definition for RCC_CFGR2 register ******************/
+/*!< PREDIV1 configuration */
+ #define RCC_CFGR2_PREDIV1 ((uint32_t)0x0000000F) /*!< PREDIV1[3:0] bits */
+ #define RCC_CFGR2_PREDIV1_0 ((uint32_t)0x00000001) /*!< Bit 0 */
+ #define RCC_CFGR2_PREDIV1_1 ((uint32_t)0x00000002) /*!< Bit 1 */
+ #define RCC_CFGR2_PREDIV1_2 ((uint32_t)0x00000004) /*!< Bit 2 */
+ #define RCC_CFGR2_PREDIV1_3 ((uint32_t)0x00000008) /*!< Bit 3 */
+
+ #define RCC_CFGR2_PREDIV1_DIV1 ((uint32_t)0x00000000) /*!< PREDIV1 input clock not divided */
+ #define RCC_CFGR2_PREDIV1_DIV2 ((uint32_t)0x00000001) /*!< PREDIV1 input clock divided by 2 */
+ #define RCC_CFGR2_PREDIV1_DIV3 ((uint32_t)0x00000002) /*!< PREDIV1 input clock divided by 3 */
+ #define RCC_CFGR2_PREDIV1_DIV4 ((uint32_t)0x00000003) /*!< PREDIV1 input clock divided by 4 */
+ #define RCC_CFGR2_PREDIV1_DIV5 ((uint32_t)0x00000004) /*!< PREDIV1 input clock divided by 5 */
+ #define RCC_CFGR2_PREDIV1_DIV6 ((uint32_t)0x00000005) /*!< PREDIV1 input clock divided by 6 */
+ #define RCC_CFGR2_PREDIV1_DIV7 ((uint32_t)0x00000006) /*!< PREDIV1 input clock divided by 7 */
+ #define RCC_CFGR2_PREDIV1_DIV8 ((uint32_t)0x00000007) /*!< PREDIV1 input clock divided by 8 */
+ #define RCC_CFGR2_PREDIV1_DIV9 ((uint32_t)0x00000008) /*!< PREDIV1 input clock divided by 9 */
+ #define RCC_CFGR2_PREDIV1_DIV10 ((uint32_t)0x00000009) /*!< PREDIV1 input clock divided by 10 */
+ #define RCC_CFGR2_PREDIV1_DIV11 ((uint32_t)0x0000000A) /*!< PREDIV1 input clock divided by 11 */
+ #define RCC_CFGR2_PREDIV1_DIV12 ((uint32_t)0x0000000B) /*!< PREDIV1 input clock divided by 12 */
+ #define RCC_CFGR2_PREDIV1_DIV13 ((uint32_t)0x0000000C) /*!< PREDIV1 input clock divided by 13 */
+ #define RCC_CFGR2_PREDIV1_DIV14 ((uint32_t)0x0000000D) /*!< PREDIV1 input clock divided by 14 */
+ #define RCC_CFGR2_PREDIV1_DIV15 ((uint32_t)0x0000000E) /*!< PREDIV1 input clock divided by 15 */
+ #define RCC_CFGR2_PREDIV1_DIV16 ((uint32_t)0x0000000F) /*!< PREDIV1 input clock divided by 16 */
+#endif
+
+/******************************************************************************/
+/* */
+/* General Purpose and Alternate Function I/O */
+/* */
+/******************************************************************************/
+
+/******************* Bit definition for GPIO_CRL register *******************/
+#define GPIO_CRL_MODE ((uint32_t)0x33333333) /*!< Port x mode bits */
+
+#define GPIO_CRL_MODE0 ((uint32_t)0x00000003) /*!< MODE0[1:0] bits (Port x mode bits, pin 0) */
+#define GPIO_CRL_MODE0_0 ((uint32_t)0x00000001) /*!< Bit 0 */
+#define GPIO_CRL_MODE0_1 ((uint32_t)0x00000002) /*!< Bit 1 */
+
+#define GPIO_CRL_MODE1 ((uint32_t)0x00000030) /*!< MODE1[1:0] bits (Port x mode bits, pin 1) */
+#define GPIO_CRL_MODE1_0 ((uint32_t)0x00000010) /*!< Bit 0 */
+#define GPIO_CRL_MODE1_1 ((uint32_t)0x00000020) /*!< Bit 1 */
+
+#define GPIO_CRL_MODE2 ((uint32_t)0x00000300) /*!< MODE2[1:0] bits (Port x mode bits, pin 2) */
+#define GPIO_CRL_MODE2_0 ((uint32_t)0x00000100) /*!< Bit 0 */
+#define GPIO_CRL_MODE2_1 ((uint32_t)0x00000200) /*!< Bit 1 */
+
+#define GPIO_CRL_MODE3 ((uint32_t)0x00003000) /*!< MODE3[1:0] bits (Port x mode bits, pin 3) */
+#define GPIO_CRL_MODE3_0 ((uint32_t)0x00001000) /*!< Bit 0 */
+#define GPIO_CRL_MODE3_1 ((uint32_t)0x00002000) /*!< Bit 1 */
+
+#define GPIO_CRL_MODE4 ((uint32_t)0x00030000) /*!< MODE4[1:0] bits (Port x mode bits, pin 4) */
+#define GPIO_CRL_MODE4_0 ((uint32_t)0x00010000) /*!< Bit 0 */
+#define GPIO_CRL_MODE4_1 ((uint32_t)0x00020000) /*!< Bit 1 */
+
+#define GPIO_CRL_MODE5 ((uint32_t)0x00300000) /*!< MODE5[1:0] bits (Port x mode bits, pin 5) */
+#define GPIO_CRL_MODE5_0 ((uint32_t)0x00100000) /*!< Bit 0 */
+#define GPIO_CRL_MODE5_1 ((uint32_t)0x00200000) /*!< Bit 1 */
+
+#define GPIO_CRL_MODE6 ((uint32_t)0x03000000) /*!< MODE6[1:0] bits (Port x mode bits, pin 6) */
+#define GPIO_CRL_MODE6_0 ((uint32_t)0x01000000) /*!< Bit 0 */
+#define GPIO_CRL_MODE6_1 ((uint32_t)0x02000000) /*!< Bit 1 */
+
+#define GPIO_CRL_MODE7 ((uint32_t)0x30000000) /*!< MODE7[1:0] bits (Port x mode bits, pin 7) */
+#define GPIO_CRL_MODE7_0 ((uint32_t)0x10000000) /*!< Bit 0 */
+#define GPIO_CRL_MODE7_1 ((uint32_t)0x20000000) /*!< Bit 1 */
+
+#define GPIO_CRL_CNF ((uint32_t)0xCCCCCCCC) /*!< Port x configuration bits */
+
+#define GPIO_CRL_CNF0 ((uint32_t)0x0000000C) /*!< CNF0[1:0] bits (Port x configuration bits, pin 0) */
+#define GPIO_CRL_CNF0_0 ((uint32_t)0x00000004) /*!< Bit 0 */
+#define GPIO_CRL_CNF0_1 ((uint32_t)0x00000008) /*!< Bit 1 */
+
+#define GPIO_CRL_CNF1 ((uint32_t)0x000000C0) /*!< CNF1[1:0] bits (Port x configuration bits, pin 1) */
+#define GPIO_CRL_CNF1_0 ((uint32_t)0x00000040) /*!< Bit 0 */
+#define GPIO_CRL_CNF1_1 ((uint32_t)0x00000080) /*!< Bit 1 */
+
+#define GPIO_CRL_CNF2 ((uint32_t)0x00000C00) /*!< CNF2[1:0] bits (Port x configuration bits, pin 2) */
+#define GPIO_CRL_CNF2_0 ((uint32_t)0x00000400) /*!< Bit 0 */
+#define GPIO_CRL_CNF2_1 ((uint32_t)0x00000800) /*!< Bit 1 */
+
+#define GPIO_CRL_CNF3 ((uint32_t)0x0000C000) /*!< CNF3[1:0] bits (Port x configuration bits, pin 3) */
+#define GPIO_CRL_CNF3_0 ((uint32_t)0x00004000) /*!< Bit 0 */
+#define GPIO_CRL_CNF3_1 ((uint32_t)0x00008000) /*!< Bit 1 */
+
+#define GPIO_CRL_CNF4 ((uint32_t)0x000C0000) /*!< CNF4[1:0] bits (Port x configuration bits, pin 4) */
+#define GPIO_CRL_CNF4_0 ((uint32_t)0x00040000) /*!< Bit 0 */
+#define GPIO_CRL_CNF4_1 ((uint32_t)0x00080000) /*!< Bit 1 */
+
+#define GPIO_CRL_CNF5 ((uint32_t)0x00C00000) /*!< CNF5[1:0] bits (Port x configuration bits, pin 5) */
+#define GPIO_CRL_CNF5_0 ((uint32_t)0x00400000) /*!< Bit 0 */
+#define GPIO_CRL_CNF5_1 ((uint32_t)0x00800000) /*!< Bit 1 */
+
+#define GPIO_CRL_CNF6 ((uint32_t)0x0C000000) /*!< CNF6[1:0] bits (Port x configuration bits, pin 6) */
+#define GPIO_CRL_CNF6_0 ((uint32_t)0x04000000) /*!< Bit 0 */
+#define GPIO_CRL_CNF6_1 ((uint32_t)0x08000000) /*!< Bit 1 */
+
+#define GPIO_CRL_CNF7 ((uint32_t)0xC0000000) /*!< CNF7[1:0] bits (Port x configuration bits, pin 7) */
+#define GPIO_CRL_CNF7_0 ((uint32_t)0x40000000) /*!< Bit 0 */
+#define GPIO_CRL_CNF7_1 ((uint32_t)0x80000000) /*!< Bit 1 */
+
+/******************* Bit definition for GPIO_CRH register *******************/
+#define GPIO_CRH_MODE ((uint32_t)0x33333333) /*!< Port x mode bits */
+
+#define GPIO_CRH_MODE8 ((uint32_t)0x00000003) /*!< MODE8[1:0] bits (Port x mode bits, pin 8) */
+#define GPIO_CRH_MODE8_0 ((uint32_t)0x00000001) /*!< Bit 0 */
+#define GPIO_CRH_MODE8_1 ((uint32_t)0x00000002) /*!< Bit 1 */
+
+#define GPIO_CRH_MODE9 ((uint32_t)0x00000030) /*!< MODE9[1:0] bits (Port x mode bits, pin 9) */
+#define GPIO_CRH_MODE9_0 ((uint32_t)0x00000010) /*!< Bit 0 */
+#define GPIO_CRH_MODE9_1 ((uint32_t)0x00000020) /*!< Bit 1 */
+
+#define GPIO_CRH_MODE10 ((uint32_t)0x00000300) /*!< MODE10[1:0] bits (Port x mode bits, pin 10) */
+#define GPIO_CRH_MODE10_0 ((uint32_t)0x00000100) /*!< Bit 0 */
+#define GPIO_CRH_MODE10_1 ((uint32_t)0x00000200) /*!< Bit 1 */
+
+#define GPIO_CRH_MODE11 ((uint32_t)0x00003000) /*!< MODE11[1:0] bits (Port x mode bits, pin 11) */
+#define GPIO_CRH_MODE11_0 ((uint32_t)0x00001000) /*!< Bit 0 */
+#define GPIO_CRH_MODE11_1 ((uint32_t)0x00002000) /*!< Bit 1 */
+
+#define GPIO_CRH_MODE12 ((uint32_t)0x00030000) /*!< MODE12[1:0] bits (Port x mode bits, pin 12) */
+#define GPIO_CRH_MODE12_0 ((uint32_t)0x00010000) /*!< Bit 0 */
+#define GPIO_CRH_MODE12_1 ((uint32_t)0x00020000) /*!< Bit 1 */
+
+#define GPIO_CRH_MODE13 ((uint32_t)0x00300000) /*!< MODE13[1:0] bits (Port x mode bits, pin 13) */
+#define GPIO_CRH_MODE13_0 ((uint32_t)0x00100000) /*!< Bit 0 */
+#define GPIO_CRH_MODE13_1 ((uint32_t)0x00200000) /*!< Bit 1 */
+
+#define GPIO_CRH_MODE14 ((uint32_t)0x03000000) /*!< MODE14[1:0] bits (Port x mode bits, pin 14) */
+#define GPIO_CRH_MODE14_0 ((uint32_t)0x01000000) /*!< Bit 0 */
+#define GPIO_CRH_MODE14_1 ((uint32_t)0x02000000) /*!< Bit 1 */
+
+#define GPIO_CRH_MODE15 ((uint32_t)0x30000000) /*!< MODE15[1:0] bits (Port x mode bits, pin 15) */
+#define GPIO_CRH_MODE15_0 ((uint32_t)0x10000000) /*!< Bit 0 */
+#define GPIO_CRH_MODE15_1 ((uint32_t)0x20000000) /*!< Bit 1 */
+
+#define GPIO_CRH_CNF ((uint32_t)0xCCCCCCCC) /*!< Port x configuration bits */
+
+#define GPIO_CRH_CNF8 ((uint32_t)0x0000000C) /*!< CNF8[1:0] bits (Port x configuration bits, pin 8) */
+#define GPIO_CRH_CNF8_0 ((uint32_t)0x00000004) /*!< Bit 0 */
+#define GPIO_CRH_CNF8_1 ((uint32_t)0x00000008) /*!< Bit 1 */
+
+#define GPIO_CRH_CNF9 ((uint32_t)0x000000C0) /*!< CNF9[1:0] bits (Port x configuration bits, pin 9) */
+#define GPIO_CRH_CNF9_0 ((uint32_t)0x00000040) /*!< Bit 0 */
+#define GPIO_CRH_CNF9_1 ((uint32_t)0x00000080) /*!< Bit 1 */
+
+#define GPIO_CRH_CNF10 ((uint32_t)0x00000C00) /*!< CNF10[1:0] bits (Port x configuration bits, pin 10) */
+#define GPIO_CRH_CNF10_0 ((uint32_t)0x00000400) /*!< Bit 0 */
+#define GPIO_CRH_CNF10_1 ((uint32_t)0x00000800) /*!< Bit 1 */
+
+#define GPIO_CRH_CNF11 ((uint32_t)0x0000C000) /*!< CNF11[1:0] bits (Port x configuration bits, pin 11) */
+#define GPIO_CRH_CNF11_0 ((uint32_t)0x00004000) /*!< Bit 0 */
+#define GPIO_CRH_CNF11_1 ((uint32_t)0x00008000) /*!< Bit 1 */
+
+#define GPIO_CRH_CNF12 ((uint32_t)0x000C0000) /*!< CNF12[1:0] bits (Port x configuration bits, pin 12) */
+#define GPIO_CRH_CNF12_0 ((uint32_t)0x00040000) /*!< Bit 0 */
+#define GPIO_CRH_CNF12_1 ((uint32_t)0x00080000) /*!< Bit 1 */
+
+#define GPIO_CRH_CNF13 ((uint32_t)0x00C00000) /*!< CNF13[1:0] bits (Port x configuration bits, pin 13) */
+#define GPIO_CRH_CNF13_0 ((uint32_t)0x00400000) /*!< Bit 0 */
+#define GPIO_CRH_CNF13_1 ((uint32_t)0x00800000) /*!< Bit 1 */
+
+#define GPIO_CRH_CNF14 ((uint32_t)0x0C000000) /*!< CNF14[1:0] bits (Port x configuration bits, pin 14) */
+#define GPIO_CRH_CNF14_0 ((uint32_t)0x04000000) /*!< Bit 0 */
+#define GPIO_CRH_CNF14_1 ((uint32_t)0x08000000) /*!< Bit 1 */
+
+#define GPIO_CRH_CNF15 ((uint32_t)0xC0000000) /*!< CNF15[1:0] bits (Port x configuration bits, pin 15) */
+#define GPIO_CRH_CNF15_0 ((uint32_t)0x40000000) /*!< Bit 0 */
+#define GPIO_CRH_CNF15_1 ((uint32_t)0x80000000) /*!< Bit 1 */
+
+/*!<****************** Bit definition for GPIO_IDR register *******************/
+#define GPIO_IDR_IDR0 ((uint16_t)0x0001) /*!< Port input data, bit 0 */
+#define GPIO_IDR_IDR1 ((uint16_t)0x0002) /*!< Port input data, bit 1 */
+#define GPIO_IDR_IDR2 ((uint16_t)0x0004) /*!< Port input data, bit 2 */
+#define GPIO_IDR_IDR3 ((uint16_t)0x0008) /*!< Port input data, bit 3 */
+#define GPIO_IDR_IDR4 ((uint16_t)0x0010) /*!< Port input data, bit 4 */
+#define GPIO_IDR_IDR5 ((uint16_t)0x0020) /*!< Port input data, bit 5 */
+#define GPIO_IDR_IDR6 ((uint16_t)0x0040) /*!< Port input data, bit 6 */
+#define GPIO_IDR_IDR7 ((uint16_t)0x0080) /*!< Port input data, bit 7 */
+#define GPIO_IDR_IDR8 ((uint16_t)0x0100) /*!< Port input data, bit 8 */
+#define GPIO_IDR_IDR9 ((uint16_t)0x0200) /*!< Port input data, bit 9 */
+#define GPIO_IDR_IDR10 ((uint16_t)0x0400) /*!< Port input data, bit 10 */
+#define GPIO_IDR_IDR11 ((uint16_t)0x0800) /*!< Port input data, bit 11 */
+#define GPIO_IDR_IDR12 ((uint16_t)0x1000) /*!< Port input data, bit 12 */
+#define GPIO_IDR_IDR13 ((uint16_t)0x2000) /*!< Port input data, bit 13 */
+#define GPIO_IDR_IDR14 ((uint16_t)0x4000) /*!< Port input data, bit 14 */
+#define GPIO_IDR_IDR15 ((uint16_t)0x8000) /*!< Port input data, bit 15 */
+
+/******************* Bit definition for GPIO_ODR register *******************/
+#define GPIO_ODR_ODR0 ((uint16_t)0x0001) /*!< Port output data, bit 0 */
+#define GPIO_ODR_ODR1 ((uint16_t)0x0002) /*!< Port output data, bit 1 */
+#define GPIO_ODR_ODR2 ((uint16_t)0x0004) /*!< Port output data, bit 2 */
+#define GPIO_ODR_ODR3 ((uint16_t)0x0008) /*!< Port output data, bit 3 */
+#define GPIO_ODR_ODR4 ((uint16_t)0x0010) /*!< Port output data, bit 4 */
+#define GPIO_ODR_ODR5 ((uint16_t)0x0020) /*!< Port output data, bit 5 */
+#define GPIO_ODR_ODR6 ((uint16_t)0x0040) /*!< Port output data, bit 6 */
+#define GPIO_ODR_ODR7 ((uint16_t)0x0080) /*!< Port output data, bit 7 */
+#define GPIO_ODR_ODR8 ((uint16_t)0x0100) /*!< Port output data, bit 8 */
+#define GPIO_ODR_ODR9 ((uint16_t)0x0200) /*!< Port output data, bit 9 */
+#define GPIO_ODR_ODR10 ((uint16_t)0x0400) /*!< Port output data, bit 10 */
+#define GPIO_ODR_ODR11 ((uint16_t)0x0800) /*!< Port output data, bit 11 */
+#define GPIO_ODR_ODR12 ((uint16_t)0x1000) /*!< Port output data, bit 12 */
+#define GPIO_ODR_ODR13 ((uint16_t)0x2000) /*!< Port output data, bit 13 */
+#define GPIO_ODR_ODR14 ((uint16_t)0x4000) /*!< Port output data, bit 14 */
+#define GPIO_ODR_ODR15 ((uint16_t)0x8000) /*!< Port output data, bit 15 */
+
+/****************** Bit definition for GPIO_BSRR register *******************/
+#define GPIO_BSRR_BS0 ((uint32_t)0x00000001) /*!< Port x Set bit 0 */
+#define GPIO_BSRR_BS1 ((uint32_t)0x00000002) /*!< Port x Set bit 1 */
+#define GPIO_BSRR_BS2 ((uint32_t)0x00000004) /*!< Port x Set bit 2 */
+#define GPIO_BSRR_BS3 ((uint32_t)0x00000008) /*!< Port x Set bit 3 */
+#define GPIO_BSRR_BS4 ((uint32_t)0x00000010) /*!< Port x Set bit 4 */
+#define GPIO_BSRR_BS5 ((uint32_t)0x00000020) /*!< Port x Set bit 5 */
+#define GPIO_BSRR_BS6 ((uint32_t)0x00000040) /*!< Port x Set bit 6 */
+#define GPIO_BSRR_BS7 ((uint32_t)0x00000080) /*!< Port x Set bit 7 */
+#define GPIO_BSRR_BS8 ((uint32_t)0x00000100) /*!< Port x Set bit 8 */
+#define GPIO_BSRR_BS9 ((uint32_t)0x00000200) /*!< Port x Set bit 9 */
+#define GPIO_BSRR_BS10 ((uint32_t)0x00000400) /*!< Port x Set bit 10 */
+#define GPIO_BSRR_BS11 ((uint32_t)0x00000800) /*!< Port x Set bit 11 */
+#define GPIO_BSRR_BS12 ((uint32_t)0x00001000) /*!< Port x Set bit 12 */
+#define GPIO_BSRR_BS13 ((uint32_t)0x00002000) /*!< Port x Set bit 13 */
+#define GPIO_BSRR_BS14 ((uint32_t)0x00004000) /*!< Port x Set bit 14 */
+#define GPIO_BSRR_BS15 ((uint32_t)0x00008000) /*!< Port x Set bit 15 */
+
+#define GPIO_BSRR_BR0 ((uint32_t)0x00010000) /*!< Port x Reset bit 0 */
+#define GPIO_BSRR_BR1 ((uint32_t)0x00020000) /*!< Port x Reset bit 1 */
+#define GPIO_BSRR_BR2 ((uint32_t)0x00040000) /*!< Port x Reset bit 2 */
+#define GPIO_BSRR_BR3 ((uint32_t)0x00080000) /*!< Port x Reset bit 3 */
+#define GPIO_BSRR_BR4 ((uint32_t)0x00100000) /*!< Port x Reset bit 4 */
+#define GPIO_BSRR_BR5 ((uint32_t)0x00200000) /*!< Port x Reset bit 5 */
+#define GPIO_BSRR_BR6 ((uint32_t)0x00400000) /*!< Port x Reset bit 6 */
+#define GPIO_BSRR_BR7 ((uint32_t)0x00800000) /*!< Port x Reset bit 7 */
+#define GPIO_BSRR_BR8 ((uint32_t)0x01000000) /*!< Port x Reset bit 8 */
+#define GPIO_BSRR_BR9 ((uint32_t)0x02000000) /*!< Port x Reset bit 9 */
+#define GPIO_BSRR_BR10 ((uint32_t)0x04000000) /*!< Port x Reset bit 10 */
+#define GPIO_BSRR_BR11 ((uint32_t)0x08000000) /*!< Port x Reset bit 11 */
+#define GPIO_BSRR_BR12 ((uint32_t)0x10000000) /*!< Port x Reset bit 12 */
+#define GPIO_BSRR_BR13 ((uint32_t)0x20000000) /*!< Port x Reset bit 13 */
+#define GPIO_BSRR_BR14 ((uint32_t)0x40000000) /*!< Port x Reset bit 14 */
+#define GPIO_BSRR_BR15 ((uint32_t)0x80000000) /*!< Port x Reset bit 15 */
+
+/******************* Bit definition for GPIO_BRR register *******************/
+#define GPIO_BRR_BR0 ((uint16_t)0x0001) /*!< Port x Reset bit 0 */
+#define GPIO_BRR_BR1 ((uint16_t)0x0002) /*!< Port x Reset bit 1 */
+#define GPIO_BRR_BR2 ((uint16_t)0x0004) /*!< Port x Reset bit 2 */
+#define GPIO_BRR_BR3 ((uint16_t)0x0008) /*!< Port x Reset bit 3 */
+#define GPIO_BRR_BR4 ((uint16_t)0x0010) /*!< Port x Reset bit 4 */
+#define GPIO_BRR_BR5 ((uint16_t)0x0020) /*!< Port x Reset bit 5 */
+#define GPIO_BRR_BR6 ((uint16_t)0x0040) /*!< Port x Reset bit 6 */
+#define GPIO_BRR_BR7 ((uint16_t)0x0080) /*!< Port x Reset bit 7 */
+#define GPIO_BRR_BR8 ((uint16_t)0x0100) /*!< Port x Reset bit 8 */
+#define GPIO_BRR_BR9 ((uint16_t)0x0200) /*!< Port x Reset bit 9 */
+#define GPIO_BRR_BR10 ((uint16_t)0x0400) /*!< Port x Reset bit 10 */
+#define GPIO_BRR_BR11 ((uint16_t)0x0800) /*!< Port x Reset bit 11 */
+#define GPIO_BRR_BR12 ((uint16_t)0x1000) /*!< Port x Reset bit 12 */
+#define GPIO_BRR_BR13 ((uint16_t)0x2000) /*!< Port x Reset bit 13 */
+#define GPIO_BRR_BR14 ((uint16_t)0x4000) /*!< Port x Reset bit 14 */
+#define GPIO_BRR_BR15 ((uint16_t)0x8000) /*!< Port x Reset bit 15 */
+
+/****************** Bit definition for GPIO_LCKR register *******************/
+#define GPIO_LCKR_LCK0 ((uint32_t)0x00000001) /*!< Port x Lock bit 0 */
+#define GPIO_LCKR_LCK1 ((uint32_t)0x00000002) /*!< Port x Lock bit 1 */
+#define GPIO_LCKR_LCK2 ((uint32_t)0x00000004) /*!< Port x Lock bit 2 */
+#define GPIO_LCKR_LCK3 ((uint32_t)0x00000008) /*!< Port x Lock bit 3 */
+#define GPIO_LCKR_LCK4 ((uint32_t)0x00000010) /*!< Port x Lock bit 4 */
+#define GPIO_LCKR_LCK5 ((uint32_t)0x00000020) /*!< Port x Lock bit 5 */
+#define GPIO_LCKR_LCK6 ((uint32_t)0x00000040) /*!< Port x Lock bit 6 */
+#define GPIO_LCKR_LCK7 ((uint32_t)0x00000080) /*!< Port x Lock bit 7 */
+#define GPIO_LCKR_LCK8 ((uint32_t)0x00000100) /*!< Port x Lock bit 8 */
+#define GPIO_LCKR_LCK9 ((uint32_t)0x00000200) /*!< Port x Lock bit 9 */
+#define GPIO_LCKR_LCK10 ((uint32_t)0x00000400) /*!< Port x Lock bit 10 */
+#define GPIO_LCKR_LCK11 ((uint32_t)0x00000800) /*!< Port x Lock bit 11 */
+#define GPIO_LCKR_LCK12 ((uint32_t)0x00001000) /*!< Port x Lock bit 12 */
+#define GPIO_LCKR_LCK13 ((uint32_t)0x00002000) /*!< Port x Lock bit 13 */
+#define GPIO_LCKR_LCK14 ((uint32_t)0x00004000) /*!< Port x Lock bit 14 */
+#define GPIO_LCKR_LCK15 ((uint32_t)0x00008000) /*!< Port x Lock bit 15 */
+#define GPIO_LCKR_LCKK ((uint32_t)0x00010000) /*!< Lock key */
+
+/*----------------------------------------------------------------------------*/
+
+/****************** Bit definition for AFIO_EVCR register *******************/
+#define AFIO_EVCR_PIN ((uint8_t)0x0F) /*!< PIN[3:0] bits (Pin selection) */
+#define AFIO_EVCR_PIN_0 ((uint8_t)0x01) /*!< Bit 0 */
+#define AFIO_EVCR_PIN_1 ((uint8_t)0x02) /*!< Bit 1 */
+#define AFIO_EVCR_PIN_2 ((uint8_t)0x04) /*!< Bit 2 */
+#define AFIO_EVCR_PIN_3 ((uint8_t)0x08) /*!< Bit 3 */
+
+/*!< PIN configuration */
+#define AFIO_EVCR_PIN_PX0 ((uint8_t)0x00) /*!< Pin 0 selected */
+#define AFIO_EVCR_PIN_PX1 ((uint8_t)0x01) /*!< Pin 1 selected */
+#define AFIO_EVCR_PIN_PX2 ((uint8_t)0x02) /*!< Pin 2 selected */
+#define AFIO_EVCR_PIN_PX3 ((uint8_t)0x03) /*!< Pin 3 selected */
+#define AFIO_EVCR_PIN_PX4 ((uint8_t)0x04) /*!< Pin 4 selected */
+#define AFIO_EVCR_PIN_PX5 ((uint8_t)0x05) /*!< Pin 5 selected */
+#define AFIO_EVCR_PIN_PX6 ((uint8_t)0x06) /*!< Pin 6 selected */
+#define AFIO_EVCR_PIN_PX7 ((uint8_t)0x07) /*!< Pin 7 selected */
+#define AFIO_EVCR_PIN_PX8 ((uint8_t)0x08) /*!< Pin 8 selected */
+#define AFIO_EVCR_PIN_PX9 ((uint8_t)0x09) /*!< Pin 9 selected */
+#define AFIO_EVCR_PIN_PX10 ((uint8_t)0x0A) /*!< Pin 10 selected */
+#define AFIO_EVCR_PIN_PX11 ((uint8_t)0x0B) /*!< Pin 11 selected */
+#define AFIO_EVCR_PIN_PX12 ((uint8_t)0x0C) /*!< Pin 12 selected */
+#define AFIO_EVCR_PIN_PX13 ((uint8_t)0x0D) /*!< Pin 13 selected */
+#define AFIO_EVCR_PIN_PX14 ((uint8_t)0x0E) /*!< Pin 14 selected */
+#define AFIO_EVCR_PIN_PX15 ((uint8_t)0x0F) /*!< Pin 15 selected */
+
+#define AFIO_EVCR_PORT ((uint8_t)0x70) /*!< PORT[2:0] bits (Port selection) */
+#define AFIO_EVCR_PORT_0 ((uint8_t)0x10) /*!< Bit 0 */
+#define AFIO_EVCR_PORT_1 ((uint8_t)0x20) /*!< Bit 1 */
+#define AFIO_EVCR_PORT_2 ((uint8_t)0x40) /*!< Bit 2 */
+
+/*!< PORT configuration */
+#define AFIO_EVCR_PORT_PA ((uint8_t)0x00) /*!< Port A selected */
+#define AFIO_EVCR_PORT_PB ((uint8_t)0x10) /*!< Port B selected */
+#define AFIO_EVCR_PORT_PC ((uint8_t)0x20) /*!< Port C selected */
+#define AFIO_EVCR_PORT_PD ((uint8_t)0x30) /*!< Port D selected */
+#define AFIO_EVCR_PORT_PE ((uint8_t)0x40) /*!< Port E selected */
+
+#define AFIO_EVCR_EVOE ((uint8_t)0x80) /*!< Event Output Enable */
+
+/****************** Bit definition for AFIO_MAPR register *******************/
+#define AFIO_MAPR_SPI1_REMAP ((uint32_t)0x00000001) /*!< SPI1 remapping */
+#define AFIO_MAPR_I2C1_REMAP ((uint32_t)0x00000002) /*!< I2C1 remapping */
+#define AFIO_MAPR_USART1_REMAP ((uint32_t)0x00000004) /*!< USART1 remapping */
+#define AFIO_MAPR_USART2_REMAP ((uint32_t)0x00000008) /*!< USART2 remapping */
+
+#define AFIO_MAPR_USART3_REMAP ((uint32_t)0x00000030) /*!< USART3_REMAP[1:0] bits (USART3 remapping) */
+#define AFIO_MAPR_USART3_REMAP_0 ((uint32_t)0x00000010) /*!< Bit 0 */
+#define AFIO_MAPR_USART3_REMAP_1 ((uint32_t)0x00000020) /*!< Bit 1 */
+
+/* USART3_REMAP configuration */
+#define AFIO_MAPR_USART3_REMAP_NOREMAP ((uint32_t)0x00000000) /*!< No remap (TX/PB10, RX/PB11, CK/PB12, CTS/PB13, RTS/PB14) */
+#define AFIO_MAPR_USART3_REMAP_PARTIALREMAP ((uint32_t)0x00000010) /*!< Partial remap (TX/PC10, RX/PC11, CK/PC12, CTS/PB13, RTS/PB14) */
+#define AFIO_MAPR_USART3_REMAP_FULLREMAP ((uint32_t)0x00000030) /*!< Full remap (TX/PD8, RX/PD9, CK/PD10, CTS/PD11, RTS/PD12) */
+
+#define AFIO_MAPR_TIM1_REMAP ((uint32_t)0x000000C0) /*!< TIM1_REMAP[1:0] bits (TIM1 remapping) */
+#define AFIO_MAPR_TIM1_REMAP_0 ((uint32_t)0x00000040) /*!< Bit 0 */
+#define AFIO_MAPR_TIM1_REMAP_1 ((uint32_t)0x00000080) /*!< Bit 1 */
+
+/*!< TIM1_REMAP configuration */
+#define AFIO_MAPR_TIM1_REMAP_NOREMAP ((uint32_t)0x00000000) /*!< No remap (ETR/PA12, CH1/PA8, CH2/PA9, CH3/PA10, CH4/PA11, BKIN/PB12, CH1N/PB13, CH2N/PB14, CH3N/PB15) */
+#define AFIO_MAPR_TIM1_REMAP_PARTIALREMAP ((uint32_t)0x00000040) /*!< Partial remap (ETR/PA12, CH1/PA8, CH2/PA9, CH3/PA10, CH4/PA11, BKIN/PA6, CH1N/PA7, CH2N/PB0, CH3N/PB1) */
+#define AFIO_MAPR_TIM1_REMAP_FULLREMAP ((uint32_t)0x000000C0) /*!< Full remap (ETR/PE7, CH1/PE9, CH2/PE11, CH3/PE13, CH4/PE14, BKIN/PE15, CH1N/PE8, CH2N/PE10, CH3N/PE12) */
+
+#define AFIO_MAPR_TIM2_REMAP ((uint32_t)0x00000300) /*!< TIM2_REMAP[1:0] bits (TIM2 remapping) */
+#define AFIO_MAPR_TIM2_REMAP_0 ((uint32_t)0x00000100) /*!< Bit 0 */
+#define AFIO_MAPR_TIM2_REMAP_1 ((uint32_t)0x00000200) /*!< Bit 1 */
+
+/*!< TIM2_REMAP configuration */
+#define AFIO_MAPR_TIM2_REMAP_NOREMAP ((uint32_t)0x00000000) /*!< No remap (CH1/ETR/PA0, CH2/PA1, CH3/PA2, CH4/PA3) */
+#define AFIO_MAPR_TIM2_REMAP_PARTIALREMAP1 ((uint32_t)0x00000100) /*!< Partial remap (CH1/ETR/PA15, CH2/PB3, CH3/PA2, CH4/PA3) */
+#define AFIO_MAPR_TIM2_REMAP_PARTIALREMAP2 ((uint32_t)0x00000200) /*!< Partial remap (CH1/ETR/PA0, CH2/PA1, CH3/PB10, CH4/PB11) */
+#define AFIO_MAPR_TIM2_REMAP_FULLREMAP ((uint32_t)0x00000300) /*!< Full remap (CH1/ETR/PA15, CH2/PB3, CH3/PB10, CH4/PB11) */
+
+#define AFIO_MAPR_TIM3_REMAP ((uint32_t)0x00000C00) /*!< TIM3_REMAP[1:0] bits (TIM3 remapping) */
+#define AFIO_MAPR_TIM3_REMAP_0 ((uint32_t)0x00000400) /*!< Bit 0 */
+#define AFIO_MAPR_TIM3_REMAP_1 ((uint32_t)0x00000800) /*!< Bit 1 */
+
+/*!< TIM3_REMAP configuration */
+#define AFIO_MAPR_TIM3_REMAP_NOREMAP ((uint32_t)0x00000000) /*!< No remap (CH1/PA6, CH2/PA7, CH3/PB0, CH4/PB1) */
+#define AFIO_MAPR_TIM3_REMAP_PARTIALREMAP ((uint32_t)0x00000800) /*!< Partial remap (CH1/PB4, CH2/PB5, CH3/PB0, CH4/PB1) */
+#define AFIO_MAPR_TIM3_REMAP_FULLREMAP ((uint32_t)0x00000C00) /*!< Full remap (CH1/PC6, CH2/PC7, CH3/PC8, CH4/PC9) */
+
+#define AFIO_MAPR_TIM4_REMAP ((uint32_t)0x00001000) /*!< TIM4_REMAP bit (TIM4 remapping) */
+
+#define AFIO_MAPR_CAN_REMAP ((uint32_t)0x00006000) /*!< CAN_REMAP[1:0] bits (CAN Alternate function remapping) */
+#define AFIO_MAPR_CAN_REMAP_0 ((uint32_t)0x00002000) /*!< Bit 0 */
+#define AFIO_MAPR_CAN_REMAP_1 ((uint32_t)0x00004000) /*!< Bit 1 */
+
+/*!< CAN_REMAP configuration */
+#define AFIO_MAPR_CAN_REMAP_REMAP1 ((uint32_t)0x00000000) /*!< CANRX mapped to PA11, CANTX mapped to PA12 */
+#define AFIO_MAPR_CAN_REMAP_REMAP2 ((uint32_t)0x00004000) /*!< CANRX mapped to PB8, CANTX mapped to PB9 */
+#define AFIO_MAPR_CAN_REMAP_REMAP3 ((uint32_t)0x00006000) /*!< CANRX mapped to PD0, CANTX mapped to PD1 */
+
+#define AFIO_MAPR_PD01_REMAP ((uint32_t)0x00008000) /*!< Port D0/Port D1 mapping on OSC_IN/OSC_OUT */
+#define AFIO_MAPR_TIM5CH4_IREMAP ((uint32_t)0x00010000) /*!< TIM5 Channel4 Internal Remap */
+#define AFIO_MAPR_ADC1_ETRGINJ_REMAP ((uint32_t)0x00020000) /*!< ADC 1 External Trigger Injected Conversion remapping */
+#define AFIO_MAPR_ADC1_ETRGREG_REMAP ((uint32_t)0x00040000) /*!< ADC 1 External Trigger Regular Conversion remapping */
+#define AFIO_MAPR_ADC2_ETRGINJ_REMAP ((uint32_t)0x00080000) /*!< ADC 2 External Trigger Injected Conversion remapping */
+#define AFIO_MAPR_ADC2_ETRGREG_REMAP ((uint32_t)0x00100000) /*!< ADC 2 External Trigger Regular Conversion remapping */
+
+/*!< SWJ_CFG configuration */
+#define AFIO_MAPR_SWJ_CFG ((uint32_t)0x07000000) /*!< SWJ_CFG[2:0] bits (Serial Wire JTAG configuration) */
+#define AFIO_MAPR_SWJ_CFG_0 ((uint32_t)0x01000000) /*!< Bit 0 */
+#define AFIO_MAPR_SWJ_CFG_1 ((uint32_t)0x02000000) /*!< Bit 1 */
+#define AFIO_MAPR_SWJ_CFG_2 ((uint32_t)0x04000000) /*!< Bit 2 */
+
+#define AFIO_MAPR_SWJ_CFG_RESET ((uint32_t)0x00000000) /*!< Full SWJ (JTAG-DP + SW-DP) : Reset State */
+#define AFIO_MAPR_SWJ_CFG_NOJNTRST ((uint32_t)0x01000000) /*!< Full SWJ (JTAG-DP + SW-DP) but without JNTRST */
+#define AFIO_MAPR_SWJ_CFG_JTAGDISABLE ((uint32_t)0x02000000) /*!< JTAG-DP Disabled and SW-DP Enabled */
+#define AFIO_MAPR_SWJ_CFG_DISABLE ((uint32_t)0x04000000) /*!< JTAG-DP Disabled and SW-DP Disabled */
+
+#ifdef STM32F10X_CL
+/*!< ETH_REMAP configuration */
+ #define AFIO_MAPR_ETH_REMAP ((uint32_t)0x00200000) /*!< SPI3_REMAP bit (Ethernet MAC I/O remapping) */
+
+/*!< CAN2_REMAP configuration */
+ #define AFIO_MAPR_CAN2_REMAP ((uint32_t)0x00400000) /*!< CAN2_REMAP bit (CAN2 I/O remapping) */
+
+/*!< MII_RMII_SEL configuration */
+ #define AFIO_MAPR_MII_RMII_SEL ((uint32_t)0x00800000) /*!< MII_RMII_SEL bit (Ethernet MII or RMII selection) */
+
+/*!< SPI3_REMAP configuration */
+ #define AFIO_MAPR_SPI3_REMAP ((uint32_t)0x10000000) /*!< SPI3_REMAP bit (SPI3 remapping) */
+
+/*!< TIM2ITR1_IREMAP configuration */
+ #define AFIO_MAPR_TIM2ITR1_IREMAP ((uint32_t)0x20000000) /*!< TIM2ITR1_IREMAP bit (TIM2 internal trigger 1 remapping) */
+
+/*!< PTP_PPS_REMAP configuration */
+ #define AFIO_MAPR_PTP_PPS_REMAP ((uint32_t)0x40000000) /*!< PTP_PPS_REMAP bit (Ethernet PTP PPS remapping) */
+#endif
+
+/***************** Bit definition for AFIO_EXTICR1 register *****************/
+#define AFIO_EXTICR1_EXTI0 ((uint16_t)0x000F) /*!< EXTI 0 configuration */
+#define AFIO_EXTICR1_EXTI1 ((uint16_t)0x00F0) /*!< EXTI 1 configuration */
+#define AFIO_EXTICR1_EXTI2 ((uint16_t)0x0F00) /*!< EXTI 2 configuration */
+#define AFIO_EXTICR1_EXTI3 ((uint16_t)0xF000) /*!< EXTI 3 configuration */
+
+/*!< EXTI0 configuration */
+#define AFIO_EXTICR1_EXTI0_PA ((uint16_t)0x0000) /*!< PA[0] pin */
+#define AFIO_EXTICR1_EXTI0_PB ((uint16_t)0x0001) /*!< PB[0] pin */
+#define AFIO_EXTICR1_EXTI0_PC ((uint16_t)0x0002) /*!< PC[0] pin */
+#define AFIO_EXTICR1_EXTI0_PD ((uint16_t)0x0003) /*!< PD[0] pin */
+#define AFIO_EXTICR1_EXTI0_PE ((uint16_t)0x0004) /*!< PE[0] pin */
+#define AFIO_EXTICR1_EXTI0_PF ((uint16_t)0x0005) /*!< PF[0] pin */
+#define AFIO_EXTICR1_EXTI0_PG ((uint16_t)0x0006) /*!< PG[0] pin */
+
+/*!< EXTI1 configuration */
+#define AFIO_EXTICR1_EXTI1_PA ((uint16_t)0x0000) /*!< PA[1] pin */
+#define AFIO_EXTICR1_EXTI1_PB ((uint16_t)0x0010) /*!< PB[1] pin */
+#define AFIO_EXTICR1_EXTI1_PC ((uint16_t)0x0020) /*!< PC[1] pin */
+#define AFIO_EXTICR1_EXTI1_PD ((uint16_t)0x0030) /*!< PD[1] pin */
+#define AFIO_EXTICR1_EXTI1_PE ((uint16_t)0x0040) /*!< PE[1] pin */
+#define AFIO_EXTICR1_EXTI1_PF ((uint16_t)0x0050) /*!< PF[1] pin */
+#define AFIO_EXTICR1_EXTI1_PG ((uint16_t)0x0060) /*!< PG[1] pin */
+
+/*!< EXTI2 configuration */
+#define AFIO_EXTICR1_EXTI2_PA ((uint16_t)0x0000) /*!< PA[2] pin */
+#define AFIO_EXTICR1_EXTI2_PB ((uint16_t)0x0100) /*!< PB[2] pin */
+#define AFIO_EXTICR1_EXTI2_PC ((uint16_t)0x0200) /*!< PC[2] pin */
+#define AFIO_EXTICR1_EXTI2_PD ((uint16_t)0x0300) /*!< PD[2] pin */
+#define AFIO_EXTICR1_EXTI2_PE ((uint16_t)0x0400) /*!< PE[2] pin */
+#define AFIO_EXTICR1_EXTI2_PF ((uint16_t)0x0500) /*!< PF[2] pin */
+#define AFIO_EXTICR1_EXTI2_PG ((uint16_t)0x0600) /*!< PG[2] pin */
+
+/*!< EXTI3 configuration */
+#define AFIO_EXTICR1_EXTI3_PA ((uint16_t)0x0000) /*!< PA[3] pin */
+#define AFIO_EXTICR1_EXTI3_PB ((uint16_t)0x1000) /*!< PB[3] pin */
+#define AFIO_EXTICR1_EXTI3_PC ((uint16_t)0x2000) /*!< PC[3] pin */
+#define AFIO_EXTICR1_EXTI3_PD ((uint16_t)0x3000) /*!< PD[3] pin */
+#define AFIO_EXTICR1_EXTI3_PE ((uint16_t)0x4000) /*!< PE[3] pin */
+#define AFIO_EXTICR1_EXTI3_PF ((uint16_t)0x5000) /*!< PF[3] pin */
+#define AFIO_EXTICR1_EXTI3_PG ((uint16_t)0x6000) /*!< PG[3] pin */
+
+/***************** Bit definition for AFIO_EXTICR2 register *****************/
+#define AFIO_EXTICR2_EXTI4 ((uint16_t)0x000F) /*!< EXTI 4 configuration */
+#define AFIO_EXTICR2_EXTI5 ((uint16_t)0x00F0) /*!< EXTI 5 configuration */
+#define AFIO_EXTICR2_EXTI6 ((uint16_t)0x0F00) /*!< EXTI 6 configuration */
+#define AFIO_EXTICR2_EXTI7 ((uint16_t)0xF000) /*!< EXTI 7 configuration */
+
+/*!< EXTI4 configuration */
+#define AFIO_EXTICR2_EXTI4_PA ((uint16_t)0x0000) /*!< PA[4] pin */
+#define AFIO_EXTICR2_EXTI4_PB ((uint16_t)0x0001) /*!< PB[4] pin */
+#define AFIO_EXTICR2_EXTI4_PC ((uint16_t)0x0002) /*!< PC[4] pin */
+#define AFIO_EXTICR2_EXTI4_PD ((uint16_t)0x0003) /*!< PD[4] pin */
+#define AFIO_EXTICR2_EXTI4_PE ((uint16_t)0x0004) /*!< PE[4] pin */
+#define AFIO_EXTICR2_EXTI4_PF ((uint16_t)0x0005) /*!< PF[4] pin */
+#define AFIO_EXTICR2_EXTI4_PG ((uint16_t)0x0006) /*!< PG[4] pin */
+
+/* EXTI5 configuration */
+#define AFIO_EXTICR2_EXTI5_PA ((uint16_t)0x0000) /*!< PA[5] pin */
+#define AFIO_EXTICR2_EXTI5_PB ((uint16_t)0x0010) /*!< PB[5] pin */
+#define AFIO_EXTICR2_EXTI5_PC ((uint16_t)0x0020) /*!< PC[5] pin */
+#define AFIO_EXTICR2_EXTI5_PD ((uint16_t)0x0030) /*!< PD[5] pin */
+#define AFIO_EXTICR2_EXTI5_PE ((uint16_t)0x0040) /*!< PE[5] pin */
+#define AFIO_EXTICR2_EXTI5_PF ((uint16_t)0x0050) /*!< PF[5] pin */
+#define AFIO_EXTICR2_EXTI5_PG ((uint16_t)0x0060) /*!< PG[5] pin */
+
+/*!< EXTI6 configuration */
+#define AFIO_EXTICR2_EXTI6_PA ((uint16_t)0x0000) /*!< PA[6] pin */
+#define AFIO_EXTICR2_EXTI6_PB ((uint16_t)0x0100) /*!< PB[6] pin */
+#define AFIO_EXTICR2_EXTI6_PC ((uint16_t)0x0200) /*!< PC[6] pin */
+#define AFIO_EXTICR2_EXTI6_PD ((uint16_t)0x0300) /*!< PD[6] pin */
+#define AFIO_EXTICR2_EXTI6_PE ((uint16_t)0x0400) /*!< PE[6] pin */
+#define AFIO_EXTICR2_EXTI6_PF ((uint16_t)0x0500) /*!< PF[6] pin */
+#define AFIO_EXTICR2_EXTI6_PG ((uint16_t)0x0600) /*!< PG[6] pin */
+
+/*!< EXTI7 configuration */
+#define AFIO_EXTICR2_EXTI7_PA ((uint16_t)0x0000) /*!< PA[7] pin */
+#define AFIO_EXTICR2_EXTI7_PB ((uint16_t)0x1000) /*!< PB[7] pin */
+#define AFIO_EXTICR2_EXTI7_PC ((uint16_t)0x2000) /*!< PC[7] pin */
+#define AFIO_EXTICR2_EXTI7_PD ((uint16_t)0x3000) /*!< PD[7] pin */
+#define AFIO_EXTICR2_EXTI7_PE ((uint16_t)0x4000) /*!< PE[7] pin */
+#define AFIO_EXTICR2_EXTI7_PF ((uint16_t)0x5000) /*!< PF[7] pin */
+#define AFIO_EXTICR2_EXTI7_PG ((uint16_t)0x6000) /*!< PG[7] pin */
+
+/***************** Bit definition for AFIO_EXTICR3 register *****************/
+#define AFIO_EXTICR3_EXTI8 ((uint16_t)0x000F) /*!< EXTI 8 configuration */
+#define AFIO_EXTICR3_EXTI9 ((uint16_t)0x00F0) /*!< EXTI 9 configuration */
+#define AFIO_EXTICR3_EXTI10 ((uint16_t)0x0F00) /*!< EXTI 10 configuration */
+#define AFIO_EXTICR3_EXTI11 ((uint16_t)0xF000) /*!< EXTI 11 configuration */
+
+/*!< EXTI8 configuration */
+#define AFIO_EXTICR3_EXTI8_PA ((uint16_t)0x0000) /*!< PA[8] pin */
+#define AFIO_EXTICR3_EXTI8_PB ((uint16_t)0x0001) /*!< PB[8] pin */
+#define AFIO_EXTICR3_EXTI8_PC ((uint16_t)0x0002) /*!< PC[8] pin */
+#define AFIO_EXTICR3_EXTI8_PD ((uint16_t)0x0003) /*!< PD[8] pin */
+#define AFIO_EXTICR3_EXTI8_PE ((uint16_t)0x0004) /*!< PE[8] pin */
+#define AFIO_EXTICR3_EXTI8_PF ((uint16_t)0x0005) /*!< PF[8] pin */
+#define AFIO_EXTICR3_EXTI8_PG ((uint16_t)0x0006) /*!< PG[8] pin */
+
+/*!< EXTI9 configuration */
+#define AFIO_EXTICR3_EXTI9_PA ((uint16_t)0x0000) /*!< PA[9] pin */
+#define AFIO_EXTICR3_EXTI9_PB ((uint16_t)0x0010) /*!< PB[9] pin */
+#define AFIO_EXTICR3_EXTI9_PC ((uint16_t)0x0020) /*!< PC[9] pin */
+#define AFIO_EXTICR3_EXTI9_PD ((uint16_t)0x0030) /*!< PD[9] pin */
+#define AFIO_EXTICR3_EXTI9_PE ((uint16_t)0x0040) /*!< PE[9] pin */
+#define AFIO_EXTICR3_EXTI9_PF ((uint16_t)0x0050) /*!< PF[9] pin */
+#define AFIO_EXTICR3_EXTI9_PG ((uint16_t)0x0060) /*!< PG[9] pin */
+
+/*!< EXTI10 configuration */
+#define AFIO_EXTICR3_EXTI10_PA ((uint16_t)0x0000) /*!< PA[10] pin */
+#define AFIO_EXTICR3_EXTI10_PB ((uint16_t)0x0100) /*!< PB[10] pin */
+#define AFIO_EXTICR3_EXTI10_PC ((uint16_t)0x0200) /*!< PC[10] pin */
+#define AFIO_EXTICR3_EXTI10_PD ((uint16_t)0x0300) /*!< PD[10] pin */
+#define AFIO_EXTICR3_EXTI10_PE ((uint16_t)0x0400) /*!< PE[10] pin */
+#define AFIO_EXTICR3_EXTI10_PF ((uint16_t)0x0500) /*!< PF[10] pin */
+#define AFIO_EXTICR3_EXTI10_PG ((uint16_t)0x0600) /*!< PG[10] pin */
+
+/*!< EXTI11 configuration */
+#define AFIO_EXTICR3_EXTI11_PA ((uint16_t)0x0000) /*!< PA[11] pin */
+#define AFIO_EXTICR3_EXTI11_PB ((uint16_t)0x1000) /*!< PB[11] pin */
+#define AFIO_EXTICR3_EXTI11_PC ((uint16_t)0x2000) /*!< PC[11] pin */
+#define AFIO_EXTICR3_EXTI11_PD ((uint16_t)0x3000) /*!< PD[11] pin */
+#define AFIO_EXTICR3_EXTI11_PE ((uint16_t)0x4000) /*!< PE[11] pin */
+#define AFIO_EXTICR3_EXTI11_PF ((uint16_t)0x5000) /*!< PF[11] pin */
+#define AFIO_EXTICR3_EXTI11_PG ((uint16_t)0x6000) /*!< PG[11] pin */
+
+/***************** Bit definition for AFIO_EXTICR4 register *****************/
+#define AFIO_EXTICR4_EXTI12 ((uint16_t)0x000F) /*!< EXTI 12 configuration */
+#define AFIO_EXTICR4_EXTI13 ((uint16_t)0x00F0) /*!< EXTI 13 configuration */
+#define AFIO_EXTICR4_EXTI14 ((uint16_t)0x0F00) /*!< EXTI 14 configuration */
+#define AFIO_EXTICR4_EXTI15 ((uint16_t)0xF000) /*!< EXTI 15 configuration */
+
+/* EXTI12 configuration */
+#define AFIO_EXTICR4_EXTI12_PA ((uint16_t)0x0000) /*!< PA[12] pin */
+#define AFIO_EXTICR4_EXTI12_PB ((uint16_t)0x0001) /*!< PB[12] pin */
+#define AFIO_EXTICR4_EXTI12_PC ((uint16_t)0x0002) /*!< PC[12] pin */
+#define AFIO_EXTICR4_EXTI12_PD ((uint16_t)0x0003) /*!< PD[12] pin */
+#define AFIO_EXTICR4_EXTI12_PE ((uint16_t)0x0004) /*!< PE[12] pin */
+#define AFIO_EXTICR4_EXTI12_PF ((uint16_t)0x0005) /*!< PF[12] pin */
+#define AFIO_EXTICR4_EXTI12_PG ((uint16_t)0x0006) /*!< PG[12] pin */
+
+/* EXTI13 configuration */
+#define AFIO_EXTICR4_EXTI13_PA ((uint16_t)0x0000) /*!< PA[13] pin */
+#define AFIO_EXTICR4_EXTI13_PB ((uint16_t)0x0010) /*!< PB[13] pin */
+#define AFIO_EXTICR4_EXTI13_PC ((uint16_t)0x0020) /*!< PC[13] pin */
+#define AFIO_EXTICR4_EXTI13_PD ((uint16_t)0x0030) /*!< PD[13] pin */
+#define AFIO_EXTICR4_EXTI13_PE ((uint16_t)0x0040) /*!< PE[13] pin */
+#define AFIO_EXTICR4_EXTI13_PF ((uint16_t)0x0050) /*!< PF[13] pin */
+#define AFIO_EXTICR4_EXTI13_PG ((uint16_t)0x0060) /*!< PG[13] pin */
+
+/*!< EXTI14 configuration */
+#define AFIO_EXTICR4_EXTI14_PA ((uint16_t)0x0000) /*!< PA[14] pin */
+#define AFIO_EXTICR4_EXTI14_PB ((uint16_t)0x0100) /*!< PB[14] pin */
+#define AFIO_EXTICR4_EXTI14_PC ((uint16_t)0x0200) /*!< PC[14] pin */
+#define AFIO_EXTICR4_EXTI14_PD ((uint16_t)0x0300) /*!< PD[14] pin */
+#define AFIO_EXTICR4_EXTI14_PE ((uint16_t)0x0400) /*!< PE[14] pin */
+#define AFIO_EXTICR4_EXTI14_PF ((uint16_t)0x0500) /*!< PF[14] pin */
+#define AFIO_EXTICR4_EXTI14_PG ((uint16_t)0x0600) /*!< PG[14] pin */
+
+/*!< EXTI15 configuration */
+#define AFIO_EXTICR4_EXTI15_PA ((uint16_t)0x0000) /*!< PA[15] pin */
+#define AFIO_EXTICR4_EXTI15_PB ((uint16_t)0x1000) /*!< PB[15] pin */
+#define AFIO_EXTICR4_EXTI15_PC ((uint16_t)0x2000) /*!< PC[15] pin */
+#define AFIO_EXTICR4_EXTI15_PD ((uint16_t)0x3000) /*!< PD[15] pin */
+#define AFIO_EXTICR4_EXTI15_PE ((uint16_t)0x4000) /*!< PE[15] pin */
+#define AFIO_EXTICR4_EXTI15_PF ((uint16_t)0x5000) /*!< PF[15] pin */
+#define AFIO_EXTICR4_EXTI15_PG ((uint16_t)0x6000) /*!< PG[15] pin */
+
+#if defined (STM32F10X_LD_VL) || defined (STM32F10X_MD_VL) || defined (STM32F10X_HD_VL)
+/****************** Bit definition for AFIO_MAPR2 register ******************/
+#define AFIO_MAPR2_TIM15_REMAP ((uint32_t)0x00000001) /*!< TIM15 remapping */
+#define AFIO_MAPR2_TIM16_REMAP ((uint32_t)0x00000002) /*!< TIM16 remapping */
+#define AFIO_MAPR2_TIM17_REMAP ((uint32_t)0x00000004) /*!< TIM17 remapping */
+#define AFIO_MAPR2_CEC_REMAP ((uint32_t)0x00000008) /*!< CEC remapping */
+#define AFIO_MAPR2_TIM1_DMA_REMAP ((uint32_t)0x00000010) /*!< TIM1_DMA remapping */
+#endif
+
+#ifdef STM32F10X_HD_VL
+#define AFIO_MAPR2_TIM13_REMAP ((uint32_t)0x00000100) /*!< TIM13 remapping */
+#define AFIO_MAPR2_TIM14_REMAP ((uint32_t)0x00000200) /*!< TIM14 remapping */
+#define AFIO_MAPR2_FSMC_NADV_REMAP ((uint32_t)0x00000400) /*!< FSMC NADV remapping */
+#define AFIO_MAPR2_TIM67_DAC_DMA_REMAP ((uint32_t)0x00000800) /*!< TIM6/TIM7 and DAC DMA remapping */
+#define AFIO_MAPR2_TIM12_REMAP ((uint32_t)0x00001000) /*!< TIM12 remapping */
+#define AFIO_MAPR2_MISC_REMAP ((uint32_t)0x00002000) /*!< Miscellaneous remapping */
+#endif
+
+#ifdef STM32F10X_XL
+/****************** Bit definition for AFIO_MAPR2 register ******************/
+#define AFIO_MAPR2_TIM9_REMAP ((uint32_t)0x00000020) /*!< TIM9 remapping */
+#define AFIO_MAPR2_TIM10_REMAP ((uint32_t)0x00000040) /*!< TIM10 remapping */
+#define AFIO_MAPR2_TIM11_REMAP ((uint32_t)0x00000080) /*!< TIM11 remapping */
+#define AFIO_MAPR2_TIM13_REMAP ((uint32_t)0x00000100) /*!< TIM13 remapping */
+#define AFIO_MAPR2_TIM14_REMAP ((uint32_t)0x00000200) /*!< TIM14 remapping */
+#define AFIO_MAPR2_FSMC_NADV_REMAP ((uint32_t)0x00000400) /*!< FSMC NADV remapping */
+#endif
+
+/******************************************************************************/
+/* */
+/* SystemTick */
+/* */
+/******************************************************************************/
+
+/***************** Bit definition for SysTick_CTRL register *****************/
+#define SysTick_CTRL_ENABLE ((uint32_t)0x00000001) /*!< Counter enable */
+#define SysTick_CTRL_TICKINT ((uint32_t)0x00000002) /*!< Counting down to 0 pends the SysTick handler */
+#define SysTick_CTRL_CLKSOURCE ((uint32_t)0x00000004) /*!< Clock source */
+#define SysTick_CTRL_COUNTFLAG ((uint32_t)0x00010000) /*!< Count Flag */
+
+/***************** Bit definition for SysTick_LOAD register *****************/
+#define SysTick_LOAD_RELOAD ((uint32_t)0x00FFFFFF) /*!< Value to load into the SysTick Current Value Register when the counter reaches 0 */
+
+/***************** Bit definition for SysTick_VAL register ******************/
+#define SysTick_VAL_CURRENT ((uint32_t)0x00FFFFFF) /*!< Current value at the time the register is accessed */
+
+/***************** Bit definition for SysTick_CALIB register ****************/
+#define SysTick_CALIB_TENMS ((uint32_t)0x00FFFFFF) /*!< Reload value to use for 10ms timing */
+#define SysTick_CALIB_SKEW ((uint32_t)0x40000000) /*!< Calibration value is not exactly 10 ms */
+#define SysTick_CALIB_NOREF ((uint32_t)0x80000000) /*!< The reference clock is not provided */
+
+/******************************************************************************/
+/* */
+/* Nested Vectored Interrupt Controller */
+/* */
+/******************************************************************************/
+
+/****************** Bit definition for NVIC_ISER register *******************/
+#define NVIC_ISER_SETENA ((uint32_t)0xFFFFFFFF) /*!< Interrupt set enable bits */
+#define NVIC_ISER_SETENA_0 ((uint32_t)0x00000001) /*!< bit 0 */
+#define NVIC_ISER_SETENA_1 ((uint32_t)0x00000002) /*!< bit 1 */
+#define NVIC_ISER_SETENA_2 ((uint32_t)0x00000004) /*!< bit 2 */
+#define NVIC_ISER_SETENA_3 ((uint32_t)0x00000008) /*!< bit 3 */
+#define NVIC_ISER_SETENA_4 ((uint32_t)0x00000010) /*!< bit 4 */
+#define NVIC_ISER_SETENA_5 ((uint32_t)0x00000020) /*!< bit 5 */
+#define NVIC_ISER_SETENA_6 ((uint32_t)0x00000040) /*!< bit 6 */
+#define NVIC_ISER_SETENA_7 ((uint32_t)0x00000080) /*!< bit 7 */
+#define NVIC_ISER_SETENA_8 ((uint32_t)0x00000100) /*!< bit 8 */
+#define NVIC_ISER_SETENA_9 ((uint32_t)0x00000200) /*!< bit 9 */
+#define NVIC_ISER_SETENA_10 ((uint32_t)0x00000400) /*!< bit 10 */
+#define NVIC_ISER_SETENA_11 ((uint32_t)0x00000800) /*!< bit 11 */
+#define NVIC_ISER_SETENA_12 ((uint32_t)0x00001000) /*!< bit 12 */
+#define NVIC_ISER_SETENA_13 ((uint32_t)0x00002000) /*!< bit 13 */
+#define NVIC_ISER_SETENA_14 ((uint32_t)0x00004000) /*!< bit 14 */
+#define NVIC_ISER_SETENA_15 ((uint32_t)0x00008000) /*!< bit 15 */
+#define NVIC_ISER_SETENA_16 ((uint32_t)0x00010000) /*!< bit 16 */
+#define NVIC_ISER_SETENA_17 ((uint32_t)0x00020000) /*!< bit 17 */
+#define NVIC_ISER_SETENA_18 ((uint32_t)0x00040000) /*!< bit 18 */
+#define NVIC_ISER_SETENA_19 ((uint32_t)0x00080000) /*!< bit 19 */
+#define NVIC_ISER_SETENA_20 ((uint32_t)0x00100000) /*!< bit 20 */
+#define NVIC_ISER_SETENA_21 ((uint32_t)0x00200000) /*!< bit 21 */
+#define NVIC_ISER_SETENA_22 ((uint32_t)0x00400000) /*!< bit 22 */
+#define NVIC_ISER_SETENA_23 ((uint32_t)0x00800000) /*!< bit 23 */
+#define NVIC_ISER_SETENA_24 ((uint32_t)0x01000000) /*!< bit 24 */
+#define NVIC_ISER_SETENA_25 ((uint32_t)0x02000000) /*!< bit 25 */
+#define NVIC_ISER_SETENA_26 ((uint32_t)0x04000000) /*!< bit 26 */
+#define NVIC_ISER_SETENA_27 ((uint32_t)0x08000000) /*!< bit 27 */
+#define NVIC_ISER_SETENA_28 ((uint32_t)0x10000000) /*!< bit 28 */
+#define NVIC_ISER_SETENA_29 ((uint32_t)0x20000000) /*!< bit 29 */
+#define NVIC_ISER_SETENA_30 ((uint32_t)0x40000000) /*!< bit 30 */
+#define NVIC_ISER_SETENA_31 ((uint32_t)0x80000000) /*!< bit 31 */
+
+/****************** Bit definition for NVIC_ICER register *******************/
+#define NVIC_ICER_CLRENA ((uint32_t)0xFFFFFFFF) /*!< Interrupt clear-enable bits */
+#define NVIC_ICER_CLRENA_0 ((uint32_t)0x00000001) /*!< bit 0 */
+#define NVIC_ICER_CLRENA_1 ((uint32_t)0x00000002) /*!< bit 1 */
+#define NVIC_ICER_CLRENA_2 ((uint32_t)0x00000004) /*!< bit 2 */
+#define NVIC_ICER_CLRENA_3 ((uint32_t)0x00000008) /*!< bit 3 */
+#define NVIC_ICER_CLRENA_4 ((uint32_t)0x00000010) /*!< bit 4 */
+#define NVIC_ICER_CLRENA_5 ((uint32_t)0x00000020) /*!< bit 5 */
+#define NVIC_ICER_CLRENA_6 ((uint32_t)0x00000040) /*!< bit 6 */
+#define NVIC_ICER_CLRENA_7 ((uint32_t)0x00000080) /*!< bit 7 */
+#define NVIC_ICER_CLRENA_8 ((uint32_t)0x00000100) /*!< bit 8 */
+#define NVIC_ICER_CLRENA_9 ((uint32_t)0x00000200) /*!< bit 9 */
+#define NVIC_ICER_CLRENA_10 ((uint32_t)0x00000400) /*!< bit 10 */
+#define NVIC_ICER_CLRENA_11 ((uint32_t)0x00000800) /*!< bit 11 */
+#define NVIC_ICER_CLRENA_12 ((uint32_t)0x00001000) /*!< bit 12 */
+#define NVIC_ICER_CLRENA_13 ((uint32_t)0x00002000) /*!< bit 13 */
+#define NVIC_ICER_CLRENA_14 ((uint32_t)0x00004000) /*!< bit 14 */
+#define NVIC_ICER_CLRENA_15 ((uint32_t)0x00008000) /*!< bit 15 */
+#define NVIC_ICER_CLRENA_16 ((uint32_t)0x00010000) /*!< bit 16 */
+#define NVIC_ICER_CLRENA_17 ((uint32_t)0x00020000) /*!< bit 17 */
+#define NVIC_ICER_CLRENA_18 ((uint32_t)0x00040000) /*!< bit 18 */
+#define NVIC_ICER_CLRENA_19 ((uint32_t)0x00080000) /*!< bit 19 */
+#define NVIC_ICER_CLRENA_20 ((uint32_t)0x00100000) /*!< bit 20 */
+#define NVIC_ICER_CLRENA_21 ((uint32_t)0x00200000) /*!< bit 21 */
+#define NVIC_ICER_CLRENA_22 ((uint32_t)0x00400000) /*!< bit 22 */
+#define NVIC_ICER_CLRENA_23 ((uint32_t)0x00800000) /*!< bit 23 */
+#define NVIC_ICER_CLRENA_24 ((uint32_t)0x01000000) /*!< bit 24 */
+#define NVIC_ICER_CLRENA_25 ((uint32_t)0x02000000) /*!< bit 25 */
+#define NVIC_ICER_CLRENA_26 ((uint32_t)0x04000000) /*!< bit 26 */
+#define NVIC_ICER_CLRENA_27 ((uint32_t)0x08000000) /*!< bit 27 */
+#define NVIC_ICER_CLRENA_28 ((uint32_t)0x10000000) /*!< bit 28 */
+#define NVIC_ICER_CLRENA_29 ((uint32_t)0x20000000) /*!< bit 29 */
+#define NVIC_ICER_CLRENA_30 ((uint32_t)0x40000000) /*!< bit 30 */
+#define NVIC_ICER_CLRENA_31 ((uint32_t)0x80000000) /*!< bit 31 */
+
+/****************** Bit definition for NVIC_ISPR register *******************/
+#define NVIC_ISPR_SETPEND ((uint32_t)0xFFFFFFFF) /*!< Interrupt set-pending bits */
+#define NVIC_ISPR_SETPEND_0 ((uint32_t)0x00000001) /*!< bit 0 */
+#define NVIC_ISPR_SETPEND_1 ((uint32_t)0x00000002) /*!< bit 1 */
+#define NVIC_ISPR_SETPEND_2 ((uint32_t)0x00000004) /*!< bit 2 */
+#define NVIC_ISPR_SETPEND_3 ((uint32_t)0x00000008) /*!< bit 3 */
+#define NVIC_ISPR_SETPEND_4 ((uint32_t)0x00000010) /*!< bit 4 */
+#define NVIC_ISPR_SETPEND_5 ((uint32_t)0x00000020) /*!< bit 5 */
+#define NVIC_ISPR_SETPEND_6 ((uint32_t)0x00000040) /*!< bit 6 */
+#define NVIC_ISPR_SETPEND_7 ((uint32_t)0x00000080) /*!< bit 7 */
+#define NVIC_ISPR_SETPEND_8 ((uint32_t)0x00000100) /*!< bit 8 */
+#define NVIC_ISPR_SETPEND_9 ((uint32_t)0x00000200) /*!< bit 9 */
+#define NVIC_ISPR_SETPEND_10 ((uint32_t)0x00000400) /*!< bit 10 */
+#define NVIC_ISPR_SETPEND_11 ((uint32_t)0x00000800) /*!< bit 11 */
+#define NVIC_ISPR_SETPEND_12 ((uint32_t)0x00001000) /*!< bit 12 */
+#define NVIC_ISPR_SETPEND_13 ((uint32_t)0x00002000) /*!< bit 13 */
+#define NVIC_ISPR_SETPEND_14 ((uint32_t)0x00004000) /*!< bit 14 */
+#define NVIC_ISPR_SETPEND_15 ((uint32_t)0x00008000) /*!< bit 15 */
+#define NVIC_ISPR_SETPEND_16 ((uint32_t)0x00010000) /*!< bit 16 */
+#define NVIC_ISPR_SETPEND_17 ((uint32_t)0x00020000) /*!< bit 17 */
+#define NVIC_ISPR_SETPEND_18 ((uint32_t)0x00040000) /*!< bit 18 */
+#define NVIC_ISPR_SETPEND_19 ((uint32_t)0x00080000) /*!< bit 19 */
+#define NVIC_ISPR_SETPEND_20 ((uint32_t)0x00100000) /*!< bit 20 */
+#define NVIC_ISPR_SETPEND_21 ((uint32_t)0x00200000) /*!< bit 21 */
+#define NVIC_ISPR_SETPEND_22 ((uint32_t)0x00400000) /*!< bit 22 */
+#define NVIC_ISPR_SETPEND_23 ((uint32_t)0x00800000) /*!< bit 23 */
+#define NVIC_ISPR_SETPEND_24 ((uint32_t)0x01000000) /*!< bit 24 */
+#define NVIC_ISPR_SETPEND_25 ((uint32_t)0x02000000) /*!< bit 25 */
+#define NVIC_ISPR_SETPEND_26 ((uint32_t)0x04000000) /*!< bit 26 */
+#define NVIC_ISPR_SETPEND_27 ((uint32_t)0x08000000) /*!< bit 27 */
+#define NVIC_ISPR_SETPEND_28 ((uint32_t)0x10000000) /*!< bit 28 */
+#define NVIC_ISPR_SETPEND_29 ((uint32_t)0x20000000) /*!< bit 29 */
+#define NVIC_ISPR_SETPEND_30 ((uint32_t)0x40000000) /*!< bit 30 */
+#define NVIC_ISPR_SETPEND_31 ((uint32_t)0x80000000) /*!< bit 31 */
+
+/****************** Bit definition for NVIC_ICPR register *******************/
+#define NVIC_ICPR_CLRPEND ((uint32_t)0xFFFFFFFF) /*!< Interrupt clear-pending bits */
+#define NVIC_ICPR_CLRPEND_0 ((uint32_t)0x00000001) /*!< bit 0 */
+#define NVIC_ICPR_CLRPEND_1 ((uint32_t)0x00000002) /*!< bit 1 */
+#define NVIC_ICPR_CLRPEND_2 ((uint32_t)0x00000004) /*!< bit 2 */
+#define NVIC_ICPR_CLRPEND_3 ((uint32_t)0x00000008) /*!< bit 3 */
+#define NVIC_ICPR_CLRPEND_4 ((uint32_t)0x00000010) /*!< bit 4 */
+#define NVIC_ICPR_CLRPEND_5 ((uint32_t)0x00000020) /*!< bit 5 */
+#define NVIC_ICPR_CLRPEND_6 ((uint32_t)0x00000040) /*!< bit 6 */
+#define NVIC_ICPR_CLRPEND_7 ((uint32_t)0x00000080) /*!< bit 7 */
+#define NVIC_ICPR_CLRPEND_8 ((uint32_t)0x00000100) /*!< bit 8 */
+#define NVIC_ICPR_CLRPEND_9 ((uint32_t)0x00000200) /*!< bit 9 */
+#define NVIC_ICPR_CLRPEND_10 ((uint32_t)0x00000400) /*!< bit 10 */
+#define NVIC_ICPR_CLRPEND_11 ((uint32_t)0x00000800) /*!< bit 11 */
+#define NVIC_ICPR_CLRPEND_12 ((uint32_t)0x00001000) /*!< bit 12 */
+#define NVIC_ICPR_CLRPEND_13 ((uint32_t)0x00002000) /*!< bit 13 */
+#define NVIC_ICPR_CLRPEND_14 ((uint32_t)0x00004000) /*!< bit 14 */
+#define NVIC_ICPR_CLRPEND_15 ((uint32_t)0x00008000) /*!< bit 15 */
+#define NVIC_ICPR_CLRPEND_16 ((uint32_t)0x00010000) /*!< bit 16 */
+#define NVIC_ICPR_CLRPEND_17 ((uint32_t)0x00020000) /*!< bit 17 */
+#define NVIC_ICPR_CLRPEND_18 ((uint32_t)0x00040000) /*!< bit 18 */
+#define NVIC_ICPR_CLRPEND_19 ((uint32_t)0x00080000) /*!< bit 19 */
+#define NVIC_ICPR_CLRPEND_20 ((uint32_t)0x00100000) /*!< bit 20 */
+#define NVIC_ICPR_CLRPEND_21 ((uint32_t)0x00200000) /*!< bit 21 */
+#define NVIC_ICPR_CLRPEND_22 ((uint32_t)0x00400000) /*!< bit 22 */
+#define NVIC_ICPR_CLRPEND_23 ((uint32_t)0x00800000) /*!< bit 23 */
+#define NVIC_ICPR_CLRPEND_24 ((uint32_t)0x01000000) /*!< bit 24 */
+#define NVIC_ICPR_CLRPEND_25 ((uint32_t)0x02000000) /*!< bit 25 */
+#define NVIC_ICPR_CLRPEND_26 ((uint32_t)0x04000000) /*!< bit 26 */
+#define NVIC_ICPR_CLRPEND_27 ((uint32_t)0x08000000) /*!< bit 27 */
+#define NVIC_ICPR_CLRPEND_28 ((uint32_t)0x10000000) /*!< bit 28 */
+#define NVIC_ICPR_CLRPEND_29 ((uint32_t)0x20000000) /*!< bit 29 */
+#define NVIC_ICPR_CLRPEND_30 ((uint32_t)0x40000000) /*!< bit 30 */
+#define NVIC_ICPR_CLRPEND_31 ((uint32_t)0x80000000) /*!< bit 31 */
+
+/****************** Bit definition for NVIC_IABR register *******************/
+#define NVIC_IABR_ACTIVE ((uint32_t)0xFFFFFFFF) /*!< Interrupt active flags */
+#define NVIC_IABR_ACTIVE_0 ((uint32_t)0x00000001) /*!< bit 0 */
+#define NVIC_IABR_ACTIVE_1 ((uint32_t)0x00000002) /*!< bit 1 */
+#define NVIC_IABR_ACTIVE_2 ((uint32_t)0x00000004) /*!< bit 2 */
+#define NVIC_IABR_ACTIVE_3 ((uint32_t)0x00000008) /*!< bit 3 */
+#define NVIC_IABR_ACTIVE_4 ((uint32_t)0x00000010) /*!< bit 4 */
+#define NVIC_IABR_ACTIVE_5 ((uint32_t)0x00000020) /*!< bit 5 */
+#define NVIC_IABR_ACTIVE_6 ((uint32_t)0x00000040) /*!< bit 6 */
+#define NVIC_IABR_ACTIVE_7 ((uint32_t)0x00000080) /*!< bit 7 */
+#define NVIC_IABR_ACTIVE_8 ((uint32_t)0x00000100) /*!< bit 8 */
+#define NVIC_IABR_ACTIVE_9 ((uint32_t)0x00000200) /*!< bit 9 */
+#define NVIC_IABR_ACTIVE_10 ((uint32_t)0x00000400) /*!< bit 10 */
+#define NVIC_IABR_ACTIVE_11 ((uint32_t)0x00000800) /*!< bit 11 */
+#define NVIC_IABR_ACTIVE_12 ((uint32_t)0x00001000) /*!< bit 12 */
+#define NVIC_IABR_ACTIVE_13 ((uint32_t)0x00002000) /*!< bit 13 */
+#define NVIC_IABR_ACTIVE_14 ((uint32_t)0x00004000) /*!< bit 14 */
+#define NVIC_IABR_ACTIVE_15 ((uint32_t)0x00008000) /*!< bit 15 */
+#define NVIC_IABR_ACTIVE_16 ((uint32_t)0x00010000) /*!< bit 16 */
+#define NVIC_IABR_ACTIVE_17 ((uint32_t)0x00020000) /*!< bit 17 */
+#define NVIC_IABR_ACTIVE_18 ((uint32_t)0x00040000) /*!< bit 18 */
+#define NVIC_IABR_ACTIVE_19 ((uint32_t)0x00080000) /*!< bit 19 */
+#define NVIC_IABR_ACTIVE_20 ((uint32_t)0x00100000) /*!< bit 20 */
+#define NVIC_IABR_ACTIVE_21 ((uint32_t)0x00200000) /*!< bit 21 */
+#define NVIC_IABR_ACTIVE_22 ((uint32_t)0x00400000) /*!< bit 22 */
+#define NVIC_IABR_ACTIVE_23 ((uint32_t)0x00800000) /*!< bit 23 */
+#define NVIC_IABR_ACTIVE_24 ((uint32_t)0x01000000) /*!< bit 24 */
+#define NVIC_IABR_ACTIVE_25 ((uint32_t)0x02000000) /*!< bit 25 */
+#define NVIC_IABR_ACTIVE_26 ((uint32_t)0x04000000) /*!< bit 26 */
+#define NVIC_IABR_ACTIVE_27 ((uint32_t)0x08000000) /*!< bit 27 */
+#define NVIC_IABR_ACTIVE_28 ((uint32_t)0x10000000) /*!< bit 28 */
+#define NVIC_IABR_ACTIVE_29 ((uint32_t)0x20000000) /*!< bit 29 */
+#define NVIC_IABR_ACTIVE_30 ((uint32_t)0x40000000) /*!< bit 30 */
+#define NVIC_IABR_ACTIVE_31 ((uint32_t)0x80000000) /*!< bit 31 */
+
+/****************** Bit definition for NVIC_PRI0 register *******************/
+#define NVIC_IPR0_PRI_0 ((uint32_t)0x000000FF) /*!< Priority of interrupt 0 */
+#define NVIC_IPR0_PRI_1 ((uint32_t)0x0000FF00) /*!< Priority of interrupt 1 */
+#define NVIC_IPR0_PRI_2 ((uint32_t)0x00FF0000) /*!< Priority of interrupt 2 */
+#define NVIC_IPR0_PRI_3 ((uint32_t)0xFF000000) /*!< Priority of interrupt 3 */
+
+/****************** Bit definition for NVIC_PRI1 register *******************/
+#define NVIC_IPR1_PRI_4 ((uint32_t)0x000000FF) /*!< Priority of interrupt 4 */
+#define NVIC_IPR1_PRI_5 ((uint32_t)0x0000FF00) /*!< Priority of interrupt 5 */
+#define NVIC_IPR1_PRI_6 ((uint32_t)0x00FF0000) /*!< Priority of interrupt 6 */
+#define NVIC_IPR1_PRI_7 ((uint32_t)0xFF000000) /*!< Priority of interrupt 7 */
+
+/****************** Bit definition for NVIC_PRI2 register *******************/
+#define NVIC_IPR2_PRI_8 ((uint32_t)0x000000FF) /*!< Priority of interrupt 8 */
+#define NVIC_IPR2_PRI_9 ((uint32_t)0x0000FF00) /*!< Priority of interrupt 9 */
+#define NVIC_IPR2_PRI_10 ((uint32_t)0x00FF0000) /*!< Priority of interrupt 10 */
+#define NVIC_IPR2_PRI_11 ((uint32_t)0xFF000000) /*!< Priority of interrupt 11 */
+
+/****************** Bit definition for NVIC_PRI3 register *******************/
+#define NVIC_IPR3_PRI_12 ((uint32_t)0x000000FF) /*!< Priority of interrupt 12 */
+#define NVIC_IPR3_PRI_13 ((uint32_t)0x0000FF00) /*!< Priority of interrupt 13 */
+#define NVIC_IPR3_PRI_14 ((uint32_t)0x00FF0000) /*!< Priority of interrupt 14 */
+#define NVIC_IPR3_PRI_15 ((uint32_t)0xFF000000) /*!< Priority of interrupt 15 */
+
+/****************** Bit definition for NVIC_PRI4 register *******************/
+#define NVIC_IPR4_PRI_16 ((uint32_t)0x000000FF) /*!< Priority of interrupt 16 */
+#define NVIC_IPR4_PRI_17 ((uint32_t)0x0000FF00) /*!< Priority of interrupt 17 */
+#define NVIC_IPR4_PRI_18 ((uint32_t)0x00FF0000) /*!< Priority of interrupt 18 */
+#define NVIC_IPR4_PRI_19 ((uint32_t)0xFF000000) /*!< Priority of interrupt 19 */
+
+/****************** Bit definition for NVIC_PRI5 register *******************/
+#define NVIC_IPR5_PRI_20 ((uint32_t)0x000000FF) /*!< Priority of interrupt 20 */
+#define NVIC_IPR5_PRI_21 ((uint32_t)0x0000FF00) /*!< Priority of interrupt 21 */
+#define NVIC_IPR5_PRI_22 ((uint32_t)0x00FF0000) /*!< Priority of interrupt 22 */
+#define NVIC_IPR5_PRI_23 ((uint32_t)0xFF000000) /*!< Priority of interrupt 23 */
+
+/****************** Bit definition for NVIC_PRI6 register *******************/
+#define NVIC_IPR6_PRI_24 ((uint32_t)0x000000FF) /*!< Priority of interrupt 24 */
+#define NVIC_IPR6_PRI_25 ((uint32_t)0x0000FF00) /*!< Priority of interrupt 25 */
+#define NVIC_IPR6_PRI_26 ((uint32_t)0x00FF0000) /*!< Priority of interrupt 26 */
+#define NVIC_IPR6_PRI_27 ((uint32_t)0xFF000000) /*!< Priority of interrupt 27 */
+
+/****************** Bit definition for NVIC_PRI7 register *******************/
+#define NVIC_IPR7_PRI_28 ((uint32_t)0x000000FF) /*!< Priority of interrupt 28 */
+#define NVIC_IPR7_PRI_29 ((uint32_t)0x0000FF00) /*!< Priority of interrupt 29 */
+#define NVIC_IPR7_PRI_30 ((uint32_t)0x00FF0000) /*!< Priority of interrupt 30 */
+#define NVIC_IPR7_PRI_31 ((uint32_t)0xFF000000) /*!< Priority of interrupt 31 */
+
+/****************** Bit definition for SCB_CPUID register *******************/
+#define SCB_CPUID_REVISION ((uint32_t)0x0000000F) /*!< Implementation defined revision number */
+#define SCB_CPUID_PARTNO ((uint32_t)0x0000FFF0) /*!< Number of processor within family */
+#define SCB_CPUID_Constant ((uint32_t)0x000F0000) /*!< Reads as 0x0F */
+#define SCB_CPUID_VARIANT ((uint32_t)0x00F00000) /*!< Implementation defined variant number */
+#define SCB_CPUID_IMPLEMENTER ((uint32_t)0xFF000000) /*!< Implementer code. ARM is 0x41 */
+
+/******************* Bit definition for SCB_ICSR register *******************/
+#define SCB_ICSR_VECTACTIVE ((uint32_t)0x000001FF) /*!< Active ISR number field */
+#define SCB_ICSR_RETTOBASE ((uint32_t)0x00000800) /*!< All active exceptions minus the IPSR_current_exception yields the empty set */
+#define SCB_ICSR_VECTPENDING ((uint32_t)0x003FF000) /*!< Pending ISR number field */
+#define SCB_ICSR_ISRPENDING ((uint32_t)0x00400000) /*!< Interrupt pending flag */
+#define SCB_ICSR_ISRPREEMPT ((uint32_t)0x00800000) /*!< It indicates that a pending interrupt becomes active in the next running cycle */
+#define SCB_ICSR_PENDSTCLR ((uint32_t)0x02000000) /*!< Clear pending SysTick bit */
+#define SCB_ICSR_PENDSTSET ((uint32_t)0x04000000) /*!< Set pending SysTick bit */
+#define SCB_ICSR_PENDSVCLR ((uint32_t)0x08000000) /*!< Clear pending pendSV bit */
+#define SCB_ICSR_PENDSVSET ((uint32_t)0x10000000) /*!< Set pending pendSV bit */
+#define SCB_ICSR_NMIPENDSET ((uint32_t)0x80000000) /*!< Set pending NMI bit */
+
+/******************* Bit definition for SCB_VTOR register *******************/
+#define SCB_VTOR_TBLOFF ((uint32_t)0x1FFFFF80) /*!< Vector table base offset field */
+#define SCB_VTOR_TBLBASE ((uint32_t)0x20000000) /*!< Table base in code(0) or RAM(1) */
+
+/*!<***************** Bit definition for SCB_AIRCR register *******************/
+#define SCB_AIRCR_VECTRESET ((uint32_t)0x00000001) /*!< System Reset bit */
+#define SCB_AIRCR_VECTCLRACTIVE ((uint32_t)0x00000002) /*!< Clear active vector bit */
+#define SCB_AIRCR_SYSRESETREQ ((uint32_t)0x00000004) /*!< Requests chip control logic to generate a reset */
+
+#define SCB_AIRCR_PRIGROUP ((uint32_t)0x00000700) /*!< PRIGROUP[2:0] bits (Priority group) */
+#define SCB_AIRCR_PRIGROUP_0 ((uint32_t)0x00000100) /*!< Bit 0 */
+#define SCB_AIRCR_PRIGROUP_1 ((uint32_t)0x00000200) /*!< Bit 1 */
+#define SCB_AIRCR_PRIGROUP_2 ((uint32_t)0x00000400) /*!< Bit 2 */
+
+/* prority group configuration */
+#define SCB_AIRCR_PRIGROUP0 ((uint32_t)0x00000000) /*!< Priority group=0 (7 bits of pre-emption priority, 1 bit of subpriority) */
+#define SCB_AIRCR_PRIGROUP1 ((uint32_t)0x00000100) /*!< Priority group=1 (6 bits of pre-emption priority, 2 bits of subpriority) */
+#define SCB_AIRCR_PRIGROUP2 ((uint32_t)0x00000200) /*!< Priority group=2 (5 bits of pre-emption priority, 3 bits of subpriority) */
+#define SCB_AIRCR_PRIGROUP3 ((uint32_t)0x00000300) /*!< Priority group=3 (4 bits of pre-emption priority, 4 bits of subpriority) */
+#define SCB_AIRCR_PRIGROUP4 ((uint32_t)0x00000400) /*!< Priority group=4 (3 bits of pre-emption priority, 5 bits of subpriority) */
+#define SCB_AIRCR_PRIGROUP5 ((uint32_t)0x00000500) /*!< Priority group=5 (2 bits of pre-emption priority, 6 bits of subpriority) */
+#define SCB_AIRCR_PRIGROUP6 ((uint32_t)0x00000600) /*!< Priority group=6 (1 bit of pre-emption priority, 7 bits of subpriority) */
+#define SCB_AIRCR_PRIGROUP7 ((uint32_t)0x00000700) /*!< Priority group=7 (no pre-emption priority, 8 bits of subpriority) */
+
+#define SCB_AIRCR_ENDIANESS ((uint32_t)0x00008000) /*!< Data endianness bit */
+#define SCB_AIRCR_VECTKEY ((uint32_t)0xFFFF0000) /*!< Register key (VECTKEY) - Reads as 0xFA05 (VECTKEYSTAT) */
+
+/******************* Bit definition for SCB_SCR register ********************/
+#define SCB_SCR_SLEEPONEXIT ((uint8_t)0x02) /*!< Sleep on exit bit */
+#define SCB_SCR_SLEEPDEEP ((uint8_t)0x04) /*!< Sleep deep bit */
+#define SCB_SCR_SEVONPEND ((uint8_t)0x10) /*!< Wake up from WFE */
+
+/******************** Bit definition for SCB_CCR register *******************/
+#define SCB_CCR_NONBASETHRDENA ((uint16_t)0x0001) /*!< Thread mode can be entered from any level in Handler mode by controlled return value */
+#define SCB_CCR_USERSETMPEND ((uint16_t)0x0002) /*!< Enables user code to write the Software Trigger Interrupt register to trigger (pend) a Main exception */
+#define SCB_CCR_UNALIGN_TRP ((uint16_t)0x0008) /*!< Trap for unaligned access */
+#define SCB_CCR_DIV_0_TRP ((uint16_t)0x0010) /*!< Trap on Divide by 0 */
+#define SCB_CCR_BFHFNMIGN ((uint16_t)0x0100) /*!< Handlers running at priority -1 and -2 */
+#define SCB_CCR_STKALIGN ((uint16_t)0x0200) /*!< On exception entry, the SP used prior to the exception is adjusted to be 8-byte aligned */
+
+/******************* Bit definition for SCB_SHPR register ********************/
+#define SCB_SHPR_PRI_N ((uint32_t)0x000000FF) /*!< Priority of system handler 4,8, and 12. Mem Manage, reserved and Debug Monitor */
+#define SCB_SHPR_PRI_N1 ((uint32_t)0x0000FF00) /*!< Priority of system handler 5,9, and 13. Bus Fault, reserved and reserved */
+#define SCB_SHPR_PRI_N2 ((uint32_t)0x00FF0000) /*!< Priority of system handler 6,10, and 14. Usage Fault, reserved and PendSV */
+#define SCB_SHPR_PRI_N3 ((uint32_t)0xFF000000) /*!< Priority of system handler 7,11, and 15. Reserved, SVCall and SysTick */
+
+/****************** Bit definition for SCB_SHCSR register *******************/
+#define SCB_SHCSR_MEMFAULTACT ((uint32_t)0x00000001) /*!< MemManage is active */
+#define SCB_SHCSR_BUSFAULTACT ((uint32_t)0x00000002) /*!< BusFault is active */
+#define SCB_SHCSR_USGFAULTACT ((uint32_t)0x00000008) /*!< UsageFault is active */
+#define SCB_SHCSR_SVCALLACT ((uint32_t)0x00000080) /*!< SVCall is active */
+#define SCB_SHCSR_MONITORACT ((uint32_t)0x00000100) /*!< Monitor is active */
+#define SCB_SHCSR_PENDSVACT ((uint32_t)0x00000400) /*!< PendSV is active */
+#define SCB_SHCSR_SYSTICKACT ((uint32_t)0x00000800) /*!< SysTick is active */
+#define SCB_SHCSR_USGFAULTPENDED ((uint32_t)0x00001000) /*!< Usage Fault is pended */
+#define SCB_SHCSR_MEMFAULTPENDED ((uint32_t)0x00002000) /*!< MemManage is pended */
+#define SCB_SHCSR_BUSFAULTPENDED ((uint32_t)0x00004000) /*!< Bus Fault is pended */
+#define SCB_SHCSR_SVCALLPENDED ((uint32_t)0x00008000) /*!< SVCall is pended */
+#define SCB_SHCSR_MEMFAULTENA ((uint32_t)0x00010000) /*!< MemManage enable */
+#define SCB_SHCSR_BUSFAULTENA ((uint32_t)0x00020000) /*!< Bus Fault enable */
+#define SCB_SHCSR_USGFAULTENA ((uint32_t)0x00040000) /*!< UsageFault enable */
+
+/******************* Bit definition for SCB_CFSR register *******************/
+/*!< MFSR */
+#define SCB_CFSR_IACCVIOL ((uint32_t)0x00000001) /*!< Instruction access violation */
+#define SCB_CFSR_DACCVIOL ((uint32_t)0x00000002) /*!< Data access violation */
+#define SCB_CFSR_MUNSTKERR ((uint32_t)0x00000008) /*!< Unstacking error */
+#define SCB_CFSR_MSTKERR ((uint32_t)0x00000010) /*!< Stacking error */
+#define SCB_CFSR_MMARVALID ((uint32_t)0x00000080) /*!< Memory Manage Address Register address valid flag */
+/*!< BFSR */
+#define SCB_CFSR_IBUSERR ((uint32_t)0x00000100) /*!< Instruction bus error flag */
+#define SCB_CFSR_PRECISERR ((uint32_t)0x00000200) /*!< Precise data bus error */
+#define SCB_CFSR_IMPRECISERR ((uint32_t)0x00000400) /*!< Imprecise data bus error */
+#define SCB_CFSR_UNSTKERR ((uint32_t)0x00000800) /*!< Unstacking error */
+#define SCB_CFSR_STKERR ((uint32_t)0x00001000) /*!< Stacking error */
+#define SCB_CFSR_BFARVALID ((uint32_t)0x00008000) /*!< Bus Fault Address Register address valid flag */
+/*!< UFSR */
+#define SCB_CFSR_UNDEFINSTR ((uint32_t)0x00010000) /*!< The processor attempt to execute an undefined instruction */
+#define SCB_CFSR_INVSTATE ((uint32_t)0x00020000) /*!< Invalid combination of EPSR and instruction */
+#define SCB_CFSR_INVPC ((uint32_t)0x00040000) /*!< Attempt to load EXC_RETURN into pc illegally */
+#define SCB_CFSR_NOCP ((uint32_t)0x00080000) /*!< Attempt to use a coprocessor instruction */
+#define SCB_CFSR_UNALIGNED ((uint32_t)0x01000000) /*!< Fault occurs when there is an attempt to make an unaligned memory access */
+#define SCB_CFSR_DIVBYZERO ((uint32_t)0x02000000) /*!< Fault occurs when SDIV or DIV instruction is used with a divisor of 0 */
+
+/******************* Bit definition for SCB_HFSR register *******************/
+#define SCB_HFSR_VECTTBL ((uint32_t)0x00000002) /*!< Fault occurs because of vector table read on exception processing */
+#define SCB_HFSR_FORCED ((uint32_t)0x40000000) /*!< Hard Fault activated when a configurable Fault was received and cannot activate */
+#define SCB_HFSR_DEBUGEVT ((uint32_t)0x80000000) /*!< Fault related to debug */
+
+/******************* Bit definition for SCB_DFSR register *******************/
+#define SCB_DFSR_HALTED ((uint8_t)0x01) /*!< Halt request flag */
+#define SCB_DFSR_BKPT ((uint8_t)0x02) /*!< BKPT flag */
+#define SCB_DFSR_DWTTRAP ((uint8_t)0x04) /*!< Data Watchpoint and Trace (DWT) flag */
+#define SCB_DFSR_VCATCH ((uint8_t)0x08) /*!< Vector catch flag */
+#define SCB_DFSR_EXTERNAL ((uint8_t)0x10) /*!< External debug request flag */
+
+/******************* Bit definition for SCB_MMFAR register ******************/
+#define SCB_MMFAR_ADDRESS ((uint32_t)0xFFFFFFFF) /*!< Mem Manage fault address field */
+
+/******************* Bit definition for SCB_BFAR register *******************/
+#define SCB_BFAR_ADDRESS ((uint32_t)0xFFFFFFFF) /*!< Bus fault address field */
+
+/******************* Bit definition for SCB_afsr register *******************/
+#define SCB_AFSR_IMPDEF ((uint32_t)0xFFFFFFFF) /*!< Implementation defined */
+
+/******************************************************************************/
+/* */
+/* External Interrupt/Event Controller */
+/* */
+/******************************************************************************/
+
+/******************* Bit definition for EXTI_IMR register *******************/
+#define EXTI_IMR_MR0 ((uint32_t)0x00000001) /*!< Interrupt Mask on line 0 */
+#define EXTI_IMR_MR1 ((uint32_t)0x00000002) /*!< Interrupt Mask on line 1 */
+#define EXTI_IMR_MR2 ((uint32_t)0x00000004) /*!< Interrupt Mask on line 2 */
+#define EXTI_IMR_MR3 ((uint32_t)0x00000008) /*!< Interrupt Mask on line 3 */
+#define EXTI_IMR_MR4 ((uint32_t)0x00000010) /*!< Interrupt Mask on line 4 */
+#define EXTI_IMR_MR5 ((uint32_t)0x00000020) /*!< Interrupt Mask on line 5 */
+#define EXTI_IMR_MR6 ((uint32_t)0x00000040) /*!< Interrupt Mask on line 6 */
+#define EXTI_IMR_MR7 ((uint32_t)0x00000080) /*!< Interrupt Mask on line 7 */
+#define EXTI_IMR_MR8 ((uint32_t)0x00000100) /*!< Interrupt Mask on line 8 */
+#define EXTI_IMR_MR9 ((uint32_t)0x00000200) /*!< Interrupt Mask on line 9 */
+#define EXTI_IMR_MR10 ((uint32_t)0x00000400) /*!< Interrupt Mask on line 10 */
+#define EXTI_IMR_MR11 ((uint32_t)0x00000800) /*!< Interrupt Mask on line 11 */
+#define EXTI_IMR_MR12 ((uint32_t)0x00001000) /*!< Interrupt Mask on line 12 */
+#define EXTI_IMR_MR13 ((uint32_t)0x00002000) /*!< Interrupt Mask on line 13 */
+#define EXTI_IMR_MR14 ((uint32_t)0x00004000) /*!< Interrupt Mask on line 14 */
+#define EXTI_IMR_MR15 ((uint32_t)0x00008000) /*!< Interrupt Mask on line 15 */
+#define EXTI_IMR_MR16 ((uint32_t)0x00010000) /*!< Interrupt Mask on line 16 */
+#define EXTI_IMR_MR17 ((uint32_t)0x00020000) /*!< Interrupt Mask on line 17 */
+#define EXTI_IMR_MR18 ((uint32_t)0x00040000) /*!< Interrupt Mask on line 18 */
+#define EXTI_IMR_MR19 ((uint32_t)0x00080000) /*!< Interrupt Mask on line 19 */
+
+/******************* Bit definition for EXTI_EMR register *******************/
+#define EXTI_EMR_MR0 ((uint32_t)0x00000001) /*!< Event Mask on line 0 */
+#define EXTI_EMR_MR1 ((uint32_t)0x00000002) /*!< Event Mask on line 1 */
+#define EXTI_EMR_MR2 ((uint32_t)0x00000004) /*!< Event Mask on line 2 */
+#define EXTI_EMR_MR3 ((uint32_t)0x00000008) /*!< Event Mask on line 3 */
+#define EXTI_EMR_MR4 ((uint32_t)0x00000010) /*!< Event Mask on line 4 */
+#define EXTI_EMR_MR5 ((uint32_t)0x00000020) /*!< Event Mask on line 5 */
+#define EXTI_EMR_MR6 ((uint32_t)0x00000040) /*!< Event Mask on line 6 */
+#define EXTI_EMR_MR7 ((uint32_t)0x00000080) /*!< Event Mask on line 7 */
+#define EXTI_EMR_MR8 ((uint32_t)0x00000100) /*!< Event Mask on line 8 */
+#define EXTI_EMR_MR9 ((uint32_t)0x00000200) /*!< Event Mask on line 9 */
+#define EXTI_EMR_MR10 ((uint32_t)0x00000400) /*!< Event Mask on line 10 */
+#define EXTI_EMR_MR11 ((uint32_t)0x00000800) /*!< Event Mask on line 11 */
+#define EXTI_EMR_MR12 ((uint32_t)0x00001000) /*!< Event Mask on line 12 */
+#define EXTI_EMR_MR13 ((uint32_t)0x00002000) /*!< Event Mask on line 13 */
+#define EXTI_EMR_MR14 ((uint32_t)0x00004000) /*!< Event Mask on line 14 */
+#define EXTI_EMR_MR15 ((uint32_t)0x00008000) /*!< Event Mask on line 15 */
+#define EXTI_EMR_MR16 ((uint32_t)0x00010000) /*!< Event Mask on line 16 */
+#define EXTI_EMR_MR17 ((uint32_t)0x00020000) /*!< Event Mask on line 17 */
+#define EXTI_EMR_MR18 ((uint32_t)0x00040000) /*!< Event Mask on line 18 */
+#define EXTI_EMR_MR19 ((uint32_t)0x00080000) /*!< Event Mask on line 19 */
+
+/****************** Bit definition for EXTI_RTSR register *******************/
+#define EXTI_RTSR_TR0 ((uint32_t)0x00000001) /*!< Rising trigger event configuration bit of line 0 */
+#define EXTI_RTSR_TR1 ((uint32_t)0x00000002) /*!< Rising trigger event configuration bit of line 1 */
+#define EXTI_RTSR_TR2 ((uint32_t)0x00000004) /*!< Rising trigger event configuration bit of line 2 */
+#define EXTI_RTSR_TR3 ((uint32_t)0x00000008) /*!< Rising trigger event configuration bit of line 3 */
+#define EXTI_RTSR_TR4 ((uint32_t)0x00000010) /*!< Rising trigger event configuration bit of line 4 */
+#define EXTI_RTSR_TR5 ((uint32_t)0x00000020) /*!< Rising trigger event configuration bit of line 5 */
+#define EXTI_RTSR_TR6 ((uint32_t)0x00000040) /*!< Rising trigger event configuration bit of line 6 */
+#define EXTI_RTSR_TR7 ((uint32_t)0x00000080) /*!< Rising trigger event configuration bit of line 7 */
+#define EXTI_RTSR_TR8 ((uint32_t)0x00000100) /*!< Rising trigger event configuration bit of line 8 */
+#define EXTI_RTSR_TR9 ((uint32_t)0x00000200) /*!< Rising trigger event configuration bit of line 9 */
+#define EXTI_RTSR_TR10 ((uint32_t)0x00000400) /*!< Rising trigger event configuration bit of line 10 */
+#define EXTI_RTSR_TR11 ((uint32_t)0x00000800) /*!< Rising trigger event configuration bit of line 11 */
+#define EXTI_RTSR_TR12 ((uint32_t)0x00001000) /*!< Rising trigger event configuration bit of line 12 */
+#define EXTI_RTSR_TR13 ((uint32_t)0x00002000) /*!< Rising trigger event configuration bit of line 13 */
+#define EXTI_RTSR_TR14 ((uint32_t)0x00004000) /*!< Rising trigger event configuration bit of line 14 */
+#define EXTI_RTSR_TR15 ((uint32_t)0x00008000) /*!< Rising trigger event configuration bit of line 15 */
+#define EXTI_RTSR_TR16 ((uint32_t)0x00010000) /*!< Rising trigger event configuration bit of line 16 */
+#define EXTI_RTSR_TR17 ((uint32_t)0x00020000) /*!< Rising trigger event configuration bit of line 17 */
+#define EXTI_RTSR_TR18 ((uint32_t)0x00040000) /*!< Rising trigger event configuration bit of line 18 */
+#define EXTI_RTSR_TR19 ((uint32_t)0x00080000) /*!< Rising trigger event configuration bit of line 19 */
+
+/****************** Bit definition for EXTI_FTSR register *******************/
+#define EXTI_FTSR_TR0 ((uint32_t)0x00000001) /*!< Falling trigger event configuration bit of line 0 */
+#define EXTI_FTSR_TR1 ((uint32_t)0x00000002) /*!< Falling trigger event configuration bit of line 1 */
+#define EXTI_FTSR_TR2 ((uint32_t)0x00000004) /*!< Falling trigger event configuration bit of line 2 */
+#define EXTI_FTSR_TR3 ((uint32_t)0x00000008) /*!< Falling trigger event configuration bit of line 3 */
+#define EXTI_FTSR_TR4 ((uint32_t)0x00000010) /*!< Falling trigger event configuration bit of line 4 */
+#define EXTI_FTSR_TR5 ((uint32_t)0x00000020) /*!< Falling trigger event configuration bit of line 5 */
+#define EXTI_FTSR_TR6 ((uint32_t)0x00000040) /*!< Falling trigger event configuration bit of line 6 */
+#define EXTI_FTSR_TR7 ((uint32_t)0x00000080) /*!< Falling trigger event configuration bit of line 7 */
+#define EXTI_FTSR_TR8 ((uint32_t)0x00000100) /*!< Falling trigger event configuration bit of line 8 */
+#define EXTI_FTSR_TR9 ((uint32_t)0x00000200) /*!< Falling trigger event configuration bit of line 9 */
+#define EXTI_FTSR_TR10 ((uint32_t)0x00000400) /*!< Falling trigger event configuration bit of line 10 */
+#define EXTI_FTSR_TR11 ((uint32_t)0x00000800) /*!< Falling trigger event configuration bit of line 11 */
+#define EXTI_FTSR_TR12 ((uint32_t)0x00001000) /*!< Falling trigger event configuration bit of line 12 */
+#define EXTI_FTSR_TR13 ((uint32_t)0x00002000) /*!< Falling trigger event configuration bit of line 13 */
+#define EXTI_FTSR_TR14 ((uint32_t)0x00004000) /*!< Falling trigger event configuration bit of line 14 */
+#define EXTI_FTSR_TR15 ((uint32_t)0x00008000) /*!< Falling trigger event configuration bit of line 15 */
+#define EXTI_FTSR_TR16 ((uint32_t)0x00010000) /*!< Falling trigger event configuration bit of line 16 */
+#define EXTI_FTSR_TR17 ((uint32_t)0x00020000) /*!< Falling trigger event configuration bit of line 17 */
+#define EXTI_FTSR_TR18 ((uint32_t)0x00040000) /*!< Falling trigger event configuration bit of line 18 */
+#define EXTI_FTSR_TR19 ((uint32_t)0x00080000) /*!< Falling trigger event configuration bit of line 19 */
+
+/****************** Bit definition for EXTI_SWIER register ******************/
+#define EXTI_SWIER_SWIER0 ((uint32_t)0x00000001) /*!< Software Interrupt on line 0 */
+#define EXTI_SWIER_SWIER1 ((uint32_t)0x00000002) /*!< Software Interrupt on line 1 */
+#define EXTI_SWIER_SWIER2 ((uint32_t)0x00000004) /*!< Software Interrupt on line 2 */
+#define EXTI_SWIER_SWIER3 ((uint32_t)0x00000008) /*!< Software Interrupt on line 3 */
+#define EXTI_SWIER_SWIER4 ((uint32_t)0x00000010) /*!< Software Interrupt on line 4 */
+#define EXTI_SWIER_SWIER5 ((uint32_t)0x00000020) /*!< Software Interrupt on line 5 */
+#define EXTI_SWIER_SWIER6 ((uint32_t)0x00000040) /*!< Software Interrupt on line 6 */
+#define EXTI_SWIER_SWIER7 ((uint32_t)0x00000080) /*!< Software Interrupt on line 7 */
+#define EXTI_SWIER_SWIER8 ((uint32_t)0x00000100) /*!< Software Interrupt on line 8 */
+#define EXTI_SWIER_SWIER9 ((uint32_t)0x00000200) /*!< Software Interrupt on line 9 */
+#define EXTI_SWIER_SWIER10 ((uint32_t)0x00000400) /*!< Software Interrupt on line 10 */
+#define EXTI_SWIER_SWIER11 ((uint32_t)0x00000800) /*!< Software Interrupt on line 11 */
+#define EXTI_SWIER_SWIER12 ((uint32_t)0x00001000) /*!< Software Interrupt on line 12 */
+#define EXTI_SWIER_SWIER13 ((uint32_t)0x00002000) /*!< Software Interrupt on line 13 */
+#define EXTI_SWIER_SWIER14 ((uint32_t)0x00004000) /*!< Software Interrupt on line 14 */
+#define EXTI_SWIER_SWIER15 ((uint32_t)0x00008000) /*!< Software Interrupt on line 15 */
+#define EXTI_SWIER_SWIER16 ((uint32_t)0x00010000) /*!< Software Interrupt on line 16 */
+#define EXTI_SWIER_SWIER17 ((uint32_t)0x00020000) /*!< Software Interrupt on line 17 */
+#define EXTI_SWIER_SWIER18 ((uint32_t)0x00040000) /*!< Software Interrupt on line 18 */
+#define EXTI_SWIER_SWIER19 ((uint32_t)0x00080000) /*!< Software Interrupt on line 19 */
+
+/******************* Bit definition for EXTI_PR register ********************/
+#define EXTI_PR_PR0 ((uint32_t)0x00000001) /*!< Pending bit for line 0 */
+#define EXTI_PR_PR1 ((uint32_t)0x00000002) /*!< Pending bit for line 1 */
+#define EXTI_PR_PR2 ((uint32_t)0x00000004) /*!< Pending bit for line 2 */
+#define EXTI_PR_PR3 ((uint32_t)0x00000008) /*!< Pending bit for line 3 */
+#define EXTI_PR_PR4 ((uint32_t)0x00000010) /*!< Pending bit for line 4 */
+#define EXTI_PR_PR5 ((uint32_t)0x00000020) /*!< Pending bit for line 5 */
+#define EXTI_PR_PR6 ((uint32_t)0x00000040) /*!< Pending bit for line 6 */
+#define EXTI_PR_PR7 ((uint32_t)0x00000080) /*!< Pending bit for line 7 */
+#define EXTI_PR_PR8 ((uint32_t)0x00000100) /*!< Pending bit for line 8 */
+#define EXTI_PR_PR9 ((uint32_t)0x00000200) /*!< Pending bit for line 9 */
+#define EXTI_PR_PR10 ((uint32_t)0x00000400) /*!< Pending bit for line 10 */
+#define EXTI_PR_PR11 ((uint32_t)0x00000800) /*!< Pending bit for line 11 */
+#define EXTI_PR_PR12 ((uint32_t)0x00001000) /*!< Pending bit for line 12 */
+#define EXTI_PR_PR13 ((uint32_t)0x00002000) /*!< Pending bit for line 13 */
+#define EXTI_PR_PR14 ((uint32_t)0x00004000) /*!< Pending bit for line 14 */
+#define EXTI_PR_PR15 ((uint32_t)0x00008000) /*!< Pending bit for line 15 */
+#define EXTI_PR_PR16 ((uint32_t)0x00010000) /*!< Pending bit for line 16 */
+#define EXTI_PR_PR17 ((uint32_t)0x00020000) /*!< Pending bit for line 17 */
+#define EXTI_PR_PR18 ((uint32_t)0x00040000) /*!< Pending bit for line 18 */
+#define EXTI_PR_PR19 ((uint32_t)0x00080000) /*!< Pending bit for line 19 */
+
+/******************************************************************************/
+/* */
+/* DMA Controller */
+/* */
+/******************************************************************************/
+
+/******************* Bit definition for DMA_ISR register ********************/
+#define DMA_ISR_GIF1 ((uint32_t)0x00000001) /*!< Channel 1 Global interrupt flag */
+#define DMA_ISR_TCIF1 ((uint32_t)0x00000002) /*!< Channel 1 Transfer Complete flag */
+#define DMA_ISR_HTIF1 ((uint32_t)0x00000004) /*!< Channel 1 Half Transfer flag */
+#define DMA_ISR_TEIF1 ((uint32_t)0x00000008) /*!< Channel 1 Transfer Error flag */
+#define DMA_ISR_GIF2 ((uint32_t)0x00000010) /*!< Channel 2 Global interrupt flag */
+#define DMA_ISR_TCIF2 ((uint32_t)0x00000020) /*!< Channel 2 Transfer Complete flag */
+#define DMA_ISR_HTIF2 ((uint32_t)0x00000040) /*!< Channel 2 Half Transfer flag */
+#define DMA_ISR_TEIF2 ((uint32_t)0x00000080) /*!< Channel 2 Transfer Error flag */
+#define DMA_ISR_GIF3 ((uint32_t)0x00000100) /*!< Channel 3 Global interrupt flag */
+#define DMA_ISR_TCIF3 ((uint32_t)0x00000200) /*!< Channel 3 Transfer Complete flag */
+#define DMA_ISR_HTIF3 ((uint32_t)0x00000400) /*!< Channel 3 Half Transfer flag */
+#define DMA_ISR_TEIF3 ((uint32_t)0x00000800) /*!< Channel 3 Transfer Error flag */
+#define DMA_ISR_GIF4 ((uint32_t)0x00001000) /*!< Channel 4 Global interrupt flag */
+#define DMA_ISR_TCIF4 ((uint32_t)0x00002000) /*!< Channel 4 Transfer Complete flag */
+#define DMA_ISR_HTIF4 ((uint32_t)0x00004000) /*!< Channel 4 Half Transfer flag */
+#define DMA_ISR_TEIF4 ((uint32_t)0x00008000) /*!< Channel 4 Transfer Error flag */
+#define DMA_ISR_GIF5 ((uint32_t)0x00010000) /*!< Channel 5 Global interrupt flag */
+#define DMA_ISR_TCIF5 ((uint32_t)0x00020000) /*!< Channel 5 Transfer Complete flag */
+#define DMA_ISR_HTIF5 ((uint32_t)0x00040000) /*!< Channel 5 Half Transfer flag */
+#define DMA_ISR_TEIF5 ((uint32_t)0x00080000) /*!< Channel 5 Transfer Error flag */
+#define DMA_ISR_GIF6 ((uint32_t)0x00100000) /*!< Channel 6 Global interrupt flag */
+#define DMA_ISR_TCIF6 ((uint32_t)0x00200000) /*!< Channel 6 Transfer Complete flag */
+#define DMA_ISR_HTIF6 ((uint32_t)0x00400000) /*!< Channel 6 Half Transfer flag */
+#define DMA_ISR_TEIF6 ((uint32_t)0x00800000) /*!< Channel 6 Transfer Error flag */
+#define DMA_ISR_GIF7 ((uint32_t)0x01000000) /*!< Channel 7 Global interrupt flag */
+#define DMA_ISR_TCIF7 ((uint32_t)0x02000000) /*!< Channel 7 Transfer Complete flag */
+#define DMA_ISR_HTIF7 ((uint32_t)0x04000000) /*!< Channel 7 Half Transfer flag */
+#define DMA_ISR_TEIF7 ((uint32_t)0x08000000) /*!< Channel 7 Transfer Error flag */
+
+/******************* Bit definition for DMA_IFCR register *******************/
+#define DMA_IFCR_CGIF1 ((uint32_t)0x00000001) /*!< Channel 1 Global interrupt clear */
+#define DMA_IFCR_CTCIF1 ((uint32_t)0x00000002) /*!< Channel 1 Transfer Complete clear */
+#define DMA_IFCR_CHTIF1 ((uint32_t)0x00000004) /*!< Channel 1 Half Transfer clear */
+#define DMA_IFCR_CTEIF1 ((uint32_t)0x00000008) /*!< Channel 1 Transfer Error clear */
+#define DMA_IFCR_CGIF2 ((uint32_t)0x00000010) /*!< Channel 2 Global interrupt clear */
+#define DMA_IFCR_CTCIF2 ((uint32_t)0x00000020) /*!< Channel 2 Transfer Complete clear */
+#define DMA_IFCR_CHTIF2 ((uint32_t)0x00000040) /*!< Channel 2 Half Transfer clear */
+#define DMA_IFCR_CTEIF2 ((uint32_t)0x00000080) /*!< Channel 2 Transfer Error clear */
+#define DMA_IFCR_CGIF3 ((uint32_t)0x00000100) /*!< Channel 3 Global interrupt clear */
+#define DMA_IFCR_CTCIF3 ((uint32_t)0x00000200) /*!< Channel 3 Transfer Complete clear */
+#define DMA_IFCR_CHTIF3 ((uint32_t)0x00000400) /*!< Channel 3 Half Transfer clear */
+#define DMA_IFCR_CTEIF3 ((uint32_t)0x00000800) /*!< Channel 3 Transfer Error clear */
+#define DMA_IFCR_CGIF4 ((uint32_t)0x00001000) /*!< Channel 4 Global interrupt clear */
+#define DMA_IFCR_CTCIF4 ((uint32_t)0x00002000) /*!< Channel 4 Transfer Complete clear */
+#define DMA_IFCR_CHTIF4 ((uint32_t)0x00004000) /*!< Channel 4 Half Transfer clear */
+#define DMA_IFCR_CTEIF4 ((uint32_t)0x00008000) /*!< Channel 4 Transfer Error clear */
+#define DMA_IFCR_CGIF5 ((uint32_t)0x00010000) /*!< Channel 5 Global interrupt clear */
+#define DMA_IFCR_CTCIF5 ((uint32_t)0x00020000) /*!< Channel 5 Transfer Complete clear */
+#define DMA_IFCR_CHTIF5 ((uint32_t)0x00040000) /*!< Channel 5 Half Transfer clear */
+#define DMA_IFCR_CTEIF5 ((uint32_t)0x00080000) /*!< Channel 5 Transfer Error clear */
+#define DMA_IFCR_CGIF6 ((uint32_t)0x00100000) /*!< Channel 6 Global interrupt clear */
+#define DMA_IFCR_CTCIF6 ((uint32_t)0x00200000) /*!< Channel 6 Transfer Complete clear */
+#define DMA_IFCR_CHTIF6 ((uint32_t)0x00400000) /*!< Channel 6 Half Transfer clear */
+#define DMA_IFCR_CTEIF6 ((uint32_t)0x00800000) /*!< Channel 6 Transfer Error clear */
+#define DMA_IFCR_CGIF7 ((uint32_t)0x01000000) /*!< Channel 7 Global interrupt clear */
+#define DMA_IFCR_CTCIF7 ((uint32_t)0x02000000) /*!< Channel 7 Transfer Complete clear */
+#define DMA_IFCR_CHTIF7 ((uint32_t)0x04000000) /*!< Channel 7 Half Transfer clear */
+#define DMA_IFCR_CTEIF7 ((uint32_t)0x08000000) /*!< Channel 7 Transfer Error clear */
+
+/******************* Bit definition for DMA_CCR1 register *******************/
+#define DMA_CCR1_EN ((uint16_t)0x0001) /*!< Channel enable*/
+#define DMA_CCR1_TCIE ((uint16_t)0x0002) /*!< Transfer complete interrupt enable */
+#define DMA_CCR1_HTIE ((uint16_t)0x0004) /*!< Half Transfer interrupt enable */
+#define DMA_CCR1_TEIE ((uint16_t)0x0008) /*!< Transfer error interrupt enable */
+#define DMA_CCR1_DIR ((uint16_t)0x0010) /*!< Data transfer direction */
+#define DMA_CCR1_CIRC ((uint16_t)0x0020) /*!< Circular mode */
+#define DMA_CCR1_PINC ((uint16_t)0x0040) /*!< Peripheral increment mode */
+#define DMA_CCR1_MINC ((uint16_t)0x0080) /*!< Memory increment mode */
+
+#define DMA_CCR1_PSIZE ((uint16_t)0x0300) /*!< PSIZE[1:0] bits (Peripheral size) */
+#define DMA_CCR1_PSIZE_0 ((uint16_t)0x0100) /*!< Bit 0 */
+#define DMA_CCR1_PSIZE_1 ((uint16_t)0x0200) /*!< Bit 1 */
+
+#define DMA_CCR1_MSIZE ((uint16_t)0x0C00) /*!< MSIZE[1:0] bits (Memory size) */
+#define DMA_CCR1_MSIZE_0 ((uint16_t)0x0400) /*!< Bit 0 */
+#define DMA_CCR1_MSIZE_1 ((uint16_t)0x0800) /*!< Bit 1 */
+
+#define DMA_CCR1_PL ((uint16_t)0x3000) /*!< PL[1:0] bits(Channel Priority level) */
+#define DMA_CCR1_PL_0 ((uint16_t)0x1000) /*!< Bit 0 */
+#define DMA_CCR1_PL_1 ((uint16_t)0x2000) /*!< Bit 1 */
+
+#define DMA_CCR1_MEM2MEM ((uint16_t)0x4000) /*!< Memory to memory mode */
+
+/******************* Bit definition for DMA_CCR2 register *******************/
+#define DMA_CCR2_EN ((uint16_t)0x0001) /*!< Channel enable */
+#define DMA_CCR2_TCIE ((uint16_t)0x0002) /*!< Transfer complete interrupt enable */
+#define DMA_CCR2_HTIE ((uint16_t)0x0004) /*!< Half Transfer interrupt enable */
+#define DMA_CCR2_TEIE ((uint16_t)0x0008) /*!< Transfer error interrupt enable */
+#define DMA_CCR2_DIR ((uint16_t)0x0010) /*!< Data transfer direction */
+#define DMA_CCR2_CIRC ((uint16_t)0x0020) /*!< Circular mode */
+#define DMA_CCR2_PINC ((uint16_t)0x0040) /*!< Peripheral increment mode */
+#define DMA_CCR2_MINC ((uint16_t)0x0080) /*!< Memory increment mode */
+
+#define DMA_CCR2_PSIZE ((uint16_t)0x0300) /*!< PSIZE[1:0] bits (Peripheral size) */
+#define DMA_CCR2_PSIZE_0 ((uint16_t)0x0100) /*!< Bit 0 */
+#define DMA_CCR2_PSIZE_1 ((uint16_t)0x0200) /*!< Bit 1 */
+
+#define DMA_CCR2_MSIZE ((uint16_t)0x0C00) /*!< MSIZE[1:0] bits (Memory size) */
+#define DMA_CCR2_MSIZE_0 ((uint16_t)0x0400) /*!< Bit 0 */
+#define DMA_CCR2_MSIZE_1 ((uint16_t)0x0800) /*!< Bit 1 */
+
+#define DMA_CCR2_PL ((uint16_t)0x3000) /*!< PL[1:0] bits (Channel Priority level) */
+#define DMA_CCR2_PL_0 ((uint16_t)0x1000) /*!< Bit 0 */
+#define DMA_CCR2_PL_1 ((uint16_t)0x2000) /*!< Bit 1 */
+
+#define DMA_CCR2_MEM2MEM ((uint16_t)0x4000) /*!< Memory to memory mode */
+
+/******************* Bit definition for DMA_CCR3 register *******************/
+#define DMA_CCR3_EN ((uint16_t)0x0001) /*!< Channel enable */
+#define DMA_CCR3_TCIE ((uint16_t)0x0002) /*!< Transfer complete interrupt enable */
+#define DMA_CCR3_HTIE ((uint16_t)0x0004) /*!< Half Transfer interrupt enable */
+#define DMA_CCR3_TEIE ((uint16_t)0x0008) /*!< Transfer error interrupt enable */
+#define DMA_CCR3_DIR ((uint16_t)0x0010) /*!< Data transfer direction */
+#define DMA_CCR3_CIRC ((uint16_t)0x0020) /*!< Circular mode */
+#define DMA_CCR3_PINC ((uint16_t)0x0040) /*!< Peripheral increment mode */
+#define DMA_CCR3_MINC ((uint16_t)0x0080) /*!< Memory increment mode */
+
+#define DMA_CCR3_PSIZE ((uint16_t)0x0300) /*!< PSIZE[1:0] bits (Peripheral size) */
+#define DMA_CCR3_PSIZE_0 ((uint16_t)0x0100) /*!< Bit 0 */
+#define DMA_CCR3_PSIZE_1 ((uint16_t)0x0200) /*!< Bit 1 */
+
+#define DMA_CCR3_MSIZE ((uint16_t)0x0C00) /*!< MSIZE[1:0] bits (Memory size) */
+#define DMA_CCR3_MSIZE_0 ((uint16_t)0x0400) /*!< Bit 0 */
+#define DMA_CCR3_MSIZE_1 ((uint16_t)0x0800) /*!< Bit 1 */
+
+#define DMA_CCR3_PL ((uint16_t)0x3000) /*!< PL[1:0] bits (Channel Priority level) */
+#define DMA_CCR3_PL_0 ((uint16_t)0x1000) /*!< Bit 0 */
+#define DMA_CCR3_PL_1 ((uint16_t)0x2000) /*!< Bit 1 */
+
+#define DMA_CCR3_MEM2MEM ((uint16_t)0x4000) /*!< Memory to memory mode */
+
+/*!<****************** Bit definition for DMA_CCR4 register *******************/
+#define DMA_CCR4_EN ((uint16_t)0x0001) /*!< Channel enable */
+#define DMA_CCR4_TCIE ((uint16_t)0x0002) /*!< Transfer complete interrupt enable */
+#define DMA_CCR4_HTIE ((uint16_t)0x0004) /*!< Half Transfer interrupt enable */
+#define DMA_CCR4_TEIE ((uint16_t)0x0008) /*!< Transfer error interrupt enable */
+#define DMA_CCR4_DIR ((uint16_t)0x0010) /*!< Data transfer direction */
+#define DMA_CCR4_CIRC ((uint16_t)0x0020) /*!< Circular mode */
+#define DMA_CCR4_PINC ((uint16_t)0x0040) /*!< Peripheral increment mode */
+#define DMA_CCR4_MINC ((uint16_t)0x0080) /*!< Memory increment mode */
+
+#define DMA_CCR4_PSIZE ((uint16_t)0x0300) /*!< PSIZE[1:0] bits (Peripheral size) */
+#define DMA_CCR4_PSIZE_0 ((uint16_t)0x0100) /*!< Bit 0 */
+#define DMA_CCR4_PSIZE_1 ((uint16_t)0x0200) /*!< Bit 1 */
+
+#define DMA_CCR4_MSIZE ((uint16_t)0x0C00) /*!< MSIZE[1:0] bits (Memory size) */
+#define DMA_CCR4_MSIZE_0 ((uint16_t)0x0400) /*!< Bit 0 */
+#define DMA_CCR4_MSIZE_1 ((uint16_t)0x0800) /*!< Bit 1 */
+
+#define DMA_CCR4_PL ((uint16_t)0x3000) /*!< PL[1:0] bits (Channel Priority level) */
+#define DMA_CCR4_PL_0 ((uint16_t)0x1000) /*!< Bit 0 */
+#define DMA_CCR4_PL_1 ((uint16_t)0x2000) /*!< Bit 1 */
+
+#define DMA_CCR4_MEM2MEM ((uint16_t)0x4000) /*!< Memory to memory mode */
+
+/****************** Bit definition for DMA_CCR5 register *******************/
+#define DMA_CCR5_EN ((uint16_t)0x0001) /*!< Channel enable */
+#define DMA_CCR5_TCIE ((uint16_t)0x0002) /*!< Transfer complete interrupt enable */
+#define DMA_CCR5_HTIE ((uint16_t)0x0004) /*!< Half Transfer interrupt enable */
+#define DMA_CCR5_TEIE ((uint16_t)0x0008) /*!< Transfer error interrupt enable */
+#define DMA_CCR5_DIR ((uint16_t)0x0010) /*!< Data transfer direction */
+#define DMA_CCR5_CIRC ((uint16_t)0x0020) /*!< Circular mode */
+#define DMA_CCR5_PINC ((uint16_t)0x0040) /*!< Peripheral increment mode */
+#define DMA_CCR5_MINC ((uint16_t)0x0080) /*!< Memory increment mode */
+
+#define DMA_CCR5_PSIZE ((uint16_t)0x0300) /*!< PSIZE[1:0] bits (Peripheral size) */
+#define DMA_CCR5_PSIZE_0 ((uint16_t)0x0100) /*!< Bit 0 */
+#define DMA_CCR5_PSIZE_1 ((uint16_t)0x0200) /*!< Bit 1 */
+
+#define DMA_CCR5_MSIZE ((uint16_t)0x0C00) /*!< MSIZE[1:0] bits (Memory size) */
+#define DMA_CCR5_MSIZE_0 ((uint16_t)0x0400) /*!< Bit 0 */
+#define DMA_CCR5_MSIZE_1 ((uint16_t)0x0800) /*!< Bit 1 */
+
+#define DMA_CCR5_PL ((uint16_t)0x3000) /*!< PL[1:0] bits (Channel Priority level) */
+#define DMA_CCR5_PL_0 ((uint16_t)0x1000) /*!< Bit 0 */
+#define DMA_CCR5_PL_1 ((uint16_t)0x2000) /*!< Bit 1 */
+
+#define DMA_CCR5_MEM2MEM ((uint16_t)0x4000) /*!< Memory to memory mode enable */
+
+/******************* Bit definition for DMA_CCR6 register *******************/
+#define DMA_CCR6_EN ((uint16_t)0x0001) /*!< Channel enable */
+#define DMA_CCR6_TCIE ((uint16_t)0x0002) /*!< Transfer complete interrupt enable */
+#define DMA_CCR6_HTIE ((uint16_t)0x0004) /*!< Half Transfer interrupt enable */
+#define DMA_CCR6_TEIE ((uint16_t)0x0008) /*!< Transfer error interrupt enable */
+#define DMA_CCR6_DIR ((uint16_t)0x0010) /*!< Data transfer direction */
+#define DMA_CCR6_CIRC ((uint16_t)0x0020) /*!< Circular mode */
+#define DMA_CCR6_PINC ((uint16_t)0x0040) /*!< Peripheral increment mode */
+#define DMA_CCR6_MINC ((uint16_t)0x0080) /*!< Memory increment mode */
+
+#define DMA_CCR6_PSIZE ((uint16_t)0x0300) /*!< PSIZE[1:0] bits (Peripheral size) */
+#define DMA_CCR6_PSIZE_0 ((uint16_t)0x0100) /*!< Bit 0 */
+#define DMA_CCR6_PSIZE_1 ((uint16_t)0x0200) /*!< Bit 1 */
+
+#define DMA_CCR6_MSIZE ((uint16_t)0x0C00) /*!< MSIZE[1:0] bits (Memory size) */
+#define DMA_CCR6_MSIZE_0 ((uint16_t)0x0400) /*!< Bit 0 */
+#define DMA_CCR6_MSIZE_1 ((uint16_t)0x0800) /*!< Bit 1 */
+
+#define DMA_CCR6_PL ((uint16_t)0x3000) /*!< PL[1:0] bits (Channel Priority level) */
+#define DMA_CCR6_PL_0 ((uint16_t)0x1000) /*!< Bit 0 */
+#define DMA_CCR6_PL_1 ((uint16_t)0x2000) /*!< Bit 1 */
+
+#define DMA_CCR6_MEM2MEM ((uint16_t)0x4000) /*!< Memory to memory mode */
+
+/******************* Bit definition for DMA_CCR7 register *******************/
+#define DMA_CCR7_EN ((uint16_t)0x0001) /*!< Channel enable */
+#define DMA_CCR7_TCIE ((uint16_t)0x0002) /*!< Transfer complete interrupt enable */
+#define DMA_CCR7_HTIE ((uint16_t)0x0004) /*!< Half Transfer interrupt enable */
+#define DMA_CCR7_TEIE ((uint16_t)0x0008) /*!< Transfer error interrupt enable */
+#define DMA_CCR7_DIR ((uint16_t)0x0010) /*!< Data transfer direction */
+#define DMA_CCR7_CIRC ((uint16_t)0x0020) /*!< Circular mode */
+#define DMA_CCR7_PINC ((uint16_t)0x0040) /*!< Peripheral increment mode */
+#define DMA_CCR7_MINC ((uint16_t)0x0080) /*!< Memory increment mode */
+
+#define DMA_CCR7_PSIZE , ((uint16_t)0x0300) /*!< PSIZE[1:0] bits (Peripheral size) */
+#define DMA_CCR7_PSIZE_0 ((uint16_t)0x0100) /*!< Bit 0 */
+#define DMA_CCR7_PSIZE_1 ((uint16_t)0x0200) /*!< Bit 1 */
+
+#define DMA_CCR7_MSIZE ((uint16_t)0x0C00) /*!< MSIZE[1:0] bits (Memory size) */
+#define DMA_CCR7_MSIZE_0 ((uint16_t)0x0400) /*!< Bit 0 */
+#define DMA_CCR7_MSIZE_1 ((uint16_t)0x0800) /*!< Bit 1 */
+
+#define DMA_CCR7_PL ((uint16_t)0x3000) /*!< PL[1:0] bits (Channel Priority level) */
+#define DMA_CCR7_PL_0 ((uint16_t)0x1000) /*!< Bit 0 */
+#define DMA_CCR7_PL_1 ((uint16_t)0x2000) /*!< Bit 1 */
+
+#define DMA_CCR7_MEM2MEM ((uint16_t)0x4000) /*!< Memory to memory mode enable */
+
+/****************** Bit definition for DMA_CNDTR1 register ******************/
+#define DMA_CNDTR1_NDT ((uint16_t)0xFFFF) /*!< Number of data to Transfer */
+
+/****************** Bit definition for DMA_CNDTR2 register ******************/
+#define DMA_CNDTR2_NDT ((uint16_t)0xFFFF) /*!< Number of data to Transfer */
+
+/****************** Bit definition for DMA_CNDTR3 register ******************/
+#define DMA_CNDTR3_NDT ((uint16_t)0xFFFF) /*!< Number of data to Transfer */
+
+/****************** Bit definition for DMA_CNDTR4 register ******************/
+#define DMA_CNDTR4_NDT ((uint16_t)0xFFFF) /*!< Number of data to Transfer */
+
+/****************** Bit definition for DMA_CNDTR5 register ******************/
+#define DMA_CNDTR5_NDT ((uint16_t)0xFFFF) /*!< Number of data to Transfer */
+
+/****************** Bit definition for DMA_CNDTR6 register ******************/
+#define DMA_CNDTR6_NDT ((uint16_t)0xFFFF) /*!< Number of data to Transfer */
+
+/****************** Bit definition for DMA_CNDTR7 register ******************/
+#define DMA_CNDTR7_NDT ((uint16_t)0xFFFF) /*!< Number of data to Transfer */
+
+/****************** Bit definition for DMA_CPAR1 register *******************/
+#define DMA_CPAR1_PA ((uint32_t)0xFFFFFFFF) /*!< Peripheral Address */
+
+/****************** Bit definition for DMA_CPAR2 register *******************/
+#define DMA_CPAR2_PA ((uint32_t)0xFFFFFFFF) /*!< Peripheral Address */
+
+/****************** Bit definition for DMA_CPAR3 register *******************/
+#define DMA_CPAR3_PA ((uint32_t)0xFFFFFFFF) /*!< Peripheral Address */
+
+
+/****************** Bit definition for DMA_CPAR4 register *******************/
+#define DMA_CPAR4_PA ((uint32_t)0xFFFFFFFF) /*!< Peripheral Address */
+
+/****************** Bit definition for DMA_CPAR5 register *******************/
+#define DMA_CPAR5_PA ((uint32_t)0xFFFFFFFF) /*!< Peripheral Address */
+
+/****************** Bit definition for DMA_CPAR6 register *******************/
+#define DMA_CPAR6_PA ((uint32_t)0xFFFFFFFF) /*!< Peripheral Address */
+
+
+/****************** Bit definition for DMA_CPAR7 register *******************/
+#define DMA_CPAR7_PA ((uint32_t)0xFFFFFFFF) /*!< Peripheral Address */
+
+/****************** Bit definition for DMA_CMAR1 register *******************/
+#define DMA_CMAR1_MA ((uint32_t)0xFFFFFFFF) /*!< Memory Address */
+
+/****************** Bit definition for DMA_CMAR2 register *******************/
+#define DMA_CMAR2_MA ((uint32_t)0xFFFFFFFF) /*!< Memory Address */
+
+/****************** Bit definition for DMA_CMAR3 register *******************/
+#define DMA_CMAR3_MA ((uint32_t)0xFFFFFFFF) /*!< Memory Address */
+
+
+/****************** Bit definition for DMA_CMAR4 register *******************/
+#define DMA_CMAR4_MA ((uint32_t)0xFFFFFFFF) /*!< Memory Address */
+
+/****************** Bit definition for DMA_CMAR5 register *******************/
+#define DMA_CMAR5_MA ((uint32_t)0xFFFFFFFF) /*!< Memory Address */
+
+/****************** Bit definition for DMA_CMAR6 register *******************/
+#define DMA_CMAR6_MA ((uint32_t)0xFFFFFFFF) /*!< Memory Address */
+
+/****************** Bit definition for DMA_CMAR7 register *******************/
+#define DMA_CMAR7_MA ((uint32_t)0xFFFFFFFF) /*!< Memory Address */
+
+/******************************************************************************/
+/* */
+/* Analog to Digital Converter */
+/* */
+/******************************************************************************/
+
+/******************** Bit definition for ADC_SR register ********************/
+#define ADC_SR_AWD ((uint8_t)0x01) /*!< Analog watchdog flag */
+#define ADC_SR_EOC ((uint8_t)0x02) /*!< End of conversion */
+#define ADC_SR_JEOC ((uint8_t)0x04) /*!< Injected channel end of conversion */
+#define ADC_SR_JSTRT ((uint8_t)0x08) /*!< Injected channel Start flag */
+#define ADC_SR_STRT ((uint8_t)0x10) /*!< Regular channel Start flag */
+
+/******************* Bit definition for ADC_CR1 register ********************/
+#define ADC_CR1_AWDCH ((uint32_t)0x0000001F) /*!< AWDCH[4:0] bits (Analog watchdog channel select bits) */
+#define ADC_CR1_AWDCH_0 ((uint32_t)0x00000001) /*!< Bit 0 */
+#define ADC_CR1_AWDCH_1 ((uint32_t)0x00000002) /*!< Bit 1 */
+#define ADC_CR1_AWDCH_2 ((uint32_t)0x00000004) /*!< Bit 2 */
+#define ADC_CR1_AWDCH_3 ((uint32_t)0x00000008) /*!< Bit 3 */
+#define ADC_CR1_AWDCH_4 ((uint32_t)0x00000010) /*!< Bit 4 */
+
+#define ADC_CR1_EOCIE ((uint32_t)0x00000020) /*!< Interrupt enable for EOC */
+#define ADC_CR1_AWDIE ((uint32_t)0x00000040) /*!< Analog Watchdog interrupt enable */
+#define ADC_CR1_JEOCIE ((uint32_t)0x00000080) /*!< Interrupt enable for injected channels */
+#define ADC_CR1_SCAN ((uint32_t)0x00000100) /*!< Scan mode */
+#define ADC_CR1_AWDSGL ((uint32_t)0x00000200) /*!< Enable the watchdog on a single channel in scan mode */
+#define ADC_CR1_JAUTO ((uint32_t)0x00000400) /*!< Automatic injected group conversion */
+#define ADC_CR1_DISCEN ((uint32_t)0x00000800) /*!< Discontinuous mode on regular channels */
+#define ADC_CR1_JDISCEN ((uint32_t)0x00001000) /*!< Discontinuous mode on injected channels */
+
+#define ADC_CR1_DISCNUM ((uint32_t)0x0000E000) /*!< DISCNUM[2:0] bits (Discontinuous mode channel count) */
+#define ADC_CR1_DISCNUM_0 ((uint32_t)0x00002000) /*!< Bit 0 */
+#define ADC_CR1_DISCNUM_1 ((uint32_t)0x00004000) /*!< Bit 1 */
+#define ADC_CR1_DISCNUM_2 ((uint32_t)0x00008000) /*!< Bit 2 */
+
+#define ADC_CR1_DUALMOD ((uint32_t)0x000F0000) /*!< DUALMOD[3:0] bits (Dual mode selection) */
+#define ADC_CR1_DUALMOD_0 ((uint32_t)0x00010000) /*!< Bit 0 */
+#define ADC_CR1_DUALMOD_1 ((uint32_t)0x00020000) /*!< Bit 1 */
+#define ADC_CR1_DUALMOD_2 ((uint32_t)0x00040000) /*!< Bit 2 */
+#define ADC_CR1_DUALMOD_3 ((uint32_t)0x00080000) /*!< Bit 3 */
+
+#define ADC_CR1_JAWDEN ((uint32_t)0x00400000) /*!< Analog watchdog enable on injected channels */
+#define ADC_CR1_AWDEN ((uint32_t)0x00800000) /*!< Analog watchdog enable on regular channels */
+
+
+/******************* Bit definition for ADC_CR2 register ********************/
+#define ADC_CR2_ADON ((uint32_t)0x00000001) /*!< A/D Converter ON / OFF */
+#define ADC_CR2_CONT ((uint32_t)0x00000002) /*!< Continuous Conversion */
+#define ADC_CR2_CAL ((uint32_t)0x00000004) /*!< A/D Calibration */
+#define ADC_CR2_RSTCAL ((uint32_t)0x00000008) /*!< Reset Calibration */
+#define ADC_CR2_DMA ((uint32_t)0x00000100) /*!< Direct Memory access mode */
+#define ADC_CR2_ALIGN ((uint32_t)0x00000800) /*!< Data Alignment */
+
+#define ADC_CR2_JEXTSEL ((uint32_t)0x00007000) /*!< JEXTSEL[2:0] bits (External event select for injected group) */
+#define ADC_CR2_JEXTSEL_0 ((uint32_t)0x00001000) /*!< Bit 0 */
+#define ADC_CR2_JEXTSEL_1 ((uint32_t)0x00002000) /*!< Bit 1 */
+#define ADC_CR2_JEXTSEL_2 ((uint32_t)0x00004000) /*!< Bit 2 */
+
+#define ADC_CR2_JEXTTRIG ((uint32_t)0x00008000) /*!< External Trigger Conversion mode for injected channels */
+
+#define ADC_CR2_EXTSEL ((uint32_t)0x000E0000) /*!< EXTSEL[2:0] bits (External Event Select for regular group) */
+#define ADC_CR2_EXTSEL_0 ((uint32_t)0x00020000) /*!< Bit 0 */
+#define ADC_CR2_EXTSEL_1 ((uint32_t)0x00040000) /*!< Bit 1 */
+#define ADC_CR2_EXTSEL_2 ((uint32_t)0x00080000) /*!< Bit 2 */
+
+#define ADC_CR2_EXTTRIG ((uint32_t)0x00100000) /*!< External Trigger Conversion mode for regular channels */
+#define ADC_CR2_JSWSTART ((uint32_t)0x00200000) /*!< Start Conversion of injected channels */
+#define ADC_CR2_SWSTART ((uint32_t)0x00400000) /*!< Start Conversion of regular channels */
+#define ADC_CR2_TSVREFE ((uint32_t)0x00800000) /*!< Temperature Sensor and VREFINT Enable */
+
+/****************** Bit definition for ADC_SMPR1 register *******************/
+#define ADC_SMPR1_SMP10 ((uint32_t)0x00000007) /*!< SMP10[2:0] bits (Channel 10 Sample time selection) */
+#define ADC_SMPR1_SMP10_0 ((uint32_t)0x00000001) /*!< Bit 0 */
+#define ADC_SMPR1_SMP10_1 ((uint32_t)0x00000002) /*!< Bit 1 */
+#define ADC_SMPR1_SMP10_2 ((uint32_t)0x00000004) /*!< Bit 2 */
+
+#define ADC_SMPR1_SMP11 ((uint32_t)0x00000038) /*!< SMP11[2:0] bits (Channel 11 Sample time selection) */
+#define ADC_SMPR1_SMP11_0 ((uint32_t)0x00000008) /*!< Bit 0 */
+#define ADC_SMPR1_SMP11_1 ((uint32_t)0x00000010) /*!< Bit 1 */
+#define ADC_SMPR1_SMP11_2 ((uint32_t)0x00000020) /*!< Bit 2 */
+
+#define ADC_SMPR1_SMP12 ((uint32_t)0x000001C0) /*!< SMP12[2:0] bits (Channel 12 Sample time selection) */
+#define ADC_SMPR1_SMP12_0 ((uint32_t)0x00000040) /*!< Bit 0 */
+#define ADC_SMPR1_SMP12_1 ((uint32_t)0x00000080) /*!< Bit 1 */
+#define ADC_SMPR1_SMP12_2 ((uint32_t)0x00000100) /*!< Bit 2 */
+
+#define ADC_SMPR1_SMP13 ((uint32_t)0x00000E00) /*!< SMP13[2:0] bits (Channel 13 Sample time selection) */
+#define ADC_SMPR1_SMP13_0 ((uint32_t)0x00000200) /*!< Bit 0 */
+#define ADC_SMPR1_SMP13_1 ((uint32_t)0x00000400) /*!< Bit 1 */
+#define ADC_SMPR1_SMP13_2 ((uint32_t)0x00000800) /*!< Bit 2 */
+
+#define ADC_SMPR1_SMP14 ((uint32_t)0x00007000) /*!< SMP14[2:0] bits (Channel 14 Sample time selection) */
+#define ADC_SMPR1_SMP14_0 ((uint32_t)0x00001000) /*!< Bit 0 */
+#define ADC_SMPR1_SMP14_1 ((uint32_t)0x00002000) /*!< Bit 1 */
+#define ADC_SMPR1_SMP14_2 ((uint32_t)0x00004000) /*!< Bit 2 */
+
+#define ADC_SMPR1_SMP15 ((uint32_t)0x00038000) /*!< SMP15[2:0] bits (Channel 15 Sample time selection) */
+#define ADC_SMPR1_SMP15_0 ((uint32_t)0x00008000) /*!< Bit 0 */
+#define ADC_SMPR1_SMP15_1 ((uint32_t)0x00010000) /*!< Bit 1 */
+#define ADC_SMPR1_SMP15_2 ((uint32_t)0x00020000) /*!< Bit 2 */
+
+#define ADC_SMPR1_SMP16 ((uint32_t)0x001C0000) /*!< SMP16[2:0] bits (Channel 16 Sample time selection) */
+#define ADC_SMPR1_SMP16_0 ((uint32_t)0x00040000) /*!< Bit 0 */
+#define ADC_SMPR1_SMP16_1 ((uint32_t)0x00080000) /*!< Bit 1 */
+#define ADC_SMPR1_SMP16_2 ((uint32_t)0x00100000) /*!< Bit 2 */
+
+#define ADC_SMPR1_SMP17 ((uint32_t)0x00E00000) /*!< SMP17[2:0] bits (Channel 17 Sample time selection) */
+#define ADC_SMPR1_SMP17_0 ((uint32_t)0x00200000) /*!< Bit 0 */
+#define ADC_SMPR1_SMP17_1 ((uint32_t)0x00400000) /*!< Bit 1 */
+#define ADC_SMPR1_SMP17_2 ((uint32_t)0x00800000) /*!< Bit 2 */
+
+/****************** Bit definition for ADC_SMPR2 register *******************/
+#define ADC_SMPR2_SMP0 ((uint32_t)0x00000007) /*!< SMP0[2:0] bits (Channel 0 Sample time selection) */
+#define ADC_SMPR2_SMP0_0 ((uint32_t)0x00000001) /*!< Bit 0 */
+#define ADC_SMPR2_SMP0_1 ((uint32_t)0x00000002) /*!< Bit 1 */
+#define ADC_SMPR2_SMP0_2 ((uint32_t)0x00000004) /*!< Bit 2 */
+
+#define ADC_SMPR2_SMP1 ((uint32_t)0x00000038) /*!< SMP1[2:0] bits (Channel 1 Sample time selection) */
+#define ADC_SMPR2_SMP1_0 ((uint32_t)0x00000008) /*!< Bit 0 */
+#define ADC_SMPR2_SMP1_1 ((uint32_t)0x00000010) /*!< Bit 1 */
+#define ADC_SMPR2_SMP1_2 ((uint32_t)0x00000020) /*!< Bit 2 */
+
+#define ADC_SMPR2_SMP2 ((uint32_t)0x000001C0) /*!< SMP2[2:0] bits (Channel 2 Sample time selection) */
+#define ADC_SMPR2_SMP2_0 ((uint32_t)0x00000040) /*!< Bit 0 */
+#define ADC_SMPR2_SMP2_1 ((uint32_t)0x00000080) /*!< Bit 1 */
+#define ADC_SMPR2_SMP2_2 ((uint32_t)0x00000100) /*!< Bit 2 */
+
+#define ADC_SMPR2_SMP3 ((uint32_t)0x00000E00) /*!< SMP3[2:0] bits (Channel 3 Sample time selection) */
+#define ADC_SMPR2_SMP3_0 ((uint32_t)0x00000200) /*!< Bit 0 */
+#define ADC_SMPR2_SMP3_1 ((uint32_t)0x00000400) /*!< Bit 1 */
+#define ADC_SMPR2_SMP3_2 ((uint32_t)0x00000800) /*!< Bit 2 */
+
+#define ADC_SMPR2_SMP4 ((uint32_t)0x00007000) /*!< SMP4[2:0] bits (Channel 4 Sample time selection) */
+#define ADC_SMPR2_SMP4_0 ((uint32_t)0x00001000) /*!< Bit 0 */
+#define ADC_SMPR2_SMP4_1 ((uint32_t)0x00002000) /*!< Bit 1 */
+#define ADC_SMPR2_SMP4_2 ((uint32_t)0x00004000) /*!< Bit 2 */
+
+#define ADC_SMPR2_SMP5 ((uint32_t)0x00038000) /*!< SMP5[2:0] bits (Channel 5 Sample time selection) */
+#define ADC_SMPR2_SMP5_0 ((uint32_t)0x00008000) /*!< Bit 0 */
+#define ADC_SMPR2_SMP5_1 ((uint32_t)0x00010000) /*!< Bit 1 */
+#define ADC_SMPR2_SMP5_2 ((uint32_t)0x00020000) /*!< Bit 2 */
+
+#define ADC_SMPR2_SMP6 ((uint32_t)0x001C0000) /*!< SMP6[2:0] bits (Channel 6 Sample time selection) */
+#define ADC_SMPR2_SMP6_0 ((uint32_t)0x00040000) /*!< Bit 0 */
+#define ADC_SMPR2_SMP6_1 ((uint32_t)0x00080000) /*!< Bit 1 */
+#define ADC_SMPR2_SMP6_2 ((uint32_t)0x00100000) /*!< Bit 2 */
+
+#define ADC_SMPR2_SMP7 ((uint32_t)0x00E00000) /*!< SMP7[2:0] bits (Channel 7 Sample time selection) */
+#define ADC_SMPR2_SMP7_0 ((uint32_t)0x00200000) /*!< Bit 0 */
+#define ADC_SMPR2_SMP7_1 ((uint32_t)0x00400000) /*!< Bit 1 */
+#define ADC_SMPR2_SMP7_2 ((uint32_t)0x00800000) /*!< Bit 2 */
+
+#define ADC_SMPR2_SMP8 ((uint32_t)0x07000000) /*!< SMP8[2:0] bits (Channel 8 Sample time selection) */
+#define ADC_SMPR2_SMP8_0 ((uint32_t)0x01000000) /*!< Bit 0 */
+#define ADC_SMPR2_SMP8_1 ((uint32_t)0x02000000) /*!< Bit 1 */
+#define ADC_SMPR2_SMP8_2 ((uint32_t)0x04000000) /*!< Bit 2 */
+
+#define ADC_SMPR2_SMP9 ((uint32_t)0x38000000) /*!< SMP9[2:0] bits (Channel 9 Sample time selection) */
+#define ADC_SMPR2_SMP9_0 ((uint32_t)0x08000000) /*!< Bit 0 */
+#define ADC_SMPR2_SMP9_1 ((uint32_t)0x10000000) /*!< Bit 1 */
+#define ADC_SMPR2_SMP9_2 ((uint32_t)0x20000000) /*!< Bit 2 */
+
+/****************** Bit definition for ADC_JOFR1 register *******************/
+#define ADC_JOFR1_JOFFSET1 ((uint16_t)0x0FFF) /*!< Data offset for injected channel 1 */
+
+/****************** Bit definition for ADC_JOFR2 register *******************/
+#define ADC_JOFR2_JOFFSET2 ((uint16_t)0x0FFF) /*!< Data offset for injected channel 2 */
+
+/****************** Bit definition for ADC_JOFR3 register *******************/
+#define ADC_JOFR3_JOFFSET3 ((uint16_t)0x0FFF) /*!< Data offset for injected channel 3 */
+
+/****************** Bit definition for ADC_JOFR4 register *******************/
+#define ADC_JOFR4_JOFFSET4 ((uint16_t)0x0FFF) /*!< Data offset for injected channel 4 */
+
+/******************* Bit definition for ADC_HTR register ********************/
+#define ADC_HTR_HT ((uint16_t)0x0FFF) /*!< Analog watchdog high threshold */
+
+/******************* Bit definition for ADC_LTR register ********************/
+#define ADC_LTR_LT ((uint16_t)0x0FFF) /*!< Analog watchdog low threshold */
+
+/******************* Bit definition for ADC_SQR1 register *******************/
+#define ADC_SQR1_SQ13 ((uint32_t)0x0000001F) /*!< SQ13[4:0] bits (13th conversion in regular sequence) */
+#define ADC_SQR1_SQ13_0 ((uint32_t)0x00000001) /*!< Bit 0 */
+#define ADC_SQR1_SQ13_1 ((uint32_t)0x00000002) /*!< Bit 1 */
+#define ADC_SQR1_SQ13_2 ((uint32_t)0x00000004) /*!< Bit 2 */
+#define ADC_SQR1_SQ13_3 ((uint32_t)0x00000008) /*!< Bit 3 */
+#define ADC_SQR1_SQ13_4 ((uint32_t)0x00000010) /*!< Bit 4 */
+
+#define ADC_SQR1_SQ14 ((uint32_t)0x000003E0) /*!< SQ14[4:0] bits (14th conversion in regular sequence) */
+#define ADC_SQR1_SQ14_0 ((uint32_t)0x00000020) /*!< Bit 0 */
+#define ADC_SQR1_SQ14_1 ((uint32_t)0x00000040) /*!< Bit 1 */
+#define ADC_SQR1_SQ14_2 ((uint32_t)0x00000080) /*!< Bit 2 */
+#define ADC_SQR1_SQ14_3 ((uint32_t)0x00000100) /*!< Bit 3 */
+#define ADC_SQR1_SQ14_4 ((uint32_t)0x00000200) /*!< Bit 4 */
+
+#define ADC_SQR1_SQ15 ((uint32_t)0x00007C00) /*!< SQ15[4:0] bits (15th conversion in regular sequence) */
+#define ADC_SQR1_SQ15_0 ((uint32_t)0x00000400) /*!< Bit 0 */
+#define ADC_SQR1_SQ15_1 ((uint32_t)0x00000800) /*!< Bit 1 */
+#define ADC_SQR1_SQ15_2 ((uint32_t)0x00001000) /*!< Bit 2 */
+#define ADC_SQR1_SQ15_3 ((uint32_t)0x00002000) /*!< Bit 3 */
+#define ADC_SQR1_SQ15_4 ((uint32_t)0x00004000) /*!< Bit 4 */
+
+#define ADC_SQR1_SQ16 ((uint32_t)0x000F8000) /*!< SQ16[4:0] bits (16th conversion in regular sequence) */
+#define ADC_SQR1_SQ16_0 ((uint32_t)0x00008000) /*!< Bit 0 */
+#define ADC_SQR1_SQ16_1 ((uint32_t)0x00010000) /*!< Bit 1 */
+#define ADC_SQR1_SQ16_2 ((uint32_t)0x00020000) /*!< Bit 2 */
+#define ADC_SQR1_SQ16_3 ((uint32_t)0x00040000) /*!< Bit 3 */
+#define ADC_SQR1_SQ16_4 ((uint32_t)0x00080000) /*!< Bit 4 */
+
+#define ADC_SQR1_L ((uint32_t)0x00F00000) /*!< L[3:0] bits (Regular channel sequence length) */
+#define ADC_SQR1_L_0 ((uint32_t)0x00100000) /*!< Bit 0 */
+#define ADC_SQR1_L_1 ((uint32_t)0x00200000) /*!< Bit 1 */
+#define ADC_SQR1_L_2 ((uint32_t)0x00400000) /*!< Bit 2 */
+#define ADC_SQR1_L_3 ((uint32_t)0x00800000) /*!< Bit 3 */
+
+/******************* Bit definition for ADC_SQR2 register *******************/
+#define ADC_SQR2_SQ7 ((uint32_t)0x0000001F) /*!< SQ7[4:0] bits (7th conversion in regular sequence) */
+#define ADC_SQR2_SQ7_0 ((uint32_t)0x00000001) /*!< Bit 0 */
+#define ADC_SQR2_SQ7_1 ((uint32_t)0x00000002) /*!< Bit 1 */
+#define ADC_SQR2_SQ7_2 ((uint32_t)0x00000004) /*!< Bit 2 */
+#define ADC_SQR2_SQ7_3 ((uint32_t)0x00000008) /*!< Bit 3 */
+#define ADC_SQR2_SQ7_4 ((uint32_t)0x00000010) /*!< Bit 4 */
+
+#define ADC_SQR2_SQ8 ((uint32_t)0x000003E0) /*!< SQ8[4:0] bits (8th conversion in regular sequence) */
+#define ADC_SQR2_SQ8_0 ((uint32_t)0x00000020) /*!< Bit 0 */
+#define ADC_SQR2_SQ8_1 ((uint32_t)0x00000040) /*!< Bit 1 */
+#define ADC_SQR2_SQ8_2 ((uint32_t)0x00000080) /*!< Bit 2 */
+#define ADC_SQR2_SQ8_3 ((uint32_t)0x00000100) /*!< Bit 3 */
+#define ADC_SQR2_SQ8_4 ((uint32_t)0x00000200) /*!< Bit 4 */
+
+#define ADC_SQR2_SQ9 ((uint32_t)0x00007C00) /*!< SQ9[4:0] bits (9th conversion in regular sequence) */
+#define ADC_SQR2_SQ9_0 ((uint32_t)0x00000400) /*!< Bit 0 */
+#define ADC_SQR2_SQ9_1 ((uint32_t)0x00000800) /*!< Bit 1 */
+#define ADC_SQR2_SQ9_2 ((uint32_t)0x00001000) /*!< Bit 2 */
+#define ADC_SQR2_SQ9_3 ((uint32_t)0x00002000) /*!< Bit 3 */
+#define ADC_SQR2_SQ9_4 ((uint32_t)0x00004000) /*!< Bit 4 */
+
+#define ADC_SQR2_SQ10 ((uint32_t)0x000F8000) /*!< SQ10[4:0] bits (10th conversion in regular sequence) */
+#define ADC_SQR2_SQ10_0 ((uint32_t)0x00008000) /*!< Bit 0 */
+#define ADC_SQR2_SQ10_1 ((uint32_t)0x00010000) /*!< Bit 1 */
+#define ADC_SQR2_SQ10_2 ((uint32_t)0x00020000) /*!< Bit 2 */
+#define ADC_SQR2_SQ10_3 ((uint32_t)0x00040000) /*!< Bit 3 */
+#define ADC_SQR2_SQ10_4 ((uint32_t)0x00080000) /*!< Bit 4 */
+
+#define ADC_SQR2_SQ11 ((uint32_t)0x01F00000) /*!< SQ11[4:0] bits (11th conversion in regular sequence) */
+#define ADC_SQR2_SQ11_0 ((uint32_t)0x00100000) /*!< Bit 0 */
+#define ADC_SQR2_SQ11_1 ((uint32_t)0x00200000) /*!< Bit 1 */
+#define ADC_SQR2_SQ11_2 ((uint32_t)0x00400000) /*!< Bit 2 */
+#define ADC_SQR2_SQ11_3 ((uint32_t)0x00800000) /*!< Bit 3 */
+#define ADC_SQR2_SQ11_4 ((uint32_t)0x01000000) /*!< Bit 4 */
+
+#define ADC_SQR2_SQ12 ((uint32_t)0x3E000000) /*!< SQ12[4:0] bits (12th conversion in regular sequence) */
+#define ADC_SQR2_SQ12_0 ((uint32_t)0x02000000) /*!< Bit 0 */
+#define ADC_SQR2_SQ12_1 ((uint32_t)0x04000000) /*!< Bit 1 */
+#define ADC_SQR2_SQ12_2 ((uint32_t)0x08000000) /*!< Bit 2 */
+#define ADC_SQR2_SQ12_3 ((uint32_t)0x10000000) /*!< Bit 3 */
+#define ADC_SQR2_SQ12_4 ((uint32_t)0x20000000) /*!< Bit 4 */
+
+/******************* Bit definition for ADC_SQR3 register *******************/
+#define ADC_SQR3_SQ1 ((uint32_t)0x0000001F) /*!< SQ1[4:0] bits (1st conversion in regular sequence) */
+#define ADC_SQR3_SQ1_0 ((uint32_t)0x00000001) /*!< Bit 0 */
+#define ADC_SQR3_SQ1_1 ((uint32_t)0x00000002) /*!< Bit 1 */
+#define ADC_SQR3_SQ1_2 ((uint32_t)0x00000004) /*!< Bit 2 */
+#define ADC_SQR3_SQ1_3 ((uint32_t)0x00000008) /*!< Bit 3 */
+#define ADC_SQR3_SQ1_4 ((uint32_t)0x00000010) /*!< Bit 4 */
+
+#define ADC_SQR3_SQ2 ((uint32_t)0x000003E0) /*!< SQ2[4:0] bits (2nd conversion in regular sequence) */
+#define ADC_SQR3_SQ2_0 ((uint32_t)0x00000020) /*!< Bit 0 */
+#define ADC_SQR3_SQ2_1 ((uint32_t)0x00000040) /*!< Bit 1 */
+#define ADC_SQR3_SQ2_2 ((uint32_t)0x00000080) /*!< Bit 2 */
+#define ADC_SQR3_SQ2_3 ((uint32_t)0x00000100) /*!< Bit 3 */
+#define ADC_SQR3_SQ2_4 ((uint32_t)0x00000200) /*!< Bit 4 */
+
+#define ADC_SQR3_SQ3 ((uint32_t)0x00007C00) /*!< SQ3[4:0] bits (3rd conversion in regular sequence) */
+#define ADC_SQR3_SQ3_0 ((uint32_t)0x00000400) /*!< Bit 0 */
+#define ADC_SQR3_SQ3_1 ((uint32_t)0x00000800) /*!< Bit 1 */
+#define ADC_SQR3_SQ3_2 ((uint32_t)0x00001000) /*!< Bit 2 */
+#define ADC_SQR3_SQ3_3 ((uint32_t)0x00002000) /*!< Bit 3 */
+#define ADC_SQR3_SQ3_4 ((uint32_t)0x00004000) /*!< Bit 4 */
+
+#define ADC_SQR3_SQ4 ((uint32_t)0x000F8000) /*!< SQ4[4:0] bits (4th conversion in regular sequence) */
+#define ADC_SQR3_SQ4_0 ((uint32_t)0x00008000) /*!< Bit 0 */
+#define ADC_SQR3_SQ4_1 ((uint32_t)0x00010000) /*!< Bit 1 */
+#define ADC_SQR3_SQ4_2 ((uint32_t)0x00020000) /*!< Bit 2 */
+#define ADC_SQR3_SQ4_3 ((uint32_t)0x00040000) /*!< Bit 3 */
+#define ADC_SQR3_SQ4_4 ((uint32_t)0x00080000) /*!< Bit 4 */
+
+#define ADC_SQR3_SQ5 ((uint32_t)0x01F00000) /*!< SQ5[4:0] bits (5th conversion in regular sequence) */
+#define ADC_SQR3_SQ5_0 ((uint32_t)0x00100000) /*!< Bit 0 */
+#define ADC_SQR3_SQ5_1 ((uint32_t)0x00200000) /*!< Bit 1 */
+#define ADC_SQR3_SQ5_2 ((uint32_t)0x00400000) /*!< Bit 2 */
+#define ADC_SQR3_SQ5_3 ((uint32_t)0x00800000) /*!< Bit 3 */
+#define ADC_SQR3_SQ5_4 ((uint32_t)0x01000000) /*!< Bit 4 */
+
+#define ADC_SQR3_SQ6 ((uint32_t)0x3E000000) /*!< SQ6[4:0] bits (6th conversion in regular sequence) */
+#define ADC_SQR3_SQ6_0 ((uint32_t)0x02000000) /*!< Bit 0 */
+#define ADC_SQR3_SQ6_1 ((uint32_t)0x04000000) /*!< Bit 1 */
+#define ADC_SQR3_SQ6_2 ((uint32_t)0x08000000) /*!< Bit 2 */
+#define ADC_SQR3_SQ6_3 ((uint32_t)0x10000000) /*!< Bit 3 */
+#define ADC_SQR3_SQ6_4 ((uint32_t)0x20000000) /*!< Bit 4 */
+
+/******************* Bit definition for ADC_JSQR register *******************/
+#define ADC_JSQR_JSQ1 ((uint32_t)0x0000001F) /*!< JSQ1[4:0] bits (1st conversion in injected sequence) */
+#define ADC_JSQR_JSQ1_0 ((uint32_t)0x00000001) /*!< Bit 0 */
+#define ADC_JSQR_JSQ1_1 ((uint32_t)0x00000002) /*!< Bit 1 */
+#define ADC_JSQR_JSQ1_2 ((uint32_t)0x00000004) /*!< Bit 2 */
+#define ADC_JSQR_JSQ1_3 ((uint32_t)0x00000008) /*!< Bit 3 */
+#define ADC_JSQR_JSQ1_4 ((uint32_t)0x00000010) /*!< Bit 4 */
+
+#define ADC_JSQR_JSQ2 ((uint32_t)0x000003E0) /*!< JSQ2[4:0] bits (2nd conversion in injected sequence) */
+#define ADC_JSQR_JSQ2_0 ((uint32_t)0x00000020) /*!< Bit 0 */
+#define ADC_JSQR_JSQ2_1 ((uint32_t)0x00000040) /*!< Bit 1 */
+#define ADC_JSQR_JSQ2_2 ((uint32_t)0x00000080) /*!< Bit 2 */
+#define ADC_JSQR_JSQ2_3 ((uint32_t)0x00000100) /*!< Bit 3 */
+#define ADC_JSQR_JSQ2_4 ((uint32_t)0x00000200) /*!< Bit 4 */
+
+#define ADC_JSQR_JSQ3 ((uint32_t)0x00007C00) /*!< JSQ3[4:0] bits (3rd conversion in injected sequence) */
+#define ADC_JSQR_JSQ3_0 ((uint32_t)0x00000400) /*!< Bit 0 */
+#define ADC_JSQR_JSQ3_1 ((uint32_t)0x00000800) /*!< Bit 1 */
+#define ADC_JSQR_JSQ3_2 ((uint32_t)0x00001000) /*!< Bit 2 */
+#define ADC_JSQR_JSQ3_3 ((uint32_t)0x00002000) /*!< Bit 3 */
+#define ADC_JSQR_JSQ3_4 ((uint32_t)0x00004000) /*!< Bit 4 */
+
+#define ADC_JSQR_JSQ4 ((uint32_t)0x000F8000) /*!< JSQ4[4:0] bits (4th conversion in injected sequence) */
+#define ADC_JSQR_JSQ4_0 ((uint32_t)0x00008000) /*!< Bit 0 */
+#define ADC_JSQR_JSQ4_1 ((uint32_t)0x00010000) /*!< Bit 1 */
+#define ADC_JSQR_JSQ4_2 ((uint32_t)0x00020000) /*!< Bit 2 */
+#define ADC_JSQR_JSQ4_3 ((uint32_t)0x00040000) /*!< Bit 3 */
+#define ADC_JSQR_JSQ4_4 ((uint32_t)0x00080000) /*!< Bit 4 */
+
+#define ADC_JSQR_JL ((uint32_t)0x00300000) /*!< JL[1:0] bits (Injected Sequence length) */
+#define ADC_JSQR_JL_0 ((uint32_t)0x00100000) /*!< Bit 0 */
+#define ADC_JSQR_JL_1 ((uint32_t)0x00200000) /*!< Bit 1 */
+
+/******************* Bit definition for ADC_JDR1 register *******************/
+#define ADC_JDR1_JDATA ((uint16_t)0xFFFF) /*!< Injected data */
+
+/******************* Bit definition for ADC_JDR2 register *******************/
+#define ADC_JDR2_JDATA ((uint16_t)0xFFFF) /*!< Injected data */
+
+/******************* Bit definition for ADC_JDR3 register *******************/
+#define ADC_JDR3_JDATA ((uint16_t)0xFFFF) /*!< Injected data */
+
+/******************* Bit definition for ADC_JDR4 register *******************/
+#define ADC_JDR4_JDATA ((uint16_t)0xFFFF) /*!< Injected data */
+
+/******************** Bit definition for ADC_DR register ********************/
+#define ADC_DR_DATA ((uint32_t)0x0000FFFF) /*!< Regular data */
+#define ADC_DR_ADC2DATA ((uint32_t)0xFFFF0000) /*!< ADC2 data */
+
+/******************************************************************************/
+/* */
+/* Digital to Analog Converter */
+/* */
+/******************************************************************************/
+
+/******************** Bit definition for DAC_CR register ********************/
+#define DAC_CR_EN1 ((uint32_t)0x00000001) /*!< DAC channel1 enable */
+#define DAC_CR_BOFF1 ((uint32_t)0x00000002) /*!< DAC channel1 output buffer disable */
+#define DAC_CR_TEN1 ((uint32_t)0x00000004) /*!< DAC channel1 Trigger enable */
+
+#define DAC_CR_TSEL1 ((uint32_t)0x00000038) /*!< TSEL1[2:0] (DAC channel1 Trigger selection) */
+#define DAC_CR_TSEL1_0 ((uint32_t)0x00000008) /*!< Bit 0 */
+#define DAC_CR_TSEL1_1 ((uint32_t)0x00000010) /*!< Bit 1 */
+#define DAC_CR_TSEL1_2 ((uint32_t)0x00000020) /*!< Bit 2 */
+
+#define DAC_CR_WAVE1 ((uint32_t)0x000000C0) /*!< WAVE1[1:0] (DAC channel1 noise/triangle wave generation enable) */
+#define DAC_CR_WAVE1_0 ((uint32_t)0x00000040) /*!< Bit 0 */
+#define DAC_CR_WAVE1_1 ((uint32_t)0x00000080) /*!< Bit 1 */
+
+#define DAC_CR_MAMP1 ((uint32_t)0x00000F00) /*!< MAMP1[3:0] (DAC channel1 Mask/Amplitude selector) */
+#define DAC_CR_MAMP1_0 ((uint32_t)0x00000100) /*!< Bit 0 */
+#define DAC_CR_MAMP1_1 ((uint32_t)0x00000200) /*!< Bit 1 */
+#define DAC_CR_MAMP1_2 ((uint32_t)0x00000400) /*!< Bit 2 */
+#define DAC_CR_MAMP1_3 ((uint32_t)0x00000800) /*!< Bit 3 */
+
+#define DAC_CR_DMAEN1 ((uint32_t)0x00001000) /*!< DAC channel1 DMA enable */
+#define DAC_CR_EN2 ((uint32_t)0x00010000) /*!< DAC channel2 enable */
+#define DAC_CR_BOFF2 ((uint32_t)0x00020000) /*!< DAC channel2 output buffer disable */
+#define DAC_CR_TEN2 ((uint32_t)0x00040000) /*!< DAC channel2 Trigger enable */
+
+#define DAC_CR_TSEL2 ((uint32_t)0x00380000) /*!< TSEL2[2:0] (DAC channel2 Trigger selection) */
+#define DAC_CR_TSEL2_0 ((uint32_t)0x00080000) /*!< Bit 0 */
+#define DAC_CR_TSEL2_1 ((uint32_t)0x00100000) /*!< Bit 1 */
+#define DAC_CR_TSEL2_2 ((uint32_t)0x00200000) /*!< Bit 2 */
+
+#define DAC_CR_WAVE2 ((uint32_t)0x00C00000) /*!< WAVE2[1:0] (DAC channel2 noise/triangle wave generation enable) */
+#define DAC_CR_WAVE2_0 ((uint32_t)0x00400000) /*!< Bit 0 */
+#define DAC_CR_WAVE2_1 ((uint32_t)0x00800000) /*!< Bit 1 */
+
+#define DAC_CR_MAMP2 ((uint32_t)0x0F000000) /*!< MAMP2[3:0] (DAC channel2 Mask/Amplitude selector) */
+#define DAC_CR_MAMP2_0 ((uint32_t)0x01000000) /*!< Bit 0 */
+#define DAC_CR_MAMP2_1 ((uint32_t)0x02000000) /*!< Bit 1 */
+#define DAC_CR_MAMP2_2 ((uint32_t)0x04000000) /*!< Bit 2 */
+#define DAC_CR_MAMP2_3 ((uint32_t)0x08000000) /*!< Bit 3 */
+
+#define DAC_CR_DMAEN2 ((uint32_t)0x10000000) /*!< DAC channel2 DMA enabled */
+
+/***************** Bit definition for DAC_SWTRIGR register ******************/
+#define DAC_SWTRIGR_SWTRIG1 ((uint8_t)0x01) /*!< DAC channel1 software trigger */
+#define DAC_SWTRIGR_SWTRIG2 ((uint8_t)0x02) /*!< DAC channel2 software trigger */
+
+/***************** Bit definition for DAC_DHR12R1 register ******************/
+#define DAC_DHR12R1_DACC1DHR ((uint16_t)0x0FFF) /*!< DAC channel1 12-bit Right aligned data */
+
+/***************** Bit definition for DAC_DHR12L1 register ******************/
+#define DAC_DHR12L1_DACC1DHR ((uint16_t)0xFFF0) /*!< DAC channel1 12-bit Left aligned data */
+
+/****************** Bit definition for DAC_DHR8R1 register ******************/
+#define DAC_DHR8R1_DACC1DHR ((uint8_t)0xFF) /*!< DAC channel1 8-bit Right aligned data */
+
+/***************** Bit definition for DAC_DHR12R2 register ******************/
+#define DAC_DHR12R2_DACC2DHR ((uint16_t)0x0FFF) /*!< DAC channel2 12-bit Right aligned data */
+
+/***************** Bit definition for DAC_DHR12L2 register ******************/
+#define DAC_DHR12L2_DACC2DHR ((uint16_t)0xFFF0) /*!< DAC channel2 12-bit Left aligned data */
+
+/****************** Bit definition for DAC_DHR8R2 register ******************/
+#define DAC_DHR8R2_DACC2DHR ((uint8_t)0xFF) /*!< DAC channel2 8-bit Right aligned data */
+
+/***************** Bit definition for DAC_DHR12RD register ******************/
+#define DAC_DHR12RD_DACC1DHR ((uint32_t)0x00000FFF) /*!< DAC channel1 12-bit Right aligned data */
+#define DAC_DHR12RD_DACC2DHR ((uint32_t)0x0FFF0000) /*!< DAC channel2 12-bit Right aligned data */
+
+/***************** Bit definition for DAC_DHR12LD register ******************/
+#define DAC_DHR12LD_DACC1DHR ((uint32_t)0x0000FFF0) /*!< DAC channel1 12-bit Left aligned data */
+#define DAC_DHR12LD_DACC2DHR ((uint32_t)0xFFF00000) /*!< DAC channel2 12-bit Left aligned data */
+
+/****************** Bit definition for DAC_DHR8RD register ******************/
+#define DAC_DHR8RD_DACC1DHR ((uint16_t)0x00FF) /*!< DAC channel1 8-bit Right aligned data */
+#define DAC_DHR8RD_DACC2DHR ((uint16_t)0xFF00) /*!< DAC channel2 8-bit Right aligned data */
+
+/******************* Bit definition for DAC_DOR1 register *******************/
+#define DAC_DOR1_DACC1DOR ((uint16_t)0x0FFF) /*!< DAC channel1 data output */
+
+/******************* Bit definition for DAC_DOR2 register *******************/
+#define DAC_DOR2_DACC2DOR ((uint16_t)0x0FFF) /*!< DAC channel2 data output */
+
+/******************** Bit definition for DAC_SR register ********************/
+#define DAC_SR_DMAUDR1 ((uint32_t)0x00002000) /*!< DAC channel1 DMA underrun flag */
+#define DAC_SR_DMAUDR2 ((uint32_t)0x20000000) /*!< DAC channel2 DMA underrun flag */
+
+/******************************************************************************/
+/* */
+/* CEC */
+/* */
+/******************************************************************************/
+/******************** Bit definition for CEC_CFGR register ******************/
+#define CEC_CFGR_PE ((uint16_t)0x0001) /*!< Peripheral Enable */
+#define CEC_CFGR_IE ((uint16_t)0x0002) /*!< Interrupt Enable */
+#define CEC_CFGR_BTEM ((uint16_t)0x0004) /*!< Bit Timing Error Mode */
+#define CEC_CFGR_BPEM ((uint16_t)0x0008) /*!< Bit Period Error Mode */
+
+/******************** Bit definition for CEC_OAR register ******************/
+#define CEC_OAR_OA ((uint16_t)0x000F) /*!< OA[3:0]: Own Address */
+#define CEC_OAR_OA_0 ((uint16_t)0x0001) /*!< Bit 0 */
+#define CEC_OAR_OA_1 ((uint16_t)0x0002) /*!< Bit 1 */
+#define CEC_OAR_OA_2 ((uint16_t)0x0004) /*!< Bit 2 */
+#define CEC_OAR_OA_3 ((uint16_t)0x0008) /*!< Bit 3 */
+
+/******************** Bit definition for CEC_PRES register ******************/
+#define CEC_PRES_PRES ((uint16_t)0x3FFF) /*!< Prescaler Counter Value */
+
+/******************** Bit definition for CEC_ESR register ******************/
+#define CEC_ESR_BTE ((uint16_t)0x0001) /*!< Bit Timing Error */
+#define CEC_ESR_BPE ((uint16_t)0x0002) /*!< Bit Period Error */
+#define CEC_ESR_RBTFE ((uint16_t)0x0004) /*!< Rx Block Transfer Finished Error */
+#define CEC_ESR_SBE ((uint16_t)0x0008) /*!< Start Bit Error */
+#define CEC_ESR_ACKE ((uint16_t)0x0010) /*!< Block Acknowledge Error */
+#define CEC_ESR_LINE ((uint16_t)0x0020) /*!< Line Error */
+#define CEC_ESR_TBTFE ((uint16_t)0x0040) /*!< Tx Block Transfer Finished Error */
+
+/******************** Bit definition for CEC_CSR register ******************/
+#define CEC_CSR_TSOM ((uint16_t)0x0001) /*!< Tx Start Of Message */
+#define CEC_CSR_TEOM ((uint16_t)0x0002) /*!< Tx End Of Message */
+#define CEC_CSR_TERR ((uint16_t)0x0004) /*!< Tx Error */
+#define CEC_CSR_TBTRF ((uint16_t)0x0008) /*!< Tx Byte Transfer Request or Block Transfer Finished */
+#define CEC_CSR_RSOM ((uint16_t)0x0010) /*!< Rx Start Of Message */
+#define CEC_CSR_REOM ((uint16_t)0x0020) /*!< Rx End Of Message */
+#define CEC_CSR_RERR ((uint16_t)0x0040) /*!< Rx Error */
+#define CEC_CSR_RBTF ((uint16_t)0x0080) /*!< Rx Block Transfer Finished */
+
+/******************** Bit definition for CEC_TXD register ******************/
+#define CEC_TXD_TXD ((uint16_t)0x00FF) /*!< Tx Data register */
+
+/******************** Bit definition for CEC_RXD register ******************/
+#define CEC_RXD_RXD ((uint16_t)0x00FF) /*!< Rx Data register */
+
+/******************************************************************************/
+/* */
+/* TIM */
+/* */
+/******************************************************************************/
+
+/******************* Bit definition for TIM_CR1 register ********************/
+#define TIM_CR1_CEN ((uint16_t)0x0001) /*!< Counter enable */
+#define TIM_CR1_UDIS ((uint16_t)0x0002) /*!< Update disable */
+#define TIM_CR1_URS ((uint16_t)0x0004) /*!< Update request source */
+#define TIM_CR1_OPM ((uint16_t)0x0008) /*!< One pulse mode */
+#define TIM_CR1_DIR ((uint16_t)0x0010) /*!< Direction */
+
+#define TIM_CR1_CMS ((uint16_t)0x0060) /*!< CMS[1:0] bits (Center-aligned mode selection) */
+#define TIM_CR1_CMS_0 ((uint16_t)0x0020) /*!< Bit 0 */
+#define TIM_CR1_CMS_1 ((uint16_t)0x0040) /*!< Bit 1 */
+
+#define TIM_CR1_ARPE ((uint16_t)0x0080) /*!< Auto-reload preload enable */
+
+#define TIM_CR1_CKD ((uint16_t)0x0300) /*!< CKD[1:0] bits (clock division) */
+#define TIM_CR1_CKD_0 ((uint16_t)0x0100) /*!< Bit 0 */
+#define TIM_CR1_CKD_1 ((uint16_t)0x0200) /*!< Bit 1 */
+
+/******************* Bit definition for TIM_CR2 register ********************/
+#define TIM_CR2_CCPC ((uint16_t)0x0001) /*!< Capture/Compare Preloaded Control */
+#define TIM_CR2_CCUS ((uint16_t)0x0004) /*!< Capture/Compare Control Update Selection */
+#define TIM_CR2_CCDS ((uint16_t)0x0008) /*!< Capture/Compare DMA Selection */
+
+#define TIM_CR2_MMS ((uint16_t)0x0070) /*!< MMS[2:0] bits (Master Mode Selection) */
+#define TIM_CR2_MMS_0 ((uint16_t)0x0010) /*!< Bit 0 */
+#define TIM_CR2_MMS_1 ((uint16_t)0x0020) /*!< Bit 1 */
+#define TIM_CR2_MMS_2 ((uint16_t)0x0040) /*!< Bit 2 */
+
+#define TIM_CR2_TI1S ((uint16_t)0x0080) /*!< TI1 Selection */
+#define TIM_CR2_OIS1 ((uint16_t)0x0100) /*!< Output Idle state 1 (OC1 output) */
+#define TIM_CR2_OIS1N ((uint16_t)0x0200) /*!< Output Idle state 1 (OC1N output) */
+#define TIM_CR2_OIS2 ((uint16_t)0x0400) /*!< Output Idle state 2 (OC2 output) */
+#define TIM_CR2_OIS2N ((uint16_t)0x0800) /*!< Output Idle state 2 (OC2N output) */
+#define TIM_CR2_OIS3 ((uint16_t)0x1000) /*!< Output Idle state 3 (OC3 output) */
+#define TIM_CR2_OIS3N ((uint16_t)0x2000) /*!< Output Idle state 3 (OC3N output) */
+#define TIM_CR2_OIS4 ((uint16_t)0x4000) /*!< Output Idle state 4 (OC4 output) */
+
+/******************* Bit definition for TIM_SMCR register *******************/
+#define TIM_SMCR_SMS ((uint16_t)0x0007) /*!< SMS[2:0] bits (Slave mode selection) */
+#define TIM_SMCR_SMS_0 ((uint16_t)0x0001) /*!< Bit 0 */
+#define TIM_SMCR_SMS_1 ((uint16_t)0x0002) /*!< Bit 1 */
+#define TIM_SMCR_SMS_2 ((uint16_t)0x0004) /*!< Bit 2 */
+
+#define TIM_SMCR_TS ((uint16_t)0x0070) /*!< TS[2:0] bits (Trigger selection) */
+#define TIM_SMCR_TS_0 ((uint16_t)0x0010) /*!< Bit 0 */
+#define TIM_SMCR_TS_1 ((uint16_t)0x0020) /*!< Bit 1 */
+#define TIM_SMCR_TS_2 ((uint16_t)0x0040) /*!< Bit 2 */
+
+#define TIM_SMCR_MSM ((uint16_t)0x0080) /*!< Master/slave mode */
+
+#define TIM_SMCR_ETF ((uint16_t)0x0F00) /*!< ETF[3:0] bits (External trigger filter) */
+#define TIM_SMCR_ETF_0 ((uint16_t)0x0100) /*!< Bit 0 */
+#define TIM_SMCR_ETF_1 ((uint16_t)0x0200) /*!< Bit 1 */
+#define TIM_SMCR_ETF_2 ((uint16_t)0x0400) /*!< Bit 2 */
+#define TIM_SMCR_ETF_3 ((uint16_t)0x0800) /*!< Bit 3 */
+
+#define TIM_SMCR_ETPS ((uint16_t)0x3000) /*!< ETPS[1:0] bits (External trigger prescaler) */
+#define TIM_SMCR_ETPS_0 ((uint16_t)0x1000) /*!< Bit 0 */
+#define TIM_SMCR_ETPS_1 ((uint16_t)0x2000) /*!< Bit 1 */
+
+#define TIM_SMCR_ECE ((uint16_t)0x4000) /*!< External clock enable */
+#define TIM_SMCR_ETP ((uint16_t)0x8000) /*!< External trigger polarity */
+
+/******************* Bit definition for TIM_DIER register *******************/
+#define TIM_DIER_UIE ((uint16_t)0x0001) /*!< Update interrupt enable */
+#define TIM_DIER_CC1IE ((uint16_t)0x0002) /*!< Capture/Compare 1 interrupt enable */
+#define TIM_DIER_CC2IE ((uint16_t)0x0004) /*!< Capture/Compare 2 interrupt enable */
+#define TIM_DIER_CC3IE ((uint16_t)0x0008) /*!< Capture/Compare 3 interrupt enable */
+#define TIM_DIER_CC4IE ((uint16_t)0x0010) /*!< Capture/Compare 4 interrupt enable */
+#define TIM_DIER_COMIE ((uint16_t)0x0020) /*!< COM interrupt enable */
+#define TIM_DIER_TIE ((uint16_t)0x0040) /*!< Trigger interrupt enable */
+#define TIM_DIER_BIE ((uint16_t)0x0080) /*!< Break interrupt enable */
+#define TIM_DIER_UDE ((uint16_t)0x0100) /*!< Update DMA request enable */
+#define TIM_DIER_CC1DE ((uint16_t)0x0200) /*!< Capture/Compare 1 DMA request enable */
+#define TIM_DIER_CC2DE ((uint16_t)0x0400) /*!< Capture/Compare 2 DMA request enable */
+#define TIM_DIER_CC3DE ((uint16_t)0x0800) /*!< Capture/Compare 3 DMA request enable */
+#define TIM_DIER_CC4DE ((uint16_t)0x1000) /*!< Capture/Compare 4 DMA request enable */
+#define TIM_DIER_COMDE ((uint16_t)0x2000) /*!< COM DMA request enable */
+#define TIM_DIER_TDE ((uint16_t)0x4000) /*!< Trigger DMA request enable */
+
+/******************** Bit definition for TIM_SR register ********************/
+#define TIM_SR_UIF ((uint16_t)0x0001) /*!< Update interrupt Flag */
+#define TIM_SR_CC1IF ((uint16_t)0x0002) /*!< Capture/Compare 1 interrupt Flag */
+#define TIM_SR_CC2IF ((uint16_t)0x0004) /*!< Capture/Compare 2 interrupt Flag */
+#define TIM_SR_CC3IF ((uint16_t)0x0008) /*!< Capture/Compare 3 interrupt Flag */
+#define TIM_SR_CC4IF ((uint16_t)0x0010) /*!< Capture/Compare 4 interrupt Flag */
+#define TIM_SR_COMIF ((uint16_t)0x0020) /*!< COM interrupt Flag */
+#define TIM_SR_TIF ((uint16_t)0x0040) /*!< Trigger interrupt Flag */
+#define TIM_SR_BIF ((uint16_t)0x0080) /*!< Break interrupt Flag */
+#define TIM_SR_CC1OF ((uint16_t)0x0200) /*!< Capture/Compare 1 Overcapture Flag */
+#define TIM_SR_CC2OF ((uint16_t)0x0400) /*!< Capture/Compare 2 Overcapture Flag */
+#define TIM_SR_CC3OF ((uint16_t)0x0800) /*!< Capture/Compare 3 Overcapture Flag */
+#define TIM_SR_CC4OF ((uint16_t)0x1000) /*!< Capture/Compare 4 Overcapture Flag */
+
+/******************* Bit definition for TIM_EGR register ********************/
+#define TIM_EGR_UG ((uint8_t)0x01) /*!< Update Generation */
+#define TIM_EGR_CC1G ((uint8_t)0x02) /*!< Capture/Compare 1 Generation */
+#define TIM_EGR_CC2G ((uint8_t)0x04) /*!< Capture/Compare 2 Generation */
+#define TIM_EGR_CC3G ((uint8_t)0x08) /*!< Capture/Compare 3 Generation */
+#define TIM_EGR_CC4G ((uint8_t)0x10) /*!< Capture/Compare 4 Generation */
+#define TIM_EGR_COMG ((uint8_t)0x20) /*!< Capture/Compare Control Update Generation */
+#define TIM_EGR_TG ((uint8_t)0x40) /*!< Trigger Generation */
+#define TIM_EGR_BG ((uint8_t)0x80) /*!< Break Generation */
+
+/****************** Bit definition for TIM_CCMR1 register *******************/
+#define TIM_CCMR1_CC1S ((uint16_t)0x0003) /*!< CC1S[1:0] bits (Capture/Compare 1 Selection) */
+#define TIM_CCMR1_CC1S_0 ((uint16_t)0x0001) /*!< Bit 0 */
+#define TIM_CCMR1_CC1S_1 ((uint16_t)0x0002) /*!< Bit 1 */
+
+#define TIM_CCMR1_OC1FE ((uint16_t)0x0004) /*!< Output Compare 1 Fast enable */
+#define TIM_CCMR1_OC1PE ((uint16_t)0x0008) /*!< Output Compare 1 Preload enable */
+
+#define TIM_CCMR1_OC1M ((uint16_t)0x0070) /*!< OC1M[2:0] bits (Output Compare 1 Mode) */
+#define TIM_CCMR1_OC1M_0 ((uint16_t)0x0010) /*!< Bit 0 */
+#define TIM_CCMR1_OC1M_1 ((uint16_t)0x0020) /*!< Bit 1 */
+#define TIM_CCMR1_OC1M_2 ((uint16_t)0x0040) /*!< Bit 2 */
+
+#define TIM_CCMR1_OC1CE ((uint16_t)0x0080) /*!< Output Compare 1Clear Enable */
+
+#define TIM_CCMR1_CC2S ((uint16_t)0x0300) /*!< CC2S[1:0] bits (Capture/Compare 2 Selection) */
+#define TIM_CCMR1_CC2S_0 ((uint16_t)0x0100) /*!< Bit 0 */
+#define TIM_CCMR1_CC2S_1 ((uint16_t)0x0200) /*!< Bit 1 */
+
+#define TIM_CCMR1_OC2FE ((uint16_t)0x0400) /*!< Output Compare 2 Fast enable */
+#define TIM_CCMR1_OC2PE ((uint16_t)0x0800) /*!< Output Compare 2 Preload enable */
+
+#define TIM_CCMR1_OC2M ((uint16_t)0x7000) /*!< OC2M[2:0] bits (Output Compare 2 Mode) */
+#define TIM_CCMR1_OC2M_0 ((uint16_t)0x1000) /*!< Bit 0 */
+#define TIM_CCMR1_OC2M_1 ((uint16_t)0x2000) /*!< Bit 1 */
+#define TIM_CCMR1_OC2M_2 ((uint16_t)0x4000) /*!< Bit 2 */
+
+#define TIM_CCMR1_OC2CE ((uint16_t)0x8000) /*!< Output Compare 2 Clear Enable */
+
+/*----------------------------------------------------------------------------*/
+
+#define TIM_CCMR1_IC1PSC ((uint16_t)0x000C) /*!< IC1PSC[1:0] bits (Input Capture 1 Prescaler) */
+#define TIM_CCMR1_IC1PSC_0 ((uint16_t)0x0004) /*!< Bit 0 */
+#define TIM_CCMR1_IC1PSC_1 ((uint16_t)0x0008) /*!< Bit 1 */
+
+#define TIM_CCMR1_IC1F ((uint16_t)0x00F0) /*!< IC1F[3:0] bits (Input Capture 1 Filter) */
+#define TIM_CCMR1_IC1F_0 ((uint16_t)0x0010) /*!< Bit 0 */
+#define TIM_CCMR1_IC1F_1 ((uint16_t)0x0020) /*!< Bit 1 */
+#define TIM_CCMR1_IC1F_2 ((uint16_t)0x0040) /*!< Bit 2 */
+#define TIM_CCMR1_IC1F_3 ((uint16_t)0x0080) /*!< Bit 3 */
+
+#define TIM_CCMR1_IC2PSC ((uint16_t)0x0C00) /*!< IC2PSC[1:0] bits (Input Capture 2 Prescaler) */
+#define TIM_CCMR1_IC2PSC_0 ((uint16_t)0x0400) /*!< Bit 0 */
+#define TIM_CCMR1_IC2PSC_1 ((uint16_t)0x0800) /*!< Bit 1 */
+
+#define TIM_CCMR1_IC2F ((uint16_t)0xF000) /*!< IC2F[3:0] bits (Input Capture 2 Filter) */
+#define TIM_CCMR1_IC2F_0 ((uint16_t)0x1000) /*!< Bit 0 */
+#define TIM_CCMR1_IC2F_1 ((uint16_t)0x2000) /*!< Bit 1 */
+#define TIM_CCMR1_IC2F_2 ((uint16_t)0x4000) /*!< Bit 2 */
+#define TIM_CCMR1_IC2F_3 ((uint16_t)0x8000) /*!< Bit 3 */
+
+/****************** Bit definition for TIM_CCMR2 register *******************/
+#define TIM_CCMR2_CC3S ((uint16_t)0x0003) /*!< CC3S[1:0] bits (Capture/Compare 3 Selection) */
+#define TIM_CCMR2_CC3S_0 ((uint16_t)0x0001) /*!< Bit 0 */
+#define TIM_CCMR2_CC3S_1 ((uint16_t)0x0002) /*!< Bit 1 */
+
+#define TIM_CCMR2_OC3FE ((uint16_t)0x0004) /*!< Output Compare 3 Fast enable */
+#define TIM_CCMR2_OC3PE ((uint16_t)0x0008) /*!< Output Compare 3 Preload enable */
+
+#define TIM_CCMR2_OC3M ((uint16_t)0x0070) /*!< OC3M[2:0] bits (Output Compare 3 Mode) */
+#define TIM_CCMR2_OC3M_0 ((uint16_t)0x0010) /*!< Bit 0 */
+#define TIM_CCMR2_OC3M_1 ((uint16_t)0x0020) /*!< Bit 1 */
+#define TIM_CCMR2_OC3M_2 ((uint16_t)0x0040) /*!< Bit 2 */
+
+#define TIM_CCMR2_OC3CE ((uint16_t)0x0080) /*!< Output Compare 3 Clear Enable */
+
+#define TIM_CCMR2_CC4S ((uint16_t)0x0300) /*!< CC4S[1:0] bits (Capture/Compare 4 Selection) */
+#define TIM_CCMR2_CC4S_0 ((uint16_t)0x0100) /*!< Bit 0 */
+#define TIM_CCMR2_CC4S_1 ((uint16_t)0x0200) /*!< Bit 1 */
+
+#define TIM_CCMR2_OC4FE ((uint16_t)0x0400) /*!< Output Compare 4 Fast enable */
+#define TIM_CCMR2_OC4PE ((uint16_t)0x0800) /*!< Output Compare 4 Preload enable */
+
+#define TIM_CCMR2_OC4M ((uint16_t)0x7000) /*!< OC4M[2:0] bits (Output Compare 4 Mode) */
+#define TIM_CCMR2_OC4M_0 ((uint16_t)0x1000) /*!< Bit 0 */
+#define TIM_CCMR2_OC4M_1 ((uint16_t)0x2000) /*!< Bit 1 */
+#define TIM_CCMR2_OC4M_2 ((uint16_t)0x4000) /*!< Bit 2 */
+
+#define TIM_CCMR2_OC4CE ((uint16_t)0x8000) /*!< Output Compare 4 Clear Enable */
+
+/*----------------------------------------------------------------------------*/
+
+#define TIM_CCMR2_IC3PSC ((uint16_t)0x000C) /*!< IC3PSC[1:0] bits (Input Capture 3 Prescaler) */
+#define TIM_CCMR2_IC3PSC_0 ((uint16_t)0x0004) /*!< Bit 0 */
+#define TIM_CCMR2_IC3PSC_1 ((uint16_t)0x0008) /*!< Bit 1 */
+
+#define TIM_CCMR2_IC3F ((uint16_t)0x00F0) /*!< IC3F[3:0] bits (Input Capture 3 Filter) */
+#define TIM_CCMR2_IC3F_0 ((uint16_t)0x0010) /*!< Bit 0 */
+#define TIM_CCMR2_IC3F_1 ((uint16_t)0x0020) /*!< Bit 1 */
+#define TIM_CCMR2_IC3F_2 ((uint16_t)0x0040) /*!< Bit 2 */
+#define TIM_CCMR2_IC3F_3 ((uint16_t)0x0080) /*!< Bit 3 */
+
+#define TIM_CCMR2_IC4PSC ((uint16_t)0x0C00) /*!< IC4PSC[1:0] bits (Input Capture 4 Prescaler) */
+#define TIM_CCMR2_IC4PSC_0 ((uint16_t)0x0400) /*!< Bit 0 */
+#define TIM_CCMR2_IC4PSC_1 ((uint16_t)0x0800) /*!< Bit 1 */
+
+#define TIM_CCMR2_IC4F ((uint16_t)0xF000) /*!< IC4F[3:0] bits (Input Capture 4 Filter) */
+#define TIM_CCMR2_IC4F_0 ((uint16_t)0x1000) /*!< Bit 0 */
+#define TIM_CCMR2_IC4F_1 ((uint16_t)0x2000) /*!< Bit 1 */
+#define TIM_CCMR2_IC4F_2 ((uint16_t)0x4000) /*!< Bit 2 */
+#define TIM_CCMR2_IC4F_3 ((uint16_t)0x8000) /*!< Bit 3 */
+
+/******************* Bit definition for TIM_CCER register *******************/
+#define TIM_CCER_CC1E ((uint16_t)0x0001) /*!< Capture/Compare 1 output enable */
+#define TIM_CCER_CC1P ((uint16_t)0x0002) /*!< Capture/Compare 1 output Polarity */
+#define TIM_CCER_CC1NE ((uint16_t)0x0004) /*!< Capture/Compare 1 Complementary output enable */
+#define TIM_CCER_CC1NP ((uint16_t)0x0008) /*!< Capture/Compare 1 Complementary output Polarity */
+#define TIM_CCER_CC2E ((uint16_t)0x0010) /*!< Capture/Compare 2 output enable */
+#define TIM_CCER_CC2P ((uint16_t)0x0020) /*!< Capture/Compare 2 output Polarity */
+#define TIM_CCER_CC2NE ((uint16_t)0x0040) /*!< Capture/Compare 2 Complementary output enable */
+#define TIM_CCER_CC2NP ((uint16_t)0x0080) /*!< Capture/Compare 2 Complementary output Polarity */
+#define TIM_CCER_CC3E ((uint16_t)0x0100) /*!< Capture/Compare 3 output enable */
+#define TIM_CCER_CC3P ((uint16_t)0x0200) /*!< Capture/Compare 3 output Polarity */
+#define TIM_CCER_CC3NE ((uint16_t)0x0400) /*!< Capture/Compare 3 Complementary output enable */
+#define TIM_CCER_CC3NP ((uint16_t)0x0800) /*!< Capture/Compare 3 Complementary output Polarity */
+#define TIM_CCER_CC4E ((uint16_t)0x1000) /*!< Capture/Compare 4 output enable */
+#define TIM_CCER_CC4P ((uint16_t)0x2000) /*!< Capture/Compare 4 output Polarity */
+#define TIM_CCER_CC4NP ((uint16_t)0x8000) /*!< Capture/Compare 4 Complementary output Polarity */
+
+/******************* Bit definition for TIM_CNT register ********************/
+#define TIM_CNT_CNT ((uint16_t)0xFFFF) /*!< Counter Value */
+
+/******************* Bit definition for TIM_PSC register ********************/
+#define TIM_PSC_PSC ((uint16_t)0xFFFF) /*!< Prescaler Value */
+
+/******************* Bit definition for TIM_ARR register ********************/
+#define TIM_ARR_ARR ((uint16_t)0xFFFF) /*!< actual auto-reload Value */
+
+/******************* Bit definition for TIM_RCR register ********************/
+#define TIM_RCR_REP ((uint8_t)0xFF) /*!< Repetition Counter Value */
+
+/******************* Bit definition for TIM_CCR1 register *******************/
+#define TIM_CCR1_CCR1 ((uint16_t)0xFFFF) /*!< Capture/Compare 1 Value */
+
+/******************* Bit definition for TIM_CCR2 register *******************/
+#define TIM_CCR2_CCR2 ((uint16_t)0xFFFF) /*!< Capture/Compare 2 Value */
+
+/******************* Bit definition for TIM_CCR3 register *******************/
+#define TIM_CCR3_CCR3 ((uint16_t)0xFFFF) /*!< Capture/Compare 3 Value */
+
+/******************* Bit definition for TIM_CCR4 register *******************/
+#define TIM_CCR4_CCR4 ((uint16_t)0xFFFF) /*!< Capture/Compare 4 Value */
+
+/******************* Bit definition for TIM_BDTR register *******************/
+#define TIM_BDTR_DTG ((uint16_t)0x00FF) /*!< DTG[0:7] bits (Dead-Time Generator set-up) */
+#define TIM_BDTR_DTG_0 ((uint16_t)0x0001) /*!< Bit 0 */
+#define TIM_BDTR_DTG_1 ((uint16_t)0x0002) /*!< Bit 1 */
+#define TIM_BDTR_DTG_2 ((uint16_t)0x0004) /*!< Bit 2 */
+#define TIM_BDTR_DTG_3 ((uint16_t)0x0008) /*!< Bit 3 */
+#define TIM_BDTR_DTG_4 ((uint16_t)0x0010) /*!< Bit 4 */
+#define TIM_BDTR_DTG_5 ((uint16_t)0x0020) /*!< Bit 5 */
+#define TIM_BDTR_DTG_6 ((uint16_t)0x0040) /*!< Bit 6 */
+#define TIM_BDTR_DTG_7 ((uint16_t)0x0080) /*!< Bit 7 */
+
+#define TIM_BDTR_LOCK ((uint16_t)0x0300) /*!< LOCK[1:0] bits (Lock Configuration) */
+#define TIM_BDTR_LOCK_0 ((uint16_t)0x0100) /*!< Bit 0 */
+#define TIM_BDTR_LOCK_1 ((uint16_t)0x0200) /*!< Bit 1 */
+
+#define TIM_BDTR_OSSI ((uint16_t)0x0400) /*!< Off-State Selection for Idle mode */
+#define TIM_BDTR_OSSR ((uint16_t)0x0800) /*!< Off-State Selection for Run mode */
+#define TIM_BDTR_BKE ((uint16_t)0x1000) /*!< Break enable */
+#define TIM_BDTR_BKP ((uint16_t)0x2000) /*!< Break Polarity */
+#define TIM_BDTR_AOE ((uint16_t)0x4000) /*!< Automatic Output enable */
+#define TIM_BDTR_MOE ((uint16_t)0x8000) /*!< Main Output enable */
+
+/******************* Bit definition for TIM_DCR register ********************/
+#define TIM_DCR_DBA ((uint16_t)0x001F) /*!< DBA[4:0] bits (DMA Base Address) */
+#define TIM_DCR_DBA_0 ((uint16_t)0x0001) /*!< Bit 0 */
+#define TIM_DCR_DBA_1 ((uint16_t)0x0002) /*!< Bit 1 */
+#define TIM_DCR_DBA_2 ((uint16_t)0x0004) /*!< Bit 2 */
+#define TIM_DCR_DBA_3 ((uint16_t)0x0008) /*!< Bit 3 */
+#define TIM_DCR_DBA_4 ((uint16_t)0x0010) /*!< Bit 4 */
+
+#define TIM_DCR_DBL ((uint16_t)0x1F00) /*!< DBL[4:0] bits (DMA Burst Length) */
+#define TIM_DCR_DBL_0 ((uint16_t)0x0100) /*!< Bit 0 */
+#define TIM_DCR_DBL_1 ((uint16_t)0x0200) /*!< Bit 1 */
+#define TIM_DCR_DBL_2 ((uint16_t)0x0400) /*!< Bit 2 */
+#define TIM_DCR_DBL_3 ((uint16_t)0x0800) /*!< Bit 3 */
+#define TIM_DCR_DBL_4 ((uint16_t)0x1000) /*!< Bit 4 */
+
+/******************* Bit definition for TIM_DMAR register *******************/
+#define TIM_DMAR_DMAB ((uint16_t)0xFFFF) /*!< DMA register for burst accesses */
+
+/******************************************************************************/
+/* */
+/* Real-Time Clock */
+/* */
+/******************************************************************************/
+
+/******************* Bit definition for RTC_CRH register ********************/
+#define RTC_CRH_SECIE ((uint8_t)0x01) /*!< Second Interrupt Enable */
+#define RTC_CRH_ALRIE ((uint8_t)0x02) /*!< Alarm Interrupt Enable */
+#define RTC_CRH_OWIE ((uint8_t)0x04) /*!< OverfloW Interrupt Enable */
+
+/******************* Bit definition for RTC_CRL register ********************/
+#define RTC_CRL_SECF ((uint8_t)0x01) /*!< Second Flag */
+#define RTC_CRL_ALRF ((uint8_t)0x02) /*!< Alarm Flag */
+#define RTC_CRL_OWF ((uint8_t)0x04) /*!< OverfloW Flag */
+#define RTC_CRL_RSF ((uint8_t)0x08) /*!< Registers Synchronized Flag */
+#define RTC_CRL_CNF ((uint8_t)0x10) /*!< Configuration Flag */
+#define RTC_CRL_RTOFF ((uint8_t)0x20) /*!< RTC operation OFF */
+
+/******************* Bit definition for RTC_PRLH register *******************/
+#define RTC_PRLH_PRL ((uint16_t)0x000F) /*!< RTC Prescaler Reload Value High */
+
+/******************* Bit definition for RTC_PRLL register *******************/
+#define RTC_PRLL_PRL ((uint16_t)0xFFFF) /*!< RTC Prescaler Reload Value Low */
+
+/******************* Bit definition for RTC_DIVH register *******************/
+#define RTC_DIVH_RTC_DIV ((uint16_t)0x000F) /*!< RTC Clock Divider High */
+
+/******************* Bit definition for RTC_DIVL register *******************/
+#define RTC_DIVL_RTC_DIV ((uint16_t)0xFFFF) /*!< RTC Clock Divider Low */
+
+/******************* Bit definition for RTC_CNTH register *******************/
+#define RTC_CNTH_RTC_CNT ((uint16_t)0xFFFF) /*!< RTC Counter High */
+
+/******************* Bit definition for RTC_CNTL register *******************/
+#define RTC_CNTL_RTC_CNT ((uint16_t)0xFFFF) /*!< RTC Counter Low */
+
+/******************* Bit definition for RTC_ALRH register *******************/
+#define RTC_ALRH_RTC_ALR ((uint16_t)0xFFFF) /*!< RTC Alarm High */
+
+/******************* Bit definition for RTC_ALRL register *******************/
+#define RTC_ALRL_RTC_ALR ((uint16_t)0xFFFF) /*!< RTC Alarm Low */
+
+/******************************************************************************/
+/* */
+/* Independent WATCHDOG */
+/* */
+/******************************************************************************/
+
+/******************* Bit definition for IWDG_KR register ********************/
+#define IWDG_KR_KEY ((uint16_t)0xFFFF) /*!< Key value (write only, read 0000h) */
+
+/******************* Bit definition for IWDG_PR register ********************/
+#define IWDG_PR_PR ((uint8_t)0x07) /*!< PR[2:0] (Prescaler divider) */
+#define IWDG_PR_PR_0 ((uint8_t)0x01) /*!< Bit 0 */
+#define IWDG_PR_PR_1 ((uint8_t)0x02) /*!< Bit 1 */
+#define IWDG_PR_PR_2 ((uint8_t)0x04) /*!< Bit 2 */
+
+/******************* Bit definition for IWDG_RLR register *******************/
+#define IWDG_RLR_RL ((uint16_t)0x0FFF) /*!< Watchdog counter reload value */
+
+/******************* Bit definition for IWDG_SR register ********************/
+#define IWDG_SR_PVU ((uint8_t)0x01) /*!< Watchdog prescaler value update */
+#define IWDG_SR_RVU ((uint8_t)0x02) /*!< Watchdog counter reload value update */
+
+/******************************************************************************/
+/* */
+/* Window WATCHDOG */
+/* */
+/******************************************************************************/
+
+/******************* Bit definition for WWDG_CR register ********************/
+#define WWDG_CR_T ((uint8_t)0x7F) /*!< T[6:0] bits (7-Bit counter (MSB to LSB)) */
+#define WWDG_CR_T0 ((uint8_t)0x01) /*!< Bit 0 */
+#define WWDG_CR_T1 ((uint8_t)0x02) /*!< Bit 1 */
+#define WWDG_CR_T2 ((uint8_t)0x04) /*!< Bit 2 */
+#define WWDG_CR_T3 ((uint8_t)0x08) /*!< Bit 3 */
+#define WWDG_CR_T4 ((uint8_t)0x10) /*!< Bit 4 */
+#define WWDG_CR_T5 ((uint8_t)0x20) /*!< Bit 5 */
+#define WWDG_CR_T6 ((uint8_t)0x40) /*!< Bit 6 */
+
+#define WWDG_CR_WDGA ((uint8_t)0x80) /*!< Activation bit */
+
+/******************* Bit definition for WWDG_CFR register *******************/
+#define WWDG_CFR_W ((uint16_t)0x007F) /*!< W[6:0] bits (7-bit window value) */
+#define WWDG_CFR_W0 ((uint16_t)0x0001) /*!< Bit 0 */
+#define WWDG_CFR_W1 ((uint16_t)0x0002) /*!< Bit 1 */
+#define WWDG_CFR_W2 ((uint16_t)0x0004) /*!< Bit 2 */
+#define WWDG_CFR_W3 ((uint16_t)0x0008) /*!< Bit 3 */
+#define WWDG_CFR_W4 ((uint16_t)0x0010) /*!< Bit 4 */
+#define WWDG_CFR_W5 ((uint16_t)0x0020) /*!< Bit 5 */
+#define WWDG_CFR_W6 ((uint16_t)0x0040) /*!< Bit 6 */
+
+#define WWDG_CFR_WDGTB ((uint16_t)0x0180) /*!< WDGTB[1:0] bits (Timer Base) */
+#define WWDG_CFR_WDGTB0 ((uint16_t)0x0080) /*!< Bit 0 */
+#define WWDG_CFR_WDGTB1 ((uint16_t)0x0100) /*!< Bit 1 */
+
+#define WWDG_CFR_EWI ((uint16_t)0x0200) /*!< Early Wakeup Interrupt */
+
+/******************* Bit definition for WWDG_SR register ********************/
+#define WWDG_SR_EWIF ((uint8_t)0x01) /*!< Early Wakeup Interrupt Flag */
+
+/******************************************************************************/
+/* */
+/* Flexible Static Memory Controller */
+/* */
+/******************************************************************************/
+
+/****************** Bit definition for FSMC_BCR1 register *******************/
+#define FSMC_BCR1_MBKEN ((uint32_t)0x00000001) /*!< Memory bank enable bit */
+#define FSMC_BCR1_MUXEN ((uint32_t)0x00000002) /*!< Address/data multiplexing enable bit */
+
+#define FSMC_BCR1_MTYP ((uint32_t)0x0000000C) /*!< MTYP[1:0] bits (Memory type) */
+#define FSMC_BCR1_MTYP_0 ((uint32_t)0x00000004) /*!< Bit 0 */
+#define FSMC_BCR1_MTYP_1 ((uint32_t)0x00000008) /*!< Bit 1 */
+
+#define FSMC_BCR1_MWID ((uint32_t)0x00000030) /*!< MWID[1:0] bits (Memory data bus width) */
+#define FSMC_BCR1_MWID_0 ((uint32_t)0x00000010) /*!< Bit 0 */
+#define FSMC_BCR1_MWID_1 ((uint32_t)0x00000020) /*!< Bit 1 */
+
+#define FSMC_BCR1_FACCEN ((uint32_t)0x00000040) /*!< Flash access enable */
+#define FSMC_BCR1_BURSTEN ((uint32_t)0x00000100) /*!< Burst enable bit */
+#define FSMC_BCR1_WAITPOL ((uint32_t)0x00000200) /*!< Wait signal polarity bit */
+#define FSMC_BCR1_WRAPMOD ((uint32_t)0x00000400) /*!< Wrapped burst mode support */
+#define FSMC_BCR1_WAITCFG ((uint32_t)0x00000800) /*!< Wait timing configuration */
+#define FSMC_BCR1_WREN ((uint32_t)0x00001000) /*!< Write enable bit */
+#define FSMC_BCR1_WAITEN ((uint32_t)0x00002000) /*!< Wait enable bit */
+#define FSMC_BCR1_EXTMOD ((uint32_t)0x00004000) /*!< Extended mode enable */
+#define FSMC_BCR1_ASYNCWAIT ((uint32_t)0x00008000) /*!< Asynchronous wait */
+#define FSMC_BCR1_CBURSTRW ((uint32_t)0x00080000) /*!< Write burst enable */
+
+/****************** Bit definition for FSMC_BCR2 register *******************/
+#define FSMC_BCR2_MBKEN ((uint32_t)0x00000001) /*!< Memory bank enable bit */
+#define FSMC_BCR2_MUXEN ((uint32_t)0x00000002) /*!< Address/data multiplexing enable bit */
+
+#define FSMC_BCR2_MTYP ((uint32_t)0x0000000C) /*!< MTYP[1:0] bits (Memory type) */
+#define FSMC_BCR2_MTYP_0 ((uint32_t)0x00000004) /*!< Bit 0 */
+#define FSMC_BCR2_MTYP_1 ((uint32_t)0x00000008) /*!< Bit 1 */
+
+#define FSMC_BCR2_MWID ((uint32_t)0x00000030) /*!< MWID[1:0] bits (Memory data bus width) */
+#define FSMC_BCR2_MWID_0 ((uint32_t)0x00000010) /*!< Bit 0 */
+#define FSMC_BCR2_MWID_1 ((uint32_t)0x00000020) /*!< Bit 1 */
+
+#define FSMC_BCR2_FACCEN ((uint32_t)0x00000040) /*!< Flash access enable */
+#define FSMC_BCR2_BURSTEN ((uint32_t)0x00000100) /*!< Burst enable bit */
+#define FSMC_BCR2_WAITPOL ((uint32_t)0x00000200) /*!< Wait signal polarity bit */
+#define FSMC_BCR2_WRAPMOD ((uint32_t)0x00000400) /*!< Wrapped burst mode support */
+#define FSMC_BCR2_WAITCFG ((uint32_t)0x00000800) /*!< Wait timing configuration */
+#define FSMC_BCR2_WREN ((uint32_t)0x00001000) /*!< Write enable bit */
+#define FSMC_BCR2_WAITEN ((uint32_t)0x00002000) /*!< Wait enable bit */
+#define FSMC_BCR2_EXTMOD ((uint32_t)0x00004000) /*!< Extended mode enable */
+#define FSMC_BCR2_ASYNCWAIT ((uint32_t)0x00008000) /*!< Asynchronous wait */
+#define FSMC_BCR2_CBURSTRW ((uint32_t)0x00080000) /*!< Write burst enable */
+
+/****************** Bit definition for FSMC_BCR3 register *******************/
+#define FSMC_BCR3_MBKEN ((uint32_t)0x00000001) /*!< Memory bank enable bit */
+#define FSMC_BCR3_MUXEN ((uint32_t)0x00000002) /*!< Address/data multiplexing enable bit */
+
+#define FSMC_BCR3_MTYP ((uint32_t)0x0000000C) /*!< MTYP[1:0] bits (Memory type) */
+#define FSMC_BCR3_MTYP_0 ((uint32_t)0x00000004) /*!< Bit 0 */
+#define FSMC_BCR3_MTYP_1 ((uint32_t)0x00000008) /*!< Bit 1 */
+
+#define FSMC_BCR3_MWID ((uint32_t)0x00000030) /*!< MWID[1:0] bits (Memory data bus width) */
+#define FSMC_BCR3_MWID_0 ((uint32_t)0x00000010) /*!< Bit 0 */
+#define FSMC_BCR3_MWID_1 ((uint32_t)0x00000020) /*!< Bit 1 */
+
+#define FSMC_BCR3_FACCEN ((uint32_t)0x00000040) /*!< Flash access enable */
+#define FSMC_BCR3_BURSTEN ((uint32_t)0x00000100) /*!< Burst enable bit */
+#define FSMC_BCR3_WAITPOL ((uint32_t)0x00000200) /*!< Wait signal polarity bit. */
+#define FSMC_BCR3_WRAPMOD ((uint32_t)0x00000400) /*!< Wrapped burst mode support */
+#define FSMC_BCR3_WAITCFG ((uint32_t)0x00000800) /*!< Wait timing configuration */
+#define FSMC_BCR3_WREN ((uint32_t)0x00001000) /*!< Write enable bit */
+#define FSMC_BCR3_WAITEN ((uint32_t)0x00002000) /*!< Wait enable bit */
+#define FSMC_BCR3_EXTMOD ((uint32_t)0x00004000) /*!< Extended mode enable */
+#define FSMC_BCR3_ASYNCWAIT ((uint32_t)0x00008000) /*!< Asynchronous wait */
+#define FSMC_BCR3_CBURSTRW ((uint32_t)0x00080000) /*!< Write burst enable */
+
+/****************** Bit definition for FSMC_BCR4 register *******************/
+#define FSMC_BCR4_MBKEN ((uint32_t)0x00000001) /*!< Memory bank enable bit */
+#define FSMC_BCR4_MUXEN ((uint32_t)0x00000002) /*!< Address/data multiplexing enable bit */
+
+#define FSMC_BCR4_MTYP ((uint32_t)0x0000000C) /*!< MTYP[1:0] bits (Memory type) */
+#define FSMC_BCR4_MTYP_0 ((uint32_t)0x00000004) /*!< Bit 0 */
+#define FSMC_BCR4_MTYP_1 ((uint32_t)0x00000008) /*!< Bit 1 */
+
+#define FSMC_BCR4_MWID ((uint32_t)0x00000030) /*!< MWID[1:0] bits (Memory data bus width) */
+#define FSMC_BCR4_MWID_0 ((uint32_t)0x00000010) /*!< Bit 0 */
+#define FSMC_BCR4_MWID_1 ((uint32_t)0x00000020) /*!< Bit 1 */
+
+#define FSMC_BCR4_FACCEN ((uint32_t)0x00000040) /*!< Flash access enable */
+#define FSMC_BCR4_BURSTEN ((uint32_t)0x00000100) /*!< Burst enable bit */
+#define FSMC_BCR4_WAITPOL ((uint32_t)0x00000200) /*!< Wait signal polarity bit */
+#define FSMC_BCR4_WRAPMOD ((uint32_t)0x00000400) /*!< Wrapped burst mode support */
+#define FSMC_BCR4_WAITCFG ((uint32_t)0x00000800) /*!< Wait timing configuration */
+#define FSMC_BCR4_WREN ((uint32_t)0x00001000) /*!< Write enable bit */
+#define FSMC_BCR4_WAITEN ((uint32_t)0x00002000) /*!< Wait enable bit */
+#define FSMC_BCR4_EXTMOD ((uint32_t)0x00004000) /*!< Extended mode enable */
+#define FSMC_BCR4_ASYNCWAIT ((uint32_t)0x00008000) /*!< Asynchronous wait */
+#define FSMC_BCR4_CBURSTRW ((uint32_t)0x00080000) /*!< Write burst enable */
+
+/****************** Bit definition for FSMC_BTR1 register ******************/
+#define FSMC_BTR1_ADDSET ((uint32_t)0x0000000F) /*!< ADDSET[3:0] bits (Address setup phase duration) */
+#define FSMC_BTR1_ADDSET_0 ((uint32_t)0x00000001) /*!< Bit 0 */
+#define FSMC_BTR1_ADDSET_1 ((uint32_t)0x00000002) /*!< Bit 1 */
+#define FSMC_BTR1_ADDSET_2 ((uint32_t)0x00000004) /*!< Bit 2 */
+#define FSMC_BTR1_ADDSET_3 ((uint32_t)0x00000008) /*!< Bit 3 */
+
+#define FSMC_BTR1_ADDHLD ((uint32_t)0x000000F0) /*!< ADDHLD[3:0] bits (Address-hold phase duration) */
+#define FSMC_BTR1_ADDHLD_0 ((uint32_t)0x00000010) /*!< Bit 0 */
+#define FSMC_BTR1_ADDHLD_1 ((uint32_t)0x00000020) /*!< Bit 1 */
+#define FSMC_BTR1_ADDHLD_2 ((uint32_t)0x00000040) /*!< Bit 2 */
+#define FSMC_BTR1_ADDHLD_3 ((uint32_t)0x00000080) /*!< Bit 3 */
+
+#define FSMC_BTR1_DATAST ((uint32_t)0x0000FF00) /*!< DATAST [3:0] bits (Data-phase duration) */
+#define FSMC_BTR1_DATAST_0 ((uint32_t)0x00000100) /*!< Bit 0 */
+#define FSMC_BTR1_DATAST_1 ((uint32_t)0x00000200) /*!< Bit 1 */
+#define FSMC_BTR1_DATAST_2 ((uint32_t)0x00000400) /*!< Bit 2 */
+#define FSMC_BTR1_DATAST_3 ((uint32_t)0x00000800) /*!< Bit 3 */
+
+#define FSMC_BTR1_BUSTURN ((uint32_t)0x000F0000) /*!< BUSTURN[3:0] bits (Bus turnaround phase duration) */
+#define FSMC_BTR1_BUSTURN_0 ((uint32_t)0x00010000) /*!< Bit 0 */
+#define FSMC_BTR1_BUSTURN_1 ((uint32_t)0x00020000) /*!< Bit 1 */
+#define FSMC_BTR1_BUSTURN_2 ((uint32_t)0x00040000) /*!< Bit 2 */
+#define FSMC_BTR1_BUSTURN_3 ((uint32_t)0x00080000) /*!< Bit 3 */
+
+#define FSMC_BTR1_CLKDIV ((uint32_t)0x00F00000) /*!< CLKDIV[3:0] bits (Clock divide ratio) */
+#define FSMC_BTR1_CLKDIV_0 ((uint32_t)0x00100000) /*!< Bit 0 */
+#define FSMC_BTR1_CLKDIV_1 ((uint32_t)0x00200000) /*!< Bit 1 */
+#define FSMC_BTR1_CLKDIV_2 ((uint32_t)0x00400000) /*!< Bit 2 */
+#define FSMC_BTR1_CLKDIV_3 ((uint32_t)0x00800000) /*!< Bit 3 */
+
+#define FSMC_BTR1_DATLAT ((uint32_t)0x0F000000) /*!< DATLA[3:0] bits (Data latency) */
+#define FSMC_BTR1_DATLAT_0 ((uint32_t)0x01000000) /*!< Bit 0 */
+#define FSMC_BTR1_DATLAT_1 ((uint32_t)0x02000000) /*!< Bit 1 */
+#define FSMC_BTR1_DATLAT_2 ((uint32_t)0x04000000) /*!< Bit 2 */
+#define FSMC_BTR1_DATLAT_3 ((uint32_t)0x08000000) /*!< Bit 3 */
+
+#define FSMC_BTR1_ACCMOD ((uint32_t)0x30000000) /*!< ACCMOD[1:0] bits (Access mode) */
+#define FSMC_BTR1_ACCMOD_0 ((uint32_t)0x10000000) /*!< Bit 0 */
+#define FSMC_BTR1_ACCMOD_1 ((uint32_t)0x20000000) /*!< Bit 1 */
+
+/****************** Bit definition for FSMC_BTR2 register *******************/
+#define FSMC_BTR2_ADDSET ((uint32_t)0x0000000F) /*!< ADDSET[3:0] bits (Address setup phase duration) */
+#define FSMC_BTR2_ADDSET_0 ((uint32_t)0x00000001) /*!< Bit 0 */
+#define FSMC_BTR2_ADDSET_1 ((uint32_t)0x00000002) /*!< Bit 1 */
+#define FSMC_BTR2_ADDSET_2 ((uint32_t)0x00000004) /*!< Bit 2 */
+#define FSMC_BTR2_ADDSET_3 ((uint32_t)0x00000008) /*!< Bit 3 */
+
+#define FSMC_BTR2_ADDHLD ((uint32_t)0x000000F0) /*!< ADDHLD[3:0] bits (Address-hold phase duration) */
+#define FSMC_BTR2_ADDHLD_0 ((uint32_t)0x00000010) /*!< Bit 0 */
+#define FSMC_BTR2_ADDHLD_1 ((uint32_t)0x00000020) /*!< Bit 1 */
+#define FSMC_BTR2_ADDHLD_2 ((uint32_t)0x00000040) /*!< Bit 2 */
+#define FSMC_BTR2_ADDHLD_3 ((uint32_t)0x00000080) /*!< Bit 3 */
+
+#define FSMC_BTR2_DATAST ((uint32_t)0x0000FF00) /*!< DATAST [3:0] bits (Data-phase duration) */
+#define FSMC_BTR2_DATAST_0 ((uint32_t)0x00000100) /*!< Bit 0 */
+#define FSMC_BTR2_DATAST_1 ((uint32_t)0x00000200) /*!< Bit 1 */
+#define FSMC_BTR2_DATAST_2 ((uint32_t)0x00000400) /*!< Bit 2 */
+#define FSMC_BTR2_DATAST_3 ((uint32_t)0x00000800) /*!< Bit 3 */
+
+#define FSMC_BTR2_BUSTURN ((uint32_t)0x000F0000) /*!< BUSTURN[3:0] bits (Bus turnaround phase duration) */
+#define FSMC_BTR2_BUSTURN_0 ((uint32_t)0x00010000) /*!< Bit 0 */
+#define FSMC_BTR2_BUSTURN_1 ((uint32_t)0x00020000) /*!< Bit 1 */
+#define FSMC_BTR2_BUSTURN_2 ((uint32_t)0x00040000) /*!< Bit 2 */
+#define FSMC_BTR2_BUSTURN_3 ((uint32_t)0x00080000) /*!< Bit 3 */
+
+#define FSMC_BTR2_CLKDIV ((uint32_t)0x00F00000) /*!< CLKDIV[3:0] bits (Clock divide ratio) */
+#define FSMC_BTR2_CLKDIV_0 ((uint32_t)0x00100000) /*!< Bit 0 */
+#define FSMC_BTR2_CLKDIV_1 ((uint32_t)0x00200000) /*!< Bit 1 */
+#define FSMC_BTR2_CLKDIV_2 ((uint32_t)0x00400000) /*!< Bit 2 */
+#define FSMC_BTR2_CLKDIV_3 ((uint32_t)0x00800000) /*!< Bit 3 */
+
+#define FSMC_BTR2_DATLAT ((uint32_t)0x0F000000) /*!< DATLA[3:0] bits (Data latency) */
+#define FSMC_BTR2_DATLAT_0 ((uint32_t)0x01000000) /*!< Bit 0 */
+#define FSMC_BTR2_DATLAT_1 ((uint32_t)0x02000000) /*!< Bit 1 */
+#define FSMC_BTR2_DATLAT_2 ((uint32_t)0x04000000) /*!< Bit 2 */
+#define FSMC_BTR2_DATLAT_3 ((uint32_t)0x08000000) /*!< Bit 3 */
+
+#define FSMC_BTR2_ACCMOD ((uint32_t)0x30000000) /*!< ACCMOD[1:0] bits (Access mode) */
+#define FSMC_BTR2_ACCMOD_0 ((uint32_t)0x10000000) /*!< Bit 0 */
+#define FSMC_BTR2_ACCMOD_1 ((uint32_t)0x20000000) /*!< Bit 1 */
+
+/******************* Bit definition for FSMC_BTR3 register *******************/
+#define FSMC_BTR3_ADDSET ((uint32_t)0x0000000F) /*!< ADDSET[3:0] bits (Address setup phase duration) */
+#define FSMC_BTR3_ADDSET_0 ((uint32_t)0x00000001) /*!< Bit 0 */
+#define FSMC_BTR3_ADDSET_1 ((uint32_t)0x00000002) /*!< Bit 1 */
+#define FSMC_BTR3_ADDSET_2 ((uint32_t)0x00000004) /*!< Bit 2 */
+#define FSMC_BTR3_ADDSET_3 ((uint32_t)0x00000008) /*!< Bit 3 */
+
+#define FSMC_BTR3_ADDHLD ((uint32_t)0x000000F0) /*!< ADDHLD[3:0] bits (Address-hold phase duration) */
+#define FSMC_BTR3_ADDHLD_0 ((uint32_t)0x00000010) /*!< Bit 0 */
+#define FSMC_BTR3_ADDHLD_1 ((uint32_t)0x00000020) /*!< Bit 1 */
+#define FSMC_BTR3_ADDHLD_2 ((uint32_t)0x00000040) /*!< Bit 2 */
+#define FSMC_BTR3_ADDHLD_3 ((uint32_t)0x00000080) /*!< Bit 3 */
+
+#define FSMC_BTR3_DATAST ((uint32_t)0x0000FF00) /*!< DATAST [3:0] bits (Data-phase duration) */
+#define FSMC_BTR3_DATAST_0 ((uint32_t)0x00000100) /*!< Bit 0 */
+#define FSMC_BTR3_DATAST_1 ((uint32_t)0x00000200) /*!< Bit 1 */
+#define FSMC_BTR3_DATAST_2 ((uint32_t)0x00000400) /*!< Bit 2 */
+#define FSMC_BTR3_DATAST_3 ((uint32_t)0x00000800) /*!< Bit 3 */
+
+#define FSMC_BTR3_BUSTURN ((uint32_t)0x000F0000) /*!< BUSTURN[3:0] bits (Bus turnaround phase duration) */
+#define FSMC_BTR3_BUSTURN_0 ((uint32_t)0x00010000) /*!< Bit 0 */
+#define FSMC_BTR3_BUSTURN_1 ((uint32_t)0x00020000) /*!< Bit 1 */
+#define FSMC_BTR3_BUSTURN_2 ((uint32_t)0x00040000) /*!< Bit 2 */
+#define FSMC_BTR3_BUSTURN_3 ((uint32_t)0x00080000) /*!< Bit 3 */
+
+#define FSMC_BTR3_CLKDIV ((uint32_t)0x00F00000) /*!< CLKDIV[3:0] bits (Clock divide ratio) */
+#define FSMC_BTR3_CLKDIV_0 ((uint32_t)0x00100000) /*!< Bit 0 */
+#define FSMC_BTR3_CLKDIV_1 ((uint32_t)0x00200000) /*!< Bit 1 */
+#define FSMC_BTR3_CLKDIV_2 ((uint32_t)0x00400000) /*!< Bit 2 */
+#define FSMC_BTR3_CLKDIV_3 ((uint32_t)0x00800000) /*!< Bit 3 */
+
+#define FSMC_BTR3_DATLAT ((uint32_t)0x0F000000) /*!< DATLA[3:0] bits (Data latency) */
+#define FSMC_BTR3_DATLAT_0 ((uint32_t)0x01000000) /*!< Bit 0 */
+#define FSMC_BTR3_DATLAT_1 ((uint32_t)0x02000000) /*!< Bit 1 */
+#define FSMC_BTR3_DATLAT_2 ((uint32_t)0x04000000) /*!< Bit 2 */
+#define FSMC_BTR3_DATLAT_3 ((uint32_t)0x08000000) /*!< Bit 3 */
+
+#define FSMC_BTR3_ACCMOD ((uint32_t)0x30000000) /*!< ACCMOD[1:0] bits (Access mode) */
+#define FSMC_BTR3_ACCMOD_0 ((uint32_t)0x10000000) /*!< Bit 0 */
+#define FSMC_BTR3_ACCMOD_1 ((uint32_t)0x20000000) /*!< Bit 1 */
+
+/****************** Bit definition for FSMC_BTR4 register *******************/
+#define FSMC_BTR4_ADDSET ((uint32_t)0x0000000F) /*!< ADDSET[3:0] bits (Address setup phase duration) */
+#define FSMC_BTR4_ADDSET_0 ((uint32_t)0x00000001) /*!< Bit 0 */
+#define FSMC_BTR4_ADDSET_1 ((uint32_t)0x00000002) /*!< Bit 1 */
+#define FSMC_BTR4_ADDSET_2 ((uint32_t)0x00000004) /*!< Bit 2 */
+#define FSMC_BTR4_ADDSET_3 ((uint32_t)0x00000008) /*!< Bit 3 */
+
+#define FSMC_BTR4_ADDHLD ((uint32_t)0x000000F0) /*!< ADDHLD[3:0] bits (Address-hold phase duration) */
+#define FSMC_BTR4_ADDHLD_0 ((uint32_t)0x00000010) /*!< Bit 0 */
+#define FSMC_BTR4_ADDHLD_1 ((uint32_t)0x00000020) /*!< Bit 1 */
+#define FSMC_BTR4_ADDHLD_2 ((uint32_t)0x00000040) /*!< Bit 2 */
+#define FSMC_BTR4_ADDHLD_3 ((uint32_t)0x00000080) /*!< Bit 3 */
+
+#define FSMC_BTR4_DATAST ((uint32_t)0x0000FF00) /*!< DATAST [3:0] bits (Data-phase duration) */
+#define FSMC_BTR4_DATAST_0 ((uint32_t)0x00000100) /*!< Bit 0 */
+#define FSMC_BTR4_DATAST_1 ((uint32_t)0x00000200) /*!< Bit 1 */
+#define FSMC_BTR4_DATAST_2 ((uint32_t)0x00000400) /*!< Bit 2 */
+#define FSMC_BTR4_DATAST_3 ((uint32_t)0x00000800) /*!< Bit 3 */
+
+#define FSMC_BTR4_BUSTURN ((uint32_t)0x000F0000) /*!< BUSTURN[3:0] bits (Bus turnaround phase duration) */
+#define FSMC_BTR4_BUSTURN_0 ((uint32_t)0x00010000) /*!< Bit 0 */
+#define FSMC_BTR4_BUSTURN_1 ((uint32_t)0x00020000) /*!< Bit 1 */
+#define FSMC_BTR4_BUSTURN_2 ((uint32_t)0x00040000) /*!< Bit 2 */
+#define FSMC_BTR4_BUSTURN_3 ((uint32_t)0x00080000) /*!< Bit 3 */
+
+#define FSMC_BTR4_CLKDIV ((uint32_t)0x00F00000) /*!< CLKDIV[3:0] bits (Clock divide ratio) */
+#define FSMC_BTR4_CLKDIV_0 ((uint32_t)0x00100000) /*!< Bit 0 */
+#define FSMC_BTR4_CLKDIV_1 ((uint32_t)0x00200000) /*!< Bit 1 */
+#define FSMC_BTR4_CLKDIV_2 ((uint32_t)0x00400000) /*!< Bit 2 */
+#define FSMC_BTR4_CLKDIV_3 ((uint32_t)0x00800000) /*!< Bit 3 */
+
+#define FSMC_BTR4_DATLAT ((uint32_t)0x0F000000) /*!< DATLA[3:0] bits (Data latency) */
+#define FSMC_BTR4_DATLAT_0 ((uint32_t)0x01000000) /*!< Bit 0 */
+#define FSMC_BTR4_DATLAT_1 ((uint32_t)0x02000000) /*!< Bit 1 */
+#define FSMC_BTR4_DATLAT_2 ((uint32_t)0x04000000) /*!< Bit 2 */
+#define FSMC_BTR4_DATLAT_3 ((uint32_t)0x08000000) /*!< Bit 3 */
+
+#define FSMC_BTR4_ACCMOD ((uint32_t)0x30000000) /*!< ACCMOD[1:0] bits (Access mode) */
+#define FSMC_BTR4_ACCMOD_0 ((uint32_t)0x10000000) /*!< Bit 0 */
+#define FSMC_BTR4_ACCMOD_1 ((uint32_t)0x20000000) /*!< Bit 1 */
+
+/****************** Bit definition for FSMC_BWTR1 register ******************/
+#define FSMC_BWTR1_ADDSET ((uint32_t)0x0000000F) /*!< ADDSET[3:0] bits (Address setup phase duration) */
+#define FSMC_BWTR1_ADDSET_0 ((uint32_t)0x00000001) /*!< Bit 0 */
+#define FSMC_BWTR1_ADDSET_1 ((uint32_t)0x00000002) /*!< Bit 1 */
+#define FSMC_BWTR1_ADDSET_2 ((uint32_t)0x00000004) /*!< Bit 2 */
+#define FSMC_BWTR1_ADDSET_3 ((uint32_t)0x00000008) /*!< Bit 3 */
+
+#define FSMC_BWTR1_ADDHLD ((uint32_t)0x000000F0) /*!< ADDHLD[3:0] bits (Address-hold phase duration) */
+#define FSMC_BWTR1_ADDHLD_0 ((uint32_t)0x00000010) /*!< Bit 0 */
+#define FSMC_BWTR1_ADDHLD_1 ((uint32_t)0x00000020) /*!< Bit 1 */
+#define FSMC_BWTR1_ADDHLD_2 ((uint32_t)0x00000040) /*!< Bit 2 */
+#define FSMC_BWTR1_ADDHLD_3 ((uint32_t)0x00000080) /*!< Bit 3 */
+
+#define FSMC_BWTR1_DATAST ((uint32_t)0x0000FF00) /*!< DATAST [3:0] bits (Data-phase duration) */
+#define FSMC_BWTR1_DATAST_0 ((uint32_t)0x00000100) /*!< Bit 0 */
+#define FSMC_BWTR1_DATAST_1 ((uint32_t)0x00000200) /*!< Bit 1 */
+#define FSMC_BWTR1_DATAST_2 ((uint32_t)0x00000400) /*!< Bit 2 */
+#define FSMC_BWTR1_DATAST_3 ((uint32_t)0x00000800) /*!< Bit 3 */
+
+#define FSMC_BWTR1_CLKDIV ((uint32_t)0x00F00000) /*!< CLKDIV[3:0] bits (Clock divide ratio) */
+#define FSMC_BWTR1_CLKDIV_0 ((uint32_t)0x00100000) /*!< Bit 0 */
+#define FSMC_BWTR1_CLKDIV_1 ((uint32_t)0x00200000) /*!< Bit 1 */
+#define FSMC_BWTR1_CLKDIV_2 ((uint32_t)0x00400000) /*!< Bit 2 */
+#define FSMC_BWTR1_CLKDIV_3 ((uint32_t)0x00800000) /*!< Bit 3 */
+
+#define FSMC_BWTR1_DATLAT ((uint32_t)0x0F000000) /*!< DATLA[3:0] bits (Data latency) */
+#define FSMC_BWTR1_DATLAT_0 ((uint32_t)0x01000000) /*!< Bit 0 */
+#define FSMC_BWTR1_DATLAT_1 ((uint32_t)0x02000000) /*!< Bit 1 */
+#define FSMC_BWTR1_DATLAT_2 ((uint32_t)0x04000000) /*!< Bit 2 */
+#define FSMC_BWTR1_DATLAT_3 ((uint32_t)0x08000000) /*!< Bit 3 */
+
+#define FSMC_BWTR1_ACCMOD ((uint32_t)0x30000000) /*!< ACCMOD[1:0] bits (Access mode) */
+#define FSMC_BWTR1_ACCMOD_0 ((uint32_t)0x10000000) /*!< Bit 0 */
+#define FSMC_BWTR1_ACCMOD_1 ((uint32_t)0x20000000) /*!< Bit 1 */
+
+/****************** Bit definition for FSMC_BWTR2 register ******************/
+#define FSMC_BWTR2_ADDSET ((uint32_t)0x0000000F) /*!< ADDSET[3:0] bits (Address setup phase duration) */
+#define FSMC_BWTR2_ADDSET_0 ((uint32_t)0x00000001) /*!< Bit 0 */
+#define FSMC_BWTR2_ADDSET_1 ((uint32_t)0x00000002) /*!< Bit 1 */
+#define FSMC_BWTR2_ADDSET_2 ((uint32_t)0x00000004) /*!< Bit 2 */
+#define FSMC_BWTR2_ADDSET_3 ((uint32_t)0x00000008) /*!< Bit 3 */
+
+#define FSMC_BWTR2_ADDHLD ((uint32_t)0x000000F0) /*!< ADDHLD[3:0] bits (Address-hold phase duration) */
+#define FSMC_BWTR2_ADDHLD_0 ((uint32_t)0x00000010) /*!< Bit 0 */
+#define FSMC_BWTR2_ADDHLD_1 ((uint32_t)0x00000020) /*!< Bit 1 */
+#define FSMC_BWTR2_ADDHLD_2 ((uint32_t)0x00000040) /*!< Bit 2 */
+#define FSMC_BWTR2_ADDHLD_3 ((uint32_t)0x00000080) /*!< Bit 3 */
+
+#define FSMC_BWTR2_DATAST ((uint32_t)0x0000FF00) /*!< DATAST [3:0] bits (Data-phase duration) */
+#define FSMC_BWTR2_DATAST_0 ((uint32_t)0x00000100) /*!< Bit 0 */
+#define FSMC_BWTR2_DATAST_1 ((uint32_t)0x00000200) /*!< Bit 1 */
+#define FSMC_BWTR2_DATAST_2 ((uint32_t)0x00000400) /*!< Bit 2 */
+#define FSMC_BWTR2_DATAST_3 ((uint32_t)0x00000800) /*!< Bit 3 */
+
+#define FSMC_BWTR2_CLKDIV ((uint32_t)0x00F00000) /*!< CLKDIV[3:0] bits (Clock divide ratio) */
+#define FSMC_BWTR2_CLKDIV_0 ((uint32_t)0x00100000) /*!< Bit 0 */
+#define FSMC_BWTR2_CLKDIV_1 ((uint32_t)0x00200000) /*!< Bit 1*/
+#define FSMC_BWTR2_CLKDIV_2 ((uint32_t)0x00400000) /*!< Bit 2 */
+#define FSMC_BWTR2_CLKDIV_3 ((uint32_t)0x00800000) /*!< Bit 3 */
+
+#define FSMC_BWTR2_DATLAT ((uint32_t)0x0F000000) /*!< DATLA[3:0] bits (Data latency) */
+#define FSMC_BWTR2_DATLAT_0 ((uint32_t)0x01000000) /*!< Bit 0 */
+#define FSMC_BWTR2_DATLAT_1 ((uint32_t)0x02000000) /*!< Bit 1 */
+#define FSMC_BWTR2_DATLAT_2 ((uint32_t)0x04000000) /*!< Bit 2 */
+#define FSMC_BWTR2_DATLAT_3 ((uint32_t)0x08000000) /*!< Bit 3 */
+
+#define FSMC_BWTR2_ACCMOD ((uint32_t)0x30000000) /*!< ACCMOD[1:0] bits (Access mode) */
+#define FSMC_BWTR2_ACCMOD_0 ((uint32_t)0x10000000) /*!< Bit 0 */
+#define FSMC_BWTR2_ACCMOD_1 ((uint32_t)0x20000000) /*!< Bit 1 */
+
+/****************** Bit definition for FSMC_BWTR3 register ******************/
+#define FSMC_BWTR3_ADDSET ((uint32_t)0x0000000F) /*!< ADDSET[3:0] bits (Address setup phase duration) */
+#define FSMC_BWTR3_ADDSET_0 ((uint32_t)0x00000001) /*!< Bit 0 */
+#define FSMC_BWTR3_ADDSET_1 ((uint32_t)0x00000002) /*!< Bit 1 */
+#define FSMC_BWTR3_ADDSET_2 ((uint32_t)0x00000004) /*!< Bit 2 */
+#define FSMC_BWTR3_ADDSET_3 ((uint32_t)0x00000008) /*!< Bit 3 */
+
+#define FSMC_BWTR3_ADDHLD ((uint32_t)0x000000F0) /*!< ADDHLD[3:0] bits (Address-hold phase duration) */
+#define FSMC_BWTR3_ADDHLD_0 ((uint32_t)0x00000010) /*!< Bit 0 */
+#define FSMC_BWTR3_ADDHLD_1 ((uint32_t)0x00000020) /*!< Bit 1 */
+#define FSMC_BWTR3_ADDHLD_2 ((uint32_t)0x00000040) /*!< Bit 2 */
+#define FSMC_BWTR3_ADDHLD_3 ((uint32_t)0x00000080) /*!< Bit 3 */
+
+#define FSMC_BWTR3_DATAST ((uint32_t)0x0000FF00) /*!< DATAST [3:0] bits (Data-phase duration) */
+#define FSMC_BWTR3_DATAST_0 ((uint32_t)0x00000100) /*!< Bit 0 */
+#define FSMC_BWTR3_DATAST_1 ((uint32_t)0x00000200) /*!< Bit 1 */
+#define FSMC_BWTR3_DATAST_2 ((uint32_t)0x00000400) /*!< Bit 2 */
+#define FSMC_BWTR3_DATAST_3 ((uint32_t)0x00000800) /*!< Bit 3 */
+
+#define FSMC_BWTR3_CLKDIV ((uint32_t)0x00F00000) /*!< CLKDIV[3:0] bits (Clock divide ratio) */
+#define FSMC_BWTR3_CLKDIV_0 ((uint32_t)0x00100000) /*!< Bit 0 */
+#define FSMC_BWTR3_CLKDIV_1 ((uint32_t)0x00200000) /*!< Bit 1 */
+#define FSMC_BWTR3_CLKDIV_2 ((uint32_t)0x00400000) /*!< Bit 2 */
+#define FSMC_BWTR3_CLKDIV_3 ((uint32_t)0x00800000) /*!< Bit 3 */
+
+#define FSMC_BWTR3_DATLAT ((uint32_t)0x0F000000) /*!< DATLA[3:0] bits (Data latency) */
+#define FSMC_BWTR3_DATLAT_0 ((uint32_t)0x01000000) /*!< Bit 0 */
+#define FSMC_BWTR3_DATLAT_1 ((uint32_t)0x02000000) /*!< Bit 1 */
+#define FSMC_BWTR3_DATLAT_2 ((uint32_t)0x04000000) /*!< Bit 2 */
+#define FSMC_BWTR3_DATLAT_3 ((uint32_t)0x08000000) /*!< Bit 3 */
+
+#define FSMC_BWTR3_ACCMOD ((uint32_t)0x30000000) /*!< ACCMOD[1:0] bits (Access mode) */
+#define FSMC_BWTR3_ACCMOD_0 ((uint32_t)0x10000000) /*!< Bit 0 */
+#define FSMC_BWTR3_ACCMOD_1 ((uint32_t)0x20000000) /*!< Bit 1 */
+
+/****************** Bit definition for FSMC_BWTR4 register ******************/
+#define FSMC_BWTR4_ADDSET ((uint32_t)0x0000000F) /*!< ADDSET[3:0] bits (Address setup phase duration) */
+#define FSMC_BWTR4_ADDSET_0 ((uint32_t)0x00000001) /*!< Bit 0 */
+#define FSMC_BWTR4_ADDSET_1 ((uint32_t)0x00000002) /*!< Bit 1 */
+#define FSMC_BWTR4_ADDSET_2 ((uint32_t)0x00000004) /*!< Bit 2 */
+#define FSMC_BWTR4_ADDSET_3 ((uint32_t)0x00000008) /*!< Bit 3 */
+
+#define FSMC_BWTR4_ADDHLD ((uint32_t)0x000000F0) /*!< ADDHLD[3:0] bits (Address-hold phase duration) */
+#define FSMC_BWTR4_ADDHLD_0 ((uint32_t)0x00000010) /*!< Bit 0 */
+#define FSMC_BWTR4_ADDHLD_1 ((uint32_t)0x00000020) /*!< Bit 1 */
+#define FSMC_BWTR4_ADDHLD_2 ((uint32_t)0x00000040) /*!< Bit 2 */
+#define FSMC_BWTR4_ADDHLD_3 ((uint32_t)0x00000080) /*!< Bit 3 */
+
+#define FSMC_BWTR4_DATAST ((uint32_t)0x0000FF00) /*!< DATAST [3:0] bits (Data-phase duration) */
+#define FSMC_BWTR4_DATAST_0 ((uint32_t)0x00000100) /*!< Bit 0 */
+#define FSMC_BWTR4_DATAST_1 ((uint32_t)0x00000200) /*!< Bit 1 */
+#define FSMC_BWTR4_DATAST_2 ((uint32_t)0x00000400) /*!< Bit 2 */
+#define FSMC_BWTR4_DATAST_3 ((uint32_t)0x00000800) /*!< Bit 3 */
+
+#define FSMC_BWTR4_CLKDIV ((uint32_t)0x00F00000) /*!< CLKDIV[3:0] bits (Clock divide ratio) */
+#define FSMC_BWTR4_CLKDIV_0 ((uint32_t)0x00100000) /*!< Bit 0 */
+#define FSMC_BWTR4_CLKDIV_1 ((uint32_t)0x00200000) /*!< Bit 1 */
+#define FSMC_BWTR4_CLKDIV_2 ((uint32_t)0x00400000) /*!< Bit 2 */
+#define FSMC_BWTR4_CLKDIV_3 ((uint32_t)0x00800000) /*!< Bit 3 */
+
+#define FSMC_BWTR4_DATLAT ((uint32_t)0x0F000000) /*!< DATLA[3:0] bits (Data latency) */
+#define FSMC_BWTR4_DATLAT_0 ((uint32_t)0x01000000) /*!< Bit 0 */
+#define FSMC_BWTR4_DATLAT_1 ((uint32_t)0x02000000) /*!< Bit 1 */
+#define FSMC_BWTR4_DATLAT_2 ((uint32_t)0x04000000) /*!< Bit 2 */
+#define FSMC_BWTR4_DATLAT_3 ((uint32_t)0x08000000) /*!< Bit 3 */
+
+#define FSMC_BWTR4_ACCMOD ((uint32_t)0x30000000) /*!< ACCMOD[1:0] bits (Access mode) */
+#define FSMC_BWTR4_ACCMOD_0 ((uint32_t)0x10000000) /*!< Bit 0 */
+#define FSMC_BWTR4_ACCMOD_1 ((uint32_t)0x20000000) /*!< Bit 1 */
+
+/****************** Bit definition for FSMC_PCR2 register *******************/
+#define FSMC_PCR2_PWAITEN ((uint32_t)0x00000002) /*!< Wait feature enable bit */
+#define FSMC_PCR2_PBKEN ((uint32_t)0x00000004) /*!< PC Card/NAND Flash memory bank enable bit */
+#define FSMC_PCR2_PTYP ((uint32_t)0x00000008) /*!< Memory type */
+
+#define FSMC_PCR2_PWID ((uint32_t)0x00000030) /*!< PWID[1:0] bits (NAND Flash databus width) */
+#define FSMC_PCR2_PWID_0 ((uint32_t)0x00000010) /*!< Bit 0 */
+#define FSMC_PCR2_PWID_1 ((uint32_t)0x00000020) /*!< Bit 1 */
+
+#define FSMC_PCR2_ECCEN ((uint32_t)0x00000040) /*!< ECC computation logic enable bit */
+
+#define FSMC_PCR2_TCLR ((uint32_t)0x00001E00) /*!< TCLR[3:0] bits (CLE to RE delay) */
+#define FSMC_PCR2_TCLR_0 ((uint32_t)0x00000200) /*!< Bit 0 */
+#define FSMC_PCR2_TCLR_1 ((uint32_t)0x00000400) /*!< Bit 1 */
+#define FSMC_PCR2_TCLR_2 ((uint32_t)0x00000800) /*!< Bit 2 */
+#define FSMC_PCR2_TCLR_3 ((uint32_t)0x00001000) /*!< Bit 3 */
+
+#define FSMC_PCR2_TAR ((uint32_t)0x0001E000) /*!< TAR[3:0] bits (ALE to RE delay) */
+#define FSMC_PCR2_TAR_0 ((uint32_t)0x00002000) /*!< Bit 0 */
+#define FSMC_PCR2_TAR_1 ((uint32_t)0x00004000) /*!< Bit 1 */
+#define FSMC_PCR2_TAR_2 ((uint32_t)0x00008000) /*!< Bit 2 */
+#define FSMC_PCR2_TAR_3 ((uint32_t)0x00010000) /*!< Bit 3 */
+
+#define FSMC_PCR2_ECCPS ((uint32_t)0x000E0000) /*!< ECCPS[1:0] bits (ECC page size) */
+#define FSMC_PCR2_ECCPS_0 ((uint32_t)0x00020000) /*!< Bit 0 */
+#define FSMC_PCR2_ECCPS_1 ((uint32_t)0x00040000) /*!< Bit 1 */
+#define FSMC_PCR2_ECCPS_2 ((uint32_t)0x00080000) /*!< Bit 2 */
+
+/****************** Bit definition for FSMC_PCR3 register *******************/
+#define FSMC_PCR3_PWAITEN ((uint32_t)0x00000002) /*!< Wait feature enable bit */
+#define FSMC_PCR3_PBKEN ((uint32_t)0x00000004) /*!< PC Card/NAND Flash memory bank enable bit */
+#define FSMC_PCR3_PTYP ((uint32_t)0x00000008) /*!< Memory type */
+
+#define FSMC_PCR3_PWID ((uint32_t)0x00000030) /*!< PWID[1:0] bits (NAND Flash databus width) */
+#define FSMC_PCR3_PWID_0 ((uint32_t)0x00000010) /*!< Bit 0 */
+#define FSMC_PCR3_PWID_1 ((uint32_t)0x00000020) /*!< Bit 1 */
+
+#define FSMC_PCR3_ECCEN ((uint32_t)0x00000040) /*!< ECC computation logic enable bit */
+
+#define FSMC_PCR3_TCLR ((uint32_t)0x00001E00) /*!< TCLR[3:0] bits (CLE to RE delay) */
+#define FSMC_PCR3_TCLR_0 ((uint32_t)0x00000200) /*!< Bit 0 */
+#define FSMC_PCR3_TCLR_1 ((uint32_t)0x00000400) /*!< Bit 1 */
+#define FSMC_PCR3_TCLR_2 ((uint32_t)0x00000800) /*!< Bit 2 */
+#define FSMC_PCR3_TCLR_3 ((uint32_t)0x00001000) /*!< Bit 3 */
+
+#define FSMC_PCR3_TAR ((uint32_t)0x0001E000) /*!< TAR[3:0] bits (ALE to RE delay) */
+#define FSMC_PCR3_TAR_0 ((uint32_t)0x00002000) /*!< Bit 0 */
+#define FSMC_PCR3_TAR_1 ((uint32_t)0x00004000) /*!< Bit 1 */
+#define FSMC_PCR3_TAR_2 ((uint32_t)0x00008000) /*!< Bit 2 */
+#define FSMC_PCR3_TAR_3 ((uint32_t)0x00010000) /*!< Bit 3 */
+
+#define FSMC_PCR3_ECCPS ((uint32_t)0x000E0000) /*!< ECCPS[2:0] bits (ECC page size) */
+#define FSMC_PCR3_ECCPS_0 ((uint32_t)0x00020000) /*!< Bit 0 */
+#define FSMC_PCR3_ECCPS_1 ((uint32_t)0x00040000) /*!< Bit 1 */
+#define FSMC_PCR3_ECCPS_2 ((uint32_t)0x00080000) /*!< Bit 2 */
+
+/****************** Bit definition for FSMC_PCR4 register *******************/
+#define FSMC_PCR4_PWAITEN ((uint32_t)0x00000002) /*!< Wait feature enable bit */
+#define FSMC_PCR4_PBKEN ((uint32_t)0x00000004) /*!< PC Card/NAND Flash memory bank enable bit */
+#define FSMC_PCR4_PTYP ((uint32_t)0x00000008) /*!< Memory type */
+
+#define FSMC_PCR4_PWID ((uint32_t)0x00000030) /*!< PWID[1:0] bits (NAND Flash databus width) */
+#define FSMC_PCR4_PWID_0 ((uint32_t)0x00000010) /*!< Bit 0 */
+#define FSMC_PCR4_PWID_1 ((uint32_t)0x00000020) /*!< Bit 1 */
+
+#define FSMC_PCR4_ECCEN ((uint32_t)0x00000040) /*!< ECC computation logic enable bit */
+
+#define FSMC_PCR4_TCLR ((uint32_t)0x00001E00) /*!< TCLR[3:0] bits (CLE to RE delay) */
+#define FSMC_PCR4_TCLR_0 ((uint32_t)0x00000200) /*!< Bit 0 */
+#define FSMC_PCR4_TCLR_1 ((uint32_t)0x00000400) /*!< Bit 1 */
+#define FSMC_PCR4_TCLR_2 ((uint32_t)0x00000800) /*!< Bit 2 */
+#define FSMC_PCR4_TCLR_3 ((uint32_t)0x00001000) /*!< Bit 3 */
+
+#define FSMC_PCR4_TAR ((uint32_t)0x0001E000) /*!< TAR[3:0] bits (ALE to RE delay) */
+#define FSMC_PCR4_TAR_0 ((uint32_t)0x00002000) /*!< Bit 0 */
+#define FSMC_PCR4_TAR_1 ((uint32_t)0x00004000) /*!< Bit 1 */
+#define FSMC_PCR4_TAR_2 ((uint32_t)0x00008000) /*!< Bit 2 */
+#define FSMC_PCR4_TAR_3 ((uint32_t)0x00010000) /*!< Bit 3 */
+
+#define FSMC_PCR4_ECCPS ((uint32_t)0x000E0000) /*!< ECCPS[2:0] bits (ECC page size) */
+#define FSMC_PCR4_ECCPS_0 ((uint32_t)0x00020000) /*!< Bit 0 */
+#define FSMC_PCR4_ECCPS_1 ((uint32_t)0x00040000) /*!< Bit 1 */
+#define FSMC_PCR4_ECCPS_2 ((uint32_t)0x00080000) /*!< Bit 2 */
+
+/******************* Bit definition for FSMC_SR2 register *******************/
+#define FSMC_SR2_IRS ((uint8_t)0x01) /*!< Interrupt Rising Edge status */
+#define FSMC_SR2_ILS ((uint8_t)0x02) /*!< Interrupt Level status */
+#define FSMC_SR2_IFS ((uint8_t)0x04) /*!< Interrupt Falling Edge status */
+#define FSMC_SR2_IREN ((uint8_t)0x08) /*!< Interrupt Rising Edge detection Enable bit */
+#define FSMC_SR2_ILEN ((uint8_t)0x10) /*!< Interrupt Level detection Enable bit */
+#define FSMC_SR2_IFEN ((uint8_t)0x20) /*!< Interrupt Falling Edge detection Enable bit */
+#define FSMC_SR2_FEMPT ((uint8_t)0x40) /*!< FIFO empty */
+
+/******************* Bit definition for FSMC_SR3 register *******************/
+#define FSMC_SR3_IRS ((uint8_t)0x01) /*!< Interrupt Rising Edge status */
+#define FSMC_SR3_ILS ((uint8_t)0x02) /*!< Interrupt Level status */
+#define FSMC_SR3_IFS ((uint8_t)0x04) /*!< Interrupt Falling Edge status */
+#define FSMC_SR3_IREN ((uint8_t)0x08) /*!< Interrupt Rising Edge detection Enable bit */
+#define FSMC_SR3_ILEN ((uint8_t)0x10) /*!< Interrupt Level detection Enable bit */
+#define FSMC_SR3_IFEN ((uint8_t)0x20) /*!< Interrupt Falling Edge detection Enable bit */
+#define FSMC_SR3_FEMPT ((uint8_t)0x40) /*!< FIFO empty */
+
+/******************* Bit definition for FSMC_SR4 register *******************/
+#define FSMC_SR4_IRS ((uint8_t)0x01) /*!< Interrupt Rising Edge status */
+#define FSMC_SR4_ILS ((uint8_t)0x02) /*!< Interrupt Level status */
+#define FSMC_SR4_IFS ((uint8_t)0x04) /*!< Interrupt Falling Edge status */
+#define FSMC_SR4_IREN ((uint8_t)0x08) /*!< Interrupt Rising Edge detection Enable bit */
+#define FSMC_SR4_ILEN ((uint8_t)0x10) /*!< Interrupt Level detection Enable bit */
+#define FSMC_SR4_IFEN ((uint8_t)0x20) /*!< Interrupt Falling Edge detection Enable bit */
+#define FSMC_SR4_FEMPT ((uint8_t)0x40) /*!< FIFO empty */
+
+/****************** Bit definition for FSMC_PMEM2 register ******************/
+#define FSMC_PMEM2_MEMSET2 ((uint32_t)0x000000FF) /*!< MEMSET2[7:0] bits (Common memory 2 setup time) */
+#define FSMC_PMEM2_MEMSET2_0 ((uint32_t)0x00000001) /*!< Bit 0 */
+#define FSMC_PMEM2_MEMSET2_1 ((uint32_t)0x00000002) /*!< Bit 1 */
+#define FSMC_PMEM2_MEMSET2_2 ((uint32_t)0x00000004) /*!< Bit 2 */
+#define FSMC_PMEM2_MEMSET2_3 ((uint32_t)0x00000008) /*!< Bit 3 */
+#define FSMC_PMEM2_MEMSET2_4 ((uint32_t)0x00000010) /*!< Bit 4 */
+#define FSMC_PMEM2_MEMSET2_5 ((uint32_t)0x00000020) /*!< Bit 5 */
+#define FSMC_PMEM2_MEMSET2_6 ((uint32_t)0x00000040) /*!< Bit 6 */
+#define FSMC_PMEM2_MEMSET2_7 ((uint32_t)0x00000080) /*!< Bit 7 */
+
+#define FSMC_PMEM2_MEMWAIT2 ((uint32_t)0x0000FF00) /*!< MEMWAIT2[7:0] bits (Common memory 2 wait time) */
+#define FSMC_PMEM2_MEMWAIT2_0 ((uint32_t)0x00000100) /*!< Bit 0 */
+#define FSMC_PMEM2_MEMWAIT2_1 ((uint32_t)0x00000200) /*!< Bit 1 */
+#define FSMC_PMEM2_MEMWAIT2_2 ((uint32_t)0x00000400) /*!< Bit 2 */
+#define FSMC_PMEM2_MEMWAIT2_3 ((uint32_t)0x00000800) /*!< Bit 3 */
+#define FSMC_PMEM2_MEMWAIT2_4 ((uint32_t)0x00001000) /*!< Bit 4 */
+#define FSMC_PMEM2_MEMWAIT2_5 ((uint32_t)0x00002000) /*!< Bit 5 */
+#define FSMC_PMEM2_MEMWAIT2_6 ((uint32_t)0x00004000) /*!< Bit 6 */
+#define FSMC_PMEM2_MEMWAIT2_7 ((uint32_t)0x00008000) /*!< Bit 7 */
+
+#define FSMC_PMEM2_MEMHOLD2 ((uint32_t)0x00FF0000) /*!< MEMHOLD2[7:0] bits (Common memory 2 hold time) */
+#define FSMC_PMEM2_MEMHOLD2_0 ((uint32_t)0x00010000) /*!< Bit 0 */
+#define FSMC_PMEM2_MEMHOLD2_1 ((uint32_t)0x00020000) /*!< Bit 1 */
+#define FSMC_PMEM2_MEMHOLD2_2 ((uint32_t)0x00040000) /*!< Bit 2 */
+#define FSMC_PMEM2_MEMHOLD2_3 ((uint32_t)0x00080000) /*!< Bit 3 */
+#define FSMC_PMEM2_MEMHOLD2_4 ((uint32_t)0x00100000) /*!< Bit 4 */
+#define FSMC_PMEM2_MEMHOLD2_5 ((uint32_t)0x00200000) /*!< Bit 5 */
+#define FSMC_PMEM2_MEMHOLD2_6 ((uint32_t)0x00400000) /*!< Bit 6 */
+#define FSMC_PMEM2_MEMHOLD2_7 ((uint32_t)0x00800000) /*!< Bit 7 */
+
+#define FSMC_PMEM2_MEMHIZ2 ((uint32_t)0xFF000000) /*!< MEMHIZ2[7:0] bits (Common memory 2 databus HiZ time) */
+#define FSMC_PMEM2_MEMHIZ2_0 ((uint32_t)0x01000000) /*!< Bit 0 */
+#define FSMC_PMEM2_MEMHIZ2_1 ((uint32_t)0x02000000) /*!< Bit 1 */
+#define FSMC_PMEM2_MEMHIZ2_2 ((uint32_t)0x04000000) /*!< Bit 2 */
+#define FSMC_PMEM2_MEMHIZ2_3 ((uint32_t)0x08000000) /*!< Bit 3 */
+#define FSMC_PMEM2_MEMHIZ2_4 ((uint32_t)0x10000000) /*!< Bit 4 */
+#define FSMC_PMEM2_MEMHIZ2_5 ((uint32_t)0x20000000) /*!< Bit 5 */
+#define FSMC_PMEM2_MEMHIZ2_6 ((uint32_t)0x40000000) /*!< Bit 6 */
+#define FSMC_PMEM2_MEMHIZ2_7 ((uint32_t)0x80000000) /*!< Bit 7 */
+
+/****************** Bit definition for FSMC_PMEM3 register ******************/
+#define FSMC_PMEM3_MEMSET3 ((uint32_t)0x000000FF) /*!< MEMSET3[7:0] bits (Common memory 3 setup time) */
+#define FSMC_PMEM3_MEMSET3_0 ((uint32_t)0x00000001) /*!< Bit 0 */
+#define FSMC_PMEM3_MEMSET3_1 ((uint32_t)0x00000002) /*!< Bit 1 */
+#define FSMC_PMEM3_MEMSET3_2 ((uint32_t)0x00000004) /*!< Bit 2 */
+#define FSMC_PMEM3_MEMSET3_3 ((uint32_t)0x00000008) /*!< Bit 3 */
+#define FSMC_PMEM3_MEMSET3_4 ((uint32_t)0x00000010) /*!< Bit 4 */
+#define FSMC_PMEM3_MEMSET3_5 ((uint32_t)0x00000020) /*!< Bit 5 */
+#define FSMC_PMEM3_MEMSET3_6 ((uint32_t)0x00000040) /*!< Bit 6 */
+#define FSMC_PMEM3_MEMSET3_7 ((uint32_t)0x00000080) /*!< Bit 7 */
+
+#define FSMC_PMEM3_MEMWAIT3 ((uint32_t)0x0000FF00) /*!< MEMWAIT3[7:0] bits (Common memory 3 wait time) */
+#define FSMC_PMEM3_MEMWAIT3_0 ((uint32_t)0x00000100) /*!< Bit 0 */
+#define FSMC_PMEM3_MEMWAIT3_1 ((uint32_t)0x00000200) /*!< Bit 1 */
+#define FSMC_PMEM3_MEMWAIT3_2 ((uint32_t)0x00000400) /*!< Bit 2 */
+#define FSMC_PMEM3_MEMWAIT3_3 ((uint32_t)0x00000800) /*!< Bit 3 */
+#define FSMC_PMEM3_MEMWAIT3_4 ((uint32_t)0x00001000) /*!< Bit 4 */
+#define FSMC_PMEM3_MEMWAIT3_5 ((uint32_t)0x00002000) /*!< Bit 5 */
+#define FSMC_PMEM3_MEMWAIT3_6 ((uint32_t)0x00004000) /*!< Bit 6 */
+#define FSMC_PMEM3_MEMWAIT3_7 ((uint32_t)0x00008000) /*!< Bit 7 */
+
+#define FSMC_PMEM3_MEMHOLD3 ((uint32_t)0x00FF0000) /*!< MEMHOLD3[7:0] bits (Common memory 3 hold time) */
+#define FSMC_PMEM3_MEMHOLD3_0 ((uint32_t)0x00010000) /*!< Bit 0 */
+#define FSMC_PMEM3_MEMHOLD3_1 ((uint32_t)0x00020000) /*!< Bit 1 */
+#define FSMC_PMEM3_MEMHOLD3_2 ((uint32_t)0x00040000) /*!< Bit 2 */
+#define FSMC_PMEM3_MEMHOLD3_3 ((uint32_t)0x00080000) /*!< Bit 3 */
+#define FSMC_PMEM3_MEMHOLD3_4 ((uint32_t)0x00100000) /*!< Bit 4 */
+#define FSMC_PMEM3_MEMHOLD3_5 ((uint32_t)0x00200000) /*!< Bit 5 */
+#define FSMC_PMEM3_MEMHOLD3_6 ((uint32_t)0x00400000) /*!< Bit 6 */
+#define FSMC_PMEM3_MEMHOLD3_7 ((uint32_t)0x00800000) /*!< Bit 7 */
+
+#define FSMC_PMEM3_MEMHIZ3 ((uint32_t)0xFF000000) /*!< MEMHIZ3[7:0] bits (Common memory 3 databus HiZ time) */
+#define FSMC_PMEM3_MEMHIZ3_0 ((uint32_t)0x01000000) /*!< Bit 0 */
+#define FSMC_PMEM3_MEMHIZ3_1 ((uint32_t)0x02000000) /*!< Bit 1 */
+#define FSMC_PMEM3_MEMHIZ3_2 ((uint32_t)0x04000000) /*!< Bit 2 */
+#define FSMC_PMEM3_MEMHIZ3_3 ((uint32_t)0x08000000) /*!< Bit 3 */
+#define FSMC_PMEM3_MEMHIZ3_4 ((uint32_t)0x10000000) /*!< Bit 4 */
+#define FSMC_PMEM3_MEMHIZ3_5 ((uint32_t)0x20000000) /*!< Bit 5 */
+#define FSMC_PMEM3_MEMHIZ3_6 ((uint32_t)0x40000000) /*!< Bit 6 */
+#define FSMC_PMEM3_MEMHIZ3_7 ((uint32_t)0x80000000) /*!< Bit 7 */
+
+/****************** Bit definition for FSMC_PMEM4 register ******************/
+#define FSMC_PMEM4_MEMSET4 ((uint32_t)0x000000FF) /*!< MEMSET4[7:0] bits (Common memory 4 setup time) */
+#define FSMC_PMEM4_MEMSET4_0 ((uint32_t)0x00000001) /*!< Bit 0 */
+#define FSMC_PMEM4_MEMSET4_1 ((uint32_t)0x00000002) /*!< Bit 1 */
+#define FSMC_PMEM4_MEMSET4_2 ((uint32_t)0x00000004) /*!< Bit 2 */
+#define FSMC_PMEM4_MEMSET4_3 ((uint32_t)0x00000008) /*!< Bit 3 */
+#define FSMC_PMEM4_MEMSET4_4 ((uint32_t)0x00000010) /*!< Bit 4 */
+#define FSMC_PMEM4_MEMSET4_5 ((uint32_t)0x00000020) /*!< Bit 5 */
+#define FSMC_PMEM4_MEMSET4_6 ((uint32_t)0x00000040) /*!< Bit 6 */
+#define FSMC_PMEM4_MEMSET4_7 ((uint32_t)0x00000080) /*!< Bit 7 */
+
+#define FSMC_PMEM4_MEMWAIT4 ((uint32_t)0x0000FF00) /*!< MEMWAIT4[7:0] bits (Common memory 4 wait time) */
+#define FSMC_PMEM4_MEMWAIT4_0 ((uint32_t)0x00000100) /*!< Bit 0 */
+#define FSMC_PMEM4_MEMWAIT4_1 ((uint32_t)0x00000200) /*!< Bit 1 */
+#define FSMC_PMEM4_MEMWAIT4_2 ((uint32_t)0x00000400) /*!< Bit 2 */
+#define FSMC_PMEM4_MEMWAIT4_3 ((uint32_t)0x00000800) /*!< Bit 3 */
+#define FSMC_PMEM4_MEMWAIT4_4 ((uint32_t)0x00001000) /*!< Bit 4 */
+#define FSMC_PMEM4_MEMWAIT4_5 ((uint32_t)0x00002000) /*!< Bit 5 */
+#define FSMC_PMEM4_MEMWAIT4_6 ((uint32_t)0x00004000) /*!< Bit 6 */
+#define FSMC_PMEM4_MEMWAIT4_7 ((uint32_t)0x00008000) /*!< Bit 7 */
+
+#define FSMC_PMEM4_MEMHOLD4 ((uint32_t)0x00FF0000) /*!< MEMHOLD4[7:0] bits (Common memory 4 hold time) */
+#define FSMC_PMEM4_MEMHOLD4_0 ((uint32_t)0x00010000) /*!< Bit 0 */
+#define FSMC_PMEM4_MEMHOLD4_1 ((uint32_t)0x00020000) /*!< Bit 1 */
+#define FSMC_PMEM4_MEMHOLD4_2 ((uint32_t)0x00040000) /*!< Bit 2 */
+#define FSMC_PMEM4_MEMHOLD4_3 ((uint32_t)0x00080000) /*!< Bit 3 */
+#define FSMC_PMEM4_MEMHOLD4_4 ((uint32_t)0x00100000) /*!< Bit 4 */
+#define FSMC_PMEM4_MEMHOLD4_5 ((uint32_t)0x00200000) /*!< Bit 5 */
+#define FSMC_PMEM4_MEMHOLD4_6 ((uint32_t)0x00400000) /*!< Bit 6 */
+#define FSMC_PMEM4_MEMHOLD4_7 ((uint32_t)0x00800000) /*!< Bit 7 */
+
+#define FSMC_PMEM4_MEMHIZ4 ((uint32_t)0xFF000000) /*!< MEMHIZ4[7:0] bits (Common memory 4 databus HiZ time) */
+#define FSMC_PMEM4_MEMHIZ4_0 ((uint32_t)0x01000000) /*!< Bit 0 */
+#define FSMC_PMEM4_MEMHIZ4_1 ((uint32_t)0x02000000) /*!< Bit 1 */
+#define FSMC_PMEM4_MEMHIZ4_2 ((uint32_t)0x04000000) /*!< Bit 2 */
+#define FSMC_PMEM4_MEMHIZ4_3 ((uint32_t)0x08000000) /*!< Bit 3 */
+#define FSMC_PMEM4_MEMHIZ4_4 ((uint32_t)0x10000000) /*!< Bit 4 */
+#define FSMC_PMEM4_MEMHIZ4_5 ((uint32_t)0x20000000) /*!< Bit 5 */
+#define FSMC_PMEM4_MEMHIZ4_6 ((uint32_t)0x40000000) /*!< Bit 6 */
+#define FSMC_PMEM4_MEMHIZ4_7 ((uint32_t)0x80000000) /*!< Bit 7 */
+
+/****************** Bit definition for FSMC_PATT2 register ******************/
+#define FSMC_PATT2_ATTSET2 ((uint32_t)0x000000FF) /*!< ATTSET2[7:0] bits (Attribute memory 2 setup time) */
+#define FSMC_PATT2_ATTSET2_0 ((uint32_t)0x00000001) /*!< Bit 0 */
+#define FSMC_PATT2_ATTSET2_1 ((uint32_t)0x00000002) /*!< Bit 1 */
+#define FSMC_PATT2_ATTSET2_2 ((uint32_t)0x00000004) /*!< Bit 2 */
+#define FSMC_PATT2_ATTSET2_3 ((uint32_t)0x00000008) /*!< Bit 3 */
+#define FSMC_PATT2_ATTSET2_4 ((uint32_t)0x00000010) /*!< Bit 4 */
+#define FSMC_PATT2_ATTSET2_5 ((uint32_t)0x00000020) /*!< Bit 5 */
+#define FSMC_PATT2_ATTSET2_6 ((uint32_t)0x00000040) /*!< Bit 6 */
+#define FSMC_PATT2_ATTSET2_7 ((uint32_t)0x00000080) /*!< Bit 7 */
+
+#define FSMC_PATT2_ATTWAIT2 ((uint32_t)0x0000FF00) /*!< ATTWAIT2[7:0] bits (Attribute memory 2 wait time) */
+#define FSMC_PATT2_ATTWAIT2_0 ((uint32_t)0x00000100) /*!< Bit 0 */
+#define FSMC_PATT2_ATTWAIT2_1 ((uint32_t)0x00000200) /*!< Bit 1 */
+#define FSMC_PATT2_ATTWAIT2_2 ((uint32_t)0x00000400) /*!< Bit 2 */
+#define FSMC_PATT2_ATTWAIT2_3 ((uint32_t)0x00000800) /*!< Bit 3 */
+#define FSMC_PATT2_ATTWAIT2_4 ((uint32_t)0x00001000) /*!< Bit 4 */
+#define FSMC_PATT2_ATTWAIT2_5 ((uint32_t)0x00002000) /*!< Bit 5 */
+#define FSMC_PATT2_ATTWAIT2_6 ((uint32_t)0x00004000) /*!< Bit 6 */
+#define FSMC_PATT2_ATTWAIT2_7 ((uint32_t)0x00008000) /*!< Bit 7 */
+
+#define FSMC_PATT2_ATTHOLD2 ((uint32_t)0x00FF0000) /*!< ATTHOLD2[7:0] bits (Attribute memory 2 hold time) */
+#define FSMC_PATT2_ATTHOLD2_0 ((uint32_t)0x00010000) /*!< Bit 0 */
+#define FSMC_PATT2_ATTHOLD2_1 ((uint32_t)0x00020000) /*!< Bit 1 */
+#define FSMC_PATT2_ATTHOLD2_2 ((uint32_t)0x00040000) /*!< Bit 2 */
+#define FSMC_PATT2_ATTHOLD2_3 ((uint32_t)0x00080000) /*!< Bit 3 */
+#define FSMC_PATT2_ATTHOLD2_4 ((uint32_t)0x00100000) /*!< Bit 4 */
+#define FSMC_PATT2_ATTHOLD2_5 ((uint32_t)0x00200000) /*!< Bit 5 */
+#define FSMC_PATT2_ATTHOLD2_6 ((uint32_t)0x00400000) /*!< Bit 6 */
+#define FSMC_PATT2_ATTHOLD2_7 ((uint32_t)0x00800000) /*!< Bit 7 */
+
+#define FSMC_PATT2_ATTHIZ2 ((uint32_t)0xFF000000) /*!< ATTHIZ2[7:0] bits (Attribute memory 2 databus HiZ time) */
+#define FSMC_PATT2_ATTHIZ2_0 ((uint32_t)0x01000000) /*!< Bit 0 */
+#define FSMC_PATT2_ATTHIZ2_1 ((uint32_t)0x02000000) /*!< Bit 1 */
+#define FSMC_PATT2_ATTHIZ2_2 ((uint32_t)0x04000000) /*!< Bit 2 */
+#define FSMC_PATT2_ATTHIZ2_3 ((uint32_t)0x08000000) /*!< Bit 3 */
+#define FSMC_PATT2_ATTHIZ2_4 ((uint32_t)0x10000000) /*!< Bit 4 */
+#define FSMC_PATT2_ATTHIZ2_5 ((uint32_t)0x20000000) /*!< Bit 5 */
+#define FSMC_PATT2_ATTHIZ2_6 ((uint32_t)0x40000000) /*!< Bit 6 */
+#define FSMC_PATT2_ATTHIZ2_7 ((uint32_t)0x80000000) /*!< Bit 7 */
+
+/****************** Bit definition for FSMC_PATT3 register ******************/
+#define FSMC_PATT3_ATTSET3 ((uint32_t)0x000000FF) /*!< ATTSET3[7:0] bits (Attribute memory 3 setup time) */
+#define FSMC_PATT3_ATTSET3_0 ((uint32_t)0x00000001) /*!< Bit 0 */
+#define FSMC_PATT3_ATTSET3_1 ((uint32_t)0x00000002) /*!< Bit 1 */
+#define FSMC_PATT3_ATTSET3_2 ((uint32_t)0x00000004) /*!< Bit 2 */
+#define FSMC_PATT3_ATTSET3_3 ((uint32_t)0x00000008) /*!< Bit 3 */
+#define FSMC_PATT3_ATTSET3_4 ((uint32_t)0x00000010) /*!< Bit 4 */
+#define FSMC_PATT3_ATTSET3_5 ((uint32_t)0x00000020) /*!< Bit 5 */
+#define FSMC_PATT3_ATTSET3_6 ((uint32_t)0x00000040) /*!< Bit 6 */
+#define FSMC_PATT3_ATTSET3_7 ((uint32_t)0x00000080) /*!< Bit 7 */
+
+#define FSMC_PATT3_ATTWAIT3 ((uint32_t)0x0000FF00) /*!< ATTWAIT3[7:0] bits (Attribute memory 3 wait time) */
+#define FSMC_PATT3_ATTWAIT3_0 ((uint32_t)0x00000100) /*!< Bit 0 */
+#define FSMC_PATT3_ATTWAIT3_1 ((uint32_t)0x00000200) /*!< Bit 1 */
+#define FSMC_PATT3_ATTWAIT3_2 ((uint32_t)0x00000400) /*!< Bit 2 */
+#define FSMC_PATT3_ATTWAIT3_3 ((uint32_t)0x00000800) /*!< Bit 3 */
+#define FSMC_PATT3_ATTWAIT3_4 ((uint32_t)0x00001000) /*!< Bit 4 */
+#define FSMC_PATT3_ATTWAIT3_5 ((uint32_t)0x00002000) /*!< Bit 5 */
+#define FSMC_PATT3_ATTWAIT3_6 ((uint32_t)0x00004000) /*!< Bit 6 */
+#define FSMC_PATT3_ATTWAIT3_7 ((uint32_t)0x00008000) /*!< Bit 7 */
+
+#define FSMC_PATT3_ATTHOLD3 ((uint32_t)0x00FF0000) /*!< ATTHOLD3[7:0] bits (Attribute memory 3 hold time) */
+#define FSMC_PATT3_ATTHOLD3_0 ((uint32_t)0x00010000) /*!< Bit 0 */
+#define FSMC_PATT3_ATTHOLD3_1 ((uint32_t)0x00020000) /*!< Bit 1 */
+#define FSMC_PATT3_ATTHOLD3_2 ((uint32_t)0x00040000) /*!< Bit 2 */
+#define FSMC_PATT3_ATTHOLD3_3 ((uint32_t)0x00080000) /*!< Bit 3 */
+#define FSMC_PATT3_ATTHOLD3_4 ((uint32_t)0x00100000) /*!< Bit 4 */
+#define FSMC_PATT3_ATTHOLD3_5 ((uint32_t)0x00200000) /*!< Bit 5 */
+#define FSMC_PATT3_ATTHOLD3_6 ((uint32_t)0x00400000) /*!< Bit 6 */
+#define FSMC_PATT3_ATTHOLD3_7 ((uint32_t)0x00800000) /*!< Bit 7 */
+
+#define FSMC_PATT3_ATTHIZ3 ((uint32_t)0xFF000000) /*!< ATTHIZ3[7:0] bits (Attribute memory 3 databus HiZ time) */
+#define FSMC_PATT3_ATTHIZ3_0 ((uint32_t)0x01000000) /*!< Bit 0 */
+#define FSMC_PATT3_ATTHIZ3_1 ((uint32_t)0x02000000) /*!< Bit 1 */
+#define FSMC_PATT3_ATTHIZ3_2 ((uint32_t)0x04000000) /*!< Bit 2 */
+#define FSMC_PATT3_ATTHIZ3_3 ((uint32_t)0x08000000) /*!< Bit 3 */
+#define FSMC_PATT3_ATTHIZ3_4 ((uint32_t)0x10000000) /*!< Bit 4 */
+#define FSMC_PATT3_ATTHIZ3_5 ((uint32_t)0x20000000) /*!< Bit 5 */
+#define FSMC_PATT3_ATTHIZ3_6 ((uint32_t)0x40000000) /*!< Bit 6 */
+#define FSMC_PATT3_ATTHIZ3_7 ((uint32_t)0x80000000) /*!< Bit 7 */
+
+/****************** Bit definition for FSMC_PATT4 register ******************/
+#define FSMC_PATT4_ATTSET4 ((uint32_t)0x000000FF) /*!< ATTSET4[7:0] bits (Attribute memory 4 setup time) */
+#define FSMC_PATT4_ATTSET4_0 ((uint32_t)0x00000001) /*!< Bit 0 */
+#define FSMC_PATT4_ATTSET4_1 ((uint32_t)0x00000002) /*!< Bit 1 */
+#define FSMC_PATT4_ATTSET4_2 ((uint32_t)0x00000004) /*!< Bit 2 */
+#define FSMC_PATT4_ATTSET4_3 ((uint32_t)0x00000008) /*!< Bit 3 */
+#define FSMC_PATT4_ATTSET4_4 ((uint32_t)0x00000010) /*!< Bit 4 */
+#define FSMC_PATT4_ATTSET4_5 ((uint32_t)0x00000020) /*!< Bit 5 */
+#define FSMC_PATT4_ATTSET4_6 ((uint32_t)0x00000040) /*!< Bit 6 */
+#define FSMC_PATT4_ATTSET4_7 ((uint32_t)0x00000080) /*!< Bit 7 */
+
+#define FSMC_PATT4_ATTWAIT4 ((uint32_t)0x0000FF00) /*!< ATTWAIT4[7:0] bits (Attribute memory 4 wait time) */
+#define FSMC_PATT4_ATTWAIT4_0 ((uint32_t)0x00000100) /*!< Bit 0 */
+#define FSMC_PATT4_ATTWAIT4_1 ((uint32_t)0x00000200) /*!< Bit 1 */
+#define FSMC_PATT4_ATTWAIT4_2 ((uint32_t)0x00000400) /*!< Bit 2 */
+#define FSMC_PATT4_ATTWAIT4_3 ((uint32_t)0x00000800) /*!< Bit 3 */
+#define FSMC_PATT4_ATTWAIT4_4 ((uint32_t)0x00001000) /*!< Bit 4 */
+#define FSMC_PATT4_ATTWAIT4_5 ((uint32_t)0x00002000) /*!< Bit 5 */
+#define FSMC_PATT4_ATTWAIT4_6 ((uint32_t)0x00004000) /*!< Bit 6 */
+#define FSMC_PATT4_ATTWAIT4_7 ((uint32_t)0x00008000) /*!< Bit 7 */
+
+#define FSMC_PATT4_ATTHOLD4 ((uint32_t)0x00FF0000) /*!< ATTHOLD4[7:0] bits (Attribute memory 4 hold time) */
+#define FSMC_PATT4_ATTHOLD4_0 ((uint32_t)0x00010000) /*!< Bit 0 */
+#define FSMC_PATT4_ATTHOLD4_1 ((uint32_t)0x00020000) /*!< Bit 1 */
+#define FSMC_PATT4_ATTHOLD4_2 ((uint32_t)0x00040000) /*!< Bit 2 */
+#define FSMC_PATT4_ATTHOLD4_3 ((uint32_t)0x00080000) /*!< Bit 3 */
+#define FSMC_PATT4_ATTHOLD4_4 ((uint32_t)0x00100000) /*!< Bit 4 */
+#define FSMC_PATT4_ATTHOLD4_5 ((uint32_t)0x00200000) /*!< Bit 5 */
+#define FSMC_PATT4_ATTHOLD4_6 ((uint32_t)0x00400000) /*!< Bit 6 */
+#define FSMC_PATT4_ATTHOLD4_7 ((uint32_t)0x00800000) /*!< Bit 7 */
+
+#define FSMC_PATT4_ATTHIZ4 ((uint32_t)0xFF000000) /*!< ATTHIZ4[7:0] bits (Attribute memory 4 databus HiZ time) */
+#define FSMC_PATT4_ATTHIZ4_0 ((uint32_t)0x01000000) /*!< Bit 0 */
+#define FSMC_PATT4_ATTHIZ4_1 ((uint32_t)0x02000000) /*!< Bit 1 */
+#define FSMC_PATT4_ATTHIZ4_2 ((uint32_t)0x04000000) /*!< Bit 2 */
+#define FSMC_PATT4_ATTHIZ4_3 ((uint32_t)0x08000000) /*!< Bit 3 */
+#define FSMC_PATT4_ATTHIZ4_4 ((uint32_t)0x10000000) /*!< Bit 4 */
+#define FSMC_PATT4_ATTHIZ4_5 ((uint32_t)0x20000000) /*!< Bit 5 */
+#define FSMC_PATT4_ATTHIZ4_6 ((uint32_t)0x40000000) /*!< Bit 6 */
+#define FSMC_PATT4_ATTHIZ4_7 ((uint32_t)0x80000000) /*!< Bit 7 */
+
+/****************** Bit definition for FSMC_PIO4 register *******************/
+#define FSMC_PIO4_IOSET4 ((uint32_t)0x000000FF) /*!< IOSET4[7:0] bits (I/O 4 setup time) */
+#define FSMC_PIO4_IOSET4_0 ((uint32_t)0x00000001) /*!< Bit 0 */
+#define FSMC_PIO4_IOSET4_1 ((uint32_t)0x00000002) /*!< Bit 1 */
+#define FSMC_PIO4_IOSET4_2 ((uint32_t)0x00000004) /*!< Bit 2 */
+#define FSMC_PIO4_IOSET4_3 ((uint32_t)0x00000008) /*!< Bit 3 */
+#define FSMC_PIO4_IOSET4_4 ((uint32_t)0x00000010) /*!< Bit 4 */
+#define FSMC_PIO4_IOSET4_5 ((uint32_t)0x00000020) /*!< Bit 5 */
+#define FSMC_PIO4_IOSET4_6 ((uint32_t)0x00000040) /*!< Bit 6 */
+#define FSMC_PIO4_IOSET4_7 ((uint32_t)0x00000080) /*!< Bit 7 */
+
+#define FSMC_PIO4_IOWAIT4 ((uint32_t)0x0000FF00) /*!< IOWAIT4[7:0] bits (I/O 4 wait time) */
+#define FSMC_PIO4_IOWAIT4_0 ((uint32_t)0x00000100) /*!< Bit 0 */
+#define FSMC_PIO4_IOWAIT4_1 ((uint32_t)0x00000200) /*!< Bit 1 */
+#define FSMC_PIO4_IOWAIT4_2 ((uint32_t)0x00000400) /*!< Bit 2 */
+#define FSMC_PIO4_IOWAIT4_3 ((uint32_t)0x00000800) /*!< Bit 3 */
+#define FSMC_PIO4_IOWAIT4_4 ((uint32_t)0x00001000) /*!< Bit 4 */
+#define FSMC_PIO4_IOWAIT4_5 ((uint32_t)0x00002000) /*!< Bit 5 */
+#define FSMC_PIO4_IOWAIT4_6 ((uint32_t)0x00004000) /*!< Bit 6 */
+#define FSMC_PIO4_IOWAIT4_7 ((uint32_t)0x00008000) /*!< Bit 7 */
+
+#define FSMC_PIO4_IOHOLD4 ((uint32_t)0x00FF0000) /*!< IOHOLD4[7:0] bits (I/O 4 hold time) */
+#define FSMC_PIO4_IOHOLD4_0 ((uint32_t)0x00010000) /*!< Bit 0 */
+#define FSMC_PIO4_IOHOLD4_1 ((uint32_t)0x00020000) /*!< Bit 1 */
+#define FSMC_PIO4_IOHOLD4_2 ((uint32_t)0x00040000) /*!< Bit 2 */
+#define FSMC_PIO4_IOHOLD4_3 ((uint32_t)0x00080000) /*!< Bit 3 */
+#define FSMC_PIO4_IOHOLD4_4 ((uint32_t)0x00100000) /*!< Bit 4 */
+#define FSMC_PIO4_IOHOLD4_5 ((uint32_t)0x00200000) /*!< Bit 5 */
+#define FSMC_PIO4_IOHOLD4_6 ((uint32_t)0x00400000) /*!< Bit 6 */
+#define FSMC_PIO4_IOHOLD4_7 ((uint32_t)0x00800000) /*!< Bit 7 */
+
+#define FSMC_PIO4_IOHIZ4 ((uint32_t)0xFF000000) /*!< IOHIZ4[7:0] bits (I/O 4 databus HiZ time) */
+#define FSMC_PIO4_IOHIZ4_0 ((uint32_t)0x01000000) /*!< Bit 0 */
+#define FSMC_PIO4_IOHIZ4_1 ((uint32_t)0x02000000) /*!< Bit 1 */
+#define FSMC_PIO4_IOHIZ4_2 ((uint32_t)0x04000000) /*!< Bit 2 */
+#define FSMC_PIO4_IOHIZ4_3 ((uint32_t)0x08000000) /*!< Bit 3 */
+#define FSMC_PIO4_IOHIZ4_4 ((uint32_t)0x10000000) /*!< Bit 4 */
+#define FSMC_PIO4_IOHIZ4_5 ((uint32_t)0x20000000) /*!< Bit 5 */
+#define FSMC_PIO4_IOHIZ4_6 ((uint32_t)0x40000000) /*!< Bit 6 */
+#define FSMC_PIO4_IOHIZ4_7 ((uint32_t)0x80000000) /*!< Bit 7 */
+
+/****************** Bit definition for FSMC_ECCR2 register ******************/
+#define FSMC_ECCR2_ECC2 ((uint32_t)0xFFFFFFFF) /*!< ECC result */
+
+/****************** Bit definition for FSMC_ECCR3 register ******************/
+#define FSMC_ECCR3_ECC3 ((uint32_t)0xFFFFFFFF) /*!< ECC result */
+
+/******************************************************************************/
+/* */
+/* SD host Interface */
+/* */
+/******************************************************************************/
+
+/****************** Bit definition for SDIO_POWER register ******************/
+#define SDIO_POWER_PWRCTRL ((uint8_t)0x03) /*!< PWRCTRL[1:0] bits (Power supply control bits) */
+#define SDIO_POWER_PWRCTRL_0 ((uint8_t)0x01) /*!< Bit 0 */
+#define SDIO_POWER_PWRCTRL_1 ((uint8_t)0x02) /*!< Bit 1 */
+
+/****************** Bit definition for SDIO_CLKCR register ******************/
+#define SDIO_CLKCR_CLKDIV ((uint16_t)0x00FF) /*!< Clock divide factor */
+#define SDIO_CLKCR_CLKEN ((uint16_t)0x0100) /*!< Clock enable bit */
+#define SDIO_CLKCR_PWRSAV ((uint16_t)0x0200) /*!< Power saving configuration bit */
+#define SDIO_CLKCR_BYPASS ((uint16_t)0x0400) /*!< Clock divider bypass enable bit */
+
+#define SDIO_CLKCR_WIDBUS ((uint16_t)0x1800) /*!< WIDBUS[1:0] bits (Wide bus mode enable bit) */
+#define SDIO_CLKCR_WIDBUS_0 ((uint16_t)0x0800) /*!< Bit 0 */
+#define SDIO_CLKCR_WIDBUS_1 ((uint16_t)0x1000) /*!< Bit 1 */
+
+#define SDIO_CLKCR_NEGEDGE ((uint16_t)0x2000) /*!< SDIO_CK dephasing selection bit */
+#define SDIO_CLKCR_HWFC_EN ((uint16_t)0x4000) /*!< HW Flow Control enable */
+
+/******************* Bit definition for SDIO_ARG register *******************/
+#define SDIO_ARG_CMDARG ((uint32_t)0xFFFFFFFF) /*!< Command argument */
+
+/******************* Bit definition for SDIO_CMD register *******************/
+#define SDIO_CMD_CMDINDEX ((uint16_t)0x003F) /*!< Command Index */
+
+#define SDIO_CMD_WAITRESP ((uint16_t)0x00C0) /*!< WAITRESP[1:0] bits (Wait for response bits) */
+#define SDIO_CMD_WAITRESP_0 ((uint16_t)0x0040) /*!< Bit 0 */
+#define SDIO_CMD_WAITRESP_1 ((uint16_t)0x0080) /*!< Bit 1 */
+
+#define SDIO_CMD_WAITINT ((uint16_t)0x0100) /*!< CPSM Waits for Interrupt Request */
+#define SDIO_CMD_WAITPEND ((uint16_t)0x0200) /*!< CPSM Waits for ends of data transfer (CmdPend internal signal) */
+#define SDIO_CMD_CPSMEN ((uint16_t)0x0400) /*!< Command path state machine (CPSM) Enable bit */
+#define SDIO_CMD_SDIOSUSPEND ((uint16_t)0x0800) /*!< SD I/O suspend command */
+#define SDIO_CMD_ENCMDCOMPL ((uint16_t)0x1000) /*!< Enable CMD completion */
+#define SDIO_CMD_NIEN ((uint16_t)0x2000) /*!< Not Interrupt Enable */
+#define SDIO_CMD_CEATACMD ((uint16_t)0x4000) /*!< CE-ATA command */
+
+/***************** Bit definition for SDIO_RESPCMD register *****************/
+#define SDIO_RESPCMD_RESPCMD ((uint8_t)0x3F) /*!< Response command index */
+
+/****************** Bit definition for SDIO_RESP0 register ******************/
+#define SDIO_RESP0_CARDSTATUS0 ((uint32_t)0xFFFFFFFF) /*!< Card Status */
+
+/****************** Bit definition for SDIO_RESP1 register ******************/
+#define SDIO_RESP1_CARDSTATUS1 ((uint32_t)0xFFFFFFFF) /*!< Card Status */
+
+/****************** Bit definition for SDIO_RESP2 register ******************/
+#define SDIO_RESP2_CARDSTATUS2 ((uint32_t)0xFFFFFFFF) /*!< Card Status */
+
+/****************** Bit definition for SDIO_RESP3 register ******************/
+#define SDIO_RESP3_CARDSTATUS3 ((uint32_t)0xFFFFFFFF) /*!< Card Status */
+
+/****************** Bit definition for SDIO_RESP4 register ******************/
+#define SDIO_RESP4_CARDSTATUS4 ((uint32_t)0xFFFFFFFF) /*!< Card Status */
+
+/****************** Bit definition for SDIO_DTIMER register *****************/
+#define SDIO_DTIMER_DATATIME ((uint32_t)0xFFFFFFFF) /*!< Data timeout period. */
+
+/****************** Bit definition for SDIO_DLEN register *******************/
+#define SDIO_DLEN_DATALENGTH ((uint32_t)0x01FFFFFF) /*!< Data length value */
+
+/****************** Bit definition for SDIO_DCTRL register ******************/
+#define SDIO_DCTRL_DTEN ((uint16_t)0x0001) /*!< Data transfer enabled bit */
+#define SDIO_DCTRL_DTDIR ((uint16_t)0x0002) /*!< Data transfer direction selection */
+#define SDIO_DCTRL_DTMODE ((uint16_t)0x0004) /*!< Data transfer mode selection */
+#define SDIO_DCTRL_DMAEN ((uint16_t)0x0008) /*!< DMA enabled bit */
+
+#define SDIO_DCTRL_DBLOCKSIZE ((uint16_t)0x00F0) /*!< DBLOCKSIZE[3:0] bits (Data block size) */
+#define SDIO_DCTRL_DBLOCKSIZE_0 ((uint16_t)0x0010) /*!< Bit 0 */
+#define SDIO_DCTRL_DBLOCKSIZE_1 ((uint16_t)0x0020) /*!< Bit 1 */
+#define SDIO_DCTRL_DBLOCKSIZE_2 ((uint16_t)0x0040) /*!< Bit 2 */
+#define SDIO_DCTRL_DBLOCKSIZE_3 ((uint16_t)0x0080) /*!< Bit 3 */
+
+#define SDIO_DCTRL_RWSTART ((uint16_t)0x0100) /*!< Read wait start */
+#define SDIO_DCTRL_RWSTOP ((uint16_t)0x0200) /*!< Read wait stop */
+#define SDIO_DCTRL_RWMOD ((uint16_t)0x0400) /*!< Read wait mode */
+#define SDIO_DCTRL_SDIOEN ((uint16_t)0x0800) /*!< SD I/O enable functions */
+
+/****************** Bit definition for SDIO_DCOUNT register *****************/
+#define SDIO_DCOUNT_DATACOUNT ((uint32_t)0x01FFFFFF) /*!< Data count value */
+
+/****************** Bit definition for SDIO_STA register ********************/
+#define SDIO_STA_CCRCFAIL ((uint32_t)0x00000001) /*!< Command response received (CRC check failed) */
+#define SDIO_STA_DCRCFAIL ((uint32_t)0x00000002) /*!< Data block sent/received (CRC check failed) */
+#define SDIO_STA_CTIMEOUT ((uint32_t)0x00000004) /*!< Command response timeout */
+#define SDIO_STA_DTIMEOUT ((uint32_t)0x00000008) /*!< Data timeout */
+#define SDIO_STA_TXUNDERR ((uint32_t)0x00000010) /*!< Transmit FIFO underrun error */
+#define SDIO_STA_RXOVERR ((uint32_t)0x00000020) /*!< Received FIFO overrun error */
+#define SDIO_STA_CMDREND ((uint32_t)0x00000040) /*!< Command response received (CRC check passed) */
+#define SDIO_STA_CMDSENT ((uint32_t)0x00000080) /*!< Command sent (no response required) */
+#define SDIO_STA_DATAEND ((uint32_t)0x00000100) /*!< Data end (data counter, SDIDCOUNT, is zero) */
+#define SDIO_STA_STBITERR ((uint32_t)0x00000200) /*!< Start bit not detected on all data signals in wide bus mode */
+#define SDIO_STA_DBCKEND ((uint32_t)0x00000400) /*!< Data block sent/received (CRC check passed) */
+#define SDIO_STA_CMDACT ((uint32_t)0x00000800) /*!< Command transfer in progress */
+#define SDIO_STA_TXACT ((uint32_t)0x00001000) /*!< Data transmit in progress */
+#define SDIO_STA_RXACT ((uint32_t)0x00002000) /*!< Data receive in progress */
+#define SDIO_STA_TXFIFOHE ((uint32_t)0x00004000) /*!< Transmit FIFO Half Empty: at least 8 words can be written into the FIFO */
+#define SDIO_STA_RXFIFOHF ((uint32_t)0x00008000) /*!< Receive FIFO Half Full: there are at least 8 words in the FIFO */
+#define SDIO_STA_TXFIFOF ((uint32_t)0x00010000) /*!< Transmit FIFO full */
+#define SDIO_STA_RXFIFOF ((uint32_t)0x00020000) /*!< Receive FIFO full */
+#define SDIO_STA_TXFIFOE ((uint32_t)0x00040000) /*!< Transmit FIFO empty */
+#define SDIO_STA_RXFIFOE ((uint32_t)0x00080000) /*!< Receive FIFO empty */
+#define SDIO_STA_TXDAVL ((uint32_t)0x00100000) /*!< Data available in transmit FIFO */
+#define SDIO_STA_RXDAVL ((uint32_t)0x00200000) /*!< Data available in receive FIFO */
+#define SDIO_STA_SDIOIT ((uint32_t)0x00400000) /*!< SDIO interrupt received */
+#define SDIO_STA_CEATAEND ((uint32_t)0x00800000) /*!< CE-ATA command completion signal received for CMD61 */
+
+/******************* Bit definition for SDIO_ICR register *******************/
+#define SDIO_ICR_CCRCFAILC ((uint32_t)0x00000001) /*!< CCRCFAIL flag clear bit */
+#define SDIO_ICR_DCRCFAILC ((uint32_t)0x00000002) /*!< DCRCFAIL flag clear bit */
+#define SDIO_ICR_CTIMEOUTC ((uint32_t)0x00000004) /*!< CTIMEOUT flag clear bit */
+#define SDIO_ICR_DTIMEOUTC ((uint32_t)0x00000008) /*!< DTIMEOUT flag clear bit */
+#define SDIO_ICR_TXUNDERRC ((uint32_t)0x00000010) /*!< TXUNDERR flag clear bit */
+#define SDIO_ICR_RXOVERRC ((uint32_t)0x00000020) /*!< RXOVERR flag clear bit */
+#define SDIO_ICR_CMDRENDC ((uint32_t)0x00000040) /*!< CMDREND flag clear bit */
+#define SDIO_ICR_CMDSENTC ((uint32_t)0x00000080) /*!< CMDSENT flag clear bit */
+#define SDIO_ICR_DATAENDC ((uint32_t)0x00000100) /*!< DATAEND flag clear bit */
+#define SDIO_ICR_STBITERRC ((uint32_t)0x00000200) /*!< STBITERR flag clear bit */
+#define SDIO_ICR_DBCKENDC ((uint32_t)0x00000400) /*!< DBCKEND flag clear bit */
+#define SDIO_ICR_SDIOITC ((uint32_t)0x00400000) /*!< SDIOIT flag clear bit */
+#define SDIO_ICR_CEATAENDC ((uint32_t)0x00800000) /*!< CEATAEND flag clear bit */
+
+/****************** Bit definition for SDIO_MASK register *******************/
+#define SDIO_MASK_CCRCFAILIE ((uint32_t)0x00000001) /*!< Command CRC Fail Interrupt Enable */
+#define SDIO_MASK_DCRCFAILIE ((uint32_t)0x00000002) /*!< Data CRC Fail Interrupt Enable */
+#define SDIO_MASK_CTIMEOUTIE ((uint32_t)0x00000004) /*!< Command TimeOut Interrupt Enable */
+#define SDIO_MASK_DTIMEOUTIE ((uint32_t)0x00000008) /*!< Data TimeOut Interrupt Enable */
+#define SDIO_MASK_TXUNDERRIE ((uint32_t)0x00000010) /*!< Tx FIFO UnderRun Error Interrupt Enable */
+#define SDIO_MASK_RXOVERRIE ((uint32_t)0x00000020) /*!< Rx FIFO OverRun Error Interrupt Enable */
+#define SDIO_MASK_CMDRENDIE ((uint32_t)0x00000040) /*!< Command Response Received Interrupt Enable */
+#define SDIO_MASK_CMDSENTIE ((uint32_t)0x00000080) /*!< Command Sent Interrupt Enable */
+#define SDIO_MASK_DATAENDIE ((uint32_t)0x00000100) /*!< Data End Interrupt Enable */
+#define SDIO_MASK_STBITERRIE ((uint32_t)0x00000200) /*!< Start Bit Error Interrupt Enable */
+#define SDIO_MASK_DBCKENDIE ((uint32_t)0x00000400) /*!< Data Block End Interrupt Enable */
+#define SDIO_MASK_CMDACTIE ((uint32_t)0x00000800) /*!< Command Acting Interrupt Enable */
+#define SDIO_MASK_TXACTIE ((uint32_t)0x00001000) /*!< Data Transmit Acting Interrupt Enable */
+#define SDIO_MASK_RXACTIE ((uint32_t)0x00002000) /*!< Data receive acting interrupt enabled */
+#define SDIO_MASK_TXFIFOHEIE ((uint32_t)0x00004000) /*!< Tx FIFO Half Empty interrupt Enable */
+#define SDIO_MASK_RXFIFOHFIE ((uint32_t)0x00008000) /*!< Rx FIFO Half Full interrupt Enable */
+#define SDIO_MASK_TXFIFOFIE ((uint32_t)0x00010000) /*!< Tx FIFO Full interrupt Enable */
+#define SDIO_MASK_RXFIFOFIE ((uint32_t)0x00020000) /*!< Rx FIFO Full interrupt Enable */
+#define SDIO_MASK_TXFIFOEIE ((uint32_t)0x00040000) /*!< Tx FIFO Empty interrupt Enable */
+#define SDIO_MASK_RXFIFOEIE ((uint32_t)0x00080000) /*!< Rx FIFO Empty interrupt Enable */
+#define SDIO_MASK_TXDAVLIE ((uint32_t)0x00100000) /*!< Data available in Tx FIFO interrupt Enable */
+#define SDIO_MASK_RXDAVLIE ((uint32_t)0x00200000) /*!< Data available in Rx FIFO interrupt Enable */
+#define SDIO_MASK_SDIOITIE ((uint32_t)0x00400000) /*!< SDIO Mode Interrupt Received interrupt Enable */
+#define SDIO_MASK_CEATAENDIE ((uint32_t)0x00800000) /*!< CE-ATA command completion signal received Interrupt Enable */
+
+/***************** Bit definition for SDIO_FIFOCNT register *****************/
+#define SDIO_FIFOCNT_FIFOCOUNT ((uint32_t)0x00FFFFFF) /*!< Remaining number of words to be written to or read from the FIFO */
+
+/****************** Bit definition for SDIO_FIFO register *******************/
+#define SDIO_FIFO_FIFODATA ((uint32_t)0xFFFFFFFF) /*!< Receive and transmit FIFO data */
+
+/******************************************************************************/
+/* */
+/* USB Device FS */
+/* */
+/******************************************************************************/
+
+/*!< Endpoint-specific registers */
+/******************* Bit definition for USB_EP0R register *******************/
+#define USB_EP0R_EA ((uint16_t)0x000F) /*!< Endpoint Address */
+
+#define USB_EP0R_STAT_TX ((uint16_t)0x0030) /*!< STAT_TX[1:0] bits (Status bits, for transmission transfers) */
+#define USB_EP0R_STAT_TX_0 ((uint16_t)0x0010) /*!< Bit 0 */
+#define USB_EP0R_STAT_TX_1 ((uint16_t)0x0020) /*!< Bit 1 */
+
+#define USB_EP0R_DTOG_TX ((uint16_t)0x0040) /*!< Data Toggle, for transmission transfers */
+#define USB_EP0R_CTR_TX ((uint16_t)0x0080) /*!< Correct Transfer for transmission */
+#define USB_EP0R_EP_KIND ((uint16_t)0x0100) /*!< Endpoint Kind */
+
+#define USB_EP0R_EP_TYPE ((uint16_t)0x0600) /*!< EP_TYPE[1:0] bits (Endpoint type) */
+#define USB_EP0R_EP_TYPE_0 ((uint16_t)0x0200) /*!< Bit 0 */
+#define USB_EP0R_EP_TYPE_1 ((uint16_t)0x0400) /*!< Bit 1 */
+
+#define USB_EP0R_SETUP ((uint16_t)0x0800) /*!< Setup transaction completed */
+
+#define USB_EP0R_STAT_RX ((uint16_t)0x3000) /*!< STAT_RX[1:0] bits (Status bits, for reception transfers) */
+#define USB_EP0R_STAT_RX_0 ((uint16_t)0x1000) /*!< Bit 0 */
+#define USB_EP0R_STAT_RX_1 ((uint16_t)0x2000) /*!< Bit 1 */
+
+#define USB_EP0R_DTOG_RX ((uint16_t)0x4000) /*!< Data Toggle, for reception transfers */
+#define USB_EP0R_CTR_RX ((uint16_t)0x8000) /*!< Correct Transfer for reception */
+
+/******************* Bit definition for USB_EP1R register *******************/
+#define USB_EP1R_EA ((uint16_t)0x000F) /*!< Endpoint Address */
+
+#define USB_EP1R_STAT_TX ((uint16_t)0x0030) /*!< STAT_TX[1:0] bits (Status bits, for transmission transfers) */
+#define USB_EP1R_STAT_TX_0 ((uint16_t)0x0010) /*!< Bit 0 */
+#define USB_EP1R_STAT_TX_1 ((uint16_t)0x0020) /*!< Bit 1 */
+
+#define USB_EP1R_DTOG_TX ((uint16_t)0x0040) /*!< Data Toggle, for transmission transfers */
+#define USB_EP1R_CTR_TX ((uint16_t)0x0080) /*!< Correct Transfer for transmission */
+#define USB_EP1R_EP_KIND ((uint16_t)0x0100) /*!< Endpoint Kind */
+
+#define USB_EP1R_EP_TYPE ((uint16_t)0x0600) /*!< EP_TYPE[1:0] bits (Endpoint type) */
+#define USB_EP1R_EP_TYPE_0 ((uint16_t)0x0200) /*!< Bit 0 */
+#define USB_EP1R_EP_TYPE_1 ((uint16_t)0x0400) /*!< Bit 1 */
+
+#define USB_EP1R_SETUP ((uint16_t)0x0800) /*!< Setup transaction completed */
+
+#define USB_EP1R_STAT_RX ((uint16_t)0x3000) /*!< STAT_RX[1:0] bits (Status bits, for reception transfers) */
+#define USB_EP1R_STAT_RX_0 ((uint16_t)0x1000) /*!< Bit 0 */
+#define USB_EP1R_STAT_RX_1 ((uint16_t)0x2000) /*!< Bit 1 */
+
+#define USB_EP1R_DTOG_RX ((uint16_t)0x4000) /*!< Data Toggle, for reception transfers */
+#define USB_EP1R_CTR_RX ((uint16_t)0x8000) /*!< Correct Transfer for reception */
+
+/******************* Bit definition for USB_EP2R register *******************/
+#define USB_EP2R_EA ((uint16_t)0x000F) /*!< Endpoint Address */
+
+#define USB_EP2R_STAT_TX ((uint16_t)0x0030) /*!< STAT_TX[1:0] bits (Status bits, for transmission transfers) */
+#define USB_EP2R_STAT_TX_0 ((uint16_t)0x0010) /*!< Bit 0 */
+#define USB_EP2R_STAT_TX_1 ((uint16_t)0x0020) /*!< Bit 1 */
+
+#define USB_EP2R_DTOG_TX ((uint16_t)0x0040) /*!< Data Toggle, for transmission transfers */
+#define USB_EP2R_CTR_TX ((uint16_t)0x0080) /*!< Correct Transfer for transmission */
+#define USB_EP2R_EP_KIND ((uint16_t)0x0100) /*!< Endpoint Kind */
+
+#define USB_EP2R_EP_TYPE ((uint16_t)0x0600) /*!< EP_TYPE[1:0] bits (Endpoint type) */
+#define USB_EP2R_EP_TYPE_0 ((uint16_t)0x0200) /*!< Bit 0 */
+#define USB_EP2R_EP_TYPE_1 ((uint16_t)0x0400) /*!< Bit 1 */
+
+#define USB_EP2R_SETUP ((uint16_t)0x0800) /*!< Setup transaction completed */
+
+#define USB_EP2R_STAT_RX ((uint16_t)0x3000) /*!< STAT_RX[1:0] bits (Status bits, for reception transfers) */
+#define USB_EP2R_STAT_RX_0 ((uint16_t)0x1000) /*!< Bit 0 */
+#define USB_EP2R_STAT_RX_1 ((uint16_t)0x2000) /*!< Bit 1 */
+
+#define USB_EP2R_DTOG_RX ((uint16_t)0x4000) /*!< Data Toggle, for reception transfers */
+#define USB_EP2R_CTR_RX ((uint16_t)0x8000) /*!< Correct Transfer for reception */
+
+/******************* Bit definition for USB_EP3R register *******************/
+#define USB_EP3R_EA ((uint16_t)0x000F) /*!< Endpoint Address */
+
+#define USB_EP3R_STAT_TX ((uint16_t)0x0030) /*!< STAT_TX[1:0] bits (Status bits, for transmission transfers) */
+#define USB_EP3R_STAT_TX_0 ((uint16_t)0x0010) /*!< Bit 0 */
+#define USB_EP3R_STAT_TX_1 ((uint16_t)0x0020) /*!< Bit 1 */
+
+#define USB_EP3R_DTOG_TX ((uint16_t)0x0040) /*!< Data Toggle, for transmission transfers */
+#define USB_EP3R_CTR_TX ((uint16_t)0x0080) /*!< Correct Transfer for transmission */
+#define USB_EP3R_EP_KIND ((uint16_t)0x0100) /*!< Endpoint Kind */
+
+#define USB_EP3R_EP_TYPE ((uint16_t)0x0600) /*!< EP_TYPE[1:0] bits (Endpoint type) */
+#define USB_EP3R_EP_TYPE_0 ((uint16_t)0x0200) /*!< Bit 0 */
+#define USB_EP3R_EP_TYPE_1 ((uint16_t)0x0400) /*!< Bit 1 */
+
+#define USB_EP3R_SETUP ((uint16_t)0x0800) /*!< Setup transaction completed */
+
+#define USB_EP3R_STAT_RX ((uint16_t)0x3000) /*!< STAT_RX[1:0] bits (Status bits, for reception transfers) */
+#define USB_EP3R_STAT_RX_0 ((uint16_t)0x1000) /*!< Bit 0 */
+#define USB_EP3R_STAT_RX_1 ((uint16_t)0x2000) /*!< Bit 1 */
+
+#define USB_EP3R_DTOG_RX ((uint16_t)0x4000) /*!< Data Toggle, for reception transfers */
+#define USB_EP3R_CTR_RX ((uint16_t)0x8000) /*!< Correct Transfer for reception */
+
+/******************* Bit definition for USB_EP4R register *******************/
+#define USB_EP4R_EA ((uint16_t)0x000F) /*!< Endpoint Address */
+
+#define USB_EP4R_STAT_TX ((uint16_t)0x0030) /*!< STAT_TX[1:0] bits (Status bits, for transmission transfers) */
+#define USB_EP4R_STAT_TX_0 ((uint16_t)0x0010) /*!< Bit 0 */
+#define USB_EP4R_STAT_TX_1 ((uint16_t)0x0020) /*!< Bit 1 */
+
+#define USB_EP4R_DTOG_TX ((uint16_t)0x0040) /*!< Data Toggle, for transmission transfers */
+#define USB_EP4R_CTR_TX ((uint16_t)0x0080) /*!< Correct Transfer for transmission */
+#define USB_EP4R_EP_KIND ((uint16_t)0x0100) /*!< Endpoint Kind */
+
+#define USB_EP4R_EP_TYPE ((uint16_t)0x0600) /*!< EP_TYPE[1:0] bits (Endpoint type) */
+#define USB_EP4R_EP_TYPE_0 ((uint16_t)0x0200) /*!< Bit 0 */
+#define USB_EP4R_EP_TYPE_1 ((uint16_t)0x0400) /*!< Bit 1 */
+
+#define USB_EP4R_SETUP ((uint16_t)0x0800) /*!< Setup transaction completed */
+
+#define USB_EP4R_STAT_RX ((uint16_t)0x3000) /*!< STAT_RX[1:0] bits (Status bits, for reception transfers) */
+#define USB_EP4R_STAT_RX_0 ((uint16_t)0x1000) /*!< Bit 0 */
+#define USB_EP4R_STAT_RX_1 ((uint16_t)0x2000) /*!< Bit 1 */
+
+#define USB_EP4R_DTOG_RX ((uint16_t)0x4000) /*!< Data Toggle, for reception transfers */
+#define USB_EP4R_CTR_RX ((uint16_t)0x8000) /*!< Correct Transfer for reception */
+
+/******************* Bit definition for USB_EP5R register *******************/
+#define USB_EP5R_EA ((uint16_t)0x000F) /*!< Endpoint Address */
+
+#define USB_EP5R_STAT_TX ((uint16_t)0x0030) /*!< STAT_TX[1:0] bits (Status bits, for transmission transfers) */
+#define USB_EP5R_STAT_TX_0 ((uint16_t)0x0010) /*!< Bit 0 */
+#define USB_EP5R_STAT_TX_1 ((uint16_t)0x0020) /*!< Bit 1 */
+
+#define USB_EP5R_DTOG_TX ((uint16_t)0x0040) /*!< Data Toggle, for transmission transfers */
+#define USB_EP5R_CTR_TX ((uint16_t)0x0080) /*!< Correct Transfer for transmission */
+#define USB_EP5R_EP_KIND ((uint16_t)0x0100) /*!< Endpoint Kind */
+
+#define USB_EP5R_EP_TYPE ((uint16_t)0x0600) /*!< EP_TYPE[1:0] bits (Endpoint type) */
+#define USB_EP5R_EP_TYPE_0 ((uint16_t)0x0200) /*!< Bit 0 */
+#define USB_EP5R_EP_TYPE_1 ((uint16_t)0x0400) /*!< Bit 1 */
+
+#define USB_EP5R_SETUP ((uint16_t)0x0800) /*!< Setup transaction completed */
+
+#define USB_EP5R_STAT_RX ((uint16_t)0x3000) /*!< STAT_RX[1:0] bits (Status bits, for reception transfers) */
+#define USB_EP5R_STAT_RX_0 ((uint16_t)0x1000) /*!< Bit 0 */
+#define USB_EP5R_STAT_RX_1 ((uint16_t)0x2000) /*!< Bit 1 */
+
+#define USB_EP5R_DTOG_RX ((uint16_t)0x4000) /*!< Data Toggle, for reception transfers */
+#define USB_EP5R_CTR_RX ((uint16_t)0x8000) /*!< Correct Transfer for reception */
+
+/******************* Bit definition for USB_EP6R register *******************/
+#define USB_EP6R_EA ((uint16_t)0x000F) /*!< Endpoint Address */
+
+#define USB_EP6R_STAT_TX ((uint16_t)0x0030) /*!< STAT_TX[1:0] bits (Status bits, for transmission transfers) */
+#define USB_EP6R_STAT_TX_0 ((uint16_t)0x0010) /*!< Bit 0 */
+#define USB_EP6R_STAT_TX_1 ((uint16_t)0x0020) /*!< Bit 1 */
+
+#define USB_EP6R_DTOG_TX ((uint16_t)0x0040) /*!< Data Toggle, for transmission transfers */
+#define USB_EP6R_CTR_TX ((uint16_t)0x0080) /*!< Correct Transfer for transmission */
+#define USB_EP6R_EP_KIND ((uint16_t)0x0100) /*!< Endpoint Kind */
+
+#define USB_EP6R_EP_TYPE ((uint16_t)0x0600) /*!< EP_TYPE[1:0] bits (Endpoint type) */
+#define USB_EP6R_EP_TYPE_0 ((uint16_t)0x0200) /*!< Bit 0 */
+#define USB_EP6R_EP_TYPE_1 ((uint16_t)0x0400) /*!< Bit 1 */
+
+#define USB_EP6R_SETUP ((uint16_t)0x0800) /*!< Setup transaction completed */
+
+#define USB_EP6R_STAT_RX ((uint16_t)0x3000) /*!< STAT_RX[1:0] bits (Status bits, for reception transfers) */
+#define USB_EP6R_STAT_RX_0 ((uint16_t)0x1000) /*!< Bit 0 */
+#define USB_EP6R_STAT_RX_1 ((uint16_t)0x2000) /*!< Bit 1 */
+
+#define USB_EP6R_DTOG_RX ((uint16_t)0x4000) /*!< Data Toggle, for reception transfers */
+#define USB_EP6R_CTR_RX ((uint16_t)0x8000) /*!< Correct Transfer for reception */
+
+/******************* Bit definition for USB_EP7R register *******************/
+#define USB_EP7R_EA ((uint16_t)0x000F) /*!< Endpoint Address */
+
+#define USB_EP7R_STAT_TX ((uint16_t)0x0030) /*!< STAT_TX[1:0] bits (Status bits, for transmission transfers) */
+#define USB_EP7R_STAT_TX_0 ((uint16_t)0x0010) /*!< Bit 0 */
+#define USB_EP7R_STAT_TX_1 ((uint16_t)0x0020) /*!< Bit 1 */
+
+#define USB_EP7R_DTOG_TX ((uint16_t)0x0040) /*!< Data Toggle, for transmission transfers */
+#define USB_EP7R_CTR_TX ((uint16_t)0x0080) /*!< Correct Transfer for transmission */
+#define USB_EP7R_EP_KIND ((uint16_t)0x0100) /*!< Endpoint Kind */
+
+#define USB_EP7R_EP_TYPE ((uint16_t)0x0600) /*!< EP_TYPE[1:0] bits (Endpoint type) */
+#define USB_EP7R_EP_TYPE_0 ((uint16_t)0x0200) /*!< Bit 0 */
+#define USB_EP7R_EP_TYPE_1 ((uint16_t)0x0400) /*!< Bit 1 */
+
+#define USB_EP7R_SETUP ((uint16_t)0x0800) /*!< Setup transaction completed */
+
+#define USB_EP7R_STAT_RX ((uint16_t)0x3000) /*!< STAT_RX[1:0] bits (Status bits, for reception transfers) */
+#define USB_EP7R_STAT_RX_0 ((uint16_t)0x1000) /*!< Bit 0 */
+#define USB_EP7R_STAT_RX_1 ((uint16_t)0x2000) /*!< Bit 1 */
+
+#define USB_EP7R_DTOG_RX ((uint16_t)0x4000) /*!< Data Toggle, for reception transfers */
+#define USB_EP7R_CTR_RX ((uint16_t)0x8000) /*!< Correct Transfer for reception */
+
+/*!< Common registers */
+/******************* Bit definition for USB_CNTR register *******************/
+#define USB_CNTR_FRES ((uint16_t)0x0001) /*!< Force USB Reset */
+#define USB_CNTR_PDWN ((uint16_t)0x0002) /*!< Power down */
+#define USB_CNTR_LP_MODE ((uint16_t)0x0004) /*!< Low-power mode */
+#define USB_CNTR_FSUSP ((uint16_t)0x0008) /*!< Force suspend */
+#define USB_CNTR_RESUME ((uint16_t)0x0010) /*!< Resume request */
+#define USB_CNTR_ESOFM ((uint16_t)0x0100) /*!< Expected Start Of Frame Interrupt Mask */
+#define USB_CNTR_SOFM ((uint16_t)0x0200) /*!< Start Of Frame Interrupt Mask */
+#define USB_CNTR_RESETM ((uint16_t)0x0400) /*!< RESET Interrupt Mask */
+#define USB_CNTR_SUSPM ((uint16_t)0x0800) /*!< Suspend mode Interrupt Mask */
+#define USB_CNTR_WKUPM ((uint16_t)0x1000) /*!< Wakeup Interrupt Mask */
+#define USB_CNTR_ERRM ((uint16_t)0x2000) /*!< Error Interrupt Mask */
+#define USB_CNTR_PMAOVRM ((uint16_t)0x4000) /*!< Packet Memory Area Over / Underrun Interrupt Mask */
+#define USB_CNTR_CTRM ((uint16_t)0x8000) /*!< Correct Transfer Interrupt Mask */
+
+/******************* Bit definition for USB_ISTR register *******************/
+#define USB_ISTR_EP_ID ((uint16_t)0x000F) /*!< Endpoint Identifier */
+#define USB_ISTR_DIR ((uint16_t)0x0010) /*!< Direction of transaction */
+#define USB_ISTR_ESOF ((uint16_t)0x0100) /*!< Expected Start Of Frame */
+#define USB_ISTR_SOF ((uint16_t)0x0200) /*!< Start Of Frame */
+#define USB_ISTR_RESET ((uint16_t)0x0400) /*!< USB RESET request */
+#define USB_ISTR_SUSP ((uint16_t)0x0800) /*!< Suspend mode request */
+#define USB_ISTR_WKUP ((uint16_t)0x1000) /*!< Wake up */
+#define USB_ISTR_ERR ((uint16_t)0x2000) /*!< Error */
+#define USB_ISTR_PMAOVR ((uint16_t)0x4000) /*!< Packet Memory Area Over / Underrun */
+#define USB_ISTR_CTR ((uint16_t)0x8000) /*!< Correct Transfer */
+
+/******************* Bit definition for USB_FNR register ********************/
+#define USB_FNR_FN ((uint16_t)0x07FF) /*!< Frame Number */
+#define USB_FNR_LSOF ((uint16_t)0x1800) /*!< Lost SOF */
+#define USB_FNR_LCK ((uint16_t)0x2000) /*!< Locked */
+#define USB_FNR_RXDM ((uint16_t)0x4000) /*!< Receive Data - Line Status */
+#define USB_FNR_RXDP ((uint16_t)0x8000) /*!< Receive Data + Line Status */
+
+/****************** Bit definition for USB_DADDR register *******************/
+#define USB_DADDR_ADD ((uint8_t)0x7F) /*!< ADD[6:0] bits (Device Address) */
+#define USB_DADDR_ADD0 ((uint8_t)0x01) /*!< Bit 0 */
+#define USB_DADDR_ADD1 ((uint8_t)0x02) /*!< Bit 1 */
+#define USB_DADDR_ADD2 ((uint8_t)0x04) /*!< Bit 2 */
+#define USB_DADDR_ADD3 ((uint8_t)0x08) /*!< Bit 3 */
+#define USB_DADDR_ADD4 ((uint8_t)0x10) /*!< Bit 4 */
+#define USB_DADDR_ADD5 ((uint8_t)0x20) /*!< Bit 5 */
+#define USB_DADDR_ADD6 ((uint8_t)0x40) /*!< Bit 6 */
+
+#define USB_DADDR_EF ((uint8_t)0x80) /*!< Enable Function */
+
+/****************** Bit definition for USB_BTABLE register ******************/
+#define USB_BTABLE_BTABLE ((uint16_t)0xFFF8) /*!< Buffer Table */
+
+/*!< Buffer descriptor table */
+/***************** Bit definition for USB_ADDR0_TX register *****************/
+#define USB_ADDR0_TX_ADDR0_TX ((uint16_t)0xFFFE) /*!< Transmission Buffer Address 0 */
+
+/***************** Bit definition for USB_ADDR1_TX register *****************/
+#define USB_ADDR1_TX_ADDR1_TX ((uint16_t)0xFFFE) /*!< Transmission Buffer Address 1 */
+
+/***************** Bit definition for USB_ADDR2_TX register *****************/
+#define USB_ADDR2_TX_ADDR2_TX ((uint16_t)0xFFFE) /*!< Transmission Buffer Address 2 */
+
+/***************** Bit definition for USB_ADDR3_TX register *****************/
+#define USB_ADDR3_TX_ADDR3_TX ((uint16_t)0xFFFE) /*!< Transmission Buffer Address 3 */
+
+/***************** Bit definition for USB_ADDR4_TX register *****************/
+#define USB_ADDR4_TX_ADDR4_TX ((uint16_t)0xFFFE) /*!< Transmission Buffer Address 4 */
+
+/***************** Bit definition for USB_ADDR5_TX register *****************/
+#define USB_ADDR5_TX_ADDR5_TX ((uint16_t)0xFFFE) /*!< Transmission Buffer Address 5 */
+
+/***************** Bit definition for USB_ADDR6_TX register *****************/
+#define USB_ADDR6_TX_ADDR6_TX ((uint16_t)0xFFFE) /*!< Transmission Buffer Address 6 */
+
+/***************** Bit definition for USB_ADDR7_TX register *****************/
+#define USB_ADDR7_TX_ADDR7_TX ((uint16_t)0xFFFE) /*!< Transmission Buffer Address 7 */
+
+/*----------------------------------------------------------------------------*/
+
+/***************** Bit definition for USB_COUNT0_TX register ****************/
+#define USB_COUNT0_TX_COUNT0_TX ((uint16_t)0x03FF) /*!< Transmission Byte Count 0 */
+
+/***************** Bit definition for USB_COUNT1_TX register ****************/
+#define USB_COUNT1_TX_COUNT1_TX ((uint16_t)0x03FF) /*!< Transmission Byte Count 1 */
+
+/***************** Bit definition for USB_COUNT2_TX register ****************/
+#define USB_COUNT2_TX_COUNT2_TX ((uint16_t)0x03FF) /*!< Transmission Byte Count 2 */
+
+/***************** Bit definition for USB_COUNT3_TX register ****************/
+#define USB_COUNT3_TX_COUNT3_TX ((uint16_t)0x03FF) /*!< Transmission Byte Count 3 */
+
+/***************** Bit definition for USB_COUNT4_TX register ****************/
+#define USB_COUNT4_TX_COUNT4_TX ((uint16_t)0x03FF) /*!< Transmission Byte Count 4 */
+
+/***************** Bit definition for USB_COUNT5_TX register ****************/
+#define USB_COUNT5_TX_COUNT5_TX ((uint16_t)0x03FF) /*!< Transmission Byte Count 5 */
+
+/***************** Bit definition for USB_COUNT6_TX register ****************/
+#define USB_COUNT6_TX_COUNT6_TX ((uint16_t)0x03FF) /*!< Transmission Byte Count 6 */
+
+/***************** Bit definition for USB_COUNT7_TX register ****************/
+#define USB_COUNT7_TX_COUNT7_TX ((uint16_t)0x03FF) /*!< Transmission Byte Count 7 */
+
+/*----------------------------------------------------------------------------*/
+
+/**************** Bit definition for USB_COUNT0_TX_0 register ***************/
+#define USB_COUNT0_TX_0_COUNT0_TX_0 ((uint32_t)0x000003FF) /*!< Transmission Byte Count 0 (low) */
+
+/**************** Bit definition for USB_COUNT0_TX_1 register ***************/
+#define USB_COUNT0_TX_1_COUNT0_TX_1 ((uint32_t)0x03FF0000) /*!< Transmission Byte Count 0 (high) */
+
+/**************** Bit definition for USB_COUNT1_TX_0 register ***************/
+#define USB_COUNT1_TX_0_COUNT1_TX_0 ((uint32_t)0x000003FF) /*!< Transmission Byte Count 1 (low) */
+
+/**************** Bit definition for USB_COUNT1_TX_1 register ***************/
+#define USB_COUNT1_TX_1_COUNT1_TX_1 ((uint32_t)0x03FF0000) /*!< Transmission Byte Count 1 (high) */
+
+/**************** Bit definition for USB_COUNT2_TX_0 register ***************/
+#define USB_COUNT2_TX_0_COUNT2_TX_0 ((uint32_t)0x000003FF) /*!< Transmission Byte Count 2 (low) */
+
+/**************** Bit definition for USB_COUNT2_TX_1 register ***************/
+#define USB_COUNT2_TX_1_COUNT2_TX_1 ((uint32_t)0x03FF0000) /*!< Transmission Byte Count 2 (high) */
+
+/**************** Bit definition for USB_COUNT3_TX_0 register ***************/
+#define USB_COUNT3_TX_0_COUNT3_TX_0 ((uint16_t)0x000003FF) /*!< Transmission Byte Count 3 (low) */
+
+/**************** Bit definition for USB_COUNT3_TX_1 register ***************/
+#define USB_COUNT3_TX_1_COUNT3_TX_1 ((uint16_t)0x03FF0000) /*!< Transmission Byte Count 3 (high) */
+
+/**************** Bit definition for USB_COUNT4_TX_0 register ***************/
+#define USB_COUNT4_TX_0_COUNT4_TX_0 ((uint32_t)0x000003FF) /*!< Transmission Byte Count 4 (low) */
+
+/**************** Bit definition for USB_COUNT4_TX_1 register ***************/
+#define USB_COUNT4_TX_1_COUNT4_TX_1 ((uint32_t)0x03FF0000) /*!< Transmission Byte Count 4 (high) */
+
+/**************** Bit definition for USB_COUNT5_TX_0 register ***************/
+#define USB_COUNT5_TX_0_COUNT5_TX_0 ((uint32_t)0x000003FF) /*!< Transmission Byte Count 5 (low) */
+
+/**************** Bit definition for USB_COUNT5_TX_1 register ***************/
+#define USB_COUNT5_TX_1_COUNT5_TX_1 ((uint32_t)0x03FF0000) /*!< Transmission Byte Count 5 (high) */
+
+/**************** Bit definition for USB_COUNT6_TX_0 register ***************/
+#define USB_COUNT6_TX_0_COUNT6_TX_0 ((uint32_t)0x000003FF) /*!< Transmission Byte Count 6 (low) */
+
+/**************** Bit definition for USB_COUNT6_TX_1 register ***************/
+#define USB_COUNT6_TX_1_COUNT6_TX_1 ((uint32_t)0x03FF0000) /*!< Transmission Byte Count 6 (high) */
+
+/**************** Bit definition for USB_COUNT7_TX_0 register ***************/
+#define USB_COUNT7_TX_0_COUNT7_TX_0 ((uint32_t)0x000003FF) /*!< Transmission Byte Count 7 (low) */
+
+/**************** Bit definition for USB_COUNT7_TX_1 register ***************/
+#define USB_COUNT7_TX_1_COUNT7_TX_1 ((uint32_t)0x03FF0000) /*!< Transmission Byte Count 7 (high) */
+
+/*----------------------------------------------------------------------------*/
+
+/***************** Bit definition for USB_ADDR0_RX register *****************/
+#define USB_ADDR0_RX_ADDR0_RX ((uint16_t)0xFFFE) /*!< Reception Buffer Address 0 */
+
+/***************** Bit definition for USB_ADDR1_RX register *****************/
+#define USB_ADDR1_RX_ADDR1_RX ((uint16_t)0xFFFE) /*!< Reception Buffer Address 1 */
+
+/***************** Bit definition for USB_ADDR2_RX register *****************/
+#define USB_ADDR2_RX_ADDR2_RX ((uint16_t)0xFFFE) /*!< Reception Buffer Address 2 */
+
+/***************** Bit definition for USB_ADDR3_RX register *****************/
+#define USB_ADDR3_RX_ADDR3_RX ((uint16_t)0xFFFE) /*!< Reception Buffer Address 3 */
+
+/***************** Bit definition for USB_ADDR4_RX register *****************/
+#define USB_ADDR4_RX_ADDR4_RX ((uint16_t)0xFFFE) /*!< Reception Buffer Address 4 */
+
+/***************** Bit definition for USB_ADDR5_RX register *****************/
+#define USB_ADDR5_RX_ADDR5_RX ((uint16_t)0xFFFE) /*!< Reception Buffer Address 5 */
+
+/***************** Bit definition for USB_ADDR6_RX register *****************/
+#define USB_ADDR6_RX_ADDR6_RX ((uint16_t)0xFFFE) /*!< Reception Buffer Address 6 */
+
+/***************** Bit definition for USB_ADDR7_RX register *****************/
+#define USB_ADDR7_RX_ADDR7_RX ((uint16_t)0xFFFE) /*!< Reception Buffer Address 7 */
+
+/*----------------------------------------------------------------------------*/
+
+/***************** Bit definition for USB_COUNT0_RX register ****************/
+#define USB_COUNT0_RX_COUNT0_RX ((uint16_t)0x03FF) /*!< Reception Byte Count */
+
+#define USB_COUNT0_RX_NUM_BLOCK ((uint16_t)0x7C00) /*!< NUM_BLOCK[4:0] bits (Number of blocks) */
+#define USB_COUNT0_RX_NUM_BLOCK_0 ((uint16_t)0x0400) /*!< Bit 0 */
+#define USB_COUNT0_RX_NUM_BLOCK_1 ((uint16_t)0x0800) /*!< Bit 1 */
+#define USB_COUNT0_RX_NUM_BLOCK_2 ((uint16_t)0x1000) /*!< Bit 2 */
+#define USB_COUNT0_RX_NUM_BLOCK_3 ((uint16_t)0x2000) /*!< Bit 3 */
+#define USB_COUNT0_RX_NUM_BLOCK_4 ((uint16_t)0x4000) /*!< Bit 4 */
+
+#define USB_COUNT0_RX_BLSIZE ((uint16_t)0x8000) /*!< BLock SIZE */
+
+/***************** Bit definition for USB_COUNT1_RX register ****************/
+#define USB_COUNT1_RX_COUNT1_RX ((uint16_t)0x03FF) /*!< Reception Byte Count */
+
+#define USB_COUNT1_RX_NUM_BLOCK ((uint16_t)0x7C00) /*!< NUM_BLOCK[4:0] bits (Number of blocks) */
+#define USB_COUNT1_RX_NUM_BLOCK_0 ((uint16_t)0x0400) /*!< Bit 0 */
+#define USB_COUNT1_RX_NUM_BLOCK_1 ((uint16_t)0x0800) /*!< Bit 1 */
+#define USB_COUNT1_RX_NUM_BLOCK_2 ((uint16_t)0x1000) /*!< Bit 2 */
+#define USB_COUNT1_RX_NUM_BLOCK_3 ((uint16_t)0x2000) /*!< Bit 3 */
+#define USB_COUNT1_RX_NUM_BLOCK_4 ((uint16_t)0x4000) /*!< Bit 4 */
+
+#define USB_COUNT1_RX_BLSIZE ((uint16_t)0x8000) /*!< BLock SIZE */
+
+/***************** Bit definition for USB_COUNT2_RX register ****************/
+#define USB_COUNT2_RX_COUNT2_RX ((uint16_t)0x03FF) /*!< Reception Byte Count */
+
+#define USB_COUNT2_RX_NUM_BLOCK ((uint16_t)0x7C00) /*!< NUM_BLOCK[4:0] bits (Number of blocks) */
+#define USB_COUNT2_RX_NUM_BLOCK_0 ((uint16_t)0x0400) /*!< Bit 0 */
+#define USB_COUNT2_RX_NUM_BLOCK_1 ((uint16_t)0x0800) /*!< Bit 1 */
+#define USB_COUNT2_RX_NUM_BLOCK_2 ((uint16_t)0x1000) /*!< Bit 2 */
+#define USB_COUNT2_RX_NUM_BLOCK_3 ((uint16_t)0x2000) /*!< Bit 3 */
+#define USB_COUNT2_RX_NUM_BLOCK_4 ((uint16_t)0x4000) /*!< Bit 4 */
+
+#define USB_COUNT2_RX_BLSIZE ((uint16_t)0x8000) /*!< BLock SIZE */
+
+/***************** Bit definition for USB_COUNT3_RX register ****************/
+#define USB_COUNT3_RX_COUNT3_RX ((uint16_t)0x03FF) /*!< Reception Byte Count */
+
+#define USB_COUNT3_RX_NUM_BLOCK ((uint16_t)0x7C00) /*!< NUM_BLOCK[4:0] bits (Number of blocks) */
+#define USB_COUNT3_RX_NUM_BLOCK_0 ((uint16_t)0x0400) /*!< Bit 0 */
+#define USB_COUNT3_RX_NUM_BLOCK_1 ((uint16_t)0x0800) /*!< Bit 1 */
+#define USB_COUNT3_RX_NUM_BLOCK_2 ((uint16_t)0x1000) /*!< Bit 2 */
+#define USB_COUNT3_RX_NUM_BLOCK_3 ((uint16_t)0x2000) /*!< Bit 3 */
+#define USB_COUNT3_RX_NUM_BLOCK_4 ((uint16_t)0x4000) /*!< Bit 4 */
+
+#define USB_COUNT3_RX_BLSIZE ((uint16_t)0x8000) /*!< BLock SIZE */
+
+/***************** Bit definition for USB_COUNT4_RX register ****************/
+#define USB_COUNT4_RX_COUNT4_RX ((uint16_t)0x03FF) /*!< Reception Byte Count */
+
+#define USB_COUNT4_RX_NUM_BLOCK ((uint16_t)0x7C00) /*!< NUM_BLOCK[4:0] bits (Number of blocks) */
+#define USB_COUNT4_RX_NUM_BLOCK_0 ((uint16_t)0x0400) /*!< Bit 0 */
+#define USB_COUNT4_RX_NUM_BLOCK_1 ((uint16_t)0x0800) /*!< Bit 1 */
+#define USB_COUNT4_RX_NUM_BLOCK_2 ((uint16_t)0x1000) /*!< Bit 2 */
+#define USB_COUNT4_RX_NUM_BLOCK_3 ((uint16_t)0x2000) /*!< Bit 3 */
+#define USB_COUNT4_RX_NUM_BLOCK_4 ((uint16_t)0x4000) /*!< Bit 4 */
+
+#define USB_COUNT4_RX_BLSIZE ((uint16_t)0x8000) /*!< BLock SIZE */
+
+/***************** Bit definition for USB_COUNT5_RX register ****************/
+#define USB_COUNT5_RX_COUNT5_RX ((uint16_t)0x03FF) /*!< Reception Byte Count */
+
+#define USB_COUNT5_RX_NUM_BLOCK ((uint16_t)0x7C00) /*!< NUM_BLOCK[4:0] bits (Number of blocks) */
+#define USB_COUNT5_RX_NUM_BLOCK_0 ((uint16_t)0x0400) /*!< Bit 0 */
+#define USB_COUNT5_RX_NUM_BLOCK_1 ((uint16_t)0x0800) /*!< Bit 1 */
+#define USB_COUNT5_RX_NUM_BLOCK_2 ((uint16_t)0x1000) /*!< Bit 2 */
+#define USB_COUNT5_RX_NUM_BLOCK_3 ((uint16_t)0x2000) /*!< Bit 3 */
+#define USB_COUNT5_RX_NUM_BLOCK_4 ((uint16_t)0x4000) /*!< Bit 4 */
+
+#define USB_COUNT5_RX_BLSIZE ((uint16_t)0x8000) /*!< BLock SIZE */
+
+/***************** Bit definition for USB_COUNT6_RX register ****************/
+#define USB_COUNT6_RX_COUNT6_RX ((uint16_t)0x03FF) /*!< Reception Byte Count */
+
+#define USB_COUNT6_RX_NUM_BLOCK ((uint16_t)0x7C00) /*!< NUM_BLOCK[4:0] bits (Number of blocks) */
+#define USB_COUNT6_RX_NUM_BLOCK_0 ((uint16_t)0x0400) /*!< Bit 0 */
+#define USB_COUNT6_RX_NUM_BLOCK_1 ((uint16_t)0x0800) /*!< Bit 1 */
+#define USB_COUNT6_RX_NUM_BLOCK_2 ((uint16_t)0x1000) /*!< Bit 2 */
+#define USB_COUNT6_RX_NUM_BLOCK_3 ((uint16_t)0x2000) /*!< Bit 3 */
+#define USB_COUNT6_RX_NUM_BLOCK_4 ((uint16_t)0x4000) /*!< Bit 4 */
+
+#define USB_COUNT6_RX_BLSIZE ((uint16_t)0x8000) /*!< BLock SIZE */
+
+/***************** Bit definition for USB_COUNT7_RX register ****************/
+#define USB_COUNT7_RX_COUNT7_RX ((uint16_t)0x03FF) /*!< Reception Byte Count */
+
+#define USB_COUNT7_RX_NUM_BLOCK ((uint16_t)0x7C00) /*!< NUM_BLOCK[4:0] bits (Number of blocks) */
+#define USB_COUNT7_RX_NUM_BLOCK_0 ((uint16_t)0x0400) /*!< Bit 0 */
+#define USB_COUNT7_RX_NUM_BLOCK_1 ((uint16_t)0x0800) /*!< Bit 1 */
+#define USB_COUNT7_RX_NUM_BLOCK_2 ((uint16_t)0x1000) /*!< Bit 2 */
+#define USB_COUNT7_RX_NUM_BLOCK_3 ((uint16_t)0x2000) /*!< Bit 3 */
+#define USB_COUNT7_RX_NUM_BLOCK_4 ((uint16_t)0x4000) /*!< Bit 4 */
+
+#define USB_COUNT7_RX_BLSIZE ((uint16_t)0x8000) /*!< BLock SIZE */
+
+/*----------------------------------------------------------------------------*/
+
+/**************** Bit definition for USB_COUNT0_RX_0 register ***************/
+#define USB_COUNT0_RX_0_COUNT0_RX_0 ((uint32_t)0x000003FF) /*!< Reception Byte Count (low) */
+
+#define USB_COUNT0_RX_0_NUM_BLOCK_0 ((uint32_t)0x00007C00) /*!< NUM_BLOCK_0[4:0] bits (Number of blocks) (low) */
+#define USB_COUNT0_RX_0_NUM_BLOCK_0_0 ((uint32_t)0x00000400) /*!< Bit 0 */
+#define USB_COUNT0_RX_0_NUM_BLOCK_0_1 ((uint32_t)0x00000800) /*!< Bit 1 */
+#define USB_COUNT0_RX_0_NUM_BLOCK_0_2 ((uint32_t)0x00001000) /*!< Bit 2 */
+#define USB_COUNT0_RX_0_NUM_BLOCK_0_3 ((uint32_t)0x00002000) /*!< Bit 3 */
+#define USB_COUNT0_RX_0_NUM_BLOCK_0_4 ((uint32_t)0x00004000) /*!< Bit 4 */
+
+#define USB_COUNT0_RX_0_BLSIZE_0 ((uint32_t)0x00008000) /*!< BLock SIZE (low) */
+
+/**************** Bit definition for USB_COUNT0_RX_1 register ***************/
+#define USB_COUNT0_RX_1_COUNT0_RX_1 ((uint32_t)0x03FF0000) /*!< Reception Byte Count (high) */
+
+#define USB_COUNT0_RX_1_NUM_BLOCK_1 ((uint32_t)0x7C000000) /*!< NUM_BLOCK_1[4:0] bits (Number of blocks) (high) */
+#define USB_COUNT0_RX_1_NUM_BLOCK_1_0 ((uint32_t)0x04000000) /*!< Bit 1 */
+#define USB_COUNT0_RX_1_NUM_BLOCK_1_1 ((uint32_t)0x08000000) /*!< Bit 1 */
+#define USB_COUNT0_RX_1_NUM_BLOCK_1_2 ((uint32_t)0x10000000) /*!< Bit 2 */
+#define USB_COUNT0_RX_1_NUM_BLOCK_1_3 ((uint32_t)0x20000000) /*!< Bit 3 */
+#define USB_COUNT0_RX_1_NUM_BLOCK_1_4 ((uint32_t)0x40000000) /*!< Bit 4 */
+
+#define USB_COUNT0_RX_1_BLSIZE_1 ((uint32_t)0x80000000) /*!< BLock SIZE (high) */
+
+/**************** Bit definition for USB_COUNT1_RX_0 register ***************/
+#define USB_COUNT1_RX_0_COUNT1_RX_0 ((uint32_t)0x000003FF) /*!< Reception Byte Count (low) */
+
+#define USB_COUNT1_RX_0_NUM_BLOCK_0 ((uint32_t)0x00007C00) /*!< NUM_BLOCK_0[4:0] bits (Number of blocks) (low) */
+#define USB_COUNT1_RX_0_NUM_BLOCK_0_0 ((uint32_t)0x00000400) /*!< Bit 0 */
+#define USB_COUNT1_RX_0_NUM_BLOCK_0_1 ((uint32_t)0x00000800) /*!< Bit 1 */
+#define USB_COUNT1_RX_0_NUM_BLOCK_0_2 ((uint32_t)0x00001000) /*!< Bit 2 */
+#define USB_COUNT1_RX_0_NUM_BLOCK_0_3 ((uint32_t)0x00002000) /*!< Bit 3 */
+#define USB_COUNT1_RX_0_NUM_BLOCK_0_4 ((uint32_t)0x00004000) /*!< Bit 4 */
+
+#define USB_COUNT1_RX_0_BLSIZE_0 ((uint32_t)0x00008000) /*!< BLock SIZE (low) */
+
+/**************** Bit definition for USB_COUNT1_RX_1 register ***************/
+#define USB_COUNT1_RX_1_COUNT1_RX_1 ((uint32_t)0x03FF0000) /*!< Reception Byte Count (high) */
+
+#define USB_COUNT1_RX_1_NUM_BLOCK_1 ((uint32_t)0x7C000000) /*!< NUM_BLOCK_1[4:0] bits (Number of blocks) (high) */
+#define USB_COUNT1_RX_1_NUM_BLOCK_1_0 ((uint32_t)0x04000000) /*!< Bit 0 */
+#define USB_COUNT1_RX_1_NUM_BLOCK_1_1 ((uint32_t)0x08000000) /*!< Bit 1 */
+#define USB_COUNT1_RX_1_NUM_BLOCK_1_2 ((uint32_t)0x10000000) /*!< Bit 2 */
+#define USB_COUNT1_RX_1_NUM_BLOCK_1_3 ((uint32_t)0x20000000) /*!< Bit 3 */
+#define USB_COUNT1_RX_1_NUM_BLOCK_1_4 ((uint32_t)0x40000000) /*!< Bit 4 */
+
+#define USB_COUNT1_RX_1_BLSIZE_1 ((uint32_t)0x80000000) /*!< BLock SIZE (high) */
+
+/**************** Bit definition for USB_COUNT2_RX_0 register ***************/
+#define USB_COUNT2_RX_0_COUNT2_RX_0 ((uint32_t)0x000003FF) /*!< Reception Byte Count (low) */
+
+#define USB_COUNT2_RX_0_NUM_BLOCK_0 ((uint32_t)0x00007C00) /*!< NUM_BLOCK_0[4:0] bits (Number of blocks) (low) */
+#define USB_COUNT2_RX_0_NUM_BLOCK_0_0 ((uint32_t)0x00000400) /*!< Bit 0 */
+#define USB_COUNT2_RX_0_NUM_BLOCK_0_1 ((uint32_t)0x00000800) /*!< Bit 1 */
+#define USB_COUNT2_RX_0_NUM_BLOCK_0_2 ((uint32_t)0x00001000) /*!< Bit 2 */
+#define USB_COUNT2_RX_0_NUM_BLOCK_0_3 ((uint32_t)0x00002000) /*!< Bit 3 */
+#define USB_COUNT2_RX_0_NUM_BLOCK_0_4 ((uint32_t)0x00004000) /*!< Bit 4 */
+
+#define USB_COUNT2_RX_0_BLSIZE_0 ((uint32_t)0x00008000) /*!< BLock SIZE (low) */
+
+/**************** Bit definition for USB_COUNT2_RX_1 register ***************/
+#define USB_COUNT2_RX_1_COUNT2_RX_1 ((uint32_t)0x03FF0000) /*!< Reception Byte Count (high) */
+
+#define USB_COUNT2_RX_1_NUM_BLOCK_1 ((uint32_t)0x7C000000) /*!< NUM_BLOCK_1[4:0] bits (Number of blocks) (high) */
+#define USB_COUNT2_RX_1_NUM_BLOCK_1_0 ((uint32_t)0x04000000) /*!< Bit 0 */
+#define USB_COUNT2_RX_1_NUM_BLOCK_1_1 ((uint32_t)0x08000000) /*!< Bit 1 */
+#define USB_COUNT2_RX_1_NUM_BLOCK_1_2 ((uint32_t)0x10000000) /*!< Bit 2 */
+#define USB_COUNT2_RX_1_NUM_BLOCK_1_3 ((uint32_t)0x20000000) /*!< Bit 3 */
+#define USB_COUNT2_RX_1_NUM_BLOCK_1_4 ((uint32_t)0x40000000) /*!< Bit 4 */
+
+#define USB_COUNT2_RX_1_BLSIZE_1 ((uint32_t)0x80000000) /*!< BLock SIZE (high) */
+
+/**************** Bit definition for USB_COUNT3_RX_0 register ***************/
+#define USB_COUNT3_RX_0_COUNT3_RX_0 ((uint32_t)0x000003FF) /*!< Reception Byte Count (low) */
+
+#define USB_COUNT3_RX_0_NUM_BLOCK_0 ((uint32_t)0x00007C00) /*!< NUM_BLOCK_0[4:0] bits (Number of blocks) (low) */
+#define USB_COUNT3_RX_0_NUM_BLOCK_0_0 ((uint32_t)0x00000400) /*!< Bit 0 */
+#define USB_COUNT3_RX_0_NUM_BLOCK_0_1 ((uint32_t)0x00000800) /*!< Bit 1 */
+#define USB_COUNT3_RX_0_NUM_BLOCK_0_2 ((uint32_t)0x00001000) /*!< Bit 2 */
+#define USB_COUNT3_RX_0_NUM_BLOCK_0_3 ((uint32_t)0x00002000) /*!< Bit 3 */
+#define USB_COUNT3_RX_0_NUM_BLOCK_0_4 ((uint32_t)0x00004000) /*!< Bit 4 */
+
+#define USB_COUNT3_RX_0_BLSIZE_0 ((uint32_t)0x00008000) /*!< BLock SIZE (low) */
+
+/**************** Bit definition for USB_COUNT3_RX_1 register ***************/
+#define USB_COUNT3_RX_1_COUNT3_RX_1 ((uint32_t)0x03FF0000) /*!< Reception Byte Count (high) */
+
+#define USB_COUNT3_RX_1_NUM_BLOCK_1 ((uint32_t)0x7C000000) /*!< NUM_BLOCK_1[4:0] bits (Number of blocks) (high) */
+#define USB_COUNT3_RX_1_NUM_BLOCK_1_0 ((uint32_t)0x04000000) /*!< Bit 0 */
+#define USB_COUNT3_RX_1_NUM_BLOCK_1_1 ((uint32_t)0x08000000) /*!< Bit 1 */
+#define USB_COUNT3_RX_1_NUM_BLOCK_1_2 ((uint32_t)0x10000000) /*!< Bit 2 */
+#define USB_COUNT3_RX_1_NUM_BLOCK_1_3 ((uint32_t)0x20000000) /*!< Bit 3 */
+#define USB_COUNT3_RX_1_NUM_BLOCK_1_4 ((uint32_t)0x40000000) /*!< Bit 4 */
+
+#define USB_COUNT3_RX_1_BLSIZE_1 ((uint32_t)0x80000000) /*!< BLock SIZE (high) */
+
+/**************** Bit definition for USB_COUNT4_RX_0 register ***************/
+#define USB_COUNT4_RX_0_COUNT4_RX_0 ((uint32_t)0x000003FF) /*!< Reception Byte Count (low) */
+
+#define USB_COUNT4_RX_0_NUM_BLOCK_0 ((uint32_t)0x00007C00) /*!< NUM_BLOCK_0[4:0] bits (Number of blocks) (low) */
+#define USB_COUNT4_RX_0_NUM_BLOCK_0_0 ((uint32_t)0x00000400) /*!< Bit 0 */
+#define USB_COUNT4_RX_0_NUM_BLOCK_0_1 ((uint32_t)0x00000800) /*!< Bit 1 */
+#define USB_COUNT4_RX_0_NUM_BLOCK_0_2 ((uint32_t)0x00001000) /*!< Bit 2 */
+#define USB_COUNT4_RX_0_NUM_BLOCK_0_3 ((uint32_t)0x00002000) /*!< Bit 3 */
+#define USB_COUNT4_RX_0_NUM_BLOCK_0_4 ((uint32_t)0x00004000) /*!< Bit 4 */
+
+#define USB_COUNT4_RX_0_BLSIZE_0 ((uint32_t)0x00008000) /*!< BLock SIZE (low) */
+
+/**************** Bit definition for USB_COUNT4_RX_1 register ***************/
+#define USB_COUNT4_RX_1_COUNT4_RX_1 ((uint32_t)0x03FF0000) /*!< Reception Byte Count (high) */
+
+#define USB_COUNT4_RX_1_NUM_BLOCK_1 ((uint32_t)0x7C000000) /*!< NUM_BLOCK_1[4:0] bits (Number of blocks) (high) */
+#define USB_COUNT4_RX_1_NUM_BLOCK_1_0 ((uint32_t)0x04000000) /*!< Bit 0 */
+#define USB_COUNT4_RX_1_NUM_BLOCK_1_1 ((uint32_t)0x08000000) /*!< Bit 1 */
+#define USB_COUNT4_RX_1_NUM_BLOCK_1_2 ((uint32_t)0x10000000) /*!< Bit 2 */
+#define USB_COUNT4_RX_1_NUM_BLOCK_1_3 ((uint32_t)0x20000000) /*!< Bit 3 */
+#define USB_COUNT4_RX_1_NUM_BLOCK_1_4 ((uint32_t)0x40000000) /*!< Bit 4 */
+
+#define USB_COUNT4_RX_1_BLSIZE_1 ((uint32_t)0x80000000) /*!< BLock SIZE (high) */
+
+/**************** Bit definition for USB_COUNT5_RX_0 register ***************/
+#define USB_COUNT5_RX_0_COUNT5_RX_0 ((uint32_t)0x000003FF) /*!< Reception Byte Count (low) */
+
+#define USB_COUNT5_RX_0_NUM_BLOCK_0 ((uint32_t)0x00007C00) /*!< NUM_BLOCK_0[4:0] bits (Number of blocks) (low) */
+#define USB_COUNT5_RX_0_NUM_BLOCK_0_0 ((uint32_t)0x00000400) /*!< Bit 0 */
+#define USB_COUNT5_RX_0_NUM_BLOCK_0_1 ((uint32_t)0x00000800) /*!< Bit 1 */
+#define USB_COUNT5_RX_0_NUM_BLOCK_0_2 ((uint32_t)0x00001000) /*!< Bit 2 */
+#define USB_COUNT5_RX_0_NUM_BLOCK_0_3 ((uint32_t)0x00002000) /*!< Bit 3 */
+#define USB_COUNT5_RX_0_NUM_BLOCK_0_4 ((uint32_t)0x00004000) /*!< Bit 4 */
+
+#define USB_COUNT5_RX_0_BLSIZE_0 ((uint32_t)0x00008000) /*!< BLock SIZE (low) */
+
+/**************** Bit definition for USB_COUNT5_RX_1 register ***************/
+#define USB_COUNT5_RX_1_COUNT5_RX_1 ((uint32_t)0x03FF0000) /*!< Reception Byte Count (high) */
+
+#define USB_COUNT5_RX_1_NUM_BLOCK_1 ((uint32_t)0x7C000000) /*!< NUM_BLOCK_1[4:0] bits (Number of blocks) (high) */
+#define USB_COUNT5_RX_1_NUM_BLOCK_1_0 ((uint32_t)0x04000000) /*!< Bit 0 */
+#define USB_COUNT5_RX_1_NUM_BLOCK_1_1 ((uint32_t)0x08000000) /*!< Bit 1 */
+#define USB_COUNT5_RX_1_NUM_BLOCK_1_2 ((uint32_t)0x10000000) /*!< Bit 2 */
+#define USB_COUNT5_RX_1_NUM_BLOCK_1_3 ((uint32_t)0x20000000) /*!< Bit 3 */
+#define USB_COUNT5_RX_1_NUM_BLOCK_1_4 ((uint32_t)0x40000000) /*!< Bit 4 */
+
+#define USB_COUNT5_RX_1_BLSIZE_1 ((uint32_t)0x80000000) /*!< BLock SIZE (high) */
+
+/*************** Bit definition for USB_COUNT6_RX_0 register ***************/
+#define USB_COUNT6_RX_0_COUNT6_RX_0 ((uint32_t)0x000003FF) /*!< Reception Byte Count (low) */
+
+#define USB_COUNT6_RX_0_NUM_BLOCK_0 ((uint32_t)0x00007C00) /*!< NUM_BLOCK_0[4:0] bits (Number of blocks) (low) */
+#define USB_COUNT6_RX_0_NUM_BLOCK_0_0 ((uint32_t)0x00000400) /*!< Bit 0 */
+#define USB_COUNT6_RX_0_NUM_BLOCK_0_1 ((uint32_t)0x00000800) /*!< Bit 1 */
+#define USB_COUNT6_RX_0_NUM_BLOCK_0_2 ((uint32_t)0x00001000) /*!< Bit 2 */
+#define USB_COUNT6_RX_0_NUM_BLOCK_0_3 ((uint32_t)0x00002000) /*!< Bit 3 */
+#define USB_COUNT6_RX_0_NUM_BLOCK_0_4 ((uint32_t)0x00004000) /*!< Bit 4 */
+
+#define USB_COUNT6_RX_0_BLSIZE_0 ((uint32_t)0x00008000) /*!< BLock SIZE (low) */
+
+/**************** Bit definition for USB_COUNT6_RX_1 register ***************/
+#define USB_COUNT6_RX_1_COUNT6_RX_1 ((uint32_t)0x03FF0000) /*!< Reception Byte Count (high) */
+
+#define USB_COUNT6_RX_1_NUM_BLOCK_1 ((uint32_t)0x7C000000) /*!< NUM_BLOCK_1[4:0] bits (Number of blocks) (high) */
+#define USB_COUNT6_RX_1_NUM_BLOCK_1_0 ((uint32_t)0x04000000) /*!< Bit 0 */
+#define USB_COUNT6_RX_1_NUM_BLOCK_1_1 ((uint32_t)0x08000000) /*!< Bit 1 */
+#define USB_COUNT6_RX_1_NUM_BLOCK_1_2 ((uint32_t)0x10000000) /*!< Bit 2 */
+#define USB_COUNT6_RX_1_NUM_BLOCK_1_3 ((uint32_t)0x20000000) /*!< Bit 3 */
+#define USB_COUNT6_RX_1_NUM_BLOCK_1_4 ((uint32_t)0x40000000) /*!< Bit 4 */
+
+#define USB_COUNT6_RX_1_BLSIZE_1 ((uint32_t)0x80000000) /*!< BLock SIZE (high) */
+
+/*************** Bit definition for USB_COUNT7_RX_0 register ****************/
+#define USB_COUNT7_RX_0_COUNT7_RX_0 ((uint32_t)0x000003FF) /*!< Reception Byte Count (low) */
+
+#define USB_COUNT7_RX_0_NUM_BLOCK_0 ((uint32_t)0x00007C00) /*!< NUM_BLOCK_0[4:0] bits (Number of blocks) (low) */
+#define USB_COUNT7_RX_0_NUM_BLOCK_0_0 ((uint32_t)0x00000400) /*!< Bit 0 */
+#define USB_COUNT7_RX_0_NUM_BLOCK_0_1 ((uint32_t)0x00000800) /*!< Bit 1 */
+#define USB_COUNT7_RX_0_NUM_BLOCK_0_2 ((uint32_t)0x00001000) /*!< Bit 2 */
+#define USB_COUNT7_RX_0_NUM_BLOCK_0_3 ((uint32_t)0x00002000) /*!< Bit 3 */
+#define USB_COUNT7_RX_0_NUM_BLOCK_0_4 ((uint32_t)0x00004000) /*!< Bit 4 */
+
+#define USB_COUNT7_RX_0_BLSIZE_0 ((uint32_t)0x00008000) /*!< BLock SIZE (low) */
+
+/*************** Bit definition for USB_COUNT7_RX_1 register ****************/
+#define USB_COUNT7_RX_1_COUNT7_RX_1 ((uint32_t)0x03FF0000) /*!< Reception Byte Count (high) */
+
+#define USB_COUNT7_RX_1_NUM_BLOCK_1 ((uint32_t)0x7C000000) /*!< NUM_BLOCK_1[4:0] bits (Number of blocks) (high) */
+#define USB_COUNT7_RX_1_NUM_BLOCK_1_0 ((uint32_t)0x04000000) /*!< Bit 0 */
+#define USB_COUNT7_RX_1_NUM_BLOCK_1_1 ((uint32_t)0x08000000) /*!< Bit 1 */
+#define USB_COUNT7_RX_1_NUM_BLOCK_1_2 ((uint32_t)0x10000000) /*!< Bit 2 */
+#define USB_COUNT7_RX_1_NUM_BLOCK_1_3 ((uint32_t)0x20000000) /*!< Bit 3 */
+#define USB_COUNT7_RX_1_NUM_BLOCK_1_4 ((uint32_t)0x40000000) /*!< Bit 4 */
+
+#define USB_COUNT7_RX_1_BLSIZE_1 ((uint32_t)0x80000000) /*!< BLock SIZE (high) */
+
+/******************************************************************************/
+/* */
+/* Controller Area Network */
+/* */
+/******************************************************************************/
+
+/*!< CAN control and status registers */
+/******************* Bit definition for CAN_MCR register ********************/
+#define CAN_MCR_INRQ ((uint16_t)0x0001) /*!< Initialization Request */
+#define CAN_MCR_SLEEP ((uint16_t)0x0002) /*!< Sleep Mode Request */
+#define CAN_MCR_TXFP ((uint16_t)0x0004) /*!< Transmit FIFO Priority */
+#define CAN_MCR_RFLM ((uint16_t)0x0008) /*!< Receive FIFO Locked Mode */
+#define CAN_MCR_NART ((uint16_t)0x0010) /*!< No Automatic Retransmission */
+#define CAN_MCR_AWUM ((uint16_t)0x0020) /*!< Automatic Wakeup Mode */
+#define CAN_MCR_ABOM ((uint16_t)0x0040) /*!< Automatic Bus-Off Management */
+#define CAN_MCR_TTCM ((uint16_t)0x0080) /*!< Time Triggered Communication Mode */
+#define CAN_MCR_RESET ((uint16_t)0x8000) /*!< CAN software master reset */
+
+/******************* Bit definition for CAN_MSR register ********************/
+#define CAN_MSR_INAK ((uint16_t)0x0001) /*!< Initialization Acknowledge */
+#define CAN_MSR_SLAK ((uint16_t)0x0002) /*!< Sleep Acknowledge */
+#define CAN_MSR_ERRI ((uint16_t)0x0004) /*!< Error Interrupt */
+#define CAN_MSR_WKUI ((uint16_t)0x0008) /*!< Wakeup Interrupt */
+#define CAN_MSR_SLAKI ((uint16_t)0x0010) /*!< Sleep Acknowledge Interrupt */
+#define CAN_MSR_TXM ((uint16_t)0x0100) /*!< Transmit Mode */
+#define CAN_MSR_RXM ((uint16_t)0x0200) /*!< Receive Mode */
+#define CAN_MSR_SAMP ((uint16_t)0x0400) /*!< Last Sample Point */
+#define CAN_MSR_RX ((uint16_t)0x0800) /*!< CAN Rx Signal */
+
+/******************* Bit definition for CAN_TSR register ********************/
+#define CAN_TSR_RQCP0 ((uint32_t)0x00000001) /*!< Request Completed Mailbox0 */
+#define CAN_TSR_TXOK0 ((uint32_t)0x00000002) /*!< Transmission OK of Mailbox0 */
+#define CAN_TSR_ALST0 ((uint32_t)0x00000004) /*!< Arbitration Lost for Mailbox0 */
+#define CAN_TSR_TERR0 ((uint32_t)0x00000008) /*!< Transmission Error of Mailbox0 */
+#define CAN_TSR_ABRQ0 ((uint32_t)0x00000080) /*!< Abort Request for Mailbox0 */
+#define CAN_TSR_RQCP1 ((uint32_t)0x00000100) /*!< Request Completed Mailbox1 */
+#define CAN_TSR_TXOK1 ((uint32_t)0x00000200) /*!< Transmission OK of Mailbox1 */
+#define CAN_TSR_ALST1 ((uint32_t)0x00000400) /*!< Arbitration Lost for Mailbox1 */
+#define CAN_TSR_TERR1 ((uint32_t)0x00000800) /*!< Transmission Error of Mailbox1 */
+#define CAN_TSR_ABRQ1 ((uint32_t)0x00008000) /*!< Abort Request for Mailbox 1 */
+#define CAN_TSR_RQCP2 ((uint32_t)0x00010000) /*!< Request Completed Mailbox2 */
+#define CAN_TSR_TXOK2 ((uint32_t)0x00020000) /*!< Transmission OK of Mailbox 2 */
+#define CAN_TSR_ALST2 ((uint32_t)0x00040000) /*!< Arbitration Lost for mailbox 2 */
+#define CAN_TSR_TERR2 ((uint32_t)0x00080000) /*!< Transmission Error of Mailbox 2 */
+#define CAN_TSR_ABRQ2 ((uint32_t)0x00800000) /*!< Abort Request for Mailbox 2 */
+#define CAN_TSR_CODE ((uint32_t)0x03000000) /*!< Mailbox Code */
+
+#define CAN_TSR_TME ((uint32_t)0x1C000000) /*!< TME[2:0] bits */
+#define CAN_TSR_TME0 ((uint32_t)0x04000000) /*!< Transmit Mailbox 0 Empty */
+#define CAN_TSR_TME1 ((uint32_t)0x08000000) /*!< Transmit Mailbox 1 Empty */
+#define CAN_TSR_TME2 ((uint32_t)0x10000000) /*!< Transmit Mailbox 2 Empty */
+
+#define CAN_TSR_LOW ((uint32_t)0xE0000000) /*!< LOW[2:0] bits */
+#define CAN_TSR_LOW0 ((uint32_t)0x20000000) /*!< Lowest Priority Flag for Mailbox 0 */
+#define CAN_TSR_LOW1 ((uint32_t)0x40000000) /*!< Lowest Priority Flag for Mailbox 1 */
+#define CAN_TSR_LOW2 ((uint32_t)0x80000000) /*!< Lowest Priority Flag for Mailbox 2 */
+
+/******************* Bit definition for CAN_RF0R register *******************/
+#define CAN_RF0R_FMP0 ((uint8_t)0x03) /*!< FIFO 0 Message Pending */
+#define CAN_RF0R_FULL0 ((uint8_t)0x08) /*!< FIFO 0 Full */
+#define CAN_RF0R_FOVR0 ((uint8_t)0x10) /*!< FIFO 0 Overrun */
+#define CAN_RF0R_RFOM0 ((uint8_t)0x20) /*!< Release FIFO 0 Output Mailbox */
+
+/******************* Bit definition for CAN_RF1R register *******************/
+#define CAN_RF1R_FMP1 ((uint8_t)0x03) /*!< FIFO 1 Message Pending */
+#define CAN_RF1R_FULL1 ((uint8_t)0x08) /*!< FIFO 1 Full */
+#define CAN_RF1R_FOVR1 ((uint8_t)0x10) /*!< FIFO 1 Overrun */
+#define CAN_RF1R_RFOM1 ((uint8_t)0x20) /*!< Release FIFO 1 Output Mailbox */
+
+/******************** Bit definition for CAN_IER register *******************/
+#define CAN_IER_TMEIE ((uint32_t)0x00000001) /*!< Transmit Mailbox Empty Interrupt Enable */
+#define CAN_IER_FMPIE0 ((uint32_t)0x00000002) /*!< FIFO Message Pending Interrupt Enable */
+#define CAN_IER_FFIE0 ((uint32_t)0x00000004) /*!< FIFO Full Interrupt Enable */
+#define CAN_IER_FOVIE0 ((uint32_t)0x00000008) /*!< FIFO Overrun Interrupt Enable */
+#define CAN_IER_FMPIE1 ((uint32_t)0x00000010) /*!< FIFO Message Pending Interrupt Enable */
+#define CAN_IER_FFIE1 ((uint32_t)0x00000020) /*!< FIFO Full Interrupt Enable */
+#define CAN_IER_FOVIE1 ((uint32_t)0x00000040) /*!< FIFO Overrun Interrupt Enable */
+#define CAN_IER_EWGIE ((uint32_t)0x00000100) /*!< Error Warning Interrupt Enable */
+#define CAN_IER_EPVIE ((uint32_t)0x00000200) /*!< Error Passive Interrupt Enable */
+#define CAN_IER_BOFIE ((uint32_t)0x00000400) /*!< Bus-Off Interrupt Enable */
+#define CAN_IER_LECIE ((uint32_t)0x00000800) /*!< Last Error Code Interrupt Enable */
+#define CAN_IER_ERRIE ((uint32_t)0x00008000) /*!< Error Interrupt Enable */
+#define CAN_IER_WKUIE ((uint32_t)0x00010000) /*!< Wakeup Interrupt Enable */
+#define CAN_IER_SLKIE ((uint32_t)0x00020000) /*!< Sleep Interrupt Enable */
+
+/******************** Bit definition for CAN_ESR register *******************/
+#define CAN_ESR_EWGF ((uint32_t)0x00000001) /*!< Error Warning Flag */
+#define CAN_ESR_EPVF ((uint32_t)0x00000002) /*!< Error Passive Flag */
+#define CAN_ESR_BOFF ((uint32_t)0x00000004) /*!< Bus-Off Flag */
+
+#define CAN_ESR_LEC ((uint32_t)0x00000070) /*!< LEC[2:0] bits (Last Error Code) */
+#define CAN_ESR_LEC_0 ((uint32_t)0x00000010) /*!< Bit 0 */
+#define CAN_ESR_LEC_1 ((uint32_t)0x00000020) /*!< Bit 1 */
+#define CAN_ESR_LEC_2 ((uint32_t)0x00000040) /*!< Bit 2 */
+
+#define CAN_ESR_TEC ((uint32_t)0x00FF0000) /*!< Least significant byte of the 9-bit Transmit Error Counter */
+#define CAN_ESR_REC ((uint32_t)0xFF000000) /*!< Receive Error Counter */
+
+/******************* Bit definition for CAN_BTR register ********************/
+#define CAN_BTR_BRP ((uint32_t)0x000003FF) /*!< Baud Rate Prescaler */
+#define CAN_BTR_TS1 ((uint32_t)0x000F0000) /*!< Time Segment 1 */
+#define CAN_BTR_TS2 ((uint32_t)0x00700000) /*!< Time Segment 2 */
+#define CAN_BTR_SJW ((uint32_t)0x03000000) /*!< Resynchronization Jump Width */
+#define CAN_BTR_LBKM ((uint32_t)0x40000000) /*!< Loop Back Mode (Debug) */
+#define CAN_BTR_SILM ((uint32_t)0x80000000) /*!< Silent Mode */
+
+/*!< Mailbox registers */
+/****************** Bit definition for CAN_TI0R register ********************/
+#define CAN_TI0R_TXRQ ((uint32_t)0x00000001) /*!< Transmit Mailbox Request */
+#define CAN_TI0R_RTR ((uint32_t)0x00000002) /*!< Remote Transmission Request */
+#define CAN_TI0R_IDE ((uint32_t)0x00000004) /*!< Identifier Extension */
+#define CAN_TI0R_EXID ((uint32_t)0x001FFFF8) /*!< Extended Identifier */
+#define CAN_TI0R_STID ((uint32_t)0xFFE00000) /*!< Standard Identifier or Extended Identifier */
+
+/****************** Bit definition for CAN_TDT0R register *******************/
+#define CAN_TDT0R_DLC ((uint32_t)0x0000000F) /*!< Data Length Code */
+#define CAN_TDT0R_TGT ((uint32_t)0x00000100) /*!< Transmit Global Time */
+#define CAN_TDT0R_TIME ((uint32_t)0xFFFF0000) /*!< Message Time Stamp */
+
+/****************** Bit definition for CAN_TDL0R register *******************/
+#define CAN_TDL0R_DATA0 ((uint32_t)0x000000FF) /*!< Data byte 0 */
+#define CAN_TDL0R_DATA1 ((uint32_t)0x0000FF00) /*!< Data byte 1 */
+#define CAN_TDL0R_DATA2 ((uint32_t)0x00FF0000) /*!< Data byte 2 */
+#define CAN_TDL0R_DATA3 ((uint32_t)0xFF000000) /*!< Data byte 3 */
+
+/****************** Bit definition for CAN_TDH0R register *******************/
+#define CAN_TDH0R_DATA4 ((uint32_t)0x000000FF) /*!< Data byte 4 */
+#define CAN_TDH0R_DATA5 ((uint32_t)0x0000FF00) /*!< Data byte 5 */
+#define CAN_TDH0R_DATA6 ((uint32_t)0x00FF0000) /*!< Data byte 6 */
+#define CAN_TDH0R_DATA7 ((uint32_t)0xFF000000) /*!< Data byte 7 */
+
+/******************* Bit definition for CAN_TI1R register *******************/
+#define CAN_TI1R_TXRQ ((uint32_t)0x00000001) /*!< Transmit Mailbox Request */
+#define CAN_TI1R_RTR ((uint32_t)0x00000002) /*!< Remote Transmission Request */
+#define CAN_TI1R_IDE ((uint32_t)0x00000004) /*!< Identifier Extension */
+#define CAN_TI1R_EXID ((uint32_t)0x001FFFF8) /*!< Extended Identifier */
+#define CAN_TI1R_STID ((uint32_t)0xFFE00000) /*!< Standard Identifier or Extended Identifier */
+
+/******************* Bit definition for CAN_TDT1R register ******************/
+#define CAN_TDT1R_DLC ((uint32_t)0x0000000F) /*!< Data Length Code */
+#define CAN_TDT1R_TGT ((uint32_t)0x00000100) /*!< Transmit Global Time */
+#define CAN_TDT1R_TIME ((uint32_t)0xFFFF0000) /*!< Message Time Stamp */
+
+/******************* Bit definition for CAN_TDL1R register ******************/
+#define CAN_TDL1R_DATA0 ((uint32_t)0x000000FF) /*!< Data byte 0 */
+#define CAN_TDL1R_DATA1 ((uint32_t)0x0000FF00) /*!< Data byte 1 */
+#define CAN_TDL1R_DATA2 ((uint32_t)0x00FF0000) /*!< Data byte 2 */
+#define CAN_TDL1R_DATA3 ((uint32_t)0xFF000000) /*!< Data byte 3 */
+
+/******************* Bit definition for CAN_TDH1R register ******************/
+#define CAN_TDH1R_DATA4 ((uint32_t)0x000000FF) /*!< Data byte 4 */
+#define CAN_TDH1R_DATA5 ((uint32_t)0x0000FF00) /*!< Data byte 5 */
+#define CAN_TDH1R_DATA6 ((uint32_t)0x00FF0000) /*!< Data byte 6 */
+#define CAN_TDH1R_DATA7 ((uint32_t)0xFF000000) /*!< Data byte 7 */
+
+/******************* Bit definition for CAN_TI2R register *******************/
+#define CAN_TI2R_TXRQ ((uint32_t)0x00000001) /*!< Transmit Mailbox Request */
+#define CAN_TI2R_RTR ((uint32_t)0x00000002) /*!< Remote Transmission Request */
+#define CAN_TI2R_IDE ((uint32_t)0x00000004) /*!< Identifier Extension */
+#define CAN_TI2R_EXID ((uint32_t)0x001FFFF8) /*!< Extended identifier */
+#define CAN_TI2R_STID ((uint32_t)0xFFE00000) /*!< Standard Identifier or Extended Identifier */
+
+/******************* Bit definition for CAN_TDT2R register ******************/
+#define CAN_TDT2R_DLC ((uint32_t)0x0000000F) /*!< Data Length Code */
+#define CAN_TDT2R_TGT ((uint32_t)0x00000100) /*!< Transmit Global Time */
+#define CAN_TDT2R_TIME ((uint32_t)0xFFFF0000) /*!< Message Time Stamp */
+
+/******************* Bit definition for CAN_TDL2R register ******************/
+#define CAN_TDL2R_DATA0 ((uint32_t)0x000000FF) /*!< Data byte 0 */
+#define CAN_TDL2R_DATA1 ((uint32_t)0x0000FF00) /*!< Data byte 1 */
+#define CAN_TDL2R_DATA2 ((uint32_t)0x00FF0000) /*!< Data byte 2 */
+#define CAN_TDL2R_DATA3 ((uint32_t)0xFF000000) /*!< Data byte 3 */
+
+/******************* Bit definition for CAN_TDH2R register ******************/
+#define CAN_TDH2R_DATA4 ((uint32_t)0x000000FF) /*!< Data byte 4 */
+#define CAN_TDH2R_DATA5 ((uint32_t)0x0000FF00) /*!< Data byte 5 */
+#define CAN_TDH2R_DATA6 ((uint32_t)0x00FF0000) /*!< Data byte 6 */
+#define CAN_TDH2R_DATA7 ((uint32_t)0xFF000000) /*!< Data byte 7 */
+
+/******************* Bit definition for CAN_RI0R register *******************/
+#define CAN_RI0R_RTR ((uint32_t)0x00000002) /*!< Remote Transmission Request */
+#define CAN_RI0R_IDE ((uint32_t)0x00000004) /*!< Identifier Extension */
+#define CAN_RI0R_EXID ((uint32_t)0x001FFFF8) /*!< Extended Identifier */
+#define CAN_RI0R_STID ((uint32_t)0xFFE00000) /*!< Standard Identifier or Extended Identifier */
+
+/******************* Bit definition for CAN_RDT0R register ******************/
+#define CAN_RDT0R_DLC ((uint32_t)0x0000000F) /*!< Data Length Code */
+#define CAN_RDT0R_FMI ((uint32_t)0x0000FF00) /*!< Filter Match Index */
+#define CAN_RDT0R_TIME ((uint32_t)0xFFFF0000) /*!< Message Time Stamp */
+
+/******************* Bit definition for CAN_RDL0R register ******************/
+#define CAN_RDL0R_DATA0 ((uint32_t)0x000000FF) /*!< Data byte 0 */
+#define CAN_RDL0R_DATA1 ((uint32_t)0x0000FF00) /*!< Data byte 1 */
+#define CAN_RDL0R_DATA2 ((uint32_t)0x00FF0000) /*!< Data byte 2 */
+#define CAN_RDL0R_DATA3 ((uint32_t)0xFF000000) /*!< Data byte 3 */
+
+/******************* Bit definition for CAN_RDH0R register ******************/
+#define CAN_RDH0R_DATA4 ((uint32_t)0x000000FF) /*!< Data byte 4 */
+#define CAN_RDH0R_DATA5 ((uint32_t)0x0000FF00) /*!< Data byte 5 */
+#define CAN_RDH0R_DATA6 ((uint32_t)0x00FF0000) /*!< Data byte 6 */
+#define CAN_RDH0R_DATA7 ((uint32_t)0xFF000000) /*!< Data byte 7 */
+
+/******************* Bit definition for CAN_RI1R register *******************/
+#define CAN_RI1R_RTR ((uint32_t)0x00000002) /*!< Remote Transmission Request */
+#define CAN_RI1R_IDE ((uint32_t)0x00000004) /*!< Identifier Extension */
+#define CAN_RI1R_EXID ((uint32_t)0x001FFFF8) /*!< Extended identifier */
+#define CAN_RI1R_STID ((uint32_t)0xFFE00000) /*!< Standard Identifier or Extended Identifier */
+
+/******************* Bit definition for CAN_RDT1R register ******************/
+#define CAN_RDT1R_DLC ((uint32_t)0x0000000F) /*!< Data Length Code */
+#define CAN_RDT1R_FMI ((uint32_t)0x0000FF00) /*!< Filter Match Index */
+#define CAN_RDT1R_TIME ((uint32_t)0xFFFF0000) /*!< Message Time Stamp */
+
+/******************* Bit definition for CAN_RDL1R register ******************/
+#define CAN_RDL1R_DATA0 ((uint32_t)0x000000FF) /*!< Data byte 0 */
+#define CAN_RDL1R_DATA1 ((uint32_t)0x0000FF00) /*!< Data byte 1 */
+#define CAN_RDL1R_DATA2 ((uint32_t)0x00FF0000) /*!< Data byte 2 */
+#define CAN_RDL1R_DATA3 ((uint32_t)0xFF000000) /*!< Data byte 3 */
+
+/******************* Bit definition for CAN_RDH1R register ******************/
+#define CAN_RDH1R_DATA4 ((uint32_t)0x000000FF) /*!< Data byte 4 */
+#define CAN_RDH1R_DATA5 ((uint32_t)0x0000FF00) /*!< Data byte 5 */
+#define CAN_RDH1R_DATA6 ((uint32_t)0x00FF0000) /*!< Data byte 6 */
+#define CAN_RDH1R_DATA7 ((uint32_t)0xFF000000) /*!< Data byte 7 */
+
+/*!< CAN filter registers */
+/******************* Bit definition for CAN_FMR register ********************/
+#define CAN_FMR_FINIT ((uint8_t)0x01) /*!< Filter Init Mode */
+
+/******************* Bit definition for CAN_FM1R register *******************/
+#define CAN_FM1R_FBM ((uint16_t)0x3FFF) /*!< Filter Mode */
+#define CAN_FM1R_FBM0 ((uint16_t)0x0001) /*!< Filter Init Mode bit 0 */
+#define CAN_FM1R_FBM1 ((uint16_t)0x0002) /*!< Filter Init Mode bit 1 */
+#define CAN_FM1R_FBM2 ((uint16_t)0x0004) /*!< Filter Init Mode bit 2 */
+#define CAN_FM1R_FBM3 ((uint16_t)0x0008) /*!< Filter Init Mode bit 3 */
+#define CAN_FM1R_FBM4 ((uint16_t)0x0010) /*!< Filter Init Mode bit 4 */
+#define CAN_FM1R_FBM5 ((uint16_t)0x0020) /*!< Filter Init Mode bit 5 */
+#define CAN_FM1R_FBM6 ((uint16_t)0x0040) /*!< Filter Init Mode bit 6 */
+#define CAN_FM1R_FBM7 ((uint16_t)0x0080) /*!< Filter Init Mode bit 7 */
+#define CAN_FM1R_FBM8 ((uint16_t)0x0100) /*!< Filter Init Mode bit 8 */
+#define CAN_FM1R_FBM9 ((uint16_t)0x0200) /*!< Filter Init Mode bit 9 */
+#define CAN_FM1R_FBM10 ((uint16_t)0x0400) /*!< Filter Init Mode bit 10 */
+#define CAN_FM1R_FBM11 ((uint16_t)0x0800) /*!< Filter Init Mode bit 11 */
+#define CAN_FM1R_FBM12 ((uint16_t)0x1000) /*!< Filter Init Mode bit 12 */
+#define CAN_FM1R_FBM13 ((uint16_t)0x2000) /*!< Filter Init Mode bit 13 */
+
+/******************* Bit definition for CAN_FS1R register *******************/
+#define CAN_FS1R_FSC ((uint16_t)0x3FFF) /*!< Filter Scale Configuration */
+#define CAN_FS1R_FSC0 ((uint16_t)0x0001) /*!< Filter Scale Configuration bit 0 */
+#define CAN_FS1R_FSC1 ((uint16_t)0x0002) /*!< Filter Scale Configuration bit 1 */
+#define CAN_FS1R_FSC2 ((uint16_t)0x0004) /*!< Filter Scale Configuration bit 2 */
+#define CAN_FS1R_FSC3 ((uint16_t)0x0008) /*!< Filter Scale Configuration bit 3 */
+#define CAN_FS1R_FSC4 ((uint16_t)0x0010) /*!< Filter Scale Configuration bit 4 */
+#define CAN_FS1R_FSC5 ((uint16_t)0x0020) /*!< Filter Scale Configuration bit 5 */
+#define CAN_FS1R_FSC6 ((uint16_t)0x0040) /*!< Filter Scale Configuration bit 6 */
+#define CAN_FS1R_FSC7 ((uint16_t)0x0080) /*!< Filter Scale Configuration bit 7 */
+#define CAN_FS1R_FSC8 ((uint16_t)0x0100) /*!< Filter Scale Configuration bit 8 */
+#define CAN_FS1R_FSC9 ((uint16_t)0x0200) /*!< Filter Scale Configuration bit 9 */
+#define CAN_FS1R_FSC10 ((uint16_t)0x0400) /*!< Filter Scale Configuration bit 10 */
+#define CAN_FS1R_FSC11 ((uint16_t)0x0800) /*!< Filter Scale Configuration bit 11 */
+#define CAN_FS1R_FSC12 ((uint16_t)0x1000) /*!< Filter Scale Configuration bit 12 */
+#define CAN_FS1R_FSC13 ((uint16_t)0x2000) /*!< Filter Scale Configuration bit 13 */
+
+/****************** Bit definition for CAN_FFA1R register *******************/
+#define CAN_FFA1R_FFA ((uint16_t)0x3FFF) /*!< Filter FIFO Assignment */
+#define CAN_FFA1R_FFA0 ((uint16_t)0x0001) /*!< Filter FIFO Assignment for Filter 0 */
+#define CAN_FFA1R_FFA1 ((uint16_t)0x0002) /*!< Filter FIFO Assignment for Filter 1 */
+#define CAN_FFA1R_FFA2 ((uint16_t)0x0004) /*!< Filter FIFO Assignment for Filter 2 */
+#define CAN_FFA1R_FFA3 ((uint16_t)0x0008) /*!< Filter FIFO Assignment for Filter 3 */
+#define CAN_FFA1R_FFA4 ((uint16_t)0x0010) /*!< Filter FIFO Assignment for Filter 4 */
+#define CAN_FFA1R_FFA5 ((uint16_t)0x0020) /*!< Filter FIFO Assignment for Filter 5 */
+#define CAN_FFA1R_FFA6 ((uint16_t)0x0040) /*!< Filter FIFO Assignment for Filter 6 */
+#define CAN_FFA1R_FFA7 ((uint16_t)0x0080) /*!< Filter FIFO Assignment for Filter 7 */
+#define CAN_FFA1R_FFA8 ((uint16_t)0x0100) /*!< Filter FIFO Assignment for Filter 8 */
+#define CAN_FFA1R_FFA9 ((uint16_t)0x0200) /*!< Filter FIFO Assignment for Filter 9 */
+#define CAN_FFA1R_FFA10 ((uint16_t)0x0400) /*!< Filter FIFO Assignment for Filter 10 */
+#define CAN_FFA1R_FFA11 ((uint16_t)0x0800) /*!< Filter FIFO Assignment for Filter 11 */
+#define CAN_FFA1R_FFA12 ((uint16_t)0x1000) /*!< Filter FIFO Assignment for Filter 12 */
+#define CAN_FFA1R_FFA13 ((uint16_t)0x2000) /*!< Filter FIFO Assignment for Filter 13 */
+
+/******************* Bit definition for CAN_FA1R register *******************/
+#define CAN_FA1R_FACT ((uint16_t)0x3FFF) /*!< Filter Active */
+#define CAN_FA1R_FACT0 ((uint16_t)0x0001) /*!< Filter 0 Active */
+#define CAN_FA1R_FACT1 ((uint16_t)0x0002) /*!< Filter 1 Active */
+#define CAN_FA1R_FACT2 ((uint16_t)0x0004) /*!< Filter 2 Active */
+#define CAN_FA1R_FACT3 ((uint16_t)0x0008) /*!< Filter 3 Active */
+#define CAN_FA1R_FACT4 ((uint16_t)0x0010) /*!< Filter 4 Active */
+#define CAN_FA1R_FACT5 ((uint16_t)0x0020) /*!< Filter 5 Active */
+#define CAN_FA1R_FACT6 ((uint16_t)0x0040) /*!< Filter 6 Active */
+#define CAN_FA1R_FACT7 ((uint16_t)0x0080) /*!< Filter 7 Active */
+#define CAN_FA1R_FACT8 ((uint16_t)0x0100) /*!< Filter 8 Active */
+#define CAN_FA1R_FACT9 ((uint16_t)0x0200) /*!< Filter 9 Active */
+#define CAN_FA1R_FACT10 ((uint16_t)0x0400) /*!< Filter 10 Active */
+#define CAN_FA1R_FACT11 ((uint16_t)0x0800) /*!< Filter 11 Active */
+#define CAN_FA1R_FACT12 ((uint16_t)0x1000) /*!< Filter 12 Active */
+#define CAN_FA1R_FACT13 ((uint16_t)0x2000) /*!< Filter 13 Active */
+
+/******************* Bit definition for CAN_F0R1 register *******************/
+#define CAN_F0R1_FB0 ((uint32_t)0x00000001) /*!< Filter bit 0 */
+#define CAN_F0R1_FB1 ((uint32_t)0x00000002) /*!< Filter bit 1 */
+#define CAN_F0R1_FB2 ((uint32_t)0x00000004) /*!< Filter bit 2 */
+#define CAN_F0R1_FB3 ((uint32_t)0x00000008) /*!< Filter bit 3 */
+#define CAN_F0R1_FB4 ((uint32_t)0x00000010) /*!< Filter bit 4 */
+#define CAN_F0R1_FB5 ((uint32_t)0x00000020) /*!< Filter bit 5 */
+#define CAN_F0R1_FB6 ((uint32_t)0x00000040) /*!< Filter bit 6 */
+#define CAN_F0R1_FB7 ((uint32_t)0x00000080) /*!< Filter bit 7 */
+#define CAN_F0R1_FB8 ((uint32_t)0x00000100) /*!< Filter bit 8 */
+#define CAN_F0R1_FB9 ((uint32_t)0x00000200) /*!< Filter bit 9 */
+#define CAN_F0R1_FB10 ((uint32_t)0x00000400) /*!< Filter bit 10 */
+#define CAN_F0R1_FB11 ((uint32_t)0x00000800) /*!< Filter bit 11 */
+#define CAN_F0R1_FB12 ((uint32_t)0x00001000) /*!< Filter bit 12 */
+#define CAN_F0R1_FB13 ((uint32_t)0x00002000) /*!< Filter bit 13 */
+#define CAN_F0R1_FB14 ((uint32_t)0x00004000) /*!< Filter bit 14 */
+#define CAN_F0R1_FB15 ((uint32_t)0x00008000) /*!< Filter bit 15 */
+#define CAN_F0R1_FB16 ((uint32_t)0x00010000) /*!< Filter bit 16 */
+#define CAN_F0R1_FB17 ((uint32_t)0x00020000) /*!< Filter bit 17 */
+#define CAN_F0R1_FB18 ((uint32_t)0x00040000) /*!< Filter bit 18 */
+#define CAN_F0R1_FB19 ((uint32_t)0x00080000) /*!< Filter bit 19 */
+#define CAN_F0R1_FB20 ((uint32_t)0x00100000) /*!< Filter bit 20 */
+#define CAN_F0R1_FB21 ((uint32_t)0x00200000) /*!< Filter bit 21 */
+#define CAN_F0R1_FB22 ((uint32_t)0x00400000) /*!< Filter bit 22 */
+#define CAN_F0R1_FB23 ((uint32_t)0x00800000) /*!< Filter bit 23 */
+#define CAN_F0R1_FB24 ((uint32_t)0x01000000) /*!< Filter bit 24 */
+#define CAN_F0R1_FB25 ((uint32_t)0x02000000) /*!< Filter bit 25 */
+#define CAN_F0R1_FB26 ((uint32_t)0x04000000) /*!< Filter bit 26 */
+#define CAN_F0R1_FB27 ((uint32_t)0x08000000) /*!< Filter bit 27 */
+#define CAN_F0R1_FB28 ((uint32_t)0x10000000) /*!< Filter bit 28 */
+#define CAN_F0R1_FB29 ((uint32_t)0x20000000) /*!< Filter bit 29 */
+#define CAN_F0R1_FB30 ((uint32_t)0x40000000) /*!< Filter bit 30 */
+#define CAN_F0R1_FB31 ((uint32_t)0x80000000) /*!< Filter bit 31 */
+
+/******************* Bit definition for CAN_F1R1 register *******************/
+#define CAN_F1R1_FB0 ((uint32_t)0x00000001) /*!< Filter bit 0 */
+#define CAN_F1R1_FB1 ((uint32_t)0x00000002) /*!< Filter bit 1 */
+#define CAN_F1R1_FB2 ((uint32_t)0x00000004) /*!< Filter bit 2 */
+#define CAN_F1R1_FB3 ((uint32_t)0x00000008) /*!< Filter bit 3 */
+#define CAN_F1R1_FB4 ((uint32_t)0x00000010) /*!< Filter bit 4 */
+#define CAN_F1R1_FB5 ((uint32_t)0x00000020) /*!< Filter bit 5 */
+#define CAN_F1R1_FB6 ((uint32_t)0x00000040) /*!< Filter bit 6 */
+#define CAN_F1R1_FB7 ((uint32_t)0x00000080) /*!< Filter bit 7 */
+#define CAN_F1R1_FB8 ((uint32_t)0x00000100) /*!< Filter bit 8 */
+#define CAN_F1R1_FB9 ((uint32_t)0x00000200) /*!< Filter bit 9 */
+#define CAN_F1R1_FB10 ((uint32_t)0x00000400) /*!< Filter bit 10 */
+#define CAN_F1R1_FB11 ((uint32_t)0x00000800) /*!< Filter bit 11 */
+#define CAN_F1R1_FB12 ((uint32_t)0x00001000) /*!< Filter bit 12 */
+#define CAN_F1R1_FB13 ((uint32_t)0x00002000) /*!< Filter bit 13 */
+#define CAN_F1R1_FB14 ((uint32_t)0x00004000) /*!< Filter bit 14 */
+#define CAN_F1R1_FB15 ((uint32_t)0x00008000) /*!< Filter bit 15 */
+#define CAN_F1R1_FB16 ((uint32_t)0x00010000) /*!< Filter bit 16 */
+#define CAN_F1R1_FB17 ((uint32_t)0x00020000) /*!< Filter bit 17 */
+#define CAN_F1R1_FB18 ((uint32_t)0x00040000) /*!< Filter bit 18 */
+#define CAN_F1R1_FB19 ((uint32_t)0x00080000) /*!< Filter bit 19 */
+#define CAN_F1R1_FB20 ((uint32_t)0x00100000) /*!< Filter bit 20 */
+#define CAN_F1R1_FB21 ((uint32_t)0x00200000) /*!< Filter bit 21 */
+#define CAN_F1R1_FB22 ((uint32_t)0x00400000) /*!< Filter bit 22 */
+#define CAN_F1R1_FB23 ((uint32_t)0x00800000) /*!< Filter bit 23 */
+#define CAN_F1R1_FB24 ((uint32_t)0x01000000) /*!< Filter bit 24 */
+#define CAN_F1R1_FB25 ((uint32_t)0x02000000) /*!< Filter bit 25 */
+#define CAN_F1R1_FB26 ((uint32_t)0x04000000) /*!< Filter bit 26 */
+#define CAN_F1R1_FB27 ((uint32_t)0x08000000) /*!< Filter bit 27 */
+#define CAN_F1R1_FB28 ((uint32_t)0x10000000) /*!< Filter bit 28 */
+#define CAN_F1R1_FB29 ((uint32_t)0x20000000) /*!< Filter bit 29 */
+#define CAN_F1R1_FB30 ((uint32_t)0x40000000) /*!< Filter bit 30 */
+#define CAN_F1R1_FB31 ((uint32_t)0x80000000) /*!< Filter bit 31 */
+
+/******************* Bit definition for CAN_F2R1 register *******************/
+#define CAN_F2R1_FB0 ((uint32_t)0x00000001) /*!< Filter bit 0 */
+#define CAN_F2R1_FB1 ((uint32_t)0x00000002) /*!< Filter bit 1 */
+#define CAN_F2R1_FB2 ((uint32_t)0x00000004) /*!< Filter bit 2 */
+#define CAN_F2R1_FB3 ((uint32_t)0x00000008) /*!< Filter bit 3 */
+#define CAN_F2R1_FB4 ((uint32_t)0x00000010) /*!< Filter bit 4 */
+#define CAN_F2R1_FB5 ((uint32_t)0x00000020) /*!< Filter bit 5 */
+#define CAN_F2R1_FB6 ((uint32_t)0x00000040) /*!< Filter bit 6 */
+#define CAN_F2R1_FB7 ((uint32_t)0x00000080) /*!< Filter bit 7 */
+#define CAN_F2R1_FB8 ((uint32_t)0x00000100) /*!< Filter bit 8 */
+#define CAN_F2R1_FB9 ((uint32_t)0x00000200) /*!< Filter bit 9 */
+#define CAN_F2R1_FB10 ((uint32_t)0x00000400) /*!< Filter bit 10 */
+#define CAN_F2R1_FB11 ((uint32_t)0x00000800) /*!< Filter bit 11 */
+#define CAN_F2R1_FB12 ((uint32_t)0x00001000) /*!< Filter bit 12 */
+#define CAN_F2R1_FB13 ((uint32_t)0x00002000) /*!< Filter bit 13 */
+#define CAN_F2R1_FB14 ((uint32_t)0x00004000) /*!< Filter bit 14 */
+#define CAN_F2R1_FB15 ((uint32_t)0x00008000) /*!< Filter bit 15 */
+#define CAN_F2R1_FB16 ((uint32_t)0x00010000) /*!< Filter bit 16 */
+#define CAN_F2R1_FB17 ((uint32_t)0x00020000) /*!< Filter bit 17 */
+#define CAN_F2R1_FB18 ((uint32_t)0x00040000) /*!< Filter bit 18 */
+#define CAN_F2R1_FB19 ((uint32_t)0x00080000) /*!< Filter bit 19 */
+#define CAN_F2R1_FB20 ((uint32_t)0x00100000) /*!< Filter bit 20 */
+#define CAN_F2R1_FB21 ((uint32_t)0x00200000) /*!< Filter bit 21 */
+#define CAN_F2R1_FB22 ((uint32_t)0x00400000) /*!< Filter bit 22 */
+#define CAN_F2R1_FB23 ((uint32_t)0x00800000) /*!< Filter bit 23 */
+#define CAN_F2R1_FB24 ((uint32_t)0x01000000) /*!< Filter bit 24 */
+#define CAN_F2R1_FB25 ((uint32_t)0x02000000) /*!< Filter bit 25 */
+#define CAN_F2R1_FB26 ((uint32_t)0x04000000) /*!< Filter bit 26 */
+#define CAN_F2R1_FB27 ((uint32_t)0x08000000) /*!< Filter bit 27 */
+#define CAN_F2R1_FB28 ((uint32_t)0x10000000) /*!< Filter bit 28 */
+#define CAN_F2R1_FB29 ((uint32_t)0x20000000) /*!< Filter bit 29 */
+#define CAN_F2R1_FB30 ((uint32_t)0x40000000) /*!< Filter bit 30 */
+#define CAN_F2R1_FB31 ((uint32_t)0x80000000) /*!< Filter bit 31 */
+
+/******************* Bit definition for CAN_F3R1 register *******************/
+#define CAN_F3R1_FB0 ((uint32_t)0x00000001) /*!< Filter bit 0 */
+#define CAN_F3R1_FB1 ((uint32_t)0x00000002) /*!< Filter bit 1 */
+#define CAN_F3R1_FB2 ((uint32_t)0x00000004) /*!< Filter bit 2 */
+#define CAN_F3R1_FB3 ((uint32_t)0x00000008) /*!< Filter bit 3 */
+#define CAN_F3R1_FB4 ((uint32_t)0x00000010) /*!< Filter bit 4 */
+#define CAN_F3R1_FB5 ((uint32_t)0x00000020) /*!< Filter bit 5 */
+#define CAN_F3R1_FB6 ((uint32_t)0x00000040) /*!< Filter bit 6 */
+#define CAN_F3R1_FB7 ((uint32_t)0x00000080) /*!< Filter bit 7 */
+#define CAN_F3R1_FB8 ((uint32_t)0x00000100) /*!< Filter bit 8 */
+#define CAN_F3R1_FB9 ((uint32_t)0x00000200) /*!< Filter bit 9 */
+#define CAN_F3R1_FB10 ((uint32_t)0x00000400) /*!< Filter bit 10 */
+#define CAN_F3R1_FB11 ((uint32_t)0x00000800) /*!< Filter bit 11 */
+#define CAN_F3R1_FB12 ((uint32_t)0x00001000) /*!< Filter bit 12 */
+#define CAN_F3R1_FB13 ((uint32_t)0x00002000) /*!< Filter bit 13 */
+#define CAN_F3R1_FB14 ((uint32_t)0x00004000) /*!< Filter bit 14 */
+#define CAN_F3R1_FB15 ((uint32_t)0x00008000) /*!< Filter bit 15 */
+#define CAN_F3R1_FB16 ((uint32_t)0x00010000) /*!< Filter bit 16 */
+#define CAN_F3R1_FB17 ((uint32_t)0x00020000) /*!< Filter bit 17 */
+#define CAN_F3R1_FB18 ((uint32_t)0x00040000) /*!< Filter bit 18 */
+#define CAN_F3R1_FB19 ((uint32_t)0x00080000) /*!< Filter bit 19 */
+#define CAN_F3R1_FB20 ((uint32_t)0x00100000) /*!< Filter bit 20 */
+#define CAN_F3R1_FB21 ((uint32_t)0x00200000) /*!< Filter bit 21 */
+#define CAN_F3R1_FB22 ((uint32_t)0x00400000) /*!< Filter bit 22 */
+#define CAN_F3R1_FB23 ((uint32_t)0x00800000) /*!< Filter bit 23 */
+#define CAN_F3R1_FB24 ((uint32_t)0x01000000) /*!< Filter bit 24 */
+#define CAN_F3R1_FB25 ((uint32_t)0x02000000) /*!< Filter bit 25 */
+#define CAN_F3R1_FB26 ((uint32_t)0x04000000) /*!< Filter bit 26 */
+#define CAN_F3R1_FB27 ((uint32_t)0x08000000) /*!< Filter bit 27 */
+#define CAN_F3R1_FB28 ((uint32_t)0x10000000) /*!< Filter bit 28 */
+#define CAN_F3R1_FB29 ((uint32_t)0x20000000) /*!< Filter bit 29 */
+#define CAN_F3R1_FB30 ((uint32_t)0x40000000) /*!< Filter bit 30 */
+#define CAN_F3R1_FB31 ((uint32_t)0x80000000) /*!< Filter bit 31 */
+
+/******************* Bit definition for CAN_F4R1 register *******************/
+#define CAN_F4R1_FB0 ((uint32_t)0x00000001) /*!< Filter bit 0 */
+#define CAN_F4R1_FB1 ((uint32_t)0x00000002) /*!< Filter bit 1 */
+#define CAN_F4R1_FB2 ((uint32_t)0x00000004) /*!< Filter bit 2 */
+#define CAN_F4R1_FB3 ((uint32_t)0x00000008) /*!< Filter bit 3 */
+#define CAN_F4R1_FB4 ((uint32_t)0x00000010) /*!< Filter bit 4 */
+#define CAN_F4R1_FB5 ((uint32_t)0x00000020) /*!< Filter bit 5 */
+#define CAN_F4R1_FB6 ((uint32_t)0x00000040) /*!< Filter bit 6 */
+#define CAN_F4R1_FB7 ((uint32_t)0x00000080) /*!< Filter bit 7 */
+#define CAN_F4R1_FB8 ((uint32_t)0x00000100) /*!< Filter bit 8 */
+#define CAN_F4R1_FB9 ((uint32_t)0x00000200) /*!< Filter bit 9 */
+#define CAN_F4R1_FB10 ((uint32_t)0x00000400) /*!< Filter bit 10 */
+#define CAN_F4R1_FB11 ((uint32_t)0x00000800) /*!< Filter bit 11 */
+#define CAN_F4R1_FB12 ((uint32_t)0x00001000) /*!< Filter bit 12 */
+#define CAN_F4R1_FB13 ((uint32_t)0x00002000) /*!< Filter bit 13 */
+#define CAN_F4R1_FB14 ((uint32_t)0x00004000) /*!< Filter bit 14 */
+#define CAN_F4R1_FB15 ((uint32_t)0x00008000) /*!< Filter bit 15 */
+#define CAN_F4R1_FB16 ((uint32_t)0x00010000) /*!< Filter bit 16 */
+#define CAN_F4R1_FB17 ((uint32_t)0x00020000) /*!< Filter bit 17 */
+#define CAN_F4R1_FB18 ((uint32_t)0x00040000) /*!< Filter bit 18 */
+#define CAN_F4R1_FB19 ((uint32_t)0x00080000) /*!< Filter bit 19 */
+#define CAN_F4R1_FB20 ((uint32_t)0x00100000) /*!< Filter bit 20 */
+#define CAN_F4R1_FB21 ((uint32_t)0x00200000) /*!< Filter bit 21 */
+#define CAN_F4R1_FB22 ((uint32_t)0x00400000) /*!< Filter bit 22 */
+#define CAN_F4R1_FB23 ((uint32_t)0x00800000) /*!< Filter bit 23 */
+#define CAN_F4R1_FB24 ((uint32_t)0x01000000) /*!< Filter bit 24 */
+#define CAN_F4R1_FB25 ((uint32_t)0x02000000) /*!< Filter bit 25 */
+#define CAN_F4R1_FB26 ((uint32_t)0x04000000) /*!< Filter bit 26 */
+#define CAN_F4R1_FB27 ((uint32_t)0x08000000) /*!< Filter bit 27 */
+#define CAN_F4R1_FB28 ((uint32_t)0x10000000) /*!< Filter bit 28 */
+#define CAN_F4R1_FB29 ((uint32_t)0x20000000) /*!< Filter bit 29 */
+#define CAN_F4R1_FB30 ((uint32_t)0x40000000) /*!< Filter bit 30 */
+#define CAN_F4R1_FB31 ((uint32_t)0x80000000) /*!< Filter bit 31 */
+
+/******************* Bit definition for CAN_F5R1 register *******************/
+#define CAN_F5R1_FB0 ((uint32_t)0x00000001) /*!< Filter bit 0 */
+#define CAN_F5R1_FB1 ((uint32_t)0x00000002) /*!< Filter bit 1 */
+#define CAN_F5R1_FB2 ((uint32_t)0x00000004) /*!< Filter bit 2 */
+#define CAN_F5R1_FB3 ((uint32_t)0x00000008) /*!< Filter bit 3 */
+#define CAN_F5R1_FB4 ((uint32_t)0x00000010) /*!< Filter bit 4 */
+#define CAN_F5R1_FB5 ((uint32_t)0x00000020) /*!< Filter bit 5 */
+#define CAN_F5R1_FB6 ((uint32_t)0x00000040) /*!< Filter bit 6 */
+#define CAN_F5R1_FB7 ((uint32_t)0x00000080) /*!< Filter bit 7 */
+#define CAN_F5R1_FB8 ((uint32_t)0x00000100) /*!< Filter bit 8 */
+#define CAN_F5R1_FB9 ((uint32_t)0x00000200) /*!< Filter bit 9 */
+#define CAN_F5R1_FB10 ((uint32_t)0x00000400) /*!< Filter bit 10 */
+#define CAN_F5R1_FB11 ((uint32_t)0x00000800) /*!< Filter bit 11 */
+#define CAN_F5R1_FB12 ((uint32_t)0x00001000) /*!< Filter bit 12 */
+#define CAN_F5R1_FB13 ((uint32_t)0x00002000) /*!< Filter bit 13 */
+#define CAN_F5R1_FB14 ((uint32_t)0x00004000) /*!< Filter bit 14 */
+#define CAN_F5R1_FB15 ((uint32_t)0x00008000) /*!< Filter bit 15 */
+#define CAN_F5R1_FB16 ((uint32_t)0x00010000) /*!< Filter bit 16 */
+#define CAN_F5R1_FB17 ((uint32_t)0x00020000) /*!< Filter bit 17 */
+#define CAN_F5R1_FB18 ((uint32_t)0x00040000) /*!< Filter bit 18 */
+#define CAN_F5R1_FB19 ((uint32_t)0x00080000) /*!< Filter bit 19 */
+#define CAN_F5R1_FB20 ((uint32_t)0x00100000) /*!< Filter bit 20 */
+#define CAN_F5R1_FB21 ((uint32_t)0x00200000) /*!< Filter bit 21 */
+#define CAN_F5R1_FB22 ((uint32_t)0x00400000) /*!< Filter bit 22 */
+#define CAN_F5R1_FB23 ((uint32_t)0x00800000) /*!< Filter bit 23 */
+#define CAN_F5R1_FB24 ((uint32_t)0x01000000) /*!< Filter bit 24 */
+#define CAN_F5R1_FB25 ((uint32_t)0x02000000) /*!< Filter bit 25 */
+#define CAN_F5R1_FB26 ((uint32_t)0x04000000) /*!< Filter bit 26 */
+#define CAN_F5R1_FB27 ((uint32_t)0x08000000) /*!< Filter bit 27 */
+#define CAN_F5R1_FB28 ((uint32_t)0x10000000) /*!< Filter bit 28 */
+#define CAN_F5R1_FB29 ((uint32_t)0x20000000) /*!< Filter bit 29 */
+#define CAN_F5R1_FB30 ((uint32_t)0x40000000) /*!< Filter bit 30 */
+#define CAN_F5R1_FB31 ((uint32_t)0x80000000) /*!< Filter bit 31 */
+
+/******************* Bit definition for CAN_F6R1 register *******************/
+#define CAN_F6R1_FB0 ((uint32_t)0x00000001) /*!< Filter bit 0 */
+#define CAN_F6R1_FB1 ((uint32_t)0x00000002) /*!< Filter bit 1 */
+#define CAN_F6R1_FB2 ((uint32_t)0x00000004) /*!< Filter bit 2 */
+#define CAN_F6R1_FB3 ((uint32_t)0x00000008) /*!< Filter bit 3 */
+#define CAN_F6R1_FB4 ((uint32_t)0x00000010) /*!< Filter bit 4 */
+#define CAN_F6R1_FB5 ((uint32_t)0x00000020) /*!< Filter bit 5 */
+#define CAN_F6R1_FB6 ((uint32_t)0x00000040) /*!< Filter bit 6 */
+#define CAN_F6R1_FB7 ((uint32_t)0x00000080) /*!< Filter bit 7 */
+#define CAN_F6R1_FB8 ((uint32_t)0x00000100) /*!< Filter bit 8 */
+#define CAN_F6R1_FB9 ((uint32_t)0x00000200) /*!< Filter bit 9 */
+#define CAN_F6R1_FB10 ((uint32_t)0x00000400) /*!< Filter bit 10 */
+#define CAN_F6R1_FB11 ((uint32_t)0x00000800) /*!< Filter bit 11 */
+#define CAN_F6R1_FB12 ((uint32_t)0x00001000) /*!< Filter bit 12 */
+#define CAN_F6R1_FB13 ((uint32_t)0x00002000) /*!< Filter bit 13 */
+#define CAN_F6R1_FB14 ((uint32_t)0x00004000) /*!< Filter bit 14 */
+#define CAN_F6R1_FB15 ((uint32_t)0x00008000) /*!< Filter bit 15 */
+#define CAN_F6R1_FB16 ((uint32_t)0x00010000) /*!< Filter bit 16 */
+#define CAN_F6R1_FB17 ((uint32_t)0x00020000) /*!< Filter bit 17 */
+#define CAN_F6R1_FB18 ((uint32_t)0x00040000) /*!< Filter bit 18 */
+#define CAN_F6R1_FB19 ((uint32_t)0x00080000) /*!< Filter bit 19 */
+#define CAN_F6R1_FB20 ((uint32_t)0x00100000) /*!< Filter bit 20 */
+#define CAN_F6R1_FB21 ((uint32_t)0x00200000) /*!< Filter bit 21 */
+#define CAN_F6R1_FB22 ((uint32_t)0x00400000) /*!< Filter bit 22 */
+#define CAN_F6R1_FB23 ((uint32_t)0x00800000) /*!< Filter bit 23 */
+#define CAN_F6R1_FB24 ((uint32_t)0x01000000) /*!< Filter bit 24 */
+#define CAN_F6R1_FB25 ((uint32_t)0x02000000) /*!< Filter bit 25 */
+#define CAN_F6R1_FB26 ((uint32_t)0x04000000) /*!< Filter bit 26 */
+#define CAN_F6R1_FB27 ((uint32_t)0x08000000) /*!< Filter bit 27 */
+#define CAN_F6R1_FB28 ((uint32_t)0x10000000) /*!< Filter bit 28 */
+#define CAN_F6R1_FB29 ((uint32_t)0x20000000) /*!< Filter bit 29 */
+#define CAN_F6R1_FB30 ((uint32_t)0x40000000) /*!< Filter bit 30 */
+#define CAN_F6R1_FB31 ((uint32_t)0x80000000) /*!< Filter bit 31 */
+
+/******************* Bit definition for CAN_F7R1 register *******************/
+#define CAN_F7R1_FB0 ((uint32_t)0x00000001) /*!< Filter bit 0 */
+#define CAN_F7R1_FB1 ((uint32_t)0x00000002) /*!< Filter bit 1 */
+#define CAN_F7R1_FB2 ((uint32_t)0x00000004) /*!< Filter bit 2 */
+#define CAN_F7R1_FB3 ((uint32_t)0x00000008) /*!< Filter bit 3 */
+#define CAN_F7R1_FB4 ((uint32_t)0x00000010) /*!< Filter bit 4 */
+#define CAN_F7R1_FB5 ((uint32_t)0x00000020) /*!< Filter bit 5 */
+#define CAN_F7R1_FB6 ((uint32_t)0x00000040) /*!< Filter bit 6 */
+#define CAN_F7R1_FB7 ((uint32_t)0x00000080) /*!< Filter bit 7 */
+#define CAN_F7R1_FB8 ((uint32_t)0x00000100) /*!< Filter bit 8 */
+#define CAN_F7R1_FB9 ((uint32_t)0x00000200) /*!< Filter bit 9 */
+#define CAN_F7R1_FB10 ((uint32_t)0x00000400) /*!< Filter bit 10 */
+#define CAN_F7R1_FB11 ((uint32_t)0x00000800) /*!< Filter bit 11 */
+#define CAN_F7R1_FB12 ((uint32_t)0x00001000) /*!< Filter bit 12 */
+#define CAN_F7R1_FB13 ((uint32_t)0x00002000) /*!< Filter bit 13 */
+#define CAN_F7R1_FB14 ((uint32_t)0x00004000) /*!< Filter bit 14 */
+#define CAN_F7R1_FB15 ((uint32_t)0x00008000) /*!< Filter bit 15 */
+#define CAN_F7R1_FB16 ((uint32_t)0x00010000) /*!< Filter bit 16 */
+#define CAN_F7R1_FB17 ((uint32_t)0x00020000) /*!< Filter bit 17 */
+#define CAN_F7R1_FB18 ((uint32_t)0x00040000) /*!< Filter bit 18 */
+#define CAN_F7R1_FB19 ((uint32_t)0x00080000) /*!< Filter bit 19 */
+#define CAN_F7R1_FB20 ((uint32_t)0x00100000) /*!< Filter bit 20 */
+#define CAN_F7R1_FB21 ((uint32_t)0x00200000) /*!< Filter bit 21 */
+#define CAN_F7R1_FB22 ((uint32_t)0x00400000) /*!< Filter bit 22 */
+#define CAN_F7R1_FB23 ((uint32_t)0x00800000) /*!< Filter bit 23 */
+#define CAN_F7R1_FB24 ((uint32_t)0x01000000) /*!< Filter bit 24 */
+#define CAN_F7R1_FB25 ((uint32_t)0x02000000) /*!< Filter bit 25 */
+#define CAN_F7R1_FB26 ((uint32_t)0x04000000) /*!< Filter bit 26 */
+#define CAN_F7R1_FB27 ((uint32_t)0x08000000) /*!< Filter bit 27 */
+#define CAN_F7R1_FB28 ((uint32_t)0x10000000) /*!< Filter bit 28 */
+#define CAN_F7R1_FB29 ((uint32_t)0x20000000) /*!< Filter bit 29 */
+#define CAN_F7R1_FB30 ((uint32_t)0x40000000) /*!< Filter bit 30 */
+#define CAN_F7R1_FB31 ((uint32_t)0x80000000) /*!< Filter bit 31 */
+
+/******************* Bit definition for CAN_F8R1 register *******************/
+#define CAN_F8R1_FB0 ((uint32_t)0x00000001) /*!< Filter bit 0 */
+#define CAN_F8R1_FB1 ((uint32_t)0x00000002) /*!< Filter bit 1 */
+#define CAN_F8R1_FB2 ((uint32_t)0x00000004) /*!< Filter bit 2 */
+#define CAN_F8R1_FB3 ((uint32_t)0x00000008) /*!< Filter bit 3 */
+#define CAN_F8R1_FB4 ((uint32_t)0x00000010) /*!< Filter bit 4 */
+#define CAN_F8R1_FB5 ((uint32_t)0x00000020) /*!< Filter bit 5 */
+#define CAN_F8R1_FB6 ((uint32_t)0x00000040) /*!< Filter bit 6 */
+#define CAN_F8R1_FB7 ((uint32_t)0x00000080) /*!< Filter bit 7 */
+#define CAN_F8R1_FB8 ((uint32_t)0x00000100) /*!< Filter bit 8 */
+#define CAN_F8R1_FB9 ((uint32_t)0x00000200) /*!< Filter bit 9 */
+#define CAN_F8R1_FB10 ((uint32_t)0x00000400) /*!< Filter bit 10 */
+#define CAN_F8R1_FB11 ((uint32_t)0x00000800) /*!< Filter bit 11 */
+#define CAN_F8R1_FB12 ((uint32_t)0x00001000) /*!< Filter bit 12 */
+#define CAN_F8R1_FB13 ((uint32_t)0x00002000) /*!< Filter bit 13 */
+#define CAN_F8R1_FB14 ((uint32_t)0x00004000) /*!< Filter bit 14 */
+#define CAN_F8R1_FB15 ((uint32_t)0x00008000) /*!< Filter bit 15 */
+#define CAN_F8R1_FB16 ((uint32_t)0x00010000) /*!< Filter bit 16 */
+#define CAN_F8R1_FB17 ((uint32_t)0x00020000) /*!< Filter bit 17 */
+#define CAN_F8R1_FB18 ((uint32_t)0x00040000) /*!< Filter bit 18 */
+#define CAN_F8R1_FB19 ((uint32_t)0x00080000) /*!< Filter bit 19 */
+#define CAN_F8R1_FB20 ((uint32_t)0x00100000) /*!< Filter bit 20 */
+#define CAN_F8R1_FB21 ((uint32_t)0x00200000) /*!< Filter bit 21 */
+#define CAN_F8R1_FB22 ((uint32_t)0x00400000) /*!< Filter bit 22 */
+#define CAN_F8R1_FB23 ((uint32_t)0x00800000) /*!< Filter bit 23 */
+#define CAN_F8R1_FB24 ((uint32_t)0x01000000) /*!< Filter bit 24 */
+#define CAN_F8R1_FB25 ((uint32_t)0x02000000) /*!< Filter bit 25 */
+#define CAN_F8R1_FB26 ((uint32_t)0x04000000) /*!< Filter bit 26 */
+#define CAN_F8R1_FB27 ((uint32_t)0x08000000) /*!< Filter bit 27 */
+#define CAN_F8R1_FB28 ((uint32_t)0x10000000) /*!< Filter bit 28 */
+#define CAN_F8R1_FB29 ((uint32_t)0x20000000) /*!< Filter bit 29 */
+#define CAN_F8R1_FB30 ((uint32_t)0x40000000) /*!< Filter bit 30 */
+#define CAN_F8R1_FB31 ((uint32_t)0x80000000) /*!< Filter bit 31 */
+
+/******************* Bit definition for CAN_F9R1 register *******************/
+#define CAN_F9R1_FB0 ((uint32_t)0x00000001) /*!< Filter bit 0 */
+#define CAN_F9R1_FB1 ((uint32_t)0x00000002) /*!< Filter bit 1 */
+#define CAN_F9R1_FB2 ((uint32_t)0x00000004) /*!< Filter bit 2 */
+#define CAN_F9R1_FB3 ((uint32_t)0x00000008) /*!< Filter bit 3 */
+#define CAN_F9R1_FB4 ((uint32_t)0x00000010) /*!< Filter bit 4 */
+#define CAN_F9R1_FB5 ((uint32_t)0x00000020) /*!< Filter bit 5 */
+#define CAN_F9R1_FB6 ((uint32_t)0x00000040) /*!< Filter bit 6 */
+#define CAN_F9R1_FB7 ((uint32_t)0x00000080) /*!< Filter bit 7 */
+#define CAN_F9R1_FB8 ((uint32_t)0x00000100) /*!< Filter bit 8 */
+#define CAN_F9R1_FB9 ((uint32_t)0x00000200) /*!< Filter bit 9 */
+#define CAN_F9R1_FB10 ((uint32_t)0x00000400) /*!< Filter bit 10 */
+#define CAN_F9R1_FB11 ((uint32_t)0x00000800) /*!< Filter bit 11 */
+#define CAN_F9R1_FB12 ((uint32_t)0x00001000) /*!< Filter bit 12 */
+#define CAN_F9R1_FB13 ((uint32_t)0x00002000) /*!< Filter bit 13 */
+#define CAN_F9R1_FB14 ((uint32_t)0x00004000) /*!< Filter bit 14 */
+#define CAN_F9R1_FB15 ((uint32_t)0x00008000) /*!< Filter bit 15 */
+#define CAN_F9R1_FB16 ((uint32_t)0x00010000) /*!< Filter bit 16 */
+#define CAN_F9R1_FB17 ((uint32_t)0x00020000) /*!< Filter bit 17 */
+#define CAN_F9R1_FB18 ((uint32_t)0x00040000) /*!< Filter bit 18 */
+#define CAN_F9R1_FB19 ((uint32_t)0x00080000) /*!< Filter bit 19 */
+#define CAN_F9R1_FB20 ((uint32_t)0x00100000) /*!< Filter bit 20 */
+#define CAN_F9R1_FB21 ((uint32_t)0x00200000) /*!< Filter bit 21 */
+#define CAN_F9R1_FB22 ((uint32_t)0x00400000) /*!< Filter bit 22 */
+#define CAN_F9R1_FB23 ((uint32_t)0x00800000) /*!< Filter bit 23 */
+#define CAN_F9R1_FB24 ((uint32_t)0x01000000) /*!< Filter bit 24 */
+#define CAN_F9R1_FB25 ((uint32_t)0x02000000) /*!< Filter bit 25 */
+#define CAN_F9R1_FB26 ((uint32_t)0x04000000) /*!< Filter bit 26 */
+#define CAN_F9R1_FB27 ((uint32_t)0x08000000) /*!< Filter bit 27 */
+#define CAN_F9R1_FB28 ((uint32_t)0x10000000) /*!< Filter bit 28 */
+#define CAN_F9R1_FB29 ((uint32_t)0x20000000) /*!< Filter bit 29 */
+#define CAN_F9R1_FB30 ((uint32_t)0x40000000) /*!< Filter bit 30 */
+#define CAN_F9R1_FB31 ((uint32_t)0x80000000) /*!< Filter bit 31 */
+
+/******************* Bit definition for CAN_F10R1 register ******************/
+#define CAN_F10R1_FB0 ((uint32_t)0x00000001) /*!< Filter bit 0 */
+#define CAN_F10R1_FB1 ((uint32_t)0x00000002) /*!< Filter bit 1 */
+#define CAN_F10R1_FB2 ((uint32_t)0x00000004) /*!< Filter bit 2 */
+#define CAN_F10R1_FB3 ((uint32_t)0x00000008) /*!< Filter bit 3 */
+#define CAN_F10R1_FB4 ((uint32_t)0x00000010) /*!< Filter bit 4 */
+#define CAN_F10R1_FB5 ((uint32_t)0x00000020) /*!< Filter bit 5 */
+#define CAN_F10R1_FB6 ((uint32_t)0x00000040) /*!< Filter bit 6 */
+#define CAN_F10R1_FB7 ((uint32_t)0x00000080) /*!< Filter bit 7 */
+#define CAN_F10R1_FB8 ((uint32_t)0x00000100) /*!< Filter bit 8 */
+#define CAN_F10R1_FB9 ((uint32_t)0x00000200) /*!< Filter bit 9 */
+#define CAN_F10R1_FB10 ((uint32_t)0x00000400) /*!< Filter bit 10 */
+#define CAN_F10R1_FB11 ((uint32_t)0x00000800) /*!< Filter bit 11 */
+#define CAN_F10R1_FB12 ((uint32_t)0x00001000) /*!< Filter bit 12 */
+#define CAN_F10R1_FB13 ((uint32_t)0x00002000) /*!< Filter bit 13 */
+#define CAN_F10R1_FB14 ((uint32_t)0x00004000) /*!< Filter bit 14 */
+#define CAN_F10R1_FB15 ((uint32_t)0x00008000) /*!< Filter bit 15 */
+#define CAN_F10R1_FB16 ((uint32_t)0x00010000) /*!< Filter bit 16 */
+#define CAN_F10R1_FB17 ((uint32_t)0x00020000) /*!< Filter bit 17 */
+#define CAN_F10R1_FB18 ((uint32_t)0x00040000) /*!< Filter bit 18 */
+#define CAN_F10R1_FB19 ((uint32_t)0x00080000) /*!< Filter bit 19 */
+#define CAN_F10R1_FB20 ((uint32_t)0x00100000) /*!< Filter bit 20 */
+#define CAN_F10R1_FB21 ((uint32_t)0x00200000) /*!< Filter bit 21 */
+#define CAN_F10R1_FB22 ((uint32_t)0x00400000) /*!< Filter bit 22 */
+#define CAN_F10R1_FB23 ((uint32_t)0x00800000) /*!< Filter bit 23 */
+#define CAN_F10R1_FB24 ((uint32_t)0x01000000) /*!< Filter bit 24 */
+#define CAN_F10R1_FB25 ((uint32_t)0x02000000) /*!< Filter bit 25 */
+#define CAN_F10R1_FB26 ((uint32_t)0x04000000) /*!< Filter bit 26 */
+#define CAN_F10R1_FB27 ((uint32_t)0x08000000) /*!< Filter bit 27 */
+#define CAN_F10R1_FB28 ((uint32_t)0x10000000) /*!< Filter bit 28 */
+#define CAN_F10R1_FB29 ((uint32_t)0x20000000) /*!< Filter bit 29 */
+#define CAN_F10R1_FB30 ((uint32_t)0x40000000) /*!< Filter bit 30 */
+#define CAN_F10R1_FB31 ((uint32_t)0x80000000) /*!< Filter bit 31 */
+
+/******************* Bit definition for CAN_F11R1 register ******************/
+#define CAN_F11R1_FB0 ((uint32_t)0x00000001) /*!< Filter bit 0 */
+#define CAN_F11R1_FB1 ((uint32_t)0x00000002) /*!< Filter bit 1 */
+#define CAN_F11R1_FB2 ((uint32_t)0x00000004) /*!< Filter bit 2 */
+#define CAN_F11R1_FB3 ((uint32_t)0x00000008) /*!< Filter bit 3 */
+#define CAN_F11R1_FB4 ((uint32_t)0x00000010) /*!< Filter bit 4 */
+#define CAN_F11R1_FB5 ((uint32_t)0x00000020) /*!< Filter bit 5 */
+#define CAN_F11R1_FB6 ((uint32_t)0x00000040) /*!< Filter bit 6 */
+#define CAN_F11R1_FB7 ((uint32_t)0x00000080) /*!< Filter bit 7 */
+#define CAN_F11R1_FB8 ((uint32_t)0x00000100) /*!< Filter bit 8 */
+#define CAN_F11R1_FB9 ((uint32_t)0x00000200) /*!< Filter bit 9 */
+#define CAN_F11R1_FB10 ((uint32_t)0x00000400) /*!< Filter bit 10 */
+#define CAN_F11R1_FB11 ((uint32_t)0x00000800) /*!< Filter bit 11 */
+#define CAN_F11R1_FB12 ((uint32_t)0x00001000) /*!< Filter bit 12 */
+#define CAN_F11R1_FB13 ((uint32_t)0x00002000) /*!< Filter bit 13 */
+#define CAN_F11R1_FB14 ((uint32_t)0x00004000) /*!< Filter bit 14 */
+#define CAN_F11R1_FB15 ((uint32_t)0x00008000) /*!< Filter bit 15 */
+#define CAN_F11R1_FB16 ((uint32_t)0x00010000) /*!< Filter bit 16 */
+#define CAN_F11R1_FB17 ((uint32_t)0x00020000) /*!< Filter bit 17 */
+#define CAN_F11R1_FB18 ((uint32_t)0x00040000) /*!< Filter bit 18 */
+#define CAN_F11R1_FB19 ((uint32_t)0x00080000) /*!< Filter bit 19 */
+#define CAN_F11R1_FB20 ((uint32_t)0x00100000) /*!< Filter bit 20 */
+#define CAN_F11R1_FB21 ((uint32_t)0x00200000) /*!< Filter bit 21 */
+#define CAN_F11R1_FB22 ((uint32_t)0x00400000) /*!< Filter bit 22 */
+#define CAN_F11R1_FB23 ((uint32_t)0x00800000) /*!< Filter bit 23 */
+#define CAN_F11R1_FB24 ((uint32_t)0x01000000) /*!< Filter bit 24 */
+#define CAN_F11R1_FB25 ((uint32_t)0x02000000) /*!< Filter bit 25 */
+#define CAN_F11R1_FB26 ((uint32_t)0x04000000) /*!< Filter bit 26 */
+#define CAN_F11R1_FB27 ((uint32_t)0x08000000) /*!< Filter bit 27 */
+#define CAN_F11R1_FB28 ((uint32_t)0x10000000) /*!< Filter bit 28 */
+#define CAN_F11R1_FB29 ((uint32_t)0x20000000) /*!< Filter bit 29 */
+#define CAN_F11R1_FB30 ((uint32_t)0x40000000) /*!< Filter bit 30 */
+#define CAN_F11R1_FB31 ((uint32_t)0x80000000) /*!< Filter bit 31 */
+
+/******************* Bit definition for CAN_F12R1 register ******************/
+#define CAN_F12R1_FB0 ((uint32_t)0x00000001) /*!< Filter bit 0 */
+#define CAN_F12R1_FB1 ((uint32_t)0x00000002) /*!< Filter bit 1 */
+#define CAN_F12R1_FB2 ((uint32_t)0x00000004) /*!< Filter bit 2 */
+#define CAN_F12R1_FB3 ((uint32_t)0x00000008) /*!< Filter bit 3 */
+#define CAN_F12R1_FB4 ((uint32_t)0x00000010) /*!< Filter bit 4 */
+#define CAN_F12R1_FB5 ((uint32_t)0x00000020) /*!< Filter bit 5 */
+#define CAN_F12R1_FB6 ((uint32_t)0x00000040) /*!< Filter bit 6 */
+#define CAN_F12R1_FB7 ((uint32_t)0x00000080) /*!< Filter bit 7 */
+#define CAN_F12R1_FB8 ((uint32_t)0x00000100) /*!< Filter bit 8 */
+#define CAN_F12R1_FB9 ((uint32_t)0x00000200) /*!< Filter bit 9 */
+#define CAN_F12R1_FB10 ((uint32_t)0x00000400) /*!< Filter bit 10 */
+#define CAN_F12R1_FB11 ((uint32_t)0x00000800) /*!< Filter bit 11 */
+#define CAN_F12R1_FB12 ((uint32_t)0x00001000) /*!< Filter bit 12 */
+#define CAN_F12R1_FB13 ((uint32_t)0x00002000) /*!< Filter bit 13 */
+#define CAN_F12R1_FB14 ((uint32_t)0x00004000) /*!< Filter bit 14 */
+#define CAN_F12R1_FB15 ((uint32_t)0x00008000) /*!< Filter bit 15 */
+#define CAN_F12R1_FB16 ((uint32_t)0x00010000) /*!< Filter bit 16 */
+#define CAN_F12R1_FB17 ((uint32_t)0x00020000) /*!< Filter bit 17 */
+#define CAN_F12R1_FB18 ((uint32_t)0x00040000) /*!< Filter bit 18 */
+#define CAN_F12R1_FB19 ((uint32_t)0x00080000) /*!< Filter bit 19 */
+#define CAN_F12R1_FB20 ((uint32_t)0x00100000) /*!< Filter bit 20 */
+#define CAN_F12R1_FB21 ((uint32_t)0x00200000) /*!< Filter bit 21 */
+#define CAN_F12R1_FB22 ((uint32_t)0x00400000) /*!< Filter bit 22 */
+#define CAN_F12R1_FB23 ((uint32_t)0x00800000) /*!< Filter bit 23 */
+#define CAN_F12R1_FB24 ((uint32_t)0x01000000) /*!< Filter bit 24 */
+#define CAN_F12R1_FB25 ((uint32_t)0x02000000) /*!< Filter bit 25 */
+#define CAN_F12R1_FB26 ((uint32_t)0x04000000) /*!< Filter bit 26 */
+#define CAN_F12R1_FB27 ((uint32_t)0x08000000) /*!< Filter bit 27 */
+#define CAN_F12R1_FB28 ((uint32_t)0x10000000) /*!< Filter bit 28 */
+#define CAN_F12R1_FB29 ((uint32_t)0x20000000) /*!< Filter bit 29 */
+#define CAN_F12R1_FB30 ((uint32_t)0x40000000) /*!< Filter bit 30 */
+#define CAN_F12R1_FB31 ((uint32_t)0x80000000) /*!< Filter bit 31 */
+
+/******************* Bit definition for CAN_F13R1 register ******************/
+#define CAN_F13R1_FB0 ((uint32_t)0x00000001) /*!< Filter bit 0 */
+#define CAN_F13R1_FB1 ((uint32_t)0x00000002) /*!< Filter bit 1 */
+#define CAN_F13R1_FB2 ((uint32_t)0x00000004) /*!< Filter bit 2 */
+#define CAN_F13R1_FB3 ((uint32_t)0x00000008) /*!< Filter bit 3 */
+#define CAN_F13R1_FB4 ((uint32_t)0x00000010) /*!< Filter bit 4 */
+#define CAN_F13R1_FB5 ((uint32_t)0x00000020) /*!< Filter bit 5 */
+#define CAN_F13R1_FB6 ((uint32_t)0x00000040) /*!< Filter bit 6 */
+#define CAN_F13R1_FB7 ((uint32_t)0x00000080) /*!< Filter bit 7 */
+#define CAN_F13R1_FB8 ((uint32_t)0x00000100) /*!< Filter bit 8 */
+#define CAN_F13R1_FB9 ((uint32_t)0x00000200) /*!< Filter bit 9 */
+#define CAN_F13R1_FB10 ((uint32_t)0x00000400) /*!< Filter bit 10 */
+#define CAN_F13R1_FB11 ((uint32_t)0x00000800) /*!< Filter bit 11 */
+#define CAN_F13R1_FB12 ((uint32_t)0x00001000) /*!< Filter bit 12 */
+#define CAN_F13R1_FB13 ((uint32_t)0x00002000) /*!< Filter bit 13 */
+#define CAN_F13R1_FB14 ((uint32_t)0x00004000) /*!< Filter bit 14 */
+#define CAN_F13R1_FB15 ((uint32_t)0x00008000) /*!< Filter bit 15 */
+#define CAN_F13R1_FB16 ((uint32_t)0x00010000) /*!< Filter bit 16 */
+#define CAN_F13R1_FB17 ((uint32_t)0x00020000) /*!< Filter bit 17 */
+#define CAN_F13R1_FB18 ((uint32_t)0x00040000) /*!< Filter bit 18 */
+#define CAN_F13R1_FB19 ((uint32_t)0x00080000) /*!< Filter bit 19 */
+#define CAN_F13R1_FB20 ((uint32_t)0x00100000) /*!< Filter bit 20 */
+#define CAN_F13R1_FB21 ((uint32_t)0x00200000) /*!< Filter bit 21 */
+#define CAN_F13R1_FB22 ((uint32_t)0x00400000) /*!< Filter bit 22 */
+#define CAN_F13R1_FB23 ((uint32_t)0x00800000) /*!< Filter bit 23 */
+#define CAN_F13R1_FB24 ((uint32_t)0x01000000) /*!< Filter bit 24 */
+#define CAN_F13R1_FB25 ((uint32_t)0x02000000) /*!< Filter bit 25 */
+#define CAN_F13R1_FB26 ((uint32_t)0x04000000) /*!< Filter bit 26 */
+#define CAN_F13R1_FB27 ((uint32_t)0x08000000) /*!< Filter bit 27 */
+#define CAN_F13R1_FB28 ((uint32_t)0x10000000) /*!< Filter bit 28 */
+#define CAN_F13R1_FB29 ((uint32_t)0x20000000) /*!< Filter bit 29 */
+#define CAN_F13R1_FB30 ((uint32_t)0x40000000) /*!< Filter bit 30 */
+#define CAN_F13R1_FB31 ((uint32_t)0x80000000) /*!< Filter bit 31 */
+
+/******************* Bit definition for CAN_F0R2 register *******************/
+#define CAN_F0R2_FB0 ((uint32_t)0x00000001) /*!< Filter bit 0 */
+#define CAN_F0R2_FB1 ((uint32_t)0x00000002) /*!< Filter bit 1 */
+#define CAN_F0R2_FB2 ((uint32_t)0x00000004) /*!< Filter bit 2 */
+#define CAN_F0R2_FB3 ((uint32_t)0x00000008) /*!< Filter bit 3 */
+#define CAN_F0R2_FB4 ((uint32_t)0x00000010) /*!< Filter bit 4 */
+#define CAN_F0R2_FB5 ((uint32_t)0x00000020) /*!< Filter bit 5 */
+#define CAN_F0R2_FB6 ((uint32_t)0x00000040) /*!< Filter bit 6 */
+#define CAN_F0R2_FB7 ((uint32_t)0x00000080) /*!< Filter bit 7 */
+#define CAN_F0R2_FB8 ((uint32_t)0x00000100) /*!< Filter bit 8 */
+#define CAN_F0R2_FB9 ((uint32_t)0x00000200) /*!< Filter bit 9 */
+#define CAN_F0R2_FB10 ((uint32_t)0x00000400) /*!< Filter bit 10 */
+#define CAN_F0R2_FB11 ((uint32_t)0x00000800) /*!< Filter bit 11 */
+#define CAN_F0R2_FB12 ((uint32_t)0x00001000) /*!< Filter bit 12 */
+#define CAN_F0R2_FB13 ((uint32_t)0x00002000) /*!< Filter bit 13 */
+#define CAN_F0R2_FB14 ((uint32_t)0x00004000) /*!< Filter bit 14 */
+#define CAN_F0R2_FB15 ((uint32_t)0x00008000) /*!< Filter bit 15 */
+#define CAN_F0R2_FB16 ((uint32_t)0x00010000) /*!< Filter bit 16 */
+#define CAN_F0R2_FB17 ((uint32_t)0x00020000) /*!< Filter bit 17 */
+#define CAN_F0R2_FB18 ((uint32_t)0x00040000) /*!< Filter bit 18 */
+#define CAN_F0R2_FB19 ((uint32_t)0x00080000) /*!< Filter bit 19 */
+#define CAN_F0R2_FB20 ((uint32_t)0x00100000) /*!< Filter bit 20 */
+#define CAN_F0R2_FB21 ((uint32_t)0x00200000) /*!< Filter bit 21 */
+#define CAN_F0R2_FB22 ((uint32_t)0x00400000) /*!< Filter bit 22 */
+#define CAN_F0R2_FB23 ((uint32_t)0x00800000) /*!< Filter bit 23 */
+#define CAN_F0R2_FB24 ((uint32_t)0x01000000) /*!< Filter bit 24 */
+#define CAN_F0R2_FB25 ((uint32_t)0x02000000) /*!< Filter bit 25 */
+#define CAN_F0R2_FB26 ((uint32_t)0x04000000) /*!< Filter bit 26 */
+#define CAN_F0R2_FB27 ((uint32_t)0x08000000) /*!< Filter bit 27 */
+#define CAN_F0R2_FB28 ((uint32_t)0x10000000) /*!< Filter bit 28 */
+#define CAN_F0R2_FB29 ((uint32_t)0x20000000) /*!< Filter bit 29 */
+#define CAN_F0R2_FB30 ((uint32_t)0x40000000) /*!< Filter bit 30 */
+#define CAN_F0R2_FB31 ((uint32_t)0x80000000) /*!< Filter bit 31 */
+
+/******************* Bit definition for CAN_F1R2 register *******************/
+#define CAN_F1R2_FB0 ((uint32_t)0x00000001) /*!< Filter bit 0 */
+#define CAN_F1R2_FB1 ((uint32_t)0x00000002) /*!< Filter bit 1 */
+#define CAN_F1R2_FB2 ((uint32_t)0x00000004) /*!< Filter bit 2 */
+#define CAN_F1R2_FB3 ((uint32_t)0x00000008) /*!< Filter bit 3 */
+#define CAN_F1R2_FB4 ((uint32_t)0x00000010) /*!< Filter bit 4 */
+#define CAN_F1R2_FB5 ((uint32_t)0x00000020) /*!< Filter bit 5 */
+#define CAN_F1R2_FB6 ((uint32_t)0x00000040) /*!< Filter bit 6 */
+#define CAN_F1R2_FB7 ((uint32_t)0x00000080) /*!< Filter bit 7 */
+#define CAN_F1R2_FB8 ((uint32_t)0x00000100) /*!< Filter bit 8 */
+#define CAN_F1R2_FB9 ((uint32_t)0x00000200) /*!< Filter bit 9 */
+#define CAN_F1R2_FB10 ((uint32_t)0x00000400) /*!< Filter bit 10 */
+#define CAN_F1R2_FB11 ((uint32_t)0x00000800) /*!< Filter bit 11 */
+#define CAN_F1R2_FB12 ((uint32_t)0x00001000) /*!< Filter bit 12 */
+#define CAN_F1R2_FB13 ((uint32_t)0x00002000) /*!< Filter bit 13 */
+#define CAN_F1R2_FB14 ((uint32_t)0x00004000) /*!< Filter bit 14 */
+#define CAN_F1R2_FB15 ((uint32_t)0x00008000) /*!< Filter bit 15 */
+#define CAN_F1R2_FB16 ((uint32_t)0x00010000) /*!< Filter bit 16 */
+#define CAN_F1R2_FB17 ((uint32_t)0x00020000) /*!< Filter bit 17 */
+#define CAN_F1R2_FB18 ((uint32_t)0x00040000) /*!< Filter bit 18 */
+#define CAN_F1R2_FB19 ((uint32_t)0x00080000) /*!< Filter bit 19 */
+#define CAN_F1R2_FB20 ((uint32_t)0x00100000) /*!< Filter bit 20 */
+#define CAN_F1R2_FB21 ((uint32_t)0x00200000) /*!< Filter bit 21 */
+#define CAN_F1R2_FB22 ((uint32_t)0x00400000) /*!< Filter bit 22 */
+#define CAN_F1R2_FB23 ((uint32_t)0x00800000) /*!< Filter bit 23 */
+#define CAN_F1R2_FB24 ((uint32_t)0x01000000) /*!< Filter bit 24 */
+#define CAN_F1R2_FB25 ((uint32_t)0x02000000) /*!< Filter bit 25 */
+#define CAN_F1R2_FB26 ((uint32_t)0x04000000) /*!< Filter bit 26 */
+#define CAN_F1R2_FB27 ((uint32_t)0x08000000) /*!< Filter bit 27 */
+#define CAN_F1R2_FB28 ((uint32_t)0x10000000) /*!< Filter bit 28 */
+#define CAN_F1R2_FB29 ((uint32_t)0x20000000) /*!< Filter bit 29 */
+#define CAN_F1R2_FB30 ((uint32_t)0x40000000) /*!< Filter bit 30 */
+#define CAN_F1R2_FB31 ((uint32_t)0x80000000) /*!< Filter bit 31 */
+
+/******************* Bit definition for CAN_F2R2 register *******************/
+#define CAN_F2R2_FB0 ((uint32_t)0x00000001) /*!< Filter bit 0 */
+#define CAN_F2R2_FB1 ((uint32_t)0x00000002) /*!< Filter bit 1 */
+#define CAN_F2R2_FB2 ((uint32_t)0x00000004) /*!< Filter bit 2 */
+#define CAN_F2R2_FB3 ((uint32_t)0x00000008) /*!< Filter bit 3 */
+#define CAN_F2R2_FB4 ((uint32_t)0x00000010) /*!< Filter bit 4 */
+#define CAN_F2R2_FB5 ((uint32_t)0x00000020) /*!< Filter bit 5 */
+#define CAN_F2R2_FB6 ((uint32_t)0x00000040) /*!< Filter bit 6 */
+#define CAN_F2R2_FB7 ((uint32_t)0x00000080) /*!< Filter bit 7 */
+#define CAN_F2R2_FB8 ((uint32_t)0x00000100) /*!< Filter bit 8 */
+#define CAN_F2R2_FB9 ((uint32_t)0x00000200) /*!< Filter bit 9 */
+#define CAN_F2R2_FB10 ((uint32_t)0x00000400) /*!< Filter bit 10 */
+#define CAN_F2R2_FB11 ((uint32_t)0x00000800) /*!< Filter bit 11 */
+#define CAN_F2R2_FB12 ((uint32_t)0x00001000) /*!< Filter bit 12 */
+#define CAN_F2R2_FB13 ((uint32_t)0x00002000) /*!< Filter bit 13 */
+#define CAN_F2R2_FB14 ((uint32_t)0x00004000) /*!< Filter bit 14 */
+#define CAN_F2R2_FB15 ((uint32_t)0x00008000) /*!< Filter bit 15 */
+#define CAN_F2R2_FB16 ((uint32_t)0x00010000) /*!< Filter bit 16 */
+#define CAN_F2R2_FB17 ((uint32_t)0x00020000) /*!< Filter bit 17 */
+#define CAN_F2R2_FB18 ((uint32_t)0x00040000) /*!< Filter bit 18 */
+#define CAN_F2R2_FB19 ((uint32_t)0x00080000) /*!< Filter bit 19 */
+#define CAN_F2R2_FB20 ((uint32_t)0x00100000) /*!< Filter bit 20 */
+#define CAN_F2R2_FB21 ((uint32_t)0x00200000) /*!< Filter bit 21 */
+#define CAN_F2R2_FB22 ((uint32_t)0x00400000) /*!< Filter bit 22 */
+#define CAN_F2R2_FB23 ((uint32_t)0x00800000) /*!< Filter bit 23 */
+#define CAN_F2R2_FB24 ((uint32_t)0x01000000) /*!< Filter bit 24 */
+#define CAN_F2R2_FB25 ((uint32_t)0x02000000) /*!< Filter bit 25 */
+#define CAN_F2R2_FB26 ((uint32_t)0x04000000) /*!< Filter bit 26 */
+#define CAN_F2R2_FB27 ((uint32_t)0x08000000) /*!< Filter bit 27 */
+#define CAN_F2R2_FB28 ((uint32_t)0x10000000) /*!< Filter bit 28 */
+#define CAN_F2R2_FB29 ((uint32_t)0x20000000) /*!< Filter bit 29 */
+#define CAN_F2R2_FB30 ((uint32_t)0x40000000) /*!< Filter bit 30 */
+#define CAN_F2R2_FB31 ((uint32_t)0x80000000) /*!< Filter bit 31 */
+
+/******************* Bit definition for CAN_F3R2 register *******************/
+#define CAN_F3R2_FB0 ((uint32_t)0x00000001) /*!< Filter bit 0 */
+#define CAN_F3R2_FB1 ((uint32_t)0x00000002) /*!< Filter bit 1 */
+#define CAN_F3R2_FB2 ((uint32_t)0x00000004) /*!< Filter bit 2 */
+#define CAN_F3R2_FB3 ((uint32_t)0x00000008) /*!< Filter bit 3 */
+#define CAN_F3R2_FB4 ((uint32_t)0x00000010) /*!< Filter bit 4 */
+#define CAN_F3R2_FB5 ((uint32_t)0x00000020) /*!< Filter bit 5 */
+#define CAN_F3R2_FB6 ((uint32_t)0x00000040) /*!< Filter bit 6 */
+#define CAN_F3R2_FB7 ((uint32_t)0x00000080) /*!< Filter bit 7 */
+#define CAN_F3R2_FB8 ((uint32_t)0x00000100) /*!< Filter bit 8 */
+#define CAN_F3R2_FB9 ((uint32_t)0x00000200) /*!< Filter bit 9 */
+#define CAN_F3R2_FB10 ((uint32_t)0x00000400) /*!< Filter bit 10 */
+#define CAN_F3R2_FB11 ((uint32_t)0x00000800) /*!< Filter bit 11 */
+#define CAN_F3R2_FB12 ((uint32_t)0x00001000) /*!< Filter bit 12 */
+#define CAN_F3R2_FB13 ((uint32_t)0x00002000) /*!< Filter bit 13 */
+#define CAN_F3R2_FB14 ((uint32_t)0x00004000) /*!< Filter bit 14 */
+#define CAN_F3R2_FB15 ((uint32_t)0x00008000) /*!< Filter bit 15 */
+#define CAN_F3R2_FB16 ((uint32_t)0x00010000) /*!< Filter bit 16 */
+#define CAN_F3R2_FB17 ((uint32_t)0x00020000) /*!< Filter bit 17 */
+#define CAN_F3R2_FB18 ((uint32_t)0x00040000) /*!< Filter bit 18 */
+#define CAN_F3R2_FB19 ((uint32_t)0x00080000) /*!< Filter bit 19 */
+#define CAN_F3R2_FB20 ((uint32_t)0x00100000) /*!< Filter bit 20 */
+#define CAN_F3R2_FB21 ((uint32_t)0x00200000) /*!< Filter bit 21 */
+#define CAN_F3R2_FB22 ((uint32_t)0x00400000) /*!< Filter bit 22 */
+#define CAN_F3R2_FB23 ((uint32_t)0x00800000) /*!< Filter bit 23 */
+#define CAN_F3R2_FB24 ((uint32_t)0x01000000) /*!< Filter bit 24 */
+#define CAN_F3R2_FB25 ((uint32_t)0x02000000) /*!< Filter bit 25 */
+#define CAN_F3R2_FB26 ((uint32_t)0x04000000) /*!< Filter bit 26 */
+#define CAN_F3R2_FB27 ((uint32_t)0x08000000) /*!< Filter bit 27 */
+#define CAN_F3R2_FB28 ((uint32_t)0x10000000) /*!< Filter bit 28 */
+#define CAN_F3R2_FB29 ((uint32_t)0x20000000) /*!< Filter bit 29 */
+#define CAN_F3R2_FB30 ((uint32_t)0x40000000) /*!< Filter bit 30 */
+#define CAN_F3R2_FB31 ((uint32_t)0x80000000) /*!< Filter bit 31 */
+
+/******************* Bit definition for CAN_F4R2 register *******************/
+#define CAN_F4R2_FB0 ((uint32_t)0x00000001) /*!< Filter bit 0 */
+#define CAN_F4R2_FB1 ((uint32_t)0x00000002) /*!< Filter bit 1 */
+#define CAN_F4R2_FB2 ((uint32_t)0x00000004) /*!< Filter bit 2 */
+#define CAN_F4R2_FB3 ((uint32_t)0x00000008) /*!< Filter bit 3 */
+#define CAN_F4R2_FB4 ((uint32_t)0x00000010) /*!< Filter bit 4 */
+#define CAN_F4R2_FB5 ((uint32_t)0x00000020) /*!< Filter bit 5 */
+#define CAN_F4R2_FB6 ((uint32_t)0x00000040) /*!< Filter bit 6 */
+#define CAN_F4R2_FB7 ((uint32_t)0x00000080) /*!< Filter bit 7 */
+#define CAN_F4R2_FB8 ((uint32_t)0x00000100) /*!< Filter bit 8 */
+#define CAN_F4R2_FB9 ((uint32_t)0x00000200) /*!< Filter bit 9 */
+#define CAN_F4R2_FB10 ((uint32_t)0x00000400) /*!< Filter bit 10 */
+#define CAN_F4R2_FB11 ((uint32_t)0x00000800) /*!< Filter bit 11 */
+#define CAN_F4R2_FB12 ((uint32_t)0x00001000) /*!< Filter bit 12 */
+#define CAN_F4R2_FB13 ((uint32_t)0x00002000) /*!< Filter bit 13 */
+#define CAN_F4R2_FB14 ((uint32_t)0x00004000) /*!< Filter bit 14 */
+#define CAN_F4R2_FB15 ((uint32_t)0x00008000) /*!< Filter bit 15 */
+#define CAN_F4R2_FB16 ((uint32_t)0x00010000) /*!< Filter bit 16 */
+#define CAN_F4R2_FB17 ((uint32_t)0x00020000) /*!< Filter bit 17 */
+#define CAN_F4R2_FB18 ((uint32_t)0x00040000) /*!< Filter bit 18 */
+#define CAN_F4R2_FB19 ((uint32_t)0x00080000) /*!< Filter bit 19 */
+#define CAN_F4R2_FB20 ((uint32_t)0x00100000) /*!< Filter bit 20 */
+#define CAN_F4R2_FB21 ((uint32_t)0x00200000) /*!< Filter bit 21 */
+#define CAN_F4R2_FB22 ((uint32_t)0x00400000) /*!< Filter bit 22 */
+#define CAN_F4R2_FB23 ((uint32_t)0x00800000) /*!< Filter bit 23 */
+#define CAN_F4R2_FB24 ((uint32_t)0x01000000) /*!< Filter bit 24 */
+#define CAN_F4R2_FB25 ((uint32_t)0x02000000) /*!< Filter bit 25 */
+#define CAN_F4R2_FB26 ((uint32_t)0x04000000) /*!< Filter bit 26 */
+#define CAN_F4R2_FB27 ((uint32_t)0x08000000) /*!< Filter bit 27 */
+#define CAN_F4R2_FB28 ((uint32_t)0x10000000) /*!< Filter bit 28 */
+#define CAN_F4R2_FB29 ((uint32_t)0x20000000) /*!< Filter bit 29 */
+#define CAN_F4R2_FB30 ((uint32_t)0x40000000) /*!< Filter bit 30 */
+#define CAN_F4R2_FB31 ((uint32_t)0x80000000) /*!< Filter bit 31 */
+
+/******************* Bit definition for CAN_F5R2 register *******************/
+#define CAN_F5R2_FB0 ((uint32_t)0x00000001) /*!< Filter bit 0 */
+#define CAN_F5R2_FB1 ((uint32_t)0x00000002) /*!< Filter bit 1 */
+#define CAN_F5R2_FB2 ((uint32_t)0x00000004) /*!< Filter bit 2 */
+#define CAN_F5R2_FB3 ((uint32_t)0x00000008) /*!< Filter bit 3 */
+#define CAN_F5R2_FB4 ((uint32_t)0x00000010) /*!< Filter bit 4 */
+#define CAN_F5R2_FB5 ((uint32_t)0x00000020) /*!< Filter bit 5 */
+#define CAN_F5R2_FB6 ((uint32_t)0x00000040) /*!< Filter bit 6 */
+#define CAN_F5R2_FB7 ((uint32_t)0x00000080) /*!< Filter bit 7 */
+#define CAN_F5R2_FB8 ((uint32_t)0x00000100) /*!< Filter bit 8 */
+#define CAN_F5R2_FB9 ((uint32_t)0x00000200) /*!< Filter bit 9 */
+#define CAN_F5R2_FB10 ((uint32_t)0x00000400) /*!< Filter bit 10 */
+#define CAN_F5R2_FB11 ((uint32_t)0x00000800) /*!< Filter bit 11 */
+#define CAN_F5R2_FB12 ((uint32_t)0x00001000) /*!< Filter bit 12 */
+#define CAN_F5R2_FB13 ((uint32_t)0x00002000) /*!< Filter bit 13 */
+#define CAN_F5R2_FB14 ((uint32_t)0x00004000) /*!< Filter bit 14 */
+#define CAN_F5R2_FB15 ((uint32_t)0x00008000) /*!< Filter bit 15 */
+#define CAN_F5R2_FB16 ((uint32_t)0x00010000) /*!< Filter bit 16 */
+#define CAN_F5R2_FB17 ((uint32_t)0x00020000) /*!< Filter bit 17 */
+#define CAN_F5R2_FB18 ((uint32_t)0x00040000) /*!< Filter bit 18 */
+#define CAN_F5R2_FB19 ((uint32_t)0x00080000) /*!< Filter bit 19 */
+#define CAN_F5R2_FB20 ((uint32_t)0x00100000) /*!< Filter bit 20 */
+#define CAN_F5R2_FB21 ((uint32_t)0x00200000) /*!< Filter bit 21 */
+#define CAN_F5R2_FB22 ((uint32_t)0x00400000) /*!< Filter bit 22 */
+#define CAN_F5R2_FB23 ((uint32_t)0x00800000) /*!< Filter bit 23 */
+#define CAN_F5R2_FB24 ((uint32_t)0x01000000) /*!< Filter bit 24 */
+#define CAN_F5R2_FB25 ((uint32_t)0x02000000) /*!< Filter bit 25 */
+#define CAN_F5R2_FB26 ((uint32_t)0x04000000) /*!< Filter bit 26 */
+#define CAN_F5R2_FB27 ((uint32_t)0x08000000) /*!< Filter bit 27 */
+#define CAN_F5R2_FB28 ((uint32_t)0x10000000) /*!< Filter bit 28 */
+#define CAN_F5R2_FB29 ((uint32_t)0x20000000) /*!< Filter bit 29 */
+#define CAN_F5R2_FB30 ((uint32_t)0x40000000) /*!< Filter bit 30 */
+#define CAN_F5R2_FB31 ((uint32_t)0x80000000) /*!< Filter bit 31 */
+
+/******************* Bit definition for CAN_F6R2 register *******************/
+#define CAN_F6R2_FB0 ((uint32_t)0x00000001) /*!< Filter bit 0 */
+#define CAN_F6R2_FB1 ((uint32_t)0x00000002) /*!< Filter bit 1 */
+#define CAN_F6R2_FB2 ((uint32_t)0x00000004) /*!< Filter bit 2 */
+#define CAN_F6R2_FB3 ((uint32_t)0x00000008) /*!< Filter bit 3 */
+#define CAN_F6R2_FB4 ((uint32_t)0x00000010) /*!< Filter bit 4 */
+#define CAN_F6R2_FB5 ((uint32_t)0x00000020) /*!< Filter bit 5 */
+#define CAN_F6R2_FB6 ((uint32_t)0x00000040) /*!< Filter bit 6 */
+#define CAN_F6R2_FB7 ((uint32_t)0x00000080) /*!< Filter bit 7 */
+#define CAN_F6R2_FB8 ((uint32_t)0x00000100) /*!< Filter bit 8 */
+#define CAN_F6R2_FB9 ((uint32_t)0x00000200) /*!< Filter bit 9 */
+#define CAN_F6R2_FB10 ((uint32_t)0x00000400) /*!< Filter bit 10 */
+#define CAN_F6R2_FB11 ((uint32_t)0x00000800) /*!< Filter bit 11 */
+#define CAN_F6R2_FB12 ((uint32_t)0x00001000) /*!< Filter bit 12 */
+#define CAN_F6R2_FB13 ((uint32_t)0x00002000) /*!< Filter bit 13 */
+#define CAN_F6R2_FB14 ((uint32_t)0x00004000) /*!< Filter bit 14 */
+#define CAN_F6R2_FB15 ((uint32_t)0x00008000) /*!< Filter bit 15 */
+#define CAN_F6R2_FB16 ((uint32_t)0x00010000) /*!< Filter bit 16 */
+#define CAN_F6R2_FB17 ((uint32_t)0x00020000) /*!< Filter bit 17 */
+#define CAN_F6R2_FB18 ((uint32_t)0x00040000) /*!< Filter bit 18 */
+#define CAN_F6R2_FB19 ((uint32_t)0x00080000) /*!< Filter bit 19 */
+#define CAN_F6R2_FB20 ((uint32_t)0x00100000) /*!< Filter bit 20 */
+#define CAN_F6R2_FB21 ((uint32_t)0x00200000) /*!< Filter bit 21 */
+#define CAN_F6R2_FB22 ((uint32_t)0x00400000) /*!< Filter bit 22 */
+#define CAN_F6R2_FB23 ((uint32_t)0x00800000) /*!< Filter bit 23 */
+#define CAN_F6R2_FB24 ((uint32_t)0x01000000) /*!< Filter bit 24 */
+#define CAN_F6R2_FB25 ((uint32_t)0x02000000) /*!< Filter bit 25 */
+#define CAN_F6R2_FB26 ((uint32_t)0x04000000) /*!< Filter bit 26 */
+#define CAN_F6R2_FB27 ((uint32_t)0x08000000) /*!< Filter bit 27 */
+#define CAN_F6R2_FB28 ((uint32_t)0x10000000) /*!< Filter bit 28 */
+#define CAN_F6R2_FB29 ((uint32_t)0x20000000) /*!< Filter bit 29 */
+#define CAN_F6R2_FB30 ((uint32_t)0x40000000) /*!< Filter bit 30 */
+#define CAN_F6R2_FB31 ((uint32_t)0x80000000) /*!< Filter bit 31 */
+
+/******************* Bit definition for CAN_F7R2 register *******************/
+#define CAN_F7R2_FB0 ((uint32_t)0x00000001) /*!< Filter bit 0 */
+#define CAN_F7R2_FB1 ((uint32_t)0x00000002) /*!< Filter bit 1 */
+#define CAN_F7R2_FB2 ((uint32_t)0x00000004) /*!< Filter bit 2 */
+#define CAN_F7R2_FB3 ((uint32_t)0x00000008) /*!< Filter bit 3 */
+#define CAN_F7R2_FB4 ((uint32_t)0x00000010) /*!< Filter bit 4 */
+#define CAN_F7R2_FB5 ((uint32_t)0x00000020) /*!< Filter bit 5 */
+#define CAN_F7R2_FB6 ((uint32_t)0x00000040) /*!< Filter bit 6 */
+#define CAN_F7R2_FB7 ((uint32_t)0x00000080) /*!< Filter bit 7 */
+#define CAN_F7R2_FB8 ((uint32_t)0x00000100) /*!< Filter bit 8 */
+#define CAN_F7R2_FB9 ((uint32_t)0x00000200) /*!< Filter bit 9 */
+#define CAN_F7R2_FB10 ((uint32_t)0x00000400) /*!< Filter bit 10 */
+#define CAN_F7R2_FB11 ((uint32_t)0x00000800) /*!< Filter bit 11 */
+#define CAN_F7R2_FB12 ((uint32_t)0x00001000) /*!< Filter bit 12 */
+#define CAN_F7R2_FB13 ((uint32_t)0x00002000) /*!< Filter bit 13 */
+#define CAN_F7R2_FB14 ((uint32_t)0x00004000) /*!< Filter bit 14 */
+#define CAN_F7R2_FB15 ((uint32_t)0x00008000) /*!< Filter bit 15 */
+#define CAN_F7R2_FB16 ((uint32_t)0x00010000) /*!< Filter bit 16 */
+#define CAN_F7R2_FB17 ((uint32_t)0x00020000) /*!< Filter bit 17 */
+#define CAN_F7R2_FB18 ((uint32_t)0x00040000) /*!< Filter bit 18 */
+#define CAN_F7R2_FB19 ((uint32_t)0x00080000) /*!< Filter bit 19 */
+#define CAN_F7R2_FB20 ((uint32_t)0x00100000) /*!< Filter bit 20 */
+#define CAN_F7R2_FB21 ((uint32_t)0x00200000) /*!< Filter bit 21 */
+#define CAN_F7R2_FB22 ((uint32_t)0x00400000) /*!< Filter bit 22 */
+#define CAN_F7R2_FB23 ((uint32_t)0x00800000) /*!< Filter bit 23 */
+#define CAN_F7R2_FB24 ((uint32_t)0x01000000) /*!< Filter bit 24 */
+#define CAN_F7R2_FB25 ((uint32_t)0x02000000) /*!< Filter bit 25 */
+#define CAN_F7R2_FB26 ((uint32_t)0x04000000) /*!< Filter bit 26 */
+#define CAN_F7R2_FB27 ((uint32_t)0x08000000) /*!< Filter bit 27 */
+#define CAN_F7R2_FB28 ((uint32_t)0x10000000) /*!< Filter bit 28 */
+#define CAN_F7R2_FB29 ((uint32_t)0x20000000) /*!< Filter bit 29 */
+#define CAN_F7R2_FB30 ((uint32_t)0x40000000) /*!< Filter bit 30 */
+#define CAN_F7R2_FB31 ((uint32_t)0x80000000) /*!< Filter bit 31 */
+
+/******************* Bit definition for CAN_F8R2 register *******************/
+#define CAN_F8R2_FB0 ((uint32_t)0x00000001) /*!< Filter bit 0 */
+#define CAN_F8R2_FB1 ((uint32_t)0x00000002) /*!< Filter bit 1 */
+#define CAN_F8R2_FB2 ((uint32_t)0x00000004) /*!< Filter bit 2 */
+#define CAN_F8R2_FB3 ((uint32_t)0x00000008) /*!< Filter bit 3 */
+#define CAN_F8R2_FB4 ((uint32_t)0x00000010) /*!< Filter bit 4 */
+#define CAN_F8R2_FB5 ((uint32_t)0x00000020) /*!< Filter bit 5 */
+#define CAN_F8R2_FB6 ((uint32_t)0x00000040) /*!< Filter bit 6 */
+#define CAN_F8R2_FB7 ((uint32_t)0x00000080) /*!< Filter bit 7 */
+#define CAN_F8R2_FB8 ((uint32_t)0x00000100) /*!< Filter bit 8 */
+#define CAN_F8R2_FB9 ((uint32_t)0x00000200) /*!< Filter bit 9 */
+#define CAN_F8R2_FB10 ((uint32_t)0x00000400) /*!< Filter bit 10 */
+#define CAN_F8R2_FB11 ((uint32_t)0x00000800) /*!< Filter bit 11 */
+#define CAN_F8R2_FB12 ((uint32_t)0x00001000) /*!< Filter bit 12 */
+#define CAN_F8R2_FB13 ((uint32_t)0x00002000) /*!< Filter bit 13 */
+#define CAN_F8R2_FB14 ((uint32_t)0x00004000) /*!< Filter bit 14 */
+#define CAN_F8R2_FB15 ((uint32_t)0x00008000) /*!< Filter bit 15 */
+#define CAN_F8R2_FB16 ((uint32_t)0x00010000) /*!< Filter bit 16 */
+#define CAN_F8R2_FB17 ((uint32_t)0x00020000) /*!< Filter bit 17 */
+#define CAN_F8R2_FB18 ((uint32_t)0x00040000) /*!< Filter bit 18 */
+#define CAN_F8R2_FB19 ((uint32_t)0x00080000) /*!< Filter bit 19 */
+#define CAN_F8R2_FB20 ((uint32_t)0x00100000) /*!< Filter bit 20 */
+#define CAN_F8R2_FB21 ((uint32_t)0x00200000) /*!< Filter bit 21 */
+#define CAN_F8R2_FB22 ((uint32_t)0x00400000) /*!< Filter bit 22 */
+#define CAN_F8R2_FB23 ((uint32_t)0x00800000) /*!< Filter bit 23 */
+#define CAN_F8R2_FB24 ((uint32_t)0x01000000) /*!< Filter bit 24 */
+#define CAN_F8R2_FB25 ((uint32_t)0x02000000) /*!< Filter bit 25 */
+#define CAN_F8R2_FB26 ((uint32_t)0x04000000) /*!< Filter bit 26 */
+#define CAN_F8R2_FB27 ((uint32_t)0x08000000) /*!< Filter bit 27 */
+#define CAN_F8R2_FB28 ((uint32_t)0x10000000) /*!< Filter bit 28 */
+#define CAN_F8R2_FB29 ((uint32_t)0x20000000) /*!< Filter bit 29 */
+#define CAN_F8R2_FB30 ((uint32_t)0x40000000) /*!< Filter bit 30 */
+#define CAN_F8R2_FB31 ((uint32_t)0x80000000) /*!< Filter bit 31 */
+
+/******************* Bit definition for CAN_F9R2 register *******************/
+#define CAN_F9R2_FB0 ((uint32_t)0x00000001) /*!< Filter bit 0 */
+#define CAN_F9R2_FB1 ((uint32_t)0x00000002) /*!< Filter bit 1 */
+#define CAN_F9R2_FB2 ((uint32_t)0x00000004) /*!< Filter bit 2 */
+#define CAN_F9R2_FB3 ((uint32_t)0x00000008) /*!< Filter bit 3 */
+#define CAN_F9R2_FB4 ((uint32_t)0x00000010) /*!< Filter bit 4 */
+#define CAN_F9R2_FB5 ((uint32_t)0x00000020) /*!< Filter bit 5 */
+#define CAN_F9R2_FB6 ((uint32_t)0x00000040) /*!< Filter bit 6 */
+#define CAN_F9R2_FB7 ((uint32_t)0x00000080) /*!< Filter bit 7 */
+#define CAN_F9R2_FB8 ((uint32_t)0x00000100) /*!< Filter bit 8 */
+#define CAN_F9R2_FB9 ((uint32_t)0x00000200) /*!< Filter bit 9 */
+#define CAN_F9R2_FB10 ((uint32_t)0x00000400) /*!< Filter bit 10 */
+#define CAN_F9R2_FB11 ((uint32_t)0x00000800) /*!< Filter bit 11 */
+#define CAN_F9R2_FB12 ((uint32_t)0x00001000) /*!< Filter bit 12 */
+#define CAN_F9R2_FB13 ((uint32_t)0x00002000) /*!< Filter bit 13 */
+#define CAN_F9R2_FB14 ((uint32_t)0x00004000) /*!< Filter bit 14 */
+#define CAN_F9R2_FB15 ((uint32_t)0x00008000) /*!< Filter bit 15 */
+#define CAN_F9R2_FB16 ((uint32_t)0x00010000) /*!< Filter bit 16 */
+#define CAN_F9R2_FB17 ((uint32_t)0x00020000) /*!< Filter bit 17 */
+#define CAN_F9R2_FB18 ((uint32_t)0x00040000) /*!< Filter bit 18 */
+#define CAN_F9R2_FB19 ((uint32_t)0x00080000) /*!< Filter bit 19 */
+#define CAN_F9R2_FB20 ((uint32_t)0x00100000) /*!< Filter bit 20 */
+#define CAN_F9R2_FB21 ((uint32_t)0x00200000) /*!< Filter bit 21 */
+#define CAN_F9R2_FB22 ((uint32_t)0x00400000) /*!< Filter bit 22 */
+#define CAN_F9R2_FB23 ((uint32_t)0x00800000) /*!< Filter bit 23 */
+#define CAN_F9R2_FB24 ((uint32_t)0x01000000) /*!< Filter bit 24 */
+#define CAN_F9R2_FB25 ((uint32_t)0x02000000) /*!< Filter bit 25 */
+#define CAN_F9R2_FB26 ((uint32_t)0x04000000) /*!< Filter bit 26 */
+#define CAN_F9R2_FB27 ((uint32_t)0x08000000) /*!< Filter bit 27 */
+#define CAN_F9R2_FB28 ((uint32_t)0x10000000) /*!< Filter bit 28 */
+#define CAN_F9R2_FB29 ((uint32_t)0x20000000) /*!< Filter bit 29 */
+#define CAN_F9R2_FB30 ((uint32_t)0x40000000) /*!< Filter bit 30 */
+#define CAN_F9R2_FB31 ((uint32_t)0x80000000) /*!< Filter bit 31 */
+
+/******************* Bit definition for CAN_F10R2 register ******************/
+#define CAN_F10R2_FB0 ((uint32_t)0x00000001) /*!< Filter bit 0 */
+#define CAN_F10R2_FB1 ((uint32_t)0x00000002) /*!< Filter bit 1 */
+#define CAN_F10R2_FB2 ((uint32_t)0x00000004) /*!< Filter bit 2 */
+#define CAN_F10R2_FB3 ((uint32_t)0x00000008) /*!< Filter bit 3 */
+#define CAN_F10R2_FB4 ((uint32_t)0x00000010) /*!< Filter bit 4 */
+#define CAN_F10R2_FB5 ((uint32_t)0x00000020) /*!< Filter bit 5 */
+#define CAN_F10R2_FB6 ((uint32_t)0x00000040) /*!< Filter bit 6 */
+#define CAN_F10R2_FB7 ((uint32_t)0x00000080) /*!< Filter bit 7 */
+#define CAN_F10R2_FB8 ((uint32_t)0x00000100) /*!< Filter bit 8 */
+#define CAN_F10R2_FB9 ((uint32_t)0x00000200) /*!< Filter bit 9 */
+#define CAN_F10R2_FB10 ((uint32_t)0x00000400) /*!< Filter bit 10 */
+#define CAN_F10R2_FB11 ((uint32_t)0x00000800) /*!< Filter bit 11 */
+#define CAN_F10R2_FB12 ((uint32_t)0x00001000) /*!< Filter bit 12 */
+#define CAN_F10R2_FB13 ((uint32_t)0x00002000) /*!< Filter bit 13 */
+#define CAN_F10R2_FB14 ((uint32_t)0x00004000) /*!< Filter bit 14 */
+#define CAN_F10R2_FB15 ((uint32_t)0x00008000) /*!< Filter bit 15 */
+#define CAN_F10R2_FB16 ((uint32_t)0x00010000) /*!< Filter bit 16 */
+#define CAN_F10R2_FB17 ((uint32_t)0x00020000) /*!< Filter bit 17 */
+#define CAN_F10R2_FB18 ((uint32_t)0x00040000) /*!< Filter bit 18 */
+#define CAN_F10R2_FB19 ((uint32_t)0x00080000) /*!< Filter bit 19 */
+#define CAN_F10R2_FB20 ((uint32_t)0x00100000) /*!< Filter bit 20 */
+#define CAN_F10R2_FB21 ((uint32_t)0x00200000) /*!< Filter bit 21 */
+#define CAN_F10R2_FB22 ((uint32_t)0x00400000) /*!< Filter bit 22 */
+#define CAN_F10R2_FB23 ((uint32_t)0x00800000) /*!< Filter bit 23 */
+#define CAN_F10R2_FB24 ((uint32_t)0x01000000) /*!< Filter bit 24 */
+#define CAN_F10R2_FB25 ((uint32_t)0x02000000) /*!< Filter bit 25 */
+#define CAN_F10R2_FB26 ((uint32_t)0x04000000) /*!< Filter bit 26 */
+#define CAN_F10R2_FB27 ((uint32_t)0x08000000) /*!< Filter bit 27 */
+#define CAN_F10R2_FB28 ((uint32_t)0x10000000) /*!< Filter bit 28 */
+#define CAN_F10R2_FB29 ((uint32_t)0x20000000) /*!< Filter bit 29 */
+#define CAN_F10R2_FB30 ((uint32_t)0x40000000) /*!< Filter bit 30 */
+#define CAN_F10R2_FB31 ((uint32_t)0x80000000) /*!< Filter bit 31 */
+
+/******************* Bit definition for CAN_F11R2 register ******************/
+#define CAN_F11R2_FB0 ((uint32_t)0x00000001) /*!< Filter bit 0 */
+#define CAN_F11R2_FB1 ((uint32_t)0x00000002) /*!< Filter bit 1 */
+#define CAN_F11R2_FB2 ((uint32_t)0x00000004) /*!< Filter bit 2 */
+#define CAN_F11R2_FB3 ((uint32_t)0x00000008) /*!< Filter bit 3 */
+#define CAN_F11R2_FB4 ((uint32_t)0x00000010) /*!< Filter bit 4 */
+#define CAN_F11R2_FB5 ((uint32_t)0x00000020) /*!< Filter bit 5 */
+#define CAN_F11R2_FB6 ((uint32_t)0x00000040) /*!< Filter bit 6 */
+#define CAN_F11R2_FB7 ((uint32_t)0x00000080) /*!< Filter bit 7 */
+#define CAN_F11R2_FB8 ((uint32_t)0x00000100) /*!< Filter bit 8 */
+#define CAN_F11R2_FB9 ((uint32_t)0x00000200) /*!< Filter bit 9 */
+#define CAN_F11R2_FB10 ((uint32_t)0x00000400) /*!< Filter bit 10 */
+#define CAN_F11R2_FB11 ((uint32_t)0x00000800) /*!< Filter bit 11 */
+#define CAN_F11R2_FB12 ((uint32_t)0x00001000) /*!< Filter bit 12 */
+#define CAN_F11R2_FB13 ((uint32_t)0x00002000) /*!< Filter bit 13 */
+#define CAN_F11R2_FB14 ((uint32_t)0x00004000) /*!< Filter bit 14 */
+#define CAN_F11R2_FB15 ((uint32_t)0x00008000) /*!< Filter bit 15 */
+#define CAN_F11R2_FB16 ((uint32_t)0x00010000) /*!< Filter bit 16 */
+#define CAN_F11R2_FB17 ((uint32_t)0x00020000) /*!< Filter bit 17 */
+#define CAN_F11R2_FB18 ((uint32_t)0x00040000) /*!< Filter bit 18 */
+#define CAN_F11R2_FB19 ((uint32_t)0x00080000) /*!< Filter bit 19 */
+#define CAN_F11R2_FB20 ((uint32_t)0x00100000) /*!< Filter bit 20 */
+#define CAN_F11R2_FB21 ((uint32_t)0x00200000) /*!< Filter bit 21 */
+#define CAN_F11R2_FB22 ((uint32_t)0x00400000) /*!< Filter bit 22 */
+#define CAN_F11R2_FB23 ((uint32_t)0x00800000) /*!< Filter bit 23 */
+#define CAN_F11R2_FB24 ((uint32_t)0x01000000) /*!< Filter bit 24 */
+#define CAN_F11R2_FB25 ((uint32_t)0x02000000) /*!< Filter bit 25 */
+#define CAN_F11R2_FB26 ((uint32_t)0x04000000) /*!< Filter bit 26 */
+#define CAN_F11R2_FB27 ((uint32_t)0x08000000) /*!< Filter bit 27 */
+#define CAN_F11R2_FB28 ((uint32_t)0x10000000) /*!< Filter bit 28 */
+#define CAN_F11R2_FB29 ((uint32_t)0x20000000) /*!< Filter bit 29 */
+#define CAN_F11R2_FB30 ((uint32_t)0x40000000) /*!< Filter bit 30 */
+#define CAN_F11R2_FB31 ((uint32_t)0x80000000) /*!< Filter bit 31 */
+
+/******************* Bit definition for CAN_F12R2 register ******************/
+#define CAN_F12R2_FB0 ((uint32_t)0x00000001) /*!< Filter bit 0 */
+#define CAN_F12R2_FB1 ((uint32_t)0x00000002) /*!< Filter bit 1 */
+#define CAN_F12R2_FB2 ((uint32_t)0x00000004) /*!< Filter bit 2 */
+#define CAN_F12R2_FB3 ((uint32_t)0x00000008) /*!< Filter bit 3 */
+#define CAN_F12R2_FB4 ((uint32_t)0x00000010) /*!< Filter bit 4 */
+#define CAN_F12R2_FB5 ((uint32_t)0x00000020) /*!< Filter bit 5 */
+#define CAN_F12R2_FB6 ((uint32_t)0x00000040) /*!< Filter bit 6 */
+#define CAN_F12R2_FB7 ((uint32_t)0x00000080) /*!< Filter bit 7 */
+#define CAN_F12R2_FB8 ((uint32_t)0x00000100) /*!< Filter bit 8 */
+#define CAN_F12R2_FB9 ((uint32_t)0x00000200) /*!< Filter bit 9 */
+#define CAN_F12R2_FB10 ((uint32_t)0x00000400) /*!< Filter bit 10 */
+#define CAN_F12R2_FB11 ((uint32_t)0x00000800) /*!< Filter bit 11 */
+#define CAN_F12R2_FB12 ((uint32_t)0x00001000) /*!< Filter bit 12 */
+#define CAN_F12R2_FB13 ((uint32_t)0x00002000) /*!< Filter bit 13 */
+#define CAN_F12R2_FB14 ((uint32_t)0x00004000) /*!< Filter bit 14 */
+#define CAN_F12R2_FB15 ((uint32_t)0x00008000) /*!< Filter bit 15 */
+#define CAN_F12R2_FB16 ((uint32_t)0x00010000) /*!< Filter bit 16 */
+#define CAN_F12R2_FB17 ((uint32_t)0x00020000) /*!< Filter bit 17 */
+#define CAN_F12R2_FB18 ((uint32_t)0x00040000) /*!< Filter bit 18 */
+#define CAN_F12R2_FB19 ((uint32_t)0x00080000) /*!< Filter bit 19 */
+#define CAN_F12R2_FB20 ((uint32_t)0x00100000) /*!< Filter bit 20 */
+#define CAN_F12R2_FB21 ((uint32_t)0x00200000) /*!< Filter bit 21 */
+#define CAN_F12R2_FB22 ((uint32_t)0x00400000) /*!< Filter bit 22 */
+#define CAN_F12R2_FB23 ((uint32_t)0x00800000) /*!< Filter bit 23 */
+#define CAN_F12R2_FB24 ((uint32_t)0x01000000) /*!< Filter bit 24 */
+#define CAN_F12R2_FB25 ((uint32_t)0x02000000) /*!< Filter bit 25 */
+#define CAN_F12R2_FB26 ((uint32_t)0x04000000) /*!< Filter bit 26 */
+#define CAN_F12R2_FB27 ((uint32_t)0x08000000) /*!< Filter bit 27 */
+#define CAN_F12R2_FB28 ((uint32_t)0x10000000) /*!< Filter bit 28 */
+#define CAN_F12R2_FB29 ((uint32_t)0x20000000) /*!< Filter bit 29 */
+#define CAN_F12R2_FB30 ((uint32_t)0x40000000) /*!< Filter bit 30 */
+#define CAN_F12R2_FB31 ((uint32_t)0x80000000) /*!< Filter bit 31 */
+
+/******************* Bit definition for CAN_F13R2 register ******************/
+#define CAN_F13R2_FB0 ((uint32_t)0x00000001) /*!< Filter bit 0 */
+#define CAN_F13R2_FB1 ((uint32_t)0x00000002) /*!< Filter bit 1 */
+#define CAN_F13R2_FB2 ((uint32_t)0x00000004) /*!< Filter bit 2 */
+#define CAN_F13R2_FB3 ((uint32_t)0x00000008) /*!< Filter bit 3 */
+#define CAN_F13R2_FB4 ((uint32_t)0x00000010) /*!< Filter bit 4 */
+#define CAN_F13R2_FB5 ((uint32_t)0x00000020) /*!< Filter bit 5 */
+#define CAN_F13R2_FB6 ((uint32_t)0x00000040) /*!< Filter bit 6 */
+#define CAN_F13R2_FB7 ((uint32_t)0x00000080) /*!< Filter bit 7 */
+#define CAN_F13R2_FB8 ((uint32_t)0x00000100) /*!< Filter bit 8 */
+#define CAN_F13R2_FB9 ((uint32_t)0x00000200) /*!< Filter bit 9 */
+#define CAN_F13R2_FB10 ((uint32_t)0x00000400) /*!< Filter bit 10 */
+#define CAN_F13R2_FB11 ((uint32_t)0x00000800) /*!< Filter bit 11 */
+#define CAN_F13R2_FB12 ((uint32_t)0x00001000) /*!< Filter bit 12 */
+#define CAN_F13R2_FB13 ((uint32_t)0x00002000) /*!< Filter bit 13 */
+#define CAN_F13R2_FB14 ((uint32_t)0x00004000) /*!< Filter bit 14 */
+#define CAN_F13R2_FB15 ((uint32_t)0x00008000) /*!< Filter bit 15 */
+#define CAN_F13R2_FB16 ((uint32_t)0x00010000) /*!< Filter bit 16 */
+#define CAN_F13R2_FB17 ((uint32_t)0x00020000) /*!< Filter bit 17 */
+#define CAN_F13R2_FB18 ((uint32_t)0x00040000) /*!< Filter bit 18 */
+#define CAN_F13R2_FB19 ((uint32_t)0x00080000) /*!< Filter bit 19 */
+#define CAN_F13R2_FB20 ((uint32_t)0x00100000) /*!< Filter bit 20 */
+#define CAN_F13R2_FB21 ((uint32_t)0x00200000) /*!< Filter bit 21 */
+#define CAN_F13R2_FB22 ((uint32_t)0x00400000) /*!< Filter bit 22 */
+#define CAN_F13R2_FB23 ((uint32_t)0x00800000) /*!< Filter bit 23 */
+#define CAN_F13R2_FB24 ((uint32_t)0x01000000) /*!< Filter bit 24 */
+#define CAN_F13R2_FB25 ((uint32_t)0x02000000) /*!< Filter bit 25 */
+#define CAN_F13R2_FB26 ((uint32_t)0x04000000) /*!< Filter bit 26 */
+#define CAN_F13R2_FB27 ((uint32_t)0x08000000) /*!< Filter bit 27 */
+#define CAN_F13R2_FB28 ((uint32_t)0x10000000) /*!< Filter bit 28 */
+#define CAN_F13R2_FB29 ((uint32_t)0x20000000) /*!< Filter bit 29 */
+#define CAN_F13R2_FB30 ((uint32_t)0x40000000) /*!< Filter bit 30 */
+#define CAN_F13R2_FB31 ((uint32_t)0x80000000) /*!< Filter bit 31 */
+
+/******************************************************************************/
+/* */
+/* Serial Peripheral Interface */
+/* */
+/******************************************************************************/
+
+/******************* Bit definition for SPI_CR1 register ********************/
+#define SPI_CR1_CPHA ((uint16_t)0x0001) /*!< Clock Phase */
+#define SPI_CR1_CPOL ((uint16_t)0x0002) /*!< Clock Polarity */
+#define SPI_CR1_MSTR ((uint16_t)0x0004) /*!< Master Selection */
+
+#define SPI_CR1_BR ((uint16_t)0x0038) /*!< BR[2:0] bits (Baud Rate Control) */
+#define SPI_CR1_BR_0 ((uint16_t)0x0008) /*!< Bit 0 */
+#define SPI_CR1_BR_1 ((uint16_t)0x0010) /*!< Bit 1 */
+#define SPI_CR1_BR_2 ((uint16_t)0x0020) /*!< Bit 2 */
+
+#define SPI_CR1_SPE ((uint16_t)0x0040) /*!< SPI Enable */
+#define SPI_CR1_LSBFIRST ((uint16_t)0x0080) /*!< Frame Format */
+#define SPI_CR1_SSI ((uint16_t)0x0100) /*!< Internal slave select */
+#define SPI_CR1_SSM ((uint16_t)0x0200) /*!< Software slave management */
+#define SPI_CR1_RXONLY ((uint16_t)0x0400) /*!< Receive only */
+#define SPI_CR1_DFF ((uint16_t)0x0800) /*!< Data Frame Format */
+#define SPI_CR1_CRCNEXT ((uint16_t)0x1000) /*!< Transmit CRC next */
+#define SPI_CR1_CRCEN ((uint16_t)0x2000) /*!< Hardware CRC calculation enable */
+#define SPI_CR1_BIDIOE ((uint16_t)0x4000) /*!< Output enable in bidirectional mode */
+#define SPI_CR1_BIDIMODE ((uint16_t)0x8000) /*!< Bidirectional data mode enable */
+
+/******************* Bit definition for SPI_CR2 register ********************/
+#define SPI_CR2_RXDMAEN ((uint8_t)0x01) /*!< Rx Buffer DMA Enable */
+#define SPI_CR2_TXDMAEN ((uint8_t)0x02) /*!< Tx Buffer DMA Enable */
+#define SPI_CR2_SSOE ((uint8_t)0x04) /*!< SS Output Enable */
+#define SPI_CR2_ERRIE ((uint8_t)0x20) /*!< Error Interrupt Enable */
+#define SPI_CR2_RXNEIE ((uint8_t)0x40) /*!< RX buffer Not Empty Interrupt Enable */
+#define SPI_CR2_TXEIE ((uint8_t)0x80) /*!< Tx buffer Empty Interrupt Enable */
+
+/******************** Bit definition for SPI_SR register ********************/
+#define SPI_SR_RXNE ((uint8_t)0x01) /*!< Receive buffer Not Empty */
+#define SPI_SR_TXE ((uint8_t)0x02) /*!< Transmit buffer Empty */
+#define SPI_SR_CHSIDE ((uint8_t)0x04) /*!< Channel side */
+#define SPI_SR_UDR ((uint8_t)0x08) /*!< Underrun flag */
+#define SPI_SR_CRCERR ((uint8_t)0x10) /*!< CRC Error flag */
+#define SPI_SR_MODF ((uint8_t)0x20) /*!< Mode fault */
+#define SPI_SR_OVR ((uint8_t)0x40) /*!< Overrun flag */
+#define SPI_SR_BSY ((uint8_t)0x80) /*!< Busy flag */
+
+/******************** Bit definition for SPI_DR register ********************/
+#define SPI_DR_DR ((uint16_t)0xFFFF) /*!< Data Register */
+
+/******************* Bit definition for SPI_CRCPR register ******************/
+#define SPI_CRCPR_CRCPOLY ((uint16_t)0xFFFF) /*!< CRC polynomial register */
+
+/****************** Bit definition for SPI_RXCRCR register ******************/
+#define SPI_RXCRCR_RXCRC ((uint16_t)0xFFFF) /*!< Rx CRC Register */
+
+/****************** Bit definition for SPI_TXCRCR register ******************/
+#define SPI_TXCRCR_TXCRC ((uint16_t)0xFFFF) /*!< Tx CRC Register */
+
+/****************** Bit definition for SPI_I2SCFGR register *****************/
+#define SPI_I2SCFGR_CHLEN ((uint16_t)0x0001) /*!< Channel length (number of bits per audio channel) */
+
+#define SPI_I2SCFGR_DATLEN ((uint16_t)0x0006) /*!< DATLEN[1:0] bits (Data length to be transferred) */
+#define SPI_I2SCFGR_DATLEN_0 ((uint16_t)0x0002) /*!< Bit 0 */
+#define SPI_I2SCFGR_DATLEN_1 ((uint16_t)0x0004) /*!< Bit 1 */
+
+#define SPI_I2SCFGR_CKPOL ((uint16_t)0x0008) /*!< steady state clock polarity */
+
+#define SPI_I2SCFGR_I2SSTD ((uint16_t)0x0030) /*!< I2SSTD[1:0] bits (I2S standard selection) */
+#define SPI_I2SCFGR_I2SSTD_0 ((uint16_t)0x0010) /*!< Bit 0 */
+#define SPI_I2SCFGR_I2SSTD_1 ((uint16_t)0x0020) /*!< Bit 1 */
+
+#define SPI_I2SCFGR_PCMSYNC ((uint16_t)0x0080) /*!< PCM frame synchronization */
+
+#define SPI_I2SCFGR_I2SCFG ((uint16_t)0x0300) /*!< I2SCFG[1:0] bits (I2S configuration mode) */
+#define SPI_I2SCFGR_I2SCFG_0 ((uint16_t)0x0100) /*!< Bit 0 */
+#define SPI_I2SCFGR_I2SCFG_1 ((uint16_t)0x0200) /*!< Bit 1 */
+
+#define SPI_I2SCFGR_I2SE ((uint16_t)0x0400) /*!< I2S Enable */
+#define SPI_I2SCFGR_I2SMOD ((uint16_t)0x0800) /*!< I2S mode selection */
+
+/****************** Bit definition for SPI_I2SPR register *******************/
+#define SPI_I2SPR_I2SDIV ((uint16_t)0x00FF) /*!< I2S Linear prescaler */
+#define SPI_I2SPR_ODD ((uint16_t)0x0100) /*!< Odd factor for the prescaler */
+#define SPI_I2SPR_MCKOE ((uint16_t)0x0200) /*!< Master Clock Output Enable */
+
+/******************************************************************************/
+/* */
+/* Inter-integrated Circuit Interface */
+/* */
+/******************************************************************************/
+
+/******************* Bit definition for I2C_CR1 register ********************/
+#define I2C_CR1_PE ((uint16_t)0x0001) /*!< Peripheral Enable */
+#define I2C_CR1_SMBUS ((uint16_t)0x0002) /*!< SMBus Mode */
+#define I2C_CR1_SMBTYPE ((uint16_t)0x0008) /*!< SMBus Type */
+#define I2C_CR1_ENARP ((uint16_t)0x0010) /*!< ARP Enable */
+#define I2C_CR1_ENPEC ((uint16_t)0x0020) /*!< PEC Enable */
+#define I2C_CR1_ENGC ((uint16_t)0x0040) /*!< General Call Enable */
+#define I2C_CR1_NOSTRETCH ((uint16_t)0x0080) /*!< Clock Stretching Disable (Slave mode) */
+#define I2C_CR1_START ((uint16_t)0x0100) /*!< Start Generation */
+#define I2C_CR1_STOP ((uint16_t)0x0200) /*!< Stop Generation */
+#define I2C_CR1_ACK ((uint16_t)0x0400) /*!< Acknowledge Enable */
+#define I2C_CR1_POS ((uint16_t)0x0800) /*!< Acknowledge/PEC Position (for data reception) */
+#define I2C_CR1_PEC ((uint16_t)0x1000) /*!< Packet Error Checking */
+#define I2C_CR1_ALERT ((uint16_t)0x2000) /*!< SMBus Alert */
+#define I2C_CR1_SWRST ((uint16_t)0x8000) /*!< Software Reset */
+
+/******************* Bit definition for I2C_CR2 register ********************/
+#define I2C_CR2_FREQ ((uint16_t)0x003F) /*!< FREQ[5:0] bits (Peripheral Clock Frequency) */
+#define I2C_CR2_FREQ_0 ((uint16_t)0x0001) /*!< Bit 0 */
+#define I2C_CR2_FREQ_1 ((uint16_t)0x0002) /*!< Bit 1 */
+#define I2C_CR2_FREQ_2 ((uint16_t)0x0004) /*!< Bit 2 */
+#define I2C_CR2_FREQ_3 ((uint16_t)0x0008) /*!< Bit 3 */
+#define I2C_CR2_FREQ_4 ((uint16_t)0x0010) /*!< Bit 4 */
+#define I2C_CR2_FREQ_5 ((uint16_t)0x0020) /*!< Bit 5 */
+
+#define I2C_CR2_ITERREN ((uint16_t)0x0100) /*!< Error Interrupt Enable */
+#define I2C_CR2_ITEVTEN ((uint16_t)0x0200) /*!< Event Interrupt Enable */
+#define I2C_CR2_ITBUFEN ((uint16_t)0x0400) /*!< Buffer Interrupt Enable */
+#define I2C_CR2_DMAEN ((uint16_t)0x0800) /*!< DMA Requests Enable */
+#define I2C_CR2_LAST ((uint16_t)0x1000) /*!< DMA Last Transfer */
+
+/******************* Bit definition for I2C_OAR1 register *******************/
+#define I2C_OAR1_ADD1_7 ((uint16_t)0x00FE) /*!< Interface Address */
+#define I2C_OAR1_ADD8_9 ((uint16_t)0x0300) /*!< Interface Address */
+
+#define I2C_OAR1_ADD0 ((uint16_t)0x0001) /*!< Bit 0 */
+#define I2C_OAR1_ADD1 ((uint16_t)0x0002) /*!< Bit 1 */
+#define I2C_OAR1_ADD2 ((uint16_t)0x0004) /*!< Bit 2 */
+#define I2C_OAR1_ADD3 ((uint16_t)0x0008) /*!< Bit 3 */
+#define I2C_OAR1_ADD4 ((uint16_t)0x0010) /*!< Bit 4 */
+#define I2C_OAR1_ADD5 ((uint16_t)0x0020) /*!< Bit 5 */
+#define I2C_OAR1_ADD6 ((uint16_t)0x0040) /*!< Bit 6 */
+#define I2C_OAR1_ADD7 ((uint16_t)0x0080) /*!< Bit 7 */
+#define I2C_OAR1_ADD8 ((uint16_t)0x0100) /*!< Bit 8 */
+#define I2C_OAR1_ADD9 ((uint16_t)0x0200) /*!< Bit 9 */
+
+#define I2C_OAR1_ADDMODE ((uint16_t)0x8000) /*!< Addressing Mode (Slave mode) */
+
+/******************* Bit definition for I2C_OAR2 register *******************/
+#define I2C_OAR2_ENDUAL ((uint8_t)0x01) /*!< Dual addressing mode enable */
+#define I2C_OAR2_ADD2 ((uint8_t)0xFE) /*!< Interface address */
+
+/******************** Bit definition for I2C_DR register ********************/
+#define I2C_DR_DR ((uint8_t)0xFF) /*!< 8-bit Data Register */
+
+/******************* Bit definition for I2C_SR1 register ********************/
+#define I2C_SR1_SB ((uint16_t)0x0001) /*!< Start Bit (Master mode) */
+#define I2C_SR1_ADDR ((uint16_t)0x0002) /*!< Address sent (master mode)/matched (slave mode) */
+#define I2C_SR1_BTF ((uint16_t)0x0004) /*!< Byte Transfer Finished */
+#define I2C_SR1_ADD10 ((uint16_t)0x0008) /*!< 10-bit header sent (Master mode) */
+#define I2C_SR1_STOPF ((uint16_t)0x0010) /*!< Stop detection (Slave mode) */
+#define I2C_SR1_RXNE ((uint16_t)0x0040) /*!< Data Register not Empty (receivers) */
+#define I2C_SR1_TXE ((uint16_t)0x0080) /*!< Data Register Empty (transmitters) */
+#define I2C_SR1_BERR ((uint16_t)0x0100) /*!< Bus Error */
+#define I2C_SR1_ARLO ((uint16_t)0x0200) /*!< Arbitration Lost (master mode) */
+#define I2C_SR1_AF ((uint16_t)0x0400) /*!< Acknowledge Failure */
+#define I2C_SR1_OVR ((uint16_t)0x0800) /*!< Overrun/Underrun */
+#define I2C_SR1_PECERR ((uint16_t)0x1000) /*!< PEC Error in reception */
+#define I2C_SR1_TIMEOUT ((uint16_t)0x4000) /*!< Timeout or Tlow Error */
+#define I2C_SR1_SMBALERT ((uint16_t)0x8000) /*!< SMBus Alert */
+
+/******************* Bit definition for I2C_SR2 register ********************/
+#define I2C_SR2_MSL ((uint16_t)0x0001) /*!< Master/Slave */
+#define I2C_SR2_BUSY ((uint16_t)0x0002) /*!< Bus Busy */
+#define I2C_SR2_TRA ((uint16_t)0x0004) /*!< Transmitter/Receiver */
+#define I2C_SR2_GENCALL ((uint16_t)0x0010) /*!< General Call Address (Slave mode) */
+#define I2C_SR2_SMBDEFAULT ((uint16_t)0x0020) /*!< SMBus Device Default Address (Slave mode) */
+#define I2C_SR2_SMBHOST ((uint16_t)0x0040) /*!< SMBus Host Header (Slave mode) */
+#define I2C_SR2_DUALF ((uint16_t)0x0080) /*!< Dual Flag (Slave mode) */
+#define I2C_SR2_PEC ((uint16_t)0xFF00) /*!< Packet Error Checking Register */
+
+/******************* Bit definition for I2C_CCR register ********************/
+#define I2C_CCR_CCR ((uint16_t)0x0FFF) /*!< Clock Control Register in Fast/Standard mode (Master mode) */
+#define I2C_CCR_DUTY ((uint16_t)0x4000) /*!< Fast Mode Duty Cycle */
+#define I2C_CCR_FS ((uint16_t)0x8000) /*!< I2C Master Mode Selection */
+
+/****************** Bit definition for I2C_TRISE register *******************/
+#define I2C_TRISE_TRISE ((uint8_t)0x3F) /*!< Maximum Rise Time in Fast/Standard mode (Master mode) */
+
+/******************************************************************************/
+/* */
+/* Universal Synchronous Asynchronous Receiver Transmitter */
+/* */
+/******************************************************************************/
+
+/******************* Bit definition for USART_SR register *******************/
+#define USART_SR_PE ((uint16_t)0x0001) /*!< Parity Error */
+#define USART_SR_FE ((uint16_t)0x0002) /*!< Framing Error */
+#define USART_SR_NE ((uint16_t)0x0004) /*!< Noise Error Flag */
+#define USART_SR_ORE ((uint16_t)0x0008) /*!< OverRun Error */
+#define USART_SR_IDLE ((uint16_t)0x0010) /*!< IDLE line detected */
+#define USART_SR_RXNE ((uint16_t)0x0020) /*!< Read Data Register Not Empty */
+#define USART_SR_TC ((uint16_t)0x0040) /*!< Transmission Complete */
+#define USART_SR_TXE ((uint16_t)0x0080) /*!< Transmit Data Register Empty */
+#define USART_SR_LBD ((uint16_t)0x0100) /*!< LIN Break Detection Flag */
+#define USART_SR_CTS ((uint16_t)0x0200) /*!< CTS Flag */
+
+/******************* Bit definition for USART_DR register *******************/
+#define USART_DR_DR ((uint16_t)0x01FF) /*!< Data value */
+
+/****************** Bit definition for USART_BRR register *******************/
+#define USART_BRR_DIV_Fraction ((uint16_t)0x000F) /*!< Fraction of USARTDIV */
+#define USART_BRR_DIV_Mantissa ((uint16_t)0xFFF0) /*!< Mantissa of USARTDIV */
+
+/****************** Bit definition for USART_CR1 register *******************/
+#define USART_CR1_SBK ((uint16_t)0x0001) /*!< Send Break */
+#define USART_CR1_RWU ((uint16_t)0x0002) /*!< Receiver wakeup */
+#define USART_CR1_RE ((uint16_t)0x0004) /*!< Receiver Enable */
+#define USART_CR1_TE ((uint16_t)0x0008) /*!< Transmitter Enable */
+#define USART_CR1_IDLEIE ((uint16_t)0x0010) /*!< IDLE Interrupt Enable */
+#define USART_CR1_RXNEIE ((uint16_t)0x0020) /*!< RXNE Interrupt Enable */
+#define USART_CR1_TCIE ((uint16_t)0x0040) /*!< Transmission Complete Interrupt Enable */
+#define USART_CR1_TXEIE ((uint16_t)0x0080) /*!< PE Interrupt Enable */
+#define USART_CR1_PEIE ((uint16_t)0x0100) /*!< PE Interrupt Enable */
+#define USART_CR1_PS ((uint16_t)0x0200) /*!< Parity Selection */
+#define USART_CR1_PCE ((uint16_t)0x0400) /*!< Parity Control Enable */
+#define USART_CR1_WAKE ((uint16_t)0x0800) /*!< Wakeup method */
+#define USART_CR1_M ((uint16_t)0x1000) /*!< Word length */
+#define USART_CR1_UE ((uint16_t)0x2000) /*!< USART Enable */
+#define USART_CR1_OVER8 ((uint16_t)0x8000) /*!< USART Oversmapling 8-bits */
+
+/****************** Bit definition for USART_CR2 register *******************/
+#define USART_CR2_ADD ((uint16_t)0x000F) /*!< Address of the USART node */
+#define USART_CR2_LBDL ((uint16_t)0x0020) /*!< LIN Break Detection Length */
+#define USART_CR2_LBDIE ((uint16_t)0x0040) /*!< LIN Break Detection Interrupt Enable */
+#define USART_CR2_LBCL ((uint16_t)0x0100) /*!< Last Bit Clock pulse */
+#define USART_CR2_CPHA ((uint16_t)0x0200) /*!< Clock Phase */
+#define USART_CR2_CPOL ((uint16_t)0x0400) /*!< Clock Polarity */
+#define USART_CR2_CLKEN ((uint16_t)0x0800) /*!< Clock Enable */
+
+#define USART_CR2_STOP ((uint16_t)0x3000) /*!< STOP[1:0] bits (STOP bits) */
+#define USART_CR2_STOP_0 ((uint16_t)0x1000) /*!< Bit 0 */
+#define USART_CR2_STOP_1 ((uint16_t)0x2000) /*!< Bit 1 */
+
+#define USART_CR2_LINEN ((uint16_t)0x4000) /*!< LIN mode enable */
+
+/****************** Bit definition for USART_CR3 register *******************/
+#define USART_CR3_EIE ((uint16_t)0x0001) /*!< Error Interrupt Enable */
+#define USART_CR3_IREN ((uint16_t)0x0002) /*!< IrDA mode Enable */
+#define USART_CR3_IRLP ((uint16_t)0x0004) /*!< IrDA Low-Power */
+#define USART_CR3_HDSEL ((uint16_t)0x0008) /*!< Half-Duplex Selection */
+#define USART_CR3_NACK ((uint16_t)0x0010) /*!< Smartcard NACK enable */
+#define USART_CR3_SCEN ((uint16_t)0x0020) /*!< Smartcard mode enable */
+#define USART_CR3_DMAR ((uint16_t)0x0040) /*!< DMA Enable Receiver */
+#define USART_CR3_DMAT ((uint16_t)0x0080) /*!< DMA Enable Transmitter */
+#define USART_CR3_RTSE ((uint16_t)0x0100) /*!< RTS Enable */
+#define USART_CR3_CTSE ((uint16_t)0x0200) /*!< CTS Enable */
+#define USART_CR3_CTSIE ((uint16_t)0x0400) /*!< CTS Interrupt Enable */
+#define USART_CR3_ONEBIT ((uint16_t)0x0800) /*!< One Bit method */
+
+/****************** Bit definition for USART_GTPR register ******************/
+#define USART_GTPR_PSC ((uint16_t)0x00FF) /*!< PSC[7:0] bits (Prescaler value) */
+#define USART_GTPR_PSC_0 ((uint16_t)0x0001) /*!< Bit 0 */
+#define USART_GTPR_PSC_1 ((uint16_t)0x0002) /*!< Bit 1 */
+#define USART_GTPR_PSC_2 ((uint16_t)0x0004) /*!< Bit 2 */
+#define USART_GTPR_PSC_3 ((uint16_t)0x0008) /*!< Bit 3 */
+#define USART_GTPR_PSC_4 ((uint16_t)0x0010) /*!< Bit 4 */
+#define USART_GTPR_PSC_5 ((uint16_t)0x0020) /*!< Bit 5 */
+#define USART_GTPR_PSC_6 ((uint16_t)0x0040) /*!< Bit 6 */
+#define USART_GTPR_PSC_7 ((uint16_t)0x0080) /*!< Bit 7 */
+
+#define USART_GTPR_GT ((uint16_t)0xFF00) /*!< Guard time value */
+
+/******************************************************************************/
+/* */
+/* Debug MCU */
+/* */
+/******************************************************************************/
+
+/**************** Bit definition for DBGMCU_IDCODE register *****************/
+#define DBGMCU_IDCODE_DEV_ID ((uint32_t)0x00000FFF) /*!< Device Identifier */
+
+#define DBGMCU_IDCODE_REV_ID ((uint32_t)0xFFFF0000) /*!< REV_ID[15:0] bits (Revision Identifier) */
+#define DBGMCU_IDCODE_REV_ID_0 ((uint32_t)0x00010000) /*!< Bit 0 */
+#define DBGMCU_IDCODE_REV_ID_1 ((uint32_t)0x00020000) /*!< Bit 1 */
+#define DBGMCU_IDCODE_REV_ID_2 ((uint32_t)0x00040000) /*!< Bit 2 */
+#define DBGMCU_IDCODE_REV_ID_3 ((uint32_t)0x00080000) /*!< Bit 3 */
+#define DBGMCU_IDCODE_REV_ID_4 ((uint32_t)0x00100000) /*!< Bit 4 */
+#define DBGMCU_IDCODE_REV_ID_5 ((uint32_t)0x00200000) /*!< Bit 5 */
+#define DBGMCU_IDCODE_REV_ID_6 ((uint32_t)0x00400000) /*!< Bit 6 */
+#define DBGMCU_IDCODE_REV_ID_7 ((uint32_t)0x00800000) /*!< Bit 7 */
+#define DBGMCU_IDCODE_REV_ID_8 ((uint32_t)0x01000000) /*!< Bit 8 */
+#define DBGMCU_IDCODE_REV_ID_9 ((uint32_t)0x02000000) /*!< Bit 9 */
+#define DBGMCU_IDCODE_REV_ID_10 ((uint32_t)0x04000000) /*!< Bit 10 */
+#define DBGMCU_IDCODE_REV_ID_11 ((uint32_t)0x08000000) /*!< Bit 11 */
+#define DBGMCU_IDCODE_REV_ID_12 ((uint32_t)0x10000000) /*!< Bit 12 */
+#define DBGMCU_IDCODE_REV_ID_13 ((uint32_t)0x20000000) /*!< Bit 13 */
+#define DBGMCU_IDCODE_REV_ID_14 ((uint32_t)0x40000000) /*!< Bit 14 */
+#define DBGMCU_IDCODE_REV_ID_15 ((uint32_t)0x80000000) /*!< Bit 15 */
+
+/****************** Bit definition for DBGMCU_CR register *******************/
+#define DBGMCU_CR_DBG_SLEEP ((uint32_t)0x00000001) /*!< Debug Sleep Mode */
+#define DBGMCU_CR_DBG_STOP ((uint32_t)0x00000002) /*!< Debug Stop Mode */
+#define DBGMCU_CR_DBG_STANDBY ((uint32_t)0x00000004) /*!< Debug Standby mode */
+#define DBGMCU_CR_TRACE_IOEN ((uint32_t)0x00000020) /*!< Trace Pin Assignment Control */
+
+#define DBGMCU_CR_TRACE_MODE ((uint32_t)0x000000C0) /*!< TRACE_MODE[1:0] bits (Trace Pin Assignment Control) */
+#define DBGMCU_CR_TRACE_MODE_0 ((uint32_t)0x00000040) /*!< Bit 0 */
+#define DBGMCU_CR_TRACE_MODE_1 ((uint32_t)0x00000080) /*!< Bit 1 */
+
+#define DBGMCU_CR_DBG_IWDG_STOP ((uint32_t)0x00000100) /*!< Debug Independent Watchdog stopped when Core is halted */
+#define DBGMCU_CR_DBG_WWDG_STOP ((uint32_t)0x00000200) /*!< Debug Window Watchdog stopped when Core is halted */
+#define DBGMCU_CR_DBG_TIM1_STOP ((uint32_t)0x00000400) /*!< TIM1 counter stopped when core is halted */
+#define DBGMCU_CR_DBG_TIM2_STOP ((uint32_t)0x00000800) /*!< TIM2 counter stopped when core is halted */
+#define DBGMCU_CR_DBG_TIM3_STOP ((uint32_t)0x00001000) /*!< TIM3 counter stopped when core is halted */
+#define DBGMCU_CR_DBG_TIM4_STOP ((uint32_t)0x00002000) /*!< TIM4 counter stopped when core is halted */
+#define DBGMCU_CR_DBG_CAN1_STOP ((uint32_t)0x00004000) /*!< Debug CAN1 stopped when Core is halted */
+#define DBGMCU_CR_DBG_I2C1_SMBUS_TIMEOUT ((uint32_t)0x00008000) /*!< SMBUS timeout mode stopped when Core is halted */
+#define DBGMCU_CR_DBG_I2C2_SMBUS_TIMEOUT ((uint32_t)0x00010000) /*!< SMBUS timeout mode stopped when Core is halted */
+#define DBGMCU_CR_DBG_TIM8_STOP ((uint32_t)0x00020000) /*!< TIM8 counter stopped when core is halted */
+#define DBGMCU_CR_DBG_TIM5_STOP ((uint32_t)0x00040000) /*!< TIM5 counter stopped when core is halted */
+#define DBGMCU_CR_DBG_TIM6_STOP ((uint32_t)0x00080000) /*!< TIM6 counter stopped when core is halted */
+#define DBGMCU_CR_DBG_TIM7_STOP ((uint32_t)0x00100000) /*!< TIM7 counter stopped when core is halted */
+#define DBGMCU_CR_DBG_CAN2_STOP ((uint32_t)0x00200000) /*!< Debug CAN2 stopped when Core is halted */
+#define DBGMCU_CR_DBG_TIM15_STOP ((uint32_t)0x00400000) /*!< Debug TIM15 stopped when Core is halted */
+#define DBGMCU_CR_DBG_TIM16_STOP ((uint32_t)0x00800000) /*!< Debug TIM16 stopped when Core is halted */
+#define DBGMCU_CR_DBG_TIM17_STOP ((uint32_t)0x01000000) /*!< Debug TIM17 stopped when Core is halted */
+#define DBGMCU_CR_DBG_TIM12_STOP ((uint32_t)0x02000000) /*!< Debug TIM12 stopped when Core is halted */
+#define DBGMCU_CR_DBG_TIM13_STOP ((uint32_t)0x04000000) /*!< Debug TIM13 stopped when Core is halted */
+#define DBGMCU_CR_DBG_TIM14_STOP ((uint32_t)0x08000000) /*!< Debug TIM14 stopped when Core is halted */
+#define DBGMCU_CR_DBG_TIM9_STOP ((uint32_t)0x10000000) /*!< Debug TIM9 stopped when Core is halted */
+#define DBGMCU_CR_DBG_TIM10_STOP ((uint32_t)0x20000000) /*!< Debug TIM10 stopped when Core is halted */
+#define DBGMCU_CR_DBG_TIM11_STOP ((uint32_t)0x40000000) /*!< Debug TIM11 stopped when Core is halted */
+
+/******************************************************************************/
+/* */
+/* FLASH and Option Bytes Registers */
+/* */
+/******************************************************************************/
+
+/******************* Bit definition for FLASH_ACR register ******************/
+#define FLASH_ACR_LATENCY ((uint8_t)0x03) /*!< LATENCY[2:0] bits (Latency) */
+#define FLASH_ACR_LATENCY_0 ((uint8_t)0x00) /*!< Bit 0 */
+#define FLASH_ACR_LATENCY_1 ((uint8_t)0x01) /*!< Bit 0 */
+#define FLASH_ACR_LATENCY_2 ((uint8_t)0x02) /*!< Bit 1 */
+
+#define FLASH_ACR_HLFCYA ((uint8_t)0x08) /*!< Flash Half Cycle Access Enable */
+#define FLASH_ACR_PRFTBE ((uint8_t)0x10) /*!< Prefetch Buffer Enable */
+#define FLASH_ACR_PRFTBS ((uint8_t)0x20) /*!< Prefetch Buffer Status */
+
+/****************** Bit definition for FLASH_KEYR register ******************/
+#define FLASH_KEYR_FKEYR ((uint32_t)0xFFFFFFFF) /*!< FPEC Key */
+
+/***************** Bit definition for FLASH_OPTKEYR register ****************/
+#define FLASH_OPTKEYR_OPTKEYR ((uint32_t)0xFFFFFFFF) /*!< Option Byte Key */
+
+/****************** Bit definition for FLASH_SR register *******************/
+#define FLASH_SR_BSY ((uint8_t)0x01) /*!< Busy */
+#define FLASH_SR_PGERR ((uint8_t)0x04) /*!< Programming Error */
+#define FLASH_SR_WRPRTERR ((uint8_t)0x10) /*!< Write Protection Error */
+#define FLASH_SR_EOP ((uint8_t)0x20) /*!< End of operation */
+
+/******************* Bit definition for FLASH_CR register *******************/
+#define FLASH_CR_PG ((uint16_t)0x0001) /*!< Programming */
+#define FLASH_CR_PER ((uint16_t)0x0002) /*!< Page Erase */
+#define FLASH_CR_MER ((uint16_t)0x0004) /*!< Mass Erase */
+#define FLASH_CR_OPTPG ((uint16_t)0x0010) /*!< Option Byte Programming */
+#define FLASH_CR_OPTER ((uint16_t)0x0020) /*!< Option Byte Erase */
+#define FLASH_CR_STRT ((uint16_t)0x0040) /*!< Start */
+#define FLASH_CR_LOCK ((uint16_t)0x0080) /*!< Lock */
+#define FLASH_CR_OPTWRE ((uint16_t)0x0200) /*!< Option Bytes Write Enable */
+#define FLASH_CR_ERRIE ((uint16_t)0x0400) /*!< Error Interrupt Enable */
+#define FLASH_CR_EOPIE ((uint16_t)0x1000) /*!< End of operation interrupt enable */
+
+/******************* Bit definition for FLASH_AR register *******************/
+#define FLASH_AR_FAR ((uint32_t)0xFFFFFFFF) /*!< Flash Address */
+
+/****************** Bit definition for FLASH_OBR register *******************/
+#define FLASH_OBR_OPTERR ((uint16_t)0x0001) /*!< Option Byte Error */
+#define FLASH_OBR_RDPRT ((uint16_t)0x0002) /*!< Read protection */
+
+#define FLASH_OBR_USER ((uint16_t)0x03FC) /*!< User Option Bytes */
+#define FLASH_OBR_WDG_SW ((uint16_t)0x0004) /*!< WDG_SW */
+#define FLASH_OBR_nRST_STOP ((uint16_t)0x0008) /*!< nRST_STOP */
+#define FLASH_OBR_nRST_STDBY ((uint16_t)0x0010) /*!< nRST_STDBY */
+#define FLASH_OBR_BFB2 ((uint16_t)0x0020) /*!< BFB2 */
+
+/****************** Bit definition for FLASH_WRPR register ******************/
+#define FLASH_WRPR_WRP ((uint32_t)0xFFFFFFFF) /*!< Write Protect */
+
+/*----------------------------------------------------------------------------*/
+
+/****************** Bit definition for FLASH_RDP register *******************/
+#define FLASH_RDP_RDP ((uint32_t)0x000000FF) /*!< Read protection option byte */
+#define FLASH_RDP_nRDP ((uint32_t)0x0000FF00) /*!< Read protection complemented option byte */
+
+/****************** Bit definition for FLASH_USER register ******************/
+#define FLASH_USER_USER ((uint32_t)0x00FF0000) /*!< User option byte */
+#define FLASH_USER_nUSER ((uint32_t)0xFF000000) /*!< User complemented option byte */
+
+/****************** Bit definition for FLASH_Data0 register *****************/
+#define FLASH_Data0_Data0 ((uint32_t)0x000000FF) /*!< User data storage option byte */
+#define FLASH_Data0_nData0 ((uint32_t)0x0000FF00) /*!< User data storage complemented option byte */
+
+/****************** Bit definition for FLASH_Data1 register *****************/
+#define FLASH_Data1_Data1 ((uint32_t)0x00FF0000) /*!< User data storage option byte */
+#define FLASH_Data1_nData1 ((uint32_t)0xFF000000) /*!< User data storage complemented option byte */
+
+/****************** Bit definition for FLASH_WRP0 register ******************/
+#define FLASH_WRP0_WRP0 ((uint32_t)0x000000FF) /*!< Flash memory write protection option bytes */
+#define FLASH_WRP0_nWRP0 ((uint32_t)0x0000FF00) /*!< Flash memory write protection complemented option bytes */
+
+/****************** Bit definition for FLASH_WRP1 register ******************/
+#define FLASH_WRP1_WRP1 ((uint32_t)0x00FF0000) /*!< Flash memory write protection option bytes */
+#define FLASH_WRP1_nWRP1 ((uint32_t)0xFF000000) /*!< Flash memory write protection complemented option bytes */
+
+/****************** Bit definition for FLASH_WRP2 register ******************/
+#define FLASH_WRP2_WRP2 ((uint32_t)0x000000FF) /*!< Flash memory write protection option bytes */
+#define FLASH_WRP2_nWRP2 ((uint32_t)0x0000FF00) /*!< Flash memory write protection complemented option bytes */
+
+/****************** Bit definition for FLASH_WRP3 register ******************/
+#define FLASH_WRP3_WRP3 ((uint32_t)0x00FF0000) /*!< Flash memory write protection option bytes */
+#define FLASH_WRP3_nWRP3 ((uint32_t)0xFF000000) /*!< Flash memory write protection complemented option bytes */
+
+#ifdef STM32F10X_CL
+/******************************************************************************/
+/* Ethernet MAC Registers bits definitions */
+/******************************************************************************/
+/* Bit definition for Ethernet MAC Control Register register */
+#define ETH_MACCR_WD ((uint32_t)0x00800000) /* Watchdog disable */
+#define ETH_MACCR_JD ((uint32_t)0x00400000) /* Jabber disable */
+#define ETH_MACCR_IFG ((uint32_t)0x000E0000) /* Inter-frame gap */
+ #define ETH_MACCR_IFG_96Bit ((uint32_t)0x00000000) /* Minimum IFG between frames during transmission is 96Bit */
+ #define ETH_MACCR_IFG_88Bit ((uint32_t)0x00020000) /* Minimum IFG between frames during transmission is 88Bit */
+ #define ETH_MACCR_IFG_80Bit ((uint32_t)0x00040000) /* Minimum IFG between frames during transmission is 80Bit */
+ #define ETH_MACCR_IFG_72Bit ((uint32_t)0x00060000) /* Minimum IFG between frames during transmission is 72Bit */
+ #define ETH_MACCR_IFG_64Bit ((uint32_t)0x00080000) /* Minimum IFG between frames during transmission is 64Bit */
+ #define ETH_MACCR_IFG_56Bit ((uint32_t)0x000A0000) /* Minimum IFG between frames during transmission is 56Bit */
+ #define ETH_MACCR_IFG_48Bit ((uint32_t)0x000C0000) /* Minimum IFG between frames during transmission is 48Bit */
+ #define ETH_MACCR_IFG_40Bit ((uint32_t)0x000E0000) /* Minimum IFG between frames during transmission is 40Bit */
+#define ETH_MACCR_CSD ((uint32_t)0x00010000) /* Carrier sense disable (during transmission) */
+#define ETH_MACCR_FES ((uint32_t)0x00004000) /* Fast ethernet speed */
+#define ETH_MACCR_ROD ((uint32_t)0x00002000) /* Receive own disable */
+#define ETH_MACCR_LM ((uint32_t)0x00001000) /* loopback mode */
+#define ETH_MACCR_DM ((uint32_t)0x00000800) /* Duplex mode */
+#define ETH_MACCR_IPCO ((uint32_t)0x00000400) /* IP Checksum offload */
+#define ETH_MACCR_RD ((uint32_t)0x00000200) /* Retry disable */
+#define ETH_MACCR_APCS ((uint32_t)0x00000080) /* Automatic Pad/CRC stripping */
+#define ETH_MACCR_BL ((uint32_t)0x00000060) /* Back-off limit: random integer number (r) of slot time delays before rescheduling
+ a transmission attempt during retries after a collision: 0 =< r <2^k */
+ #define ETH_MACCR_BL_10 ((uint32_t)0x00000000) /* k = min (n, 10) */
+ #define ETH_MACCR_BL_8 ((uint32_t)0x00000020) /* k = min (n, 8) */
+ #define ETH_MACCR_BL_4 ((uint32_t)0x00000040) /* k = min (n, 4) */
+ #define ETH_MACCR_BL_1 ((uint32_t)0x00000060) /* k = min (n, 1) */
+#define ETH_MACCR_DC ((uint32_t)0x00000010) /* Defferal check */
+#define ETH_MACCR_TE ((uint32_t)0x00000008) /* Transmitter enable */
+#define ETH_MACCR_RE ((uint32_t)0x00000004) /* Receiver enable */
+
+/* Bit definition for Ethernet MAC Frame Filter Register */
+#define ETH_MACFFR_RA ((uint32_t)0x80000000) /* Receive all */
+#define ETH_MACFFR_HPF ((uint32_t)0x00000400) /* Hash or perfect filter */
+#define ETH_MACFFR_SAF ((uint32_t)0x00000200) /* Source address filter enable */
+#define ETH_MACFFR_SAIF ((uint32_t)0x00000100) /* SA inverse filtering */
+#define ETH_MACFFR_PCF ((uint32_t)0x000000C0) /* Pass control frames: 3 cases */
+ #define ETH_MACFFR_PCF_BlockAll ((uint32_t)0x00000040) /* MAC filters all control frames from reaching the application */
+ #define ETH_MACFFR_PCF_ForwardAll ((uint32_t)0x00000080) /* MAC forwards all control frames to application even if they fail the Address Filter */
+ #define ETH_MACFFR_PCF_ForwardPassedAddrFilter ((uint32_t)0x000000C0) /* MAC forwards control frames that pass the Address Filter. */
+#define ETH_MACFFR_BFD ((uint32_t)0x00000020) /* Broadcast frame disable */
+#define ETH_MACFFR_PAM ((uint32_t)0x00000010) /* Pass all mutlicast */
+#define ETH_MACFFR_DAIF ((uint32_t)0x00000008) /* DA Inverse filtering */
+#define ETH_MACFFR_HM ((uint32_t)0x00000004) /* Hash multicast */
+#define ETH_MACFFR_HU ((uint32_t)0x00000002) /* Hash unicast */
+#define ETH_MACFFR_PM ((uint32_t)0x00000001) /* Promiscuous mode */
+
+/* Bit definition for Ethernet MAC Hash Table High Register */
+#define ETH_MACHTHR_HTH ((uint32_t)0xFFFFFFFF) /* Hash table high */
+
+/* Bit definition for Ethernet MAC Hash Table Low Register */
+#define ETH_MACHTLR_HTL ((uint32_t)0xFFFFFFFF) /* Hash table low */
+
+/* Bit definition for Ethernet MAC MII Address Register */
+#define ETH_MACMIIAR_PA ((uint32_t)0x0000F800) /* Physical layer address */
+#define ETH_MACMIIAR_MR ((uint32_t)0x000007C0) /* MII register in the selected PHY */
+#define ETH_MACMIIAR_CR ((uint32_t)0x0000001C) /* CR clock range: 6 cases */
+ #define ETH_MACMIIAR_CR_Div42 ((uint32_t)0x00000000) /* HCLK:60-72 MHz; MDC clock= HCLK/42 */
+ #define ETH_MACMIIAR_CR_Div16 ((uint32_t)0x00000008) /* HCLK:20-35 MHz; MDC clock= HCLK/16 */
+ #define ETH_MACMIIAR_CR_Div26 ((uint32_t)0x0000000C) /* HCLK:35-60 MHz; MDC clock= HCLK/26 */
+#define ETH_MACMIIAR_MW ((uint32_t)0x00000002) /* MII write */
+#define ETH_MACMIIAR_MB ((uint32_t)0x00000001) /* MII busy */
+
+/* Bit definition for Ethernet MAC MII Data Register */
+#define ETH_MACMIIDR_MD ((uint32_t)0x0000FFFF) /* MII data: read/write data from/to PHY */
+
+/* Bit definition for Ethernet MAC Flow Control Register */
+#define ETH_MACFCR_PT ((uint32_t)0xFFFF0000) /* Pause time */
+#define ETH_MACFCR_ZQPD ((uint32_t)0x00000080) /* Zero-quanta pause disable */
+#define ETH_MACFCR_PLT ((uint32_t)0x00000030) /* Pause low threshold: 4 cases */
+ #define ETH_MACFCR_PLT_Minus4 ((uint32_t)0x00000000) /* Pause time minus 4 slot times */
+ #define ETH_MACFCR_PLT_Minus28 ((uint32_t)0x00000010) /* Pause time minus 28 slot times */
+ #define ETH_MACFCR_PLT_Minus144 ((uint32_t)0x00000020) /* Pause time minus 144 slot times */
+ #define ETH_MACFCR_PLT_Minus256 ((uint32_t)0x00000030) /* Pause time minus 256 slot times */
+#define ETH_MACFCR_UPFD ((uint32_t)0x00000008) /* Unicast pause frame detect */
+#define ETH_MACFCR_RFCE ((uint32_t)0x00000004) /* Receive flow control enable */
+#define ETH_MACFCR_TFCE ((uint32_t)0x00000002) /* Transmit flow control enable */
+#define ETH_MACFCR_FCBBPA ((uint32_t)0x00000001) /* Flow control busy/backpressure activate */
+
+/* Bit definition for Ethernet MAC VLAN Tag Register */
+#define ETH_MACVLANTR_VLANTC ((uint32_t)0x00010000) /* 12-bit VLAN tag comparison */
+#define ETH_MACVLANTR_VLANTI ((uint32_t)0x0000FFFF) /* VLAN tag identifier (for receive frames) */
+
+/* Bit definition for Ethernet MAC Remote Wake-UpFrame Filter Register */
+#define ETH_MACRWUFFR_D ((uint32_t)0xFFFFFFFF) /* Wake-up frame filter register data */
+/* Eight sequential Writes to this address (offset 0x28) will write all Wake-UpFrame Filter Registers.
+ Eight sequential Reads from this address (offset 0x28) will read all Wake-UpFrame Filter Registers. */
+/* Wake-UpFrame Filter Reg0 : Filter 0 Byte Mask
+ Wake-UpFrame Filter Reg1 : Filter 1 Byte Mask
+ Wake-UpFrame Filter Reg2 : Filter 2 Byte Mask
+ Wake-UpFrame Filter Reg3 : Filter 3 Byte Mask
+ Wake-UpFrame Filter Reg4 : RSVD - Filter3 Command - RSVD - Filter2 Command -
+ RSVD - Filter1 Command - RSVD - Filter0 Command
+ Wake-UpFrame Filter Re5 : Filter3 Offset - Filter2 Offset - Filter1 Offset - Filter0 Offset
+ Wake-UpFrame Filter Re6 : Filter1 CRC16 - Filter0 CRC16
+ Wake-UpFrame Filter Re7 : Filter3 CRC16 - Filter2 CRC16 */
+
+/* Bit definition for Ethernet MAC PMT Control and Status Register */
+#define ETH_MACPMTCSR_WFFRPR ((uint32_t)0x80000000) /* Wake-Up Frame Filter Register Pointer Reset */
+#define ETH_MACPMTCSR_GU ((uint32_t)0x00000200) /* Global Unicast */
+#define ETH_MACPMTCSR_WFR ((uint32_t)0x00000040) /* Wake-Up Frame Received */
+#define ETH_MACPMTCSR_MPR ((uint32_t)0x00000020) /* Magic Packet Received */
+#define ETH_MACPMTCSR_WFE ((uint32_t)0x00000004) /* Wake-Up Frame Enable */
+#define ETH_MACPMTCSR_MPE ((uint32_t)0x00000002) /* Magic Packet Enable */
+#define ETH_MACPMTCSR_PD ((uint32_t)0x00000001) /* Power Down */
+
+/* Bit definition for Ethernet MAC Status Register */
+#define ETH_MACSR_TSTS ((uint32_t)0x00000200) /* Time stamp trigger status */
+#define ETH_MACSR_MMCTS ((uint32_t)0x00000040) /* MMC transmit status */
+#define ETH_MACSR_MMMCRS ((uint32_t)0x00000020) /* MMC receive status */
+#define ETH_MACSR_MMCS ((uint32_t)0x00000010) /* MMC status */
+#define ETH_MACSR_PMTS ((uint32_t)0x00000008) /* PMT status */
+
+/* Bit definition for Ethernet MAC Interrupt Mask Register */
+#define ETH_MACIMR_TSTIM ((uint32_t)0x00000200) /* Time stamp trigger interrupt mask */
+#define ETH_MACIMR_PMTIM ((uint32_t)0x00000008) /* PMT interrupt mask */
+
+/* Bit definition for Ethernet MAC Address0 High Register */
+#define ETH_MACA0HR_MACA0H ((uint32_t)0x0000FFFF) /* MAC address0 high */
+
+/* Bit definition for Ethernet MAC Address0 Low Register */
+#define ETH_MACA0LR_MACA0L ((uint32_t)0xFFFFFFFF) /* MAC address0 low */
+
+/* Bit definition for Ethernet MAC Address1 High Register */
+#define ETH_MACA1HR_AE ((uint32_t)0x80000000) /* Address enable */
+#define ETH_MACA1HR_SA ((uint32_t)0x40000000) /* Source address */
+#define ETH_MACA1HR_MBC ((uint32_t)0x3F000000) /* Mask byte control: bits to mask for comparison of the MAC Address bytes */
+ #define ETH_MACA1HR_MBC_HBits15_8 ((uint32_t)0x20000000) /* Mask MAC Address high reg bits [15:8] */
+ #define ETH_MACA1HR_MBC_HBits7_0 ((uint32_t)0x10000000) /* Mask MAC Address high reg bits [7:0] */
+ #define ETH_MACA1HR_MBC_LBits31_24 ((uint32_t)0x08000000) /* Mask MAC Address low reg bits [31:24] */
+ #define ETH_MACA1HR_MBC_LBits23_16 ((uint32_t)0x04000000) /* Mask MAC Address low reg bits [23:16] */
+ #define ETH_MACA1HR_MBC_LBits15_8 ((uint32_t)0x02000000) /* Mask MAC Address low reg bits [15:8] */
+ #define ETH_MACA1HR_MBC_LBits7_0 ((uint32_t)0x01000000) /* Mask MAC Address low reg bits [7:0] */
+#define ETH_MACA1HR_MACA1H ((uint32_t)0x0000FFFF) /* MAC address1 high */
+
+/* Bit definition for Ethernet MAC Address1 Low Register */
+#define ETH_MACA1LR_MACA1L ((uint32_t)0xFFFFFFFF) /* MAC address1 low */
+
+/* Bit definition for Ethernet MAC Address2 High Register */
+#define ETH_MACA2HR_AE ((uint32_t)0x80000000) /* Address enable */
+#define ETH_MACA2HR_SA ((uint32_t)0x40000000) /* Source address */
+#define ETH_MACA2HR_MBC ((uint32_t)0x3F000000) /* Mask byte control */
+ #define ETH_MACA2HR_MBC_HBits15_8 ((uint32_t)0x20000000) /* Mask MAC Address high reg bits [15:8] */
+ #define ETH_MACA2HR_MBC_HBits7_0 ((uint32_t)0x10000000) /* Mask MAC Address high reg bits [7:0] */
+ #define ETH_MACA2HR_MBC_LBits31_24 ((uint32_t)0x08000000) /* Mask MAC Address low reg bits [31:24] */
+ #define ETH_MACA2HR_MBC_LBits23_16 ((uint32_t)0x04000000) /* Mask MAC Address low reg bits [23:16] */
+ #define ETH_MACA2HR_MBC_LBits15_8 ((uint32_t)0x02000000) /* Mask MAC Address low reg bits [15:8] */
+ #define ETH_MACA2HR_MBC_LBits7_0 ((uint32_t)0x01000000) /* Mask MAC Address low reg bits [70] */
+#define ETH_MACA2HR_MACA2H ((uint32_t)0x0000FFFF) /* MAC address1 high */
+
+/* Bit definition for Ethernet MAC Address2 Low Register */
+#define ETH_MACA2LR_MACA2L ((uint32_t)0xFFFFFFFF) /* MAC address2 low */
+
+/* Bit definition for Ethernet MAC Address3 High Register */
+#define ETH_MACA3HR_AE ((uint32_t)0x80000000) /* Address enable */
+#define ETH_MACA3HR_SA ((uint32_t)0x40000000) /* Source address */
+#define ETH_MACA3HR_MBC ((uint32_t)0x3F000000) /* Mask byte control */
+ #define ETH_MACA3HR_MBC_HBits15_8 ((uint32_t)0x20000000) /* Mask MAC Address high reg bits [15:8] */
+ #define ETH_MACA3HR_MBC_HBits7_0 ((uint32_t)0x10000000) /* Mask MAC Address high reg bits [7:0] */
+ #define ETH_MACA3HR_MBC_LBits31_24 ((uint32_t)0x08000000) /* Mask MAC Address low reg bits [31:24] */
+ #define ETH_MACA3HR_MBC_LBits23_16 ((uint32_t)0x04000000) /* Mask MAC Address low reg bits [23:16] */
+ #define ETH_MACA3HR_MBC_LBits15_8 ((uint32_t)0x02000000) /* Mask MAC Address low reg bits [15:8] */
+ #define ETH_MACA3HR_MBC_LBits7_0 ((uint32_t)0x01000000) /* Mask MAC Address low reg bits [70] */
+#define ETH_MACA3HR_MACA3H ((uint32_t)0x0000FFFF) /* MAC address3 high */
+
+/* Bit definition for Ethernet MAC Address3 Low Register */
+#define ETH_MACA3LR_MACA3L ((uint32_t)0xFFFFFFFF) /* MAC address3 low */
+
+/******************************************************************************/
+/* Ethernet MMC Registers bits definition */
+/******************************************************************************/
+
+/* Bit definition for Ethernet MMC Contol Register */
+#define ETH_MMCCR_MCF ((uint32_t)0x00000008) /* MMC Counter Freeze */
+#define ETH_MMCCR_ROR ((uint32_t)0x00000004) /* Reset on Read */
+#define ETH_MMCCR_CSR ((uint32_t)0x00000002) /* Counter Stop Rollover */
+#define ETH_MMCCR_CR ((uint32_t)0x00000001) /* Counters Reset */
+
+/* Bit definition for Ethernet MMC Receive Interrupt Register */
+#define ETH_MMCRIR_RGUFS ((uint32_t)0x00020000) /* Set when Rx good unicast frames counter reaches half the maximum value */
+#define ETH_MMCRIR_RFAES ((uint32_t)0x00000040) /* Set when Rx alignment error counter reaches half the maximum value */
+#define ETH_MMCRIR_RFCES ((uint32_t)0x00000020) /* Set when Rx crc error counter reaches half the maximum value */
+
+/* Bit definition for Ethernet MMC Transmit Interrupt Register */
+#define ETH_MMCTIR_TGFS ((uint32_t)0x00200000) /* Set when Tx good frame count counter reaches half the maximum value */
+#define ETH_MMCTIR_TGFMSCS ((uint32_t)0x00008000) /* Set when Tx good multi col counter reaches half the maximum value */
+#define ETH_MMCTIR_TGFSCS ((uint32_t)0x00004000) /* Set when Tx good single col counter reaches half the maximum value */
+
+/* Bit definition for Ethernet MMC Receive Interrupt Mask Register */
+#define ETH_MMCRIMR_RGUFM ((uint32_t)0x00020000) /* Mask the interrupt when Rx good unicast frames counter reaches half the maximum value */
+#define ETH_MMCRIMR_RFAEM ((uint32_t)0x00000040) /* Mask the interrupt when when Rx alignment error counter reaches half the maximum value */
+#define ETH_MMCRIMR_RFCEM ((uint32_t)0x00000020) /* Mask the interrupt when Rx crc error counter reaches half the maximum value */
+
+/* Bit definition for Ethernet MMC Transmit Interrupt Mask Register */
+#define ETH_MMCTIMR_TGFM ((uint32_t)0x00200000) /* Mask the interrupt when Tx good frame count counter reaches half the maximum value */
+#define ETH_MMCTIMR_TGFMSCM ((uint32_t)0x00008000) /* Mask the interrupt when Tx good multi col counter reaches half the maximum value */
+#define ETH_MMCTIMR_TGFSCM ((uint32_t)0x00004000) /* Mask the interrupt when Tx good single col counter reaches half the maximum value */
+
+/* Bit definition for Ethernet MMC Transmitted Good Frames after Single Collision Counter Register */
+#define ETH_MMCTGFSCCR_TGFSCC ((uint32_t)0xFFFFFFFF) /* Number of successfully transmitted frames after a single collision in Half-duplex mode. */
+
+/* Bit definition for Ethernet MMC Transmitted Good Frames after More than a Single Collision Counter Register */
+#define ETH_MMCTGFMSCCR_TGFMSCC ((uint32_t)0xFFFFFFFF) /* Number of successfully transmitted frames after more than a single collision in Half-duplex mode. */
+
+/* Bit definition for Ethernet MMC Transmitted Good Frames Counter Register */
+#define ETH_MMCTGFCR_TGFC ((uint32_t)0xFFFFFFFF) /* Number of good frames transmitted. */
+
+/* Bit definition for Ethernet MMC Received Frames with CRC Error Counter Register */
+#define ETH_MMCRFCECR_RFCEC ((uint32_t)0xFFFFFFFF) /* Number of frames received with CRC error. */
+
+/* Bit definition for Ethernet MMC Received Frames with Alignement Error Counter Register */
+#define ETH_MMCRFAECR_RFAEC ((uint32_t)0xFFFFFFFF) /* Number of frames received with alignment (dribble) error */
+
+/* Bit definition for Ethernet MMC Received Good Unicast Frames Counter Register */
+#define ETH_MMCRGUFCR_RGUFC ((uint32_t)0xFFFFFFFF) /* Number of good unicast frames received. */
+
+/******************************************************************************/
+/* Ethernet PTP Registers bits definition */
+/******************************************************************************/
+
+/* Bit definition for Ethernet PTP Time Stamp Contol Register */
+#define ETH_PTPTSCR_TSARU ((uint32_t)0x00000020) /* Addend register update */
+#define ETH_PTPTSCR_TSITE ((uint32_t)0x00000010) /* Time stamp interrupt trigger enable */
+#define ETH_PTPTSCR_TSSTU ((uint32_t)0x00000008) /* Time stamp update */
+#define ETH_PTPTSCR_TSSTI ((uint32_t)0x00000004) /* Time stamp initialize */
+#define ETH_PTPTSCR_TSFCU ((uint32_t)0x00000002) /* Time stamp fine or coarse update */
+#define ETH_PTPTSCR_TSE ((uint32_t)0x00000001) /* Time stamp enable */
+
+/* Bit definition for Ethernet PTP Sub-Second Increment Register */
+#define ETH_PTPSSIR_STSSI ((uint32_t)0x000000FF) /* System time Sub-second increment value */
+
+/* Bit definition for Ethernet PTP Time Stamp High Register */
+#define ETH_PTPTSHR_STS ((uint32_t)0xFFFFFFFF) /* System Time second */
+
+/* Bit definition for Ethernet PTP Time Stamp Low Register */
+#define ETH_PTPTSLR_STPNS ((uint32_t)0x80000000) /* System Time Positive or negative time */
+#define ETH_PTPTSLR_STSS ((uint32_t)0x7FFFFFFF) /* System Time sub-seconds */
+
+/* Bit definition for Ethernet PTP Time Stamp High Update Register */
+#define ETH_PTPTSHUR_TSUS ((uint32_t)0xFFFFFFFF) /* Time stamp update seconds */
+
+/* Bit definition for Ethernet PTP Time Stamp Low Update Register */
+#define ETH_PTPTSLUR_TSUPNS ((uint32_t)0x80000000) /* Time stamp update Positive or negative time */
+#define ETH_PTPTSLUR_TSUSS ((uint32_t)0x7FFFFFFF) /* Time stamp update sub-seconds */
+
+/* Bit definition for Ethernet PTP Time Stamp Addend Register */
+#define ETH_PTPTSAR_TSA ((uint32_t)0xFFFFFFFF) /* Time stamp addend */
+
+/* Bit definition for Ethernet PTP Target Time High Register */
+#define ETH_PTPTTHR_TTSH ((uint32_t)0xFFFFFFFF) /* Target time stamp high */
+
+/* Bit definition for Ethernet PTP Target Time Low Register */
+#define ETH_PTPTTLR_TTSL ((uint32_t)0xFFFFFFFF) /* Target time stamp low */
+
+/******************************************************************************/
+/* Ethernet DMA Registers bits definition */
+/******************************************************************************/
+
+/* Bit definition for Ethernet DMA Bus Mode Register */
+#define ETH_DMABMR_AAB ((uint32_t)0x02000000) /* Address-Aligned beats */
+#define ETH_DMABMR_FPM ((uint32_t)0x01000000) /* 4xPBL mode */
+#define ETH_DMABMR_USP ((uint32_t)0x00800000) /* Use separate PBL */
+#define ETH_DMABMR_RDP ((uint32_t)0x007E0000) /* RxDMA PBL */
+ #define ETH_DMABMR_RDP_1Beat ((uint32_t)0x00020000) /* maximum number of beats to be transferred in one RxDMA transaction is 1 */
+ #define ETH_DMABMR_RDP_2Beat ((uint32_t)0x00040000) /* maximum number of beats to be transferred in one RxDMA transaction is 2 */
+ #define ETH_DMABMR_RDP_4Beat ((uint32_t)0x00080000) /* maximum number of beats to be transferred in one RxDMA transaction is 4 */
+ #define ETH_DMABMR_RDP_8Beat ((uint32_t)0x00100000) /* maximum number of beats to be transferred in one RxDMA transaction is 8 */
+ #define ETH_DMABMR_RDP_16Beat ((uint32_t)0x00200000) /* maximum number of beats to be transferred in one RxDMA transaction is 16 */
+ #define ETH_DMABMR_RDP_32Beat ((uint32_t)0x00400000) /* maximum number of beats to be transferred in one RxDMA transaction is 32 */
+ #define ETH_DMABMR_RDP_4xPBL_4Beat ((uint32_t)0x01020000) /* maximum number of beats to be transferred in one RxDMA transaction is 4 */
+ #define ETH_DMABMR_RDP_4xPBL_8Beat ((uint32_t)0x01040000) /* maximum number of beats to be transferred in one RxDMA transaction is 8 */
+ #define ETH_DMABMR_RDP_4xPBL_16Beat ((uint32_t)0x01080000) /* maximum number of beats to be transferred in one RxDMA transaction is 16 */
+ #define ETH_DMABMR_RDP_4xPBL_32Beat ((uint32_t)0x01100000) /* maximum number of beats to be transferred in one RxDMA transaction is 32 */
+ #define ETH_DMABMR_RDP_4xPBL_64Beat ((uint32_t)0x01200000) /* maximum number of beats to be transferred in one RxDMA transaction is 64 */
+ #define ETH_DMABMR_RDP_4xPBL_128Beat ((uint32_t)0x01400000) /* maximum number of beats to be transferred in one RxDMA transaction is 128 */
+#define ETH_DMABMR_FB ((uint32_t)0x00010000) /* Fixed Burst */
+#define ETH_DMABMR_RTPR ((uint32_t)0x0000C000) /* Rx Tx priority ratio */
+ #define ETH_DMABMR_RTPR_1_1 ((uint32_t)0x00000000) /* Rx Tx priority ratio */
+ #define ETH_DMABMR_RTPR_2_1 ((uint32_t)0x00004000) /* Rx Tx priority ratio */
+ #define ETH_DMABMR_RTPR_3_1 ((uint32_t)0x00008000) /* Rx Tx priority ratio */
+ #define ETH_DMABMR_RTPR_4_1 ((uint32_t)0x0000C000) /* Rx Tx priority ratio */
+#define ETH_DMABMR_PBL ((uint32_t)0x00003F00) /* Programmable burst length */
+ #define ETH_DMABMR_PBL_1Beat ((uint32_t)0x00000100) /* maximum number of beats to be transferred in one TxDMA (or both) transaction is 1 */
+ #define ETH_DMABMR_PBL_2Beat ((uint32_t)0x00000200) /* maximum number of beats to be transferred in one TxDMA (or both) transaction is 2 */
+ #define ETH_DMABMR_PBL_4Beat ((uint32_t)0x00000400) /* maximum number of beats to be transferred in one TxDMA (or both) transaction is 4 */
+ #define ETH_DMABMR_PBL_8Beat ((uint32_t)0x00000800) /* maximum number of beats to be transferred in one TxDMA (or both) transaction is 8 */
+ #define ETH_DMABMR_PBL_16Beat ((uint32_t)0x00001000) /* maximum number of beats to be transferred in one TxDMA (or both) transaction is 16 */
+ #define ETH_DMABMR_PBL_32Beat ((uint32_t)0x00002000) /* maximum number of beats to be transferred in one TxDMA (or both) transaction is 32 */
+ #define ETH_DMABMR_PBL_4xPBL_4Beat ((uint32_t)0x01000100) /* maximum number of beats to be transferred in one TxDMA (or both) transaction is 4 */
+ #define ETH_DMABMR_PBL_4xPBL_8Beat ((uint32_t)0x01000200) /* maximum number of beats to be transferred in one TxDMA (or both) transaction is 8 */
+ #define ETH_DMABMR_PBL_4xPBL_16Beat ((uint32_t)0x01000400) /* maximum number of beats to be transferred in one TxDMA (or both) transaction is 16 */
+ #define ETH_DMABMR_PBL_4xPBL_32Beat ((uint32_t)0x01000800) /* maximum number of beats to be transferred in one TxDMA (or both) transaction is 32 */
+ #define ETH_DMABMR_PBL_4xPBL_64Beat ((uint32_t)0x01001000) /* maximum number of beats to be transferred in one TxDMA (or both) transaction is 64 */
+ #define ETH_DMABMR_PBL_4xPBL_128Beat ((uint32_t)0x01002000) /* maximum number of beats to be transferred in one TxDMA (or both) transaction is 128 */
+#define ETH_DMABMR_DSL ((uint32_t)0x0000007C) /* Descriptor Skip Length */
+#define ETH_DMABMR_DA ((uint32_t)0x00000002) /* DMA arbitration scheme */
+#define ETH_DMABMR_SR ((uint32_t)0x00000001) /* Software reset */
+
+/* Bit definition for Ethernet DMA Transmit Poll Demand Register */
+#define ETH_DMATPDR_TPD ((uint32_t)0xFFFFFFFF) /* Transmit poll demand */
+
+/* Bit definition for Ethernet DMA Receive Poll Demand Register */
+#define ETH_DMARPDR_RPD ((uint32_t)0xFFFFFFFF) /* Receive poll demand */
+
+/* Bit definition for Ethernet DMA Receive Descriptor List Address Register */
+#define ETH_DMARDLAR_SRL ((uint32_t)0xFFFFFFFF) /* Start of receive list */
+
+/* Bit definition for Ethernet DMA Transmit Descriptor List Address Register */
+#define ETH_DMATDLAR_STL ((uint32_t)0xFFFFFFFF) /* Start of transmit list */
+
+/* Bit definition for Ethernet DMA Status Register */
+#define ETH_DMASR_TSTS ((uint32_t)0x20000000) /* Time-stamp trigger status */
+#define ETH_DMASR_PMTS ((uint32_t)0x10000000) /* PMT status */
+#define ETH_DMASR_MMCS ((uint32_t)0x08000000) /* MMC status */
+#define ETH_DMASR_EBS ((uint32_t)0x03800000) /* Error bits status */
+ /* combination with EBS[2:0] for GetFlagStatus function */
+ #define ETH_DMASR_EBS_DescAccess ((uint32_t)0x02000000) /* Error bits 0-data buffer, 1-desc. access */
+ #define ETH_DMASR_EBS_ReadTransf ((uint32_t)0x01000000) /* Error bits 0-write trnsf, 1-read transfr */
+ #define ETH_DMASR_EBS_DataTransfTx ((uint32_t)0x00800000) /* Error bits 0-Rx DMA, 1-Tx DMA */
+#define ETH_DMASR_TPS ((uint32_t)0x00700000) /* Transmit process state */
+ #define ETH_DMASR_TPS_Stopped ((uint32_t)0x00000000) /* Stopped - Reset or Stop Tx Command issued */
+ #define ETH_DMASR_TPS_Fetching ((uint32_t)0x00100000) /* Running - fetching the Tx descriptor */
+ #define ETH_DMASR_TPS_Waiting ((uint32_t)0x00200000) /* Running - waiting for status */
+ #define ETH_DMASR_TPS_Reading ((uint32_t)0x00300000) /* Running - reading the data from host memory */
+ #define ETH_DMASR_TPS_Suspended ((uint32_t)0x00600000) /* Suspended - Tx Descriptor unavailabe */
+ #define ETH_DMASR_TPS_Closing ((uint32_t)0x00700000) /* Running - closing Rx descriptor */
+#define ETH_DMASR_RPS ((uint32_t)0x000E0000) /* Receive process state */
+ #define ETH_DMASR_RPS_Stopped ((uint32_t)0x00000000) /* Stopped - Reset or Stop Rx Command issued */
+ #define ETH_DMASR_RPS_Fetching ((uint32_t)0x00020000) /* Running - fetching the Rx descriptor */
+ #define ETH_DMASR_RPS_Waiting ((uint32_t)0x00060000) /* Running - waiting for packet */
+ #define ETH_DMASR_RPS_Suspended ((uint32_t)0x00080000) /* Suspended - Rx Descriptor unavailable */
+ #define ETH_DMASR_RPS_Closing ((uint32_t)0x000A0000) /* Running - closing descriptor */
+ #define ETH_DMASR_RPS_Queuing ((uint32_t)0x000E0000) /* Running - queuing the recieve frame into host memory */
+#define ETH_DMASR_NIS ((uint32_t)0x00010000) /* Normal interrupt summary */
+#define ETH_DMASR_AIS ((uint32_t)0x00008000) /* Abnormal interrupt summary */
+#define ETH_DMASR_ERS ((uint32_t)0x00004000) /* Early receive status */
+#define ETH_DMASR_FBES ((uint32_t)0x00002000) /* Fatal bus error status */
+#define ETH_DMASR_ETS ((uint32_t)0x00000400) /* Early transmit status */
+#define ETH_DMASR_RWTS ((uint32_t)0x00000200) /* Receive watchdog timeout status */
+#define ETH_DMASR_RPSS ((uint32_t)0x00000100) /* Receive process stopped status */
+#define ETH_DMASR_RBUS ((uint32_t)0x00000080) /* Receive buffer unavailable status */
+#define ETH_DMASR_RS ((uint32_t)0x00000040) /* Receive status */
+#define ETH_DMASR_TUS ((uint32_t)0x00000020) /* Transmit underflow status */
+#define ETH_DMASR_ROS ((uint32_t)0x00000010) /* Receive overflow status */
+#define ETH_DMASR_TJTS ((uint32_t)0x00000008) /* Transmit jabber timeout status */
+#define ETH_DMASR_TBUS ((uint32_t)0x00000004) /* Transmit buffer unavailable status */
+#define ETH_DMASR_TPSS ((uint32_t)0x00000002) /* Transmit process stopped status */
+#define ETH_DMASR_TS ((uint32_t)0x00000001) /* Transmit status */
+
+/* Bit definition for Ethernet DMA Operation Mode Register */
+#define ETH_DMAOMR_DTCEFD ((uint32_t)0x04000000) /* Disable Dropping of TCP/IP checksum error frames */
+#define ETH_DMAOMR_RSF ((uint32_t)0x02000000) /* Receive store and forward */
+#define ETH_DMAOMR_DFRF ((uint32_t)0x01000000) /* Disable flushing of received frames */
+#define ETH_DMAOMR_TSF ((uint32_t)0x00200000) /* Transmit store and forward */
+#define ETH_DMAOMR_FTF ((uint32_t)0x00100000) /* Flush transmit FIFO */
+#define ETH_DMAOMR_TTC ((uint32_t)0x0001C000) /* Transmit threshold control */
+ #define ETH_DMAOMR_TTC_64Bytes ((uint32_t)0x00000000) /* threshold level of the MTL Transmit FIFO is 64 Bytes */
+ #define ETH_DMAOMR_TTC_128Bytes ((uint32_t)0x00004000) /* threshold level of the MTL Transmit FIFO is 128 Bytes */
+ #define ETH_DMAOMR_TTC_192Bytes ((uint32_t)0x00008000) /* threshold level of the MTL Transmit FIFO is 192 Bytes */
+ #define ETH_DMAOMR_TTC_256Bytes ((uint32_t)0x0000C000) /* threshold level of the MTL Transmit FIFO is 256 Bytes */
+ #define ETH_DMAOMR_TTC_40Bytes ((uint32_t)0x00010000) /* threshold level of the MTL Transmit FIFO is 40 Bytes */
+ #define ETH_DMAOMR_TTC_32Bytes ((uint32_t)0x00014000) /* threshold level of the MTL Transmit FIFO is 32 Bytes */
+ #define ETH_DMAOMR_TTC_24Bytes ((uint32_t)0x00018000) /* threshold level of the MTL Transmit FIFO is 24 Bytes */
+ #define ETH_DMAOMR_TTC_16Bytes ((uint32_t)0x0001C000) /* threshold level of the MTL Transmit FIFO is 16 Bytes */
+#define ETH_DMAOMR_ST ((uint32_t)0x00002000) /* Start/stop transmission command */
+#define ETH_DMAOMR_FEF ((uint32_t)0x00000080) /* Forward error frames */
+#define ETH_DMAOMR_FUGF ((uint32_t)0x00000040) /* Forward undersized good frames */
+#define ETH_DMAOMR_RTC ((uint32_t)0x00000018) /* receive threshold control */
+ #define ETH_DMAOMR_RTC_64Bytes ((uint32_t)0x00000000) /* threshold level of the MTL Receive FIFO is 64 Bytes */
+ #define ETH_DMAOMR_RTC_32Bytes ((uint32_t)0x00000008) /* threshold level of the MTL Receive FIFO is 32 Bytes */
+ #define ETH_DMAOMR_RTC_96Bytes ((uint32_t)0x00000010) /* threshold level of the MTL Receive FIFO is 96 Bytes */
+ #define ETH_DMAOMR_RTC_128Bytes ((uint32_t)0x00000018) /* threshold level of the MTL Receive FIFO is 128 Bytes */
+#define ETH_DMAOMR_OSF ((uint32_t)0x00000004) /* operate on second frame */
+#define ETH_DMAOMR_SR ((uint32_t)0x00000002) /* Start/stop receive */
+
+/* Bit definition for Ethernet DMA Interrupt Enable Register */
+#define ETH_DMAIER_NISE ((uint32_t)0x00010000) /* Normal interrupt summary enable */
+#define ETH_DMAIER_AISE ((uint32_t)0x00008000) /* Abnormal interrupt summary enable */
+#define ETH_DMAIER_ERIE ((uint32_t)0x00004000) /* Early receive interrupt enable */
+#define ETH_DMAIER_FBEIE ((uint32_t)0x00002000) /* Fatal bus error interrupt enable */
+#define ETH_DMAIER_ETIE ((uint32_t)0x00000400) /* Early transmit interrupt enable */
+#define ETH_DMAIER_RWTIE ((uint32_t)0x00000200) /* Receive watchdog timeout interrupt enable */
+#define ETH_DMAIER_RPSIE ((uint32_t)0x00000100) /* Receive process stopped interrupt enable */
+#define ETH_DMAIER_RBUIE ((uint32_t)0x00000080) /* Receive buffer unavailable interrupt enable */
+#define ETH_DMAIER_RIE ((uint32_t)0x00000040) /* Receive interrupt enable */
+#define ETH_DMAIER_TUIE ((uint32_t)0x00000020) /* Transmit Underflow interrupt enable */
+#define ETH_DMAIER_ROIE ((uint32_t)0x00000010) /* Receive Overflow interrupt enable */
+#define ETH_DMAIER_TJTIE ((uint32_t)0x00000008) /* Transmit jabber timeout interrupt enable */
+#define ETH_DMAIER_TBUIE ((uint32_t)0x00000004) /* Transmit buffer unavailable interrupt enable */
+#define ETH_DMAIER_TPSIE ((uint32_t)0x00000002) /* Transmit process stopped interrupt enable */
+#define ETH_DMAIER_TIE ((uint32_t)0x00000001) /* Transmit interrupt enable */
+
+/* Bit definition for Ethernet DMA Missed Frame and Buffer Overflow Counter Register */
+#define ETH_DMAMFBOCR_OFOC ((uint32_t)0x10000000) /* Overflow bit for FIFO overflow counter */
+#define ETH_DMAMFBOCR_MFA ((uint32_t)0x0FFE0000) /* Number of frames missed by the application */
+#define ETH_DMAMFBOCR_OMFC ((uint32_t)0x00010000) /* Overflow bit for missed frame counter */
+#define ETH_DMAMFBOCR_MFC ((uint32_t)0x0000FFFF) /* Number of frames missed by the controller */
+
+/* Bit definition for Ethernet DMA Current Host Transmit Descriptor Register */
+#define ETH_DMACHTDR_HTDAP ((uint32_t)0xFFFFFFFF) /* Host transmit descriptor address pointer */
+
+/* Bit definition for Ethernet DMA Current Host Receive Descriptor Register */
+#define ETH_DMACHRDR_HRDAP ((uint32_t)0xFFFFFFFF) /* Host receive descriptor address pointer */
+
+/* Bit definition for Ethernet DMA Current Host Transmit Buffer Address Register */
+#define ETH_DMACHTBAR_HTBAP ((uint32_t)0xFFFFFFFF) /* Host transmit buffer address pointer */
+
+/* Bit definition for Ethernet DMA Current Host Receive Buffer Address Register */
+#define ETH_DMACHRBAR_HRBAP ((uint32_t)0xFFFFFFFF) /* Host receive buffer address pointer */
+#endif /* STM32F10X_CL */
+
+/**
+ * @}
+ */
+
+ /**
+ * @}
+ */
+
+#ifdef USE_STDPERIPH_DRIVER
+ #include "stm32f10x_conf.h"
+#endif
+
+/** @addtogroup Exported_macro
+ * @{
+ */
+
+#define SET_BIT(REG, BIT) ((REG) |= (BIT))
+
+#define CLEAR_BIT(REG, BIT) ((REG) &= ~(BIT))
+
+#define READ_BIT(REG, BIT) ((REG) & (BIT))
+
+#define CLEAR_REG(REG) ((REG) = (0x0))
+
+#define WRITE_REG(REG, VAL) ((REG) = (VAL))
+
+#define READ_REG(REG) ((REG))
+
+#define MODIFY_REG(REG, CLEARMASK, SETMASK) WRITE_REG((REG), (((READ_REG(REG)) & (~(CLEARMASK))) | (SETMASK)))
+
+/**
+ * @}
+ */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __STM32F10x_H */
+
+/**
+ * @}
+ */
+
+ /**
+ * @}
+ */
+
+/******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/
diff --git a/Firmware/CubeIDE/CMSIS/inc/system_stm32f10x.h b/Firmware/CubeIDE/CMSIS/inc/system_stm32f10x.h
new file mode 100644
index 0000000..739f332
--- /dev/null
+++ b/Firmware/CubeIDE/CMSIS/inc/system_stm32f10x.h
@@ -0,0 +1,98 @@
+/**
+ ******************************************************************************
+ * @file system_stm32f10x.h
+ * @author MCD Application Team
+ * @version V3.5.0
+ * @date 11-March-2011
+ * @brief CMSIS Cortex-M3 Device Peripheral Access Layer System Header File.
+ ******************************************************************************
+ * @attention
+ *
+ * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
+ * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
+ * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY
+ * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
+ * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
+ * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
+ *
+ * © COPYRIGHT 2011 STMicroelectronics
+ ******************************************************************************
+ */
+
+/** @addtogroup CMSIS
+ * @{
+ */
+
+/** @addtogroup stm32f10x_system
+ * @{
+ */
+
+/**
+ * @brief Define to prevent recursive inclusion
+ */
+#ifndef __SYSTEM_STM32F10X_H
+#define __SYSTEM_STM32F10X_H
+
+#ifdef __cplusplus
+ extern "C" {
+#endif
+
+/** @addtogroup STM32F10x_System_Includes
+ * @{
+ */
+
+/**
+ * @}
+ */
+
+
+/** @addtogroup STM32F10x_System_Exported_types
+ * @{
+ */
+
+extern uint32_t SystemCoreClock; /*!< System Clock Frequency (Core Clock) */
+
+/**
+ * @}
+ */
+
+/** @addtogroup STM32F10x_System_Exported_Constants
+ * @{
+ */
+
+/**
+ * @}
+ */
+
+/** @addtogroup STM32F10x_System_Exported_Macros
+ * @{
+ */
+
+/**
+ * @}
+ */
+
+/** @addtogroup STM32F10x_System_Exported_Functions
+ * @{
+ */
+
+extern void SystemInit(void);
+extern void SystemCoreClockUpdate(void);
+/**
+ * @}
+ */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /*__SYSTEM_STM32F10X_H */
+
+/**
+ * @}
+ */
+
+/**
+ * @}
+ */
+/******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/
diff --git a/Firmware/CubeIDE/CMSIS/src/core_cm3.c b/Firmware/CubeIDE/CMSIS/src/core_cm3.c
new file mode 100644
index 0000000..d202e36
--- /dev/null
+++ b/Firmware/CubeIDE/CMSIS/src/core_cm3.c
@@ -0,0 +1,784 @@
+/**************************************************************************//**
+ * @file core_cm3.c
+ * @brief CMSIS Cortex-M3 Core Peripheral Access Layer Source File
+ * @version V1.30
+ * @date 30. October 2009
+ *
+ * @note
+ * Copyright (C) 2009 ARM Limited. All rights reserved.
+ *
+ * @par
+ * ARM Limited (ARM) is supplying this software for use with Cortex-M
+ * processor based microcontrollers. This file can be freely distributed
+ * within development tools that are supporting such ARM based processors.
+ *
+ * @par
+ * THIS SOFTWARE IS PROVIDED "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED
+ * OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE.
+ * ARM SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR
+ * CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
+ *
+ ******************************************************************************/
+
+#include
+
+/* define compiler specific symbols */
+#if defined ( __CC_ARM )
+ #define __ASM __asm /*!< asm keyword for ARM Compiler */
+ #define __INLINE __inline /*!< inline keyword for ARM Compiler */
+
+#elif defined ( __ICCARM__ )
+ #define __ASM __asm /*!< asm keyword for IAR Compiler */
+ #define __INLINE inline /*!< inline keyword for IAR Compiler. Only avaiable in High optimization mode! */
+
+#elif defined ( __GNUC__ )
+ #define __ASM __asm /*!< asm keyword for GNU Compiler */
+ #define __INLINE inline /*!< inline keyword for GNU Compiler */
+
+#elif defined ( __TASKING__ )
+ #define __ASM __asm /*!< asm keyword for TASKING Compiler */
+ #define __INLINE inline /*!< inline keyword for TASKING Compiler */
+
+#endif
+
+
+/* ################### Compiler specific Intrinsics ########################### */
+
+#if defined ( __CC_ARM ) /*------------------RealView Compiler -----------------*/
+/* ARM armcc specific functions */
+
+/**
+ * @brief Return the Process Stack Pointer
+ *
+ * @return ProcessStackPointer
+ *
+ * Return the actual process stack pointer
+ */
+__ASM uint32_t __get_PSP(void)
+{
+ mrs r0, psp
+ bx lr
+}
+
+/**
+ * @brief Set the Process Stack Pointer
+ *
+ * @param topOfProcStack Process Stack Pointer
+ *
+ * Assign the value ProcessStackPointer to the MSP
+ * (process stack pointer) Cortex processor register
+ */
+__ASM void __set_PSP(uint32_t topOfProcStack)
+{
+ msr psp, r0
+ bx lr
+}
+
+/**
+ * @brief Return the Main Stack Pointer
+ *
+ * @return Main Stack Pointer
+ *
+ * Return the current value of the MSP (main stack pointer)
+ * Cortex processor register
+ */
+__ASM uint32_t __get_MSP(void)
+{
+ mrs r0, msp
+ bx lr
+}
+
+/**
+ * @brief Set the Main Stack Pointer
+ *
+ * @param topOfMainStack Main Stack Pointer
+ *
+ * Assign the value mainStackPointer to the MSP
+ * (main stack pointer) Cortex processor register
+ */
+__ASM void __set_MSP(uint32_t mainStackPointer)
+{
+ msr msp, r0
+ bx lr
+}
+
+/**
+ * @brief Reverse byte order in unsigned short value
+ *
+ * @param value value to reverse
+ * @return reversed value
+ *
+ * Reverse byte order in unsigned short value
+ */
+__ASM uint32_t __REV16(uint16_t value)
+{
+ rev16 r0, r0
+ bx lr
+}
+
+/**
+ * @brief Reverse byte order in signed short value with sign extension to integer
+ *
+ * @param value value to reverse
+ * @return reversed value
+ *
+ * Reverse byte order in signed short value with sign extension to integer
+ */
+__ASM int32_t __REVSH(int16_t value)
+{
+ revsh r0, r0
+ bx lr
+}
+
+
+#if (__ARMCC_VERSION < 400000)
+
+/**
+ * @brief Remove the exclusive lock created by ldrex
+ *
+ * Removes the exclusive lock which is created by ldrex.
+ */
+__ASM void __CLREX(void)
+{
+ clrex
+}
+
+/**
+ * @brief Return the Base Priority value
+ *
+ * @return BasePriority
+ *
+ * Return the content of the base priority register
+ */
+__ASM uint32_t __get_BASEPRI(void)
+{
+ mrs r0, basepri
+ bx lr
+}
+
+/**
+ * @brief Set the Base Priority value
+ *
+ * @param basePri BasePriority
+ *
+ * Set the base priority register
+ */
+__ASM void __set_BASEPRI(uint32_t basePri)
+{
+ msr basepri, r0
+ bx lr
+}
+
+/**
+ * @brief Return the Priority Mask value
+ *
+ * @return PriMask
+ *
+ * Return state of the priority mask bit from the priority mask register
+ */
+__ASM uint32_t __get_PRIMASK(void)
+{
+ mrs r0, primask
+ bx lr
+}
+
+/**
+ * @brief Set the Priority Mask value
+ *
+ * @param priMask PriMask
+ *
+ * Set the priority mask bit in the priority mask register
+ */
+__ASM void __set_PRIMASK(uint32_t priMask)
+{
+ msr primask, r0
+ bx lr
+}
+
+/**
+ * @brief Return the Fault Mask value
+ *
+ * @return FaultMask
+ *
+ * Return the content of the fault mask register
+ */
+__ASM uint32_t __get_FAULTMASK(void)
+{
+ mrs r0, faultmask
+ bx lr
+}
+
+/**
+ * @brief Set the Fault Mask value
+ *
+ * @param faultMask faultMask value
+ *
+ * Set the fault mask register
+ */
+__ASM void __set_FAULTMASK(uint32_t faultMask)
+{
+ msr faultmask, r0
+ bx lr
+}
+
+/**
+ * @brief Return the Control Register value
+ *
+ * @return Control value
+ *
+ * Return the content of the control register
+ */
+__ASM uint32_t __get_CONTROL(void)
+{
+ mrs r0, control
+ bx lr
+}
+
+/**
+ * @brief Set the Control Register value
+ *
+ * @param control Control value
+ *
+ * Set the control register
+ */
+__ASM void __set_CONTROL(uint32_t control)
+{
+ msr control, r0
+ bx lr
+}
+
+#endif /* __ARMCC_VERSION */
+
+
+
+#elif (defined (__ICCARM__)) /*------------------ ICC Compiler -------------------*/
+/* IAR iccarm specific functions */
+#pragma diag_suppress=Pe940
+
+/**
+ * @brief Return the Process Stack Pointer
+ *
+ * @return ProcessStackPointer
+ *
+ * Return the actual process stack pointer
+ */
+uint32_t __get_PSP(void)
+{
+ __ASM("mrs r0, psp");
+ __ASM("bx lr");
+}
+
+/**
+ * @brief Set the Process Stack Pointer
+ *
+ * @param topOfProcStack Process Stack Pointer
+ *
+ * Assign the value ProcessStackPointer to the MSP
+ * (process stack pointer) Cortex processor register
+ */
+void __set_PSP(uint32_t topOfProcStack)
+{
+ __ASM("msr psp, r0");
+ __ASM("bx lr");
+}
+
+/**
+ * @brief Return the Main Stack Pointer
+ *
+ * @return Main Stack Pointer
+ *
+ * Return the current value of the MSP (main stack pointer)
+ * Cortex processor register
+ */
+uint32_t __get_MSP(void)
+{
+ __ASM("mrs r0, msp");
+ __ASM("bx lr");
+}
+
+/**
+ * @brief Set the Main Stack Pointer
+ *
+ * @param topOfMainStack Main Stack Pointer
+ *
+ * Assign the value mainStackPointer to the MSP
+ * (main stack pointer) Cortex processor register
+ */
+void __set_MSP(uint32_t topOfMainStack)
+{
+ __ASM("msr msp, r0");
+ __ASM("bx lr");
+}
+
+/**
+ * @brief Reverse byte order in unsigned short value
+ *
+ * @param value value to reverse
+ * @return reversed value
+ *
+ * Reverse byte order in unsigned short value
+ */
+uint32_t __REV16(uint16_t value)
+{
+ __ASM("rev16 r0, r0");
+ __ASM("bx lr");
+}
+
+/**
+ * @brief Reverse bit order of value
+ *
+ * @param value value to reverse
+ * @return reversed value
+ *
+ * Reverse bit order of value
+ */
+uint32_t __RBIT(uint32_t value)
+{
+ __ASM("rbit r0, r0");
+ __ASM("bx lr");
+}
+
+/**
+ * @brief LDR Exclusive (8 bit)
+ *
+ * @param *addr address pointer
+ * @return value of (*address)
+ *
+ * Exclusive LDR command for 8 bit values)
+ */
+uint8_t __LDREXB(uint8_t *addr)
+{
+ __ASM("ldrexb r0, [r0]");
+ __ASM("bx lr");
+}
+
+/**
+ * @brief LDR Exclusive (16 bit)
+ *
+ * @param *addr address pointer
+ * @return value of (*address)
+ *
+ * Exclusive LDR command for 16 bit values
+ */
+uint16_t __LDREXH(uint16_t *addr)
+{
+ __ASM("ldrexh r0, [r0]");
+ __ASM("bx lr");
+}
+
+/**
+ * @brief LDR Exclusive (32 bit)
+ *
+ * @param *addr address pointer
+ * @return value of (*address)
+ *
+ * Exclusive LDR command for 32 bit values
+ */
+uint32_t __LDREXW(uint32_t *addr)
+{
+ __ASM("ldrex r0, [r0]");
+ __ASM("bx lr");
+}
+
+/**
+ * @brief STR Exclusive (8 bit)
+ *
+ * @param value value to store
+ * @param *addr address pointer
+ * @return successful / failed
+ *
+ * Exclusive STR command for 8 bit values
+ */
+uint32_t __STREXB(uint8_t value, uint8_t *addr)
+{
+ __ASM("strexb r0, r0, [r1]");
+ __ASM("bx lr");
+}
+
+/**
+ * @brief STR Exclusive (16 bit)
+ *
+ * @param value value to store
+ * @param *addr address pointer
+ * @return successful / failed
+ *
+ * Exclusive STR command for 16 bit values
+ */
+uint32_t __STREXH(uint16_t value, uint16_t *addr)
+{
+ __ASM("strexh r0, r0, [r1]");
+ __ASM("bx lr");
+}
+
+/**
+ * @brief STR Exclusive (32 bit)
+ *
+ * @param value value to store
+ * @param *addr address pointer
+ * @return successful / failed
+ *
+ * Exclusive STR command for 32 bit values
+ */
+uint32_t __STREXW(uint32_t value, uint32_t *addr)
+{
+ __ASM("strex r0, r0, [r1]");
+ __ASM("bx lr");
+}
+
+#pragma diag_default=Pe940
+
+
+#elif (defined (__GNUC__)) /*------------------ GNU Compiler ---------------------*/
+/* GNU gcc specific functions */
+
+/**
+ * @brief Return the Process Stack Pointer
+ *
+ * @return ProcessStackPointer
+ *
+ * Return the actual process stack pointer
+ */
+uint32_t __get_PSP(void) __attribute__( ( naked ) );
+uint32_t __get_PSP(void)
+{
+ uint32_t result=0;
+
+ __ASM volatile ("MRS %0, psp\n\t"
+ "MOV r0, %0 \n\t"
+ "BX lr \n\t" : "=r" (result) );
+ return(result);
+}
+
+/**
+ * @brief Set the Process Stack Pointer
+ *
+ * @param topOfProcStack Process Stack Pointer
+ *
+ * Assign the value ProcessStackPointer to the MSP
+ * (process stack pointer) Cortex processor register
+ */
+void __set_PSP(uint32_t topOfProcStack) __attribute__( ( naked ) );
+void __set_PSP(uint32_t topOfProcStack)
+{
+ __ASM volatile ("MSR psp, %0\n\t"
+ "BX lr \n\t" : : "r" (topOfProcStack) );
+}
+
+/**
+ * @brief Return the Main Stack Pointer
+ *
+ * @return Main Stack Pointer
+ *
+ * Return the current value of the MSP (main stack pointer)
+ * Cortex processor register
+ */
+uint32_t __get_MSP(void) __attribute__( ( naked ) );
+uint32_t __get_MSP(void)
+{
+ uint32_t result=0;
+
+ __ASM volatile ("MRS %0, msp\n\t"
+ "MOV r0, %0 \n\t"
+ "BX lr \n\t" : "=r" (result) );
+ return(result);
+}
+
+/**
+ * @brief Set the Main Stack Pointer
+ *
+ * @param topOfMainStack Main Stack Pointer
+ *
+ * Assign the value mainStackPointer to the MSP
+ * (main stack pointer) Cortex processor register
+ */
+void __set_MSP(uint32_t topOfMainStack) __attribute__( ( naked ) );
+void __set_MSP(uint32_t topOfMainStack)
+{
+ __ASM volatile ("MSR msp, %0\n\t"
+ "BX lr \n\t" : : "r" (topOfMainStack) );
+}
+
+/**
+ * @brief Return the Base Priority value
+ *
+ * @return BasePriority
+ *
+ * Return the content of the base priority register
+ */
+uint32_t __get_BASEPRI(void)
+{
+ uint32_t result=0;
+
+ __ASM volatile ("MRS %0, basepri_max" : "=r" (result) );
+ return(result);
+}
+
+/**
+ * @brief Set the Base Priority value
+ *
+ * @param basePri BasePriority
+ *
+ * Set the base priority register
+ */
+void __set_BASEPRI(uint32_t value)
+{
+ __ASM volatile ("MSR basepri, %0" : : "r" (value) );
+}
+
+/**
+ * @brief Return the Priority Mask value
+ *
+ * @return PriMask
+ *
+ * Return state of the priority mask bit from the priority mask register
+ */
+uint32_t __get_PRIMASK(void)
+{
+ uint32_t result=0;
+
+ __ASM volatile ("MRS %0, primask" : "=r" (result) );
+ return(result);
+}
+
+/**
+ * @brief Set the Priority Mask value
+ *
+ * @param priMask PriMask
+ *
+ * Set the priority mask bit in the priority mask register
+ */
+void __set_PRIMASK(uint32_t priMask)
+{
+ __ASM volatile ("MSR primask, %0" : : "r" (priMask) );
+}
+
+/**
+ * @brief Return the Fault Mask value
+ *
+ * @return FaultMask
+ *
+ * Return the content of the fault mask register
+ */
+uint32_t __get_FAULTMASK(void)
+{
+ uint32_t result=0;
+
+ __ASM volatile ("MRS %0, faultmask" : "=r" (result) );
+ return(result);
+}
+
+/**
+ * @brief Set the Fault Mask value
+ *
+ * @param faultMask faultMask value
+ *
+ * Set the fault mask register
+ */
+void __set_FAULTMASK(uint32_t faultMask)
+{
+ __ASM volatile ("MSR faultmask, %0" : : "r" (faultMask) );
+}
+
+/**
+ * @brief Return the Control Register value
+*
+* @return Control value
+ *
+ * Return the content of the control register
+ */
+uint32_t __get_CONTROL(void)
+{
+ uint32_t result=0;
+
+ __ASM volatile ("MRS %0, control" : "=r" (result) );
+ return(result);
+}
+
+/**
+ * @brief Set the Control Register value
+ *
+ * @param control Control value
+ *
+ * Set the control register
+ */
+void __set_CONTROL(uint32_t control)
+{
+ __ASM volatile ("MSR control, %0" : : "r" (control) );
+}
+
+
+/**
+ * @brief Reverse byte order in integer value
+ *
+ * @param value value to reverse
+ * @return reversed value
+ *
+ * Reverse byte order in integer value
+ */
+uint32_t __REV(uint32_t value)
+{
+ uint32_t result=0;
+
+ __ASM volatile ("rev %0, %1" : "=r" (result) : "r" (value) );
+ return(result);
+}
+
+/**
+ * @brief Reverse byte order in unsigned short value
+ *
+ * @param value value to reverse
+ * @return reversed value
+ *
+ * Reverse byte order in unsigned short value
+ */
+uint32_t __REV16(uint16_t value)
+{
+ uint32_t result=0;
+
+ __ASM volatile ("rev16 %0, %1" : "=r" (result) : "r" (value) );
+ return(result);
+}
+
+/**
+ * @brief Reverse byte order in signed short value with sign extension to integer
+ *
+ * @param value value to reverse
+ * @return reversed value
+ *
+ * Reverse byte order in signed short value with sign extension to integer
+ */
+int32_t __REVSH(int16_t value)
+{
+ uint32_t result=0;
+
+ __ASM volatile ("revsh %0, %1" : "=r" (result) : "r" (value) );
+ return(result);
+}
+
+/**
+ * @brief Reverse bit order of value
+ *
+ * @param value value to reverse
+ * @return reversed value
+ *
+ * Reverse bit order of value
+ */
+uint32_t __RBIT(uint32_t value)
+{
+ uint32_t result=0;
+
+ __ASM volatile ("rbit %0, %1" : "=r" (result) : "r" (value) );
+ return(result);
+}
+
+/**
+ * @brief LDR Exclusive (8 bit)
+ *
+ * @param *addr address pointer
+ * @return value of (*address)
+ *
+ * Exclusive LDR command for 8 bit value
+ */
+uint8_t __LDREXB(uint8_t *addr)
+{
+ uint8_t result=0;
+
+ __ASM volatile ("ldrexb %0, [%1]" : "=r" (result) : "r" (addr) );
+ return(result);
+}
+
+/**
+ * @brief LDR Exclusive (16 bit)
+ *
+ * @param *addr address pointer
+ * @return value of (*address)
+ *
+ * Exclusive LDR command for 16 bit values
+ */
+uint16_t __LDREXH(uint16_t *addr)
+{
+ uint16_t result=0;
+
+ __ASM volatile ("ldrexh %0, [%1]" : "=r" (result) : "r" (addr) );
+ return(result);
+}
+
+/**
+ * @brief LDR Exclusive (32 bit)
+ *
+ * @param *addr address pointer
+ * @return value of (*address)
+ *
+ * Exclusive LDR command for 32 bit values
+ */
+uint32_t __LDREXW(uint32_t *addr)
+{
+ uint32_t result=0;
+
+ __ASM volatile ("ldrex %0, [%1]" : "=r" (result) : "r" (addr) );
+ return(result);
+}
+
+/**
+ * @brief STR Exclusive (8 bit)
+ *
+ * @param value value to store
+ * @param *addr address pointer
+ * @return successful / failed
+ *
+ * Exclusive STR command for 8 bit values
+ */
+uint32_t __STREXB(uint8_t value, uint8_t *addr)
+{
+ uint32_t result=0;
+
+ __ASM volatile ("strexb %0, %2, [%1]" : "=&r" (result) : "r" (addr), "r" (value) );
+ return(result);
+}
+
+/**
+ * @brief STR Exclusive (16 bit)
+ *
+ * @param value value to store
+ * @param *addr address pointer
+ * @return successful / failed
+ *
+ * Exclusive STR command for 16 bit values
+ */
+uint32_t __STREXH(uint16_t value, uint16_t *addr)
+{
+ uint32_t result=0;
+
+ __ASM volatile ("strexh %0, %2, [%1]" : "=&r" (result) : "r" (addr), "r" (value) );
+ return(result);
+}
+
+/**
+ * @brief STR Exclusive (32 bit)
+ *
+ * @param value value to store
+ * @param *addr address pointer
+ * @return successful / failed
+ *
+ * Exclusive STR command for 32 bit values
+ */
+uint32_t __STREXW(uint32_t value, uint32_t *addr)
+{
+ uint32_t result=0;
+
+ __ASM volatile ("strex %0, %2, [%1]" : "=&r" (result) : "r" (addr), "r" (value) );
+ return(result);
+}
+
+
+#elif (defined (__TASKING__)) /*------------------ TASKING Compiler ---------------------*/
+/* TASKING carm specific functions */
+
+/*
+ * The CMSIS functions have been implemented as intrinsics in the compiler.
+ * Please use "carm -?i" to get an up to date list of all instrinsics,
+ * Including the CMSIS ones.
+ */
+
+#endif
diff --git a/Firmware/CubeIDE/CMSIS/src/system_stm32f10x.c b/Firmware/CubeIDE/CMSIS/src/system_stm32f10x.c
new file mode 100644
index 0000000..6fb4579
--- /dev/null
+++ b/Firmware/CubeIDE/CMSIS/src/system_stm32f10x.c
@@ -0,0 +1,1094 @@
+/**
+ ******************************************************************************
+ * @file system_stm32f10x.c
+ * @author MCD Application Team
+ * @version V3.5.0
+ * @date 11-March-2011
+ * @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_stm32f10x_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_stm32f10x_xx.s" file, to
+ * configure the system clock before to branch to main program.
+ *
+ * 3. If the system clock source selected by user fails to startup, the SystemInit()
+ * function will do nothing and HSI still used as system clock source. User can
+ * add some code to deal with this issue inside the SetSysClock() function.
+ *
+ * 4. The default value of HSE crystal is set to 8 MHz (or 25 MHz, depedning on
+ * the product used), refer to "HSE_VALUE" define in "stm32f10x.h" file.
+ * 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
+ *
+ * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
+ * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
+ * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY
+ * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
+ * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
+ * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
+ *
+ * © COPYRIGHT 2011 STMicroelectronics
+ ******************************************************************************
+ */
+
+/** @addtogroup CMSIS
+ * @{
+ */
+
+/** @addtogroup stm32f10x_system
+ * @{
+ */
+
+/** @addtogroup STM32F10x_System_Private_Includes
+ * @{
+ */
+
+#include "stm32f10x.h"
+
+/**
+ * @}
+ */
+
+/** @addtogroup STM32F10x_System_Private_TypesDefinitions
+ * @{
+ */
+
+/**
+ * @}
+ */
+
+/** @addtogroup STM32F10x_System_Private_Defines
+ * @{
+ */
+
+/*!< Uncomment the line corresponding to the desired System clock (SYSCLK)
+ frequency (after reset the HSI is used as SYSCLK source)
+
+ IMPORTANT NOTE:
+ ==============
+ 1. After each device reset the HSI is used as System clock source.
+
+ 2. Please make sure that the selected System clock doesn't exceed your device's
+ maximum frequency.
+
+ 3. If none of the define below is enabled, the HSI is used as System clock
+ source.
+
+ 4. The System clock configuration functions provided within this file assume that:
+ - For Low, Medium and High density Value line devices an external 8MHz
+ crystal is used to drive the System clock.
+ - For Low, Medium and High density devices an external 8MHz crystal is
+ used to drive the System clock.
+ - For Connectivity line devices an external 25MHz crystal is used to drive
+ the System clock.
+ If you are using different crystal you have to adapt those functions accordingly.
+ */
+
+#if defined (STM32F10X_LD_VL) || (defined STM32F10X_MD_VL) || (defined STM32F10X_HD_VL)
+/* #define SYSCLK_FREQ_HSE HSE_VALUE */
+ #define SYSCLK_FREQ_24MHz 24000000
+#else
+/* #define SYSCLK_FREQ_HSE HSE_VALUE */
+/* #define SYSCLK_FREQ_24MHz 24000000 */
+/* #define SYSCLK_FREQ_36MHz 36000000 */
+/* #define SYSCLK_FREQ_48MHz 48000000 */
+/* #define SYSCLK_FREQ_56MHz 56000000 */
+#define SYSCLK_FREQ_72MHz 72000000
+#endif
+
+/*!< Uncomment the following line if you need to use external SRAM mounted
+ on STM3210E-EVAL board (STM32 High density and XL-density devices) or on
+ STM32100E-EVAL board (STM32 High-density value line devices) as data memory */
+#if defined (STM32F10X_HD) || (defined STM32F10X_XL) || (defined STM32F10X_HD_VL)
+/* #define DATA_IN_ExtSRAM */
+#endif
+
+/*!< Uncomment the following line if you need to relocate your vector Table in
+ Internal SRAM. */
+/* #define VECT_TAB_SRAM */
+#define VECT_TAB_OFFSET 0x0 /*!< Vector Table base offset field.
+ This value must be a multiple of 0x200. */
+
+
+/**
+ * @}
+ */
+
+/** @addtogroup STM32F10x_System_Private_Macros
+ * @{
+ */
+
+/**
+ * @}
+ */
+
+/** @addtogroup STM32F10x_System_Private_Variables
+ * @{
+ */
+
+/*******************************************************************************
+* Clock Definitions
+*******************************************************************************/
+#ifdef SYSCLK_FREQ_HSE
+ uint32_t SystemCoreClock = SYSCLK_FREQ_HSE; /*!< System Clock Frequency (Core Clock) */
+#elif defined SYSCLK_FREQ_24MHz
+ uint32_t SystemCoreClock = SYSCLK_FREQ_24MHz; /*!< System Clock Frequency (Core Clock) */
+#elif defined SYSCLK_FREQ_36MHz
+ uint32_t SystemCoreClock = SYSCLK_FREQ_36MHz; /*!< System Clock Frequency (Core Clock) */
+#elif defined SYSCLK_FREQ_48MHz
+ uint32_t SystemCoreClock = SYSCLK_FREQ_48MHz; /*!< System Clock Frequency (Core Clock) */
+#elif defined SYSCLK_FREQ_56MHz
+ uint32_t SystemCoreClock = SYSCLK_FREQ_56MHz; /*!< System Clock Frequency (Core Clock) */
+#elif defined SYSCLK_FREQ_72MHz
+ uint32_t SystemCoreClock = SYSCLK_FREQ_72MHz; /*!< System Clock Frequency (Core Clock) */
+#else /*!< HSI Selected as System Clock source */
+ uint32_t SystemCoreClock = HSI_VALUE; /*!< System Clock Frequency (Core Clock) */
+#endif
+
+__I uint8_t AHBPrescTable[16] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 6, 7, 8, 9};
+/**
+ * @}
+ */
+
+/** @addtogroup STM32F10x_System_Private_FunctionPrototypes
+ * @{
+ */
+
+static void SetSysClock(void);
+
+#ifdef SYSCLK_FREQ_HSE
+ static void SetSysClockToHSE(void);
+#elif defined SYSCLK_FREQ_24MHz
+ static void SetSysClockTo24(void);
+#elif defined SYSCLK_FREQ_36MHz
+ static void SetSysClockTo36(void);
+#elif defined SYSCLK_FREQ_48MHz
+ static void SetSysClockTo48(void);
+#elif defined SYSCLK_FREQ_56MHz
+ static void SetSysClockTo56(void);
+#elif defined SYSCLK_FREQ_72MHz
+ static void SetSysClockTo72(void);
+#endif
+
+#ifdef DATA_IN_ExtSRAM
+ static void SystemInit_ExtMemCtl(void);
+#endif /* DATA_IN_ExtSRAM */
+
+/**
+ * @}
+ */
+
+/** @addtogroup STM32F10x_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)
+{
+ /* Reset the RCC clock configuration to the default reset state(for debug purpose) */
+ /* Set HSION bit */
+ RCC->CR |= (uint32_t)0x00000001;
+
+ /* Reset SW, HPRE, PPRE1, PPRE2, ADCPRE and MCO bits */
+#ifndef STM32F10X_CL
+ RCC->CFGR &= (uint32_t)0xF8FF0000;
+#else
+ RCC->CFGR &= (uint32_t)0xF0FF0000;
+#endif /* STM32F10X_CL */
+
+ /* Reset HSEON, CSSON and PLLON bits */
+ RCC->CR &= (uint32_t)0xFEF6FFFF;
+
+ /* Reset HSEBYP bit */
+ RCC->CR &= (uint32_t)0xFFFBFFFF;
+
+ /* Reset PLLSRC, PLLXTPRE, PLLMUL and USBPRE/OTGFSPRE bits */
+ RCC->CFGR &= (uint32_t)0xFF80FFFF;
+
+#ifdef STM32F10X_CL
+ /* Reset PLL2ON and PLL3ON bits */
+ RCC->CR &= (uint32_t)0xEBFFFFFF;
+
+ /* Disable all interrupts and clear pending bits */
+ RCC->CIR = 0x00FF0000;
+
+ /* Reset CFGR2 register */
+ RCC->CFGR2 = 0x00000000;
+#elif defined (STM32F10X_LD_VL) || defined (STM32F10X_MD_VL) || (defined STM32F10X_HD_VL)
+ /* Disable all interrupts and clear pending bits */
+ RCC->CIR = 0x009F0000;
+
+ /* Reset CFGR2 register */
+ RCC->CFGR2 = 0x00000000;
+#else
+ /* Disable all interrupts and clear pending bits */
+ RCC->CIR = 0x009F0000;
+#endif /* STM32F10X_CL */
+
+#if defined (STM32F10X_HD) || (defined STM32F10X_XL) || (defined STM32F10X_HD_VL)
+ #ifdef DATA_IN_ExtSRAM
+ SystemInit_ExtMemCtl();
+ #endif /* DATA_IN_ExtSRAM */
+#endif
+
+ /* Configure the System clock frequency, HCLK, PCLK2 and PCLK1 prescalers */
+ /* Configure the Flash Latency cycles and enable prefetch buffer */
+ SetSysClock();
+
+#ifdef VECT_TAB_SRAM
+ SCB->VTOR = SRAM_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal SRAM. */
+#else
+ SCB->VTOR = FLASH_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal FLASH. */
+#endif
+}
+
+/**
+ * @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, depedning 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 = 0, pllmull = 0, pllsource = 0;
+
+#ifdef STM32F10X_CL
+ uint32_t prediv1source = 0, prediv1factor = 0, prediv2factor = 0, pll2mull = 0;
+#endif /* STM32F10X_CL */
+
+#if defined (STM32F10X_LD_VL) || defined (STM32F10X_MD_VL) || (defined STM32F10X_HD_VL)
+ uint32_t prediv1factor = 0;
+#endif /* STM32F10X_LD_VL or STM32F10X_MD_VL or STM32F10X_HD_VL */
+
+ /* Get SYSCLK source -------------------------------------------------------*/
+ tmp = RCC->CFGR & RCC_CFGR_SWS;
+
+ switch (tmp)
+ {
+ case 0x00: /* HSI used as system clock */
+ SystemCoreClock = HSI_VALUE;
+ break;
+ case 0x04: /* HSE used as system clock */
+ SystemCoreClock = HSE_VALUE;
+ break;
+ case 0x08: /* PLL used as system clock */
+
+ /* Get PLL clock source and multiplication factor ----------------------*/
+ pllmull = RCC->CFGR & RCC_CFGR_PLLMULL;
+ pllsource = RCC->CFGR & RCC_CFGR_PLLSRC;
+
+#ifndef STM32F10X_CL
+ pllmull = ( pllmull >> 18) + 2;
+
+ if (pllsource == 0x00)
+ {
+ /* HSI oscillator clock divided by 2 selected as PLL clock entry */
+ SystemCoreClock = (HSI_VALUE >> 1) * pllmull;
+ }
+ else
+ {
+ #if defined (STM32F10X_LD_VL) || defined (STM32F10X_MD_VL) || (defined STM32F10X_HD_VL)
+ prediv1factor = (RCC->CFGR2 & RCC_CFGR2_PREDIV1) + 1;
+ /* 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 >> 1) * pllmull;
+ }
+ else
+ {
+ SystemCoreClock = HSE_VALUE * pllmull;
+ }
+ #endif
+ }
+#else
+ pllmull = pllmull >> 18;
+
+ if (pllmull != 0x0D)
+ {
+ pllmull += 2;
+ }
+ else
+ { /* PLL multiplication factor = PLL input clock * 6.5 */
+ pllmull = 13 / 2;
+ }
+
+ if (pllsource == 0x00)
+ {
+ /* HSI oscillator clock divided by 2 selected as PLL clock entry */
+ SystemCoreClock = (HSI_VALUE >> 1) * 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) + 1;
+
+ if (prediv1source == 0)
+ {
+ /* 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) >> 4) + 1;
+ pll2mull = ((RCC->CFGR2 & RCC_CFGR2_PLL2MUL) >> 8 ) + 2;
+ SystemCoreClock = (((HSE_VALUE / prediv2factor) * pll2mull) / prediv1factor) * pllmull;
+ }
+ }
+#endif /* STM32F10X_CL */
+ break;
+
+ default:
+ SystemCoreClock = HSI_VALUE;
+ break;
+ }
+
+ /* Compute HCLK clock frequency ----------------*/
+ /* Get HCLK prescaler */
+ tmp = AHBPrescTable[((RCC->CFGR & RCC_CFGR_HPRE) >> 4)];
+ /* HCLK clock frequency */
+ SystemCoreClock >>= tmp;
+}
+
+/**
+ * @brief Configures the System clock frequency, HCLK, PCLK2 and PCLK1 prescalers.
+ * @param None
+ * @retval None
+ */
+static void SetSysClock(void)
+{
+#ifdef SYSCLK_FREQ_HSE
+ SetSysClockToHSE();
+#elif defined SYSCLK_FREQ_24MHz
+ SetSysClockTo24();
+#elif defined SYSCLK_FREQ_36MHz
+ SetSysClockTo36();
+#elif defined SYSCLK_FREQ_48MHz
+ SetSysClockTo48();
+#elif defined SYSCLK_FREQ_56MHz
+ SetSysClockTo56();
+#elif defined SYSCLK_FREQ_72MHz
+ SetSysClockTo72();
+#endif
+
+ /* If none of the define above is enabled, the HSI is used as System clock
+ source (default after reset) */
+}
+
+/**
+ * @brief Setup the external memory controller. Called in startup_stm32f10x.s
+ * before jump to __main
+ * @param None
+ * @retval None
+ */
+#ifdef DATA_IN_ExtSRAM
+/**
+ * @brief Setup the external memory controller.
+ * Called in startup_stm32f10x_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)
+{
+/*!< 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 = 0x00000114;
+
+ /* Enable GPIOD, GPIOE, GPIOF and GPIOG clocks */
+ RCC->APB2ENR = 0x000001E0;
+
+/* --------------- SRAM Data lines, NOE and NWE configuration ---------------*/
+/*---------------- SRAM Address lines configuration -------------------------*/
+/*---------------- NOE and NWE configuration --------------------------------*/
+/*---------------- NE3 configuration ----------------------------------------*/
+/*---------------- NBL0, NBL1 configuration ---------------------------------*/
+
+ GPIOD->CRL = 0x44BB44BB;
+ GPIOD->CRH = 0xBBBBBBBB;
+
+ GPIOE->CRL = 0xB44444BB;
+ GPIOE->CRH = 0xBBBBBBBB;
+
+ GPIOF->CRL = 0x44BBBBBB;
+ GPIOF->CRH = 0xBBBB4444;
+
+ GPIOG->CRL = 0x44BBBBBB;
+ GPIOG->CRH = 0x44444B44;
+
+/*---------------- FSMC Configuration ---------------------------------------*/
+/*---------------- Enable FSMC Bank1_SRAM Bank ------------------------------*/
+
+ FSMC_Bank1->BTCR[4] = 0x00001011;
+ FSMC_Bank1->BTCR[5] = 0x00000200;
+}
+#endif /* DATA_IN_ExtSRAM */
+
+#ifdef SYSCLK_FREQ_HSE
+/**
+ * @brief Selects HSE as System clock source and configure HCLK, PCLK2
+ * and PCLK1 prescalers.
+ * @note This function should be used only after reset.
+ * @param None
+ * @retval None
+ */
+static void SetSysClockToHSE(void)
+{
+ __IO uint32_t StartUpCounter = 0, HSEStatus = 0;
+
+ /* SYSCLK, HCLK, PCLK2 and PCLK1 configuration ---------------------------*/
+ /* Enable HSE */
+ RCC->CR |= ((uint32_t)RCC_CR_HSEON);
+
+ /* Wait till HSE is ready and if Time out is reached exit */
+ do
+ {
+ HSEStatus = RCC->CR & RCC_CR_HSERDY;
+ StartUpCounter++;
+ } while((HSEStatus == 0) && (StartUpCounter != HSE_STARTUP_TIMEOUT));
+
+ if ((RCC->CR & RCC_CR_HSERDY) != RESET)
+ {
+ HSEStatus = (uint32_t)0x01;
+ }
+ else
+ {
+ HSEStatus = (uint32_t)0x00;
+ }
+
+ if (HSEStatus == (uint32_t)0x01)
+ {
+
+#if !defined STM32F10X_LD_VL && !defined STM32F10X_MD_VL && !defined STM32F10X_HD_VL
+ /* Enable Prefetch Buffer */
+ FLASH->ACR |= FLASH_ACR_PRFTBE;
+
+ /* Flash 0 wait state */
+ FLASH->ACR &= (uint32_t)((uint32_t)~FLASH_ACR_LATENCY);
+
+#ifndef STM32F10X_CL
+ FLASH->ACR |= (uint32_t)FLASH_ACR_LATENCY_0;
+#else
+ if (HSE_VALUE <= 24000000)
+ {
+ FLASH->ACR |= (uint32_t)FLASH_ACR_LATENCY_0;
+ }
+ else
+ {
+ FLASH->ACR |= (uint32_t)FLASH_ACR_LATENCY_1;
+ }
+#endif /* STM32F10X_CL */
+#endif
+
+ /* HCLK = SYSCLK */
+ RCC->CFGR |= (uint32_t)RCC_CFGR_HPRE_DIV1;
+
+ /* PCLK2 = HCLK */
+ RCC->CFGR |= (uint32_t)RCC_CFGR_PPRE2_DIV1;
+
+ /* PCLK1 = HCLK */
+ RCC->CFGR |= (uint32_t)RCC_CFGR_PPRE1_DIV1;
+
+ /* Select HSE as system clock source */
+ RCC->CFGR &= (uint32_t)((uint32_t)~(RCC_CFGR_SW));
+ RCC->CFGR |= (uint32_t)RCC_CFGR_SW_HSE;
+
+ /* Wait till HSE is used as system clock source */
+ while ((RCC->CFGR & (uint32_t)RCC_CFGR_SWS) != (uint32_t)0x04)
+ {
+ }
+ }
+ else
+ { /* If HSE fails to start-up, the application will have wrong clock
+ configuration. User can add here some code to deal with this error */
+ }
+}
+#elif defined SYSCLK_FREQ_24MHz
+/**
+ * @brief Sets System clock frequency to 24MHz and configure HCLK, PCLK2
+ * and PCLK1 prescalers.
+ * @note This function should be used only after reset.
+ * @param None
+ * @retval None
+ */
+static void SetSysClockTo24(void)
+{
+ __IO uint32_t StartUpCounter = 0, HSEStatus = 0;
+
+ /* SYSCLK, HCLK, PCLK2 and PCLK1 configuration ---------------------------*/
+ /* Enable HSE */
+ RCC->CR |= ((uint32_t)RCC_CR_HSEON);
+
+ /* Wait till HSE is ready and if Time out is reached exit */
+ do
+ {
+ HSEStatus = RCC->CR & RCC_CR_HSERDY;
+ StartUpCounter++;
+ } while((HSEStatus == 0) && (StartUpCounter != HSE_STARTUP_TIMEOUT));
+
+ if ((RCC->CR & RCC_CR_HSERDY) != RESET)
+ {
+ HSEStatus = (uint32_t)0x01;
+ }
+ else
+ {
+ HSEStatus = (uint32_t)0x00;
+ }
+
+ if (HSEStatus == (uint32_t)0x01)
+ {
+#if !defined STM32F10X_LD_VL && !defined STM32F10X_MD_VL && !defined STM32F10X_HD_VL
+ /* Enable Prefetch Buffer */
+ FLASH->ACR |= FLASH_ACR_PRFTBE;
+
+ /* Flash 0 wait state */
+ FLASH->ACR &= (uint32_t)((uint32_t)~FLASH_ACR_LATENCY);
+ FLASH->ACR |= (uint32_t)FLASH_ACR_LATENCY_0;
+#endif
+
+ /* HCLK = SYSCLK */
+ RCC->CFGR |= (uint32_t)RCC_CFGR_HPRE_DIV1;
+
+ /* PCLK2 = HCLK */
+ RCC->CFGR |= (uint32_t)RCC_CFGR_PPRE2_DIV1;
+
+ /* PCLK1 = HCLK */
+ RCC->CFGR |= (uint32_t)RCC_CFGR_PPRE1_DIV1;
+
+#ifdef STM32F10X_CL
+ /* Configure PLLs ------------------------------------------------------*/
+ /* PLL configuration: PLLCLK = PREDIV1 * 6 = 24 MHz */
+ RCC->CFGR &= (uint32_t)~(RCC_CFGR_PLLXTPRE | RCC_CFGR_PLLSRC | RCC_CFGR_PLLMULL);
+ RCC->CFGR |= (uint32_t)(RCC_CFGR_PLLXTPRE_PREDIV1 | RCC_CFGR_PLLSRC_PREDIV1 |
+ RCC_CFGR_PLLMULL6);
+
+ /* PLL2 configuration: PLL2CLK = (HSE / 5) * 8 = 40 MHz */
+ /* PREDIV1 configuration: PREDIV1CLK = PLL2 / 10 = 4 MHz */
+ RCC->CFGR2 &= (uint32_t)~(RCC_CFGR2_PREDIV2 | RCC_CFGR2_PLL2MUL |
+ RCC_CFGR2_PREDIV1 | RCC_CFGR2_PREDIV1SRC);
+ RCC->CFGR2 |= (uint32_t)(RCC_CFGR2_PREDIV2_DIV5 | RCC_CFGR2_PLL2MUL8 |
+ RCC_CFGR2_PREDIV1SRC_PLL2 | RCC_CFGR2_PREDIV1_DIV10);
+
+ /* Enable PLL2 */
+ RCC->CR |= RCC_CR_PLL2ON;
+ /* Wait till PLL2 is ready */
+ while((RCC->CR & RCC_CR_PLL2RDY) == 0)
+ {
+ }
+#elif defined (STM32F10X_LD_VL) || defined (STM32F10X_MD_VL) || defined (STM32F10X_HD_VL)
+ /* PLL configuration: = (HSE / 2) * 6 = 24 MHz */
+ RCC->CFGR &= (uint32_t)((uint32_t)~(RCC_CFGR_PLLSRC | RCC_CFGR_PLLXTPRE | RCC_CFGR_PLLMULL));
+ RCC->CFGR |= (uint32_t)(RCC_CFGR_PLLSRC_PREDIV1 | RCC_CFGR_PLLXTPRE_PREDIV1_Div2 | RCC_CFGR_PLLMULL6);
+#else
+ /* PLL configuration: = (HSE / 2) * 6 = 24 MHz */
+ RCC->CFGR &= (uint32_t)((uint32_t)~(RCC_CFGR_PLLSRC | RCC_CFGR_PLLXTPRE | RCC_CFGR_PLLMULL));
+ RCC->CFGR |= (uint32_t)(RCC_CFGR_PLLSRC_HSE | RCC_CFGR_PLLXTPRE_HSE_Div2 | RCC_CFGR_PLLMULL6);
+#endif /* STM32F10X_CL */
+
+ /* Enable PLL */
+ RCC->CR |= RCC_CR_PLLON;
+
+ /* Wait till PLL is ready */
+ while((RCC->CR & RCC_CR_PLLRDY) == 0)
+ {
+ }
+
+ /* Select PLL as system clock source */
+ RCC->CFGR &= (uint32_t)((uint32_t)~(RCC_CFGR_SW));
+ RCC->CFGR |= (uint32_t)RCC_CFGR_SW_PLL;
+
+ /* Wait till PLL is used as system clock source */
+ while ((RCC->CFGR & (uint32_t)RCC_CFGR_SWS) != (uint32_t)0x08)
+ {
+ }
+ }
+ else
+ { /* If HSE fails to start-up, the application will have wrong clock
+ configuration. User can add here some code to deal with this error */
+ }
+}
+#elif defined SYSCLK_FREQ_36MHz
+/**
+ * @brief Sets System clock frequency to 36MHz and configure HCLK, PCLK2
+ * and PCLK1 prescalers.
+ * @note This function should be used only after reset.
+ * @param None
+ * @retval None
+ */
+static void SetSysClockTo36(void)
+{
+ __IO uint32_t StartUpCounter = 0, HSEStatus = 0;
+
+ /* SYSCLK, HCLK, PCLK2 and PCLK1 configuration ---------------------------*/
+ /* Enable HSE */
+ RCC->CR |= ((uint32_t)RCC_CR_HSEON);
+
+ /* Wait till HSE is ready and if Time out is reached exit */
+ do
+ {
+ HSEStatus = RCC->CR & RCC_CR_HSERDY;
+ StartUpCounter++;
+ } while((HSEStatus == 0) && (StartUpCounter != HSE_STARTUP_TIMEOUT));
+
+ if ((RCC->CR & RCC_CR_HSERDY) != RESET)
+ {
+ HSEStatus = (uint32_t)0x01;
+ }
+ else
+ {
+ HSEStatus = (uint32_t)0x00;
+ }
+
+ if (HSEStatus == (uint32_t)0x01)
+ {
+ /* Enable Prefetch Buffer */
+ FLASH->ACR |= FLASH_ACR_PRFTBE;
+
+ /* Flash 1 wait state */
+ FLASH->ACR &= (uint32_t)((uint32_t)~FLASH_ACR_LATENCY);
+ FLASH->ACR |= (uint32_t)FLASH_ACR_LATENCY_1;
+
+ /* HCLK = SYSCLK */
+ RCC->CFGR |= (uint32_t)RCC_CFGR_HPRE_DIV1;
+
+ /* PCLK2 = HCLK */
+ RCC->CFGR |= (uint32_t)RCC_CFGR_PPRE2_DIV1;
+
+ /* PCLK1 = HCLK */
+ RCC->CFGR |= (uint32_t)RCC_CFGR_PPRE1_DIV1;
+
+#ifdef STM32F10X_CL
+ /* Configure PLLs ------------------------------------------------------*/
+
+ /* PLL configuration: PLLCLK = PREDIV1 * 9 = 36 MHz */
+ RCC->CFGR &= (uint32_t)~(RCC_CFGR_PLLXTPRE | RCC_CFGR_PLLSRC | RCC_CFGR_PLLMULL);
+ RCC->CFGR |= (uint32_t)(RCC_CFGR_PLLXTPRE_PREDIV1 | RCC_CFGR_PLLSRC_PREDIV1 |
+ RCC_CFGR_PLLMULL9);
+
+ /*!< PLL2 configuration: PLL2CLK = (HSE / 5) * 8 = 40 MHz */
+ /* PREDIV1 configuration: PREDIV1CLK = PLL2 / 10 = 4 MHz */
+
+ RCC->CFGR2 &= (uint32_t)~(RCC_CFGR2_PREDIV2 | RCC_CFGR2_PLL2MUL |
+ RCC_CFGR2_PREDIV1 | RCC_CFGR2_PREDIV1SRC);
+ RCC->CFGR2 |= (uint32_t)(RCC_CFGR2_PREDIV2_DIV5 | RCC_CFGR2_PLL2MUL8 |
+ RCC_CFGR2_PREDIV1SRC_PLL2 | RCC_CFGR2_PREDIV1_DIV10);
+
+ /* Enable PLL2 */
+ RCC->CR |= RCC_CR_PLL2ON;
+ /* Wait till PLL2 is ready */
+ while((RCC->CR & RCC_CR_PLL2RDY) == 0)
+ {
+ }
+
+#else
+ /* PLL configuration: PLLCLK = (HSE / 2) * 9 = 36 MHz */
+ RCC->CFGR &= (uint32_t)((uint32_t)~(RCC_CFGR_PLLSRC | RCC_CFGR_PLLXTPRE | RCC_CFGR_PLLMULL));
+ RCC->CFGR |= (uint32_t)(RCC_CFGR_PLLSRC_HSE | RCC_CFGR_PLLXTPRE_HSE_Div2 | RCC_CFGR_PLLMULL9);
+#endif /* STM32F10X_CL */
+
+ /* Enable PLL */
+ RCC->CR |= RCC_CR_PLLON;
+
+ /* Wait till PLL is ready */
+ while((RCC->CR & RCC_CR_PLLRDY) == 0)
+ {
+ }
+
+ /* Select PLL as system clock source */
+ RCC->CFGR &= (uint32_t)((uint32_t)~(RCC_CFGR_SW));
+ RCC->CFGR |= (uint32_t)RCC_CFGR_SW_PLL;
+
+ /* Wait till PLL is used as system clock source */
+ while ((RCC->CFGR & (uint32_t)RCC_CFGR_SWS) != (uint32_t)0x08)
+ {
+ }
+ }
+ else
+ { /* If HSE fails to start-up, the application will have wrong clock
+ configuration. User can add here some code to deal with this error */
+ }
+}
+#elif defined SYSCLK_FREQ_48MHz
+/**
+ * @brief Sets System clock frequency to 48MHz and configure HCLK, PCLK2
+ * and PCLK1 prescalers.
+ * @note This function should be used only after reset.
+ * @param None
+ * @retval None
+ */
+static void SetSysClockTo48(void)
+{
+ __IO uint32_t StartUpCounter = 0, HSEStatus = 0;
+
+ /* SYSCLK, HCLK, PCLK2 and PCLK1 configuration ---------------------------*/
+ /* Enable HSE */
+ RCC->CR |= ((uint32_t)RCC_CR_HSEON);
+
+ /* Wait till HSE is ready and if Time out is reached exit */
+ do
+ {
+ HSEStatus = RCC->CR & RCC_CR_HSERDY;
+ StartUpCounter++;
+ } while((HSEStatus == 0) && (StartUpCounter != HSE_STARTUP_TIMEOUT));
+
+ if ((RCC->CR & RCC_CR_HSERDY) != RESET)
+ {
+ HSEStatus = (uint32_t)0x01;
+ }
+ else
+ {
+ HSEStatus = (uint32_t)0x00;
+ }
+
+ if (HSEStatus == (uint32_t)0x01)
+ {
+ /* Enable Prefetch Buffer */
+ FLASH->ACR |= FLASH_ACR_PRFTBE;
+
+ /* Flash 1 wait state */
+ FLASH->ACR &= (uint32_t)((uint32_t)~FLASH_ACR_LATENCY);
+ FLASH->ACR |= (uint32_t)FLASH_ACR_LATENCY_1;
+
+ /* HCLK = SYSCLK */
+ RCC->CFGR |= (uint32_t)RCC_CFGR_HPRE_DIV1;
+
+ /* PCLK2 = HCLK */
+ RCC->CFGR |= (uint32_t)RCC_CFGR_PPRE2_DIV1;
+
+ /* PCLK1 = HCLK */
+ RCC->CFGR |= (uint32_t)RCC_CFGR_PPRE1_DIV2;
+
+#ifdef STM32F10X_CL
+ /* Configure PLLs ------------------------------------------------------*/
+ /* PLL2 configuration: PLL2CLK = (HSE / 5) * 8 = 40 MHz */
+ /* PREDIV1 configuration: PREDIV1CLK = PLL2 / 5 = 8 MHz */
+
+ RCC->CFGR2 &= (uint32_t)~(RCC_CFGR2_PREDIV2 | RCC_CFGR2_PLL2MUL |
+ RCC_CFGR2_PREDIV1 | RCC_CFGR2_PREDIV1SRC);
+ RCC->CFGR2 |= (uint32_t)(RCC_CFGR2_PREDIV2_DIV5 | RCC_CFGR2_PLL2MUL8 |
+ RCC_CFGR2_PREDIV1SRC_PLL2 | RCC_CFGR2_PREDIV1_DIV5);
+
+ /* Enable PLL2 */
+ RCC->CR |= RCC_CR_PLL2ON;
+ /* Wait till PLL2 is ready */
+ while((RCC->CR & RCC_CR_PLL2RDY) == 0)
+ {
+ }
+
+
+ /* PLL configuration: PLLCLK = PREDIV1 * 6 = 48 MHz */
+ RCC->CFGR &= (uint32_t)~(RCC_CFGR_PLLXTPRE | RCC_CFGR_PLLSRC | RCC_CFGR_PLLMULL);
+ RCC->CFGR |= (uint32_t)(RCC_CFGR_PLLXTPRE_PREDIV1 | RCC_CFGR_PLLSRC_PREDIV1 |
+ RCC_CFGR_PLLMULL6);
+#else
+ /* PLL configuration: PLLCLK = HSE * 6 = 48 MHz */
+ RCC->CFGR &= (uint32_t)((uint32_t)~(RCC_CFGR_PLLSRC | RCC_CFGR_PLLXTPRE | RCC_CFGR_PLLMULL));
+ RCC->CFGR |= (uint32_t)(RCC_CFGR_PLLSRC_HSE | RCC_CFGR_PLLMULL6);
+#endif /* STM32F10X_CL */
+
+ /* Enable PLL */
+ RCC->CR |= RCC_CR_PLLON;
+
+ /* Wait till PLL is ready */
+ while((RCC->CR & RCC_CR_PLLRDY) == 0)
+ {
+ }
+
+ /* Select PLL as system clock source */
+ RCC->CFGR &= (uint32_t)((uint32_t)~(RCC_CFGR_SW));
+ RCC->CFGR |= (uint32_t)RCC_CFGR_SW_PLL;
+
+ /* Wait till PLL is used as system clock source */
+ while ((RCC->CFGR & (uint32_t)RCC_CFGR_SWS) != (uint32_t)0x08)
+ {
+ }
+ }
+ else
+ { /* If HSE fails to start-up, the application will have wrong clock
+ configuration. User can add here some code to deal with this error */
+ }
+}
+
+#elif defined SYSCLK_FREQ_56MHz
+/**
+ * @brief Sets System clock frequency to 56MHz and configure HCLK, PCLK2
+ * and PCLK1 prescalers.
+ * @note This function should be used only after reset.
+ * @param None
+ * @retval None
+ */
+static void SetSysClockTo56(void)
+{
+ __IO uint32_t StartUpCounter = 0, HSEStatus = 0;
+
+ /* SYSCLK, HCLK, PCLK2 and PCLK1 configuration ---------------------------*/
+ /* Enable HSE */
+ RCC->CR |= ((uint32_t)RCC_CR_HSEON);
+
+ /* Wait till HSE is ready and if Time out is reached exit */
+ do
+ {
+ HSEStatus = RCC->CR & RCC_CR_HSERDY;
+ StartUpCounter++;
+ } while((HSEStatus == 0) && (StartUpCounter != HSE_STARTUP_TIMEOUT));
+
+ if ((RCC->CR & RCC_CR_HSERDY) != RESET)
+ {
+ HSEStatus = (uint32_t)0x01;
+ }
+ else
+ {
+ HSEStatus = (uint32_t)0x00;
+ }
+
+ if (HSEStatus == (uint32_t)0x01)
+ {
+ /* Enable Prefetch Buffer */
+ FLASH->ACR |= FLASH_ACR_PRFTBE;
+
+ /* Flash 2 wait state */
+ FLASH->ACR &= (uint32_t)((uint32_t)~FLASH_ACR_LATENCY);
+ FLASH->ACR |= (uint32_t)FLASH_ACR_LATENCY_2;
+
+ /* HCLK = SYSCLK */
+ RCC->CFGR |= (uint32_t)RCC_CFGR_HPRE_DIV1;
+
+ /* PCLK2 = HCLK */
+ RCC->CFGR |= (uint32_t)RCC_CFGR_PPRE2_DIV1;
+
+ /* PCLK1 = HCLK */
+ RCC->CFGR |= (uint32_t)RCC_CFGR_PPRE1_DIV2;
+
+#ifdef STM32F10X_CL
+ /* Configure PLLs ------------------------------------------------------*/
+ /* PLL2 configuration: PLL2CLK = (HSE / 5) * 8 = 40 MHz */
+ /* PREDIV1 configuration: PREDIV1CLK = PLL2 / 5 = 8 MHz */
+
+ RCC->CFGR2 &= (uint32_t)~(RCC_CFGR2_PREDIV2 | RCC_CFGR2_PLL2MUL |
+ RCC_CFGR2_PREDIV1 | RCC_CFGR2_PREDIV1SRC);
+ RCC->CFGR2 |= (uint32_t)(RCC_CFGR2_PREDIV2_DIV5 | RCC_CFGR2_PLL2MUL8 |
+ RCC_CFGR2_PREDIV1SRC_PLL2 | RCC_CFGR2_PREDIV1_DIV5);
+
+ /* Enable PLL2 */
+ RCC->CR |= RCC_CR_PLL2ON;
+ /* Wait till PLL2 is ready */
+ while((RCC->CR & RCC_CR_PLL2RDY) == 0)
+ {
+ }
+
+
+ /* PLL configuration: PLLCLK = PREDIV1 * 7 = 56 MHz */
+ RCC->CFGR &= (uint32_t)~(RCC_CFGR_PLLXTPRE | RCC_CFGR_PLLSRC | RCC_CFGR_PLLMULL);
+ RCC->CFGR |= (uint32_t)(RCC_CFGR_PLLXTPRE_PREDIV1 | RCC_CFGR_PLLSRC_PREDIV1 |
+ RCC_CFGR_PLLMULL7);
+#else
+ /* PLL configuration: PLLCLK = HSE * 7 = 56 MHz */
+ RCC->CFGR &= (uint32_t)((uint32_t)~(RCC_CFGR_PLLSRC | RCC_CFGR_PLLXTPRE | RCC_CFGR_PLLMULL));
+ RCC->CFGR |= (uint32_t)(RCC_CFGR_PLLSRC_HSE | RCC_CFGR_PLLMULL7);
+
+#endif /* STM32F10X_CL */
+
+ /* Enable PLL */
+ RCC->CR |= RCC_CR_PLLON;
+
+ /* Wait till PLL is ready */
+ while((RCC->CR & RCC_CR_PLLRDY) == 0)
+ {
+ }
+
+ /* Select PLL as system clock source */
+ RCC->CFGR &= (uint32_t)((uint32_t)~(RCC_CFGR_SW));
+ RCC->CFGR |= (uint32_t)RCC_CFGR_SW_PLL;
+
+ /* Wait till PLL is used as system clock source */
+ while ((RCC->CFGR & (uint32_t)RCC_CFGR_SWS) != (uint32_t)0x08)
+ {
+ }
+ }
+ else
+ { /* If HSE fails to start-up, the application will have wrong clock
+ configuration. User can add here some code to deal with this error */
+ }
+}
+
+#elif defined SYSCLK_FREQ_72MHz
+/**
+ * @brief Sets System clock frequency to 72MHz and configure HCLK, PCLK2
+ * and PCLK1 prescalers.
+ * @note This function should be used only after reset.
+ * @param None
+ * @retval None
+ */
+static void SetSysClockTo72(void)
+{
+ __IO uint32_t StartUpCounter = 0, HSEStatus = 0;
+
+ /* SYSCLK, HCLK, PCLK2 and PCLK1 configuration ---------------------------*/
+ /* Enable HSE */
+ RCC->CR |= ((uint32_t)RCC_CR_HSEON);
+
+ /* Wait till HSE is ready and if Time out is reached exit */
+ do
+ {
+ HSEStatus = RCC->CR & RCC_CR_HSERDY;
+ StartUpCounter++;
+ } while((HSEStatus == 0) && (StartUpCounter != HSE_STARTUP_TIMEOUT));
+
+ if ((RCC->CR & RCC_CR_HSERDY) != RESET)
+ {
+ HSEStatus = (uint32_t)0x01;
+ }
+ else
+ {
+ HSEStatus = (uint32_t)0x00;
+ }
+
+ if (HSEStatus == (uint32_t)0x01)
+ {
+ /* Enable Prefetch Buffer */
+ FLASH->ACR |= FLASH_ACR_PRFTBE;
+
+ /* Flash 2 wait state */
+ FLASH->ACR &= (uint32_t)((uint32_t)~FLASH_ACR_LATENCY);
+ FLASH->ACR |= (uint32_t)FLASH_ACR_LATENCY_2;
+
+
+ /* HCLK = SYSCLK */
+ RCC->CFGR |= (uint32_t)RCC_CFGR_HPRE_DIV1;
+
+ /* PCLK2 = HCLK */
+ RCC->CFGR |= (uint32_t)RCC_CFGR_PPRE2_DIV1;
+
+ /* PCLK1 = HCLK */
+ RCC->CFGR |= (uint32_t)RCC_CFGR_PPRE1_DIV2;
+
+#ifdef STM32F10X_CL
+ /* Configure PLLs ------------------------------------------------------*/
+ /* PLL2 configuration: PLL2CLK = (HSE / 5) * 8 = 40 MHz */
+ /* PREDIV1 configuration: PREDIV1CLK = PLL2 / 5 = 8 MHz */
+
+ RCC->CFGR2 &= (uint32_t)~(RCC_CFGR2_PREDIV2 | RCC_CFGR2_PLL2MUL |
+ RCC_CFGR2_PREDIV1 | RCC_CFGR2_PREDIV1SRC);
+ RCC->CFGR2 |= (uint32_t)(RCC_CFGR2_PREDIV2_DIV5 | RCC_CFGR2_PLL2MUL8 |
+ RCC_CFGR2_PREDIV1SRC_PLL2 | RCC_CFGR2_PREDIV1_DIV5);
+
+ /* Enable PLL2 */
+ RCC->CR |= RCC_CR_PLL2ON;
+ /* Wait till PLL2 is ready */
+ while((RCC->CR & RCC_CR_PLL2RDY) == 0)
+ {
+ }
+
+
+ /* PLL configuration: PLLCLK = PREDIV1 * 9 = 72 MHz */
+ RCC->CFGR &= (uint32_t)~(RCC_CFGR_PLLXTPRE | RCC_CFGR_PLLSRC | RCC_CFGR_PLLMULL);
+ RCC->CFGR |= (uint32_t)(RCC_CFGR_PLLXTPRE_PREDIV1 | RCC_CFGR_PLLSRC_PREDIV1 |
+ RCC_CFGR_PLLMULL9);
+#else
+ /* PLL configuration: PLLCLK = HSE * 9 = 72 MHz */
+ RCC->CFGR &= (uint32_t)((uint32_t)~(RCC_CFGR_PLLSRC | RCC_CFGR_PLLXTPRE |
+ RCC_CFGR_PLLMULL));
+ RCC->CFGR |= (uint32_t)(RCC_CFGR_PLLSRC_HSE | RCC_CFGR_PLLMULL9);
+#endif /* STM32F10X_CL */
+
+ /* Enable PLL */
+ RCC->CR |= RCC_CR_PLLON;
+
+ /* Wait till PLL is ready */
+ while((RCC->CR & RCC_CR_PLLRDY) == 0)
+ {
+ }
+
+ /* Select PLL as system clock source */
+ RCC->CFGR &= (uint32_t)((uint32_t)~(RCC_CFGR_SW));
+ RCC->CFGR |= (uint32_t)RCC_CFGR_SW_PLL;
+
+ /* Wait till PLL is used as system clock source */
+ while ((RCC->CFGR & (uint32_t)RCC_CFGR_SWS) != (uint32_t)0x08)
+ {
+ }
+ }
+ else
+ { /* If HSE fails to start-up, the application will have wrong clock
+ configuration. User can add here some code to deal with this error */
+ }
+}
+#endif
+
+/**
+ * @}
+ */
+
+/**
+ * @}
+ */
+
+/**
+ * @}
+ */
+/******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/
diff --git a/Firmware/CubeIDE/Code/inc/adc.h b/Firmware/CubeIDE/Code/inc/adc.h
new file mode 100644
index 0000000..1f9c5c6
--- /dev/null
+++ b/Firmware/CubeIDE/Code/inc/adc.h
@@ -0,0 +1,12 @@
+/*
+ ELEPH - Local Relative Navigation System
+
+ Copyright (C) 2021 Feruz Topalov
+ Released under the GNU General Public License v3.0
+
+ file: adc.h
+*/
+
+void adc_init(void);
+uint8_t adc_get_bat_voltage(void);
+float get_bat_voltage(void);
diff --git a/Firmware/CubeIDE/Code/inc/buttons.h b/Firmware/CubeIDE/Code/inc/buttons.h
new file mode 100644
index 0000000..b70d75c
--- /dev/null
+++ b/Firmware/CubeIDE/Code/inc/buttons.h
@@ -0,0 +1,29 @@
+/*
+ ELEPH - Local Relative Navigation System
+
+ Copyright (C) 2021 Feruz Topalov
+ Released under the GNU General Public License v3.0
+
+ file: buttons.h
+*/
+
+#define BTN_NO_ACTION (0)
+
+#define BTN_UP (1) //PA1
+#define BTN_UP_LONG (2)
+
+#define BTN_DOWN (3) //PA2
+#define BTN_DOWN_LONG (4)
+
+#define BTN_OK (5) //PA3
+#define BTN_OK_LONG (6)
+
+#define BTN_PWR (7) //PA4
+#define BTN_PWR_LONG (8)
+
+#define BTN_ESC (9) //PA5
+#define BTN_ESC_LONG (10)
+
+
+
+uint8_t scan_buttons(void);
diff --git a/Firmware/CubeIDE/Code/inc/gpio.h b/Firmware/CubeIDE/Code/inc/gpio.h
new file mode 100644
index 0000000..3683b2e
--- /dev/null
+++ b/Firmware/CubeIDE/Code/inc/gpio.h
@@ -0,0 +1,36 @@
+/*
+ ELEPH - Local Relative Navigation System
+
+ Copyright (C) 2021 Feruz Topalov
+ Released under the GNU General Public License v3.0
+
+ file: gpio.h
+*/
+
+void gpio_init(void);
+void ext_int_init(void);
+
+void led_board_on(void);
+void led_board_off(void);
+void led_red_on(void);
+void led_red_off(void);
+void led_green_on(void);
+void led_green_off(void);
+
+void sdn_si4463_active(void);
+void sdn_si4463_inactive(void);
+
+void cs_si4463_active(void);
+void cs_si4463_inactive(void);
+
+void res_ssd1306_active(void);
+void res_ssd1306_inactive(void);
+
+void ssd1306_data_mode(void);
+void ssd1306_command_mode(void);
+
+void cs_ssd1306_active(void);
+void cs_ssd1306_inactive(void);
+
+void bat_mon_on(void);
+void bat_mon_off(void);
diff --git a/Firmware/CubeIDE/Code/inc/gps.h b/Firmware/CubeIDE/Code/inc/gps.h
new file mode 100644
index 0000000..ab908ec
--- /dev/null
+++ b/Firmware/CubeIDE/Code/inc/gps.h
@@ -0,0 +1,79 @@
+/*
+ ELEPH - Local Relative Navigation System
+
+ Copyright (C) 2021 Feruz Topalov
+ Released under the GNU General Public License v3.0
+
+ file: gps.h
+*/
+
+#define GPS_DATA_INVALID (0)
+#define GPS_DATA_VALID (1)
+#define GPS_POSITION_NOFIX (1)
+#define GPS_POSITION_2DFIX (2)
+#define GPS_POSITION_3DFIX (3)
+
+
+
+//GPS data from GNSS module (raw)
+#define CHAR_RESERVE (2)
+struct gps_raw_struct
+{
+ char time[sizeof("hhmmss.ss") + CHAR_RESERVE]; //UTC Time
+ char date[sizeof("ddmmyy") + CHAR_RESERVE]; //UTC Date
+ char latitude[sizeof("ddmm.mmmm") + CHAR_RESERVE]; //Shirota
+ char ns[sizeof("x") + CHAR_RESERVE]; //Northing
+ char longitude[sizeof("dddmm.mmmm") + CHAR_RESERVE]; //Dolgota
+ char ew[sizeof("x") + CHAR_RESERVE]; //Easting
+ char speed[sizeof("xxx.yyy") + CHAR_RESERVE]; //Speed over ground, knots
+ char course[sizeof("xxx.y") + CHAR_RESERVE]; //Course over ground, deg
+ char status[sizeof("x") + CHAR_RESERVE]; //A=Valid, V=Invalid
+ char altitude[sizeof("aaaaa.a") + CHAR_RESERVE]; //Altitude above means sea level, meters probably
+ char sat_view[sizeof("nn") + CHAR_RESERVE]; //Number of SVs used for navigation
+ char sat_used[sizeof("nn") + CHAR_RESERVE]; //Number of SVs used for navigation
+ char mode[sizeof("x") + CHAR_RESERVE]; //0=No, 1=2D, 2=3D
+ char pdop[sizeof("xx.yy") + CHAR_RESERVE]; //Positional dilution of precision
+};
+
+
+
+//Similar to (but not the same as) gps_raw_struct, in numerical format
+struct gps_num_struct
+{
+ uint8_t hour; //UTC Time
+ uint8_t minute;
+ uint8_t second;
+
+ uint8_t day; //UTC Date
+ uint8_t month;
+ uint8_t year;
+
+ struct {
+ float in_deg; //Lat in decimal deg
+ double in_rad; //in radians (converted), scaled to double to improve relative pos calculation accuracy
+ } latitude;
+
+ struct {
+ float in_deg; //Lon in decimal deg
+ double in_rad; //in radians (converted), scaled to double to improve relative pos calculation accuracy
+ } longitude;
+
+ float speed; //kilometers per hour (converted)
+ float course; //decimal degrees
+ float altitude; //meters above means sea level, signed
+
+ uint8_t sat_view;
+ uint8_t sat_used;
+
+ uint8_t status; //0=Invalid, 1=Valid
+ uint8_t mode; //1=NoFix, 2=2D, 3=3D
+ float pdop;
+};
+
+
+
+uint8_t parse_gps(void);
+char *get_nmea_buf(void);
+struct gps_raw_struct *get_gps_raw(void);
+struct gps_num_struct *get_gps_num(void);
+uint8_t get_gps_status(void);
diff --git a/Firmware/CubeIDE/Code/inc/i2c.h b/Firmware/CubeIDE/Code/inc/i2c.h
new file mode 100644
index 0000000..04cb83f
--- /dev/null
+++ b/Firmware/CubeIDE/Code/inc/i2c.h
@@ -0,0 +1,10 @@
+/*
+ ELEPH - Local Relative Navigation System
+
+ Copyright (C) 2021 Feruz Topalov
+ Released under the GNU General Public License v3.0
+
+ file: i2c.h
+*/
+
+void i2c_init(void);
diff --git a/Firmware/CubeIDE/Code/inc/lrns.h b/Firmware/CubeIDE/Code/inc/lrns.h
new file mode 100644
index 0000000..d361b6c
--- /dev/null
+++ b/Firmware/CubeIDE/Code/inc/lrns.h
@@ -0,0 +1,115 @@
+/*
+ ELEPH - Local Relative Navigation System
+
+ Copyright (C) 2021 Feruz Topalov
+ Released under the GNU General Public License v3.0
+
+ file: lrns.h
+*/
+
+extern const double deg_to_rad; //deg to rad multiplyer
+
+
+
+//DEVICES
+#define DEVICES_IN_GROUP (6) //total number of devices in group
+
+
+
+#define FLAGS_BATTERY (1)
+#define FLAGS_GPS_FIX (2)
+#define FLAGS_PDOP (3)
+#define FLAGS_ALARM (4)
+
+#define FLAG_BATTERY_0_TO_10 (0)
+#define FLAG_BATTERY_10_TO_25 (1)
+#define FLAG_BATTERY_25_TO_50 (2)
+#define FLAG_BATTERY_50_TO_75 (3)
+#define FLAG_BATTERY_75_TO_100 (4)
+#define FLAG_GPS_FIX_2D (0)
+#define FLAG_GPS_FIX_3D (1)
+#define FLAG_PDOP_BAD (0)
+#define FLAG_PDOP_GOOD (1)
+#define FLAG_ALARM_OFF (0)
+#define FLAG_ALARM_ON (1)
+
+
+
+void init_lrns(void);
+void set_device_flags(uint8_t parameter_to_set, uint8_t parameter_value);
+uint8_t get_device_flags(uint8_t device_number, uint8_t parameter_to_get);
+
+uint8_t check_alarms(void);
+void calc_timeout(uint32_t current_uptime);
+uint8_t check_timeout(void);
+uint8_t check_fence(void);
+
+void process_all_devices(void);
+
+void gps_air_update_my_data(uint32_t uptime);
+void fill_air_packet_with_struct_data(void);
+uint8_t fill_struct_with_air_packet_data(uint32_t uptime);
+void calc_relative_position(uint8_t another_device);
+
+struct gps_air_struct **get_gps_air(void);
+struct gps_rel_struct **get_gps_rel(void);
+struct dev_aux_struct **get_dev_aux(void);
+
+
+
+//Data to be transferred over-the-air
+struct gps_air_struct
+{
+ char device_id[DEVICE_ID_LEN]; //user id, ASCII symbols
+ uint8_t flags; //device flags
+
+ union
+ {
+ float as_float; //latitude in decimal degrees (-90...+90)
+ uint8_t as_array[4];
+ } latitude;
+
+ union
+ {
+ float as_float; //longitude in decimal degrees (-180...+180)
+ uint8_t as_array[4];
+ } longitude;
+
+ union
+ {
+ int16_t as_integer; //altitude in meters, signed
+ uint8_t as_array[2];
+ } altitude;
+
+ uint8_t speed; //speed in km/h, unsigned
+
+ union
+ {
+ uint16_t as_integer; //course in degrees, unsigned
+ uint8_t as_array[2];
+ } course;
+};
+
+
+
+//Data with relative position info
+struct gps_rel_struct
+{
+ uint32_t distance; //distance in meters between this device and another one
+ uint16_t heading; //heading to another device, degrees
+ int16_t altitude_diff; //difference in altitudes, in meters, signed
+};
+
+
+
+//Auxiliary information about devices
+struct dev_aux_struct
+{
+ uint8_t exist_flag; //is this device exist? (i.e. at least one successful receprion is exist)
+ uint32_t timestamp; //"uptime" value at the moment of packet reception
+ uint32_t timeout; //timeout value at the moment of calculation via check_timeout(); equals uptime-timestamp
+ uint8_t timeout_flag; //flag, indicates that timeout occured
+ uint8_t fence_flag; //indicates if distance to a device is bigger than predefined fence radius
+ uint8_t memory_point_flag; //is this device was loaded as a point from memory?
+ char point_name[MEMORY_POINT_NAME_LENGTH + 1]; //user-defined point name in the slot
+};
diff --git a/Firmware/CubeIDE/Code/inc/m24c64.h b/Firmware/CubeIDE/Code/inc/m24c64.h
new file mode 100644
index 0000000..fa04220
--- /dev/null
+++ b/Firmware/CubeIDE/Code/inc/m24c64.h
@@ -0,0 +1,19 @@
+/*
+ ELEPH - Local Relative Navigation System
+
+ Copyright (C) 2021 Feruz Topalov
+ Released under the GNU General Public License v3.0
+
+ file: m24c64.h
+*/
+
+#define M24C64_PAGE_SIZE (32)
+#define M24C64_EMPTY_CELL_VALUE (0xFF)
+
+uint8_t m24c64_poll(void);
+uint8_t m24c64_read_byte(uint16_t memory_address);
+void m24c64_write_byte(uint8_t data_byte, uint16_t memory_address);
+void m24c64_read_page(uint8_t data_array[], uint8_t page_address);
+void m24c64_write_page(uint8_t data_array[], uint8_t page_address);
+void m24c64_erase_page(uint8_t page_address);
+void m24c64_erase_all(void);
diff --git a/Firmware/CubeIDE/Code/inc/main.h b/Firmware/CubeIDE/Code/inc/main.h
new file mode 100644
index 0000000..d0484a0
--- /dev/null
+++ b/Firmware/CubeIDE/Code/inc/main.h
@@ -0,0 +1,23 @@
+/*
+ ELEPH - Local Relative Navigation System
+
+ Copyright (C) 2021 Feruz Topalov
+ Released under the GNU General Public License v3.0
+
+ file: main.h
+*/
+
+uint32_t get_uptime(void);
+struct main_flags_struct *get_main_flags(void);
+
+
+
+struct main_flags_struct
+{
+ uint8_t gps_ready;
+ uint8_t gps_sync;
+ uint8_t rx_ready;
+ uint8_t time_slots_end;
+ uint8_t battery_low;
+ uint8_t act_status;
+};
diff --git a/Firmware/CubeIDE/Code/inc/menu.h b/Firmware/CubeIDE/Code/inc/menu.h
new file mode 100644
index 0000000..fd4fe16
--- /dev/null
+++ b/Firmware/CubeIDE/Code/inc/menu.h
@@ -0,0 +1,12 @@
+/*
+ ELEPH - Local Relative Navigation System
+
+ Copyright (C) 2021 Feruz Topalov
+ Released under the GNU General Public License v3.0
+
+ file: menu.h
+*/
+
+void init_menu(void);
+void change_menu(uint8_t button_code);
+void draw_current_menu(void);
diff --git a/Firmware/CubeIDE/Code/inc/points.h b/Firmware/CubeIDE/Code/inc/points.h
new file mode 100644
index 0000000..3e5cbd6
--- /dev/null
+++ b/Firmware/CubeIDE/Code/inc/points.h
@@ -0,0 +1,30 @@
+/*
+ ELEPH - Local Relative Navigation System
+
+ Copyright (C) 2021 Feruz Topalov
+ Released under the GNU General Public License v3.0
+
+ file: points.h
+*/
+
+#define MEMORY_POINT_NAME_LENGTH (5) //excluding string-end symbol \0
+#define MEMORY_SLOTS_TOTAL (5)
+
+
+
+void init_points(void);
+struct memory_slot_struct **get_memory_slot(void);
+void read_memory_slots(void);
+void save_memory_point(uint8_t dev_num, char *point_name, uint8_t slot_num);
+void load_memory_point(uint8_t dev_num, uint8_t slot_num);
+void delete_memory_point(uint8_t slot_num);
+
+
+
+struct memory_slot_struct
+{
+ uint8_t exist_flag; //is this point exist (was previously saved) in memory?
+ char slot_name[sizeof("SX")]; //slot name S1...S5, not user-defined
+ char point_name[MEMORY_POINT_NAME_LENGTH + 1]; //user-defined point name in the slot
+ char save_date[sizeof("ddmmyy")]; //point save date
+};
diff --git a/Firmware/CubeIDE/Code/inc/radio_config_Si4463.h b/Firmware/CubeIDE/Code/inc/radio_config_Si4463.h
new file mode 100644
index 0000000..62d0eae
--- /dev/null
+++ b/Firmware/CubeIDE/Code/inc/radio_config_Si4463.h
@@ -0,0 +1,633 @@
+/*! @file radio_config.h
+ * @brief This file contains the automatically generated
+ * configurations.
+ *
+ * @n WDS GUI Version: 3.2.11.0
+ * @n Device: Si4463 Rev.: B1
+ *
+ * @b COPYRIGHT
+ * @n Silicon Laboratories Confidential
+ * @n Copyright 2017 Silicon Laboratories, Inc.
+ * @n http://www.silabs.com
+ */
+
+#ifndef RADIO_CONFIG_H_
+#define RADIO_CONFIG_H_
+
+// USER DEFINED PARAMETERS
+// Define your own parameters here
+
+// INPUT DATA
+/*
+// Crys_freq(Hz): 26000000 Crys_tol(ppm): 50 IF_mode: 2 High_perf_Ch_Fil: 1 OSRtune: 0 Ch_Fil_Bw_AFC: 1 ANT_DIV: 0 PM_pattern: 0
+// MOD_type: 3 Rsymb(sps): 3000 Fdev(Hz): 6000 RXBW(Hz): 100000 Manchester: 0 AFC_en: 1 Rsymb_error: 0.0 Chip-Version: 2
+// RF Freq.(MHz): 433.05 API_TC: 29 fhst: 25000 inputBW: 0 BERT: 0 RAW_dout: 0 D_source: 0 Hi_pfm_div: 1
+//
+// # RX IF frequency is -406250 Hz
+// # WB filter 1 (BW = 99.20 kHz); NB-filter 15 (BW = 22.48 kHz)
+//
+// Modulation index: 4
+*/
+
+
+// CONFIGURATION PARAMETERS
+#define RADIO_CONFIGURATION_DATA_RADIO_XO_FREQ 26000000L
+#define RADIO_CONFIGURATION_DATA_CHANNEL_NUMBER 0x01
+#define RADIO_CONFIGURATION_DATA_RADIO_PACKET_LENGTH 0x07
+#define RADIO_CONFIGURATION_DATA_RADIO_STATE_AFTER_POWER_UP 0x03
+#define RADIO_CONFIGURATION_DATA_RADIO_DELAY_CNT_AFTER_RESET 0xF000
+
+
+// CONFIGURATION COMMANDS
+
+/*
+// Command: RF_POWER_UP
+// Description: Command to power-up the device and select the operational mode and functionality.
+*/
+#define RF_POWER_UP 0x02, 0x01, 0x00, 0x01, 0x8C, 0xBA, 0x80
+
+/*
+// Command: RF_GPIO_PIN_CFG
+// Description: Configures the GPIO pins.
+*/
+#define RF_GPIO_PIN_CFG 0x13, 0x44, 0x08, 0x21, 0x20, 0x00, 0x00, 0x00
+
+/*
+// Set properties: RF_GLOBAL_XO_TUNE_2
+// Number of properties: 2
+// Group ID: 0x00
+// Start ID: 0x00
+// Default values: 0x40, 0x00,
+// Descriptions:
+// GLOBAL_XO_TUNE - Configure the internal capacitor frequency tuning bank for the crystal oscillator.
+// GLOBAL_CLK_CFG - Clock configuration options.
+*/
+#define RF_GLOBAL_XO_TUNE_2 0x11, 0x00, 0x02, 0x00, 0x46, 0x00
+
+/*
+// Set properties: RF_GLOBAL_CONFIG_1
+// Number of properties: 1
+// Group ID: 0x00
+// Start ID: 0x03
+// Default values: 0x20,
+// Descriptions:
+// GLOBAL_CONFIG - Global configuration settings.
+*/
+#define RF_GLOBAL_CONFIG_1 0x11, 0x00, 0x01, 0x03, 0x60
+
+/*
+// Set properties: RF_INT_CTL_ENABLE_2
+// Number of properties: 2
+// Group ID: 0x01
+// Start ID: 0x00
+// Default values: 0x04, 0x00,
+// Descriptions:
+// INT_CTL_ENABLE - This property provides for global enabling of the three interrupt groups (Chip, Modem and Packet Handler) in order to generate HW interrupts at the NIRQ pin.
+// INT_CTL_PH_ENABLE - Enable individual interrupt sources within the Packet Handler Interrupt Group to generate a HW interrupt on the NIRQ output pin.
+*/
+#define RF_INT_CTL_ENABLE_2 0x11, 0x01, 0x02, 0x00, 0x01, 0x18
+
+/*
+// Set properties: RF_FRR_CTL_A_MODE_4
+// Number of properties: 4
+// Group ID: 0x02
+// Start ID: 0x00
+// Default values: 0x01, 0x02, 0x09, 0x00,
+// Descriptions:
+// FRR_CTL_A_MODE - Fast Response Register A Configuration.
+// FRR_CTL_B_MODE - Fast Response Register B Configuration.
+// FRR_CTL_C_MODE - Fast Response Register C Configuration.
+// FRR_CTL_D_MODE - Fast Response Register D Configuration.
+*/
+#define RF_FRR_CTL_A_MODE_4 0x11, 0x02, 0x04, 0x00, 0x0A, 0x00, 0x00, 0x00
+
+/*
+// Set properties: RF_PREAMBLE_TX_LENGTH_9
+// Number of properties: 9
+// Group ID: 0x10
+// Start ID: 0x00
+// Default values: 0x08, 0x14, 0x00, 0x0F, 0x21, 0x00, 0x00, 0x00, 0x00,
+// Descriptions:
+// PREAMBLE_TX_LENGTH - Configure length of TX Preamble.
+// PREAMBLE_CONFIG_STD_1 - Configuration of reception of a packet with a Standard Preamble pattern.
+// PREAMBLE_CONFIG_NSTD - Configuration of transmission/reception of a packet with a Non-Standard Preamble pattern.
+// PREAMBLE_CONFIG_STD_2 - Configuration of timeout periods during reception of a packet with Standard Preamble pattern.
+// PREAMBLE_CONFIG - General configuration bits for the Preamble field.
+// PREAMBLE_PATTERN_31_24 - Configuration of the bit values describing a Non-Standard Preamble pattern.
+// PREAMBLE_PATTERN_23_16 - Configuration of the bit values describing a Non-Standard Preamble pattern.
+// PREAMBLE_PATTERN_15_8 - Configuration of the bit values describing a Non-Standard Preamble pattern.
+// PREAMBLE_PATTERN_7_0 - Configuration of the bit values describing a Non-Standard Preamble pattern.
+*/
+#define RF_PREAMBLE_TX_LENGTH_9 0x11, 0x10, 0x09, 0x00, 0x08, 0x14, 0x00, 0x0F, 0x31, 0x00, 0x00, 0x00, 0x00
+
+/*
+// Set properties: RF_SYNC_CONFIG_5
+// Number of properties: 5
+// Group ID: 0x11
+// Start ID: 0x00
+// Default values: 0x01, 0x2D, 0xD4, 0x2D, 0xD4,
+// Descriptions:
+// SYNC_CONFIG - Sync Word configuration bits.
+// SYNC_BITS_31_24 - Sync word.
+// SYNC_BITS_23_16 - Sync word.
+// SYNC_BITS_15_8 - Sync word.
+// SYNC_BITS_7_0 - Sync word.
+*/
+#define RF_SYNC_CONFIG_5 0x11, 0x11, 0x05, 0x00, 0x01, 0xB4, 0x2B, 0x00, 0x00
+
+/*
+// Set properties: RF_PKT_CRC_CONFIG_7
+// Number of properties: 7
+// Group ID: 0x12
+// Start ID: 0x00
+// Default values: 0x00, 0x01, 0x08, 0xFF, 0xFF, 0x00, 0x00,
+// Descriptions:
+// PKT_CRC_CONFIG - Select a CRC polynomial and seed.
+// PKT_WHT_POLY_15_8 - 16-bit polynomial value for the PN Generator (e.g., for Data Whitening)
+// PKT_WHT_POLY_7_0 - 16-bit polynomial value for the PN Generator (e.g., for Data Whitening)
+// PKT_WHT_SEED_15_8 - 16-bit seed value for the PN Generator (e.g., for Data Whitening)
+// PKT_WHT_SEED_7_0 - 16-bit seed value for the PN Generator (e.g., for Data Whitening)
+// PKT_WHT_BIT_NUM - Selects which bit of the LFSR (used to generate the PN / data whitening sequence) is used as the output bit for data scrambling.
+// PKT_CONFIG1 - General configuration bits for transmission or reception of a packet.
+*/
+#define RF_PKT_CRC_CONFIG_7 0x11, 0x12, 0x07, 0x00, 0x84, 0x01, 0x08, 0xFF, 0xFF, 0x00, 0x02
+
+/*
+// Set properties: RF_PKT_LEN_12
+// Number of properties: 12
+// Group ID: 0x12
+// Start ID: 0x08
+// Default values: 0x00, 0x00, 0x00, 0x30, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+// Descriptions:
+// PKT_LEN - Configuration bits for reception of a variable length packet.
+// PKT_LEN_FIELD_SOURCE - Field number containing the received packet length byte(s).
+// PKT_LEN_ADJUST - Provides for adjustment/offset of the received packet length value (in order to accommodate a variety of methods of defining total packet length).
+// PKT_TX_THRESHOLD - TX FIFO almost empty threshold.
+// PKT_RX_THRESHOLD - RX FIFO Almost Full threshold.
+// PKT_FIELD_1_LENGTH_12_8 - Unsigned 13-bit Field 1 length value.
+// PKT_FIELD_1_LENGTH_7_0 - Unsigned 13-bit Field 1 length value.
+// PKT_FIELD_1_CONFIG - General data processing and packet configuration bits for Field 1.
+// PKT_FIELD_1_CRC_CONFIG - Configuration of CRC control bits across Field 1.
+// PKT_FIELD_2_LENGTH_12_8 - Unsigned 13-bit Field 2 length value.
+// PKT_FIELD_2_LENGTH_7_0 - Unsigned 13-bit Field 2 length value.
+// PKT_FIELD_2_CONFIG - General data processing and packet configuration bits for Field 2.
+*/
+#define RF_PKT_LEN_12 0x11, 0x12, 0x0C, 0x08, 0x00, 0x00, 0x00, 0x30, 0x30, 0x00, 0x11, 0x04, 0xAA, 0x00, 0x00, 0x00
+
+/*
+// Set properties: RF_PKT_FIELD_2_CRC_CONFIG_12
+// Number of properties: 12
+// Group ID: 0x12
+// Start ID: 0x14
+// Default values: 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+// Descriptions:
+// PKT_FIELD_2_CRC_CONFIG - Configuration of CRC control bits across Field 2.
+// PKT_FIELD_3_LENGTH_12_8 - Unsigned 13-bit Field 3 length value.
+// PKT_FIELD_3_LENGTH_7_0 - Unsigned 13-bit Field 3 length value.
+// PKT_FIELD_3_CONFIG - General data processing and packet configuration bits for Field 3.
+// PKT_FIELD_3_CRC_CONFIG - Configuration of CRC control bits across Field 3.
+// PKT_FIELD_4_LENGTH_12_8 - Unsigned 13-bit Field 4 length value.
+// PKT_FIELD_4_LENGTH_7_0 - Unsigned 13-bit Field 4 length value.
+// PKT_FIELD_4_CONFIG - General data processing and packet configuration bits for Field 4.
+// PKT_FIELD_4_CRC_CONFIG - Configuration of CRC control bits across Field 4.
+// PKT_FIELD_5_LENGTH_12_8 - Unsigned 13-bit Field 5 length value.
+// PKT_FIELD_5_LENGTH_7_0 - Unsigned 13-bit Field 5 length value.
+// PKT_FIELD_5_CONFIG - General data processing and packet configuration bits for Field 5.
+*/
+#define RF_PKT_FIELD_2_CRC_CONFIG_12 0x11, 0x12, 0x0C, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+
+/*
+// Set properties: RF_PKT_FIELD_5_CRC_CONFIG_12
+// Number of properties: 12
+// Group ID: 0x12
+// Start ID: 0x20
+// Default values: 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+// Descriptions:
+// PKT_FIELD_5_CRC_CONFIG - Configuration of CRC control bits across Field 5.
+// PKT_RX_FIELD_1_LENGTH_12_8 - Unsigned 13-bit RX Field 1 length value.
+// PKT_RX_FIELD_1_LENGTH_7_0 - Unsigned 13-bit RX Field 1 length value.
+// PKT_RX_FIELD_1_CONFIG - General data processing and packet configuration bits for RX Field 1.
+// PKT_RX_FIELD_1_CRC_CONFIG - Configuration of CRC control bits across RX Field 1.
+// PKT_RX_FIELD_2_LENGTH_12_8 - Unsigned 13-bit RX Field 2 length value.
+// PKT_RX_FIELD_2_LENGTH_7_0 - Unsigned 13-bit RX Field 2 length value.
+// PKT_RX_FIELD_2_CONFIG - General data processing and packet configuration bits for RX Field 2.
+// PKT_RX_FIELD_2_CRC_CONFIG - Configuration of CRC control bits across RX Field 2.
+// PKT_RX_FIELD_3_LENGTH_12_8 - Unsigned 13-bit RX Field 3 length value.
+// PKT_RX_FIELD_3_LENGTH_7_0 - Unsigned 13-bit RX Field 3 length value.
+// PKT_RX_FIELD_3_CONFIG - General data processing and packet configuration bits for RX Field 3.
+*/
+#define RF_PKT_FIELD_5_CRC_CONFIG_12 0x11, 0x12, 0x0C, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+
+/*
+// Set properties: RF_PKT_RX_FIELD_3_CRC_CONFIG_9
+// Number of properties: 9
+// Group ID: 0x12
+// Start ID: 0x2C
+// Default values: 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+// Descriptions:
+// PKT_RX_FIELD_3_CRC_CONFIG - Configuration of CRC control bits across RX Field 3.
+// PKT_RX_FIELD_4_LENGTH_12_8 - Unsigned 13-bit RX Field 4 length value.
+// PKT_RX_FIELD_4_LENGTH_7_0 - Unsigned 13-bit RX Field 4 length value.
+// PKT_RX_FIELD_4_CONFIG - General data processing and packet configuration bits for RX Field 4.
+// PKT_RX_FIELD_4_CRC_CONFIG - Configuration of CRC control bits across RX Field 4.
+// PKT_RX_FIELD_5_LENGTH_12_8 - Unsigned 13-bit RX Field 5 length value.
+// PKT_RX_FIELD_5_LENGTH_7_0 - Unsigned 13-bit RX Field 5 length value.
+// PKT_RX_FIELD_5_CONFIG - General data processing and packet configuration bits for RX Field 5.
+// PKT_RX_FIELD_5_CRC_CONFIG - Configuration of CRC control bits across RX Field 5.
+*/
+#define RF_PKT_RX_FIELD_3_CRC_CONFIG_9 0x11, 0x12, 0x09, 0x2C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+
+/*
+// Set properties: RF_MODEM_MOD_TYPE_12
+// Number of properties: 12
+// Group ID: 0x20
+// Start ID: 0x00
+// Default values: 0x02, 0x80, 0x07, 0x0F, 0x42, 0x40, 0x01, 0xC9, 0xC3, 0x80, 0x00, 0x06,
+// Descriptions:
+// MODEM_MOD_TYPE - Selects the type of modulation. In TX mode, additionally selects the source of the modulation.
+// MODEM_MAP_CONTROL - Controls polarity and mapping of transmit and receive bits.
+// MODEM_DSM_CTRL - Miscellaneous control bits for the Delta-Sigma Modulator (DSM) in the PLL Synthesizer.
+// MODEM_DATA_RATE_2 - Unsigned 24-bit value used to determine the TX data rate
+// MODEM_DATA_RATE_1 - Unsigned 24-bit value used to determine the TX data rate
+// MODEM_DATA_RATE_0 - Unsigned 24-bit value used to determine the TX data rate
+// MODEM_TX_NCO_MODE_3 - TX Gaussian filter oversampling ratio and Byte 3 of unsigned 26-bit TX Numerically Controlled Oscillator (NCO) modulus.
+// MODEM_TX_NCO_MODE_2 - TX Gaussian filter oversampling ratio and Byte 3 of unsigned 26-bit TX Numerically Controlled Oscillator (NCO) modulus.
+// MODEM_TX_NCO_MODE_1 - TX Gaussian filter oversampling ratio and Byte 3 of unsigned 26-bit TX Numerically Controlled Oscillator (NCO) modulus.
+// MODEM_TX_NCO_MODE_0 - TX Gaussian filter oversampling ratio and Byte 3 of unsigned 26-bit TX Numerically Controlled Oscillator (NCO) modulus.
+// MODEM_FREQ_DEV_2 - 17-bit unsigned TX frequency deviation word.
+// MODEM_FREQ_DEV_1 - 17-bit unsigned TX frequency deviation word.
+*/
+#define RF_MODEM_MOD_TYPE_12 0x11, 0x20, 0x0C, 0x00, 0x03, 0x00, 0x07, 0x01, 0xD4, 0xC0, 0x05, 0x8C, 0xBA, 0x80, 0x00, 0x01
+
+/*
+// Set properties: RF_MODEM_FREQ_DEV_0_1
+// Number of properties: 1
+// Group ID: 0x20
+// Start ID: 0x0C
+// Default values: 0xD3,
+// Descriptions:
+// MODEM_FREQ_DEV_0 - 17-bit unsigned TX frequency deviation word.
+*/
+#define RF_MODEM_FREQ_DEV_0_1 0x11, 0x20, 0x01, 0x0C, 0xE4
+
+/*
+// Set properties: RF_MODEM_TX_RAMP_DELAY_8
+// Number of properties: 8
+// Group ID: 0x20
+// Start ID: 0x18
+// Default values: 0x01, 0x00, 0x08, 0x03, 0xC0, 0x00, 0x10, 0x20,
+// Descriptions:
+// MODEM_TX_RAMP_DELAY - TX ramp-down delay setting.
+// MODEM_MDM_CTRL - MDM control.
+// MODEM_IF_CONTROL - Selects Fixed-IF, Scaled-IF, or Zero-IF mode of RX Modem operation.
+// MODEM_IF_FREQ_2 - the IF frequency setting (an 18-bit signed number).
+// MODEM_IF_FREQ_1 - the IF frequency setting (an 18-bit signed number).
+// MODEM_IF_FREQ_0 - the IF frequency setting (an 18-bit signed number).
+// MODEM_DECIMATION_CFG1 - Specifies three decimator ratios for the Cascaded Integrator Comb (CIC) filter.
+// MODEM_DECIMATION_CFG0 - Specifies miscellaneous parameters and decimator ratios for the Cascaded Integrator Comb (CIC) filter.
+*/
+#define RF_MODEM_TX_RAMP_DELAY_8 0x11, 0x20, 0x08, 0x18, 0x01, 0x80, 0x08, 0x03, 0x80, 0x00, 0x20, 0x20
+
+/*
+// Set properties: RF_MODEM_BCR_OSR_1_9
+// Number of properties: 9
+// Group ID: 0x20
+// Start ID: 0x22
+// Default values: 0x00, 0x4B, 0x06, 0xD3, 0xA0, 0x06, 0xD3, 0x02, 0xC0,
+// Descriptions:
+// MODEM_BCR_OSR_1 - RX BCR/Slicer oversampling rate (12-bit unsigned number).
+// MODEM_BCR_OSR_0 - RX BCR/Slicer oversampling rate (12-bit unsigned number).
+// MODEM_BCR_NCO_OFFSET_2 - RX BCR NCO offset value (an unsigned 22-bit number).
+// MODEM_BCR_NCO_OFFSET_1 - RX BCR NCO offset value (an unsigned 22-bit number).
+// MODEM_BCR_NCO_OFFSET_0 - RX BCR NCO offset value (an unsigned 22-bit number).
+// MODEM_BCR_GAIN_1 - The unsigned 11-bit RX BCR loop gain value.
+// MODEM_BCR_GAIN_0 - The unsigned 11-bit RX BCR loop gain value.
+// MODEM_BCR_GEAR - RX BCR loop gear control.
+// MODEM_BCR_MISC1 - Miscellaneous control bits for the RX BCR loop.
+*/
+#define RF_MODEM_BCR_OSR_1_9 0x11, 0x20, 0x09, 0x22, 0x04, 0x3B, 0x00, 0x78, 0xFD, 0x00, 0x3D, 0x02, 0xC2
+
+/*
+// Set properties: RF_MODEM_AFC_GEAR_7
+// Number of properties: 7
+// Group ID: 0x20
+// Start ID: 0x2C
+// Default values: 0x00, 0x23, 0x83, 0x69, 0x00, 0x40, 0xA0,
+// Descriptions:
+// MODEM_AFC_GEAR - RX AFC loop gear control.
+// MODEM_AFC_WAIT - RX AFC loop wait time control.
+// MODEM_AFC_GAIN_1 - Sets the gain of the PLL-based AFC acquisition loop, and provides miscellaneous control bits for AFC functionality.
+// MODEM_AFC_GAIN_0 - Sets the gain of the PLL-based AFC acquisition loop, and provides miscellaneous control bits for AFC functionality.
+// MODEM_AFC_LIMITER_1 - Set the AFC limiter value.
+// MODEM_AFC_LIMITER_0 - Set the AFC limiter value.
+// MODEM_AFC_MISC - Specifies miscellaneous AFC control bits.
+*/
+#define RF_MODEM_AFC_GEAR_7 0x11, 0x20, 0x07, 0x2C, 0x04, 0x36, 0xC0, 0x0A, 0x48, 0x18, 0xC0
+
+/*
+// Set properties: RF_MODEM_AGC_CONTROL_1
+// Number of properties: 1
+// Group ID: 0x20
+// Start ID: 0x35
+// Default values: 0xE0,
+// Descriptions:
+// MODEM_AGC_CONTROL - Miscellaneous control bits for the Automatic Gain Control (AGC) function in the RX Chain.
+*/
+#define RF_MODEM_AGC_CONTROL_1 0x11, 0x20, 0x01, 0x35, 0xE2
+
+/*
+// Set properties: RF_MODEM_AGC_WINDOW_SIZE_9
+// Number of properties: 9
+// Group ID: 0x20
+// Start ID: 0x38
+// Default values: 0x11, 0x10, 0x10, 0x0B, 0x1C, 0x40, 0x00, 0x00, 0x2B,
+// Descriptions:
+// MODEM_AGC_WINDOW_SIZE - Specifies the size of the measurement and settling windows for the AGC algorithm.
+// MODEM_AGC_RFPD_DECAY - Sets the decay time of the RF peak detectors.
+// MODEM_AGC_IFPD_DECAY - Sets the decay time of the IF peak detectors.
+// MODEM_FSK4_GAIN1 - Specifies the gain factor of the secondary branch in 4(G)FSK ISI-suppression.
+// MODEM_FSK4_GAIN0 - Specifies the gain factor of the primary branch in 4(G)FSK ISI-suppression.
+// MODEM_FSK4_TH1 - 16 bit 4(G)FSK slicer threshold.
+// MODEM_FSK4_TH0 - 16 bit 4(G)FSK slicer threshold.
+// MODEM_FSK4_MAP - 4(G)FSK symbol mapping code.
+// MODEM_OOK_PDTC - Configures the attack and decay times of the OOK Peak Detector.
+*/
+#define RF_MODEM_AGC_WINDOW_SIZE_9 0x11, 0x20, 0x09, 0x38, 0x11, 0xED, 0xED, 0x00, 0x1A, 0xFF, 0xFF, 0x00, 0x2B
+
+/*
+// Set properties: RF_MODEM_OOK_CNT1_9
+// Number of properties: 9
+// Group ID: 0x20
+// Start ID: 0x42
+// Default values: 0xA4, 0x03, 0x56, 0x02, 0x00, 0xA3, 0x02, 0x80, 0xFF,
+// Descriptions:
+// MODEM_OOK_CNT1 - OOK control.
+// MODEM_OOK_MISC - Selects the detector(s) used for demodulation of an OOK signal, or for demodulation of a (G)FSK signal when using the asynchronous demodulator.
+// MODEM_RAW_SEARCH - Defines and controls the search period length for the Moving Average and Min-Max detectors.
+// MODEM_RAW_CONTROL - Defines gain and enable controls for raw / nonstandard mode.
+// MODEM_RAW_EYE_1 - 11 bit eye-open detector threshold.
+// MODEM_RAW_EYE_0 - 11 bit eye-open detector threshold.
+// MODEM_ANT_DIV_MODE - Antenna diversity mode settings.
+// MODEM_ANT_DIV_CONTROL - Specifies controls for the Antenna Diversity algorithm.
+// MODEM_RSSI_THRESH - Configures the RSSI threshold.
+*/
+#define RF_MODEM_OOK_CNT1_9 0x11, 0x20, 0x09, 0x42, 0xA4, 0x02, 0xD6, 0x83, 0x00, 0x3C, 0x01, 0x80, 0xFF
+
+/*
+// Set properties: RF_MODEM_RSSI_CONTROL_1
+// Number of properties: 1
+// Group ID: 0x20
+// Start ID: 0x4C
+// Default values: 0x01,
+// Descriptions:
+// MODEM_RSSI_CONTROL - Control of the averaging modes and latching time for reporting RSSI value(s).
+*/
+#define RF_MODEM_RSSI_CONTROL_1 0x11, 0x20, 0x01, 0x4C, 0x02
+
+/*
+// Set properties: RF_MODEM_RSSI_COMP_1
+// Number of properties: 1
+// Group ID: 0x20
+// Start ID: 0x4E
+// Default values: 0x32,
+// Descriptions:
+// MODEM_RSSI_COMP - RSSI compensation value.
+*/
+#define RF_MODEM_RSSI_COMP_1 0x11, 0x20, 0x01, 0x4E, 0x40
+
+/*
+// Set properties: RF_MODEM_CLKGEN_BAND_1
+// Number of properties: 1
+// Group ID: 0x20
+// Start ID: 0x51
+// Default values: 0x08,
+// Descriptions:
+// MODEM_CLKGEN_BAND - Select PLL Synthesizer output divider ratio as a function of frequency band.
+*/
+#define RF_MODEM_CLKGEN_BAND_1 0x11, 0x20, 0x01, 0x51, 0x0A
+
+/*
+// Set properties: RF_MODEM_CHFLT_RX1_CHFLT_COE13_7_0_12
+// Number of properties: 12
+// Group ID: 0x21
+// Start ID: 0x00
+// Default values: 0xFF, 0xBA, 0x0F, 0x51, 0xCF, 0xA9, 0xC9, 0xFC, 0x1B, 0x1E, 0x0F, 0x01,
+// Descriptions:
+// MODEM_CHFLT_RX1_CHFLT_COE13_7_0 - Filter coefficients for the first set of RX filter coefficients.
+// MODEM_CHFLT_RX1_CHFLT_COE12_7_0 - Filter coefficients for the first set of RX filter coefficients.
+// MODEM_CHFLT_RX1_CHFLT_COE11_7_0 - Filter coefficients for the first set of RX filter coefficients.
+// MODEM_CHFLT_RX1_CHFLT_COE10_7_0 - Filter coefficients for the first set of RX filter coefficients.
+// MODEM_CHFLT_RX1_CHFLT_COE9_7_0 - Filter coefficients for the first set of RX filter coefficients.
+// MODEM_CHFLT_RX1_CHFLT_COE8_7_0 - Filter coefficients for the first set of RX filter coefficients.
+// MODEM_CHFLT_RX1_CHFLT_COE7_7_0 - Filter coefficients for the first set of RX filter coefficients.
+// MODEM_CHFLT_RX1_CHFLT_COE6_7_0 - Filter coefficients for the first set of RX filter coefficients.
+// MODEM_CHFLT_RX1_CHFLT_COE5_7_0 - Filter coefficients for the first set of RX filter coefficients.
+// MODEM_CHFLT_RX1_CHFLT_COE4_7_0 - Filter coefficients for the first set of RX filter coefficients.
+// MODEM_CHFLT_RX1_CHFLT_COE3_7_0 - Filter coefficients for the first set of RX filter coefficients.
+// MODEM_CHFLT_RX1_CHFLT_COE2_7_0 - Filter coefficients for the first set of RX filter coefficients.
+*/
+#define RF_MODEM_CHFLT_RX1_CHFLT_COE13_7_0_12 0x11, 0x21, 0x0C, 0x00, 0xFF, 0xBA, 0x0F, 0x51, 0xCF, 0xA9, 0xC9, 0xFC, 0x1B, 0x1E, 0x0F, 0x01
+
+/*
+// Set properties: RF_MODEM_CHFLT_RX1_CHFLT_COE1_7_0_12
+// Number of properties: 12
+// Group ID: 0x21
+// Start ID: 0x0C
+// Default values: 0xFC, 0xFD, 0x15, 0xFF, 0x00, 0x0F, 0xFF, 0xC4, 0x30, 0x7F, 0xF5, 0xB5,
+// Descriptions:
+// MODEM_CHFLT_RX1_CHFLT_COE1_7_0 - Filter coefficients for the first set of RX filter coefficients.
+// MODEM_CHFLT_RX1_CHFLT_COE0_7_0 - Filter coefficients for the first set of RX filter coefficients.
+// MODEM_CHFLT_RX1_CHFLT_COEM0 - Filter coefficients for the first set of RX filter coefficients.
+// MODEM_CHFLT_RX1_CHFLT_COEM1 - Filter coefficients for the first set of RX filter coefficients.
+// MODEM_CHFLT_RX1_CHFLT_COEM2 - Filter coefficients for the first set of RX filter coefficients.
+// MODEM_CHFLT_RX1_CHFLT_COEM3 - Filter coefficients for the first set of RX filter coefficients.
+// MODEM_CHFLT_RX2_CHFLT_COE13_7_0 - Filter coefficients for the second set of RX filter coefficients.
+// MODEM_CHFLT_RX2_CHFLT_COE12_7_0 - Filter coefficients for the second set of RX filter coefficients.
+// MODEM_CHFLT_RX2_CHFLT_COE11_7_0 - Filter coefficients for the second set of RX filter coefficients.
+// MODEM_CHFLT_RX2_CHFLT_COE10_7_0 - Filter coefficients for the second set of RX filter coefficients.
+// MODEM_CHFLT_RX2_CHFLT_COE9_7_0 - Filter coefficients for the second set of RX filter coefficients.
+// MODEM_CHFLT_RX2_CHFLT_COE8_7_0 - Filter coefficients for the second set of RX filter coefficients.
+*/
+#define RF_MODEM_CHFLT_RX1_CHFLT_COE1_7_0_12 0x11, 0x21, 0x0C, 0x0C, 0xFC, 0xFD, 0x15, 0xFF, 0x00, 0x0F, 0xA2, 0xA0, 0x97, 0x8A, 0x79, 0x66
+
+/*
+// Set properties: RF_MODEM_CHFLT_RX2_CHFLT_COE7_7_0_12
+// Number of properties: 12
+// Group ID: 0x21
+// Start ID: 0x18
+// Default values: 0xB8, 0xDE, 0x05, 0x17, 0x16, 0x0C, 0x03, 0x00, 0x15, 0xFF, 0x00, 0x00,
+// Descriptions:
+// MODEM_CHFLT_RX2_CHFLT_COE7_7_0 - Filter coefficients for the second set of RX filter coefficients.
+// MODEM_CHFLT_RX2_CHFLT_COE6_7_0 - Filter coefficients for the second set of RX filter coefficients.
+// MODEM_CHFLT_RX2_CHFLT_COE5_7_0 - Filter coefficients for the second set of RX filter coefficients.
+// MODEM_CHFLT_RX2_CHFLT_COE4_7_0 - Filter coefficients for the second set of RX filter coefficients.
+// MODEM_CHFLT_RX2_CHFLT_COE3_7_0 - Filter coefficients for the second set of RX filter coefficients.
+// MODEM_CHFLT_RX2_CHFLT_COE2_7_0 - Filter coefficients for the second set of RX filter coefficients.
+// MODEM_CHFLT_RX2_CHFLT_COE1_7_0 - Filter coefficients for the second set of RX filter coefficients.
+// MODEM_CHFLT_RX2_CHFLT_COE0_7_0 - Filter coefficients for the second set of RX filter coefficients.
+// MODEM_CHFLT_RX2_CHFLT_COEM0 - Filter coefficients for the second set of RX filter coefficients.
+// MODEM_CHFLT_RX2_CHFLT_COEM1 - Filter coefficients for the second set of RX filter coefficients.
+// MODEM_CHFLT_RX2_CHFLT_COEM2 - Filter coefficients for the second set of RX filter coefficients.
+// MODEM_CHFLT_RX2_CHFLT_COEM3 - Filter coefficients for the second set of RX filter coefficients.
+*/
+#define RF_MODEM_CHFLT_RX2_CHFLT_COE7_7_0_12 0x11, 0x21, 0x0C, 0x18, 0x52, 0x3F, 0x2E, 0x1F, 0x14, 0x0B, 0x06, 0x02, 0x00, 0x00, 0x00, 0x00
+
+/*
+// Set properties: RF_PA_MODE_4
+// Number of properties: 4
+// Group ID: 0x22
+// Start ID: 0x00
+// Default values: 0x08, 0x7F, 0x00, 0x5D,
+// Descriptions:
+// PA_MODE - Selects the PA operating mode, and selects resolution of PA power adjustment (i.e., step size).
+// PA_PWR_LVL - Configuration of PA output power level.
+// PA_BIAS_CLKDUTY - Configuration of the PA Bias and duty cycle of the TX clock source.
+// PA_TC - Configuration of PA ramping parameters.
+*/
+#define RF_PA_MODE_4 0x11, 0x22, 0x04, 0x00, 0x08, 0x05, 0x00, 0x3D
+
+/*
+// Set properties: RF_SYNTH_PFDCP_CPFF_7
+// Number of properties: 7
+// Group ID: 0x23
+// Start ID: 0x00
+// Default values: 0x2C, 0x0E, 0x0B, 0x04, 0x0C, 0x73, 0x03,
+// Descriptions:
+// SYNTH_PFDCP_CPFF - Feed forward charge pump current selection.
+// SYNTH_PFDCP_CPINT - Integration charge pump current selection.
+// SYNTH_VCO_KV - Gain scaling factors (Kv) for the VCO tuning varactors on both the integrated-path and feed forward path.
+// SYNTH_LPFILT3 - Value of resistor R2 in feed-forward path of loop filter.
+// SYNTH_LPFILT2 - Value of capacitor C2 in feed-forward path of loop filter.
+// SYNTH_LPFILT1 - Value of capacitors C1 and C3 in feed-forward path of loop filter.
+// SYNTH_LPFILT0 - Bias current of the active amplifier in the feed-forward loop filter.
+*/
+#define RF_SYNTH_PFDCP_CPFF_7 0x11, 0x23, 0x07, 0x00, 0x2C, 0x0E, 0x0B, 0x04, 0x0C, 0x73, 0x03
+
+/*
+// Set properties: RF_MATCH_VALUE_1_12
+// Number of properties: 12
+// Group ID: 0x30
+// Start ID: 0x00
+// Default values: 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+// Descriptions:
+// MATCH_VALUE_1 - Match value to be compared with the result of logically AND-ing (bit-wise) the Mask 1 value with the received Match 1 byte.
+// MATCH_MASK_1 - Mask value to be logically AND-ed (bit-wise) with the Match 1 byte.
+// MATCH_CTRL_1 - Enable for Packet Match functionality, and configuration of Match Byte 1.
+// MATCH_VALUE_2 - Match value to be compared with the result of logically AND-ing (bit-wise) the Mask 2 value with the received Match 2 byte.
+// MATCH_MASK_2 - Mask value to be logically AND-ed (bit-wise) with the Match 2 byte.
+// MATCH_CTRL_2 - Configuration of Match Byte 2.
+// MATCH_VALUE_3 - Match value to be compared with the result of logically AND-ing (bit-wise) the Mask 3 value with the received Match 3 byte.
+// MATCH_MASK_3 - Mask value to be logically AND-ed (bit-wise) with the Match 3 byte.
+// MATCH_CTRL_3 - Configuration of Match Byte 3.
+// MATCH_VALUE_4 - Match value to be compared with the result of logically AND-ing (bit-wise) the Mask 4 value with the received Match 4 byte.
+// MATCH_MASK_4 - Mask value to be logically AND-ed (bit-wise) with the Match 4 byte.
+// MATCH_CTRL_4 - Configuration of Match Byte 4.
+*/
+#define RF_MATCH_VALUE_1_12 0x11, 0x30, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+
+/*
+// Set properties: RF_FREQ_CONTROL_INTE_8
+// Number of properties: 8
+// Group ID: 0x40
+// Start ID: 0x00
+// Default values: 0x3C, 0x08, 0x00, 0x00, 0x00, 0x00, 0x20, 0xFF,
+// Descriptions:
+// FREQ_CONTROL_INTE - Frac-N PLL Synthesizer integer divide number.
+// FREQ_CONTROL_FRAC_2 - Frac-N PLL fraction number.
+// FREQ_CONTROL_FRAC_1 - Frac-N PLL fraction number.
+// FREQ_CONTROL_FRAC_0 - Frac-N PLL fraction number.
+// FREQ_CONTROL_CHANNEL_STEP_SIZE_1 - EZ Frequency Programming channel step size.
+// FREQ_CONTROL_CHANNEL_STEP_SIZE_0 - EZ Frequency Programming channel step size.
+// FREQ_CONTROL_W_SIZE - Set window gating period (in number of crystal reference clock cycles) for counting VCO frequency during calibration.
+// FREQ_CONTROL_VCOCNT_RX_ADJ - Adjust target count for VCO calibration in RX mode.
+*/
+#define RF_FREQ_CONTROL_INTE_8 0x11, 0x40, 0x08, 0x00, 0x41, 0x0C, 0xFC, 0x0F, 0x07, 0xE0, 0x20, 0xFE
+
+
+// AUTOMATICALLY GENERATED CODE!
+// DO NOT EDIT/MODIFY BELOW THIS LINE!
+// --------------------------------------------
+
+#ifndef FIRMWARE_LOAD_COMPILE
+#define RADIO_CONFIGURATION_DATA_ARRAY { \
+ 0x07, RF_POWER_UP, \
+ 0x08, RF_GPIO_PIN_CFG, \
+ 0x06, RF_GLOBAL_XO_TUNE_2, \
+ 0x05, RF_GLOBAL_CONFIG_1, \
+ 0x06, RF_INT_CTL_ENABLE_2, \
+ 0x08, RF_FRR_CTL_A_MODE_4, \
+ 0x0D, RF_PREAMBLE_TX_LENGTH_9, \
+ 0x09, RF_SYNC_CONFIG_5, \
+ 0x0B, RF_PKT_CRC_CONFIG_7, \
+ 0x10, RF_PKT_LEN_12, \
+ 0x10, RF_PKT_FIELD_2_CRC_CONFIG_12, \
+ 0x10, RF_PKT_FIELD_5_CRC_CONFIG_12, \
+ 0x0D, RF_PKT_RX_FIELD_3_CRC_CONFIG_9, \
+ 0x10, RF_MODEM_MOD_TYPE_12, \
+ 0x05, RF_MODEM_FREQ_DEV_0_1, \
+ 0x0C, RF_MODEM_TX_RAMP_DELAY_8, \
+ 0x0D, RF_MODEM_BCR_OSR_1_9, \
+ 0x0B, RF_MODEM_AFC_GEAR_7, \
+ 0x05, RF_MODEM_AGC_CONTROL_1, \
+ 0x0D, RF_MODEM_AGC_WINDOW_SIZE_9, \
+ 0x0D, RF_MODEM_OOK_CNT1_9, \
+ 0x05, RF_MODEM_RSSI_CONTROL_1, \
+ 0x05, RF_MODEM_RSSI_COMP_1, \
+ 0x05, RF_MODEM_CLKGEN_BAND_1, \
+ 0x10, RF_MODEM_CHFLT_RX1_CHFLT_COE13_7_0_12, \
+ 0x10, RF_MODEM_CHFLT_RX1_CHFLT_COE1_7_0_12, \
+ 0x10, RF_MODEM_CHFLT_RX2_CHFLT_COE7_7_0_12, \
+ 0x08, RF_PA_MODE_4, \
+ 0x0B, RF_SYNTH_PFDCP_CPFF_7, \
+ 0x10, RF_MATCH_VALUE_1_12, \
+ 0x0C, RF_FREQ_CONTROL_INTE_8, \
+ 0x00 \
+ }
+#else
+#define RADIO_CONFIGURATION_DATA_ARRAY { 0 }
+#endif
+
+// DEFAULT VALUES FOR CONFIGURATION PARAMETERS
+#define RADIO_CONFIGURATION_DATA_RADIO_XO_FREQ_DEFAULT 30000000L
+#define RADIO_CONFIGURATION_DATA_CHANNEL_NUMBER_DEFAULT 0x00
+#define RADIO_CONFIGURATION_DATA_RADIO_PACKET_LENGTH_DEFAULT 0x10
+#define RADIO_CONFIGURATION_DATA_RADIO_STATE_AFTER_POWER_UP_DEFAULT 0x01
+#define RADIO_CONFIGURATION_DATA_RADIO_DELAY_CNT_AFTER_RESET_DEFAULT 0x1000
+
+#define RADIO_CONFIGURATION_DATA_RADIO_PATCH_INCLUDED 0x00
+#define RADIO_CONFIGURATION_DATA_RADIO_PATCH_SIZE 0x00
+#define RADIO_CONFIGURATION_DATA_RADIO_PATCH { }
+
+#ifndef RADIO_CONFIGURATION_DATA_ARRAY
+#error "This property must be defined!"
+#endif
+
+#ifndef RADIO_CONFIGURATION_DATA_RADIO_XO_FREQ
+#define RADIO_CONFIGURATION_DATA_RADIO_XO_FREQ RADIO_CONFIGURATION_DATA_RADIO_XO_FREQ_DEFAULT
+#endif
+
+#ifndef RADIO_CONFIGURATION_DATA_CHANNEL_NUMBER
+#define RADIO_CONFIGURATION_DATA_CHANNEL_NUMBER RADIO_CONFIGURATION_DATA_CHANNEL_NUMBER_DEFAULT
+#endif
+
+#ifndef RADIO_CONFIGURATION_DATA_RADIO_PACKET_LENGTH
+#define RADIO_CONFIGURATION_DATA_RADIO_PACKET_LENGTH RADIO_CONFIGURATION_DATA_RADIO_PACKET_LENGTH_DEFAULT
+#endif
+
+#ifndef RADIO_CONFIGURATION_DATA_RADIO_STATE_AFTER_POWER_UP
+#define RADIO_CONFIGURATION_DATA_RADIO_STATE_AFTER_POWER_UP RADIO_CONFIGURATION_DATA_RADIO_STATE_AFTER_POWER_UP_DEFAULT
+#endif
+
+#ifndef RADIO_CONFIGURATION_DATA_RADIO_DELAY_CNT_AFTER_RESET
+#define RADIO_CONFIGURATION_DATA_RADIO_DELAY_CNT_AFTER_RESET RADIO_CONFIGURATION_DATA_RADIO_DELAY_CNT_AFTER_RESET_DEFAULT
+#endif
+
+#define RADIO_CONFIGURATION_DATA { \
+ Radio_Configuration_Data_Array, \
+ RADIO_CONFIGURATION_DATA_CHANNEL_NUMBER, \
+ RADIO_CONFIGURATION_DATA_RADIO_PACKET_LENGTH, \
+ RADIO_CONFIGURATION_DATA_RADIO_STATE_AFTER_POWER_UP, \
+ RADIO_CONFIGURATION_DATA_RADIO_DELAY_CNT_AFTER_RESET \
+ }
+
+#endif /* RADIO_CONFIG_H_ */
diff --git a/Firmware/CubeIDE/Code/inc/service.h b/Firmware/CubeIDE/Code/inc/service.h
new file mode 100644
index 0000000..0a041c6
--- /dev/null
+++ b/Firmware/CubeIDE/Code/inc/service.h
@@ -0,0 +1,18 @@
+/*
+ ELEPH - Local Relative Navigation System
+
+ Copyright (C) 2021 Feruz Topalov
+ Released under the GNU General Public License v3.0
+
+ file: service.h
+*/
+
+void convert_timeout(uint32_t timeout_val, char *buffer);
+
+void delay_cyc(uint32_t cycles);
+void copy_string(char *from, char *to);
+
+float atof32(char *input);
+void ftoa32(float value, uint8_t precision, char *buffer);
+int32_t atoi32(char *input);
+void itoa32(int32_t value, char *buffer);
diff --git a/Firmware/CubeIDE/Code/inc/settings.h b/Firmware/CubeIDE/Code/inc/settings.h
new file mode 100644
index 0000000..9e9fc7b
--- /dev/null
+++ b/Firmware/CubeIDE/Code/inc/settings.h
@@ -0,0 +1,67 @@
+/*
+ ELEPH - Local Relative Navigation System
+
+ Copyright (C) 2021 Feruz Topalov
+ Released under the GNU General Public License v3.0
+
+ file: settings.h
+*/
+
+#define DEVICE_ID_LEN (2) //length of device ID, two ASCII characters
+#define TIMEOUT_ALARM_DISABLED (0)
+#define FENCE_ALARM_DISABLED (0)
+
+
+
+//Send interval settings
+#define SEND_INTERVAL_1S_SETTING (0)
+#define SEND_INTERVAL_5S_SETTING (1)
+#define SEND_INTERVAL_10S_SETTING (2)
+#define SEND_INTERVAL_30S_SETTING (3)
+#define SEND_INTERVAL_60S_SETTING (4)
+
+
+
+//POWER SETTINGS
+#define TX_POWER_10MILLIW_SETTING (0)
+#define TX_POWER_25MILLIW_SETTING (1)
+#define TX_POWER_40MILLIW_SETTING (2)
+#define TX_POWER_100MILLIW_SETTING (3)
+
+
+
+//Structure with settings
+struct settings_struct
+{
+ uint8_t device_number; //this device number in group, 1...DEVICES_IN_GROUP
+
+ char device_id[DEVICE_ID_LEN]; //user id, ASCII symbols
+
+ uint8_t freq_channel; //frequency tx/rx channel
+
+ uint8_t tx_power_opt; //tx power option, not an actual value
+
+ uint8_t send_interval_opt; //send interval option, not an actual value
+
+ union
+ {
+ uint16_t as_integer; //timeout treshold in seconds, unsigned. if it == 0, then timeout alarm not trigger (but, anyway, timeout is counting). See TIMEOUT_ALARM_DISABLED
+ uint8_t as_array[2];
+ } timeout_threshold;
+
+ union
+ {
+ uint16_t as_integer; //fence treshold in meters, unsigned. if it == 0, then fence alarm not trigger. See FENCE_ALARM_DISABLED
+ uint8_t as_array[2];
+ } fence_threshold;
+
+};
+
+
+
+struct settings_struct *get_settings(void);
+uint8_t *get_send_interval_values(void);
+uint8_t *get_tx_power_values(void);
+void settings_save_default(void);
+void settings_load(void);
+void settings_save(struct settings_struct *settings);
diff --git a/Firmware/CubeIDE/Code/inc/si4463.h b/Firmware/CubeIDE/Code/inc/si4463.h
new file mode 100644
index 0000000..e7f5292
--- /dev/null
+++ b/Firmware/CubeIDE/Code/inc/si4463.h
@@ -0,0 +1,15 @@
+/*
+ ELEPH - Local Relative Navigation System
+
+ Copyright (C) 2021 Feruz Topalov
+ Released under the GNU General Public License v3.0
+
+ file: si4463.h
+*/
+
+void si4463_init(void);
+void si4463_tx_packet(void);
+void si4463_start_rx(void);
+uint8_t si4463_get_rx_packet(void);
+uint8_t *get_air_packet_tx(void);
+uint8_t *get_air_packet_rx(void);
diff --git a/Firmware/CubeIDE/Code/inc/spi.h b/Firmware/CubeIDE/Code/inc/spi.h
new file mode 100644
index 0000000..004c055
--- /dev/null
+++ b/Firmware/CubeIDE/Code/inc/spi.h
@@ -0,0 +1,13 @@
+/*
+ ELEPH - Local Relative Navigation System
+
+ Copyright (C) 2021 Feruz Topalov
+ Released under the GNU General Public License v3.0
+
+ file: spi.h
+*/
+
+void spi1_init(void);
+void spi2_init(void);
+uint8_t spi1_trx(uint8_t send_data);
+uint8_t spi2_trx(uint8_t send_data);
diff --git a/Firmware/CubeIDE/Code/inc/ssd1306.h b/Firmware/CubeIDE/Code/inc/ssd1306.h
new file mode 100644
index 0000000..d7afe1c
--- /dev/null
+++ b/Firmware/CubeIDE/Code/inc/ssd1306.h
@@ -0,0 +1,47 @@
+/*
+ ELEPH - Local Relative Navigation System
+
+ Copyright (C) 2021 Feruz Topalov
+ Released under the GNU General Public License v3.0
+
+ file: ssd1306.h
+*/
+
+#define LCD_LAST_COL (20)
+#define LCD_LAST_ROW (7)
+
+
+
+//Special sympols
+#define SYMB_ARROW_UP ('\x80')
+#define SYMB_ARROW_DOWN ('\x81')
+#define SYMB_NO_SATT ('\x82')
+#define SYMB_SATT_1D ('\x83')
+#define SYMB_SATT_2D ('\x84')
+#define SYMB_SATT_3D ('\x85')
+#define SYMB_TIMEOUT ('\x86')
+#define SYMB_ALARM ('\x87')
+#define SYMB_BAT_0OF4 ('\x88')
+#define SYMB_BAT_1OF4 ('\x89')
+#define SYMB_BAT_2OF4 ('\x8A')
+#define SYMB_BAT_3OF4 ('\x8B')
+#define SYMB_BAT_4OF4 ('\x8C')
+#define SYMB_DEGREE ('\x8D')
+#define SYMB_FENCE ('\x8E')
+#define SYMB_NOTE ('\x8F')
+
+
+
+void ssd1306_init(void);
+void ssd1306_fill(void);
+void ssd1306_clear(void);
+void ssd1306_pixel(uint8_t x, uint8_t y, int8_t action);
+void ssd1306_pos(uint8_t row, uint8_t col);
+void ssd1306_char(char chr, uint8_t inv);
+void ssd1306_char_pos(uint8_t row, uint8_t col, char chr, uint8_t inv);
+void ssd1306_print(uint8_t row, uint8_t col, char *p_str, uint8_t inv);
+void ssd1306_print_next(char *p_str, uint8_t inv);
+void ssd1306_print_viceversa(uint8_t row, uint8_t col, char *p_str, uint8_t inv);
+void ssd1306_bitmap(const uint8_t arr[]);
+void ssd1306_update(void);
+void ssd1306_print_byte(uint8_t row, uint8_t col, uint8_t *p_byte, uint8_t amount);
diff --git a/Firmware/CubeIDE/Code/inc/ssd1306_bitmaps.h b/Firmware/CubeIDE/Code/inc/ssd1306_bitmaps.h
new file mode 100644
index 0000000..59a1420
--- /dev/null
+++ b/Firmware/CubeIDE/Code/inc/ssd1306_bitmaps.h
@@ -0,0 +1,13 @@
+/*
+ ELEPH - Local Relative Navigation System
+
+ Copyright (C) 2021 Feruz Topalov
+ Released under the GNU General Public License v3.0
+
+ file: ssd1306_bitmaps.h
+*/
+
+extern const uint8_t startup_screen[1024];
+extern const uint8_t devices_blank[1024];
+extern const uint8_t radar_blank[1024];
+extern const uint8_t info_blank[1024];
diff --git a/Firmware/CubeIDE/Code/inc/ssd1306_font6x8.h b/Firmware/CubeIDE/Code/inc/ssd1306_font6x8.h
new file mode 100644
index 0000000..1c68334
--- /dev/null
+++ b/Firmware/CubeIDE/Code/inc/ssd1306_font6x8.h
@@ -0,0 +1,157 @@
+/*
+ ELEPH - Local Relative Navigation System
+
+ Copyright (C) 2021 Feruz Topalov
+ Released under the GNU General Public License v3.0
+
+ file: ssd1306_font6x8.h
+*/
+
+//font 5x8 (intercharacter space not included, 6x8 with it) http://dotmatrixtool.com/
+const uint8_t font[][5] =
+{
+ { 0x3E, 0x51, 0x49, 0x45, 0x3E }, // 0 0 //all symbols from 0x00 to 0x1F are ASCII '0'
+ { 0x3E, 0x51, 0x49, 0x45, 0x3E }, // 0 1
+ { 0x3E, 0x51, 0x49, 0x45, 0x3E }, // 0 2
+ { 0x3E, 0x51, 0x49, 0x45, 0x3E }, // 0 3
+ { 0x3E, 0x51, 0x49, 0x45, 0x3E }, // 0 4
+ { 0x3E, 0x51, 0x49, 0x45, 0x3E }, // 0 5
+ { 0x3E, 0x51, 0x49, 0x45, 0x3E }, // 0 6
+ { 0x3E, 0x51, 0x49, 0x45, 0x3E }, // 0 7
+ { 0x3E, 0x51, 0x49, 0x45, 0x3E }, // 0 8
+ { 0x3E, 0x51, 0x49, 0x45, 0x3E }, // 0 9
+ { 0x3E, 0x51, 0x49, 0x45, 0x3E }, // 0 10
+ { 0x3E, 0x51, 0x49, 0x45, 0x3E }, // 0 11
+ { 0x3E, 0x51, 0x49, 0x45, 0x3E }, // 0 12
+ { 0x3E, 0x51, 0x49, 0x45, 0x3E }, // 0 13
+ { 0x3E, 0x51, 0x49, 0x45, 0x3E }, // 0 14
+ { 0x3E, 0x51, 0x49, 0x45, 0x3E }, // 0 15
+ { 0x3E, 0x51, 0x49, 0x45, 0x3E }, // 0 16
+ { 0x3E, 0x51, 0x49, 0x45, 0x3E }, // 0 17
+ { 0x3E, 0x51, 0x49, 0x45, 0x3E }, // 0 18
+ { 0x3E, 0x51, 0x49, 0x45, 0x3E }, // 0 19
+ { 0x3E, 0x51, 0x49, 0x45, 0x3E }, // 0 20
+ { 0x3E, 0x51, 0x49, 0x45, 0x3E }, // 0 21
+ { 0x3E, 0x51, 0x49, 0x45, 0x3E }, // 0 22
+ { 0x3E, 0x51, 0x49, 0x45, 0x3E }, // 0 23
+ { 0x3E, 0x51, 0x49, 0x45, 0x3E }, // 0 24
+ { 0x3E, 0x51, 0x49, 0x45, 0x3E }, // 0 25
+ { 0x3E, 0x51, 0x49, 0x45, 0x3E }, // 0 26
+ { 0x3E, 0x51, 0x49, 0x45, 0x3E }, // 0 27
+ { 0x3E, 0x51, 0x49, 0x45, 0x3E }, // 0 28
+ { 0x3E, 0x51, 0x49, 0x45, 0x3E }, // 0 29
+ { 0x3E, 0x51, 0x49, 0x45, 0x3E }, // 0 30
+ { 0x3E, 0x51, 0x49, 0x45, 0x3E }, // 0 31
+ { 0x00, 0x00, 0x00, 0x00, 0x00 }, // 0x20 32
+ { 0x00, 0x00, 0x5F, 0x00, 0x00 }, // ! 0x21 33
+ { 0x00, 0x07, 0x00, 0x07, 0x00 }, // " 0x22 34
+ { 0x14, 0x7F, 0x14, 0x7F, 0x14 }, // # 0x23 35
+ { 0x24, 0x2A, 0x7F, 0x2A, 0x12 }, // $ 0x24 36
+ { 0x4C, 0x2C, 0x10, 0x68, 0x64 }, // % 0x25 37
+ { 0x36, 0x49, 0x55, 0x22, 0x50 }, // & 0x26 38
+ { 0x00, 0x05, 0x03, 0x00, 0x00 }, // ' 0x27 39
+ { 0x00, 0x1C, 0x22, 0x41, 0x00 }, // ( 0x28 40
+ { 0x00, 0x41, 0x22, 0x1C, 0x00 }, // ) 0x29 41
+ { 0x14, 0x08, 0x3E, 0x08, 0x14 }, // * 0x2A 42
+ { 0x08, 0x08, 0x3E, 0x08, 0x08 }, // + 0x2B 43
+ { 0x00, 0x00, 0x50, 0x30, 0x00 }, // , 0x2C 44
+ { 0x10, 0x10, 0x10, 0x10, 0x10 }, // - 0x2D 45
+ { 0x00, 0x60, 0x60, 0x00, 0x00 }, // . 0x2E 46
+ { 0x20, 0x10, 0x08, 0x04, 0x02 }, // / 0x2F 47
+ { 0x3E, 0x51, 0x49, 0x45, 0x3E }, // 0 0x30 48
+ { 0x00, 0x42, 0x7F, 0x40, 0x00 }, // 1 0x31 49
+ { 0x42, 0x61, 0x51, 0x49, 0x46 }, // 2 0x32 50
+ { 0x21, 0x41, 0x45, 0x4B, 0x31 }, // 3 0x33 51
+ { 0x18, 0x14, 0x12, 0x7F, 0x10 }, // 4 0x34 52
+ { 0x27, 0x45, 0x45, 0x45, 0x39 }, // 5 0x35 53
+ { 0x3C, 0x4A, 0x49, 0x49, 0x30 }, // 6 0x36 54
+ { 0x01, 0x71, 0x09, 0x05, 0x03 }, // 7 0x37 55
+ { 0x36, 0x49, 0x49, 0x49, 0x36 }, // 8 0x38 56
+ { 0x06, 0x49, 0x49, 0x29, 0x1E }, // 9 0x39 57
+ { 0x00, 0x36, 0x36, 0x00, 0x00 }, // : 0x3A 58
+ { 0x00, 0x56, 0x36, 0x00, 0x00 }, // ; 0x3B 59
+ { 0x08, 0x14, 0x22, 0x41, 0x00 }, // < 0x3C 60
+ { 0x14, 0x14, 0x14, 0x14, 0x14 }, // = 0x3D 61
+ { 0x00, 0x41, 0x22, 0x14, 0x08 }, // > 0x3E 62
+ { 0x02, 0x01, 0x51, 0x09, 0x06 }, // ? 0x3F 63
+ { 0x32, 0x49, 0x79, 0x41, 0x3E }, // @ 0x40 64
+ { 0x7E, 0x11, 0x11, 0x11, 0x7E }, // A 0x41 65
+ { 0x7F, 0x49, 0x49, 0x49, 0x36 }, // B 0x42 66
+ { 0x3E, 0x41, 0x41, 0x41, 0x22 }, // C 0x43 67
+ { 0x7F, 0x41, 0x41, 0x22, 0x1C }, // D 0x44 68
+ { 0x7F, 0x49, 0x49, 0x49, 0x41 }, // E 0x45 69
+ { 0x7F, 0x09, 0x09, 0x09, 0x01 }, // F 0x46 70
+ { 0x3E, 0x41, 0x49, 0x49, 0x7A }, // G 0x47 71
+ { 0x7F, 0x08, 0x08, 0x08, 0x7F }, // H 0x48 72
+ { 0x00, 0x41, 0x7F, 0x41, 0x00 }, // I 0x49 73
+ { 0x20, 0x40, 0x41, 0x3F, 0x01 }, // J 0x4A 74
+ { 0x7F, 0x08, 0x14, 0x22, 0x41 }, // K 0x4B 75
+ { 0x7F, 0x40, 0x40, 0x40, 0x40 }, // L 0x4C 76
+ { 0x7F, 0x02, 0x0C, 0x02, 0x7F }, // M 0x4D 77
+ { 0x7F, 0x04, 0x08, 0x10, 0x7F }, // N 0x4E 78
+ { 0x3E, 0x41, 0x41, 0x41, 0x3E }, // O 0x4F 79
+ { 0x7F, 0x09, 0x09, 0x09, 0x06 }, // P 0x50 80
+ { 0x3E, 0x41, 0x51, 0x21, 0x5E }, // Q 0x51 81
+ { 0x7F, 0x09, 0x19, 0x29, 0x46 }, // R 0x52 82
+ { 0x46, 0x49, 0x49, 0x49, 0x31 }, // S 0x53 83
+ { 0x01, 0x01, 0x7F, 0x01, 0x01 }, // T 0x54 84
+ { 0x3F, 0x40, 0x40, 0x40, 0x3F }, // U 0x55 85
+ { 0x1F, 0x20, 0x40, 0x20, 0x1F }, // V 0x56 86
+ { 0x3F, 0x40, 0x38, 0x40, 0x3F }, // W 0x57 87
+ { 0x63, 0x14, 0x08, 0x14, 0x63 }, // X 0x58 88
+ { 0x07, 0x08, 0x70, 0x08, 0x07 }, // Y 0x59 89
+ { 0x61, 0x51, 0x49, 0x45, 0x43 }, // Z 0x5A 90
+ { 0x00, 0x7F, 0x41, 0x41, 0x00 }, // [ 0x5B 91
+ { 0x02, 0x04, 0x08, 0x10, 0x20 }, // \ 0x5C 92
+ { 0x00, 0x41, 0x41, 0x7F, 0x00 }, // ] 0x5D 93
+ { 0x04, 0x02, 0x01, 0x02, 0x04 }, // ^ 0x5E 94
+ { 0x40, 0x40, 0x40, 0x40, 0x40 }, // _ 0x5F 95
+ { 0x00, 0x01, 0x02, 0x04, 0x00 }, // ` 0x60 96
+ { 0x20, 0x54, 0x54, 0x54, 0x78 }, // a 0x61 97
+ { 0x7F, 0x48, 0x44, 0x44, 0x38 }, // b 0x62 98
+ { 0x38, 0x44, 0x44, 0x44, 0x20 }, // c 0x63 99
+ { 0x38, 0x44, 0x44, 0x48, 0x7F }, // d 0x64 100
+ { 0x38, 0x54, 0x54, 0x54, 0x18 }, // e 0x65 101
+ { 0x08, 0x7E, 0x09, 0x01, 0x02 }, // f 0x66 102
+ { 0x0C, 0x52, 0x52, 0x52, 0x3E }, // g 0x67 103
+ { 0x7F, 0x08, 0x04, 0x04, 0x78 }, // h 0x68 104
+ { 0x00, 0x44, 0x7D, 0x40, 0x00 }, // i 0x69 105
+ { 0x20, 0x40, 0x44, 0x3D, 0x00 }, // j 0x6A 106
+ { 0x7F, 0x10, 0x28, 0x44, 0x00 }, // k 0x6B 107
+ { 0x00, 0x41, 0x7F, 0x40, 0x00 }, // l 0x6C 108
+ { 0x7C, 0x04, 0x18, 0x04, 0x78 }, // m 0x6D 109
+ { 0x7C, 0x08, 0x04, 0x04, 0x78 }, // n 0x6E 110
+ { 0x38, 0x44, 0x44, 0x44, 0x38 }, // o 0x6F 111
+ { 0x7C, 0x14, 0x14, 0x14, 0x08 }, // p 0x70 112
+ { 0x08, 0x14, 0x14, 0x18, 0x7C }, // q 0x71 113
+ { 0x7C, 0x08, 0x04, 0x04, 0x08 }, // r 0x72 114
+ { 0x48, 0x54, 0x54, 0x54, 0x20 }, // s 0x73 115
+ { 0x04, 0x3F, 0x44, 0x40, 0x20 }, // t 0x74 116
+ { 0x3C, 0x40, 0x40, 0x20, 0x7C }, // u 0x75 117
+ { 0x1C, 0x20, 0x40, 0x20, 0x1C }, // v 0x76 118
+ { 0x3C, 0x40, 0x30, 0x40, 0x3C }, // w 0x77 119
+ { 0x44, 0x28, 0x10, 0x28, 0x44 }, // x 0x78 120
+ { 0x0C, 0x50, 0x50, 0x50, 0x3C }, // y 0x79 121
+ { 0x44, 0x64, 0x54, 0x4C, 0x44 }, // z 0x7A 122
+ { 0x00, 0x08, 0x36, 0x41, 0x00 }, // { 0x7B 123
+ { 0x00, 0x00, 0x7F, 0x00, 0x00 }, // | 0x7C 124
+ { 0x00, 0x41, 0x36, 0x08, 0x00 }, // } 0x7D 125
+ { 0x08, 0x04, 0x08, 0x10, 0x08 }, // ~ 0x7E 126
+ { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }, // 0x7F 127
+ { 0x00, 0x00, 0x04, 0x02, 0x7f }, // 0x80 128 arrow up
+ { 0x00, 0x7f, 0x20, 0x10, 0x00 }, // 0x81 129 arrow down
+ { 0x22, 0x14, 0x08, 0x14, 0x22 }, // 0x82 130 no sattelites
+ { 0x71, 0x03, 0x41, 0x00, 0x40 }, // 0x83 131 sattelites only time fix
+ { 0x71, 0x03, 0x79, 0x00, 0x40 }, // 0x84 132 sattelites 2D fix
+ { 0x71, 0x03, 0x79, 0x00, 0x7c }, // 0x85 133 sattelites 3D fix
+ { 0x63, 0x75, 0x79, 0x75, 0x63 }, // 0x86 134 timeout
+ { 0x10, 0x1e, 0x3f, 0x1e, 0x10 }, // 0x87 135 alarm
+ { 0x7e, 0x43, 0x43, 0x43, 0x7e }, // 0x88 136 battery 0/4
+ { 0x7e, 0x63, 0x63, 0x63, 0x7e }, // 0x89 137 battery 1/4
+ { 0x7e, 0x73, 0x73, 0x73, 0x7e }, // 0x8A 138 battery 2/4
+ { 0x7e, 0x7b, 0x7b, 0x7b, 0x7e }, // 0x8B 139 battery 3/4
+ { 0x7e, 0x7f, 0x7f, 0x7f, 0x7e }, // 0x8C 140 battery 4/4
+ { 0x07, 0x05, 0x07, 0x00, 0x00 }, // 0x8D 141 degree sign
+ { 0x55, 0x00, 0x41, 0x00, 0x55 }, // 0x8E 142 fence
+ { 0x60, 0x60, 0x7f, 0x02, 0x0c }, // 0x8F 143 note
+};
diff --git a/Firmware/CubeIDE/Code/inc/timer.h b/Firmware/CubeIDE/Code/inc/timer.h
new file mode 100644
index 0000000..ca7e37d
--- /dev/null
+++ b/Firmware/CubeIDE/Code/inc/timer.h
@@ -0,0 +1,17 @@
+/*
+ ELEPH - Local Relative Navigation System
+
+ Copyright (C) 2021 Feruz Topalov
+ Released under the GNU General Public License v3.0
+
+ file: timer.h
+*/
+
+void timers_init(void);
+void make_a_beep(void);
+void toggle_mute(void);
+uint8_t get_mute_flag(void);
+void timer1_start(void);
+void timer1_stop_reload(void);
+void timer2_stop(void);
+void timer3_stop(void);
diff --git a/Firmware/CubeIDE/Code/inc/uart.h b/Firmware/CubeIDE/Code/inc/uart.h
new file mode 100644
index 0000000..2a1e129
--- /dev/null
+++ b/Firmware/CubeIDE/Code/inc/uart.h
@@ -0,0 +1,18 @@
+/*
+ ELEPH - Local Relative Navigation System
+
+ Copyright (C) 2021 Feruz Topalov
+ Released under the GNU General Public License v3.0
+
+ file: uart.h
+*/
+
+#define UART_BUF_LEN (1024)
+
+
+
+void uart_dma_init(void);
+void uart_dma_stop(void);
+void uart_dma_restart(void);
+void backup_and_clear_uart_buffer(void);
+void uart_tx(uint8_t data);
diff --git a/Firmware/CubeIDE/Code/src/adc.c b/Firmware/CubeIDE/Code/src/adc.c
new file mode 100644
index 0000000..43aee82
--- /dev/null
+++ b/Firmware/CubeIDE/Code/src/adc.c
@@ -0,0 +1,126 @@
+/*
+ ELEPH - Local Relative Navigation System
+
+ Copyright (C) 2021 Feruz Topalov
+ Released under the GNU General Public License v3.0
+
+ file: adc.c
+*/
+
+#include "stm32f10x.h"
+#include "adc.h"
+#include "service.h"
+#include "settings.h"
+#include "points.h"
+#include "lrns.h"
+#include "gpio.h"
+
+
+
+#define GET_BAT_VOLTAGE_INTERVAL (10)
+
+#define V_BATTERY_0_TO_10 (3.0)
+#define V_BATTERY_10_TO_25 (3.1)
+#define V_BATTERY_25_TO_50 (3.3)
+#define V_BATTERY_50_TO_75 (3.6)
+#define V_BATTERY_75_TO_100 (3.9)
+
+
+
+const float vref = 3.3;
+uint8_t bat_interval_counter = 0;
+float bat_voltage;
+
+
+
+//ADC Init
+void adc_init(void)
+{
+ //ADC prescaller
+ RCC->CFGR &= ~RCC_CFGR_ADCPRE; //div by 8
+
+ //ADC clock on
+ RCC->APB2ENR |= RCC_APB2ENR_ADC1EN;
+
+ //Sample time
+ ADC1->SMPR2 |= ADC_SMPR2_SMP0_1; //13.5 cycles
+
+ //Number of conversions in regular sequence
+ ADC1->SQR1 &= ~ADC_SQR1_L; //1 conversion
+
+ //First channel in regular sequence
+ ADC1->SQR3 &= ~ADC_SQR3_SQ1; //channel #0
+
+ //Extermal trigger enable for regular sequence
+ ADC1->CR2 |= ADC_CR2_EXTTRIG;
+
+ //Event to start regular sequence
+ ADC1->CR2 |= ADC_CR2_EXTSEL; //start by software
+
+ //ADC enable
+ ADC1->CR2 |= ADC_CR2_ADON;
+
+ //Calibration
+ delay_cyc(100000);
+ ADC1->CR2 |= ADC_CR2_CAL; //start cal
+ while (ADC1->CR2 & ADC_CR2_CAL); //wait
+}
+
+
+
+//Get battery voltage
+uint8_t adc_get_bat_voltage(void)
+{
+ bat_interval_counter++;
+
+ if (bat_interval_counter >= GET_BAT_VOLTAGE_INTERVAL)
+ {
+ bat_interval_counter = 0;
+
+ bat_mon_on(); //Enable resistive divider and wait a bit
+ delay_cyc(100);
+
+ //Start conversation
+ ADC1->CR2 |= ADC_CR2_SWSTART;
+
+ //Wait for conversation end
+ while (!(ADC1->SR & ADC_SR_EOC));
+
+ bat_mon_off(); //Disable resistive divider
+
+ //Convert
+ bat_voltage = 2 * ((ADC1->DR * vref) / 4096); //x2 due to resistive voltage divider before ADC input
+
+ //Refresh flags
+ if (bat_voltage > V_BATTERY_75_TO_100)
+ {
+ set_device_flags(FLAGS_BATTERY, FLAG_BATTERY_75_TO_100);
+ }
+ else if (bat_voltage > V_BATTERY_50_TO_75)
+ {
+ set_device_flags(FLAGS_BATTERY, FLAG_BATTERY_50_TO_75);
+ }
+ else if (bat_voltage > V_BATTERY_25_TO_50)
+ {
+ set_device_flags(FLAGS_BATTERY, FLAG_BATTERY_25_TO_50);
+ }
+ else if (bat_voltage > V_BATTERY_10_TO_25)
+ {
+ set_device_flags(FLAGS_BATTERY, FLAG_BATTERY_10_TO_25);
+ }
+ else
+ {
+ set_device_flags(FLAGS_BATTERY, FLAG_BATTERY_0_TO_10);
+ return 1;
+ }
+ }
+
+ return 0;
+}
+
+
+
+float get_bat_voltage(void)
+{
+ return bat_voltage;
+}
diff --git a/Firmware/CubeIDE/Code/src/buttons.c b/Firmware/CubeIDE/Code/src/buttons.c
new file mode 100644
index 0000000..ff74a1d
--- /dev/null
+++ b/Firmware/CubeIDE/Code/src/buttons.c
@@ -0,0 +1,157 @@
+/*
+ ELEPH - Local Relative Navigation System
+
+ Copyright (C) 2021 Feruz Topalov
+ Released under the GNU General Public License v3.0
+
+ file: buttons.c
+*/
+
+#include "stm32f10x.h"
+#include "buttons.h"
+
+
+
+//SCAN_INTERVAL: 1000000 = 0.8 s; 1500 = 1 ms
+#define SCAN_INTERVAL (1500)
+
+#define BUTTONS_NUM (5) //five buttons total
+
+#define BUTTON_WEIGHT_MAX (16)
+#define BUTTON_WEIGHT_MIN (0)
+
+#define BUTTON_THRESHOLD_HI (12) //0.8 of BUTTON_WEIGHT_MAX
+#define BUTTON_THRESHOLD_LO (4) //0.2 of BUTTON_WEIGHT_MAX
+
+#define BUTTON_PRESSED (0)
+#define BUTTON_RELEASED (1)
+
+#define BUTTON_PRESSED_COUNTER_MAX (UINT16_MAX)
+#define BUTTON_PRESSED_COUNTER_THRESHOLD (350) //short or long cick?
+
+#define TIMEOUT_NO_OVERFLOW (0)
+#define TIMEOUT_OVERFLOW (1)
+
+#define BUTTON_ACTIONS_NUM (2) //two actions: short click, long click
+#define BUTTON_ACTION_SHORT (0)
+#define BUTTON_ACTION_LONG (1)
+
+
+
+uint32_t scan_interval_counter = 0;
+uint32_t idr_register_copy = 0;
+
+uint8_t button_weight[BUTTONS_NUM] = {BUTTON_WEIGHT_MAX,
+ BUTTON_WEIGHT_MAX,
+ BUTTON_WEIGHT_MAX,
+ BUTTON_WEIGHT_MAX,
+ BUTTON_WEIGHT_MAX};
+
+uint8_t button_state[BUTTONS_NUM] = {BUTTON_RELEASED,
+ BUTTON_RELEASED,
+ BUTTON_RELEASED,
+ BUTTON_RELEASED,
+ BUTTON_RELEASED};
+
+uint8_t button_prev_state[BUTTONS_NUM] = {BUTTON_RELEASED,
+ BUTTON_RELEASED,
+ BUTTON_RELEASED,
+ BUTTON_RELEASED,
+ BUTTON_RELEASED};
+
+uint16_t button_pressed_counter[BUTTONS_NUM] = {0};
+
+uint8_t timeout_state[BUTTONS_NUM] = {TIMEOUT_NO_OVERFLOW,
+ TIMEOUT_NO_OVERFLOW,
+ TIMEOUT_NO_OVERFLOW,
+ TIMEOUT_NO_OVERFLOW,
+ TIMEOUT_NO_OVERFLOW};
+
+uint8_t timeout_prev_state[BUTTONS_NUM] = {TIMEOUT_NO_OVERFLOW,
+ TIMEOUT_NO_OVERFLOW,
+ TIMEOUT_NO_OVERFLOW,
+ TIMEOUT_NO_OVERFLOW,
+ TIMEOUT_NO_OVERFLOW};
+
+
+
+//button return code = {ButtonNumber(0...BUTTONS_NUM-1) * BUTTON_ACTIONS_NUM + BUTTON_ACTION(_SHORT)(_LONG)} + 1
+uint8_t scan_buttons(void)
+{
+ if (scan_interval_counter < SCAN_INTERVAL)
+ {
+ scan_interval_counter++; //increase counter
+ }
+ else
+ {
+ scan_interval_counter = 0; //time to scan buttons! reset counter
+
+ idr_register_copy = GPIOA->IDR; //save pins data
+ idr_register_copy &= (GPIO_IDR_IDR1 | //mask needed pins
+ GPIO_IDR_IDR2 |
+ GPIO_IDR_IDR3 |
+ GPIO_IDR_IDR4 |
+ GPIO_IDR_IDR5);
+
+ idr_register_copy >>= 1; //align bits to the left, now IDR1(PA1) is in LSBit position
+
+ for (uint8_t i = 0; i < BUTTONS_NUM; i++) //update buttons weight (digital capacitor, increase or decrease "charge")
+ {
+ if (idr_register_copy & ((uint32_t)1 << i)) //check pin state
+ {
+ if (button_weight[i] < BUTTON_WEIGHT_MAX)
+ {
+ button_weight[i] += 1; // if input pin = 1, increase weight
+ }
+ }
+ else
+ {
+ if (button_weight[i] > BUTTON_WEIGHT_MIN)
+ {
+ button_weight[i] -= 1; // if input pin = 0, decrease weight
+ }
+ }
+ }
+
+ for (uint8_t i = 0; i < BUTTONS_NUM; i++) //make a desicion "button is pressed or not?" (with hysteresis)
+ {
+ if (button_weight[i] > BUTTON_THRESHOLD_HI)
+ {
+ button_prev_state[i] = button_state[i];
+ button_state[i] = BUTTON_RELEASED;
+ }
+ else if (button_weight[i] < BUTTON_THRESHOLD_LO)
+ {
+ button_prev_state[i] = button_state[i];
+ button_state[i] = BUTTON_PRESSED;
+ }
+ }
+
+ for (uint8_t i = 0; i < BUTTONS_NUM; i++) //check click duration. short click after button released (and before timeout overflow); long click after timeout overflow
+ {
+ if ((button_state[i] == BUTTON_PRESSED) && (button_pressed_counter[i] < BUTTON_PRESSED_COUNTER_MAX)) //increase timeout counter, update overflow states
+ {
+ button_pressed_counter[i]++;
+
+ timeout_prev_state[i] = timeout_state[i];
+ timeout_state[i] = (button_pressed_counter[i] > BUTTON_PRESSED_COUNTER_THRESHOLD); //overflow or not? 1 or 0?
+ }
+
+ if ((button_state[i] == BUTTON_RELEASED) && (button_prev_state[i] == BUTTON_PRESSED)) //button has been released
+ {
+ button_pressed_counter[i] = 0;
+
+ if (timeout_state[i] == TIMEOUT_NO_OVERFLOW)
+ {
+ return (i * BUTTON_ACTIONS_NUM + BUTTON_ACTION_SHORT) + 1; //if before overflow, then short click
+ }
+ }
+
+ if ((timeout_state[i] == TIMEOUT_OVERFLOW) && (timeout_prev_state[i] == TIMEOUT_NO_OVERFLOW)) //overflow occured
+ {
+ return (i * BUTTON_ACTIONS_NUM + BUTTON_ACTION_LONG) + 1; //long click
+ }
+ }
+ }
+ return BTN_NO_ACTION;
+}
diff --git a/Firmware/CubeIDE/Code/src/gpio.c b/Firmware/CubeIDE/Code/src/gpio.c
new file mode 100644
index 0000000..06c8887
--- /dev/null
+++ b/Firmware/CubeIDE/Code/src/gpio.c
@@ -0,0 +1,332 @@
+/*
+ ELEPH - Local Relative Navigation System
+
+ Copyright (C) 2021 Feruz Topalov
+ Released under the GNU General Public License v3.0
+
+ file: gpio.c
+*/
+
+#include "stm32f10x.h"
+#include "gpio.h"
+
+
+
+//Initialization of all used ports
+void gpio_init(void)
+{
+ //Port A
+ RCC->APB2ENR |= RCC_APB2ENR_IOPAEN;
+
+ //PA0 - ADC0 (Battery voltage)
+ GPIOA->CRL &= ~GPIO_CRL_MODE0; //input mode
+ GPIOA->CRL &= ~GPIO_CRL_CNF0; //analog input
+
+ //PA1 - Button 1
+ GPIOA->CRL &= ~GPIO_CRL_MODE1; //input mode
+ GPIOA->CRL &= ~GPIO_CRL_CNF1_0; //input with pull
+ GPIOA->CRL |= GPIO_CRL_CNF1_1;
+ GPIOA->ODR |= GPIO_ODR_ODR1; //pull-up on
+
+ //PA2 - Button 2
+ GPIOA->CRL &= ~GPIO_CRL_MODE2; //input mode
+ GPIOA->CRL &= ~GPIO_CRL_CNF2_0; //input with pull
+ GPIOA->CRL |= GPIO_CRL_CNF2_1;
+ GPIOA->ODR |= GPIO_ODR_ODR2; //pull-up on
+
+ //PA3 - Button 3
+ GPIOA->CRL &= ~GPIO_CRL_MODE3; //input mode
+ GPIOA->CRL &= ~GPIO_CRL_CNF3_0; //input with pull
+ GPIOA->CRL |= GPIO_CRL_CNF3_1;
+ GPIOA->ODR |= GPIO_ODR_ODR3; //pull-up on
+
+ //PA4 - Button 4
+ GPIOA->CRL &= ~GPIO_CRL_MODE4; //input mode
+ GPIOA->CRL &= ~GPIO_CRL_CNF4_0; //input with pull
+ GPIOA->CRL |= GPIO_CRL_CNF4_1;
+ GPIOA->ODR |= GPIO_ODR_ODR4; //pull-up on
+
+ //PA5 - Button 5
+ GPIOA->CRL &= ~GPIO_CRL_MODE5; //input mode
+ GPIOA->CRL &= ~GPIO_CRL_CNF5_0; //input with pull
+ GPIOA->CRL |= GPIO_CRL_CNF5_1;
+ GPIOA->ODR |= GPIO_ODR_ODR5; //pull-up on
+
+ //PA6 - Battery monitor switch
+ GPIOA->CRL |= GPIO_CRL_MODE6; //output 50 MHz
+ GPIOA->CRL &= ~GPIO_CRL_CNF6; //output push-pull
+
+ //PA7 - Piezo Buzzer (PWM)
+ GPIOA->CRL |= GPIO_CRL_MODE7; //output mode
+ GPIOA->CRL &= ~GPIO_CRL_CNF7_0; //alternate output push-pull
+ GPIOA->CRL |= GPIO_CRL_CNF7_1;
+
+ //PA8 - RES (SSD1306)
+ GPIOA->CRH |= GPIO_CRH_MODE8; //output 50 MHz
+ GPIOA->CRH &= ~GPIO_CRH_CNF8; //output push-pull
+
+ //PA9 - USART TX1 (Debug out)
+ GPIOA->CRH |= GPIO_CRH_MODE9; //output 50 MHz
+ GPIOA->CRH &= ~GPIO_CRH_CNF9_0; //alternate output push-pull
+ GPIOA->CRH |= GPIO_CRH_CNF9_1;
+
+ //PA10 - USART RX1 (GPS NMEA here)
+ GPIOA->CRH &= ~GPIO_CRH_MODE10; //input
+ GPIOA->CRH |= GPIO_CRH_CNF10_0; //alternate input floating
+ GPIOA->CRH &= ~GPIO_CRH_CNF10_1;
+
+ //PA11 - GPS (PPS interrupt)
+ GPIOA->CRH &= ~GPIO_CRH_MODE11; //input mode
+ GPIOA->CRH &= ~GPIO_CRH_CNF11_0; //input with pull
+ GPIOA->CRH |= GPIO_CRH_CNF11_1;
+ GPIOA->ODR &= ~GPIO_ODR_ODR11; //pull-down
+
+ //PA12 - CTS (SI4463)
+ GPIOA->CRH &= ~GPIO_CRH_MODE11; //input mode
+ GPIOA->CRH &= ~GPIO_CRH_CNF11_0; //input with pull
+ GPIOA->CRH |= GPIO_CRH_CNF11_1;
+ GPIOA->ODR &= ~GPIO_ODR_ODR11; //pull-down
+
+ //PA15 - CS (SI4463)
+ GPIOA->CRH |= GPIO_CRH_MODE15; //output 50 MHz
+ GPIOA->CRH &= ~GPIO_CRH_CNF15; //output push-pull
+
+
+ //Port B
+ RCC->APB2ENR |= RCC_APB2ENR_IOPBEN;
+
+ //PB0 - Red LED
+ GPIOB->CRL |= GPIO_CRL_MODE0; //output 50 MHz
+ GPIOB->CRL &= ~GPIO_CRL_CNF0; //output push-pull
+
+ //PB1 - Green LED
+ GPIOB->CRL |= GPIO_CRL_MODE1; //output 50 MHz
+ GPIOB->CRL &= ~GPIO_CRL_CNF1; //output push-pull
+
+ //PB3 - SCK (SI4463)
+ GPIOB->CRL |= GPIO_CRL_MODE3; //output 50 MHz
+ GPIOB->CRL &= ~GPIO_CRL_CNF3_0; //alternate output push-pull
+ GPIOB->CRL |= GPIO_CRL_CNF3_1;
+
+ //PB4 - MISO (SI4463)
+ GPIOB->CRL &= ~GPIO_CRL_MODE4; //input mode
+ GPIOB->CRL |= GPIO_CRL_CNF4_0; //floating input
+ GPIOB->CRL &= ~GPIO_CRL_CNF4_1;
+
+ //PB5 - MOSI (SI4463)
+ GPIOB->CRL |= GPIO_CRL_MODE5; //output 50 MHz
+ GPIOB->CRL &= ~GPIO_CRL_CNF5_0; //alternate output push-pull
+ GPIOB->CRL |= GPIO_CRL_CNF5_1;
+
+ //PB6 - IRQn (SI4463 interrupt)
+ GPIOB->CRL &= ~GPIO_CRL_MODE6; //input mode
+ GPIOB->CRL &= ~GPIO_CRL_CNF6_0; //input with pull
+ GPIOB->CRL |= GPIO_CRL_CNF6_1;
+ GPIOB->ODR |= GPIO_ODR_ODR6; //pull-up
+
+ //PB7 - SDN (SI4463)
+ GPIOB->CRL |= GPIO_CRL_MODE7; //output 50 MHz
+ GPIOB->CRL &= ~GPIO_CRL_CNF7; //output push-pull
+
+ //PB10 - I2C SCL
+ GPIOB->CRH |= GPIO_CRH_MODE10; //output 50 MHz
+ GPIOB->CRH |= GPIO_CRH_CNF10; //alternate function open-drain
+
+ //PB11 - I2C SDA
+ GPIOB->CRH |= GPIO_CRH_MODE11; //output max speed
+ GPIOB->CRH |= GPIO_CRH_CNF11; //alternate function open-drain
+
+ //PB12 - CS (SSD1306)
+ GPIOB->CRH |= GPIO_CRH_MODE12; //output 50 MHz
+ GPIOB->CRH &= ~GPIO_CRH_CNF12; //output push-pull
+
+ //PB13 - SCK (SSD1306)
+ GPIOB->CRH |= GPIO_CRH_MODE13; //output 50 MHz
+ GPIOB->CRH &= ~GPIO_CRH_CNF13_0; //alternate output push-pull
+ GPIOB->CRH |= GPIO_CRH_CNF13_1;
+
+ //PB14 - D/C (SSD1306)
+ GPIOB->CRH |= GPIO_CRH_MODE14; //output 50 MHz
+ GPIOB->CRH &= ~GPIO_CRH_CNF14; //output push-pull
+
+ //PB15 - MOSI (SSD1306)
+ GPIOB->CRH |= GPIO_CRH_MODE15; //output 50 MHz
+ GPIOB->CRH &= ~GPIO_CRH_CNF15_0; //alternate output push-pull
+ GPIOB->CRH |= GPIO_CRH_CNF15_1;
+
+
+ //Port C
+ RCC->APB2ENR |= RCC_APB2ENR_IOPCEN;
+
+ //PC13 - Blue led
+ GPIOC->CRH |= GPIO_CRH_MODE13; //output 50 MHz
+ GPIOC->CRH &= ~GPIO_CRH_CNF13; //output push-pull
+ led_board_off();
+}
+
+
+
+//Init external interrupts
+void ext_int_init(void)
+{
+ RCC->APB2ENR |= RCC_APB2ENR_AFIOEN; //enable afio clock
+
+ //PA11 GPS PPS interrupt on rising edge
+ AFIO->EXTICR[2] |= AFIO_EXTICR3_EXTI11_PA; //exti 11 source is port A
+ EXTI->RTSR |= EXTI_RTSR_TR11; //interrupt 11 on rising edge
+ EXTI->IMR |= EXTI_IMR_MR11; //unmask interrupt 11
+ NVIC_EnableIRQ(EXTI15_10_IRQn); //enable interrupt
+
+ //PB6 SI4463 RX interrupt on falling edge
+ AFIO->EXTICR[1] |= AFIO_EXTICR2_EXTI6_PB; //exti 6 source is port B
+ EXTI->FTSR |= EXTI_FTSR_TR6; //interrupt 6 on falling edge
+ EXTI->IMR |= EXTI_IMR_MR6; //unmask interrupt 6
+ NVIC_EnableIRQ(EXTI9_5_IRQn); //enable interrupt
+
+ EXTI->PR = (uint32_t)0x0007FFFF; //clear all pending interrupts
+}
+
+
+
+//Red led on
+void led_red_on(void)
+{
+ GPIOB->BSRR = GPIO_BSRR_BS0;
+}
+
+
+
+//Red led off
+void led_red_off(void)
+{
+ GPIOB->BSRR = GPIO_BSRR_BR0;
+}
+
+
+
+//Red green on
+void led_green_on(void)
+{
+ GPIOB->BSRR = GPIO_BSRR_BS1;
+}
+
+
+
+//Red green off
+void led_green_off(void)
+{
+ GPIOB->BSRR = GPIO_BSRR_BR1;
+}
+
+
+
+//Blue led on
+void led_board_on(void)
+{
+ GPIOC->BSRR = GPIO_BSRR_BR13;
+}
+
+
+
+//Blue led off
+void led_board_off(void)
+{
+ GPIOC->BSRR = GPIO_BSRR_BS13;
+}
+
+
+
+//SDN SI4463 active
+void sdn_si4463_active(void)
+{
+ GPIOB->BSRR = GPIO_BSRR_BS7;
+}
+
+
+
+//SDN SI4463 inactive
+void sdn_si4463_inactive(void)
+{
+ GPIOB->BSRR = GPIO_BSRR_BR7;
+}
+
+
+
+//CS SI4463 active
+void cs_si4463_active(void)
+{
+ GPIOA->BSRR = GPIO_BSRR_BR15;
+}
+
+
+
+//CS SI4463 inactive
+void cs_si4463_inactive(void)
+{
+ GPIOA->BSRR = GPIO_BSRR_BS15;
+}
+
+
+
+//RES SSD1306 active
+void res_ssd1306_active(void)
+{
+ GPIOA->BSRR = GPIO_BSRR_BR8;
+}
+
+
+
+//RES SSD1306 inactive
+void res_ssd1306_inactive(void)
+{
+ GPIOA->BSRR = GPIO_BSRR_BS8;
+}
+
+
+
+//Data mode SSD1306
+void ssd1306_data_mode(void)
+{
+ GPIOB->BSRR = GPIO_BSRR_BS14;
+}
+
+
+
+//Command mode SSD1306
+void ssd1306_command_mode(void)
+{
+ GPIOB->BSRR = GPIO_BSRR_BR14;
+}
+
+
+
+//CS SSD1306 active
+void cs_ssd1306_active(void)
+{
+ GPIOB->BSRR = GPIO_BSRR_BR12;
+}
+
+
+
+//CS SSD1306 inactive
+void cs_ssd1306_inactive(void)
+{
+ GPIOB->BSRR = GPIO_BSRR_BS12;
+}
+
+
+
+//Battery monitoring on
+void bat_mon_on(void)
+{
+ GPIOA->BSRR = GPIO_BSRR_BS6;
+}
+
+
+
+//Battery monitoring off
+void bat_mon_off(void)
+{
+ GPIOA->BSRR = GPIO_BSRR_BR6;
+}
+
diff --git a/Firmware/CubeIDE/Code/src/gps.c b/Firmware/CubeIDE/Code/src/gps.c
new file mode 100644
index 0000000..437283e
--- /dev/null
+++ b/Firmware/CubeIDE/Code/src/gps.c
@@ -0,0 +1,461 @@
+/*
+ ELEPH - Local Relative Navigation System
+
+ Copyright (C) 2021 Feruz Topalov
+ Released under the GNU General Public License v3.0
+
+ file: gps.c
+*/
+
+#include
+#include "stm32f10x.h"
+#include "main.h"
+#include "gps.h"
+#include "uart.h"
+#include "service.h"
+#include "settings.h"
+#include "points.h"
+#include "lrns.h"
+
+
+
+void gps_raw_convert_to_numerical(void);
+
+
+
+const float knots_to_kph = 1.852; //knots to kilometers per hour multiplyer
+
+
+uint8_t nmea_checksum(uint16_t pos);
+uint8_t parse_RMC(void);
+uint8_t parse_GGA(void);
+uint8_t parse_GSA(void);
+uint8_t parse_GSV(void);
+
+
+
+char nmea_data[UART_BUF_LEN];
+struct gps_raw_struct gps_raw;
+struct gps_num_struct gps_num;
+
+
+
+char tmp_char[15];
+uint8_t tmp_uint8;
+float tmp_float;
+
+
+
+//Parse all gps fields all together
+uint8_t parse_gps(void)
+{
+ memset(&gps_raw, 0, sizeof(gps_raw));
+ if (parse_RMC() && parse_GGA() && parse_GSA() && parse_GSV())
+ {
+ memset(&gps_num, 0, sizeof(gps_num));
+ gps_raw_convert_to_numerical();
+ return 1;
+ }
+ else
+ {
+ return 0;
+ }
+}
+
+
+
+//Converts gps_raw data (symbols) to gps_num data (numbers) with conversions if needed
+void gps_raw_convert_to_numerical(void)
+{
+ //Time
+ tmp_char[0] = gps_raw.time[0];
+ tmp_char[1] = gps_raw.time[1];
+ tmp_char[2] = 0;
+ gps_num.hour = (uint8_t)atoi32(&tmp_char[0]);
+
+ tmp_char[0] = gps_raw.time[2];
+ tmp_char[1] = gps_raw.time[3];
+ tmp_char[2] = 0;
+ gps_num.minute = (uint8_t)atoi32(&tmp_char[0]);
+
+ tmp_char[0] = gps_raw.time[4];
+ tmp_char[1] = gps_raw.time[5];
+ tmp_char[2] = 0;
+ gps_num.second = (uint8_t)atoi32(&tmp_char[0]);
+
+
+ //Date
+ tmp_char[0] = gps_raw.date[0];
+ tmp_char[1] = gps_raw.date[1];
+ tmp_char[2] = 0;
+ gps_num.day = (uint8_t)atoi32(&tmp_char[0]);
+
+ tmp_char[0] = gps_raw.date[2];
+ tmp_char[1] = gps_raw.date[3];
+ tmp_char[2] = 0;
+ gps_num.month = (uint8_t)atoi32(&tmp_char[0]);
+
+ tmp_char[0] = gps_raw.date[4];
+ tmp_char[1] = gps_raw.date[5];
+ tmp_char[2] = 0;
+ gps_num.year = (uint8_t)atoi32(&tmp_char[0]);
+
+
+ //Latitude
+ tmp_char[0] = gps_raw.latitude[0];
+ tmp_char[1] = gps_raw.latitude[1];
+ tmp_char[2] = 0;
+ tmp_uint8 = (uint8_t)atoi32(&tmp_char[0]); //int part of lat
+ tmp_float = atof32(&(gps_raw.latitude[2])); //frac part of lat
+
+ tmp_float /= 60.0; //convert ddmm.mmmm to dd.dddddd
+ tmp_float += tmp_uint8;
+
+ if (gps_raw.ns[0] == 'S')
+ {
+ gps_num.latitude.in_deg = tmp_float * -1.0; //negative (southern) latitudes
+ }
+ else
+ {
+ gps_num.latitude.in_deg = tmp_float;
+ }
+
+ gps_num.latitude.in_rad = gps_num.latitude.in_deg * deg_to_rad;
+
+
+ //Longitude
+ tmp_char[0] = gps_raw.longitude[0];
+ tmp_char[1] = gps_raw.longitude[1];
+ tmp_char[2] = gps_raw.longitude[2];
+ tmp_char[3] = 0;
+ tmp_uint8 = (uint8_t)atoi32(&tmp_char[0]); //int part of lon
+ tmp_float = atof32(&(gps_raw.longitude[3])); //frac part of lon
+
+ tmp_float /= 60.0; //convert dddmm.mmmm to ddd.dddddd
+ tmp_float += tmp_uint8;
+
+ if (gps_raw.ew[0] == 'W')
+ {
+ gps_num.longitude.in_deg = tmp_float * -1.0; //negative (western) longitudes
+ }
+ else
+ {
+ gps_num.longitude.in_deg = tmp_float;
+ }
+
+ gps_num.longitude.in_rad = gps_num.longitude.in_deg * deg_to_rad;
+
+
+ //Speed
+ gps_num.speed = atof32(&(gps_raw.speed[0])) * knots_to_kph;
+
+ //Course
+ gps_num.course = atof32(&(gps_raw.course[0]));
+
+ //Altitude
+ gps_num.altitude = atof32(&(gps_raw.altitude[0]));
+
+ //Satellites
+ gps_num.sat_view = (uint8_t)atoi32(&(gps_raw.sat_view[0]));
+ gps_num.sat_used = (uint8_t)atoi32(&(gps_raw.sat_used[0]));
+
+
+ //Status, Mode, PDOP
+ if (gps_raw.status[0] == 'A')
+ {
+ gps_num.status = GPS_DATA_VALID;
+ }
+ else
+ {
+ gps_num.status = GPS_DATA_INVALID;
+ }
+
+ gps_num.mode = (uint8_t)atoi32(&(gps_raw.mode[0]));
+
+ gps_num.pdop = atof32(&(gps_raw.pdop[0]));
+}
+
+
+
+//Parse RMC sentence
+uint8_t parse_RMC(void)
+{
+ uint8_t comma = 0;
+ uint8_t sym = 0;
+ uint16_t pos = 0;
+
+ while (!((nmea_data[pos] == '$') &&
+ (nmea_data[pos + 3] == 'R') &&
+ (nmea_data[pos + 4] == 'M') &&
+ (nmea_data[pos + 5] == 'C')) && pos < UART_BUF_LEN) //search for start pos
+ {
+ pos++;
+ }
+
+ if(nmea_checksum(pos) == 0)
+ {
+ return 0; //checksum error
+ }
+
+ for (uint16_t i = pos + 6; i < UART_BUF_LEN ; i++) //i starts from the symbol right after "$GPRMC" string
+ {
+ if (nmea_data[i] == '*') return 1; //end of the sentence
+
+ if (nmea_data[i] == ',')
+ {
+ comma++; //increase comma counter
+ sym = 0;
+ }
+ else
+ {
+ switch (comma) //surfing through RMC data fields
+ {
+ case 1:
+ gps_raw.time[sym++] = nmea_data[i];
+ break;
+ case 2:
+ gps_raw.status[sym++] = nmea_data[i];
+ break;
+ case 3:
+ gps_raw.latitude[sym++] = nmea_data[i];
+ break;
+ case 4:
+ gps_raw.ns[sym++] = nmea_data[i];
+ break;
+ case 5:
+ gps_raw.longitude[sym++] = nmea_data[i];
+ break;
+ case 6:
+ gps_raw.ew[sym++] = nmea_data[i];
+ break;
+ case 7:
+ gps_raw.speed[sym++] = nmea_data[i];
+ break;
+ case 8:
+ gps_raw.course[sym++] = nmea_data[i];
+ break;
+ case 9:
+ gps_raw.date[sym++] = nmea_data[i];
+ break;
+ default:
+ break;
+ }
+ }
+ }
+ return 1;
+}
+
+
+
+//Parse GGA sentence
+uint8_t parse_GGA(void)
+{
+ uint8_t comma = 0;
+ uint8_t sym = 0;
+ uint16_t pos = 0;
+
+ while (!((nmea_data[pos] == '$') &&
+ (nmea_data[pos + 3] == 'G') &&
+ (nmea_data[pos + 4] == 'G') &&
+ (nmea_data[pos + 5] == 'A')) && pos < UART_BUF_LEN) //search for start pos
+ {
+ pos++;
+ }
+
+ if(nmea_checksum(pos) == 0)
+ {
+ return 0; //checksum error
+ }
+
+ for (uint16_t i = pos + 6; i < UART_BUF_LEN ; i++) //i starts from the symbol right after "$GPRMC" string
+ {
+ if (nmea_data[i] == '*') return 1; //end of the sentence
+
+ if (nmea_data[i] == ',')
+ {
+ comma++; //increase comma counter
+ sym = 0;
+ }
+ else
+ {
+ switch (comma) //surfing through GGA data fields
+ {
+ case 7:
+ gps_raw.sat_used[sym++] = nmea_data[i];
+ break;
+ case 9:
+ gps_raw.altitude[sym++] = nmea_data[i];
+ break;
+ default:
+ break;
+ }
+ }
+ }
+ return 1;
+}
+
+
+
+//Parse GSA sentence
+uint8_t parse_GSA(void)
+{
+ uint8_t comma = 0;
+ uint8_t sym = 0;
+ uint16_t pos = 0;
+
+ while (!((nmea_data[pos] == '$') &&
+ (nmea_data[pos + 3] == 'G') &&
+ (nmea_data[pos + 4] == 'S') &&
+ (nmea_data[pos + 5] == 'A')) && pos < UART_BUF_LEN) //search for start pos
+ {
+ pos++;
+ }
+
+ if(nmea_checksum(pos) == 0)
+ {
+ return 0; //checksum error
+ }
+
+ for (uint16_t i = pos + 6; i < UART_BUF_LEN ; i++) //i starts from the symbol right after "$GPRMC" string
+ {
+ if (nmea_data[i] == '*') return 1; //end of the sentence
+
+ if (nmea_data[i] == ',')
+ {
+ comma++; //increase comma counter
+ sym = 0;
+ }
+ else
+ {
+ switch (comma) //surfing through GSA data fields
+ {
+ case 2:
+ gps_raw.mode[sym++] = nmea_data[i];
+ break;
+ case 15:
+ gps_raw.pdop[sym++] = nmea_data[i];
+ break;
+ default:
+ break;
+ }
+ }
+ }
+ return 1;
+}
+
+
+
+//Parse GSV sentence
+uint8_t parse_GSV(void)
+{
+ uint8_t comma = 0;
+ uint8_t sym = 0;
+ uint16_t pos = 0;
+
+ while (!((nmea_data[pos] == '$') &&
+ (nmea_data[pos + 3] == 'G') &&
+ (nmea_data[pos + 4] == 'S') &&
+ (nmea_data[pos + 5] == 'V')) && pos < UART_BUF_LEN) //search for start pos
+ {
+ pos++;
+ }
+
+ if(nmea_checksum(pos) == 0)
+ {
+ return 0; //checksum error
+ }
+
+ for (uint16_t i = pos + 6; i < UART_BUF_LEN ; i++) //i starts from the symbol right after "$GPRMC" string
+ {
+ if (nmea_data[i] == '*') return 1; //end of the sentence
+
+ if (nmea_data[i] == ',')
+ {
+ comma++; //increase comma counter
+ sym = 0;
+ }
+ else
+ {
+ switch (comma) //surfing through GSV data fields
+ {
+ case 3:
+ gps_raw.sat_view[sym++] = nmea_data[i];
+ break;
+ default:
+ break;
+ }
+ }
+ }
+ return 1;
+}
+
+
+
+//NMEA checksum
+uint8_t nmea_checksum(uint16_t pos)
+{
+ uint8_t CheckSum = 0;
+ uint8_t MessageCheckSum = 0;
+
+ pos++; //pick up symbol right after $
+ while (nmea_data[pos] != '*')
+ {
+ CheckSum ^= nmea_data[pos];
+ if (++pos >= UART_BUF_LEN) return 0; //check sum not found
+ }
+
+ if (nmea_data[++pos] > 0x40)
+ {
+ MessageCheckSum = (nmea_data[pos] - 0x37) << 4; //ascii hex to number
+ }
+ else
+ {
+ MessageCheckSum = (nmea_data[pos] - 0x30) << 4;
+ }
+
+ if (nmea_data[++pos] > 0x40)
+ {
+ MessageCheckSum += (nmea_data[pos] - 0x37); //ascii hex to number
+ }
+ else
+ {
+ MessageCheckSum += (nmea_data[pos] - 0x30);
+ }
+
+ if (MessageCheckSum == CheckSum)
+ {
+ return 1;
+ }
+ else
+ {
+ return 0;
+ }
+}
+
+
+
+uint8_t get_gps_status(void)
+{
+ return gps_num.status;
+}
+
+
+
+char *get_nmea_buf(void)
+{
+ return &nmea_data[0];
+}
+
+
+
+struct gps_raw_struct *get_gps_raw(void)
+{
+ return &gps_raw;
+}
+
+
+
+struct gps_num_struct *get_gps_num(void)
+{
+ return &gps_num;
+}
diff --git a/Firmware/CubeIDE/Code/src/i2c.c b/Firmware/CubeIDE/Code/src/i2c.c
new file mode 100644
index 0000000..18a57af
--- /dev/null
+++ b/Firmware/CubeIDE/Code/src/i2c.c
@@ -0,0 +1,33 @@
+/*
+ ELEPH - Local Relative Navigation System
+
+ Copyright (C) 2021 Feruz Topalov
+ Released under the GNU General Public License v3.0
+
+ file: gpio.c
+*/
+
+#include "stm32f10x.h"
+#include "i2c.h"
+#include "service.h"
+
+
+
+#define I2C_CLOCK_DELAY (500)
+
+
+
+void i2c_init(void)
+{
+ //I2C config
+ RCC->APB1ENR |= RCC_APB1ENR_I2C2EN; //enable i2c clock
+
+ I2C2->CR2 &= ~I2C_CR2_FREQ; //clear bits before set
+ I2C2->CR2 |= (uint16_t)10; //10 MHz periph clock
+
+ //Stndard mode
+ I2C2->CCR |= (uint16_t)180; //CCR = TSCL/(2 * TPCLK1); TSCL = 1 / 100kHz standard mode freq; TPCLK1 = 1 / APB1 clock 36 MHz
+ I2C2->TRISE |= (uint16_t)37; //TRISE = (Tr max/TPCLK1)+1; Tr max = 1000nS for standard mode
+
+ I2C2->CR1 |= I2C_CR1_PE; //enable i2c2
+}
diff --git a/Firmware/CubeIDE/Code/src/lrns.c b/Firmware/CubeIDE/Code/src/lrns.c
new file mode 100644
index 0000000..a245f84
--- /dev/null
+++ b/Firmware/CubeIDE/Code/src/lrns.c
@@ -0,0 +1,491 @@
+/*
+ ELEPH - Local Relative Navigation System
+
+ Copyright (C) 2021 Feruz Topalov
+ Released under the GNU General Public License v3.0
+
+ file: lrns.c
+*/
+
+#include
+#include
+#include "stm32f10x.h"
+#include "main.h"
+#include "service.h"
+#include "settings.h"
+#include "gps.h"
+#include "points.h"
+#include "lrns.h"
+#include "si4463.h"
+#include "gpio.h"
+
+
+
+//(bit) start position in "flag" variable
+#define FLAGS_BATTERY_POS (0)
+#define FLAGS_GPS_FIX_POS (3)
+#define FLAGS_PDOP_POS (4)
+#define FLAGS_ALARM_POS (5)
+
+//bit masks in "flag" variable
+#define FLAGS_BATTERY_MASK (0x07)
+#define FLAGS_GPS_FIX_MASK (0x08)
+#define FLAGS_PDOP_MASK (0x10)
+#define FLAGS_ALARM_MASK (0x20)
+
+
+
+//Air packet structure and fields position (must match structure "gps_air")
+#define PACKET_DEVICE_NUMBER_POS (0)
+#define PACKET_DEVICE_ID_POS (1)
+#define PACKET_FLAGS_POS (3)
+#define PACKET_LATITUDE_POS (4)
+#define PACKET_LONGITUDE_POS (8)
+#define PACKET_ALTITUDE_POS (12)
+#define PACKET_SPEED_POS (14)
+#define PACKET_COURSE_POS (15)
+
+
+
+#define PDOP_THRESHOLD (6.0)
+
+
+
+const double rad_to_deg = 57.29577951308232; //rad to deg multiplyer
+const double deg_to_rad = 0.0174532925199433; //deg to rad multiplyer
+
+const double twice_mean_earth_radius = 12742016.0; // 2 * 6371008 meters
+const double pi_div_by_4 = 0.7853981633974483; // pi / 4
+
+
+
+struct gps_air_struct gps_air[DEVICES_IN_GROUP + 1]; //structure for devices from 1 to DEVICES_IN_GROUP. Index 0 is invalid and always empty
+struct gps_air_struct *p_gps_air[DEVICES_IN_GROUP + 1];
+
+struct gps_rel_struct gps_rel[DEVICES_IN_GROUP + 1]; //structure with relative coordinates. Indexing is the same as above
+struct gps_rel_struct *p_gps_rel[DEVICES_IN_GROUP + 1];
+
+struct dev_aux_struct dev_aux[DEVICES_IN_GROUP + 1]; //structure with auxiliary information. Indexing is the same as above
+struct dev_aux_struct *p_dev_aux[DEVICES_IN_GROUP + 1];
+
+struct settings_struct *p_settings;
+struct gps_num_struct *p_gps_num;
+uint8_t *p_air_packet_tx;
+uint8_t *p_air_packet_rx;
+
+uint8_t device_number;
+
+
+
+void init_lrns(void)
+{
+ //Clear mem
+ for (uint8_t dev = 1; dev <= DEVICES_IN_GROUP; dev++)
+ {
+ memset(&gps_air[dev], 0, sizeof(gps_air[dev]));
+ memset(&gps_rel[dev], 0, sizeof(gps_rel[dev]));
+ }
+
+ //Get external things
+ p_settings = get_settings();
+ p_gps_num = get_gps_num();
+ p_air_packet_tx = get_air_packet_tx();
+ p_air_packet_rx = get_air_packet_rx();
+
+ //This device number
+ device_number = p_settings->device_number;
+
+ //Exist flag
+ dev_aux[device_number].exist_flag = 1;
+
+ //ID
+ gps_air[device_number].device_id[0] = p_settings->device_id[0]; //note: ID loads only once at startup
+ gps_air[device_number].device_id[1] = p_settings->device_id[1];
+}
+
+
+
+//Set this device flags
+void set_device_flags(uint8_t parameter_to_set, uint8_t parameter_value)
+{
+ uint8_t mask;
+ uint8_t pos;
+
+ switch (parameter_to_set)
+ {
+ case FLAGS_BATTERY:
+ mask = FLAGS_BATTERY_MASK;
+ pos = FLAGS_BATTERY_POS;
+ break;
+
+ case FLAGS_GPS_FIX:
+ mask = FLAGS_GPS_FIX_MASK;
+ pos = FLAGS_GPS_FIX_POS;
+ break;
+
+ case FLAGS_PDOP:
+ mask = FLAGS_PDOP_MASK;
+ pos = FLAGS_PDOP_POS;
+ break;
+
+ case FLAGS_ALARM:
+ mask = FLAGS_ALARM_MASK;
+ pos = FLAGS_ALARM_POS;
+ break;
+ }
+
+ gps_air[device_number].flags &= ~mask; //clear bits
+ parameter_value &= (mask >> pos); //clear non-masked bits
+ gps_air[device_number].flags |= (parameter_value << pos); //add to flags
+}
+
+
+
+//Get any device flags
+uint8_t get_device_flags(uint8_t dev_num, uint8_t parameter_to_get)
+{
+ uint8_t mask;
+ uint8_t pos;
+
+ switch (parameter_to_get)
+ {
+ case FLAGS_BATTERY:
+ mask = FLAGS_BATTERY_MASK;
+ pos = FLAGS_BATTERY_POS;
+ break;
+
+ case FLAGS_GPS_FIX:
+ mask = FLAGS_GPS_FIX_MASK;
+ pos = FLAGS_GPS_FIX_POS;
+ break;
+
+ case FLAGS_PDOP:
+ mask = FLAGS_PDOP_MASK;
+ pos = FLAGS_PDOP_POS;
+ break;
+
+ case FLAGS_ALARM:
+ mask = FLAGS_ALARM_MASK;
+ pos = FLAGS_ALARM_POS;
+ break;
+ }
+
+ return (gps_air[dev_num].flags & mask) >> pos;
+}
+
+
+
+//Check alarm status of each device and make red led on if any alarm exist
+uint8_t check_alarms(void)
+{
+ uint8_t led_status = 0;
+
+ for (uint8_t dev = 1; dev <= DEVICES_IN_GROUP; dev++)
+ {
+ if (get_device_flags(dev, FLAGS_ALARM) == FLAG_ALARM_ON)
+ {
+ led_status = 1;
+ }
+ }
+
+ if (led_status == 1)
+ {
+ led_red_on();
+ return 1;
+ }
+ else
+ {
+ led_red_off();
+ return 0;
+ }
+}
+
+
+
+void calc_timeout(uint32_t current_uptime)
+{
+ for (uint8_t dev = 1; dev <= DEVICES_IN_GROUP; dev++)
+ {
+ if (dev_aux[dev].exist_flag == 1)
+ {
+ dev_aux[dev].timeout = current_uptime - dev_aux[dev].timestamp;
+ }
+ }
+}
+
+
+
+//Check devices timeout and set flags if needed
+uint8_t check_timeout(void)
+{
+ uint8_t timeout_status = 0;
+
+ for (uint8_t dev = 1; dev <= DEVICES_IN_GROUP; dev++)
+ {
+ if (dev_aux[dev].memory_point_flag == 0) //no timeout alarm for memory points
+ {
+ if (p_settings->timeout_threshold.as_integer != TIMEOUT_ALARM_DISABLED)
+ {
+ if (dev_aux[dev].timeout > p_settings->timeout_threshold.as_integer)
+ {
+ dev_aux[dev].timeout_flag = 1;
+ timeout_status = 1;
+ }
+ else
+ {
+ dev_aux[dev].timeout_flag = 0;
+ }
+ }
+ }
+ }
+
+ if (timeout_status == 1)
+ {
+ return 1;
+ }
+ else
+ {
+ return 0;
+ }
+}
+
+
+
+uint8_t check_fence(void)
+{
+ uint8_t fence_status = 0;
+
+ for (uint8_t dev = 1; dev <= DEVICES_IN_GROUP; dev++)
+ {
+ if (dev_aux[dev].exist_flag)
+ {
+ if (gps_rel[dev].distance > p_settings->fence_threshold.as_integer)
+ {
+ dev_aux[dev].fence_flag = 1;
+ fence_status = 1;
+ }
+ else
+ {
+ dev_aux[dev].fence_flag = 0;
+ }
+ }
+ }
+
+ if (fence_status == 1)
+ {
+ return 1;
+ }
+ else
+ {
+ return 0;
+ }
+}
+
+
+
+void process_all_devices(void)
+{
+ for (uint8_t dev = 1; dev <= DEVICES_IN_GROUP; dev++)
+ {
+ if (dev_aux[dev].exist_flag == 1) //process mem points too
+ {
+ calc_relative_position(dev);
+ }
+ }
+}
+
+
+
+//Update gps_air structure with coordinates of this device in order to transmit them further
+void gps_air_update_my_data(uint32_t uptime)
+{
+
+ //Timestamp
+ dev_aux[device_number].timestamp = uptime;
+
+
+ //Flags
+ if (p_gps_num->mode == GPS_POSITION_3DFIX)
+ {
+ set_device_flags(FLAGS_GPS_FIX, FLAG_GPS_FIX_3D);
+ }
+ else
+ {
+ set_device_flags(FLAGS_GPS_FIX, FLAG_GPS_FIX_2D);
+ }
+
+ if (p_gps_num->pdop <= PDOP_THRESHOLD)
+ {
+ set_device_flags(FLAGS_PDOP, FLAG_PDOP_GOOD);
+ }
+ else
+ {
+ set_device_flags(FLAGS_PDOP, FLAG_PDOP_BAD);
+ }
+
+ //Latitude & Longitude
+ gps_air[device_number].latitude.as_float = p_gps_num->latitude.in_deg;
+ gps_air[device_number].longitude.as_float = p_gps_num->longitude.in_deg;
+
+ //Altitude
+ gps_air[device_number].altitude.as_integer = (int16_t)p_gps_num->altitude;
+
+ //Speed
+ gps_air[device_number].speed = (uint8_t)p_gps_num->speed;
+
+ //Course
+ gps_air[device_number].course.as_integer = (uint16_t)p_gps_num->course;
+}
+
+
+
+//Copy gps_air struct data to the TX air packet
+void fill_air_packet_with_struct_data(void)
+{
+ p_air_packet_tx[PACKET_DEVICE_NUMBER_POS] = device_number; //this device number
+ p_air_packet_tx[PACKET_DEVICE_ID_POS] = gps_air[device_number].device_id[0];
+ p_air_packet_tx[PACKET_DEVICE_ID_POS + 1] = gps_air[device_number].device_id[1];
+ p_air_packet_tx[PACKET_FLAGS_POS] = gps_air[device_number].flags;
+ p_air_packet_tx[PACKET_LATITUDE_POS] = gps_air[device_number].latitude.as_array[0];
+ p_air_packet_tx[PACKET_LATITUDE_POS + 1] = gps_air[device_number].latitude.as_array[1];
+ p_air_packet_tx[PACKET_LATITUDE_POS + 2] = gps_air[device_number].latitude.as_array[2];
+ p_air_packet_tx[PACKET_LATITUDE_POS + 3] = gps_air[device_number].latitude.as_array[3];
+ p_air_packet_tx[PACKET_LONGITUDE_POS] = gps_air[device_number].longitude.as_array[0];
+ p_air_packet_tx[PACKET_LONGITUDE_POS + 1] = gps_air[device_number].longitude.as_array[1];
+ p_air_packet_tx[PACKET_LONGITUDE_POS + 2] = gps_air[device_number].longitude.as_array[2];
+ p_air_packet_tx[PACKET_LONGITUDE_POS + 3] = gps_air[device_number].longitude.as_array[3];
+ p_air_packet_tx[PACKET_ALTITUDE_POS] = gps_air[device_number].altitude.as_array[0];
+ p_air_packet_tx[PACKET_ALTITUDE_POS + 1] = gps_air[device_number].altitude.as_array[1];
+ p_air_packet_tx[PACKET_SPEED_POS] = gps_air[device_number].speed;
+ p_air_packet_tx[PACKET_COURSE_POS] = gps_air[device_number].course.as_array[0];
+ p_air_packet_tx[PACKET_COURSE_POS + 1] = gps_air[device_number].course.as_array[1];
+}
+
+
+
+//Copy RX air packet data to the gps_air struct
+uint8_t fill_struct_with_air_packet_data(uint32_t uptime)
+{
+ uint8_t rx_device = p_air_packet_rx[PACKET_DEVICE_NUMBER_POS]; //extract device number from received packet
+
+ dev_aux[rx_device].exist_flag = 1;
+ dev_aux[rx_device].timestamp = uptime;
+ gps_air[rx_device].device_id[0] = p_air_packet_rx[PACKET_DEVICE_ID_POS];
+ gps_air[rx_device].device_id[1] = p_air_packet_rx[PACKET_DEVICE_ID_POS + 1];
+ gps_air[rx_device].flags = p_air_packet_rx[PACKET_FLAGS_POS];
+ gps_air[rx_device].latitude.as_array[0] = p_air_packet_rx[PACKET_LATITUDE_POS];
+ gps_air[rx_device].latitude.as_array[1] = p_air_packet_rx[PACKET_LATITUDE_POS + 1];
+ gps_air[rx_device].latitude.as_array[2] = p_air_packet_rx[PACKET_LATITUDE_POS + 2];
+ gps_air[rx_device].latitude.as_array[3] = p_air_packet_rx[PACKET_LATITUDE_POS + 3];
+ gps_air[rx_device].longitude.as_array[0] = p_air_packet_rx[PACKET_LONGITUDE_POS];
+ gps_air[rx_device].longitude.as_array[1] = p_air_packet_rx[PACKET_LONGITUDE_POS + 1];
+ gps_air[rx_device].longitude.as_array[2] = p_air_packet_rx[PACKET_LONGITUDE_POS + 2];
+ gps_air[rx_device].longitude.as_array[3] = p_air_packet_rx[PACKET_LONGITUDE_POS + 3];
+ gps_air[rx_device].altitude.as_array[0] = p_air_packet_rx[PACKET_ALTITUDE_POS];
+ gps_air[rx_device].altitude.as_array[1] = p_air_packet_rx[PACKET_ALTITUDE_POS + 1];
+ gps_air[rx_device].speed = p_air_packet_rx[PACKET_SPEED_POS];
+ gps_air[rx_device].course.as_array[0] = p_air_packet_rx[PACKET_COURSE_POS];
+ gps_air[rx_device].course.as_array[1] = p_air_packet_rx[PACKET_COURSE_POS + 1];
+
+ return rx_device;
+}
+
+
+
+// Heart of the device <3
+//Calculates distance between two GPS points (using haversine formula)
+//Calculates heading between two GPS points (loxodrome, or rhumb line)
+//Calculates altitude difference
+void calc_relative_position(uint8_t another_device)
+{
+ double lat1, lat2, lon1, lon2;
+ double distance, heading;
+
+ //my position
+ lat1 = p_gps_num->latitude.in_rad;
+ lon1 = p_gps_num->longitude.in_rad;
+
+ //position of the device to calculate relative position
+ lat2 = gps_air[another_device].latitude.as_float * deg_to_rad;
+ lon2 = gps_air[another_device].longitude.as_float * deg_to_rad;
+
+ if (lat1 == lat2)
+ {
+ lat2 += 0.00000001; //slightly shift the position
+ }
+
+ if (lon1 == lon2)
+ {
+ lon2 += 0.00000001; //slightly shift the position
+ }
+
+ distance = twice_mean_earth_radius *
+ asin( sqrt( pow(sin((lat2 - lat1) / 2), 2) +
+ cos(lat2) * cos(lat1) * pow(sin((lon2 - lon1) / 2), 2)));
+
+ heading = atan((lon2 - lon1) /
+ log(tan(pi_div_by_4 + lat2 / 2) / tan(pi_div_by_4 + lat1 / 2)));
+
+
+ if ((lat2 > lat1) && (lon2 > lon1))
+ {
+ heading *= rad_to_deg;
+ }
+ else if ((lat2 > lat1) && (lon2 < lon1))
+ {
+ heading = 360.0 + heading * rad_to_deg;
+ }
+ else if (lat2 < lat1)
+ {
+ heading = 180.0 + heading * rad_to_deg;
+ }
+
+ gps_rel[another_device].distance = (uint32_t)distance;
+
+ if (gps_rel[another_device].distance == 0)
+ {
+ gps_rel[another_device].heading = 0; //if distance is zero then make heading equals zero too
+ }
+ else
+ {
+ gps_rel[another_device].heading = (uint16_t)heading;
+ }
+
+ gps_rel[another_device].altitude_diff = gps_air[another_device].altitude.as_integer - (int16_t)p_gps_num->altitude;
+}
+
+
+
+struct gps_air_struct **get_gps_air(void)
+{
+ for (uint8_t i = 0; i <= DEVICES_IN_GROUP; i++)
+ {
+ p_gps_air[i] = &gps_air[i];
+ }
+
+ return &p_gps_air[0];
+}
+
+
+
+struct gps_rel_struct **get_gps_rel(void)
+{
+ for (uint8_t i = 0; i <= DEVICES_IN_GROUP; i++)
+ {
+ p_gps_rel[i] = &gps_rel[i];
+ }
+
+ return &p_gps_rel[0];
+}
+
+
+
+struct dev_aux_struct **get_dev_aux(void)
+{
+ for (uint8_t i = 0; i <= DEVICES_IN_GROUP; i++)
+ {
+ p_dev_aux[i] = &dev_aux[i];
+ }
+
+ return &p_dev_aux[0];
+}
diff --git a/Firmware/CubeIDE/Code/src/m24c64.c b/Firmware/CubeIDE/Code/src/m24c64.c
new file mode 100644
index 0000000..44e1a89
--- /dev/null
+++ b/Firmware/CubeIDE/Code/src/m24c64.c
@@ -0,0 +1,396 @@
+/*
+ ELEPH - Local Relative Navigation System
+
+ Copyright (C) 2021 Feruz Topalov
+ Released under the GNU General Public License v3.0
+
+ file: m24c64.c
+*/
+
+#include "stm32f10x.h"
+#include "m24c64.h"
+#include "i2c.h"
+
+
+
+#define M24C64_POLL_ATTEMPTS (100) //takes ~10ms @ 100 kHz I2C
+
+#define M24C64_ADDRESS_WRITE_MODE (0xA0)
+#define M24C64_ADDRESS_READ_MODE (0xA1)
+
+#define M24C64_WHOLE_SIZE (8192)
+#define M24C64_PAGES_TOTAL (256)
+
+
+
+uint8_t m24c64_poll(void)
+{
+ uint16_t SR1_tmp;
+ uint16_t SR2_tmp;
+ uint8_t attempts = M24C64_POLL_ATTEMPTS;
+
+ while (attempts)
+ {
+ //Start
+ I2C2->CR1 |= I2C_CR1_START;
+ //Wait for start generated
+ while (!(I2C2->SR1 & I2C_SR1_SB))
+ {
+ }
+ //Clear
+ SR1_tmp = I2C2->SR1;
+
+ //Device address
+ I2C2->DR = (uint8_t)M24C64_ADDRESS_WRITE_MODE;
+ //Wait for address end of transmission or NAK reception
+ do
+ {
+ SR1_tmp = I2C2->SR1;
+ }
+ while (!(SR1_tmp & I2C_SR1_ADDR) && !(SR1_tmp & I2C_SR1_AF)); //"ADDR is not set after a NACK reception"
+ //Clear
+ SR1_tmp = I2C2->SR1;
+ SR2_tmp = I2C2->SR2;
+
+ //Check acknowledge failure
+ if (SR1_tmp & I2C_SR1_AF)
+ {
+ //no acknowledge is returned, slave is busy
+ I2C2->SR1 = ~(I2C_SR1_AF); //write 0 to clear AF bit
+
+ attempts--; //slave is not ready, decrement attmepts counter
+ }
+ else if (SR1_tmp & I2C_SR1_ADDR)
+ {
+ //Stop
+ I2C2->CR1 |= I2C_CR1_STOP;
+
+ return 1; //slave is ready
+ }
+ else
+ {
+ attempts--; //???
+ }
+ }
+
+ SR2_tmp = SR2_tmp + 1;
+
+ //Stop before end
+ I2C2->CR1 |= I2C_CR1_STOP;
+
+ return 0; //end of attmepts, slave is busy or absent
+}
+
+
+
+uint8_t m24c64_read_byte(uint16_t memory_address)
+{
+ uint8_t result = 0;
+
+ if (m24c64_poll())
+ {
+ uint16_t SR_tmp;
+
+ //Start
+ I2C2->CR1 |= I2C_CR1_START;
+ //Wait for start generated
+ while (!(I2C2->SR1 & I2C_SR1_SB))
+ {
+ }
+ //Clear
+ SR_tmp = I2C2->SR1;
+
+ //Device address
+ I2C2->DR = (uint8_t)M24C64_ADDRESS_WRITE_MODE;
+ //Wait for address end of transmission
+ while (!(I2C2->SR1 & I2C_SR1_ADDR))
+ {
+ }
+ //Clear
+ SR_tmp = I2C2->SR1;
+ SR_tmp = I2C2->SR2;
+
+ //Memory address high byte
+ I2C2->DR = (uint8_t)(memory_address >> 8);
+ //Wait for data register empty
+ while (!(I2C2->SR1 & I2C_SR1_TXE))
+ {
+ }
+
+ //Memory address low byte
+ I2C2->DR = (uint8_t)memory_address;
+ //Wait for data register empty
+ while (!(I2C2->SR1 & I2C_SR1_TXE))
+ {
+ }
+
+
+ //Start (restart actually)
+ I2C2->CR1 |= I2C_CR1_START;
+ //Wait for start generated
+ while (!(I2C2->SR1 & I2C_SR1_SB))
+ {
+ }
+ //Clear
+ SR_tmp = I2C2->SR1;
+
+ //Device address
+ I2C2->DR = (uint8_t)M24C64_ADDRESS_READ_MODE;
+ //Wait for address end of transmission
+ while (!(I2C2->SR1 & I2C_SR1_ADDR))
+ {
+ }
+ //Clear
+ SR_tmp = I2C2->SR1;
+ SR_tmp = I2C2->SR2;
+
+ //NACK next byte
+ I2C2->CR1 &= ~I2C_CR1_ACK;
+ //Stop
+ I2C2->CR1 |= I2C_CR1_STOP;
+ //Wait for data register not empty
+ while (!(I2C2->SR1 & I2C_SR1_RXNE))
+ {
+ }
+
+ SR_tmp = SR_tmp + 1;
+
+ //Read requested byte
+ result = I2C2->DR;
+ }
+ else
+ {
+ result = 0;
+ }
+
+ return result;
+}
+
+
+
+void m24c64_write_byte(uint8_t data_byte, uint16_t memory_address)
+{
+ if (m24c64_poll())
+ {
+ uint8_t SR_tmp;
+
+ //Start
+ I2C2->CR1 |= I2C_CR1_START;
+ //Wait for start generated
+ while (!(I2C2->SR1 & I2C_SR1_SB))
+ {
+ }
+ //Clear
+ SR_tmp = I2C2->SR1;
+
+ //Device address
+ I2C2->DR = (uint8_t)M24C64_ADDRESS_WRITE_MODE;
+ //Wait for address end of transmission
+ while (!(I2C2->SR1 & I2C_SR1_ADDR))
+ {
+ }
+ //Clear
+ SR_tmp = I2C2->SR1;
+ SR_tmp = I2C2->SR2;
+
+ //Memory address high byte
+ I2C2->DR = (uint8_t)(memory_address >> 8);
+ //Wait for data register empty
+ while (!(I2C2->SR1 & I2C_SR1_TXE))
+ {
+ }
+
+ //Memory address low byte
+ I2C2->DR = (uint8_t)memory_address;
+ //Wait for data register empty
+ while (!(I2C2->SR1 & I2C_SR1_TXE))
+ {
+ }
+
+ //Write byte
+ I2C2->DR = data_byte;
+ //Wait byte transfer finish
+ while (!(I2C2->SR1 & I2C_SR1_BTF))
+ {
+ }
+
+ SR_tmp = SR_tmp + 1;
+
+ //Stop
+ I2C2->CR1 |= I2C_CR1_STOP;
+ }
+}
+
+
+
+void m24c64_read_page(uint8_t data_array[], uint8_t page_address)
+{
+ if (m24c64_poll())
+ {
+ uint8_t SR_tmp;
+ uint16_t memory_address = page_address * M24C64_PAGE_SIZE;
+
+ //Start
+ I2C2->CR1 |= I2C_CR1_START;
+ //Wait for start generated
+ while (!(I2C2->SR1 & I2C_SR1_SB))
+ {
+ }
+ //Clear
+ SR_tmp = I2C2->SR1;
+
+ //Device address
+ I2C2->DR = (uint8_t)M24C64_ADDRESS_WRITE_MODE;
+ //Wait for address end of transmission
+ while (!(I2C2->SR1 & I2C_SR1_ADDR))
+ {
+ }
+ //Clear
+ SR_tmp = I2C2->SR1;
+ SR_tmp = I2C2->SR2;
+
+ //Memory address high byte
+ I2C2->DR = (uint8_t)(memory_address >> 8);
+ //Wait for data register empty
+ while (!(I2C2->SR1 & I2C_SR1_TXE))
+ {
+ }
+
+ //Memory address low byte
+ I2C2->DR = (uint8_t)memory_address;
+ //Wait for data register empty
+ while (!(I2C2->SR1 & I2C_SR1_TXE))
+ {
+ }
+
+
+ //Start (restart actually)
+ I2C2->CR1 |= I2C_CR1_START;
+ //Wait for start generated
+ while (!(I2C2->SR1 & I2C_SR1_SB))
+ {
+ }
+ //Clear
+ SR_tmp = I2C2->SR1;
+
+ //Device address
+ I2C2->DR = (uint8_t)M24C64_ADDRESS_READ_MODE;
+ //Wait for address end of transmission
+ while (!(I2C2->SR1 & I2C_SR1_ADDR))
+ {
+ }
+ //Clear
+ SR_tmp = I2C2->SR1;
+ SR_tmp = I2C2->SR2;
+
+ for (uint8_t i = 0; i < M24C64_PAGE_SIZE - 1; i++)
+ {
+ //ACK next byte
+ I2C2->CR1 |= I2C_CR1_ACK;
+ //Wait for data register not empty
+ while (!(I2C2->SR1 & I2C_SR1_RXNE))
+ {
+ }
+
+ //Read byte
+ data_array[i] = I2C2->DR;
+ }
+
+ //NACK last byte
+ I2C2->CR1 &= ~I2C_CR1_ACK;
+ //Stop
+ I2C2->CR1 |= I2C_CR1_STOP;
+ //Wait for data register not empty
+ while (!(I2C2->SR1 & I2C_SR1_RXNE))
+ {
+ }
+
+ //Read last byte
+ data_array[M24C64_PAGE_SIZE - 1] = I2C2->DR;
+
+ SR_tmp = SR_tmp + 1;
+ }
+}
+
+
+
+void m24c64_write_page(uint8_t data_array[], uint8_t page_address)
+{
+ if (m24c64_poll())
+ {
+ uint8_t SR_tmp = 0;
+ uint16_t memory_address = page_address * M24C64_PAGE_SIZE;
+
+ //Start
+ I2C2->CR1 |= I2C_CR1_START;
+ //Wait for start generated
+ while (!(I2C2->SR1 & I2C_SR1_SB))
+ {
+ }
+ //Clear
+ SR_tmp = I2C2->SR1;
+
+ //Device address
+ I2C2->DR = (uint8_t)M24C64_ADDRESS_WRITE_MODE;
+ //Wait for address end of transmission
+ while (!(I2C2->SR1 & I2C_SR1_ADDR))
+ {
+ }
+ //Clear
+ SR_tmp = I2C2->SR1;
+ SR_tmp = I2C2->SR2;
+
+ //Memory address high byte
+ I2C2->DR = (uint8_t)(memory_address >> 8);
+ //Wait for data register empty
+ while (!(I2C2->SR1 & I2C_SR1_TXE))
+ {
+ }
+
+ //Memory address low byte
+ I2C2->DR = (uint8_t)memory_address;
+ //Wait for data register empty
+ while (!(I2C2->SR1 & I2C_SR1_TXE))
+ {
+ }
+
+ for (uint8_t i = 0; i < M24C64_PAGE_SIZE; i++)
+ {
+ //Write byte
+ I2C2->DR = data_array[i];
+ //Wait byte transfer finish
+ while (!(I2C2->SR1 & I2C_SR1_BTF))
+ {
+ }
+ }
+
+ SR_tmp = SR_tmp + 1;
+
+ //Stop
+ I2C2->CR1 |= I2C_CR1_STOP;
+ }
+}
+
+
+
+void m24c64_erase_page(uint8_t page_address)
+{
+ uint8_t empty_page[M24C64_PAGE_SIZE];
+
+ for (uint8_t i = 0; i < M24C64_PAGE_SIZE; i++)
+ {
+ empty_page[i] = M24C64_EMPTY_CELL_VALUE;
+ }
+
+ m24c64_write_page(&empty_page[0], page_address);
+}
+
+
+
+void m24c64_erase_all(void)
+{
+ for (uint16_t page = 0; page < M24C64_PAGES_TOTAL; page++)
+ {
+ m24c64_erase_page(page);
+ }
+}
diff --git a/Firmware/CubeIDE/Code/src/main.c b/Firmware/CubeIDE/Code/src/main.c
new file mode 100644
index 0000000..3987a68
--- /dev/null
+++ b/Firmware/CubeIDE/Code/src/main.c
@@ -0,0 +1,336 @@
+/*
+ ELEPH - Local Relative Navigation System
+
+ Copyright (C) 2021 Feruz Topalov
+ Released under the GNU General Public License v3.0
+
+ file: main.c
+*/
+
+#include
+#include "stm32f10x.h"
+#include "main.h"
+#include "gpio.h"
+#include "spi.h"
+#include "ssd1306.h"
+#include "service.h"
+#include "uart.h"
+#include "gps.h"
+#include "si4463.h"
+#include "timer.h"
+#include "i2c.h"
+#include "m24c64.h"
+#include "settings.h"
+#include "buttons.h"
+#include "menu.h"
+#include "adc.h"
+#include "points.h"
+#include "lrns.h"
+#include "ssd1306_bitmaps.h"
+
+
+
+//TIMERS
+uint32_t uptime = 0;
+uint32_t pps_counter = 0;
+uint8_t overflow_counter = 0;
+uint8_t time_slot = 0;
+
+
+
+//MAIN
+struct main_flags_struct main_flags = {0, 0, 0, 0, 0, 0};
+struct settings_struct *p_settings;
+struct gps_num_struct *p_gps_num;
+uint8_t *p_send_interval_values;
+
+
+
+//PROGRAM
+int main(void)
+{
+ gpio_init();
+ timers_init();
+ spi1_init();
+ spi2_init();
+ i2c_init();
+ uart_dma_init();
+ settings_load();
+ ssd1306_init();
+ si4463_init();
+ ext_int_init();
+ adc_init();
+ adc_get_bat_voltage();
+ init_lrns();
+ init_menu();
+ init_points();
+
+ p_settings = get_settings();
+ p_gps_num = get_gps_num();
+ p_send_interval_values = get_send_interval_values();
+
+ ssd1306_bitmap(&startup_screen[0]);
+ ssd1306_update();
+ delay_cyc(5000000);
+ draw_current_menu();
+
+ __enable_irq();
+ make_a_beep();
+
+ while (1)
+ {
+ //Scan Keys
+ change_menu(scan_buttons());
+
+
+ //Parse GPS after PPS interrupt or UART DMA overflow
+ if (main_flags.gps_ready == 1)
+ {
+ main_flags.gps_ready = 0;
+
+
+ if (parse_gps() == 1)
+ {
+ if (main_flags.gps_sync == 1)
+ {
+ if (get_gps_status() == GPS_DATA_VALID)
+ {
+ gps_air_update_my_data(uptime);
+ fill_air_packet_with_struct_data(); //fill air data with coordinates of this device (this occur before first time slot interrupt)
+ }
+ else //if PPS exist but data is invalid (rare situation)
+ {
+ timer1_stop_reload(); //stop time slot timer due to nothing to transmitt
+ }
+ }
+
+ draw_current_menu();
+ }
+ else if (main_flags.gps_sync == 1)
+ {
+ timer1_stop_reload(); //stop time slot timer due to nothing to transmitt
+ }
+ }
+
+
+ //Extract received packet
+ if (main_flags.rx_ready == 1)
+ {
+ main_flags.rx_ready = 0;
+
+ if (si4463_get_rx_packet())
+ {
+ fill_struct_with_air_packet_data(uptime); //parse air data from another device (which has ended TX in the current time_slot)
+ }
+ }
+
+
+ //Checks after receiving packets from all devices; performing beep
+ if (main_flags.time_slots_end == 1)
+ {
+ main_flags.time_slots_end = 0;
+
+ process_all_devices(); //calculate relative position for each active device
+
+ uint8_t any_alarm_status = 0;
+ any_alarm_status += check_alarms();
+ any_alarm_status += check_timeout(); //check timeout flags and get the result only after the end of the TRX sequence
+ any_alarm_status += check_fence();
+
+ if (any_alarm_status > 0)
+ {
+ make_a_beep();
+ }
+
+ }
+ else if ((main_flags.battery_low == 1) && (main_flags.gps_sync == 0)) //else check battery low flag
+ {
+ make_a_beep();
+ main_flags.battery_low = 0;
+ }
+
+ }
+}
+
+
+
+
+
+//DMA UART RX overflow
+void DMA1_Channel5_IRQHandler(void)
+{
+ DMA1->IFCR = DMA_IFCR_CGIF5; //clear all interrupt flags for DMA channel 5
+
+ uart_dma_stop();
+ backup_and_clear_uart_buffer();
+ uart_dma_restart();
+
+ main_flags.gps_ready = 1;
+ main_flags.gps_sync = 0; //no pps signal
+ pps_counter = 0;
+ led_green_off();
+}
+
+
+
+//GPS PPS interrupt
+void EXTI15_10_IRQHandler(void)
+{
+ EXTI->PR = EXTI_PR_PR11; //clear interrupt
+ timer1_start(); //the first thing to do is start time slot timer right after PPS
+
+ uart_dma_stop(); //fix the data
+ backup_and_clear_uart_buffer();
+ uart_dma_restart();
+
+ pps_counter++;
+ switch (pps_counter)
+ {
+ case 1: //skip first PPS, ignore previous nmea data
+ timer1_stop_reload();
+ main_flags.gps_ready = 0;
+ main_flags.gps_sync = 0;
+ break;
+
+ case 2: //skip second PPS, but fix the nmea data acquired after first PPS
+ timer1_stop_reload();
+ main_flags.gps_ready = 1;
+ main_flags.gps_sync = 0;
+ break;
+
+ default: //at the moment, the nmea data, captured after first PPS, is parsed
+ main_flags.gps_ready = 1;
+ main_flags.gps_sync = 1;
+
+ if ((p_gps_num->second % p_send_interval_values[p_settings->send_interval_opt]) == 0) //calc division remainder
+ {
+ main_flags.act_status = 1; //we are ready to show we are in act
+ }
+ else
+ {
+ timer1_stop_reload();
+ }
+
+ break;
+ }
+}
+
+
+
+//SI4463 RX interrupt (RX valid or CRC error)
+void EXTI9_5_IRQHandler(void)
+{
+ EXTI->PR = EXTI_PR_PR6; //clear interrupt
+
+ main_flags.rx_ready = 1;
+}
+
+
+/*
+ TIMINGS LEGEND (DEVICES_IN_GROUP = 6)
+ +----+ +----+
+ | | | |
+ | | | | PPS Signal
+ | | | |
++-------+ +--------------------------------------------+ +------+
+
+ ^ ^ ^ ^ ^ ^ ^ ^
+ | | | | | | | |
+ | | | | | | | | Time Slot # Timer Interrupt # Action
+ | | | | | | | | (time_slot) (overflow_counter)
+ | | | | | | | |
+ | | | | | | | |
+ | | | | | | | |
+ | | | | | | | |
+ | | | | | | | |
+ | | | | | | | |
+ | | | | | | | +---------------------+ 7 Stop Timer1, Set main_flags.time_slots_end
+ | | | | | | | 6
+ | | | | | | +--------------------------+ 6
+ | | | | | | 5
+ | | | | | +-------------------------------+ 5
+ | | | | | 4
+ | | | | +------------------------------------+ 4
+ | | | | 3
+ | | | +-----------------------------------------+ 3
+ | | | 2
+ | | +----------------------------------------------+ 2
+ | | 1
+ | +---------------------------------------------------+ 1
+ | Timer1 interval
+ +--------------------------------------------------------+ PPS Interrupt, Start Timer1
+*/
+
+//Time slot interrupt
+void TIM1_UP_IRQHandler(void)
+{
+ TIM1->SR &= ~TIM_SR_UIF; //clear interrupt
+
+ overflow_counter++; //increment ovf counter (starts from 1)
+
+ if(overflow_counter == (DEVICES_IN_GROUP + 1)) //if interrupt at the end of the last time slot
+ {
+ timer1_stop_reload();
+ overflow_counter = 0;
+ main_flags.time_slots_end = 1;
+ led_green_off();
+ }
+ else
+ {
+ time_slot = overflow_counter;
+
+ if (time_slot == p_settings->device_number)
+ {
+ si4463_tx_packet();
+ }
+ else
+ {
+ si4463_start_rx();
+ }
+ }
+
+ if (main_flags.act_status == 1)
+ {
+ main_flags.act_status = 0;
+ led_green_on(); //make ACT led on only here, after we are shure that gps data is valid (otherwise we would never reach this interrupt)
+ }
+}
+
+
+
+//Uptime counter (every 1 second)
+void SysTick_Handler(void)
+{
+ uptime++;
+
+ main_flags.battery_low = adc_get_bat_voltage();
+
+ calc_timeout(uptime); //always calculate timeout for each device, even if this function is disabled
+ check_timeout(); //also check timeout in order to set/reset timeout flags
+}
+
+
+
+//End of "beep"
+void TIM2_IRQHandler(void)
+{
+ timer2_stop();
+ TIM2->SR &= ~TIM_SR_UIF; //clear gating timer int
+
+ timer3_stop();
+ led_board_off();
+}
+
+
+
+uint32_t get_uptime(void)
+{
+ return uptime;
+}
+
+
+
+struct main_flags_struct *get_main_flags(void)
+{
+ return &main_flags;
+}
diff --git a/Firmware/CubeIDE/Code/src/menu.c b/Firmware/CubeIDE/Code/src/menu.c
new file mode 100644
index 0000000..8591fd9
--- /dev/null
+++ b/Firmware/CubeIDE/Code/src/menu.c
@@ -0,0 +1,3194 @@
+/*
+ ELEPH - Local Relative Navigation System
+
+ Copyright (C) 2021 Feruz Topalov
+ Released under the GNU General Public License v3.0
+
+ file: menu.c
+*/
+
+#include
+#include
+#include "stm32f10x.h"
+#include "menu.h"
+#include "buttons.h"
+#include "ssd1306.h"
+#include "main.h"
+#include "service.h"
+#include "settings.h"
+#include "m24c64.h"
+#include "ssd1306_bitmaps.h"
+#include "gpio.h"
+#include "adc.h"
+#include "gps.h"
+#include "points.h"
+#include "lrns.h"
+#include "si4463.h"
+#include "timer.h"
+
+
+
+char *FW_VERSION = "1.0"; //firmware
+char *HW_VERSION = "1"; //hardware
+
+
+
+#define ANOTHER_DEVICE_START_ROW (3)
+#define ANOTHER_RADAR_DEVICE_START_ROW (2)
+
+
+#define FREQ_CHANNEL_FIRST (1)
+#define FREQ_CHANNEL_LAST (69)
+
+#define DEVICE_ID_FIRST_SYMBOL ('A')
+#define DEVICE_ID_LAST_SYMBOL ('Z')
+
+#define POINT_NAME_FIRST_SYMBOL (' ')
+#define POINT_NAME_LAST_SYMBOL ('~')
+
+#define TX_POWER_FIRST_OPTION (TX_POWER_10MILLIW_SETTING)
+#define TX_POWER_LAST_OPTION (TX_POWER_100MILLIW_SETTING)
+
+
+#define SEND_INTERVAL_FIRST_OPTION (SEND_INTERVAL_1S_SETTING)
+#define SEND_INTERVAL_LAST_OPTION (SEND_INTERVAL_60S_SETTING)
+
+
+#define MEMORY_SLOT_FIRST (1)
+#define MEMORY_SLOT_LAST (MEMORY_SLOTS_TOTAL)
+
+
+#define DEVICE_NUMBER_FIRST (1)
+#define DEVICE_NUMBER_LAST (DEVICES_IN_GROUP)
+
+#define MEMORY_POINT_DEFAULT_NAME ("ALPHA")
+
+
+
+void toggle_alarm(void);
+
+uint8_t get_current_item(void);
+uint8_t get_last_item(void);
+void set_current_item(uint8_t new_value);
+void reset_current_item_in_menu(uint8_t menu);
+
+void scroll_up(void);
+void scroll_down(void);
+void switch_forward(void);
+void switch_backward(void);
+
+void draw_main(void);
+void draw_devices(void);
+void draw_settings(void);
+void draw_info(void);
+void draw_edit_settings(void);
+void draw_set_dev_num(void);
+void draw_set_dev_id(void);
+void draw_set_freq_ch(void);
+void draw_set_tx_pow(void);
+void draw_set_send_intvl(void);
+void draw_set_to_thr(void);
+void draw_set_fnc_thr(void);
+void draw_confirm_settings_save(void);
+void draw_restore_defaults(void);
+void draw_erase_all(void);
+void draw_each_device(void);
+void draw_each_device_submenu(void);
+void draw_radar(void);
+void draw_points(void);
+void draw_each_point(void);
+void draw_load_point(void);
+void draw_delete_point(void);
+void draw_delete_device(void);
+void draw_save_device(void);
+void draw_save_device_as(void);
+void draw_saved_popup(void);
+
+void set_dev_num_up(void);
+void set_dev_num_down(void);
+void set_dev_num_ok(void);
+void set_dev_num_esc(void);
+void set_dev_id_up(void);
+void set_dev_id_down(void);
+void set_dev_id_ok(void);
+void set_dev_id_ok_long(void);
+void set_dev_id_esc(void);
+void set_freq_ch_up(void);
+void set_freq_ch_down(void);
+void set_freq_ch_ok(void);
+void set_freq_ch_esc(void);
+void set_tx_pow_up(void);
+void set_tx_pow_down(void);
+void set_tx_pow_ok(void);
+void set_tx_pow_esc(void);
+void set_send_intvl_up(void);
+void set_send_intvl_down(void);
+void set_send_intvl_ok(void);
+void set_send_intvl_esc(void);
+void set_to_thr_up(void);
+void set_to_thr_down(void);
+void set_to_thr_ok(void);
+void set_to_thr_esc(void);
+void set_fnc_thr_up(void);
+void set_fnc_thr_down(void);
+void set_fnc_thr_ok(void);
+void set_fnc_thr_esc(void);
+void confirm_settings_save_ok(void);
+void confirm_settings_save_esc(void);
+void restore_defaults_ok(void);
+void erase_all_ok(void);
+void devices_ok(void);
+void each_device_up(void);
+void each_device_down(void);
+void each_device_ok(void);
+void radar_up(void);
+void radar_down(void);
+void radar_ok(void);
+void points_up(void);
+void points_down(void);
+void points_ok(void);
+void points_esc(void);
+void load_point_up(void);
+void load_point_down(void);
+void load_point_ok(void);
+void load_point_esc(void);
+void delete_point_ok(void);
+void delete_device_ok(void);
+void save_device_up(void);
+void save_device_down(void);
+void save_device_ok(void);
+void save_device_esc(void);
+void save_device_as_up(void);
+void save_device_as_down(void);
+void save_device_as_ok(void);
+void save_device_as_ok_long(void);
+void save_device_as_esc(void);
+void saved_popup_esc(void);
+
+
+
+//ALL MENUS HERE
+enum
+{
+ //menu numbers start from 1, because 0 is used as "end marker" in menu structs
+ M_MAIN = 1,
+ M_DEVICES,
+ M_EACH_DEVICE,
+ M_EACH_DEVICE_SUBMENU,
+ M_DELETE_DEVICE,
+ M_SAVE_DEVICE,
+ M_SAVE_DEVICE_AS,
+ M_SAVED_POPUP,
+ M_RADAR,
+ M_POINTS,
+ M_EACH_POINT,
+ M_LOAD_POINT,
+ M_DELETE_POINT,
+ M_SETTINGS,
+ M_INFO,
+ M_EDIT_SETTINGS,
+ M_SET_DEV_NUM,
+ M_SET_DEV_ID,
+ M_SET_FREQ_CH,
+ M_SET_TX_POW,
+ M_SET_SEND_INTVL,
+ M_SET_TO_THR,
+ M_SET_FNC_THR,
+ M_CONFIRM_SETTINGS_SAVE,
+ M_RESTORE_DEFAULTS,
+ M_ERASE_ALL
+};
+
+
+
+//ALL MENU ITEMS HERE (for each menu separately)
+//note: for all menus first item always has index of 0
+#define M_ALL_I_FIRST (0)
+
+//MAIN
+enum
+{
+ M_MAIN_I_DEVICES = 0,
+ M_MAIN_I_RADAR,
+ M_MAIN_I_POINTS,
+ M_MAIN_I_SETTINGS,
+ M_MAIN_I_INFO, //last item
+ M_MAIN_I_LAST = M_MAIN_I_INFO //copy last item here
+};
+
+
+//SETTINGS
+enum
+{
+ M_SETTINGS_I_EDIT = 0,
+ M_SETTINGS_I_RESTORE,
+ M_SETTINGS_I_ERASE,
+ M_SETTINGS_I_LAST = M_SETTINGS_I_ERASE
+};
+
+
+
+//EDIT SETTINGS
+enum
+{
+ M_EDIT_SETTINGS_I_DEV_NUM = 0,
+ M_EDIT_SETTINGS_I_DEV_ID,
+ M_EDIT_SETTINGS_I_FREQ_CH,
+ M_EDIT_SETTINGS_I_TX_POW,
+ M_EDIT_SETTINGS_I_SEND_INTVL,
+ M_EDIT_SETTINGS_I_TO_THR,
+ M_EDIT_SETTINGS_I_FNC_THR,
+ M_EDIT_SETTINGS_I_LAST = M_EDIT_SETTINGS_I_FNC_THR
+};
+
+
+
+//EACH POINT
+enum
+{
+ M_EACH_POINT_I_LOAD = 0,
+ M_EACH_POINT_I_DELETE,
+ M_EACH_POINT_I_LAST = M_EACH_POINT_I_DELETE
+};
+
+
+
+//EACH DEVICE SUBMENU
+enum
+{
+ M_EACH_DEVICE_SUBMENU_I_SAVE = 0,
+ M_EACH_DEVICE_SUBMENU_I_DELETE,
+ M_EACH_DEVICE_SUBMENU_I_LAST = M_EACH_DEVICE_SUBMENU_I_DELETE
+};
+
+
+
+//Only exclusive (non default) actions here, for example edit a variable in settings
+const struct
+{
+ uint8_t current_menu;
+ uint8_t button_pressed;
+ void (*execute_function)(void);
+} menu_exclusive_table[] =
+{
+// Current Menu Button pressed Action (function name)
+ {M_DEVICES, BTN_OK, devices_ok},
+ {M_EACH_DEVICE, BTN_UP, each_device_up},
+ {M_EACH_DEVICE, BTN_DOWN, each_device_down},
+ {M_EACH_DEVICE, BTN_OK, each_device_ok},
+ {M_RADAR, BTN_UP, radar_up},
+ {M_RADAR, BTN_DOWN, radar_down},
+ {M_RADAR, BTN_OK, radar_ok},
+ {M_SAVE_DEVICE, BTN_UP, save_device_up},
+ {M_SAVE_DEVICE, BTN_DOWN, save_device_down},
+ {M_SAVE_DEVICE, BTN_OK, save_device_ok},
+ {M_SAVE_DEVICE, BTN_ESC, save_device_esc},
+ {M_SAVE_DEVICE_AS, BTN_UP, save_device_as_up},
+ {M_SAVE_DEVICE_AS, BTN_DOWN, save_device_as_down},
+ {M_SAVE_DEVICE_AS, BTN_OK, save_device_as_ok},
+ {M_SAVE_DEVICE_AS, BTN_OK_LONG, save_device_as_ok_long},
+ {M_SAVE_DEVICE_AS, BTN_ESC, save_device_as_esc},
+ {M_SAVED_POPUP, BTN_ESC, saved_popup_esc},
+ {M_DELETE_DEVICE, BTN_OK, delete_device_ok},
+ {M_POINTS, BTN_UP, points_up},
+ {M_POINTS, BTN_DOWN, points_down},
+ {M_POINTS, BTN_OK, points_ok},
+ {M_POINTS, BTN_ESC, points_esc},
+ {M_LOAD_POINT, BTN_UP, load_point_up},
+ {M_LOAD_POINT, BTN_DOWN, load_point_down},
+ {M_LOAD_POINT, BTN_OK, load_point_ok},
+ {M_LOAD_POINT, BTN_ESC, load_point_esc},
+ {M_DELETE_POINT, BTN_OK, delete_point_ok},
+ {M_SET_DEV_NUM, BTN_UP, set_dev_num_up},
+ {M_SET_DEV_NUM, BTN_DOWN, set_dev_num_down},
+ {M_SET_DEV_NUM, BTN_OK, set_dev_num_ok},
+ {M_SET_DEV_NUM, BTN_ESC, set_dev_num_esc},
+ {M_SET_DEV_ID, BTN_UP, set_dev_id_up},
+ {M_SET_DEV_ID, BTN_DOWN, set_dev_id_down},
+ {M_SET_DEV_ID, BTN_OK, set_dev_id_ok},
+ {M_SET_DEV_ID, BTN_OK_LONG, set_dev_id_ok_long},
+ {M_SET_DEV_ID, BTN_ESC, set_dev_id_esc},
+ {M_SET_FREQ_CH, BTN_UP, set_freq_ch_up},
+ {M_SET_FREQ_CH, BTN_DOWN, set_freq_ch_down},
+ {M_SET_FREQ_CH, BTN_OK, set_freq_ch_ok},
+ {M_SET_FREQ_CH, BTN_ESC, set_freq_ch_esc},
+ {M_SET_TX_POW, BTN_UP, set_tx_pow_up},
+ {M_SET_TX_POW, BTN_DOWN, set_tx_pow_down},
+ {M_SET_TX_POW, BTN_OK, set_tx_pow_ok},
+ {M_SET_TX_POW, BTN_ESC, set_tx_pow_esc},
+ {M_SET_SEND_INTVL, BTN_UP, set_send_intvl_up},
+ {M_SET_SEND_INTVL, BTN_DOWN, set_send_intvl_down},
+ {M_SET_SEND_INTVL, BTN_OK, set_send_intvl_ok},
+ {M_SET_SEND_INTVL, BTN_ESC, set_send_intvl_esc},
+ {M_SET_TO_THR, BTN_UP, set_to_thr_up},
+ {M_SET_TO_THR, BTN_DOWN, set_to_thr_down},
+ {M_SET_TO_THR, BTN_OK, set_to_thr_ok},
+ {M_SET_TO_THR, BTN_ESC, set_to_thr_esc},
+ {M_SET_FNC_THR, BTN_UP, set_fnc_thr_up},
+ {M_SET_FNC_THR, BTN_DOWN, set_fnc_thr_down},
+ {M_SET_FNC_THR, BTN_OK, set_fnc_thr_ok},
+ {M_SET_FNC_THR, BTN_ESC, set_fnc_thr_esc},
+ {M_CONFIRM_SETTINGS_SAVE, BTN_OK, confirm_settings_save_ok},
+ {M_CONFIRM_SETTINGS_SAVE, BTN_ESC, confirm_settings_save_esc},
+ {M_RESTORE_DEFAULTS, BTN_OK, restore_defaults_ok},
+ {M_ERASE_ALL, BTN_OK, erase_all_ok},
+ {0, 0, 0} //end marker
+};
+
+
+
+//Defaul behaviour (non exclusive) when OK button has been pressed (move forward)
+const struct
+{
+ uint8_t current_menu;
+ uint8_t current_item;
+ uint8_t next_menu;
+} menu_forward_table[] =
+{
+// Current Menu Current Item Next Menu
+ {M_MAIN, M_MAIN_I_DEVICES, M_DEVICES},
+ {M_MAIN, M_MAIN_I_RADAR, M_RADAR},
+ {M_MAIN, M_MAIN_I_POINTS, M_POINTS},
+ {M_MAIN, M_MAIN_I_SETTINGS, M_SETTINGS},
+ {M_MAIN, M_MAIN_I_INFO, M_INFO},
+ {M_EACH_DEVICE_SUBMENU, M_EACH_DEVICE_SUBMENU_I_SAVE, M_SAVE_DEVICE},
+ {M_EACH_DEVICE_SUBMENU, M_EACH_DEVICE_SUBMENU_I_DELETE, M_DELETE_DEVICE},
+ {M_EACH_POINT, M_EACH_POINT_I_LOAD, M_LOAD_POINT},
+ {M_EACH_POINT, M_EACH_POINT_I_DELETE, M_DELETE_POINT},
+ {M_SETTINGS, M_SETTINGS_I_EDIT, M_EDIT_SETTINGS},
+ {M_SETTINGS, M_SETTINGS_I_RESTORE, M_RESTORE_DEFAULTS},
+ {M_SETTINGS, M_SETTINGS_I_ERASE, M_ERASE_ALL},
+ {M_EDIT_SETTINGS, M_EDIT_SETTINGS_I_DEV_NUM, M_SET_DEV_NUM},
+ {M_EDIT_SETTINGS, M_EDIT_SETTINGS_I_DEV_ID, M_SET_DEV_ID},
+ {M_EDIT_SETTINGS, M_EDIT_SETTINGS_I_FREQ_CH, M_SET_FREQ_CH},
+ {M_EDIT_SETTINGS, M_EDIT_SETTINGS_I_TX_POW, M_SET_TX_POW},
+ {M_EDIT_SETTINGS, M_EDIT_SETTINGS_I_SEND_INTVL, M_SET_SEND_INTVL},
+ {M_EDIT_SETTINGS, M_EDIT_SETTINGS_I_TO_THR, M_SET_TO_THR},
+ {M_EDIT_SETTINGS, M_EDIT_SETTINGS_I_FNC_THR, M_SET_FNC_THR},
+ {0, 0, 0} //end marker
+};
+
+
+
+//Defaul behaviour (non exclusive) when ESC button has been pressed (move backward)
+const struct
+{
+ uint8_t current_menu;
+ uint8_t next_menu;
+} menu_backward_table[] =
+{
+// Current Menu Next Menu
+ {M_DEVICES, M_MAIN},
+ {M_EACH_DEVICE, M_DEVICES},
+ {M_EACH_DEVICE_SUBMENU, M_EACH_DEVICE},
+ {M_SAVE_DEVICE, M_EACH_DEVICE_SUBMENU},
+ {M_DELETE_DEVICE, M_EACH_DEVICE_SUBMENU},
+ {M_RADAR, M_MAIN},
+ {M_EACH_POINT, M_POINTS},
+ {M_DELETE_POINT, M_EACH_POINT},
+ {M_SETTINGS, M_MAIN},
+ {M_INFO, M_MAIN},
+ {M_EDIT_SETTINGS, M_CONFIRM_SETTINGS_SAVE},
+ {M_RESTORE_DEFAULTS, M_SETTINGS},
+ {M_ERASE_ALL, M_SETTINGS},
+ {0, 0} //end marker
+};
+
+
+
+//Struct with list of menus and real-time values of current item in current menu. Last Item is needed for scroll function
+//note: if current menu has no items (like INFO menu) no need to put it in structure below, because item functions (get, get last, set) automatically return 0 (which is zero item)
+struct
+{
+ const uint8_t curent_menu;
+ uint8_t cur_item;
+ const uint8_t last_item;
+} item_table[] =
+{
+// Current Menu Current Item Last Item in Current Menu
+ {M_MAIN, M_ALL_I_FIRST, M_MAIN_I_LAST},
+ {M_EACH_DEVICE_SUBMENU, M_ALL_I_FIRST, M_EACH_DEVICE_SUBMENU_I_LAST},
+ {M_EACH_POINT, M_ALL_I_FIRST, M_EACH_POINT_I_LAST},
+ {M_SETTINGS, M_ALL_I_FIRST, M_SETTINGS_I_LAST},
+ {M_EDIT_SETTINGS, M_ALL_I_FIRST, M_EDIT_SETTINGS_I_LAST},
+ {0, 0, 0} //end marker
+};
+
+
+
+//List of menus with appropriate functions to draw it (show on screen)
+const struct
+{
+ uint8_t current;
+ void (*action)(void);
+} menu_draw_table[] =
+{
+// Current Menu Draw Function
+ {M_MAIN, draw_main},
+ {M_DEVICES, draw_devices},
+ {M_EACH_DEVICE, draw_each_device},
+ {M_EACH_DEVICE_SUBMENU, draw_each_device_submenu},
+ {M_SAVE_DEVICE, draw_save_device},
+ {M_SAVE_DEVICE_AS, draw_save_device_as},
+ {M_SAVED_POPUP, draw_saved_popup},
+ {M_DELETE_DEVICE, draw_delete_device},
+ {M_RADAR, draw_radar},
+ {M_POINTS, draw_points},
+ {M_EACH_POINT, draw_each_point},
+ {M_LOAD_POINT, draw_load_point},
+ {M_DELETE_POINT, draw_delete_point},
+ {M_SETTINGS, draw_settings},
+ {M_INFO, draw_info},
+ {M_EDIT_SETTINGS, draw_edit_settings},
+ {M_SET_DEV_NUM, draw_set_dev_num},
+ {M_SET_DEV_ID, draw_set_dev_id},
+ {M_SET_FREQ_CH, draw_set_freq_ch},
+ {M_SET_TX_POW, draw_set_tx_pow},
+ {M_SET_SEND_INTVL, draw_set_send_intvl},
+ {M_SET_TO_THR, draw_set_to_thr},
+ {M_SET_FNC_THR, draw_set_fnc_thr},
+ {M_CONFIRM_SETTINGS_SAVE, draw_confirm_settings_save},
+ {M_RESTORE_DEFAULTS, draw_restore_defaults},
+ {M_ERASE_ALL, draw_erase_all},
+ {0, 0} //end marker
+};
+
+
+
+struct settings_struct *p_settings;
+struct settings_struct settings_copy;
+
+struct gps_raw_struct *p_gps_raw;
+struct gps_num_struct *p_gps_num;
+struct gps_air_struct **pp_gps_air;
+struct gps_rel_struct **pp_gps_rel;
+struct dev_aux_struct **pp_dev_aux;
+struct memory_slot_struct **pp_memory_slot;
+
+uint8_t *p_send_interval_values;
+uint8_t *p_get_tx_power_values;
+
+uint8_t current_menu; //Actually Current Menu value (real-time)
+char buf[21]; //temporary char buffer for screen text fragments
+float tmpf; //temporary float variable
+uint32_t tmpui32; //temporary uint32
+int16_t tmpi16; //temporary int16
+uint8_t flag_settings_changed = 0; //is settings changed?
+uint8_t device_id_current_symbol = 0; //current editing symbol in device_id[]
+
+const char point_to_save_default_name[MEMORY_POINT_NAME_LENGTH + 1] = MEMORY_POINT_DEFAULT_NAME;
+char point_to_save_name[MEMORY_POINT_NAME_LENGTH + 1];
+uint8_t point_name_current_symbol = 0;
+
+uint8_t current_each_device = DEVICE_NUMBER_FIRST; //current device number in EACH DEVICE menu
+uint8_t current_radar_device = 0; //current device number in RADAR menu, set to 0, see draw_radar()
+uint8_t current_device_to_load = 0;
+uint8_t current_slot_to_load = MEMORY_SLOT_FIRST; //currently selected point slot in points menu
+uint8_t current_slot_to_save = 0;
+uint8_t point_to_save_list[MEMORY_SLOTS_TOTAL + 1];
+uint8_t device_to_load_list[DEVICES_IN_GROUP + 1];
+uint8_t radar_list[DEVICES_IN_GROUP + 1]; //list of devices in radar menu, 5 devices total (because of except me); radar_list[device_number] = item; items start from 0
+uint8_t radar_list_hide[DEVICES_IN_GROUP + 1]; //if == 1 then hide device cross on the radar screen
+uint8_t device_number; //this device number
+
+const uint8_t sx0 = 24; //radar center pixel on screen (i.e. my position)
+const uint8_t sy0 = 31;
+const uint8_t r_circ_dots = 20; //screen circle radius in dots
+
+uint8_t custom_exclam_mark[2] = {0, 0x5F};
+
+
+
+//Init and show MAIN menu
+void init_menu(void)
+{
+ p_gps_raw = get_gps_raw();
+ p_gps_num = get_gps_num();
+ pp_gps_air = get_gps_air();
+ pp_gps_rel = get_gps_rel();
+ pp_dev_aux = get_dev_aux();
+
+ pp_memory_slot = get_memory_slot();
+
+ p_settings = get_settings();
+ settings_copy = *p_settings;
+
+ device_number = p_settings->device_number;
+
+ p_send_interval_values = get_send_interval_values();
+ p_get_tx_power_values = get_tx_power_values();
+
+ //init variables
+ current_each_device = device_number; //set me current
+ current_menu = M_MAIN;
+ set_current_item(M_MAIN_I_DEVICES);
+}
+
+
+
+//Check for buttons and change menu if needed
+void change_menu(uint8_t button_code)
+{
+ if (button_code)
+ {
+
+ //search for exclusive operation for this case
+ for (uint8_t i = 0; menu_exclusive_table[i].current_menu; i++) //until end marker
+ {
+ if (current_menu == menu_exclusive_table[i].current_menu &&
+ button_code == menu_exclusive_table[i].button_pressed)
+ {
+ menu_exclusive_table[i].execute_function();
+ return; //exit
+ }
+ }
+
+ //well, there is no exclusive operations for that case, perform default action
+ switch (button_code)
+ {
+ case BTN_UP:
+ scroll_up();
+ break;
+
+ case BTN_DOWN:
+ scroll_down();
+ break;
+
+ case BTN_OK:
+ switch_forward();
+ break;
+
+ case BTN_ESC:
+ switch_backward();
+ break;
+
+ case BTN_PWR_LONG:
+ toggle_alarm();
+ break;
+
+ case BTN_ESC_LONG:
+ toggle_mute();
+ draw_current_menu();
+ break;
+ }
+
+ }
+}
+
+
+
+//Switch alarm status
+void toggle_alarm(void)
+{
+ if (get_device_flags(device_number, FLAGS_ALARM) == FLAG_ALARM_OFF)
+ {
+ set_device_flags(FLAGS_ALARM, FLAG_ALARM_ON);
+ }
+ else
+ {
+ set_device_flags(FLAGS_ALARM, FLAG_ALARM_OFF);
+ }
+
+ check_alarms(); //immediately update alarm indication
+ draw_current_menu();
+}
+
+
+
+//Scroll current menu Up
+void scroll_up(void)
+{
+ uint8_t current = get_current_item();
+ uint8_t last = get_last_item();
+
+ if (current == M_ALL_I_FIRST)
+ {
+ set_current_item(last);
+ }
+ else
+ {
+ set_current_item(current - 1);
+ }
+
+ draw_current_menu();
+}
+
+
+
+//Scroll current menu Down
+void scroll_down(void)
+{
+ uint8_t current = get_current_item();
+ uint8_t last = get_last_item();
+
+ if (current == last)
+ {
+ set_current_item(M_ALL_I_FIRST);
+ }
+ else
+ {
+ set_current_item(current + 1);
+ }
+
+ draw_current_menu();
+}
+
+
+
+//Switch menu forward by default
+void switch_forward(void)
+{
+ for (uint8_t i = 0; menu_forward_table[i].current_menu; i++)
+ {
+ if (current_menu == menu_forward_table[i].current_menu &&
+ get_current_item() == menu_forward_table[i].current_item)
+ {
+ current_menu = menu_forward_table[i].next_menu;
+ break;
+ }
+ }
+ draw_current_menu();
+}
+
+
+
+//Switch menu backward by default
+void switch_backward(void)
+{
+ for (uint8_t i = 0; menu_backward_table[i].current_menu; i++)
+ {
+ if (current_menu == menu_backward_table[i].current_menu)
+ {
+ set_current_item(M_ALL_I_FIRST); //reset current item before exit
+ current_menu = menu_backward_table[i].next_menu;
+ break;
+ }
+ }
+ draw_current_menu();
+}
+
+
+
+//Get currently selected item in current menu
+uint8_t get_current_item(void)
+{
+ for (uint8_t i = 0; item_table[i].curent_menu; i++)
+ {
+ if (current_menu == item_table[i].curent_menu)
+ {
+ return item_table[i].cur_item;
+ }
+ }
+ return 0; //automatically return 0 if item not found in item_table[]
+}
+
+
+
+//Get last item in current menu
+uint8_t get_last_item(void)
+{
+ for (uint8_t i = 0; item_table[i].curent_menu; i++)
+ {
+ if (current_menu == item_table[i].curent_menu)
+ {
+ return item_table[i].last_item;
+ }
+ }
+ return 0; //automatically return 0 if item not found in item_table[]
+}
+
+
+
+//Set item to be current in current menu
+void set_current_item(uint8_t new_value)
+{
+ for (uint8_t i = 0; item_table[i].curent_menu; i++)
+ {
+ if (current_menu == item_table[i].curent_menu)
+ {
+ item_table[i].cur_item = new_value;
+ break;
+ }
+ }
+}
+
+
+
+//Reset item in any menu
+void reset_current_item_in_menu(uint8_t menu)
+{
+ for (uint8_t i = 0; item_table[i].curent_menu; i++)
+ {
+ if (menu == item_table[i].curent_menu)
+ {
+ item_table[i].cur_item = M_ALL_I_FIRST;
+ break;
+ }
+ }
+}
+
+
+
+//Draw current menu (after scroll)
+void draw_current_menu(void)
+{
+ for (uint8_t i = 0; menu_draw_table[i].current; i++)
+ {
+ if (current_menu == menu_draw_table[i].current)
+ {
+ menu_draw_table[i].action();
+ break;
+ }
+ }
+}
+
+
+
+//MAIN
+void draw_main(void)
+{
+ #define MAIN_ROW (2)
+ #define MAIN_COL (1)
+
+ ssd1306_clear();
+ ssd1306_print(0, MAIN_COL, "MENU", 0);
+ ssd1306_print(MAIN_ROW, MAIN_COL, "Devices", 0);
+ ssd1306_print(MAIN_ROW + 1, MAIN_COL, "Radar", 0);
+ ssd1306_print(MAIN_ROW + 2, MAIN_COL, "Points", 0);
+ ssd1306_print(MAIN_ROW + 3, MAIN_COL, "Settings", 0);
+ ssd1306_print(MAIN_ROW + 4, MAIN_COL, "Info", 0);
+ ssd1306_print(MAIN_ROW + get_current_item(), MAIN_COL - 1, ">", 0);
+
+ ssd1306_char_pos(0, 20, SYMB_NOTE, 0);
+ if (get_mute_flag() == 1)
+ {
+ ssd1306_char_pos(0, 19, '!', 0);
+ }
+
+ ssd1306_update();
+}
+
+
+
+//DEVICES
+void draw_devices(void)
+{
+ ssd1306_clear();
+ ssd1306_bitmap(&devices_blank[0]);
+
+ //TRX
+ if (get_main_flags()->gps_sync)
+ {
+ ssd1306_char_pos(0, 18, SYMB_ARROW_UP, 0);
+ ssd1306_char_pos(0, 19, SYMB_ARROW_DOWN, 0);
+ }
+
+ //Sattelites
+ if (p_gps_raw->time[0] == 0) //if no time received then no sattelites at all
+ {
+ ssd1306_char_pos(0, 20, SYMB_NO_SATT, 0);
+ }
+ else
+ {
+ if (p_gps_num->mode == GPS_POSITION_3DFIX && p_gps_num->status == GPS_DATA_VALID)
+ {
+ ssd1306_char_pos(0, 20, SYMB_SATT_3D, 0); //3D when data is valid
+ }
+ else if (p_gps_num->mode == GPS_POSITION_2DFIX && p_gps_num->status == GPS_DATA_VALID)
+ {
+ ssd1306_char_pos(0, 20, SYMB_SATT_2D, 0); //2D when data is valid
+ }
+ else
+ {
+ ssd1306_char_pos(0, 20, SYMB_SATT_1D, 0); //if not 2D or 3D then only time is avaliable
+ }
+ }
+
+ uint8_t icon_col = LCD_LAST_COL;
+
+ //Battery
+ switch (get_device_flags(device_number, FLAGS_BATTERY))
+ {
+ case FLAG_BATTERY_75_TO_100:
+ ssd1306_char_pos(1, icon_col--, SYMB_BAT_4OF4, 0);
+ break;
+
+ case FLAG_BATTERY_50_TO_75:
+ ssd1306_char_pos(1, icon_col--, SYMB_BAT_3OF4, 0);
+ break;
+
+ case FLAG_BATTERY_25_TO_50:
+ ssd1306_char_pos(1, icon_col--, SYMB_BAT_2OF4, 0);
+ break;
+
+ case FLAG_BATTERY_10_TO_25:
+ ssd1306_char_pos(1, icon_col--, SYMB_BAT_1OF4, 0);
+ break;
+
+ case FLAG_BATTERY_0_TO_10:
+ ssd1306_char_pos(1, icon_col--, SYMB_BAT_0OF4, 0);
+ break;
+ }
+
+
+
+ //Timeout
+ if (pp_dev_aux[device_number]->timeout_flag)
+ {
+ ssd1306_char_pos(1, icon_col--, SYMB_TIMEOUT, 0);
+ }
+
+
+
+ //Alarm
+ if (get_device_flags(device_number, FLAGS_ALARM) == FLAG_ALARM_ON)
+ {
+ ssd1306_char_pos(1, icon_col--, SYMB_ALARM, 0);
+ }
+
+
+
+ //Devices
+ uint8_t another_dev_row = ANOTHER_DEVICE_START_ROW; //start to print another devices from row 3
+
+ for (uint8_t dev = 1; dev <= DEVICES_IN_GROUP; dev++)
+ {
+ if (dev == device_number) //if me
+ {
+ //Number
+ itoa32(dev, &buf[0]);
+ ssd1306_print(1, 0, &buf[0], 0);
+
+ //ID
+ ssd1306_char_pos(1, 2, p_settings->device_id[0], 0);
+ ssd1306_char_pos(1, 3, p_settings->device_id[1], 0);
+
+ //Speed
+ if (p_gps_num->speed < 10.0) //if speed is small show x.x format
+ {
+ ftoa32(p_gps_num->speed, 1, &buf[0]);
+ ssd1306_print_viceversa(1, 7, &buf[0], 0);
+ }
+ else //else show int format
+ {
+ itoa32(pp_gps_air[dev]->speed, &buf[0]);
+ ssd1306_print_viceversa(1, 7, &buf[0], 0);
+ }
+
+ //Course
+ itoa32(pp_gps_air[dev]->course.as_integer, &buf[0]);
+ ssd1306_print_viceversa(1, 11, &buf[0], 0);
+
+ //Altitude
+ itoa32(pp_gps_air[dev]->altitude.as_integer, &buf[0]);
+ ssd1306_print_viceversa(1, 16, &buf[0], 0);
+ }
+ else
+ {
+ if (pp_dev_aux[dev]->exist_flag == 1) //if not me & exist
+ {
+ //Number
+ itoa32(dev, &buf[0]);
+ ssd1306_print(another_dev_row, 0, &buf[0], 0);
+
+ //ID
+ ssd1306_char_pos(another_dev_row, 2, pp_gps_air[dev]->device_id[0], 0);
+ ssd1306_char_pos(another_dev_row, 3, pp_gps_air[dev]->device_id[1], 0);
+
+ //Distance
+ if (pp_gps_rel[dev]->distance < 1000) //1-999 m
+ {
+ itoa32(pp_gps_rel[dev]->distance, &buf[0]);
+ ssd1306_print_viceversa(another_dev_row, 7, &buf[0], 0);
+ }
+ else if (pp_gps_rel[dev]->distance < 10000) //1.0-9.9 km
+ {
+ tmpf = pp_gps_rel[dev]->distance / 1000.0;
+ ftoa32(tmpf, 1, &buf[0]);
+ ssd1306_print_viceversa(another_dev_row, 7, &buf[0], 0);
+ }
+ else if (pp_gps_rel[dev]->distance < 100000) //10.-99. km
+ {
+ tmpf = pp_gps_rel[dev]->distance / 1000.0;
+ itoa32((uint32_t)tmpf, &buf[0]);
+ ssd1306_print_viceversa(another_dev_row, 6, &buf[0], 0);
+ ssd1306_char_pos(another_dev_row, 7, '.', 0);
+ }
+ else // >100 km
+ {
+ ssd1306_print(another_dev_row, 5, "...", 0);
+ }
+
+ //Heading
+ itoa32(pp_gps_rel[dev]->heading, &buf[0]);
+ ssd1306_print_viceversa(another_dev_row, 11, &buf[0], 0);
+
+ //Delta Altitude
+ tmpi16 = pp_gps_rel[dev]->altitude_diff;
+ if (tmpi16 < 0)
+ {
+ tmpi16 *= -1;
+ }
+
+ if (tmpi16 < 1000) //1-999 m
+ {
+ itoa32(pp_gps_rel[dev]->altitude_diff, &buf[0]);
+ ssd1306_print_viceversa(another_dev_row, 16, &buf[0], 0);
+ }
+ else if (tmpi16 < 10000) //1.0-9.9 km
+ {
+ tmpf = pp_gps_rel[dev]->altitude_diff / 1000.0;
+ ftoa32(tmpf, 1, &buf[0]);
+ ssd1306_print_viceversa(another_dev_row, 16, &buf[0], 0);
+ }
+ else //10.-99. km
+ {
+ tmpf = pp_gps_rel[dev]->altitude_diff / 1000.0;
+ itoa32((int32_t)tmpf, &buf[0]);
+ ssd1306_char_pos(another_dev_row, 16, '.', 0);
+ ssd1306_print_viceversa(another_dev_row, 15, &buf[0], 0);
+ }
+
+ if (pp_gps_rel[dev]->altitude_diff > 0)
+ {
+ ssd1306_char('+', 0);
+ }
+
+
+
+ uint8_t icon_col = LCD_LAST_COL;
+
+ //Battery
+ if (pp_dev_aux[dev]->memory_point_flag == 0) //dont show battery icon for memory points
+ {
+ switch (get_device_flags(dev, FLAGS_BATTERY))
+ {
+ case FLAG_BATTERY_75_TO_100:
+ ssd1306_char_pos(another_dev_row, icon_col--, SYMB_BAT_4OF4, 0);
+ break;
+
+ case FLAG_BATTERY_50_TO_75:
+ ssd1306_char_pos(another_dev_row, icon_col--, SYMB_BAT_3OF4, 0);
+ break;
+
+ case FLAG_BATTERY_25_TO_50:
+ ssd1306_char_pos(another_dev_row, icon_col--, SYMB_BAT_2OF4, 0);
+ break;
+
+ case FLAG_BATTERY_10_TO_25:
+ ssd1306_char_pos(another_dev_row, icon_col--, SYMB_BAT_1OF4, 0);
+ break;
+
+ case FLAG_BATTERY_0_TO_10:
+ ssd1306_char_pos(another_dev_row, icon_col--, SYMB_BAT_0OF4, 0);
+ break;
+ }
+ }
+
+
+ //Timeout
+ if (pp_dev_aux[dev]->memory_point_flag == 0) //dont show timeout icon for memory points
+ {
+ if (pp_dev_aux[dev]->timeout_flag)
+ {
+ ssd1306_char_pos(another_dev_row, icon_col--, SYMB_TIMEOUT, 0);
+ }
+ }
+
+
+ //Fence
+ if (pp_dev_aux[dev]->fence_flag)
+ {
+ ssd1306_char_pos(another_dev_row, icon_col--, SYMB_FENCE, 0);
+ }
+
+
+ //Alarm
+ if (pp_dev_aux[dev]->memory_point_flag == 0) //dont show alarm icon for memory points
+ {
+ if (get_device_flags(dev, FLAGS_ALARM) == FLAG_ALARM_ON)
+ {
+ ssd1306_char_pos(another_dev_row, icon_col--, SYMB_ALARM, 0);
+ }
+ }
+
+
+ another_dev_row++; //set next row
+ }
+ }
+ }
+
+ ssd1306_update();
+}
+
+
+
+//EACH DEVICE
+void draw_each_device(void)
+{
+ ssd1306_clear();
+
+ //My status row
+ uint8_t icon_col = LCD_LAST_COL;
+
+ //Battery
+ switch (get_device_flags(device_number, FLAGS_BATTERY))
+ {
+ case FLAG_BATTERY_75_TO_100:
+ ssd1306_char_pos(0, icon_col--, SYMB_BAT_4OF4, 0);
+ break;
+
+ case FLAG_BATTERY_50_TO_75:
+ ssd1306_char_pos(0, icon_col--, SYMB_BAT_3OF4, 0);
+ break;
+
+ case FLAG_BATTERY_25_TO_50:
+ ssd1306_char_pos(0, icon_col--, SYMB_BAT_2OF4, 0);
+ break;
+
+ case FLAG_BATTERY_10_TO_25:
+ ssd1306_char_pos(0, icon_col--, SYMB_BAT_1OF4, 0);
+ break;
+
+ case FLAG_BATTERY_0_TO_10:
+ ssd1306_char_pos(0, icon_col--, SYMB_BAT_0OF4, 0);
+ break;
+ }
+
+
+
+ //Sattelites
+ if (p_gps_raw->time[0] == 0) //if no time received then no sattelites at all
+ {
+ ssd1306_char_pos(0, icon_col--, SYMB_NO_SATT, 0);
+ }
+ else
+ {
+ if (p_gps_num->mode == GPS_POSITION_3DFIX && p_gps_num->status == GPS_DATA_VALID)
+ {
+ ssd1306_char_pos(0, icon_col--, SYMB_SATT_3D, 0); //3D when data is valid
+ }
+ else if (p_gps_num->mode == GPS_POSITION_2DFIX && p_gps_num->status == GPS_DATA_VALID)
+ {
+ ssd1306_char_pos(0, icon_col--, SYMB_SATT_2D, 0); //2D when data is valid
+ }
+ else
+ {
+ ssd1306_char_pos(0, icon_col--, SYMB_SATT_1D, 0); //if not 2D or 3D then only time is avaliable
+ }
+ }
+
+
+ //TRX
+ if (get_main_flags()->gps_sync)
+ {
+ ssd1306_char_pos(0, icon_col--, SYMB_ARROW_DOWN, 0);
+ ssd1306_char_pos(0, icon_col--, SYMB_ARROW_UP, 0);
+ }
+
+
+ //Timeout
+ if (pp_dev_aux[device_number]->timeout_flag)
+ {
+ ssd1306_char_pos(0, icon_col--, SYMB_TIMEOUT, 0);
+ }
+
+
+ //Alarm
+ if (get_device_flags(device_number, FLAGS_ALARM) == FLAG_ALARM_ON)
+ {
+ ssd1306_char_pos(0, icon_col--, SYMB_ALARM, 0);
+ }
+
+
+
+ if (current_each_device == device_number) //if me
+ {
+ ssd1306_print(0, 0, "#", 0);
+ itoa32(current_each_device, &buf[0]);
+ ssd1306_print(0, 1, &buf[0], 0);
+
+ ssd1306_char_pos(0, 3, p_settings->device_id[0], 0);
+ ssd1306_char_pos(0, 4, p_settings->device_id[1], 0);
+
+ ssd1306_print(0, 6, "(me)", 0);
+
+ ssd1306_char_pos(1, 0, p_gps_raw->date[0], 0);
+ ssd1306_char_pos(1, 1, p_gps_raw->date[1], 0);
+ ssd1306_print(1, 2, ".", 0);
+
+ ssd1306_char_pos(1, 3, p_gps_raw->date[2], 0);
+ ssd1306_char_pos(1, 4, p_gps_raw->date[3], 0);
+ ssd1306_print(1, 5, ".", 0);
+
+ ssd1306_char_pos(1, 6, p_gps_raw->date[4], 0);
+ ssd1306_char_pos(1, 7, p_gps_raw->date[5], 0);
+
+ ssd1306_char_pos(1, 9, p_gps_raw->time[0], 0);
+ ssd1306_char_pos(1, 10, p_gps_raw->time[1], 0);
+ ssd1306_print(1, 11, ":", 0);
+
+ ssd1306_char_pos(1, 12, p_gps_raw->time[2], 0);
+ ssd1306_char_pos(1, 13, p_gps_raw->time[3], 0);
+ ssd1306_print(1, 14, ":", 0);
+
+ ssd1306_char_pos(1, 15, p_gps_raw->time[4], 0);
+ ssd1306_char_pos(1, 16, p_gps_raw->time[5], 0);
+
+ ssd1306_print(1, 18, "GMT", 0);
+
+ ssd1306_print(2, 0, "LAT", 0);
+ ftoa32(p_gps_num->latitude.in_deg, 6, &buf[0]);
+ ssd1306_print_viceversa(2, 14, &buf[0], 0);
+ if (p_gps_num->latitude.in_deg >= 0)
+ {
+ ssd1306_char('+', 0);
+ ssd1306_print(2, 16, "(N)", 0);
+ }
+ else
+ {
+ ssd1306_print(2, 16, "(S)", 0);
+ }
+
+ ssd1306_print(3, 0, "LON", 0);
+ ftoa32(p_gps_num->longitude.in_deg, 6, &buf[0]);
+ ssd1306_print_viceversa(3, 14, &buf[0], 0);
+ if (p_gps_num->longitude.in_deg >= 0)
+ {
+ ssd1306_char('+', 0);
+ ssd1306_print(3, 16, "(E)", 0);
+ }
+ else
+ {
+ ssd1306_print(3, 16, "(W)", 0);
+ }
+
+ ssd1306_print(4, 0, "ALT", 0);
+ itoa32(p_gps_num->altitude, &buf[0]);
+ ssd1306_print(4, 4, &buf[0], 0);
+ ssd1306_print_next("m", 0);
+
+ ssd1306_print(4, 11, "FIX", 0);
+ if (p_gps_num->status == GPS_DATA_VALID)
+ {
+ ssd1306_print(4, 15, "A/", 0);
+ }
+ else
+ {
+ ssd1306_print(4, 15, "V/", 0);
+ }
+
+ if (p_gps_num->mode == GPS_POSITION_2DFIX)
+ {
+ ssd1306_print(4, 17, "2D", 0);
+ }
+ else if (p_gps_num->mode == GPS_POSITION_3DFIX)
+ {
+ ssd1306_print(4, 17, "3D", 0);
+ }
+ else
+ {
+ ssd1306_print(4, 17, "NO", 0);
+ }
+
+ ssd1306_print(5, 0, "COG", 0);
+ itoa32(p_gps_num->course, &buf[0]);
+ ssd1306_print(5, 4, &buf[0], 0);
+ ssd1306_char(SYMB_DEGREE, 0);
+
+ ssd1306_print(5, 11, "DOP", 0);
+ ftoa32(p_gps_num->pdop, 2, &buf[0]);
+ ssd1306_print(5, 15, &buf[0], 0);
+
+ ssd1306_print(6, 0, "SOG", 0);
+ if (p_gps_num->speed < 10.0) //if speed is small show x.x format
+ {
+ ftoa32(p_gps_num->speed, 1, &buf[0]);
+ ssd1306_print(6, 4, &buf[0], 0);
+ }
+ else //else show int format
+ {
+ itoa32((int16_t)p_gps_num->speed, &buf[0]);
+ ssd1306_print(6, 4, &buf[0], 0);
+ }
+ ssd1306_print_next("kph", 0);
+
+ ssd1306_print(6, 11, "SAT", 0);
+ itoa32(p_gps_num->sat_used, &buf[0]);
+ ssd1306_print(6, 15, &buf[0], 0);
+ ssd1306_print_next("/", 0);
+ itoa32(p_gps_num->sat_view, &buf[0]);
+ ssd1306_print_next(&buf[0], 0);
+
+ if (pp_dev_aux[device_number]->timeout_flag == 1)
+ {
+ ssd1306_print(7, 0, "TOC", 1);
+ }
+ else
+ {
+ ssd1306_print(7, 0, "TOC", 0);
+ }
+ convert_timeout(pp_dev_aux[device_number]->timeout, &buf[0]);
+ ssd1306_print(7, 4, &buf[0], 0);
+
+ ssd1306_print(7, 11, "BAT", 0);
+ ftoa32(get_bat_voltage(), 2, &buf[0]);
+ ssd1306_print(7, 15, &buf[0], 0);
+ ssd1306_char('V', 0);
+ }
+ else //if not me
+ {
+ ssd1306_print(0, 1, "#", 0);
+ itoa32(current_each_device, &buf[0]);
+ ssd1306_print(0, 2, &buf[0], 0);
+
+ ssd1306_char_pos(0, 4, pp_gps_air[current_each_device]->device_id[0], 0);
+ ssd1306_char_pos(0, 5, pp_gps_air[current_each_device]->device_id[1], 0);
+
+ if (pp_dev_aux[current_each_device]->memory_point_flag == 1) //print memory point name
+ {
+ ssd1306_print(0, 7, pp_dev_aux[current_each_device]->point_name, 0);
+ }
+
+ ssd1306_print(1, 0, "LAT", 0);
+ ftoa32(pp_gps_air[current_each_device]->latitude.as_float, 6, &buf[0]);
+ ssd1306_print_viceversa(1, 14, &buf[0], 0);
+ if (pp_gps_air[current_each_device]->latitude.as_float >= 0)
+ {
+ ssd1306_char('+', 0);
+ ssd1306_print(1, 16, "(N)", 0);
+ }
+ else
+ {
+ ssd1306_print(1, 16, "(S)", 0);
+ }
+
+ ssd1306_print(2, 0, "LON", 0);
+ ftoa32(pp_gps_air[current_each_device]->longitude.as_float, 6, &buf[0]);
+ ssd1306_print_viceversa(2, 14, &buf[0], 0);
+ if (pp_gps_air[current_each_device]->longitude.as_float >= 0)
+ {
+ ssd1306_char('+', 0);
+ ssd1306_print(2, 16, "(E)", 0);
+ }
+ else
+ {
+ ssd1306_print(2, 16, "(W)", 0);
+ }
+
+ ssd1306_print(3, 0, "ALT", 0);
+ itoa32(pp_gps_air[current_each_device]->altitude.as_integer, &buf[0]);
+ ssd1306_print(3, 4, &buf[0], 0);
+ ssd1306_print_next("m", 0);
+
+
+ ssd1306_print(3, 11, "DLT", 0);
+ tmpi16 = pp_gps_rel[current_each_device]->altitude_diff;
+
+ if (tmpi16 < 0)
+ {
+ tmpi16 *= -1;
+ ssd1306_char_pos(3, 14, ' ', 0);
+ }
+ else if (tmpi16 > 0)
+ {
+ ssd1306_char_pos(3, 15, '+', 0);
+ }
+ else
+ {
+ ssd1306_char_pos(3, 14, ' ', 0);
+ }
+
+ if (tmpi16 < 10000) //0-9999 m
+ {
+ itoa32(pp_gps_rel[current_each_device]->altitude_diff, &buf[0]);
+ ssd1306_print_next(&buf[0], 0);
+ ssd1306_print_next("m", 0);
+ }
+ else // >=10000 km
+ {
+ tmpf = pp_gps_rel[current_each_device]->altitude_diff / 1000.0;
+ ftoa32(tmpf, 1, &buf[0]);
+ ssd1306_print_next(&buf[0], 0);
+ ssd1306_print_next("k", 0);
+ }
+
+ if (pp_dev_aux[current_each_device]->memory_point_flag == 0)
+ {
+ ssd1306_print(4, 0, "COG", 0);
+ itoa32(pp_gps_air[current_each_device]->course.as_integer, &buf[0]);
+ ssd1306_print(4, 4, &buf[0], 0);
+ ssd1306_char(SYMB_DEGREE, 0);
+ }
+
+ ssd1306_print(4, 11, "BRG", 0);
+ itoa32(pp_gps_rel[current_each_device]->heading, &buf[0]);
+ ssd1306_print(4, 15, &buf[0], 0);
+ ssd1306_char(SYMB_DEGREE, 0);
+
+ if (pp_dev_aux[current_each_device]->memory_point_flag == 0)
+ {
+ ssd1306_print(5, 0, "SOG", 0);
+ itoa32(pp_gps_air[current_each_device]->speed, &buf[0]);
+ ssd1306_print(5, 4, &buf[0], 0);
+ ssd1306_print_next("kph", 0);
+ }
+
+
+ ssd1306_print(5, 11, "DST", 0);
+
+ if (pp_gps_rel[current_each_device]->distance < 100000) // 0-99999 m
+ {
+ itoa32(pp_gps_rel[current_each_device]->distance, &buf[0]);
+ ssd1306_print(5, 15, &buf[0], 0);
+ ssd1306_print_next("m", 0);
+ }
+ else if (pp_gps_rel[current_each_device]->distance < 1000000) // 100-999.9 km
+ {
+ tmpf = pp_gps_rel[current_each_device]->distance / 1000.0;
+ ftoa32(tmpf, 1, &buf[0]);
+ ssd1306_print(5, 15, &buf[0], 0);
+ ssd1306_print_next("k", 0);
+ }
+ else // 1000-... km
+ {
+ tmpf = pp_gps_rel[current_each_device]->distance / 1000000.0;
+ ftoa32(tmpf, 1, &buf[0]);
+ ssd1306_print(5, 15, &buf[0], 0);
+ ssd1306_print_next("M", 0);
+ }
+
+
+ if (pp_dev_aux[current_each_device]->memory_point_flag == 0)
+ {
+ ssd1306_print(6, 0, "FIX", 0);
+ if (get_device_flags(current_each_device, FLAGS_GPS_FIX) == FLAG_GPS_FIX_3D)
+ {
+ ssd1306_print(6, 4, "3D/", 0);
+ }
+ else
+ {
+ ssd1306_print(6, 4, "2D/", 0);
+ }
+
+ if (get_device_flags(current_each_device, FLAGS_PDOP) == FLAG_PDOP_GOOD)
+ {
+ ssd1306_print(6, 7, "HI", 0);
+ }
+ else
+ {
+ ssd1306_print(6, 7, "LO", 0);
+ }
+ }
+
+
+ if (pp_dev_aux[current_each_device]->memory_point_flag == 0)
+ {
+ ssd1306_print(6, 11, "BAT", 0);
+ switch (get_device_flags(current_each_device, FLAGS_BATTERY))
+ {
+ case FLAG_BATTERY_75_TO_100:
+ ssd1306_print(6, 15, "4/4", 0);
+ break;
+
+ case FLAG_BATTERY_50_TO_75:
+ ssd1306_print(6, 15, "3/4", 0);
+ break;
+
+ case FLAG_BATTERY_25_TO_50:
+ ssd1306_print(6, 15, "2/4", 0);
+ break;
+
+ case FLAG_BATTERY_10_TO_25:
+ ssd1306_print(6, 15, "1/4", 0);
+ break;
+
+ case FLAG_BATTERY_0_TO_10:
+ ssd1306_print(6, 15, "0/4", 0);
+ break;
+ }
+ }
+
+ if (pp_dev_aux[current_each_device]->timeout_flag == 1)
+ {
+ ssd1306_print(7, 0, "TOC", 1);
+ }
+ else
+ {
+ ssd1306_print(7, 0, "TOC", 0);
+ }
+ convert_timeout(pp_dev_aux[current_each_device]->timeout, &buf[0]);
+ ssd1306_print(7, 4, &buf[0], 0);
+
+
+
+ if (pp_dev_aux[current_each_device]->fence_flag)
+ {
+ ssd1306_print(7, 11, "FNC", 1); //print inverted
+ }
+ else
+ {
+ ssd1306_print(7, 11, "FNC", 0);
+ }
+
+
+ if (pp_dev_aux[current_each_device]->memory_point_flag == 0)
+ {
+ if (get_device_flags(current_each_device, FLAGS_ALARM) == FLAG_ALARM_ON)
+ {
+ ssd1306_print(7, 15, "ALR", 1); //print inverted
+ }
+ else
+ {
+ ssd1306_print(7, 15, "ALR", 0);
+ }
+ }
+
+
+
+ }
+ ssd1306_update();
+}
+
+
+
+void draw_each_device_submenu(void)
+{
+ #define EACH_DEV_SM_ROW (2)
+ #define EACH_DEV_SM_COL (1)
+
+ ssd1306_clear();
+
+ ssd1306_print(0, EACH_DEV_SM_COL, "DEVICE", 0);
+
+ ssd1306_print(0, EACH_DEV_SM_COL + 7, "#", 0);
+ itoa32(current_each_device, &buf[0]);
+ ssd1306_print(0, EACH_DEV_SM_COL + 8, &buf[0], 0);
+
+ ssd1306_char_pos(0, EACH_DEV_SM_COL + 10, pp_gps_air[current_each_device]->device_id[0], 0);
+ ssd1306_char_pos(0, EACH_DEV_SM_COL + 11, pp_gps_air[current_each_device]->device_id[1], 0);
+
+ ssd1306_print(EACH_DEV_SM_ROW, EACH_DEV_SM_COL, "Save", 0);
+ ssd1306_print(EACH_DEV_SM_ROW + 1, EACH_DEV_SM_COL, "Delete", 0);
+ ssd1306_print(EACH_DEV_SM_ROW + get_current_item(), EACH_DEV_SM_COL - 1, ">", 0);
+
+ ssd1306_update();
+}
+
+
+
+void draw_delete_device(void)
+{
+ ssd1306_clear();
+ ssd1306_print(0, 1, "Delete device", 0);
+
+ ssd1306_print(0, 15, "#", 0);
+ itoa32(current_each_device, &buf[0]);
+ ssd1306_print(0, 16, &buf[0], 0);
+
+ ssd1306_char_pos(0, 18, pp_gps_air[current_each_device]->device_id[0], 0);
+ ssd1306_char_pos(0, 19, pp_gps_air[current_each_device]->device_id[1], 0);
+
+ ssd1306_print_next("?", 0);
+
+
+ if (current_each_device == device_number)
+ {
+ ssd1306_print(3, 1, "Can't del yourself", 0);
+ }
+ else
+ {
+ ssd1306_print(3, 1, "OK - delete", 0);
+ }
+
+ ssd1306_print(4, 1, "ESC - cancel", 0);
+
+ ssd1306_update();
+}
+
+
+
+void delete_device_ok(void)
+{
+ if (current_each_device != device_number)
+ {
+ pp_dev_aux[current_each_device]->exist_flag = 0; //delete device just by resetting exist flag
+ current_each_device = device_number; //also reset the current device
+ current_radar_device = 0; //reset current dev in radar menu
+ radar_list_hide[current_each_device] = 0;//reset hide flag
+
+ reset_current_item_in_menu(M_EACH_DEVICE_SUBMENU);
+ current_menu = M_DEVICES;
+ draw_current_menu();
+ }
+}
+
+
+
+void draw_save_device(void)
+{
+ #define SAVE_DEVICE_ROW (2)
+ #define SAVE_DEVICE_COL (1)
+
+ memcpy(point_to_save_name, point_to_save_default_name, sizeof(point_to_save_default_name)); //init default name here
+
+ ssd1306_clear();
+
+ ssd1306_print(0, SAVE_DEVICE_COL, "Where to save", 0);
+
+ ssd1306_print(0, SAVE_DEVICE_COL + 14, "#", 0);
+ itoa32(current_each_device, &buf[0]);
+ ssd1306_print(0, SAVE_DEVICE_COL + 15, &buf[0], 0);
+
+ ssd1306_char_pos(0, SAVE_DEVICE_COL + 17, pp_gps_air[current_each_device]->device_id[0], 0);
+ ssd1306_char_pos(0, SAVE_DEVICE_COL + 18, pp_gps_air[current_each_device]->device_id[1], 0);
+
+ ssd1306_print_next("?", 0);
+
+ read_memory_slots();
+
+ uint8_t another_point_to_save_row = SAVE_DEVICE_ROW;
+ uint8_t points_enlisted_cntr = 0;
+
+ for (uint8_t s = 1; s <= MEMORY_SLOTS_TOTAL; s++)
+ {
+ if (pp_memory_slot[s]->exist_flag == 0)
+ {
+ point_to_save_list[s] = points_enlisted_cntr++; //first nonexisting point will get index 0
+
+ if (current_slot_to_save == 0) //if for the first time
+ {
+ current_slot_to_save = s;
+ }
+
+ //Slot name
+ ssd1306_print(another_point_to_save_row, SAVE_DEVICE_COL, pp_memory_slot[s]->slot_name, 0);
+
+ another_point_to_save_row++;
+ }
+ }
+
+ if (points_enlisted_cntr > 0)
+ {
+ ssd1306_print(SAVE_DEVICE_ROW + point_to_save_list[current_slot_to_save], SAVE_DEVICE_COL - 1, ">", 0);
+ }
+ else
+ {
+ ssd1306_print(SAVE_DEVICE_ROW, SAVE_DEVICE_COL, "no empty slots", 0);
+ current_slot_to_save = 0;
+ }
+
+ ssd1306_update();
+}
+
+
+
+void draw_save_device_as(void)
+{
+ #define SAVE_DEV_AS_ROW (2)
+ #define SAVE_DEV_AS_COL (1)
+ #define SAVE_DEV_AS_PARAM_COL (11)
+
+ ssd1306_clear();
+ ssd1306_print(0, SAVE_DEV_AS_COL, "Set point name", 0);
+
+ ssd1306_print(SAVE_DEV_AS_ROW, SAVE_DEV_AS_COL, "Name", 0);
+ ssd1306_print(SAVE_DEV_AS_ROW, SAVE_DEV_AS_PARAM_COL, point_to_save_name, 0);
+ ssd1306_print(SAVE_DEV_AS_ROW + 1, SAVE_DEV_AS_PARAM_COL + point_name_current_symbol, "^", 0);
+ ssd1306_print(SAVE_DEV_AS_ROW + 3, SAVE_DEV_AS_COL, "Long OK - save", 0);
+ ssd1306_update();
+}
+
+
+
+void draw_saved_popup(void)
+{
+ ssd1306_clear();
+ ssd1306_print(0, 1, "Saved!", 0);
+ ssd1306_update();
+}
+
+
+
+//RADAR
+void draw_radar(void)
+{
+ ssd1306_clear();
+ ssd1306_bitmap(&radar_blank[0]);
+
+ //My status row
+ uint8_t icon_col = LCD_LAST_COL;
+
+
+ //Battery
+ switch (get_device_flags(device_number, FLAGS_BATTERY))
+ {
+ case FLAG_BATTERY_75_TO_100:
+ ssd1306_char_pos(0, icon_col--, SYMB_BAT_4OF4, 0);
+ break;
+
+ case FLAG_BATTERY_50_TO_75:
+ ssd1306_char_pos(0, icon_col--, SYMB_BAT_3OF4, 0);
+ break;
+
+ case FLAG_BATTERY_25_TO_50:
+ ssd1306_char_pos(0, icon_col--, SYMB_BAT_2OF4, 0);
+ break;
+
+ case FLAG_BATTERY_10_TO_25:
+ ssd1306_char_pos(0, icon_col--, SYMB_BAT_1OF4, 0);
+ break;
+
+ case FLAG_BATTERY_0_TO_10:
+ ssd1306_char_pos(0, icon_col--, SYMB_BAT_0OF4, 0);
+ break;
+ }
+
+
+ //Sattelites
+ if (p_gps_raw->time[0] == 0) //if no time received then no sattelites at all
+ {
+ ssd1306_char_pos(0, icon_col--, SYMB_NO_SATT, 0);
+ }
+ else
+ {
+ if (p_gps_num->mode == GPS_POSITION_3DFIX && p_gps_num->status == GPS_DATA_VALID)
+ {
+ ssd1306_char_pos(0, icon_col--, SYMB_SATT_3D, 0); //3D when data is valid
+ }
+ else if (p_gps_num->mode == GPS_POSITION_2DFIX && p_gps_num->status == GPS_DATA_VALID)
+ {
+ ssd1306_char_pos(0, icon_col--, SYMB_SATT_2D, 0); //2D when data is valid
+ }
+ else
+ {
+ ssd1306_char_pos(0, icon_col--, SYMB_SATT_1D, 0); //if not 2D or 3D then only time is avaliable
+ }
+ }
+
+ //TRX
+ if (get_main_flags()->gps_sync)
+ {
+ ssd1306_char_pos(0, icon_col--, SYMB_ARROW_DOWN, 0);
+ ssd1306_char_pos(0, icon_col--, SYMB_ARROW_UP, 0);
+ }
+
+
+
+ //Timeout
+ if (pp_dev_aux[device_number]->timeout_flag)
+ {
+ ssd1306_char_pos(0, icon_col--, SYMB_TIMEOUT, 0);
+ }
+
+ //Alarm
+ if (get_device_flags(device_number, FLAGS_ALARM) == FLAG_ALARM_ON)
+ {
+ ssd1306_char_pos(0, icon_col--, SYMB_ALARM, 0);
+ }
+
+
+
+ //COG
+ itoa32(pp_gps_air[device_number]->course.as_integer, &buf[0]);
+ ssd1306_print_viceversa(0, 7, &buf[0], 0);
+
+
+
+ uint8_t another_radar_dev_row = ANOTHER_RADAR_DEVICE_START_ROW;
+ uint32_t max_distance = 0;
+ uint8_t devices_enlisted_cntr = 0;
+
+ for (uint8_t dev = 1; dev <= DEVICES_IN_GROUP; dev++)
+ {
+ if (dev != device_number)
+ {
+ if (pp_dev_aux[dev]->exist_flag == 1)
+ {
+ radar_list[dev] = devices_enlisted_cntr++; //first existing device will get index 0
+
+ if (current_radar_device == 0) //if for the first time
+ {
+ current_radar_device = dev;
+ }
+
+ //Number
+ itoa32(dev, &buf[0]);
+ if (radar_list_hide[dev] == 1)
+ {
+ ssd1306_print(another_radar_dev_row, 9, &buf[0], 1);
+ }
+ else
+ {
+ ssd1306_print(another_radar_dev_row, 9, &buf[0], 0);
+ }
+
+ //ID
+ ssd1306_char_pos(another_radar_dev_row, 11, pp_gps_air[dev]->device_id[0], 0);
+ ssd1306_char_pos(another_radar_dev_row, 12, pp_gps_air[dev]->device_id[1], 0);
+
+ //Distance
+ if (pp_gps_rel[dev]->distance < 1000) //1-999 m
+ {
+ itoa32(pp_gps_rel[dev]->distance, &buf[0]);
+ ssd1306_print_viceversa(another_radar_dev_row, 16, &buf[0], 0);
+ }
+ else if (pp_gps_rel[dev]->distance < 10000) //1.0-9.9 km
+ {
+ tmpf = pp_gps_rel[dev]->distance / 1000.0;
+ ftoa32(tmpf, 1, &buf[0]);
+ ssd1306_print_viceversa(another_radar_dev_row, 16, &buf[0], 0);
+ }
+ else if (pp_gps_rel[dev]->distance < 100000) //10.-99. km
+ {
+ tmpf = pp_gps_rel[dev]->distance / 1000.0;
+ itoa32((uint32_t)tmpf, &buf[0]);
+ ssd1306_print_viceversa(another_radar_dev_row, 16, &buf[0], 0);
+ ssd1306_char_pos(another_radar_dev_row, 17, '.', 0);
+ }
+ else // >100 km
+ {
+ ssd1306_print(another_radar_dev_row, 14, "...", 0);
+ }
+
+ //Search max distance
+ if (pp_gps_rel[dev]->distance > max_distance)
+ {
+ if (radar_list_hide[dev] == 0)
+ {
+ max_distance = pp_gps_rel[dev]->distance; //fix max distance only if device is not hided
+ }
+ }
+
+ //Heading
+ itoa32(pp_gps_rel[dev]->heading, &buf[0]);
+ ssd1306_print_viceversa(another_radar_dev_row, 20, &buf[0], 0);
+
+
+ //Warning sign in case of timeout, alarm or fence
+ if (get_device_flags(dev, FLAGS_ALARM) || pp_dev_aux[dev]->timeout_flag || pp_dev_aux[dev]->fence_flag)
+ {
+ ssd1306_print_byte(another_radar_dev_row, 21, custom_exclam_mark, 2);
+ }
+
+ another_radar_dev_row++;
+ }
+ else //if device is not exist
+ {
+ radar_list_hide[dev] = 0; //clear hide flag, so when device disappear, and appear again it will be not hided
+ }
+
+ }
+ }
+
+
+ //Pointer and bottom row information bar
+ if (devices_enlisted_cntr > 0)
+ {
+ ssd1306_print(2 + radar_list[current_radar_device], 8, ">", 0);
+
+ uint8_t icon_col = LCD_LAST_COL;
+
+ if (pp_dev_aux[current_radar_device]->memory_point_flag == 0) //dont show battery icon for memory points
+ {
+ //Battery
+ switch (get_device_flags(current_radar_device, FLAGS_BATTERY))
+ {
+ case FLAG_BATTERY_75_TO_100:
+ ssd1306_char_pos(7, icon_col--, SYMB_BAT_4OF4, 0);
+ break;
+
+ case FLAG_BATTERY_50_TO_75:
+ ssd1306_char_pos(7, icon_col--, SYMB_BAT_3OF4, 0);
+ break;
+
+ case FLAG_BATTERY_25_TO_50:
+ ssd1306_char_pos(7, icon_col--, SYMB_BAT_2OF4, 0);
+ break;
+
+ case FLAG_BATTERY_10_TO_25:
+ ssd1306_char_pos(7, icon_col--, SYMB_BAT_1OF4, 0);
+ break;
+
+ case FLAG_BATTERY_0_TO_10:
+ ssd1306_char_pos(7, icon_col--, SYMB_BAT_0OF4, 0);
+ break;
+ }
+ }
+
+
+ if (pp_dev_aux[current_radar_device]->memory_point_flag == 0)
+ {
+ //Timeout
+ if (pp_dev_aux[current_radar_device]->timeout_flag)
+ {
+ ssd1306_char_pos(7, icon_col--, SYMB_TIMEOUT, 0);
+ }
+ }
+
+
+ //Fence
+ if (pp_dev_aux[current_radar_device]->fence_flag)
+ {
+ ssd1306_char_pos(7, icon_col--, SYMB_FENCE, 0);
+ }
+
+
+ if (pp_dev_aux[current_radar_device]->memory_point_flag == 0)
+ {
+ //Alarm
+ if (get_device_flags(current_radar_device, FLAGS_ALARM) == FLAG_ALARM_ON)
+ {
+ ssd1306_char_pos(7, icon_col--, SYMB_ALARM, 0);
+ }
+ }
+
+
+ //if mem point then print it name
+ if (pp_dev_aux[current_radar_device]->memory_point_flag == 1)
+ {
+ ssd1306_print(7, 9, pp_dev_aux[current_radar_device]->point_name, 0);
+ }
+
+
+ }
+ else
+ {
+ current_radar_device = 0;
+ }
+
+
+ //Radar implementation is here
+ float mpd_ratio_f = 0.0; //meters per dot ratio
+ uint32_t mpd_ratio_i = 0;
+
+ if (max_distance < r_circ_dots)
+ {
+ max_distance = r_circ_dots;
+ }
+
+ mpd_ratio_f = (float)max_distance / (float)r_circ_dots; //calc ratio
+ mpd_ratio_i = (uint32_t)mpd_ratio_f; //extract int part
+
+ mpd_ratio_f -= mpd_ratio_i; //extract frac part
+
+ if (mpd_ratio_f > 0.001) //if frac part is non-zero, then inc ratio
+ {
+ mpd_ratio_i++;
+ }
+
+ //print radar range
+ uint32_t radar_range = mpd_ratio_i * r_circ_dots; //i.e. radar screen radius
+
+ if (radar_range < 10000) // 0...9999 meters, screen fits 4 characters max
+ {
+ itoa32(radar_range, &buf[0]);
+ ssd1306_print_viceversa(7, 7, &buf[0], 0);
+ }
+ else if (radar_range < 1000000) // 10000...999999 meters
+ {
+ itoa32((radar_range / 1000), &buf[0]);
+ ssd1306_char_pos(7, 7, 'k', 0);
+ ssd1306_print_viceversa(7, 6, &buf[0], 0);
+ }
+ else
+ {
+ ssd1306_print_viceversa(7, 7, "...", 0);
+ }
+
+
+
+ //plot on radar
+ for (uint8_t dev = 1; dev <= DEVICES_IN_GROUP; dev++)
+ {
+ if (dev != device_number)
+ {
+ if (pp_dev_aux[dev]->exist_flag == 1)
+ {
+ if (radar_list_hide[dev] == 0) //if not hided
+ {
+ uint8_t sx1 = 0; //device coordinates on the screen
+ uint8_t sy1 = 0;
+
+ double x1 = 0.0; //device coordinates relative from my position (0, 0)
+ double y1 = 0.0;
+
+ x1 = -((pp_gps_rel[dev]->distance)/(double)mpd_ratio_i) * cos((pp_gps_rel[dev]->heading + 90) * deg_to_rad);
+ y1 = ((pp_gps_rel[dev]->distance)/(double)mpd_ratio_i) * sin((pp_gps_rel[dev]->heading + 90) * deg_to_rad);
+
+ sx1 = sx0 + (int8_t)x1;
+ sy1 = sy0 - (int8_t)y1; //note: Y axis is inverted (counts from top to the bottom)
+
+
+ ssd1306_pixel(sx1, sy1+1, 1); //pixel cross
+ ssd1306_pixel(sx1+1, sy1, 1);
+ ssd1306_pixel(sx1, sy1-1, 1);
+ ssd1306_pixel(sx1-1, sy1, 1);
+
+ //center pixel if device is selected
+ if (dev == current_radar_device)
+ {
+ ssd1306_pixel(sx1, sy1, 1);
+ }
+ }
+ }
+ }
+ }
+
+ ssd1306_update();
+}
+
+
+
+//POINTS
+void draw_points(void)
+{
+ #define POINTS_ROW (2)
+ #define POINTS_COL (1)
+ #define POINTS_NAME_COL (4)
+ #define POINTS_DATE_COL (10)
+
+
+
+#if 0
+
+ save_memory_point(1, "TEST1", 1);
+
+#endif
+
+ read_memory_slots();
+
+ ssd1306_clear();
+ ssd1306_print(0, POINTS_COL, "POINTS", 0);
+
+ for (uint8_t s = 1; s <= MEMORY_SLOTS_TOTAL; s++)
+ {
+ ssd1306_print(POINTS_ROW + s - 1, POINTS_COL, pp_memory_slot[s]->slot_name, 0); //print slot name
+
+ if (pp_memory_slot[s]->exist_flag == 1)
+ {
+ ssd1306_print(POINTS_ROW + s - 1, POINTS_NAME_COL, pp_memory_slot[s]->point_name, 0); //print point name
+
+ ssd1306_char_pos(POINTS_ROW + s - 1, POINTS_DATE_COL, pp_memory_slot[s]->save_date[0], 0); //print point save date
+ ssd1306_char_pos(POINTS_ROW + s - 1, POINTS_DATE_COL + 1, pp_memory_slot[s]->save_date[1], 0);
+ ssd1306_print(POINTS_ROW + s - 1, POINTS_DATE_COL + 2, ".", 0);
+
+ ssd1306_char_pos(POINTS_ROW + s - 1, POINTS_DATE_COL + 3, pp_memory_slot[s]->save_date[2], 0);
+ ssd1306_char_pos(POINTS_ROW + s - 1, POINTS_DATE_COL + 4, pp_memory_slot[s]->save_date[3], 0);
+ ssd1306_print(POINTS_ROW + s - 1, POINTS_DATE_COL + 5, ".", 0);
+
+ ssd1306_char_pos(POINTS_ROW + s - 1, POINTS_DATE_COL + 6, pp_memory_slot[s]->save_date[4], 0);
+ ssd1306_char_pos(POINTS_ROW + s - 1, POINTS_DATE_COL + 7, pp_memory_slot[s]->save_date[5], 0);
+ }
+ else
+ {
+ ssd1306_print(POINTS_ROW + s - 1, POINTS_NAME_COL, "empty", 0);
+ }
+ }
+
+ ssd1306_print(POINTS_ROW + current_slot_to_load - 1, POINTS_COL - 1, ">", 0); //print pointer
+
+ ssd1306_update();
+}
+
+
+
+void draw_each_point(void)
+{
+ #define EACH_POINT_ROW (2)
+ #define EACH_POINT_COL (1)
+
+ ssd1306_clear();
+
+ ssd1306_print(0, EACH_POINT_COL, "POINT ", 0);
+ ssd1306_print_next(pp_memory_slot[current_slot_to_load]->slot_name, 0);
+
+ ssd1306_print(EACH_POINT_ROW, EACH_POINT_COL, "Load", 0);
+ ssd1306_print(EACH_POINT_ROW + 1, EACH_POINT_COL, "Delete", 0);
+ ssd1306_print(EACH_POINT_ROW + get_current_item(), EACH_POINT_COL - 1, ">", 0);
+
+ ssd1306_update();
+}
+
+
+
+void draw_load_point(void)
+{
+ #define LOAD_POINT_ROW (2)
+ #define LOAD_POINT_COL (1)
+
+ ssd1306_clear();
+
+ ssd1306_print(0, LOAD_POINT_COL, "Where to load ", 0);
+ ssd1306_print_next(pp_memory_slot[current_slot_to_load]->slot_name, 0);
+ ssd1306_print_next("?", 0);
+
+ uint8_t another_device_to_load_row = LOAD_POINT_ROW;
+ uint8_t devices_enlisted_cntr = 0;
+
+ for (uint8_t dev = 1; dev <= DEVICES_IN_GROUP; dev++)
+ {
+ if (pp_dev_aux[dev]->exist_flag == 0)
+ {
+ device_to_load_list[dev] = devices_enlisted_cntr++; //first nonexisting device will get index 0
+
+ if (current_device_to_load == 0) //if for the first time
+ {
+ current_device_to_load = dev;
+ }
+
+ //Device
+ ssd1306_print(another_device_to_load_row, LOAD_POINT_COL, "Device ", 0);
+
+ //Number
+ itoa32(dev, &buf[0]);
+ ssd1306_print_next(&buf[0], 0);
+
+ another_device_to_load_row++;
+ }
+ }
+
+ if (devices_enlisted_cntr > 0)
+ {
+ ssd1306_print(LOAD_POINT_ROW + device_to_load_list[current_device_to_load], LOAD_POINT_COL - 1, ">", 0);
+ }
+ else
+ {
+ ssd1306_print(LOAD_POINT_ROW, LOAD_POINT_COL, "no empty devices", 0);
+ current_device_to_load = 0;
+ }
+
+ ssd1306_update();
+}
+
+
+
+void draw_delete_point(void)
+{
+ ssd1306_clear();
+ ssd1306_print(0, 1, "Delete point ", 0);
+ ssd1306_print_next(pp_memory_slot[current_slot_to_load]->slot_name, 0);
+ ssd1306_print_next("?", 0);
+ ssd1306_print(3, 1, "OK - delete", 0);
+ ssd1306_print(4, 1, "ESC - cancel", 0);
+ ssd1306_update();
+}
+
+
+
+//SETTINGS
+void draw_settings(void)
+{
+ #define SETTINGS_ROW (2)
+ #define SETTINGS_COL (1)
+
+ ssd1306_clear();
+ ssd1306_print(0, SETTINGS_COL, "SETTINGS", 0);
+ ssd1306_print(SETTINGS_ROW, SETTINGS_COL, "Edit", 0);
+ ssd1306_print(SETTINGS_ROW + 1, SETTINGS_COL, "Restore", 0);
+ ssd1306_print(SETTINGS_ROW + 2, SETTINGS_COL, "Erase", 0);
+ ssd1306_print(SETTINGS_ROW + get_current_item(), SETTINGS_COL - 1, ">", 0);
+ ssd1306_update();
+}
+
+
+
+//INFO
+void draw_info(void)
+{
+ ssd1306_clear();
+
+ ssd1306_bitmap(&info_blank[0]);
+
+ ssd1306_print(0, 0, "LRNS", 0);
+
+ ssd1306_print(2, 0, "HW/FW: ", 0);
+ ssd1306_print_next(HW_VERSION, 0);
+ ssd1306_print_next("/", 0);
+ ssd1306_print_next(FW_VERSION, 0);
+
+ ssd1306_print(3, 0, __TIME__, 0);
+ ssd1306_print(4, 0, __DATE__, 0);
+
+ ssd1306_print(7, 0, "(C)2021 Feruz Topalov", 0);
+
+ ssd1306_update();
+}
+
+
+
+//EDIT SETTINGS
+void draw_edit_settings(void)
+{
+ #define EDIT_SETTINGS_ROW (1)
+ #define EDIT_SETTINGS_COL (1)
+ #define EDIT_SETTINGS_PARAM_COL (15)
+
+ ssd1306_clear();
+ ssd1306_print(0, EDIT_SETTINGS_COL + 1, "EDIT SETTINGS", 0);
+
+ ssd1306_print(EDIT_SETTINGS_ROW, EDIT_SETTINGS_COL, "Device number", 0);
+ itoa32(settings_copy.device_number, &buf[0]);
+ ssd1306_print(EDIT_SETTINGS_ROW, EDIT_SETTINGS_PARAM_COL, &buf[0], 0);
+
+ ssd1306_print(EDIT_SETTINGS_ROW + 1, EDIT_SETTINGS_COL, "Device ID", 0);
+ buf[0] = settings_copy.device_id[0];
+ buf[1] = settings_copy.device_id[1];
+ buf[2] = 0;
+ ssd1306_print(EDIT_SETTINGS_ROW + 1, EDIT_SETTINGS_PARAM_COL, &buf[0], 0);
+
+ ssd1306_print(EDIT_SETTINGS_ROW + 2, EDIT_SETTINGS_COL, "Freq channel", 0);
+ itoa32(settings_copy.freq_channel, &buf[0]);
+ ssd1306_print(EDIT_SETTINGS_ROW + 2, EDIT_SETTINGS_PARAM_COL, &buf[0], 0);
+
+ ssd1306_print(EDIT_SETTINGS_ROW + 3, EDIT_SETTINGS_COL, "TX power", 0);
+ itoa32(p_get_tx_power_values[settings_copy.tx_power_opt], &buf[0]);
+ ssd1306_print(EDIT_SETTINGS_ROW + 3, EDIT_SETTINGS_PARAM_COL, &buf[0], 0);
+ ssd1306_print_next(" mW", 0);
+
+ ssd1306_print(EDIT_SETTINGS_ROW + 4, EDIT_SETTINGS_COL, "Send interval", 0);
+ itoa32(p_send_interval_values[settings_copy.send_interval_opt], &buf[0]);
+ ssd1306_print(EDIT_SETTINGS_ROW + 4, EDIT_SETTINGS_PARAM_COL, &buf[0], 0);
+ ssd1306_print_next(" s", 0);
+
+ ssd1306_print(EDIT_SETTINGS_ROW + 5, EDIT_SETTINGS_COL, "Timeout thr", 0);
+ itoa32(settings_copy.timeout_threshold.as_integer, &buf[0]);
+ ssd1306_print(EDIT_SETTINGS_ROW + 5, EDIT_SETTINGS_PARAM_COL, &buf[0], 0);
+ ssd1306_print_next(" s", 0);
+
+ ssd1306_print(EDIT_SETTINGS_ROW + 6, EDIT_SETTINGS_COL, "Fence thr", 0);
+ itoa32(settings_copy.fence_threshold.as_integer, &buf[0]);
+ ssd1306_print(EDIT_SETTINGS_ROW + 6, EDIT_SETTINGS_PARAM_COL, &buf[0], 0);
+ ssd1306_print_next(" m", 0);
+
+ ssd1306_print(EDIT_SETTINGS_ROW + get_current_item(), EDIT_SETTINGS_COL - 1, ">", 0);
+ ssd1306_update();
+}
+
+
+
+//SET DEV NUM
+void draw_set_dev_num(void)
+{
+ #define SET_DEV_NUM_ROW (2)
+ #define SET_DEV_NUM_COL (1)
+ #define SET_DEV_NUM_PARAM_COL (15)
+
+ ssd1306_clear();
+ ssd1306_print(0, SET_DEV_NUM_COL, "SET DEV NUM", 0);
+
+ ssd1306_print(SET_DEV_NUM_ROW, SET_DEV_NUM_COL, "Device number", 0);
+ itoa32(settings_copy.device_number, &buf[0]);
+ ssd1306_print(SET_DEV_NUM_ROW, SET_DEV_NUM_PARAM_COL, &buf[0], 0);
+ ssd1306_print(SET_DEV_NUM_ROW + 1, SET_DEV_NUM_PARAM_COL, "^", 0);
+ ssd1306_update();
+}
+
+
+
+//SET DEV ID
+void draw_set_dev_id(void)
+{
+ #define SET_DEV_ID_ROW (2)
+ #define SET_DEV_ID_COL (1)
+ #define SET_DEV_ID_PARAM_COL (15)
+
+ ssd1306_clear();
+ ssd1306_print(0, SET_DEV_NUM_COL, "SET DEV ID", 0);
+
+ ssd1306_print(SET_DEV_ID_ROW, SET_DEV_ID_COL, "Device ID", 0);
+ buf[0] = settings_copy.device_id[0];
+ buf[1] = settings_copy.device_id[1];
+ buf[2] = 0;
+ ssd1306_print(SET_DEV_ID_ROW, SET_DEV_ID_PARAM_COL, &buf[0], 0);
+ ssd1306_print(SET_DEV_ID_ROW + 1, SET_DEV_ID_PARAM_COL + device_id_current_symbol, "^", 0);
+ ssd1306_print(SET_DEV_ID_ROW + 3, SET_DEV_ID_COL, "Long OK - apply", 0);
+ ssd1306_update();
+}
+
+
+
+//SET FREQ CH
+void draw_set_freq_ch(void)
+{
+ #define SET_FREQ_CH_ROW (2)
+ #define SET_FREQ_CH_COL (1)
+ #define SET_FREQ_CH_PARAM_COL (16)
+
+ ssd1306_clear();
+ ssd1306_print(0, SET_FREQ_CH_COL, "SET FREQ CH", 0);
+
+ ssd1306_print(SET_FREQ_CH_ROW, SET_FREQ_CH_COL, "Freq channel", 0);
+ itoa32(settings_copy.freq_channel, &buf[0]);
+ ssd1306_print_viceversa(SET_FREQ_CH_ROW, SET_FREQ_CH_PARAM_COL, &buf[0], 0);
+ ssd1306_print(SET_FREQ_CH_ROW + 1, SET_FREQ_CH_PARAM_COL, "^", 0);
+ ssd1306_update();
+}
+
+
+
+//SET TX POW
+void draw_set_tx_pow(void)
+{
+ #define SET_TX_POW_ROW (2)
+ #define SET_TX_POW_COL (1)
+ #define SET_TX_POW_PARAM_COL (15)
+
+ ssd1306_clear();
+ ssd1306_print(0, SET_TX_POW_COL, "SET TX POW", 0);
+
+ ssd1306_print(SET_TX_POW_ROW, SET_TX_POW_COL, "TX power", 0);
+ itoa32(p_get_tx_power_values[settings_copy.tx_power_opt], &buf[0]);
+ ssd1306_print(SET_TX_POW_ROW, SET_TX_POW_PARAM_COL, &buf[0], 0);
+ ssd1306_print_next(" mW", 0);
+ ssd1306_print(SET_TX_POW_ROW + 1, SET_TX_POW_PARAM_COL, "^", 0);
+ ssd1306_update();
+}
+
+
+
+//SET SEND INTRVL
+void draw_set_send_intvl(void)
+{
+ #define SET_SEND_INTVL_ROW (2)
+ #define SET_SEND_INTVL_COL (1)
+ #define SET_SEND_INTVL_PARAM_COL (16)
+
+ ssd1306_clear();
+ ssd1306_print(0, SET_SEND_INTVL_COL, "SET SEND INTVL", 0);
+
+ ssd1306_print(SET_SEND_INTVL_ROW, SET_SEND_INTVL_COL, "Send interval", 0);
+ itoa32(p_send_interval_values[settings_copy.send_interval_opt], &buf[0]);
+ ssd1306_print(SET_SEND_INTVL_ROW, SET_SEND_INTVL_PARAM_COL, &buf[0], 0);
+ ssd1306_print_next(" s", 0);
+ ssd1306_print(SET_SEND_INTVL_ROW + 1, SET_SEND_INTVL_PARAM_COL, "^", 0);
+ ssd1306_update();
+}
+
+
+
+//SET TIMEOUT THR
+void draw_set_to_thr(void)
+{
+ #define SET_TO_THR_ROW (2)
+ #define SET_TO_THR_COL (1)
+ #define SET_TO_THR_PARAM_COL (14)
+
+ ssd1306_clear();
+ ssd1306_print(0, SET_TO_THR_COL, "SET TO THR", 0);
+
+ ssd1306_print(SET_TO_THR_ROW, SET_TO_THR_COL, "Timeout thr", 0);
+ itoa32(settings_copy.timeout_threshold.as_integer, &buf[0]);
+ ssd1306_print(SET_TO_THR_ROW, SET_TO_THR_PARAM_COL, &buf[0], 0);
+ ssd1306_print_next(" s", 0);
+ ssd1306_print(SET_TO_THR_ROW + 1, SET_TO_THR_PARAM_COL, "^", 0);
+ ssd1306_update();
+}
+
+
+
+//SET TIMEOUT THR
+void draw_set_fnc_thr(void)
+{
+ #define SET_FNC_THR_ROW (2)
+ #define SET_FNC_THR_COL (1)
+ #define SET_FNC_THR_PARAM_COL (14)
+
+ ssd1306_clear();
+ ssd1306_print(0, SET_FNC_THR_COL, "SET FNC THR", 0);
+
+ ssd1306_print(SET_FNC_THR_ROW, SET_FNC_THR_COL, "Fence thr", 0);
+ itoa32(settings_copy.fence_threshold.as_integer, &buf[0]);
+ ssd1306_print(SET_FNC_THR_ROW, SET_FNC_THR_PARAM_COL, &buf[0], 0);
+ ssd1306_print_next(" m", 0);
+ ssd1306_print(SET_FNC_THR_ROW + 1, SET_FNC_THR_PARAM_COL, "^", 0);
+ ssd1306_update();
+}
+
+
+
+//CONFIRM SETTINGS SAVE
+void draw_confirm_settings_save(void)
+{
+ if (flag_settings_changed)
+ {
+ ssd1306_clear();
+ ssd1306_print(0, 1, "Settings changed", 0);
+ ssd1306_print(3, 1, "OK - save & restart", 0);
+ ssd1306_print(4, 1, "ESC - cancel changes", 0);
+ ssd1306_update();
+ }
+ else
+ {
+ current_menu = M_SETTINGS;
+ draw_current_menu();
+ }
+}
+
+
+
+//RESTORE DEFAULTS
+void draw_restore_defaults(void)
+{
+ ssd1306_clear();
+ ssd1306_print(0, 1, "Restore defaults?", 0);
+ ssd1306_print(3, 1, "OK - restore & reset", 0);
+ ssd1306_print(4, 1, "ESC - cancel", 0);
+ ssd1306_update();
+}
+
+
+
+//ERASE ALL
+void draw_erase_all(void)
+{
+ ssd1306_clear();
+ ssd1306_print(0, 1, "Erase all EEPROM?", 0);
+ ssd1306_print(3, 1, "OK - erase & reset", 0);
+ ssd1306_print(4, 1, "ESC - cancel", 0);
+ ssd1306_update();
+}
+
+
+
+void devices_ok(void)
+{
+ if (pp_dev_aux[current_each_device]->exist_flag == 0)
+ {
+ each_device_up();
+ }
+
+ current_menu = M_EACH_DEVICE;
+ draw_current_menu();
+}
+
+
+
+void each_device_up(void)
+{
+ do
+ {
+ if (current_each_device == DEVICE_NUMBER_FIRST)
+ {
+ current_each_device = DEVICE_NUMBER_LAST;
+ }
+ else
+ {
+ current_each_device--;
+ }
+ }
+ while (pp_dev_aux[current_each_device]->exist_flag == 0);
+
+ draw_current_menu();
+}
+
+
+
+void each_device_down(void)
+{
+ do
+ {
+ if (current_each_device == DEVICE_NUMBER_LAST)
+ {
+ current_each_device = DEVICE_NUMBER_FIRST;
+ }
+ else
+ {
+ current_each_device++;
+ }
+ }
+ while (pp_dev_aux[current_each_device]->exist_flag == 0);
+
+ draw_current_menu();
+}
+
+
+
+void each_device_ok(void)
+{
+ current_menu = M_EACH_DEVICE_SUBMENU;
+ draw_current_menu();
+}
+
+
+
+void save_device_up(void)
+{
+ if (current_slot_to_save != 0)
+ {
+ do
+ {
+ if (current_slot_to_save == MEMORY_SLOT_FIRST)
+ {
+ current_slot_to_save = MEMORY_SLOT_LAST;
+ }
+ else
+ {
+ current_slot_to_save--;
+ }
+ }
+ while (pp_memory_slot[current_slot_to_save]->exist_flag == 1);
+
+ draw_current_menu();
+ }
+}
+
+
+
+void save_device_down(void)
+{
+ if (current_slot_to_save != 0)
+ {
+ do
+ {
+ if (current_slot_to_save == MEMORY_SLOT_LAST)
+ {
+ current_slot_to_save = MEMORY_SLOT_FIRST;
+ }
+ else
+ {
+ current_slot_to_save++;
+ }
+ }
+ while (pp_memory_slot[current_slot_to_save]->exist_flag == 1);
+
+ draw_current_menu();
+ }
+}
+
+
+
+void save_device_ok(void)
+{
+ if (current_slot_to_save != 0)
+ {
+ current_menu = M_SAVE_DEVICE_AS;
+ draw_current_menu();
+ }
+}
+
+
+
+void save_device_esc(void)
+{
+ current_slot_to_save = 0;
+ current_menu = M_EACH_DEVICE_SUBMENU;
+ draw_current_menu();
+}
+
+
+
+void save_device_as_up(void)
+{
+ if (point_to_save_name[point_name_current_symbol] == POINT_NAME_LAST_SYMBOL)
+ {
+ point_to_save_name[point_name_current_symbol] = POINT_NAME_FIRST_SYMBOL;
+ }
+ else
+ {
+ point_to_save_name[point_name_current_symbol]++;
+ }
+
+ draw_current_menu();
+}
+
+
+
+void save_device_as_down(void)
+{
+ if (point_to_save_name[point_name_current_symbol] == POINT_NAME_FIRST_SYMBOL)
+ {
+ point_to_save_name[point_name_current_symbol] = POINT_NAME_LAST_SYMBOL;
+ }
+ else
+ {
+ point_to_save_name[point_name_current_symbol]--;
+ }
+
+ draw_current_menu();
+}
+
+
+
+void save_device_as_ok(void)
+{
+ if (++point_name_current_symbol == MEMORY_POINT_NAME_LENGTH)
+ {
+ point_name_current_symbol = 0;
+ }
+
+ draw_current_menu();
+}
+
+
+
+void save_device_as_ok_long(void)
+{
+ save_memory_point(current_each_device, &point_to_save_name[0], current_slot_to_save);
+
+ current_each_device = device_number;
+ current_slot_to_save = 0;
+ point_name_current_symbol = 0;
+
+ current_menu = M_SAVED_POPUP;
+ draw_current_menu();
+}
+
+
+
+void save_device_as_esc(void)
+{
+ point_name_current_symbol = 0;
+ current_menu = M_SAVE_DEVICE;
+ draw_current_menu();
+}
+
+
+
+void saved_popup_esc(void)
+{
+ current_each_device = device_number;
+ current_slot_to_save = 0;
+ point_name_current_symbol = 0;
+
+ current_menu = M_DEVICES;
+ draw_current_menu();
+}
+
+
+
+void radar_up(void)
+{
+ if (current_radar_device != 0)
+ {
+ do
+ {
+ do
+ {
+ if (current_radar_device == DEVICE_NUMBER_FIRST)
+ {
+ current_radar_device = DEVICE_NUMBER_LAST;
+ }
+ else
+ {
+ current_radar_device--;
+ }
+ }
+ while (pp_dev_aux[current_radar_device]->exist_flag == 0);
+ }
+ while (current_radar_device == device_number);
+
+ draw_current_menu();
+ }
+}
+
+
+
+void radar_down(void)
+{
+ if (current_radar_device != 0)
+ {
+ do
+ {
+ do
+ {
+ if (current_radar_device == DEVICE_NUMBER_LAST)
+ {
+ current_radar_device = DEVICE_NUMBER_FIRST;
+ }
+ else
+ {
+ current_radar_device++;
+ }
+ }
+ while (pp_dev_aux[current_radar_device]->exist_flag == 0);
+ }
+ while (current_radar_device == device_number);
+
+ draw_current_menu();
+ }
+}
+
+
+
+void radar_ok(void)
+{
+ if (current_radar_device != 0)
+ {
+ radar_list_hide[current_radar_device] ^= 1; //Invert hide flag
+
+ draw_current_menu();
+ }
+}
+
+
+
+void points_up(void)
+{
+ if (current_slot_to_load == MEMORY_SLOT_FIRST)
+ {
+ current_slot_to_load = MEMORY_SLOT_LAST;
+ }
+ else
+ {
+ current_slot_to_load--;
+ }
+
+ draw_current_menu();
+}
+
+
+
+void points_down(void)
+{
+ if (current_slot_to_load == MEMORY_SLOT_LAST)
+ {
+ current_slot_to_load = MEMORY_SLOT_FIRST;
+ }
+ else
+ {
+ current_slot_to_load++;
+ }
+
+ draw_current_menu();
+}
+
+
+
+void points_ok(void)
+{
+ if (pp_memory_slot[current_slot_to_load]->exist_flag == 1)
+ {
+ current_menu = M_EACH_POINT;
+ draw_current_menu();
+ }
+}
+
+
+
+void points_esc(void)
+{
+ current_slot_to_load = MEMORY_SLOT_FIRST;
+ current_menu = M_MAIN;
+ draw_current_menu();
+}
+
+
+
+void load_point_up(void)
+{
+ if (current_device_to_load != 0)
+ {
+ do
+ {
+ do
+ {
+ if (current_device_to_load == DEVICE_NUMBER_FIRST)
+ {
+ current_device_to_load = DEVICE_NUMBER_LAST;
+ }
+ else
+ {
+ current_device_to_load--;
+ }
+ }
+ while (pp_dev_aux[current_device_to_load]->exist_flag == 1);
+ }
+ while (current_device_to_load == device_number);
+
+ draw_current_menu();
+ }
+}
+
+
+
+void load_point_down(void)
+{
+ if (current_device_to_load != 0)
+ {
+ do
+ {
+ do
+ {
+ if (current_device_to_load == DEVICE_NUMBER_LAST)
+ {
+ current_device_to_load = DEVICE_NUMBER_FIRST;
+ }
+ else
+ {
+ current_device_to_load++;
+ }
+ }
+ while (pp_dev_aux[current_device_to_load]->exist_flag == 1);
+ }
+ while (current_device_to_load == device_number);
+
+ draw_current_menu();
+ }
+}
+
+
+
+void load_point_ok(void)
+{
+ if (current_device_to_load != 0)
+ {
+ load_memory_point(current_device_to_load, current_slot_to_load);
+
+ current_slot_to_load = MEMORY_SLOT_FIRST;
+ current_device_to_load = 0;
+ current_menu = M_MAIN;
+ draw_current_menu();
+ }
+}
+
+
+
+void load_point_esc(void)
+{
+ current_device_to_load = 0;
+ current_menu = M_EACH_POINT;
+ draw_current_menu();
+}
+
+
+
+void delete_point_ok(void)
+{
+ delete_memory_point(current_slot_to_load);
+
+ reset_current_item_in_menu(M_EACH_POINT);
+ current_slot_to_load = MEMORY_SLOT_FIRST;
+ current_menu = M_POINTS;
+ draw_current_menu();
+}
+
+
+
+void set_dev_num_up(void)
+{
+ if (settings_copy.device_number == DEVICE_NUMBER_LAST)
+ {
+ settings_copy.device_number = DEVICE_NUMBER_FIRST;
+ }
+ else
+ {
+ settings_copy.device_number++;
+ }
+
+ draw_current_menu();
+}
+
+
+
+void set_dev_num_down(void)
+{
+ if (settings_copy.device_number == DEVICE_NUMBER_FIRST)
+ {
+ settings_copy.device_number = DEVICE_NUMBER_LAST;
+ }
+ else
+ {
+ settings_copy.device_number--;
+ }
+
+ draw_current_menu();
+}
+
+
+
+void set_dev_num_ok(void)
+{
+ if (settings_copy.device_number != device_number)
+ {
+ flag_settings_changed = 1;
+ }
+
+ current_menu = M_EDIT_SETTINGS;
+ draw_current_menu();
+}
+
+
+
+void set_dev_num_esc(void)
+{
+ settings_copy.device_number = device_number; //exit no save, reset value
+ current_menu = M_EDIT_SETTINGS;
+ draw_current_menu();
+}
+
+
+
+void confirm_settings_save_ok(void)
+{
+ settings_save(&settings_copy);
+ NVIC_SystemReset();
+}
+
+
+
+void set_dev_id_up(void)
+{
+ if (settings_copy.device_id[device_id_current_symbol] == DEVICE_ID_LAST_SYMBOL)
+ {
+ settings_copy.device_id[device_id_current_symbol] = DEVICE_ID_FIRST_SYMBOL;
+ }
+ else
+ {
+ settings_copy.device_id[device_id_current_symbol]++;
+ }
+
+ draw_current_menu();
+}
+
+
+
+void set_dev_id_down(void)
+{
+ if (settings_copy.device_id[device_id_current_symbol] == DEVICE_ID_FIRST_SYMBOL)
+ {
+ settings_copy.device_id[device_id_current_symbol] = DEVICE_ID_LAST_SYMBOL;
+ }
+ else
+ {
+ settings_copy.device_id[device_id_current_symbol]--;
+ }
+
+ draw_current_menu();
+}
+
+
+
+void set_dev_id_ok(void)
+{
+ if (++device_id_current_symbol == DEVICE_ID_LEN)
+ {
+ device_id_current_symbol = 0;
+ }
+
+ draw_current_menu();
+}
+
+
+
+void set_dev_id_ok_long(void)
+{
+ for (uint8_t i = 0; i < DEVICE_ID_LEN; i++)
+ {
+ if (settings_copy.device_id[i] != p_settings->device_id[i])
+ {
+ flag_settings_changed = 1;
+ break;
+ }
+ }
+
+ current_menu = M_EDIT_SETTINGS;
+ draw_current_menu();
+}
+
+
+
+void set_dev_id_esc(void)
+{
+ for (uint8_t i = 0; i < DEVICE_ID_LEN; i++)
+ {
+ settings_copy.device_id[i] = p_settings->device_id[i]; //exit no save, reset value
+ }
+ device_id_current_symbol = 0;
+
+ current_menu = M_EDIT_SETTINGS;
+ draw_current_menu();
+}
+
+
+
+void set_freq_ch_up(void)
+{
+ if (settings_copy.freq_channel == FREQ_CHANNEL_LAST)
+ {
+ settings_copy.freq_channel = FREQ_CHANNEL_FIRST;
+ }
+ else
+ {
+ settings_copy.freq_channel++;
+ }
+
+ draw_current_menu();
+}
+
+
+
+void set_freq_ch_down(void)
+{
+ if (settings_copy.freq_channel == FREQ_CHANNEL_FIRST)
+ {
+ settings_copy.freq_channel = FREQ_CHANNEL_LAST;
+ }
+ else
+ {
+ settings_copy.freq_channel--;
+ }
+
+ draw_current_menu();
+}
+
+
+
+void set_freq_ch_ok(void)
+{
+ if (settings_copy.freq_channel != p_settings->freq_channel)
+ {
+ flag_settings_changed = 1;
+ }
+
+ current_menu = M_EDIT_SETTINGS;
+ draw_current_menu();
+}
+
+
+
+void set_freq_ch_esc(void)
+{
+ settings_copy.freq_channel = p_settings->freq_channel; //exit no save, reset value
+ current_menu = M_EDIT_SETTINGS;
+ draw_current_menu();
+}
+
+
+
+void set_tx_pow_up(void)
+{
+ if (settings_copy.tx_power_opt == TX_POWER_LAST_OPTION)
+ {
+ settings_copy.tx_power_opt = TX_POWER_FIRST_OPTION;
+ }
+ else
+ {
+ settings_copy.tx_power_opt++;
+ }
+
+ draw_current_menu();
+}
+
+
+
+void set_tx_pow_down(void)
+{
+ if (settings_copy.tx_power_opt == TX_POWER_FIRST_OPTION)
+ {
+ settings_copy.tx_power_opt = TX_POWER_LAST_OPTION;
+ }
+ else
+ {
+ settings_copy.tx_power_opt--;
+ }
+
+ draw_current_menu();
+}
+
+
+
+void set_tx_pow_ok(void)
+{
+ if (settings_copy.tx_power_opt != p_settings->tx_power_opt)
+ {
+ flag_settings_changed = 1;
+ }
+
+ current_menu = M_EDIT_SETTINGS;
+ draw_current_menu();
+}
+
+
+
+void set_tx_pow_esc(void)
+{
+ settings_copy.tx_power_opt = p_settings->tx_power_opt; //exit no save, reset value
+ current_menu = M_EDIT_SETTINGS;
+ draw_current_menu();
+}
+
+
+
+void set_send_intvl_up(void)
+{
+ if (settings_copy.send_interval_opt == SEND_INTERVAL_LAST_OPTION)
+ {
+ settings_copy.send_interval_opt = SEND_INTERVAL_FIRST_OPTION;
+ }
+ else
+ {
+ settings_copy.send_interval_opt++;
+ }
+
+ draw_current_menu();
+}
+
+
+
+void set_send_intvl_down(void)
+{
+ if (settings_copy.send_interval_opt == SEND_INTERVAL_FIRST_OPTION)
+ {
+ settings_copy.send_interval_opt = SEND_INTERVAL_LAST_OPTION;
+ }
+ else
+ {
+ settings_copy.send_interval_opt--;
+ }
+
+ draw_current_menu();
+}
+
+
+
+void set_send_intvl_ok(void)
+{
+ if (settings_copy.send_interval_opt != p_settings->send_interval_opt)
+ {
+ flag_settings_changed = 1;
+ }
+
+ current_menu = M_EDIT_SETTINGS;
+ draw_current_menu();
+}
+
+
+
+void set_send_intvl_esc(void)
+{
+ settings_copy.send_interval_opt = p_settings->send_interval_opt; //exit no save, reset value
+ current_menu = M_EDIT_SETTINGS;
+ draw_current_menu();
+}
+
+
+
+void set_to_thr_up(void)
+{
+ #define TIMEOUT_THRESHOLD_MAX (3600)
+ #define TIMEOUT_THRESHOLD_STEP (10)
+
+ if (settings_copy.timeout_threshold.as_integer < TIMEOUT_THRESHOLD_MAX)
+ {
+ settings_copy.timeout_threshold.as_integer += TIMEOUT_THRESHOLD_STEP;
+ }
+
+ draw_current_menu();
+}
+
+
+
+void set_to_thr_down(void)
+{
+ #define TIMEOUT_THRESHOLD_MIN (0)
+
+ if (settings_copy.timeout_threshold.as_integer > TIMEOUT_THRESHOLD_MIN)
+ {
+ settings_copy.timeout_threshold.as_integer -= TIMEOUT_THRESHOLD_STEP;
+ }
+
+ draw_current_menu();
+}
+
+
+
+void set_to_thr_ok(void)
+{
+ if (settings_copy.timeout_threshold.as_integer != p_settings->timeout_threshold.as_integer)
+ {
+ flag_settings_changed = 1;
+ }
+
+ current_menu = M_EDIT_SETTINGS;
+ draw_current_menu();
+}
+
+
+
+void set_to_thr_esc(void)
+{
+ settings_copy.timeout_threshold.as_integer = p_settings->timeout_threshold.as_integer; //exit no save, reset value
+ current_menu = M_EDIT_SETTINGS;
+ draw_current_menu();
+}
+
+
+
+void set_fnc_thr_up(void)
+{
+ #define FENCE_THRESHOLD_MAX (3600)
+ #define FENCE_THRESHOLD_STEP (10)
+
+ if (settings_copy.fence_threshold.as_integer < FENCE_THRESHOLD_MAX)
+ {
+ settings_copy.fence_threshold.as_integer += FENCE_THRESHOLD_STEP;
+ }
+
+ draw_current_menu();
+}
+
+
+
+void set_fnc_thr_down(void)
+{
+ #define FENCE_THRESHOLD_MIN (0)
+
+ if (settings_copy.fence_threshold.as_integer > FENCE_THRESHOLD_MIN)
+ {
+ settings_copy.fence_threshold.as_integer -= FENCE_THRESHOLD_STEP;
+ }
+
+ draw_current_menu();
+}
+
+
+
+void set_fnc_thr_ok(void)
+{
+ if (settings_copy.fence_threshold.as_integer != p_settings->fence_threshold.as_integer)
+ {
+ flag_settings_changed = 1;
+ }
+
+ current_menu = M_EDIT_SETTINGS;
+ draw_current_menu();
+}
+
+
+
+void set_fnc_thr_esc(void)
+{
+ settings_copy.fence_threshold.as_integer = p_settings->fence_threshold.as_integer; //exit no save, reset value
+ current_menu = M_EDIT_SETTINGS;
+ draw_current_menu();
+}
+
+
+
+void confirm_settings_save_esc(void)
+{
+ settings_copy = *p_settings; //reset to no changes state
+ flag_settings_changed = 0; //clear flag
+ current_menu = M_SETTINGS;
+ draw_current_menu();
+}
+
+
+
+void restore_defaults_ok(void)
+{
+ settings_save_default();
+ NVIC_SystemReset();
+}
+
+
+
+void erase_all_ok(void)
+{
+ ssd1306_clear();
+ ssd1306_print(0, 1, "WAIT...", 0);
+ ssd1306_update();
+ m24c64_erase_all();
+ NVIC_SystemReset();
+}
diff --git a/Firmware/CubeIDE/Code/src/points.c b/Firmware/CubeIDE/Code/src/points.c
new file mode 100644
index 0000000..6dfa710
--- /dev/null
+++ b/Firmware/CubeIDE/Code/src/points.c
@@ -0,0 +1,227 @@
+/*
+ ELEPH - Local Relative Navigation System
+
+ Copyright (C) 2021 Feruz Topalov
+ Released under the GNU General Public License v3.0
+
+ file: points.c
+*/
+
+#include
+#include "stm32f10x.h"
+#include "points.h"
+#include "m24c64.h"
+#include "settings.h"
+#include "lrns.h"
+#include "gps.h"
+#include "service.h"
+#include "main.h"
+
+
+
+//positions:
+#define MEMORY_POINT_EXIST_FLAG_POS (0)
+
+#define MEMORY_POINT_NAME_POS (1)
+
+#define MEMORY_POINT_DAY_POS (6)
+#define MEMORY_POINT_MONTH_POS (8)
+#define MEMORY_POINT_YEAR_POS (10)
+
+#define MEMORY_POINT_LATITUDE_POS (12)
+#define MEMORY_POINT_LONGITUDE_POS (16)
+#define MEMORY_POINT_ALTITUDE_POS (20)
+
+
+
+//default values:
+#define POINT_EXIST_FLAG_DEFAULT (0xAA)
+
+
+
+#define MEMORY_SLOT_1_NAME ("S1")
+#define MEMORY_SLOT_2_NAME ("S2")
+#define MEMORY_SLOT_3_NAME ("S3")
+#define MEMORY_SLOT_4_NAME ("S4")
+#define MEMORY_SLOT_5_NAME ("S5")
+
+#define MEMORY_SLOT_NAMES { "0", \
+ MEMORY_SLOT_1_NAME, \
+ MEMORY_SLOT_2_NAME, \
+ MEMORY_SLOT_3_NAME, \
+ MEMORY_SLOT_4_NAME, \
+ MEMORY_SLOT_5_NAME }
+
+
+
+void clear_point_buffer(void);
+
+
+
+struct memory_slot_struct memory_slot[MEMORY_SLOTS_TOTAL + 1]; //index 0 is invalid and not used; slots start from 1 to MEMORY_SLOTS_TOTAL
+struct memory_slot_struct *p_memory_slot[MEMORY_SLOTS_TOTAL + 1];
+
+uint8_t point_buffer[M24C64_PAGE_SIZE];
+struct gps_raw_struct *p_gps_raw;
+struct gps_air_struct **pp_gps_air;
+struct dev_aux_struct **pp_dev_aux;
+
+char *memory_slot_names[MEMORY_SLOTS_TOTAL + 1] = MEMORY_SLOT_NAMES;
+
+
+
+struct memory_slot_struct **get_memory_slot(void)
+{
+ for (uint8_t slot = 1; slot <= MEMORY_SLOTS_TOTAL; slot++)
+ {
+ p_memory_slot[slot] = &memory_slot[slot];
+ }
+
+ return &p_memory_slot[0];
+}
+
+
+
+void init_points(void)
+{
+ p_gps_raw = get_gps_raw();
+ pp_gps_air = get_gps_air();
+ pp_dev_aux = get_dev_aux();
+
+ for (uint8_t slot = 1; slot <= MEMORY_SLOTS_TOTAL; slot++)
+ {
+ memory_slot[slot].slot_name[0] = memory_slot_names[slot][0]; //init slot names
+ memory_slot[slot].slot_name[1] = memory_slot_names[slot][1];
+ memory_slot[slot].slot_name[2] = 0;
+ }
+}
+
+
+
+void read_memory_slots(void)
+{
+ for (uint8_t slot = 1; slot <= MEMORY_SLOTS_TOTAL; slot++)
+ {
+
+ clear_point_buffer();
+ m24c64_read_page(&point_buffer[0], slot);
+
+ if (point_buffer[MEMORY_POINT_EXIST_FLAG_POS] == POINT_EXIST_FLAG_DEFAULT)
+ {
+ memory_slot[slot].exist_flag = 1;
+
+ memory_slot[slot].point_name[0] = point_buffer[MEMORY_POINT_NAME_POS];
+ memory_slot[slot].point_name[1] = point_buffer[MEMORY_POINT_NAME_POS + 1];
+ memory_slot[slot].point_name[2] = point_buffer[MEMORY_POINT_NAME_POS + 2];
+ memory_slot[slot].point_name[3] = point_buffer[MEMORY_POINT_NAME_POS + 3];
+ memory_slot[slot].point_name[4] = point_buffer[MEMORY_POINT_NAME_POS + 4];
+ memory_slot[slot].point_name[5] = 0;
+
+ memory_slot[slot].save_date[0] = point_buffer[MEMORY_POINT_DAY_POS];
+ memory_slot[slot].save_date[1] = point_buffer[MEMORY_POINT_DAY_POS + 1];
+ memory_slot[slot].save_date[2] = point_buffer[MEMORY_POINT_MONTH_POS];
+ memory_slot[slot].save_date[3] = point_buffer[MEMORY_POINT_MONTH_POS + 1];
+ memory_slot[slot].save_date[4] = point_buffer[MEMORY_POINT_YEAR_POS];
+ memory_slot[slot].save_date[5] = point_buffer[MEMORY_POINT_YEAR_POS + 1];
+ }
+ else
+ {
+ memory_slot[slot].exist_flag = 0;
+ }
+ }
+}
+
+
+
+//Save selected device in a slot
+void save_memory_point(uint8_t dev_num, char *point_name, uint8_t slot_num)
+{
+ clear_point_buffer();
+
+ point_buffer[MEMORY_POINT_EXIST_FLAG_POS] = POINT_EXIST_FLAG_DEFAULT;
+
+ point_buffer[MEMORY_POINT_NAME_POS] = point_name[0];
+ point_buffer[MEMORY_POINT_NAME_POS + 1] = point_name[1];
+ point_buffer[MEMORY_POINT_NAME_POS + 2] = point_name[2];
+ point_buffer[MEMORY_POINT_NAME_POS + 3] = point_name[3];
+ point_buffer[MEMORY_POINT_NAME_POS + 4] = point_name[4];
+
+ point_buffer[MEMORY_POINT_DAY_POS] = p_gps_raw->date[0]; //save in char format for easy print in the menu
+ point_buffer[MEMORY_POINT_DAY_POS + 1] = p_gps_raw->date[1];
+
+ point_buffer[MEMORY_POINT_MONTH_POS] = p_gps_raw->date[2];
+ point_buffer[MEMORY_POINT_MONTH_POS + 1] = p_gps_raw->date[3];
+
+ point_buffer[MEMORY_POINT_YEAR_POS] = p_gps_raw->date[4];
+ point_buffer[MEMORY_POINT_YEAR_POS + 1] = p_gps_raw->date[5];
+
+ point_buffer[MEMORY_POINT_LATITUDE_POS] = pp_gps_air[dev_num]->latitude.as_array[0];
+ point_buffer[MEMORY_POINT_LATITUDE_POS + 1] = pp_gps_air[dev_num]->latitude.as_array[1];
+ point_buffer[MEMORY_POINT_LATITUDE_POS + 2] = pp_gps_air[dev_num]->latitude.as_array[2];
+ point_buffer[MEMORY_POINT_LATITUDE_POS + 3] = pp_gps_air[dev_num]->latitude.as_array[3];
+
+ point_buffer[MEMORY_POINT_LONGITUDE_POS] = pp_gps_air[dev_num]->longitude.as_array[0];
+ point_buffer[MEMORY_POINT_LONGITUDE_POS + 1] = pp_gps_air[dev_num]->longitude.as_array[1];
+ point_buffer[MEMORY_POINT_LONGITUDE_POS + 2] = pp_gps_air[dev_num]->longitude.as_array[2];
+ point_buffer[MEMORY_POINT_LONGITUDE_POS + 3] = pp_gps_air[dev_num]->longitude.as_array[3];
+
+ point_buffer[MEMORY_POINT_ALTITUDE_POS] = pp_gps_air[dev_num]->altitude.as_array[0];
+ point_buffer[MEMORY_POINT_ALTITUDE_POS + 1] = pp_gps_air[dev_num]->altitude.as_array[1];
+
+ m24c64_write_page(&point_buffer[0], slot_num);
+}
+
+
+
+void load_memory_point(uint8_t dev_num, uint8_t slot_num)
+{
+ clear_point_buffer();
+
+ m24c64_read_page(&point_buffer[0], slot_num);
+
+ memset(pp_gps_air[dev_num], 0, sizeof(*(pp_gps_air[dev_num])));
+ memset(pp_dev_aux[dev_num], 0, sizeof(*(pp_dev_aux[dev_num])));
+
+ pp_dev_aux[dev_num]->exist_flag = 1;
+ pp_dev_aux[dev_num]->memory_point_flag = 1;
+ pp_dev_aux[dev_num]->timestamp = get_uptime();
+
+ for (uint8_t c = 0; c < MEMORY_POINT_NAME_LENGTH; c++)
+ {
+ pp_dev_aux[dev_num]->point_name[c] = memory_slot[slot_num].point_name[c];
+ }
+
+ pp_gps_air[dev_num]->device_id[0] = memory_slot[slot_num].slot_name[0];
+ pp_gps_air[dev_num]->device_id[1] = memory_slot[slot_num].slot_name[1];
+
+ pp_gps_air[dev_num]->latitude.as_array[0] = point_buffer[MEMORY_POINT_LATITUDE_POS];
+ pp_gps_air[dev_num]->latitude.as_array[1] = point_buffer[MEMORY_POINT_LATITUDE_POS + 1];
+ pp_gps_air[dev_num]->latitude.as_array[2] = point_buffer[MEMORY_POINT_LATITUDE_POS + 2];
+ pp_gps_air[dev_num]->latitude.as_array[3] = point_buffer[MEMORY_POINT_LATITUDE_POS + 3];
+
+ pp_gps_air[dev_num]->longitude.as_array[0] = point_buffer[MEMORY_POINT_LONGITUDE_POS];
+ pp_gps_air[dev_num]->longitude.as_array[1] = point_buffer[MEMORY_POINT_LONGITUDE_POS + 1];
+ pp_gps_air[dev_num]->longitude.as_array[2] = point_buffer[MEMORY_POINT_LONGITUDE_POS + 2];
+ pp_gps_air[dev_num]->longitude.as_array[3] = point_buffer[MEMORY_POINT_LONGITUDE_POS + 3];
+
+ pp_gps_air[dev_num]->altitude.as_array[0] = point_buffer[MEMORY_POINT_ALTITUDE_POS];
+ pp_gps_air[dev_num]->altitude.as_array[1] = point_buffer[MEMORY_POINT_ALTITUDE_POS + 1];
+}
+
+
+
+void delete_memory_point(uint8_t slot_num)
+{
+ clear_point_buffer();
+ m24c64_write_page(&point_buffer[0], slot_num);
+}
+
+
+
+void clear_point_buffer(void)
+{
+ for (uint8_t i = 0; i < M24C64_PAGE_SIZE; i++)
+ {
+ point_buffer[i] = M24C64_EMPTY_CELL_VALUE;
+ }
+}
diff --git a/Firmware/CubeIDE/Code/src/service.c b/Firmware/CubeIDE/Code/src/service.c
new file mode 100644
index 0000000..9033f0e
--- /dev/null
+++ b/Firmware/CubeIDE/Code/src/service.c
@@ -0,0 +1,366 @@
+/*
+ ELEPH - Local Relative Navigation System
+
+ Copyright (C) 2021 Feruz Topalov
+ Released under the GNU General Public License v3.0
+
+ file: service.c
+*/
+
+#include
+#include "stm32f10x.h"
+#include "service.h"
+
+
+
+//Convert timeout in seconds to timeout in "XXdXXhXXmXXs"
+void convert_timeout(uint32_t timeout_val, char *buffer)
+{
+ uint32_t sec = 0;
+ uint32_t min = 0;
+ uint32_t hour = 0;
+ uint32_t day = 0;
+ char buf[3];
+
+
+ if (timeout_val >= 60)
+ {
+ min = timeout_val / 60;
+ sec = timeout_val % 60;
+
+ if (min >= 60)
+ {
+ hour = min / 60;
+ min = min % 60;
+
+ if (hour >= 24)
+ {
+ day = hour / 24;
+ hour = hour % 24;
+ }
+ }
+ }
+ else
+ {
+ sec = timeout_val;
+ }
+
+ if (day)
+ {
+ //XXdXXh
+ itoa32(day, &buf[0]);
+ if (day > 9)
+ {
+ buffer[0] = buf[0];
+ buffer[1] = buf[1];
+ buffer[2] = 'd';
+ }
+ else
+ {
+ buffer[0] = '0';
+ buffer[1] = buf[0];
+ buffer[2] = 'd';
+ }
+
+ itoa32(hour, &buf[0]);
+ if (hour > 9)
+ {
+ buffer[3] = buf[0];
+ buffer[4] = buf[1];
+ buffer[5] = 'h';
+ }
+ else
+ {
+ buffer[3] = '0';
+ buffer[4] = buf[0];
+ buffer[5] = 'h';
+ }
+ }
+ else if (hour)
+ {
+ //XXhXXm
+ itoa32(hour, &buf[0]);
+ if (hour > 9)
+ {
+ buffer[0] = buf[0];
+ buffer[1] = buf[1];
+ buffer[2] = 'h';
+ }
+ else
+ {
+ buffer[0] = '0';
+ buffer[1] = buf[0];
+ buffer[2] = 'h';
+ }
+
+ itoa32(min, &buf[0]);
+ if (min > 9)
+ {
+ buffer[3] = buf[0];
+ buffer[4] = buf[1];
+ buffer[5] = 'm';
+ }
+ else
+ {
+ buffer[3] = '0';
+ buffer[4] = buf[0];
+ buffer[5] = 'm';
+ }
+ }
+ else
+ {
+ //XXmXXs
+ itoa32(min, &buf[0]);
+ if (min > 9)
+ {
+ buffer[0] = buf[0];
+ buffer[1] = buf[1];
+ buffer[2] = 'm';
+ }
+ else
+ {
+ buffer[0] = '0';
+ buffer[1] = buf[0];
+ buffer[2] = 'm';
+ }
+
+ itoa32(sec, &buf[0]);
+ if (sec > 9)
+ {
+ buffer[3] = buf[0];
+ buffer[4] = buf[1];
+ buffer[5] = 's';
+ }
+ else
+ {
+ buffer[3] = '0';
+ buffer[4] = buf[0];
+ buffer[5] = 's';
+ }
+ }
+
+ buffer[6] = 0; //string end
+}
+
+
+
+//Simple delay in cycles
+void delay_cyc(uint32_t cycles)
+{
+ while (cycles)
+ {
+ cycles--;
+ }
+}
+
+
+
+//Copy string
+void copy_string(char *from, char *to)
+{
+ while (*from)
+ {
+ *to++ = *from++;
+ }
+ *to = 0; //end terminator
+}
+
+
+
+//Converts string to float
+float atof32(char *input)
+{
+ uint8_t i = 0;
+ int32_t sign = 1;
+ float power = 1.0;
+ float result = 0.0;
+
+ if(input[0] == 0)
+ {
+ return 0.0;
+ }
+
+ if(input[i] == '-')
+ {
+ sign = -1;
+ i++;
+ }
+
+ while(input[i] != '.')
+ {
+ result = result * 10.0 + (input[i] - '0');
+ i++;
+ }
+
+ i++;
+
+ while(input[i] != 0)
+ {
+ result = result * 10.0 + (input[i] - '0');
+ power *= 10.0;
+ i++;
+ }
+
+ return (sign * result / power);
+}
+
+
+
+//Converts float to string
+void ftoa32(float value, uint8_t precision, char *buffer)
+{
+ uint8_t i = 0;
+ uint32_t mod = 0;
+ float pow = 1.0;
+ char sgn = 0;
+ float value_copy;
+
+ if((value == 0.0) || (value == -0.0))
+ {
+ buffer[0] = '0';
+ buffer[1] = 0;
+ return;
+ }
+
+ if(value < 0)
+ {
+ sgn = '-';
+ value *= -1.0;
+ }
+
+ value_copy = value;
+
+ for(uint8_t p = 0; p < precision; p++)
+ {
+ pow = pow * 10.0;
+ }
+
+ value = value * pow;
+ uint32_t ipart = value;
+
+ buffer[i++] = 0;
+
+ do
+ {
+ mod = ipart % 10;
+ ipart /= 10;
+ buffer[i++] = mod + '0';
+ }
+ while(ipart > 0);
+
+ if (value_copy < 1.0)
+ {
+ for(uint8_t p = 0; p < precision; p++)
+ {
+ buffer[i] = '0';
+ i++;
+ }
+ }
+
+ if(sgn == '-')
+ {
+ buffer[i] = sgn;
+ }
+ else
+ {
+ i--;
+ }
+
+ for(uint8_t n = i + 1; n > precision + 1; n--)
+ {
+ buffer[n] = buffer[n - 1];
+ }
+ buffer[precision + 1] = '.';
+ i++;
+
+ char c;
+ for(uint8_t j = 0; j < i; j++, i--)
+ {
+ c = buffer[j];
+ buffer[j] = buffer[i];
+ buffer[i] = c;
+ }
+}
+
+
+
+//Converts string to integer
+int32_t atoi32(char *input)
+{
+ uint8_t i = 0;
+ int32_t sign = 1;
+ int32_t result = 0;
+
+ if(input[0] == 0)
+ {
+ return 0;
+ }
+
+ if((input[0] == '0') && (input[1] == 0))
+ {
+ return 0;
+ }
+
+ if(input[i] == '-')
+ {
+ sign = -1;
+ i++;
+ }
+
+ while(input[i] != 0)
+ {
+ result = result * 10 + (input[i] - '0');
+ i++;
+ }
+
+ return result * sign;
+}
+
+
+
+//Converts integer to string
+void itoa32(int32_t value, char *buffer)
+{
+ uint8_t i = 0;
+ uint8_t mod = 0;
+ char sgn = 0;
+
+ if(value == 0)
+ {
+ buffer[0] = '0';
+ buffer[1] = 0;
+ return;
+ }
+
+ if(value < 0)
+ {
+ sgn = '-';
+ value *= -1;
+ }
+
+ buffer[i++] = 0;
+
+ while(value > 0)
+ {
+ mod = value % 10;
+ value /= 10;
+ buffer[i++] = mod + '0';
+ }
+
+ if(sgn == '-')
+ {
+ buffer[i] = sgn;
+ }
+ else
+ {
+ i--;
+ }
+
+ char c;
+ for(uint8_t j = 0; j < i; j++, i--)
+ {
+ c = buffer[j];
+ buffer[j] = buffer[i];
+ buffer[i] = c;
+ }
+}
diff --git a/Firmware/CubeIDE/Code/src/settings.c b/Firmware/CubeIDE/Code/src/settings.c
new file mode 100644
index 0000000..fd07d65
--- /dev/null
+++ b/Firmware/CubeIDE/Code/src/settings.c
@@ -0,0 +1,174 @@
+/*
+ ELEPH - Local Relative Navigation System
+
+ Copyright (C) 2021 Feruz Topalov
+ Released under the GNU General Public License v3.0
+
+ file: m24c64.c
+*/
+
+#include "stm32f10x.h"
+#include "main.h"
+#include "settings.h"
+#include "m24c64.h"
+#include "si4463.h"
+
+
+
+#define SEND_INTERVAL_1S_VALUE (1)
+#define SEND_INTERVAL_5S_VALUE (5)
+#define SEND_INTERVAL_10S_VALUE (10)
+#define SEND_INTERVAL_30S_VALUE (30)
+#define SEND_INTERVAL_60S_VALUE (60)
+
+#define SEND_INTERVAL_VALUES_ARRAY { SEND_INTERVAL_1S_VALUE, \
+ SEND_INTERVAL_5S_VALUE, \
+ SEND_INTERVAL_10S_VALUE, \
+ SEND_INTERVAL_30S_VALUE, \
+ SEND_INTERVAL_60S_VALUE }
+
+
+
+#define TX_POWER_10MILLIW_VALUE (10)
+#define TX_POWER_25MILLIW_VALUE (25)
+#define TX_POWER_40MILLIW_VALUE (40)
+#define TX_POWER_100MILLIW_VALUE (100)
+
+#define TX_POWER_VALUES_ARRAY { TX_POWER_10MILLIW_VALUE, \
+ TX_POWER_25MILLIW_VALUE, \
+ TX_POWER_40MILLIW_VALUE, \
+ TX_POWER_100MILLIW_VALUE }
+
+
+
+#define EEPROM_SETTINGS_PAGE_ADDRESS (0)
+
+
+
+//positions:
+#define SETTINGS_INIT_FLAG_POS (0)
+#define SETTINGS_DEVICE_NUMBER_POS (1)
+#define SETTINGS_DEVICE_ID_POS (2)
+#define SETTINGS_FREQ_CHANNEL_POS (4)
+#define SETTINGS_TX_POWER_POS (5)
+#define SETTINGS_SEND_INTERVAL_POS (6)
+#define SETTINGS_TIMEOUT_THRESHOLD_POS (7)
+#define SETTINGS_FENCE_THRESHOLD_POS (9)
+
+//default values:
+#define SETTINGS_INIT_FLAG_DEFAULT (0xAA)
+#define SETTINGS_DEVICE_NUMBER_DEFAULT (1)
+#define SETTINGS_DEVICE_ID_0_DEFAULT ('I')
+#define SETTINGS_DEVICE_ID_1_DEFAULT ('D')
+#define SETTINGS_FREQ_CHANNEL_DEFAULT (1) //base freq is 433.050 and freq step is 25kHz, so CH0 - 433.050 (not valid, not used); CH1 - 433.075 (first LPD channel)
+#define SETTINGS_TX_POWER_DEFAULT (TX_POWER_10MILLIW_SETTING)
+#define SETTINGS_SEND_INTERVAL_DEFAULT (SEND_INTERVAL_1S_SETTING)
+#define SETTINGS_TIMEOUT_THRESHOLD_DEFAULT (60)
+#define SETTINGS_FENCE_THRESHOLD_DEFAULT (100)
+
+
+
+uint8_t settings_array[M24C64_PAGE_SIZE];
+struct settings_struct settings;
+uint8_t send_interval_values[] = SEND_INTERVAL_VALUES_ARRAY;
+uint8_t tx_power_values[] = TX_POWER_VALUES_ARRAY;
+
+
+
+uint8_t *get_send_interval_values(void)
+{
+ return &send_interval_values[0];
+}
+
+
+
+uint8_t *get_tx_power_values(void)
+{
+ return &tx_power_values[0];
+}
+
+
+
+struct settings_struct *get_settings(void)
+{
+ return &settings;
+}
+
+
+
+void settings_load(void)
+{
+ uint16_t init_flag_addr = EEPROM_SETTINGS_PAGE_ADDRESS * M24C64_PAGE_SIZE + SETTINGS_INIT_FLAG_POS;
+
+ if (m24c64_read_byte(init_flag_addr) != SETTINGS_INIT_FLAG_DEFAULT) //if first power-up or EEPROM had been erased
+ {
+ settings_save_default();
+ }
+
+ //read from EEPROM
+ m24c64_read_page(&settings_array[0], EEPROM_SETTINGS_PAGE_ADDRESS);
+
+ //load settings to struct
+ settings.device_number = settings_array[SETTINGS_DEVICE_NUMBER_POS];
+ settings.device_id[0] = settings_array[SETTINGS_DEVICE_ID_POS];
+ settings.device_id[1] = settings_array[SETTINGS_DEVICE_ID_POS + 1];
+ settings.freq_channel = settings_array[SETTINGS_FREQ_CHANNEL_POS];
+ settings.tx_power_opt = settings_array[SETTINGS_TX_POWER_POS];
+ settings.send_interval_opt = settings_array[SETTINGS_SEND_INTERVAL_POS];
+ settings.timeout_threshold.as_array[0] = settings_array[SETTINGS_TIMEOUT_THRESHOLD_POS];
+ settings.timeout_threshold.as_array[1] = settings_array[SETTINGS_TIMEOUT_THRESHOLD_POS + 1];
+ settings.fence_threshold.as_array[0] = settings_array[SETTINGS_FENCE_THRESHOLD_POS];
+ settings.fence_threshold.as_array[1] = settings_array[SETTINGS_FENCE_THRESHOLD_POS + 1];
+}
+
+
+
+void settings_save_default(void)
+{
+ for (uint8_t i = 0; i < M24C64_PAGE_SIZE; i++)
+ {
+ settings_array[i] = M24C64_EMPTY_CELL_VALUE; //clear array
+ }
+
+ //assign default values
+ settings_array[SETTINGS_INIT_FLAG_POS] = SETTINGS_INIT_FLAG_DEFAULT;
+ settings_array[SETTINGS_DEVICE_NUMBER_POS] = SETTINGS_DEVICE_NUMBER_DEFAULT;
+ settings_array[SETTINGS_DEVICE_ID_POS] = SETTINGS_DEVICE_ID_0_DEFAULT;
+ settings_array[SETTINGS_DEVICE_ID_POS + 1] = SETTINGS_DEVICE_ID_1_DEFAULT;
+ settings_array[SETTINGS_FREQ_CHANNEL_POS] = SETTINGS_FREQ_CHANNEL_DEFAULT;
+ settings_array[SETTINGS_TX_POWER_POS] = SETTINGS_TX_POWER_DEFAULT;
+ settings_array[SETTINGS_SEND_INTERVAL_POS] = SETTINGS_SEND_INTERVAL_DEFAULT;
+ settings_array[SETTINGS_TIMEOUT_THRESHOLD_POS] = (uint8_t)((uint8_t)0xFF & (uint16_t)SETTINGS_TIMEOUT_THRESHOLD_DEFAULT); //note: little-endian assumed
+ settings_array[SETTINGS_TIMEOUT_THRESHOLD_POS + 1]= (uint8_t)((uint8_t)0xFF & ((uint16_t)SETTINGS_TIMEOUT_THRESHOLD_DEFAULT >> 8));
+ settings_array[SETTINGS_FENCE_THRESHOLD_POS] = (uint8_t)((uint8_t)0xFF & (uint16_t)SETTINGS_FENCE_THRESHOLD_DEFAULT); //note: little-endian assumed
+ settings_array[SETTINGS_FENCE_THRESHOLD_POS + 1] = (uint8_t)((uint8_t)0xFF & ((uint16_t)SETTINGS_FENCE_THRESHOLD_DEFAULT >> 8));
+
+ //write to EEPROM
+ m24c64_write_page(&settings_array[0], EEPROM_SETTINGS_PAGE_ADDRESS);
+}
+
+
+
+void settings_save(struct settings_struct *p_settings)
+{
+ for (uint8_t i = 0; i < M24C64_PAGE_SIZE; i++)
+ {
+ settings_array[i] = M24C64_EMPTY_CELL_VALUE; //clear array
+ }
+
+ //assign values
+ settings_array[SETTINGS_INIT_FLAG_POS] = SETTINGS_INIT_FLAG_DEFAULT;
+ settings_array[SETTINGS_DEVICE_NUMBER_POS] = p_settings->device_number;
+ settings_array[SETTINGS_DEVICE_ID_POS] = p_settings->device_id[0];
+ settings_array[SETTINGS_DEVICE_ID_POS + 1] = p_settings->device_id[1];
+ settings_array[SETTINGS_FREQ_CHANNEL_POS] = p_settings->freq_channel;
+ settings_array[SETTINGS_TX_POWER_POS] = p_settings->tx_power_opt;
+ settings_array[SETTINGS_SEND_INTERVAL_POS] = p_settings->send_interval_opt;
+ settings_array[SETTINGS_TIMEOUT_THRESHOLD_POS] = p_settings->timeout_threshold.as_array[0];
+ settings_array[SETTINGS_TIMEOUT_THRESHOLD_POS + 1]= p_settings->timeout_threshold.as_array[1];
+ settings_array[SETTINGS_FENCE_THRESHOLD_POS] = p_settings->fence_threshold.as_array[0];
+ settings_array[SETTINGS_FENCE_THRESHOLD_POS + 1] = p_settings->fence_threshold.as_array[1];
+
+ //write to EEPROM
+ m24c64_write_page(&settings_array[0], EEPROM_SETTINGS_PAGE_ADDRESS);
+}
diff --git a/Firmware/CubeIDE/Code/src/si4463.c b/Firmware/CubeIDE/Code/src/si4463.c
new file mode 100644
index 0000000..11a9c7d
--- /dev/null
+++ b/Firmware/CubeIDE/Code/src/si4463.c
@@ -0,0 +1,275 @@
+/*
+ ELEPH - Local Relative Navigation System
+
+ Copyright (C) 2021 Feruz Topalov
+ Released under the GNU General Public License v3.0
+
+ file: si4463.c
+*/
+
+#include "stm32f10x.h"
+#include "si4463.h"
+#include "radio_config_Si4463.h"
+#include "gpio.h"
+#include "spi.h"
+#include "service.h"
+#include "main.h"
+#include "settings.h"
+
+
+
+void si4463_wait_cts(void);
+void si4463_set_packet_len(uint8_t packet_len);
+void si4463_set_tx_power(uint8_t tx_pow_reg_val);
+
+
+
+#define SI4463_BYTE_DUMMY (0x00)
+#define SI4463_CMD_FIFO_INFO (0x15)
+#define SI4463_CMD_WRITE_TX_FIFO (0x66)
+#define SI4463_CMD_READ_RX_FIFO (0x77)
+#define SI4463_CMD_START_TX (0x31)
+#define SI4463_CMD_START_RX (0x32)
+#define SI4463_CMD_CHANGE_STATE (0x34)
+#define SI4463_CMD_GET_PH_STATUS (0x21)
+#define SI4463_CMD_READ_CMD_BUF (0x44)
+#define SI4463_CMD_SET_PROPERTY (0x11)
+
+#define SI4463_FIFO_INFO_TX_BIT (0x01)
+#define SI4463_FIFO_INFO_RX_BIT (0x02)
+#define SI4463_PH_PEND_CRC_ERROR_BIT (0x08)
+#define SI4463_PH_PEND_PACKET_RX_BIT (0x10)
+
+#define SI4463_NOCHANGE_STATE (0x00)
+#define SI4463_SLEEP_STATE (0x01)
+#define SI4463_READY_STATE (0x03)
+
+#define SI4463_PKT_FIELD_1_LENGTH_GROUP_ID (0x12)
+#define SI4463_PKT_FIELD_1_LENGTH_NUM_PROPS (0x02)
+#define SI4463_PKT_FIELD_1_LENGTH_START_PROP (0x0D)
+
+#define SI4463_PA_PWR_LVL_GROUP_ID (0x22)
+#define SI4463_PA_PWR_LVL_NUM_PROPS (0x01)
+#define SI4463_PA_PWR_LVL_START_PROP (0x01)
+
+#define TX_POWER_10MILLIW_REGISTER_VALUE (20) //see datasheet graph
+#define TX_POWER_25MILLIW_REGISTER_VALUE (30)
+#define TX_POWER_40MILLIW_REGISTER_VALUE (40)
+#define TX_POWER_100MILLIW_REGISTER_VALUE (127)
+
+#define TX_POWER_REGISTER_VALUES_ARRAY { TX_POWER_10MILLIW_REGISTER_VALUE, \
+ TX_POWER_25MILLIW_REGISTER_VALUE, \
+ TX_POWER_40MILLIW_REGISTER_VALUE, \
+ TX_POWER_100MILLIW_REGISTER_VALUE }
+
+#define AIR_PACKET_LEN (17) //bytes amount to tx/rx over air; does not include two bytes of CRC (refer to "radio_config_Si4463.h")
+
+
+
+uint8_t air_packet_tx[AIR_PACKET_LEN];
+uint8_t air_packet_rx[AIR_PACKET_LEN];
+struct settings_struct *p_settings;
+uint8_t tx_power_register_values[] = TX_POWER_REGISTER_VALUES_ARRAY;
+
+
+
+//SI4463 Init
+void si4463_init(void)
+{
+ cs_si4463_inactive(); //set pins initial state
+ sdn_si4463_inactive();
+ delay_cyc(1000000);
+
+ sdn_si4463_active(); //reset the chip
+ delay_cyc(1000000);
+ sdn_si4463_inactive();
+
+ uint8_t init_arr[] = RADIO_CONFIGURATION_DATA_ARRAY; //array with init data, generated by WDS software
+ uint8_t *p_init_arr = &init_arr[0]; //pointer to the array
+
+ //Send all commands while pointer not equal 0x00 (0x00 presented in the end of the configuration array)
+ while(*p_init_arr != 0x00)
+ {
+ uint8_t len = *p_init_arr; //command len (first byte of the each line in configuration array)
+ p_init_arr++; //move pointer to the first data byte (which is next after the command len)
+
+ si4463_wait_cts(); //check cts before any command
+ cs_si4463_active();
+ for(uint8_t i = 0; i < len; i++)
+ {
+ spi1_trx(*p_init_arr); //send command byte
+ p_init_arr++; //move pointer to the next byte in command
+ }
+ cs_si4463_inactive();
+ }
+
+ //Set len of the packet
+ si4463_set_packet_len(AIR_PACKET_LEN);
+
+ //Get current settings
+ p_settings = get_settings();
+
+ //Set TX power
+ si4463_set_tx_power(tx_power_register_values[p_settings->tx_power_opt]);
+}
+
+
+
+//Wait for hardware CTS pin
+void si4463_wait_cts(void)
+{
+ while(!(GPIOA->IDR & GPIO_IDR_IDR12)){} //while GPIO1 = 0
+}
+
+
+
+//Set air packet length
+void si4463_set_packet_len(uint8_t packet_len)
+{
+ si4463_wait_cts();
+ cs_si4463_active();
+ spi1_trx(SI4463_CMD_SET_PROPERTY);
+ spi1_trx(SI4463_PKT_FIELD_1_LENGTH_GROUP_ID);
+ spi1_trx(SI4463_PKT_FIELD_1_LENGTH_NUM_PROPS);
+ spi1_trx(SI4463_PKT_FIELD_1_LENGTH_START_PROP);
+ spi1_trx(0x00); //packet len high byte
+ spi1_trx(packet_len); //packet len low byte
+ cs_si4463_inactive();
+}
+
+
+
+void si4463_set_tx_power(uint8_t tx_pow_reg_val)
+{
+ si4463_wait_cts();
+ cs_si4463_active();
+ spi1_trx(SI4463_CMD_SET_PROPERTY);
+ spi1_trx(SI4463_PA_PWR_LVL_GROUP_ID);
+ spi1_trx(SI4463_PA_PWR_LVL_NUM_PROPS);
+ spi1_trx(SI4463_PA_PWR_LVL_START_PROP);
+ spi1_trx(tx_pow_reg_val);
+ cs_si4463_inactive();
+}
+
+
+
+//SI4463 TX packet
+void si4463_tx_packet(void)
+{
+ //reset TX FIFO
+ si4463_wait_cts();
+ cs_si4463_active();
+ spi1_trx(SI4463_CMD_FIFO_INFO);
+ spi1_trx(SI4463_FIFO_INFO_TX_BIT);
+ cs_si4463_inactive();
+
+ //fill TX FIFO buffer
+ si4463_wait_cts();
+ cs_si4463_active();
+ spi1_trx(SI4463_CMD_WRITE_TX_FIFO);
+ for (uint8_t i = 0; i < AIR_PACKET_LEN; i++)
+ {
+ spi1_trx(air_packet_tx[i]);
+ }
+ cs_si4463_inactive();
+
+ //start TX
+ si4463_wait_cts();
+ cs_si4463_active();
+ spi1_trx(SI4463_CMD_START_TX);
+ spi1_trx(p_settings->freq_channel); //frequency channel
+ spi1_trx(SI4463_SLEEP_STATE << 4); //return to sleep state, send FIFO content, start TX immediately
+ spi1_trx(0x00); //the number of data bytes to be transmitted
+ spi1_trx(0x00); //is specified by the value(s) of the PKT_FIELD_X_LENGTH properties
+ cs_si4463_inactive();
+}
+
+
+
+//SI4463 start packet RX
+void si4463_start_rx(void)
+{
+ si4463_wait_cts();
+ cs_si4463_active();
+ spi1_trx(SI4463_CMD_START_RX);
+ spi1_trx(p_settings->freq_channel); //frequency channel
+ spi1_trx(0x00); //start RX immediately
+ spi1_trx(0x00); //RX packet len is specified
+ spi1_trx(0x00); //in packet handler configuration
+ spi1_trx(SI4463_SLEEP_STATE); //if RX timeout then go to sleep (after RX_PREAMBLE_TIMEOUT)
+ spi1_trx(SI4463_SLEEP_STATE); //if RX valid then go to sleep
+ spi1_trx(SI4463_SLEEP_STATE); //if RX invalid then go to sleep
+ cs_si4463_inactive();
+}
+
+
+
+//SI4463 get received packet
+uint8_t si4463_get_rx_packet(void)
+{
+ uint8_t ph_pending = 0;
+
+ //send get PH status command
+ si4463_wait_cts();
+ cs_si4463_active();
+ spi1_trx(SI4463_CMD_GET_PH_STATUS);
+ spi1_trx(SI4463_BYTE_DUMMY); //also clear all pending interrupts
+ cs_si4463_inactive();
+
+ //retrieve response
+ si4463_wait_cts();
+ cs_si4463_active();
+ spi1_trx(SI4463_CMD_READ_CMD_BUF);
+ spi1_trx(SI4463_BYTE_DUMMY); //skip CTS byte
+ ph_pending = spi1_trx(SI4463_BYTE_DUMMY);
+ cs_si4463_inactive();
+
+ if (ph_pending & SI4463_PH_PEND_CRC_ERROR_BIT)
+ {
+ si4463_wait_cts(); //clear RX FIFO content
+ cs_si4463_active();
+ spi1_trx(SI4463_CMD_FIFO_INFO);
+ spi1_trx(SI4463_FIFO_INFO_RX_BIT);
+ cs_si4463_inactive();
+
+ si4463_wait_cts(); //workaround if received packet has CRC error (see si4463 revB1 errata)
+ cs_si4463_active();
+ spi1_trx(SI4463_CMD_CHANGE_STATE);
+ spi1_trx(SI4463_SLEEP_STATE);
+ cs_si4463_inactive();
+
+ return 0;
+ }
+ else if (ph_pending & SI4463_PH_PEND_PACKET_RX_BIT)
+ {
+ //read RX FIFO buffer
+ si4463_wait_cts();
+ cs_si4463_active();
+ spi1_trx(SI4463_CMD_READ_RX_FIFO);
+ for (uint8_t i = 0; i < AIR_PACKET_LEN; i++)
+ {
+ air_packet_rx[i] = spi1_trx(SI4463_BYTE_DUMMY);
+ }
+ cs_si4463_inactive();
+
+ return 1;
+ }
+ else
+ {
+ return 0;
+ }
+}
+
+
+
+uint8_t *get_air_packet_tx(void)
+{
+ return &air_packet_tx[0];
+}
+
+
+
+uint8_t *get_air_packet_rx(void)
+{
+ return &air_packet_rx[0];
+}
diff --git a/Firmware/CubeIDE/Code/src/spi.c b/Firmware/CubeIDE/Code/src/spi.c
new file mode 100644
index 0000000..ef1796a
--- /dev/null
+++ b/Firmware/CubeIDE/Code/src/spi.c
@@ -0,0 +1,68 @@
+/*
+ ELEPH - Local Relative Navigation System
+
+ Copyright (C) 2021 Feruz Topalov
+ Released under the GNU General Public License v3.0
+
+ file: spi.c
+*/
+
+#include "stm32f10x.h"
+#include "spi.h"
+
+
+
+//Init SPI1
+void spi1_init(void)
+{
+ RCC->APB2ENR |= RCC_APB2ENR_SPI1EN; //enable clock spi1
+ RCC->APB2ENR |= RCC_APB2ENR_AFIOEN; //enable alternate function clock
+ AFIO->MAPR |= AFIO_MAPR_SPI1_REMAP; //remap spi
+ AFIO->MAPR |= AFIO_MAPR_SWJ_CFG_JTAGDISABLE; //disable JTAG
+ SPI1->CR1 &= ~SPI_CR1_BR; //clock/2
+ SPI1->CR1 |= SPI_CR1_SSM;
+ SPI1->CR1 |= SPI_CR1_SSI;
+ SPI1->CR1 |= SPI_CR1_MSTR; //master mode
+ SPI1->CR1 &= ~SPI_CR1_CPOL; //SCK = 0 in IDLE
+ SPI1->CR1 &= ~SPI_CR1_CPHA; //first rising edge capture
+ SPI1->CR1 |= SPI_CR1_SPE; //enable spi
+}
+
+
+
+//Init SPI2
+void spi2_init(void)
+{
+ RCC->APB1ENR |= RCC_APB1ENR_SPI2EN; //enable clock spi2
+ SPI2->CR1 &= ~SPI_CR1_BR; //clock/2
+ SPI2->CR1 |= SPI_CR1_SSM;
+ SPI2->CR1 |= SPI_CR1_SSI;
+ SPI2->CR1 |= SPI_CR1_MSTR; //master mode
+ SPI2->CR1 &= ~SPI_CR1_CPOL; //SCK = 0 in IDLE
+ SPI2->CR1 &= ~SPI_CR1_CPHA; //first rising edge capture
+ SPI2->CR1 |= SPI_CR1_SPE; //enable spi
+}
+
+
+
+//TRX one byte via SPI1
+uint8_t spi1_trx(uint8_t send_data)
+{
+ while(!(SPI1->SR & SPI_SR_TXE)){} //while TXE bit = 0
+ SPI1->DR = send_data;
+
+ while(!(SPI1->SR & SPI_SR_RXNE)){} //while RXNE = 0
+ return SPI1->DR;
+}
+
+
+
+//TRX one byte via SPI2
+uint8_t spi2_trx(uint8_t send_data)
+{
+ while (!(SPI2->SR & SPI_SR_TXE)){} //while TXE bit = 0
+ SPI2->DR = send_data;
+
+ while (!(SPI2->SR & SPI_SR_RXNE)){} //while RXNE = 0
+ return SPI2->DR;
+}
diff --git a/Firmware/CubeIDE/Code/src/ssd1306.c b/Firmware/CubeIDE/Code/src/ssd1306.c
new file mode 100644
index 0000000..25ae97a
--- /dev/null
+++ b/Firmware/CubeIDE/Code/src/ssd1306.c
@@ -0,0 +1,236 @@
+/*
+ ELEPH - Local Relative Navigation System
+
+ Copyright (C) 2021 Feruz Topalov
+ Released under the GNU General Public License v3.0
+
+ file: ssd1306.c
+*/
+
+#include "stm32f10x.h"
+#include "ssd1306.h"
+#include "ssd1306_font6x8.h"
+#include "gpio.h"
+#include "spi.h"
+#include "service.h"
+
+
+
+#define LCD_SIZE_BYTES (1024)
+#define LCD_SIZE_X (128)
+#define LCD_SIZE_Y (64)
+#define FONT_SIZE_X (6)
+#define FONT_SIZE_Y (8)
+
+
+
+uint8_t screen_buf[LCD_SIZE_BYTES]; //public array 128x64 pixels
+uint16_t buf_pos = 0; //public var 0 - 1023
+
+
+
+//SSD1306 init sequence (first byte in line = amount of config bytes in line)
+const uint8_t ssd1306_conf[] =
+{
+ 0x02, 0x20, 0x00, /* horizontal adressing */ \
+ 0x02, 0xA1, 0xC8, /* invert orientation */ \
+ 0x03, 0x8D, 0x14, 0xAF, /* enable charge pump and display */ \
+ 0x00 /* end of the sequence */
+};
+
+
+
+//SSD1306 Init
+void ssd1306_init(void)
+{
+ cs_ssd1306_inactive(); //ports init state
+ res_ssd1306_inactive();
+ ssd1306_command_mode();
+ delay_cyc(100000);
+
+ res_ssd1306_active(); //reset ssd1306
+ delay_cyc(100000);
+ res_ssd1306_inactive();
+ delay_cyc(100000);
+
+ uint8_t i = 0;
+ uint8_t len = 0;
+ while (ssd1306_conf[i] != 0x00)
+ {
+ len = ssd1306_conf[i++];
+
+ cs_ssd1306_active();
+ while (len--)
+ {
+ spi2_trx(ssd1306_conf[i++]);
+ }
+ cs_ssd1306_inactive();
+ }
+
+ ssd1306_clear();
+ ssd1306_update();
+}
+
+
+
+//Update screen with buffer content
+void ssd1306_update(void)
+{
+ ssd1306_data_mode();
+ cs_ssd1306_active();
+ for (uint16_t i = 0; i < LCD_SIZE_BYTES; i++)
+ {
+ spi2_trx(screen_buf[i]);
+ }
+ cs_ssd1306_inactive();
+}
+
+
+
+//Fill all screen pixels
+void ssd1306_fill(void)
+{
+ for (uint16_t i = 0; i < LCD_SIZE_BYTES; i++)
+ {
+ screen_buf[i] = 0xFF;
+ }
+}
+
+
+
+//Clear all screen pixels
+void ssd1306_clear(void)
+{
+ for (uint16_t i = 0; i < LCD_SIZE_BYTES; i++)
+ {
+ screen_buf[i] = 0x00;
+ }
+}
+
+
+
+//Clear, Set or Reset any pixel on the screen (x 0-127, y 0-63)
+void ssd1306_pixel(uint8_t x, uint8_t y, int8_t action)
+{
+ switch (action)
+ {
+ case 0: //clear pixel
+ screen_buf[x + (y / 8) * LCD_SIZE_X] &= ~(1 << (y % 8));
+ break;
+ case 1: //set pixel
+ screen_buf[x + (y / 8) * LCD_SIZE_X] |= 1 << (y % 8);
+ break;
+ default: //invert pixel
+ screen_buf[x + (y / 8) * LCD_SIZE_X] ^= 1 << (y % 8);
+ break;
+ }
+}
+
+
+
+//Set character position on screen (rows 0-7, cols 0-20)
+void ssd1306_pos(uint8_t row, uint8_t col)
+{
+ buf_pos = (row * 21 + col) * FONT_SIZE_X + 2 * row; //+2 bytes, because 128 - 21 * 6 = 2
+}
+
+
+
+//Put one char in buffer in position, defined previously via ssd1306_pos()
+void ssd1306_char(char chr, uint8_t inv)
+{
+ if (inv)
+ {
+ inv = 0xFF;
+ }
+ else
+ {
+ inv = 0x00;
+ }
+
+ for (uint8_t i = 0; i < FONT_SIZE_X - 1; i++)
+ {
+ screen_buf[buf_pos++] = font[(uint8_t)chr][i] ^ inv;
+ }
+ screen_buf[buf_pos++] = 0x00 ^ inv; //intercharacter space
+}
+
+
+
+//Put one char in defined pos
+void ssd1306_char_pos(uint8_t row, uint8_t col, char chr, uint8_t inv)
+{
+ ssd1306_pos(row, col);
+ ssd1306_char(chr, inv);
+}
+
+
+
+//Print string on screen (with position)
+void ssd1306_print(uint8_t row, uint8_t col, char *p_str, uint8_t inv)
+{
+ ssd1306_pos(row, col);
+
+ while (*p_str)
+ {
+ ssd1306_char(*p_str++, inv);
+ }
+}
+
+
+
+//Print string on screen (with position) in viceversa direction (decrease collumn)
+void ssd1306_print_viceversa(uint8_t row, uint8_t col, char *p_str, uint8_t inv)
+{
+ uint8_t symb_cntr = 0;
+
+ ssd1306_pos(row, col);
+
+ while (*p_str)
+ {
+ p_str++;
+ symb_cntr++;
+ }
+
+ while (symb_cntr)
+ {
+ symb_cntr--;
+ ssd1306_char(*--p_str, inv);
+ buf_pos -= 2 * FONT_SIZE_X; //minus two characters position
+ }
+}
+
+
+
+//Print string on screen
+void ssd1306_print_next(char *p_str, uint8_t inv)
+{
+ while (*p_str)
+ {
+ ssd1306_char(*p_str++, inv);
+ }
+}
+
+
+
+//Show bitmap
+void ssd1306_bitmap(const uint8_t arr[])
+{
+ for (uint16_t i = 0; i < LCD_SIZE_BYTES; i++)
+ {
+ screen_buf[i] = arr[i];
+ }
+}
+
+
+
+//Print byte on screen (debug function)
+void ssd1306_print_byte(uint8_t row, uint8_t col, uint8_t *p_byte, uint8_t amount)
+{
+ ssd1306_pos(row, col);
+
+ while (amount--)
+ {
+ screen_buf[buf_pos++] = *p_byte++;
+ }
+}
diff --git a/Firmware/CubeIDE/Code/src/ssd1306_bitmaps.c b/Firmware/CubeIDE/Code/src/ssd1306_bitmaps.c
new file mode 100644
index 0000000..3a8a997
--- /dev/null
+++ b/Firmware/CubeIDE/Code/src/ssd1306_bitmaps.c
@@ -0,0 +1,538 @@
+/*
+ ELEPH - Local Relative Navigation System
+
+ Copyright (C) 2021 Feruz Topalov
+ Released under the GNU General Public License v3.0
+
+ file: ssd1306_bitmaps.c
+*/
+
+#include "stm32f10x.h"
+
+
+
+const uint8_t startup_screen[1024] =
+{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x81, 0xFF,
+ 0x89, 0x9D, 0x81, 0xC3, 0x00, 0x00, 0x81, 0xFF,
+ 0x81, 0x80, 0xE0, 0x00, 0x81, 0xFF, 0x89, 0x9D,
+ 0x81, 0xC3, 0x00, 0x00, 0x81, 0xFF, 0x91, 0x11,
+ 0x0E, 0x00, 0x81, 0xFF, 0x89, 0x08, 0x89, 0xFF,
+ 0x81, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x80, 0xC0, 0x60, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x60, 0x30, 0x10, 0x18, 0x08, 0x08, 0x08,
+ 0x08, 0x08, 0x18, 0x10, 0x30, 0x60, 0x40, 0x60,
+ 0x20, 0x20, 0x20, 0x20, 0x60, 0xC0, 0x80, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8,
+ 0x0F, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00,
+ 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x03,
+ 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
+ 0x0F, 0x18, 0x30, 0x40, 0xC0, 0x80, 0x80, 0x80,
+ 0x80, 0xC0, 0xE0, 0x80, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0xC0, 0x80,
+ 0x80, 0x80, 0x80, 0x80, 0x80, 0xC0, 0x60, 0x38,
+ 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08,
+ 0x0C, 0x06, 0x03, 0x03, 0x06, 0x3C, 0xE0, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0xFF, 0x03, 0x06, 0x04,
+ 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0xB0,
+ 0x90, 0x70, 0x10, 0x10, 0x10, 0x10, 0x10, 0x30,
+ 0x20, 0x30, 0x10, 0x18, 0x08, 0x0E, 0x03, 0x80,
+ 0xC0, 0x60, 0x30, 0x1C, 0x07, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
+ 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
+ 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
+
+
+
+const uint8_t devices_blank[1024] =
+{ 0x7F, 0x6B, 0x41, 0x6B, 0x41, 0x6B, 0x7F, 0x00,
+ 0x00, 0x00, 0x00, 0x7F, 0x5D, 0x5D, 0x41, 0x5D,
+ 0x5D, 0x7F, 0x41, 0x5D, 0x5D, 0x5D, 0x63, 0x7F,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0x51, 0x55,
+ 0x55, 0x55, 0x45, 0x7F, 0x41, 0x5D, 0x5D, 0x5D,
+ 0x41, 0x7F, 0x41, 0x5D, 0x5D, 0x55, 0x45, 0x7F,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0x41, 0x5D,
+ 0x5D, 0x5D, 0x5D, 0x7F, 0x41, 0x5D, 0x5D, 0x5D,
+ 0x41, 0x7F, 0x41, 0x5D, 0x5D, 0x55, 0x45, 0x7F,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0x43, 0x75,
+ 0x75, 0x75, 0x43, 0x7F, 0x43, 0x75, 0x75, 0x75,
+ 0x43, 0x7F, 0x41, 0x5F, 0x5F, 0x5F, 0x5F, 0x7F,
+ 0x7D, 0x7D, 0x41, 0x7D, 0x7D, 0x7F, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x7F, 0x6B, 0x41, 0x6B, 0x41, 0x6B, 0x7F, 0x00,
+ 0x00, 0x00, 0x00, 0x7F, 0x5D, 0x5D, 0x41, 0x5D,
+ 0x5D, 0x7F, 0x41, 0x5D, 0x5D, 0x5D, 0x63, 0x7F,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0x41, 0x5D,
+ 0x5D, 0x5D, 0x63, 0x7F, 0x51, 0x55, 0x55, 0x55,
+ 0x45, 0x7F, 0x7D, 0x7D, 0x41, 0x7D, 0x7D, 0x7F,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0x41, 0x55,
+ 0x55, 0x55, 0x6B, 0x7F, 0x41, 0x6D, 0x6D, 0x6D,
+ 0x53, 0x7F, 0x41, 0x5D, 0x5D, 0x55, 0x45, 0x7F,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0x41, 0x5D,
+ 0x5D, 0x5D, 0x63, 0x7F, 0x43, 0x75, 0x75, 0x75,
+ 0x43, 0x7F, 0x41, 0x5F, 0x5F, 0x5F, 0x5F, 0x7F,
+ 0x7D, 0x7D, 0x41, 0x7D, 0x7D, 0x7F, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
+
+
+
+const uint8_t radar_blank[1024] =
+{ 0x00, 0x00, 0x7F, 0x41, 0x5D, 0x5D, 0x5D, 0x5D,
+ 0x7F, 0x41, 0x5D, 0x5D, 0x5D, 0x41, 0x7F, 0x41,
+ 0x5D, 0x5D, 0x55, 0x45, 0x7F, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0xFE, 0x02, 0x02, 0x02, 0x02, 0x02,
+ 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
+ 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
+ 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
+ 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02,
+ 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0xFE, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0x6B, 0x41,
+ 0x6B, 0x41, 0x6B, 0x7F, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x7F, 0x5D, 0x5D, 0x41, 0x5D, 0x5D, 0x7F,
+ 0x41, 0x5D, 0x5D, 0x5D, 0x63, 0x7F, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x7F, 0x41, 0x5D, 0x5D, 0x5D,
+ 0x63, 0x7F, 0x51, 0x55, 0x55, 0x55, 0x45, 0x7F,
+ 0x7D, 0x7D, 0x41, 0x7D, 0x7D, 0x7F, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x7F, 0x41, 0x55, 0x55, 0x55,
+ 0x6B, 0x7F, 0x41, 0x6D, 0x6D, 0x6D, 0x53, 0x7F,
+ 0x41, 0x5D, 0x5D, 0x55, 0x45, 0x7F, 0x00, 0x00,
+ 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x3F, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x3F, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x7F, 0x41, 0x6D, 0x6D, 0x6D, 0x53,
+ 0x7F, 0x41, 0x7B, 0x77, 0x6F, 0x41, 0x7F, 0x41,
+ 0x5D, 0x5D, 0x55, 0x45, 0x7F, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
+
+
+
+const uint8_t info_blank[1024] =
+{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0,
+ 0x30, 0x18, 0x0C, 0x04, 0x04, 0x04, 0x04, 0x04,
+ 0x0C, 0x06, 0x02, 0x03, 0x01, 0x01, 0x01, 0x01,
+ 0x01, 0x03, 0x02, 0x06, 0x0C, 0x08, 0x0C, 0x04,
+ 0x04, 0x04, 0x04, 0x0C, 0x18, 0x30, 0x60, 0xC0,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0xE1,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x03, 0x03, 0x00, 0x00, 0x00, 0x00,
+ 0x03, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
+ 0x03, 0x06, 0x08, 0x18, 0x10, 0x10, 0x10, 0x90,
+ 0xD8, 0x7C, 0x70, 0xC0, 0x80, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0xF0, 0x70, 0xD8, 0x90, 0x90,
+ 0x10, 0x10, 0x10, 0x10, 0x18, 0x0C, 0x07, 0x01,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01,
+ 0x00, 0x00, 0x00, 0x00, 0xC7, 0x7C, 0x00, 0x00,
+ 0x00, 0x00, 0x80, 0xFF, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x1C, 0x36, 0x32,
+ 0x2E, 0x22, 0x22, 0x22, 0x22, 0x22, 0x26, 0x24,
+ 0x26, 0x22, 0x23, 0x21, 0x21, 0x20, 0x30, 0x18,
+ 0x0C, 0x06, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
diff --git a/Firmware/CubeIDE/Code/src/timer.c b/Firmware/CubeIDE/Code/src/timer.c
new file mode 100644
index 0000000..42b4780
--- /dev/null
+++ b/Firmware/CubeIDE/Code/src/timer.c
@@ -0,0 +1,166 @@
+/*
+ ELEPH - Local Relative Navigation System
+
+ Copyright (C) 2021 Feruz Topalov
+ Released under the GNU General Public License v3.0
+
+ file: timer.c
+*/
+
+#include "stm32f10x.h"
+#include "timer.h"
+#include "gpio.h"
+
+
+
+void systick_init(void);
+void timer1_init(void);
+void timer2_init(void);
+void timer2_start(void);
+void timer3_init(void);
+void timer3_start(void);
+
+
+
+uint8_t beep_mute = 0;
+
+
+
+//Init all timers together
+void timers_init(void)
+{
+ systick_init();
+ timer1_init();
+ timer2_init();
+ timer3_init();
+}
+
+
+
+void make_a_beep(void)
+{
+ led_board_on();
+ timer2_start(); //in order to switch off led_board
+
+ if (beep_mute == 0)
+ {
+ timer3_start();
+ }
+}
+
+
+
+void toggle_mute(void)
+{
+ beep_mute ^= (uint8_t)1;
+}
+
+
+
+uint8_t get_mute_flag(void)
+{
+ return beep_mute;
+}
+
+
+
+//SysTick timer init (tick every 1s to count uptime)
+void systick_init(void)
+{
+ SysTick->CTRL &= ~SysTick_CTRL_CLKSOURCE_Msk; //clock source = AHB/8 = 72MHz/8 = 9MHz
+ SysTick->LOAD = (uint32_t)8999999; //9000000Hz-1
+ SysTick->VAL = 0; //reset counter value
+ SysTick->CTRL |= SysTick_CTRL_TICKINT_Msk; //enable interrupt
+ SysTick->CTRL |= SysTick_CTRL_ENABLE_Msk; //enable counter
+}
+
+
+
+//Timer1 init (time slot counter)
+void timer1_init(void)
+{
+ RCC->APB2ENR |= RCC_APB2ENR_TIM1EN; //enable timer 1 clock
+ TIM1->PSC = (uint16_t)35999; // 72MHz/(35999+1)=2kHz
+ TIM1->ARR = (uint16_t)199; // 2kHz/(199+1)=10Hz(100ms)
+ TIM1->CR1 |= TIM_CR1_URS; //only overflow generates interrupt
+ TIM1->EGR = TIM_EGR_UG; //software update generation
+ TIM1->SR &= ~TIM_SR_UIF; //clear update interrupt
+ TIM1->DIER |= TIM_DIER_UIE; //update interrupt enable
+
+ NVIC_EnableIRQ(TIM1_UP_IRQn); //enable interrupt
+}
+
+
+
+//Timer1 start
+void timer1_start(void)
+{
+ TIM1->CR1 |= TIM_CR1_CEN; //enable counter
+}
+
+
+
+//Timer1 stop and reload
+void timer1_stop_reload(void)
+{
+ TIM1->CR1 &= ~TIM_CR1_CEN; //disable counter
+ TIM1->EGR = TIM_EGR_UG; //software update generation
+}
+
+
+
+//Timer 2 init (gating timer, the length of the "beep")
+void timer2_init(void)
+{
+ RCC->APB1ENR |= RCC_APB1ENR_TIM2EN; //enable timer clock
+ TIM2->PSC = (uint16_t)35999; //72MHz/(35999+1)=2kHz
+ TIM2->ARR = (uint16_t)199; //2kHz/(199+1)=10Hz(100ms)
+ TIM2->EGR = TIM_EGR_UG; //software update generation
+ TIM2->DIER |= TIM_DIER_UIE; //update interrupt enable
+
+ NVIC_EnableIRQ(TIM2_IRQn);
+}
+
+
+
+void timer2_stop(void)
+{
+ TIM2->CR1 &= ~TIM_CR1_CEN; //stop gating timer
+}
+
+
+
+void timer2_start(void)
+{
+ TIM2->CR1 |= TIM_CR1_CEN; //start gating timer
+}
+
+
+
+//Timer 3 init (pwm timer, the frequency of the "beep")
+void timer3_init(void)
+{
+ RCC->APB1ENR |= RCC_APB1ENR_TIM3EN; //enable timer clock
+ TIM3->PSC = (uint16_t)8999; //72MHz/(8999+1)=8kHz
+ TIM3->ARR = (uint16_t)3; //8kHz/(3+1)=2kHz
+ TIM3->CCR2 = (uint16_t)2; //duty cycle 2/(3+1)=0.5
+ TIM3->CCMR1 |= TIM_CCMR1_OC2M_2; //PWM mode 2
+ TIM3->CCMR1 |= TIM_CCMR1_OC2M_1;
+ TIM3->CCMR1 |= TIM_CCMR1_OC2M_0;
+ TIM3->CCER |= TIM_CCER_CC2E; //CH2 output enable
+}
+
+
+
+void timer3_stop(void)
+{
+ TIM3->CR1 &= ~TIM_CR1_CEN; //disable PWM timer
+ TIM3->CNT = 0; //force output low
+}
+
+
+
+void timer3_start(void)
+{
+ TIM3->CR1 |= TIM_CR1_CEN; //enable PWM timer
+}
diff --git a/Firmware/CubeIDE/Code/src/uart.c b/Firmware/CubeIDE/Code/src/uart.c
new file mode 100644
index 0000000..3f5412b
--- /dev/null
+++ b/Firmware/CubeIDE/Code/src/uart.c
@@ -0,0 +1,87 @@
+/*
+ ELEPH - Local Relative Navigation System
+
+ Copyright (C) 2021 Feruz Topalov
+ Released under the GNU General Public License v3.0
+
+ file: uart.c
+*/
+
+#include "stm32f10x.h"
+#include "main.h"
+#include "uart.h"
+#include "gps.h"
+
+
+
+char uart_buffer[UART_BUF_LEN];
+char *backup_buf;
+
+
+
+//UART Init
+void uart_dma_init(void)
+{
+ RCC->APB2ENR |= RCC_APB2ENR_USART1EN; //ENABLE usart clock
+
+ USART1->BRR = 0x1D4C; //9600 bod
+ USART1->CR1 |= USART_CR1_TE; //enable tx
+ USART1->CR1 |= USART_CR1_RE; //enable rx
+ USART1->CR1 |= USART_CR1_UE; //uart enable
+
+ USART1->CR3 |= USART_CR3_DMAR; //enable DMA mode USART
+ RCC->AHBENR |= RCC_AHBENR_DMA1EN; //enable dma1 clock
+
+ DMA1_Channel5->CPAR = (uint32_t)(&(USART1->DR)); //transfer source
+ DMA1_Channel5->CMAR = (uint32_t)(&uart_buffer[0]); //transfer destination
+ DMA1_Channel5->CNDTR = UART_BUF_LEN; //bytes amount to receive
+
+ DMA1_Channel5->CCR |= DMA_CCR5_MINC; //enable memory increment
+ DMA1_Channel5->CCR |= DMA_CCR5_TCIE; //enable transfer complete interrupt
+ DMA1_Channel5->CCR |= DMA_CCR5_EN; //enable channel
+
+ NVIC_EnableIRQ(DMA1_Channel5_IRQn); //enable interrupts
+ DMA1->IFCR = DMA_IFCR_CGIF5; //clear all interrupt flags for DMA channel 5
+
+ backup_buf = get_nmea_buf();
+}
+
+
+
+//Stop UART DMA
+void uart_dma_stop(void)
+{
+ DMA1_Channel5->CCR &= ~DMA_CCR5_EN; //disable channel
+}
+
+
+
+//Restart UART DMA
+void uart_dma_restart(void)
+{
+ DMA1_Channel5->CNDTR = UART_BUF_LEN; //reload bytes amount to receive
+ DMA1_Channel5->CCR |= DMA_CCR5_EN; //enable channel
+}
+
+
+
+//Backup uart buffer and then clear it
+void backup_and_clear_uart_buffer(void)
+{
+ for (uint16_t i = 0; i < UART_BUF_LEN; i++) //copy received data to buffer and clear uart_buffer
+ {
+ backup_buf[i] = uart_buffer[i];
+ uart_buffer[i] = 0;
+ }
+}
+
+
+
+//UART Tx one byte
+void uart_tx(uint8_t data)
+{
+ while (!(USART1->SR & USART_SR_TXE)) //wait for transmit register empty
+ {
+ }
+ USART1->DR = data; //transmit data
+}
diff --git a/Firmware/CubeIDE/Debug/CMSIS/src/core_cm3.d b/Firmware/CubeIDE/Debug/CMSIS/src/core_cm3.d
new file mode 100644
index 0000000..38bfc72
--- /dev/null
+++ b/Firmware/CubeIDE/Debug/CMSIS/src/core_cm3.d
@@ -0,0 +1 @@
+CMSIS/src/core_cm3.o: ../CMSIS/src/core_cm3.c
diff --git a/Firmware/CubeIDE/Debug/CMSIS/src/core_cm3.o b/Firmware/CubeIDE/Debug/CMSIS/src/core_cm3.o
new file mode 100644
index 0000000..5886b62
Binary files /dev/null and b/Firmware/CubeIDE/Debug/CMSIS/src/core_cm3.o differ
diff --git a/Firmware/CubeIDE/Debug/CMSIS/src/core_cm3.su b/Firmware/CubeIDE/Debug/CMSIS/src/core_cm3.su
new file mode 100644
index 0000000..afa05be
--- /dev/null
+++ b/Firmware/CubeIDE/Debug/CMSIS/src/core_cm3.su
@@ -0,0 +1,22 @@
+core_cm3.c:443:10:__get_PSP 0 static,ignoring_inline_asm
+core_cm3.c:462:6:__set_PSP 0 static,ignoring_inline_asm
+core_cm3.c:477:10:__get_MSP 0 static,ignoring_inline_asm
+core_cm3.c:496:6:__set_MSP 0 static,ignoring_inline_asm
+core_cm3.c:509:10:__get_BASEPRI 16 static,ignoring_inline_asm
+core_cm3.c:524:6:__set_BASEPRI 16 static,ignoring_inline_asm
+core_cm3.c:536:10:__get_PRIMASK 16 static,ignoring_inline_asm
+core_cm3.c:551:6:__set_PRIMASK 16 static,ignoring_inline_asm
+core_cm3.c:563:10:__get_FAULTMASK 16 static,ignoring_inline_asm
+core_cm3.c:578:6:__set_FAULTMASK 16 static,ignoring_inline_asm
+core_cm3.c:590:10:__get_CONTROL 16 static,ignoring_inline_asm
+core_cm3.c:605:6:__set_CONTROL 16 static,ignoring_inline_asm
+core_cm3.c:619:10:__REV 24 static,ignoring_inline_asm
+core_cm3.c:635:10:__REV16 24 static,ignoring_inline_asm
+core_cm3.c:651:9:__REVSH 24 static,ignoring_inline_asm
+core_cm3.c:667:10:__RBIT 24 static,ignoring_inline_asm
+core_cm3.c:683:9:__LDREXB 24 static,ignoring_inline_asm
+core_cm3.c:699:10:__LDREXH 24 static,ignoring_inline_asm
+core_cm3.c:715:10:__LDREXW 24 static,ignoring_inline_asm
+core_cm3.c:732:10:__STREXB 24 static,ignoring_inline_asm
+core_cm3.c:749:10:__STREXH 24 static,ignoring_inline_asm
+core_cm3.c:766:10:__STREXW 24 static,ignoring_inline_asm
diff --git a/Firmware/CubeIDE/Debug/CMSIS/src/subdir.mk b/Firmware/CubeIDE/Debug/CMSIS/src/subdir.mk
new file mode 100644
index 0000000..b789a2b
--- /dev/null
+++ b/Firmware/CubeIDE/Debug/CMSIS/src/subdir.mk
@@ -0,0 +1,24 @@
+################################################################################
+# Automatically-generated file. Do not edit!
+################################################################################
+
+# Add inputs and outputs from these tool invocations to the build variables
+C_SRCS += \
+../CMSIS/src/core_cm3.c \
+../CMSIS/src/system_stm32f10x.c
+
+OBJS += \
+./CMSIS/src/core_cm3.o \
+./CMSIS/src/system_stm32f10x.o
+
+C_DEPS += \
+./CMSIS/src/core_cm3.d \
+./CMSIS/src/system_stm32f10x.d
+
+
+# Each subdirectory must supply rules for building sources it contributes
+CMSIS/src/core_cm3.o: ../CMSIS/src/core_cm3.c
+ arm-none-eabi-gcc "$<" -mcpu=cortex-m3 -std=gnu11 -g3 -DSTM32 -DSTM32F1 -DSTM32F103C8Tx -DDEBUG -c -I"D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc" -I"D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc" -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -MMD -MP -MF"CMSIS/src/core_cm3.d" -MT"$@" --specs=nano.specs -mfloat-abi=soft -mthumb -o "$@"
+CMSIS/src/system_stm32f10x.o: ../CMSIS/src/system_stm32f10x.c
+ arm-none-eabi-gcc "$<" -mcpu=cortex-m3 -std=gnu11 -g3 -DSTM32 -DSTM32F1 -DSTM32F103C8Tx -DDEBUG -c -I"D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc" -I"D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc" -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -MMD -MP -MF"CMSIS/src/system_stm32f10x.d" -MT"$@" --specs=nano.specs -mfloat-abi=soft -mthumb -o "$@"
+
diff --git a/Firmware/CubeIDE/Debug/CMSIS/src/system_stm32f10x.d b/Firmware/CubeIDE/Debug/CMSIS/src/system_stm32f10x.d
new file mode 100644
index 0000000..cf8778a
--- /dev/null
+++ b/Firmware/CubeIDE/Debug/CMSIS/src/system_stm32f10x.d
@@ -0,0 +1,10 @@
+CMSIS/src/system_stm32f10x.o: ../CMSIS/src/system_stm32f10x.c \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc/stm32f10x.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc/core_cm3.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc/system_stm32f10x.h
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc/stm32f10x.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc/core_cm3.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc/system_stm32f10x.h:
diff --git a/Firmware/CubeIDE/Debug/CMSIS/src/system_stm32f10x.o b/Firmware/CubeIDE/Debug/CMSIS/src/system_stm32f10x.o
new file mode 100644
index 0000000..f733b30
Binary files /dev/null and b/Firmware/CubeIDE/Debug/CMSIS/src/system_stm32f10x.o differ
diff --git a/Firmware/CubeIDE/Debug/CMSIS/src/system_stm32f10x.su b/Firmware/CubeIDE/Debug/CMSIS/src/system_stm32f10x.su
new file mode 100644
index 0000000..530fcf2
--- /dev/null
+++ b/Firmware/CubeIDE/Debug/CMSIS/src/system_stm32f10x.su
@@ -0,0 +1,4 @@
+system_stm32f10x.c:212:6:SystemInit 8 static
+system_stm32f10x.c:306:6:SystemCoreClockUpdate 24 static
+system_stm32f10x.c:419:13:SetSysClock 8 static
+system_stm32f10x.c:987:13:SetSysClockTo72 16 static
diff --git a/Firmware/CubeIDE/Debug/Code/src/adc.d b/Firmware/CubeIDE/Debug/Code/src/adc.d
new file mode 100644
index 0000000..4146eed
--- /dev/null
+++ b/Firmware/CubeIDE/Debug/Code/src/adc.d
@@ -0,0 +1,28 @@
+Code/src/adc.o: ../Code/src/adc.c \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc/stm32f10x.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc/core_cm3.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc/system_stm32f10x.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/adc.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/service.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/settings.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/points.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/lrns.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/gpio.h
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc/stm32f10x.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc/core_cm3.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc/system_stm32f10x.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/adc.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/service.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/settings.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/points.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/lrns.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/gpio.h:
diff --git a/Firmware/CubeIDE/Debug/Code/src/adc.o b/Firmware/CubeIDE/Debug/Code/src/adc.o
new file mode 100644
index 0000000..601fc3b
Binary files /dev/null and b/Firmware/CubeIDE/Debug/Code/src/adc.o differ
diff --git a/Firmware/CubeIDE/Debug/Code/src/adc.su b/Firmware/CubeIDE/Debug/Code/src/adc.su
new file mode 100644
index 0000000..574ea65
--- /dev/null
+++ b/Firmware/CubeIDE/Debug/Code/src/adc.su
@@ -0,0 +1,3 @@
+adc.c:37:6:adc_init 8 static
+adc.c:72:9:adc_get_bat_voltage 8 static
+adc.c:123:7:get_bat_voltage 4 static
diff --git a/Firmware/CubeIDE/Debug/Code/src/buttons.d b/Firmware/CubeIDE/Debug/Code/src/buttons.d
new file mode 100644
index 0000000..0d236ff
--- /dev/null
+++ b/Firmware/CubeIDE/Debug/Code/src/buttons.d
@@ -0,0 +1,13 @@
+Code/src/buttons.o: ../Code/src/buttons.c \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc/stm32f10x.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc/core_cm3.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc/system_stm32f10x.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/buttons.h
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc/stm32f10x.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc/core_cm3.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc/system_stm32f10x.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/buttons.h:
diff --git a/Firmware/CubeIDE/Debug/Code/src/buttons.o b/Firmware/CubeIDE/Debug/Code/src/buttons.o
new file mode 100644
index 0000000..3d8741e
Binary files /dev/null and b/Firmware/CubeIDE/Debug/Code/src/buttons.o differ
diff --git a/Firmware/CubeIDE/Debug/Code/src/buttons.su b/Firmware/CubeIDE/Debug/Code/src/buttons.su
new file mode 100644
index 0000000..9f3bbd1
--- /dev/null
+++ b/Firmware/CubeIDE/Debug/Code/src/buttons.su
@@ -0,0 +1 @@
+buttons.c:79:9:scan_buttons 16 static
diff --git a/Firmware/CubeIDE/Debug/Code/src/gpio.d b/Firmware/CubeIDE/Debug/Code/src/gpio.d
new file mode 100644
index 0000000..111f830
--- /dev/null
+++ b/Firmware/CubeIDE/Debug/Code/src/gpio.d
@@ -0,0 +1,13 @@
+Code/src/gpio.o: ../Code/src/gpio.c \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc/stm32f10x.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc/core_cm3.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc/system_stm32f10x.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/gpio.h
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc/stm32f10x.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc/core_cm3.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc/system_stm32f10x.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/gpio.h:
diff --git a/Firmware/CubeIDE/Debug/Code/src/gpio.o b/Firmware/CubeIDE/Debug/Code/src/gpio.o
new file mode 100644
index 0000000..dbdb106
Binary files /dev/null and b/Firmware/CubeIDE/Debug/Code/src/gpio.o differ
diff --git a/Firmware/CubeIDE/Debug/Code/src/gpio.su b/Firmware/CubeIDE/Debug/Code/src/gpio.su
new file mode 100644
index 0000000..330e841
--- /dev/null
+++ b/Firmware/CubeIDE/Debug/Code/src/gpio.su
@@ -0,0 +1,21 @@
+core_cm3.h:1502:22:NVIC_EnableIRQ 16 static
+gpio.c:16:6:gpio_init 8 static
+gpio.c:170:6:ext_int_init 8 static
+gpio.c:192:6:led_red_on 4 static
+gpio.c:200:6:led_red_off 4 static
+gpio.c:208:6:led_green_on 4 static
+gpio.c:216:6:led_green_off 4 static
+gpio.c:224:6:led_board_on 4 static
+gpio.c:232:6:led_board_off 4 static
+gpio.c:240:6:sdn_si4463_active 4 static
+gpio.c:248:6:sdn_si4463_inactive 4 static
+gpio.c:256:6:cs_si4463_active 4 static
+gpio.c:264:6:cs_si4463_inactive 4 static
+gpio.c:272:6:res_ssd1306_active 4 static
+gpio.c:280:6:res_ssd1306_inactive 4 static
+gpio.c:288:6:ssd1306_data_mode 4 static
+gpio.c:296:6:ssd1306_command_mode 4 static
+gpio.c:304:6:cs_ssd1306_active 4 static
+gpio.c:312:6:cs_ssd1306_inactive 4 static
+gpio.c:320:6:bat_mon_on 4 static
+gpio.c:328:6:bat_mon_off 4 static
diff --git a/Firmware/CubeIDE/Debug/Code/src/gps.d b/Firmware/CubeIDE/Debug/Code/src/gps.d
new file mode 100644
index 0000000..b730579
--- /dev/null
+++ b/Firmware/CubeIDE/Debug/Code/src/gps.d
@@ -0,0 +1,31 @@
+Code/src/gps.o: ../Code/src/gps.c \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc/stm32f10x.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc/core_cm3.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc/system_stm32f10x.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/main.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/gps.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/uart.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/service.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/settings.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/points.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/lrns.h
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc/stm32f10x.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc/core_cm3.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc/system_stm32f10x.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/main.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/gps.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/uart.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/service.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/settings.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/points.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/lrns.h:
diff --git a/Firmware/CubeIDE/Debug/Code/src/gps.o b/Firmware/CubeIDE/Debug/Code/src/gps.o
new file mode 100644
index 0000000..7c72b42
Binary files /dev/null and b/Firmware/CubeIDE/Debug/Code/src/gps.o differ
diff --git a/Firmware/CubeIDE/Debug/Code/src/gps.su b/Firmware/CubeIDE/Debug/Code/src/gps.su
new file mode 100644
index 0000000..4543d0c
--- /dev/null
+++ b/Firmware/CubeIDE/Debug/Code/src/gps.su
@@ -0,0 +1,11 @@
+gps.c:50:9:parse_gps 8 static
+gps.c:68:6:gps_raw_convert_to_numerical 16 static
+gps.c:181:9:parse_RMC 16 static
+gps.c:251:9:parse_GGA 16 static
+gps.c:300:9:parse_GSA 16 static
+gps.c:349:9:parse_GSV 16 static
+gps.c:395:9:nmea_checksum 24 static
+gps.c:437:9:get_gps_status 4 static
+gps.c:444:7:get_nmea_buf 4 static
+gps.c:451:24:get_gps_raw 4 static
+gps.c:458:24:get_gps_num 4 static
diff --git a/Firmware/CubeIDE/Debug/Code/src/i2c.d b/Firmware/CubeIDE/Debug/Code/src/i2c.d
new file mode 100644
index 0000000..fe1a302
--- /dev/null
+++ b/Firmware/CubeIDE/Debug/Code/src/i2c.d
@@ -0,0 +1,16 @@
+Code/src/i2c.o: ../Code/src/i2c.c \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc/stm32f10x.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc/core_cm3.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc/system_stm32f10x.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/i2c.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/service.h
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc/stm32f10x.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc/core_cm3.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc/system_stm32f10x.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/i2c.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/service.h:
diff --git a/Firmware/CubeIDE/Debug/Code/src/i2c.o b/Firmware/CubeIDE/Debug/Code/src/i2c.o
new file mode 100644
index 0000000..a5b78b9
Binary files /dev/null and b/Firmware/CubeIDE/Debug/Code/src/i2c.o differ
diff --git a/Firmware/CubeIDE/Debug/Code/src/i2c.su b/Firmware/CubeIDE/Debug/Code/src/i2c.su
new file mode 100644
index 0000000..46568f2
--- /dev/null
+++ b/Firmware/CubeIDE/Debug/Code/src/i2c.su
@@ -0,0 +1 @@
+i2c.c:20:6:i2c_init 4 static
diff --git a/Firmware/CubeIDE/Debug/Code/src/lrns.d b/Firmware/CubeIDE/Debug/Code/src/lrns.d
new file mode 100644
index 0000000..37d5d39
--- /dev/null
+++ b/Firmware/CubeIDE/Debug/Code/src/lrns.d
@@ -0,0 +1,34 @@
+Code/src/lrns.o: ../Code/src/lrns.c \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc/stm32f10x.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc/core_cm3.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc/system_stm32f10x.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/main.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/service.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/settings.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/gps.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/points.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/lrns.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/si4463.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/gpio.h
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc/stm32f10x.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc/core_cm3.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc/system_stm32f10x.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/main.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/service.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/settings.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/gps.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/points.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/lrns.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/si4463.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/gpio.h:
diff --git a/Firmware/CubeIDE/Debug/Code/src/lrns.o b/Firmware/CubeIDE/Debug/Code/src/lrns.o
new file mode 100644
index 0000000..014ac05
Binary files /dev/null and b/Firmware/CubeIDE/Debug/Code/src/lrns.o differ
diff --git a/Firmware/CubeIDE/Debug/Code/src/lrns.su b/Firmware/CubeIDE/Debug/Code/src/lrns.su
new file mode 100644
index 0000000..151acd5
--- /dev/null
+++ b/Firmware/CubeIDE/Debug/Code/src/lrns.su
@@ -0,0 +1,15 @@
+lrns.c:80:6:init_lrns 16 static
+lrns.c:109:6:set_device_flags 24 static
+lrns.c:145:9:get_device_flags 24 static
+lrns.c:179:9:check_alarms 16 static
+lrns.c:205:6:calc_timeout 24 static
+lrns.c:219:9:check_timeout 16 static
+lrns.c:254:9:check_fence 16 static
+lrns.c:286:6:process_all_devices 16 static
+lrns.c:300:6:gps_air_update_my_data 24 static
+lrns.c:343:6:fill_air_packet_with_struct_data 4 static
+lrns.c:367:9:fill_struct_with_air_packet_data 24 static
+lrns.c:399:6:calc_relative_position 88 static
+lrns.c:459:25:get_gps_air 16 static
+lrns.c:471:25:get_gps_rel 16 static
+lrns.c:483:25:get_dev_aux 16 static
diff --git a/Firmware/CubeIDE/Debug/Code/src/m24c64.d b/Firmware/CubeIDE/Debug/Code/src/m24c64.d
new file mode 100644
index 0000000..871755b
--- /dev/null
+++ b/Firmware/CubeIDE/Debug/Code/src/m24c64.d
@@ -0,0 +1,16 @@
+Code/src/m24c64.o: ../Code/src/m24c64.c \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc/stm32f10x.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc/core_cm3.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc/system_stm32f10x.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/m24c64.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/i2c.h
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc/stm32f10x.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc/core_cm3.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc/system_stm32f10x.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/m24c64.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/i2c.h:
diff --git a/Firmware/CubeIDE/Debug/Code/src/m24c64.o b/Firmware/CubeIDE/Debug/Code/src/m24c64.o
new file mode 100644
index 0000000..f564523
Binary files /dev/null and b/Firmware/CubeIDE/Debug/Code/src/m24c64.o differ
diff --git a/Firmware/CubeIDE/Debug/Code/src/m24c64.su b/Firmware/CubeIDE/Debug/Code/src/m24c64.su
new file mode 100644
index 0000000..974c064
--- /dev/null
+++ b/Firmware/CubeIDE/Debug/Code/src/m24c64.su
@@ -0,0 +1,7 @@
+m24c64.c:26:9:m24c64_poll 16 static
+m24c64.c:86:9:m24c64_read_byte 24 static
+m24c64.c:171:6:m24c64_write_byte 24 static
+m24c64.c:226:6:m24c64_read_page 24 static
+m24c64.c:317:6:m24c64_write_page 24 static
+m24c64.c:376:6:m24c64_erase_page 56 static
+m24c64.c:390:6:m24c64_erase_all 16 static
diff --git a/Firmware/CubeIDE/Debug/Code/src/main.d b/Firmware/CubeIDE/Debug/Code/src/main.d
new file mode 100644
index 0000000..48df56a
--- /dev/null
+++ b/Firmware/CubeIDE/Debug/Code/src/main.d
@@ -0,0 +1,64 @@
+Code/src/main.o: ../Code/src/main.c \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc/stm32f10x.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc/core_cm3.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc/system_stm32f10x.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/main.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/gpio.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/spi.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/ssd1306.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/service.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/uart.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/gps.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/si4463.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/timer.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/i2c.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/m24c64.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/settings.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/buttons.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/menu.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/adc.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/points.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/lrns.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/ssd1306_bitmaps.h
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc/stm32f10x.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc/core_cm3.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc/system_stm32f10x.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/main.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/gpio.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/spi.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/ssd1306.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/service.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/uart.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/gps.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/si4463.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/timer.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/i2c.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/m24c64.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/settings.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/buttons.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/menu.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/adc.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/points.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/lrns.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/ssd1306_bitmaps.h:
diff --git a/Firmware/CubeIDE/Debug/Code/src/main.o b/Firmware/CubeIDE/Debug/Code/src/main.o
new file mode 100644
index 0000000..368d72e
Binary files /dev/null and b/Firmware/CubeIDE/Debug/Code/src/main.o differ
diff --git a/Firmware/CubeIDE/Debug/Code/src/main.su b/Firmware/CubeIDE/Debug/Code/src/main.su
new file mode 100644
index 0000000..81228ee
--- /dev/null
+++ b/Firmware/CubeIDE/Debug/Code/src/main.su
@@ -0,0 +1,10 @@
+core_cm3.h:1204:22:__enable_irq 4 static,ignoring_inline_asm
+main.c:50:5:main 16 static
+main.c:160:6:DMA1_Channel5_IRQHandler 8 static
+main.c:177:6:EXTI15_10_IRQHandler 8 static
+main.c:221:6:EXTI9_5_IRQHandler 4 static
+main.c:265:6:TIM1_UP_IRQHandler 8 static
+main.c:302:6:SysTick_Handler 8 static
+main.c:315:6:TIM2_IRQHandler 8 static
+main.c:326:10:get_uptime 4 static
+main.c:333:27:get_main_flags 4 static
diff --git a/Firmware/CubeIDE/Debug/Code/src/menu.d b/Firmware/CubeIDE/Debug/Code/src/menu.d
new file mode 100644
index 0000000..6e780db
--- /dev/null
+++ b/Firmware/CubeIDE/Debug/Code/src/menu.d
@@ -0,0 +1,55 @@
+Code/src/menu.o: ../Code/src/menu.c \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc/stm32f10x.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc/core_cm3.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc/system_stm32f10x.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/menu.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/buttons.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/ssd1306.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/main.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/service.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/settings.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/m24c64.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/ssd1306_bitmaps.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/gpio.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/adc.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/gps.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/points.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/lrns.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/si4463.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/timer.h
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc/stm32f10x.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc/core_cm3.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc/system_stm32f10x.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/menu.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/buttons.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/ssd1306.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/main.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/service.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/settings.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/m24c64.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/ssd1306_bitmaps.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/gpio.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/adc.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/gps.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/points.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/lrns.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/si4463.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/timer.h:
diff --git a/Firmware/CubeIDE/Debug/Code/src/menu.o b/Firmware/CubeIDE/Debug/Code/src/menu.o
new file mode 100644
index 0000000..96830df
Binary files /dev/null and b/Firmware/CubeIDE/Debug/Code/src/menu.o differ
diff --git a/Firmware/CubeIDE/Debug/Code/src/menu.su b/Firmware/CubeIDE/Debug/Code/src/menu.su
new file mode 100644
index 0000000..6b30c39
--- /dev/null
+++ b/Firmware/CubeIDE/Debug/Code/src/menu.su
@@ -0,0 +1,100 @@
+core_cm3.h:1215:22:__DSB 4 static,ignoring_inline_asm
+core_cm3.h:1719:22:NVIC_SystemReset 8 static
+menu.c:503:6:init_menu 8 static
+menu.c:530:6:change_menu 24 static
+menu.c:581:6:toggle_alarm 8 static
+menu.c:599:6:scroll_up 16 static
+menu.c:619:6:scroll_down 16 static
+menu.c:639:6:switch_forward 16 static
+menu.c:656:6:switch_backward 16 static
+menu.c:673:9:get_current_item 16 static
+menu.c:688:9:get_last_item 16 static
+menu.c:703:6:set_current_item 24 static
+menu.c:718:6:reset_current_item_in_menu 24 static
+menu.c:733:6:draw_current_menu 16 static
+menu.c:748:6:draw_main 8 static
+menu.c:774:6:draw_devices 24 static
+menu.c:1027:6:draw_each_device 24 static
+menu.c:1455:6:draw_each_device_submenu 8 static
+menu.c:1480:6:draw_delete_device 8 static
+menu.c:1511:6:delete_device_ok 8 static
+menu.c:1528:6:draw_save_device 16 static
+menu.c:1586:6:draw_save_device_as 8 static
+menu.c:1604:6:draw_saved_popup 8 static
+menu.c:1614:6:draw_radar 80 static
+menu.c:1944:6:draw_points 16 static
+menu.c:1996:6:draw_each_point 8 static
+menu.c:2015:6:draw_load_point 16 static
+menu.c:2066:6:draw_delete_point 8 static
+menu.c:2080:6:draw_settings 8 static
+menu.c:2097:6:draw_info 8 static
+menu.c:2121:6:draw_edit_settings 8 static
+menu.c:2171:6:draw_set_dev_num 8 static
+menu.c:2190:6:draw_set_dev_id 8 static
+menu.c:2212:6:draw_set_freq_ch 8 static
+menu.c:2231:6:draw_set_tx_pow 8 static
+menu.c:2251:6:draw_set_send_intvl 8 static
+menu.c:2271:6:draw_set_to_thr 8 static
+menu.c:2291:6:draw_set_fnc_thr 8 static
+menu.c:2311:6:draw_confirm_settings_save 8 static
+menu.c:2331:6:draw_restore_defaults 8 static
+menu.c:2343:6:draw_erase_all 8 static
+menu.c:2354:6:devices_ok 8 static
+menu.c:2367:6:each_device_up 8 static
+menu.c:2387:6:each_device_down 8 static
+menu.c:2407:6:each_device_ok 8 static
+menu.c:2415:6:save_device_up 8 static
+menu.c:2438:6:save_device_down 8 static
+menu.c:2461:6:save_device_ok 8 static
+menu.c:2472:6:save_device_esc 8 static
+menu.c:2481:6:save_device_as_up 8 static
+menu.c:2497:6:save_device_as_down 8 static
+menu.c:2513:6:save_device_as_ok 8 static
+menu.c:2525:6:save_device_as_ok_long 8 static
+menu.c:2539:6:save_device_as_esc 8 static
+menu.c:2548:6:saved_popup_esc 8 static
+menu.c:2560:6:radar_up 8 static
+menu.c:2587:6:radar_down 8 static
+menu.c:2614:6:radar_ok 8 static
+menu.c:2626:6:points_up 8 static
+menu.c:2642:6:points_down 8 static
+menu.c:2658:6:points_ok 8 static
+menu.c:2669:6:points_esc 8 static
+menu.c:2678:6:load_point_up 8 static
+menu.c:2705:6:load_point_down 8 static
+menu.c:2732:6:load_point_ok 8 static
+menu.c:2747:6:load_point_esc 8 static
+menu.c:2756:6:delete_point_ok 8 static
+menu.c:2768:6:set_dev_num_up 8 static
+menu.c:2784:6:set_dev_num_down 8 static
+menu.c:2800:6:set_dev_num_ok 8 static
+menu.c:2813:6:set_dev_num_esc 8 static
+menu.c:2822:6:confirm_settings_save_ok 8 static
+menu.c:2830:6:set_dev_id_up 8 static
+menu.c:2846:6:set_dev_id_down 8 static
+menu.c:2862:6:set_dev_id_ok 8 static
+menu.c:2874:6:set_dev_id_ok_long 16 static
+menu.c:2891:6:set_dev_id_esc 16 static
+menu.c:2905:6:set_freq_ch_up 8 static
+menu.c:2921:6:set_freq_ch_down 8 static
+menu.c:2937:6:set_freq_ch_ok 8 static
+menu.c:2950:6:set_freq_ch_esc 8 static
+menu.c:2959:6:set_tx_pow_up 8 static
+menu.c:2975:6:set_tx_pow_down 8 static
+menu.c:2991:6:set_tx_pow_ok 8 static
+menu.c:3004:6:set_tx_pow_esc 8 static
+menu.c:3013:6:set_send_intvl_up 8 static
+menu.c:3029:6:set_send_intvl_down 8 static
+menu.c:3045:6:set_send_intvl_ok 8 static
+menu.c:3058:6:set_send_intvl_esc 8 static
+menu.c:3067:6:set_to_thr_up 8 static
+menu.c:3082:6:set_to_thr_down 8 static
+menu.c:3096:6:set_to_thr_ok 8 static
+menu.c:3109:6:set_to_thr_esc 8 static
+menu.c:3118:6:set_fnc_thr_up 8 static
+menu.c:3133:6:set_fnc_thr_down 8 static
+menu.c:3147:6:set_fnc_thr_ok 8 static
+menu.c:3160:6:set_fnc_thr_esc 8 static
+menu.c:3169:6:confirm_settings_save_esc 8 static
+menu.c:3179:6:restore_defaults_ok 8 static
+menu.c:3187:6:erase_all_ok 8 static
diff --git a/Firmware/CubeIDE/Debug/Code/src/points.d b/Firmware/CubeIDE/Debug/Code/src/points.d
new file mode 100644
index 0000000..f816e0a
--- /dev/null
+++ b/Firmware/CubeIDE/Debug/Code/src/points.d
@@ -0,0 +1,31 @@
+Code/src/points.o: ../Code/src/points.c \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc/stm32f10x.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc/core_cm3.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc/system_stm32f10x.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/points.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/m24c64.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/settings.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/lrns.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/gps.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/service.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/main.h
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc/stm32f10x.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc/core_cm3.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc/system_stm32f10x.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/points.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/m24c64.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/settings.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/lrns.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/gps.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/service.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/main.h:
diff --git a/Firmware/CubeIDE/Debug/Code/src/points.o b/Firmware/CubeIDE/Debug/Code/src/points.o
new file mode 100644
index 0000000..4baa080
Binary files /dev/null and b/Firmware/CubeIDE/Debug/Code/src/points.o differ
diff --git a/Firmware/CubeIDE/Debug/Code/src/points.su b/Firmware/CubeIDE/Debug/Code/src/points.su
new file mode 100644
index 0000000..27a662d
--- /dev/null
+++ b/Firmware/CubeIDE/Debug/Code/src/points.su
@@ -0,0 +1,7 @@
+points.c:73:29:get_memory_slot 16 static
+points.c:85:6:init_points 16 static
+points.c:101:6:read_memory_slots 16 static
+points.c:137:6:save_memory_point 16 static
+points.c:176:6:load_memory_point 32 static
+points.c:213:6:delete_memory_point 16 static
+points.c:221:6:clear_point_buffer 16 static
diff --git a/Firmware/CubeIDE/Debug/Code/src/service.d b/Firmware/CubeIDE/Debug/Code/src/service.d
new file mode 100644
index 0000000..b2fb4ad
--- /dev/null
+++ b/Firmware/CubeIDE/Debug/Code/src/service.d
@@ -0,0 +1,13 @@
+Code/src/service.o: ../Code/src/service.c \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc/stm32f10x.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc/core_cm3.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc/system_stm32f10x.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/service.h
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc/stm32f10x.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc/core_cm3.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc/system_stm32f10x.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/service.h:
diff --git a/Firmware/CubeIDE/Debug/Code/src/service.o b/Firmware/CubeIDE/Debug/Code/src/service.o
new file mode 100644
index 0000000..66a4558
Binary files /dev/null and b/Firmware/CubeIDE/Debug/Code/src/service.o differ
diff --git a/Firmware/CubeIDE/Debug/Code/src/service.su b/Firmware/CubeIDE/Debug/Code/src/service.su
new file mode 100644
index 0000000..e9ddaee
--- /dev/null
+++ b/Firmware/CubeIDE/Debug/Code/src/service.su
@@ -0,0 +1,7 @@
+service.c:17:6:convert_timeout 40 static
+service.c:148:6:delay_cyc 16 static
+service.c:159:6:copy_string 16 static
+service.c:171:7:atof32 40 static
+service.c:210:6:ftoa32 64 static
+service.c:288:9:atoi32 32 static
+service.c:322:6:itoa32 24 static
diff --git a/Firmware/CubeIDE/Debug/Code/src/settings.d b/Firmware/CubeIDE/Debug/Code/src/settings.d
new file mode 100644
index 0000000..3d63cff
--- /dev/null
+++ b/Firmware/CubeIDE/Debug/Code/src/settings.d
@@ -0,0 +1,22 @@
+Code/src/settings.o: ../Code/src/settings.c \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc/stm32f10x.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc/core_cm3.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc/system_stm32f10x.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/main.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/settings.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/m24c64.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/si4463.h
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc/stm32f10x.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc/core_cm3.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc/system_stm32f10x.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/main.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/settings.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/m24c64.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/si4463.h:
diff --git a/Firmware/CubeIDE/Debug/Code/src/settings.o b/Firmware/CubeIDE/Debug/Code/src/settings.o
new file mode 100644
index 0000000..11167e9
Binary files /dev/null and b/Firmware/CubeIDE/Debug/Code/src/settings.o differ
diff --git a/Firmware/CubeIDE/Debug/Code/src/settings.su b/Firmware/CubeIDE/Debug/Code/src/settings.su
new file mode 100644
index 0000000..1be685c
--- /dev/null
+++ b/Firmware/CubeIDE/Debug/Code/src/settings.su
@@ -0,0 +1,6 @@
+settings.c:78:10:get_send_interval_values 4 static
+settings.c:85:10:get_tx_power_values 4 static
+settings.c:92:25:get_settings 4 static
+settings.c:99:6:settings_load 16 static
+settings.c:126:6:settings_save_default 16 static
+settings.c:152:6:settings_save 24 static
diff --git a/Firmware/CubeIDE/Debug/Code/src/si4463.d b/Firmware/CubeIDE/Debug/Code/src/si4463.d
new file mode 100644
index 0000000..662eb30
--- /dev/null
+++ b/Firmware/CubeIDE/Debug/Code/src/si4463.d
@@ -0,0 +1,31 @@
+Code/src/si4463.o: ../Code/src/si4463.c \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc/stm32f10x.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc/core_cm3.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc/system_stm32f10x.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/si4463.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/radio_config_Si4463.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/gpio.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/spi.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/service.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/main.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/settings.h
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc/stm32f10x.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc/core_cm3.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc/system_stm32f10x.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/si4463.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/radio_config_Si4463.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/gpio.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/spi.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/service.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/main.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/settings.h:
diff --git a/Firmware/CubeIDE/Debug/Code/src/si4463.o b/Firmware/CubeIDE/Debug/Code/src/si4463.o
new file mode 100644
index 0000000..1e677ec
Binary files /dev/null and b/Firmware/CubeIDE/Debug/Code/src/si4463.o differ
diff --git a/Firmware/CubeIDE/Debug/Code/src/si4463.su b/Firmware/CubeIDE/Debug/Code/src/si4463.su
new file mode 100644
index 0000000..174c3eb
--- /dev/null
+++ b/Firmware/CubeIDE/Debug/Code/src/si4463.su
@@ -0,0 +1,9 @@
+si4463.c:77:6:si4463_init 384 static
+si4463.c:119:6:si4463_wait_cts 4 static
+si4463.c:127:6:si4463_set_packet_len 16 static
+si4463.c:142:6:si4463_set_tx_power 16 static
+si4463.c:157:6:si4463_tx_packet 16 static
+si4463.c:190:6:si4463_start_rx 8 static
+si4463.c:208:9:si4463_get_rx_packet 24 static
+si4463.c:265:10:get_air_packet_tx 4 static
+si4463.c:272:10:get_air_packet_rx 4 static
diff --git a/Firmware/CubeIDE/Debug/Code/src/spi.d b/Firmware/CubeIDE/Debug/Code/src/spi.d
new file mode 100644
index 0000000..053ba59
--- /dev/null
+++ b/Firmware/CubeIDE/Debug/Code/src/spi.d
@@ -0,0 +1,13 @@
+Code/src/spi.o: ../Code/src/spi.c \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc/stm32f10x.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc/core_cm3.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc/system_stm32f10x.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/spi.h
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc/stm32f10x.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc/core_cm3.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc/system_stm32f10x.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/spi.h:
diff --git a/Firmware/CubeIDE/Debug/Code/src/spi.o b/Firmware/CubeIDE/Debug/Code/src/spi.o
new file mode 100644
index 0000000..d60ae34
Binary files /dev/null and b/Firmware/CubeIDE/Debug/Code/src/spi.o differ
diff --git a/Firmware/CubeIDE/Debug/Code/src/spi.su b/Firmware/CubeIDE/Debug/Code/src/spi.su
new file mode 100644
index 0000000..42ce144
--- /dev/null
+++ b/Firmware/CubeIDE/Debug/Code/src/spi.su
@@ -0,0 +1,4 @@
+spi.c:16:6:spi1_init 4 static
+spi.c:34:6:spi2_init 4 static
+spi.c:49:9:spi1_trx 16 static
+spi.c:61:9:spi2_trx 16 static
diff --git a/Firmware/CubeIDE/Debug/Code/src/ssd1306.d b/Firmware/CubeIDE/Debug/Code/src/ssd1306.d
new file mode 100644
index 0000000..782baf7
--- /dev/null
+++ b/Firmware/CubeIDE/Debug/Code/src/ssd1306.d
@@ -0,0 +1,25 @@
+Code/src/ssd1306.o: ../Code/src/ssd1306.c \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc/stm32f10x.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc/core_cm3.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc/system_stm32f10x.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/ssd1306.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/ssd1306_font6x8.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/gpio.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/spi.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/service.h
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc/stm32f10x.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc/core_cm3.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc/system_stm32f10x.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/ssd1306.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/ssd1306_font6x8.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/gpio.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/spi.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/service.h:
diff --git a/Firmware/CubeIDE/Debug/Code/src/ssd1306.o b/Firmware/CubeIDE/Debug/Code/src/ssd1306.o
new file mode 100644
index 0000000..6d3aeae
Binary files /dev/null and b/Firmware/CubeIDE/Debug/Code/src/ssd1306.o differ
diff --git a/Firmware/CubeIDE/Debug/Code/src/ssd1306.su b/Firmware/CubeIDE/Debug/Code/src/ssd1306.su
new file mode 100644
index 0000000..ab5ffea
--- /dev/null
+++ b/Firmware/CubeIDE/Debug/Code/src/ssd1306.su
@@ -0,0 +1,13 @@
+ssd1306.c:44:6:ssd1306_init 16 static
+ssd1306.c:77:6:ssd1306_update 16 static
+ssd1306.c:91:6:ssd1306_fill 16 static
+ssd1306.c:102:6:ssd1306_clear 16 static
+ssd1306.c:113:6:ssd1306_pixel 16 static
+ssd1306.c:132:6:ssd1306_pos 16 static
+ssd1306.c:140:6:ssd1306_char 24 static
+ssd1306.c:161:6:ssd1306_char_pos 24 static
+ssd1306.c:170:6:ssd1306_print 16 static
+ssd1306.c:183:6:ssd1306_print_viceversa 24 static
+ssd1306.c:206:6:ssd1306_print_next 16 static
+ssd1306.c:217:6:ssd1306_bitmap 24 static
+ssd1306.c:228:6:ssd1306_print_byte 16 static
diff --git a/Firmware/CubeIDE/Debug/Code/src/ssd1306_bitmaps.d b/Firmware/CubeIDE/Debug/Code/src/ssd1306_bitmaps.d
new file mode 100644
index 0000000..88fd744
--- /dev/null
+++ b/Firmware/CubeIDE/Debug/Code/src/ssd1306_bitmaps.d
@@ -0,0 +1,10 @@
+Code/src/ssd1306_bitmaps.o: ../Code/src/ssd1306_bitmaps.c \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc/stm32f10x.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc/core_cm3.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc/system_stm32f10x.h
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc/stm32f10x.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc/core_cm3.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc/system_stm32f10x.h:
diff --git a/Firmware/CubeIDE/Debug/Code/src/ssd1306_bitmaps.o b/Firmware/CubeIDE/Debug/Code/src/ssd1306_bitmaps.o
new file mode 100644
index 0000000..52925e4
Binary files /dev/null and b/Firmware/CubeIDE/Debug/Code/src/ssd1306_bitmaps.o differ
diff --git a/Firmware/CubeIDE/Debug/Code/src/ssd1306_bitmaps.su b/Firmware/CubeIDE/Debug/Code/src/ssd1306_bitmaps.su
new file mode 100644
index 0000000..e69de29
diff --git a/Firmware/CubeIDE/Debug/Code/src/subdir.mk b/Firmware/CubeIDE/Debug/Code/src/subdir.mk
new file mode 100644
index 0000000..5b3e081
--- /dev/null
+++ b/Firmware/CubeIDE/Debug/Code/src/subdir.mk
@@ -0,0 +1,104 @@
+################################################################################
+# Automatically-generated file. Do not edit!
+################################################################################
+
+# Add inputs and outputs from these tool invocations to the build variables
+C_SRCS += \
+../Code/src/adc.c \
+../Code/src/buttons.c \
+../Code/src/gpio.c \
+../Code/src/gps.c \
+../Code/src/i2c.c \
+../Code/src/lrns.c \
+../Code/src/m24c64.c \
+../Code/src/main.c \
+../Code/src/menu.c \
+../Code/src/points.c \
+../Code/src/service.c \
+../Code/src/settings.c \
+../Code/src/si4463.c \
+../Code/src/spi.c \
+../Code/src/ssd1306.c \
+../Code/src/ssd1306_bitmaps.c \
+../Code/src/timer.c \
+../Code/src/uart.c
+
+OBJS += \
+./Code/src/adc.o \
+./Code/src/buttons.o \
+./Code/src/gpio.o \
+./Code/src/gps.o \
+./Code/src/i2c.o \
+./Code/src/lrns.o \
+./Code/src/m24c64.o \
+./Code/src/main.o \
+./Code/src/menu.o \
+./Code/src/points.o \
+./Code/src/service.o \
+./Code/src/settings.o \
+./Code/src/si4463.o \
+./Code/src/spi.o \
+./Code/src/ssd1306.o \
+./Code/src/ssd1306_bitmaps.o \
+./Code/src/timer.o \
+./Code/src/uart.o
+
+C_DEPS += \
+./Code/src/adc.d \
+./Code/src/buttons.d \
+./Code/src/gpio.d \
+./Code/src/gps.d \
+./Code/src/i2c.d \
+./Code/src/lrns.d \
+./Code/src/m24c64.d \
+./Code/src/main.d \
+./Code/src/menu.d \
+./Code/src/points.d \
+./Code/src/service.d \
+./Code/src/settings.d \
+./Code/src/si4463.d \
+./Code/src/spi.d \
+./Code/src/ssd1306.d \
+./Code/src/ssd1306_bitmaps.d \
+./Code/src/timer.d \
+./Code/src/uart.d
+
+
+# Each subdirectory must supply rules for building sources it contributes
+Code/src/adc.o: ../Code/src/adc.c
+ arm-none-eabi-gcc "$<" -mcpu=cortex-m3 -std=gnu11 -g3 -DSTM32 -DSTM32F1 -DSTM32F103C8Tx -DDEBUG -c -I"D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc" -I"D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc" -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -MMD -MP -MF"Code/src/adc.d" -MT"$@" --specs=nano.specs -mfloat-abi=soft -mthumb -o "$@"
+Code/src/buttons.o: ../Code/src/buttons.c
+ arm-none-eabi-gcc "$<" -mcpu=cortex-m3 -std=gnu11 -g3 -DSTM32 -DSTM32F1 -DSTM32F103C8Tx -DDEBUG -c -I"D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc" -I"D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc" -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -MMD -MP -MF"Code/src/buttons.d" -MT"$@" --specs=nano.specs -mfloat-abi=soft -mthumb -o "$@"
+Code/src/gpio.o: ../Code/src/gpio.c
+ arm-none-eabi-gcc "$<" -mcpu=cortex-m3 -std=gnu11 -g3 -DSTM32 -DSTM32F1 -DSTM32F103C8Tx -DDEBUG -c -I"D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc" -I"D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc" -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -MMD -MP -MF"Code/src/gpio.d" -MT"$@" --specs=nano.specs -mfloat-abi=soft -mthumb -o "$@"
+Code/src/gps.o: ../Code/src/gps.c
+ arm-none-eabi-gcc "$<" -mcpu=cortex-m3 -std=gnu11 -g3 -DSTM32 -DSTM32F1 -DSTM32F103C8Tx -DDEBUG -c -I"D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc" -I"D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc" -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -MMD -MP -MF"Code/src/gps.d" -MT"$@" --specs=nano.specs -mfloat-abi=soft -mthumb -o "$@"
+Code/src/i2c.o: ../Code/src/i2c.c
+ arm-none-eabi-gcc "$<" -mcpu=cortex-m3 -std=gnu11 -g3 -DSTM32 -DSTM32F1 -DSTM32F103C8Tx -DDEBUG -c -I"D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc" -I"D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc" -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -MMD -MP -MF"Code/src/i2c.d" -MT"$@" --specs=nano.specs -mfloat-abi=soft -mthumb -o "$@"
+Code/src/lrns.o: ../Code/src/lrns.c
+ arm-none-eabi-gcc "$<" -mcpu=cortex-m3 -std=gnu11 -g3 -DSTM32 -DSTM32F1 -DSTM32F103C8Tx -DDEBUG -c -I"D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc" -I"D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc" -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -MMD -MP -MF"Code/src/lrns.d" -MT"$@" --specs=nano.specs -mfloat-abi=soft -mthumb -o "$@"
+Code/src/m24c64.o: ../Code/src/m24c64.c
+ arm-none-eabi-gcc "$<" -mcpu=cortex-m3 -std=gnu11 -g3 -DSTM32 -DSTM32F1 -DSTM32F103C8Tx -DDEBUG -c -I"D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc" -I"D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc" -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -MMD -MP -MF"Code/src/m24c64.d" -MT"$@" --specs=nano.specs -mfloat-abi=soft -mthumb -o "$@"
+Code/src/main.o: ../Code/src/main.c
+ arm-none-eabi-gcc "$<" -mcpu=cortex-m3 -std=gnu11 -g3 -DSTM32 -DSTM32F1 -DSTM32F103C8Tx -DDEBUG -c -I"D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc" -I"D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc" -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -MMD -MP -MF"Code/src/main.d" -MT"$@" --specs=nano.specs -mfloat-abi=soft -mthumb -o "$@"
+Code/src/menu.o: ../Code/src/menu.c
+ arm-none-eabi-gcc "$<" -mcpu=cortex-m3 -std=gnu11 -g3 -DSTM32 -DSTM32F1 -DSTM32F103C8Tx -DDEBUG -c -I"D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc" -I"D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc" -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -MMD -MP -MF"Code/src/menu.d" -MT"$@" --specs=nano.specs -mfloat-abi=soft -mthumb -o "$@"
+Code/src/points.o: ../Code/src/points.c
+ arm-none-eabi-gcc "$<" -mcpu=cortex-m3 -std=gnu11 -g3 -DSTM32 -DSTM32F1 -DSTM32F103C8Tx -DDEBUG -c -I"D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc" -I"D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc" -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -MMD -MP -MF"Code/src/points.d" -MT"$@" --specs=nano.specs -mfloat-abi=soft -mthumb -o "$@"
+Code/src/service.o: ../Code/src/service.c
+ arm-none-eabi-gcc "$<" -mcpu=cortex-m3 -std=gnu11 -g3 -DSTM32 -DSTM32F1 -DSTM32F103C8Tx -DDEBUG -c -I"D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc" -I"D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc" -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -MMD -MP -MF"Code/src/service.d" -MT"$@" --specs=nano.specs -mfloat-abi=soft -mthumb -o "$@"
+Code/src/settings.o: ../Code/src/settings.c
+ arm-none-eabi-gcc "$<" -mcpu=cortex-m3 -std=gnu11 -g3 -DSTM32 -DSTM32F1 -DSTM32F103C8Tx -DDEBUG -c -I"D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc" -I"D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc" -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -MMD -MP -MF"Code/src/settings.d" -MT"$@" --specs=nano.specs -mfloat-abi=soft -mthumb -o "$@"
+Code/src/si4463.o: ../Code/src/si4463.c
+ arm-none-eabi-gcc "$<" -mcpu=cortex-m3 -std=gnu11 -g3 -DSTM32 -DSTM32F1 -DSTM32F103C8Tx -DDEBUG -c -I"D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc" -I"D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc" -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -MMD -MP -MF"Code/src/si4463.d" -MT"$@" --specs=nano.specs -mfloat-abi=soft -mthumb -o "$@"
+Code/src/spi.o: ../Code/src/spi.c
+ arm-none-eabi-gcc "$<" -mcpu=cortex-m3 -std=gnu11 -g3 -DSTM32 -DSTM32F1 -DSTM32F103C8Tx -DDEBUG -c -I"D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc" -I"D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc" -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -MMD -MP -MF"Code/src/spi.d" -MT"$@" --specs=nano.specs -mfloat-abi=soft -mthumb -o "$@"
+Code/src/ssd1306.o: ../Code/src/ssd1306.c
+ arm-none-eabi-gcc "$<" -mcpu=cortex-m3 -std=gnu11 -g3 -DSTM32 -DSTM32F1 -DSTM32F103C8Tx -DDEBUG -c -I"D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc" -I"D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc" -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -MMD -MP -MF"Code/src/ssd1306.d" -MT"$@" --specs=nano.specs -mfloat-abi=soft -mthumb -o "$@"
+Code/src/ssd1306_bitmaps.o: ../Code/src/ssd1306_bitmaps.c
+ arm-none-eabi-gcc "$<" -mcpu=cortex-m3 -std=gnu11 -g3 -DSTM32 -DSTM32F1 -DSTM32F103C8Tx -DDEBUG -c -I"D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc" -I"D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc" -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -MMD -MP -MF"Code/src/ssd1306_bitmaps.d" -MT"$@" --specs=nano.specs -mfloat-abi=soft -mthumb -o "$@"
+Code/src/timer.o: ../Code/src/timer.c
+ arm-none-eabi-gcc "$<" -mcpu=cortex-m3 -std=gnu11 -g3 -DSTM32 -DSTM32F1 -DSTM32F103C8Tx -DDEBUG -c -I"D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc" -I"D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc" -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -MMD -MP -MF"Code/src/timer.d" -MT"$@" --specs=nano.specs -mfloat-abi=soft -mthumb -o "$@"
+Code/src/uart.o: ../Code/src/uart.c
+ arm-none-eabi-gcc "$<" -mcpu=cortex-m3 -std=gnu11 -g3 -DSTM32 -DSTM32F1 -DSTM32F103C8Tx -DDEBUG -c -I"D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc" -I"D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc" -O0 -ffunction-sections -fdata-sections -Wall -fstack-usage -MMD -MP -MF"Code/src/uart.d" -MT"$@" --specs=nano.specs -mfloat-abi=soft -mthumb -o "$@"
+
diff --git a/Firmware/CubeIDE/Debug/Code/src/timer.d b/Firmware/CubeIDE/Debug/Code/src/timer.d
new file mode 100644
index 0000000..41206f2
--- /dev/null
+++ b/Firmware/CubeIDE/Debug/Code/src/timer.d
@@ -0,0 +1,16 @@
+Code/src/timer.o: ../Code/src/timer.c \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc/stm32f10x.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc/core_cm3.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc/system_stm32f10x.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/timer.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/gpio.h
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc/stm32f10x.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc/core_cm3.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc/system_stm32f10x.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/timer.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/gpio.h:
diff --git a/Firmware/CubeIDE/Debug/Code/src/timer.o b/Firmware/CubeIDE/Debug/Code/src/timer.o
new file mode 100644
index 0000000..93d1e7e
Binary files /dev/null and b/Firmware/CubeIDE/Debug/Code/src/timer.o differ
diff --git a/Firmware/CubeIDE/Debug/Code/src/timer.su b/Firmware/CubeIDE/Debug/Code/src/timer.su
new file mode 100644
index 0000000..478acdc
--- /dev/null
+++ b/Firmware/CubeIDE/Debug/Code/src/timer.su
@@ -0,0 +1,15 @@
+core_cm3.h:1502:22:NVIC_EnableIRQ 16 static
+timer.c:30:6:timers_init 8 static
+timer.c:40:6:make_a_beep 8 static
+timer.c:53:6:toggle_mute 4 static
+timer.c:60:9:get_mute_flag 4 static
+timer.c:68:6:systick_init 4 static
+timer.c:80:6:timer1_init 8 static
+timer.c:96:6:timer1_start 4 static
+timer.c:104:6:timer1_stop_reload 4 static
+timer.c:113:6:timer2_init 8 static
+timer.c:126:6:timer2_stop 4 static
+timer.c:133:6:timer2_start 4 static
+timer.c:141:6:timer3_init 4 static
+timer.c:155:6:timer3_stop 4 static
+timer.c:163:6:timer3_start 4 static
diff --git a/Firmware/CubeIDE/Debug/Code/src/uart.d b/Firmware/CubeIDE/Debug/Code/src/uart.d
new file mode 100644
index 0000000..0fa45d7
--- /dev/null
+++ b/Firmware/CubeIDE/Debug/Code/src/uart.d
@@ -0,0 +1,19 @@
+Code/src/uart.o: ../Code/src/uart.c \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc/stm32f10x.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc/core_cm3.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc/system_stm32f10x.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/main.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/uart.h \
+ D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/gps.h
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc/stm32f10x.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc/core_cm3.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/CMSIS/inc/system_stm32f10x.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/main.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/uart.h:
+
+D:/Projects/ARM/!ELEPH/eleph/Firmware/CubeIDE/Code/inc/gps.h:
diff --git a/Firmware/CubeIDE/Debug/Code/src/uart.o b/Firmware/CubeIDE/Debug/Code/src/uart.o
new file mode 100644
index 0000000..90f4e34
Binary files /dev/null and b/Firmware/CubeIDE/Debug/Code/src/uart.o differ
diff --git a/Firmware/CubeIDE/Debug/Code/src/uart.su b/Firmware/CubeIDE/Debug/Code/src/uart.su
new file mode 100644
index 0000000..d3aff5d
--- /dev/null
+++ b/Firmware/CubeIDE/Debug/Code/src/uart.su
@@ -0,0 +1,6 @@
+core_cm3.h:1502:22:NVIC_EnableIRQ 16 static
+uart.c:23:6:uart_dma_init 8 static
+uart.c:52:6:uart_dma_stop 4 static
+uart.c:60:6:uart_dma_restart 4 static
+uart.c:69:6:backup_and_clear_uart_buffer 16 static
+uart.c:81:6:uart_tx 16 static
diff --git a/Firmware/CubeIDE/Debug/Eleph.bin b/Firmware/CubeIDE/Debug/Eleph.bin
new file mode 100644
index 0000000..2cc6d95
Binary files /dev/null and b/Firmware/CubeIDE/Debug/Eleph.bin differ
diff --git a/Firmware/CubeIDE/Debug/Eleph.elf b/Firmware/CubeIDE/Debug/Eleph.elf
new file mode 100644
index 0000000..3266249
Binary files /dev/null and b/Firmware/CubeIDE/Debug/Eleph.elf differ
diff --git a/Firmware/CubeIDE/Debug/Eleph.hex b/Firmware/CubeIDE/Debug/Eleph.hex
new file mode 100644
index 0000000..eb81fcb
--- /dev/null
+++ b/Firmware/CubeIDE/Debug/Eleph.hex
@@ -0,0 +1,3726 @@
+:020000040800F2
+:1000000000500020BD9800080D9900080D990008C7
+:100010000D9900080D9900080D99000800000000D6
+:100020000000000000000000000000000D99000822
+:100030000D990008000000000D990008953D00088A
+:100040000D9900080D9900080D9900080D990008F8
+:100050000D9900080D9900080D9900080D990008E8
+:100060000D9900080D9900080D9900080D990008D8
+:100070000D9900080D9900080D990008F93B00083A
+:100080000D9900080D9900080D9900080D990008B8
+:100090000D9900080D9900080D990008ED3C000825
+:1000A0000D9900080D3D00080D9900080D990008F4
+:1000B000C93D00080D9900080D9900080D99000828
+:1000C0000D9900080D9900080D9900080D99000878
+:1000D0000D9900080D9900080D9900080D99000868
+:1000E000393C00080D990008000000000D99000837
+:1000F0000D9900080D9900080D9900080D99000848
+:100100000D9900080D9900080D9900080D99000837
+:100110000D9900080D9900080D9900080D99000827
+:100120000D9900080D9900080D9900080D99000817
+:1001300010B5054C237833B9044B13B10448AFF321
+:1001400000800123237010BDC800002000000000C3
+:10015000BCC9000808B5034B1BB103490348AFF302
+:10016000008008BD00000000CC000020BCC90008D1
+:1001700081F0004102E000BF83F0004330B54FEA58
+:1001800041044FEA430594EA050F08BF90EA020FC5
+:100190001FBF54EA000C55EA020C7FEA645C7FEA58
+:1001A000655C00F0E2804FEA5454D4EB5555B8BF7B
+:1001B0006D420CDD2C4480EA020281EA030382EAEC
+:1001C000000083EA010180EA020281EA0303362D7E
+:1001D00088BF30BD11F0004F4FEA01314FF4801C51
+:1001E0004CEA113102D0404261EB410113F0004F63
+:1001F0004FEA03334CEA133302D0524263EB43031A
+:1002000094EA050F00F0A780A4F10104D5F1200EB7
+:100210000DDB02FA0EFC22FA05F2801841F1000112
+:1002200003FA0EF2801843FA05F359410EE0A5F1E6
+:1002300020050EF1200E012A03FA0EFC28BF4CF017
+:10024000020C43FA05F3C01851EBE37101F00045CD
+:1002500007D54FF0000EDCF1000C7EEB00006EEBDA
+:100260000101B1F5801F1BD3B1F5001F0CD3490864
+:100270005FEA30004FEA3C0C04F101044FEA4452BB
+:1002800012F5800F80F09A80BCF1004F08BF5FEA42
+:10029000500C50F1000041EB045141EA050130BD22
+:1002A0005FEA4C0C404141EB010111F4801FA4F1C5
+:1002B0000104E9D191F0000F04BF01460020B1FA1A
+:1002C00081F308BF2033A3F10B03B3F120020CDA52
+:1002D0000C3208DD02F1140CC2F10C0201FA0CF030
+:1002E00021FA02F10CE002F11402D8BFC2F1200C95
+:1002F00001FA02F120FA0CFCDCBF41EA0C0190404B
+:10030000E41AA2BF01EB0451294330BD6FEA040493
+:100310001F3C1CDA0C340EDC04F11404C4F120027E
+:1003200020FA04F001FA02F340EA030021FA04F390
+:1003300045EA030130BDC4F10C04C4F1200220FAE7
+:1003400002F001FA04F340EA0300294630BD21FA25
+:1003500004F0294630BD94F0000F83F4801306BFEB
+:1003600081F480110134013D4EE77FEA645C18BFDF
+:100370007FEA655C29D094EA050F08BF90EA020F76
+:1003800005D054EA000C04BF1946104630BD91EA6E
+:10039000030F1EBF0021002030BD5FEA545C05D171
+:1003A0004000494128BF41F0004130BD14F58004B0
+:1003B0003CBF01F5801130BD01F0004545F0FE4124
+:1003C00041F470014FF0000030BD7FEA645C1ABF59
+:1003D000194610467FEA655C1CBF0B46024650EA90
+:1003E000013406BF52EA033591EA030F41F40021BC
+:1003F00030BD00BF90F0000F04BF0021704730B542
+:100400004FF4806404F132044FF000054FF0000116
+:1004100050E700BF90F0000F04BF0021704730B5D7
+:100420004FF4806404F1320410F0004548BF4042AC
+:100430004FF000013EE700BF42004FEAE2014FEA01
+:1004400031014FEA02701FBF12F07F4393F07F4FDC
+:1004500081F06051704732F07F4208BF704793F0DF
+:100460007F4F04BF41F40021704730B54FF46074F2
+:1004700001F0004521F000411CE700BF50EA0102F5
+:1004800008BF704730B54FF000050AE050EA01029E
+:1004900008BF704730B511F0004502D5404261EB0E
+:1004A00041014FF4806404F132045FEA915C3FF44F
+:1004B000D8AE4FF003025FEADC0C18BF03325FEAEC
+:1004C000DC0C18BF033202EBDC02C2F1200300FA9D
+:1004D00003FC20FA02F001FA03FE40EA0E0021FAC2
+:1004E00002F11444BDE600BF70B54FF0FF0C4CF4B0
+:1004F000E06C1CEA11541DBF1CEA135594EA0C0F62
+:1005000095EA0C0F00F0DEF82C4481EA030621EA9C
+:100510004C5123EA4C5350EA013518BF52EA0335D7
+:1005200041F4801143F4801338D0A0FB02CE4FF089
+:100530000005E1FB02E506F00042E0FB03E54FF0B9
+:100540000006E1FB03569CF0000F18BF4EF0010EB1
+:10055000A4F1FF04B6F5007F64F5407404D25FEAAD
+:100560004E0E6D4146EB060642EAC62141EA555160
+:100570004FEAC52040EA5E504FEACE2EB4F1FD0CA2
+:1005800088BFBCF5E06F1ED8BEF1004F08BF5FEA20
+:10059000500E50F1000041EB045170BD06F00046D2
+:1005A00046EA010140EA020081EA0301B4EB5C047F
+:1005B000C2BFD4EB0C0541EA045170BD41F4801177
+:1005C0004FF0000E013C00F3AB8014F1360FDEBF9C
+:1005D000002001F0004170BDC4F10004203C35DA78
+:1005E0000C341BDC04F11404C4F1200500FA05F3FB
+:1005F00020FA04F001FA05F240EA020001F000429C
+:1006000021F0004110EBD37021FA04F642EB060111
+:100610005EEA430E08BF20EAD37070BDC4F10C043B
+:10062000C4F1200500FA04F320FA05F001FA04F2FF
+:1006300040EA020001F0004110EBD37041F10001EB
+:100640005EEA430E08BF20EAD37070BDC4F12005F6
+:1006500000FA05F24EEA020E20FA04F301FA05F25E
+:1006600043EA020321FA04F001F0004121FA04F206
+:1006700020EA020000EBD3705EEA430E08BF20EAD6
+:10068000D37070BD94F0000F0FD101F00046400010
+:1006900041EB010111F4801F08BF013CF7D041EA92
+:1006A000060195F0000F18BF704703F00046520096
+:1006B00043EB030313F4801F08BF013DF7D043EA67
+:1006C0000603704794EA0C0F0CEA135518BF95EA1D
+:1006D0000C0F0CD050EA410618BF52EA4306D1D1A4
+:1006E00081EA030101F000414FF0000070BD50EAC3
+:1006F000410606BF1046194652EA430619D094EA4D
+:100700000C0F02D150EA013613D195EA0C0F05D136
+:1007100052EA03361CBF104619460AD181EA03018A
+:1007200001F0004141F0FE4141F470014FF0000042
+:1007300070BD41F0FE4141F4780170BD70B54FF0DD
+:10074000FF0C4CF4E06C1CEA11541DBF1CEA13555D
+:1007500094EA0C0F95EA0C0F00F0A7F8A4EB05043F
+:1007600081EA030E52EA03354FEA013100F0888036
+:100770004FEA03334FF0805545EA131343EA1263FF
+:100780004FEA022245EA111545EA10654FEA0026B4
+:100790000EF000419D4208BF964244F1FD0404F56D
+:1007A000407402D25B084FEA3202B61A65EB0305C9
+:1007B0005B084FEA32024FF480104FF4002CB6EB86
+:1007C000020E75EB030E22BFB61A754640EA0C0006
+:1007D0005B084FEA3202B6EB020E75EB030E22BF46
+:1007E000B61A754640EA5C005B084FEA3202B6EB87
+:1007F000020E75EB030E22BFB61A754640EA9C0046
+:100800005B084FEA3202B6EB020E75EB030E22BF15
+:10081000B61A754640EADC0055EA060E18D04FEAD3
+:10082000051545EA16754FEA06164FEAC30343EA73
+:1008300052734FEAC2025FEA1C1CC0D111F4801F40
+:100840000BD141EA00014FF000004FF0004CB6E739
+:1008500011F4801F04BF01430020B4F1FD0C88BFD8
+:10086000BCF5E06F3FF6AFAEB5EB030C04BFB6EBE3
+:10087000020C5FEA500C50F1000041EB045170BDD6
+:100880000EF0004E4EEA113114EB5C04C2BFD4EB03
+:100890000C0541EA045170BD41F480114FF0000E87
+:1008A000013C90E645EA060E8DE60CEA135594EA03
+:1008B0000C0F08BF95EA0C0F3FF43BAF94EA0C0F06
+:1008C0000AD150EA01347FF434AF95EA0C0F7FF47B
+:1008D00025AF104619462CE795EA0C0F06D152EACF
+:1008E00003353FF4FDAE1046194622E750EA4106B3
+:1008F00018BF52EA43067FF4C5AE50EA41047FF4C4
+:100900000DAF52EA43057FF4EBAE12E74FF0FF3C28
+:1009100006E000BF4FF0010C02E000BF4FF0010CF9
+:100920004DF804CD4FEA410C7FEA6C5C4FEA430C72
+:1009300018BF7FEA6C5C1BD001B050EA410C0CBFC1
+:1009400052EA430C91EA030F02BF90EA020F002023
+:10095000704710F1000F91EA030F58BF994208BF8A
+:1009600090422CBFD8176FEAE37040F00100704747
+:100970004FEA410C7FEA6C5C02D150EA013C07D19E
+:100980004FEA430C7FEA6C5CD6D152EA033CD3D0E9
+:100990005DF8040B704700BF8446104662468C46E3
+:1009A0001946634600E000BF01B5FFF7B7FF002816
+:1009B00048BF10F1000F01BD4DF808EDFFF7F4FF3F
+:1009C0000CBF012000205DF808FB00BF4DF808EDCA
+:1009D000FFF7EAFF34BF012000205DF808FB00BFED
+:1009E0004DF808EDFFF7E0FF94BF012000205DF80F
+:1009F00008FB00BF4DF808EDFFF7CEFF94BF0120C4
+:100A000000205DF808FB00BF4DF808EDFFF7C4FFBC
+:100A100034BF012000205DF808FB00BF4FEA410C05
+:100A20007FEA6C5C02D150EA013C0AD14FEA430CE8
+:100A30007FEA6C5C02D152EA033C02D14FF0000025
+:100A400070474FF0010070474FEA410212F5001263
+:100A500015D211D56FF47873B3EB625212D94FEA05
+:100A6000C12343F0004343EA505311F0004F23FAEF
+:100A700002F018BF404270474FF00000704750EA44
+:100A8000013005D111F0004008BF6FF00040704701
+:100A90004FF00000704700BF4A0011D212F500125B
+:100AA00011D20DD56FF47873B3EB62520ED44FEAC6
+:100AB000C12343F0004343EA505323FA02F0704746
+:100AC0004FF00000704750EA013002D14FF0FF3084
+:100AD00070474FF0000070474FEA4102B2F1E04327
+:100AE00024BFB3F5001CDCF1FE5C0DD901F0004C15
+:100AF0004FEAC0024CEA5070B2F1004F40EB830065
+:100B000008BF20F00100704711F0804F21D113F190
+:100B10003872BCBF01F00040704741F480114FEAC9
+:100B20005252C2F11802C2F1200C10FA0CF320FA52
+:100B300002F018BF40F001004FEAC1234FEAD3236F
+:100B400003FA0CFC40EA0C0023FA02F34FEA4303D9
+:100B5000CCE77FEA625307D150EA01331EBF4FF062
+:100B6000FE4040F44000704701F0004040F0FE407D
+:100B700040F40000704700BF80F0004002E000BF7A
+:100B800081F0004142001FBF5FEA410392EA030F78
+:100B90007FEA226C7FEA236C6AD04FEA1262D2EBC2
+:100BA0001363C1BFD218414048404140B8BF5B42C7
+:100BB000192B88BF704710F0004F40F4000020F060
+:100BC0007F4018BF404211F0004F41F4000121F076
+:100BD0007F4118BF494292EA030F3FD0A2F10102C0
+:100BE00041FA03FC10EB0C00C3F1200301FA03F1FE
+:100BF00000F0004302D5494260EB4000B0F5000F21
+:100C000013D3B0F1807F06D340084FEA310102F1DF
+:100C10000102FE2A51D2B1F1004F40EBC25008BF91
+:100C200020F0010040EA03007047490040EB00005B
+:100C300010F4000FA2F10102EDD1B0FA80FCACF18A
+:100C4000080CB2EB0C0200FA0CF0AABF00EBC25089
+:100C500052421843BCBFD0401843704792F0000F77
+:100C600081F4000106BF80F400000132013BB5E7CA
+:100C70004FEA41037FEA226C18BF7FEA236C21D040
+:100C800092EA030F04D092F0000F08BF08467047A5
+:100C900090EA010F1CBF0020704712F07F4F04D173
+:100CA000400028BF40F00040704712F100723CBF86
+:100CB00000F50000704700F0004343F0FE4040F4B0
+:100CC000000070477FEA226216BF08467FEA23636E
+:100CD0000146420206BF5FEA412390EA010F40F459
+:100CE000800070474FF0000304E000BF10F00043A5
+:100CF00048BF40425FEA000C08BF704743F096438C
+:100D000001464FF000001CE050EA010208BF7047A6
+:100D10004FF000030AE000BF50EA010208BF70472D
+:100D200011F0004302D5404261EB41015FEA010C42
+:100D300002BF84460146002043F0B64308BFA3F13A
+:100D40008053A3F50003BCFA8CF2083AA3EBC2531C
+:100D500010DB01FA02FC634400FA02FCC2F120023B
+:100D6000BCF1004F20FA02F243EB020008BF20F072
+:100D70000100704702F1200201FA02FCC2F12002D8
+:100D800050EA4C0021FA02F243EB020008BF20EACD
+:100D9000DC7070474FF0FF0C1CEAD0521EBF1CEAFB
+:100DA000D15392EA0C0F93EA0C0F6FD01A4480EAE9
+:100DB000010C400218BF5FEA41211ED04FF00063D2
+:100DC00043EA501043EA5111A0FB01310CF00040FE
+:100DD000B1F5000F3EBF490041EAD3715B0040EA24
+:100DE000010062F17F02FD2A1DD8B3F1004F40EBF4
+:100DF000C25008BF20F00100704790F0000F0CF0C7
+:100E0000004C08BF49024CEA502040EA51207F3A8A
+:100E1000C2BFD2F1FF0340EAC250704740F4000065
+:100E20004FF00003013A5DDC12F1190FDCBF00F056
+:100E300000407047C2F10002410021FA02F1C2F104
+:100E4000200200FA02FC5FEA310040F1000053EAA0
+:100E50004C0308BF20EADC70704792F0000F00F0EE
+:100E6000004C02BF400010F4000F013AF9D040EAF4
+:100E70000C0093F0000F01F0004C02BF490011F488
+:100E8000000F013BF9D041EA0C018FE70CEAD15386
+:100E900092EA0C0F18BF93EA0C0F0AD030F0004C06
+:100EA00018BF31F0004CD8D180EA010000F00040BA
+:100EB000704790F0000F17BF90F0004F084691F078
+:100EC000000F91F0004F14D092EA0C0F01D14202B2
+:100ED0000FD193EA0C0F03D14B0218BF084608D17B
+:100EE00080EA010000F0004040F0FE4040F40000C5
+:100EF000704740F0FE4040F4400070474FF0FF0C58
+:100F00001CEAD0521EBF1CEAD15392EA0C0F93EA9E
+:100F10000C0F69D0A2EB030280EA010C49024FEAF0
+:100F2000402037D04FF0805343EA111143EA1013A9
+:100F30000CF000408B4238BF5B0042F17D024FF461
+:100F4000000C8B4224BF5B1A40EA0C00B3EB510F3C
+:100F500024BFA3EB510340EA5C00B3EB910F24BF25
+:100F6000A3EB910340EA9C00B3EBD10F24BFA3EBAA
+:100F7000D10340EADC001B0118BF5FEA1C1CE0D172
+:100F8000FD2A3FF650AF8B4240EBC25008BF20F025
+:100F9000010070470CF0004C4CEA50207F32C2BF79
+:100FA000D2F1FF0340EAC250704740F400004FF016
+:100FB0000003013A37E792F0000F00F0004C02BF47
+:100FC000400010F4000F013AF9D040EA0C0093F011
+:100FD000000F01F0004C02BF490011F4000F013B6B
+:100FE000F9D041EA0C0195E70CEAD15392EA0C0FD3
+:100FF00008D142027FF47DAF93EA0C0F7FF470AF0B
+:10100000084676E793EA0C0F04D14B023FF44CAF4D
+:1010100008466EE730F0004C18BF31F0004CCAD1E2
+:1010200030F000427FF45CAF31F000437FF43CAF1E
+:101030005FE700BF4FF0FF3C06E000BF4FF0010C40
+:1010400002E000BF4FF0010C4DF804CD4FEA400222
+:101050004FEA41037FEA226C18BF7FEA236C11D06C
+:1010600001B052EA530C18BF90EA010F58BFB2EB1F
+:10107000030088BFC81738BF6FEAE17018BF40F09F
+:10108000010070477FEA226C02D15FEA402C05D153
+:101090007FEA236CE4D15FEA412CE1D05DF8040BD8
+:1010A000704700BF844608466146FFE70FB5FFF76B
+:1010B000C9FF002848BF10F1000F0FBD4DF808ED23
+:1010C000FFF7F4FF0CBF012000205DF808FB00BF14
+:1010D0004DF808EDFFF7EAFF34BF012000205DF86E
+:1010E00008FB00BF4DF808EDFFF7E0FF94BF0120BB
+:1010F00000205DF808FB00BF4DF808EDFFF7D2FFB8
+:1011000094BF012000205DF808FB00BF4DF808EDFA
+:10111000FFF7C8FF34BF012000205DF808FB00BFC7
+:101120004FEA4002B2F1FE4F0FD34FF09E03B3EBF4
+:1011300012620DD94FEA002343F0004310F0004F34
+:1011400023FA02F018BF404270474FF0000070478A
+:1011500012F1610F01D1420205D110F0004008BF29
+:101160006FF0004070474FF00000704742000ED211
+:10117000B2F1FE4F0BD34FF09E03B3EB126209D4D2
+:101180004FEA002343F0004323FA02F070474FF088
+:101190000000704712F1610F01D1420202D14FF0FD
+:1011A000FF3070474FF00000704700BF80B500AFC0
+:1011B000154B1B68144A43F001031360124B5A6825
+:1011C0001149124B13404B600F4B1B680E4A23F022
+:1011D000847323F4803313600B4B1B680A4A23F497
+:1011E00080231360084B5B68074A23F4FE035360B7
+:1011F000054B4FF41F029A6000F00CF8044B4FF0BF
+:1012000000629A6000BF80BD001002400000FFF83D
+:1012100000ED00E080B500AF00F002F800BF80BD37
+:1012200080B483B000AF00237B6000233B603A4B67
+:101230001B68394A43F480331360374B1B6803F44F
+:1012400000333B607B6801337B603B68002B03D13C
+:101250007B68B3F5A06FF0D12F4B1B6803F400330C
+:10126000002B02D001233B6001E000233B603B6880
+:10127000012B4BD1294B1B68284A43F01003136004
+:10128000264B1B68254A23F003031360234B1B687E
+:10129000224A43F0020313601F4B1F4A5B685360EE
+:1012A0001D4B1D4A5B6853601B4B5B681A4A43F435
+:1012B00080635360184B5B68174A23F47C135360B8
+:1012C000154B5B68144A43F4E8135360124B1B68D8
+:1012D000114A43F08073136000BF0F4B1B6803F08B
+:1012E0000073002BF9D00C4B5B680B4A23F003030F
+:1012F0005360094B5B68084A43F00203536000BF28
+:10130000054B5B6803F00C03082BF9D100BF0C37C9
+:10131000BD4680BC704700BF001002400020024064
+:1013200080B500AF204B5B681F4A23F440435360F5
+:101330001D4B9B691C4A43F4007393611B4B1B6953
+:101340001A4A43F002031361184BDB6A174A23F46D
+:101350007003D362154B5B6B144A23F01F03536376
+:10136000124B9B68114A43F4801393600F4B9B68A8
+:101370000E4A43F4602393600C4B9B680B4A43F086
+:10138000010393600A4807F04FF8084B9B68074A2F
+:1013900043F00403936000BF044B9B6803F0040315
+:1013A000002BF9D100BF80BD001002400024014095
+:1013B000A08601000000000080B500AF4E4B1B78F6
+:1013C0000133DAB24C4B1A704B4B1B78092B7ED988
+:1013D000494B00221A7000F0A9FC642007F024F8A1
+:1013E000464B9B68454A43F48003936000BF434BE0
+:1013F0001B6803F00203002BF9D000F0A3FC3F4B65
+:10140000DB6C1846FFF76EFC02463D4B1946104652
+:10141000FFF7C0FC03464FF08B411846FFF76EFD07
+:10142000034619461846FFF7ADFB03461A46354BEF
+:101430001A60344B1B681846FEF7FEFF26A3D3E95B
+:101440000023FFF7E1FA0346002B04D0042101201A
+:1014500001F0B6F93BE02B4B1B681846FEF7ECFF9A
+:101460001FA3D3E90023FFF7CFFA0346002B04D0D4
+:101470000321012001F0A4F929E0224B1B68184642
+:10148000FEF7DAFF18A3D3E90023FFF7BDFA0346FE
+:10149000002B04D00221012001F092F917E0194B32
+:1014A0001B681846FEF7C8FF11A3D3E90023FFF716
+:1014B000ABFA0346002B04D00121012001F080F992
+:1014C00005E00021012001F07BF9012300E0002369
+:1014D000184680BDAFF300803333333333330F40CE
+:1014E000CDCCCCCCCCCC0C406666666666660A4039
+:1014F000CDCCCCCCCCCC0840E40000200024014072
+:10150000333353402801002080B400AF024B1B68E6
+:101510001846BD4680BC70472801002080B483B0C7
+:1015200000AF6B4B1B6840F2DB52934205D8684B0F
+:101530001B680133664A1360C3E0654B00221A60E2
+:10154000644B9B68644A1360634B1B6803F03E0363
+:10155000614A1360604B1B685B085F4A136000239D
+:10156000FB7126E05C4B1A68FB7922FA03F303F067
+:101570000103002B0DD0FB79584AD35C0F2B15D8F3
+:10158000FB79564AD25CFB790132D1B2534AD1542D
+:101590000CE0FB79514AD35C002B07D0FB794F4A12
+:1015A000D25CFB79013AD1B24C4AD154FB79013378
+:1015B000FB71FB79042BD5D90023BB7121E0BB79EA
+:1015C000464AD35C0C2B0AD9BA79BB794449895C69
+:1015D000444AD154BB79424A0121D1540EE0BB792F
+:1015E0003E4AD35C032B09D8BA79BB793C49895C64
+:1015F0003C4AD154BB793A4A0021D154BB790133DA
+:10160000BB71BB79042BDAD900237B7156E07B795F
+:10161000334AD35C002B24D17B79334A32F8133020
+:101620004FF6FF7293421CD07B792F4A32F8132079
+:10163000013291B22C4A22F813107A797B792B4926
+:10164000895C2B4AD1547B79274A32F81330B3F5A1
+:10165000AF7F8CBF01230023DAB27B791146234A86
+:10166000D1547B791E4AD35C012B14D17B791D4A5E
+:10167000D35C002B0FD17B791B4A002122F8131079
+:101680007B791A4AD35C002B05D17B795B00DBB2F6
+:101690000133DBB216E07B79144AD35C012B0AD10B
+:1016A0007B79134AD35C002B05D17B790133DBB204
+:1016B0005B00DBB206E07B7901337B717B79042B25
+:1016C000A5D9002318460C37BD4680BC704700BF23
+:1016D000E800002000080140EC000020000000208D
+:1016E0000800002010000020F0000020FC00002076
+:1016F0000401002080B483B000AF0346FB71FB7986
+:1017000003F01F03012202FA03F1054A97F907309B
+:101710005B0942F8231000BF0C37BD4680BC704700
+:1017200000E100E080B500AF984B9B69974A43F019
+:1017300004039361964B1B68954A23F003031360DF
+:10174000934B1B68924A23F00C031360904B1B6869
+:101750008F4A23F0300313608D4B1B688C4A23F0B3
+:10176000400313608A4B1B68894A43F0800313606F
+:10177000874BDB68864A43F00203D360844B1B68C7
+:10178000834A23F440731360814B1B68804A23F41F
+:10179000806313607E4B1B687D4A43F400631360D3
+:1017A0007B4BDB687A4A43F00403D360784B1B68B9
+:1017B000774A23F440531360754B1B68744A23F433
+:1017C00080431360724B1B68714A43F400431360FB
+:1017D0006F4BDB686E4A43F00803D3606C4B1B68A9
+:1017E0006B4A23F440331360694B1B68684A23F447
+:1017F00080231360664B1B68654A43F40023136023
+:10180000634BDB68624A43F01003D360604B1B6894
+:101810005F4A23F4401313605D4B1B685C4A23F45A
+:10182000800313605A4B1B68594A43F4000313604A
+:10183000574BDB68564A43F02003D360544B1B6878
+:10184000534A43F040731360514B1B68504A23F0D6
+:10185000406313604E4B1B684D4A43F04053136086
+:101860004B4B1B684A4A23F080431360484B1B686C
+:10187000474A43F000431360454B5B68444A43F0DA
+:1018800003035360424B5B68414A23F00C035360EF
+:101890003F4B5B683E4A43F0300353603C4B5B6810
+:1018A0003B4A23F040035360394B5B68384A43F0AE
+:1018B00080035360364B5B68354A23F440735360B2
+:1018C000334B5B68324A43F480635360304B5B6850
+:1018D0002F4A23F4006353602D4B5B682C4A23F49A
+:1018E000405353602A4B5B68294A23F4804353607A
+:1018F000274B5B68264A43F400435360244BDB6864
+:10190000234A23F40063D360214B5B68204A23F40D
+:10191000405353601E4B5B681D4A23F48043536061
+:101920001B4B5B681A4A43F400435360184BDB6857
+:10193000174A23F40063D360154B5B68144A43F0E5
+:1019400040535360124B5B68114A23F0404353608D
+:101950000E4B9B690D4A43F0080393610D4B1B68C6
+:101960000C4A43F0030313600A4B1B68094A23F037
+:101970000C031360074B1B68064A43F030031360E7
+:10198000044B1B68034A23F0C00305E0001002402B
+:1019900000080140000C01401360624B1B68614A63
+:1019A00043F4405313605F4B1B685E4A23F480434B
+:1019B00013605C4B1B685B4A43F400431360594B54
+:1019C0001B68584A23F440331360564B1B68554A32
+:1019D00043F480231360534B1B68524A23F40023C3
+:1019E0001360504B1B684F4A43F4401313604D4B38
+:1019F0001B684C4A23F4800313604A4B1B68494A16
+:101A000043F400031360474B1B68464A23F04073BE
+:101A10001360444B1B68434A23F080631360414BBF
+:101A20001B68404A43F0006313603E4BDB683D4A4D
+:101A300043F04003D3603B4B1B683A4A43F04053AA
+:101A40001360384B1B68374A23F040431360354B13
+:101A50005B68344A43F440735360324B5B68314AED
+:101A600043F4406353602F4B5B682E4A43F440536A
+:101A700053602C4B5B682B4A43F440435360294B23
+:101A80005B68284A43F440335360264B5B68254A21
+:101A900023F440235360234B5B68224A43F44013F2
+:101AA0005360204B5B681F4A23F4800353601D4B37
+:101AB0005B681C4A43F4000353601A4B5B68194A85
+:101AC00043F040735360174B5B68164A23F0406342
+:101AD0005360144B5B68134A43F040535360114BFF
+:101AE0005B68104A23F0804353600E4B5B680D4ADD
+:101AF00043F0004353600C4B9B690B4A43F01003C7
+:101B000093610A4B5B68094A43F440135360074BE7
+:101B10005B68064A23F44003536000F083F800BF7B
+:101B200080BD00BF000C01400010024000100140C9
+:101B300080B500AF194B9B69184A43F001039361CC
+:101B4000174B174A1B691361164B9B68154A43F4E0
+:101B500000639360134B1B68124A43F400631360E5
+:101B60002820FFF7C7FD0E4BDB680D4A43F4807356
+:101B7000D3600C4BDB680B4A43F04003D360094B46
+:101B80001B68084A43F0400313601720FFF7B2FDBB
+:101B9000044B054A5A6100BF80BD00BF00100240DF
+:101BA0000000014000040140FFFF070080B400AFC7
+:101BB000034B01221A6100BFBD4680BC704700BFC5
+:101BC000000C014080B400AF034B4FF480321A6127
+:101BD00000BFBD4680BC7047000C014080B400AF20
+:101BE000034B02221A6100BFBD4680BC704700BF94
+:101BF000000C014080B400AF034B4FF400321A6177
+:101C000000BFBD4680BC7047000C014080B400AFEF
+:101C1000034B4FF000521A6100BFBD4680BC7047B5
+:101C20000010014080B400AF034B4FF400521A6122
+:101C300000BFBD4680BC70470010014080B400AFBB
+:101C4000034B80221A6100BFBD4680BC704700BFB5
+:101C5000000C014080B400AF034B4FF400021A6146
+:101C600000BFBD4680BC7047000C014080B400AF8F
+:101C7000034B4FF000421A6100BFBD4680BC704765
+:101C80000008014080B400AF034B4FF400421A61DA
+:101C900000BFBD4680BC70470008014080B400AF63
+:101CA000034B4FF080721A6100BFBD4680BC704785
+:101CB0000008014080B400AF034B4FF480721A61FA
+:101CC00000BFBD4680BC70470008014080B400AF33
+:101CD000034B4FF480421A6100BFBD4680BC704781
+:101CE000000C014080B400AF034B4FF080421A61FA
+:101CF00000BFBD4680BC7047000C014080B400AFFF
+:101D0000034B4FF080521A6100BFBD4680BC704744
+:101D1000000C014080B400AF034B4FF480521A61B5
+:101D200000BFBD4680BC7047000C014080B400AFCE
+:101D3000034B40221A6100BFBD4680BC704700BF04
+:101D40000008014080B400AF034B4FF480021A61D9
+:101D500000BFBD4680BC70470008014080B500AFA1
+:101D60006C220021114807F002FE00F0C3F903467F
+:101D7000002B17D000F098FA0346002B12D000F089
+:101D800009FB0346002B0DD000F07AFB0346002B25
+:101D900008D040220021064807F0E9FD00F00AF8CB
+:101DA000012300E00023184680BD00BF8805002005
+:101DB0003801002098B500AF8B4B1A788B4B1A7006
+:101DC000894B5A78894B5A70884B00229A70874801
+:101DD00006F0DAFC0346DAB2854B1A70824B9A7829
+:101DE000824B1A70804BDA78804B5A707F4B0022FE
+:101DF0009A707E4806F0C8FC0346DAB27C4B5A70F3
+:101E0000794B1A79794B1A70774B5A79774B5A700C
+:101E1000764B00229A70754806F0B6FC0346DAB29B
+:101E2000734B9A70704B1A7B704B1A706E4B5A7BC7
+:101E30006E4B5A706D4B00229A706C4806F0A4FCF1
+:101E40000346DAB26A4BDA70674B9A7B674B1A70BB
+:101E5000654BDA7B654B5A70644B00229A7063487D
+:101E600006F092FC0346DAB2614B1A715E4B1A7CA3
+:101E70005E4B1A705C4B5A7C5C4B5A705B4B002279
+:101E80009A705A4806F080FC0346DAB2584B5A71F1
+:101E9000554B5A7D554B1A70534B9A7D534B5A7084
+:101EA000524B00229A70514806F06EFC0346DAB29B
+:101EB000504B1A70504806F0C7FA02464F4B1A6052
+:101EC0004E4B1B684E491846FFF718F803461A4652
+:101ED0004A4B1A60474B1B781846FEF707FF02462D
+:101EE000464B1B6819461046FEF74CFE03461A4641
+:101EF000424B1A603C4B93F82130532B10D13F4B8F
+:101F00001B681846FEF798FA03460C461846214609
+:101F1000FEF7E2FD034683F00043354A936003E099
+:101F2000364B1B68324A9360314B9B681846FEF76C
+:101F300083FA344B18CB1A462346FEF7D5FA0346EC
+:101F40000C462B4AC2E90434274B93F82520274B33
+:101F50001A70254B93F82620244B5A70224B93F885
+:101F60002720224B9A70214B0022DA701F4806F07E
+:101F70000BFC0346DAB21F4B1A70234806F064FAD2
+:101F800002461E4B1A601D4B1B681D491846FEF782
+:101F9000B5FF03461A46194B1A60164B1B781846B4
+:101FA000FEF7A4FE0246154B1B6819461046FEF7C5
+:101FB000E9FD03461A46114B1A600B4B93F8323079
+:101FC000572B23D10D4B1B681846FEF735FA0346F5
+:101FD0000C4618462146FEF77FFD034683F000437A
+:101FE000034A936116E000BF8805002078010020B5
+:101FF00038010020F40500209F050020300100205A
+:102000000000704240CF0008B00500202D4B1B6837
+:102010002D4A93612C4B9B691846FEF70DFA2B4B0A
+:1020200018CB1A462346FEF75FFA03460C46264AAB
+:10203000C2E90834264806F007FA0246254B19463D
+:102040001046FEF7A7FE03461A461F4B9A62224827
+:1020500006F0FAF902461C4BDA62204806F0F4F961
+:102060000246194B1A631E4806F08EFB0346DAB28D
+:10207000154B83F834201B4806F086FB0346DAB282
+:10208000114B83F83520184B93F84830412B04D17D
+:102090000D4B012283F8362003E00B4B002283F81E
+:1020A0003620124806F070FB0346DAB2064B83F87E
+:1020B00037200F4806F0C8F90246034B9A6300BF69
+:1020C00098BD00BF300100203801002040CF00083B
+:1020D000BE050020560EED3FC8050020D4050020A7
+:1020E000DE050020E305002088050020E80500202B
+:1020F000EC05002080B582B000AF0023FB71002307
+:10210000BB710023BB8002E0BB880133BB80BB886E
+:10211000634AD35C242B11D1BB880333604AD35C60
+:10212000522B0BD1BB8804335D4AD35C4D2B05D1B8
+:10213000BB8805335A4AD35C432B03D0BB88B3F525
+:10214000806FE1D3BB88184600F002FA0346002BEB
+:1021500001D10023A0E0BB8806337B8096E07B881A
+:102160004F4AD35C2A2B01D1012395E07B884C4A4E
+:10217000D35C2C2B05D1FB790133FB710023BB71A0
+:1021800081E0FB79013B082B7CD801A252F823F0B7
+:10219000B5210008C9210008E1210008F721000845
+:1021A0000F220008272200083F22000857220008BB
+:1021B0006F2200087A88BB79591CB9711946384BCF
+:1021C0009A5C384B5A545EE07A88BB79591CB971D5
+:1021D0001946334B9A5C334B0B4483F8482052E04A
+:1021E0007A88BB79591CB97119462D4B9A5C2D4BD5
+:1021F0000B445A7547E07A88BB79591CB971194666
+:10220000274B9A5C274B0B4483F821203BE07A88CC
+:10221000BB79591CB9711946214B9A5C214B0B446F
+:1022200083F825202FE07A88BB79591CB9711946AB
+:102230001B4B9A5C1B4B0B4483F8322023E07A88BB
+:10224000BB79591CB9711946154B9A5C154B0B4457
+:1022500083F8362017E07A88BB79591CB971194682
+:102260000F4B9A5C0F4B0B4483F840200BE07A88AD
+:10227000BB79591CB9711946094B9A5C094B0B443F
+:102280001A7300E000BF7B8801337B807B88B3F545
+:10229000806FFFF464AF012318460837BD4680BD48
+:1022A000880100208805002080B582B000AF00239F
+:1022B000FB710023BB710023BB8002E0BB880133AC
+:1022C000BB80BB88314AD35C242B11D1BB8803333C
+:1022D0002E4AD35C472B0BD1BB8804332B4AD35CEB
+:1022E000472B05D1BB880533284AD35C412B03D04B
+:1022F000BB88B3F5806FE1D3BB88184600F028F99E
+:102300000346002B01D100233BE0BB8806337B80D2
+:1023100032E07B881D4AD35C2A2B01D1012330E0B7
+:102320007B881A4AD35C2C2B05D1FB790133FB71D6
+:102330000023BB711DE0FB79072B02D0092B0CD0C9
+:1023400017E07A88BB79591CB97119460F4B9A5C12
+:102350000F4B0B4483F85B200BE07A88BB79591C48
+:10236000B9711946094B9A5C094B0B4483F84C2010
+:1023700000BF7B8801337B807B88B3F5806FC8D337
+:10238000012318460837BD4680BD00BF88010020E4
+:102390008805002080B582B000AF0023FB710023C8
+:1023A000BB710023BB8002E0BB880133BB80BB88CC
+:1023B000314AD35C242B11D1BB8803332E4AD35C22
+:1023C000472B0BD1BB8804332B4AD35C532B05D14D
+:1023D000BB880533284AD35C412B03D0BB88B3F5B7
+:1023E000806FE1D3BB88184600F0B2F80346002B9B
+:1023F00001D100233BE0BB8806337B8032E07B8841
+:102400001D4AD35C2A2B01D1012330E07B881A4A74
+:10241000D35C2C2B05D1FB790133FB710023BB71FD
+:102420001DE0FB79022B02D00F2B0CD017E07A882D
+:10243000BB79591CB97119460F4B9A5C0F4B0B4471
+:1024400083F860200BE07A88BB79591CB971194672
+:10245000094B9A5C094B0B4483F8642000BF7B88CE
+:1024600001337B807B88B3F5806FC8D30123184686
+:102470000837BD4680BD00BF8801002088050020C8
+:1024800080B582B000AF0023FB710023BB71002335
+:10249000BB8002E0BB880133BB80BB882A4AD35C87
+:1024A000242B11D1BB880333274AD35C472B0BD194
+:1024B000BB880433244AD35C532B05D1BB88053336
+:1024C000214AD35C562B03D0BB88B3F5806FE1D390
+:1024D000BB88184600F03CF80346002B01D10023CE
+:1024E0002DE0BB8806337B8024E07B88164AD35CD2
+:1024F0002A2B01D1012322E07B88134AD35C2C2BA9
+:1025000005D1FB790133FB710023BB710FE0FB792F
+:10251000032B00D00BE07A88BB79591CB97119469E
+:10252000094B9A5C094B0B4483F8562000BF7B880B
+:1025300001337B807B88B3F5806FD6D301231846A7
+:102540000837BD4680BD00BF8801002088050020F7
+:1025500080B485B000AF0346FB800023FB730023EB
+:10256000BB73FB880133FB800EE0FB88274AD25CFB
+:10257000FB7B5340FB73FB880133FB80FB88B3F587
+:10258000806F01D300233BE0FB88204AD35C2A2BD9
+:10259000EBD1FB880133FB80FB881C4AD35C402BCA
+:1025A00007D9FB88194AD35C373BDBB21B01BB73ED
+:1025B00006E0FB88154AD35C303BDBB21B01BB73E2
+:1025C000FB880133FB80FB88104AD35C402B08D981
+:1025D000FB880E4AD25CBB7B1344DBB2373BBB7338
+:1025E00007E0FB88094AD25CBB7B1344DBB2303B7B
+:1025F000BB73BA7BFB7B9A4201D1012300E000232D
+:1026000018461437BD4680BC704700BF88010020C3
+:1026100080B400AF034B93F836301846BD4680BCFB
+:10262000704700BF3801002080B400AF024B18464D
+:10263000BD4680BC704700BF8801002080B400AF59
+:10264000024B1846BD4680BC704700BF880500207D
+:1026500080B400AF024B1846BD4680BC704700BF37
+:102660003801002080B400AF184BDB69174A43F4EF
+:102670008003D361164B9B889BB2154A23F03F031E
+:102680009BB29380124B9B889BB2114A43F00A0382
+:102690009BB293800E4B9B8B9BB20D4A43F0B403CD
+:1026A0009BB293830A4B1B8C9BB2094A43F02503D0
+:1026B0009BB21384064B1B889BB2054A43F001036F
+:1026C0009BB2138000BFBD4680BC70470010024023
+:1026D0000058004080B582B000AF0123FB7117E0C5
+:1026E000FA7913469B0013449B002D4A134414228D
+:1026F0000021184607F03BF9FB79DB00294A134417
+:1027000008220021184607F032F9FB790133FB71EA
+:10271000FB79062BE4D906F00FF90246224B1A602A
+:10272000FFF796FF0246214B1A6006F06BFB02464C
+:102730001F4B1A6006F070FB02461E4B1A601A4BC4
+:102740001B681A781C4B1A701B4B1B7819461B4AC6
+:102750000B465B000B44DB00134401221A70124B42
+:102760001B68154A1278114658780D4A0B469B0093
+:102770000B449B00134402461A700B4B1B680E4A15
+:10278000127811469878064A0B469B000B449B0032
+:102790001344013302461A7000BF0837BD4680BD9E
+:1027A00040070020000700201C060020140600201F
+:1027B0003C070020180600203807002020060020D3
+:1027C00080B485B000AF03460A46FB711346BB7167
+:1027D000FB79013B032B1FD801A252F823F000BF65
+:1027E000F1270008FB270008052800080F2800082B
+:1027F0000723FB730023BB730EE00823FB73032343
+:10280000BB7309E01023FB730423BB7304E0202394
+:10281000FB730523BB7300BF264B1B781946264A62
+:102820000B469B000B449B00134402331B785AB2A7
+:1028300097F90F30DB435BB213405AB21D4B1B7844
+:102840001946D0B21C4A0B469B000B449B00134414
+:10285000023302461A70FA7BBB7B42FA03F35AB288
+:1028600097F9063013405BB2BB71124B1B781946C7
+:10287000114A0B469B000B449B00134402331B7808
+:102880005AB2B979BB7B01FA03F35BB213435AB274
+:10289000084B1B781946D0B2074A0B469B000B44E5
+:1028A0009B001344023302461A7000BF1437BD4622
+:1028B00080BC7047380700204007002080B485B0F6
+:1028C00000AF03460A46FB711346BB71BB79013B5F
+:1028D000032B1FD801A252F823F000BFED280008F7
+:1028E000F7280008012900080B2900080723FB73BB
+:1028F0000023BB730EE00823FB730323BB7309E0C3
+:102900001023FB730423BB7304E02023FB73052314
+:10291000BB7300BFFA790A4913469B0013449B001E
+:102920000B4402331A78FB7B1340DBB21A46BB7BA5
+:1029300042FA03F3DBB218461437BD4680BC704739
+:102940004007002080B582B000AF0023FB71012357
+:10295000BB710CE0BB7904211846FFF7AFFF0346BB
+:10296000012B01D10123FB71BB790133BB71BB7911
+:10297000062BEFD9FB79012B03D1FFF717F90123C0
+:1029800002E0FFF71FF9002318460837BD4680BD57
+:1029900080B485B000AF78600123FB7320E0FA7B40
+:1029A000134913465B001344DB000B441B78012BD7
+:1029B00013D1FA7B0E4913465B001344DB000B4432
+:1029C00004331B68FA7B7968C91A094813465B000F
+:1029D0001344DB00034408331960FB7B0133FB73B2
+:1029E000FB7B062BDBD900BF1437BD4680BC70478C
+:1029F0002006002080B483B000AF0023FB710123C8
+:102A0000BB7137E0BA79224913465B001344DB00FF
+:102A10000B440E331B78002B29D11E4B1B68DB881F
+:102A2000002B24D0BA791A4913465B001344DB000B
+:102A30000B4408331B68174A1268D28893420CD99A
+:102A4000BA79134913465B001344DB000B440C3383
+:102A500001221A700123FB7109E0BA790C4913466F
+:102A60005B001344DB000B440C3300221A70BB796B
+:102A70000133BB71BB79062BC4D9FB79012B01D182
+:102A8000012300E0002318460C37BD4680BC704788
+:102A9000200600201C06002080B483B000AF002375
+:102AA000FB710123BB712CE0BA791D4913465B0011
+:102AB0001344DB000B441B78002B1FD0BB79194A51
+:102AC00052F83330184A1268128993420CD9BA79F5
+:102AD000134913465B001344DB000B440D33012202
+:102AE0001A700123FB7109E0BA790D4913465B00A6
+:102AF0001344DB000B440D3300221A70BB79013301
+:102B0000BB71BB79062BCFD9FB79012B01D10123F6
+:102B100000E0002318460C37BD4680BC704700BF5C
+:102B200020060020000700201C06002080B582B08F
+:102B300000AF0123FB7110E0FA790B4913465B00EB
+:102B40001344DB000B441B78012B03D1FB7918469F
+:102B500000F0A6FAFB790133FB71FB79062BEBD968
+:102B600000BF0837BD4680BD2006002090B583B069
+:102B700000AF7860444B1B781946444A0B465B0013
+:102B80000B44DB00134404337A681A60404B1B6823
+:102B900093F83730032B04D101210220FFF710FEF8
+:102BA00003E000210220FFF70BFE394B1B689B6BF3
+:102BB00038491846FEF796FA0346002B04D0012147
+:102BC0000320FFF7FDFD03E000210320FFF7F8FDE0
+:102BD0002F4B1B682C4A127810469A682E490346E0
+:102BE0009B0003449B000B4404331A60284B1B6872
+:102BF000254A127810469A69274903469B000344E8
+:102C00009B000B4408331A60214B1B681A6B1E4B48
+:102C10001B781C461046FEF783FA034619B21E4A7B
+:102C200023469B0023449B0013440C330A461A801E
+:102C3000174B1B689A6A144B1B781C461046FEF70C
+:102C400095FA0346D9B2144A23469B0023449B00BD
+:102C500013440E330A461A700D4B1B68DA6A0A4B8E
+:102C60001B781C461046FEF781FA034699B20A4AC1
+:102C700023469B0023449B00134410330A461A80CA
+:102C800000BF0C37BD4690BD38070020200600204D
+:102C9000140600200000C0404007002080B400AFB0
+:102CA000804B1B68804A12781A707F4B1B7818463D
+:102CB0007C4B1B685A1C7D4903469B0003449B00C8
+:102CC0000B441B781370784B1B781846754B1B68A8
+:102CD0009A1C764903469B0003449B000B44013336
+:102CE0001B781370704B1B7818466E4B1B68DA1CF0
+:102CF0006E4903469B0003449B000B4402331B7840
+:102D00001370694B1B781846664B1B681A1D674980
+:102D100003469B0003449B000B4404331B78137051
+:102D2000614B1B7818465F4B1B685A1D5F49034671
+:102D30009B0003449B000B4405331B7813705A4BD4
+:102D40001B781846574B1B689A1D584903469B0031
+:102D500003449B000B4406331B781370524B1B78C3
+:102D60001846504B1B68DA1D504903469B0003442C
+:102D70009B000B4407331B7813704B4B1B78184692
+:102D8000484B1B6803F10802484903469B00034473
+:102D90009B000B4408331B781370434B1B78184679
+:102DA000404B1B6803F10902404903469B00034462
+:102DB0009B000B4409331B7813703B4B1B78184660
+:102DC000384B1B6803F10A02384903469B00034451
+:102DD0009B000B440A331B781370334B1B78184647
+:102DE000304B1B6803F10B02304903469B00034440
+:102DF0009B000B440B331B7813702B4B1B7818462E
+:102E0000284B1B6803F10C02284903469B0003442E
+:102E10009B000B440C331B781370234B1B78184614
+:102E2000204B1B6803F10D02204903469B0003441D
+:102E30009B000B440D331B7813701B4B1B781846FB
+:102E4000184B1B6803F10E02184903469B0003440C
+:102E50009B000B440E331B781370134B1B781846E2
+:102E6000104B1B6803F10F02104903469B000344FB
+:102E70009B000B4410331B7813700B4B1B781846C8
+:102E8000084B1B6803F11002084903469B000344EA
+:102E90009B000B4411331B78137000BFBD4680BCF0
+:102EA000704700BF3C070020380700204007002083
+:102EB00080B485B000AF7860764B1B681B78FB73DD
+:102EC000FA7B754913465B001344DB000B44012277
+:102ED0001A70FA7B704913465B001344DB000B4405
+:102EE00004337A681A606B4B1B680133FA7B1878DD
+:102EF0006A4913469B0013449B000B4402461A7018
+:102F0000644B1B680233FA7B1878644913469B00B4
+:102F100013449B000B44013302461A705D4B1B683F
+:102F2000FA7BD8785D4913469B0013449B000B4401
+:102F3000023302461A70574B1B68FA7B18795749BF
+:102F400013469B0013449B000B44043302461A7043
+:102F5000504B1B68FA7B5879504913469B00134429
+:102F60009B000B44053302461A704A4B1B68FA7BE0
+:102F700098794A4913469B0013449B000B4406333F
+:102F800002461A70434B1B68FA7BD87943491346B3
+:102F90009B0013449B000B44073302461A703D4BC1
+:102FA0001B68FA7B187A3D4913469B0013449B002B
+:102FB0000B44083302461A70364B1B68FA7B587A6A
+:102FC000364913469B0013449B000B4409330246C9
+:102FD0001A70304B1B68FA7B987A304913469B0075
+:102FE00013449B000B440A3302461A70294B1B689A
+:102FF000FA7BD87A294913469B0013449B000B4463
+:103000000B3302461A70234B1B68FA7B187B23494B
+:1030100013469B0013449B000B440C3302461A706A
+:103020001C4B1B68FA7B587B1C4913469B001344BE
+:103030009B000B440D3302461A70164B1B68FA7B3B
+:10304000987B164913469B0013449B000B440E3398
+:1030500002461A700F4B1B68FA7BD87B0F49134648
+:103060009B0013449B000B44103302461A70094B1B
+:103070001B68FA7B187C094913469B0013449B008C
+:103080000B44113302461A70FB7B18461437BD46B9
+:1030900080BC704718060020200600204007002052
+:1030A0002DE9F0438FB000AF0346FB71C64B1B68A0
+:1030B00003F11004D4E90034C7E90634C24B1B689D
+:1030C00003F12004D4E90034C7E90434FA79BF4994
+:1030D00013469B0013449B000B4404331B681846A3
+:1030E000FDF7AAF9AEA4D4E900341A462346FDF749
+:1030F000FBF903460C46C7E90C34FA79B349134689
+:103100009B0013449B000B4408331B681846FDF7D3
+:1031100093F9A3A4D4E900341A462346FDF7E4F951
+:1031200003460C46C7E90A34D7E90C23D7E9060160
+:10313000FDF742FC0346002B0AD09BA3D3E90023F2
+:10314000D7E90C01FDF71AF803460C46C7E90C3421
+:10315000D7E90A23D7E90401FDF72EFC0346002B2B
+:103160000AD091A3D3E90023D7E90A01FDF706F8B5
+:1031700003460C46C7E90A34D7E90623D7E90C0110
+:10318000FCF7FAFF03460C46184621464FF00002B2
+:103190004FF08043FDF7D2FA03460C46184621460D
+:1031A00006F0B2FD4FF000024FF0804306F0DEFE65
+:1031B00004460D46D7E90C0106F06CFD80468946B1
+:1031C000D7E9060106F066FD02460B464046494631
+:1031D000FDF78AF902460B4690469946D7E9042343
+:1031E000D7E90A01FCF7C8FF02460B46104619460C
+:1031F0004FF000024FF08043FDF7A0FA02460B4665
+:103200001046194606F080FD4FF000024FF0804353
+:1032100006F0ACFE02460B4640464946FDF764F90F
+:1032200002460B4620462946FCF7A8FF03460C46FB
+:103230001846214606F0F6FF03460C46184621467E
+:1032400006F0C6FD5AA4D4E900341A462346FDF719
+:103250004BF903460C46C7E90234D7E90423D7E902
+:103260000A01FCF789FF03460C461D4626464FF02F
+:1032700000024FF08043D7E90C01FDF75FFA0346E7
+:103280000C46184621464CA4D4E900341A4623467D
+:10329000FCF774FF03460C461846214606F06EFD07
+:1032A000804689464FF000024FF08043D7E906017F
+:1032B000FDF744FA03460C46184621463EA4D4E9DD
+:1032C00000341A462346FCF759FF03460C461846BD
+:1032D000214606F053FD03460C461A462346404657
+:1032E0004946FDF72BFA03460C461846214606F0E0
+:1032F000C3FD03460C461A46234628463146FDF7D1
+:103300001DFA03460C461846214606F039FBC7E96C
+:103310000801D7E90623D7E90C01FDF775FB034641
+:10332000002B16D0D7E90423D7E90A01FDF76CFB7F
+:103330000346002B0DD022A4D4E900341A462346BC
+:10334000D7E90801FDF7D0F803460C46C7E9083471
+:103350005DE0D7E90623D7E90C01FDF755FB0346ED
+:10336000002B37D0D7E90423D7E90A01FDF72EFB5C
+:103370000346002B2ED012A1D1E90001D7E9082382
+:10338000FDF7B2F803460C46184621464FF00002FE
+:103390000F4BFCF7F3FE03460C46C7E9083436E052
+:1033A0003A9D52A246DF913F3A8C30E28E79453EFB
+:1033B00000000000B04D6841182D4454FB21E93F46
+:1033C000F8C1631ADCA54C40140600204007002019
+:1033D00000807640D7E90623D7E90C01FDF7F6FA1D
+:1033E0000346002B13D02CA1D1E90001D7E9082313
+:1033F000FDF77AF803460C46184621464FF00002C6
+:10340000274BFCF7BBFE03460C46C7E90834FC79A2
+:10341000D7E90201FDF740FB0246224B43F8342076
+:10342000FB79204A52F83330002B06D1FB791D4A34
+:10343000DB00134400229A800BE0FC79D7E90801F5
+:10344000FDF72AFB034699B2164AE30013440A46E5
+:103450009A80FA79144913469B0013449B000B444D
+:103460000C33B3F900309CB2104B1B681B6B184631
+:10347000FDF756FE03461BB29BB2E31A9AB2FB79E4
+:1034800011B2084ADB0013440A46DA8000BF3C3719
+:10349000BD46BDE8F08300BFF8C1631ADCA54C400F
+:1034A000008066400007002040070020140600202E
+:1034B00080B483B000AF0023FB710DE0FA79F97995
+:1034C00013469B0013449B00084A1344084A42F8E1
+:1034D0002130FB790133FB71FB79062BEED9044BCC
+:1034E00018460C37BD4680BC704700BF400700201F
+:1034F000E406002080B483B000AF0023FB710AE033
+:10350000FA79FB79D20008490A44084941F8232096
+:10351000FB790133FB71FB79062BF1D9034B18467C
+:103520000C37BD4680BC704700070020C80600204D
+:1035300080B483B000AF0023FB710DE0FA79F97914
+:1035400013465B001344DB00084A1344084A42F860
+:103550002130FB790133FB71FB79062BEED9044B4B
+:1035600018460C37BD4680BC704700BF20060020BF
+:10357000F805002080B483B000AF64237B7147E07E
+:103580002D4B1B889BB22C4A43F480739BB2138053
+:1035900000BF294B9B8A9BB203F00103002BF8D09C
+:1035A000254B9B8A7B80244BA0221A82224B9B8A2C
+:1035B0007B807B8803F00203002B04D17B8803F41B
+:1035C0008063002BF2D01C4B9B8A7B801A4B1B8B99
+:1035D000FB807B8803F48063002B07D0164B4FF6EB
+:1035E000FF329A827B79013B7B7111E07B8803F08B
+:1035F0000203002B09D0104B1B889BB20E4A43F4E8
+:1036000000739BB21380012311E07B79013B7B7136
+:103610007B79002BB4D1FB880133FB80064B1B88E0
+:103620009BB2054A43F400739BB2138000231846F3
+:103630000C37BD4680BC70470058004080B584B050
+:1036400000AF0346FB800023FB73FFF793FF0346A5
+:10365000002B00F08480454B1B889BB2434A43F407
+:1036600080739BB2138000BF404B9B8A9BB203F0D8
+:103670000103002BF8D03D4B9B8ABB813B4BA02222
+:103680001A8200BF394B9B8A9BB203F00203002BC6
+:10369000F8D0364B9B8ABB81344B1B8BBB81FB889C
+:1036A0001B0A9BB2DAB2314B92B21A8200BF2F4B87
+:1036B0009B8A9BB203F08003002BF8D0FB88DAB220
+:1036C0002A4B92B21A8200BF284B9B8A9BB203F00E
+:1036D0008003002BF8D0254B1B889BB2234A43F470
+:1036E00080739BB2138000BF204B9B8A9BB203F078
+:1036F0000103002BF8D01D4B9B8ABB811B4BA122E1
+:103700001A8200BF194B9B8A9BB203F00203002B65
+:10371000F8D0164B9B8ABB81144B1B8BBB81134B80
+:103720001B889BB2114A23F480639BB213800F4B1A
+:103730001B889BB20D4A43F400739BB2138000BFF9
+:103740000A4B9B8A9BB203F04003002BF8D0BB8945
+:103750000133BB81054B1B8A9BB2FB7301E0002345
+:10376000FB73FB7B18461037BD4680BD00580040F8
+:1037700080B584B000AF78600B46FB70FFF7FAFEAF
+:103780000346002B00F0B180FB789BB25B01BB814C
+:10379000584B1B889BB2574A43F480739BB21380EB
+:1037A00000BF544B9B8A9BB203F00103002BF8D05F
+:1037B000504B9B8A9BB2FB724E4BA0221A8200BFD9
+:1037C0004C4B9B8A9BB203F00203002BF8D0494B71
+:1037D0009B8A9BB2FB72474B1B8B9BB2FB72BB89D4
+:1037E0001B0A9BB2DAB2434B92B21A8200BF414B22
+:1037F0009B8A9BB203F08003002BF8D0BB89DAB21E
+:103800003C4B92B21A8200BF3A4B9B8A9BB203F0A8
+:103810008003002BF8D0374B1B889BB2354A43F40A
+:1038200080739BB2138000BF324B9B8A9BB203F024
+:103830000103002BF8D02F4B9B8A9BB2FB722D4BC0
+:10384000A1221A8200BF2B4B9B8A9BB203F002037A
+:10385000002BF8D0274B9B8A9BB2FB72254B1B8B0E
+:103860009BB2FB720023FB731AE0224B1B889BB2B6
+:10387000204A43F480639BB2138000BF1D4B9B8A98
+:103880009BB203F04003002BF8D01A4B1B8A99B26D
+:10389000FB7B7A681344CAB21A70FB7B0133FB735B
+:1038A000FB7B1E2BE1D9134B1B889BB2114A23F4DF
+:1038B00080639BB213800F4B1B889BB20D4A43F46D
+:1038C00000739BB2138000BF0A4B9B8A9BB203F02C
+:1038D0004003002BF8D0074B1B8A9AB27B681F333A
+:1038E000D2B21A70FB7A0133FB7200BF1037BD46AB
+:1038F00080BD00BF0058004080B584B000AF786044
+:103900000B46FB70FFF736FE0346002B6BD00023FF
+:10391000BB73FB789BB25B01BB81354B1B889BB2B1
+:10392000334A43F480739BB2138000BF304B9B8AB1
+:103930009BB203F00103002BF8D02D4B9B8A9BB266
+:10394000BB732B4BA0221A8200BF294B9B8A9BB2D0
+:1039500003F00203002BF8D0254B9B8A9BB2BB736C
+:10396000234B1B8B9BB2BB73BB891B0A9BB2DAB286
+:103970001F4B92B21A8200BF1D4B9B8A9BB203F071
+:103980008003002BF8D0BB89DAB2194B92B21A82AD
+:1039900000BF174B9B8A9BB203F08003002BF8D02B
+:1039A0000023FB7311E0FB7B7A6813441A78104BF9
+:1039B00092B21A8200BF0E4B9B8A9BB203F00403A3
+:1039C000002BF8D0FB7B0133FB73FB7B1F2BEAD969
+:1039D000BB7B0133BB73064B1B889BB2044A43F489
+:1039E00000739BB2138000BF1037BD4680BD00BF7F
+:1039F0000058004080B58CB000AF0346FB71002337
+:103A000087F82F300CE097F82F3007F1300213447D
+:103A1000FF2203F8242C97F82F30013387F82F303A
+:103A200097F82F301F2BEED9FA7907F10C031146C6
+:103A30001846FFF761FF00BF3037BD4680BD80B537
+:103A400082B000AF0023FB8007E0FB88DBB21846A2
+:103A5000FFF7D0FFFB880133FB80FB88FF2BF4D9F5
+:103A600000BF0837BD4680BD80B400AF62B600BF5E
+:103A7000BD4680BC7047000080B582B000AFFDF746
+:103A800051FE05F003FD05F0D1F905F02BFAFEF724
+:103A9000E9FD05F067FE04F059FF05F0B3FA05F003
+:103AA00019F8FEF745F8FDF73BFCFDF785FCFEF73E
+:103AB00011FE00F0CBF904F0D3F804F03DFF02460C
+:103AC000464B1A60FEF7C4FD0246454B1A6004F0EF
+:103AD0001FFF0246434B1A60434805F077FC05F090
+:103AE000D7FA424804F0A0FC00F0FEFBFFF7BCFF51
+:103AF00005F0D8FCFDF712FD0346184600F00AFA5F
+:103B00003B4B1B78012B23D1394B00221A70FEF757
+:103B100025F90346012B15D1354B5B78012B0ED1CE
+:103B2000FEF776FD0346012B07D1324B1B68184682
+:103B3000FFF71CF8FFF7B2F801E005F043FD00F0D5
+:103B4000D3FB05E02A4B5B78012B01D105F03AFD50
+:103B5000274B9B78012B0CD1254B00229A7005F046
+:103B6000E7F80346002B04D0224B1B681846FFF7EA
+:103B70009FF91F4BDB78012B21D11D4B0022DA70FE
+:103B8000FEF7D4FF0023FB71FEF7DCFE03461A4666
+:103B9000FB791344FB71FEF72DFF03461A46FB79B0
+:103BA0001344FB71FEF778FF03461A46FB79134472
+:103BB000FB71FB79002B9DD005F074FC9AE70C4B50
+:103BC0001B79012B96D10A4B5B78002B92D105F023
+:103BD00069FC074B00221A718CE700BF1C0600200D
+:103BE00014060020CC07002044D50008404B4C00B0
+:103BF000180100200C01002080B500AF0B4B4FF4E2
+:103C000080325A6005F018FE05F036FE05F022FEFF
+:103C1000074B01221A70064B00225A70054B0022F6
+:103C20001A60FDF7E7FF00BF80BD00BF0000024043
+:103C3000180100201001002080B500AF254B4FF483
+:103C400000625A6105F0AEFC05F0F6FD05F014FEC9
+:103C500005F000FE204B1B6801331F4A13601E4B0A
+:103C60001B68012B02D0022B09D011E005F0AAFC41
+:103C70001A4B00221A70194B00225A7027E005F0E7
+:103C8000A1FC164B01221A70144B00225A701EE040
+:103C9000124B01221A70114B01225A70104B1B68F3
+:103CA0009B78104A12681049096849790A441278C9
+:103CB000B3FBF2F102FB01F29B1ADBB2002B03D142
+:103CC000064B01225A7101E005F07CFC00BF00BFE9
+:103CD00080BD00BF00040140100100201801002039
+:103CE00014060020CC0700201C06002080B400AF82
+:103CF000044B40225A61044B01229A7000BFBD461A
+:103D000080BC7047000401401801002080B500AF5E
+:103D10001B4B1B8A9BB21A4A23F001039BB21382EE
+:103D2000184B1B780133DAB2164B1A70154B1B78FF
+:103D3000072B0AD105F046FC124B00221A70124BD9
+:103D40000122DA70FDF756FF0FE00E4B1A780F4B89
+:103D50001A700F4B1B681A780C4B1B789A4202D1D1
+:103D600004F076FF01E004F0BBFF074B5B79012B09
+:103D700004D1054B00225A71FDF730FF00BF80BD12
+:103D8000002C014014010020180100201501002022
+:103D90001C06002080B500AF094B1B680133084AA0
+:103DA0001360FDF709FB03461A46064B1A71044BD4
+:103DB0001B681846FEF7ECFDFEF71CFE00BF80BD39
+:103DC0000C0100201801002080B500AF05F034FC84
+:103DD0004FF080431B8A9BB24FF0804223F00103D7
+:103DE0009BB2138205F082FCFDF71CFF00BF80BD73
+:103DF00080B400AF024B1B681846BD4680BC7047BC
+:103E00000C01002080B400AF024B1846BD4680BCB8
+:103E1000704700BF1801002080B400AFBFF34F8F80
+:103E200000BFBD4680BC704780B500AF054BDB6866
+:103E300003F4E0620349044B1343CB60FFF7ECFF4C
+:103E4000FEE700BF00ED00E00400FA0580B500AF1A
+:103E5000FEF7F4FB0246224B1A60FEF7F9FB02461E
+:103E6000204B1A60FFF724FB02461F4B1A60FFF736
+:103E700041FB02461D4B1A60FFF75AFB02461C4BE2
+:103E80001A6003F0CDFE02461A4B1A6004F054FD8E
+:103E90000246194B1A60184B1A68184B1068516883
+:103EA0001860596012891A81134B1B681A78144BD9
+:103EB0001A7004F02DFD0246124B1A6004F032FD18
+:103EC0000246114B1A600E4B1A78104B1A70104BA9
+:103ED00001221A70002000F0A5F900BF80BD00BFCC
+:103EE000080800201406002004080020D007002045
+:103EF0003C080020D40700201C060020E00700201A
+:103F000038070020CC0700200C08002032000020D9
+:103F1000FA07002080B584B000AF0346FB71FB793F
+:103F2000002B51D00023FB7319E0FB7B284A12F8C9
+:103F30003320284B1B789A420ED1FB7B244ADB00AE
+:103F400013445B78FA799A4206D1FB7B204ADB0066
+:103F500013445B68984737E0FB7B0133FB73FB7BC3
+:103F60001B4A12F83330002BDFD1FB79013B092BC0
+:103F70002AD801A252F823F0A13F0008C93F000847
+:103F8000A73F0008C93F0008AD3F0008C93F00082F
+:103F9000C93F0008B93F0008B33F0008BF3F000811
+:103FA00000F036F810E000F052F80DE000F06EF886
+:103FB0000AE000F0ABF807E000F00EF804E005F0CE
+:103FC00081FA00F091F900BF1037BD4680BD00BFF7
+:103FD00048CF0008FA07002080B500AF0B4B1B78D4
+:103FE00004211846FEF76AFC0346002B04D1012188
+:103FF0000420FEF7E5FB03E000210420FEF7E0FBD0
+:10400000FEF7A0FC00F070F900BF80BD380700206B
+:1040100080B582B000AF00F0A5F80346FB7100F058
+:10402000D1F80346BB71FB79002B04D1BB7918464C
+:1040300000F0F8F805E0FB79013BDBB2184600F030
+:10404000F1F800F051F900BF0837BD4680BD80B5DA
+:1040500082B000AF00F086F80346FB7100F0B2F8C2
+:104060000346BB71FA79BB799A4203D1002000F074
+:10407000D9F805E0FB790133DBB2184600F0D2F83D
+:1040800000F032F900BF0837BD4680BD80B582B070
+:1040900000AF0023FB7126E0FA791A4913465B0052
+:1040A00013440B441A78184B1B789A4218D100F02D
+:1040B00059F803461846FA79124913465B0013442F
+:1040C0000B4401331B7898420AD1FA790D49134603
+:1040D0005B0013440B4402331A780B4B1A700BE04D
+:1040E000FB790133FB71FA79064913465B001344EF
+:1040F0000B441B78002BCFD100F0F6F800BF083737
+:10410000BD4680BD30D10008FA07002080B582B0DE
+:1041100000AF0023FB7115E0FB79104A12F8132061
+:104120000F4B1B789A420AD1002000F07BF8FB79F4
+:104130000A4A5B0013445A78094B1A7008E0FB796D
+:104140000133FB71FB79054A12F81330002BE3D1E0
+:1041500000F0CAF800BF0837BD4680BD6CD100082A
+:10416000FA07002080B483B000AF0023FB7116E093
+:10417000FA79124913465B0013440B441A78104B2A
+:104180001B789A4208D1FA790C4913465B00134414
+:104190000B4401331B780CE0FB790133FB71FA7996
+:1041A000064913465B0013440B441B78002BDFD1F8
+:1041B000002318460C37BD4680BC70472000002005
+:1041C000FA07002080B483B000AF0023FB7116E033
+:1041D000FA79124913465B0013440B441A78104BCA
+:1041E0001B789A4208D1FA790C4913465B001344B4
+:1041F0000B4402331B780CE0FB790133FB71FA7935
+:10420000064913465B0013440B441B78002BDFD197
+:10421000002318460C37BD4680BC704720000020A4
+:10422000FA07002080B485B000AF0346FB7100237D
+:10423000FB7317E0FA7B124913465B0013440B44EF
+:104240001A78104B1B789A4209D1FA7B0C49134615
+:104250005B0013440B440133FA791A700BE0FB7BCB
+:104260000133FB73FA7B064913465B0013440B448E
+:104270001B78002BDED100BF1437BD4680BC7047D1
+:1042800020000020FA07002080B485B000AF03466C
+:10429000FB710023FB7316E0FA7B124913465B00A7
+:1042A00013440B441B78FA799A4209D1FA7B0D49E1
+:1042B00013465B0013440B44013300221A700BE0D9
+:1042C000FB7B0133FB73FA7B064913465B00134407
+:1042D0000B441B78002BDFD100BF1437BD4680BCD8
+:1042E000704700BF2000002080B582B000AF0023DF
+:1042F000FB7111E0FB790D4A12F833200C4B1B784F
+:104300009A4206D1FB79094ADB0013445B6898475F
+:1043100008E0FB790133FB71FB79044A12F8333072
+:10432000002BE7D100BF0837BD4680BD88D100080B
+:10433000FA07002080B500AF04F0CAFE0023214A2E
+:104340000121002004F0CBFF00231F4A012102209D
+:1043500004F0C5FF00231D4A0121032004F0BFFF24
+:1043600000231B4A0121042004F0B9FF0023194A4D
+:104370000121052004F0B3FF0023174A0121062084
+:1043800004F0ADFFFFF7EEFE03460233D8B2002380
+:10439000124A002104F0A3FF00238F2214210020E1
+:1043A00004F07EFF05F09EF80346012B05D10023A3
+:1043B00021221321002004F073FF04F069FE00BFE6
+:1043C00080BD00BFE0C90008E8C90008F0C90008C6
+:1043D000F8C9000800CA00080CCA000814CA00087E
+:1043E00090B583B000AF04F073FEB84804F0EEFF60
+:1043F000FFF708FD03465B78002B0BD000238022DB
+:104400001221002004F04CFF002381221321002000
+:1044100004F046FFAE4B1B681B78002B06D100232F
+:1044200082221421002004F03BFF2BE0A94B1B68E3
+:1044300093F83730032B0CD1A64B1B6893F836301A
+:10444000012B06D1002385221421002004F028FF2F
+:1044500018E0A04B1B6893F83730022B0CD19D4B12
+:104460001B6893F83630012B06D1002384221421D7
+:10447000002004F015FF05E0002383221421002012
+:1044800004F00EFF1423FB71934B1B780121184697
+:10449000FEF714FA0346042B39D801A252F823F090
+:1044A000FD440008EB440008D9440008C744000854
+:1044B000B5440008F9794B1EFB7100238C220120C2
+:1044C00004F0EEFE23E0F9794B1EFB7100238B22F2
+:1044D000012004F0E5FE1AE0F9794B1EFB71002380
+:1044E0008A22012004F0DCFE11E0F9794B1EFB71F9
+:1044F00000238922012004F0D3FE08E0F9794B1E45
+:10450000FB7100238822012004F0CAFE00BF734B18
+:104510001A68714B1B789B0013441B681B7B002B94
+:1045200007D0F9794B1EFB7100238622012004F08D
+:10453000B7FE694B1B7804211846FEF7BFF9034606
+:10454000012B07D1F9794B1EFB7100238722012033
+:1045500004F0A6FE0323BB7101237B718FE25E4B47
+:104560001B787A799A4268D17B795D49184604F0C4
+:1045700053F900235A4A0021012004F0B0FE594BA0
+:104580001B685A7800230221012004F089FE554B54
+:104590001B689A7800230321012004F081FE4D4B13
+:1045A0001B689B6A50491846FCF792FD0346002B96
+:1045B0000ED0484B1B689B6A494A0121184603F0FC
+:1045C000DBFF0023464A0721012004F0ABFE10E088
+:1045D000464B1A687B799B0013441B689B7B4049C0
+:1045E000184604F019F900233D4A0721012004F080
+:1045F00099FE3E4B1A687B799B0013441B681B8A0B
+:104600003749184604F008F90023354A0B210120E8
+:1046100004F088FE354B1A687B799B0013441B68B5
+:10462000B3F90C302E49184604F0F6F800232C4A52
+:104630001021012004F076FE1EE2284B1A687B79D7
+:104640009B0013441B681B78012B40F015827B797B
+:104650002349184604F0E0F8B8790023204A0021E5
+:1046600004F03DFE214B1A687B799B0013441B68C4
+:104670001A78B8790023022104F012FE1B4B1A6845
+:104680007B799B0013441B685A78B8790023032177
+:1046900004F006FE164B1A687B799B0013441B68D6
+:1046A0001B68B3F57A7F25D2114B1A687B799B0082
+:1046B00013441B681B680A49184604F0ADF8B87922
+:1046C0000023074A072104F02DFE83E044D90008A7
+:1046D0000808002014060020380700203C080020AD
+:1046E000100800201C0600200000204104080020C3
+:1046F000D0070020B04B1A687B799B0013441B68DD
+:104700001B6842F20F72934225D8AB4B1A687B7933
+:104710009B0013441B681B681846FBF76BFE4FF0A9
+:104720000002A64BFCF70AF803460C461846214641
+:10473000FCF7D2F90246A24B1A60A14B1B68A14AB2
+:104740000121184603F018FFB87900239D4A07217C
+:1047500004F0E8FD3EE0984B1A687B799B00134417
+:104760001B681B68984A93422ED8934B1A687B7932
+:104770009B0013441B681B681846FBF73BFE4FF079
+:1047800000028E4BFBF7DAFF03460C461846214623
+:10479000FCF7A2F902468A4B1A60894B1B6818463F
+:1047A000FCF7E4FC03468749184604F035F8B8796D
+:1047B0000023844A062104F0B5FDB87900232E2297
+:1047C000072104F06DFD05E0B87900237F4A05213B
+:1047D00004F085FD784B1A687B799B0013441B68B5
+:1047E0009B887849184604F017F8B8790023754A71
+:1047F0000B2104F097FD704B1A687B799B001344E2
+:104800001B68B3F90620724B1A80714BB3F9003064
+:10481000002B08DA6E4BB3F900309BB25B429BB2BF
+:104820001AB26B4B1A806A4BB3F90030B3F57A7F3A
+:1048300012DA614B1A687B799B0013441B68B3F949
+:1048400006306049184603F0E7FFB87900235D4A57
+:10485000102104F067FD5CE05D4BB3F9003042F2DB
+:104860000F72934226DC544B1A687B799B001344E9
+:104870001B68B3F906301846FBF7CCFD4FF0000279
+:104880004E4BFBF75BFF03460C4618462146FCF7F0
+:1048900023F902464A4B1A60494B1B68494A0121D9
+:1048A000184603F069FEB8790023464A102104F047
+:1048B00039FD2EE0404B1A687B799B0013441B683E
+:1048C000B3F906301846FBF7A5FD4FF000023B4B4D
+:1048D000FBF734FF03460C4618462146FCF7FCF86C
+:1048E0000246374B1A60364B1B681846FCF718FC1B
+:1048F00003463449184603F08FFFB87900232E226F
+:10490000102104F0CDFCB87900232E4A0F2104F0C9
+:1049100009FD294B1A687B799B0013441B68B3F986
+:104920000630002B03DD00212B2004F075FC14233E
+:104930003B71284B1A687B799B0013441B689B7B57
+:10494000002B52D17B7901211846FDF7B7FF0346B2
+:10495000042B4AD801A252F823F000BFD94900081D
+:10496000A7490008954900088349000871490008D3
+:1049700039794B1E3B71B87900238C2204F090FCEE
+:1049800033E039794B1E3B71B87900238B2204F058
+:1049900087FC2AE039794B1E3B71B87900238A22C3
+:1049A00004F07EFC21E039794B1E3B71B87900237D
+:1049B000892204F075FC18E0D007002000408F40E9
+:1049C000F4070020100800209F86010018CA000884
+:1049D000F80700203C08002039794B1E3B71B8795C
+:1049E0000023882204F05CFC00BF2A4B1A687B7904
+:1049F0009B0013441B689B7B002B10D1254B1A682E
+:104A00007B799B0013441B681B7B002B07D03979F3
+:104A10004B1E3B71B8790023862204F041FC1D4BEC
+:104A20001A687B799B0013441B685B7B002B07D0C3
+:104A300039794B1E3B71B87900238E2204F030FC8B
+:104A4000144B1A687B799B0013441B689B7B002BDB
+:104A50000FD17B7904211846FDF730FF0346012B67
+:104A600007D139794B1E3B71B8790023872204F0B6
+:104A700017FCBB790133BB717B7901337B717B7987
+:104A8000062B7FF66CAD04F003FB00BF0C37BD4670
+:104A900090BD00BF3C08002090B583B000AF04F08B
+:104AA00017FB1423FB713E4B1B7801211846FDF7C1
+:104AB00005FF0346042B3AD801A252F823F000BFA9
+:104AC0001D4B00080B4B0008F94A0008E74A000894
+:104AD000D54A0008F9794B1EFB7100238C22002077
+:104AE00004F0DEFB23E0F9794B1EFB7100238B22DF
+:104AF000002004F0D5FB1AE0F9794B1EFB7100236E
+:104B00008A22002004F0CCFB11E0F9794B1EFB71E6
+:104B100000238922002004F0C3FB08E0F9794B1E32
+:104B2000FB7100238822002004F0BAFB00BF1D4B5C
+:104B30001B681B78002B08D1F9794B1EFB710023F1
+:104B40008222002004F0ACFB38E0174B1B6893F87E
+:104B50003730032B0ED1144B1B6893F83630012BE2
+:104B600008D1F9794B1EFB7100238522002004F047
+:104B700097FB23E00C4B1B6893F83730022B15D1C1
+:104B8000094B1B6893F83630012B0FD1F9794B1E76
+:104B9000FB7100238422002004F082FB0EE000BFA2
+:104BA000380700200808002014060020F9794B1E61
+:104BB000FB7100238322002004F072FBFFF722F92F
+:104BC00003465B78002B0FD0F9794B1EFB71002355
+:104BD0008122002004F064FBF9794B1EFB71002355
+:104BE0008022002004F05CFBBE4B1A68BE4B1B7891
+:104BF0009B0013441B681B7B002B07D0F9794B1ECD
+:104C0000FB7100238622002004F04AFBB64B1B7880
+:104C100004211846FDF752FE0346012B07D1F9790E
+:104C20004B1EFB7100238722002004F039FBAF4BA1
+:104C30001A78AD4B1B789A4240F056820023AC4A5A
+:104C40000021002004F04BFBA84B1B78A949184613
+:104C500003F0E2FD0023A74A0121002004F03FFBFE
+:104C6000A54B1B685A7800230321002004F018FB91
+:104C7000A14B1B689A7800230421002004F010FB4C
+:104C800000239E4A0621002004F029FB9C4B1B6850
+:104C90001A7B00230021012004F002FB984B1B68C3
+:104CA0005A7B00230121012004F0FAFA0023954ADF
+:104CB0000221012004F013FB914B1B689A7B002317
+:104CC0000321012004F0ECFA8D4B1B68DA7B0023F2
+:104CD0000421012004F0E4FA00238A4A052101207E
+:104CE00004F0FDFA864B1B681A7C00230621012084
+:104CF00004F0D6FA824B1B685A7C0023072101205E
+:104D000004F0CEFA7E4B1B681A780023092101209B
+:104D100004F0C6FA7A4B1B685A7800230A21012056
+:104D200004F0BEFA0023784A0B21012004F0D7FAE0
+:104D3000734B1B689A7800230C21012004F0B0FA11
+:104D40006F4B1B68DA7800230D21012004F0A8FACC
+:104D500000236D4A0E21012004F0C1FA684B1B6844
+:104D60001A7900230F21012004F09AFA644B1B6882
+:104D70005A7900231021012004F092FA0023634A9B
+:104D80001221012004F0ABFA0023614A0021022025
+:104D900004F0A5FA5F4B1B689B68564A062118462B
+:104DA00003F0EAFB0023534A0E21022004F0BAFA72
+:104DB000584B1B689B684FF000011846FCF79CF9A4
+:104DC0000346002B0AD000212B2004F025FA0023F3
+:104DD000514A1021022004F082FA05E000234F4AD4
+:104DE0001021022004F07BFA00234D4A0021032009
+:104DF00004F075FA474B1B689B693E4A062118462A
+:104E000003F0BAFB00233B4A0E21032004F08AFA88
+:104E1000404B1B689B694FF000011846FCF76CF98A
+:104E20000346002B0AD000212B2004F0F5F90023C3
+:104E30003C4A1021032004F052FA05E000233A4ACC
+:104E40001021032004F04BFA0023384A00210420EB
+:104E500004F045FA2F4B1B681B6B1846FCF760F9F2
+:104E600003462449184603F0D7FC0023214A0421B5
+:104E7000042004F034FA00212D4804F08FFA0023B6
+:104E80002C4A0B21042004F02AFA224B1B6893F8C9
+:104E90003630012B06D10023274A0F21042004F0CD
+:104EA0001EFA05E00023254A0F21042004F017FA1A
+:104EB000184B1B6893F83730022B06D10023204A89
+:104EC0001121042004F00BFA44E0124B1B6893F804
+:104ED0003730032B38D100231A4A1121042004F063
+:104EE000FEF937E03C08002038070020320000209F
+:104EF0001CCA0008100800201C06002020CA000858
+:104F00000808002028CA00082CCA000830CA000877
+:104F100034CA00081406002038CA00083CCA000839
+:104F200040CA000844CA000848CA00084CCA000821
+:104F300050CA000854CA000858CA00085CCA0008D1
+:104F400060CA000864CA00080023A34A1121042093
+:104F500004F0C5F90023A14A0021052004F0BFF99F
+:104F60009F4B1B68DB6A1846FCF7DAF803469D493D
+:104F7000184603F051FC00239A4A0421052004F04E
+:104F8000AEF900218D2004F047F90023964A0B2149
+:104F9000052004F0A4F9924B1B689B6B914A0221F7
+:104FA000184603F0E9FA00238E4A0F21052004F089
+:104FB00096F900238D4A0021062004F090F9884BD1
+:104FC0001B689B6A8A491846FCF782F80346002B47
+:104FD0000ED0834B1B689B6A824A0121184603F05E
+:104FE000CBFA00237F4A0421062004F078F911E06F
+:104FF0007B4B1B689B6A1846FCF792F803461BB272
+:105000007849184603F008FC0023764A042106205C
+:1050100004F065F90021774804F0C0F90023764ACE
+:105020000B21062004F05BF96D4B1B6893F83530BB
+:105030006C49184603F0F0FB00236A4A0F21062052
+:1050400004F04DF900216D4804F0A8F9644B1B6889
+:1050500093F834306349184603F0DEFB00216148C1
+:1050600004F09CF9664B1A68664B1B789B0013444E
+:105070001B681B7B012B06D10123634A00210720FB
+:1050800004F02DF905E000235F4A0021072004F019
+:1050900026F95B4B1A685B4B1B789B0013441B681B
+:1050A0009B685049184603F093F800234D4A0421A9
+:1050B000072004F014F90023544A0B21072004F0C0
+:1050C0000EF9FCF721FA0346464A0221184603F07E
+:1050D00053FA0023434A0F21072004F000F900216E
+:1050E000562004F099F87AE30023494A0121002070
+:1050F00004F0F5F8474B1B783A49184603F08CFB4F
+:105100000023384A0221002004F0E9F8424B1A68D3
+:10511000404B1B789B0013441B681A780023042122
+:10512000002004F0BDF83C4B1A683A4B1B789B00FA
+:1051300013441B685A7800230521002004F0B0F8BE
+:105140002F4B1A68334B1B789B0013441B689B7BC7
+:10515000012B0DD12A4B1A682E4B1B789B00134450
+:105160001B6803F10F0200230721002004F0B7F8A9
+:1051700000232A4A0021012004F0B1F8264B1A68C6
+:10518000244B1B789B0013441B685B68154A06215F
+:10519000184603F0F1F90023124A0E21012004F011
+:1051A000C1F81D4B1A681B4B1B789B0013441B68EE
+:1051B0005B684FF000011846FBF79EFF0346002B8B
+:1051C00030D000212B2004F027F80023144A1021AE
+:1051D000012004F084F82BE068CA00086CCA0008BB
+:1051E000140600201008002070CA000874CA0008C5
+:1051F0000000204178CA00087CCA000880CA000864
+:105200003C0800203807002084CA000888CA00082B
+:105210001CCA0008320000200408002034CA00081C
+:1052200038CA00080023B54A1021012004F057F8BD
+:105230000023B34A0021022004F051F8B14B1A6850
+:10524000B14B1B789B0013441B689B68AF4A062137
+:10525000184603F091F90023AC4A0E21022004F015
+:1052600061F8A84B1A68A84B1B789B0013441B6875
+:105270009B684FF000011846FBF73EFF0346002BEA
+:105280000AD000212B2003F0C7FF0023A04A1021E1
+:10529000022004F024F805E000239E4A1021022099
+:1052A00004F01DF800239C4A0021032004F017F8A5
+:1052B000944B1A68944B1B789B0013441B68B3F9FA
+:1052C0000C309249184603F0A7FA00238F4A0421B4
+:1052D000032004F004F80021904804F05FF8002354
+:1052E0008F4A0B21032003F0FAFF8E4B1A68864B7E
+:1052F0001B789B0013441B68B3F906208A4B1A8065
+:10530000894BB3F90030002B0FDA874BB3F900302B
+:105310009BB25B429BB21AB2834B1A8000232022BD
+:105320000E21032003F0BCFF11E07F4BB3F90030E6
+:10533000002B06DD00232B220F21032003F0B0FFFA
+:1053400005E0002320220E21032003F0A9FF764B65
+:10535000B3F9003042F20F72934215DC714B1A68B8
+:10536000694B1B789B0013441B68B3F906306749EF
+:10537000184603F051FA0021644804F00FF80021A8
+:10538000664804F00BF828E0664B1A685E4B1B7801
+:105390009B0013441B68B3F906301846FBF73AF834
+:1053A0004FF00002614BFBF7C9F903460C46184663
+:1053B0002146FBF791FB02465D4B1A605C4B1B6874
+:1053C000524A0121184603F0D7F800214F4803F054
+:1053D000E5FF0021574803F0E1FF574B1A684A4B9D
+:1053E0001B789B0013441B689B7B002B1BD1002365
+:1053F000524A0021042003F072FF424B1A68424BCC
+:105400001B789B0013441B681B8A4049184603F015
+:1054100003FA00233D4A0421042003F060FF002129
+:105420008D2003F0F9FE0023454A0B21042003F0F0
+:1054300056FF3C4B1A68344B1B789B0013441B6887
+:105440009B883249184603F0E7F900232F4A0F21C1
+:10545000042003F044FF00218D2003F0DDFE364BD5
+:105460001A68294B1B789B0013441B689B7B002BFD
+:105470001BD10023334A0021052003F030FF214BCC
+:105480001A68214B1B789B0013441B689B7B1F49A8
+:10549000184603F0C1F900231C4A0421052003F03B
+:1054A0001EFF0021284803F079FF0023274A0B2123
+:1054B000052003F014FF1B4B1A68134B1B789B004D
+:1054C00013441B681B68224A934243D8154B1A6841
+:1054D0000D4B1B789B0013441B681B680B49184637
+:1054E00003F09AF90023094A0F21052003F0F7FE83
+:1054F00000210A4803F052FF8CE000BF3CCA0008BC
+:1055000040CA0008040800203200002010080020D3
+:1055100044CA000848CA00084CCA000850CA00081B
+:105520008CCA0008D0070020F807002000408F40F8
+:10553000F407002090CA00083C0800206CCA00084C
+:1055400094CA000874CA000878CA000898CA0008FB
+:105550009F860100A84B1A68A84B1B789B00134438
+:105560001B681B68A64A93422AD8A34B1A68A34B10
+:105570001B789B0013441B681B681846FAF73AFF18
+:105580004FF000029F4BFBF7D9F803460C46184634
+:105590002146FBF7A1FA02469B4B1A609A4B1B6807
+:1055A0009A4A0121184602F0E7FF0023974A0F218B
+:1055B000052003F094FE0021954803F0EFFE29E05A
+:1055C0008D4B1A688D4B1B789B0013441B681B681E
+:1055D0001846FAF70FFF86A3D3E90023FBF7AEF8CE
+:1055E00003460C4618462146FBF776FA0246864BE0
+:1055F0001A60854B1B68854A0121184602F0BCFFE2
+:105600000023824A0F21052003F069FE0021814812
+:1056100003F0C4FE804B1A68784B1B789B00134440
+:105620001B689B7B002B31D100237C4A0021062084
+:1056300003F055FE714B1B7802211846FDF73EF929
+:105640000346012B06D10023754A0421062003F0EE
+:1056500046FE05E00023734A0421062003F03FFEC6
+:10566000664B1B7803211846FDF728F90346012BEA
+:1056700006D100236C4A0721062003F030FE05E026
+:1056800000236A4A0721062003F029FE624B1A68AC
+:105690005A4B1B789B0013441B689B7B002B3ED10D
+:1056A0000023634A0B21062003F019FE534B1B789D
+:1056B00001211846FDF702F90346042B2FD801A259
+:1056C00052F823F01157000803570008F556000858
+:1056D000E7560008D95600080023564A0F21062035
+:1056E00003F0FDFD1BE00023534A0F21062003F0C9
+:1056F000F6FD14E00023514A0F21062003F0EFFDD0
+:105700000DE000234E4A0F21062003F0E8FD06E0DD
+:1057100000234C4A0F21062003F0E1FD00BF3E4B61
+:105720001A68364B1B789B0013441B681B7B012BAC
+:1057300006D10123444A0021072003F0D0FD05E0F3
+:105740000023414A0021072003F0C9FD324B1A68AB
+:105750002A4B1B789B0013441B689B682B491846F7
+:1057600002F036FD0023294A0421072003F0B7FD8B
+:10577000294B1A68214B1B789B0013441B685B7BE9
+:10578000002B06D00123314A0B21072003F0A7FD8F
+:1057900005E000232D4A0B21072003F0A0FD1E4B3E
+:1057A0001A68164B1B789B0013441B689B7B002BCD
+:1057B00015D1124B1B7804211846FDF77FF80346DC
+:1057C000012B06D10123224A0F21072003F087FD78
+:1057D00005E000231E4A0F21072003F080FD03F09F
+:1057E00057FC00BF0C37BD4690BD00BFAFF3008033
+:1057F0000000000080842E41D007002032000020ED
+:105800003F420F0000408F40F407002010080020A6
+:1058100090CA00089CCA00083C08002054CA00082E
+:10582000A0CA0008A4CA0008A8CA0008ACCA000898
+:1058300088CA0008B0CA0008B4CA0008B8CA00087C
+:10584000BCCA0008C0CA000884CA0008C4CA00084C
+:10585000C8CA000880B500AF03F03AFC0023254A0F
+:105860000121002003F03BFD0023234A08210020F2
+:1058700003F035FD214B1B782149184602F0CCFF7F
+:1058800000231F4A0921002003F029FD1D4B1A683F
+:105890001A4B1B789B0013441B681A7800230B21BA
+:1058A000002003F0FDFC174B1A68144B1B789B007B
+:1058B00013441B685A7800230C21002003F0F0FCED
+:1058C0000023114A0121022003F009FD00230F4AA1
+:1058D0000121032003F003FDFEF744FC03460233DD
+:1058E000D8B200230A4A002103F0F9FC03F0D0FBF0
+:1058F00000BF80BDCCCA00081CCA000832000020CE
+:105900001008002004080020D4CA0008DCCA0008DF
+:1059100014CA000880B500AF03F0DAFB0023294A5F
+:105920000121002003F0DBFC0023274A0F21002087
+:1059300003F0D5FC254B1B782549184602F06CFF77
+:105940000023234A1021002003F0C9FC214B1A68D0
+:105950001E4B1B789B0013441B681A7800231221EE
+:10596000002003F09DFC1B4B1A68184B1B789B0012
+:1059700013441B685A7800231321002003F090FC85
+:105980000021154803F00AFD104B1A78134B1B78C1
+:105990009A4206D10023124A0121032003F09FFC02
+:1059A00005E000230F4A0121032003F098FC0023A7
+:1059B0000D4A0121042003F092FC03F069FB00BFB3
+:1059C00080BD00BFE4CA00081CCA000832000020E5
+:1059D0001008002004080020F4CA0008380700203E
+:1059E000F8CA00080CCB000818CB000880B500AF3F
+:1059F000124B1A78124B1B789A421DD0114B1A6821
+:105A00000E4B1B789B0013441B6800221A700C4B32
+:105A10001A780A4B1A700C4B00221A70074B1B782D
+:105A20001A460A4B002199540420FEF72DFC084B1E
+:105A300002221A70FEF758FC00BF80BD3200002021
+:105A4000380700203C0800202101002030080020F9
+:105A5000FA07002080B582B000AF484B484A106872
+:105A6000186092889A8003F033FB0023454A012195
+:105A7000002003F034FC0023434A0F21002003F0F0
+:105A80002EFC424B1B784249184602F0C5FE00230B
+:105A90003F4A1021002003F022FC3E4B1A683B4B8A
+:105AA0001B789B0013441B681A78002312210020E6
+:105AB00003F0F6FB374B1A68344B1B789B001344FA
+:105AC0001B685A7800231321002003F0E9FB002112
+:105AD000314803F063FC02F011F90223FB7100234B
+:105AE000BB7101237B7127E02C4B1A687B799B00EB
+:105AF00013441B681B78002B1BD1BB795A1CBA714D
+:105B00007A7927498B54274B1B78002B02D1254AE1
+:105B10007B791370214B1A687B799B0013441B68B7
+:105B20005A1CF8790023012103F0D9FBFB790133DA
+:105B3000FB717B7901337B717B79052BD4D9BB79E0
+:105B4000002B0CD0174B1B781A46154B9B5C02336D
+:105B5000D8B20023144A002103F0C1FB08E000235F
+:105B6000124A0121022003F0BAFB0E4B00221A70E8
+:105B700003F08EFA00BF0837BD4680BD280800201C
+:105B800060D2000828CB00081CCA000832000020A0
+:105B90001008002004080020F4CA0008D4070020E0
+:105BA000FC0700202301002014CA000838CB00089D
+:105BB00080B500AF03F08CFA0023124A01210020C7
+:105BC00003F08DFB0023104A0121022003F087FB24
+:105BD00000230E4A0B21022003F081FB0C4B1B78A3
+:105BE0000B33D9B200230B4A032003F078FB0023C8
+:105BF000094A0121052003F072FB03F049FA00BFB6
+:105C000080BD00BF48CB000858CB00082808002002
+:105C10002001002060CB000864CB000880B500AFF5
+:105C200003F056FA0023044A0121002003F057FB39
+:105C300003F02EFA00BF80BD74CB00080000000006
+:105C40002DE9F0438DB000AF03F042FAB94803F0FC
+:105C5000BDFB142387F82F30B74B1B780121184662
+:105C6000FCF72CFE0346042B43D801A252F823F084
+:105C7000DD5C0008C75C0008B15C00089B5C0008A4
+:105C8000855C000897F82F104B1E87F82F300023F3
+:105C90008C22002003F004FB2BE097F82F104B1E02
+:105CA00087F82F3000238B22002003F0F9FA20E040
+:105CB00097F82F104B1E87F82F3000238A220020E0
+:105CC00003F0EEFA15E097F82F104B1E87F82F30EF
+:105CD00000238922002003F0E3FA0AE097F82F104E
+:105CE0004B1E87F82F3000238822002003F0D8FABB
+:105CF00000BF924B1B681B78002B0AD197F82F101E
+:105D00004B1E87F82F3000238222002003F0C8FAB0
+:105D100037E08B4B1B6893F83730032B10D1884B3F
+:105D20001B6893F83630012B0AD197F82F104B1EC1
+:105D300087F82F3000238522002003F0B1FA20E0FD
+:105D40007F4B1B6893F83730022B10D17C4B1B68BC
+:105D500093F83630012B0AD197F82F104B1E87F895
+:105D60002F3000238422002003F09AFA09E097F8EC
+:105D70002F104B1E87F82F3000238322002003F0C2
+:105D80008FFAFEF73FF803465B78002B13D097F8A5
+:105D90002F104B1E87F82F3000238122002003F0A4
+:105DA0007FFA97F82F104B1E87F82F3000238022A0
+:105DB000002003F075FA634B1A685F4B1B789B0059
+:105DC00013441B681B7B002B09D097F82F104B1E28
+:105DD00087F82F3000238622002003F061FA564B0B
+:105DE0001B7804211846FCF769FD0346012B09D1F5
+:105DF00097F82F104B1E87F82F30002387220020A2
+:105E000003F04EFA504B1A684B4B1B789B0013441F
+:105E10001B681B8A4D49184602F0FEFC00234B4AC2
+:105E20000721002003F07EFA022387F82E3000239A
+:105E3000BB62002387F82730012387F8263068E10A
+:105E40003D4B1B7897F826209A4200F05D813D4B30
+:105E50001A6897F826309B0013441B681B78012BA7
+:105E600040F04D8197F827305A1C87F8272097F883
+:105E7000262037498B54374B1B78002B03D1354AEA
+:105E800097F82630137097F826303049184602F0FC
+:105E9000C3FC97F82630304AD35C012B07D197F822
+:105EA0002E000123294A092103F019FA06E097F888
+:105EB0002E000023254A092103F011FA224B1A680B
+:105EC00097F826309B0013441B681A7897F82E0029
+:105ED00000230B2103F0E4F91B4B1A6897F82630D6
+:105EE0009B0013441B685A7897F82E0000230C215E
+:105EF00003F0D6F9194B1A6897F826309B00134423
+:105F00001B681B68B3F57A7F2AD2144B1A6897F87E
+:105F100026309B0013441B681B680C49184602F08E
+:105F20007BFC97F82E000023084A102103F0FAF9B1
+:105F30008EE000BF44DD000838070020080800207C
+:105F4000140600203C08002004080020100800204F
+:105F5000D80700202101002030080020D0070020B1
+:105F60009E4B1A6897F826309B0013441B681B68E9
+:105F700042F20F72934227D8984B1A6897F826304E
+:105F80009B0013441B681B681846FAF733FA4FF05E
+:105F90000002934BFAF7D2FB03460C461846214603
+:105FA000FAF79AFD02468F4B1A608E4B1B688E4A99
+:105FB0000121184602F0E0FA97F82E0000238A4AE1
+:105FC000102103F0AFF943E0844B1A6897F82630AC
+:105FD0009B0013441B681B68844A934231D87F4B53
+:105FE0001A6897F826309B0013441B681B681846F4
+:105FF000FAF700FA4FF00002794BFAF79FFB0346DD
+:106000000C4618462146FAF767FD0246754B1A60A2
+:10601000744B1B681846FBF7A9F8034672491846EB
+:1060200002F0FAFB97F82E0000236F4A102103F0CC
+:1060300079F997F82E0000232E22112103F030F970
+:1060400006E097F82E000023694A0E2103F047F975
+:10605000624B1A6897F826309B0013441B681B6834
+:10606000BA6A9A420ED297F82630624AD35C002B65
+:1060700008D15A4B1A6897F826309B0013441B68C6
+:106080001B68BB62554B1A6897F826309B00134477
+:106090001B689B885449184602F0BEFB97F82E00F7
+:1060A0000023514A142103F03DF997F826300421CA
+:1060B0001846FCF703FC0346002B13D14E4B1A681D
+:1060C00097F826309B0013441B681B7B002B09D1DB
+:1060D000494B1A6897F826309B0013441B685B7B7A
+:1060E000002B06D097F82E000223444A152103F016
+:1060F00089F997F82E30013387F82E3004E097F8AD
+:1061000026303C4A0021D15497F82630013387F8D5
+:10611000263097F82630062B7FF692AE97F8273078
+:10612000002B00F0E680364B1B781A46354B9B5C03
+:106130000233D8B20023344A082103F0D0F81423E4
+:1061400087F825302C4B1A682D4B1B789B00134485
+:106150001B689B7B002B64D1294B1B7801211846BF
+:10616000FCF7ACFB0346042B5BD801A252F823F0EA
+:106170000D620008C7610008B16100089B6100085A
+:106180008561000897F825104B1E87F825300023FD
+:106190008C22072003F084F843E097F825104B1E6B
+:1061A00087F8253000238B22072003F079F838E0A8
+:1061B00097F825104B1E87F8253000238A220720E8
+:1061C00003F06EF82DE097F825104B1E87F8253068
+:1061D00000238922072003F063F822E0D007002083
+:1061E00000408F40F4070020100800209F86010027
+:1061F00018CA0008300800203C08002034000020A5
+:1062000021010020D807002014CA000897F82510A3
+:106210004B1E87F8253000238822072003F040F822
+:1062200000BF714B1A68714B1B789B0013441B68AD
+:106230009B7B002B13D16C4B1A686C4B1B789B001B
+:1062400013441B681B7B002B09D097F825104B1EAD
+:1062500087F8253000238622072003F021F8624BBF
+:106260001A68624B1B789B0013441B685B7B002BF6
+:1062700009D097F825104B1E87F8253000238E2271
+:10628000072003F00DF8584B1A68584B1B789B00F9
+:1062900013441B689B7B002B12D1544B1B780421A9
+:1062A0001846FCF70BFB0346012B09D197F8251084
+:1062B0004B1E87F8253000238722072002F0F0FFCD
+:1062C000494B1A68494B1B789B0013441B689B7B06
+:1062D000012B11D1444B1A68444B1B789B0013448B
+:1062E0001B6803F10F0200230921072002F0F7FFCA
+:1062F00002E03E4B00221A704FF00003BB61002306
+:106300003B6214231A46BB6A934201D21423BB6238
+:10631000B86AFAF7E7FC044614231846FAF7E2FCD9
+:10632000034619462046FAF7E9FD0346BB61B86902
+:10633000FAF71CFF03463B62386AFAF7D3FC0346C0
+:106340001946B869FAF71CFC0346BB61B869FAF74D
+:1063500073F823A3D3E90023FAF756FB0346002B77
+:1063600002D03B6A01333B6214231A463B6A02FBAC
+:1063700003F37B617B6942F20F7293420BD87B6916
+:106380001B49184602F048FA0023194A0721072042
+:1063900002F0C8FF1FE07B69164A934215D87B695B
+:1063A000154AA2FB03239B091149184602F034FA4F
+:1063B00000236B220721072002F072FF00230C4A02
+:1063C0000621072002F0AEFF05E000230B4A07215B
+:1063D000072002F0A7FF0123FB77F6E0AFF3008070
+:1063E000FCA9F1D24D62503F3C0800202101002061
+:1063F000100800203F420F00D34D621018CA000859
+:10640000774B1B78FA7F9A4200F0DC80754B1A6854
+:10641000FB7F9B0013441B681B78012B40F0D2804C
+:10642000FB7F714AD35C002B40F0CC800023FB74CF
+:106430000023BB744FF000034FF00004C7E902349F
+:106440004FF000034FF00004C7E90034674B1A68AF
+:10645000FB7F9B0013441B681B681846F9F7CAFFB3
+:1064600080468946386AF9F7C5FF03460C461A4646
+:10647000234640464946FAF761F903460C461D4655
+:1064800084F00046594B1A68FB7F9B0013441B683D
+:106490009B885A331846F9F7BDFF554B18CB1A465F
+:1064A0002346FAF721F803460C461846214603F026
+:1064B000F1FB03460C461A46234628463146FAF7B6
+:1064C00013F803460C46C7E90234484B1A68FB7FB1
+:1064D0009B0013441B681B681846F9F78BFF804626
+:1064E0008946386AF9F786FF03460C461A46234662
+:1064F00040464946FAF722F903460C469846A1461B
+:106500003A4B1A68FB7F9B0013441B689B885A33E5
+:106510001846F9F77FFF364B18CB1A462346F9F792
+:10652000E3FF03460C461846214603F0EDFB034605
+:106530000C461A46234640464946F9F7D5FF03461E
+:106540000C46C7E90034D7E90201FAF77DFA0346A1
+:106550005BB2DBB218221344FB741F24D7E900019D
+:10656000FAF772FA03465BB2DBB2E31ABB74BB7C88
+:106570000133D9B2FB7C0122184602F0C1FDFB7C3D
+:106580000133DBB2B97C0122184602F0B9FDBB7CB5
+:10659000013BD9B2FB7C0122184602F0B1FDFB7C25
+:1065A000013BDBB2B97C0122184602F0A9FD114B78
+:1065B0001B78FA7F9A4205D1B97CFB7C01221846F0
+:1065C00002F09EFDFB7F0133FB77FB7F062B7FF6FE
+:1065D00017AF02F05DFD00BF3437BD46BDE8F08364
+:1065E000380700203C08002030080020D007002099
+:1065F00040CF00082101002080B582B000AF01F03B
+:106600007DFB02F065FD0023574A0121002002F0C6
+:1066100066FE0123FB7194E0FB790133D8B2534B42
+:106620001A68FB799B0013441B685A1C0023012144
+:1066300002F055FE4D4B1A68FB799B0013441B6812
+:106640001B78012B72D1FB790133D8B2474B1A6802
+:10665000FB799B0013441B681A1D0023042102F0E0
+:106660003EFEFB790133D8B2404B1A68FB799B00A0
+:1066700013441B689A7A00230A2102F011FEFB7969
+:106680000133D8B2394B1A68FB799B0013441B685D
+:10669000DA7A00230B2102F003FEFB790133D8B232
+:1066A0000023334A0C2102F01AFEFB790133D8B2E1
+:1066B0002E4B1A68FB799B0013441B681A7B00233E
+:1066C0000D2102F0EDFDFB790133D8B2274B1A689A
+:1066D000FB799B0013441B685A7B00230E2102F0B8
+:1066E000DFFDFB790133D8B20023214A0F2102F0EC
+:1066F000F6FDFB790133D8B21C4B1A68FB799B007D
+:1067000013441B689A7B0023102102F0C9FDFB791A
+:106710000133D8B2154B1A68FB799B0013441B68F0
+:10672000DA7B0023112102F0BBFD07E0FB79013386
+:10673000D8B200230F4A042102F0D1FDFB790133C6
+:10674000FB71FB79052B7FF667AF0B4B1B78013391
+:10675000D8B20023094A002102F0C1FD02F098FCE2
+:1067600000BF0837BD4680BD7CCB0008D4070020A1
+:1067700028CA000884CB00083300002014CA00088F
+:1067800080B500AF02F0A4FC0023154A01210020CF
+:1067900002F0A5FD134B1A68134B1B789B001344A2
+:1067A0001B6801330021184602F0F8FD00230F4A50
+:1067B0000121022002F093FD00230D4A0121032054
+:1067C00002F08DFDFDF7CEFC03460233D8B2002364
+:1067D000084A002102F083FD02F05AFC00BF80BD90
+:1067E0008CCB0008D40700203300002094CB000895
+:1067F000DCCA000814CA000880B582B000AF02F0FD
+:1068000067FC0023344A0121002002F068FD334B6D
+:106810001A68334B1B789B0013441B68013300211B
+:10682000184602F0BBFD00212E4802F0B7FD0223FE
+:10683000FB710023BB7101237B712AE02A4B1A688C
+:106840007B799B0013441B681B78002B1ED1BB79FE
+:106850005A1CBA717A7925498B54254B1B78002B29
+:1068600002D1234A7B791370F8790023214A012150
+:1068700002F035FD7B792049184601F0CDFF00215B
+:106880001D4802F08BFDFB790133FB717B790133ED
+:106890007B717B79062BD1D9BB79002B0CD0144BA3
+:1068A0001B781A46114B9B5C0233D8B20023134A63
+:1068B000002102F014FD08E00023114A012102200A
+:1068C00002F00DFD0A4B00221A7002F0E1FB00BF3E
+:1068D0000837BD4680BD00BF9CCB0008D407002010
+:1068E00033000020F4CA00083C080020EC07002018
+:1068F00022010020ACCB00081008002014CA0008B8
+:10690000B4CB000880B500AF02F0E2FB0023124ACE
+:106910000121002002F0E3FC104B1A68104B1B7899
+:106920009B0013441B6801330021184602F036FD1A
+:1069300000210C4802F032FD00230B4A0121032004
+:1069400002F0CDFC0023094A0121042002F0C7FC1B
+:1069500002F09EFB00BF80BDC8CB0008D40700201A
+:1069600033000020F4CA00080CCB000818CB000844
+:1069700080B500AF02F0ACFB0023124A01210020D9
+:1069800002F0ADFC0023104A0121022002F0A7FC16
+:1069900000230E4A0121032002F0A1FC00230C4A2F
+:1069A0000121042002F09BFCFDF7DCFB03460233CF
+:1069B000D8B20023074A002102F091FC02F068FBE4
+:1069C00000BF80BDD8CB0008E4CB0008ECCB0008AA
+:1069D000F4CB000814CA000880B500AF02F078FBC1
+:1069E0001A4802F0F3FC0023194A0021002002F0AB
+:1069F00076FC0023174A0021022002F070FC164B9F
+:106A00001B680021184602F0C9FC0021134802F05F
+:106A1000C5FC134B1B680021184602F0BFFC002385
+:106A2000104A0021032002F05AFC00230E4A0021E4
+:106A3000042002F054FC00230C4A0021072002F03D
+:106A40004EFC02F025FB00BF80BD00BF44E1000802
+:106A5000FCCB000804CC00081C00002080CA000801
+:106A6000180000200CCC000818CC000824CC00082A
+:106A700080B500AF02F02CFB0023574A0221002012
+:106A800002F02DFC0023554A0121012002F027FCD1
+:106A9000534B1B785349184601F0BEFE0023514A60
+:106AA0000F21012002F01BFC00234F4A012102208C
+:106AB00002F015FC4A4B5A784A4B1A70484B9A78A8
+:106AC000484B5A70474B00229A700023454A0F21C9
+:106AD000022002F004FC0023444A0121032002F0BA
+:106AE000FEFB3F4BDB783F49184601F095FE002343
+:106AF0003C4A0F21032002F0F2FB00233C4A012113
+:106B0000042002F0ECFB3B4B1B68354A127913441E
+:106B10001B783449184601F07FFE0023314A0F21CB
+:106B2000042002F0DCFB0021334802F037FC002394
+:106B3000324A0121052002F0D2FB314B1B68284A62
+:106B4000527913441B782749184601F065FE00234B
+:106B5000244A0F21052002F0C2FB0021294802F03F
+:106B60001DFC0023284A0121062002F0B8FB1C4B23
+:106B7000DB881C49184601F04FFE0023194A0F21FB
+:106B8000062002F0ACFB00211E4802F007FC0023A7
+:106B90001E4A0121072002F0A2FB114B1B8911495B
+:106BA000184601F039FE00230E4A0F21072002F09B
+:106BB00096FB0021164802F0F1FBFDF7D3FA0346DD
+:106BC0000133D8B20023134A002102F088FB02F0FF
+:106BD0005FFA00BF80BD00BF3CCC00084CCC000871
+:106BE000E0070020100800205CCC000868CC0008FA
+:106BF00078CC00080C08002084CC000888CC000861
+:106C0000CC07002098CC00089CCC0008A8CC000839
+:106C1000B4CC000814CA000880B500AF02F058FADE
+:106C20000023104A0121002002F059FB00230E4AE4
+:106C30000121022002F053FB0C4B1B780C49184633
+:106C400001F0EAFD00230A4A0F21022002F047FB6F
+:106C50000023084A0F21032002F041FB02F018FA3A
+:106C600000BF80BDB8CC00084CCC0008E007002075
+:106C70001008002060CB000880B500AF02F028FAB1
+:106C80000023174A0121002002F029FB0023154AA6
+:106C90000121022002F023FB134B5A78134B1A7088
+:106CA000114B9A78114B5A70104B00229A700023A6
+:106CB0000E4A0F21022002F012FB0D4B1B780F33FE
+:106CC000D9B200230B4A032002F009FB00230A4A31
+:106CD0000121052002F003FB02F0DAF900BF80BDBC
+:106CE000C4CC00085CCC0008E0070020100800209D
+:106CF0001F01002060CB0008D0CC000880B500AF99
+:106D000002F0E6F90023104A0121002002F0E7FA20
+:106D100000230E4A0121022002F0E1FA0C4BDB783D
+:106D20000C49184601F078FD00230A4A1021022080
+:106D300002F0F8FA0023084A1021032002F0CFFAEB
+:106D400002F0A6F900BF80BDE0CC000868CC0008C6
+:106D5000E00700201008002060CB000880B500AFDD
+:106D600002F0B6F90023144A0121002002F0B7FA1C
+:106D70000023124A0121022002F0B1FA104B1B68D5
+:106D8000104A127913441B780F49184601F044FD4C
+:106D900000230D4A0F21022002F0A1FA00210B4826
+:106DA00002F0FCFA00230A4A0F21032002F097FAAE
+:106DB00002F06EF900BF80BDECCC000878CC000872
+:106DC0000C080020E00700201008002084CC0008F8
+:106DD00060CB000880B500AF02F07AF90023144AB6
+:106DE0000121002002F07BFA0023124A0121022037
+:106DF00002F075FA104B1B68104A527913441B7845
+:106E00000F49184601F008FD00230D4A1021022009
+:106E100002F065FA00210B4802F0C0FA00230A4A8A
+:106E20001021032002F05BFA02F032F900BF80BDAE
+:106E3000F8CC000888CC0008CC070020E007002030
+:106E40001008002098CC000860CB000880B500AF87
+:106E500002F03EF90023124A0121002002F03FFA1D
+:106E60000023104A0121022002F039FA0E4BDB8880
+:106E70000E49184601F0D0FC00230C4A0E210220D6
+:106E800002F02DFA00210A4802F088FA0023094A8C
+:106E90000E21032002F023FA02F0FAF800BF80BDB1
+:106EA00008CD00089CCC0008E00700201008002056
+:106EB00098CC000860CB000880B500AF02F008F95C
+:106EC0000023124A0121002002F009FA0023104A8F
+:106ED0000121022002F003FA0E4B1B890E491846CD
+:106EE00001F09AFC00230C4A0E21022002F0F7F96F
+:106EF00000210A4802F052FA0023094A0E21032019
+:106F000002F0EDF902F0C4F800BF80BD14CD000816
+:106F1000A8CC0008E007002010080020B4CC00082E
+:106F200060CB000880B500AF104B1B78002B16D04B
+:106F300002F0CEF800230E4A0121002002F0CFF922
+:106F400000230C4A0121032002F0C9F900230A4A58
+:106F50000121042002F0C3F902F09AF804E0074B83
+:106F60000E221A70FDF7C0F900BF80BD1E0100207F
+:106F700020CD000834CD000848CD0008FA070020D5
+:106F800080B500AF02F0A4F800230A4A01210020D6
+:106F900002F0A5F90023084A0121032002F09FF91D
+:106FA0000023064A0121042002F099F902F070F84A
+:106FB00000BF80BD60CD000874CD000818CB00086C
+:106FC00080B500AF02F084F800230A4A01210020B6
+:106FD00002F085F90023084A0121032002F07FF91D
+:106FE0000023064A0121042002F079F902F050F84A
+:106FF00000BF80BD8CCD0008A0CD000818CB0008D4
+:1070000080B500AF094B1A68094B1B789B001344ED
+:107010001B681B78002B01D100F00EF8054B0322F2
+:107020001A70FDF761F900BF80BD00BF3C08002069
+:1070300032000020FA07002080B500AF0D4B1B780E
+:10704000012B03D10B4B06221A7005E0094B1B786C
+:10705000013BDAB2074B1A70074B1A68054B1B78D5
+:107060009B0013441B681B78002BE7D0FDF73CF90D
+:1070700000BF80BD320000203C08002080B500AF7A
+:107080000D4B1B78062B03D10B4B01221A7005E028
+:10709000094B1B780133DAB2074B1A70074B1A6899
+:1070A000054B1B789B0013441B681B78002BE7D013
+:1070B000FDF71AF900BF80BD320000203C08002017
+:1070C00080B500AF034B04221A70FDF70DF900BF25
+:1070D00080BD00BFFA07002080B500AF0F4B1B78C2
+:1070E000002B19D00D4B1B78012B03D10B4B052224
+:1070F0001A7005E0094B1B78013BDAB2074B1A7096
+:10710000074B1A68054B1B789B0013441B681B78C0
+:10711000012BE7D0FDF7E8F800BF80BD2301002078
+:10712000D407002080B500AF0F4B1B78002B19D07F
+:107130000D4B1B78052B03D10B4B01221A7005E078
+:10714000094B1B780133DAB2074B1A70074B1A68E8
+:10715000054B1B789B0013441B681B78012BE7D061
+:10716000FDF7C2F800BF80BD23010020D407002036
+:1071700080B500AF054B1B78002B04D0044B0722D1
+:107180001A70FDF7B1F800BF80BD00BF23010020D9
+:10719000FA07002080B500AF044B00221A70044BA0
+:1071A00004221A70FDF7A0F800BF80BD2301002063
+:1071B000FA07002080B500AF0C4B1B781A460C4B29
+:1071C0009B5C7E2B06D1094B1B781A46084B20216D
+:1071D000995407E0054B1B78054AD25C0132D1B2C5
+:1071E000034AD154FDF780F800BF80BD2001002084
+:1071F0002808002080B500AF0C4B1B781A460C4BBA
+:107200009B5C202B06D1094B1B781A46084B7E212C
+:10721000995407E0054B1B78054AD25C013AD1B27C
+:10722000034AD154FDF760F800BF80BD2001002063
+:107230002808002080B500AF084B1B780133DAB274
+:10724000064B1A70054B1B78052B02D1034B00220D
+:107250001A70FDF749F800BF80BD00BF2001002073
+:1072600080B500AF0C4B18780C4B1B781A460C49B4
+:1072700000F0F8FD0B4B1A78074B1A70074B0022F1
+:107280001A70094B00221A70084B08221A70FDF779
+:107290002BF800BF80BD00BF32000020230100207A
+:1072A000280800203807002020010020FA070020CD
+:1072B00080B500AF044B00221A70044B06221A70EE
+:1072C000FDF712F800BF80BD20010020FA07002062
+:1072D00080B500AF084B1A78084B1A70084B002293
+:1072E0001A70084B00221A70074B02221A70FCF722
+:1072F000FBFF00BF80BD00BF380700203200002028
+:107300002301002020010020FA07002080B500AFF3
+:10731000124B1B78002B1FD0104B1B78012B03D175
+:107320000E4B06221A7005E00C4B1B78013BDAB2BB
+:107330000A4B1A700A4B1A68084B1B789B001344BF
+:107340001B681B78002BE7D0044B1A78054B1B7881
+:107350009A42E1D0FCF7C8FF00BF80BD21010020A8
+:107360003C0800203807002080B500AF124B1B7886
+:10737000002B1FD0104B1B78062B03D10E4B012284
+:107380001A7005E00C4B1B780133DAB20A4B1A7005
+:107390000A4B1A68084B1B789B0013441B681B7828
+:1073A000002BE7D0044B1A78054B1B789A42E1D0AA
+:1073B000FCF79AFF00BF80BD210100203C0800209F
+:1073C0003807002080B500AF094B1B78002B0DD08B
+:1073D000074B1B781A46074B9B5C054A127883F0D3
+:1073E0000103D9B2034B9954FCF77EFF00BF80BD67
+:1073F000210100203008002080B500AF084B1B7829
+:10740000012B03D1064B05221A7005E0044B1B78B3
+:10741000013BDAB2024B1A70FCF766FF00BF80BD79
+:107420003300002080B500AF084B1B78052B03D13B
+:10743000064B01221A7005E0044B1B780133DAB2C7
+:10744000024B1A70FCF750FF00BF80BD33000020D4
+:1074500080B500AF084B1A68084B1B789B0013449B
+:107460001B681B78012B04D1054B0B221A70FCF70B
+:107470003BFF00BF80BD00BFD407002033000020C9
+:10748000FA07002080B500AF044B01221A70044BAC
+:1074900001221A70FCF728FF00BF80BD33000020D6
+:1074A000FA07002080B500AF124B1B78002B1FD0CD
+:1074B000104B1B78012B03D10E4B06221A7005E0EE
+:1074C0000C4B1B78013BDAB20A4B1A700A4B1A6854
+:1074D000084B1B789B0013441B681B78012BE7D0DB
+:1074E000044B1A78054B1B789A42E1D0FCF7FCFE5E
+:1074F00000BF80BD220100203C080020380700208A
+:1075000080B500AF124B1B78002B1FD0104B1B789F
+:10751000062B03D10E4B01221A7005E00C4B1B7891
+:107520000133DAB20A4B1A700A4B1A68084B1B78FF
+:107530009B0013441B681B78012BE7D0044B1A787F
+:10754000054B1B789A42E1D0FCF7CEFE00BF80BD10
+:10755000220100203C0800203807002080B500AF41
+:107560000C4B1B78002B12D00A4B1A780A4B1B7855
+:107570001946104600F022FD074B01221A70054BF8
+:1075800000221A70054B01221A70FCF7ADFE00BFF5
+:1075900080BD00BF2201002033000020FA07002038
+:1075A00080B500AF044B00221A70044B0B221A70F6
+:1075B000FCF79AFE00BF80BD22010020FA070020E0
+:1075C00080B500AF084B1B78184600F0D7FD0B20A4
+:1075D000FCF75AFE044B01221A70044B0A221A705F
+:1075E000FCF782FE00BF80BD33000020FA070020B8
+:1075F00080B500AF084B1B78062B03D1064B012248
+:107600001A7005E0044B1B780133DAB2024B1A7092
+:10761000FCF76AFE00BF80BDE007002080B500AF28
+:10762000084B1B78012B03D1064B06221A7005E08C
+:10763000044B1B78013BDAB2024B1A70FCF754FE84
+:1076400000BF80BDE007002080B500AF074B1A786F
+:10765000074B1B789A4202D0064B01221A70064B48
+:1076600010221A70FCF740FE00BF80BDE00700202A
+:10767000380700201E010020FA07002080B500AF67
+:10768000054B1A78054B1A70054B10221A70FCF73F
+:107690002BFE00BF80BD00BF38070020E0070020A0
+:1076A000FA07002080B500AF034801F0CDF9FCF7E0
+:1076B000BBFB00BF80BD00BFE007002080B500AF6E
+:1076C0000F4B1B781A460F4B13445B785A2B07D18C
+:1076D0000B4B1B781A460B4B134441225A700AE09D
+:1076E000074B1B78074A1A4452780132D1B2054A37
+:1076F00013440A465A70FCF7F7FD00BF80BD00BF77
+:107700001F010020E007002080B500AF0F4B1B7861
+:107710001A460F4B13445B78412B07D10B4B1B7858
+:107720001A460B4B13445A225A700AE0074B1B7837
+:10773000074A1A445278013AD1B2054A13440A461C
+:107740005A70FCF7D1FD00BF80BD00BF1F010020B3
+:10775000E007002080B500AF084B1B780133DAB298
+:10776000064B1A70054B1B78022B02D1034B0022EB
+:107770001A70FCF7B9FD00BF80BD00BF1F010020DB
+:1077800080B582B000AF0023FB7111E0FB790E4A97
+:1077900013445A780D4B1968FB790B445B789A4275
+:1077A00003D00B4B01221A7005E0FB790133FB710A
+:1077B000FB79012BEAD9074B10221A70FCF794FDD4
+:1077C00000BF0837BD4680BDE00700201C06002032
+:1077D0001E010020FA07002080B582B000AF002310
+:1077E000FB710CE00D4B1968FA79FB790A4451786A
+:1077F0000B4A13440A465A70FB790133FB71FB793B
+:10780000012BEFD9074B00221A70074B10221A7078
+:10781000FCF76AFD00BF0837BD4680BD1C0600208E
+:10782000E00700201F010020FA07002080B500AF0C
+:10783000084BDB78452B03D1064B0122DA7005E0BB
+:10784000044BDB780133DAB2024BDA70FCF74CFD03
+:1078500000BF80BDE007002080B500AF084BDB789B
+:10786000012B03D1064B4522DA7005E0044BDB788F
+:10787000013BDAB2024BDA70FCF736FD00BF80BD87
+:10788000E007002080B500AF084BDA78084B1B6892
+:10789000DB789A4202D0074B01221A70064B102265
+:1078A0001A70FCF721FD00BF80BD00BFE00700207B
+:1078B0001C0600201E010020FA07002080B500AF42
+:1078C000054B1B68DA78054BDA70054B10221A70ED
+:1078D000FCF70AFD00BF80BD1C060020E007002069
+:1078E000FA07002080B500AF084B1B79032B03D1AA
+:1078F000064B00221A7105E0044B1B790133DAB202
+:10790000024B1A71FCF7F0FC00BF80BDE0070020BD
+:1079100080B500AF084B1B79002B03D1064B032227
+:107920001A7105E0044B1B79013BDAB2024B1A7164
+:10793000FCF7DAFC00BF80BDE007002080B500AF97
+:10794000084B1A79084B1B681B799A4202D0074BE7
+:1079500001221A70064B10221A70FCF7C5FC00BFFA
+:1079600080BD00BFE00700201C0600201E01002093
+:10797000FA07002080B500AF054B1B681A79054B4C
+:107980001A71054B10221A70FCF7AEFC00BF80BDC7
+:107990001C060020E0070020FA07002080B500AF99
+:1079A000084B5B79042B03D1064B00225A7105E08A
+:1079B000044B5B790133DAB2024B5A71FCF794FC49
+:1079C00000BF80BDE007002080B500AF084B5B79A9
+:1079D000002B03D1064B04225A7105E0044B5B795E
+:1079E000013BDAB2024B5A71FCF77EFC00BF80BD4E
+:1079F000E007002080B500AF084B5A79084B1B68A0
+:107A00005B799A4202D0074B01221A70064B102272
+:107A10001A70FCF769FC00BF80BD00BFE0070020C2
+:107A20001C0600201E010020FA07002080B500AFD0
+:107A3000054B1B685A79054B5A71054B10221A7079
+:107A4000FCF752FC00BF80BD1C060020E0070020B0
+:107A5000FA07002080B500AF074BDB88B3F5616FF4
+:107A600005D2054BDB880A339AB2034BDA80FCF768
+:107A70003BFC00BF80BD00BFE007002080B500AF29
+:107A8000064BDB88002B05D0044BDB880A3B9AB2FF
+:107A9000024BDA80FCF728FC00BF80BDE007002025
+:107AA00080B500AF084BDA88084B1B68DB889A4228
+:107AB00002D0074B01221A70064B10221A70FCF7F5
+:107AC00013FC00BF80BD00BFE00700201C060020A3
+:107AD0001E010020FA07002080B500AF054B1B688F
+:107AE000DA88054BDA80054B10221A70FCF7FCFB94
+:107AF00000BF80BD1C060020E0070020FA07002020
+:107B000080B500AF074B1B89B3F5616F05D2054BFC
+:107B10001B890A339AB2034B1A81FCF7E5FB00BFBD
+:107B200080BD00BFE007002080B500AF064B1B8979
+:107B3000002B05D0044B1B890A3B9AB2024B1A81D9
+:107B4000FCF7D2FB00BF80BDE007002080B500AF8E
+:107B5000084B1A89084B1B681B899A4202D0074BB5
+:107B600001221A70064B10221A70FCF7BDFB00BFF1
+:107B700080BD00BFE00700201C0600201E01002081
+:107B8000FA07002080B500AF054B1B681A89054B2A
+:107B90001A81054B10221A70FCF7A6FB00BF80BDAE
+:107BA0001C060020E0070020FA07002080B500AF87
+:107BB000094B1A68094B106851681860596012899E
+:107BC0001A81074B00221A70064B0E221A70FCF71E
+:107BD0008BFB00BF80BD00BF1C060020E00700201B
+:107BE0001E010020FA07002080B500AF00F0F0FE73
+:107BF000FCF71AF900BF80BD80B500AF01F068FA4C
+:107C00000023064A0121002001F069FB01F040FA3F
+:107C1000FBF715FFFCF708F900BF80BDB4CD0008E5
+:107C200080B483B000AF0123FB710CE0FA79F979DD
+:107C300013461B011344084A1344084A42F82130F2
+:107C4000FB790133FB71FB79052BEFD9034B184608
+:107C50000C37BD4680BC70477808002060080020C3
+:107C600080B582B000AFFAF7E9FC02461E4B1A60FD
+:107C7000FBF71EFC02461D4B1A60FBF759FC02463F
+:107C80001B4B1A600123FB7127E0FB79194A52F85C
+:107C90002330FA791878184913461B0113440B4412
+:107CA000013302461A70FB79124A52F82330FA79EE
+:107CB0005878114913461B0113440B440233024602
+:107CC0001A70FA790C4913461B0113440B44033311
+:107CD00000221A70FB790133FB71FB79052BD4D993
+:107CE00000BF0837BD4680BD0808002004080020FA
+:107CF0003C080020380000207808002080B582B0C1
+:107D000000AF0123FB71A1E000F04AFAFB791946AC
+:107D10005248FBF72DFD514B1B78AA2B40F08B806E
+:107D2000FA794F4913461B0113440B4401221A7080
+:107D3000FA794A4B58784A4913461B0113440B44BD
+:107D4000043302461A70FA79444B98784449134632
+:107D50001B0113440B44053302461A70FA793F4B5A
+:107D6000D8783F4913461B0113440B44063302469F
+:107D70001A70FA79394B1879394913461B011344A3
+:107D80000B44073302461A70FA79344B5879344958
+:107D900013461B0113440B44083302461A70FA7948
+:107DA0002F4913461B0113440B44093300221A7058
+:107DB000FA792A4B98792A4913461B0113440B443C
+:107DC0000A3302461A70FA79244BD87924491346AB
+:107DD0001B0113440B440B3302461A70FA791F4BF4
+:107DE000187A1F4913461B0113440B440C330246F7
+:107DF0001A70FA79194B587A194913461B01134422
+:107E00000B440D3302461A70FA79144B987A1449D0
+:107E100013461B0113440B440E3302461A70FA79C1
+:107E20000E4BD87A0E4913461B0113440B440F33F3
+:107E300002461A7007E0FA79094913461B011344F8
+:107E40000B4400221A70FB790133FB71FB79052B7F
+:107E50007FF65AAF00BF0837BD4680BD40080020FE
+:107E60007808002080B582B000AF03463960FB710E
+:107E70001346BB7100F094F94D4BAA221A703B686F
+:107E80001A784B4B5A703B6801331A78484B9A70FA
+:107E90003B6802331A78464BDA703B6803331A7832
+:107EA000434B1A713B6804331A78414B5A71414B6A
+:107EB0001B681A7B3E4B9A713E4B1B685A7B3C4BAE
+:107EC000DA713C4B1B689A7B394B1A72394B1B6831
+:107ED000DA7B374B5A72374B1B681A7C344B9A72D9
+:107EE000344B1B685A7C324BDA72334B1A68FB797D
+:107EF0009B0013441B681A792D4B1A732E4B1A687A
+:107F0000FB799B0013441B685A79294B5A732A4BFF
+:107F10001A68FB799B0013441B689A79244B9A7367
+:107F2000254B1A68FB799B0013441B68DA79204BB8
+:107F3000DA73214B1A68FB799B0013441B681A7A89
+:107F40001B4B1A741C4B1A68FB799B0013441B686B
+:107F50005A7A174B5A74184B1A68FB799B001344D2
+:107F60001B689A7A124B9A74134B1A68FB799B0020
+:107F700013441B68DA7A0E4BDA740F4B1A68FB79DC
+:107F80009B0013441B681A7B094B1A750A4B1A682D
+:107F9000FB799B0013441B685A7B054B5A75BB79D0
+:107FA00019460348FBF7A8FC00BF0837BD4680BD53
+:107FB000400800200808002004080020B0B584B064
+:107FC00000AF03460A46FB711346BB7100F0E8F8A8
+:107FD000BB7919466548FBF7CBFB654B1A68FB7903
+:107FE0009B0013441B6814220021184601F0BFFCBB
+:107FF000604B1A68FB799B0013441B681822002110
+:10800000184601F0B4FC5B4B1A68FB799B001344E3
+:108010001B6801221A70574B1A68FB799B001344A6
+:108020001B6801229A73534B1A68FB799B00134417
+:108030001C68FBF7DDFE034663600023FB7315E05D
+:10804000BA79FC7B4B4B1968FB799B000B44186891
+:10805000F97B494D13461B0113442B44234404333D
+:108060001A784318DA73FB7B0133FB73FB7B042B19
+:10807000E6D9BA793E4B1968FB799B000B44196825
+:108080003D4813461B011344034401331B780B7016
+:10809000BA79374B1968FB799B000B44196836484D
+:1080A00013461B011344034402331B784B70304BBF
+:1080B0001A68FB799B0013441B682C4A127B1A71C7
+:1080C0002B4B1A68FB799B0013441B68274A527B91
+:1080D0005A71274B1A68FB799B0013441B68234A8B
+:1080E000927B9A71224B1A68FB799B0013441B68A0
+:1080F0001E4AD27BDA711E4B1A68FB799B0013442F
+:108100001B681A4A127C1A72194B1A68FB799B0079
+:1081100013441B68154A527C5A72154B1A68FB7936
+:108120009B0013441B68114A927C9A72104B1A6888
+:10813000FB799B0013441B680C4AD27CDA720C4B0F
+:108140001A68FB799B0013441B68084A127D1A7356
+:10815000074B1A68FB799B0013441B68034A527D46
+:108160005A7300BF1037BD46B0BD00BF40080020A5
+:10817000040800203C0800207808002080B582B068
+:1081800000AF0346FB7100F00BF8FB79194603487A
+:10819000FBF7B2FB00BF0837BD4680BD400800209A
+:1081A00080B483B000AF0023FB7106E0FB79074A7F
+:1081B000FF21D154FB790133FB71FB791F2BF5D9DA
+:1081C00000BF0C37BD4680BC704700BF4008002090
+:1081D00080B588B000AF786039600023FB61002370
+:1081E000BB6100237B6100233B617B683B2B39D95A
+:1081F0007B688B4AA2FB03235B09BB617A68884BCF
+:10820000A3FB021359090B461B015B1A9B00D31AEF
+:10821000FB61BB693B2B27D9BB69814AA2FB0323C6
+:108220005B097B61BA697E4BA3FB021359090B46BC
+:108230001B015B1A9B00D31ABB617B69172B13D9F7
+:108240007B69784AA2FB03231B093B617A69754B62
+:10825000A3FB021319090B465B000B44DB00D31A86
+:108260007B6101E07B68FB613B69002B44D03B698B
+:1082700007F10C021146184600F0CEFA3B69092BB3
+:108280000BD93A7B3B681A703B6801337A7B1A70D2
+:108290003B68023364221A700AE03B6830221A708D
+:1082A0003B6801333A7B1A703B68023364221A70D0
+:1082B0007B6907F10C021146184600F0ADFA7B69A4
+:1082C000092B0CD93B6803333A7B1A703B680433A3
+:1082D0007A7B1A703B68053368221A7098E03B6815
+:1082E000033330221A703B6804333A7B1A703B68C0
+:1082F000053368221A708BE07B69002B44D07B69C0
+:1083000007F10C021146184600F086FA7B69092B2A
+:108310000BD93A7B3B681A703B6801337A7B1A7041
+:108320003B68023368221A700AE03B6830221A70F8
+:108330003B6801333A7B1A703B68023368221A703B
+:10834000BB6907F10C021146184600F065FABB69DB
+:10835000092B0CD93B6803333A7B1A703B68043312
+:108360007A7B1A703B6805336D221A7050E03B68C7
+:10837000033330221A703B6804333A7B1A703B682F
+:1083800005336D221A7043E0BB6907F10C021146F8
+:10839000184600F041FABB69092B0BD93A7B3B68C0
+:1083A0001A703B6801337A7B1A703B6802336D2286
+:1083B0001A700AE03B6830221A703B6801333A7B3E
+:1083C0001A703B6802336D221A70FB6907F10C02C8
+:1083D0001146184600F020FAFB69092B0CD93B68BE
+:1083E00003333A7B1A703B6804337A7B1A703B681C
+:1083F000053373221A700BE03B68033330221A7086
+:108400003B6804333A7B1A703B68053373221A7059
+:108410003B68063300221A7000BF2037BD4680BD7E
+:1084200089888888ABAAAAAA80B483B000AF786094
+:1084300002E07B68013B7B607B68002BF9D100BFC9
+:108440000C37BD4680BC7047B0B586B000AF7860D1
+:108450000023FB7501233B614FF07E53FB604FF01F
+:108460000003BB607B681B78002B02D14FF0000338
+:108470007AE0FB7D7A6813441B782D2B2BD14FF0CB
+:10848000FF333B61FB7D0133FB7524E0B868F7F7F0
+:10849000D3FF4FF00002364BF8F726F803460C46A0
+:1084A00025461C46FB7D7A6813441B78303B1846F2
+:1084B000F7F7B0FF02460B4620462946F7F75EFE67
+:1084C00003460C4618462146F8F706FB0346BB60F8
+:1084D000FB7D0133FB75FB7D7A6813441B782E2BE3
+:1084E000D4D1FB7D0133FB752AE0B868F7F7A4FF10
+:1084F0004FF000021E4BF7F7F7FF03460C462546E8
+:108500001C46FB7D7A6813441B78303B1846F7F70E
+:1085100081FF02460B4620462946F7F72FFE034609
+:108520000C4618462146F8F7D7FA0346BB601149B6
+:10853000F868F8F72FFC0346FB60FB7D0133FB7501
+:10854000FB7D7A6813441B78002BCED13869F8F78D
+:10855000CDFB0346B9681846F8F71CFC0346F968DA
+:108560001846F8F7CBFC034618461837BD46B0BD91
+:10857000000024400000204190B58DB000AFF860AD
+:108580000B467A60FB72002387F82F300023BB6113
+:108590004FF07E53BB62002387F827304FF0000175
+:1085A000F868F8F78BFD0346002B07D14FF0000168
+:1085B000F868F8F783FD0346002B07D07B6830226C
+:1085C0001A707B68013300221A70D6E04FF0000168
+:1085D000F868F8F77DFD0346002B0FD02D2387F8B0
+:1085E0002730F868F7F728FF03460C46184621465F
+:1085F000F8F772FA034683F00043FB60FB687B6187
+:10860000002387F826300AE05D49B86AF8F7C2FB14
+:108610000346BB6297F82630013387F8263097F877
+:108620002620FB7A9A42EFD3B96AF868F8F7B2FBD2
+:108630000346FB60F868F8F799FD03463B6297F83C
+:108640002F305A1C87F82F201A467B6813440022CB
+:108650001A703A6A4B4BA3FB0213D9080B469B00D6
+:108660000B445B00D31ABB613B6A464AA2FB03235F
+:10867000DB083B62BB69DAB297F82F30591C87F8E8
+:108680002F1019467B680B443032D2B21A703B6A05
+:10869000002BDED14FF07E517869F8F719FD0346C3
+:1086A000002B14D00023FB770DE097F82F307A6869
+:1086B000134430221A7097F82F30013387F82F3087
+:1086C000FB7F0133FB77FA7FFB7A9A42EDD397F871
+:1086D00027302D2B07D197F82F307A68134497F85D
+:1086E00027201A7004E097F82F30013B87F82F30CD
+:1086F00097F82F300133BB770BE0BB7F013B7A68E3
+:108700001A44BB7F79680B4412781A70BB7F013B17
+:10871000BB77BA7FFB7A01339A42EEDCFB7A0133F6
+:108720007A6813442E221A7097F82F30013387F895
+:108730002F3000237B771BE07B7F7A6813441B7804
+:10874000FB7497F82F307A681A447B7F79680B4462
+:1087500012781A7097F82F307A681344FA7C1A70DE
+:108760007B7F01337B7797F82F30013B87F82F30E1
+:108770007A7F97F82F309A42DED33437BD4690BDCA
+:1087800000002041CDCCCCCC80B487B000AF786065
+:108790000023FB7501233B610023FB607B681B7892
+:1087A000002B01D1002331E07B681B78302B06D1F0
+:1087B0007B6801331B78002B01D1002326E0FB7D71
+:1087C0007A6813441B782D2B16D14FF0FF333B6191
+:1087D000FB7D0133FB750FE0FA6813469B001344E1
+:1087E0005B001946FB7D7A6813441B78303B0B44D1
+:1087F000FB60FB7D0133FB75FB7D7A6813441B78BE
+:10880000002BE9D1FB683A6902FB03F318461C37D9
+:10881000BD4680BC7047000080B485B000AF786072
+:1088200039600023FB7300233B730023BB737B6819
+:10883000002B07D13B6830221A703B6801330022BD
+:108840001A705EE07B68002B04DA2D23BB737B6813
+:108850005B427B60FB7B5A1CFA731A463B681344ED
+:1088600000221A701FE07A68284B83FB02139910CC
+:10887000D317C91A0B469B000B445B00D11A0B4659
+:108880003B737B68214A82FB03129210DB17D31AD9
+:108890007B60FB7B5A1CFA731A463B6813443A7B95
+:1088A0003032D2B21A707B68002BDCDCBB7B2D2B04
+:1088B00005D1FB7B3A681344BA7B1A7002E0FB7B5C
+:1088C000013BFB7300237B7317E07B7B3A68134407
+:1088D0001B78FB72FB7B3A681A447B7B39680B443C
+:1088E00012781A70FB7B3A681344FA7A1A707B7B11
+:1088F00001337B73FB7B013BFB737A7BFB7B9A42EF
+:10890000E3D31437BD4680BC704700BF6766666618
+:1089100080B400AF024B1846BD4680BC704700BF14
+:108920005000002080B400AF024B1846BD4680BC0A
+:10893000704700BF5800002080B400AF024B1846BB
+:10894000BD4680BC704700BFE008002080B582B003
+:1089500000AF0023FB80FB881846FAF76FFE034642
+:10896000AA2B01D000F034F800211748FAF700FFD5
+:10897000154B5A78154B1A70134B9A78134B5A7043
+:10898000114BDA78114B9A700F4B1A790F4BDA7042
+:108990000D4B5A790D4B1A710B4B9A790B4B5A713F
+:1089A000094BDA79094B9A71074B1A7A074BDA713E
+:1089B000054B5A7A054B1A72034B9A7A034B5A723B
+:1089C00000BF0837BD4680BDEC080020E00800204D
+:1089D00080B582B000AF0023FB7106E0FB79194A35
+:1089E000FF21D154FB790133FB71FB791F2BF5D9A2
+:1089F000144BAA221A70134B01225A70114B4922B0
+:108A00009A70104B4422DA700E4B01221A710D4BF2
+:108A100000225A710B4B00229A710A4B3C22DA71E8
+:108A2000084B00221A72074B64225A72054B00222F
+:108A30009A7200210348FAF75FFF00BF0837BD466E
+:108A400080BD00BFEC08002080B584B000AF786026
+:108A50000023FB7306E0FB7B1D4AFF21D154FB7B07
+:108A60000133FB73FB7B1F2BF5D9194BAA221A701C
+:108A70007B681A78164B5A707B685A78144B9A7038
+:108A80007B689A78124BDA707B68DA78104B1A712F
+:108A90007B681A790E4B5A717B685A790C4B9A7124
+:108AA0007B689A790A4BDA717B68DA79084B1A721B
+:108AB0007B681A7A064B5A727B685A7A044B9A7210
+:108AC00000210348FAF718FF00BF1037BD4680BDEC
+:108AD000EC08002080B5DEB000AFF9F7D3F8F9F765
+:108AE000B9F82E48FFF7A0FCF9F7A8F82B48FFF7D4
+:108AF0009BFCF9F7AFF83B1D294A184611464FF485
+:108B0000B6731A4600F028FF3B1DC7F8743129E000
+:108B1000D7F874311B7887F87231D7F87431013384
+:108B2000C7F8743100F042F8F9F7A0F8002387F88D
+:108B300073310FE0D7F874311B78184600F01AFA39
+:108B4000D7F874310133C7F8743197F873310133B2
+:108B500087F8733197F8732197F872319A42E9D305
+:108B6000F9F790F8D7F874311B78002BD0D1112089
+:108B700000F02CF8FFF7E0FE02460A4B1A60094BA2
+:108B80001B681B791A46084B9B5C184600F040F89E
+:108B900000BF07F5BC77BD4680BD00BF40420F0057
+:108BA000D4CD00081C0600205C00002080B400AF7B
+:108BB00000BF054B9B6803F48053002BF9D000BF26
+:108BC000BD4680BC704700BF0008014080B582B040
+:108BD00000AF0346FB71FFF7E9FFF9F747F81120F3
+:108BE00000F0C8F9122000F0C5F9022000F0C2F927
+:108BF0000D2000F0BFF9002000F0BCF9FB79184609
+:108C000000F0B8F9F9F73EF800BF0837BD4680BD5F
+:108C100080B582B000AF0346FB71FFF7C7FFF9F7DD
+:108C200025F8112000F0A6F9222000F0A3F9012078
+:108C300000F0A0F9012000F09DF9FB79184600F042
+:108C400099F9F9F71FF800BF0837BD4680BD00004D
+:108C500080B582B000AFFFF7A9FFF9F707F815203C
+:108C600000F088F9012000F085F9F9F70BF8FFF71B
+:108C70009DFFF8F7FBFF662000F07CF90023FB71F5
+:108C800008E0FB79144AD35C184600F073F9FB79CD
+:108C90000133FB71FB79102BF3D9F8F7F3FFFFF7E2
+:108CA00085FFF8F7E3FF312000F064F90B4B1B68F8
+:108CB000DB78184600F05EF9102000F05BF9002028
+:108CC00000F058F9002000F055F9F8F7DBFF00BF7D
+:108CD0000837BD4680BD00BF200900201C060020CB
+:108CE00080B500AFFFF762FFF8F7C0FF322000F059
+:108CF00041F90E4B1B68DB78184600F03BF9002069
+:108D000000F038F9002000F035F9002000F032F9C9
+:108D1000012000F02FF9012000F02CF9012000F0D3
+:108D200029F9F8F7AFFF00BF80BD00BF1C06002087
+:108D300090B583B000AF0023BB71FFF737FFF8F7A2
+:108D400095FF212000F016F9002000F013F9F8F744
+:108D500099FFFFF72BFFF8F789FF442000F00AF98D
+:108D6000002000F007F9002000F004F90346BB7171
+:108D7000F8F788FFBB7903F00803002B19D0FFF741
+:108D800015FFF8F773FF152000F0F4F8022000F04B
+:108D9000F1F8F8F777FFFFF709FFF8F767FF3420DE
+:108DA00000F0E8F8012000F0E5F8F8F76BFF002389
+:108DB00021E0BB7903F01003002B1BD0FFF7F6FE78
+:108DC000F8F754FF772000F0D5F80023FB710AE094
+:108DD000FC79002000F0CEF803461A46084B1A55DD
+:108DE000FB790133FB71FB79102BF1D9F8F74AFFBE
+:108DF000012300E0002318460C37BD4690BD00BF9C
+:108E00000C09002080B400AF024B1846BD4680BC60
+:108E1000704700BF2009002080B400AF024B184605
+:108E2000BD4680BC704700BF0C09002080B400AF75
+:108E3000294B9B69284A43F480539361264B9B69D5
+:108E4000254A43F001039361244B5B68234A43F0B6
+:108E500001035360214B5B68204A43F00073536069
+:108E60001F4B1B889BB21E4A23F038039BB2138012
+:108E70001B4B1B889BB21A4A43F400739BB21380AE
+:108E8000174B1B889BB2164A43F480739BB2138026
+:108E9000134B1B889BB2124A43F004039BB213800E
+:108EA0000F4B1B889BB20E4A23F002039BB2138028
+:108EB0000B4B1B889BB20A4A23F001039BB2138021
+:108EC000074B1B889BB2064A43F040039BB21380BA
+:108ED00000BFBD4680BC704700100240000001404A
+:108EE0000030014080B400AF204BDB691F4A43F4DF
+:108EF0008043D3611E4B1B889BB21D4A23F038036D
+:108F00009BB213801A4B1B889BB2194A43F400731F
+:108F10009BB21380164B1B889BB2154A43F4807397
+:108F20009BB21380124B1B889BB2114A43F004037F
+:108F30009BB213800E4B1B889BB20D4A23F0020399
+:108F40009BB213800A4B1B889BB2094A23F0010392
+:108F50009BB21380064B1B889BB2054A43F040032B
+:108F60009BB2138000BFBD4680BC7047001002401A
+:108F70000038004080B483B000AF0346FB7100BFEF
+:108F80000D4B1B899BB203F00203002BF8D00A4B58
+:108F9000FA7992B29A8100BF074B1B899BB203F00A
+:108FA0000103002BF8D0044B9B899BB2DBB218461F
+:108FB0000C37BD4680BC70470030014080B483B0A0
+:108FC00000AF0346FB7100BF0D4B1B899BB203F042
+:108FD0000203002BF8D00A4BFA7992B29A8100BFB3
+:108FE000074B1B899BB203F00103002BF8D0044B05
+:108FF0009B899BB2DBB218460C37BD4680BC7047DC
+:109000000038004080B582B000AFF8F783FEF8F773
+:1090100051FEF8F767FE1C48FFF706FAF8F73EFE28
+:109020001948FFF701FAF8F745FE1748FFF7FCF972
+:109030000023FB710023BB7119E0FB795A1CFA7104
+:109040001A46124B9B5CBB71F8F758FE08E0FB799F
+:109050005A1CFA711A460D4B9B5C1846FFF7AEFF7F
+:10906000BB795A1EBA71002BF1D1F8F753FEFB7988
+:10907000064AD35C002BE0D100F02AF800F008F893
+:1090800000BF0837BD4680BDA086010038D5000866
+:1090900080B582B000AFF8F719FEF8F72FFE002375
+:1090A000FB8008E0FB88094AD35C1846FFF786FF7F
+:1090B000FB880133FB80FB88B3F5806FF2D3F8F7B0
+:1090C00029FE00BF0837BD4680BD00BF340900201F
+:1090D00080B483B000AF0023FB8006E0FB88074A22
+:1090E0000021D154FB880133FB80FB88B3F5806FEE
+:1090F000F4D300BF0C37BD4680BC70473409002054
+:1091000080B483B000AF0346FB710B46BB711346BE
+:109110007B7197F90530002B02D0012B1DD037E071
+:10912000FA79BB79DB08D8B20346DB011344284A3D
+:10913000D35C5AB2BB7903F00703012101FA03F3B0
+:109140005BB2DB435BB2134059B2FA790346DB01F1
+:109150001344C9B21E4AD15435E0FA79BB79DB0811
+:10916000D8B20346DB011344194AD35C5AB2BB7927
+:1091700003F00703012101FA03F35BB2134359B271
+:10918000FA790346DB011344C9B2114AD1541AE0FB
+:10919000FA79BB79DB08D8B20346DB0113440C4AE9
+:1091A000D35C5AB2BB7903F00703012101FA03F340
+:1091B0005BB2534059B2FA790346DB011344C9B29A
+:1091C000034AD15400BF00BF0C37BD4680BC704776
+:1091D0003409002080B483B000AF03460A46FB7117
+:1091E0001346BB71FA7913465B001344DA00D21AB6
+:1091F000BB791A4413465B001A44FB7913449BB2B3
+:109200005B009AB2034B1A8000BF0C37BD4680BC8E
+:10921000704700BF2401002080B485B000AF034632
+:109220000A46FB711346BB71BB79002B02D0FF23AA
+:10923000BB7101E00023BB710023FB7317E0FA79D7
+:10924000F97B144813469B00134403440B441A78DB
+:10925000114B1B88591C88B20F4908801946BB79ED
+:109260005340DAB20D4B5A54FB7B0133FB73FB7B4B
+:10927000042BE4D9084B1B885A1C91B2064A118072
+:109280001946064ABB79535400BF1437BD4680BC0B
+:10929000704700BF68D20008240100203409002074
+:1092A00090B583B000AF0446084611461A462346DF
+:1092B000FB710346BB710B467B7113463B71BA7958
+:1092C000FB7911461846FFF785FF3A797B791146FD
+:1092D0001846FFF7A1FF00BF0C37BD4690BD80B513
+:1092E00082B000AF3A601A460346FB710B46BB7171
+:1092F00013467B71BA79FB7911461846FFF76AFF6E
+:1093000008E03B685A1C3A601B787A791146184687
+:10931000FFF782FF3B681B78002BF2D100BF0837B4
+:10932000BD4680BD80B584B000AF3A601A460346A2
+:10933000FB710B46BB7113467B710023FB73BA793B
+:10934000FB7911461846FFF745FF05E03B680133FE
+:109350003B60FB7B0133FB733B681B78002BF5D133
+:1093600012E0FB7B013BFB733B68013B3B603B68CE
+:109370001B787A7911461846FFF74EFF064B1B887B
+:109380000C3B9AB2044B1A80FB7B002BE9D100BF47
+:109390001037BD4680BD00BF2401002080B582B0DB
+:1093A00000AF78600B46FB7008E07B685A1C7A605F
+:1093B0001B78FA7811461846FFF72EFF7B681B785A
+:1093C000002BF2D100BF0837BD4680BD80B485B008
+:1093D00000AF78600023FB8109E0FB897A681A44BA
+:1093E000FB891178064AD154FB890133FB81FB8943
+:1093F000B3F5806FF1D300BF1437BD4680BC704712
+:109400003409002080B582B000AF3A601A460346A6
+:10941000FB710B46BB7113467B71BA79FB79114620
+:109420001846FFF7D7FE0BE03B685A1C3A60094A22
+:109430001288511C88B2074908801978064B995444
+:109440007B795A1E7A71002BEED100BF0837BD46DA
+:1094500080BD00BF240100203409002080B483B007
+:1094600000AF0346FB71FB7903F01F03012202FAF0
+:1094700003F1054A97F907305B0942F8231000BF52
+:109480000C37BD4680BC704700E100E080B500AFFE
+:1094900000F032F800F052F800F0A8F800F0ECF814
+:1094A00000BF80BD80B500AFF8F7B0FB00F0D4F886
+:1094B000034B1B78002B01D100F02CF900BF80BDBD
+:1094C0002601002080B400AF054B1B7883F0010318
+:1094D000DAB2034B1A7000BFBD4680BC704700BFB4
+:1094E0002601002080B400AF024B1B781846BD4611
+:1094F00080BC70472601002080B400AF0D4B1B6874
+:109500000C4A23F0040313600A4B0B4A5A60094BC0
+:1095100000229A60074B1B68064A43F0020313605F
+:10952000044B1B68034A43F00103136000BFBD46B0
+:1095300080BC704710E000E03F54890080B500AF68
+:10954000164B9B69154A43F400639361144B48F62C
+:109550009F421A85124BC7229A85114B1B889BB2DA
+:109560000F4A43F004039BB213800D4B01229A82F1
+:109570000B4B1B8A9BB20A4A23F001039BB2138256
+:10958000074B9B899BB2064A43F001039BB2938130
+:109590001920FFF763FF00BF80BD00BF001002402D
+:1095A000002C014080B400AF054B1B889BB2044ADD
+:1095B00043F001039BB2138000BFBD4680BC7047DF
+:1095C000002C014080B400AF074B1B889BB2064AB9
+:1095D00023F001039BB21380034B01229A8200BF48
+:1095E000BD4680BC704700BF002C014080B500AF75
+:1095F000104BDB690F4A43F00103D3614FF0804306
+:1096000048F69F421A854FF08043C7229A854FF053
+:10961000804301229A824FF080439B899BB24FF096
+:10962000804243F001039BB293811C20FFF716FF99
+:1096300000BF80BD0010024080B400AF4FF08043F7
+:109640001B889BB24FF0804223F001039BB2138032
+:1096500000BFBD4680BC704780B400AF4FF0804370
+:109660001B889BB24FF0804243F001039BB21380F2
+:1096700000BFBD4680BC704780B400AF194BDB69AA
+:10968000184A43F00203D361174B42F227321A857E
+:10969000154B03229A85144B02221A87124B1B8BFF
+:1096A0009BB2114A43F480439BB213830E4B1B8B36
+:1096B0009BB20D4A43F400539BB213830A4B1B8B9E
+:1096C0009BB2094A43F480539BB21383064B1B8C15
+:1096D0009BB2054A43F010039BB2138400BFBD4602
+:1096E00080BC7047001002400004004080B400AF0E
+:1096F000074B1B889BB2064A23F001039BB21380E1
+:10970000034B00229A8400BFBD4680BC704700BF57
+:109710000004004080B400AF054B1B889BB2044A94
+:1097200043F001039BB2138000BFBD4680BC70476D
+:109730000004004080B483B000AF0346FB71FB79A6
+:1097400003F01F03012202FA03F1054A97F90730DB
+:109750005B0942F8231000BF0C37BD4680BC704740
+:1097600000E100E080B500AF2C4B9B692B4A43F42D
+:10977000804393612A4B41F64C521A81284B9B89B6
+:109780009BB2274A43F008039BB29381244B9B89E9
+:109790009BB2234A43F004039BB29381204B9B89E5
+:1097A0009BB21F4A43F400539BB293811C4B9B8A8C
+:1097B0009BB21B4A43F040039BB29382174B5B69F9
+:1097C000164A43F001035361164B174A9A60154B32
+:1097D000164ADA60134B4FF480625A60114B1B68D3
+:1097E000104A43F0800313600E4B1B680D4A43F090
+:1097F000020313600B4B1B680A4A43F0010313601A
+:109800000F20FFF797FF0A4B4FF480325A60F8F7AA
+:109810000BFF0246074B1A6000BF80BD00100240DC
+:10982000003801405800024004380140380D002043
+:1098300000000240340D002080B400AF044B1B68D0
+:10984000034A23F00103136000BFBD4680BC70478C
+:109850005800024080B400AF064B4FF480625A605B
+:10986000044B1B68034A43F00103136000BFBD466D
+:1098700080BC70475800024080B483B000AF002322
+:10988000FB800EE0FA880B4B1968FB880B440A49F1
+:109890008A5C1A70FB88084A0021D154FB88013386
+:1098A000FB80FB88B3F5806FECD300BF0C37BD465F
+:1098B00080BC7047340D0020380D00200D488546CF
+:1098C000F7F774FC0C480D490D4A002302E0D45808
+:1098D000C4500433C4188C42F9D30A4A0A4C0023FA
+:1098E00001E013600432A242FBD300F011F8FAF752
+:1098F000C3F8FEE70050002000000020C800002050
+:10990000C0E70008C800002038110020FEE7000072
+:1099100070B500250C4E0D4CA41BA410A54209D116
+:1099200003F04CF800250A4E0A4CA41BA410A542D3
+:1099300005D170BD56F8253098470135EEE756F849
+:10994000253098470135F2E7B8E70008B8E7000886
+:10995000B8E70008BCE7000810B5431E0A4491426E
+:1099600000D110BD11F8014B03F8014FF7E7034692
+:109970000244934200D1704703F8011BF9E700004D
+:109980002DE9F84FB64B21F000469E4204460D46A5
+:109990008B4617DDB34B9E4201DC09D140B1224614
+:1099A0002B4620462946F6F7E9FB04460D4605E01E
+:1099B000BBF1000FAC4C40F32181AC4D2046294651
+:1099C000BDE8F88FAA4B9E4211DCA3F1DE739E42E4
+:1099D0000ADC8BA3D3E90023F6F7D0FB0022A54BCA
+:1099E000F7F712F80028E9D14FF0FF3A27E000F02E
+:1099F00087F9A14B04469E420D4600F3B880A3F5BB
+:109A000050239E4200F39C8002460B46F6F7B6FBBD
+:109A10000022984BF6F7B0FB002206460F464FF0A7
+:109A2000804320462946F6F7A9FB02460B463046FE
+:109A30003946F6F783FE4FF0000A04460D462246EB
+:109A40002B4620462946F6F74FFD02460B46804638
+:109A50008946F6F749FD6CA3D3E9002306460F4675
+:109A6000F6F742FD6AA3D3E90023F6F787FB3246F7
+:109A70003B46F6F739FD68A3D3E90023F6F77EFBF2
+:109A800032463B46F6F730FD65A3D3E90023F6F7EF
+:109A900075FB32463B46F6F727FD63A3D3E9002367
+:109AA000F6F76CFB32463B46F6F71EFD60A3D3E9A2
+:109AB0000023F6F763FB42464B46F6F715FD5EA31F
+:109AC000D3E900238046894630463946F6F70CFD37
+:109AD0005BA3D3E90023F6F74FFB32463B46F6F78C
+:109AE00003FD59A3D3E90023F6F746FB32463B4674
+:109AF000F6F7FAFC56A3D3E90023F6F73DFB32460E
+:109B00003B46F6F7F1FC54A3D3E90023F6F734FB08
+:109B100032463B46F6F7E8FC02460B4640464946CD
+:109B2000F6F72CFB22462B46F6F7DEFCBAF1FF3F98
+:109B300002460B4644D120462946F6F71DFB34E782
+:109B400000224C4BF6F718FB002206460F46494B05
+:109B500020462946F6F712FB02460B4630463946A8
+:109B6000F6F7ECFD4FF0010A04460D4667E7434B5C
+:109B70009E421ADC0022424BF6F7FEFA002206460D
+:109B80000F463F4B20462946F6F7AEFC0022394BE4
+:109B9000F6F7F4FA02460B4630463946F6F7CEFDA4
+:109BA0004FF0020A04460D4649E702460B460020E4
+:109BB0003449F6F7C3FD4FF0030A04460D463EE76D
+:109BC000314B324E4FEACA0A56449A44DAE900232E
+:109BD000F6F7D2FA22462B46F6F7CEFA02460B46A5
+:109BE000D6E90001F6F7C8FABBF1000F04460D46AE
+:109BF000BFF6E4AE01F100431D46DFE6244DDDE68D
+:109C00009C7500883CE4377E11DA22E33AAD903F40
+:109C1000EB0D76244B7BA93F513DD0A0660DB13FA3
+:109C20006E204CC5CD45B73FFF8300922449C23F0B
+:109C30000D5555555555D53F2F6C6A2C44B4A2BFD0
+:109C40009AFDDE522DDEAD3F6D9A74AFF2B0B33F98
+:109C5000711623FEC671BC3FC4EB98999999C93F10
+:109C6000FFFF0F440000F07F182D4454FB21F93F03
+:109C7000FFFFDB3F0000F03FFFFFF23FFF7F0340AD
+:109C80000000F83F0000F0BF68E5000848E5000864
+:109C9000FB21F9BF30B5184A21F00043934287B049
+:109CA00004DC0022002301F06BFE06E0134A93421D
+:109CB00005DD02460B46F6F75FFA07B030BD02AA93
+:109CC00001F0C2FBDDE9042300F00304012CDDE90F
+:109CD000020108D0022C0CD0002CE4D00124009406
+:109CE00002F056FAE9E7009402F052FA01F100415D
+:109CF000E3E701F045FEF9E7FB21E93FFFFFEF7FD6
+:109D000021F000431946704730B51A4A21F000434C
+:109D1000934287B006DC002300220093002302F068
+:109D200037FA06E0144A934205DD02460B46F6F781
+:109D300023FA07B030BD02AA01F086FBDDE9042357
+:109D400000F00304012CDDE9020105D0022C06D04D
+:109D500064B901240094E2E701F012FEE9E701246E
+:109D6000009402F015FA01F10041E2E701F008FE6B
+:109D7000F9E700BFFB21E93FFFFFEF7F30B5124A53
+:109D800021F00043934287B006DC012300220093B8
+:109D9000002302F0B5FA06E00C4A934205DD0246C4
+:109DA0000B46F6F7E9F907B030BD02AA01F04CFB0B
+:109DB000DDE90423400000F00200C0F10100009042
+:109DC000DDE90201E5E700BFFB21E93FFFFFEF7F8F
+:109DD0002DE9F0438BB004460D4600F079FADFF828
+:109DE0009480064698F900300F46013336D022465B
+:109DF0002B4620462946F6F711FE814600282DD134
+:109E000020462946FFF77CFF0022174BF6F7FCFDA2
+:109E100020B301230093154B15480193CDF82090F2
+:109E2000CDE90445CDE9024502F0B8FC98F90030CF
+:109E3000CDE90601022B04D102F0BAFD2123036013
+:109E400004E0684602F0A8FC0028F5D0089B1BB18E
+:109E500002F0AEFD089B0360DDE906673046394637
+:109E60000BB0BDE8F08300BF0000F03F88E50008BC
+:109E700090E50008C40000202DE970438AB0044634
+:109E80000D4600F021FC344B804693F90060894672
+:109E9000731C5BD022462B4620462946F6F7BEFDB2
+:109EA000002853D10022002320462946F6F7ACFDB6
+:109EB00000284BD1294B08900193CDE90245CDE90B
+:109EC0000445A6B94FF06042254B2046CDE9062354
+:109ED000294600220023F6F76FFD40BB0123022E26
+:109EE000009319D102F064FD2123036019E00022E0
+:109EF0001C4B2046CDE90623294600220023F6F715
+:109F00005BFD0028EAD002239E42009311D102F0AB
+:109F10004FFD2223036011E0684602F03DFC00285B
+:109F2000E0D0114802F03AFCCDE9060106E0022338
+:109F30000093684602F030FC0028E8D0089B1BB173
+:109F400002F036FD089B0360DDE90689404649467C
+:109F50000AB0BDE8708300BFC40000208DE5000892
+:109F6000FFFFEFC70000F0FF90E500082DE9F04F7C
+:109F70008FB01D4680468946144600F059FDA14F1A
+:109F8000CDE9000197F900303E46029301335FD0DE
+:109F900022462B4620462946F6F740FD82460028F9
+:109FA00056D142464B4640464946F6F737FD0390A8
+:109FB000E8B10022002320462946F6F7FDFC0028E0
+:109FC00046D00123002204938F4BCDF830A0059397
+:109FD0008E4BCDE90689CDE90A23029BCDE90845E0
+:109FE000022B31D004A802F0D7FB38BB58E04FF069
+:109FF000000A4FF0000B52465B4640464946F6F7D2
+:10A00000DBFC002851D052465B4620462946F6F735
+:10A01000D3FC064608B3012304937B4BCDE90689A4
+:10A020000593039BCDE908450C93029BCDE90AAB50
+:10A03000002BD7D00022754BCDE90A230C9B1BB116
+:10A0400002F0B6FC0C9B0360DDE90A34CDE9003474
+:10A05000DDE900010FB0BDE8F08F2046294602F08F
+:10A060000FFB0028F4D052465B4620462946F6F7FF
+:10A07000ADFC0028ECD001230493634B0C960593B0
+:10A0800097F90030CDE90689CDE9084513B9CDE946
+:10A090000AABA7E700205E49022BCDE90A01A1D156
+:10A0A00002F086FC21230360C8E7DDE9000102F02D
+:10A0B000E7FA0290002877D14046494602F0E0FADC
+:10A0C000002871D02046294602F0DAFA00286BD029
+:10A0D000DDE9002319461046F6F7A0FC97F9007059
+:10A0E000494BA0B10122CDE90423029BCDE90689A9
+:10A0F0000C93CDE90845002FC9D052465B46504627
+:10A100005946F6F71BFB022FCDE90A01C7E70322E8
+:10A110000C90CDE904232046294600223D4BCDE991
+:10A120000845CDE90689F6F7DFF904460D4617BB69
+:10A130004FF06042384B4046CDE90A23494652462B
+:10A140005B46F6F743FC002854D02046294602F02F
+:10A150002BFB22462B46F6F72FFC20B94FF060422E
+:10A160002E4BCDE90A2396F90030022B42D102F0A2
+:10A170001FFC222397E70022294B4046CDE90A2302
+:10A18000494652465B46F6F721FC0028EBD02046B4
+:10A19000294602F009FB22462B46F6F70DFC002863
+:10A1A000E1D100221A4BDCE70022DDE900010023A7
+:10A1B000F6F702FC00283FF44BAF4046494602F058
+:10A1C0005FFA00283FF444AF2046294602F058FACF
+:10A1D00000283FF43DAF042304930B4BCDE9084521
+:10A1E0000593002300240C930023CDE90689CDE9D3
+:10A1F0000A34B8E704A802F0CFFA00287FF41EAFB3
+:10A20000B5E700BFC400002091E500080000F03F62
+:10A210000000F0FF0000E03FFFFFEF47FFFFEFC748
+:10A220000000F07F2DE9F04F8BB004460D4601F0A1
+:10A23000FBFA244B804693F900A08946BAF1FF3F10
+:10A240002BD022462B4620462946F6F7E7FB8346CD
+:10A2500018BB0026002732463B4620462946F6F723
+:10A26000B5FBD0B101230093174BCDF820B001937B
+:10A27000CDE90445CDE90245BAF1000F12D1CDE98F
+:10A280000667684602F088FAB8B1089B1BB102F075
+:10A290008FFB089B0360DDE90689404649460BB009
+:10A2A000BDE8F08F32463B4630463946F6F746FA6F
+:10A2B000BAF1020FCDE90601E3D102F079FB2123C7
+:10A2C0000360E2E7C400002095E5000800000000FC
+:10A2D0002DE9F04FC44B21F0004787B09F42044660
+:10A2E0000D4603912ADD034607F1404707F5801725
+:10A2F0003B4314D1A2A3D3E90023F6F7F5F8A2A3B8
+:10A30000D3E9002306460F4620462946F6F7ECF827
+:10A3100002460B4630463946F5F730FF07E0024665
+:10A320000B46F5F729FF02460B46F6F707FA0446F7
+:10A330000D462046294607B0BDE8F08FAB4B9F4243
+:10A340000EDCB7F1795F80F2AB8091A3D3E90023F3
+:10A35000F5F714FF0022A64BF6F756FB0028E8D1CC
+:10A3600020462946FFF7CCFC02460B460020A049B8
+:10A37000F5F702FF00229F4BF6F7B6F886A3D3E964
+:10A38000002304460D46F6F7AFF885A3D3E9002372
+:10A39000F5F7F4FE22462B46F6F7A6F882A3D3E99A
+:10A3A0000023F5F7E9FE22462B46F6F79DF880A339
+:10A3B000D3E90023F5F7E2FE22462B46F6F794F8A0
+:10A3C0007DA3D3E90023F5F7D7FE22462B46F6F707
+:10A3D0008BF87BA3D3E90023F5F7D0FE22462B466A
+:10A3E000F6F782F878A3D3E9002380468946204611
+:10A3F0002946F6F779F876A3D3E90023F5F7BCFEF2
+:10A4000022462B46F6F770F873A3D3E90023F5F73D
+:10A41000B5FE22462B46F6F767F871A3D3E9002371
+:10A42000F5F7AAFE22462B46F6F75EF8704B00229F
+:10A43000F5F7A4FECDE900012046294601F0F4F924
+:10A440006D4B82469F428B4640F3D880DDE9002366
+:10A4500040464946F6F772F952465B46F6F744F82D
+:10A4600052465B46F5F78AFE02460B46F5F786FE36
+:10A4700045A3D3E90023F5F77FFE02460B4640A132
+:10A48000D1E90001F5F778FE039B0446002BDCBF01
+:10A49000024601F100430D46DCBF14461D4648E765
+:10A4A00002460B46F6F720F83BA3D3E90023064605
+:10A4B0000F46F6F719F83AA3D3E90023F5F75EFE45
+:10A4C00032463B46F6F710F837A3D3E90023F5F7F9
+:10A4D00053FE32463B46F6F707F835A3D3E900238F
+:10A4E000F5F74CFE32463B46F5F7FEFF32A3D3E9C3
+:10A4F0000023F5F741FE32463B46F5F7F5FF30A362
+:10A50000D3E90023F5F73AFE32463B46F5F7ECFF78
+:10A510002DA3D3E900238046894630463946F5F716
+:10A52000E3FF2BA3D3E90023F5F726FE32463B4693
+:10A53000F5F7DAFF28A3D3E90023F5F71FFE32462B
+:10A540003B46F5F7D1FF26A3D3E90023F5F714FE28
+:10A5500032463B46F5F7C8FF0022254BF5F70EFEC5
+:10A5600002460B4640464946F6F7E8F822462B4697
+:10A57000F5F7BAFF02460B4620462946CCE600BF57
+:10A58000182D4454FB21F93F075C143326A6913C57
+:10A590009C7500883CE4377E09F7FD0DE13D023FE4
+:10A5A00088B20175E0EF493F3B8F68B52882A43F30
+:10A5B0005544880E55C1C93F7D6FEB0312D6D43F79
+:10A5C000555555555555C53F82922EB1C5B8B33F27
+:10A5D00059018D1B6C06E63FC88A599CE52A00404C
+:10A5E0004B2D8A1C273A0340FFFFEF3FFFFFDF3F61
+:10A5F0000000F03F0000E03F3233EF3F02460B46E1
+:10A600000F46F5F7BBFDDDE90023CDE90401404627
+:10A610004946F6F793F802460B46DDE90401F5F7E3
+:10A6200063FF00268046894632465B4630465946DF
+:10A63000F5F75AFF02460B4620462946F5F79CFDE2
+:10A64000324604460D465B4650465946F5F796FDA0
+:10A6500002460B4620462946F6F770F802460B469E
+:10A66000F5F78CFD02460B4613A1D1E90001F5F781
+:10A6700083FD02460B4640464946F5F77DFD3246CE
+:10A6800004460D465B4630463946F5F777FD0246EF
+:10A690000B460BA1D1E90001F5F76EFD02460B4612
+:10A6A00020462946F5F768FD02460B4604A1D1E98C
+:10A6B0000001E7E6AFF30080075C143326A6913C67
+:10A6C000182D4454FB21E93F2DE9F04FB1F5801FCF
+:10A6D00087B002460B460D4624DA21F000440443BD
+:10A6E00008D1002200230020CB49F6F727F807B055
+:10A6F000BDE8F08F002904DAF5F73EFD00220023C3
+:10A70000F3E70022C54BF5F7EFFE6FF03506024682
+:10A710000B460D46C2498D4206DD10461946F5F737
+:10A720002DFDE4E70026F5E72C15C5F3130505F527
+:10A730001521A4F2FF3401F66471264401F480145B
+:10A7400084F07F5181F4401141EA05031046194617
+:10A750000022B44BF5F710FDAB1CC3F31303022B1F
+:10A7600006EB145482468B464FF0000253DC002364
+:10A77000F6F722F9D0B1002C00F020812046F5F741
+:10A7800049FE91A3D3E9002306460F46F5F7ACFE38
+:10A790008FA3D3E9002304460D4630463946F5F72A
+:10A7A000A3FE02460B4620462946B8E78AA3D3E912
+:10A7B000002350465946F5F797FE02460B46002007
+:10A7C0009949F5F7D9FC524606460F465B46504676
+:10A7D0005946F5F789FE02460B4630463946F5F7ED
+:10A7E00083FE06460F4614B932463B46A0E020469B
+:10A7F000F5F710FE74A3D3E9002380468946F5F7E8
+:10A8000073FE73A3D3E9002304460D464046494630
+:10A81000F5F76AFEA5E04FF08043F5F7AFFC02467E
+:10A820000B4650465946F5F789FFCDE90001204611
+:10A83000F5F7F0FDDDE90023CDE9020110461946E8
+:10A84000F5F752FE02460B46CDE90401F5F74CFE42
+:10A8500063A3D3E9002380468946F5F745FE62A34A
+:10A86000D3E90023F5F78AFC42464B46F5F73CFE58
+:10A870005FA3D3E90023F5F781FC42464B46F5F789
+:10A8800033FE5DA3D3E90023F5F778FCDDE904236B
+:10A89000F5F72AFE5AA3D3E90023CDE90401404687
+:10A8A0004946F5F721FE58A3D3E90023F5F766FCE6
+:10A8B00042464B46F5F718FE55A3D3E90023F5F7BA
+:10A8C0005DFC42464B46F5F70FFE02460B46DDE9BE
+:10A8D0000401F5F753FCA5F5C226C5F5D725A6F268
+:10A8E0007A4651353543002D8046894648DD0022A1
+:10A8F0004D4B50465946F5F7F7FD52465B46F5F786
+:10A90000F3FD02460B4606460F4640464946F5F71C
+:10A9100035FCDDE90023F5F7E7FD8046894664B99B
+:10A9200002460B4630463946F5F726FC02460B46F2
+:10A9300050465946F5F720FCD9E623A3D3E9002376
+:10A94000DDE90201F5F7D0FD21A3D3E90023044698
+:10A950000D46DDE90201F5F7C7FD42464B46F5F726
+:10A960000DFC02460B4630463946F5F705FC5246CB
+:10A970005B46F5F701FC02460B4620462946D9E71F
+:10A9800002460B4650465946F5F7F6FBDDE9002333
+:10A99000F5F7AAFD06460F46002C3FF425AF0AA3A3
+:10A9A000D3E90023DDE90201F5F79EFD08A3D3E911
+:10A9B000002304460D46DDE9020129E700200021BD
+:10A9C00095E600BFAFF300800000E0FE422EE63FB8
+:10A9D000763C7935EF39EA3D555555555555D53FB6
+:10A9E00044523EDF12F1C23FDE03CB966446C73FBE
+:10A9F000599322942449D23F935555555555E53FD7
+:10AA00009FC678D0099AC33FAF788E1DC571CC3FE1
+:10AA100004FA97999999D93F000050C30000504318
+:10AA2000FFFFEF7F0000F03F0000E03F000000006C
+:10AA30002DE9F04F91B0CDE90223DDE9022626F0A1
+:10AA4000004555EA02030746884600F0B784804B6C
+:10AA500021F000449C428946824609DC03D138B982
+:10AA6000A5420DDC01E09D4202DC9D420ED16AB19F
+:10AA700004F1404404F5801454EA0A0300F09E8473
+:10AA8000744811B0BDE8F04F01F088BEB9F1000F75
+:10AA900053DA714B9D424EDCA3F154739D424CDD61
+:10AAA0002B15A3F2FF33142B28DDC3F1340322FA54
+:10AAB00003F101FA03F393423FD101F00101C1F127
+:10AAC00002030093002A5CD1614B9D4226D104F120
+:10AAD000404303F5801353EA0A0300F06F845F4B91
+:10AAE0009C422CDD002E80F26F844FF0000B4FF063
+:10AAF000000C5846614611B0BDE8F08F002A3ED1E7
+:10AB0000C3F1140345FA03F101FA03F3AB4240F039
+:10AB1000638401F00101C1F102030093504B9D4297
+:10AB200014D1002E80F254843A46434600204C490A
+:10AB3000F5F704FE13E00223C3E70023C1E7002E6C
+:10AB4000D3DADDE902B303F1004CD2E7B6F1804F6E
+:10AB500008D13A46434638464146F5F7C5FC834698
+:10AB60008C46C6E73F4B9E420BD1B9F1000F08DB84
+:10AB70003846414611B0BDE8F04F00F055BE002305
+:10AB8000009338464146FFF7BBF883468C46BAF13E
+:10AB9000000F2BD124B1324B29F040429A4225D1EB
+:10ABA000002E07DA5A46634600202D49F5F7C6FD08
+:10ABB00083468C46B9F1000F9BDA04F14044009BB8
+:10ABC00004F58014234308D15A466346584661462B
+:10ABD000F5F7D2FA02460B46AAE7009B012B88D173
+:10ABE00058460CF1004383469C4682E74FEAD979E8
+:10ABF00009F1FF330D930D9A009B134304D13A469C
+:10AC0000434638464146E3E7174B9D4240F3FE80FA
+:10AC100003F104739D420BDD104B9C420EDC002EB1
+:10AC2000BFF663AF08A3D3E900231046194694E7A3
+:10AC30000E4B9C42F3DD0A4B9C4219DD002EF1DCE9
+:10AC400053E700BFAFF300809C7500883CE4377E7B
+:10AC50000000F07F90E50008FFFF3F43FFFFEF3F5C
+:10AC60000000F03F0000E03F0000E041FEFFEF3F4A
+:10AC700061460022604B5846F5F77EFA54A3D3E9AB
+:10AC8000002304460D46F5F72FFC53A3D3E9002318
+:10AC900006460F4620462946F5F726FC0022824646
+:10ACA0008B46564B20462946F5F71EFC02460B46BE
+:10ACB0004BA1D1E90001F5F75FFA22462B46F5F7E3
+:10ACC00013FC02460B4600204D49F5F755FA224683
+:10ACD0002B468046894620462946F5F705FC024664
+:10ACE0000B4640464946F5F7FFFB3FA3D3E9002357
+:10ACF000F5F7FAFB02460B4650465946F5F73CFA83
+:10AD000002460B4604460D4630463946F5F736FAFC
+:10AD100000208B46824632463B46F5F72DFA024626
+:10AD20000B4620462946F5F727FA009B0D9A013B72
+:10AD300013434FF000030CBF324C2F4C0646CDE9B5
+:10AD40000034DDE9024500240F46DDE90201224618
+:10AD50002B46F5F711FA52465B46F5F7C5FBDDE9E0
+:10AD600002238046894630463946F5F7BDFB024648
+:10AD70000B4640464946F5F701FA22462B468046E7
+:10AD8000894650465946F5F7AFFB04460D460B463B
+:10AD9000024649464046CDE90245F5F7EFF91A4B20
+:10ADA000824699420F460E4640F3E18201F13F434D
+:10ADB00003F5E003034300F0DB810DA3D3E9002397
+:10ADC000DDE90001F5F790FB09A3D3E90023C4E610
+:10ADD000000000604715F73F44DF5DF80BAE543EBE
+:10ADE000555555555555D53FFE822B654715F73FAF
+:10ADF0009C7500883CE4377E0000F03F0000D03FA7
+:10AE00000000E03F0000F0BFFFFF8F40B4F5801F5F
+:10AE10004FF0000208DA5846CD4B6146F5F764FB67
+:10AE20006FF0340283460C462315A3F2FF3313441C
+:10AE30000C93C84BC4F3130444F07F559C4245F473
+:10AE4000401508DDC44B9C4240F35B810C9BA5F58B
+:10AE5000801501330C934FF0000858462946BF4B2C
+:10AE60004FEAC8094B44D3E90034CDE908341A4607
+:10AE70002346CDE90A01F5F77FF9DDE90A23064605
+:10AE80000F46DDE90801F5F779F902460B46002087
+:10AE9000B349F5F753FCCDE90E0102460B463046A7
+:10AEA0003946F5F721FBCDE90601DDE90634CDE9A8
+:10AEB0000434002300226D1045F00055049305F57D
+:10AEC0000025DDE904AB05EB88435046594614469E
+:10AED0001D46F5F709FB02460B4630463946F5F7A5
+:10AEE0004BF9DDE9082306460F4620462946F5F7CB
+:10AEF00043F902460B46DDE90A01F5F73DF95246F2
+:10AF00005B46F5F7F1FA02460B4630463946F5F74F
+:10AF100033F9DDE90E23F5F7E7FADDE90623CDE99C
+:10AF2000080110461946F5F7DFFA77A3D3E90023A5
+:10AF300004460D46F5F7D8FA75A3D3E90023F5F7D3
+:10AF40001DF922462B46F5F7CFFA73A3D3E9002368
+:10AF5000F5F714F922462B46F5F7C6FA70A3D3E9A4
+:10AF60000023F5F70BF922462B46F5F7BDFA6EA341
+:10AF7000D3E90023F5F702F922462B46F5F7B4FA98
+:10AF80006BA3D3E90023F5F7F9F8224606460F46EE
+:10AF90002B4620462946F5F7A7FA02460B463046CF
+:10AFA0003946F5F7A1FA04460D46DDE90601524699
+:10AFB0005B46F5F7E3F8DDE90823F5F795FA224655
+:10AFC0002B46F5F7DBF8524606460F465B465046E1
+:10AFD0005946F5F789FA0022624BCDE90A01F5F7E7
+:10AFE000CDF832463B46F5F7C9F804980D460446BD
+:10AFF00002460B4650465946F5F776FA002282463D
+:10B000008B46584B20462946F5F7B6F8DDE90A236A
+:10B01000F5F7B2F802460B4630463946F5F7ACF87C
+:10B02000DDE90623F5F760FA224606460F46DDE91C
+:10B0300008012B46F5F758FA02460B4630463946CA
+:10B04000F5F79CF806460F4602460B465046594611
+:10B05000F5F794F838A3D3E9002304980D46044685
+:10B06000F5F742FA5246CDE906015B4620462946ED
+:10B07000F5F782F802460B4630463946F5F77CF87C
+:10B080002FA3D3E90023F5F72FFA2FA3D3E9002349
+:10B0900006460F4620462946F5F726FA02460B4695
+:10B0A00030463946F5F76AF82F4B4B44D3E9002375
+:10B0B000F5F764F804460C980D46F5F7ABF906462B
+:10B0C0000F462A4B22464B44D3E900892B46DDE943
+:10B0D0000601F5F753F842464B46F5F74FF832466E
+:10B0E0003B46F5F74BF8049832463B4682468B4682
+:10B0F000F5F742F842464B46F5F73EF8DDE9062300
+:10B100000BE64FF00108A8E6EF4E454A287ECA3FFD
+:10B1100065DBC9934A86CD3F01411DA96074D13FCB
+:10B120004D268F515555D53FFFAB6FDBB66DDB3FDD
+:10B13000033333333333E33F000000E009C7EE3F0E
+:10B14000FD033ADC09C7EE3FF5015B14E02F3EBE7C
+:10B15000000040438E98030079B60B00A0E500087C
+:10B160000000F03F00000840C0E50008B0E500081E
+:10B170009BA3D3E9002340464946F4F7FFFF22464C
+:10B18000CDE904012B4650463946F4F7F5FF024657
+:10B190000B46DDE90401F5F737FC00287FF40DAE1E
+:10B1A000A34A26F00043934240F303814FF4801AF0
+:10B1B00000201B15A3F2FE334AFA03F33344C3F312
+:10B1C0000A529C4FA2F2FF321741C3F3130A23EA3B
+:10B1D0000701C2F114024AF4801A4AFA02FA002E58
+:10B1E00002460B4620462946B8BFCAF1000AF4F7CA
+:10B1F000C3FFCDE90201DDE9020142464B46F4F707
+:10B20000BDFF79A3D3E9002300200D460446F5F7DE
+:10B210006BF9DDE9022306460F4620462946F4F77E
+:10B22000ABFF02460B4640464946F4F7A5FF70A324
+:10B23000D3E90023F5F758F96FA3D3E9002380463B
+:10B24000894620462946F5F74FF902460B46404607
+:10B250004946F4F793FF04460D4602460B46304636
+:10B260003946F4F78BFF32463B4680468946F4F771
+:10B2700083FF02460B4620462946F4F77DFF4246EF
+:10B2800006460F464B4640464946F5F72DF95CA366
+:10B29000D3E9002304460D46F5F726F95AA3D3E96E
+:10B2A0000023F4F769FF22462B46F5F71DF958A352
+:10B2B000D3E90023F4F762FF22462B46F5F714F991
+:10B2C00055A3D3E90023F4F757FF22462B46F5F7A1
+:10B2D0000BF953A3D3E90023F4F750FF22462B4682
+:10B2E000F5F702F902460B4640464946F4F744FF9B
+:10B2F00004460D4602460B4640464946F5F7F4F82B
+:10B300000022CDE902014FF0804320462946F4F7A0
+:10B3100033FF02460B46DDE90201F5F70FFA32462C
+:10B3200004460D463B4640464946F5F7DDF83246B1
+:10B330003B46F4F723FF02460B4620462946F4F726
+:10B340001BFF42464B46F4F717FF02460B46002010
+:10B350003949F4F711FF01EB0A54B4F5801F2BDAD9
+:10B36000524601F0ADFADDE90023FFF7F6BB334B9F
+:10B3700021F000479F427FF713AF314B0B4403434B
+:10B380000BD029A3D3E90023DDE90001F5F7ACF8E0
+:10B3900025A3D3E90023FFF7E0BB22462B46F4F7B1
+:10B3A000EBFE42464B46F5F725FB00283FF4F8AE8E
+:10B3B000E7E74FF0000A1EE72146D4E74FF0000B05
+:10B3C000DFF874C0FFF795BBDDE902BCFFF791BB66
+:10B3D00038464146FFF7C3BB0092FFF79FBB00BF53
+:10B3E000FE822B654715973C00000000432EE63F88
+:10B3F000EF39FAFE422EE63F396CA80C615C20BEA4
+:10B40000D0A4BE726937663EF16BD2C541BDBB3E6A
+:10B410002CDE25AF6A56113F93BDBE166CC1663F48
+:10B420003E5555555555C53F59F3F8C21F6EA501F8
+:10B430000000E03FFFFF0F000000F03FFFCB904017
+:10B4400000346F3F000000002DE9F04F1446C24A5F
+:10B4500021F0004A92458DB08B4607DC0022002384
+:10B46000C4E90001C4E90223002523E0BB4A924558
+:10B4700071DCABA3D3E900230029B94D36DDF4F725
+:10B480007BFEAA4506460F4618D0A7A3D3E90023A2
+:10B49000F4F772FE02460B463046C4E900233946F3
+:10B4A000F4F76AFEA0A3D3E90023F4F765FE0125B3
+:10B4B000C4E9020128460DB0BDE8F08F9CA3D3E992
+:10B4C0000023F4F759FE9CA3D3E9002306460F4658
+:10B4D000F4F752FE02460B463046C4E900233946D3
+:10B4E000F4F74AFE94A3D3E90023DEE7F4F746FE1F
+:10B4F000AA4506460F4616D08BA3D3E90023F4F7DE
+:10B500003DFE02460B463046C4E900233946F4F7B7
+:10B5100033FE85A3D3E90023F4F730FE4FF0FF3567
+:10B52000C4E90201C6E782A3D3E90023F4F726FEAB
+:10B5300081A3D3E9002306460F46F4F71FFE024617
+:10B540000B463046C4E900233946F4F715FE7AA3CA
+:10B55000D3E90023E0E7834A924500F3D280FEF767
+:10B56000CFFB77A3D3E9002306460F46F4F7BCFFD1
+:10B5700000227D4BF4F702FEF5F766FA0546F4F774
+:10B5800049FF67A3D3E90023CDE90201F4F7ACFF3B
+:10B5900002460B4630463946F4F7EEFD62A3D3E986
+:10B5A000002306460F46DDE90201F4F79DFF1F2D3B
+:10B5B000804689460EDC6D4B6A1E53F82230534597
+:10B5C00008D042464B4630463946F4F7D5FDC4E92B
+:10B5D000000111E04B46424630463946F4F7CCFDB7
+:10B5E0004FEA2A5AC1F30A53AAEB0303102B1FDCBC
+:10B5F00002460B46C4E90023D4E9002A30465346EC
+:10B600003946F4F7B9FD42464B46F4F7B5FD02461C
+:10B610000B46BBF1000FC4E90223BFF64BAF0AF1A2
+:10B620000043C4E9013001F10041E1606D4241E7AE
+:10B630003FA3D3E90023DDE90201F4F755FF80467B
+:10B64000894602460B4630463946F4F795FDCDE96A
+:10B65000040102460B4630463946F4F78DFD42465A
+:10B660004B46F4F789FD34A3D3E9002306460F4681
+:10B67000DDE90201F4F738FF32463B46F4F77CFD82
+:10B680000B46024680468946DDE90401F4F774FD65
+:10B69000C1F30A53AAEB030ABAF1310F06DCDDE964
+:10B6A000046702460B46C4E90023A5E726A3D3E9B5
+:10B6B0000023DDE90201F4F717FF804689460246C0
+:10B6C0000B46DDE90401F4F757FD02460B4606463A
+:10B6D0000F46DDE90401F4F74FFD42464B46F4F70F
+:10B6E0004BFD1BA3D3E9002380468946DDE9020117
+:10B6F000F4F7FAFE42464B46F4F73EFD8046894693
+:10B700005FE71B4A924535DD02460B46F4F734FDF0
+:10B71000C4E90201C4E90001A6E600BFAFF300805E
+:10B7200000004054FB21F93F3163621A61B4D03DFF
+:10B730000000601A61B4D03D7370032E8A19A33BD8
+:10B7400083C8C96D305FE43F0000002E8A19A33B17
+:10B75000C14920259A837B39FB21E93F7BD90240EF
+:10B76000FB21F93FFB2139410000E03FD0E5000813
+:10B77000FFFFEF7F4FEA2A55A5F21645AAEB0551C8
+:10B780000F460646F5F760F9F4F744FE02460B460D
+:10B7900030463946CDE90623F4F7EEFC0022204B73
+:10B7A000F4F7A2FE0F460646F5F74EF9F4F732FE1F
+:10B7B00002460B4630463946CDE90823F4F7DCFC57
+:10B7C0000022174BF4F790FE4FF0030800260027E5
+:10B7D000CDE90A010DF13009324679E902013B4613
+:10B7E00008F1FF3AF5F7E8F8B8B90E4B2A4601938D
+:10B7F00002232146009306A8434600F07FF9BBF1DF
+:10B80000000F0546BFF656AE636803F10043636060
+:10B81000E36803F10043E36008E7D046DCE700BFDC
+:10B820000000704150E60008544B2DE9F0418B4375
+:10B8300006460D460A460C460FD102460B46F4F763
+:10B8400053FE02460B4630462946F4F797FC06465F
+:10B850000D4630462946BDE8F081002907460346DB
+:10B860000EDC21F0004C5CEA0707F2D041B1024641
+:10B870000B46F4F781FC02460B46F4F75FFFE6E760
+:10B88000121574D0A2F2FF32D5074FF00005C4F3B1
+:10B89000130448BFD90F44F4801444BF5B0001EB8C
+:10B8A00044045110DA0F02EB4404284616224FF4E8
+:10B8B00000165B008719A742DEBFB819E41BAD195B
+:10B8C000DF0F013A07EB44044FEA43034FEA560601
+:10B8D000F0D14FF0200C96464FF00046844206EB24
+:10B8E0000E0702DC12D19F4210D8002F07EB060E84
+:10B8F00042DABEF1000F3FDB00F10108241A404696
+:10B900009F4288BF04F1FF34DB1B32446400BCF16A
+:10B91000010C04EBD3744FEA56064FEA4303DDD122
+:10B92000234306D0541C0BBF62460132013522F07E
+:10B9300001026B105208E80703F17F5303F500136F
+:10B9400048BF42F0004203EB0155164681E7DC0A8E
+:10B9500015395B05002CFAD0E6020AD5C2F12000A9
+:10B9600023FA00F0551E934004434A1B8AE7114610
+:10B97000F0E764000132EFE78046BFE70000F07FA8
+:10B980002DE9F74F21F00046B6F1795F80460F466A
+:10B99000CDE9002304DAF5F757F8002800F0868097
+:10B9A00042463B4640463946F4F79EFD00224E4B48
+:10B9B00004460D46F4F798FD3FA3D3E900238246E1
+:10B9C0008B4620462946F4F78FFD3DA3D3E900239B
+:10B9D000F4F7D4FB22462B46F4F786FD3AA3D3E9CD
+:10B9E0000023F4F7C9FB22462B46F4F77DFD38A36C
+:10B9F000D3E90023F4F7C2FB22462B46F4F774FD8B
+:10BA000035A3D3E90023F4F7B7FB22462B46F4F71E
+:10BA10006BFD33A3D3E90023F4F7B0FB22462B469A
+:10BA2000F4F762FD22462B46F4F75EFDDDE90023C4
+:10BA300004460D4640463946F4F756FD0B4602468D
+:10BA400029462046F4F798FB284B80469E428946BB
+:10BA50000EDC02460B4650465946F4F78DFB024673
+:10BA600000200B462249F4F787FB03B0BDE8F08FB6
+:10BA70000024204B22469E42CCBF1F4DA6F5001548
+:10BA80002B4600201A49F4F777FB224606460F465C
+:10BA90002B4650465946F4F76FFB42464B46F4F7A7
+:10BAA0006BFB02460B4630463946DCE70020104966
+:10BAB000DBE700BFAFF30080D43888BEE9FAA8BD49
+:10BAC000C4B1B4BD9EEE213EAD529C804F7E923EED
+:10BAD0009015CB19A001FA3E7751C1166CC1563FA3
+:10BAE0004C5555555555A53F0000E03F3233D33FE7
+:10BAF0000000F03F0000E93F0000D23F2DE9F04F89
+:10BB0000ADF5197D07930491BF4BA299D41E53F84C
+:10BB1000213000250293079B0890013B06931823D0
+:10BB200094FBF3F46FF0170324EAE47404FB03338B
+:10BB300003EB020A069A029BA71A03EB0208A39BD7
+:10BB4000002203EB870900231EAE454514DD0026C5
+:10BB50000DF5DC7B029B9E4239DC089B4FF0000810
+:10BB6000083B0093079B4FF000099D1920AB03EBA6
+:10BB7000C5030593002723E0EF420BD459F82500B5
+:10BB8000CDE90023F4F746FCDDE90023E6E90201F4
+:10BB90000135DAE710461946F8E70599009D71E985
+:10BBA00002230591F5E902010095F4F79DFC024698
+:10BBB0000B4640464946F4F7E1FA8046894601378C
+:10BBC000069B9F42E9DDEBE902890136C2E7029B51
+:10BBD0000CAA02EB83030B93A39B029F03EB84034A
+:10BBE0000A93002698AB07F1005B03EBC7030BF148
+:10BBF000FF3B53E928894FEACB0B98AB5B44A3F199
+:10BC00009804BB1B002B71DC52464046494600F0AD
+:10BC100057FE00224FF07F5304460D46F4F764FCB4
+:10BC200000F036FD0022794BF4F75EFC02460B462D
+:10BC300020462946F4F7A0FA0D460446F4F704FF1F
+:10BC40000590F4F7E7FB02460B4620462946F4F739
+:10BC500093FABAF1000F804689466CDD7A1E0CAB70
+:10BC600053F82200CAF11801059C40FA01F31C4464
+:10BC70008B40C01A0CAB43F82200CAF1170305949D
+:10BC800040FA03F30093009B002B62DD00226FF06B
+:10BC90007F411446059B01330593974200F39F8033
+:10BCA000BAF1000F07DDBAF1010F00F0BB80BAF165
+:10BCB000020F00F0C180009B022B4AD142464B4646
+:10BCC00000205349F4F758FA80468946002C40D0AA
+:10BCD000524600204E4900F0F3FD02460B46404616
+:10BCE0004946F4F749FA8046894632E00022494B3A
+:10BCF00040464946F4F7F8FBF4F7A6FEF4F78AFB52
+:10BD00000022454BCDE90001F4F7EEFB02460B465D
+:10BD100040464946F4F730FAF4F796FE0CAB43F888
+:10BD2000260074E90223DDE90001F4F727FA013661
+:10BD30008046894665E705D17B1E0CAA52F8230090
+:10BD4000C3159FE70022354BF4F754FE002843D17A
+:10BD500000900022002340464946F4F72DFE0028BB
+:10BD600000F0C3807C1E2346002202998B426ADACF
+:10BD7000002A00F084800CAB53F82430AAF1180A92
+:10BD8000002B00F0B08052460020214900F098FDC1
+:10BD9000254606460F464FF0000AE30098AA02EB3C
+:10BDA0000308DFF870B00693A8F19808002D80F220
+:10BDB000D2800025069A98AB9E18A83E631B002BE4
+:10BDC000C0F2F980DFF85890A6EBC5084FF0000AE2
+:10BDD0004FF0000B0027E2E00223009356E70CAB84
+:10BDE00053F822304CB92BB1C3F180730CA840F842
+:10BDF0002230012301321C464FE7CB1A0CA840F831
+:10BE000022302346F6E700BF98E7000800002040F4
+:10BE10000000F03F0000703E000070410000E03F75
+:10BE200050E700087A1E0CAB53F82230C3F3160318
+:10BE30000CA941F822303EE77A1E0CAB53F82230B1
+:10BE4000C3F31503F4E70CA951F82310013B0A438F
+:10BE50008BE7013453F8042D002AFAD098AB9B44A9
+:10BE6000079B7E1CDD1998AB03EBC505ABF1980B66
+:10BE7000A5F5F4753C44B44204DA2746B1E60B9BC1
+:10BE80000124E7E705F1080309930A9B002753F80B
+:10BE90002600F4F7BFFA4FF000084FF00009089BA6
+:10BEA000C5E90201083B009305F110030593069BC9
+:10BEB0009F4204DDEBE902890136099DDBE7059924
+:10BEC000009D71E902230591F5E902010095F4F75F
+:10BED0000BFB02460B4640464946F4F74FF9013743
+:10BEE00080468946E3E7013C45E7CAF10002404647
+:10BEF000494600F0E5FC0022A34B04460D46F4F74A
+:10BF000079FDF8B10022A14B20462946F4F7ECFA5E
+:10BF1000F4F79AFD0646F4F77DFA00229A4BF4F7FF
+:10BF2000E3FA0B46024629462046F4F725F9F4F7D2
+:10BF30008BFD7C1C0CAB43F827000AF1180A43F870
+:10BF4000246020E720462946F4F77EFD0CAB43F839
+:10BF500027003C4617E70CAB53F82500F4F75AFAD4
+:10BF600032463B46F4F7C0FA524668E902015B46A6
+:10BF700030463946F4F7B8FA013D06460F4615E754
+:10BF8000F8E90223F9E90201F4F7AEFA02460B469A
+:10BF900050465946F4F7F2F882468B460137029B29
+:10BFA0009F4201DCBD42EBDA48AB03EBC503C3E9BA
+:10BFB00000AB013502E7A29B032B6CD8DFE803F04E
+:10BFC000592F2F02069A48AB9D18AA46A346BBF1EB
+:10BFD000000F00F38780A246BAF1010F00F39F80A3
+:10BFE00000273E46069D48AB08351D44012C00F352
+:10BFF000B380009B489D49984A9C4B99002B40F088
+:10C00000B58003462A460498C0E9002322460B4621
+:10C01000C0E902233A463346C0E904233BE04FF02F
+:10C02000000C26466746069D48AB08351D44002E89
+:10C0300042DA009B002B49D007F1004162460B46D3
+:10C0400004990126C1E9002348A93B46D1E9000132
+:10C05000F4F792F884460F4648ADB44238DA009BB4
+:10C060000BB107F1004762463B460499C1E9022340
+:10C0700011E000273D46069B98AA1344A3F59C7641
+:10C08000002C0FDA009B0BB105F100453A462B4618
+:10C090000499C1E90023059B03F007000DF5197D04
+:10C0A000BDE8F08F384676E902232946F4F766F8B2
+:10C0B000013C07460D46E3E7604675E90223394631
+:10C0C000F4F75CF8013E84460F46B0E73946B5E721
+:10C0D0006046F5E902233946F4F750F80136844604
+:10C0E0000F46BAE77AE90289DAE90223404649466F
+:10C0F000CDE90223F4F742F802460B4606460F4606
+:10C1000040464946F4F738F8DDE90223F4F736F8FB
+:10C110000BF1FF3BCAE90201CAE9006757E775E97D
+:10C120000267D5E9022330463946CDE90223F4F708
+:10C1300025F802460B468046894630463946F4F7D4
+:10C140001BF8DDE90223F4F719F80AF1FF3AC5E913
+:10C150000201C5E900893FE7384675E90223314607
+:10C16000F4F70CF8013C07460E463FE7049B00F14C
+:10C17000004001F1004106F100461D60C3E90104E1
+:10C18000C3E903175E6186E7000070410000703E5E
+:10C190002DE9F04786B0CDE9002321F00043B3F14B
+:10C1A000795F82460C460E9D03DAF4F74DFC0028B9
+:10C1B00050D05246234650462146F4F795F906469C
+:10C1C0000F4602460B4650462146F4F78DF93EA332
+:10C1D000D3E900238046894630463946F4F784F98E
+:10C1E0003BA3D3E90023F3F7C7FF32463B46F4F7FE
+:10C1F0007BF939A3D3E90023F3F7C0FF32463B466E
+:10C20000F4F772F936A3D3E90023F3F7B5FF32460A
+:10C210003B46F4F769F934A3D3E90023F3F7AEFF03
+:10C22000CDE90201DDB902460B4630463946F4F746
+:10C230005BF92FA3D3E90023F3F79EFF42464B4659
+:10C24000F4F752F902460B4650462146F3F796FFA3
+:10C2500082460C465046214606B0BDE8F0870022D3
+:10C26000DDE90001244BF4F73FF9DDE90223CDE9D4
+:10C27000040140464946F4F737F902460B46DDE92A
+:10C280000401F3F779FF32463B46F4F72DF9DDE977
+:10C290000023F3F771FF16A3D3E9002306460F46E8
+:10C2A00040464946F4F720F902460B4630463946E7
+:10C2B000F3F764FF02460B4650462146F3F75CFF56
+:10C2C000C6E700BFAFF300807CD5CF5A3AD9E53D31
+:10C2D000EB9C2B8AE6E55A3E7DFEB157E31DC73E37
+:10C2E000D561C119A0012A3FA6F810111111813F93
+:10C2F000495555555555C53F0000E03F0000000029
+:10C300002DE9F04F1F46DA4B21F0004689B09E42DE
+:10C3100082468B469046DDF84890059121DCF4F783
+:10C3200093FB002840D1524609F1010313433343E4
+:10C3300010D150465946FDF7E3FC024600200B465B
+:10C34000CC49F4F7FBF982468B465046594609B072
+:10C35000BDE8F08FB9F1010FF7D05B460020C64968
+:10C36000EFE7C64B9E421FDD002904DA0BF10043C4
+:10C370009B4607F1004752469FA1D1E900015B4669
+:10C38000F3F7FAFE04460D469DA1D1E900014246AD
+:10C390003B46F3F7F1FE22462B46F3F7EFFE4FF054
+:10C3A000000882468B46474652465B4650465946F1
+:10C3B000F4F79AF802460B46CDE90001F4F794F839
+:10C3C000DDE9002304460D4650465946F4F78CF843
+:10C3D0008DA3D3E90023CDE9020120462946F4F7D5
+:10C3E00083F88BA3D3E90023F3F7C8FE22462B463C
+:10C3F000F4F77AF888A3D3E90023F3F7BFFE2246C7
+:10C400002B46F4F771F886A3D3E90023F3F7B6FEC1
+:10C4100022462B46F4F768F883A3D3E90023F3F709
+:10C42000ADFE22462B46F4F75FF881A3D3E9002343
+:10C43000F3F7A4FEDDE90023F4F756F87EA3D3E971
+:10C440000023CDE9060120462946F4F74DF87CA3E8
+:10C45000D3E90023F3F792FE22462B46F4F744F883
+:10C4600079A3D3E90023F3F789FE22462B46F4F79C
+:10C470003BF877A3D3E90023F3F780FE22462B464F
+:10C48000F4F732F874A3D3E90023F3F777FE2246DA
+:10C490002B46F4F729F872A3D3E90023F3F76EFED5
+:10C4A00002460B46DDE90601F3F768FEDDE90223EB
+:10C4B000F4F71AF842463B46F3F760FEDDE9002345
+:10C4C000F4F712F842463B46F3F758FE66A3D3E969
+:10C4D000002304460D46DDE90201F4F705F8224683
+:10C4E0002B46F3F74BFECDE900010B4602465946B9
+:10C4F0005046F3F743FE614B04469E420D463DDD38
+:10C500004846F3F787FF2246804689462B46204659
+:10C510002946F3F7E9FF424606460F464B462046BA
+:10C520002946F3F72BFE02460B4630463946F4F710
+:10C5300005F9DDE90023F3F71FFE02460B465046DE
+:10C540005946F3F719FE02460B46F3F717FE02466B
+:10C550000B4640464946F3F70FFE059B04469817E5
+:10C5600000F00200C0F101000D46F3F753FF024650
+:10C570000B4620462946F3F7B7FFE4E6B9F1010F71
+:10C5800036D00F4602460B4600203B49F4F7D6F85A
+:10C590000026CDE90201DDE9024552465B46304600
+:10C5A0003946F3F7E9FD02460B46DDE90001F3F7F2
+:10C5B000E3FD32462B46F3F797FF324682468B4621
+:10C5C0002B4630463946F3F78FFF0022294BF3F70D
+:10C5D000D5FD02460B4650465946F3F7CFFDDDE93F
+:10C5E0000223F3F781FF32462B46F3F7C7FDAAE695
+:10C5F00082468B46A9E600BF182D4454FB21E93F33
+:10C60000075C143326A6813CD47ABF74702AFB3EA3
+:10C61000E9A7F0320FB8123F68108D1AF726303FA5
+:10C620001583E0FEC8DB573F93846EE9E326823F23
+:10C63000FE41B31BBAA1AB3F735360DBCB75F3BEB6
+:10C64000A69237A0887E143F0165F2F2D844433F9A
+:10C65000280356C9226D6D3F37D60684F464963F91
+:10C660007AFE10111111C13F635555555555D53FEF
+:10C67000FFFF2F3E0000F03F0000F0BF2794E53F92
+:10C6800041F0004101F58010C00F7047000000002C
+:10C690002DE9F843C1F30A58A8F2FF36132E0746D6
+:10C6A0000B460C46054635DC002E16DA36A3D3E9D8
+:10C6B0000023F3F763FD00220023F4F7A5F948B146
+:10C6C000002C5BDA002524F00043314A3B43AB42A7
+:10C6D00018BF144623462F4626E02E4A42FA06F893
+:10C6E00001EA080202431FD027A3D3E90023F3F78E
+:10C6F00045FD00220023F4F787F90028EAD0002C3A
+:10C70000BEBF4FF4801343FA06F6A41924EA0804C6
+:10C710000025DFE7332E0BDDB6F5806F04D102462E
+:10C72000F3F72CFD07460B4638461946BDE8F8835B
+:10C730004FF0FF32A8F2134822FA08F818EA000F67
+:10C74000F2D011A3D3E90023F3F718FD0022002350
+:10C75000F4F75AF90028BDD0002C02DA142E03D1C8
+:10C76000013425EA0805B5E70123C6F1340603FACA
+:10C7700006F63544BD4238BFE418F2E700252C46E2
+:10C78000A8E700BFAFF300809C7500883CE4377ECB
+:10C790000000F0BFFFFF0F0000207047002001499C
+:10C7A000704700BF0000F87FF7B5C1F30A52A2F24C
+:10C7B000FF3CBCF1130F04460D460B4606464FEAFC
+:10C7C000D1775ADCBCF1000F2BDA21F00042024392
+:10C7D00023D0C1F313020243564216434B0C360BCF
+:10C7E00034495B0406F4002646EA030501EBC70161
+:10C7F00002462B46D1E9004520462946F3F7BEFC08
+:10C80000CDE90001DDE900012B462246F3F7B4FC37
+:10C81000044621F0004343EAC7752046294603B089
+:10C82000F0BD254A42FA0CF211400143F5D05208FE
+:10C8300005EA020150EA01060CD04FF48023BCF156
+:10C84000130F0CBF4FF00046002625EA020243FA00
+:10C850000CF313431749324601EBC707D7E90045EC
+:10C8600020462946F3F78AFCCDE90001DDE9000105
+:10C8700022462B46F3F780FC08E0BCF1330F08DDBD
+:10C88000BCF5806FC9D10246F3F778FC04460D462B
+:10C89000C3E7A2F213414FF0FF32CA401042BCD0AE
+:10C8A000520810421FBF4FF0804620EA02020E419C
+:10C8B0001643CFE7A8E70008FFFF0F0000000000C5
+:10C8C000F8B51646C1F30A5204460D460B4682B926
+:10C8D00021F00043034334D02D4B0022F3F704FE34
+:10C8E0002C4B04469E420D460DDA25A3D3E90023C6
+:10C8F0001CE040F2FF77BA4209D10246F3F73EFC52
+:10C9000004460D461DE00B46C1F30A52363A40F28A
+:10C91000FE7132448A420CDD22462B461AA1D1E92F
+:10C92000000100F03BF818A3D3E90023F3F7DCFD86
+:10C93000E6E7002A08DD23F0FF4323F4E00343EA9F
+:10C94000025520462946F8BD12F1350F0BDA4CF29C
+:10C9500050339E4222462B46E0DC09A1D1E900017A
+:10C9600000F01CF8C1E723F0FF43363223F4E00364
+:10C9700043EA0255204629460022074BD6E700BF6E
+:10C9800059F3F8C21F6EA5019C7500883CE4377E00
+:10C9900000005043B03CFFFF0000903C30B521F058
+:10C9A000004203F0004342EA0305294630BD00007F
+:10C9B000014B1868704700BF60000020F8B500BF49
+:10C9C000F8BC08BC9E467047F8B500BFF8BC08BC70
+:04C9D0009E467047C8
+:10C9D800312E3000310000004D454E55000000005A
+:10C9E8004465766963657300526164617200000092
+:10C9F800506F696E7473000053657474696E677361
+:10CA080000000000496E666F000000003E00000054
+:10CA18002E2E2E0023000000286D6529000000003E
+:10CA28002E0000003A000000474D54004C415400CD
+:10CA3800284E2900285329004C4F4E00284529002C
+:10CA480028572900414C54006D0000004649580001
+:10CA5800412F0000562F00003244000033440000EC
+:10CA68004E4F0000434F4700444F5000534F47007C
+:10CA78006B706800534154002F000000544F43006E
+:10CA880042415400444C54006B000000425247009D
+:10CA9800445354004D00000033442F0032442F000B
+:10CAA800484900004C4F0000342F3400332F340025
+:10CAB800322F3400312F3400302F3400464E4300DB
+:10CAC800414C520044455649434500005361766540
+:10CAD8000000000044656C657465000044656C6581
+:10CAE8007465206465766963650000003F00000096
+:10CAF80043616E27742064656C20796F7572736565
+:10CB08006C6600004F4B202D2064656C65746500D1
+:10CB1800455343202D2063616E63656C000000005F
+:10CB2800576865726520746F207361766500000030
+:10CB38006E6F20656D70747920736C6F747300006C
+:10CB480053657420706F696E74206E616D650000A6
+:10CB58004E616D65000000005E0000004C6F6E675E
+:10CB6800204F4B202D207361766500005361766558
+:10CB780064210000504F494E54530000656D707495
+:10CB880079000000504F494E542000004C6F6164FA
+:10CB980000000000576865726520746F206C6F6133
+:10CBA8006420000044657669636520006E6F206527
+:10CBB8006D707479206465766963657300000000A0
+:10CBC80044656C65746520706F696E7420000000A0
+:10CBD80053455454494E4753000000004564697456
+:10CBE80000000000526573746F72650045726173CE
+:10CBF800650000004C524E530000000048572F4675
+:10CC0800573A200031343A30323A353700000000C4
+:10CC180046656220313420323032310028432932CF
+:10CC280030323120466572757A20546F70616C6FAE
+:10CC380076000000454449542053455454494E4712
+:10CC480053000000446576696365206E756D626502
+:10CC5800720000004465766963652049440000005D
+:10CC680046726571206368616E6E656C0000000035
+:10CC7800545820706F77657200000000206D5700CF
+:10CC880053656E6420696E74657276616C0000008D
+:10CC98002073000054696D656F75742074687200A4
+:10CCA80046656E636520746872000000206D0000A0
+:10CCB80053455420444556204E554D005345542065
+:10CCC80044455620494400004C6F6E67204F4B2066
+:10CCD8002D206170706C790053455420465245519F
+:10CCE8002043480053455420545820504F570000C3
+:10CCF8005345542053454E4420494E54564C000049
+:10CD080053455420544F2054485200005345542052
+:10CD1800464E43205448520053657474696E6773D5
+:10CD2800206368616E676564000000004F4B202D2A
+:10CD380020736176652026207265737461727400B1
+:10CD4800455343202D2063616E63656C20636861E1
+:10CD58006E67657300000000526573746F7265201A
+:10CD680064656661756C74733F0000004F4B202D3D
+:10CD780020726573746F72652026207265736574FE
+:10CD880000000000457261736520616C6C204545A8
+:10CD980050524F4D3F0000004F4B202D20657261CF
+:10CDA80073652026207265736574000057414954E5
+:10CDB8002E2E2E00300000005331000053320000A8
+:10CDC80053330000533400005335000007020100BC
+:10CDD800018CBA80081344082120000000061100C5
+:10CDE800020046000511000103600611010200015E
+:10CDF8001808110204000A0000000D1110090008AB
+:10CE080014000F3100000000091111050001B42BB6
+:10CE180000000B11120700840108FFFF0002101127
+:10CE2800120C080000003030001104AA00000010A5
+:10CE380011120C14000000000000000000000000A7
+:10CE48001011120C2000000000000000000000007B
+:10CE5800000D1112092C0000000000000000001055
+:10CE680011200C0003000701D4C0058CBA80000112
+:10CE7800051120010CE40C1120081801800803801A
+:10CE88000020200D11200922043B0078FD003D02FE
+:10CE9800C20B1120072C0436C00A4818C0051120FF
+:10CEA8000135E20D1120093811EDED001AFFFF00E0
+:10CEB8002B0D11200942A402D683003C0180FF05F6
+:10CEC8001120014C02051120014E4005112001518D
+:10CED8000A1011210C00FFBA0F51CFA9C9FC1B1E63
+:10CEE8000F011011210C0CFCFD15FF000FA2A097DB
+:10CEF8008A79661011210C18523F2E1F140B060256
+:10CF08000000000008112204000805003D0B112351
+:10CF180007002C0E0B040C73031011300C000000DA
+:10CF2800000000000000000000000C114008004153
+:10CF38000CFC0F07E020FE003A9D52A246DF913F0D
+:10CF480002050000017000080301000039700008A4
+:10CF5800030300007D70000803050000C17000088D
+:10CF6800090100000D730008090300006973000837
+:10CF780009050000C573000806010000D970000803
+:10CF880006030000257100080605000071710008FD
+:10CF9800060900009571000807010000B571000836
+:10CFA80007030000F5710008070500003572000846
+:10CFB800070600006172000807090000B172000846
+:10CFC80008090000D172000805050000ED590008A5
+:10CFD8000A010000F97300080A030000257400081C
+:10CFE8000A050000517400080A0900008574000849
+:10CFF8000C010000A57400080C030000017500086E
+:10D008000C0500005D7500080C090000A1750008FA
+:10D018000D050000C175000811010000F175000838
+:10D02800110300001D76000811050000497600086C
+:10D03800110900007D76000812010000BD76000885
+:10D048001203000009770008120500005577000850
+:10D05800120600008177000812090000D97700083D
+:10D06800130100002D780008130300005978000808
+:10D07800130500008578000813090000BD78000832
+:10D0880014010000E5780008140300001179000875
+:10D09800140500003D79000814090000757900089E
+:10D0A800150100009D79000815030000C9790008E2
+:10D0B80015050000F5790008150900002D7A00080B
+:10D0C80016010000557A0008160300007D7A000852
+:10D0D80016050000A17A000816090000D97A000890
+:10D0E80017010000017B000817030000297B0008D6
+:10D0F800170500004D7B000817090000857B000814
+:10D1080018050000A576000818090000AD7B000886
+:10D1180019050000E97B00081A050000F97B0008E2
+:10D1280000000000000000000100020101090102E6
+:10D138000A01030E01040F0400060401050B000C8C
+:10D148000B010D0E00100E01190E021A100011101D
+:10D1580001121002131003141004151005161006FE
+:10D168001700000002010302040306040504090174
+:10D178000B0A0D0B0E010F011018190E1A0E0000E4
+:10D18800010000003543000802000000E1430008E8
+:10D1980003000000994A00080400000055580008E0
+:10D1A80006000000555A000807000000B15B00089F
+:10D1B800080000001D5C0008050000001559000863
+:10D1C80009000000415C00080A000000F965000839
+:10D1D8000B000000816700080C000000F9670008D8
+:10D1E8000D000000056900080E00000071690008C4
+:10D1F8000F000000D969000810000000716A0008DB
+:10D2080011000000196C000812000000796C000879
+:10D2180013000000FD6C0008140000005D6D00089C
+:10D2280015000000D56D0008160000004D6E0008BE
+:10D2380017000000B96E000818000000256F0008EC
+:10D2480019000000816F00081A000000C16F000873
+:10D258000000000000000000414C50484100000060
+:10D268003E5149453E3E5149453E3E5149453E3E67
+:10D278005149453E3E5149453E3E5149453E3E5144
+:10D2880049453E3E5149453E3E5149453E3E51493C
+:10D29800453E3E5149453E3E5149453E3E51494530
+:10D2A8003E3E5149453E3E5149453E3E5149453E27
+:10D2B8003E5149453E3E5149453E3E5149453E3E17
+:10D2C8005149453E3E5149453E3E5149453E3E51F4
+:10D2D80049453E3E5149453E3E5149453E3E5149EC
+:10D2E800453E3E5149453E3E5149453E3E514945E0
+:10D2F8003E3E5149453E3E5149453E3E5149453ED7
+:10D30800000000000000005F000000070007001494
+:10D318007F147F14242A7F2A124C2C106864364903
+:10D328005522500005030000001C22410000412244
+:10D338001C0014083E081408083E08080000503075
+:10D348000010101010100060600000201008040287
+:10D358003E5149453E00427F4000426151494621C5
+:10D3680041454B311814127F1027454545393C4A31
+:10D378004949300171090503364949493606494981
+:10D38800291E0036360000005636000008142241D7
+:10D39800001414141414004122140802015109063F
+:10D3A800324979413E7E1111117E7F494949363E05
+:10D3B800414141227F4141221C7F494949417F091E
+:10D3C8000909013E4149497A7F0808087F00417FE1
+:10D3D80041002040413F017F081422417F404040E6
+:10D3E800407F020C027F7F0408107F3E4141413E8E
+:10D3F8007F090909063E4151215E7F0919294646E0
+:10D408004949493101017F01013F4040403F1F2008
+:10D4180040201F3F4038403F6314081463070870DA
+:10D4280008076151494543007F4141000204081043
+:10D43800200041417F000402010204404040404076
+:10D44800000102040020545454787F48444438387A
+:10D4580044444420384444487F3854545418087E7F
+:10D468000901020C5252523E7F0804047800447DA0
+:10D4780040002040443D007F1028440000417F4088
+:10D48800007C041804787C08040478384444443840
+:10D498007C14141408081414187C7C080404084824
+:10D4A80054545420043F4440203C4040207C1C20DD
+:10D4B80040201C3C4030403C44281028440C50502C
+:10D4C800503C4464544C44000836410000007F003E
+:10D4D8000000413608000804081008FFFFFFFFFF9E
+:10D4E800000004027F007F2010002214081422711B
+:10D4F800034100407103790040710379007C637532
+:10D50800797563101E3F1E107E4343437E7E63631E
+:10D51800637E7E7373737E7E7B7B7B7E7E7F7F7F65
+:10D528007E0705070000550041005560607F020C2A
+:10D5380002200002A1C8038D14AF00000000000003
+:10D5480000000000000000000000000000000000D3
+:10D5580000000000000000000000000000000000C3
+:10D5680000000000000000000000000000000000B3
+:10D5780000000000000000000000000000000000A3
+:10D588000000000000000000000000000000000093
+:10D598000000000000000000000000000000000083
+:10D5A8000000000000000000000000000000000073
+:10D5B8000000000000000000000000000000000063
+:10D5C8000000000000000000000000000000000053
+:10D5D8000000000000000000000000000000000043
+:10D5E8000000000000000000000081FF899D81C349
+:10D5F800000081FF8180E00081FF899D81C30000D8
+:10D6080081FF91110E0081FF890889FF81000000C8
+:10D618000000000000000000000000000000000002
+:10D6280000000000000000000000000000000000F2
+:10D6380000000000000000000000000000000000E2
+:10D6480000000000000000000000000000000000D2
+:10D6580000000000000000000000000000000000C2
+:10D668000000000000000000000000000080C06012
+:10D6780020202020206030101808080808081810FA
+:10D68800306040602020202060C080000000000042
+:10D698000000000000000000000000000000000082
+:10D6A8000000000000000000000000000000000072
+:10D6B8000000000000000000000000000000000062
+:10D6C8000000000000000000000000000000000052
+:10D6D8000000000000000000000000000000000042
+:10D6E8000000000000000000000000F80F0100002A
+:10D6F80000000000000000181800000000181800C2
+:10D70800000000000000000000000103FE0000000F
+:10D718000000000000000000000000000000000001
+:10D7280000000000000000000000000000000000F1
+:10D7380000000000000000000000000000000000E1
+:10D7480000000000000000000000000000000000D1
+:10D7580000000000000000000000000000000000C1
+:10D768000000000000000000000000010F18304019
+:10D77800C080808080C0E0800000000000000000C1
+:10D788008080C0808080808080C060380F0000006A
+:10D798000000000000000000000000000000000081
+:10D7A8000000000000000000000000000000000071
+:10D7B8000000000000000000000000000000000061
+:10D7C8000000000000000000000000000000000051
+:10D7D8000000000000000000000000000000000041
+:10D7E8000000000000000000000000000000000031
+:10D7F800000000080C060303063CE00000000000DF
+:10D80800FF03060404000000000000000000000000
+:10D818000000000000000000000000000000000000
+:10D8280000000000000000000000000000000000F0
+:10D8380000000000000000000000000000000000E0
+:10D8480000000000000000000000000000000000D0
+:10D8580000000000000000000000000000000000C0
+:10D8680000000000000000000000E0B09070101000
+:10D878001010103020301018080E0380C060301CC3
+:10D888000700000000000000000000000000000089
+:10D898000000000000000000000000000000000080
+:10D8A8000000000000000000000000000000000070
+:10D8B8000000000000000000000000000000000060
+:10D8C8000000000000000000000000000000000050
+:10D8D8000000000000000000000000000000000040
+:10D8E800000000000000000000000001010101012B
+:10D8F8000101010101010101010101010000000014
+:10D90800000000000000000000000000000000000F
+:10D9180000000000000000000000000000000000FF
+:10D9280000000000000000000000000000000000EF
+:10D938000000000000000000000000007F6B416B49
+:10D94800416B7F000000007F5D5D415D5D7F415D53
+:10D958005D5D637F00000000007F51555555457F90
+:10D96800415D5D5D417F415D5D55457F0000000083
+:10D97800007F415D5D5D5D7F415D5D5D417F415D36
+:10D988005D55457F00000000007F43757575437F36
+:10D9980043757575437F415F5F5F5F7F7D7D417D27
+:10D9A8007D7F000000000000000000000000000073
+:10D9B800000000000000000000000000000000005F
+:10D9C800000000000000000000000000000000004F
+:10D9D800000000000000000000000000000000003F
+:10D9E800000000000000000000000000000000002F
+:10D9F800000000000000000000000000000000001F
+:10DA0800000000000000000000000000000000000E
+:10DA180000000000000000000000000000000000FE
+:10DA280000000000000000000000000000000000EE
+:10DA38000000000000000000000000007F6B416B48
+:10DA4800416B7F000000007F5D5D415D5D7F415D52
+:10DA58005D5D637F00000000007F415D5D5D637F69
+:10DA680051555555457F7D7D417D7D7F00000000E6
+:10DA7800007F415555556B7F416D6D6D537F415DFD
+:10DA88005D55457F00000000007F415D5D5D637F5F
+:10DA980043757575437F415F5F5F5F7F7D7D417D26
+:10DAA8007D7F000000000000000000000000000072
+:10DAB800000000000000000000000000000000005E
+:10DAC800000000000000000000000000000000004E
+:10DAD800000000000000000000000000000000003E
+:10DAE800000000000000000000000000000000002E
+:10DAF800000000000000000000000000000000001E
+:10DB0800000000000000000000000000000000000D
+:10DB180000000000000000000000000000000000FD
+:10DB280000000000000000000000000000000000ED
+:10DB380000000000000000000000000000000000DD
+:10DB480000000000000000000000000000000000CD
+:10DB580000000000000000000000000000000000BD
+:10DB680000000000000000000000000000000000AD
+:10DB7800000000000000000000000000000000009D
+:10DB8800000000000000000000000000000000008D
+:10DB9800000000000000000000000000000000007D
+:10DBA800000000000000000000000000000000006D
+:10DBB800000000000000000000000000000000005D
+:10DBC800000000000000000000000000000000004D
+:10DBD800000000000000000000000000000000003D
+:10DBE800000000000000000000000000000000002D
+:10DBF800000000000000000000000000000000001D
+:10DC0800000000000000000000000000000000000C
+:10DC180000000000000000000000000000000000FC
+:10DC280000000000000000000000000000000000EC
+:10DC380000000000000000000000000000000000DC
+:10DC480000000000000000000000000000000000CC
+:10DC580000000000000000000000000000000000BC
+:10DC680000000000000000000000000000000000AC
+:10DC7800000000000000000000000000000000009C
+:10DC8800000000000000000000000000000000008C
+:10DC9800000000000000000000000000000000007C
+:10DCA800000000000000000000000000000000006C
+:10DCB800000000000000000000000000000000005C
+:10DCC800000000000000000000000000000000004C
+:10DCD800000000000000000000000000000000003C
+:10DCE800000000000000000000000000000000002C
+:10DCF800000000000000000000000000000000001C
+:10DD0800000000000000000000000000000000000B
+:10DD180000000000000000000000000000000000FB
+:10DD280000000000000000000000000000000000EB
+:10DD380000000000000000000000000000007F411B
+:10DD48005D5D5D5D7F415D5D5D417F415D5D55452B
+:10DD58007F0000000000000000000000000000003C
+:10DD680000000000000000000000000000000000AB
+:10DD7800000000000000000000000000000000009B
+:10DD8800000000000000000000000000000000008B
+:10DD9800000000000000000000000000000000007B
+:10DDA800000000000000000000000000000000006B
+:10DDB8000000000000000000000000000000FE025B
+:10DDC800020202020202020202020202020202022B
+:10DDD800020202020202020202020202020202021B
+:10DDE80002020202020202020202FE000000000019
+:10DDF800007F6B416B416B7F00000000007F5D5D21
+:10DE0800415D5D7F415D5D5D637F00000000007FD7
+:10DE1800415D5D5D637F51555555457F7D7D417DF4
+:10DE28007D7F00000000007F415555556B7F416D97
+:10DE38006D6D537F415D5D55457F00000000FF001B
+:10DE480000000000000000000000000000000000CA
+:10DE580000000000000000000000000000000000BA
+:10DE680000000000000000000000FF0000000000AB
+:10DE7800000000000000000000000000000000009A
+:10DE8800000000000000000000000000000000008A
+:10DE9800000000000000000000000000000000007A
+:10DEA800000000000000000000000000000000006A
+:10DEB8000000000000000000000000000000FF005B
+:10DEC800000000000000000000000000000000004A
+:10DED80000000000800000000000000000000000BA
+:10DEE80000000000000000000000FF00000000002B
+:10DEF800000000000000000000000000000000001A
+:10DF08000000000000000000000000000000000009
+:10DF180000000000000000000000000000000000F9
+:10DF280000000000000000000000000000000000E9
+:10DF38000000000000000000000000000000FF00DA
+:10DF480000000000000000000000000000000000C9
+:10DF580000000000000000000000000000000000B9
+:10DF680000000000000000000000FF0000000000AA
+:10DF78000000000000000000000000000000000099
+:10DF88000000000000000000000000000000000089
+:10DF98000000000000000000000000000000000079
+:10DFA8000000000000000000000000000000000069
+:10DFB8000000000000000000000000000000FF005A
+:10DFC8000000000000000000000000000000000049
+:10DFD8000000000000000000000000000000000039
+:10DFE80000000000000000000000FF00000000002A
+:10DFF8000000000000000000000000000000000019
+:10E008000000000000000000000000000000000008
+:10E0180000000000000000000000000000000000F8
+:10E0280000000000000000000000000000000000E8
+:10E0380000000000000000000000000000003F2079
+:10E0480020202020202020202020202020202020C8
+:10E0580020202020202020202020202020202020B8
+:10E06800202020202020202020203F000000000029
+:10E078000000000000000000000000000000000098
+:10E088000000000000000000000000000000000088
+:10E098000000000000000000000000000000000078
+:10E0A8000000000000000000000000000000000068
+:10E0B80000000000000000000000000000007F4198
+:10E0C8006D6D6D537F417B776F417F415D5D554538
+:10E0D8007F000000000000000000000000000000B9
+:10E0E8000000000000000000000000000000000028
+:10E0F8000000000000000000000000000000000018
+:10E108000000000000000000000000000000000007
+:10E1180000000000000000000000000000000000F7
+:10E1280000000000000000000000000000000000E7
+:10E1380000000000000000000000000000000000D7
+:10E1480000000000000000000000000000000000C7
+:10E1580000000000000000000000000000000000B7
+:10E1680000000000000000000000000000000000A7
+:10E178000000000000000000000000000000000097
+:10E188000000000000000000000000000000000087
+:10E198000000000000000000000000E030180C043F
+:10E1A800040404040C060203010101010103020630
+:10E1B8000C080C040404040C183060C000000000B3
+:10E1C8000000000000000000000000000000000047
+:10E1D8000000000000000000000000000000000037
+:10E1E8000000000000000000000000000000000027
+:10E1F8000000000000000000000000000000000017
+:10E208000000000000000000000000000000000006
+:10E21800000000000000000000003FE100000000D6
+:10E2280000000000000003030000000003030000DA
+:10E238000000000000000000000000FF00000000D7
+:10E2480000000000000000000000000000000000C6
+:10E2580000000000000000000000000000000000B6
+:10E2680000000000000000000000000000000000A6
+:10E278000000000000000000000000000000000096
+:10E288000000000000000000000000000000000086
+:10E29800000000000000000000000001030608184C
+:10E2A80010101090D87C70C080000000000000F0B2
+:10E2B80070D8909010101010180C07010000000082
+:10E2C8000000000000000000000000000000000046
+:10E2D8000000000000000000000000000000000036
+:10E2E8000000000000000000000000000000000026
+:10E2F8000000000000000000000000000000000016
+:10E308000000000000000000000000000000000005
+:10E3180000000000000000000000000000000000F5
+:10E328000000010100000000C77C0000000080FF21
+:10E3380000000000000000000000000000000000D5
+:10E3480000000000000000000000000000000000C5
+:10E3580000000000000000000000000000000000B5
+:10E3680000000000000000000000000000000000A5
+:10E378000000000000000000000000000000000095
+:10E388000000000000000000000000000000000085
+:10E398000000000000000000001C36322E2222225D
+:10E3A8002222262426222321212030180C060300AD
+:10E3B8000000000000000000000000000000000055
+:10E3C8000000000000000000000000000000000045
+:10E3D8000000000000000000000000000000000035
+:10E3E8000000000000000000000000000000000025
+:10E3F8000000000000000000000000000000000015
+:10E408000000000000000000000000000000000004
+:10E4180000000000000000000000000000000000F4
+:10E4280000000000000000000000000000000000E4
+:10E4380000000000000000000000000000000000D4
+:10E4480000000000000000000000000000000000C4
+:10E4580000000000000000000000000000000000B4
+:10E4680000000000000000000000000000000000A4
+:10E478000000000000000000000000000000000094
+:10E488000000000000000000000000000000000084
+:10E498000000000000000000000000000000000074
+:10E4A8000000000000000000000000000000000064
+:10E4B8000000000000000000000000000000000054
+:10E4C8000000000000000000000000000000000044
+:10E4D8000000000000000000000000000000000034
+:10E4E8000000000000000000000000000000000024
+:10E4F8000000000000000000000000000000000014
+:10E508000000000000000000000000000000000003
+:10E5180000000000000000000000000000000000F3
+:10E5280000000000000000000000000000000000E3
+:10E5380000000000000000000000000000000000D3
+:10E548004FBB610567ACDD3F182D4454FB21E93F03
+:10E558009BF681D20B73EF3F182D4454FB21F93FF2
+:10E56800E2652F227F2B7A3C075C143326A6813C78
+:10E57800BDCBF07A8807703C075C143326A6913C23
+:10E588006173696E006C6F6700706F7700737172EA
+:10E598007400000000000000000000000000F03FD0
+:10E5A800000000000000F83F00000000000000002C
+:10E5B8000000004003B8E23F000000000000000037
+:10E5C80006D0CF43EBFD4C3EFB21F93FFB21094030
+:10E5D8007CD91240FB2119407A6A1F407CD922401D
+:10E5E800BBFD2540FB2129403A462C407A6A2F4042
+:10E5F8005C4731407CD932409C6B3440BBFD354090
+:10E60800DB8F3740FB2139401BB43A403A463C4047
+:10E618005AD83D407A6A3F404C7E40405C47414072
+:10E628006C1042407CD942408CA243409C6B4440D1
+:10E63800AC344540BBFD4540CBC64640DB8F474028
+:10E64800EB584840FB21494083F9A200444E6E0034
+:10E65800FC291500D1572700DD34F50062DBC00026
+:10E668003C999500419043006351FE00BBDEAB002E
+:10E67800B761C5003A6E2400D24D42004906E00059
+:10E6880009EA2E001C92D100EB1DFE0029B11C00E6
+:10E69800E83EA700F535820044BB2E009CE98400C3
+:10E6A800B4267000417E5F00D6913900538339004B
+:10E6B8009CF439008B5F840028F9BD00F81F3B00EB
+:10E6C800DEFF97000F980500112FEF000A5A8B0004
+:10E6D8006D1F6D00CF7E360009CB2700464FB7006F
+:10E6E8009E663F002DEA5F00BA277500E5EBC7007C
+:10E6F8003D7BF100F739070092528A00FB6BEA0074
+:10E708001FB15F00085D8D00300356007BFC46009A
+:10E71800F0AB6B0020BCCF0036F49A00E3A91D00D3
+:10E728005E619100081BE60085996500A0145F00F2
+:10E738008D40680080D8FF0027734D000606310021
+:10E74800CA561500C9A873007BE260006B8CC00034
+:10E7580000000040FB21F93F000000002D44743EFA
+:10E76800000000809846F83C0000006051CC783BDF
+:10E7780000000080831BF0390000004020257A3813
+:10E78800000000802282E336000000001DF3693596
+:10E798000200000003000000040000000600000062
+:10E7A800000000000000304300000000000030C3FB
+:04E7B80055010008FF
+:04E7BC00310100081F
+:10E7C00010101010100000000101010101000000F4
+:10E7D0000101010101000000D8C90008DCC90008DE
+:10E7E0000100040400010B00010E000210000600ED
+:10E7F00000000101005F0000BCCD0008C0CD000892
+:10E80000C4CD0008C8CD0008CCCD0008D0CD00088C
+:10E8100001050A1E3C0000000A192864141E287F06
+:10E820006400002000000000000000000000000064
+:10E8300000000000000000000000000000000000D8
+:10E8400000000000000000000000000000000000C8
+:10E8500000000000000000000000000000000000B8
+:10E8600000000000000000000000000000000000A8
+:10E870000000000000000000000000000000000098
+:08E8800000000000010000008F
+:04000005080098BD9A
+:00000001FF
diff --git a/Firmware/CubeIDE/Debug/Eleph.list b/Firmware/CubeIDE/Debug/Eleph.list
new file mode 100644
index 0000000..405b6cb
--- /dev/null
+++ b/Firmware/CubeIDE/Debug/Eleph.list
@@ -0,0 +1,27518 @@
+
+Eleph.elf: file format elf32-littlearm
+
+Sections:
+Idx Name Size VMA LMA File off Algn
+ 0 .isr_vector 00000130 08000000 08000000 00010000 2**0
+ CONTENTS, ALLOC, LOAD, READONLY, DATA
+ 1 .text 0000c8a4 08000130 08000130 00010130 2**3
+ CONTENTS, ALLOC, LOAD, READONLY, CODE
+ 2 .rodata 00001de0 0800c9d8 0800c9d8 0001c9d8 2**3
+ CONTENTS, ALLOC, LOAD, READONLY, DATA
+ 3 .ARM.extab 00000000 0800e7b8 0800e7b8 000200c8 2**0
+ CONTENTS
+ 4 .ARM 00000000 0800e7b8 0800e7b8 000200c8 2**0
+ CONTENTS
+ 5 .preinit_array 00000000 0800e7b8 0800e7b8 000200c8 2**0
+ CONTENTS, ALLOC, LOAD, DATA
+ 6 .init_array 00000004 0800e7b8 0800e7b8 0001e7b8 2**2
+ CONTENTS, ALLOC, LOAD, DATA
+ 7 .fini_array 00000004 0800e7bc 0800e7bc 0001e7bc 2**2
+ CONTENTS, ALLOC, LOAD, DATA
+ 8 .data 000000c8 20000000 0800e7c0 00020000 2**2
+ CONTENTS, ALLOC, LOAD, DATA
+ 9 .bss 00001070 200000c8 0800e888 000200c8 2**3
+ ALLOC
+ 10 ._user_heap_stack 00000600 20001138 0800e888 00021138 2**0
+ ALLOC
+ 11 .ARM.attributes 00000029 00000000 00000000 000200c8 2**0
+ CONTENTS, READONLY
+ 12 .debug_info 00009eaf 00000000 00000000 000200f1 2**0
+ CONTENTS, READONLY, DEBUGGING
+ 13 .debug_abbrev 00001ef7 00000000 00000000 00029fa0 2**0
+ CONTENTS, READONLY, DEBUGGING
+ 14 .debug_aranges 00000970 00000000 00000000 0002be98 2**3
+ CONTENTS, READONLY, DEBUGGING
+ 15 .debug_ranges 00000830 00000000 00000000 0002c808 2**3
+ CONTENTS, READONLY, DEBUGGING
+ 16 .debug_macro 0000a8fa 00000000 00000000 0002d038 2**0
+ CONTENTS, READONLY, DEBUGGING
+ 17 .debug_line 00007a9b 00000000 00000000 00037932 2**0
+ CONTENTS, READONLY, DEBUGGING
+ 18 .debug_str 0003a7d5 00000000 00000000 0003f3cd 2**0
+ CONTENTS, READONLY, DEBUGGING
+ 19 .comment 0000007b 00000000 00000000 00079ba2 2**0
+ CONTENTS, READONLY
+ 20 .debug_frame 0000299c 00000000 00000000 00079c20 2**2
+ CONTENTS, READONLY, DEBUGGING
+
+Disassembly of section .text:
+
+08000130 <__do_global_dtors_aux>:
+ 8000130: b510 push {r4, lr}
+ 8000132: 4c05 ldr r4, [pc, #20] ; (8000148 <__do_global_dtors_aux+0x18>)
+ 8000134: 7823 ldrb r3, [r4, #0]
+ 8000136: b933 cbnz r3, 8000146 <__do_global_dtors_aux+0x16>
+ 8000138: 4b04 ldr r3, [pc, #16] ; (800014c <__do_global_dtors_aux+0x1c>)
+ 800013a: b113 cbz r3, 8000142 <__do_global_dtors_aux+0x12>
+ 800013c: 4804 ldr r0, [pc, #16] ; (8000150 <__do_global_dtors_aux+0x20>)
+ 800013e: f3af 8000 nop.w
+ 8000142: 2301 movs r3, #1
+ 8000144: 7023 strb r3, [r4, #0]
+ 8000146: bd10 pop {r4, pc}
+ 8000148: 200000c8 .word 0x200000c8
+ 800014c: 00000000 .word 0x00000000
+ 8000150: 0800c9bc .word 0x0800c9bc
+
+08000154 :
+ 8000154: b508 push {r3, lr}
+ 8000156: 4b03 ldr r3, [pc, #12] ; (8000164 )
+ 8000158: b11b cbz r3, 8000162
+ 800015a: 4903 ldr r1, [pc, #12] ; (8000168 )
+ 800015c: 4803 ldr r0, [pc, #12] ; (800016c )
+ 800015e: f3af 8000 nop.w
+ 8000162: bd08 pop {r3, pc}
+ 8000164: 00000000 .word 0x00000000
+ 8000168: 200000cc .word 0x200000cc
+ 800016c: 0800c9bc .word 0x0800c9bc
+
+08000170 <__aeabi_drsub>:
+ 8000170: f081 4100 eor.w r1, r1, #2147483648 ; 0x80000000
+ 8000174: e002 b.n 800017c <__adddf3>
+ 8000176: bf00 nop
+
+08000178 <__aeabi_dsub>:
+ 8000178: f083 4300 eor.w r3, r3, #2147483648 ; 0x80000000
+
+0800017c <__adddf3>:
+ 800017c: b530 push {r4, r5, lr}
+ 800017e: ea4f 0441 mov.w r4, r1, lsl #1
+ 8000182: ea4f 0543 mov.w r5, r3, lsl #1
+ 8000186: ea94 0f05 teq r4, r5
+ 800018a: bf08 it eq
+ 800018c: ea90 0f02 teqeq r0, r2
+ 8000190: bf1f itttt ne
+ 8000192: ea54 0c00 orrsne.w ip, r4, r0
+ 8000196: ea55 0c02 orrsne.w ip, r5, r2
+ 800019a: ea7f 5c64 mvnsne.w ip, r4, asr #21
+ 800019e: ea7f 5c65 mvnsne.w ip, r5, asr #21
+ 80001a2: f000 80e2 beq.w 800036a <__adddf3+0x1ee>
+ 80001a6: ea4f 5454 mov.w r4, r4, lsr #21
+ 80001aa: ebd4 5555 rsbs r5, r4, r5, lsr #21
+ 80001ae: bfb8 it lt
+ 80001b0: 426d neglt r5, r5
+ 80001b2: dd0c ble.n 80001ce <__adddf3+0x52>
+ 80001b4: 442c add r4, r5
+ 80001b6: ea80 0202 eor.w r2, r0, r2
+ 80001ba: ea81 0303 eor.w r3, r1, r3
+ 80001be: ea82 0000 eor.w r0, r2, r0
+ 80001c2: ea83 0101 eor.w r1, r3, r1
+ 80001c6: ea80 0202 eor.w r2, r0, r2
+ 80001ca: ea81 0303 eor.w r3, r1, r3
+ 80001ce: 2d36 cmp r5, #54 ; 0x36
+ 80001d0: bf88 it hi
+ 80001d2: bd30 pophi {r4, r5, pc}
+ 80001d4: f011 4f00 tst.w r1, #2147483648 ; 0x80000000
+ 80001d8: ea4f 3101 mov.w r1, r1, lsl #12
+ 80001dc: f44f 1c80 mov.w ip, #1048576 ; 0x100000
+ 80001e0: ea4c 3111 orr.w r1, ip, r1, lsr #12
+ 80001e4: d002 beq.n 80001ec <__adddf3+0x70>
+ 80001e6: 4240 negs r0, r0
+ 80001e8: eb61 0141 sbc.w r1, r1, r1, lsl #1
+ 80001ec: f013 4f00 tst.w r3, #2147483648 ; 0x80000000
+ 80001f0: ea4f 3303 mov.w r3, r3, lsl #12
+ 80001f4: ea4c 3313 orr.w r3, ip, r3, lsr #12
+ 80001f8: d002 beq.n 8000200 <__adddf3+0x84>
+ 80001fa: 4252 negs r2, r2
+ 80001fc: eb63 0343 sbc.w r3, r3, r3, lsl #1
+ 8000200: ea94 0f05 teq r4, r5
+ 8000204: f000 80a7 beq.w 8000356 <__adddf3+0x1da>
+ 8000208: f1a4 0401 sub.w r4, r4, #1
+ 800020c: f1d5 0e20 rsbs lr, r5, #32
+ 8000210: db0d blt.n 800022e <__adddf3+0xb2>
+ 8000212: fa02 fc0e lsl.w ip, r2, lr
+ 8000216: fa22 f205 lsr.w r2, r2, r5
+ 800021a: 1880 adds r0, r0, r2
+ 800021c: f141 0100 adc.w r1, r1, #0
+ 8000220: fa03 f20e lsl.w r2, r3, lr
+ 8000224: 1880 adds r0, r0, r2
+ 8000226: fa43 f305 asr.w r3, r3, r5
+ 800022a: 4159 adcs r1, r3
+ 800022c: e00e b.n 800024c <__adddf3+0xd0>
+ 800022e: f1a5 0520 sub.w r5, r5, #32
+ 8000232: f10e 0e20 add.w lr, lr, #32
+ 8000236: 2a01 cmp r2, #1
+ 8000238: fa03 fc0e lsl.w ip, r3, lr
+ 800023c: bf28 it cs
+ 800023e: f04c 0c02 orrcs.w ip, ip, #2
+ 8000242: fa43 f305 asr.w r3, r3, r5
+ 8000246: 18c0 adds r0, r0, r3
+ 8000248: eb51 71e3 adcs.w r1, r1, r3, asr #31
+ 800024c: f001 4500 and.w r5, r1, #2147483648 ; 0x80000000
+ 8000250: d507 bpl.n 8000262 <__adddf3+0xe6>
+ 8000252: f04f 0e00 mov.w lr, #0
+ 8000256: f1dc 0c00 rsbs ip, ip, #0
+ 800025a: eb7e 0000 sbcs.w r0, lr, r0
+ 800025e: eb6e 0101 sbc.w r1, lr, r1
+ 8000262: f5b1 1f80 cmp.w r1, #1048576 ; 0x100000
+ 8000266: d31b bcc.n 80002a0 <__adddf3+0x124>
+ 8000268: f5b1 1f00 cmp.w r1, #2097152 ; 0x200000
+ 800026c: d30c bcc.n 8000288 <__adddf3+0x10c>
+ 800026e: 0849 lsrs r1, r1, #1
+ 8000270: ea5f 0030 movs.w r0, r0, rrx
+ 8000274: ea4f 0c3c mov.w ip, ip, rrx
+ 8000278: f104 0401 add.w r4, r4, #1
+ 800027c: ea4f 5244 mov.w r2, r4, lsl #21
+ 8000280: f512 0f80 cmn.w r2, #4194304 ; 0x400000
+ 8000284: f080 809a bcs.w 80003bc <__adddf3+0x240>
+ 8000288: f1bc 4f00 cmp.w ip, #2147483648 ; 0x80000000
+ 800028c: bf08 it eq
+ 800028e: ea5f 0c50 movseq.w ip, r0, lsr #1
+ 8000292: f150 0000 adcs.w r0, r0, #0
+ 8000296: eb41 5104 adc.w r1, r1, r4, lsl #20
+ 800029a: ea41 0105 orr.w r1, r1, r5
+ 800029e: bd30 pop {r4, r5, pc}
+ 80002a0: ea5f 0c4c movs.w ip, ip, lsl #1
+ 80002a4: 4140 adcs r0, r0
+ 80002a6: eb41 0101 adc.w r1, r1, r1
+ 80002aa: f411 1f80 tst.w r1, #1048576 ; 0x100000
+ 80002ae: f1a4 0401 sub.w r4, r4, #1
+ 80002b2: d1e9 bne.n 8000288 <__adddf3+0x10c>
+ 80002b4: f091 0f00 teq r1, #0
+ 80002b8: bf04 itt eq
+ 80002ba: 4601 moveq r1, r0
+ 80002bc: 2000 moveq r0, #0
+ 80002be: fab1 f381 clz r3, r1
+ 80002c2: bf08 it eq
+ 80002c4: 3320 addeq r3, #32
+ 80002c6: f1a3 030b sub.w r3, r3, #11
+ 80002ca: f1b3 0220 subs.w r2, r3, #32
+ 80002ce: da0c bge.n 80002ea <__adddf3+0x16e>
+ 80002d0: 320c adds r2, #12
+ 80002d2: dd08 ble.n 80002e6 <__adddf3+0x16a>
+ 80002d4: f102 0c14 add.w ip, r2, #20
+ 80002d8: f1c2 020c rsb r2, r2, #12
+ 80002dc: fa01 f00c lsl.w r0, r1, ip
+ 80002e0: fa21 f102 lsr.w r1, r1, r2
+ 80002e4: e00c b.n 8000300 <__adddf3+0x184>
+ 80002e6: f102 0214 add.w r2, r2, #20
+ 80002ea: bfd8 it le
+ 80002ec: f1c2 0c20 rsble ip, r2, #32
+ 80002f0: fa01 f102 lsl.w r1, r1, r2
+ 80002f4: fa20 fc0c lsr.w ip, r0, ip
+ 80002f8: bfdc itt le
+ 80002fa: ea41 010c orrle.w r1, r1, ip
+ 80002fe: 4090 lslle r0, r2
+ 8000300: 1ae4 subs r4, r4, r3
+ 8000302: bfa2 ittt ge
+ 8000304: eb01 5104 addge.w r1, r1, r4, lsl #20
+ 8000308: 4329 orrge r1, r5
+ 800030a: bd30 popge {r4, r5, pc}
+ 800030c: ea6f 0404 mvn.w r4, r4
+ 8000310: 3c1f subs r4, #31
+ 8000312: da1c bge.n 800034e <__adddf3+0x1d2>
+ 8000314: 340c adds r4, #12
+ 8000316: dc0e bgt.n 8000336 <__adddf3+0x1ba>
+ 8000318: f104 0414 add.w r4, r4, #20
+ 800031c: f1c4 0220 rsb r2, r4, #32
+ 8000320: fa20 f004 lsr.w r0, r0, r4
+ 8000324: fa01 f302 lsl.w r3, r1, r2
+ 8000328: ea40 0003 orr.w r0, r0, r3
+ 800032c: fa21 f304 lsr.w r3, r1, r4
+ 8000330: ea45 0103 orr.w r1, r5, r3
+ 8000334: bd30 pop {r4, r5, pc}
+ 8000336: f1c4 040c rsb r4, r4, #12
+ 800033a: f1c4 0220 rsb r2, r4, #32
+ 800033e: fa20 f002 lsr.w r0, r0, r2
+ 8000342: fa01 f304 lsl.w r3, r1, r4
+ 8000346: ea40 0003 orr.w r0, r0, r3
+ 800034a: 4629 mov r1, r5
+ 800034c: bd30 pop {r4, r5, pc}
+ 800034e: fa21 f004 lsr.w r0, r1, r4
+ 8000352: 4629 mov r1, r5
+ 8000354: bd30 pop {r4, r5, pc}
+ 8000356: f094 0f00 teq r4, #0
+ 800035a: f483 1380 eor.w r3, r3, #1048576 ; 0x100000
+ 800035e: bf06 itte eq
+ 8000360: f481 1180 eoreq.w r1, r1, #1048576 ; 0x100000
+ 8000364: 3401 addeq r4, #1
+ 8000366: 3d01 subne r5, #1
+ 8000368: e74e b.n 8000208 <__adddf3+0x8c>
+ 800036a: ea7f 5c64 mvns.w ip, r4, asr #21
+ 800036e: bf18 it ne
+ 8000370: ea7f 5c65 mvnsne.w ip, r5, asr #21
+ 8000374: d029 beq.n 80003ca <__adddf3+0x24e>
+ 8000376: ea94 0f05 teq r4, r5
+ 800037a: bf08 it eq
+ 800037c: ea90 0f02 teqeq r0, r2
+ 8000380: d005 beq.n 800038e <__adddf3+0x212>
+ 8000382: ea54 0c00 orrs.w ip, r4, r0
+ 8000386: bf04 itt eq
+ 8000388: 4619 moveq r1, r3
+ 800038a: 4610 moveq r0, r2
+ 800038c: bd30 pop {r4, r5, pc}
+ 800038e: ea91 0f03 teq r1, r3
+ 8000392: bf1e ittt ne
+ 8000394: 2100 movne r1, #0
+ 8000396: 2000 movne r0, #0
+ 8000398: bd30 popne {r4, r5, pc}
+ 800039a: ea5f 5c54 movs.w ip, r4, lsr #21
+ 800039e: d105 bne.n 80003ac <__adddf3+0x230>
+ 80003a0: 0040 lsls r0, r0, #1
+ 80003a2: 4149 adcs r1, r1
+ 80003a4: bf28 it cs
+ 80003a6: f041 4100 orrcs.w r1, r1, #2147483648 ; 0x80000000
+ 80003aa: bd30 pop {r4, r5, pc}
+ 80003ac: f514 0480 adds.w r4, r4, #4194304 ; 0x400000
+ 80003b0: bf3c itt cc
+ 80003b2: f501 1180 addcc.w r1, r1, #1048576 ; 0x100000
+ 80003b6: bd30 popcc {r4, r5, pc}
+ 80003b8: f001 4500 and.w r5, r1, #2147483648 ; 0x80000000
+ 80003bc: f045 41fe orr.w r1, r5, #2130706432 ; 0x7f000000
+ 80003c0: f441 0170 orr.w r1, r1, #15728640 ; 0xf00000
+ 80003c4: f04f 0000 mov.w r0, #0
+ 80003c8: bd30 pop {r4, r5, pc}
+ 80003ca: ea7f 5c64 mvns.w ip, r4, asr #21
+ 80003ce: bf1a itte ne
+ 80003d0: 4619 movne r1, r3
+ 80003d2: 4610 movne r0, r2
+ 80003d4: ea7f 5c65 mvnseq.w ip, r5, asr #21
+ 80003d8: bf1c itt ne
+ 80003da: 460b movne r3, r1
+ 80003dc: 4602 movne r2, r0
+ 80003de: ea50 3401 orrs.w r4, r0, r1, lsl #12
+ 80003e2: bf06 itte eq
+ 80003e4: ea52 3503 orrseq.w r5, r2, r3, lsl #12
+ 80003e8: ea91 0f03 teqeq r1, r3
+ 80003ec: f441 2100 orrne.w r1, r1, #524288 ; 0x80000
+ 80003f0: bd30 pop {r4, r5, pc}
+ 80003f2: bf00 nop
+
+080003f4 <__aeabi_ui2d>:
+ 80003f4: f090 0f00 teq r0, #0
+ 80003f8: bf04 itt eq
+ 80003fa: 2100 moveq r1, #0
+ 80003fc: 4770 bxeq lr
+ 80003fe: b530 push {r4, r5, lr}
+ 8000400: f44f 6480 mov.w r4, #1024 ; 0x400
+ 8000404: f104 0432 add.w r4, r4, #50 ; 0x32
+ 8000408: f04f 0500 mov.w r5, #0
+ 800040c: f04f 0100 mov.w r1, #0
+ 8000410: e750 b.n 80002b4 <__adddf3+0x138>
+ 8000412: bf00 nop
+
+08000414 <__aeabi_i2d>:
+ 8000414: f090 0f00 teq r0, #0
+ 8000418: bf04 itt eq
+ 800041a: 2100 moveq r1, #0
+ 800041c: 4770 bxeq lr
+ 800041e: b530 push {r4, r5, lr}
+ 8000420: f44f 6480 mov.w r4, #1024 ; 0x400
+ 8000424: f104 0432 add.w r4, r4, #50 ; 0x32
+ 8000428: f010 4500 ands.w r5, r0, #2147483648 ; 0x80000000
+ 800042c: bf48 it mi
+ 800042e: 4240 negmi r0, r0
+ 8000430: f04f 0100 mov.w r1, #0
+ 8000434: e73e b.n 80002b4 <__adddf3+0x138>
+ 8000436: bf00 nop
+
+08000438 <__aeabi_f2d>:
+ 8000438: 0042 lsls r2, r0, #1
+ 800043a: ea4f 01e2 mov.w r1, r2, asr #3
+ 800043e: ea4f 0131 mov.w r1, r1, rrx
+ 8000442: ea4f 7002 mov.w r0, r2, lsl #28
+ 8000446: bf1f itttt ne
+ 8000448: f012 437f andsne.w r3, r2, #4278190080 ; 0xff000000
+ 800044c: f093 4f7f teqne r3, #4278190080 ; 0xff000000
+ 8000450: f081 5160 eorne.w r1, r1, #939524096 ; 0x38000000
+ 8000454: 4770 bxne lr
+ 8000456: f032 427f bics.w r2, r2, #4278190080 ; 0xff000000
+ 800045a: bf08 it eq
+ 800045c: 4770 bxeq lr
+ 800045e: f093 4f7f teq r3, #4278190080 ; 0xff000000
+ 8000462: bf04 itt eq
+ 8000464: f441 2100 orreq.w r1, r1, #524288 ; 0x80000
+ 8000468: 4770 bxeq lr
+ 800046a: b530 push {r4, r5, lr}
+ 800046c: f44f 7460 mov.w r4, #896 ; 0x380
+ 8000470: f001 4500 and.w r5, r1, #2147483648 ; 0x80000000
+ 8000474: f021 4100 bic.w r1, r1, #2147483648 ; 0x80000000
+ 8000478: e71c b.n 80002b4 <__adddf3+0x138>
+ 800047a: bf00 nop
+
+0800047c <__aeabi_ul2d>:
+ 800047c: ea50 0201 orrs.w r2, r0, r1
+ 8000480: bf08 it eq
+ 8000482: 4770 bxeq lr
+ 8000484: b530 push {r4, r5, lr}
+ 8000486: f04f 0500 mov.w r5, #0
+ 800048a: e00a b.n 80004a2 <__aeabi_l2d+0x16>
+
+0800048c <__aeabi_l2d>:
+ 800048c: ea50 0201 orrs.w r2, r0, r1
+ 8000490: bf08 it eq
+ 8000492: 4770 bxeq lr
+ 8000494: b530 push {r4, r5, lr}
+ 8000496: f011 4500 ands.w r5, r1, #2147483648 ; 0x80000000
+ 800049a: d502 bpl.n 80004a2 <__aeabi_l2d+0x16>
+ 800049c: 4240 negs r0, r0
+ 800049e: eb61 0141 sbc.w r1, r1, r1, lsl #1
+ 80004a2: f44f 6480 mov.w r4, #1024 ; 0x400
+ 80004a6: f104 0432 add.w r4, r4, #50 ; 0x32
+ 80004aa: ea5f 5c91 movs.w ip, r1, lsr #22
+ 80004ae: f43f aed8 beq.w 8000262 <__adddf3+0xe6>
+ 80004b2: f04f 0203 mov.w r2, #3
+ 80004b6: ea5f 0cdc movs.w ip, ip, lsr #3
+ 80004ba: bf18 it ne
+ 80004bc: 3203 addne r2, #3
+ 80004be: ea5f 0cdc movs.w ip, ip, lsr #3
+ 80004c2: bf18 it ne
+ 80004c4: 3203 addne r2, #3
+ 80004c6: eb02 02dc add.w r2, r2, ip, lsr #3
+ 80004ca: f1c2 0320 rsb r3, r2, #32
+ 80004ce: fa00 fc03 lsl.w ip, r0, r3
+ 80004d2: fa20 f002 lsr.w r0, r0, r2
+ 80004d6: fa01 fe03 lsl.w lr, r1, r3
+ 80004da: ea40 000e orr.w r0, r0, lr
+ 80004de: fa21 f102 lsr.w r1, r1, r2
+ 80004e2: 4414 add r4, r2
+ 80004e4: e6bd b.n 8000262 <__adddf3+0xe6>
+ 80004e6: bf00 nop
+
+080004e8 <__aeabi_dmul>:
+ 80004e8: b570 push {r4, r5, r6, lr}
+ 80004ea: f04f 0cff mov.w ip, #255 ; 0xff
+ 80004ee: f44c 6ce0 orr.w ip, ip, #1792 ; 0x700
+ 80004f2: ea1c 5411 ands.w r4, ip, r1, lsr #20
+ 80004f6: bf1d ittte ne
+ 80004f8: ea1c 5513 andsne.w r5, ip, r3, lsr #20
+ 80004fc: ea94 0f0c teqne r4, ip
+ 8000500: ea95 0f0c teqne r5, ip
+ 8000504: f000 f8de bleq 80006c4 <__aeabi_dmul+0x1dc>
+ 8000508: 442c add r4, r5
+ 800050a: ea81 0603 eor.w r6, r1, r3
+ 800050e: ea21 514c bic.w r1, r1, ip, lsl #21
+ 8000512: ea23 534c bic.w r3, r3, ip, lsl #21
+ 8000516: ea50 3501 orrs.w r5, r0, r1, lsl #12
+ 800051a: bf18 it ne
+ 800051c: ea52 3503 orrsne.w r5, r2, r3, lsl #12
+ 8000520: f441 1180 orr.w r1, r1, #1048576 ; 0x100000
+ 8000524: f443 1380 orr.w r3, r3, #1048576 ; 0x100000
+ 8000528: d038 beq.n 800059c <__aeabi_dmul+0xb4>
+ 800052a: fba0 ce02 umull ip, lr, r0, r2
+ 800052e: f04f 0500 mov.w r5, #0
+ 8000532: fbe1 e502 umlal lr, r5, r1, r2
+ 8000536: f006 4200 and.w r2, r6, #2147483648 ; 0x80000000
+ 800053a: fbe0 e503 umlal lr, r5, r0, r3
+ 800053e: f04f 0600 mov.w r6, #0
+ 8000542: fbe1 5603 umlal r5, r6, r1, r3
+ 8000546: f09c 0f00 teq ip, #0
+ 800054a: bf18 it ne
+ 800054c: f04e 0e01 orrne.w lr, lr, #1
+ 8000550: f1a4 04ff sub.w r4, r4, #255 ; 0xff
+ 8000554: f5b6 7f00 cmp.w r6, #512 ; 0x200
+ 8000558: f564 7440 sbc.w r4, r4, #768 ; 0x300
+ 800055c: d204 bcs.n 8000568 <__aeabi_dmul+0x80>
+ 800055e: ea5f 0e4e movs.w lr, lr, lsl #1
+ 8000562: 416d adcs r5, r5
+ 8000564: eb46 0606 adc.w r6, r6, r6
+ 8000568: ea42 21c6 orr.w r1, r2, r6, lsl #11
+ 800056c: ea41 5155 orr.w r1, r1, r5, lsr #21
+ 8000570: ea4f 20c5 mov.w r0, r5, lsl #11
+ 8000574: ea40 505e orr.w r0, r0, lr, lsr #21
+ 8000578: ea4f 2ece mov.w lr, lr, lsl #11
+ 800057c: f1b4 0cfd subs.w ip, r4, #253 ; 0xfd
+ 8000580: bf88 it hi
+ 8000582: f5bc 6fe0 cmphi.w ip, #1792 ; 0x700
+ 8000586: d81e bhi.n 80005c6 <__aeabi_dmul+0xde>
+ 8000588: f1be 4f00 cmp.w lr, #2147483648 ; 0x80000000
+ 800058c: bf08 it eq
+ 800058e: ea5f 0e50 movseq.w lr, r0, lsr #1
+ 8000592: f150 0000 adcs.w r0, r0, #0
+ 8000596: eb41 5104 adc.w r1, r1, r4, lsl #20
+ 800059a: bd70 pop {r4, r5, r6, pc}
+ 800059c: f006 4600 and.w r6, r6, #2147483648 ; 0x80000000
+ 80005a0: ea46 0101 orr.w r1, r6, r1
+ 80005a4: ea40 0002 orr.w r0, r0, r2
+ 80005a8: ea81 0103 eor.w r1, r1, r3
+ 80005ac: ebb4 045c subs.w r4, r4, ip, lsr #1
+ 80005b0: bfc2 ittt gt
+ 80005b2: ebd4 050c rsbsgt r5, r4, ip
+ 80005b6: ea41 5104 orrgt.w r1, r1, r4, lsl #20
+ 80005ba: bd70 popgt {r4, r5, r6, pc}
+ 80005bc: f441 1180 orr.w r1, r1, #1048576 ; 0x100000
+ 80005c0: f04f 0e00 mov.w lr, #0
+ 80005c4: 3c01 subs r4, #1
+ 80005c6: f300 80ab bgt.w 8000720 <__aeabi_dmul+0x238>
+ 80005ca: f114 0f36 cmn.w r4, #54 ; 0x36
+ 80005ce: bfde ittt le
+ 80005d0: 2000 movle r0, #0
+ 80005d2: f001 4100 andle.w r1, r1, #2147483648 ; 0x80000000
+ 80005d6: bd70 pople {r4, r5, r6, pc}
+ 80005d8: f1c4 0400 rsb r4, r4, #0
+ 80005dc: 3c20 subs r4, #32
+ 80005de: da35 bge.n 800064c <__aeabi_dmul+0x164>
+ 80005e0: 340c adds r4, #12
+ 80005e2: dc1b bgt.n 800061c <__aeabi_dmul+0x134>
+ 80005e4: f104 0414 add.w r4, r4, #20
+ 80005e8: f1c4 0520 rsb r5, r4, #32
+ 80005ec: fa00 f305 lsl.w r3, r0, r5
+ 80005f0: fa20 f004 lsr.w r0, r0, r4
+ 80005f4: fa01 f205 lsl.w r2, r1, r5
+ 80005f8: ea40 0002 orr.w r0, r0, r2
+ 80005fc: f001 4200 and.w r2, r1, #2147483648 ; 0x80000000
+ 8000600: f021 4100 bic.w r1, r1, #2147483648 ; 0x80000000
+ 8000604: eb10 70d3 adds.w r0, r0, r3, lsr #31
+ 8000608: fa21 f604 lsr.w r6, r1, r4
+ 800060c: eb42 0106 adc.w r1, r2, r6
+ 8000610: ea5e 0e43 orrs.w lr, lr, r3, lsl #1
+ 8000614: bf08 it eq
+ 8000616: ea20 70d3 biceq.w r0, r0, r3, lsr #31
+ 800061a: bd70 pop {r4, r5, r6, pc}
+ 800061c: f1c4 040c rsb r4, r4, #12
+ 8000620: f1c4 0520 rsb r5, r4, #32
+ 8000624: fa00 f304 lsl.w r3, r0, r4
+ 8000628: fa20 f005 lsr.w r0, r0, r5
+ 800062c: fa01 f204 lsl.w r2, r1, r4
+ 8000630: ea40 0002 orr.w r0, r0, r2
+ 8000634: f001 4100 and.w r1, r1, #2147483648 ; 0x80000000
+ 8000638: eb10 70d3 adds.w r0, r0, r3, lsr #31
+ 800063c: f141 0100 adc.w r1, r1, #0
+ 8000640: ea5e 0e43 orrs.w lr, lr, r3, lsl #1
+ 8000644: bf08 it eq
+ 8000646: ea20 70d3 biceq.w r0, r0, r3, lsr #31
+ 800064a: bd70 pop {r4, r5, r6, pc}
+ 800064c: f1c4 0520 rsb r5, r4, #32
+ 8000650: fa00 f205 lsl.w r2, r0, r5
+ 8000654: ea4e 0e02 orr.w lr, lr, r2
+ 8000658: fa20 f304 lsr.w r3, r0, r4
+ 800065c: fa01 f205 lsl.w r2, r1, r5
+ 8000660: ea43 0302 orr.w r3, r3, r2
+ 8000664: fa21 f004 lsr.w r0, r1, r4
+ 8000668: f001 4100 and.w r1, r1, #2147483648 ; 0x80000000
+ 800066c: fa21 f204 lsr.w r2, r1, r4
+ 8000670: ea20 0002 bic.w r0, r0, r2
+ 8000674: eb00 70d3 add.w r0, r0, r3, lsr #31
+ 8000678: ea5e 0e43 orrs.w lr, lr, r3, lsl #1
+ 800067c: bf08 it eq
+ 800067e: ea20 70d3 biceq.w r0, r0, r3, lsr #31
+ 8000682: bd70 pop {r4, r5, r6, pc}
+ 8000684: f094 0f00 teq r4, #0
+ 8000688: d10f bne.n 80006aa <__aeabi_dmul+0x1c2>
+ 800068a: f001 4600 and.w r6, r1, #2147483648 ; 0x80000000
+ 800068e: 0040 lsls r0, r0, #1
+ 8000690: eb41 0101 adc.w r1, r1, r1
+ 8000694: f411 1f80 tst.w r1, #1048576 ; 0x100000
+ 8000698: bf08 it eq
+ 800069a: 3c01 subeq r4, #1
+ 800069c: d0f7 beq.n 800068e <__aeabi_dmul+0x1a6>
+ 800069e: ea41 0106 orr.w r1, r1, r6
+ 80006a2: f095 0f00 teq r5, #0
+ 80006a6: bf18 it ne
+ 80006a8: 4770 bxne lr
+ 80006aa: f003 4600 and.w r6, r3, #2147483648 ; 0x80000000
+ 80006ae: 0052 lsls r2, r2, #1
+ 80006b0: eb43 0303 adc.w r3, r3, r3
+ 80006b4: f413 1f80 tst.w r3, #1048576 ; 0x100000
+ 80006b8: bf08 it eq
+ 80006ba: 3d01 subeq r5, #1
+ 80006bc: d0f7 beq.n 80006ae <__aeabi_dmul+0x1c6>
+ 80006be: ea43 0306 orr.w r3, r3, r6
+ 80006c2: 4770 bx lr
+ 80006c4: ea94 0f0c teq r4, ip
+ 80006c8: ea0c 5513 and.w r5, ip, r3, lsr #20
+ 80006cc: bf18 it ne
+ 80006ce: ea95 0f0c teqne r5, ip
+ 80006d2: d00c beq.n 80006ee <__aeabi_dmul+0x206>
+ 80006d4: ea50 0641 orrs.w r6, r0, r1, lsl #1
+ 80006d8: bf18 it ne
+ 80006da: ea52 0643 orrsne.w r6, r2, r3, lsl #1
+ 80006de: d1d1 bne.n 8000684 <__aeabi_dmul+0x19c>
+ 80006e0: ea81 0103 eor.w r1, r1, r3
+ 80006e4: f001 4100 and.w r1, r1, #2147483648 ; 0x80000000
+ 80006e8: f04f 0000 mov.w r0, #0
+ 80006ec: bd70 pop {r4, r5, r6, pc}
+ 80006ee: ea50 0641 orrs.w r6, r0, r1, lsl #1
+ 80006f2: bf06 itte eq
+ 80006f4: 4610 moveq r0, r2
+ 80006f6: 4619 moveq r1, r3
+ 80006f8: ea52 0643 orrsne.w r6, r2, r3, lsl #1
+ 80006fc: d019 beq.n 8000732 <__aeabi_dmul+0x24a>
+ 80006fe: ea94 0f0c teq r4, ip
+ 8000702: d102 bne.n 800070a <__aeabi_dmul+0x222>
+ 8000704: ea50 3601 orrs.w r6, r0, r1, lsl #12
+ 8000708: d113 bne.n 8000732 <__aeabi_dmul+0x24a>
+ 800070a: ea95 0f0c teq r5, ip
+ 800070e: d105 bne.n 800071c <__aeabi_dmul+0x234>
+ 8000710: ea52 3603 orrs.w r6, r2, r3, lsl #12
+ 8000714: bf1c itt ne
+ 8000716: 4610 movne r0, r2
+ 8000718: 4619 movne r1, r3
+ 800071a: d10a bne.n 8000732 <__aeabi_dmul+0x24a>
+ 800071c: ea81 0103 eor.w r1, r1, r3
+ 8000720: f001 4100 and.w r1, r1, #2147483648 ; 0x80000000
+ 8000724: f041 41fe orr.w r1, r1, #2130706432 ; 0x7f000000
+ 8000728: f441 0170 orr.w r1, r1, #15728640 ; 0xf00000
+ 800072c: f04f 0000 mov.w r0, #0
+ 8000730: bd70 pop {r4, r5, r6, pc}
+ 8000732: f041 41fe orr.w r1, r1, #2130706432 ; 0x7f000000
+ 8000736: f441 0178 orr.w r1, r1, #16252928 ; 0xf80000
+ 800073a: bd70 pop {r4, r5, r6, pc}
+
+0800073c <__aeabi_ddiv>:
+ 800073c: b570 push {r4, r5, r6, lr}
+ 800073e: f04f 0cff mov.w ip, #255 ; 0xff
+ 8000742: f44c 6ce0 orr.w ip, ip, #1792 ; 0x700
+ 8000746: ea1c 5411 ands.w r4, ip, r1, lsr #20
+ 800074a: bf1d ittte ne
+ 800074c: ea1c 5513 andsne.w r5, ip, r3, lsr #20
+ 8000750: ea94 0f0c teqne r4, ip
+ 8000754: ea95 0f0c teqne r5, ip
+ 8000758: f000 f8a7 bleq 80008aa <__aeabi_ddiv+0x16e>
+ 800075c: eba4 0405 sub.w r4, r4, r5
+ 8000760: ea81 0e03 eor.w lr, r1, r3
+ 8000764: ea52 3503 orrs.w r5, r2, r3, lsl #12
+ 8000768: ea4f 3101 mov.w r1, r1, lsl #12
+ 800076c: f000 8088 beq.w 8000880 <__aeabi_ddiv+0x144>
+ 8000770: ea4f 3303 mov.w r3, r3, lsl #12
+ 8000774: f04f 5580 mov.w r5, #268435456 ; 0x10000000
+ 8000778: ea45 1313 orr.w r3, r5, r3, lsr #4
+ 800077c: ea43 6312 orr.w r3, r3, r2, lsr #24
+ 8000780: ea4f 2202 mov.w r2, r2, lsl #8
+ 8000784: ea45 1511 orr.w r5, r5, r1, lsr #4
+ 8000788: ea45 6510 orr.w r5, r5, r0, lsr #24
+ 800078c: ea4f 2600 mov.w r6, r0, lsl #8
+ 8000790: f00e 4100 and.w r1, lr, #2147483648 ; 0x80000000
+ 8000794: 429d cmp r5, r3
+ 8000796: bf08 it eq
+ 8000798: 4296 cmpeq r6, r2
+ 800079a: f144 04fd adc.w r4, r4, #253 ; 0xfd
+ 800079e: f504 7440 add.w r4, r4, #768 ; 0x300
+ 80007a2: d202 bcs.n 80007aa <__aeabi_ddiv+0x6e>
+ 80007a4: 085b lsrs r3, r3, #1
+ 80007a6: ea4f 0232 mov.w r2, r2, rrx
+ 80007aa: 1ab6 subs r6, r6, r2
+ 80007ac: eb65 0503 sbc.w r5, r5, r3
+ 80007b0: 085b lsrs r3, r3, #1
+ 80007b2: ea4f 0232 mov.w r2, r2, rrx
+ 80007b6: f44f 1080 mov.w r0, #1048576 ; 0x100000
+ 80007ba: f44f 2c00 mov.w ip, #524288 ; 0x80000
+ 80007be: ebb6 0e02 subs.w lr, r6, r2
+ 80007c2: eb75 0e03 sbcs.w lr, r5, r3
+ 80007c6: bf22 ittt cs
+ 80007c8: 1ab6 subcs r6, r6, r2
+ 80007ca: 4675 movcs r5, lr
+ 80007cc: ea40 000c orrcs.w r0, r0, ip
+ 80007d0: 085b lsrs r3, r3, #1
+ 80007d2: ea4f 0232 mov.w r2, r2, rrx
+ 80007d6: ebb6 0e02 subs.w lr, r6, r2
+ 80007da: eb75 0e03 sbcs.w lr, r5, r3
+ 80007de: bf22 ittt cs
+ 80007e0: 1ab6 subcs r6, r6, r2
+ 80007e2: 4675 movcs r5, lr
+ 80007e4: ea40 005c orrcs.w r0, r0, ip, lsr #1
+ 80007e8: 085b lsrs r3, r3, #1
+ 80007ea: ea4f 0232 mov.w r2, r2, rrx
+ 80007ee: ebb6 0e02 subs.w lr, r6, r2
+ 80007f2: eb75 0e03 sbcs.w lr, r5, r3
+ 80007f6: bf22 ittt cs
+ 80007f8: 1ab6 subcs r6, r6, r2
+ 80007fa: 4675 movcs r5, lr
+ 80007fc: ea40 009c orrcs.w r0, r0, ip, lsr #2
+ 8000800: 085b lsrs r3, r3, #1
+ 8000802: ea4f 0232 mov.w r2, r2, rrx
+ 8000806: ebb6 0e02 subs.w lr, r6, r2
+ 800080a: eb75 0e03 sbcs.w lr, r5, r3
+ 800080e: bf22 ittt cs
+ 8000810: 1ab6 subcs r6, r6, r2
+ 8000812: 4675 movcs r5, lr
+ 8000814: ea40 00dc orrcs.w r0, r0, ip, lsr #3
+ 8000818: ea55 0e06 orrs.w lr, r5, r6
+ 800081c: d018 beq.n 8000850 <__aeabi_ddiv+0x114>
+ 800081e: ea4f 1505 mov.w r5, r5, lsl #4
+ 8000822: ea45 7516 orr.w r5, r5, r6, lsr #28
+ 8000826: ea4f 1606 mov.w r6, r6, lsl #4
+ 800082a: ea4f 03c3 mov.w r3, r3, lsl #3
+ 800082e: ea43 7352 orr.w r3, r3, r2, lsr #29
+ 8000832: ea4f 02c2 mov.w r2, r2, lsl #3
+ 8000836: ea5f 1c1c movs.w ip, ip, lsr #4
+ 800083a: d1c0 bne.n 80007be <__aeabi_ddiv+0x82>
+ 800083c: f411 1f80 tst.w r1, #1048576 ; 0x100000
+ 8000840: d10b bne.n 800085a <__aeabi_ddiv+0x11e>
+ 8000842: ea41 0100 orr.w r1, r1, r0
+ 8000846: f04f 0000 mov.w r0, #0
+ 800084a: f04f 4c00 mov.w ip, #2147483648 ; 0x80000000
+ 800084e: e7b6 b.n 80007be <__aeabi_ddiv+0x82>
+ 8000850: f411 1f80 tst.w r1, #1048576 ; 0x100000
+ 8000854: bf04 itt eq
+ 8000856: 4301 orreq r1, r0
+ 8000858: 2000 moveq r0, #0
+ 800085a: f1b4 0cfd subs.w ip, r4, #253 ; 0xfd
+ 800085e: bf88 it hi
+ 8000860: f5bc 6fe0 cmphi.w ip, #1792 ; 0x700
+ 8000864: f63f aeaf bhi.w 80005c6 <__aeabi_dmul+0xde>
+ 8000868: ebb5 0c03 subs.w ip, r5, r3
+ 800086c: bf04 itt eq
+ 800086e: ebb6 0c02 subseq.w ip, r6, r2
+ 8000872: ea5f 0c50 movseq.w ip, r0, lsr #1
+ 8000876: f150 0000 adcs.w r0, r0, #0
+ 800087a: eb41 5104 adc.w r1, r1, r4, lsl #20
+ 800087e: bd70 pop {r4, r5, r6, pc}
+ 8000880: f00e 4e00 and.w lr, lr, #2147483648 ; 0x80000000
+ 8000884: ea4e 3111 orr.w r1, lr, r1, lsr #12
+ 8000888: eb14 045c adds.w r4, r4, ip, lsr #1
+ 800088c: bfc2 ittt gt
+ 800088e: ebd4 050c rsbsgt r5, r4, ip
+ 8000892: ea41 5104 orrgt.w r1, r1, r4, lsl #20
+ 8000896: bd70 popgt {r4, r5, r6, pc}
+ 8000898: f441 1180 orr.w r1, r1, #1048576 ; 0x100000
+ 800089c: f04f 0e00 mov.w lr, #0
+ 80008a0: 3c01 subs r4, #1
+ 80008a2: e690 b.n 80005c6 <__aeabi_dmul+0xde>
+ 80008a4: ea45 0e06 orr.w lr, r5, r6
+ 80008a8: e68d b.n 80005c6 <__aeabi_dmul+0xde>
+ 80008aa: ea0c 5513 and.w r5, ip, r3, lsr #20
+ 80008ae: ea94 0f0c teq r4, ip
+ 80008b2: bf08 it eq
+ 80008b4: ea95 0f0c teqeq r5, ip
+ 80008b8: f43f af3b beq.w 8000732 <__aeabi_dmul+0x24a>
+ 80008bc: ea94 0f0c teq r4, ip
+ 80008c0: d10a bne.n 80008d8 <__aeabi_ddiv+0x19c>
+ 80008c2: ea50 3401 orrs.w r4, r0, r1, lsl #12
+ 80008c6: f47f af34 bne.w 8000732 <__aeabi_dmul+0x24a>
+ 80008ca: ea95 0f0c teq r5, ip
+ 80008ce: f47f af25 bne.w 800071c <__aeabi_dmul+0x234>
+ 80008d2: 4610 mov r0, r2
+ 80008d4: 4619 mov r1, r3
+ 80008d6: e72c b.n 8000732 <__aeabi_dmul+0x24a>
+ 80008d8: ea95 0f0c teq r5, ip
+ 80008dc: d106 bne.n 80008ec <__aeabi_ddiv+0x1b0>
+ 80008de: ea52 3503 orrs.w r5, r2, r3, lsl #12
+ 80008e2: f43f aefd beq.w 80006e0 <__aeabi_dmul+0x1f8>
+ 80008e6: 4610 mov r0, r2
+ 80008e8: 4619 mov r1, r3
+ 80008ea: e722 b.n 8000732 <__aeabi_dmul+0x24a>
+ 80008ec: ea50 0641 orrs.w r6, r0, r1, lsl #1
+ 80008f0: bf18 it ne
+ 80008f2: ea52 0643 orrsne.w r6, r2, r3, lsl #1
+ 80008f6: f47f aec5 bne.w 8000684 <__aeabi_dmul+0x19c>
+ 80008fa: ea50 0441 orrs.w r4, r0, r1, lsl #1
+ 80008fe: f47f af0d bne.w 800071c <__aeabi_dmul+0x234>
+ 8000902: ea52 0543 orrs.w r5, r2, r3, lsl #1
+ 8000906: f47f aeeb bne.w 80006e0 <__aeabi_dmul+0x1f8>
+ 800090a: e712 b.n 8000732 <__aeabi_dmul+0x24a>
+
+0800090c <__gedf2>:
+ 800090c: f04f 3cff mov.w ip, #4294967295
+ 8000910: e006 b.n 8000920 <__cmpdf2+0x4>
+ 8000912: bf00 nop
+
+08000914 <__ledf2>:
+ 8000914: f04f 0c01 mov.w ip, #1
+ 8000918: e002 b.n 8000920 <__cmpdf2+0x4>
+ 800091a: bf00 nop
+
+0800091c <__cmpdf2>:
+ 800091c: f04f 0c01 mov.w ip, #1
+ 8000920: f84d cd04 str.w ip, [sp, #-4]!
+ 8000924: ea4f 0c41 mov.w ip, r1, lsl #1
+ 8000928: ea7f 5c6c mvns.w ip, ip, asr #21
+ 800092c: ea4f 0c43 mov.w ip, r3, lsl #1
+ 8000930: bf18 it ne
+ 8000932: ea7f 5c6c mvnsne.w ip, ip, asr #21
+ 8000936: d01b beq.n 8000970 <__cmpdf2+0x54>
+ 8000938: b001 add sp, #4
+ 800093a: ea50 0c41 orrs.w ip, r0, r1, lsl #1
+ 800093e: bf0c ite eq
+ 8000940: ea52 0c43 orrseq.w ip, r2, r3, lsl #1
+ 8000944: ea91 0f03 teqne r1, r3
+ 8000948: bf02 ittt eq
+ 800094a: ea90 0f02 teqeq r0, r2
+ 800094e: 2000 moveq r0, #0
+ 8000950: 4770 bxeq lr
+ 8000952: f110 0f00 cmn.w r0, #0
+ 8000956: ea91 0f03 teq r1, r3
+ 800095a: bf58 it pl
+ 800095c: 4299 cmppl r1, r3
+ 800095e: bf08 it eq
+ 8000960: 4290 cmpeq r0, r2
+ 8000962: bf2c ite cs
+ 8000964: 17d8 asrcs r0, r3, #31
+ 8000966: ea6f 70e3 mvncc.w r0, r3, asr #31
+ 800096a: f040 0001 orr.w r0, r0, #1
+ 800096e: 4770 bx lr
+ 8000970: ea4f 0c41 mov.w ip, r1, lsl #1
+ 8000974: ea7f 5c6c mvns.w ip, ip, asr #21
+ 8000978: d102 bne.n 8000980 <__cmpdf2+0x64>
+ 800097a: ea50 3c01 orrs.w ip, r0, r1, lsl #12
+ 800097e: d107 bne.n 8000990 <__cmpdf2+0x74>
+ 8000980: ea4f 0c43 mov.w ip, r3, lsl #1
+ 8000984: ea7f 5c6c mvns.w ip, ip, asr #21
+ 8000988: d1d6 bne.n 8000938 <__cmpdf2+0x1c>
+ 800098a: ea52 3c03 orrs.w ip, r2, r3, lsl #12
+ 800098e: d0d3 beq.n 8000938 <__cmpdf2+0x1c>
+ 8000990: f85d 0b04 ldr.w r0, [sp], #4
+ 8000994: 4770 bx lr
+ 8000996: bf00 nop
+
+08000998 <__aeabi_cdrcmple>:
+ 8000998: 4684 mov ip, r0
+ 800099a: 4610 mov r0, r2
+ 800099c: 4662 mov r2, ip
+ 800099e: 468c mov ip, r1
+ 80009a0: 4619 mov r1, r3
+ 80009a2: 4663 mov r3, ip
+ 80009a4: e000 b.n 80009a8 <__aeabi_cdcmpeq>
+ 80009a6: bf00 nop
+
+080009a8 <__aeabi_cdcmpeq>:
+ 80009a8: b501 push {r0, lr}
+ 80009aa: f7ff ffb7 bl 800091c <__cmpdf2>
+ 80009ae: 2800 cmp r0, #0
+ 80009b0: bf48 it mi
+ 80009b2: f110 0f00 cmnmi.w r0, #0
+ 80009b6: bd01 pop {r0, pc}
+
+080009b8 <__aeabi_dcmpeq>:
+ 80009b8: f84d ed08 str.w lr, [sp, #-8]!
+ 80009bc: f7ff fff4 bl 80009a8 <__aeabi_cdcmpeq>
+ 80009c0: bf0c ite eq
+ 80009c2: 2001 moveq r0, #1
+ 80009c4: 2000 movne r0, #0
+ 80009c6: f85d fb08 ldr.w pc, [sp], #8
+ 80009ca: bf00 nop
+
+080009cc <__aeabi_dcmplt>:
+ 80009cc: f84d ed08 str.w lr, [sp, #-8]!
+ 80009d0: f7ff ffea bl 80009a8 <__aeabi_cdcmpeq>
+ 80009d4: bf34 ite cc
+ 80009d6: 2001 movcc r0, #1
+ 80009d8: 2000 movcs r0, #0
+ 80009da: f85d fb08 ldr.w pc, [sp], #8
+ 80009de: bf00 nop
+
+080009e0 <__aeabi_dcmple>:
+ 80009e0: f84d ed08 str.w lr, [sp, #-8]!
+ 80009e4: f7ff ffe0 bl 80009a8 <__aeabi_cdcmpeq>
+ 80009e8: bf94 ite ls
+ 80009ea: 2001 movls r0, #1
+ 80009ec: 2000 movhi r0, #0
+ 80009ee: f85d fb08 ldr.w pc, [sp], #8
+ 80009f2: bf00 nop
+
+080009f4 <__aeabi_dcmpge>:
+ 80009f4: f84d ed08 str.w lr, [sp, #-8]!
+ 80009f8: f7ff ffce bl 8000998 <__aeabi_cdrcmple>
+ 80009fc: bf94 ite ls
+ 80009fe: 2001 movls r0, #1
+ 8000a00: 2000 movhi r0, #0
+ 8000a02: f85d fb08 ldr.w pc, [sp], #8
+ 8000a06: bf00 nop
+
+08000a08 <__aeabi_dcmpgt>:
+ 8000a08: f84d ed08 str.w lr, [sp, #-8]!
+ 8000a0c: f7ff ffc4 bl 8000998 <__aeabi_cdrcmple>
+ 8000a10: bf34 ite cc
+ 8000a12: 2001 movcc r0, #1
+ 8000a14: 2000 movcs r0, #0
+ 8000a16: f85d fb08 ldr.w pc, [sp], #8
+ 8000a1a: bf00 nop
+
+08000a1c <__aeabi_dcmpun>:
+ 8000a1c: ea4f 0c41 mov.w ip, r1, lsl #1
+ 8000a20: ea7f 5c6c mvns.w ip, ip, asr #21
+ 8000a24: d102 bne.n 8000a2c <__aeabi_dcmpun+0x10>
+ 8000a26: ea50 3c01 orrs.w ip, r0, r1, lsl #12
+ 8000a2a: d10a bne.n 8000a42 <__aeabi_dcmpun+0x26>
+ 8000a2c: ea4f 0c43 mov.w ip, r3, lsl #1
+ 8000a30: ea7f 5c6c mvns.w ip, ip, asr #21
+ 8000a34: d102 bne.n 8000a3c <__aeabi_dcmpun+0x20>
+ 8000a36: ea52 3c03 orrs.w ip, r2, r3, lsl #12
+ 8000a3a: d102 bne.n 8000a42 <__aeabi_dcmpun+0x26>
+ 8000a3c: f04f 0000 mov.w r0, #0
+ 8000a40: 4770 bx lr
+ 8000a42: f04f 0001 mov.w r0, #1
+ 8000a46: 4770 bx lr
+
+08000a48 <__aeabi_d2iz>:
+ 8000a48: ea4f 0241 mov.w r2, r1, lsl #1
+ 8000a4c: f512 1200 adds.w r2, r2, #2097152 ; 0x200000
+ 8000a50: d215 bcs.n 8000a7e <__aeabi_d2iz+0x36>
+ 8000a52: d511 bpl.n 8000a78 <__aeabi_d2iz+0x30>
+ 8000a54: f46f 7378 mvn.w r3, #992 ; 0x3e0
+ 8000a58: ebb3 5262 subs.w r2, r3, r2, asr #21
+ 8000a5c: d912 bls.n 8000a84 <__aeabi_d2iz+0x3c>
+ 8000a5e: ea4f 23c1 mov.w r3, r1, lsl #11
+ 8000a62: f043 4300 orr.w r3, r3, #2147483648 ; 0x80000000
+ 8000a66: ea43 5350 orr.w r3, r3, r0, lsr #21
+ 8000a6a: f011 4f00 tst.w r1, #2147483648 ; 0x80000000
+ 8000a6e: fa23 f002 lsr.w r0, r3, r2
+ 8000a72: bf18 it ne
+ 8000a74: 4240 negne r0, r0
+ 8000a76: 4770 bx lr
+ 8000a78: f04f 0000 mov.w r0, #0
+ 8000a7c: 4770 bx lr
+ 8000a7e: ea50 3001 orrs.w r0, r0, r1, lsl #12
+ 8000a82: d105 bne.n 8000a90 <__aeabi_d2iz+0x48>
+ 8000a84: f011 4000 ands.w r0, r1, #2147483648 ; 0x80000000
+ 8000a88: bf08 it eq
+ 8000a8a: f06f 4000 mvneq.w r0, #2147483648 ; 0x80000000
+ 8000a8e: 4770 bx lr
+ 8000a90: f04f 0000 mov.w r0, #0
+ 8000a94: 4770 bx lr
+ 8000a96: bf00 nop
+
+08000a98 <__aeabi_d2uiz>:
+ 8000a98: 004a lsls r2, r1, #1
+ 8000a9a: d211 bcs.n 8000ac0 <__aeabi_d2uiz+0x28>
+ 8000a9c: f512 1200 adds.w r2, r2, #2097152 ; 0x200000
+ 8000aa0: d211 bcs.n 8000ac6 <__aeabi_d2uiz+0x2e>
+ 8000aa2: d50d bpl.n 8000ac0 <__aeabi_d2uiz+0x28>
+ 8000aa4: f46f 7378 mvn.w r3, #992 ; 0x3e0
+ 8000aa8: ebb3 5262 subs.w r2, r3, r2, asr #21
+ 8000aac: d40e bmi.n 8000acc <__aeabi_d2uiz+0x34>
+ 8000aae: ea4f 23c1 mov.w r3, r1, lsl #11
+ 8000ab2: f043 4300 orr.w r3, r3, #2147483648 ; 0x80000000
+ 8000ab6: ea43 5350 orr.w r3, r3, r0, lsr #21
+ 8000aba: fa23 f002 lsr.w r0, r3, r2
+ 8000abe: 4770 bx lr
+ 8000ac0: f04f 0000 mov.w r0, #0
+ 8000ac4: 4770 bx lr
+ 8000ac6: ea50 3001 orrs.w r0, r0, r1, lsl #12
+ 8000aca: d102 bne.n 8000ad2 <__aeabi_d2uiz+0x3a>
+ 8000acc: f04f 30ff mov.w r0, #4294967295
+ 8000ad0: 4770 bx lr
+ 8000ad2: f04f 0000 mov.w r0, #0
+ 8000ad6: 4770 bx lr
+
+08000ad8 <__aeabi_d2f>:
+ 8000ad8: ea4f 0241 mov.w r2, r1, lsl #1
+ 8000adc: f1b2 43e0 subs.w r3, r2, #1879048192 ; 0x70000000
+ 8000ae0: bf24 itt cs
+ 8000ae2: f5b3 1c00 subscs.w ip, r3, #2097152 ; 0x200000
+ 8000ae6: f1dc 5cfe rsbscs ip, ip, #532676608 ; 0x1fc00000
+ 8000aea: d90d bls.n 8000b08 <__aeabi_d2f+0x30>
+ 8000aec: f001 4c00 and.w ip, r1, #2147483648 ; 0x80000000
+ 8000af0: ea4f 02c0 mov.w r2, r0, lsl #3
+ 8000af4: ea4c 7050 orr.w r0, ip, r0, lsr #29
+ 8000af8: f1b2 4f00 cmp.w r2, #2147483648 ; 0x80000000
+ 8000afc: eb40 0083 adc.w r0, r0, r3, lsl #2
+ 8000b00: bf08 it eq
+ 8000b02: f020 0001 biceq.w r0, r0, #1
+ 8000b06: 4770 bx lr
+ 8000b08: f011 4f80 tst.w r1, #1073741824 ; 0x40000000
+ 8000b0c: d121 bne.n 8000b52 <__aeabi_d2f+0x7a>
+ 8000b0e: f113 7238 adds.w r2, r3, #48234496 ; 0x2e00000
+ 8000b12: bfbc itt lt
+ 8000b14: f001 4000 andlt.w r0, r1, #2147483648 ; 0x80000000
+ 8000b18: 4770 bxlt lr
+ 8000b1a: f441 1180 orr.w r1, r1, #1048576 ; 0x100000
+ 8000b1e: ea4f 5252 mov.w r2, r2, lsr #21
+ 8000b22: f1c2 0218 rsb r2, r2, #24
+ 8000b26: f1c2 0c20 rsb ip, r2, #32
+ 8000b2a: fa10 f30c lsls.w r3, r0, ip
+ 8000b2e: fa20 f002 lsr.w r0, r0, r2
+ 8000b32: bf18 it ne
+ 8000b34: f040 0001 orrne.w r0, r0, #1
+ 8000b38: ea4f 23c1 mov.w r3, r1, lsl #11
+ 8000b3c: ea4f 23d3 mov.w r3, r3, lsr #11
+ 8000b40: fa03 fc0c lsl.w ip, r3, ip
+ 8000b44: ea40 000c orr.w r0, r0, ip
+ 8000b48: fa23 f302 lsr.w r3, r3, r2
+ 8000b4c: ea4f 0343 mov.w r3, r3, lsl #1
+ 8000b50: e7cc b.n 8000aec <__aeabi_d2f+0x14>
+ 8000b52: ea7f 5362 mvns.w r3, r2, asr #21
+ 8000b56: d107 bne.n 8000b68 <__aeabi_d2f+0x90>
+ 8000b58: ea50 3301 orrs.w r3, r0, r1, lsl #12
+ 8000b5c: bf1e ittt ne
+ 8000b5e: f04f 40fe movne.w r0, #2130706432 ; 0x7f000000
+ 8000b62: f440 0040 orrne.w r0, r0, #12582912 ; 0xc00000
+ 8000b66: 4770 bxne lr
+ 8000b68: f001 4000 and.w r0, r1, #2147483648 ; 0x80000000
+ 8000b6c: f040 40fe orr.w r0, r0, #2130706432 ; 0x7f000000
+ 8000b70: f440 0000 orr.w r0, r0, #8388608 ; 0x800000
+ 8000b74: 4770 bx lr
+ 8000b76: bf00 nop
+
+08000b78 <__aeabi_frsub>:
+ 8000b78: f080 4000 eor.w r0, r0, #2147483648 ; 0x80000000
+ 8000b7c: e002 b.n 8000b84 <__addsf3>
+ 8000b7e: bf00 nop
+
+08000b80 <__aeabi_fsub>:
+ 8000b80: f081 4100 eor.w r1, r1, #2147483648 ; 0x80000000
+
+08000b84 <__addsf3>:
+ 8000b84: 0042 lsls r2, r0, #1
+ 8000b86: bf1f itttt ne
+ 8000b88: ea5f 0341 movsne.w r3, r1, lsl #1
+ 8000b8c: ea92 0f03 teqne r2, r3
+ 8000b90: ea7f 6c22 mvnsne.w ip, r2, asr #24
+ 8000b94: ea7f 6c23 mvnsne.w ip, r3, asr #24
+ 8000b98: d06a beq.n 8000c70 <__addsf3+0xec>
+ 8000b9a: ea4f 6212 mov.w r2, r2, lsr #24
+ 8000b9e: ebd2 6313 rsbs r3, r2, r3, lsr #24
+ 8000ba2: bfc1 itttt gt
+ 8000ba4: 18d2 addgt r2, r2, r3
+ 8000ba6: 4041 eorgt r1, r0
+ 8000ba8: 4048 eorgt r0, r1
+ 8000baa: 4041 eorgt r1, r0
+ 8000bac: bfb8 it lt
+ 8000bae: 425b neglt r3, r3
+ 8000bb0: 2b19 cmp r3, #25
+ 8000bb2: bf88 it hi
+ 8000bb4: 4770 bxhi lr
+ 8000bb6: f010 4f00 tst.w r0, #2147483648 ; 0x80000000
+ 8000bba: f440 0000 orr.w r0, r0, #8388608 ; 0x800000
+ 8000bbe: f020 407f bic.w r0, r0, #4278190080 ; 0xff000000
+ 8000bc2: bf18 it ne
+ 8000bc4: 4240 negne r0, r0
+ 8000bc6: f011 4f00 tst.w r1, #2147483648 ; 0x80000000
+ 8000bca: f441 0100 orr.w r1, r1, #8388608 ; 0x800000
+ 8000bce: f021 417f bic.w r1, r1, #4278190080 ; 0xff000000
+ 8000bd2: bf18 it ne
+ 8000bd4: 4249 negne r1, r1
+ 8000bd6: ea92 0f03 teq r2, r3
+ 8000bda: d03f beq.n 8000c5c <__addsf3+0xd8>
+ 8000bdc: f1a2 0201 sub.w r2, r2, #1
+ 8000be0: fa41 fc03 asr.w ip, r1, r3
+ 8000be4: eb10 000c adds.w r0, r0, ip
+ 8000be8: f1c3 0320 rsb r3, r3, #32
+ 8000bec: fa01 f103 lsl.w r1, r1, r3
+ 8000bf0: f000 4300 and.w r3, r0, #2147483648 ; 0x80000000
+ 8000bf4: d502 bpl.n 8000bfc <__addsf3+0x78>
+ 8000bf6: 4249 negs r1, r1
+ 8000bf8: eb60 0040 sbc.w r0, r0, r0, lsl #1
+ 8000bfc: f5b0 0f00 cmp.w r0, #8388608 ; 0x800000
+ 8000c00: d313 bcc.n 8000c2a <__addsf3+0xa6>
+ 8000c02: f1b0 7f80 cmp.w r0, #16777216 ; 0x1000000
+ 8000c06: d306 bcc.n 8000c16 <__addsf3+0x92>
+ 8000c08: 0840 lsrs r0, r0, #1
+ 8000c0a: ea4f 0131 mov.w r1, r1, rrx
+ 8000c0e: f102 0201 add.w r2, r2, #1
+ 8000c12: 2afe cmp r2, #254 ; 0xfe
+ 8000c14: d251 bcs.n 8000cba <__addsf3+0x136>
+ 8000c16: f1b1 4f00 cmp.w r1, #2147483648 ; 0x80000000
+ 8000c1a: eb40 50c2 adc.w r0, r0, r2, lsl #23
+ 8000c1e: bf08 it eq
+ 8000c20: f020 0001 biceq.w r0, r0, #1
+ 8000c24: ea40 0003 orr.w r0, r0, r3
+ 8000c28: 4770 bx lr
+ 8000c2a: 0049 lsls r1, r1, #1
+ 8000c2c: eb40 0000 adc.w r0, r0, r0
+ 8000c30: f410 0f00 tst.w r0, #8388608 ; 0x800000
+ 8000c34: f1a2 0201 sub.w r2, r2, #1
+ 8000c38: d1ed bne.n 8000c16 <__addsf3+0x92>
+ 8000c3a: fab0 fc80 clz ip, r0
+ 8000c3e: f1ac 0c08 sub.w ip, ip, #8
+ 8000c42: ebb2 020c subs.w r2, r2, ip
+ 8000c46: fa00 f00c lsl.w r0, r0, ip
+ 8000c4a: bfaa itet ge
+ 8000c4c: eb00 50c2 addge.w r0, r0, r2, lsl #23
+ 8000c50: 4252 neglt r2, r2
+ 8000c52: 4318 orrge r0, r3
+ 8000c54: bfbc itt lt
+ 8000c56: 40d0 lsrlt r0, r2
+ 8000c58: 4318 orrlt r0, r3
+ 8000c5a: 4770 bx lr
+ 8000c5c: f092 0f00 teq r2, #0
+ 8000c60: f481 0100 eor.w r1, r1, #8388608 ; 0x800000
+ 8000c64: bf06 itte eq
+ 8000c66: f480 0000 eoreq.w r0, r0, #8388608 ; 0x800000
+ 8000c6a: 3201 addeq r2, #1
+ 8000c6c: 3b01 subne r3, #1
+ 8000c6e: e7b5 b.n 8000bdc <__addsf3+0x58>
+ 8000c70: ea4f 0341 mov.w r3, r1, lsl #1
+ 8000c74: ea7f 6c22 mvns.w ip, r2, asr #24
+ 8000c78: bf18 it ne
+ 8000c7a: ea7f 6c23 mvnsne.w ip, r3, asr #24
+ 8000c7e: d021 beq.n 8000cc4 <__addsf3+0x140>
+ 8000c80: ea92 0f03 teq r2, r3
+ 8000c84: d004 beq.n 8000c90 <__addsf3+0x10c>
+ 8000c86: f092 0f00 teq r2, #0
+ 8000c8a: bf08 it eq
+ 8000c8c: 4608 moveq r0, r1
+ 8000c8e: 4770 bx lr
+ 8000c90: ea90 0f01 teq r0, r1
+ 8000c94: bf1c itt ne
+ 8000c96: 2000 movne r0, #0
+ 8000c98: 4770 bxne lr
+ 8000c9a: f012 4f7f tst.w r2, #4278190080 ; 0xff000000
+ 8000c9e: d104 bne.n 8000caa <__addsf3+0x126>
+ 8000ca0: 0040 lsls r0, r0, #1
+ 8000ca2: bf28 it cs
+ 8000ca4: f040 4000 orrcs.w r0, r0, #2147483648 ; 0x80000000
+ 8000ca8: 4770 bx lr
+ 8000caa: f112 7200 adds.w r2, r2, #33554432 ; 0x2000000
+ 8000cae: bf3c itt cc
+ 8000cb0: f500 0000 addcc.w r0, r0, #8388608 ; 0x800000
+ 8000cb4: 4770 bxcc lr
+ 8000cb6: f000 4300 and.w r3, r0, #2147483648 ; 0x80000000
+ 8000cba: f043 40fe orr.w r0, r3, #2130706432 ; 0x7f000000
+ 8000cbe: f440 0000 orr.w r0, r0, #8388608 ; 0x800000
+ 8000cc2: 4770 bx lr
+ 8000cc4: ea7f 6222 mvns.w r2, r2, asr #24
+ 8000cc8: bf16 itet ne
+ 8000cca: 4608 movne r0, r1
+ 8000ccc: ea7f 6323 mvnseq.w r3, r3, asr #24
+ 8000cd0: 4601 movne r1, r0
+ 8000cd2: 0242 lsls r2, r0, #9
+ 8000cd4: bf06 itte eq
+ 8000cd6: ea5f 2341 movseq.w r3, r1, lsl #9
+ 8000cda: ea90 0f01 teqeq r0, r1
+ 8000cde: f440 0080 orrne.w r0, r0, #4194304 ; 0x400000
+ 8000ce2: 4770 bx lr
+
+08000ce4 <__aeabi_ui2f>:
+ 8000ce4: f04f 0300 mov.w r3, #0
+ 8000ce8: e004 b.n 8000cf4 <__aeabi_i2f+0x8>
+ 8000cea: bf00 nop
+
+08000cec <__aeabi_i2f>:
+ 8000cec: f010 4300 ands.w r3, r0, #2147483648 ; 0x80000000
+ 8000cf0: bf48 it mi
+ 8000cf2: 4240 negmi r0, r0
+ 8000cf4: ea5f 0c00 movs.w ip, r0
+ 8000cf8: bf08 it eq
+ 8000cfa: 4770 bxeq lr
+ 8000cfc: f043 4396 orr.w r3, r3, #1258291200 ; 0x4b000000
+ 8000d00: 4601 mov r1, r0
+ 8000d02: f04f 0000 mov.w r0, #0
+ 8000d06: e01c b.n 8000d42 <__aeabi_l2f+0x2a>
+
+08000d08 <__aeabi_ul2f>:
+ 8000d08: ea50 0201 orrs.w r2, r0, r1
+ 8000d0c: bf08 it eq
+ 8000d0e: 4770 bxeq lr
+ 8000d10: f04f 0300 mov.w r3, #0
+ 8000d14: e00a b.n 8000d2c <__aeabi_l2f+0x14>
+ 8000d16: bf00 nop
+
+08000d18 <__aeabi_l2f>:
+ 8000d18: ea50 0201 orrs.w r2, r0, r1
+ 8000d1c: bf08 it eq
+ 8000d1e: 4770 bxeq lr
+ 8000d20: f011 4300 ands.w r3, r1, #2147483648 ; 0x80000000
+ 8000d24: d502 bpl.n 8000d2c <__aeabi_l2f+0x14>
+ 8000d26: 4240 negs r0, r0
+ 8000d28: eb61 0141 sbc.w r1, r1, r1, lsl #1
+ 8000d2c: ea5f 0c01 movs.w ip, r1
+ 8000d30: bf02 ittt eq
+ 8000d32: 4684 moveq ip, r0
+ 8000d34: 4601 moveq r1, r0
+ 8000d36: 2000 moveq r0, #0
+ 8000d38: f043 43b6 orr.w r3, r3, #1526726656 ; 0x5b000000
+ 8000d3c: bf08 it eq
+ 8000d3e: f1a3 5380 subeq.w r3, r3, #268435456 ; 0x10000000
+ 8000d42: f5a3 0300 sub.w r3, r3, #8388608 ; 0x800000
+ 8000d46: fabc f28c clz r2, ip
+ 8000d4a: 3a08 subs r2, #8
+ 8000d4c: eba3 53c2 sub.w r3, r3, r2, lsl #23
+ 8000d50: db10 blt.n 8000d74 <__aeabi_l2f+0x5c>
+ 8000d52: fa01 fc02 lsl.w ip, r1, r2
+ 8000d56: 4463 add r3, ip
+ 8000d58: fa00 fc02 lsl.w ip, r0, r2
+ 8000d5c: f1c2 0220 rsb r2, r2, #32
+ 8000d60: f1bc 4f00 cmp.w ip, #2147483648 ; 0x80000000
+ 8000d64: fa20 f202 lsr.w r2, r0, r2
+ 8000d68: eb43 0002 adc.w r0, r3, r2
+ 8000d6c: bf08 it eq
+ 8000d6e: f020 0001 biceq.w r0, r0, #1
+ 8000d72: 4770 bx lr
+ 8000d74: f102 0220 add.w r2, r2, #32
+ 8000d78: fa01 fc02 lsl.w ip, r1, r2
+ 8000d7c: f1c2 0220 rsb r2, r2, #32
+ 8000d80: ea50 004c orrs.w r0, r0, ip, lsl #1
+ 8000d84: fa21 f202 lsr.w r2, r1, r2
+ 8000d88: eb43 0002 adc.w r0, r3, r2
+ 8000d8c: bf08 it eq
+ 8000d8e: ea20 70dc biceq.w r0, r0, ip, lsr #31
+ 8000d92: 4770 bx lr
+
+08000d94 <__aeabi_fmul>:
+ 8000d94: f04f 0cff mov.w ip, #255 ; 0xff
+ 8000d98: ea1c 52d0 ands.w r2, ip, r0, lsr #23
+ 8000d9c: bf1e ittt ne
+ 8000d9e: ea1c 53d1 andsne.w r3, ip, r1, lsr #23
+ 8000da2: ea92 0f0c teqne r2, ip
+ 8000da6: ea93 0f0c teqne r3, ip
+ 8000daa: d06f beq.n 8000e8c <__aeabi_fmul+0xf8>
+ 8000dac: 441a add r2, r3
+ 8000dae: ea80 0c01 eor.w ip, r0, r1
+ 8000db2: 0240 lsls r0, r0, #9
+ 8000db4: bf18 it ne
+ 8000db6: ea5f 2141 movsne.w r1, r1, lsl #9
+ 8000dba: d01e beq.n 8000dfa <__aeabi_fmul+0x66>
+ 8000dbc: f04f 6300 mov.w r3, #134217728 ; 0x8000000
+ 8000dc0: ea43 1050 orr.w r0, r3, r0, lsr #5
+ 8000dc4: ea43 1151 orr.w r1, r3, r1, lsr #5
+ 8000dc8: fba0 3101 umull r3, r1, r0, r1
+ 8000dcc: f00c 4000 and.w r0, ip, #2147483648 ; 0x80000000
+ 8000dd0: f5b1 0f00 cmp.w r1, #8388608 ; 0x800000
+ 8000dd4: bf3e ittt cc
+ 8000dd6: 0049 lslcc r1, r1, #1
+ 8000dd8: ea41 71d3 orrcc.w r1, r1, r3, lsr #31
+ 8000ddc: 005b lslcc r3, r3, #1
+ 8000dde: ea40 0001 orr.w r0, r0, r1
+ 8000de2: f162 027f sbc.w r2, r2, #127 ; 0x7f
+ 8000de6: 2afd cmp r2, #253 ; 0xfd
+ 8000de8: d81d bhi.n 8000e26 <__aeabi_fmul+0x92>
+ 8000dea: f1b3 4f00 cmp.w r3, #2147483648 ; 0x80000000
+ 8000dee: eb40 50c2 adc.w r0, r0, r2, lsl #23
+ 8000df2: bf08 it eq
+ 8000df4: f020 0001 biceq.w r0, r0, #1
+ 8000df8: 4770 bx lr
+ 8000dfa: f090 0f00 teq r0, #0
+ 8000dfe: f00c 4c00 and.w ip, ip, #2147483648 ; 0x80000000
+ 8000e02: bf08 it eq
+ 8000e04: 0249 lsleq r1, r1, #9
+ 8000e06: ea4c 2050 orr.w r0, ip, r0, lsr #9
+ 8000e0a: ea40 2051 orr.w r0, r0, r1, lsr #9
+ 8000e0e: 3a7f subs r2, #127 ; 0x7f
+ 8000e10: bfc2 ittt gt
+ 8000e12: f1d2 03ff rsbsgt r3, r2, #255 ; 0xff
+ 8000e16: ea40 50c2 orrgt.w r0, r0, r2, lsl #23
+ 8000e1a: 4770 bxgt lr
+ 8000e1c: f440 0000 orr.w r0, r0, #8388608 ; 0x800000
+ 8000e20: f04f 0300 mov.w r3, #0
+ 8000e24: 3a01 subs r2, #1
+ 8000e26: dc5d bgt.n 8000ee4 <__aeabi_fmul+0x150>
+ 8000e28: f112 0f19 cmn.w r2, #25
+ 8000e2c: bfdc itt le
+ 8000e2e: f000 4000 andle.w r0, r0, #2147483648 ; 0x80000000
+ 8000e32: 4770 bxle lr
+ 8000e34: f1c2 0200 rsb r2, r2, #0
+ 8000e38: 0041 lsls r1, r0, #1
+ 8000e3a: fa21 f102 lsr.w r1, r1, r2
+ 8000e3e: f1c2 0220 rsb r2, r2, #32
+ 8000e42: fa00 fc02 lsl.w ip, r0, r2
+ 8000e46: ea5f 0031 movs.w r0, r1, rrx
+ 8000e4a: f140 0000 adc.w r0, r0, #0
+ 8000e4e: ea53 034c orrs.w r3, r3, ip, lsl #1
+ 8000e52: bf08 it eq
+ 8000e54: ea20 70dc biceq.w r0, r0, ip, lsr #31
+ 8000e58: 4770 bx lr
+ 8000e5a: f092 0f00 teq r2, #0
+ 8000e5e: f000 4c00 and.w ip, r0, #2147483648 ; 0x80000000
+ 8000e62: bf02 ittt eq
+ 8000e64: 0040 lsleq r0, r0, #1
+ 8000e66: f410 0f00 tsteq.w r0, #8388608 ; 0x800000
+ 8000e6a: 3a01 subeq r2, #1
+ 8000e6c: d0f9 beq.n 8000e62 <__aeabi_fmul+0xce>
+ 8000e6e: ea40 000c orr.w r0, r0, ip
+ 8000e72: f093 0f00 teq r3, #0
+ 8000e76: f001 4c00 and.w ip, r1, #2147483648 ; 0x80000000
+ 8000e7a: bf02 ittt eq
+ 8000e7c: 0049 lsleq r1, r1, #1
+ 8000e7e: f411 0f00 tsteq.w r1, #8388608 ; 0x800000
+ 8000e82: 3b01 subeq r3, #1
+ 8000e84: d0f9 beq.n 8000e7a <__aeabi_fmul+0xe6>
+ 8000e86: ea41 010c orr.w r1, r1, ip
+ 8000e8a: e78f b.n 8000dac <__aeabi_fmul+0x18>
+ 8000e8c: ea0c 53d1 and.w r3, ip, r1, lsr #23
+ 8000e90: ea92 0f0c teq r2, ip
+ 8000e94: bf18 it ne
+ 8000e96: ea93 0f0c teqne r3, ip
+ 8000e9a: d00a beq.n 8000eb2 <__aeabi_fmul+0x11e>
+ 8000e9c: f030 4c00 bics.w ip, r0, #2147483648 ; 0x80000000
+ 8000ea0: bf18 it ne
+ 8000ea2: f031 4c00 bicsne.w ip, r1, #2147483648 ; 0x80000000
+ 8000ea6: d1d8 bne.n 8000e5a <__aeabi_fmul+0xc6>
+ 8000ea8: ea80 0001 eor.w r0, r0, r1
+ 8000eac: f000 4000 and.w r0, r0, #2147483648 ; 0x80000000
+ 8000eb0: 4770 bx lr
+ 8000eb2: f090 0f00 teq r0, #0
+ 8000eb6: bf17 itett ne
+ 8000eb8: f090 4f00 teqne r0, #2147483648 ; 0x80000000
+ 8000ebc: 4608 moveq r0, r1
+ 8000ebe: f091 0f00 teqne r1, #0
+ 8000ec2: f091 4f00 teqne r1, #2147483648 ; 0x80000000
+ 8000ec6: d014 beq.n 8000ef2 <__aeabi_fmul+0x15e>
+ 8000ec8: ea92 0f0c teq r2, ip
+ 8000ecc: d101 bne.n 8000ed2 <__aeabi_fmul+0x13e>
+ 8000ece: 0242 lsls r2, r0, #9
+ 8000ed0: d10f bne.n 8000ef2 <__aeabi_fmul+0x15e>
+ 8000ed2: ea93 0f0c teq r3, ip
+ 8000ed6: d103 bne.n 8000ee0 <__aeabi_fmul+0x14c>
+ 8000ed8: 024b lsls r3, r1, #9
+ 8000eda: bf18 it ne
+ 8000edc: 4608 movne r0, r1
+ 8000ede: d108 bne.n 8000ef2 <__aeabi_fmul+0x15e>
+ 8000ee0: ea80 0001 eor.w r0, r0, r1
+ 8000ee4: f000 4000 and.w r0, r0, #2147483648 ; 0x80000000
+ 8000ee8: f040 40fe orr.w r0, r0, #2130706432 ; 0x7f000000
+ 8000eec: f440 0000 orr.w r0, r0, #8388608 ; 0x800000
+ 8000ef0: 4770 bx lr
+ 8000ef2: f040 40fe orr.w r0, r0, #2130706432 ; 0x7f000000
+ 8000ef6: f440 0040 orr.w r0, r0, #12582912 ; 0xc00000
+ 8000efa: 4770 bx lr
+
+08000efc <__aeabi_fdiv>:
+ 8000efc: f04f 0cff mov.w ip, #255 ; 0xff
+ 8000f00: ea1c 52d0 ands.w r2, ip, r0, lsr #23
+ 8000f04: bf1e ittt ne
+ 8000f06: ea1c 53d1 andsne.w r3, ip, r1, lsr #23
+ 8000f0a: ea92 0f0c teqne r2, ip
+ 8000f0e: ea93 0f0c teqne r3, ip
+ 8000f12: d069 beq.n 8000fe8 <__aeabi_fdiv+0xec>
+ 8000f14: eba2 0203 sub.w r2, r2, r3
+ 8000f18: ea80 0c01 eor.w ip, r0, r1
+ 8000f1c: 0249 lsls r1, r1, #9
+ 8000f1e: ea4f 2040 mov.w r0, r0, lsl #9
+ 8000f22: d037 beq.n 8000f94 <__aeabi_fdiv+0x98>
+ 8000f24: f04f 5380 mov.w r3, #268435456 ; 0x10000000
+ 8000f28: ea43 1111 orr.w r1, r3, r1, lsr #4
+ 8000f2c: ea43 1310 orr.w r3, r3, r0, lsr #4
+ 8000f30: f00c 4000 and.w r0, ip, #2147483648 ; 0x80000000
+ 8000f34: 428b cmp r3, r1
+ 8000f36: bf38 it cc
+ 8000f38: 005b lslcc r3, r3, #1
+ 8000f3a: f142 027d adc.w r2, r2, #125 ; 0x7d
+ 8000f3e: f44f 0c00 mov.w ip, #8388608 ; 0x800000
+ 8000f42: 428b cmp r3, r1
+ 8000f44: bf24 itt cs
+ 8000f46: 1a5b subcs r3, r3, r1
+ 8000f48: ea40 000c orrcs.w r0, r0, ip
+ 8000f4c: ebb3 0f51 cmp.w r3, r1, lsr #1
+ 8000f50: bf24 itt cs
+ 8000f52: eba3 0351 subcs.w r3, r3, r1, lsr #1
+ 8000f56: ea40 005c orrcs.w r0, r0, ip, lsr #1
+ 8000f5a: ebb3 0f91 cmp.w r3, r1, lsr #2
+ 8000f5e: bf24 itt cs
+ 8000f60: eba3 0391 subcs.w r3, r3, r1, lsr #2
+ 8000f64: ea40 009c orrcs.w r0, r0, ip, lsr #2
+ 8000f68: ebb3 0fd1 cmp.w r3, r1, lsr #3
+ 8000f6c: bf24 itt cs
+ 8000f6e: eba3 03d1 subcs.w r3, r3, r1, lsr #3
+ 8000f72: ea40 00dc orrcs.w r0, r0, ip, lsr #3
+ 8000f76: 011b lsls r3, r3, #4
+ 8000f78: bf18 it ne
+ 8000f7a: ea5f 1c1c movsne.w ip, ip, lsr #4
+ 8000f7e: d1e0 bne.n 8000f42 <__aeabi_fdiv+0x46>
+ 8000f80: 2afd cmp r2, #253 ; 0xfd
+ 8000f82: f63f af50 bhi.w 8000e26 <__aeabi_fmul+0x92>
+ 8000f86: 428b cmp r3, r1
+ 8000f88: eb40 50c2 adc.w r0, r0, r2, lsl #23
+ 8000f8c: bf08 it eq
+ 8000f8e: f020 0001 biceq.w r0, r0, #1
+ 8000f92: 4770 bx lr
+ 8000f94: f00c 4c00 and.w ip, ip, #2147483648 ; 0x80000000
+ 8000f98: ea4c 2050 orr.w r0, ip, r0, lsr #9
+ 8000f9c: 327f adds r2, #127 ; 0x7f
+ 8000f9e: bfc2 ittt gt
+ 8000fa0: f1d2 03ff rsbsgt r3, r2, #255 ; 0xff
+ 8000fa4: ea40 50c2 orrgt.w r0, r0, r2, lsl #23
+ 8000fa8: 4770 bxgt lr
+ 8000faa: f440 0000 orr.w r0, r0, #8388608 ; 0x800000
+ 8000fae: f04f 0300 mov.w r3, #0
+ 8000fb2: 3a01 subs r2, #1
+ 8000fb4: e737 b.n 8000e26 <__aeabi_fmul+0x92>
+ 8000fb6: f092 0f00 teq r2, #0
+ 8000fba: f000 4c00 and.w ip, r0, #2147483648 ; 0x80000000
+ 8000fbe: bf02 ittt eq
+ 8000fc0: 0040 lsleq r0, r0, #1
+ 8000fc2: f410 0f00 tsteq.w r0, #8388608 ; 0x800000
+ 8000fc6: 3a01 subeq r2, #1
+ 8000fc8: d0f9 beq.n 8000fbe <__aeabi_fdiv+0xc2>
+ 8000fca: ea40 000c orr.w r0, r0, ip
+ 8000fce: f093 0f00 teq r3, #0
+ 8000fd2: f001 4c00 and.w ip, r1, #2147483648 ; 0x80000000
+ 8000fd6: bf02 ittt eq
+ 8000fd8: 0049 lsleq r1, r1, #1
+ 8000fda: f411 0f00 tsteq.w r1, #8388608 ; 0x800000
+ 8000fde: 3b01 subeq r3, #1
+ 8000fe0: d0f9 beq.n 8000fd6 <__aeabi_fdiv+0xda>
+ 8000fe2: ea41 010c orr.w r1, r1, ip
+ 8000fe6: e795 b.n 8000f14 <__aeabi_fdiv+0x18>
+ 8000fe8: ea0c 53d1 and.w r3, ip, r1, lsr #23
+ 8000fec: ea92 0f0c teq r2, ip
+ 8000ff0: d108 bne.n 8001004 <__aeabi_fdiv+0x108>
+ 8000ff2: 0242 lsls r2, r0, #9
+ 8000ff4: f47f af7d bne.w 8000ef2 <__aeabi_fmul+0x15e>
+ 8000ff8: ea93 0f0c teq r3, ip
+ 8000ffc: f47f af70 bne.w 8000ee0 <__aeabi_fmul+0x14c>
+ 8001000: 4608 mov r0, r1
+ 8001002: e776 b.n 8000ef2 <__aeabi_fmul+0x15e>
+ 8001004: ea93 0f0c teq r3, ip
+ 8001008: d104 bne.n 8001014 <__aeabi_fdiv+0x118>
+ 800100a: 024b lsls r3, r1, #9
+ 800100c: f43f af4c beq.w 8000ea8 <__aeabi_fmul+0x114>
+ 8001010: 4608 mov r0, r1
+ 8001012: e76e b.n 8000ef2 <__aeabi_fmul+0x15e>
+ 8001014: f030 4c00 bics.w ip, r0, #2147483648 ; 0x80000000
+ 8001018: bf18 it ne
+ 800101a: f031 4c00 bicsne.w ip, r1, #2147483648 ; 0x80000000
+ 800101e: d1ca bne.n 8000fb6 <__aeabi_fdiv+0xba>
+ 8001020: f030 4200 bics.w r2, r0, #2147483648 ; 0x80000000
+ 8001024: f47f af5c bne.w 8000ee0 <__aeabi_fmul+0x14c>
+ 8001028: f031 4300 bics.w r3, r1, #2147483648 ; 0x80000000
+ 800102c: f47f af3c bne.w 8000ea8 <__aeabi_fmul+0x114>
+ 8001030: e75f b.n 8000ef2 <__aeabi_fmul+0x15e>
+ 8001032: bf00 nop
+
+08001034 <__gesf2>:
+ 8001034: f04f 3cff mov.w ip, #4294967295
+ 8001038: e006 b.n 8001048 <__cmpsf2+0x4>
+ 800103a: bf00 nop
+
+0800103c <__lesf2>:
+ 800103c: f04f 0c01 mov.w ip, #1
+ 8001040: e002 b.n 8001048 <__cmpsf2+0x4>
+ 8001042: bf00 nop
+
+08001044 <__cmpsf2>:
+ 8001044: f04f 0c01 mov.w ip, #1
+ 8001048: f84d cd04 str.w ip, [sp, #-4]!
+ 800104c: ea4f 0240 mov.w r2, r0, lsl #1
+ 8001050: ea4f 0341 mov.w r3, r1, lsl #1
+ 8001054: ea7f 6c22 mvns.w ip, r2, asr #24
+ 8001058: bf18 it ne
+ 800105a: ea7f 6c23 mvnsne.w ip, r3, asr #24
+ 800105e: d011 beq.n 8001084 <__cmpsf2+0x40>
+ 8001060: b001 add sp, #4
+ 8001062: ea52 0c53 orrs.w ip, r2, r3, lsr #1
+ 8001066: bf18 it ne
+ 8001068: ea90 0f01 teqne r0, r1
+ 800106c: bf58 it pl
+ 800106e: ebb2 0003 subspl.w r0, r2, r3
+ 8001072: bf88 it hi
+ 8001074: 17c8 asrhi r0, r1, #31
+ 8001076: bf38 it cc
+ 8001078: ea6f 70e1 mvncc.w r0, r1, asr #31
+ 800107c: bf18 it ne
+ 800107e: f040 0001 orrne.w r0, r0, #1
+ 8001082: 4770 bx lr
+ 8001084: ea7f 6c22 mvns.w ip, r2, asr #24
+ 8001088: d102 bne.n 8001090 <__cmpsf2+0x4c>
+ 800108a: ea5f 2c40 movs.w ip, r0, lsl #9
+ 800108e: d105 bne.n 800109c <__cmpsf2+0x58>
+ 8001090: ea7f 6c23 mvns.w ip, r3, asr #24
+ 8001094: d1e4 bne.n 8001060 <__cmpsf2+0x1c>
+ 8001096: ea5f 2c41 movs.w ip, r1, lsl #9
+ 800109a: d0e1 beq.n 8001060 <__cmpsf2+0x1c>
+ 800109c: f85d 0b04 ldr.w r0, [sp], #4
+ 80010a0: 4770 bx lr
+ 80010a2: bf00 nop
+
+080010a4 <__aeabi_cfrcmple>:
+ 80010a4: 4684 mov ip, r0
+ 80010a6: 4608 mov r0, r1
+ 80010a8: 4661 mov r1, ip
+ 80010aa: e7ff b.n 80010ac <__aeabi_cfcmpeq>
+
+080010ac <__aeabi_cfcmpeq>:
+ 80010ac: b50f push {r0, r1, r2, r3, lr}
+ 80010ae: f7ff ffc9 bl 8001044 <__cmpsf2>
+ 80010b2: 2800 cmp r0, #0
+ 80010b4: bf48 it mi
+ 80010b6: f110 0f00 cmnmi.w r0, #0
+ 80010ba: bd0f pop {r0, r1, r2, r3, pc}
+
+080010bc <__aeabi_fcmpeq>:
+ 80010bc: f84d ed08 str.w lr, [sp, #-8]!
+ 80010c0: f7ff fff4 bl 80010ac <__aeabi_cfcmpeq>
+ 80010c4: bf0c ite eq
+ 80010c6: 2001 moveq r0, #1
+ 80010c8: 2000 movne r0, #0
+ 80010ca: f85d fb08 ldr.w pc, [sp], #8
+ 80010ce: bf00 nop
+
+080010d0 <__aeabi_fcmplt>:
+ 80010d0: f84d ed08 str.w lr, [sp, #-8]!
+ 80010d4: f7ff ffea bl 80010ac <__aeabi_cfcmpeq>
+ 80010d8: bf34 ite cc
+ 80010da: 2001 movcc r0, #1
+ 80010dc: 2000 movcs r0, #0
+ 80010de: f85d fb08 ldr.w pc, [sp], #8
+ 80010e2: bf00 nop
+
+080010e4 <__aeabi_fcmple>:
+ 80010e4: f84d ed08 str.w lr, [sp, #-8]!
+ 80010e8: f7ff ffe0 bl 80010ac <__aeabi_cfcmpeq>
+ 80010ec: bf94 ite ls
+ 80010ee: 2001 movls r0, #1
+ 80010f0: 2000 movhi r0, #0
+ 80010f2: f85d fb08 ldr.w pc, [sp], #8
+ 80010f6: bf00 nop
+
+080010f8 <__aeabi_fcmpge>:
+ 80010f8: f84d ed08 str.w lr, [sp, #-8]!
+ 80010fc: f7ff ffd2 bl 80010a4 <__aeabi_cfrcmple>
+ 8001100: bf94 ite ls
+ 8001102: 2001 movls r0, #1
+ 8001104: 2000 movhi r0, #0
+ 8001106: f85d fb08 ldr.w pc, [sp], #8
+ 800110a: bf00 nop
+
+0800110c <__aeabi_fcmpgt>:
+ 800110c: f84d ed08 str.w lr, [sp, #-8]!
+ 8001110: f7ff ffc8 bl 80010a4 <__aeabi_cfrcmple>
+ 8001114: bf34 ite cc
+ 8001116: 2001 movcc r0, #1
+ 8001118: 2000 movcs r0, #0
+ 800111a: f85d fb08 ldr.w pc, [sp], #8
+ 800111e: bf00 nop
+
+08001120 <__aeabi_f2iz>:
+ 8001120: ea4f 0240 mov.w r2, r0, lsl #1
+ 8001124: f1b2 4ffe cmp.w r2, #2130706432 ; 0x7f000000
+ 8001128: d30f bcc.n 800114a <__aeabi_f2iz+0x2a>
+ 800112a: f04f 039e mov.w r3, #158 ; 0x9e
+ 800112e: ebb3 6212 subs.w r2, r3, r2, lsr #24
+ 8001132: d90d bls.n 8001150 <__aeabi_f2iz+0x30>
+ 8001134: ea4f 2300 mov.w r3, r0, lsl #8
+ 8001138: f043 4300 orr.w r3, r3, #2147483648 ; 0x80000000
+ 800113c: f010 4f00 tst.w r0, #2147483648 ; 0x80000000
+ 8001140: fa23 f002 lsr.w r0, r3, r2
+ 8001144: bf18 it ne
+ 8001146: 4240 negne r0, r0
+ 8001148: 4770 bx lr
+ 800114a: f04f 0000 mov.w r0, #0
+ 800114e: 4770 bx lr
+ 8001150: f112 0f61 cmn.w r2, #97 ; 0x61
+ 8001154: d101 bne.n 800115a <__aeabi_f2iz+0x3a>
+ 8001156: 0242 lsls r2, r0, #9
+ 8001158: d105 bne.n 8001166 <__aeabi_f2iz+0x46>
+ 800115a: f010 4000 ands.w r0, r0, #2147483648 ; 0x80000000
+ 800115e: bf08 it eq
+ 8001160: f06f 4000 mvneq.w r0, #2147483648 ; 0x80000000
+ 8001164: 4770 bx lr
+ 8001166: f04f 0000 mov.w r0, #0
+ 800116a: 4770 bx lr
+
+0800116c <__aeabi_f2uiz>:
+ 800116c: 0042 lsls r2, r0, #1
+ 800116e: d20e bcs.n 800118e <__aeabi_f2uiz+0x22>
+ 8001170: f1b2 4ffe cmp.w r2, #2130706432 ; 0x7f000000
+ 8001174: d30b bcc.n 800118e <__aeabi_f2uiz+0x22>
+ 8001176: f04f 039e mov.w r3, #158 ; 0x9e
+ 800117a: ebb3 6212 subs.w r2, r3, r2, lsr #24
+ 800117e: d409 bmi.n 8001194 <__aeabi_f2uiz+0x28>
+ 8001180: ea4f 2300 mov.w r3, r0, lsl #8
+ 8001184: f043 4300 orr.w r3, r3, #2147483648 ; 0x80000000
+ 8001188: fa23 f002 lsr.w r0, r3, r2
+ 800118c: 4770 bx lr
+ 800118e: f04f 0000 mov.w r0, #0
+ 8001192: 4770 bx lr
+ 8001194: f112 0f61 cmn.w r2, #97 ; 0x61
+ 8001198: d101 bne.n 800119e <__aeabi_f2uiz+0x32>
+ 800119a: 0242 lsls r2, r0, #9
+ 800119c: d102 bne.n 80011a4 <__aeabi_f2uiz+0x38>
+ 800119e: f04f 30ff mov.w r0, #4294967295
+ 80011a2: 4770 bx lr
+ 80011a4: f04f 0000 mov.w r0, #0
+ 80011a8: 4770 bx lr
+ 80011aa: bf00 nop
+
+080011ac :
+ * @note This function should be used only after reset.
+ * @param None
+ * @retval None
+ */
+void SystemInit (void)
+{
+ 80011ac: b580 push {r7, lr}
+ 80011ae: af00 add r7, sp, #0
+ /* Reset the RCC clock configuration to the default reset state(for debug purpose) */
+ /* Set HSION bit */
+ RCC->CR |= (uint32_t)0x00000001;
+ 80011b0: 4b15 ldr r3, [pc, #84] ; (8001208 )
+ 80011b2: 681b ldr r3, [r3, #0]
+ 80011b4: 4a14 ldr r2, [pc, #80] ; (8001208 )
+ 80011b6: f043 0301 orr.w r3, r3, #1
+ 80011ba: 6013 str r3, [r2, #0]
+
+ /* Reset SW, HPRE, PPRE1, PPRE2, ADCPRE and MCO bits */
+#ifndef STM32F10X_CL
+ RCC->CFGR &= (uint32_t)0xF8FF0000;
+ 80011bc: 4b12 ldr r3, [pc, #72] ; (8001208 )
+ 80011be: 685a ldr r2, [r3, #4]
+ 80011c0: 4911 ldr r1, [pc, #68] ; (8001208 )
+ 80011c2: 4b12 ldr r3, [pc, #72] ; (800120c )
+ 80011c4: 4013 ands r3, r2
+ 80011c6: 604b str r3, [r1, #4]
+#else
+ RCC->CFGR &= (uint32_t)0xF0FF0000;
+#endif /* STM32F10X_CL */
+
+ /* Reset HSEON, CSSON and PLLON bits */
+ RCC->CR &= (uint32_t)0xFEF6FFFF;
+ 80011c8: 4b0f ldr r3, [pc, #60] ; (8001208 )
+ 80011ca: 681b ldr r3, [r3, #0]
+ 80011cc: 4a0e ldr r2, [pc, #56] ; (8001208 )
+ 80011ce: f023 7384 bic.w r3, r3, #17301504 ; 0x1080000
+ 80011d2: f423 3380 bic.w r3, r3, #65536 ; 0x10000
+ 80011d6: 6013 str r3, [r2, #0]
+
+ /* Reset HSEBYP bit */
+ RCC->CR &= (uint32_t)0xFFFBFFFF;
+ 80011d8: 4b0b ldr r3, [pc, #44] ; (8001208 )
+ 80011da: 681b ldr r3, [r3, #0]
+ 80011dc: 4a0a ldr r2, [pc, #40] ; (8001208 )
+ 80011de: f423 2380 bic.w r3, r3, #262144 ; 0x40000
+ 80011e2: 6013 str r3, [r2, #0]
+
+ /* Reset PLLSRC, PLLXTPRE, PLLMUL and USBPRE/OTGFSPRE bits */
+ RCC->CFGR &= (uint32_t)0xFF80FFFF;
+ 80011e4: 4b08 ldr r3, [pc, #32] ; (8001208 )
+ 80011e6: 685b ldr r3, [r3, #4]
+ 80011e8: 4a07 ldr r2, [pc, #28] ; (8001208 )
+ 80011ea: f423 03fe bic.w r3, r3, #8323072 ; 0x7f0000
+ 80011ee: 6053 str r3, [r2, #4]
+
+ /* Reset CFGR2 register */
+ RCC->CFGR2 = 0x00000000;
+#else
+ /* Disable all interrupts and clear pending bits */
+ RCC->CIR = 0x009F0000;
+ 80011f0: 4b05 ldr r3, [pc, #20] ; (8001208 )
+ 80011f2: f44f 021f mov.w r2, #10420224 ; 0x9f0000
+ 80011f6: 609a str r2, [r3, #8]
+ #endif /* DATA_IN_ExtSRAM */
+#endif
+
+ /* Configure the System clock frequency, HCLK, PCLK2 and PCLK1 prescalers */
+ /* Configure the Flash Latency cycles and enable prefetch buffer */
+ SetSysClock();
+ 80011f8: f000 f80c bl 8001214
+
+#ifdef VECT_TAB_SRAM
+ SCB->VTOR = SRAM_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal SRAM. */
+#else
+ SCB->VTOR = FLASH_BASE | VECT_TAB_OFFSET; /* Vector Table Relocation in Internal FLASH. */
+ 80011fc: 4b04 ldr r3, [pc, #16] ; (8001210 )
+ 80011fe: f04f 6200 mov.w r2, #134217728 ; 0x8000000
+ 8001202: 609a str r2, [r3, #8]
+#endif
+}
+ 8001204: bf00 nop
+ 8001206: bd80 pop {r7, pc}
+ 8001208: 40021000 .word 0x40021000
+ 800120c: f8ff0000 .word 0xf8ff0000
+ 8001210: e000ed00 .word 0xe000ed00
+
+08001214 :
+ * @brief Configures the System clock frequency, HCLK, PCLK2 and PCLK1 prescalers.
+ * @param None
+ * @retval None
+ */
+static void SetSysClock(void)
+{
+ 8001214: b580 push {r7, lr}
+ 8001216: af00 add r7, sp, #0
+#elif defined SYSCLK_FREQ_48MHz
+ SetSysClockTo48();
+#elif defined SYSCLK_FREQ_56MHz
+ SetSysClockTo56();
+#elif defined SYSCLK_FREQ_72MHz
+ SetSysClockTo72();
+ 8001218: f000 f802 bl 8001220
+#endif
+
+ /* If none of the define above is enabled, the HSI is used as System clock
+ source (default after reset) */
+}
+ 800121c: bf00 nop
+ 800121e: bd80 pop {r7, pc}
+
+08001220 :
+ * @note This function should be used only after reset.
+ * @param None
+ * @retval None
+ */
+static void SetSysClockTo72(void)
+{
+ 8001220: b480 push {r7}
+ 8001222: b083 sub sp, #12
+ 8001224: af00 add r7, sp, #0
+ __IO uint32_t StartUpCounter = 0, HSEStatus = 0;
+ 8001226: 2300 movs r3, #0
+ 8001228: 607b str r3, [r7, #4]
+ 800122a: 2300 movs r3, #0
+ 800122c: 603b str r3, [r7, #0]
+
+ /* SYSCLK, HCLK, PCLK2 and PCLK1 configuration ---------------------------*/
+ /* Enable HSE */
+ RCC->CR |= ((uint32_t)RCC_CR_HSEON);
+ 800122e: 4b3a ldr r3, [pc, #232] ; (8001318 )
+ 8001230: 681b ldr r3, [r3, #0]
+ 8001232: 4a39 ldr r2, [pc, #228] ; (8001318 )
+ 8001234: f443 3380 orr.w r3, r3, #65536 ; 0x10000
+ 8001238: 6013 str r3, [r2, #0]
+
+ /* Wait till HSE is ready and if Time out is reached exit */
+ do
+ {
+ HSEStatus = RCC->CR & RCC_CR_HSERDY;
+ 800123a: 4b37 ldr r3, [pc, #220] ; (8001318 )
+ 800123c: 681b ldr r3, [r3, #0]
+ 800123e: f403 3300 and.w r3, r3, #131072 ; 0x20000
+ 8001242: 603b str r3, [r7, #0]
+ StartUpCounter++;
+ 8001244: 687b ldr r3, [r7, #4]
+ 8001246: 3301 adds r3, #1
+ 8001248: 607b str r3, [r7, #4]
+ } while((HSEStatus == 0) && (StartUpCounter != HSE_STARTUP_TIMEOUT));
+ 800124a: 683b ldr r3, [r7, #0]
+ 800124c: 2b00 cmp r3, #0
+ 800124e: d103 bne.n 8001258
+ 8001250: 687b ldr r3, [r7, #4]
+ 8001252: f5b3 6fa0 cmp.w r3, #1280 ; 0x500
+ 8001256: d1f0 bne.n 800123a
+
+ if ((RCC->CR & RCC_CR_HSERDY) != RESET)
+ 8001258: 4b2f ldr r3, [pc, #188] ; (8001318 )
+ 800125a: 681b ldr r3, [r3, #0]
+ 800125c: f403 3300 and.w r3, r3, #131072 ; 0x20000
+ 8001260: 2b00 cmp r3, #0
+ 8001262: d002 beq.n 800126a
+ {
+ HSEStatus = (uint32_t)0x01;
+ 8001264: 2301 movs r3, #1
+ 8001266: 603b str r3, [r7, #0]
+ 8001268: e001 b.n 800126e
+ }
+ else
+ {
+ HSEStatus = (uint32_t)0x00;
+ 800126a: 2300 movs r3, #0
+ 800126c: 603b str r3, [r7, #0]
+ }
+
+ if (HSEStatus == (uint32_t)0x01)
+ 800126e: 683b ldr r3, [r7, #0]
+ 8001270: 2b01 cmp r3, #1
+ 8001272: d14b bne.n 800130c
+ {
+ /* Enable Prefetch Buffer */
+ FLASH->ACR |= FLASH_ACR_PRFTBE;
+ 8001274: 4b29 ldr r3, [pc, #164] ; (800131c )
+ 8001276: 681b ldr r3, [r3, #0]
+ 8001278: 4a28 ldr r2, [pc, #160] ; (800131c )
+ 800127a: f043 0310 orr.w r3, r3, #16
+ 800127e: 6013 str r3, [r2, #0]
+
+ /* Flash 2 wait state */
+ FLASH->ACR &= (uint32_t)((uint32_t)~FLASH_ACR_LATENCY);
+ 8001280: 4b26 ldr r3, [pc, #152] ; (800131c )
+ 8001282: 681b ldr r3, [r3, #0]
+ 8001284: 4a25 ldr r2, [pc, #148] ; (800131c )
+ 8001286: f023 0303 bic.w r3, r3, #3
+ 800128a: 6013 str r3, [r2, #0]
+ FLASH->ACR |= (uint32_t)FLASH_ACR_LATENCY_2;
+ 800128c: 4b23 ldr r3, [pc, #140] ; (800131c )
+ 800128e: 681b ldr r3, [r3, #0]
+ 8001290: 4a22 ldr r2, [pc, #136] ; (800131c )
+ 8001292: f043 0302 orr.w r3, r3, #2
+ 8001296: 6013 str r3, [r2, #0]
+
+
+ /* HCLK = SYSCLK */
+ RCC->CFGR |= (uint32_t)RCC_CFGR_HPRE_DIV1;
+ 8001298: 4b1f ldr r3, [pc, #124] ; (8001318 )
+ 800129a: 4a1f ldr r2, [pc, #124] ; (8001318 )
+ 800129c: 685b ldr r3, [r3, #4]
+ 800129e: 6053 str r3, [r2, #4]
+
+ /* PCLK2 = HCLK */
+ RCC->CFGR |= (uint32_t)RCC_CFGR_PPRE2_DIV1;
+ 80012a0: 4b1d ldr r3, [pc, #116] ; (8001318 )
+ 80012a2: 4a1d ldr r2, [pc, #116] ; (8001318 )
+ 80012a4: 685b ldr r3, [r3, #4]
+ 80012a6: 6053 str r3, [r2, #4]
+
+ /* PCLK1 = HCLK */
+ RCC->CFGR |= (uint32_t)RCC_CFGR_PPRE1_DIV2;
+ 80012a8: 4b1b ldr r3, [pc, #108] ; (8001318 )
+ 80012aa: 685b ldr r3, [r3, #4]
+ 80012ac: 4a1a ldr r2, [pc, #104] ; (8001318 )
+ 80012ae: f443 6380 orr.w r3, r3, #1024 ; 0x400
+ 80012b2: 6053 str r3, [r2, #4]
+ RCC->CFGR &= (uint32_t)~(RCC_CFGR_PLLXTPRE | RCC_CFGR_PLLSRC | RCC_CFGR_PLLMULL);
+ RCC->CFGR |= (uint32_t)(RCC_CFGR_PLLXTPRE_PREDIV1 | RCC_CFGR_PLLSRC_PREDIV1 |
+ RCC_CFGR_PLLMULL9);
+#else
+ /* PLL configuration: PLLCLK = HSE * 9 = 72 MHz */
+ RCC->CFGR &= (uint32_t)((uint32_t)~(RCC_CFGR_PLLSRC | RCC_CFGR_PLLXTPRE |
+ 80012b4: 4b18 ldr r3, [pc, #96] ; (8001318 )
+ 80012b6: 685b ldr r3, [r3, #4]
+ 80012b8: 4a17 ldr r2, [pc, #92] ; (8001318 )
+ 80012ba: f423 137c bic.w r3, r3, #4128768 ; 0x3f0000
+ 80012be: 6053 str r3, [r2, #4]
+ RCC_CFGR_PLLMULL));
+ RCC->CFGR |= (uint32_t)(RCC_CFGR_PLLSRC_HSE | RCC_CFGR_PLLMULL9);
+ 80012c0: 4b15 ldr r3, [pc, #84] ; (8001318 )
+ 80012c2: 685b ldr r3, [r3, #4]
+ 80012c4: 4a14 ldr r2, [pc, #80] ; (8001318 )
+ 80012c6: f443 13e8 orr.w r3, r3, #1900544 ; 0x1d0000
+ 80012ca: 6053 str r3, [r2, #4]
+#endif /* STM32F10X_CL */
+
+ /* Enable PLL */
+ RCC->CR |= RCC_CR_PLLON;
+ 80012cc: 4b12 ldr r3, [pc, #72] ; (8001318 )
+ 80012ce: 681b ldr r3, [r3, #0]
+ 80012d0: 4a11 ldr r2, [pc, #68] ; (8001318 )
+ 80012d2: f043 7380 orr.w r3, r3, #16777216 ; 0x1000000
+ 80012d6: 6013 str r3, [r2, #0]
+
+ /* Wait till PLL is ready */
+ while((RCC->CR & RCC_CR_PLLRDY) == 0)
+ 80012d8: bf00 nop
+ 80012da: 4b0f ldr r3, [pc, #60] ; (8001318 )
+ 80012dc: 681b ldr r3, [r3, #0]
+ 80012de: f003 7300 and.w r3, r3, #33554432 ; 0x2000000
+ 80012e2: 2b00 cmp r3, #0
+ 80012e4: d0f9 beq.n 80012da
+ {
+ }
+
+ /* Select PLL as system clock source */
+ RCC->CFGR &= (uint32_t)((uint32_t)~(RCC_CFGR_SW));
+ 80012e6: 4b0c ldr r3, [pc, #48] ; (8001318 )
+ 80012e8: 685b ldr r3, [r3, #4]
+ 80012ea: 4a0b ldr r2, [pc, #44] ; (8001318 )
+ 80012ec: f023 0303 bic.w r3, r3, #3
+ 80012f0: 6053 str r3, [r2, #4]
+ RCC->CFGR |= (uint32_t)RCC_CFGR_SW_PLL;
+ 80012f2: 4b09 ldr r3, [pc, #36] ; (8001318 )
+ 80012f4: 685b ldr r3, [r3, #4]
+ 80012f6: 4a08 ldr r2, [pc, #32] ; (8001318 )
+ 80012f8: f043 0302 orr.w r3, r3, #2
+ 80012fc: 6053 str r3, [r2, #4]
+
+ /* Wait till PLL is used as system clock source */
+ while ((RCC->CFGR & (uint32_t)RCC_CFGR_SWS) != (uint32_t)0x08)
+ 80012fe: bf00 nop
+ 8001300: 4b05 ldr r3, [pc, #20] ; (8001318 )
+ 8001302: 685b ldr r3, [r3, #4]
+ 8001304: f003 030c and.w r3, r3, #12
+ 8001308: 2b08 cmp r3, #8
+ 800130a: d1f9 bne.n 8001300
+ }
+ else
+ { /* If HSE fails to start-up, the application will have wrong clock
+ configuration. User can add here some code to deal with this error */
+ }
+}
+ 800130c: bf00 nop
+ 800130e: 370c adds r7, #12
+ 8001310: 46bd mov sp, r7
+ 8001312: bc80 pop {r7}
+ 8001314: 4770 bx lr
+ 8001316: bf00 nop
+ 8001318: 40021000 .word 0x40021000
+ 800131c: 40022000 .word 0x40022000
+
+08001320 :
+
+
+
+//ADC Init
+void adc_init(void)
+{
+ 8001320: b580 push {r7, lr}
+ 8001322: af00 add r7, sp, #0
+ //ADC prescaller
+ RCC->CFGR &= ~RCC_CFGR_ADCPRE; //div by 8
+ 8001324: 4b20 ldr r3, [pc, #128] ; (80013a8 )
+ 8001326: 685b ldr r3, [r3, #4]
+ 8001328: 4a1f ldr r2, [pc, #124] ; (80013a8 )
+ 800132a: f423 4340 bic.w r3, r3, #49152 ; 0xc000
+ 800132e: 6053 str r3, [r2, #4]
+
+ //ADC clock on
+ RCC->APB2ENR |= RCC_APB2ENR_ADC1EN;
+ 8001330: 4b1d ldr r3, [pc, #116] ; (80013a8 )
+ 8001332: 699b ldr r3, [r3, #24]
+ 8001334: 4a1c ldr r2, [pc, #112] ; (80013a8 )
+ 8001336: f443 7300 orr.w r3, r3, #512 ; 0x200
+ 800133a: 6193 str r3, [r2, #24]
+
+ //Sample time
+ ADC1->SMPR2 |= ADC_SMPR2_SMP0_1; //13.5 cycles
+ 800133c: 4b1b ldr r3, [pc, #108] ; (80013ac )
+ 800133e: 691b ldr r3, [r3, #16]
+ 8001340: 4a1a ldr r2, [pc, #104] ; (80013ac )
+ 8001342: f043 0302 orr.w r3, r3, #2
+ 8001346: 6113 str r3, [r2, #16]
+
+ //Number of conversions in regular sequence
+ ADC1->SQR1 &= ~ADC_SQR1_L; //1 conversion
+ 8001348: 4b18 ldr r3, [pc, #96] ; (80013ac )
+ 800134a: 6adb ldr r3, [r3, #44] ; 0x2c
+ 800134c: 4a17 ldr r2, [pc, #92] ; (80013ac )
+ 800134e: f423 0370 bic.w r3, r3, #15728640 ; 0xf00000
+ 8001352: 62d3 str r3, [r2, #44] ; 0x2c
+
+ //First channel in regular sequence
+ ADC1->SQR3 &= ~ADC_SQR3_SQ1; //channel #0
+ 8001354: 4b15 ldr r3, [pc, #84] ; (80013ac )
+ 8001356: 6b5b ldr r3, [r3, #52] ; 0x34
+ 8001358: 4a14 ldr r2, [pc, #80] ; (80013ac )
+ 800135a: f023 031f bic.w r3, r3, #31
+ 800135e: 6353 str r3, [r2, #52] ; 0x34
+
+ //Extermal trigger enable for regular sequence
+ ADC1->CR2 |= ADC_CR2_EXTTRIG;
+ 8001360: 4b12 ldr r3, [pc, #72] ; (80013ac )
+ 8001362: 689b ldr r3, [r3, #8]
+ 8001364: 4a11 ldr r2, [pc, #68] ; (80013ac )
+ 8001366: f443 1380 orr.w r3, r3, #1048576 ; 0x100000
+ 800136a: 6093 str r3, [r2, #8]
+
+ //Event to start regular sequence
+ ADC1->CR2 |= ADC_CR2_EXTSEL; //start by software
+ 800136c: 4b0f ldr r3, [pc, #60] ; (80013ac )
+ 800136e: 689b ldr r3, [r3, #8]
+ 8001370: 4a0e ldr r2, [pc, #56] ; (80013ac )
+ 8001372: f443 2360 orr.w r3, r3, #917504 ; 0xe0000
+ 8001376: 6093 str r3, [r2, #8]
+
+ //ADC enable
+ ADC1->CR2 |= ADC_CR2_ADON;
+ 8001378: 4b0c ldr r3, [pc, #48] ; (80013ac )
+ 800137a: 689b ldr r3, [r3, #8]
+ 800137c: 4a0b ldr r2, [pc, #44] ; (80013ac )
+ 800137e: f043 0301 orr.w r3, r3, #1
+ 8001382: 6093 str r3, [r2, #8]
+
+ //Calibration
+ delay_cyc(100000);
+ 8001384: 480a ldr r0, [pc, #40] ; (80013b0 )
+ 8001386: f007 f84f bl 8008428
+ ADC1->CR2 |= ADC_CR2_CAL; //start cal
+ 800138a: 4b08 ldr r3, [pc, #32] ; (80013ac )
+ 800138c: 689b ldr r3, [r3, #8]
+ 800138e: 4a07 ldr r2, [pc, #28] ; (80013ac )
+ 8001390: f043 0304 orr.w r3, r3, #4
+ 8001394: 6093 str r3, [r2, #8]
+ while (ADC1->CR2 & ADC_CR2_CAL); //wait
+ 8001396: bf00 nop
+ 8001398: 4b04 ldr r3, [pc, #16] ; (80013ac )
+ 800139a: 689b ldr r3, [r3, #8]
+ 800139c: f003 0304 and.w r3, r3, #4
+ 80013a0: 2b00 cmp r3, #0
+ 80013a2: d1f9 bne.n 8001398
+}
+ 80013a4: bf00 nop
+ 80013a6: bd80 pop {r7, pc}
+ 80013a8: 40021000 .word 0x40021000
+ 80013ac: 40012400 .word 0x40012400
+ 80013b0: 000186a0 .word 0x000186a0
+ 80013b4: 00000000 .word 0x00000000
+
+080013b8 :
+
+
+
+//Get battery voltage
+uint8_t adc_get_bat_voltage(void)
+{
+ 80013b8: b580 push {r7, lr}
+ 80013ba: af00 add r7, sp, #0
+ bat_interval_counter++;
+ 80013bc: 4b4e ldr r3, [pc, #312] ; (80014f8 )
+ 80013be: 781b ldrb r3, [r3, #0]
+ 80013c0: 3301 adds r3, #1
+ 80013c2: b2da uxtb r2, r3
+ 80013c4: 4b4c ldr r3, [pc, #304] ; (80014f8 )
+ 80013c6: 701a strb r2, [r3, #0]
+
+ if (bat_interval_counter >= GET_BAT_VOLTAGE_INTERVAL)
+ 80013c8: 4b4b ldr r3, [pc, #300] ; (80014f8 )
+ 80013ca: 781b ldrb r3, [r3, #0]
+ 80013cc: 2b09 cmp r3, #9
+ 80013ce: d97e bls.n 80014ce
+ {
+ bat_interval_counter = 0;
+ 80013d0: 4b49 ldr r3, [pc, #292] ; (80014f8 )
+ 80013d2: 2200 movs r2, #0
+ 80013d4: 701a strb r2, [r3, #0]
+
+ bat_mon_on(); //Enable resistive divider and wait a bit
+ 80013d6: f000 fca9 bl 8001d2c
+ delay_cyc(100);
+ 80013da: 2064 movs r0, #100 ; 0x64
+ 80013dc: f007 f824 bl 8008428
+
+ //Start conversation
+ ADC1->CR2 |= ADC_CR2_SWSTART;
+ 80013e0: 4b46 ldr r3, [pc, #280] ; (80014fc )
+ 80013e2: 689b ldr r3, [r3, #8]
+ 80013e4: 4a45 ldr r2, [pc, #276] ; (80014fc )
+ 80013e6: f443 0380 orr.w r3, r3, #4194304 ; 0x400000
+ 80013ea: 6093 str r3, [r2, #8]
+
+ //Wait for conversation end
+ while (!(ADC1->SR & ADC_SR_EOC));
+ 80013ec: bf00 nop
+ 80013ee: 4b43 ldr r3, [pc, #268] ; (80014fc )
+ 80013f0: 681b ldr r3, [r3, #0]
+ 80013f2: f003 0302 and.w r3, r3, #2
+ 80013f6: 2b00 cmp r3, #0
+ 80013f8: d0f9 beq.n 80013ee
+
+ bat_mon_off(); //Disable resistive divider
+ 80013fa: f000 fca3 bl 8001d44
+
+ //Convert
+ bat_voltage = 2 * ((ADC1->DR * vref) / 4096); //x2 due to resistive voltage divider before ADC input
+ 80013fe: 4b3f ldr r3, [pc, #252] ; (80014fc )
+ 8001400: 6cdb ldr r3, [r3, #76] ; 0x4c
+ 8001402: 4618 mov r0, r3
+ 8001404: f7ff fc6e bl 8000ce4 <__aeabi_ui2f>
+ 8001408: 4602 mov r2, r0
+ 800140a: 4b3d ldr r3, [pc, #244] ; (8001500 )
+ 800140c: 4619 mov r1, r3
+ 800140e: 4610 mov r0, r2
+ 8001410: f7ff fcc0 bl 8000d94 <__aeabi_fmul>
+ 8001414: 4603 mov r3, r0
+ 8001416: f04f 418b mov.w r1, #1166016512 ; 0x45800000
+ 800141a: 4618 mov r0, r3
+ 800141c: f7ff fd6e bl 8000efc <__aeabi_fdiv>
+ 8001420: 4603 mov r3, r0
+ 8001422: 4619 mov r1, r3
+ 8001424: 4618 mov r0, r3
+ 8001426: f7ff fbad bl 8000b84 <__addsf3>
+ 800142a: 4603 mov r3, r0
+ 800142c: 461a mov r2, r3
+ 800142e: 4b35 ldr r3, [pc, #212] ; (8001504 )
+ 8001430: 601a str r2, [r3, #0]
+
+ //Refresh flags
+ if (bat_voltage > V_BATTERY_75_TO_100)
+ 8001432: 4b34 ldr r3, [pc, #208] ; (8001504 )
+ 8001434: 681b ldr r3, [r3, #0]
+ 8001436: 4618 mov r0, r3
+ 8001438: f7fe fffe bl 8000438 <__aeabi_f2d>
+ 800143c: a326 add r3, pc, #152 ; (adr r3, 80014d8 )
+ 800143e: e9d3 2300 ldrd r2, r3, [r3]
+ 8001442: f7ff fae1 bl 8000a08 <__aeabi_dcmpgt>
+ 8001446: 4603 mov r3, r0
+ 8001448: 2b00 cmp r3, #0
+ 800144a: d004 beq.n 8001456
+ {
+ set_device_flags(FLAGS_BATTERY, FLAG_BATTERY_75_TO_100);
+ 800144c: 2104 movs r1, #4
+ 800144e: 2001 movs r0, #1
+ 8001450: f001 f9b6 bl 80027c0
+ 8001454: e03b b.n 80014ce
+ }
+ else if (bat_voltage > V_BATTERY_50_TO_75)
+ 8001456: 4b2b ldr r3, [pc, #172] ; (8001504 )
+ 8001458: 681b ldr r3, [r3, #0]
+ 800145a: 4618 mov r0, r3
+ 800145c: f7fe ffec bl 8000438 <__aeabi_f2d>
+ 8001460: a31f add r3, pc, #124 ; (adr r3, 80014e0 )
+ 8001462: e9d3 2300 ldrd r2, r3, [r3]
+ 8001466: f7ff facf bl 8000a08 <__aeabi_dcmpgt>
+ 800146a: 4603 mov r3, r0
+ 800146c: 2b00 cmp r3, #0
+ 800146e: d004 beq.n 800147a
+ {
+ set_device_flags(FLAGS_BATTERY, FLAG_BATTERY_50_TO_75);
+ 8001470: 2103 movs r1, #3
+ 8001472: 2001 movs r0, #1
+ 8001474: f001 f9a4 bl 80027c0
+ 8001478: e029 b.n 80014ce
+ }
+ else if (bat_voltage > V_BATTERY_25_TO_50)
+ 800147a: 4b22 ldr r3, [pc, #136] ; (8001504 )
+ 800147c: 681b ldr r3, [r3, #0]
+ 800147e: 4618 mov r0, r3
+ 8001480: f7fe ffda bl 8000438 <__aeabi_f2d>
+ 8001484: a318 add r3, pc, #96 ; (adr r3, 80014e8 )
+ 8001486: e9d3 2300 ldrd r2, r3, [r3]
+ 800148a: f7ff fabd bl 8000a08 <__aeabi_dcmpgt>
+ 800148e: 4603 mov r3, r0
+ 8001490: 2b00 cmp r3, #0
+ 8001492: d004 beq.n 800149e
+ {
+ set_device_flags(FLAGS_BATTERY, FLAG_BATTERY_25_TO_50);
+ 8001494: 2102 movs r1, #2
+ 8001496: 2001 movs r0, #1
+ 8001498: f001 f992 bl 80027c0
+ 800149c: e017 b.n 80014ce
+ }
+ else if (bat_voltage > V_BATTERY_10_TO_25)
+ 800149e: 4b19 ldr r3, [pc, #100] ; (8001504 )
+ 80014a0: 681b ldr r3, [r3, #0]
+ 80014a2: 4618 mov r0, r3
+ 80014a4: f7fe ffc8 bl 8000438 <__aeabi_f2d>
+ 80014a8: a311 add r3, pc, #68 ; (adr r3, 80014f0 )
+ 80014aa: e9d3 2300 ldrd r2, r3, [r3]
+ 80014ae: f7ff faab bl 8000a08 <__aeabi_dcmpgt>
+ 80014b2: 4603 mov r3, r0
+ 80014b4: 2b00 cmp r3, #0
+ 80014b6: d004 beq.n 80014c2
+ {
+ set_device_flags(FLAGS_BATTERY, FLAG_BATTERY_10_TO_25);
+ 80014b8: 2101 movs r1, #1
+ 80014ba: 2001 movs r0, #1
+ 80014bc: f001 f980 bl 80027c0
+ 80014c0: e005 b.n 80014ce
+ }
+ else
+ {
+ set_device_flags(FLAGS_BATTERY, FLAG_BATTERY_0_TO_10);
+ 80014c2: 2100 movs r1, #0
+ 80014c4: 2001 movs r0, #1
+ 80014c6: f001 f97b bl 80027c0
+ return 1;
+ 80014ca: 2301 movs r3, #1
+ 80014cc: e000 b.n 80014d0
+ }
+ }
+
+ return 0;
+ 80014ce: 2300 movs r3, #0
+}
+ 80014d0: 4618 mov r0, r3
+ 80014d2: bd80 pop {r7, pc}
+ 80014d4: f3af 8000 nop.w
+ 80014d8: 33333333 .word 0x33333333
+ 80014dc: 400f3333 .word 0x400f3333
+ 80014e0: cccccccd .word 0xcccccccd
+ 80014e4: 400ccccc .word 0x400ccccc
+ 80014e8: 66666666 .word 0x66666666
+ 80014ec: 400a6666 .word 0x400a6666
+ 80014f0: cccccccd .word 0xcccccccd
+ 80014f4: 4008cccc .word 0x4008cccc
+ 80014f8: 200000e4 .word 0x200000e4
+ 80014fc: 40012400 .word 0x40012400
+ 8001500: 40533333 .word 0x40533333
+ 8001504: 20000128 .word 0x20000128
+
+08001508 :
+
+
+
+float get_bat_voltage(void)
+{
+ 8001508: b480 push {r7}
+ 800150a: af00 add r7, sp, #0
+ return bat_voltage;
+ 800150c: 4b02 ldr r3, [pc, #8] ; (8001518 )
+ 800150e: 681b ldr r3, [r3, #0]
+}
+ 8001510: 4618 mov r0, r3
+ 8001512: 46bd mov sp, r7
+ 8001514: bc80 pop {r7}
+ 8001516: 4770 bx lr
+ 8001518: 20000128 .word 0x20000128
+
+0800151c :
+
+
+
+//button return code = {ButtonNumber(0...BUTTONS_NUM-1) * BUTTON_ACTIONS_NUM + BUTTON_ACTION(_SHORT)(_LONG)} + 1
+uint8_t scan_buttons(void)
+{
+ 800151c: b480 push {r7}
+ 800151e: b083 sub sp, #12
+ 8001520: af00 add r7, sp, #0
+ if (scan_interval_counter < SCAN_INTERVAL)
+ 8001522: 4b6b ldr r3, [pc, #428] ; (80016d0 )
+ 8001524: 681b ldr r3, [r3, #0]
+ 8001526: f240 52db movw r2, #1499 ; 0x5db
+ 800152a: 4293 cmp r3, r2
+ 800152c: d805 bhi.n 800153a
+ {
+ scan_interval_counter++; //increase counter
+ 800152e: 4b68 ldr r3, [pc, #416] ; (80016d0 )
+ 8001530: 681b ldr r3, [r3, #0]
+ 8001532: 3301 adds r3, #1
+ 8001534: 4a66 ldr r2, [pc, #408] ; (80016d0 )
+ 8001536: 6013 str r3, [r2, #0]
+ 8001538: e0c3 b.n 80016c2
+ }
+ else
+ {
+ scan_interval_counter = 0; //time to scan buttons! reset counter
+ 800153a: 4b65 ldr r3, [pc, #404] ; (80016d0 )
+ 800153c: 2200 movs r2, #0
+ 800153e: 601a str r2, [r3, #0]
+
+ idr_register_copy = GPIOA->IDR; //save pins data
+ 8001540: 4b64 ldr r3, [pc, #400] ; (80016d4 )
+ 8001542: 689b ldr r3, [r3, #8]
+ 8001544: 4a64 ldr r2, [pc, #400] ; (80016d8 )
+ 8001546: 6013 str r3, [r2, #0]
+ idr_register_copy &= (GPIO_IDR_IDR1 | //mask needed pins
+ 8001548: 4b63 ldr r3, [pc, #396] ; (80016d8 )
+ 800154a: 681b ldr r3, [r3, #0]
+ 800154c: f003 033e and.w r3, r3, #62 ; 0x3e
+ 8001550: 4a61 ldr r2, [pc, #388] ; (80016d8 )
+ 8001552: 6013 str r3, [r2, #0]
+ GPIO_IDR_IDR2 |
+ GPIO_IDR_IDR3 |
+ GPIO_IDR_IDR4 |
+ GPIO_IDR_IDR5);
+
+ idr_register_copy >>= 1; //align bits to the left, now IDR1(PA1) is in LSBit position
+ 8001554: 4b60 ldr r3, [pc, #384] ; (80016d8 )
+ 8001556: 681b ldr r3, [r3, #0]
+ 8001558: 085b lsrs r3, r3, #1
+ 800155a: 4a5f ldr r2, [pc, #380] ; (80016d8 )
+ 800155c: 6013 str r3, [r2, #0]
+
+ for (uint8_t i = 0; i < BUTTONS_NUM; i++) //update buttons weight (digital capacitor, increase or decrease "charge")
+ 800155e: 2300 movs r3, #0
+ 8001560: 71fb strb r3, [r7, #7]
+ 8001562: e026 b.n 80015b2
+ {
+ if (idr_register_copy & ((uint32_t)1 << i)) //check pin state
+ 8001564: 4b5c ldr r3, [pc, #368] ; (80016d8 )
+ 8001566: 681a ldr r2, [r3, #0]
+ 8001568: 79fb ldrb r3, [r7, #7]
+ 800156a: fa22 f303 lsr.w r3, r2, r3
+ 800156e: f003 0301 and.w r3, r3, #1
+ 8001572: 2b00 cmp r3, #0
+ 8001574: d00d beq.n 8001592
+ {
+ if (button_weight[i] < BUTTON_WEIGHT_MAX)
+ 8001576: 79fb ldrb r3, [r7, #7]
+ 8001578: 4a58 ldr r2, [pc, #352] ; (80016dc )
+ 800157a: 5cd3 ldrb r3, [r2, r3]
+ 800157c: 2b0f cmp r3, #15
+ 800157e: d815 bhi.n 80015ac
+ {
+ button_weight[i] += 1; // if input pin = 1, increase weight
+ 8001580: 79fb ldrb r3, [r7, #7]
+ 8001582: 4a56 ldr r2, [pc, #344] ; (80016dc )
+ 8001584: 5cd2 ldrb r2, [r2, r3]
+ 8001586: 79fb ldrb r3, [r7, #7]
+ 8001588: 3201 adds r2, #1
+ 800158a: b2d1 uxtb r1, r2
+ 800158c: 4a53 ldr r2, [pc, #332] ; (80016dc )
+ 800158e: 54d1 strb r1, [r2, r3]
+ 8001590: e00c b.n 80015ac
+ }
+ }
+ else
+ {
+ if (button_weight[i] > BUTTON_WEIGHT_MIN)
+ 8001592: 79fb ldrb r3, [r7, #7]
+ 8001594: 4a51 ldr r2, [pc, #324] ; (80016dc )
+ 8001596: 5cd3 ldrb r3, [r2, r3]
+ 8001598: 2b00 cmp r3, #0
+ 800159a: d007 beq.n 80015ac
+ {
+ button_weight[i] -= 1; // if input pin = 0, decrease weight
+ 800159c: 79fb ldrb r3, [r7, #7]
+ 800159e: 4a4f ldr r2, [pc, #316] ; (80016dc )
+ 80015a0: 5cd2 ldrb r2, [r2, r3]
+ 80015a2: 79fb ldrb r3, [r7, #7]
+ 80015a4: 3a01 subs r2, #1
+ 80015a6: b2d1 uxtb r1, r2
+ 80015a8: 4a4c ldr r2, [pc, #304] ; (80016dc )
+ 80015aa: 54d1 strb r1, [r2, r3]
+ for (uint8_t i = 0; i < BUTTONS_NUM; i++) //update buttons weight (digital capacitor, increase or decrease "charge")
+ 80015ac: 79fb ldrb r3, [r7, #7]
+ 80015ae: 3301 adds r3, #1
+ 80015b0: 71fb strb r3, [r7, #7]
+ 80015b2: 79fb ldrb r3, [r7, #7]
+ 80015b4: 2b04 cmp r3, #4
+ 80015b6: d9d5 bls.n 8001564
+ }
+ }
+ }
+
+ for (uint8_t i = 0; i < BUTTONS_NUM; i++) //make a desicion "button is pressed or not?" (with hysteresis)
+ 80015b8: 2300 movs r3, #0
+ 80015ba: 71bb strb r3, [r7, #6]
+ 80015bc: e021 b.n 8001602
+ {
+ if (button_weight[i] > BUTTON_THRESHOLD_HI)
+ 80015be: 79bb ldrb r3, [r7, #6]
+ 80015c0: 4a46 ldr r2, [pc, #280] ; (80016dc )
+ 80015c2: 5cd3 ldrb r3, [r2, r3]
+ 80015c4: 2b0c cmp r3, #12
+ 80015c6: d90a bls.n 80015de
+ {
+ button_prev_state[i] = button_state[i];
+ 80015c8: 79ba ldrb r2, [r7, #6]
+ 80015ca: 79bb ldrb r3, [r7, #6]
+ 80015cc: 4944 ldr r1, [pc, #272] ; (80016e0 )
+ 80015ce: 5c89 ldrb r1, [r1, r2]
+ 80015d0: 4a44 ldr r2, [pc, #272] ; (80016e4 )
+ 80015d2: 54d1 strb r1, [r2, r3]
+ button_state[i] = BUTTON_RELEASED;
+ 80015d4: 79bb ldrb r3, [r7, #6]
+ 80015d6: 4a42 ldr r2, [pc, #264] ; (80016e0 )
+ 80015d8: 2101 movs r1, #1
+ 80015da: 54d1 strb r1, [r2, r3]
+ 80015dc: e00e b.n 80015fc
+ }
+ else if (button_weight[i] < BUTTON_THRESHOLD_LO)
+ 80015de: 79bb ldrb r3, [r7, #6]
+ 80015e0: 4a3e ldr r2, [pc, #248] ; (80016dc )
+ 80015e2: 5cd3 ldrb r3, [r2, r3]
+ 80015e4: 2b03 cmp r3, #3
+ 80015e6: d809 bhi.n 80015fc
+ {
+ button_prev_state[i] = button_state[i];
+ 80015e8: 79ba ldrb r2, [r7, #6]
+ 80015ea: 79bb ldrb r3, [r7, #6]
+ 80015ec: 493c ldr r1, [pc, #240] ; (80016e0 )
+ 80015ee: 5c89 ldrb r1, [r1, r2]
+ 80015f0: 4a3c ldr r2, [pc, #240] ; (80016e4 )
+ 80015f2: 54d1 strb r1, [r2, r3]
+ button_state[i] = BUTTON_PRESSED;
+ 80015f4: 79bb ldrb r3, [r7, #6]
+ 80015f6: 4a3a ldr r2, [pc, #232] ; (80016e0 )
+ 80015f8: 2100 movs r1, #0
+ 80015fa: 54d1 strb r1, [r2, r3]
+ for (uint8_t i = 0; i < BUTTONS_NUM; i++) //make a desicion "button is pressed or not?" (with hysteresis)
+ 80015fc: 79bb ldrb r3, [r7, #6]
+ 80015fe: 3301 adds r3, #1
+ 8001600: 71bb strb r3, [r7, #6]
+ 8001602: 79bb ldrb r3, [r7, #6]
+ 8001604: 2b04 cmp r3, #4
+ 8001606: d9da bls.n 80015be
+ }
+ }
+
+ for (uint8_t i = 0; i < BUTTONS_NUM; i++) //check click duration. short click after button released (and before timeout overflow); long click after timeout overflow
+ 8001608: 2300 movs r3, #0
+ 800160a: 717b strb r3, [r7, #5]
+ 800160c: e056 b.n 80016bc
+ {
+ if ((button_state[i] == BUTTON_PRESSED) && (button_pressed_counter[i] < BUTTON_PRESSED_COUNTER_MAX)) //increase timeout counter, update overflow states
+ 800160e: 797b ldrb r3, [r7, #5]
+ 8001610: 4a33 ldr r2, [pc, #204] ; (80016e0 )
+ 8001612: 5cd3 ldrb r3, [r2, r3]
+ 8001614: 2b00 cmp r3, #0
+ 8001616: d124 bne.n 8001662
+ 8001618: 797b ldrb r3, [r7, #5]
+ 800161a: 4a33 ldr r2, [pc, #204] ; (80016e8 )
+ 800161c: f832 3013 ldrh.w r3, [r2, r3, lsl #1]
+ 8001620: f64f 72ff movw r2, #65535 ; 0xffff
+ 8001624: 4293 cmp r3, r2
+ 8001626: d01c beq.n 8001662
+ {
+ button_pressed_counter[i]++;
+ 8001628: 797b ldrb r3, [r7, #5]
+ 800162a: 4a2f ldr r2, [pc, #188] ; (80016e8 )
+ 800162c: f832 2013 ldrh.w r2, [r2, r3, lsl #1]
+ 8001630: 3201 adds r2, #1
+ 8001632: b291 uxth r1, r2
+ 8001634: 4a2c ldr r2, [pc, #176] ; (80016e8 )
+ 8001636: f822 1013 strh.w r1, [r2, r3, lsl #1]
+
+ timeout_prev_state[i] = timeout_state[i];
+ 800163a: 797a ldrb r2, [r7, #5]
+ 800163c: 797b ldrb r3, [r7, #5]
+ 800163e: 492b ldr r1, [pc, #172] ; (80016ec )
+ 8001640: 5c89 ldrb r1, [r1, r2]
+ 8001642: 4a2b ldr r2, [pc, #172] ; (80016f0 )
+ 8001644: 54d1 strb r1, [r2, r3]
+ timeout_state[i] = (button_pressed_counter[i] > BUTTON_PRESSED_COUNTER_THRESHOLD); //overflow or not? 1 or 0?
+ 8001646: 797b ldrb r3, [r7, #5]
+ 8001648: 4a27 ldr r2, [pc, #156] ; (80016e8 )
+ 800164a: f832 3013 ldrh.w r3, [r2, r3, lsl #1]
+ 800164e: f5b3 7faf cmp.w r3, #350 ; 0x15e
+ 8001652: bf8c ite hi
+ 8001654: 2301 movhi r3, #1
+ 8001656: 2300 movls r3, #0
+ 8001658: b2da uxtb r2, r3
+ 800165a: 797b ldrb r3, [r7, #5]
+ 800165c: 4611 mov r1, r2
+ 800165e: 4a23 ldr r2, [pc, #140] ; (80016ec )
+ 8001660: 54d1 strb r1, [r2, r3]
+ }
+
+ if ((button_state[i] == BUTTON_RELEASED) && (button_prev_state[i] == BUTTON_PRESSED)) //button has been released
+ 8001662: 797b ldrb r3, [r7, #5]
+ 8001664: 4a1e ldr r2, [pc, #120] ; (80016e0 )
+ 8001666: 5cd3 ldrb r3, [r2, r3]
+ 8001668: 2b01 cmp r3, #1
+ 800166a: d114 bne.n 8001696
+ 800166c: 797b ldrb r3, [r7, #5]
+ 800166e: 4a1d ldr r2, [pc, #116] ; (80016e4 )
+ 8001670: 5cd3 ldrb r3, [r2, r3]
+ 8001672: 2b00 cmp r3, #0
+ 8001674: d10f bne.n 8001696
+ {
+ button_pressed_counter[i] = 0;
+ 8001676: 797b ldrb r3, [r7, #5]
+ 8001678: 4a1b ldr r2, [pc, #108] ; (80016e8 )
+ 800167a: 2100 movs r1, #0
+ 800167c: f822 1013 strh.w r1, [r2, r3, lsl #1]
+
+ if (timeout_state[i] == TIMEOUT_NO_OVERFLOW)
+ 8001680: 797b ldrb r3, [r7, #5]
+ 8001682: 4a1a ldr r2, [pc, #104] ; (80016ec )
+ 8001684: 5cd3 ldrb r3, [r2, r3]
+ 8001686: 2b00 cmp r3, #0
+ 8001688: d105 bne.n 8001696
+ {
+ return (i * BUTTON_ACTIONS_NUM + BUTTON_ACTION_SHORT) + 1; //if before overflow, then short click
+ 800168a: 797b ldrb r3, [r7, #5]
+ 800168c: 005b lsls r3, r3, #1
+ 800168e: b2db uxtb r3, r3
+ 8001690: 3301 adds r3, #1
+ 8001692: b2db uxtb r3, r3
+ 8001694: e016 b.n 80016c4
+ }
+ }
+
+ if ((timeout_state[i] == TIMEOUT_OVERFLOW) && (timeout_prev_state[i] == TIMEOUT_NO_OVERFLOW)) //overflow occured
+ 8001696: 797b ldrb r3, [r7, #5]
+ 8001698: 4a14 ldr r2, [pc, #80] ; (80016ec )
+ 800169a: 5cd3 ldrb r3, [r2, r3]
+ 800169c: 2b01 cmp r3, #1
+ 800169e: d10a bne.n 80016b6
+ 80016a0: 797b ldrb r3, [r7, #5]
+ 80016a2: 4a13 ldr r2, [pc, #76] ; (80016f0 )
+ 80016a4: 5cd3 ldrb r3, [r2, r3]
+ 80016a6: 2b00 cmp r3, #0
+ 80016a8: d105 bne.n 80016b6
+ {
+ return (i * BUTTON_ACTIONS_NUM + BUTTON_ACTION_LONG) + 1; //long click
+ 80016aa: 797b ldrb r3, [r7, #5]
+ 80016ac: 3301 adds r3, #1
+ 80016ae: b2db uxtb r3, r3
+ 80016b0: 005b lsls r3, r3, #1
+ 80016b2: b2db uxtb r3, r3
+ 80016b4: e006 b.n 80016c4
+ for (uint8_t i = 0; i < BUTTONS_NUM; i++) //check click duration. short click after button released (and before timeout overflow); long click after timeout overflow
+ 80016b6: 797b ldrb r3, [r7, #5]
+ 80016b8: 3301 adds r3, #1
+ 80016ba: 717b strb r3, [r7, #5]
+ 80016bc: 797b ldrb r3, [r7, #5]
+ 80016be: 2b04 cmp r3, #4
+ 80016c0: d9a5 bls.n 800160e
+ }
+ }
+ }
+ return BTN_NO_ACTION;
+ 80016c2: 2300 movs r3, #0
+}
+ 80016c4: 4618 mov r0, r3
+ 80016c6: 370c adds r7, #12
+ 80016c8: 46bd mov sp, r7
+ 80016ca: bc80 pop {r7}
+ 80016cc: 4770 bx lr
+ 80016ce: bf00 nop
+ 80016d0: 200000e8 .word 0x200000e8
+ 80016d4: 40010800 .word 0x40010800
+ 80016d8: 200000ec .word 0x200000ec
+ 80016dc: 20000000 .word 0x20000000
+ 80016e0: 20000008 .word 0x20000008
+ 80016e4: 20000010 .word 0x20000010
+ 80016e8: 200000f0 .word 0x200000f0
+ 80016ec: 200000fc .word 0x200000fc
+ 80016f0: 20000104 .word 0x20000104
+
+080016f4 :
+ *
+ * Enable a device specific interupt in the NVIC interrupt controller.
+ * The interrupt number cannot be a negative value.
+ */
+static __INLINE void NVIC_EnableIRQ(IRQn_Type IRQn)
+{
+ 80016f4: b480 push {r7}
+ 80016f6: b083 sub sp, #12
+ 80016f8: af00 add r7, sp, #0
+ 80016fa: 4603 mov r3, r0
+ 80016fc: 71fb strb r3, [r7, #7]
+ NVIC->ISER[((uint32_t)(IRQn) >> 5)] = (1 << ((uint32_t)(IRQn) & 0x1F)); /* enable interrupt */
+ 80016fe: 79fb ldrb r3, [r7, #7]
+ 8001700: f003 031f and.w r3, r3, #31
+ 8001704: 2201 movs r2, #1
+ 8001706: fa02 f103 lsl.w r1, r2, r3
+ 800170a: 4a05 ldr r2, [pc, #20] ; (8001720 )
+ 800170c: f997 3007 ldrsb.w r3, [r7, #7]
+ 8001710: 095b lsrs r3, r3, #5
+ 8001712: f842 1023 str.w r1, [r2, r3, lsl #2]
+}
+ 8001716: bf00 nop
+ 8001718: 370c adds r7, #12
+ 800171a: 46bd mov sp, r7
+ 800171c: bc80 pop {r7}
+ 800171e: 4770 bx lr
+ 8001720: e000e100 .word 0xe000e100
+
+08001724 :
+
+
+
+//Initialization of all used ports
+void gpio_init(void)
+{
+ 8001724: b580 push {r7, lr}
+ 8001726: af00 add r7, sp, #0
+ //Port A
+ RCC->APB2ENR |= RCC_APB2ENR_IOPAEN;
+ 8001728: 4b98 ldr r3, [pc, #608] ; (800198c )
+ 800172a: 699b ldr r3, [r3, #24]
+ 800172c: 4a97 ldr r2, [pc, #604] ; (800198c )
+ 800172e: f043 0304 orr.w r3, r3, #4
+ 8001732: 6193 str r3, [r2, #24]
+
+ //PA0 - ADC0 (Battery voltage)
+ GPIOA->CRL &= ~GPIO_CRL_MODE0; //input mode
+ 8001734: 4b96 ldr r3, [pc, #600] ; (8001990 )
+ 8001736: 681b ldr r3, [r3, #0]
+ 8001738: 4a95 ldr r2, [pc, #596] ; (8001990 )
+ 800173a: f023 0303 bic.w r3, r3, #3
+ 800173e: 6013 str r3, [r2, #0]
+ GPIOA->CRL &= ~GPIO_CRL_CNF0; //analog input
+ 8001740: 4b93 ldr r3, [pc, #588] ; (8001990 )
+ 8001742: 681b ldr r3, [r3, #0]
+ 8001744: 4a92 ldr r2, [pc, #584] ; (8001990 )
+ 8001746: f023 030c bic.w r3, r3, #12
+ 800174a: 6013 str r3, [r2, #0]
+
+ //PA1 - Button 1
+ GPIOA->CRL &= ~GPIO_CRL_MODE1; //input mode
+ 800174c: 4b90 ldr r3, [pc, #576] ; (8001990 )
+ 800174e: 681b ldr r3, [r3, #0]
+ 8001750: 4a8f ldr r2, [pc, #572] ; (8001990 )
+ 8001752: f023 0330 bic.w r3, r3, #48 ; 0x30
+ 8001756: 6013 str r3, [r2, #0]
+ GPIOA->CRL &= ~GPIO_CRL_CNF1_0; //input with pull
+ 8001758: 4b8d ldr r3, [pc, #564] ; (8001990 )
+ 800175a: 681b ldr r3, [r3, #0]
+ 800175c: 4a8c ldr r2, [pc, #560] ; (8001990 )
+ 800175e: f023 0340 bic.w r3, r3, #64 ; 0x40
+ 8001762: 6013 str r3, [r2, #0]
+ GPIOA->CRL |= GPIO_CRL_CNF1_1;
+ 8001764: 4b8a ldr r3, [pc, #552] ; (8001990 )
+ 8001766: 681b ldr r3, [r3, #0]
+ 8001768: 4a89 ldr r2, [pc, #548] ; (8001990 )
+ 800176a: f043 0380 orr.w r3, r3, #128 ; 0x80
+ 800176e: 6013 str r3, [r2, #0]
+ GPIOA->ODR |= GPIO_ODR_ODR1; //pull-up on
+ 8001770: 4b87 ldr r3, [pc, #540] ; (8001990 )
+ 8001772: 68db ldr r3, [r3, #12]
+ 8001774: 4a86 ldr r2, [pc, #536] ; (8001990 )
+ 8001776: f043 0302 orr.w r3, r3, #2
+ 800177a: 60d3 str r3, [r2, #12]
+
+ //PA2 - Button 2
+ GPIOA->CRL &= ~GPIO_CRL_MODE2; //input mode
+ 800177c: 4b84 ldr r3, [pc, #528] ; (8001990 )
+ 800177e: 681b ldr r3, [r3, #0]
+ 8001780: 4a83 ldr r2, [pc, #524] ; (8001990 )
+ 8001782: f423 7340 bic.w r3, r3, #768 ; 0x300
+ 8001786: 6013 str r3, [r2, #0]
+ GPIOA->CRL &= ~GPIO_CRL_CNF2_0; //input with pull
+ 8001788: 4b81 ldr r3, [pc, #516] ; (8001990 )
+ 800178a: 681b ldr r3, [r3, #0]
+ 800178c: 4a80 ldr r2, [pc, #512] ; (8001990 )
+ 800178e: f423 6380 bic.w r3, r3, #1024 ; 0x400
+ 8001792: 6013 str r3, [r2, #0]
+ GPIOA->CRL |= GPIO_CRL_CNF2_1;
+ 8001794: 4b7e ldr r3, [pc, #504] ; (8001990 )
+ 8001796: 681b ldr r3, [r3, #0]
+ 8001798: 4a7d ldr r2, [pc, #500] ; (8001990 )
+ 800179a: f443 6300 orr.w r3, r3, #2048 ; 0x800
+ 800179e: 6013 str r3, [r2, #0]
+ GPIOA->ODR |= GPIO_ODR_ODR2; //pull-up on
+ 80017a0: 4b7b ldr r3, [pc, #492] ; (8001990 )
+ 80017a2: 68db ldr r3, [r3, #12]
+ 80017a4: 4a7a ldr r2, [pc, #488] ; (8001990 )
+ 80017a6: f043 0304 orr.w r3, r3, #4
+ 80017aa: 60d3 str r3, [r2, #12]
+
+ //PA3 - Button 3
+ GPIOA->CRL &= ~GPIO_CRL_MODE3; //input mode
+ 80017ac: 4b78 ldr r3, [pc, #480] ; (8001990 )
+ 80017ae: 681b ldr r3, [r3, #0]
+ 80017b0: 4a77 ldr r2, [pc, #476] ; (8001990 )
+ 80017b2: f423 5340 bic.w r3, r3, #12288 ; 0x3000
+ 80017b6: 6013 str r3, [r2, #0]
+ GPIOA->CRL &= ~GPIO_CRL_CNF3_0; //input with pull
+ 80017b8: 4b75 ldr r3, [pc, #468] ; (8001990 )
+ 80017ba: 681b ldr r3, [r3, #0]
+ 80017bc: 4a74 ldr r2, [pc, #464] ; (8001990 )
+ 80017be: f423 4380 bic.w r3, r3, #16384 ; 0x4000
+ 80017c2: 6013 str r3, [r2, #0]
+ GPIOA->CRL |= GPIO_CRL_CNF3_1;
+ 80017c4: 4b72 ldr r3, [pc, #456] ; (8001990 )
+ 80017c6: 681b ldr r3, [r3, #0]
+ 80017c8: 4a71 ldr r2, [pc, #452] ; (8001990 )
+ 80017ca: f443 4300 orr.w r3, r3, #32768 ; 0x8000
+ 80017ce: 6013 str r3, [r2, #0]
+ GPIOA->ODR |= GPIO_ODR_ODR3; //pull-up on
+ 80017d0: 4b6f ldr r3, [pc, #444] ; (8001990 )
+ 80017d2: 68db ldr r3, [r3, #12]
+ 80017d4: 4a6e ldr r2, [pc, #440] ; (8001990 )
+ 80017d6: f043 0308 orr.w r3, r3, #8
+ 80017da: 60d3 str r3, [r2, #12]
+
+ //PA4 - Button 4
+ GPIOA->CRL &= ~GPIO_CRL_MODE4; //input mode
+ 80017dc: 4b6c ldr r3, [pc, #432] ; (8001990 )
+ 80017de: 681b ldr r3, [r3, #0]
+ 80017e0: 4a6b ldr r2, [pc, #428] ; (8001990 )
+ 80017e2: f423 3340 bic.w r3, r3, #196608 ; 0x30000
+ 80017e6: 6013 str r3, [r2, #0]
+ GPIOA->CRL &= ~GPIO_CRL_CNF4_0; //input with pull
+ 80017e8: 4b69 ldr r3, [pc, #420] ; (8001990 )
+ 80017ea: 681b ldr r3, [r3, #0]
+ 80017ec: 4a68 ldr r2, [pc, #416] ; (8001990 )
+ 80017ee: f423 2380 bic.w r3, r3, #262144 ; 0x40000
+ 80017f2: 6013 str r3, [r2, #0]
+ GPIOA->CRL |= GPIO_CRL_CNF4_1;
+ 80017f4: 4b66 ldr r3, [pc, #408] ; (8001990 )
+ 80017f6: 681b ldr r3, [r3, #0]
+ 80017f8: 4a65 ldr r2, [pc, #404] ; (8001990 )
+ 80017fa: f443 2300 orr.w r3, r3, #524288 ; 0x80000
+ 80017fe: 6013 str r3, [r2, #0]
+ GPIOA->ODR |= GPIO_ODR_ODR4; //pull-up on
+ 8001800: 4b63 ldr r3, [pc, #396] ; (8001990 )
+ 8001802: 68db ldr r3, [r3, #12]
+ 8001804: 4a62 ldr r2, [pc, #392] ; (8001990 )
+ 8001806: f043 0310 orr.w r3, r3, #16
+ 800180a: 60d3 str r3, [r2, #12]
+
+ //PA5 - Button 5
+ GPIOA->CRL &= ~GPIO_CRL_MODE5; //input mode
+ 800180c: 4b60 ldr r3, [pc, #384] ; (8001990 )
+ 800180e: 681b ldr r3, [r3, #0]
+ 8001810: 4a5f ldr r2, [pc, #380] ; (8001990 )
+ 8001812: f423 1340 bic.w r3, r3, #3145728 ; 0x300000
+ 8001816: 6013 str r3, [r2, #0]
+ GPIOA->CRL &= ~GPIO_CRL_CNF5_0; //input with pull
+ 8001818: 4b5d ldr r3, [pc, #372] ; (8001990 )
+ 800181a: 681b ldr r3, [r3, #0]
+ 800181c: 4a5c ldr r2, [pc, #368] ; (8001990 )
+ 800181e: f423 0380 bic.w r3, r3, #4194304 ; 0x400000
+ 8001822: 6013 str r3, [r2, #0]
+ GPIOA->CRL |= GPIO_CRL_CNF5_1;
+ 8001824: 4b5a ldr r3, [pc, #360] ; (8001990 )
+ 8001826: 681b ldr r3, [r3, #0]
+ 8001828: 4a59 ldr r2, [pc, #356] ; (8001990 )
+ 800182a: f443 0300 orr.w r3, r3, #8388608 ; 0x800000
+ 800182e: 6013 str r3, [r2, #0]
+ GPIOA->ODR |= GPIO_ODR_ODR5; //pull-up on
+ 8001830: 4b57 ldr r3, [pc, #348] ; (8001990 )
+ 8001832: 68db ldr r3, [r3, #12]
+ 8001834: 4a56 ldr r2, [pc, #344] ; (8001990 )
+ 8001836: f043 0320 orr.w r3, r3, #32
+ 800183a: 60d3 str r3, [r2, #12]
+
+ //PA6 - Battery monitor switch
+ GPIOA->CRL |= GPIO_CRL_MODE6; //output 50 MHz
+ 800183c: 4b54 ldr r3, [pc, #336] ; (8001990 )
+ 800183e: 681b ldr r3, [r3, #0]
+ 8001840: 4a53 ldr r2, [pc, #332] ; (8001990 )
+ 8001842: f043 7340 orr.w r3, r3, #50331648 ; 0x3000000
+ 8001846: 6013 str r3, [r2, #0]
+ GPIOA->CRL &= ~GPIO_CRL_CNF6; //output push-pull
+ 8001848: 4b51 ldr r3, [pc, #324] ; (8001990 )
+ 800184a: 681b ldr r3, [r3, #0]
+ 800184c: 4a50 ldr r2, [pc, #320] ; (8001990 )
+ 800184e: f023 6340 bic.w r3, r3, #201326592 ; 0xc000000
+ 8001852: 6013 str r3, [r2, #0]
+
+ //PA7 - Piezo Buzzer (PWM)
+ GPIOA->CRL |= GPIO_CRL_MODE7; //output mode
+ 8001854: 4b4e ldr r3, [pc, #312] ; (8001990 )
+ 8001856: 681b ldr r3, [r3, #0]
+ 8001858: 4a4d ldr r2, [pc, #308] ; (8001990 )
+ 800185a: f043 5340 orr.w r3, r3, #805306368 ; 0x30000000
+ 800185e: 6013 str r3, [r2, #0]
+ GPIOA->CRL &= ~GPIO_CRL_CNF7_0; //alternate output push-pull
+ 8001860: 4b4b ldr r3, [pc, #300] ; (8001990 )
+ 8001862: 681b ldr r3, [r3, #0]
+ 8001864: 4a4a ldr r2, [pc, #296] ; (8001990