Преглед изворни кода

MBIC 부트로더 i2c 추가

PYJ пре 5 година
родитељ
комит
212ad2febf
96 измењених фајлова са 12784 додато и 6345 уклоњено
  1. 2 2
      .mxproject
  2. BIN
      Debug/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_tim.o
  3. BIN
      Debug/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_tim_ex.o
  4. BIN
      Debug/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_uart.o
  5. BIN
      Debug/STM32F103_ATTEN_PLL_Zig.elf
  6. 696 670
      Debug/STM32F103_ATTEN_PLL_Zig.hex
  7. 4547 4245
      Debug/STM32F103_ATTEN_PLL_Zig.list
  8. 736 571
      Debug/STM32F103_ATTEN_PLL_Zig.map
  9. BIN
      Debug/Src/CRC16.o
  10. 5 5
      Debug/Src/main.su
  11. BIN
      Debug/Src/stm32f1xx_hal_msp.o
  12. 6 4
      Debug/Src/stm32f1xx_hal_msp.su
  13. BIN
      Debug/Src/stm32f1xx_it.o
  14. 650 0
      Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_i2c.h
  15. 5588 0
      Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_i2c.c
  16. 226 0
      Inc/eeprom.h
  17. 4 0
      Inc/main.h
  18. 1 1
      Inc/stm32f1xx_hal_conf.h
  19. 43 36
      STM32F103_ATTEN_PLL_Zig.ioc
  20. 171 0
      Src/eeprom.c
  21. 46 8
      Src/main.c
  22. 63 0
      Src/stm32f1xx_hal_msp.c
  23. 0 8
      insight/STM32F103_ATTEN_PLL_Zig.si4project/Backup/BDA4601(3412).c
  24. 0 105
      insight/STM32F103_ATTEN_PLL_Zig.si4project/Backup/PE43711(6308).c
  25. 0 440
      insight/STM32F103_ATTEN_PLL_Zig.si4project/Backup/main(5556).c
  26. 0 214
      insight/STM32F103_ATTEN_PLL_Zig.si4project/Backup/stm32f1xx_hal_def(7893).h
  27. 0 7
      insight/STM32F103_ATTEN_PLL_Zig.si4project/STM32F103_ATTEN_PLL_Zig.bookmarks.xml
  28. BIN
      insight/STM32F103_ATTEN_PLL_Zig.si4project/STM32F103_ATTEN_PLL_Zig.sip_sym
  29. BIN
      insight/STM32F103_ATTEN_PLL_Zig.si4project/STM32F103_ATTEN_PLL_Zig.sip_xab
  30. BIN
      insight/STM32F103_ATTEN_PLL_Zig.si4project/STM32F103_ATTEN_PLL_Zig.sip_xad
  31. BIN
      insight/STM32F103_ATTEN_PLL_Zig.si4project/STM32F103_ATTEN_PLL_Zig.sip_xc
  32. BIN
      insight/STM32F103_ATTEN_PLL_Zig.si4project/STM32F103_ATTEN_PLL_Zig.sip_xf
  33. BIN
      insight/STM32F103_ATTEN_PLL_Zig.si4project/STM32F103_ATTEN_PLL_Zig.sip_xm
  34. BIN
      insight/STM32F103_ATTEN_PLL_Zig.si4project/STM32F103_ATTEN_PLL_Zig.sip_xr
  35. BIN
      insight/STM32F103_ATTEN_PLL_Zig.si4project/STM32F103_ATTEN_PLL_Zig.sip_xsb
  36. BIN
      insight/STM32F103_ATTEN_PLL_Zig.si4project/STM32F103_ATTEN_PLL_Zig.sip_xsd
  37. BIN
      insight/STM32F103_ATTEN_PLL_Zig.si4project/STM32F103_ATTEN_PLL_Zig.siproj
  38. 0 22
      insight/STM32F103_ATTEN_PLL_Zig.si4project/STM32F103_ATTEN_PLL_Zig.siproj_settings.xml
  39. BIN
      insight/STM32F103_ATTEN_PLL_Zig.si4project/STM32F103_ATTEN_PLL_Zig.siwork
  40. 0 7
      insight/STM32F103_ATTEN_PLL_Zig.si4project/STM32F103_ATTEN_PLL_Zig.snippets.xml
  41. BIN
      insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Drivers_CMSIS_Device_ST_STM32F1xx_Include_stm32f103xe.h.sisc
  42. BIN
      insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Drivers_CMSIS_Device_ST_STM32F1xx_Include_stm32f1xx.h.sisc
  43. BIN
      insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Drivers_CMSIS_Device_ST_STM32F1xx_Include_system_stm32f1xx.h.sisc
  44. BIN
      insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Drivers_CMSIS_Include_arm_common_tables.h.sisc
  45. BIN
      insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Drivers_CMSIS_Include_arm_const_structs.h.sisc
  46. BIN
      insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Drivers_CMSIS_Include_arm_math.h.sisc
  47. BIN
      insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Drivers_CMSIS_Include_cmsis_armcc.h.sisc
  48. BIN
      insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Drivers_CMSIS_Include_cmsis_armcc_V6.h.sisc
  49. BIN
      insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Drivers_CMSIS_Include_cmsis_gcc.h.sisc
  50. BIN
      insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Drivers_CMSIS_Include_core_cm0.h.sisc
  51. BIN
      insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Drivers_CMSIS_Include_core_cm0plus.h.sisc
  52. BIN
      insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Drivers_CMSIS_Include_core_cm3.h.sisc
  53. BIN
      insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Drivers_CMSIS_Include_core_cm4.h.sisc
  54. BIN
      insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Drivers_CMSIS_Include_core_cm7.h.sisc
  55. BIN
      insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Drivers_CMSIS_Include_core_cmFunc.h.sisc
  56. BIN
      insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Drivers_CMSIS_Include_core_cmInstr.h.sisc
  57. BIN
      insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Drivers_CMSIS_Include_core_cmSimd.h.sisc
  58. BIN
      insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Drivers_CMSIS_Include_core_sc000.h.sisc
  59. BIN
      insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Drivers_CMSIS_Include_core_sc300.h.sisc
  60. BIN
      insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Drivers_STM32F1xx_HAL_Driver_Inc_Legacy_stm32_hal_legacy.h.sisc
  61. BIN
      insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Drivers_STM32F1xx_HAL_Driver_Inc_stm32f1xx_hal.h.sisc
  62. BIN
      insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Drivers_STM32F1xx_HAL_Driver_Inc_stm32f1xx_hal_cortex.h.sisc
  63. BIN
      insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Drivers_STM32F1xx_HAL_Driver_Inc_stm32f1xx_hal_def.h.sisc
  64. BIN
      insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Drivers_STM32F1xx_HAL_Driver_Inc_stm32f1xx_hal_dma.h.sisc
  65. BIN
      insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Drivers_STM32F1xx_HAL_Driver_Inc_stm32f1xx_hal_dma_ex.h.sisc
  66. BIN
      insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Drivers_STM32F1xx_HAL_Driver_Inc_stm32f1xx_hal_flash.h.sisc
  67. BIN
      insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Drivers_STM32F1xx_HAL_Driver_Inc_stm32f1xx_hal_flash_ex.h.sisc
  68. BIN
      insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Drivers_STM32F1xx_HAL_Driver_Inc_stm32f1xx_hal_gpio.h.sisc
  69. BIN
      insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Drivers_STM32F1xx_HAL_Driver_Inc_stm32f1xx_hal_gpio_ex.h.sisc
  70. BIN
      insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Drivers_STM32F1xx_HAL_Driver_Inc_stm32f1xx_hal_pwr.h.sisc
  71. BIN
      insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Drivers_STM32F1xx_HAL_Driver_Inc_stm32f1xx_hal_rcc.h.sisc
  72. BIN
      insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Drivers_STM32F1xx_HAL_Driver_Inc_stm32f1xx_hal_rcc_ex.h.sisc
  73. BIN
      insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Drivers_STM32F1xx_HAL_Driver_Inc_stm32f1xx_hal_tim.h.sisc
  74. BIN
      insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Drivers_STM32F1xx_HAL_Driver_Inc_stm32f1xx_hal_tim_ex.h.sisc
  75. BIN
      insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Drivers_STM32F1xx_HAL_Driver_Inc_stm32f1xx_hal_uart.h.sisc
  76. BIN
      insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Drivers_STM32F1xx_HAL_Driver_Src_stm32f1xx_hal.c.sisc
  77. BIN
      insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Drivers_STM32F1xx_HAL_Driver_Src_stm32f1xx_hal_cortex.c.sisc
  78. BIN
      insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Drivers_STM32F1xx_HAL_Driver_Src_stm32f1xx_hal_dma.c.sisc
  79. BIN
      insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Drivers_STM32F1xx_HAL_Driver_Src_stm32f1xx_hal_flash.c.sisc
  80. BIN
      insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Drivers_STM32F1xx_HAL_Driver_Src_stm32f1xx_hal_flash_ex.c.sisc
  81. BIN
      insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Drivers_STM32F1xx_HAL_Driver_Src_stm32f1xx_hal_gpio.c.sisc
  82. BIN
      insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Drivers_STM32F1xx_HAL_Driver_Src_stm32f1xx_hal_gpio_ex.c.sisc
  83. BIN
      insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Drivers_STM32F1xx_HAL_Driver_Src_stm32f1xx_hal_pwr.c.sisc
  84. BIN
      insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Drivers_STM32F1xx_HAL_Driver_Src_stm32f1xx_hal_rcc.c.sisc
  85. BIN
      insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Drivers_STM32F1xx_HAL_Driver_Src_stm32f1xx_hal_rcc_ex.c.sisc
  86. BIN
      insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Drivers_STM32F1xx_HAL_Driver_Src_stm32f1xx_hal_tim.c.sisc
  87. BIN
      insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Drivers_STM32F1xx_HAL_Driver_Src_stm32f1xx_hal_tim_ex.c.sisc
  88. BIN
      insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Drivers_STM32F1xx_HAL_Driver_Src_stm32f1xx_hal_uart.c.sisc
  89. BIN
      insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Inc_main.h.sisc
  90. BIN
      insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Inc_stm32f1xx_hal_conf.h.sisc
  91. BIN
      insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Inc_stm32f1xx_it.h.sisc
  92. BIN
      insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Src_main.c.sisc
  93. BIN
      insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Src_stm32f1xx_hal_msp.c.sisc
  94. BIN
      insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Src_stm32f1xx_it.c.sisc
  95. BIN
      insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Src_syscalls.c.sisc
  96. BIN
      insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Src_system_stm32f1xx.c.sisc

Разлика између датотеке није приказан због своје велике величине
+ 2 - 2
.mxproject


BIN
Debug/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_tim.o


BIN
Debug/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_tim_ex.o


BIN
Debug/Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_uart.o


BIN
Debug/STM32F103_ATTEN_PLL_Zig.elf


Разлика између датотеке није приказан због своје велике величине
+ 696 - 670
Debug/STM32F103_ATTEN_PLL_Zig.hex


Разлика између датотеке није приказан због своје велике величине
+ 4547 - 4245
Debug/STM32F103_ATTEN_PLL_Zig.list


Разлика између датотеке није приказан због своје велике величине
+ 736 - 571
Debug/STM32F103_ATTEN_PLL_Zig.map


BIN
Debug/Src/CRC16.o


+ 5 - 5
Debug/Src/main.su

@@ -1,5 +1,5 @@
1
-main.c:71:6:HAL_TIM_PeriodElapsedCallback	0	static
2
-main.c:80:5:_write	8	static
3
-main.c:153:6:SystemClock_Config	72	static
4
-main.c:92:5:main	40	static
5
-main.c:320:6:Error_Handler	0	static
1
+main.c:74:6:HAL_TIM_PeriodElapsedCallback	0	static
2
+main.c:83:5:_write	8	static
3
+main.c:157:6:SystemClock_Config	72	static
4
+main.c:95:5:main	40	static
5
+main.c:358:6:Error_Handler	0	static

BIN
Debug/Src/stm32f1xx_hal_msp.o


+ 6 - 4
Debug/Src/stm32f1xx_hal_msp.su

@@ -1,5 +1,7 @@
1 1
 stm32f1xx_hal_msp.c:67:6:HAL_MspInit	8	static
2
-stm32f1xx_hal_msp.c:93:6:HAL_TIM_Base_MspInit	8	static
3
-stm32f1xx_hal_msp.c:115:6:HAL_TIM_Base_MspDeInit	0	static
4
-stm32f1xx_hal_msp.c:140:6:HAL_UART_MspInit	40	static
5
-stm32f1xx_hal_msp.c:212:6:HAL_UART_MspDeInit	8	static
2
+stm32f1xx_hal_msp.c:93:6:HAL_I2C_MspInit	32	static
3
+stm32f1xx_hal_msp.c:127:6:HAL_I2C_MspDeInit	0	static
4
+stm32f1xx_hal_msp.c:156:6:HAL_TIM_Base_MspInit	8	static
5
+stm32f1xx_hal_msp.c:178:6:HAL_TIM_Base_MspDeInit	0	static
6
+stm32f1xx_hal_msp.c:203:6:HAL_UART_MspInit	40	static
7
+stm32f1xx_hal_msp.c:275:6:HAL_UART_MspDeInit	8	static

BIN
Debug/Src/stm32f1xx_it.o


+ 650 - 0
Drivers/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_i2c.h

@@ -0,0 +1,650 @@
1
+/**
2
+  ******************************************************************************
3
+  * @file    stm32f1xx_hal_i2c.h
4
+  * @author  MCD Application Team
5
+  * @brief   Header file of I2C HAL module.
6
+  ******************************************************************************
7
+  * @attention
8
+  *
9
+  * <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
10
+  *
11
+  * Redistribution and use in source and binary forms, with or without modification,
12
+  * are permitted provided that the following conditions are met:
13
+  *   1. Redistributions of source code must retain the above copyright notice,
14
+  *      this list of conditions and the following disclaimer.
15
+  *   2. Redistributions in binary form must reproduce the above copyright notice,
16
+  *      this list of conditions and the following disclaimer in the documentation
17
+  *      and/or other materials provided with the distribution.
18
+  *   3. Neither the name of STMicroelectronics nor the names of its contributors
19
+  *      may be used to endorse or promote products derived from this software
20
+  *      without specific prior written permission.
21
+  *
22
+  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
23
+  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24
+  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
25
+  * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
26
+  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27
+  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
28
+  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29
+  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
30
+  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31
+  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32
+  *
33
+  ******************************************************************************
34
+  */
35
+
36
+/* Define to prevent recursive inclusion -------------------------------------*/
37
+#ifndef __STM32F1xx_HAL_I2C_H
38
+#define __STM32F1xx_HAL_I2C_H
39
+
40
+#ifdef __cplusplus
41
+ extern "C" {
42
+#endif
43
+
44
+/* Includes ------------------------------------------------------------------*/
45
+#include "stm32f1xx_hal_def.h"
46
+
47
+/** @addtogroup STM32F1xx_HAL_Driver
48
+  * @{
49
+  */
50
+
51
+/** @addtogroup I2C
52
+  * @{
53
+  */
54
+
55
+/* Exported types ------------------------------------------------------------*/
56
+/** @defgroup I2C_Exported_Types I2C Exported Types
57
+  * @{
58
+  */
59
+   
60
+/**
61
+  * @brief  I2C Configuration Structure definition
62
+  */
63
+typedef struct
64
+{
65
+  uint32_t ClockSpeed;       /*!< Specifies the clock frequency.
66
+                                  This parameter must be set to a value lower than 400kHz */
67
+
68
+  uint32_t DutyCycle;        /*!< Specifies the I2C fast mode duty cycle.
69
+                                  This parameter can be a value of @ref I2C_duty_cycle_in_fast_mode */
70
+
71
+  uint32_t OwnAddress1;      /*!< Specifies the first device own address.
72
+                                  This parameter can be a 7-bit or 10-bit address. */
73
+
74
+  uint32_t AddressingMode;   /*!< Specifies if 7-bit or 10-bit addressing mode is selected.
75
+                                  This parameter can be a value of @ref I2C_addressing_mode */
76
+
77
+  uint32_t DualAddressMode;  /*!< Specifies if dual addressing mode is selected.
78
+                                  This parameter can be a value of @ref I2C_dual_addressing_mode */
79
+
80
+  uint32_t OwnAddress2;      /*!< Specifies the second device own address if dual addressing mode is selected
81
+                                  This parameter can be a 7-bit address. */
82
+
83
+  uint32_t GeneralCallMode;  /*!< Specifies if general call mode is selected.
84
+                                  This parameter can be a value of @ref I2C_general_call_addressing_mode */
85
+
86
+  uint32_t NoStretchMode;    /*!< Specifies if nostretch mode is selected.
87
+                                  This parameter can be a value of @ref I2C_nostretch_mode */
88
+
89
+}I2C_InitTypeDef;
90
+
91
+/**
92
+  * @brief  HAL State structure definition
93
+  * @note  HAL I2C State value coding follow below described bitmap :
94
+  *          b7-b6  Error information 
95
+  *             00 : No Error
96
+  *             01 : Abort (Abort user request on going)
97
+  *             10 : Timeout
98
+  *             11 : Error
99
+  *          b5     IP initilisation status
100
+  *             0  : Reset (IP not initialized)
101
+  *             1  : Init done (IP initialized and ready to use. HAL I2C Init function called)
102
+  *          b4     (not used)
103
+  *             x  : Should be set to 0
104
+  *          b3
105
+  *             0  : Ready or Busy (No Listen mode ongoing)
106
+  *             1  : Listen (IP in Address Listen Mode)
107
+  *          b2     Intrinsic process state
108
+  *             0  : Ready
109
+  *             1  : Busy (IP busy with some configuration or internal operations)
110
+  *          b1     Rx state
111
+  *             0  : Ready (no Rx operation ongoing)
112
+  *             1  : Busy (Rx operation ongoing)
113
+  *          b0     Tx state
114
+  *             0  : Ready (no Tx operation ongoing)
115
+  *             1  : Busy (Tx operation ongoing)
116
+  */
117
+typedef enum
118
+{
119
+  HAL_I2C_STATE_RESET             = 0x00U,   /*!< Peripheral is not yet Initialized         */
120
+  HAL_I2C_STATE_READY             = 0x20U,   /*!< Peripheral Initialized and ready for use  */
121
+  HAL_I2C_STATE_BUSY              = 0x24U,   /*!< An internal process is ongoing            */
122
+  HAL_I2C_STATE_BUSY_TX           = 0x21U,   /*!< Data Transmission process is ongoing      */
123
+  HAL_I2C_STATE_BUSY_RX           = 0x22U,   /*!< Data Reception process is ongoing         */
124
+  HAL_I2C_STATE_LISTEN            = 0x28U,   /*!< Address Listen Mode is ongoing            */
125
+  HAL_I2C_STATE_BUSY_TX_LISTEN    = 0x29U,   /*!< Address Listen Mode and Data Transmission
126
+                                                 process is ongoing                         */
127
+  HAL_I2C_STATE_BUSY_RX_LISTEN    = 0x2AU,   /*!< Address Listen Mode and Data Reception
128
+                                                 process is ongoing                         */
129
+  HAL_I2C_STATE_ABORT             = 0x60U,   /*!< Abort user request ongoing                */
130
+  HAL_I2C_STATE_TIMEOUT           = 0xA0U,   /*!< Timeout state                             */
131
+  HAL_I2C_STATE_ERROR             = 0xE0U    /*!< Error                                     */
132
+
133
+}HAL_I2C_StateTypeDef;
134
+
135
+/**
136
+  * @brief  HAL Mode structure definition
137
+  * @note  HAL I2C Mode value coding follow below described bitmap :
138
+  *          b7     (not used)
139
+  *             x  : Should be set to 0
140
+  *          b6
141
+  *             0  : None
142
+  *             1  : Memory (HAL I2C communication is in Memory Mode)
143
+  *          b5
144
+  *             0  : None
145
+  *             1  : Slave (HAL I2C communication is in Slave Mode)
146
+  *          b4
147
+  *             0  : None
148
+  *             1  : Master (HAL I2C communication is in Master Mode)
149
+  *          b3-b2-b1-b0  (not used)
150
+  *             xxxx : Should be set to 0000
151
+  */
152
+typedef enum
153
+{
154
+  HAL_I2C_MODE_NONE               = 0x00U,   /*!< No I2C communication on going             */
155
+  HAL_I2C_MODE_MASTER             = 0x10U,   /*!< I2C communication is in Master Mode       */
156
+  HAL_I2C_MODE_SLAVE              = 0x20U,   /*!< I2C communication is in Slave Mode        */
157
+  HAL_I2C_MODE_MEM                = 0x40U    /*!< I2C communication is in Memory Mode       */
158
+
159
+}HAL_I2C_ModeTypeDef;
160
+
161
+/**
162
+  * @brief  I2C handle Structure definition
163
+  */
164
+typedef struct
165
+{
166
+  I2C_TypeDef                *Instance;      /*!< I2C registers base address               */
167
+                                             
168
+  I2C_InitTypeDef            Init;           /*!< I2C communication parameters             */
169
+                                             
170
+  uint8_t                    *pBuffPtr;      /*!< Pointer to I2C transfer buffer           */
171
+                                             
172
+  uint16_t                   XferSize;       /*!< I2C transfer size                        */
173
+                                             
174
+  __IO uint16_t              XferCount;      /*!< I2C transfer counter                     */
175
+                                             
176
+  __IO uint32_t              XferOptions;    /*!< I2C transfer options                     */
177
+                                             
178
+  __IO uint32_t              PreviousState;  /*!< I2C communication Previous state and mode
179
+                                                  context for internal usage               */
180
+                                             
181
+  DMA_HandleTypeDef          *hdmatx;        /*!< I2C Tx DMA handle parameters             */
182
+                                             
183
+  DMA_HandleTypeDef          *hdmarx;        /*!< I2C Rx DMA handle parameters             */
184
+                                             
185
+  HAL_LockTypeDef            Lock;           /*!< I2C locking object                       */
186
+                                             
187
+  __IO HAL_I2C_StateTypeDef  State;          /*!< I2C communication state                  */
188
+                                             
189
+  __IO HAL_I2C_ModeTypeDef   Mode;           /*!< I2C communication mode                   */
190
+                                             
191
+  __IO uint32_t              ErrorCode;      /*!< I2C Error code                           */
192
+
193
+  __IO uint32_t              Devaddress;     /*!< I2C Target device address                */
194
+
195
+  __IO uint32_t              Memaddress;     /*!< I2C Target memory address                */
196
+
197
+  __IO uint32_t              MemaddSize;     /*!< I2C Target memory address  size          */
198
+
199
+  __IO uint32_t              EventCount;     /*!< I2C Event counter                        */
200
+	
201
+}I2C_HandleTypeDef;
202
+
203
+/**
204
+  * @}
205
+  */
206
+
207
+/* Exported constants --------------------------------------------------------*/
208
+/** @defgroup I2C_Exported_Constants I2C Exported Constants
209
+  * @{
210
+  */
211
+
212
+/** @defgroup I2C_Error_Code I2C Error Code
213
+  * @brief    I2C Error Code 
214
+  * @{
215
+  */ 
216
+#define HAL_I2C_ERROR_NONE       0x00000000U    /*!< No error           */
217
+#define HAL_I2C_ERROR_BERR       0x00000001U    /*!< BERR error         */
218
+#define HAL_I2C_ERROR_ARLO       0x00000002U    /*!< ARLO error         */
219
+#define HAL_I2C_ERROR_AF         0x00000004U    /*!< AF error           */
220
+#define HAL_I2C_ERROR_OVR        0x00000008U    /*!< OVR error          */
221
+#define HAL_I2C_ERROR_DMA        0x00000010U    /*!< DMA transfer error */
222
+#define HAL_I2C_ERROR_TIMEOUT    0x00000020U    /*!< Timeout Error      */
223
+/**
224
+  * @}
225
+  */
226
+
227
+/** @defgroup I2C_duty_cycle_in_fast_mode I2C duty cycle in fast mode
228
+  * @{
229
+  */
230
+#define I2C_DUTYCYCLE_2                 0x00000000U
231
+#define I2C_DUTYCYCLE_16_9              I2C_CCR_DUTY
232
+/**
233
+  * @}
234
+  */
235
+
236
+/** @defgroup I2C_addressing_mode I2C addressing mode
237
+  * @{
238
+  */
239
+#define I2C_ADDRESSINGMODE_7BIT         0x00004000U
240
+#define I2C_ADDRESSINGMODE_10BIT        (I2C_OAR1_ADDMODE | 0x00004000U)
241
+/**
242
+  * @}
243
+  */
244
+
245
+/** @defgroup I2C_dual_addressing_mode  I2C dual addressing mode
246
+  * @{
247
+  */
248
+#define I2C_DUALADDRESS_DISABLE        0x00000000U
249
+#define I2C_DUALADDRESS_ENABLE         I2C_OAR2_ENDUAL
250
+/**
251
+  * @}
252
+  */
253
+
254
+/** @defgroup I2C_general_call_addressing_mode I2C general call addressing mode
255
+  * @{
256
+  */
257
+#define I2C_GENERALCALL_DISABLE        0x00000000U
258
+#define I2C_GENERALCALL_ENABLE         I2C_CR1_ENGC
259
+/**
260
+  * @}
261
+  */
262
+
263
+/** @defgroup I2C_nostretch_mode I2C nostretch mode
264
+  * @{
265
+  */
266
+#define I2C_NOSTRETCH_DISABLE          0x00000000U
267
+#define I2C_NOSTRETCH_ENABLE           I2C_CR1_NOSTRETCH
268
+/**
269
+  * @}
270
+  */
271
+
272
+/** @defgroup I2C_Memory_Address_Size I2C Memory Address Size
273
+  * @{
274
+  */
275
+#define I2C_MEMADD_SIZE_8BIT            0x00000001U
276
+#define I2C_MEMADD_SIZE_16BIT           0x00000010U
277
+/**
278
+  * @}
279
+  */
280
+
281
+/** @defgroup I2C_XferDirection_definition I2C XferDirection definition
282
+  * @{
283
+  */
284
+#define I2C_DIRECTION_RECEIVE           0x00000000U 
285
+#define I2C_DIRECTION_TRANSMIT          0x00000001U
286
+/**
287
+  * @}
288
+  */
289
+
290
+/** @defgroup I2C_XferOptions_definition I2C XferOptions definition
291
+  * @{
292
+  */
293
+#define  I2C_FIRST_FRAME                0x00000001U
294
+#define  I2C_NEXT_FRAME                 0x00000002U
295
+#define  I2C_FIRST_AND_LAST_FRAME       0x00000004U
296
+#define  I2C_LAST_FRAME                 0x00000008U
297
+/**
298
+  * @}
299
+  */
300
+
301
+/** @defgroup I2C_Interrupt_configuration_definition I2C Interrupt configuration definition
302
+  * @{
303
+  */
304
+#define I2C_IT_BUF                      I2C_CR2_ITBUFEN
305
+#define I2C_IT_EVT                      I2C_CR2_ITEVTEN
306
+#define I2C_IT_ERR                      I2C_CR2_ITERREN
307
+/**
308
+  * @}
309
+  */
310
+
311
+/** @defgroup I2C_Flag_definition I2C Flag definition
312
+  * @{
313
+  */
314
+#define I2C_FLAG_SMBALERT               0x00018000U
315
+#define I2C_FLAG_TIMEOUT                0x00014000U
316
+#define I2C_FLAG_PECERR                 0x00011000U
317
+#define I2C_FLAG_OVR                    0x00010800U
318
+#define I2C_FLAG_AF                     0x00010400U
319
+#define I2C_FLAG_ARLO                   0x00010200U
320
+#define I2C_FLAG_BERR                   0x00010100U
321
+#define I2C_FLAG_TXE                    0x00010080U
322
+#define I2C_FLAG_RXNE                   0x00010040U
323
+#define I2C_FLAG_STOPF                  0x00010010U
324
+#define I2C_FLAG_ADD10                  0x00010008U
325
+#define I2C_FLAG_BTF                    0x00010004U
326
+#define I2C_FLAG_ADDR                   0x00010002U
327
+#define I2C_FLAG_SB                     0x00010001U
328
+#define I2C_FLAG_DUALF                  0x00100080U
329
+#define I2C_FLAG_SMBHOST                0x00100040U
330
+#define I2C_FLAG_SMBDEFAULT             0x00100020U
331
+#define I2C_FLAG_GENCALL                0x00100010U
332
+#define I2C_FLAG_TRA                    0x00100004U
333
+#define I2C_FLAG_BUSY                   0x00100002U
334
+#define I2C_FLAG_MSL                    0x00100001U
335
+/**
336
+  * @}
337
+  */
338
+
339
+/**
340
+  * @}
341
+  */
342
+
343
+/* Exported macro ------------------------------------------------------------*/
344
+/** @defgroup I2C_Exported_Macros I2C Exported Macros
345
+  * @{
346
+  */
347
+
348
+/** @brief Reset I2C handle state
349
+  * @param  __HANDLE__: specifies the I2C Handle.
350
+  *         This parameter can be I2C where x: 1, 2, or 3 to select the I2C peripheral.
351
+  * @retval None
352
+  */
353
+#define __HAL_I2C_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_I2C_STATE_RESET)
354
+
355
+/** @brief  Enable or disable the specified I2C interrupts.
356
+  * @param  __HANDLE__: specifies the I2C Handle.
357
+  *         This parameter can be I2C where x: 1, 2, or 3 to select the I2C peripheral.
358
+  * @param  __INTERRUPT__: specifies the interrupt source to enable or disable.
359
+  *         This parameter can be one of the following values:
360
+  *            @arg I2C_IT_BUF: Buffer interrupt enable
361
+  *            @arg I2C_IT_EVT: Event interrupt enable
362
+  *            @arg I2C_IT_ERR: Error interrupt enable
363
+  * @retval None
364
+  */
365
+#define __HAL_I2C_ENABLE_IT(__HANDLE__, __INTERRUPT__)   ((__HANDLE__)->Instance->CR2 |= (__INTERRUPT__))
366
+#define __HAL_I2C_DISABLE_IT(__HANDLE__, __INTERRUPT__)  ((__HANDLE__)->Instance->CR2 &= (~(__INTERRUPT__)))
367
+
368
+/** @brief  Checks if the specified I2C interrupt source is enabled or disabled.
369
+  * @param  __HANDLE__: specifies the I2C Handle.
370
+  *         This parameter can be I2C where x: 1, 2, or 3 to select the I2C peripheral.
371
+  * @param  __INTERRUPT__: specifies the I2C interrupt source to check.
372
+  *          This parameter can be one of the following values:
373
+  *            @arg I2C_IT_BUF: Buffer interrupt enable
374
+  *            @arg I2C_IT_EVT: Event interrupt enable
375
+  *            @arg I2C_IT_ERR: Error interrupt enable
376
+  * @retval The new state of __INTERRUPT__ (TRUE or FALSE).
377
+  */
378
+#define __HAL_I2C_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__) ((((__HANDLE__)->Instance->CR2 & (__INTERRUPT__)) == (__INTERRUPT__)) ? SET : RESET)
379
+
380
+/** @brief  Checks whether the specified I2C flag is set or not.
381
+  * @param  __HANDLE__: specifies the I2C Handle.
382
+  *         This parameter can be I2C where x: 1, 2, or 3 to select the I2C peripheral.
383
+  * @param  __FLAG__: specifies the flag to check.
384
+  *         This parameter can be one of the following values:
385
+  *            @arg I2C_FLAG_SMBALERT: SMBus Alert flag
386
+  *            @arg I2C_FLAG_TIMEOUT: Timeout or Tlow error flag
387
+  *            @arg I2C_FLAG_PECERR: PEC error in reception flag
388
+  *            @arg I2C_FLAG_OVR: Overrun/Underrun flag
389
+  *            @arg I2C_FLAG_AF: Acknowledge failure flag
390
+  *            @arg I2C_FLAG_ARLO: Arbitration lost flag
391
+  *            @arg I2C_FLAG_BERR: Bus error flag
392
+  *            @arg I2C_FLAG_TXE: Data register empty flag
393
+  *            @arg I2C_FLAG_RXNE: Data register not empty flag
394
+  *            @arg I2C_FLAG_STOPF: Stop detection flag
395
+  *            @arg I2C_FLAG_ADD10: 10-bit header sent flag
396
+  *            @arg I2C_FLAG_BTF: Byte transfer finished flag
397
+  *            @arg I2C_FLAG_ADDR: Address sent flag
398
+  *                                Address matched flag
399
+  *            @arg I2C_FLAG_SB: Start bit flag
400
+  *            @arg I2C_FLAG_DUALF: Dual flag
401
+  *            @arg I2C_FLAG_SMBHOST: SMBus host header
402
+  *            @arg I2C_FLAG_SMBDEFAULT: SMBus default header
403
+  *            @arg I2C_FLAG_GENCALL: General call header flag
404
+  *            @arg I2C_FLAG_TRA: Transmitter/Receiver flag
405
+  *            @arg I2C_FLAG_BUSY: Bus busy flag
406
+  *            @arg I2C_FLAG_MSL: Master/Slave flag
407
+  * @retval The new state of __FLAG__ (TRUE or FALSE).
408
+  */
409
+#define __HAL_I2C_GET_FLAG(__HANDLE__, __FLAG__) ((((uint8_t)((__FLAG__) >> 16U)) == 0x01U)?((((__HANDLE__)->Instance->SR1) & ((__FLAG__) & I2C_FLAG_MASK)) == ((__FLAG__) & I2C_FLAG_MASK)): \
410
+                                                 ((((__HANDLE__)->Instance->SR2) & ((__FLAG__) & I2C_FLAG_MASK)) == ((__FLAG__) & I2C_FLAG_MASK)))
411
+
412
+/** @brief  Clears the I2C pending flags which are cleared by writing 0 in a specific bit.
413
+  * @param  __HANDLE__: specifies the I2C Handle.
414
+  *         This parameter can be I2C where x: 1, 2, or 3 to select the I2C peripheral.
415
+  * @param  __FLAG__: specifies the flag to clear.
416
+  *         This parameter can be any combination of the following values:
417
+  *            @arg I2C_FLAG_SMBALERT: SMBus Alert flag
418
+  *            @arg I2C_FLAG_TIMEOUT: Timeout or Tlow error flag
419
+  *            @arg I2C_FLAG_PECERR: PEC error in reception flag
420
+  *            @arg I2C_FLAG_OVR: Overrun/Underrun flag (Slave mode)
421
+  *            @arg I2C_FLAG_AF: Acknowledge failure flag
422
+  *            @arg I2C_FLAG_ARLO: Arbitration lost flag (Master mode)
423
+  *            @arg I2C_FLAG_BERR: Bus error flag
424
+  * @retval None
425
+  */
426
+#define __HAL_I2C_CLEAR_FLAG(__HANDLE__, __FLAG__) ((__HANDLE__)->Instance->SR1 = ~((__FLAG__) & I2C_FLAG_MASK))
427
+
428
+/** @brief  Clears the I2C ADDR pending flag.
429
+  * @param  __HANDLE__: specifies the I2C Handle.
430
+  *         This parameter can be I2C where x: 1, 2, or 3 to select the I2C peripheral.
431
+  * @retval None
432
+  */
433
+#define __HAL_I2C_CLEAR_ADDRFLAG(__HANDLE__)    \
434
+  do{                                           \
435
+    __IO uint32_t tmpreg = 0x00U;               \
436
+    tmpreg = (__HANDLE__)->Instance->SR1;       \
437
+    tmpreg = (__HANDLE__)->Instance->SR2;       \
438
+    UNUSED(tmpreg);                             \
439
+  } while(0U)
440
+
441
+/** @brief  Clears the I2C STOPF pending flag.
442
+  * @param  __HANDLE__: specifies the I2C Handle.
443
+  *         This parameter can be I2C where x: 1, 2, or 3 to select the I2C peripheral.
444
+  * @retval None
445
+  */
446
+#define __HAL_I2C_CLEAR_STOPFLAG(__HANDLE__)    \
447
+  do{                                           \
448
+    __IO uint32_t tmpreg = 0x00U;               \
449
+    tmpreg = (__HANDLE__)->Instance->SR1;       \
450
+    (__HANDLE__)->Instance->CR1 |= I2C_CR1_PE;  \
451
+    UNUSED(tmpreg);                             \
452
+  } while(0U)
453
+    
454
+/** @brief  Enable the I2C peripheral.
455
+  * @param  __HANDLE__: specifies the I2C Handle.
456
+  *         This parameter can be I2Cx where x: 1 or 2  to select the I2C peripheral.
457
+  * @retval None
458
+  */
459
+#define __HAL_I2C_ENABLE(__HANDLE__)                             ((__HANDLE__)->Instance->CR1 |=  I2C_CR1_PE)
460
+
461
+/** @brief  Disable the I2C peripheral.
462
+  * @param  __HANDLE__: specifies the I2C Handle.
463
+  *         This parameter can be I2Cx where x: 1 or 2  to select the I2C peripheral.
464
+  * @retval None
465
+  */
466
+#define __HAL_I2C_DISABLE(__HANDLE__)                            ((__HANDLE__)->Instance->CR1 &=  ~I2C_CR1_PE)
467
+
468
+/**
469
+  * @}
470
+  */
471
+
472
+/* Exported functions --------------------------------------------------------*/
473
+/** @addtogroup I2C_Exported_Functions
474
+  * @{
475
+  */
476
+
477
+/** @addtogroup I2C_Exported_Functions_Group1
478
+  * @{
479
+  */
480
+/* Initialization/de-initialization functions  **********************************/
481
+HAL_StatusTypeDef HAL_I2C_Init(I2C_HandleTypeDef *hi2c);
482
+HAL_StatusTypeDef HAL_I2C_DeInit (I2C_HandleTypeDef *hi2c);
483
+void HAL_I2C_MspInit(I2C_HandleTypeDef *hi2c);
484
+void HAL_I2C_MspDeInit(I2C_HandleTypeDef *hi2c);
485
+/**
486
+  * @}
487
+  */
488
+
489
+/** @addtogroup I2C_Exported_Functions_Group2
490
+  * @{
491
+  */
492
+/* I/O operation functions  *****************************************************/
493
+/******* Blocking mode: Polling */
494
+HAL_StatusTypeDef HAL_I2C_Master_Transmit(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t *pData, uint16_t Size, uint32_t Timeout);
495
+HAL_StatusTypeDef HAL_I2C_Master_Receive(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t *pData, uint16_t Size, uint32_t Timeout);
496
+HAL_StatusTypeDef HAL_I2C_Slave_Transmit(I2C_HandleTypeDef *hi2c, uint8_t *pData, uint16_t Size, uint32_t Timeout);
497
+HAL_StatusTypeDef HAL_I2C_Slave_Receive(I2C_HandleTypeDef *hi2c, uint8_t *pData, uint16_t Size, uint32_t Timeout);
498
+HAL_StatusTypeDef HAL_I2C_Mem_Write(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint16_t MemAddress, uint16_t MemAddSize, uint8_t *pData, uint16_t Size, uint32_t Timeout);
499
+HAL_StatusTypeDef HAL_I2C_Mem_Read(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint16_t MemAddress, uint16_t MemAddSize, uint8_t *pData, uint16_t Size, uint32_t Timeout);
500
+HAL_StatusTypeDef HAL_I2C_IsDeviceReady(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint32_t Trials, uint32_t Timeout);
501
+
502
+/******* Non-Blocking mode: Interrupt */
503
+HAL_StatusTypeDef HAL_I2C_Master_Transmit_IT(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t *pData, uint16_t Size);
504
+HAL_StatusTypeDef HAL_I2C_Master_Receive_IT(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t *pData, uint16_t Size);
505
+HAL_StatusTypeDef HAL_I2C_Slave_Transmit_IT(I2C_HandleTypeDef *hi2c, uint8_t *pData, uint16_t Size);
506
+HAL_StatusTypeDef HAL_I2C_Slave_Receive_IT(I2C_HandleTypeDef *hi2c, uint8_t *pData, uint16_t Size);
507
+HAL_StatusTypeDef HAL_I2C_Mem_Write_IT(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint16_t MemAddress, uint16_t MemAddSize, uint8_t *pData, uint16_t Size);
508
+HAL_StatusTypeDef HAL_I2C_Mem_Read_IT(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint16_t MemAddress, uint16_t MemAddSize, uint8_t *pData, uint16_t Size);
509
+
510
+HAL_StatusTypeDef HAL_I2C_Master_Sequential_Transmit_IT(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t *pData, uint16_t Size, uint32_t XferOptions);
511
+HAL_StatusTypeDef HAL_I2C_Master_Sequential_Receive_IT(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t *pData, uint16_t Size, uint32_t XferOptions);
512
+HAL_StatusTypeDef HAL_I2C_Slave_Sequential_Transmit_IT(I2C_HandleTypeDef *hi2c, uint8_t *pData, uint16_t Size, uint32_t XferOptions);
513
+HAL_StatusTypeDef HAL_I2C_Slave_Sequential_Receive_IT(I2C_HandleTypeDef *hi2c, uint8_t *pData, uint16_t Size, uint32_t XferOptions);
514
+HAL_StatusTypeDef HAL_I2C_Master_Abort_IT(I2C_HandleTypeDef *hi2c, uint16_t DevAddress);
515
+HAL_StatusTypeDef HAL_I2C_EnableListen_IT(I2C_HandleTypeDef *hi2c);
516
+HAL_StatusTypeDef HAL_I2C_DisableListen_IT(I2C_HandleTypeDef *hi2c);
517
+
518
+/******* Non-Blocking mode: DMA */
519
+HAL_StatusTypeDef HAL_I2C_Master_Transmit_DMA(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t *pData, uint16_t Size);
520
+HAL_StatusTypeDef HAL_I2C_Master_Receive_DMA(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t *pData, uint16_t Size);
521
+HAL_StatusTypeDef HAL_I2C_Slave_Transmit_DMA(I2C_HandleTypeDef *hi2c, uint8_t *pData, uint16_t Size);
522
+HAL_StatusTypeDef HAL_I2C_Slave_Receive_DMA(I2C_HandleTypeDef *hi2c, uint8_t *pData, uint16_t Size);
523
+HAL_StatusTypeDef HAL_I2C_Mem_Write_DMA(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint16_t MemAddress, uint16_t MemAddSize, uint8_t *pData, uint16_t Size);
524
+HAL_StatusTypeDef HAL_I2C_Mem_Read_DMA(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint16_t MemAddress, uint16_t MemAddSize, uint8_t *pData, uint16_t Size);
525
+
526
+/******* I2C IRQHandler and Callbacks used in non blocking modes (Interrupt and DMA) */
527
+void HAL_I2C_EV_IRQHandler(I2C_HandleTypeDef *hi2c);
528
+void HAL_I2C_ER_IRQHandler(I2C_HandleTypeDef *hi2c);
529
+void HAL_I2C_MasterTxCpltCallback(I2C_HandleTypeDef *hi2c);
530
+void HAL_I2C_MasterRxCpltCallback(I2C_HandleTypeDef *hi2c);
531
+void HAL_I2C_SlaveTxCpltCallback(I2C_HandleTypeDef *hi2c);
532
+void HAL_I2C_SlaveRxCpltCallback(I2C_HandleTypeDef *hi2c);
533
+void HAL_I2C_AddrCallback(I2C_HandleTypeDef *hi2c, uint8_t TransferDirection, uint16_t AddrMatchCode);
534
+void HAL_I2C_ListenCpltCallback(I2C_HandleTypeDef *hi2c);
535
+void HAL_I2C_MemTxCpltCallback(I2C_HandleTypeDef *hi2c);
536
+void HAL_I2C_MemRxCpltCallback(I2C_HandleTypeDef *hi2c);
537
+void HAL_I2C_ErrorCallback(I2C_HandleTypeDef *hi2c);
538
+void HAL_I2C_AbortCpltCallback(I2C_HandleTypeDef *hi2c);
539
+/**
540
+  * @}
541
+  */
542
+
543
+/** @addtogroup I2C_Exported_Functions_Group3
544
+  * @{
545
+  */
546
+/* Peripheral State, Mode and Errors functions  *********************************/
547
+HAL_I2C_StateTypeDef HAL_I2C_GetState(I2C_HandleTypeDef *hi2c);
548
+HAL_I2C_ModeTypeDef HAL_I2C_GetMode(I2C_HandleTypeDef *hi2c);
549
+uint32_t HAL_I2C_GetError(I2C_HandleTypeDef *hi2c);
550
+
551
+/**
552
+  * @}
553
+  */
554
+
555
+/**
556
+  * @}
557
+  */
558
+/* Private types -------------------------------------------------------------*/
559
+/* Private variables ---------------------------------------------------------*/
560
+/* Private constants ---------------------------------------------------------*/
561
+/** @defgroup I2C_Private_Constants I2C Private Constants
562
+  * @{
563
+  */
564
+#define I2C_FLAG_MASK                    0x0000FFFFU
565
+#define I2C_MIN_PCLK_FREQ_STANDARD       2000000U     /*!< 2 MHz                     */
566
+#define I2C_MIN_PCLK_FREQ_FAST           4000000U     /*!< 4 MHz                     */
567
+/**
568
+  * @}
569
+  */
570
+
571
+/* Private macros ------------------------------------------------------------*/
572
+/** @defgroup I2C_Private_Macros I2C Private Macros
573
+  * @{
574
+  */
575
+
576
+#define I2C_MIN_PCLK_FREQ(__PCLK__, __SPEED__)             (((__SPEED__) <= 100000U) ? ((__PCLK__) < I2C_MIN_PCLK_FREQ_STANDARD) : ((__PCLK__) < I2C_MIN_PCLK_FREQ_FAST))
577
+#define I2C_CCR_CALCULATION(__PCLK__, __SPEED__, __COEFF__)     (((((__PCLK__) - 1U)/((__SPEED__) * (__COEFF__))) + 1U) & I2C_CCR_CCR)
578
+#define I2C_FREQRANGE(__PCLK__)                            ((__PCLK__)/1000000U)
579
+#define I2C_RISE_TIME(__FREQRANGE__, __SPEED__)            (((__SPEED__) <= 100000U) ? ((__FREQRANGE__) + 1U) : ((((__FREQRANGE__) * 300U) / 1000U) + 1U))
580
+#define I2C_SPEED_STANDARD(__PCLK__, __SPEED__)            ((I2C_CCR_CALCULATION((__PCLK__), (__SPEED__), 2U) < 4U)? 4U:I2C_CCR_CALCULATION((__PCLK__), (__SPEED__), 2U))
581
+#define I2C_SPEED_FAST(__PCLK__, __SPEED__, __DUTYCYCLE__) (((__DUTYCYCLE__) == I2C_DUTYCYCLE_2)? I2C_CCR_CALCULATION((__PCLK__), (__SPEED__), 3U) : (I2C_CCR_CALCULATION((__PCLK__), (__SPEED__), 25U) | I2C_DUTYCYCLE_16_9))
582
+#define I2C_SPEED(__PCLK__, __SPEED__, __DUTYCYCLE__)      (((__SPEED__) <= 100000U)? (I2C_SPEED_STANDARD((__PCLK__), (__SPEED__))) : \
583
+                                                                  ((I2C_SPEED_FAST((__PCLK__), (__SPEED__), (__DUTYCYCLE__)) & I2C_CCR_CCR) == 0U)? 1U : \
584
+                                                                  ((I2C_SPEED_FAST((__PCLK__), (__SPEED__), (__DUTYCYCLE__))) | I2C_CCR_FS))
585
+
586
+#define I2C_7BIT_ADD_WRITE(__ADDRESS__)                    ((uint8_t)((__ADDRESS__) & (~I2C_OAR1_ADD0)))
587
+#define I2C_7BIT_ADD_READ(__ADDRESS__)                     ((uint8_t)((__ADDRESS__) | I2C_OAR1_ADD0))
588
+
589
+#define I2C_10BIT_ADDRESS(__ADDRESS__)                     ((uint8_t)((uint16_t)((__ADDRESS__) & (uint16_t)(0x00FFU))))
590
+#define I2C_10BIT_HEADER_WRITE(__ADDRESS__)                ((uint8_t)((uint16_t)((uint16_t)(((uint16_t)((__ADDRESS__) & (uint16_t)(0x0300U))) >> 7U) | (uint16_t)(0x00F0U))))
591
+#define I2C_10BIT_HEADER_READ(__ADDRESS__)                 ((uint8_t)((uint16_t)((uint16_t)(((uint16_t)((__ADDRESS__) & (uint16_t)(0x0300U))) >> 7U) | (uint16_t)(0x00F1U))))
592
+
593
+#define I2C_MEM_ADD_MSB(__ADDRESS__)                       ((uint8_t)((uint16_t)(((uint16_t)((__ADDRESS__) & (uint16_t)(0xFF00U))) >> 8U)))
594
+#define I2C_MEM_ADD_LSB(__ADDRESS__)                       ((uint8_t)((uint16_t)((__ADDRESS__) & (uint16_t)(0x00FFU))))
595
+
596
+/** @defgroup I2C_IS_RTC_Definitions I2C Private macros to check input parameters
597
+  * @{
598
+  */
599
+#define IS_I2C_DUTY_CYCLE(CYCLE) (((CYCLE) == I2C_DUTYCYCLE_2) || \
600
+                                  ((CYCLE) == I2C_DUTYCYCLE_16_9))
601
+#define IS_I2C_ADDRESSING_MODE(ADDRESS) (((ADDRESS) == I2C_ADDRESSINGMODE_7BIT) || \
602
+                                         ((ADDRESS) == I2C_ADDRESSINGMODE_10BIT))
603
+#define IS_I2C_DUAL_ADDRESS(ADDRESS) (((ADDRESS) == I2C_DUALADDRESS_DISABLE) || \
604
+                                      ((ADDRESS) == I2C_DUALADDRESS_ENABLE))
605
+#define IS_I2C_GENERAL_CALL(CALL) (((CALL) == I2C_GENERALCALL_DISABLE) || \
606
+                                   ((CALL) == I2C_GENERALCALL_ENABLE))
607
+#define IS_I2C_NO_STRETCH(STRETCH) (((STRETCH) == I2C_NOSTRETCH_DISABLE) || \
608
+                                    ((STRETCH) == I2C_NOSTRETCH_ENABLE))
609
+#define IS_I2C_MEMADD_SIZE(SIZE) (((SIZE) == I2C_MEMADD_SIZE_8BIT) || \
610
+                                  ((SIZE) == I2C_MEMADD_SIZE_16BIT))
611
+#define IS_I2C_CLOCK_SPEED(SPEED) (((SPEED) > 0) && ((SPEED) <= 400000U))
612
+#define IS_I2C_OWN_ADDRESS1(ADDRESS1) (((ADDRESS1) & (uint32_t)(0xFFFFFC00U)) == 0U)
613
+#define IS_I2C_OWN_ADDRESS2(ADDRESS2) (((ADDRESS2) & (uint32_t)(0xFFFFFF01U)) == 0U)
614
+#define IS_I2C_TRANSFER_OPTIONS_REQUEST(REQUEST)      (((REQUEST) == I2C_FIRST_FRAME)              || \
615
+                                                       ((REQUEST) == I2C_NEXT_FRAME)               || \
616
+                                                       ((REQUEST) == I2C_FIRST_AND_LAST_FRAME)     || \
617
+                                                       ((REQUEST) == I2C_LAST_FRAME))
618
+/**
619
+  * @}
620
+  */
621
+
622
+/**
623
+  * @}
624
+  */
625
+
626
+/* Private functions ---------------------------------------------------------*/
627
+/** @defgroup I2C_Private_Functions I2C Private Functions
628
+  * @{
629
+  */
630
+
631
+/**
632
+  * @}
633
+  */
634
+
635
+/**
636
+  * @}
637
+  */
638
+
639
+/**
640
+  * @}
641
+  */
642
+
643
+#ifdef __cplusplus
644
+}
645
+#endif
646
+
647
+
648
+#endif /* __STM32F1xx_HAL_I2C_H */
649
+
650
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

Разлика између датотеке није приказан због своје велике величине
+ 5588 - 0
Drivers/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_i2c.c


+ 226 - 0
Inc/eeprom.h

@@ -0,0 +1,226 @@
1
+/*
2
+ * eeprom.h
3
+ *
4
+ *  Created on: 2020. 4. 22.
5
+ *      Author: parkyj
6
+ */
7
+
8
+#ifndef EEPROM_H_
9
+#define EEPROM_H_
10
+
11
+
12
+#define EEPROM_M24C08_ID                  0xA0
13
+#define EEPROM_Block0_ADDRESS             EEPROM_M24C08_ID
14
+#define EEPROM_ATT_BASE					  0x0000 + 96
15
+
16
+#if 0 // PYJ.2020.04.25_BEGIN --
17
+
18
+#define EEPROM_ATT_DL1_TABLE_ADDRESDS	 (( EEPROM_ATT_BASE                 +(sizeof(ATT_TABLE_st))   )  & 0xFFFF) //128
19
+#define EEPROM_ATT_DL2_TABLE_ADDRESDS	 (( EEPROM_ATT_DL1_TABLE_ADDRESDS  + (sizeof(ATT_TABLE_st))  ) & 0xFFFF) 
20
+#define EEPROM_ATT_DL3_TABLE_ADDRESDS	 (( EEPROM_ATT_DL2_TABLE_ADDRESDS  + (sizeof(ATT_TABLE_st))  ) & 0xFFFF)
21
+#define EEPROM_ATT_DL4_TABLE_ADDRESDS	 (( EEPROM_ATT_DL3_TABLE_ADDRESDS  + (sizeof(ATT_TABLE_st))  ) & 0xFFFF)
22
+#define EEPROM_ATT_UL1_TABLE_ADDRESDS	 (( EEPROM_ATT_DL4_TABLE_ADDRESDS  + (sizeof(ATT_TABLE_st))  )    & 0xFFFF)
23
+#define EEPROM_ATT_UL2_TABLE_ADDRESDS	 (( EEPROM_ATT_UL1_TABLE_ADDRESDS  + (sizeof(ATT_TABLE_st))  )    & 0xFFFF)
24
+#define EEPROM_ATT_UL3_TABLE_ADDRESDS	 (( EEPROM_ATT_UL2_TABLE_ADDRESDS  + (sizeof(ATT_TABLE_st))  )    & 0xFFFF)
25
+#define EEPROM_ATT_UL4_TABLE_ADDRESDS	 (( EEPROM_ATT_UL3_TABLE_ADDRESDS  + (sizeof(ATT_TABLE_st))  )    & 0xFFFF)//128
26
+#define EEPROM_DET_DL1_TABLE_ADDRESDS	 (( EEPROM_ATT_UL4_TABLE_ADDRESDS  + (sizeof(DET_TABLEDL_st)+ 2))    & 0xFFFF)
27
+#define EEPROM_DET_DL2_TABLE_ADDRESDS	 (( EEPROM_DET_DL1_TABLE_ADDRESDS  + (sizeof(DET_TABLEDL_st)+ 2))    & 0xFFFF)
28
+#define EEPROM_DET_DL3_TABLE_ADDRESDS	 (( EEPROM_DET_DL2_TABLE_ADDRESDS  + (sizeof(DET_TABLEDL_st)+ 2))    & 0xFFFF)
29
+#define EEPROM_DET_DL4_TABLE_ADDRESDS	 (( EEPROM_DET_DL3_TABLE_ADDRESDS  + (sizeof(DET_TABLEDL_st)+ 2))    & 0xFFFF)
30
+#define EEPROM_DET_UL1_TABLE_ADDRESDS	 (( EEPROM_DET_DL4_TABLE_ADDRESDS  + (sizeof(DET_TABLEUL_st) + 4))     & 0xFFFF)
31
+#define EEPROM_DET_UL2_TABLE_ADDRESDS	 (( EEPROM_DET_UL1_TABLE_ADDRESDS  + (sizeof(DET_TABLEUL_st)+ 4))     & 0xFFFF)
32
+#define EEPROM_DET_UL3_TABLE_ADDRESDS	 (( EEPROM_DET_UL2_TABLE_ADDRESDS  + (sizeof(DET_TABLEUL_st)+ 4))     & 0xFFFF)
33
+#define EEPROM_DET_UL4_TABLE_ADDRESDS	 (( EEPROM_DET_UL3_TABLE_ADDRESDS  + (sizeof(DET_TABLEUL_st)+ 4))     & 0xFFFF)
34
+#define EEPROM_TEMP_DL1_TABLE_ADDRESDS	 (( EEPROM_DET_UL4_TABLE_ADDRESDS  + (sizeof(TEMP_TABLE_st)+12))     & 0xFFFF)
35
+#define EEPROM_TEMP_DL2_TABLE_ADDRESDS	 (( EEPROM_TEMP_DL1_TABLE_ADDRESDS +( sizeof(TEMP_TABLE_st)+12))     & 0xFFFF)
36
+#define EEPROM_TEMP_DL3_TABLE_ADDRESDS	 (( EEPROM_TEMP_DL2_TABLE_ADDRESDS +( sizeof(TEMP_TABLE_st)+12))     & 0xFFFF)
37
+#define EEPROM_TEMP_DL4_TABLE_ADDRESDS	 (( EEPROM_TEMP_DL3_TABLE_ADDRESDS +( sizeof(TEMP_TABLE_st)+12))     & 0xFFFF)
38
+#define EEPROM_TEMP_UL1_TABLE_ADDRESDS	 (( EEPROM_TEMP_DL4_TABLE_ADDRESDS +( sizeof(TEMP_TABLE_st)+12))     & 0xFFFF)
39
+#define EEPROM_TEMP_UL2_TABLE_ADDRESDS	 (( EEPROM_TEMP_UL1_TABLE_ADDRESDS +( sizeof(TEMP_TABLE_st)+12))     & 0xFFFF)
40
+#define EEPROM_TEMP_UL3_TABLE_ADDRESDS	 (( EEPROM_TEMP_UL2_TABLE_ADDRESDS +( sizeof(TEMP_TABLE_st)+12))     & 0xFFFF)
41
+#define EEPROM_TEMP_UL4_TABLE_ADDRESDS	 (( EEPROM_TEMP_UL3_TABLE_ADDRESDS +( sizeof(TEMP_TABLE_st)+12))     & 0xFFFF)
42
+#define EEPROM_USER_ATTEN_VALUE_ADDRESDS (( EEPROM_TEMP_UL4_TABLE_ADDRESDS +( sizeof(USER_ATTEN_st)+16))     & 0xFFFF)
43
+#define EEPROM_WINDOW_STATUS_ADDRESDS	 ((EEPROM_USER_ATTEN_VALUE_ADDRESDS + (sizeof(BLUESTATUS_st))) & 0xFFFF) //96byte
44
+
45
+
46
+#define EEPROM_WINDOW_STATUS_ADDRESDS	 ((EEPROM_ATT_BASE + (sizeof(BLUESTATUS_st))) & 0xFFFF) //96byte
47
+#define EEPROM_ATT_DL1_TABLE_ADDRESDS	 (( EEPROM_WINDOW_STATUS_ADDRESDS  + (sizeof(ATT_TABLE_st))  )& 0xFFFF) //128
48
+#define EEPROM_ATT_DL2_TABLE_ADDRESDS	 (( EEPROM_ATT_DL1_TABLE_ADDRESDS  + (sizeof(ATT_TABLE_st))  ) & 0xFFFF) 
49
+#define EEPROM_ATT_DL3_TABLE_ADDRESDS	 (( EEPROM_ATT_DL2_TABLE_ADDRESDS  + (sizeof(ATT_TABLE_st))  ) & 0xFFFF)
50
+#define EEPROM_ATT_DL4_TABLE_ADDRESDS	 (( EEPROM_ATT_DL3_TABLE_ADDRESDS  + (sizeof(ATT_TABLE_st))  ) & 0xFFFF)
51
+#define EEPROM_ATT_UL1_TABLE_ADDRESDS	 (( EEPROM_ATT_DL4_TABLE_ADDRESDS  + (sizeof(ATT_TABLE_st))  )    & 0xFFFF)
52
+#define EEPROM_ATT_UL2_TABLE_ADDRESDS	 (( EEPROM_ATT_UL1_TABLE_ADDRESDS  + (sizeof(ATT_TABLE_st))  )    & 0xFFFF)
53
+#define EEPROM_ATT_UL3_TABLE_ADDRESDS	 (( EEPROM_ATT_UL2_TABLE_ADDRESDS  + (sizeof(ATT_TABLE_st))  )    & 0xFFFF)
54
+#define EEPROM_ATT_UL4_TABLE_ADDRESDS	 (( EEPROM_ATT_UL3_TABLE_ADDRESDS  + (sizeof(ATT_TABLE_st))  )    & 0xFFFF)//128
55
+#define EEPROM_DET_DL1_TABLE_ADDRESDS	 (( EEPROM_ATT_UL4_TABLE_ADDRESDS  + (sizeof(DET_TABLEDL_st)))    & 0xFFFF)
56
+#define EEPROM_DET_DL2_TABLE_ADDRESDS	 (( EEPROM_DET_DL1_TABLE_ADDRESDS  + (sizeof(DET_TABLEDL_st)))    & 0xFFFF)
57
+#define EEPROM_DET_DL3_TABLE_ADDRESDS	 (( EEPROM_DET_DL2_TABLE_ADDRESDS  + (sizeof(DET_TABLEDL_st)))    & 0xFFFF)
58
+#define EEPROM_DET_DL4_TABLE_ADDRESDS	 (( EEPROM_DET_DL3_TABLE_ADDRESDS  + (sizeof(DET_TABLEDL_st)))    & 0xFFFF)
59
+#define EEPROM_DET_UL1_TABLE_ADDRESDS	 (( EEPROM_DET_DL4_TABLE_ADDRESDS  + (sizeof(DET_TABLEUL_st)))     & 0xFFFF)
60
+#define EEPROM_DET_UL2_TABLE_ADDRESDS	 (( EEPROM_DET_UL1_TABLE_ADDRESDS  + (sizeof(DET_TABLEUL_st)))     & 0xFFFF)
61
+#define EEPROM_DET_UL3_TABLE_ADDRESDS	 (( EEPROM_DET_UL2_TABLE_ADDRESDS  + (sizeof(DET_TABLEUL_st)))     & 0xFFFF)
62
+#define EEPROM_DET_UL4_TABLE_ADDRESDS	 (( EEPROM_DET_UL3_TABLE_ADDRESDS  + (sizeof(DET_TABLEUL_st)))     & 0xFFFF)
63
+#define EEPROM_TEMP_DL1_TABLE_ADDRESDS	 (( EEPROM_DET_UL4_TABLE_ADDRESDS  + (sizeof(TEMP_TABLE_st)))     & 0xFFFF)
64
+#define EEPROM_TEMP_DL2_TABLE_ADDRESDS	 (( EEPROM_TEMP_DL1_TABLE_ADDRESDS +( sizeof(TEMP_TABLE_st)))     & 0xFFFF)
65
+#define EEPROM_TEMP_DL3_TABLE_ADDRESDS	 (( EEPROM_TEMP_DL2_TABLE_ADDRESDS +( sizeof(TEMP_TABLE_st)))     & 0xFFFF)
66
+#define EEPROM_TEMP_DL4_TABLE_ADDRESDS	 (( EEPROM_TEMP_DL3_TABLE_ADDRESDS +( sizeof(TEMP_TABLE_st)))     & 0xFFFF)
67
+#define EEPROM_TEMP_UL1_TABLE_ADDRESDS	 (( EEPROM_TEMP_DL4_TABLE_ADDRESDS +( sizeof(TEMP_TABLE_st)))     & 0xFFFF)
68
+#define EEPROM_TEMP_UL2_TABLE_ADDRESDS	 (( EEPROM_TEMP_UL1_TABLE_ADDRESDS +( sizeof(TEMP_TABLE_st)))     & 0xFFFF)
69
+#define EEPROM_TEMP_UL3_TABLE_ADDRESDS	 (( EEPROM_TEMP_UL2_TABLE_ADDRESDS +( sizeof(TEMP_TABLE_st)))     & 0xFFFF)
70
+#define EEPROM_TEMP_UL4_TABLE_ADDRESDS	 (( EEPROM_TEMP_UL3_TABLE_ADDRESDS +( sizeof(TEMP_TABLE_st)))     & 0xFFFF)
71
+
72
+#endif // PYJ.2020.04.25_END -- 
73
+
74
+
75
+
76
+#define MAKE_ADDRESS(_addr, _e2)            ((uint8_t)EEPROM_M24C08_ADDR | \
77
+                                             ((_e2) ? EEPROM_M24C08_ADDR_E2 : 0) | \
78
+                                             ((uint8_t)((_addr) >> 7) & EEPROM_M24C08_BYTE_ADDR_H))
79
+
80
+#define EEPROM_M24C08_ADDR                  0xA0        //!< M24C08 device identifier
81
+#define EEPROM_M24C08_ADDR_E2               0x08        //!< M24C08 E2 address bit
82
+
83
+
84
+
85
+
86
+#define EEPROM_M24C08_BYTE_ADDR_H           0x06
87
+
88
+HAL_StatusTypeDef EEPROM_M24C08_Read(uint8_t devid,uint16_t Address,uint8_t* data,uint16_t size);
89
+HAL_StatusTypeDef EEPROM_M24C08_write(uint8_t devid,uint16_t Address,uint8_t* data,uint16_t size);
90
+
91
+HAL_StatusTypeDef EEPROM_M24C08_ByteRead(uint16_t devid,uint16_t Address,uint8_t* data,uint8_t size);
92
+HAL_StatusTypeDef EEPROM_M24C08_Bytewrite(uint16_t devid,uint16_t Address,uint8_t* data,uint8_t size);
93
+HAL_StatusTypeDef EEPROM_M24C08_Zerowrite(uint8_t devid,uint16_t Address);
94
+
95
+void EEPROM_M24C08_Init(void);
96
+
97
+
98
+
99
+
100
+
101
+
102
+
103
+
104
+
105
+
106
+
107
+
108
+
109
+
110
+
111
+// Exported type definitions --------------------------------------------------
112
+/**
113
+ * The possible states the EEPROM driver can be in.
114
+ */
115
+typedef enum
116
+{
117
+    EE_UNINIT = 0,      //!< Driver has not been initialized
118
+    EE_IDLE,            //!< Driver has been initialized and is ready to start a transfer
119
+    EE_FINISH,          //!< Driver has finished with a transfer
120
+    EE_READ,            //!< Driver is doing a read operation
121
+    EE_WRITE_SEND,      //!< Driver is writing data
122
+    EE_WRITE_WAIT       //!< Driver is waiting for the EEPROM to finish a write cycle
123
+} EEPROM_Status;
124
+
125
+/**
126
+ * The possible outcomes of an operation.
127
+ */
128
+typedef enum
129
+{
130
+    EE_OK = 0,      //!< Indicates success
131
+    EE_BUSY,        //!< Indicates that the driver is currently busy doing a transfer
132
+    EE_ERROR        //!< Indicates an error condition
133
+} EEPROM_Error;
134
+
135
+/**
136
+ * Contains static configuration for the board such as populated peripherals, fitted resistor values and Ethernet MAC
137
+ * address, that are stored on the EEPROM.
138
+ */
139
+
140
+// Macros ---------------------------------------------------------------------
141
+
142
+#ifndef LOBYTE
143
+#define LOBYTE(x)  ((uint8_t)(x & 0x00FF))
144
+#endif
145
+#ifndef HIBYTE
146
+#define HIBYTE(x)  ((uint8_t)((x & 0xFF00) >> 8))
147
+#endif
148
+#define MAKE_ADDRESS(_addr, _e2)            ((uint8_t)EEPROM_M24C08_ADDR | \
149
+                                             ((_e2) ? EEPROM_M24C08_ADDR_E2 : 0) | \
150
+                                             ((uint8_t)((_addr) >> 7) & EEPROM_M24C08_BYTE_ADDR_H))
151
+
152
+// Constants ------------------------------------------------------------------
153
+
154
+/**
155
+ * @defgroup EEPROM_M24C08_ADDRESS M24C08 Address definitions
156
+ * 
157
+ * The address byte that is sent to an M24C08 consists of 4 parts:
158
+ *  + The device identifier {@link EEPROM_M24C08_ADDR} (4 bits)
159
+ *  + An address bit {@link EEPROM_M24C08_ADDR_E2} that is either set or not, depending on the value of the `E2` pin on
160
+ *    the M24C08 device
161
+ *  + The two most significant bits of the memory address to be read/written {@link EEPROM_M24C08_BYTE_ADDR_H}
162
+ *  + The standard I2C read/write bit
163
+ * @{
164
+ */
165
+#define EEPROM_M24C08_ADDR                  0xA0        //!< M24C08 device identifier
166
+#define EEPROM_M24C08_ADDR_E2               0x08        //!< M24C08 E2 address bit
167
+/**
168
+ * Bitmask for the M24C08 I2C Address bits that are used for the high byte of the memory address. The address bits are
169
+ * either the high byte shifted left by one or the 16 bit address shifted right by 7 and then masked.
170
+ */
171
+#define EEPROM_M24C08_BYTE_ADDR_H           0x06
172
+/** @} */
173
+
174
+/**
175
+ * Timeout in ms for I2C communication
176
+ */
177
+#define EEPROM_I2C_TIMEOUT                  0x200
178
+
179
+/**
180
+ * EEPROM size in bytes
181
+ */
182
+#define EEPROM_SIZE                         0x400
183
+
184
+/**
185
+ * Mask for the page address, a page write can only write to addresses which have the same page address
186
+ */
187
+#define EEPROM_PAGE_MASK                    0x03F0
188
+
189
+/**
190
+ * Page size of the EEPROM, only one page can be written at a time
191
+ */
192
+#define EEPROM_PAGE_SIZE                    0x10
193
+
194
+/**
195
+ * Configuration data offset, that is the first address of the configuration data space
196
+ */
197
+#define EEPROM_CONFIG_OFFSET                0
198
+
199
+/**
200
+ * Size of the configuration data section in bytes
201
+ */
202
+#define EEPROM_CONFIG_SIZE                  128
203
+
204
+/**
205
+ * Data offset, that is the first address for arbitrary data
206
+ */
207
+#define EEPROM_DATA_OFFSET                  0x80
208
+
209
+/**
210
+ * Size of the data section in bytes, this is the EEPROM size minus the data offset
211
+ */
212
+#define EEPROM_DATA_SIZE                    (EEPROM_SIZE - EEPROM_DATA_OFFSET)
213
+
214
+/**
215
+ * Size of the settings buffer in bytes
216
+ */
217
+#define EEPROM_SETTINGS_SIZE                64
218
+
219
+// Exported functions ---------------------------------------------------------
220
+
221
+
222
+
223
+// ----------------------------------------------------------------------------
224
+
225
+
226
+#endif /* EEPROM_H_ */

+ 4 - 0
Inc/main.h

@@ -65,6 +65,10 @@ void Error_Handler(void);
65 65
 /* Private defines -----------------------------------------------------------*/
66 66
 #define BOOT_LED_Pin GPIO_PIN_15
67 67
 #define BOOT_LED_GPIO_Port GPIOC
68
+#define EEPROM_SCL_Pin GPIO_PIN_10
69
+#define EEPROM_SCL_GPIO_Port GPIOB
70
+#define EEPROM_SDA_Pin GPIO_PIN_11
71
+#define EEPROM_SDA_GPIO_Port GPIOB
68 72
 /* USER CODE BEGIN Private defines */
69 73
 
70 74
 /* USER CODE END Private defines */

+ 1 - 1
Inc/stm32f1xx_hal_conf.h

@@ -60,7 +60,7 @@
60 60
 /*#define HAL_ETH_MODULE_ENABLED   */
61 61
 /*#define HAL_FLASH_MODULE_ENABLED   */
62 62
 #define HAL_GPIO_MODULE_ENABLED
63
-/*#define HAL_I2C_MODULE_ENABLED   */
63
+#define HAL_I2C_MODULE_ENABLED
64 64
 /*#define HAL_I2S_MODULE_ENABLED   */
65 65
 /*#define HAL_IRDA_MODULE_ENABLED   */
66 66
 /*#define HAL_IWDG_MODULE_ENABLED   */

+ 43 - 36
STM32F103_ATTEN_PLL_Zig.ioc

@@ -21,20 +21,24 @@ Dma.USART1_TX.1.PeriphInc=DMA_PINC_DISABLE
21 21
 Dma.USART1_TX.1.Priority=DMA_PRIORITY_LOW
22 22
 Dma.USART1_TX.1.RequestParameters=Instance,Direction,PeriphInc,MemInc,PeriphDataAlignment,MemDataAlignment,Mode,Priority
23 23
 File.Version=6
24
+GPIO.groupedBy=Group By Peripherals
25
+I2C2.I2C_Mode=I2C_Fast
26
+I2C2.IPParameters=I2C_Mode
24 27
 KeepUserPlacement=false
25 28
 Mcu.Family=STM32F1
26 29
 Mcu.IP0=DMA
27
-Mcu.IP1=NVIC
28
-Mcu.IP2=RCC
29
-Mcu.IP3=SYS
30
-Mcu.IP4=TIM6
31
-Mcu.IP5=USART1
32
-Mcu.IPNb=6
30
+Mcu.IP1=I2C2
31
+Mcu.IP2=NVIC
32
+Mcu.IP3=RCC
33
+Mcu.IP4=SYS
34
+Mcu.IP5=TIM6
35
+Mcu.IP6=USART1
36
+Mcu.IPNb=7
33 37
 Mcu.Name=STM32F103Z(C-D-E)Tx
34 38
 Mcu.Package=LQFP144
35 39
 Mcu.Pin0=PC15-OSC32_OUT
36
-Mcu.Pin1=OSC_IN
37
-Mcu.Pin2=OSC_OUT
40
+Mcu.Pin1=PB10
41
+Mcu.Pin2=PB11
38 42
 Mcu.Pin3=PA9
39 43
 Mcu.Pin4=PA10
40 44
 Mcu.Pin5=PA13
@@ -62,10 +66,6 @@ NVIC.SysTick_IRQn=true\:0\:0\:false\:false\:true\:false\:true
62 66
 NVIC.TIM6_IRQn=true\:0\:0\:false\:true\:true\:3\:true\:true
63 67
 NVIC.USART1_IRQn=true\:0\:0\:false\:true\:true\:2\:true\:true
64 68
 NVIC.UsageFault_IRQn=true\:0\:0\:false\:false\:true\:false\:false
65
-OSC_IN.Mode=HSE-External-Oscillator
66
-OSC_IN.Signal=RCC_OSC_IN
67
-OSC_OUT.Mode=HSE-External-Oscillator
68
-OSC_OUT.Signal=RCC_OSC_OUT
69 69
 PA10.Mode=Asynchronous
70 70
 PA10.Signal=USART1_RX
71 71
 PA13.Mode=Serial_Wire
@@ -74,6 +74,14 @@ PA14.Mode=Serial_Wire
74 74
 PA14.Signal=SYS_JTCK-SWCLK
75 75
 PA9.Mode=Asynchronous
76 76
 PA9.Signal=USART1_TX
77
+PB10.GPIOParameters=GPIO_Label
78
+PB10.GPIO_Label=EEPROM_SCL
79
+PB10.Mode=I2C
80
+PB10.Signal=I2C2_SCL
81
+PB11.GPIOParameters=GPIO_Label
82
+PB11.GPIO_Label=EEPROM_SDA
83
+PB11.Mode=I2C
84
+PB11.Signal=I2C2_SDA
77 85
 PC15-OSC32_OUT.GPIOParameters=GPIO_Label
78 86
 PC15-OSC32_OUT.GPIO_Label=BOOT_LED
79 87
 PC15-OSC32_OUT.Locked=true
@@ -106,36 +114,35 @@ ProjectManager.TargetToolchain=TrueSTUDIO
106 114
 ProjectManager.ToolChainLocation=
107 115
 ProjectManager.UnderRoot=true
108 116
 ProjectManager.functionlistsort=1-MX_GPIO_Init-GPIO-false-HAL-true,2-MX_DMA_Init-DMA-false-HAL-true,3-SystemClock_Config-RCC-false-HAL-false,4-MX_USART1_UART_Init-USART1-false-HAL-true
109
-RCC.ADCFreqValue=12000000
117
+RCC.ADCFreqValue=9333333.333333334
110 118
 RCC.ADCPresc=RCC_ADCPCLK2_DIV6
111
-RCC.AHBFreq_Value=72000000
119
+RCC.AHBFreq_Value=56000000
112 120
 RCC.APB1CLKDivider=RCC_HCLK_DIV2
113
-RCC.APB1Freq_Value=36000000
114
-RCC.APB1TimFreq_Value=72000000
115
-RCC.APB2Freq_Value=72000000
116
-RCC.APB2TimFreq_Value=72000000
117
-RCC.FCLKCortexFreq_Value=72000000
118
-RCC.FSMCFreq_Value=72000000
121
+RCC.APB1Freq_Value=28000000
122
+RCC.APB1TimFreq_Value=56000000
123
+RCC.APB2Freq_Value=56000000
124
+RCC.APB2TimFreq_Value=56000000
125
+RCC.FCLKCortexFreq_Value=56000000
126
+RCC.FSMCFreq_Value=56000000
119 127
 RCC.FamilyName=M
120
-RCC.HCLKFreq_Value=72000000
121
-RCC.I2S2Freq_Value=72000000
122
-RCC.I2S3Freq_Value=72000000
123
-RCC.IPParameters=ADCFreqValue,ADCPresc,AHBFreq_Value,APB1CLKDivider,APB1Freq_Value,APB1TimFreq_Value,APB2Freq_Value,APB2TimFreq_Value,FCLKCortexFreq_Value,FSMCFreq_Value,FamilyName,HCLKFreq_Value,I2S2Freq_Value,I2S3Freq_Value,MCOFreq_Value,PLLCLKFreq_Value,PLLMCOFreq_Value,PLLMUL,PLLSourceVirtual,SDIOFreq_Value,SDIOHCLKDiv2FreqValue,SYSCLKFreq_VALUE,SYSCLKSource,TimSysFreq_Value,USBFreq_Value,VCOOutput2Freq_Value
124
-RCC.MCOFreq_Value=72000000
125
-RCC.PLLCLKFreq_Value=72000000
126
-RCC.PLLMCOFreq_Value=36000000
127
-RCC.PLLMUL=RCC_PLL_MUL9
128
-RCC.PLLSourceVirtual=RCC_PLLSOURCE_HSE
129
-RCC.SDIOFreq_Value=72000000
130
-RCC.SDIOHCLKDiv2FreqValue=36000000
131
-RCC.SYSCLKFreq_VALUE=72000000
128
+RCC.HCLKFreq_Value=56000000
129
+RCC.I2S2Freq_Value=56000000
130
+RCC.I2S3Freq_Value=56000000
131
+RCC.IPParameters=ADCFreqValue,ADCPresc,AHBFreq_Value,APB1CLKDivider,APB1Freq_Value,APB1TimFreq_Value,APB2Freq_Value,APB2TimFreq_Value,FCLKCortexFreq_Value,FSMCFreq_Value,FamilyName,HCLKFreq_Value,I2S2Freq_Value,I2S3Freq_Value,MCOFreq_Value,PLLCLKFreq_Value,PLLMCOFreq_Value,PLLMUL,SDIOFreq_Value,SDIOHCLKDiv2FreqValue,SYSCLKFreq_VALUE,SYSCLKSource,TimSysFreq_Value,USBFreq_Value,VCOOutput2Freq_Value
132
+RCC.MCOFreq_Value=56000000
133
+RCC.PLLCLKFreq_Value=56000000
134
+RCC.PLLMCOFreq_Value=28000000
135
+RCC.PLLMUL=RCC_PLL_MUL14
136
+RCC.SDIOFreq_Value=56000000
137
+RCC.SDIOHCLKDiv2FreqValue=28000000
138
+RCC.SYSCLKFreq_VALUE=56000000
132 139
 RCC.SYSCLKSource=RCC_SYSCLKSOURCE_PLLCLK
133
-RCC.TimSysFreq_Value=72000000
134
-RCC.USBFreq_Value=72000000
135
-RCC.VCOOutput2Freq_Value=8000000
140
+RCC.TimSysFreq_Value=56000000
141
+RCC.USBFreq_Value=56000000
142
+RCC.VCOOutput2Freq_Value=4000000
136 143
 TIM6.IPParameters=Prescaler,Period
137 144
 TIM6.Period=10 - 1
138
-TIM6.Prescaler=7200 - 1
145
+TIM6.Prescaler=5600 - 1
139 146
 USART1.IPParameters=VirtualMode
140 147
 USART1.VirtualMode=VM_ASYNC
141 148
 VP_SYS_VS_Systick.Mode=SysTick

+ 171 - 0
Src/eeprom.c

@@ -0,0 +1,171 @@
1
+/*
2
+ * eeprom.c
3
+ *
4
+ *  Created on: 2020. 4. 22.
5
+ *      Author: parkyj
6
+ */
7
+#include <stdio.h>
8
+#include "main.h"
9
+#include "eeprom.h"
10
+#include "stm32f1xx_hal.h"
11
+#include "stm32f1xx_hal_gpio.h"
12
+
13
+/* Includes ------------------------------------------------------------------*/
14
+extern I2C_HandleTypeDef hi2c2;
15
+HAL_StatusTypeDef EEPROM_M24C08_ByteRead(uint16_t devid,uint16_t Address,uint8_t* data,uint8_t size);
16
+
17
+
18
+
19
+
20
+
21
+
22
+
23
+
24
+
25
+void EEPROM_M24C08_Init(void){
26
+//    EEPROM_M24C08_Read(EEPROM_M24C08_ID,EEPROM_ATT_BASE              ,&Att_DL1.Table_0_0_dBm,sizeof(ATT_TABLE_st) );
27
+    //printf("EEPROM INIT COMPLETE\r\n");
28
+
29
+}
30
+
31
+
32
+
33
+
34
+
35
+
36
+
37
+
38
+
39
+
40
+#if 0 // PYJ.2020.04.23_BEGIN -- 
41
+
42
+
43
+void eepromtest(){
44
+    memset(&eepdata[0],0x33,100);
45
+    for(int i = 0; i < 100; i ++ ){
46
+        printf("data[%d] : %x \r\n",i,eepdata[i]);
47
+        EEPROM_M24C08_Bytewrite(EEPROM_M24C08_ID,EEPROM_ATT_BASE + i,&eepdata[i],1);
48
+    }  
49
+    for(int i = 0; i < 100; i ++ ){
50
+        EEPROM_M24C08_ByteRead(EEPROM_M24C08_ID,EEPROM_ATT_BASE + i,&eepdata[i],1);
51
+        printf("data[%d] : %x \r\n",i,eepdata[i]);
52
+    }  
53
+//    EEPROM_M24C08_Read(EEPROM_M24C08_ID,EEPROM_ATT_BASE,&eepdata[0],100);
54
+//    for(int i = 0; i < 100; i ++ ){
55
+//        printf("data[%d] : %x \r\n",i,eepdata[i]);
56
+//    }    
57
+
58
+}
59
+#endif // PYJ.2020.04.23_END -- 
60
+
61
+#define MAXEEPROM_LENG 32
62
+
63
+HAL_StatusTypeDef EEPROM_M24C08_Read(uint8_t devid,uint16_t Address,uint8_t* data,uint16_t size){
64
+   HAL_StatusTypeDef ret = HAL_ERROR;
65
+ //  uint16_t sizecnt = 0,
66
+   //uint16_t sizeremain = 0;
67
+  // uint16_t addrees_inc = 0;
68
+//   ret = HAL_I2C_Mem_Read(&hi2c2, devid | ((Address & 0x0300) >> 7),((Address )),  I2C_MEMADD_SIZE_8BIT, &data[0], size, 1024);
69
+
70
+   ret = HAL_I2C_Mem_Read(&hi2c2, devid ,((Address )),  I2C_MEMADD_SIZE_16BIT, &data[0], size, 1024);
71
+//      EEPROM24XX_Load( Address,data, size);
72
+
73
+      if(ret == HAL_ERROR)
74
+            printf("Write ERR\r\n");
75
+        else
76
+            HAL_Delay(20);
77
+
78
+    return ret;   
79
+}
80
+HAL_StatusTypeDef EEPROM_M24C08_write(uint8_t devid,uint16_t Address,uint8_t* data,uint16_t size){
81
+    HAL_StatusTypeDef ret = HAL_ERROR;
82
+    uint8_t sizecnt = 0,sizeremain = 0; 
83
+    uint16_t addrees_inc = 0;
84
+    sizecnt = size /MAXEEPROM_LENG;
85
+    sizeremain = size % MAXEEPROM_LENG;
86
+    addrees_inc = 0;
87
+#if 0 // PYJ.2020.04.25_BEGIN -- 
88
+       for(int i = 0 ; i <sizecnt; i++ ){
89
+            addrees_inc = i * 16;
90
+            ret = HAL_I2C_Mem_Write(&hi2c2, devid | (((Address  + addrees_inc) & 0x0300) >> 7),((Address + addrees_inc)) ,  I2C_MEMADD_SIZE_8BIT, &data[addrees_inc], 16, 1024);
91
+            if(ret == HAL_ERROR)
92
+                printf("Write ERR\r\n");
93
+            else
94
+                HAL_Delay(20);
95
+       }
96
+       addrees_inc += 16;
97
+           ret = HAL_I2C_Mem_Write(&hi2c2, devid | (((Address  + addrees_inc) & 0x0300) >> 7),((Address + addrees_inc)) ,  I2C_MEMADD_SIZE_8BIT, &data[addrees_inc], sizeremain, 1024);
98
+            //       EEPROM24XX_Save( Address,data, size);
99
+            if(ret == HAL_ERROR)
100
+                printf("Write ERR\r\n");
101
+            else
102
+                HAL_Delay(20);
103
+#else
104
+//    printf("size : %d sizecnt = %d sizeremain : %d\r\n",size,sizecnt,sizeremain);
105
+    if(sizecnt > 0){
106
+        for(int i = 0 ; i < sizecnt; i++ ){
107
+             addrees_inc = i * MAXEEPROM_LENG;
108
+             ret = HAL_I2C_Mem_Write(&hi2c2, devid  ,((Address + addrees_inc) & 0xFFFF) ,  I2C_MEMADD_SIZE_16BIT, &data[addrees_inc], MAXEEPROM_LENG, 1024);
109
+
110
+             if(ret == HAL_ERROR)
111
+                 printf("Write ERR\r\n");
112
+             else
113
+                 HAL_Delay(20);
114
+        }
115
+        addrees_inc += MAXEEPROM_LENG;
116
+    }
117
+
118
+//    printf("Remain Data Index : %d \r\n",sizeremain);
119
+    
120
+    if(sizeremain > 0){
121
+//         printf("Remain Data Write Start ");
122
+        for(int i = 0; i < sizeremain; i++){
123
+            ret = HAL_I2C_Mem_Write(&hi2c2, devid  ,((Address + addrees_inc + i)& 0xFFFF) ,  I2C_MEMADD_SIZE_16BIT, &data[addrees_inc + i], 1, 1024);
124
+         //       EEPROM24XX_Save( Address,data, size);
125
+         if(ret == HAL_ERROR)
126
+             printf("Write ERR\r\n");
127
+         else
128
+             HAL_Delay(20);
129
+        }
130
+    }
131
+
132
+#endif // PYJ.2020.04.25_END -- 
133
+    return ret;
134
+}
135
+
136
+HAL_StatusTypeDef EEPROM_M24C08_Zerowrite(uint8_t devid,uint16_t Address){
137
+    HAL_StatusTypeDef ret = HAL_ERROR;
138
+   // uint8_t sizeremain = 0;
139
+    uint16_t addrees_inc = 0;
140
+    addrees_inc = 0;
141
+    uint8_t data[4096] = {0,};
142
+
143
+
144
+    for(int i = 0 ; i < 128; i++ ){
145
+         addrees_inc = i * MAXEEPROM_LENG;
146
+         ret = HAL_I2C_Mem_Write(&hi2c2, devid  ,((Address + addrees_inc) & 0xFFFF) ,  I2C_MEMADD_SIZE_16BIT, &data[0], MAXEEPROM_LENG, 1024);
147
+         if(ret == HAL_ERROR)
148
+             printf("Write ERR\r\n");
149
+         else
150
+             HAL_Delay(20);
151
+    }
152
+
153
+
154
+    return ret;
155
+}
156
+
157
+
158
+
159
+
160
+
161
+
162
+
163
+
164
+
165
+
166
+
167
+
168
+
169
+
170
+
171
+

+ 46 - 8
Src/main.c

@@ -42,6 +42,8 @@
42 42
 /* USER CODE END PM */
43 43
 
44 44
 /* Private variables ---------------------------------------------------------*/
45
+I2C_HandleTypeDef hi2c2;
46
+
45 47
 TIM_HandleTypeDef htim6;
46 48
 
47 49
 UART_HandleTypeDef huart1;
@@ -60,6 +62,7 @@ void SystemClock_Config(void);
60 62
 static void MX_GPIO_Init(void);
61 63
 static void MX_DMA_Init(void);
62 64
 static void MX_USART1_UART_Init(void);
65
+static void MX_I2C2_Init(void);
63 66
 static void MX_TIM6_Init(void);
64 67
 static void MX_NVIC_Init(void);
65 68
 /* USER CODE BEGIN PFP */
@@ -116,6 +119,7 @@ int main(void)
116 119
   MX_GPIO_Init();
117 120
   MX_DMA_Init();
118 121
   MX_USART1_UART_Init();
122
+  MX_I2C2_Init();
119 123
   MX_TIM6_Init();
120 124
 
121 125
   /* Initialize interrupts */
@@ -134,7 +138,7 @@ int main(void)
134 138
   while (1)
135 139
   {
136 140
 	 // printf("Uart Start \r\n");
137
-	  if(LedTimerCnt > 500){HAL_GPIO_TogglePin(BOOT_LED_GPIO_Port,GPIO_PIN_14);LedTimerCnt = 0;}
141
+	  if(LedTimerCnt > 500){HAL_GPIO_TogglePin(BOOT_LED_GPIO_Port,BOOT_LED_Pin);LedTimerCnt = 0;}
138 142
 	  while (TerminalQueue.data > 0 && UartTimerCnt > 30) GetDataFromUartQueue(&hTerminal);
139 143
       while(FirmwareTimerCnt > 3000)  Jump_App();
140 144
 
@@ -157,13 +161,12 @@ void SystemClock_Config(void)
157 161
 
158 162
   /** Initializes the CPU, AHB and APB busses clocks 
159 163
   */
160
-  RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE;
161
-  RCC_OscInitStruct.HSEState = RCC_HSE_ON;
162
-  RCC_OscInitStruct.HSEPredivValue = RCC_HSE_PREDIV_DIV1;
164
+  RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI;
163 165
   RCC_OscInitStruct.HSIState = RCC_HSI_ON;
166
+  RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT;
164 167
   RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
165
-  RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;
166
-  RCC_OscInitStruct.PLL.PLLMUL = RCC_PLL_MUL9;
168
+  RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSI_DIV2;
169
+  RCC_OscInitStruct.PLL.PLLMUL = RCC_PLL_MUL14;
167 170
   if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)
168 171
   {
169 172
     Error_Handler();
@@ -203,6 +206,40 @@ static void MX_NVIC_Init(void)
203 206
   HAL_NVIC_EnableIRQ(DMA1_Channel4_IRQn);
204 207
 }
205 208
 
209
+/**
210
+  * @brief I2C2 Initialization Function
211
+  * @param None
212
+  * @retval None
213
+  */
214
+static void MX_I2C2_Init(void)
215
+{
216
+
217
+  /* USER CODE BEGIN I2C2_Init 0 */
218
+
219
+  /* USER CODE END I2C2_Init 0 */
220
+
221
+  /* USER CODE BEGIN I2C2_Init 1 */
222
+
223
+  /* USER CODE END I2C2_Init 1 */
224
+  hi2c2.Instance = I2C2;
225
+  hi2c2.Init.ClockSpeed = 400000;
226
+  hi2c2.Init.DutyCycle = I2C_DUTYCYCLE_2;
227
+  hi2c2.Init.OwnAddress1 = 0;
228
+  hi2c2.Init.AddressingMode = I2C_ADDRESSINGMODE_7BIT;
229
+  hi2c2.Init.DualAddressMode = I2C_DUALADDRESS_DISABLE;
230
+  hi2c2.Init.OwnAddress2 = 0;
231
+  hi2c2.Init.GeneralCallMode = I2C_GENERALCALL_DISABLE;
232
+  hi2c2.Init.NoStretchMode = I2C_NOSTRETCH_DISABLE;
233
+  if (HAL_I2C_Init(&hi2c2) != HAL_OK)
234
+  {
235
+    Error_Handler();
236
+  }
237
+  /* USER CODE BEGIN I2C2_Init 2 */
238
+
239
+  /* USER CODE END I2C2_Init 2 */
240
+
241
+}
242
+
206 243
 /**
207 244
   * @brief TIM6 Initialization Function
208 245
   * @param None
@@ -221,7 +258,7 @@ static void MX_TIM6_Init(void)
221 258
 
222 259
   /* USER CODE END TIM6_Init 1 */
223 260
   htim6.Instance = TIM6;
224
-  htim6.Init.Prescaler = 7200 - 1;
261
+  htim6.Init.Prescaler = 5600 - 1;
225 262
   htim6.Init.CounterMode = TIM_COUNTERMODE_UP;
226 263
   htim6.Init.Period = 10 - 1;
227 264
   htim6.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE;
@@ -257,7 +294,7 @@ static void MX_USART1_UART_Init(void)
257 294
 
258 295
   /* USER CODE END USART1_Init 1 */
259 296
   huart1.Instance = USART1;
260
-  huart1.Init.BaudRate = 921600;
297
+  huart1.Init.BaudRate = 115200;
261 298
   huart1.Init.WordLength = UART_WORDLENGTH_8B;
262 299
   huart1.Init.StopBits = UART_STOPBITS_1;
263 300
   huart1.Init.Parity = UART_PARITY_NONE;
@@ -295,6 +332,7 @@ static void MX_GPIO_Init(void)
295 332
 
296 333
   /* GPIO Ports Clock Enable */
297 334
   __HAL_RCC_GPIOC_CLK_ENABLE();
335
+  __HAL_RCC_GPIOB_CLK_ENABLE();
298 336
   __HAL_RCC_GPIOA_CLK_ENABLE();
299 337
 
300 338
   /*Configure GPIO pin Output Level */

+ 63 - 0
Src/stm32f1xx_hal_msp.c

@@ -84,6 +84,69 @@ void HAL_MspInit(void)
84 84
   /* USER CODE END MspInit 1 */
85 85
 }
86 86
 
87
+/**
88
+* @brief I2C MSP Initialization
89
+* This function configures the hardware resources used in this example
90
+* @param hi2c: I2C handle pointer
91
+* @retval None
92
+*/
93
+void HAL_I2C_MspInit(I2C_HandleTypeDef* hi2c)
94
+{
95
+  GPIO_InitTypeDef GPIO_InitStruct = {0};
96
+  if(hi2c->Instance==I2C2)
97
+  {
98
+  /* USER CODE BEGIN I2C2_MspInit 0 */
99
+
100
+  /* USER CODE END I2C2_MspInit 0 */
101
+  
102
+    __HAL_RCC_GPIOB_CLK_ENABLE();
103
+    /**I2C2 GPIO Configuration    
104
+    PB10     ------> I2C2_SCL
105
+    PB11     ------> I2C2_SDA 
106
+    */
107
+    GPIO_InitStruct.Pin = EEPROM_SCL_Pin|EEPROM_SDA_Pin;
108
+    GPIO_InitStruct.Mode = GPIO_MODE_AF_OD;
109
+    GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
110
+    HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
111
+
112
+    /* Peripheral clock enable */
113
+    __HAL_RCC_I2C2_CLK_ENABLE();
114
+  /* USER CODE BEGIN I2C2_MspInit 1 */
115
+
116
+  /* USER CODE END I2C2_MspInit 1 */
117
+  }
118
+
119
+}
120
+
121
+/**
122
+* @brief I2C MSP De-Initialization
123
+* This function freeze the hardware resources used in this example
124
+* @param hi2c: I2C handle pointer
125
+* @retval None
126
+*/
127
+void HAL_I2C_MspDeInit(I2C_HandleTypeDef* hi2c)
128
+{
129
+  if(hi2c->Instance==I2C2)
130
+  {
131
+  /* USER CODE BEGIN I2C2_MspDeInit 0 */
132
+
133
+  /* USER CODE END I2C2_MspDeInit 0 */
134
+    /* Peripheral clock disable */
135
+    __HAL_RCC_I2C2_CLK_DISABLE();
136
+  
137
+    /**I2C2 GPIO Configuration    
138
+    PB10     ------> I2C2_SCL
139
+    PB11     ------> I2C2_SDA 
140
+    */
141
+    HAL_GPIO_DeInit(GPIOB, EEPROM_SCL_Pin|EEPROM_SDA_Pin);
142
+
143
+  /* USER CODE BEGIN I2C2_MspDeInit 1 */
144
+
145
+  /* USER CODE END I2C2_MspDeInit 1 */
146
+  }
147
+
148
+}
149
+
87 150
 /**
88 151
 * @brief TIM_Base MSP Initialization
89 152
 * This function configures the hardware resources used in this example

+ 0 - 8
insight/STM32F103_ATTEN_PLL_Zig.si4project/Backup/BDA4601(3412).c

@@ -1,8 +0,0 @@
1
-/*
2
- * BDA4601.c
3
- *
4
- *  Created on: 2019. 6. 28.
5
- *      Author: parkyj
6
- */
7
-
8
-

+ 0 - 105
insight/STM32F103_ATTEN_PLL_Zig.si4project/Backup/PE43711(6308).c

@@ -1,105 +0,0 @@
1
-/*
2
- * PE43711.c
3
- *
4
- *  Created on: 2019. 6. 28.
5
- *      Author: parkyj
6
- */
7
- #include "PE43711.h"
8
- typedef struct{
9
-    uint16_t ATT_EN_1_8G_DL1_PIN;
10
-    GPIO_TypeDef *ATT_EN_1_8G_DL1_PORT;
11
-        
12
-    uint16_t ATT_EN_1_8G_DL2_PIN;
13
-    GPIO_TypeDef *ATT_EN_1_8G_DL2_PORT;
14
-
15
-    uint16_t ATT_EN_1_8G_UL1_PIN;
16
-    GPIO_TypeDef *ATT_EN_1_8G_UL1_PORT;
17
-
18
-    uint16_t ATT_EN_1_8G_UL2_PIN;
19
-    GPIO_TypeDef *ATT_EN_1_8G_UL2_PORT;
20
-
21
-    uint16_t ATT_EN_1_8G_UL3_PIN;
22
-    GPIO_TypeDef *ATT_EN_1_8G_UL3_PORT;
23
-
24
-    uint16_t ATT_EN_1_8G_UL4_PIN;
25
-    GPIO_TypeDef *ATT_EN_1_8G_UL4_PORT;
26
- }PE43711_st;
27
-
28
-PE43711_st *Atten_1_8Ghz; 
29
-PE43711_st *Atten_2_1Ghz; 
30
-
31
- 
32
-void PE43711_PinInit(void){
33
-    Atten_1_8Ghz->ATT_EN_1_8G_DL1_PIN = GPIO_PIN_1;
34
-    Atten_1_8Ghz->ATT_EN_1_8G_DL1_PORT = GPIOB;
35
-    
36
-    Atten_1_8Ghz->ATT_EN_1_8G_DL2_PIN = GPIO_PIN_1;
37
-    Atten_1_8Ghz->ATT_EN_1_8G_DL2_PORT = GPIOB;
38
-    
39
-    Atten_1_8Ghz->ATT_EN_1_8G_UL1_PIN = GPIO_PIN_1;
40
-    Atten_1_8Ghz->ATT_EN_1_8G_UL1_PORT = GPIOB;
41
-    
42
-    Atten_1_8Ghz->ATT_EN_1_8G_DL1_PIN = GPIO_PIN_1;
43
-    Atten_1_8Ghz->ATT_EN_1_8G_DL1_PIN = GPIOB;
44
-    
45
-    Atten_1_8Ghz->ATT_EN_1_8G_UL2_PIN = GPIO_PIN_1;
46
-    Atten_1_8Ghz->ATT_EN_1_8G_UL2_PORT = GPIOB;
47
-
48
-    Atten_1_8Ghz->ATT_EN_1_8G_UL3_PIN = GPIO_PIN_1;
49
-    Atten_1_8Ghz->ATT_EN_1_8G_UL3_PORT = GPIOB;
50
-    
51
-    Atten_1_8Ghz->ATT_EN_1_8G_UL4_PIN = GPIO_PIN_1;
52
-    Atten_1_8Ghz->ATT_EN_1_8G_UL4_PORT = GPIOB;
53
-
54
-
55
-    Atten_2_1Ghz->ATT_EN_1_8G_DL1_PIN = GPIO_PIN_1;
56
-    Atten_2_1Ghz->ATT_EN_1_8G_DL1_PORT = GPIOB;
57
-
58
-    Atten_2_1Ghz->ATT_EN_1_8G_DL2_PIN = GPIO_PIN_1;
59
-    Atten_2_1Ghz->ATT_EN_1_8G_DL2_PORT = GPIOB;
60
-
61
-    Atten_2_1Ghz->ATT_EN_1_8G_UL1_PIN = GPIO_PIN_1;
62
-    Atten_2_1Ghz->ATT_EN_1_8G_UL1_PORT = GPIOB;
63
-
64
-    Atten_2_1Ghz->ATT_EN_1_8G_DL1_PIN = GPIO_PIN_1;
65
-    Atten_2_1Ghz->ATT_EN_1_8G_DL1_PIN = GPIOB;
66
-
67
-    Atten_2_1Ghz->ATT_EN_1_8G_UL2_PIN = GPIO_PIN_1;
68
-    Atten_2_1Ghz->ATT_EN_1_8G_UL2_PORT = GPIOB;
69
-
70
-    Atten_2_1Ghz->ATT_EN_1_8G_UL3_PIN = GPIO_PIN_1;
71
-    Atten_2_1Ghz->ATT_EN_1_8G_UL3_PORT = GPIOB;
72
-
73
-    Atten_2_1Ghz->ATT_EN_1_8G_UL4_PIN = GPIO_PIN_1;
74
-    Atten_2_1Ghz->ATT_EN_1_8G_UL4_PORT = GPIOB;
75
-    
76
-}
77
-
78
-void PE43711_atten_ctrl(PE43711_st* type ,double data){
79
-    uint8_t i = 0;
80
-    uint8_t temp = 0;
81
-    data = 4 * data;
82
-    temp = (uint8_t)data;
83
-    HAL_GPIO_WritePin(GPIOB,GPIO_PIN_1,GPIO_PIN_RESET);
84
-    HAL_Delay(1);
85
-    for(i = 0; i < 8; i++){
86
-        if((uint8_t)temp & 0x01){
87
-           HAL_GPIO_WritePin(GPIOB,GPIO_PIN_15,GPIO_PIN_SET);//DATA
88
-        }
89
-           else{
90
-           HAL_GPIO_WritePin(GPIOB,GPIO_PIN_15,GPIO_PIN_RESET);//DATA
91
-           }
92
-
93
-		HAL_GPIO_WritePin(GPIOB,GPIO_PIN_2,GPIO_PIN_SET);//CLOCK
94
-		HAL_Delay(1);
95
-		HAL_GPIO_WritePin(GPIOB,GPIO_PIN_2,GPIO_PIN_RESET);//CLOCK
96
-		HAL_Delay(1);
97
-		temp >>= 1;
98
-    }
99
-	HAL_GPIO_WritePin(GPIOB,GPIO_PIN_2,GPIO_PIN_RESET);//CLOCK
100
-    HAL_GPIO_WritePin(GPIOB,GPIO_PIN_15,GPIO_PIN_RESET);//DATA
101
-    HAL_Delay(5);
102
-    HAL_GPIO_WritePin(GPIOB,GPIO_PIN_1,GPIO_PIN_SET);//LE
103
-    HAL_Delay(1);
104
-    HAL_GPIO_WritePin(GPIOB,GPIO_PIN_1,GPIO_PIN_RESET);
105
-}

+ 0 - 440
insight/STM32F103_ATTEN_PLL_Zig.si4project/Backup/main(5556).c

@@ -1,440 +0,0 @@
1
-/* USER CODE BEGIN Header */
2
-/**
3
-  ******************************************************************************
4
-  * @file           : main.c
5
-  * @brief          : Main program body
6
-  ******************************************************************************
7
-  * @attention
8
-  *
9
-  * <h2><center>&copy; Copyright (c) 2019 STMicroelectronics.
10
-  * All rights reserved.</center></h2>
11
-  *
12
-  * This software component is licensed by ST under BSD 3-Clause license,
13
-  * the "License"; You may not use this file except in compliance with the
14
-  * License. You may obtain a copy of the License at:
15
-  *                        opensource.org/licenses/BSD-3-Clause
16
-  *
17
-  ******************************************************************************
18
-  */
19
-/* USER CODE END Header */
20
-
21
-/* Includes ------------------------------------------------------------------*/
22
-#include "main.h"
23
-
24
-/* Private includes ----------------------------------------------------------*/
25
-/* USER CODE BEGIN Includes */
26
-
27
-/* USER CODE END Includes */
28
-
29
-/* Private typedef -----------------------------------------------------------*/
30
-/* USER CODE BEGIN PTD */
31
-
32
-/* USER CODE END PTD */
33
-
34
-/* Private define ------------------------------------------------------------*/
35
-/* USER CODE BEGIN PD */
36
-
37
-/* USER CODE END PD */
38
-
39
-/* Private macro -------------------------------------------------------------*/
40
-/* USER CODE BEGIN PM */
41
-
42
-/* USER CODE END PM */
43
-
44
-/* Private variables ---------------------------------------------------------*/
45
-ADC_HandleTypeDef hadc1;
46
-DMA_HandleTypeDef hdma_adc1;
47
-
48
-UART_HandleTypeDef huart1;
49
-
50
-/* USER CODE BEGIN PV */
51
-
52
-/* USER CODE END PV */
53
-
54
-/* Private function prototypes -----------------------------------------------*/
55
-void SystemClock_Config(void);
56
-static void MX_GPIO_Init(void);
57
-static void MX_DMA_Init(void);
58
-static void MX_ADC1_Init(void);
59
-static void MX_USART1_UART_Init(void);
60
-static void MX_NVIC_Init(void);
61
-/* USER CODE BEGIN PFP */
62
-
63
-/* USER CODE END PFP */
64
-
65
-/* Private user code ---------------------------------------------------------*/
66
-/* USER CODE BEGIN 0 */
67
-
68
-/* USER CODE END 0 */
69
-
70
-/**
71
-  * @brief  The application entry point.
72
-  * @retval int
73
-  */
74
-int main(void)
75
-{
76
-  /* USER CODE BEGIN 1 */
77
-
78
-  /* USER CODE END 1 */
79
-  
80
-
81
-  /* MCU Configuration--------------------------------------------------------*/
82
-
83
-  /* Reset of all peripherals, Initializes the Flash interface and the Systick. */
84
-  HAL_Init();
85
-
86
-  /* USER CODE BEGIN Init */
87
-
88
-  /* USER CODE END Init */
89
-
90
-  /* Configure the system clock */
91
-  SystemClock_Config();
92
-
93
-  /* USER CODE BEGIN SysInit */
94
-
95
-  /* USER CODE END SysInit */
96
-
97
-  /* Initialize all configured peripherals */
98
-  MX_GPIO_Init();
99
-  MX_DMA_Init();
100
-  MX_ADC1_Init();
101
-  MX_USART1_UART_Init();
102
-
103
-  /* Initialize interrupts */
104
-  MX_NVIC_Init();
105
-  /* USER CODE BEGIN 2 */
106
-
107
-  /* USER CODE END 2 */
108
-
109
-  /* Infinite loop */
110
-  /* USER CODE BEGIN WHILE */
111
-  while (1)
112
-  {
113
-    /* USER CODE END WHILE */
114
-
115
-    /* USER CODE BEGIN 3 */
116
-  }
117
-  /* USER CODE END 3 */
118
-}
119
-
120
-/**
121
-  * @brief System Clock Configuration
122
-  * @retval None
123
-  */
124
-void SystemClock_Config(void)
125
-{
126
-  RCC_OscInitTypeDef RCC_OscInitStruct = {0};
127
-  RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};
128
-  RCC_PeriphCLKInitTypeDef PeriphClkInit = {0};
129
-
130
-  /** Initializes the CPU, AHB and APB busses clocks 
131
-  */
132
-  RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI;
133
-  RCC_OscInitStruct.HSIState = RCC_HSI_ON;
134
-  RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT;
135
-  RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
136
-  RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSI_DIV2;
137
-  RCC_OscInitStruct.PLL.PLLMUL = RCC_PLL_MUL15;
138
-  if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)
139
-  {
140
-    Error_Handler();
141
-  }
142
-  /** Initializes the CPU, AHB and APB busses clocks 
143
-  */
144
-  RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK
145
-                              |RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2;
146
-  RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
147
-  RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
148
-  RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV2;
149
-  RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1;
150
-
151
-  if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_2) != HAL_OK)
152
-  {
153
-    Error_Handler();
154
-  }
155
-  PeriphClkInit.PeriphClockSelection = RCC_PERIPHCLK_ADC;
156
-  PeriphClkInit.AdcClockSelection = RCC_ADCPCLK2_DIV6;
157
-  if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInit) != HAL_OK)
158
-  {
159
-    Error_Handler();
160
-  }
161
-}
162
-
163
-/**
164
-  * @brief NVIC Configuration.
165
-  * @retval None
166
-  */
167
-static void MX_NVIC_Init(void)
168
-{
169
-  /* USART1_IRQn interrupt configuration */
170
-  HAL_NVIC_SetPriority(USART1_IRQn, 0, 0);
171
-  HAL_NVIC_EnableIRQ(USART1_IRQn);
172
-}
173
-
174
-/**
175
-  * @brief ADC1 Initialization Function
176
-  * @param None
177
-  * @retval None
178
-  */
179
-static void MX_ADC1_Init(void)
180
-{
181
-
182
-  /* USER CODE BEGIN ADC1_Init 0 */
183
-
184
-  /* USER CODE END ADC1_Init 0 */
185
-
186
-  ADC_ChannelConfTypeDef sConfig = {0};
187
-
188
-  /* USER CODE BEGIN ADC1_Init 1 */
189
-
190
-  /* USER CODE END ADC1_Init 1 */
191
-  /** Common config 
192
-  */
193
-  hadc1.Instance = ADC1;
194
-  hadc1.Init.ScanConvMode = ADC_SCAN_ENABLE;
195
-  hadc1.Init.ContinuousConvMode = DISABLE;
196
-  hadc1.Init.DiscontinuousConvMode = DISABLE;
197
-  hadc1.Init.ExternalTrigConv = ADC_SOFTWARE_START;
198
-  hadc1.Init.DataAlign = ADC_DATAALIGN_RIGHT;
199
-  hadc1.Init.NbrOfConversion = 2;
200
-  if (HAL_ADC_Init(&hadc1) != HAL_OK)
201
-  {
202
-    Error_Handler();
203
-  }
204
-  /** Configure Regular Channel 
205
-  */
206
-  sConfig.Channel = ADC_CHANNEL_0;
207
-  sConfig.Rank = ADC_REGULAR_RANK_1;
208
-  sConfig.SamplingTime = ADC_SAMPLETIME_1CYCLE_5;
209
-  if (HAL_ADC_ConfigChannel(&hadc1, &sConfig) != HAL_OK)
210
-  {
211
-    Error_Handler();
212
-  }
213
-  /** Configure Regular Channel 
214
-  */
215
-  sConfig.Rank = ADC_REGULAR_RANK_2;
216
-  if (HAL_ADC_ConfigChannel(&hadc1, &sConfig) != HAL_OK)
217
-  {
218
-    Error_Handler();
219
-  }
220
-  /* USER CODE BEGIN ADC1_Init 2 */
221
-
222
-  /* USER CODE END ADC1_Init 2 */
223
-
224
-}
225
-
226
-/**
227
-  * @brief USART1 Initialization Function
228
-  * @param None
229
-  * @retval None
230
-  */
231
-static void MX_USART1_UART_Init(void)
232
-{
233
-
234
-  /* USER CODE BEGIN USART1_Init 0 */
235
-
236
-  /* USER CODE END USART1_Init 0 */
237
-
238
-  /* USER CODE BEGIN USART1_Init 1 */
239
-
240
-  /* USER CODE END USART1_Init 1 */
241
-  huart1.Instance = USART1;
242
-  huart1.Init.BaudRate = 115200;
243
-  huart1.Init.WordLength = UART_WORDLENGTH_8B;
244
-  huart1.Init.StopBits = UART_STOPBITS_1;
245
-  huart1.Init.Parity = UART_PARITY_NONE;
246
-  huart1.Init.Mode = UART_MODE_TX_RX;
247
-  huart1.Init.HwFlowCtl = UART_HWCONTROL_NONE;
248
-  huart1.Init.OverSampling = UART_OVERSAMPLING_16;
249
-  if (HAL_UART_Init(&huart1) != HAL_OK)
250
-  {
251
-    Error_Handler();
252
-  }
253
-  /* USER CODE BEGIN USART1_Init 2 */
254
-
255
-  /* USER CODE END USART1_Init 2 */
256
-
257
-}
258
-
259
-/** 
260
-  * Enable DMA controller clock
261
-  */
262
-static void MX_DMA_Init(void) 
263
-{
264
-  /* DMA controller clock enable */
265
-  __HAL_RCC_DMA1_CLK_ENABLE();
266
-
267
-  /* DMA interrupt init */
268
-  /* DMA1_Channel1_IRQn interrupt configuration */
269
-  HAL_NVIC_SetPriority(DMA1_Channel1_IRQn, 0, 0);
270
-  HAL_NVIC_EnableIRQ(DMA1_Channel1_IRQn);
271
-
272
-}
273
-
274
-/**
275
-  * @brief GPIO Initialization Function
276
-  * @param None
277
-  * @retval None
278
-  */
279
-static void MX_GPIO_Init(void)
280
-{
281
-  GPIO_InitTypeDef GPIO_InitStruct = {0};
282
-
283
-  /* GPIO Ports Clock Enable */
284
-  __HAL_RCC_GPIOE_CLK_ENABLE();
285
-  __HAL_RCC_GPIOC_CLK_ENABLE();
286
-  __HAL_RCC_GPIOF_CLK_ENABLE();
287
-  __HAL_RCC_GPIOA_CLK_ENABLE();
288
-  __HAL_RCC_GPIOB_CLK_ENABLE();
289
-  __HAL_RCC_GPIOD_CLK_ENABLE();
290
-  __HAL_RCC_GPIOG_CLK_ENABLE();
291
-
292
-  /*Configure GPIO pin Output Level */
293
-  HAL_GPIO_WritePin(GPIOE, ATT_EN_1_8G_DL1_Pin|ATT_EN_1_8G_DL2_Pin|ATT_EN_1_8G_UL1_Pin|ATT_EN_1_8G_UL2_Pin 
294
-                          |ATT_EN_1_8G_UL3_Pin|PATH_EN_2_1G_DL_Pin|PATH_EN_2_1G_UL_Pin, GPIO_PIN_RESET);
295
-
296
-  /*Configure GPIO pin Output Level */
297
-  HAL_GPIO_WritePin(GPIOC, ATT_EN_1_8G_UL4_Pin|PATH_EN_1_8G_DL_Pin|PATH_EN_1_8G_UL_Pin|PLL_EN_3_5G_L_Pin 
298
-                          |PLL_EN_3_5G_H_Pin, GPIO_PIN_RESET);
299
-
300
-  /*Configure GPIO pin Output Level */
301
-  HAL_GPIO_WritePin(GPIOF, PLL_EN_1_8G_DL_Pin|PLL_EN_1_8G_UL_Pin|ATT_EN_2_1G_DL1_Pin|ATT_EN_2_1G_DL2_Pin 
302
-                          |ATT_EN_2_1G_UL1_Pin|ATT_EN_2_1G_UL2_Pin|ATT_EN_2_1G_UL3_Pin|ATT_EN_2_1G_UL4_Pin, GPIO_PIN_RESET);
303
-
304
-  /*Configure GPIO pin Output Level */
305
-  HAL_GPIO_WritePin(GPIOD, PLL_DATA_Pin|PLL_CLK_Pin|ATT_DATA_Pin|ATT_CLK_Pin 
306
-                          |DA_LDAC_Pin|ATT_CLK_3_5G_Pin|ATT_EN_3_5G_Pin|ATT_DATA_3_5G_DL_Pin 
307
-                          |ATT_DATA_3_5G_UL_Pin|ATT_DATA_3_5G_COM1_Pin|ATT_DATA_3_5G_COM2_Pin|ATT_DATA_3_5G_COM3_Pin 
308
-                          |PATH_EN_3_5G_L_Pin, GPIO_PIN_RESET);
309
-
310
-  /*Configure GPIO pin Output Level */
311
-  HAL_GPIO_WritePin(GPIOG, DA_SYNC_Pin|DA_SCLK_Pin|DA_DIN_Pin|_T_SYNC_UL_Pin 
312
-                          |T_SYNC_UL_Pin|_T_SYNC_DL_Pin|T_SYNC_DL_Pin|PATH_EN_3_5G_DL_Pin 
313
-                          |PATH_EN_3_5G_UL_Pin|PLL_ON_OFF_3_5G_L_Pin|PLL_ON_OFF_3_5G_H_Pin, GPIO_PIN_RESET);
314
-
315
-  /*Configure GPIO pin Output Level */
316
-  HAL_GPIO_WritePin(GPIOB, PLL_EN_2_1G_DL_Pin|PLL_EN_2_1G_UL_Pin, GPIO_PIN_RESET);
317
-
318
-  /*Configure GPIO pins : ATT_EN_1_8G_DL1_Pin ATT_EN_1_8G_DL2_Pin ATT_EN_1_8G_UL1_Pin ATT_EN_1_8G_UL2_Pin 
319
-                           ATT_EN_1_8G_UL3_Pin PATH_EN_2_1G_DL_Pin PATH_EN_2_1G_UL_Pin */
320
-  GPIO_InitStruct.Pin = ATT_EN_1_8G_DL1_Pin|ATT_EN_1_8G_DL2_Pin|ATT_EN_1_8G_UL1_Pin|ATT_EN_1_8G_UL2_Pin 
321
-                          |ATT_EN_1_8G_UL3_Pin|PATH_EN_2_1G_DL_Pin|PATH_EN_2_1G_UL_Pin;
322
-  GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
323
-  GPIO_InitStruct.Pull = GPIO_NOPULL;
324
-  GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
325
-  HAL_GPIO_Init(GPIOE, &GPIO_InitStruct);
326
-
327
-  /*Configure GPIO pins : ATT_EN_1_8G_UL4_Pin PATH_EN_1_8G_DL_Pin PATH_EN_1_8G_UL_Pin PLL_EN_3_5G_L_Pin 
328
-                           PLL_EN_3_5G_H_Pin */
329
-  GPIO_InitStruct.Pin = ATT_EN_1_8G_UL4_Pin|PATH_EN_1_8G_DL_Pin|PATH_EN_1_8G_UL_Pin|PLL_EN_3_5G_L_Pin 
330
-                          |PLL_EN_3_5G_H_Pin;
331
-  GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
332
-  GPIO_InitStruct.Pull = GPIO_NOPULL;
333
-  GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
334
-  HAL_GPIO_Init(GPIOC, &GPIO_InitStruct);
335
-
336
-  /*Configure GPIO pins : PLL_EN_1_8G_DL_Pin PLL_EN_1_8G_UL_Pin ATT_EN_2_1G_DL1_Pin ATT_EN_2_1G_DL2_Pin 
337
-                           ATT_EN_2_1G_UL1_Pin ATT_EN_2_1G_UL2_Pin ATT_EN_2_1G_UL3_Pin ATT_EN_2_1G_UL4_Pin */
338
-  GPIO_InitStruct.Pin = PLL_EN_1_8G_DL_Pin|PLL_EN_1_8G_UL_Pin|ATT_EN_2_1G_DL1_Pin|ATT_EN_2_1G_DL2_Pin 
339
-                          |ATT_EN_2_1G_UL1_Pin|ATT_EN_2_1G_UL2_Pin|ATT_EN_2_1G_UL3_Pin|ATT_EN_2_1G_UL4_Pin;
340
-  GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
341
-  GPIO_InitStruct.Pull = GPIO_NOPULL;
342
-  GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
343
-  HAL_GPIO_Init(GPIOF, &GPIO_InitStruct);
344
-
345
-  /*Configure GPIO pins : PLL_LD_1_8G_DL_Pin PLL_LD_1_8G_UL_Pin */
346
-  GPIO_InitStruct.Pin = PLL_LD_1_8G_DL_Pin|PLL_LD_1_8G_UL_Pin;
347
-  GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
348
-  GPIO_InitStruct.Pull = GPIO_NOPULL;
349
-  HAL_GPIO_Init(GPIOF, &GPIO_InitStruct);
350
-
351
-  /*Configure GPIO pins : PLL_DATA_Pin PLL_CLK_Pin ATT_DATA_Pin ATT_CLK_Pin 
352
-                           DA_LDAC_Pin ATT_CLK_3_5G_Pin ATT_EN_3_5G_Pin ATT_DATA_3_5G_DL_Pin 
353
-                           ATT_DATA_3_5G_UL_Pin ATT_DATA_3_5G_COM1_Pin ATT_DATA_3_5G_COM2_Pin ATT_DATA_3_5G_COM3_Pin 
354
-                           PATH_EN_3_5G_L_Pin */
355
-  GPIO_InitStruct.Pin = PLL_DATA_Pin|PLL_CLK_Pin|ATT_DATA_Pin|ATT_CLK_Pin 
356
-                          |DA_LDAC_Pin|ATT_CLK_3_5G_Pin|ATT_EN_3_5G_Pin|ATT_DATA_3_5G_DL_Pin 
357
-                          |ATT_DATA_3_5G_UL_Pin|ATT_DATA_3_5G_COM1_Pin|ATT_DATA_3_5G_COM2_Pin|ATT_DATA_3_5G_COM3_Pin 
358
-                          |PATH_EN_3_5G_L_Pin;
359
-  GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
360
-  GPIO_InitStruct.Pull = GPIO_NOPULL;
361
-  GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
362
-  HAL_GPIO_Init(GPIOD, &GPIO_InitStruct);
363
-
364
-  /*Configure GPIO pins : ALARM_DC_Pin ALARM_AC_Pin */
365
-  GPIO_InitStruct.Pin = ALARM_DC_Pin|ALARM_AC_Pin;
366
-  GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
367
-  GPIO_InitStruct.Pull = GPIO_NOPULL;
368
-  HAL_GPIO_Init(GPIOD, &GPIO_InitStruct);
369
-
370
-  /*Configure GPIO pins : DA_SYNC_Pin DA_SCLK_Pin DA_DIN_Pin _T_SYNC_UL_Pin 
371
-                           T_SYNC_UL_Pin _T_SYNC_DL_Pin T_SYNC_DL_Pin PATH_EN_3_5G_DL_Pin 
372
-                           PATH_EN_3_5G_UL_Pin PLL_ON_OFF_3_5G_L_Pin PLL_ON_OFF_3_5G_H_Pin */
373
-  GPIO_InitStruct.Pin = DA_SYNC_Pin|DA_SCLK_Pin|DA_DIN_Pin|_T_SYNC_UL_Pin 
374
-                          |T_SYNC_UL_Pin|_T_SYNC_DL_Pin|T_SYNC_DL_Pin|PATH_EN_3_5G_DL_Pin 
375
-                          |PATH_EN_3_5G_UL_Pin|PLL_ON_OFF_3_5G_L_Pin|PLL_ON_OFF_3_5G_H_Pin;
376
-  GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
377
-  GPIO_InitStruct.Pull = GPIO_NOPULL;
378
-  GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
379
-  HAL_GPIO_Init(GPIOG, &GPIO_InitStruct);
380
-
381
-  /*Configure GPIO pins : PLL_LD_3_5G_L_Pin PLL_LD_3_5G_H_Pin */
382
-  GPIO_InitStruct.Pin = PLL_LD_3_5G_L_Pin|PLL_LD_3_5G_H_Pin;
383
-  GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
384
-  GPIO_InitStruct.Pull = GPIO_NOPULL;
385
-  HAL_GPIO_Init(GPIOC, &GPIO_InitStruct);
386
-
387
-  /*Configure GPIO pin : PATH_EN_3_5G_H_Pin */
388
-  GPIO_InitStruct.Pin = PATH_EN_3_5G_H_Pin;
389
-  GPIO_InitStruct.Mode = GPIO_MODE_ANALOG;
390
-  HAL_GPIO_Init(PATH_EN_3_5G_H_GPIO_Port, &GPIO_InitStruct);
391
-
392
-  /*Configure GPIO pins : PLL_EN_2_1G_DL_Pin PLL_EN_2_1G_UL_Pin */
393
-  GPIO_InitStruct.Pin = PLL_EN_2_1G_DL_Pin|PLL_EN_2_1G_UL_Pin;
394
-  GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
395
-  GPIO_InitStruct.Pull = GPIO_NOPULL;
396
-  GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
397
-  HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
398
-
399
-  /*Configure GPIO pins : PLL_LD_2_1G_DL_Pin PLL_LD_2_1G_UL_Pin */
400
-  GPIO_InitStruct.Pin = PLL_LD_2_1G_DL_Pin|PLL_LD_2_1G_UL_Pin;
401
-  GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
402
-  GPIO_InitStruct.Pull = GPIO_NOPULL;
403
-  HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
404
-
405
-}
406
-
407
-/* USER CODE BEGIN 4 */
408
-
409
-/* USER CODE END 4 */
410
-
411
-/**
412
-  * @brief  This function is executed in case of error occurrence.
413
-  * @retval None
414
-  */
415
-void Error_Handler(void)
416
-{
417
-  /* USER CODE BEGIN Error_Handler_Debug */
418
-  /* User can add his own implementation to report the HAL error return state */
419
-
420
-  /* USER CODE END Error_Handler_Debug */
421
-}
422
-
423
-#ifdef  USE_FULL_ASSERT
424
-/**
425
-  * @brief  Reports the name of the source file and the source line number
426
-  *         where the assert_param error has occurred.
427
-  * @param  file: pointer to the source file name
428
-  * @param  line: assert_param error line source number
429
-  * @retval None
430
-  */
431
-void assert_failed(uint8_t *file, uint32_t line)
432
-{ 
433
-  /* USER CODE BEGIN 6 */
434
-  /* User can add his own implementation to report the file name and line number,
435
-     tex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */
436
-  /* USER CODE END 6 */
437
-}
438
-#endif /* USE_FULL_ASSERT */
439
-
440
-/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

+ 0 - 214
insight/STM32F103_ATTEN_PLL_Zig.si4project/Backup/stm32f1xx_hal_def(7893).h

@@ -1,214 +0,0 @@
1
-/**
2
-  ******************************************************************************
3
-  * @file    stm32f1xx_hal_def.h
4
-  * @author  MCD Application Team
5
-  * @brief   This file contains HAL common defines, enumeration, macros and
6
-  *          structures definitions.
7
-  ******************************************************************************
8
-  * @attention
9
-  *
10
-  * <h2><center>&copy; COPYRIGHT(c) 2017 STMicroelectronics</center></h2>
11
-  *
12
-  * Redistribution and use in source and binary forms, with or without modification,
13
-  * are permitted provided that the following conditions are met:
14
-  *   1. Redistributions of source code must retain the above copyright notice,
15
-  *      this list of conditions and the following disclaimer.
16
-  *   2. Redistributions in binary form must reproduce the above copyright notice,
17
-  *      this list of conditions and the following disclaimer in the documentation
18
-  *      and/or other materials provided with the distribution.
19
-  *   3. Neither the name of STMicroelectronics nor the names of its contributors
20
-  *      may be used to endorse or promote products derived from this software
21
-  *      without specific prior written permission.
22
-  *
23
-  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
24
-  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25
-  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
26
-  * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
27
-  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28
-  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
29
-  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
30
-  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
31
-  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
32
-  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33
-  *
34
-  ******************************************************************************
35
-  */
36
-
37
-/* Define to prevent recursive inclusion -------------------------------------*/
38
-#ifndef __STM32F1xx_HAL_DEF
39
-#define __STM32F1xx_HAL_DEF
40
-
41
-#ifdef __cplusplus
42
-extern "C" {
43
-#endif
44
-
45
-/* Includes ------------------------------------------------------------------*/
46
-#include "stm32f1xx.h"
47
-#if defined(USE_HAL_LEGACY)
48
-#include "Legacy/stm32_hal_legacy.h"
49
-#endif
50
-#include <stdio.h>
51
-
52
-/* Exported types ------------------------------------------------------------*/
53
-
54
-/**
55
-  * @brief  HAL Status structures definition
56
-  */
57
-typedef enum
58
-{
59
-  HAL_OK       = 0x00U,
60
-  HAL_ERROR    = 0x01U,
61
-  HAL_BUSY     = 0x02U,
62
-  HAL_TIMEOUT  = 0x03U
63
-} HAL_StatusTypeDef;
64
-
65
-/**
66
-  * @brief  HAL Lock structures definition
67
-  */
68
-typedef enum
69
-{
70
-  HAL_UNLOCKED = 0x00U,
71
-  HAL_LOCKED   = 0x01U
72
-} HAL_LockTypeDef;
73
-
74
-/* Exported macro ------------------------------------------------------------*/
75
-#define HAL_MAX_DELAY      0xFFFFFFFFU
76
-
77
-#define HAL_IS_BIT_SET(REG, BIT)         (((REG) & (BIT)) != 0U)
78
-#define HAL_IS_BIT_CLR(REG, BIT)         (((REG) & (BIT)) == 0U)
79
-
80
-#define __HAL_LINKDMA(__HANDLE__, __PPP_DMA_FIELD__, __DMA_HANDLE__)               \
81
-                        do{                                                      \
82
-                              (__HANDLE__)->__PPP_DMA_FIELD__ = &(__DMA_HANDLE__); \
83
-                              (__DMA_HANDLE__).Parent = (__HANDLE__);             \
84
-                          } while(0U)
85
-
86
-#define UNUSED(X) (void)X      /* To avoid gcc/g++ warnings */
87
-
88
-/** @brief Reset the Handle's State field.
89
-  * @param __HANDLE__: specifies the Peripheral Handle.
90
-  * @note  This macro can be used for the following purpose:
91
-  *          - When the Handle is declared as local variable; before passing it as parameter
92
-  *            to HAL_PPP_Init() for the first time, it is mandatory to use this macro
93
-  *            to set to 0 the Handle's "State" field.
94
-  *            Otherwise, "State" field may have any random value and the first time the function
95
-  *            HAL_PPP_Init() is called, the low level hardware initialization will be missed
96
-  *            (i.e. HAL_PPP_MspInit() will not be executed).
97
-  *          - When there is a need to reconfigure the low level hardware: instead of calling
98
-  *            HAL_PPP_DeInit() then HAL_PPP_Init(), user can make a call to this macro then HAL_PPP_Init().
99
-  *            In this later function, when the Handle's "State" field is set to 0, it will execute the function
100
-  *            HAL_PPP_MspInit() which will reconfigure the low level hardware.
101
-  * @retval None
102
-  */
103
-#define __HAL_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = 0U)
104
-
105
-#if (USE_RTOS == 1U)
106
-/* Reserved for future use */
107
-#error "USE_RTOS should be 0 in the current HAL release"
108
-#else
109
-#define __HAL_LOCK(__HANDLE__)                                           \
110
-                                do{                                        \
111
-                                    if((__HANDLE__)->Lock == HAL_LOCKED)   \
112
-                                    {                                      \
113
-                                       return HAL_BUSY;                    \
114
-                                    }                                      \
115
-                                    else                                   \
116
-                                    {                                      \
117
-                                       (__HANDLE__)->Lock = HAL_LOCKED;    \
118
-                                    }                                      \
119
-                                  }while (0U)
120
-
121
-#define __HAL_UNLOCK(__HANDLE__)                                          \
122
-                                  do{                                       \
123
-                                      (__HANDLE__)->Lock = HAL_UNLOCKED;    \
124
-                                    }while (0U)
125
-#endif /* USE_RTOS */
126
-
127
-#if defined ( __GNUC__ ) && !defined (__CC_ARM) /* GNU Compiler */
128
-#ifndef __weak
129
-#define __weak   __attribute__((weak))
130
-#endif /* __weak */
131
-#ifndef __packed
132
-#define __packed __attribute__((__packed__))
133
-#endif /* __packed */
134
-#endif /* __GNUC__ */
135
-
136
-
137
-/* Macro to get variable aligned on 4-bytes, for __ICCARM__ the directive "#pragma data_alignment=4" must be used instead */
138
-#if defined ( __GNUC__ ) && !defined (__CC_ARM) /* GNU Compiler */
139
-#ifndef __ALIGN_END
140
-#define __ALIGN_END    __attribute__ ((aligned (4)))
141
-#endif /* __ALIGN_END */
142
-#ifndef __ALIGN_BEGIN
143
-#define __ALIGN_BEGIN
144
-#endif /* __ALIGN_BEGIN */
145
-#else
146
-#ifndef __ALIGN_END
147
-#define __ALIGN_END
148
-#endif /* __ALIGN_END */
149
-#ifndef __ALIGN_BEGIN
150
-#if defined   (__CC_ARM)      /* ARM Compiler */
151
-#define __ALIGN_BEGIN    __align(4)
152
-#elif defined (__ICCARM__)    /* IAR Compiler */
153
-#define __ALIGN_BEGIN
154
-#endif /* __CC_ARM */
155
-#endif /* __ALIGN_BEGIN */
156
-#endif /* __GNUC__ */
157
-
158
-
159
-/**
160
-  * @brief  __RAM_FUNC definition
161
-  */
162
-#if defined ( __CC_ARM   )
163
-/* ARM Compiler
164
-   ------------
165
-   RAM functions are defined using the toolchain options.
166
-   Functions that are executed in RAM should reside in a separate source module.
167
-   Using the 'Options for File' dialog you can simply change the 'Code / Const'
168
-   area of a module to a memory space in physical RAM.
169
-   Available memory areas are declared in the 'Target' tab of the 'Options for Target'
170
-   dialog.
171
-*/
172
-#define __RAM_FUNC
173
-
174
-#elif defined ( __ICCARM__ )
175
-/* ICCARM Compiler
176
-   ---------------
177
-   RAM functions are defined using a specific toolchain keyword "__ramfunc".
178
-*/
179
-#define __RAM_FUNC __ramfunc
180
-
181
-#elif defined   (  __GNUC__  )
182
-/* GNU Compiler
183
-   ------------
184
-  RAM functions are defined using a specific toolchain attribute
185
-   "__attribute__((section(".RamFunc")))".
186
-*/
187
-#define __RAM_FUNC __attribute__((section(".RamFunc")))
188
-
189
-#endif
190
-
191
-/**
192
-  * @brief  __NOINLINE definition
193
-  */
194
-#if defined ( __CC_ARM   ) || defined   (  __GNUC__  )
195
-/* ARM & GNUCompiler
196
-   ----------------
197
-*/
198
-#define __NOINLINE __attribute__ ( (noinline) )
199
-
200
-#elif defined ( __ICCARM__ )
201
-/* ICCARM Compiler
202
-   ---------------
203
-*/
204
-#define __NOINLINE _Pragma("optimize = no_inline")
205
-
206
-#endif
207
-
208
-#ifdef __cplusplus
209
-}
210
-#endif
211
-
212
-#endif /* ___STM32F1xx_HAL_DEF */
213
-
214
-/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

+ 0 - 7
insight/STM32F103_ATTEN_PLL_Zig.si4project/STM32F103_ATTEN_PLL_Zig.bookmarks.xml

@@ -1,7 +0,0 @@
1
-<?xml version="1.0" encoding="utf-8"?>
2
-<SourceInsightBookmarks
3
-	AppVer="4.00.0084"
4
-	AppVerMinReader="4.00.0009"
5
-	>
6
-	<Bookmarks/>
7
-</SourceInsightBookmarks>

BIN
insight/STM32F103_ATTEN_PLL_Zig.si4project/STM32F103_ATTEN_PLL_Zig.sip_sym


BIN
insight/STM32F103_ATTEN_PLL_Zig.si4project/STM32F103_ATTEN_PLL_Zig.sip_xab


BIN
insight/STM32F103_ATTEN_PLL_Zig.si4project/STM32F103_ATTEN_PLL_Zig.sip_xad


BIN
insight/STM32F103_ATTEN_PLL_Zig.si4project/STM32F103_ATTEN_PLL_Zig.sip_xc


BIN
insight/STM32F103_ATTEN_PLL_Zig.si4project/STM32F103_ATTEN_PLL_Zig.sip_xf


BIN
insight/STM32F103_ATTEN_PLL_Zig.si4project/STM32F103_ATTEN_PLL_Zig.sip_xm


BIN
insight/STM32F103_ATTEN_PLL_Zig.si4project/STM32F103_ATTEN_PLL_Zig.sip_xr


BIN
insight/STM32F103_ATTEN_PLL_Zig.si4project/STM32F103_ATTEN_PLL_Zig.sip_xsb


BIN
insight/STM32F103_ATTEN_PLL_Zig.si4project/STM32F103_ATTEN_PLL_Zig.sip_xsd


BIN
insight/STM32F103_ATTEN_PLL_Zig.si4project/STM32F103_ATTEN_PLL_Zig.siproj


+ 0 - 22
insight/STM32F103_ATTEN_PLL_Zig.si4project/STM32F103_ATTEN_PLL_Zig.siproj_settings.xml

@@ -1,22 +0,0 @@
1
-<?xml version="1.0" encoding="utf-8"?>
2
-<ProjectSettings
3
-	AppVer="4.00.0084"
4
-	AppVerMinReader="4.00.0034"
5
-	GlobalConfiguration="1"
6
-	GlobalWorkspace="0"
7
-	LocalsInDb="0"
8
-	IndexMembers="0"
9
-	IndexFragments="1"
10
-	UseMasterFileList="0"
11
-	SourceDir="."
12
-	BackupDir="%PROJECT_DATA_DIR%\Backup"
13
-	MasterFileList="%PROJECT_SOURCE_DIR%\%PROJECT_NAME%_filelist.txt"
14
-	IsImportProject="0"
15
-	>
16
-	<Imports>
17
-		<ImportedLibs/>
18
-	</Imports>
19
-	<ParseConditions>
20
-		<Defines/>
21
-	</ParseConditions>
22
-</ProjectSettings>

BIN
insight/STM32F103_ATTEN_PLL_Zig.si4project/STM32F103_ATTEN_PLL_Zig.siwork


+ 0 - 7
insight/STM32F103_ATTEN_PLL_Zig.si4project/STM32F103_ATTEN_PLL_Zig.snippets.xml

@@ -1,7 +0,0 @@
1
-<?xml version="1.0" encoding="utf-8"?>
2
-<SourceInsightCodeSnippets
3
-	AppVer="4.00.0084"
4
-	AppVerMinReader="4.00.0019"
5
-	>
6
-	<SnippetList/>
7
-</SourceInsightCodeSnippets>

BIN
insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Drivers_CMSIS_Device_ST_STM32F1xx_Include_stm32f103xe.h.sisc


BIN
insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Drivers_CMSIS_Device_ST_STM32F1xx_Include_stm32f1xx.h.sisc


BIN
insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Drivers_CMSIS_Device_ST_STM32F1xx_Include_system_stm32f1xx.h.sisc


BIN
insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Drivers_CMSIS_Include_arm_common_tables.h.sisc


BIN
insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Drivers_CMSIS_Include_arm_const_structs.h.sisc


BIN
insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Drivers_CMSIS_Include_arm_math.h.sisc


BIN
insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Drivers_CMSIS_Include_cmsis_armcc.h.sisc


BIN
insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Drivers_CMSIS_Include_cmsis_armcc_V6.h.sisc


BIN
insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Drivers_CMSIS_Include_cmsis_gcc.h.sisc


BIN
insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Drivers_CMSIS_Include_core_cm0.h.sisc


BIN
insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Drivers_CMSIS_Include_core_cm0plus.h.sisc


BIN
insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Drivers_CMSIS_Include_core_cm3.h.sisc


BIN
insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Drivers_CMSIS_Include_core_cm4.h.sisc


BIN
insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Drivers_CMSIS_Include_core_cm7.h.sisc


BIN
insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Drivers_CMSIS_Include_core_cmFunc.h.sisc


BIN
insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Drivers_CMSIS_Include_core_cmInstr.h.sisc


BIN
insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Drivers_CMSIS_Include_core_cmSimd.h.sisc


BIN
insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Drivers_CMSIS_Include_core_sc000.h.sisc


BIN
insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Drivers_CMSIS_Include_core_sc300.h.sisc


BIN
insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Drivers_STM32F1xx_HAL_Driver_Inc_Legacy_stm32_hal_legacy.h.sisc


BIN
insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Drivers_STM32F1xx_HAL_Driver_Inc_stm32f1xx_hal.h.sisc


BIN
insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Drivers_STM32F1xx_HAL_Driver_Inc_stm32f1xx_hal_cortex.h.sisc


BIN
insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Drivers_STM32F1xx_HAL_Driver_Inc_stm32f1xx_hal_def.h.sisc


BIN
insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Drivers_STM32F1xx_HAL_Driver_Inc_stm32f1xx_hal_dma.h.sisc


BIN
insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Drivers_STM32F1xx_HAL_Driver_Inc_stm32f1xx_hal_dma_ex.h.sisc


BIN
insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Drivers_STM32F1xx_HAL_Driver_Inc_stm32f1xx_hal_flash.h.sisc


BIN
insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Drivers_STM32F1xx_HAL_Driver_Inc_stm32f1xx_hal_flash_ex.h.sisc


BIN
insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Drivers_STM32F1xx_HAL_Driver_Inc_stm32f1xx_hal_gpio.h.sisc


BIN
insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Drivers_STM32F1xx_HAL_Driver_Inc_stm32f1xx_hal_gpio_ex.h.sisc


BIN
insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Drivers_STM32F1xx_HAL_Driver_Inc_stm32f1xx_hal_pwr.h.sisc


BIN
insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Drivers_STM32F1xx_HAL_Driver_Inc_stm32f1xx_hal_rcc.h.sisc


BIN
insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Drivers_STM32F1xx_HAL_Driver_Inc_stm32f1xx_hal_rcc_ex.h.sisc


BIN
insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Drivers_STM32F1xx_HAL_Driver_Inc_stm32f1xx_hal_tim.h.sisc


BIN
insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Drivers_STM32F1xx_HAL_Driver_Inc_stm32f1xx_hal_tim_ex.h.sisc


BIN
insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Drivers_STM32F1xx_HAL_Driver_Inc_stm32f1xx_hal_uart.h.sisc


BIN
insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Drivers_STM32F1xx_HAL_Driver_Src_stm32f1xx_hal.c.sisc


BIN
insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Drivers_STM32F1xx_HAL_Driver_Src_stm32f1xx_hal_cortex.c.sisc


BIN
insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Drivers_STM32F1xx_HAL_Driver_Src_stm32f1xx_hal_dma.c.sisc


BIN
insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Drivers_STM32F1xx_HAL_Driver_Src_stm32f1xx_hal_flash.c.sisc


BIN
insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Drivers_STM32F1xx_HAL_Driver_Src_stm32f1xx_hal_flash_ex.c.sisc


BIN
insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Drivers_STM32F1xx_HAL_Driver_Src_stm32f1xx_hal_gpio.c.sisc


BIN
insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Drivers_STM32F1xx_HAL_Driver_Src_stm32f1xx_hal_gpio_ex.c.sisc


BIN
insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Drivers_STM32F1xx_HAL_Driver_Src_stm32f1xx_hal_pwr.c.sisc


BIN
insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Drivers_STM32F1xx_HAL_Driver_Src_stm32f1xx_hal_rcc.c.sisc


BIN
insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Drivers_STM32F1xx_HAL_Driver_Src_stm32f1xx_hal_rcc_ex.c.sisc


BIN
insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Drivers_STM32F1xx_HAL_Driver_Src_stm32f1xx_hal_tim.c.sisc


BIN
insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Drivers_STM32F1xx_HAL_Driver_Src_stm32f1xx_hal_tim_ex.c.sisc


BIN
insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Drivers_STM32F1xx_HAL_Driver_Src_stm32f1xx_hal_uart.c.sisc


BIN
insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Inc_main.h.sisc


BIN
insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Inc_stm32f1xx_hal_conf.h.sisc


BIN
insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Inc_stm32f1xx_it.h.sisc


BIN
insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Src_main.c.sisc


BIN
insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Src_stm32f1xx_hal_msp.c.sisc


BIN
insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Src_stm32f1xx_it.c.sisc


BIN
insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Src_syscalls.c.sisc


BIN
insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Src_system_stm32f1xx.c.sisc