浏览代码

adc / Curr Db Det Offset 제거

adc 에서 Tx Det Check 제거
Nesslab init 추가
NessLab Tdd Arrange 함수 추가
PYJ 4 年之前
父节点
当前提交
ddb58f036f
共有 61 个文件被更改,包括 17272 次插入14407 次删除
  1. 1 1
      Bluecell_Src/NessLab.c
  2. 3 3
      Bluecell_Src/adc.c
  3. 二进制
      Debug/Bluecell_Src/NessLab.o
  4. 二进制
      Debug/Bluecell_Src/adc.o
  5. 二进制
      Debug/Nesslab_200M_System.bin
  6. 二进制
      Debug/Nesslab_200M_System.elf
  7. 13988 13767
      Debug/Nesslab_200M_System.list
  8. 628 623
      Debug/Nesslab_200M_System.map
  9. 二进制
      Debug/Src/main.o
  10. 10 10
      Debug/Src/main.su
  11. 3 0
      Src/main.c
  12. 291 0
      insight/Nesslab_200M_System.si4project/Backup/NessLab(1012).c
  13. 291 0
      insight/Nesslab_200M_System.si4project/Backup/NessLab(2909).c
  14. 206 0
      insight/Nesslab_200M_System.si4project/Backup/adc(7841).c
  15. 609 0
      insight/Nesslab_200M_System.si4project/Backup/main(2135).c
  16. 610 0
      insight/Nesslab_200M_System.si4project/Backup/main(2185).c
  17. 608 0
      insight/Nesslab_200M_System.si4project/Backup/main(5638).c
  18. 23 2
      insight/Nesslab_200M_System.si4project/Nesslab_200M_System.SearchResults
  19. 1 1
      insight/Nesslab_200M_System.si4project/Nesslab_200M_System.bookmarks.xml
  20. 二进制
      insight/Nesslab_200M_System.si4project/Nesslab_200M_System.sip_sym
  21. 二进制
      insight/Nesslab_200M_System.si4project/Nesslab_200M_System.sip_xm
  22. 二进制
      insight/Nesslab_200M_System.si4project/Nesslab_200M_System.siwork
  23. 二进制
      insight/Nesslab_200M_System.si4project/cache/parse/.._Bluecell_Inc_NessLab.h.sisc
  24. 二进制
      insight/Nesslab_200M_System.si4project/cache/parse/.._Bluecell_Inc_adc.h.sisc
  25. 二进制
      insight/Nesslab_200M_System.si4project/cache/parse/.._Bluecell_Inc_crc.h.sisc
  26. 二进制
      insight/Nesslab_200M_System.si4project/cache/parse/.._Bluecell_Inc_flash.h.sisc
  27. 二进制
      insight/Nesslab_200M_System.si4project/cache/parse/.._Bluecell_Inc_uart.h.sisc
  28. 二进制
      insight/Nesslab_200M_System.si4project/cache/parse/.._Bluecell_Src_NessLab.c.sisc
  29. 二进制
      insight/Nesslab_200M_System.si4project/cache/parse/.._Bluecell_Src_adc.c.sisc
  30. 二进制
      insight/Nesslab_200M_System.si4project/cache/parse/.._Bluecell_Src_crc.c.sisc
  31. 二进制
      insight/Nesslab_200M_System.si4project/cache/parse/.._Bluecell_Src_flash.c.sisc
  32. 二进制
      insight/Nesslab_200M_System.si4project/cache/parse/.._Bluecell_Src_led.c.sisc
  33. 二进制
      insight/Nesslab_200M_System.si4project/cache/parse/.._Bluecell_Src_uart.c.sisc
  34. 二进制
      insight/Nesslab_200M_System.si4project/cache/parse/.._Drivers_CMSIS_Device_ST_STM32F1xx_Include_system_stm32f1xx.h.sisc
  35. 二进制
      insight/Nesslab_200M_System.si4project/cache/parse/.._Drivers_CMSIS_Include_tz_context.h.sisc
  36. 二进制
      insight/Nesslab_200M_System.si4project/cache/parse/.._Drivers_STM32F1xx_HAL_Driver_Inc_stm32f1xx_hal.h.sisc
  37. 二进制
      insight/Nesslab_200M_System.si4project/cache/parse/.._Drivers_STM32F1xx_HAL_Driver_Inc_stm32f1xx_hal_adc.h.sisc
  38. 二进制
      insight/Nesslab_200M_System.si4project/cache/parse/.._Drivers_STM32F1xx_HAL_Driver_Inc_stm32f1xx_hal_adc_ex.h.sisc
  39. 二进制
      insight/Nesslab_200M_System.si4project/cache/parse/.._Drivers_STM32F1xx_HAL_Driver_Inc_stm32f1xx_hal_cortex.h.sisc
  40. 二进制
      insight/Nesslab_200M_System.si4project/cache/parse/.._Drivers_STM32F1xx_HAL_Driver_Inc_stm32f1xx_hal_dma.h.sisc
  41. 二进制
      insight/Nesslab_200M_System.si4project/cache/parse/.._Drivers_STM32F1xx_HAL_Driver_Inc_stm32f1xx_hal_dma_ex.h.sisc
  42. 二进制
      insight/Nesslab_200M_System.si4project/cache/parse/.._Drivers_STM32F1xx_HAL_Driver_Inc_stm32f1xx_hal_exti.h.sisc
  43. 二进制
      insight/Nesslab_200M_System.si4project/cache/parse/.._Drivers_STM32F1xx_HAL_Driver_Inc_stm32f1xx_hal_flash.h.sisc
  44. 二进制
      insight/Nesslab_200M_System.si4project/cache/parse/.._Drivers_STM32F1xx_HAL_Driver_Inc_stm32f1xx_hal_flash_ex.h.sisc
  45. 二进制
      insight/Nesslab_200M_System.si4project/cache/parse/.._Drivers_STM32F1xx_HAL_Driver_Inc_stm32f1xx_hal_gpio.h.sisc
  46. 二进制
      insight/Nesslab_200M_System.si4project/cache/parse/.._Drivers_STM32F1xx_HAL_Driver_Inc_stm32f1xx_hal_gpio_ex.h.sisc
  47. 二进制
      insight/Nesslab_200M_System.si4project/cache/parse/.._Drivers_STM32F1xx_HAL_Driver_Inc_stm32f1xx_hal_pwr.h.sisc
  48. 二进制
      insight/Nesslab_200M_System.si4project/cache/parse/.._Drivers_STM32F1xx_HAL_Driver_Inc_stm32f1xx_hal_tim_ex.h.sisc
  49. 二进制
      insight/Nesslab_200M_System.si4project/cache/parse/.._Drivers_STM32F1xx_HAL_Driver_Src_stm32f1xx_hal.c.sisc
  50. 二进制
      insight/Nesslab_200M_System.si4project/cache/parse/.._Drivers_STM32F1xx_HAL_Driver_Src_stm32f1xx_hal_adc.c.sisc
  51. 二进制
      insight/Nesslab_200M_System.si4project/cache/parse/.._Drivers_STM32F1xx_HAL_Driver_Src_stm32f1xx_hal_cortex.c.sisc
  52. 二进制
      insight/Nesslab_200M_System.si4project/cache/parse/.._Drivers_STM32F1xx_HAL_Driver_Src_stm32f1xx_hal_dma.c.sisc
  53. 二进制
      insight/Nesslab_200M_System.si4project/cache/parse/.._Drivers_STM32F1xx_HAL_Driver_Src_stm32f1xx_hal_exti.c.sisc
  54. 二进制
      insight/Nesslab_200M_System.si4project/cache/parse/.._Drivers_STM32F1xx_HAL_Driver_Src_stm32f1xx_hal_gpio.c.sisc
  55. 二进制
      insight/Nesslab_200M_System.si4project/cache/parse/.._Drivers_STM32F1xx_HAL_Driver_Src_stm32f1xx_hal_gpio_ex.c.sisc
  56. 二进制
      insight/Nesslab_200M_System.si4project/cache/parse/.._Drivers_STM32F1xx_HAL_Driver_Src_stm32f1xx_hal_pwr.c.sisc
  57. 二进制
      insight/Nesslab_200M_System.si4project/cache/parse/.._Drivers_STM32F1xx_HAL_Driver_Src_stm32f1xx_hal_tim_ex.c.sisc
  58. 二进制
      insight/Nesslab_200M_System.si4project/cache/parse/.._Drivers_STM32F1xx_HAL_Driver_Src_stm32f1xx_hal_uart.c.sisc
  59. 二进制
      insight/Nesslab_200M_System.si4project/cache/parse/.._Inc_main.h.sisc
  60. 二进制
      insight/Nesslab_200M_System.si4project/cache/parse/.._Src_main.c.sisc
  61. 二进制
      insight/Nesslab_200M_System.si4project/cache/parse/.._Src_sysmem.c.sisc

+ 1 - 1
Bluecell_Src/NessLab.c

@@ -73,7 +73,7 @@ uint8_t NessLab_Adc_Convert_db() // ?占쏙옙湲고븿?占쏙옙
73 73
 //        printf("%d - %d calc_val : %d \r\n",CurrAdc_Temp,TableVal_Temp,calc_val);
74 74
         if(Prev_calc_val > calc_val && TableVal_Temp != 0){
75 75
            Prev_calc_val = calc_val;
76
-           Curr_DB = i + 2;
76
+           Curr_DB = i ;
77 77
 //           printf("Curr_DB : %d \r\n",Curr_DB);
78 78
         }else{
79 79
 //            printf("%d  %d \r\n",Prev_calc_val , calc_val);

+ 3 - 3
Bluecell_Src/adc.c

@@ -40,9 +40,9 @@ uint8_t ADC_Convert_Temperature(double val);
40 40
      uint16_t Rx_Det_Volt = ((ADC1value[1] * (3.3 / 4095))* 1000);
41 41
      int8_t Real_Temperature = ADC_Convert_Temperature((ADC1value[2] * (3.3 / 4095)));
42 42
      /*DL TX Calc*/
43
-     Currstatus.DownLink_Forward_Det_H = ((Tx_Det_Volt & 0xFF00) >> 8);
44
-     Currstatus.DownLink_Forward_Det_L = (Tx_Det_Volt & 0x00FF);
45
-     printf("Tx_Det_Volt : %d \r\n",Tx_Det_Volt);
43
+//     Currstatus.DownLink_Forward_Det_H = ((Tx_Det_Volt & 0xFF00) >> 8);
44
+//     Currstatus.DownLink_Forward_Det_L = (Tx_Det_Volt & 0x00FF);
45
+//     printf("Tx_Det_Volt : %d \r\n",Tx_Det_Volt);
46 46
  
47 47
      /*DL RX Calc*/
48 48
      Currstatus.DownLink_Reverse_Det_H = ((Rx_Det_Volt & 0xFF00) >> 8);

二进制
Debug/Bluecell_Src/NessLab.o


二进制
Debug/Bluecell_Src/adc.o


二进制
Debug/Nesslab_200M_System.bin


二进制
Debug/Nesslab_200M_System.elf


文件差异内容过多而无法显示
+ 13988 - 13767
Debug/Nesslab_200M_System.list


文件差异内容过多而无法显示
+ 628 - 623
Debug/Nesslab_200M_System.map


二进制
Debug/Src/main.o


+ 10 - 10
Debug/Src/main.su

@@ -1,12 +1,12 @@
1 1
 main.c:99:5:_write	24	static
2 2
 main.c:116:5:main	8	static
3
-main.c:207:6:SystemClock_Config	80	static
4
-main.c:250:13:MX_NVIC_Init	8	static
5
-main.c:286:13:MX_ADC1_Init	24	static
6
-main.c:347:13:MX_TIM6_Init	16	static
7
-main.c:385:13:MX_USART1_UART_Init	8	static
8
-main.c:418:13:MX_USART3_UART_Init	8	static
9
-main.c:449:13:MX_DMA_Init	16	static
10
-main.c:462:13:MX_GPIO_Init	40	static
11
-main.c:527:6:HAL_TIM_PeriodElapsedCallback	16	static
12
-main.c:583:6:Error_Handler	4	static
3
+main.c:210:6:SystemClock_Config	80	static
4
+main.c:253:13:MX_NVIC_Init	8	static
5
+main.c:289:13:MX_ADC1_Init	24	static
6
+main.c:350:13:MX_TIM6_Init	16	static
7
+main.c:388:13:MX_USART1_UART_Init	8	static
8
+main.c:421:13:MX_USART3_UART_Init	8	static
9
+main.c:452:13:MX_DMA_Init	16	static
10
+main.c:465:13:MX_GPIO_Init	40	static
11
+main.c:530:6:HAL_TIM_PeriodElapsedCallback	16	static
12
+main.c:586:6:Error_Handler	4	static

+ 3 - 0
Src/main.c

@@ -152,6 +152,7 @@ int main(void)
152 152
   setbuf(stdout, NULL);
153 153
   InitUartQueue(&MainQueue);
154 154
   ADC_Initialize();
155
+  NessLab_Init();
155 156
 #if 1 // PYJ.2020.05.06_BEGIN --
156 157
     printf("****************************************\r\n");
157 158
     printf("NESSLAB Project\r\n");
@@ -185,6 +186,8 @@ int main(void)
185 186
 #if 1 // PYJ.2020.08.31_BEGIN -- 
186 187
     Boot_LED_Toggle(); /*LED Check*/
187 188
     Uart_Check();      /*Usart Rx*/
189
+    NessLab_GPIO_Operate();
190
+    ADC_TDD_Arrange();
188 191
 #else
189 192
     NessLab_Operate(datatest);
190 193
     datatest[4]++;

+ 291 - 0
insight/Nesslab_200M_System.si4project/Backup/NessLab(1012).c

@@ -0,0 +1,291 @@
1
+/*
2
+ * NessLab.c
3
+ *
4
+ *  Created on: Aug 3, 2020
5
+ *      Author: parkyj
6
+ */
7
+
8
+
9
+#include "main.h"
10
+#include "NessLab.h"
11
+#include "adc.h"
12
+#include "crc.h"
13
+#include "flash.h"
14
+#include "NessLab.h"
15
+//extern uint8_t NessLab_Checksum(uint8_t* data,uint8_t size);
16
+
17
+
18
+uint8_t NessLab_Adc_Convert_db();
19
+
20
+#define NESSLAB_DATARESPONSE_INDEXSIZE  23
21
+#define NESSLAB_TABLE_LENGTH 110
22
+Nesslab_Prot Currstatus;
23
+extern volatile uint16_t ADC1value[ADC1_CNT];
24
+
25
+extern volatile uint32_t UartRxTimerCnt ;
26
+extern volatile uint32_t DC_FAIL_ALARM_CNT ;
27
+extern volatile uint32_t OVER_INPUT_ALARM_CNT ;
28
+extern volatile uint32_t OVER_TEMP_ALARM_CNT ;
29
+extern volatile uint32_t ALC_ALARM_CNT ;
30
+extern volatile uint32_t OVER_POWER_ALARM_CNT ;
31
+extern volatile uint32_t VSWR_ALARM_CNT ;
32
+
33
+volatile uint8_t NessLab_TxData[200] = {0,};
34
+uint8_t Flash_DataArray[200] = {0,};
35
+uint8_t DB_Define[100];
36
+
37
+void NessLab_Init(){
38
+    FLASH_Read_Func(FLASH_USER_USE_START_ADDR + 2,&DB_Define[0],104);
39
+    HAL_GPIO_WritePin(PAU_RESET_GPIO_Port,PAU_RESET_Pin, GPIO_PIN_SET);
40
+}
41
+double Round_Function(double value){
42
+    double val = value * 100;
43
+
44
+    val = (int)(val + 0.5);
45
+    val *= 0.1;
46
+    val = (int)(val + 0.5);
47
+    val *= 0.1;
48
+
49
+    return val;
50
+}
51
+uint16_t Absolute_value_Convert(int16_t val){
52
+    if(val < 0)
53
+        val *= -1;
54
+    return val;
55
+}
56
+uint8_t NessLab_Adc_Convert_db() // ?占쏙옙湲고븿?占쏙옙
57
+{
58
+    double CurrAdc = (float)((Currstatus.DownLink_Forward_Det_H << 8 | Currstatus.DownLink_Forward_Det_L)*0.001);
59
+    double TableVal = 0;
60
+    float ret = 0;
61
+    int16_t calc_val = 0,Prev_calc_val = 3300 ;
62
+    uint8_t Curr_DB = 0 ;
63
+    uint16_t CurrAdc_Temp = 0,TableVal_Temp = 0;
64
+    ret = Round_Function(CurrAdc);
65
+//    CurrAdc *= 1000;
66
+    CurrAdc_Temp = CurrAdc * 1000;
67
+    for(int i = 0; i <= 50; i++){
68
+        TableVal_Temp = ((DB_Define[i * 2] << 8 | DB_Define[(i * 2)+ 1]));
69
+        if(TableVal_Temp == 0)
70
+            continue;
71
+        calc_val = CurrAdc_Temp - TableVal_Temp;
72
+        calc_val = Absolute_value_Convert(calc_val);
73
+//        printf("%d - %d calc_val : %d \r\n",CurrAdc_Temp,TableVal_Temp,calc_val);
74
+        if(Prev_calc_val > calc_val && TableVal_Temp != 0){
75
+           Prev_calc_val = calc_val;
76
+           Curr_DB = i + 2;
77
+//           printf("Curr_DB : %d \r\n",Curr_DB);
78
+        }else{
79
+//            printf("%d  %d \r\n",Prev_calc_val , calc_val);
80
+        }
81
+    }
82
+//    DB_Define[]
83
+
84
+    printf("Curr Db : %d \r\n",Curr_DB);
85
+
86
+    return Curr_DB;
87
+
88
+}
89
+
90
+void NessLab_Operate(uint8_t* data){
91
+	uint8_t datatype = data[NessLab_MsgID0];
92
+    uint8_t UartLength = 0;
93
+    static uint16_t MSG_SNCnt = 0;
94
+	switch(datatype){
95
+		case NessLab_STATUS_REQ:
96
+			ADC_Check();
97
+            
98
+            UartLength = NessLab_MAX_INDEX + 1;
99
+            MSG_SNCnt = data[NessLab_Req_MsgSN0] << 8 | data[NessLab_Req_MsgSN1];
100
+            MSG_SNCnt++;
101
+//            if(data[NessLab_Req_Data_Cnt0] > 0)
102
+//                NessLab_TxData[NessLab_Over_Power_Alarm] = 1;
103
+//            else
104
+//                NessLab_TxData[NessLab_Over_Power_Alarm] = 0;
105
+//            if(data[NessLab_Req_Data_Cnt1] > 0)                
106
+//                NessLab_TxData[NessLab_VSWR_ALARM] = 1;
107
+//            else
108
+//                NessLab_TxData[NessLab_VSWR_ALARM] = 0;
109
+                
110
+            NessLab_TxData[NessLab_MsgSN0] = (uint8_t)((MSG_SNCnt & 0xFF00) >>8);//data[NessLab_Req_MsgSN0];
111
+            NessLab_TxData[NessLab_MsgSN1] = (uint8_t)((MSG_SNCnt & 0x00FF));//data[NessLab_Req_MsgSN1] ;    
112
+            NessLab_Frame_Set(NessLab_TxData,12,NessLab_STATUS_RES);
113
+//            NessLab_TxData[10] = 1;
114
+//            NessLab_TxData[11] = 0;
115
+//            NessLab_TxData[12] = 1;
116
+//            NessLab_TxData[13] = 0;
117
+//            NessLab_TxData[14] = 1;
118
+//            NessLab_TxData[15] = 0;
119
+//            NessLab_TxData[16] = 1;
120
+//            NessLab_TxData[17] = 0;            
121
+                
122
+			break;
123
+            
124
+        case NessLab_Table_REQ:
125
+            UartLength = NESSLAB_TABLE_LENGTH;
126
+            FLASH_Read_Func(FLASH_USER_USE_START_ADDR,&NessLab_TxData[NessLab_Req_Data_Cnt0],data[NessLab_DataLength]);
127
+            NessLab_Table_Frame_Set(NessLab_TxData,102,NessLab_Table_RES);
128
+            printf("NessLab_Table_REQ \r\n");
129
+            break;
130
+        case NessLab_TableSet_REQ:
131
+            DataErase_Func(FLASH_USER_USE_START_ADDR,200);
132
+            printf("Ram Data Display \r\n");
133
+            for(int i = 0; i < data[NessLab_DataLength]; i++){
134
+                Flash_DataArray[i] = data[NessLab_Data_ADC1_H + i];
135
+                printf("%x ",Flash_DataArray[i]);
136
+            }
137
+            FLASH_Write_Func(FLASH_USER_USE_START_ADDR,&Flash_DataArray[0],data[NessLab_DataLength]);
138
+            UartLength = NESSLAB_TABLE_LENGTH;
139
+            NessLab_Table_Frame_Set(NessLab_TxData,104,NessLab_TableSet_RES);
140
+            FLASH_Read_Func(FLASH_USER_USE_START_ADDR + 2,&DB_Define[0],104);
141
+//            NessLab_Init();
142
+            printf("\r\nNessLab_TableSet_REQ \r\n");            
143
+            break;
144
+        case NessLab_PAU_Enable_Req:
145
+            HAL_GPIO_WritePin(AMP_EN_GPIO_Port,AMP_EN_Pin, GPIO_PIN_SET);
146
+            break;
147
+        case NessLab_PAU_Disable_Req:
148
+            HAL_GPIO_WritePin(AMP_EN_GPIO_Port,AMP_EN_Pin, GPIO_PIN_RESET);
149
+            break;            
150
+	}
151
+    Uart1_Data_Send(&NessLab_TxData[NessLab_Header0], UartLength);
152
+}
153
+
154
+/*
155
+Rx Total Byte
156
+7e 7e 65 00 01 ff 02 00 00 99 7e 7e
157
+
158
+
159
+Tx Total Byte : 
160
+
161
+7e 7e 66 00 02 00 0c 04 20 00 00 00 00 00 00 00 00 00 68 7e 7e 0a
162
+
163
+*/
164
+
165
+void NessLab_Frame_Set(uint8_t* data,uint8_t size){
166
+    data[NessLab_Header0] = 0x7E;
167
+    data[NessLab_Header1] = 0x7E;
168
+
169
+    data[NessLab_MsgID0] = NessLab_STATUS_RES;// ID
170
+//    data[NessLab_MsgSN0] = 0; // SEQ NUMBER
171
+//    data[NessLab_MsgSN1] = 0; // SEQ NUMBER   
172
+    data[NessLab_Reserve0] = 0; // NessLab_Reserve0
173
+    data[NessLab_DataLength] = size; // Nesslab Size
174
+    data[NessLab_Data_ADC1_H] =  Currstatus.DownLink_Forward_Det_H;//(uint8_t)((ADC1value[0] & 0xFF00) >> 8);
175
+    data[NessLab_Data_ADC1_L] =  Currstatus.DownLink_Forward_Det_L;//(uint8_t)(ADC1value[0] & 0x00FF);
176
+    data[NessLab_Data_ADC1_Table_Value] = NessLab_Adc_Convert_db();
177
+    if(DC_FAIL_ALARM_CNT > 3000)
178
+        data[NessLab_DC_FAIL_ALARM] = 1;
179
+    else
180
+        data[NessLab_DC_FAIL_ALARM] = 0;
181
+    
182
+    if(OVER_INPUT_ALARM_CNT > 3000)
183
+        data[NessLab_Over_Input_Alarm] = 1;  
184
+    else
185
+        data[NessLab_Over_Input_Alarm] = 0;  
186
+    if(OVER_TEMP_ALARM_CNT > 3000)
187
+        data[NessLab_Over_Temp_Alarm] = 1; 
188
+    else
189
+        data[NessLab_Over_Temp_Alarm] = 0; 
190
+        
191
+    if(ALC_ALARM_CNT > 3000)
192
+        data[NessLab_ALC_ALARM] = 1; 
193
+    else
194
+        data[NessLab_ALC_ALARM] = 0; 
195
+    if(OVER_POWER_ALARM_CNT > 3000)
196
+        data[NessLab_Over_Power_Alarm] = 1;        
197
+    else
198
+        data[NessLab_Over_Power_Alarm] = 0;        
199
+    if(VSWR_ALARM_CNT > 3000)
200
+        data[NessLab_VSWR_ALARM] = 1;  
201
+    else
202
+        data[NessLab_VSWR_ALARM] = 0;  
203
+        
204
+    
205
+    data[NessLab_DownLink_Status] = 0;
206
+    data[NessLab_Temp_Monitor] = Currstatus.Temp_Monitor; 
207
+    data[NessLab_ChecksumVal] = NessLab_Checksum(&data[NessLab_MsgID0], NessLab_MAX_INDEX - 5);
208
+    /* Exception Header Tail Checksum */
209
+    data[NessLab_Tail0] = 0x7E;
210
+    data[NessLab_Tail1] = 0x7E; 
211
+    data[NessLab_Tail1 + 1] = 0x0A; 
212
+    NessLab_Protocol_LastCheck(&data[NessLab_MsgID0],16);
213
+}
214
+void NessLab_Protocol_LastCheck(uint8_t* data,uint8_t size){
215
+    int cnt = NessLab_MsgID0;
216
+    for(int i = cnt; i < 17; i++){
217
+
218
+        if(data[i] == 0x7e){
219
+            data[cnt++] = 0x7d;
220
+            data[cnt++] = 0x5e;
221
+        }
222
+        else if(data[i] == 0x7d){
223
+            data[cnt++] = 0x7d;
224
+            data[cnt++] = 0x5d;
225
+
226
+        }else{
227
+            data[i++] = data[i];
228
+        }
229
+
230
+    }
231
+
232
+
233
+}
234
+
235
+void NessLab_Table_Frame_Set(uint8_t* data,uint8_t size,uint8_t mode){
236
+    uint32_t i = 0;
237
+    uint32_t  CurrApiAddress = 0;
238
+    CurrApiAddress = FLASH_USER_USE_START_ADDR;
239
+    uint8_t* Currdata = (uint8_t*)CurrApiAddress;
240
+    uint8_t* pdata;
241
+
242
+
243
+
244
+    data[i++] = 0x7E;
245
+    data[i++] = 0x7E;
246
+
247
+    data[i++] = mode;// ID
248
+    data[i++] = 0; // SEQ NUMBER
249
+    data[i++] = 0; // SEQ NUMBER   
250
+    data[i++] = 0; // NessLab_Reserve0
251
+    data[i++] = size; // Nesslab Size
252
+    //    NessLab_TalbleFlash_Read(&data[NessLab_DataLength + 1],100);              
253
+
254
+    for(int a = 0; a < size; a++){
255
+        data[i++] = Currdata[a];
256
+//        printf("%02x ",Currdata[i]);
257
+    }
258
+    data[i++] = NessLab_Checksum(&data[NessLab_MsgID0], 100 + 5);
259
+    /* Exception Header Tail Checksum */
260
+    data[i++] = 0x7E;
261
+    data[i++] = 0x7E; 
262
+}
263
+
264
+void NessLab_Status_Check(){
265
+	//HAL_GPIO_ReadPin(, GPIO_Pin)
266
+}
267
+void NessLab_PAU_Enable(){
268
+#if 1
269
+    if( HAL_GPIO_ReadPin(PAU_EN_GPIO_Port, PAU_EN_Pin) != HAL_GPIO_ReadPin(AMP_EN_GPIO_Port, AMP_EN_Pin) ){
270
+        HAL_GPIO_WritePin(AMP_EN_GPIO_Port,AMP_EN_Pin, HAL_GPIO_ReadPin(PAU_EN_GPIO_Port, PAU_EN_Pin));
271
+        printf("HAL_GPIO_ReadPin(PAU_EN_GPIO_Port, PAU_EN_Pin) : %d \r\n",HAL_GPIO_ReadPin(PAU_EN_GPIO_Port, PAU_EN_Pin));
272
+        printf("AMP_EN_GPIO_Port : %d \r\n",HAL_GPIO_ReadPin(AMP_EN_GPIO_Port, AMP_EN_Pin));
273
+//        HAL_Delay(1000);
274
+    }
275
+	//HAL_GPIO_WritePin(AMP_EN_GPIO_Port,AMP_EN_Pin, HAL_GPIO_ReadPin(PAU_RESET_GPIO_Port, PAU_RESET_Pin));
276
+#else
277
+    HAL_GPIO_WritePin(AMP_EN_GPIO_Port,AMP_EN_Pin, 0);
278
+    printf("AMP_EN_GPIO_Port : %d \r\n",HAL_GPIO_ReadPin(AMP_EN_GPIO_Port, AMP_EN_Pin));
279
+
280
+#endif
281
+}
282
+void NessLab_GPIO_Operate(){
283
+	NessLab_PAU_Enable();
284
+}
285
+
286
+
287
+
288
+void NessLab_ADC_Convert_Table(){
289
+    
290
+
291
+}

+ 291 - 0
insight/Nesslab_200M_System.si4project/Backup/NessLab(2909).c

@@ -0,0 +1,291 @@
1
+/*
2
+ * NessLab.c
3
+ *
4
+ *  Created on: Aug 3, 2020
5
+ *      Author: parkyj
6
+ */
7
+
8
+
9
+#include "main.h"
10
+#include "NessLab.h"
11
+#include "adc.h"
12
+#include "crc.h"
13
+#include "flash.h"
14
+#include "NessLab.h"
15
+//extern uint8_t NessLab_Checksum(uint8_t* data,uint8_t size);
16
+
17
+
18
+uint8_t NessLab_Adc_Convert_db();
19
+
20
+#define NESSLAB_DATARESPONSE_INDEXSIZE  23
21
+#define NESSLAB_TABLE_LENGTH 110
22
+Nesslab_Prot Currstatus;
23
+extern volatile uint16_t ADC1value[ADC1_CNT];
24
+
25
+extern volatile uint32_t UartRxTimerCnt ;
26
+extern volatile uint32_t DC_FAIL_ALARM_CNT ;
27
+extern volatile uint32_t OVER_INPUT_ALARM_CNT ;
28
+extern volatile uint32_t OVER_TEMP_ALARM_CNT ;
29
+extern volatile uint32_t ALC_ALARM_CNT ;
30
+extern volatile uint32_t OVER_POWER_ALARM_CNT ;
31
+extern volatile uint32_t VSWR_ALARM_CNT ;
32
+
33
+volatile uint8_t NessLab_TxData[200] = {0,};
34
+uint8_t Flash_DataArray[200] = {0,};
35
+uint8_t DB_Define[100];
36
+
37
+void NessLab_Init(){
38
+    FLASH_Read_Func(FLASH_USER_USE_START_ADDR + 2,&DB_Define[0],104);
39
+    HAL_GPIO_WritePin(PAU_RESET_GPIO_Port,PAU_RESET_Pin, GPIO_PIN_SET);
40
+}
41
+double Round_Function(double value){
42
+    double val = value * 100;
43
+
44
+    val = (int)(val + 0.5);
45
+    val *= 0.1;
46
+    val = (int)(val + 0.5);
47
+    val *= 0.1;
48
+
49
+    return val;
50
+}
51
+uint16_t Absolute_value_Convert(int16_t val){
52
+    if(val < 0)
53
+        val *= -1;
54
+    return val;
55
+}
56
+uint8_t NessLab_Adc_Convert_db() // ?占쏙옙湲고븿?占쏙옙
57
+{
58
+    double CurrAdc = (float)((Currstatus.DownLink_Forward_Det_H << 8 | Currstatus.DownLink_Forward_Det_L)*0.001);
59
+    double TableVal = 0;
60
+    float ret = 0;
61
+    int16_t calc_val = 0,Prev_calc_val = 3300 ;
62
+    uint8_t Curr_DB = 0 ;
63
+    uint16_t CurrAdc_Temp = 0,TableVal_Temp = 0;
64
+    ret = Round_Function(CurrAdc);
65
+//    CurrAdc *= 1000;
66
+    CurrAdc_Temp = CurrAdc * 1000;
67
+    for(int i = 0; i <= 50; i++){
68
+        TableVal_Temp = ((DB_Define[i * 2] << 8 | DB_Define[(i * 2)+ 1]));
69
+        if(TableVal_Temp == 0)
70
+            continue;
71
+        calc_val = CurrAdc_Temp - TableVal_Temp;
72
+        calc_val = Absolute_value_Convert(calc_val);
73
+//        printf("%d - %d calc_val : %d \r\n",CurrAdc_Temp,TableVal_Temp,calc_val);
74
+        if(Prev_calc_val > calc_val && TableVal_Temp != 0){
75
+           Prev_calc_val = calc_val;
76
+           Curr_DB = i + 2;
77
+//           printf("Curr_DB : %d \r\n",Curr_DB);
78
+        }else{
79
+//            printf("%d  %d \r\n",Prev_calc_val , calc_val);
80
+        }
81
+    }
82
+//    DB_Define[]
83
+
84
+    printf("Curr Db : %d \r\n",Curr_DB);
85
+
86
+    return Curr_DB;
87
+
88
+}
89
+
90
+void NessLab_Operate(uint8_t* data){
91
+	uint8_t datatype = data[NessLab_MsgID0];
92
+    uint8_t UartLength = 0;
93
+    static uint16_t MSG_SNCnt = 0;
94
+	switch(datatype){
95
+		case NessLab_STATUS_REQ:
96
+			ADC_Check();
97
+            
98
+            UartLength = NessLab_MAX_INDEX + 1;
99
+            MSG_SNCnt = data[NessLab_Req_MsgSN0] << 8 | data[NessLab_Req_MsgSN1];
100
+            MSG_SNCnt++;
101
+//            if(data[NessLab_Req_Data_Cnt0] > 0)
102
+//                NessLab_TxData[NessLab_Over_Power_Alarm] = 1;
103
+//            else
104
+//                NessLab_TxData[NessLab_Over_Power_Alarm] = 0;
105
+//            if(data[NessLab_Req_Data_Cnt1] > 0)                
106
+//                NessLab_TxData[NessLab_VSWR_ALARM] = 1;
107
+//            else
108
+//                NessLab_TxData[NessLab_VSWR_ALARM] = 0;
109
+                
110
+            NessLab_TxData[NessLab_MsgSN0] = (uint8_t)((MSG_SNCnt & 0xFF00) >>8);//data[NessLab_Req_MsgSN0];
111
+            NessLab_TxData[NessLab_MsgSN1] = (uint8_t)((MSG_SNCnt & 0x00FF));//data[NessLab_Req_MsgSN1] ;    
112
+            NessLab_Frame_Set(NessLab_TxData,12,NessLab_STATUS_RES);
113
+//            NessLab_TxData[10] = 1;
114
+//            NessLab_TxData[11] = 0;
115
+//            NessLab_TxData[12] = 1;
116
+//            NessLab_TxData[13] = 0;
117
+//            NessLab_TxData[14] = 1;
118
+//            NessLab_TxData[15] = 0;
119
+//            NessLab_TxData[16] = 1;
120
+//            NessLab_TxData[17] = 0;            
121
+                
122
+			break;
123
+            
124
+        case NessLab_Table_REQ:
125
+            UartLength = NESSLAB_TABLE_LENGTH;
126
+            FLASH_Read_Func(FLASH_USER_USE_START_ADDR,&NessLab_TxData[NessLab_Req_Data_Cnt0],data[NessLab_DataLength]);
127
+            NessLab_Table_Frame_Set(NessLab_TxData,102,NessLab_Table_RES);
128
+            printf("NessLab_Table_REQ \r\n");
129
+            break;
130
+        case NessLab_TableSet_REQ:
131
+            DataErase_Func(FLASH_USER_USE_START_ADDR,200);
132
+            printf("Ram Data Display \r\n");
133
+            for(int i = 0; i < data[NessLab_DataLength]; i++){
134
+                Flash_DataArray[i] = data[NessLab_Data_ADC1_H + i];
135
+                printf("%x ",Flash_DataArray[i]);
136
+            }
137
+            FLASH_Write_Func(FLASH_USER_USE_START_ADDR,&Flash_DataArray[0],data[NessLab_DataLength]);
138
+            UartLength = NESSLAB_TABLE_LENGTH;
139
+            NessLab_Table_Frame_Set(NessLab_TxData,104,NessLab_TableSet_RES);
140
+            FLASH_Read_Func(FLASH_USER_USE_START_ADDR + 2,&DB_Define[0],104);
141
+//            NessLab_Init();
142
+            printf("\r\nNessLab_TableSet_REQ \r\n");            
143
+            break;
144
+        case NessLab_PAU_Enable_Req:
145
+            HAL_GPIO_WritePin(AMP_EN_GPIO_Port,AMP_EN_Pin, GPIO_PIN_SET);
146
+            break;
147
+        case NessLab_PAU_Disable_Req:
148
+            HAL_GPIO_WritePin(AMP_EN_GPIO_Port,AMP_EN_Pin, GPIO_PIN_RESET);
149
+            break;            
150
+	}
151
+    Uart1_Data_Send(&NessLab_TxData[NessLab_Header0], UartLength);
152
+}
153
+
154
+/*
155
+Rx Total Byte
156
+7e 7e 65 00 01 ff 02 00 00 99 7e 7e
157
+
158
+
159
+Tx Total Byte : 
160
+
161
+7e 7e 66 00 02 00 0c 04 20 00 00 00 00 00 00 00 00 00 68 7e 7e 0a
162
+
163
+*/
164
+
165
+void NessLab_Frame_Set(uint8_t* data,uint8_t size){
166
+    data[NessLab_Header0] = 0x7E;
167
+    data[NessLab_Header1] = 0x7E;
168
+
169
+    data[NessLab_MsgID0] = NessLab_STATUS_RES;// ID
170
+//    data[NessLab_MsgSN0] = 0; // SEQ NUMBER
171
+//    data[NessLab_MsgSN1] = 0; // SEQ NUMBER   
172
+    data[NessLab_Reserve0] = 0; // NessLab_Reserve0
173
+    data[NessLab_DataLength] = size; // Nesslab Size
174
+    data[NessLab_Data_ADC1_H] =  Currstatus.DownLink_Forward_Det_H;//(uint8_t)((ADC1value[0] & 0xFF00) >> 8);
175
+    data[NessLab_Data_ADC1_L] =  Currstatus.DownLink_Forward_Det_L;//(uint8_t)(ADC1value[0] & 0x00FF);
176
+    data[NessLab_Data_ADC1_Table_Value] = NessLab_Adc_Convert_db();
177
+    if(DC_FAIL_ALARM_CNT > 3000)
178
+        data[NessLab_DC_FAIL_ALARM] = 1;
179
+    else
180
+        data[NessLab_DC_FAIL_ALARM] = 0;
181
+    
182
+    if(OVER_INPUT_ALARM_CNT > 3000)
183
+        data[NessLab_Over_Input_Alarm] = 1;  
184
+    else
185
+        data[NessLab_Over_Input_Alarm] = 0;  
186
+    if(OVER_TEMP_ALARM_CNT > 3000)
187
+        data[NessLab_Over_Temp_Alarm] = 1; 
188
+    else
189
+        data[NessLab_Over_Temp_Alarm] = 0; 
190
+        
191
+    if(ALC_ALARM_CNT > 3000)
192
+        data[NessLab_ALC_ALARM] = 1; 
193
+    else
194
+        data[NessLab_ALC_ALARM] = 0; 
195
+    if(OVER_POWER_ALARM_CNT > 3000)
196
+        data[NessLab_Over_Power_Alarm] = 1;        
197
+    else
198
+        data[NessLab_Over_Power_Alarm] = 0;        
199
+    if(VSWR_ALARM_CNT > 3000)
200
+        data[NessLab_VSWR_ALARM] = 1;  
201
+    else
202
+        data[NessLab_VSWR_ALARM] = 0;  
203
+        
204
+    
205
+    data[NessLab_DownLink_Status] = 0;
206
+    data[NessLab_Temp_Monitor] = Currstatus.Temp_Monitor; 
207
+    data[NessLab_ChecksumVal] = NessLab_Checksum(&data[NessLab_MsgID0], NessLab_MAX_INDEX - 5);
208
+    /* Exception Header Tail Checksum */
209
+    data[NessLab_Tail0] = 0x7E;
210
+    data[NessLab_Tail1] = 0x7E; 
211
+    data[NessLab_Tail1 + 1] = 0x0A; 
212
+    NessLab_Protocol_LastCheck(&data[NessLab_MsgID0],16);
213
+}
214
+void NessLab_Protocol_LastCheck(uint8_t* data,uint8_t size){
215
+    int cnt = NessLab_MsgID0;
216
+    for(int i = cnt; i < 17; i++){
217
+
218
+        if(data[i] == 0x7e){
219
+            data[cnt++] = 0x7d;
220
+            data[cnt++] = 0x5e;
221
+        }
222
+        else if(data[i] == 0x7d){
223
+            data[cnt++] = 0x7d;
224
+            data[cnt++] = 0x5d;
225
+
226
+        }else{
227
+            data[i++] = data[i];
228
+        }
229
+
230
+    }
231
+
232
+
233
+}
234
+
235
+void NessLab_Table_Frame_Set(uint8_t* data,uint8_t size,uint8_t mode){
236
+    uint32_t i = 0;
237
+    uint32_t  CurrApiAddress = 0;
238
+    CurrApiAddress = FLASH_USER_USE_START_ADDR;
239
+    uint8_t* Currdata = (uint8_t*)CurrApiAddress;
240
+    uint8_t* pdata;
241
+
242
+
243
+
244
+    data[i++] = 0x7E;
245
+    data[i++] = 0x7E;
246
+
247
+    data[i++] = mode;// ID
248
+    data[i++] = 0; // SEQ NUMBER
249
+    data[i++] = 0; // SEQ NUMBER   
250
+    data[i++] = 0; // NessLab_Reserve0
251
+    data[i++] = size; // Nesslab Size
252
+    //    NessLab_TalbleFlash_Read(&data[NessLab_DataLength + 1],100);              
253
+
254
+    for(int a = 0; a < size; a++){
255
+        data[i++] = Currdata[a];
256
+//        printf("%02x ",Currdata[i]);
257
+    }
258
+    data[i++] = NessLab_Checksum(&data[NessLab_MsgID0], 100 + 5);
259
+    /* Exception Header Tail Checksum */
260
+    data[i++] = 0x7E;
261
+    data[i++] = 0x7E; 
262
+}
263
+
264
+void NessLab_Status_Check(){
265
+	//HAL_GPIO_ReadPin(, GPIO_Pin)
266
+}
267
+void NessLab_PAU_Enable(){
268
+#if 1
269
+    if( HAL_GPIO_ReadPin(PAU_EN_GPIO_Port, PAU_EN_Pin) != HAL_GPIO_ReadPin(AMP_EN_GPIO_Port, AMP_EN_Pin) ){
270
+        HAL_GPIO_WritePin(AMP_EN_GPIO_Port,AMP_EN_Pin, HAL_GPIO_ReadPin(PAU_EN_GPIO_Port, PAU_EN_Pin));
271
+        printf("HAL_GPIO_ReadPin(PAU_EN_GPIO_Port, PAU_EN_Pin) : %d \r\n",HAL_GPIO_ReadPin(PAU_EN_GPIO_Port, PAU_EN_Pin));
272
+        printf("AMP_EN_GPIO_Port : %d \r\n",HAL_GPIO_ReadPin(AMP_EN_GPIO_Port, AMP_EN_Pin));
273
+//        HAL_Delay(1000);
274
+    }
275
+	//HAL_GPIO_WritePin(AMP_EN_GPIO_Port,AMP_EN_Pin, HAL_GPIO_ReadPin(PAU_RESET_GPIO_Port, PAU_RESET_Pin));
276
+#else
277
+    HAL_GPIO_WritePin(AMP_EN_GPIO_Port,AMP_EN_Pin, 0);
278
+    printf("AMP_EN_GPIO_Port : %d \r\n",HAL_GPIO_ReadPin(AMP_EN_GPIO_Port, AMP_EN_Pin));
279
+
280
+#endif
281
+}
282
+void NessLab_GPIO_Operate(){
283
+	NessLab_PAU_Enable();
284
+}
285
+
286
+
287
+
288
+void NessLab_ADC_Convert_Table(){
289
+    
290
+
291
+}

+ 206 - 0
insight/Nesslab_200M_System.si4project/Backup/adc(7841).c

@@ -0,0 +1,206 @@
1
+ /*
2
+  * adc.c
3
+  *
4
+  *  Created on: 2020. 8. 3.
5
+  *      Author: parkyj
6
+  */
7
+#include "main.h"
8
+#include "adc.h"
9
+#include "NessLab.h"
10
+ 
11
+uint8_t ADC_Convert_Temperature(double val);
12
+
13
+ extern ADC_HandleTypeDef hadc1;
14
+ extern DMA_HandleTypeDef hdma_adc1;
15
+ extern Nesslab_Prot Currstatus;
16
+ 
17
+ 
18
+ //volatile uint16_t ADC1valuearray[ADC1_CNT][ADC_AVERAGECNT];
19
+ volatile uint16_t ADC1value[ADC1_CNT];
20
+ volatile uint16_t ADC1_Arrage[ADC_AVERAGECNT] = {0,};
21
+ volatile uint32_t ADC1_Arrage_Ret[ADC_AVERAGECNT] = {0,};
22
+ 
23
+ uint16_t adc1cnt = 0 ;
24
+ uint32_t TotalCnt = 0;
25
+ 
26
+ 
27
+ extern volatile uint32_t TDD_125ms_Cnt;
28
+ 
29
+ 
30
+ /*
31
+  *
32
+  * ADC 0 :DL TX
33
+  * ADC 1 :DL RX
34
+  * ADC 2 :TEMP
35
+  * */
36
+ 
37
+ void ADC_Value_Get(){
38
+     uint16_t CalcRet = 0 ;
39
+     uint16_t Tx_Det_Volt = ((ADC1value[0] * (3.3 / 4095))* 1000);
40
+     uint16_t Rx_Det_Volt = ((ADC1value[1] * (3.3 / 4095))* 1000);
41
+     int8_t Real_Temperature = ADC_Convert_Temperature((ADC1value[2] * (3.3 / 4095)));
42
+     /*DL TX Calc*/
43
+     Currstatus.DownLink_Forward_Det_H = ((Tx_Det_Volt & 0xFF00) >> 8);
44
+     Currstatus.DownLink_Forward_Det_L = (Tx_Det_Volt & 0x00FF);
45
+     printf("Tx_Det_Volt : %d \r\n",Tx_Det_Volt);
46
+ 
47
+     /*DL RX Calc*/
48
+     Currstatus.DownLink_Reverse_Det_H = ((Rx_Det_Volt & 0xFF00) >> 8);
49
+     Currstatus.DownLink_Reverse_Det_L = (Rx_Det_Volt & 0x00FF);
50
+ 
51
+     /*Temp Calc*/
52
+     Currstatus.Temp_Monitor = Real_Temperature;
53
+ 
54
+ 
55
+ }
56
+ void ADC_Initialize(){
57
+     while(!(HAL_ADCEx_Calibration_Start(&hadc1)==HAL_OK));
58
+     HAL_ADC_Start_DMA(&hadc1, (uint16_t*)ADC1value,(uint32_t) 3);
59
+ }
60
+ 
61
+ uint8_t ADC_Convert_Temperature(double val){
62
+     int16_t ref_0temp = 500;
63
+     int16_t ret = val * 1000;
64
+     int8_t cnt = 0;
65
+ 
66
+     printf("ret : %d \r\n", ret);
67
+     if( ret - ref_0temp > 0){
68
+         for(int i = 0; i < ret - ref_0temp; i += 10){
69
+             cnt++;
70
+         }
71
+     }else{
72
+         for(int i = 0; i > ret - ref_0temp; i -= 10){
73
+             cnt--;
74
+         }
75
+     }
76
+     printf("Temp : %d\r\n",cnt);
77
+     return cnt;
78
+ }
79
+ uint32_t SumFunc(uint32_t* data,uint16_t size){
80
+     uint32_t ret = 0;
81
+     for (uint16_t i = 0; i < size; i++)    // 배열의 요소 개수만큼 반복
82
+     {
83
+         ret += data[i];    // sum과 배열의 요소를 더해서 다시 sum에 저장
84
+ //        printf("ret : %d  data[%d] \r\n",ret,i,data[i]);
85
+     }
86
+     return ret;
87
+ }
88
+ 
89
+ 
90
+ void DascendigFunc(int32_t* src,uint32_t size ){
91
+   int32_t temp;
92
+ 
93
+   
94
+   for(int i = 0 ; i < size - 1 ; i ++) {
95
+       for(int j = i+1 ; j < size ; j ++) {
96
+       if(src[i] < src[j]) {
97
+               temp = src[j];
98
+               src[j] = src[i];
99
+               src[i] = temp;
100
+ //              printf("temp");
101
+         }
102
+       }
103
+   }
104
+ }
105
+#define Percent100 5
106
+ 
107
+ void ADC_Check(){
108
+     float tempval = 0;
109
+
110
+     for(int i = 0; i < 3 ; i++)
111
+         printf("ADC1value[%d] : %d \r\n",i,ADC1value[i]);
112
+     
113
+ 
114
+ 
115
+     
116
+#if 0 // PYJ.2020.09.09_BEGIN -- 
117
+     Currstatus.DownLink_Forward_Det_H
118
+         = (((uint16_t)tempval & 0xFF00) >> 8);
119
+     Currstatus.DownLink_Forward_Det_L
120
+         = (((uint16_t)tempval & 0x00FF) );
121
+#endif // PYJ.2020.09.09_END -- 
122
+    ADC_Value_Get();
123
+
124
+//      Currstatus.Temp_Monitor = ADC_Convert_Temperature((ADC1value[2]/1000));
125
+//     printf("Currstatus.DownLink_Forward_Det : %d \r\n",Currstatus.DownLink_Forward_Det_H << 8 | Currstatus.DownLink_Forward_Det_L);
126
+ }
127
+ void ADC_TDD_Arrange(){
128
+     uint32_t ADC1_Average_value = 0;
129
+     
130
+ 
131
+     if(TDD_125ms_Cnt > 125)
132
+     {
133
+         
134
+ //        printf("================TotalCnt %d  =================\r\n",TotalCnt);
135
+#if 1 // PYJ.2020.09.09_BEGIN -- 
136
+         DascendigFunc(&ADC1_Arrage_Ret[0],ADC_AVERAGECNT); 
137
+ 
138
+ //        for(int i = 0; i < 100; i++){/*ADC Data Dascending Complete*/
139
+ //            printf("ADC1_Arrage_Ret[%d] : %d \r\n",i,ADC1_Arrage_Ret[i]);
140
+ //        }           
141
+ 
142
+         ADC1_Average_value = SumFunc(&ADC1_Arrage_Ret[0],Percent100);
143
+         
144
+ //        printf("ADC1_Average_value Sum  : %d \r\n",ADC1_Average_value);
145
+         ADC1_Average_value /=Percent100;    
146
+ //        printf("ADC1_Average_value : %d \r\n",ADC1_Average_value);
147
+     for(int i = 0; i < ADC_AVERAGECNT; i++){
148
+         ADC1_Arrage_Ret[i] = 0;
149
+     }       
150
+ 
151
+     Currstatus.DownLink_Forward_Det_H
152
+         = (((uint16_t)ADC1_Average_value & 0xFF00) >> 8);
153
+     Currstatus.DownLink_Forward_Det_L
154
+         = (((uint16_t)ADC1_Average_value & 0x00FF) );        
155
+#else
156
+         for(int i = 0; i < ADC_AVERAGECNT; i++){
157
+             ADC1_Arrage_Ret[i] = ADC1_Arrage[i];
158
+         }
159
+#endif // PYJ.2020.09.09_END -- 
160
+ 
161
+         
162
+         TotalCnt = 0;
163
+         TDD_125ms_Cnt = 0;
164
+     }
165
+ 
166
+ }
167
+ 
168
+ void HAL_ADC_ConvCpltCallback(ADC_HandleTypeDef* hadc)
169
+ {
170
+     if(hadc->Instance == hadc1.Instance && TDD_125ms_Cnt < 125)
171
+     {
172
+         
173
+         ADC1_Arrage[adc1cnt] = ADC1value[0];
174
+ //        for(int i = 0; i < 2; i++){
175
+ //            printf("ADC1value[%d] : %d , %f\r\n",i,ADC1value[i],(float)((ADC1value[i]) *3.3 /4095));
176
+ //        }
177
+         adc1cnt++;
178
+         
179
+         if(adc1cnt == ADC_AVERAGECNT){
180
+ //            DascendigFunc(&ADC1_Arrage[0],ADC_AVERAGECNT);
181
+ 
182
+             adc1cnt = 0;
183
+             TotalCnt++;
184
+             if(TotalCnt > 2)
185
+                 TotalCnt = 2;
186
+             
187
+             for(int i = 0; i < 100; i++){/*ADC Data Dascending Complete*/
188
+                 if(ADC1_Arrage_Ret[i] <= ADC1_Arrage[i])
189
+                     ADC1_Arrage_Ret[i] = ADC1_Arrage[i];
190
+             } 
191
+             DascendigFunc(&ADC1_Arrage_Ret[0],ADC_AVERAGECNT);              
192
+ //            for(int i = 0; i < 100; i++){/*ADC Data Dascending Complete*/
193
+ //                printf("ADC1_Arrage_Ret[%d] : %d \r\n",i,ADC1_Arrage_Ret[i]);
194
+ //            }             
195
+ //                else
196
+ //                ADC1_Arrage_Ret[i] /= TotalCnt;
197
+             
198
+         }
199
+ //        if(adc1cnt < ADC_AVERAGECNT){
200
+ //            for(int i = 0; i < ADC1_CNT; i++){
201
+ //                ADC1valuearray[i][adc1cnt] = ADC1value[i];
202
+ //            }
203
+ //            adc1cnt++;
204
+ //        }
205
+     }
206
+ }

+ 609 - 0
insight/Nesslab_200M_System.si4project/Backup/main(2135).c

@@ -0,0 +1,609 @@
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) 2020 STMicroelectronics.
10
+  * All rights reserved.</center></h2>
11
+  *
12
+  * This software component is licensed by ST under Ultimate Liberty license
13
+  * SLA0044, the "License"; You may not use this file except in compliance with
14
+  * the License. You may obtain a copy of the License at:
15
+  *                             www.st.com/SLA0044
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
+#include <stdio.h>
27
+#include <string.h>
28
+#include "uart.h"
29
+#include "adc.h"
30
+#include "led.h"
31
+#include "flash.h"
32
+#include "NessLab.h"
33
+/* USER CODE END Includes */
34
+
35
+/* Private typedef -----------------------------------------------------------*/
36
+/* USER CODE BEGIN PTD */
37
+
38
+/* USER CODE END PTD */
39
+
40
+/* Private define ------------------------------------------------------------*/
41
+/* USER CODE BEGIN PD */
42
+/* USER CODE END PD */
43
+
44
+/* Private macro -------------------------------------------------------------*/
45
+/* USER CODE BEGIN PM */
46
+
47
+/* USER CODE END PM */
48
+
49
+/* Private variables ---------------------------------------------------------*/
50
+ADC_HandleTypeDef hadc1;
51
+DMA_HandleTypeDef hdma_adc1;
52
+
53
+TIM_HandleTypeDef htim6;
54
+
55
+UART_HandleTypeDef huart1;
56
+UART_HandleTypeDef huart3;
57
+DMA_HandleTypeDef hdma_usart1_tx;
58
+DMA_HandleTypeDef hdma_usart1_rx;
59
+DMA_HandleTypeDef hdma_usart3_tx;
60
+DMA_HandleTypeDef hdma_usart3_rx;
61
+
62
+/* USER CODE BEGIN PV */
63
+volatile uint32_t UartRxTimerCnt = 0;
64
+volatile uint32_t DC_FAIL_ALARM_CNT = 0;
65
+volatile uint32_t OVER_INPUT_ALARM_CNT = 0;
66
+volatile uint32_t OVER_TEMP_ALARM_CNT = 0;
67
+volatile uint32_t ALC_ALARM_CNT = 0;
68
+volatile uint32_t OVER_POWER_ALARM_CNT = 0;
69
+volatile uint32_t VSWR_ALARM_CNT = 0;
70
+
71
+
72
+
73
+volatile uint32_t TDD_125ms_Cnt = 0;
74
+
75
+volatile uint32_t TestTimer = 0;
76
+
77
+
78
+/* USER CODE END PV */
79
+
80
+/* Private function prototypes -----------------------------------------------*/
81
+void SystemClock_Config(void);
82
+static void MX_GPIO_Init(void);
83
+static void MX_DMA_Init(void);
84
+static void MX_ADC1_Init(void);
85
+static void MX_TIM6_Init(void);
86
+static void MX_USART1_UART_Init(void);
87
+static void MX_USART3_UART_Init(void);
88
+static void MX_NVIC_Init(void);
89
+/* USER CODE BEGIN PFP */
90
+extern void InitUartQueue(pUARTQUEUE pQueue);
91
+extern void Flash_InitRead();
92
+extern uint8_t FLASH_Write_Func(uint8_t* data,uint32_t size);
93
+
94
+
95
+/* USER CODE END PFP */
96
+
97
+/* Private user code ---------------------------------------------------------*/
98
+/* USER CODE BEGIN 0 */
99
+int _write (int file, uint8_t *ptr, uint16_t len)
100
+{
101
+#if 0 // PYJ.2020.06.03_BEGIN --
102
+    HAL_UART_Transmit(&hTest, ptr, len,10);
103
+#else
104
+    HAL_UART_Transmit(&hTerminal, ptr, len,10);
105
+#endif // PYJ.2020.06.03_END --
106
+
107
+    return len;
108
+}
109
+
110
+/* USER CODE END 0 */
111
+
112
+/**
113
+  * @brief  The application entry point.
114
+  * @retval int
115
+  */
116
+int main(void)
117
+{
118
+  /* USER CODE BEGIN 1 */
119
+
120
+
121
+  /* USER CODE END 1 */
122
+
123
+  /* MCU Configuration--------------------------------------------------------*/
124
+
125
+  /* Reset of all peripherals, Initializes the Flash interface and the Systick. */
126
+  HAL_Init();
127
+
128
+  /* USER CODE BEGIN Init */
129
+
130
+  /* USER CODE END Init */
131
+
132
+  /* Configure the system clock */
133
+  SystemClock_Config();
134
+
135
+  /* USER CODE BEGIN SysInit */
136
+
137
+  /* USER CODE END SysInit */
138
+
139
+  /* Initialize all configured peripherals */
140
+  MX_GPIO_Init();
141
+  MX_DMA_Init();
142
+  MX_ADC1_Init();
143
+  MX_TIM6_Init();
144
+  MX_USART1_UART_Init();
145
+  MX_USART3_UART_Init();
146
+
147
+  /* Initialize interrupts */
148
+  MX_NVIC_Init();
149
+  /* USER CODE BEGIN 2 */
150
+  HAL_TIM_Base_Start_IT(&htim6);
151
+
152
+  setbuf(stdout, NULL);
153
+  InitUartQueue(&MainQueue);
154
+  ADC_Initialize();
155
+#if 1 // PYJ.2020.05.06_BEGIN --
156
+    printf("****************************************\r\n");
157
+    printf("NESSLAB Project\r\n");
158
+    printf("Build at %s %s\r\n", __DATE__, __TIME__);
159
+    printf("Copyright (c) 2020. BLUECELL\r\n");
160
+    printf("****************************************\r\n");
161
+#if 0 // PYJ.2020.08.28_BEGIN -- 
162
+    uint8_t Flash_TestDataArray[200] = {0x33,};
163
+
164
+    Flash_InitRead();
165
+    DataErase_Func(FLASH_USER_USE_START_ADDR,200);
166
+    printf("Ram Data Display \r\n");
167
+    for(int i = 0; i < 200; i++){
168
+        Flash_TestDataArray[i] = 0x33;
169
+//        printf("%x ",Flash_TestDataArray[i]);
170
+    }
171
+    FLASH_Write_Func(&Flash_TestDataArray[0],200);
172
+    Flash_InitRead();    
173
+#endif // PYJ.2020.08.28_END -- 
174
+#endif // PYJ.2020.05.06_END --  
175
+  /* USER CODE END 2 */
176
+
177
+  /* Infinite loop */
178
+  /* USER CODE BEGIN WHILE */
179
+
180
+ 
181
+
182
+
183
+  while (1)
184
+  {
185
+#if 1 // PYJ.2020.08.31_BEGIN -- 
186
+    Boot_LED_Toggle(); /*LED Check*/
187
+    Uart_Check();      /*Usart Rx*/
188
+    NessLab_GPIO_Operate();
189
+#else
190
+    NessLab_Operate(datatest);
191
+    datatest[4]++;
192
+
193
+    HAL_Delay(3000);
194
+
195
+#endif // PYJ.2020.08.31_END -- 
196
+//    ADC_Check();       /*Det Calc + DL/UL Alarm Check Function*/
197
+    /* USER CODE END WHILE */
198
+
199
+    /* USER CODE BEGIN 3 */
200
+  }
201
+  /* USER CODE END 3 */
202
+}
203
+
204
+/**
205
+  * @brief System Clock Configuration
206
+  * @retval None
207
+  */
208
+void SystemClock_Config(void)
209
+{
210
+  RCC_OscInitTypeDef RCC_OscInitStruct = {0};
211
+  RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};
212
+  RCC_PeriphCLKInitTypeDef PeriphClkInit = {0};
213
+
214
+  /** Initializes the CPU, AHB and APB busses clocks 
215
+  */
216
+  RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI;
217
+  RCC_OscInitStruct.HSIState = RCC_HSI_ON;
218
+  RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT;
219
+  RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
220
+  RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSI_DIV2;
221
+  RCC_OscInitStruct.PLL.PLLMUL = RCC_PLL_MUL6;
222
+  if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)
223
+  {
224
+    Error_Handler();
225
+  }
226
+  /** Initializes the CPU, AHB and APB busses clocks 
227
+  */
228
+  RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK
229
+                              |RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2;
230
+  RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
231
+  RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
232
+  RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV1;
233
+  RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1;
234
+
235
+  if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_0) != HAL_OK)
236
+  {
237
+    Error_Handler();
238
+  }
239
+  PeriphClkInit.PeriphClockSelection = RCC_PERIPHCLK_ADC;
240
+  PeriphClkInit.AdcClockSelection = RCC_ADCPCLK2_DIV2;
241
+  if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInit) != HAL_OK)
242
+  {
243
+    Error_Handler();
244
+  }
245
+}
246
+
247
+/**
248
+  * @brief NVIC Configuration.
249
+  * @retval None
250
+  */
251
+static void MX_NVIC_Init(void)
252
+{
253
+  /* ADC1_IRQn interrupt configuration */
254
+  HAL_NVIC_SetPriority(ADC1_IRQn, 0, 0);
255
+  HAL_NVIC_EnableIRQ(ADC1_IRQn);
256
+  /* USART1_IRQn interrupt configuration */
257
+  HAL_NVIC_SetPriority(USART1_IRQn, 0, 0);
258
+  HAL_NVIC_EnableIRQ(USART1_IRQn);
259
+  /* USART3_IRQn interrupt configuration */
260
+  HAL_NVIC_SetPriority(USART3_IRQn, 0, 0);
261
+  HAL_NVIC_EnableIRQ(USART3_IRQn);
262
+  /* TIM6_DAC_IRQn interrupt configuration */
263
+  HAL_NVIC_SetPriority(TIM6_DAC_IRQn, 0, 0);
264
+  HAL_NVIC_EnableIRQ(TIM6_DAC_IRQn);
265
+  /* DMA1_Channel2_IRQn interrupt configuration */
266
+  HAL_NVIC_SetPriority(DMA1_Channel2_IRQn, 0, 0);
267
+  HAL_NVIC_EnableIRQ(DMA1_Channel2_IRQn);
268
+  /* DMA1_Channel4_IRQn interrupt configuration */
269
+  HAL_NVIC_SetPriority(DMA1_Channel4_IRQn, 0, 0);
270
+  HAL_NVIC_EnableIRQ(DMA1_Channel4_IRQn);
271
+  /* DMA1_Channel3_IRQn interrupt configuration */
272
+  HAL_NVIC_SetPriority(DMA1_Channel3_IRQn, 0, 0);
273
+  HAL_NVIC_EnableIRQ(DMA1_Channel3_IRQn);
274
+  /* DMA1_Channel1_IRQn interrupt configuration */
275
+  HAL_NVIC_SetPriority(DMA1_Channel1_IRQn, 0, 0);
276
+  HAL_NVIC_EnableIRQ(DMA1_Channel1_IRQn);
277
+  /* DMA1_Channel5_IRQn interrupt configuration */
278
+  HAL_NVIC_SetPriority(DMA1_Channel5_IRQn, 0, 0);
279
+  HAL_NVIC_EnableIRQ(DMA1_Channel5_IRQn);
280
+}
281
+
282
+/**
283
+  * @brief ADC1 Initialization Function
284
+  * @param None
285
+  * @retval None
286
+  */
287
+static void MX_ADC1_Init(void)
288
+{
289
+
290
+  /* USER CODE BEGIN ADC1_Init 0 */
291
+
292
+  /* USER CODE END ADC1_Init 0 */
293
+
294
+  ADC_ChannelConfTypeDef sConfig = {0};
295
+
296
+  /* USER CODE BEGIN ADC1_Init 1 */
297
+
298
+  /* USER CODE END ADC1_Init 1 */
299
+  /** Common config 
300
+  */
301
+  hadc1.Instance = ADC1;
302
+  hadc1.Init.ScanConvMode = ADC_SCAN_ENABLE;
303
+  hadc1.Init.ContinuousConvMode = ENABLE;
304
+  hadc1.Init.DiscontinuousConvMode = DISABLE;
305
+  hadc1.Init.ExternalTrigConv = ADC_SOFTWARE_START;
306
+  hadc1.Init.DataAlign = ADC_DATAALIGN_RIGHT;
307
+  hadc1.Init.NbrOfConversion = 3;
308
+  if (HAL_ADC_Init(&hadc1) != HAL_OK)
309
+  {
310
+    Error_Handler();
311
+  }
312
+  /** Configure Regular Channel 
313
+  */
314
+  sConfig.Channel = ADC_CHANNEL_0;
315
+  sConfig.Rank = ADC_REGULAR_RANK_1;
316
+  sConfig.SamplingTime = ADC_SAMPLETIME_239CYCLES_5;
317
+  if (HAL_ADC_ConfigChannel(&hadc1, &sConfig) != HAL_OK)
318
+  {
319
+    Error_Handler();
320
+  }
321
+  /** Configure Regular Channel 
322
+  */
323
+  sConfig.Channel = ADC_CHANNEL_1;
324
+  sConfig.Rank = ADC_REGULAR_RANK_2;
325
+  if (HAL_ADC_ConfigChannel(&hadc1, &sConfig) != HAL_OK)
326
+  {
327
+    Error_Handler();
328
+  }
329
+  /** Configure Regular Channel 
330
+  */
331
+  sConfig.Channel = ADC_CHANNEL_3;
332
+  sConfig.Rank = ADC_REGULAR_RANK_3;
333
+  if (HAL_ADC_ConfigChannel(&hadc1, &sConfig) != HAL_OK)
334
+  {
335
+    Error_Handler();
336
+  }
337
+  /* USER CODE BEGIN ADC1_Init 2 */
338
+
339
+  /* USER CODE END ADC1_Init 2 */
340
+
341
+}
342
+
343
+/**
344
+  * @brief TIM6 Initialization Function
345
+  * @param None
346
+  * @retval None
347
+  */
348
+static void MX_TIM6_Init(void)
349
+{
350
+
351
+  /* USER CODE BEGIN TIM6_Init 0 */
352
+
353
+  /* USER CODE END TIM6_Init 0 */
354
+
355
+  TIM_MasterConfigTypeDef sMasterConfig = {0};
356
+
357
+  /* USER CODE BEGIN TIM6_Init 1 */
358
+
359
+  /* USER CODE END TIM6_Init 1 */
360
+  htim6.Instance = TIM6;
361
+  htim6.Init.Prescaler = 2400-1;
362
+  htim6.Init.CounterMode = TIM_COUNTERMODE_UP;
363
+  htim6.Init.Period = 10;
364
+  htim6.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE;
365
+  if (HAL_TIM_Base_Init(&htim6) != HAL_OK)
366
+  {
367
+    Error_Handler();
368
+  }
369
+  sMasterConfig.MasterOutputTrigger = TIM_TRGO_RESET;
370
+  sMasterConfig.MasterSlaveMode = TIM_MASTERSLAVEMODE_DISABLE;
371
+  if (HAL_TIMEx_MasterConfigSynchronization(&htim6, &sMasterConfig) != HAL_OK)
372
+  {
373
+    Error_Handler();
374
+  }
375
+  /* USER CODE BEGIN TIM6_Init 2 */
376
+
377
+  /* USER CODE END TIM6_Init 2 */
378
+
379
+}
380
+
381
+/**
382
+  * @brief USART1 Initialization Function
383
+  * @param None
384
+  * @retval None
385
+  */
386
+static void MX_USART1_UART_Init(void)
387
+{
388
+
389
+  /* USER CODE BEGIN USART1_Init 0 */
390
+
391
+  /* USER CODE END USART1_Init 0 */
392
+
393
+  /* USER CODE BEGIN USART1_Init 1 */
394
+
395
+  /* USER CODE END USART1_Init 1 */
396
+  huart1.Instance = USART1;
397
+  huart1.Init.BaudRate = 115200;
398
+  huart1.Init.WordLength = UART_WORDLENGTH_8B;
399
+  huart1.Init.StopBits = UART_STOPBITS_1;
400
+  huart1.Init.Parity = UART_PARITY_NONE;
401
+  huart1.Init.Mode = UART_MODE_TX_RX;
402
+  huart1.Init.HwFlowCtl = UART_HWCONTROL_NONE;
403
+  huart1.Init.OverSampling = UART_OVERSAMPLING_16;
404
+  if (HAL_UART_Init(&huart1) != HAL_OK)
405
+  {
406
+    Error_Handler();
407
+  }
408
+  /* USER CODE BEGIN USART1_Init 2 */
409
+
410
+  /* USER CODE END USART1_Init 2 */
411
+
412
+}
413
+
414
+/**
415
+  * @brief USART3 Initialization Function
416
+  * @param None
417
+  * @retval None
418
+  */
419
+static void MX_USART3_UART_Init(void)
420
+{
421
+
422
+  /* USER CODE BEGIN USART3_Init 0 */
423
+
424
+  /* USER CODE END USART3_Init 0 */
425
+
426
+  /* USER CODE BEGIN USART3_Init 1 */
427
+
428
+  /* USER CODE END USART3_Init 1 */
429
+  huart3.Instance = USART3;
430
+  huart3.Init.BaudRate = 115200;
431
+  huart3.Init.WordLength = UART_WORDLENGTH_8B;
432
+  huart3.Init.StopBits = UART_STOPBITS_1;
433
+  huart3.Init.Parity = UART_PARITY_NONE;
434
+  huart3.Init.Mode = UART_MODE_TX_RX;
435
+  huart3.Init.HwFlowCtl = UART_HWCONTROL_NONE;
436
+  huart3.Init.OverSampling = UART_OVERSAMPLING_16;
437
+  if (HAL_UART_Init(&huart3) != HAL_OK)
438
+  {
439
+    Error_Handler();
440
+  }
441
+  /* USER CODE BEGIN USART3_Init 2 */
442
+
443
+  /* USER CODE END USART3_Init 2 */
444
+
445
+}
446
+
447
+/** 
448
+  * Enable DMA controller clock
449
+  */
450
+static void MX_DMA_Init(void) 
451
+{
452
+
453
+  /* DMA controller clock enable */
454
+  __HAL_RCC_DMA1_CLK_ENABLE();
455
+
456
+}
457
+
458
+/**
459
+  * @brief GPIO Initialization Function
460
+  * @param None
461
+  * @retval None
462
+  */
463
+static void MX_GPIO_Init(void)
464
+{
465
+  GPIO_InitTypeDef GPIO_InitStruct = {0};
466
+
467
+  /* GPIO Ports Clock Enable */
468
+  __HAL_RCC_GPIOC_CLK_ENABLE();
469
+  __HAL_RCC_GPIOA_CLK_ENABLE();
470
+  __HAL_RCC_GPIOB_CLK_ENABLE();
471
+
472
+  /*Configure GPIO pin Output Level */
473
+  HAL_GPIO_WritePin(BOOT_LED_GPIO_Port, BOOT_LED_Pin, GPIO_PIN_RESET);
474
+
475
+  /*Configure GPIO pin Output Level */
476
+  HAL_GPIO_WritePin(GPIOA, PAU_RESERVED0_Pin|PAU_RESERVED1_Pin|AMP_EN_Pin, GPIO_PIN_RESET);
477
+
478
+  /*Configure GPIO pin Output Level */
479
+  HAL_GPIO_WritePin(GPIOB, PAU_RESERVED3_Pin|PAU_RESERVED2_Pin|PAU_RESET_Pin, GPIO_PIN_RESET);
480
+
481
+  /*Configure GPIO pin : BOOT_LED_Pin */
482
+  GPIO_InitStruct.Pin = BOOT_LED_Pin;
483
+  GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
484
+  GPIO_InitStruct.Pull = GPIO_NOPULL;
485
+  GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
486
+  HAL_GPIO_Init(BOOT_LED_GPIO_Port, &GPIO_InitStruct);
487
+
488
+  /*Configure GPIO pins : DC_FAIL_ALARM_Pin OVER_INPUT_ALARM_Pin OVER_TEMP_ALARM_Pin */
489
+  GPIO_InitStruct.Pin = DC_FAIL_ALARM_Pin|OVER_INPUT_ALARM_Pin|OVER_TEMP_ALARM_Pin;
490
+  GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
491
+  GPIO_InitStruct.Pull = GPIO_NOPULL;
492
+  HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
493
+
494
+  /*Configure GPIO pins : PAU_RESERVED0_Pin PAU_RESERVED1_Pin AMP_EN_Pin */
495
+  GPIO_InitStruct.Pin = PAU_RESERVED0_Pin|PAU_RESERVED1_Pin|AMP_EN_Pin;
496
+  GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
497
+  GPIO_InitStruct.Pull = GPIO_NOPULL;
498
+  GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
499
+  HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
500
+
501
+  /*Configure GPIO pins : PAU_RESERVED3_Pin PAU_RESERVED2_Pin PAU_RESET_Pin */
502
+  GPIO_InitStruct.Pin = PAU_RESERVED3_Pin|PAU_RESERVED2_Pin|PAU_RESET_Pin;
503
+  GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
504
+  GPIO_InitStruct.Pull = GPIO_NOPULL;
505
+  GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
506
+  HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
507
+
508
+  /*Configure GPIO pins : OVER_POWER_ALARM_Pin VSWR_ALARM_Pin PAU_EN_Pin ALC_ALARM_Pin */
509
+  GPIO_InitStruct.Pin = OVER_POWER_ALARM_Pin|VSWR_ALARM_Pin|PAU_EN_Pin|ALC_ALARM_Pin;
510
+  GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
511
+  GPIO_InitStruct.Pull = GPIO_NOPULL;
512
+  HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
513
+
514
+}
515
+
516
+/* USER CODE BEGIN 4 */
517
+
518
+/* USER CODE END 4 */
519
+
520
+ /**
521
+  * @brief  Period elapsed callback in non blocking mode
522
+  * @note   This function is called  when TIM2 interrupt took place, inside
523
+  * HAL_TIM_IRQHandler(). It makes a direct call to HAL_IncTick() to increment
524
+  * a global variable "uwTick" used as application time base.
525
+  * @param  htim : TIM handle
526
+  * @retval None
527
+  */
528
+void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim)
529
+{
530
+  /* USER CODE BEGIN Callback 0 */
531
+
532
+  /* USER CODE END Callback 0 */
533
+  if (htim->Instance == TIM2) {
534
+    HAL_IncTick();
535
+  }
536
+  /* USER CODE BEGIN Callback 1 */
537
+  if(htim->Instance == TIM6){
538
+      UartRxTimerCnt++;
539
+          LED_TimerCnt++;
540
+          TDD_125ms_Cnt++;
541
+          TestTimer++;
542
+      
543
+      
544
+        if(HAL_GPIO_ReadPin(DC_FAIL_ALARM_GPIO_Port, DC_FAIL_ALARM_Pin) == GPIO_PIN_SET)
545
+            DC_FAIL_ALARM_CNT++;
546
+        else
547
+            DC_FAIL_ALARM_CNT = 0;
548
+            
549
+        if(HAL_GPIO_ReadPin(OVER_INPUT_ALARM_GPIO_Port, OVER_INPUT_ALARM_Pin)== GPIO_PIN_SET)
550
+            OVER_INPUT_ALARM_CNT++;
551
+        else
552
+            OVER_INPUT_ALARM_CNT = 0;
553
+            
554
+        if(HAL_GPIO_ReadPin(OVER_TEMP_ALARM_GPIO_Port, OVER_TEMP_ALARM_Pin)== GPIO_PIN_SET)
555
+            OVER_TEMP_ALARM_CNT++;
556
+        else
557
+            OVER_TEMP_ALARM_CNT = 0;
558
+            
559
+        if(HAL_GPIO_ReadPin(ALC_ALARM_GPIO_Port, ALC_ALARM_Pin)== GPIO_PIN_SET)
560
+            ALC_ALARM_CNT++;
561
+        else
562
+            ALC_ALARM_CNT = 0;
563
+            
564
+        if(HAL_GPIO_ReadPin(OVER_POWER_ALARM_GPIO_Port, OVER_POWER_ALARM_Pin)== GPIO_PIN_SET)
565
+            OVER_POWER_ALARM_CNT++;
566
+      
567
+        else
568
+            OVER_POWER_ALARM_CNT = 0;
569
+            
570
+        if(HAL_GPIO_ReadPin(VSWR_ALARM_GPIO_Port, VSWR_ALARM_Pin)== GPIO_PIN_SET)
571
+            VSWR_ALARM_CNT++;
572
+      
573
+        else
574
+            VSWR_ALARM_CNT = 0;
575
+
576
+  }
577
+  /* USER CODE END Callback 1 */
578
+}
579
+
580
+/**
581
+  * @brief  This function is executed in case of error occurrence.
582
+  * @retval None
583
+  */
584
+void Error_Handler(void)
585
+{
586
+  /* USER CODE BEGIN Error_Handler_Debug */
587
+  /* User can add his own implementation to report the HAL error return state */
588
+
589
+  /* USER CODE END Error_Handler_Debug */
590
+}
591
+
592
+#ifdef  USE_FULL_ASSERT
593
+/**
594
+  * @brief  Reports the name of the source file and the source line number
595
+  *         where the assert_param error has occurred.
596
+  * @param  file: pointer to the source file name
597
+  * @param  line: assert_param error line source number
598
+  * @retval None
599
+  */
600
+void assert_failed(uint8_t *file, uint32_t line)
601
+{ 
602
+  /* USER CODE BEGIN 6 */
603
+  /* User can add his own implementation to report the file name and line number,
604
+     tex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */
605
+  /* USER CODE END 6 */
606
+}
607
+#endif /* USE_FULL_ASSERT */
608
+
609
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

+ 610 - 0
insight/Nesslab_200M_System.si4project/Backup/main(2185).c

@@ -0,0 +1,610 @@
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) 2020 STMicroelectronics.
10
+  * All rights reserved.</center></h2>
11
+  *
12
+  * This software component is licensed by ST under Ultimate Liberty license
13
+  * SLA0044, the "License"; You may not use this file except in compliance with
14
+  * the License. You may obtain a copy of the License at:
15
+  *                             www.st.com/SLA0044
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
+#include <stdio.h>
27
+#include <string.h>
28
+#include "uart.h"
29
+#include "adc.h"
30
+#include "led.h"
31
+#include "flash.h"
32
+#include "NessLab.h"
33
+/* USER CODE END Includes */
34
+
35
+/* Private typedef -----------------------------------------------------------*/
36
+/* USER CODE BEGIN PTD */
37
+
38
+/* USER CODE END PTD */
39
+
40
+/* Private define ------------------------------------------------------------*/
41
+/* USER CODE BEGIN PD */
42
+/* USER CODE END PD */
43
+
44
+/* Private macro -------------------------------------------------------------*/
45
+/* USER CODE BEGIN PM */
46
+
47
+/* USER CODE END PM */
48
+
49
+/* Private variables ---------------------------------------------------------*/
50
+ADC_HandleTypeDef hadc1;
51
+DMA_HandleTypeDef hdma_adc1;
52
+
53
+TIM_HandleTypeDef htim6;
54
+
55
+UART_HandleTypeDef huart1;
56
+UART_HandleTypeDef huart3;
57
+DMA_HandleTypeDef hdma_usart1_tx;
58
+DMA_HandleTypeDef hdma_usart1_rx;
59
+DMA_HandleTypeDef hdma_usart3_tx;
60
+DMA_HandleTypeDef hdma_usart3_rx;
61
+
62
+/* USER CODE BEGIN PV */
63
+volatile uint32_t UartRxTimerCnt = 0;
64
+volatile uint32_t DC_FAIL_ALARM_CNT = 0;
65
+volatile uint32_t OVER_INPUT_ALARM_CNT = 0;
66
+volatile uint32_t OVER_TEMP_ALARM_CNT = 0;
67
+volatile uint32_t ALC_ALARM_CNT = 0;
68
+volatile uint32_t OVER_POWER_ALARM_CNT = 0;
69
+volatile uint32_t VSWR_ALARM_CNT = 0;
70
+
71
+
72
+
73
+volatile uint32_t TDD_125ms_Cnt = 0;
74
+
75
+volatile uint32_t TestTimer = 0;
76
+
77
+
78
+/* USER CODE END PV */
79
+
80
+/* Private function prototypes -----------------------------------------------*/
81
+void SystemClock_Config(void);
82
+static void MX_GPIO_Init(void);
83
+static void MX_DMA_Init(void);
84
+static void MX_ADC1_Init(void);
85
+static void MX_TIM6_Init(void);
86
+static void MX_USART1_UART_Init(void);
87
+static void MX_USART3_UART_Init(void);
88
+static void MX_NVIC_Init(void);
89
+/* USER CODE BEGIN PFP */
90
+extern void InitUartQueue(pUARTQUEUE pQueue);
91
+extern void Flash_InitRead();
92
+extern uint8_t FLASH_Write_Func(uint8_t* data,uint32_t size);
93
+
94
+
95
+/* USER CODE END PFP */
96
+
97
+/* Private user code ---------------------------------------------------------*/
98
+/* USER CODE BEGIN 0 */
99
+int _write (int file, uint8_t *ptr, uint16_t len)
100
+{
101
+#if 0 // PYJ.2020.06.03_BEGIN --
102
+    HAL_UART_Transmit(&hTest, ptr, len,10);
103
+#else
104
+    HAL_UART_Transmit(&hTerminal, ptr, len,10);
105
+#endif // PYJ.2020.06.03_END --
106
+
107
+    return len;
108
+}
109
+
110
+/* USER CODE END 0 */
111
+
112
+/**
113
+  * @brief  The application entry point.
114
+  * @retval int
115
+  */
116
+int main(void)
117
+{
118
+  /* USER CODE BEGIN 1 */
119
+
120
+
121
+  /* USER CODE END 1 */
122
+
123
+  /* MCU Configuration--------------------------------------------------------*/
124
+
125
+  /* Reset of all peripherals, Initializes the Flash interface and the Systick. */
126
+  HAL_Init();
127
+
128
+  /* USER CODE BEGIN Init */
129
+
130
+  /* USER CODE END Init */
131
+
132
+  /* Configure the system clock */
133
+  SystemClock_Config();
134
+
135
+  /* USER CODE BEGIN SysInit */
136
+
137
+  /* USER CODE END SysInit */
138
+
139
+  /* Initialize all configured peripherals */
140
+  MX_GPIO_Init();
141
+  MX_DMA_Init();
142
+  MX_ADC1_Init();
143
+  MX_TIM6_Init();
144
+  MX_USART1_UART_Init();
145
+  MX_USART3_UART_Init();
146
+
147
+  /* Initialize interrupts */
148
+  MX_NVIC_Init();
149
+  /* USER CODE BEGIN 2 */
150
+  HAL_TIM_Base_Start_IT(&htim6);
151
+
152
+  setbuf(stdout, NULL);
153
+  InitUartQueue(&MainQueue);
154
+  ADC_Initialize();
155
+  NessLab_Init();
156
+#if 1 // PYJ.2020.05.06_BEGIN --
157
+    printf("****************************************\r\n");
158
+    printf("NESSLAB Project\r\n");
159
+    printf("Build at %s %s\r\n", __DATE__, __TIME__);
160
+    printf("Copyright (c) 2020. BLUECELL\r\n");
161
+    printf("****************************************\r\n");
162
+#if 0 // PYJ.2020.08.28_BEGIN -- 
163
+    uint8_t Flash_TestDataArray[200] = {0x33,};
164
+
165
+    Flash_InitRead();
166
+    DataErase_Func(FLASH_USER_USE_START_ADDR,200);
167
+    printf("Ram Data Display \r\n");
168
+    for(int i = 0; i < 200; i++){
169
+        Flash_TestDataArray[i] = 0x33;
170
+//        printf("%x ",Flash_TestDataArray[i]);
171
+    }
172
+    FLASH_Write_Func(&Flash_TestDataArray[0],200);
173
+    Flash_InitRead();    
174
+#endif // PYJ.2020.08.28_END -- 
175
+#endif // PYJ.2020.05.06_END --  
176
+  /* USER CODE END 2 */
177
+
178
+  /* Infinite loop */
179
+  /* USER CODE BEGIN WHILE */
180
+
181
+ 
182
+
183
+
184
+  while (1)
185
+  {
186
+#if 1 // PYJ.2020.08.31_BEGIN -- 
187
+    Boot_LED_Toggle(); /*LED Check*/
188
+    Uart_Check();      /*Usart Rx*/
189
+    NessLab_GPIO_Operate();
190
+#else
191
+    NessLab_Operate(datatest);
192
+    datatest[4]++;
193
+
194
+    HAL_Delay(3000);
195
+
196
+#endif // PYJ.2020.08.31_END -- 
197
+//    ADC_Check();       /*Det Calc + DL/UL Alarm Check Function*/
198
+    /* USER CODE END WHILE */
199
+
200
+    /* USER CODE BEGIN 3 */
201
+  }
202
+  /* USER CODE END 3 */
203
+}
204
+
205
+/**
206
+  * @brief System Clock Configuration
207
+  * @retval None
208
+  */
209
+void SystemClock_Config(void)
210
+{
211
+  RCC_OscInitTypeDef RCC_OscInitStruct = {0};
212
+  RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};
213
+  RCC_PeriphCLKInitTypeDef PeriphClkInit = {0};
214
+
215
+  /** Initializes the CPU, AHB and APB busses clocks 
216
+  */
217
+  RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI;
218
+  RCC_OscInitStruct.HSIState = RCC_HSI_ON;
219
+  RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT;
220
+  RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
221
+  RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSI_DIV2;
222
+  RCC_OscInitStruct.PLL.PLLMUL = RCC_PLL_MUL6;
223
+  if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)
224
+  {
225
+    Error_Handler();
226
+  }
227
+  /** Initializes the CPU, AHB and APB busses clocks 
228
+  */
229
+  RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK
230
+                              |RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2;
231
+  RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
232
+  RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
233
+  RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV1;
234
+  RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1;
235
+
236
+  if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_0) != HAL_OK)
237
+  {
238
+    Error_Handler();
239
+  }
240
+  PeriphClkInit.PeriphClockSelection = RCC_PERIPHCLK_ADC;
241
+  PeriphClkInit.AdcClockSelection = RCC_ADCPCLK2_DIV2;
242
+  if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInit) != HAL_OK)
243
+  {
244
+    Error_Handler();
245
+  }
246
+}
247
+
248
+/**
249
+  * @brief NVIC Configuration.
250
+  * @retval None
251
+  */
252
+static void MX_NVIC_Init(void)
253
+{
254
+  /* ADC1_IRQn interrupt configuration */
255
+  HAL_NVIC_SetPriority(ADC1_IRQn, 0, 0);
256
+  HAL_NVIC_EnableIRQ(ADC1_IRQn);
257
+  /* USART1_IRQn interrupt configuration */
258
+  HAL_NVIC_SetPriority(USART1_IRQn, 0, 0);
259
+  HAL_NVIC_EnableIRQ(USART1_IRQn);
260
+  /* USART3_IRQn interrupt configuration */
261
+  HAL_NVIC_SetPriority(USART3_IRQn, 0, 0);
262
+  HAL_NVIC_EnableIRQ(USART3_IRQn);
263
+  /* TIM6_DAC_IRQn interrupt configuration */
264
+  HAL_NVIC_SetPriority(TIM6_DAC_IRQn, 0, 0);
265
+  HAL_NVIC_EnableIRQ(TIM6_DAC_IRQn);
266
+  /* DMA1_Channel2_IRQn interrupt configuration */
267
+  HAL_NVIC_SetPriority(DMA1_Channel2_IRQn, 0, 0);
268
+  HAL_NVIC_EnableIRQ(DMA1_Channel2_IRQn);
269
+  /* DMA1_Channel4_IRQn interrupt configuration */
270
+  HAL_NVIC_SetPriority(DMA1_Channel4_IRQn, 0, 0);
271
+  HAL_NVIC_EnableIRQ(DMA1_Channel4_IRQn);
272
+  /* DMA1_Channel3_IRQn interrupt configuration */
273
+  HAL_NVIC_SetPriority(DMA1_Channel3_IRQn, 0, 0);
274
+  HAL_NVIC_EnableIRQ(DMA1_Channel3_IRQn);
275
+  /* DMA1_Channel1_IRQn interrupt configuration */
276
+  HAL_NVIC_SetPriority(DMA1_Channel1_IRQn, 0, 0);
277
+  HAL_NVIC_EnableIRQ(DMA1_Channel1_IRQn);
278
+  /* DMA1_Channel5_IRQn interrupt configuration */
279
+  HAL_NVIC_SetPriority(DMA1_Channel5_IRQn, 0, 0);
280
+  HAL_NVIC_EnableIRQ(DMA1_Channel5_IRQn);
281
+}
282
+
283
+/**
284
+  * @brief ADC1 Initialization Function
285
+  * @param None
286
+  * @retval None
287
+  */
288
+static void MX_ADC1_Init(void)
289
+{
290
+
291
+  /* USER CODE BEGIN ADC1_Init 0 */
292
+
293
+  /* USER CODE END ADC1_Init 0 */
294
+
295
+  ADC_ChannelConfTypeDef sConfig = {0};
296
+
297
+  /* USER CODE BEGIN ADC1_Init 1 */
298
+
299
+  /* USER CODE END ADC1_Init 1 */
300
+  /** Common config 
301
+  */
302
+  hadc1.Instance = ADC1;
303
+  hadc1.Init.ScanConvMode = ADC_SCAN_ENABLE;
304
+  hadc1.Init.ContinuousConvMode = ENABLE;
305
+  hadc1.Init.DiscontinuousConvMode = DISABLE;
306
+  hadc1.Init.ExternalTrigConv = ADC_SOFTWARE_START;
307
+  hadc1.Init.DataAlign = ADC_DATAALIGN_RIGHT;
308
+  hadc1.Init.NbrOfConversion = 3;
309
+  if (HAL_ADC_Init(&hadc1) != HAL_OK)
310
+  {
311
+    Error_Handler();
312
+  }
313
+  /** Configure Regular Channel 
314
+  */
315
+  sConfig.Channel = ADC_CHANNEL_0;
316
+  sConfig.Rank = ADC_REGULAR_RANK_1;
317
+  sConfig.SamplingTime = ADC_SAMPLETIME_239CYCLES_5;
318
+  if (HAL_ADC_ConfigChannel(&hadc1, &sConfig) != HAL_OK)
319
+  {
320
+    Error_Handler();
321
+  }
322
+  /** Configure Regular Channel 
323
+  */
324
+  sConfig.Channel = ADC_CHANNEL_1;
325
+  sConfig.Rank = ADC_REGULAR_RANK_2;
326
+  if (HAL_ADC_ConfigChannel(&hadc1, &sConfig) != HAL_OK)
327
+  {
328
+    Error_Handler();
329
+  }
330
+  /** Configure Regular Channel 
331
+  */
332
+  sConfig.Channel = ADC_CHANNEL_3;
333
+  sConfig.Rank = ADC_REGULAR_RANK_3;
334
+  if (HAL_ADC_ConfigChannel(&hadc1, &sConfig) != HAL_OK)
335
+  {
336
+    Error_Handler();
337
+  }
338
+  /* USER CODE BEGIN ADC1_Init 2 */
339
+
340
+  /* USER CODE END ADC1_Init 2 */
341
+
342
+}
343
+
344
+/**
345
+  * @brief TIM6 Initialization Function
346
+  * @param None
347
+  * @retval None
348
+  */
349
+static void MX_TIM6_Init(void)
350
+{
351
+
352
+  /* USER CODE BEGIN TIM6_Init 0 */
353
+
354
+  /* USER CODE END TIM6_Init 0 */
355
+
356
+  TIM_MasterConfigTypeDef sMasterConfig = {0};
357
+
358
+  /* USER CODE BEGIN TIM6_Init 1 */
359
+
360
+  /* USER CODE END TIM6_Init 1 */
361
+  htim6.Instance = TIM6;
362
+  htim6.Init.Prescaler = 2400-1;
363
+  htim6.Init.CounterMode = TIM_COUNTERMODE_UP;
364
+  htim6.Init.Period = 10;
365
+  htim6.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE;
366
+  if (HAL_TIM_Base_Init(&htim6) != HAL_OK)
367
+  {
368
+    Error_Handler();
369
+  }
370
+  sMasterConfig.MasterOutputTrigger = TIM_TRGO_RESET;
371
+  sMasterConfig.MasterSlaveMode = TIM_MASTERSLAVEMODE_DISABLE;
372
+  if (HAL_TIMEx_MasterConfigSynchronization(&htim6, &sMasterConfig) != HAL_OK)
373
+  {
374
+    Error_Handler();
375
+  }
376
+  /* USER CODE BEGIN TIM6_Init 2 */
377
+
378
+  /* USER CODE END TIM6_Init 2 */
379
+
380
+}
381
+
382
+/**
383
+  * @brief USART1 Initialization Function
384
+  * @param None
385
+  * @retval None
386
+  */
387
+static void MX_USART1_UART_Init(void)
388
+{
389
+
390
+  /* USER CODE BEGIN USART1_Init 0 */
391
+
392
+  /* USER CODE END USART1_Init 0 */
393
+
394
+  /* USER CODE BEGIN USART1_Init 1 */
395
+
396
+  /* USER CODE END USART1_Init 1 */
397
+  huart1.Instance = USART1;
398
+  huart1.Init.BaudRate = 115200;
399
+  huart1.Init.WordLength = UART_WORDLENGTH_8B;
400
+  huart1.Init.StopBits = UART_STOPBITS_1;
401
+  huart1.Init.Parity = UART_PARITY_NONE;
402
+  huart1.Init.Mode = UART_MODE_TX_RX;
403
+  huart1.Init.HwFlowCtl = UART_HWCONTROL_NONE;
404
+  huart1.Init.OverSampling = UART_OVERSAMPLING_16;
405
+  if (HAL_UART_Init(&huart1) != HAL_OK)
406
+  {
407
+    Error_Handler();
408
+  }
409
+  /* USER CODE BEGIN USART1_Init 2 */
410
+
411
+  /* USER CODE END USART1_Init 2 */
412
+
413
+}
414
+
415
+/**
416
+  * @brief USART3 Initialization Function
417
+  * @param None
418
+  * @retval None
419
+  */
420
+static void MX_USART3_UART_Init(void)
421
+{
422
+
423
+  /* USER CODE BEGIN USART3_Init 0 */
424
+
425
+  /* USER CODE END USART3_Init 0 */
426
+
427
+  /* USER CODE BEGIN USART3_Init 1 */
428
+
429
+  /* USER CODE END USART3_Init 1 */
430
+  huart3.Instance = USART3;
431
+  huart3.Init.BaudRate = 115200;
432
+  huart3.Init.WordLength = UART_WORDLENGTH_8B;
433
+  huart3.Init.StopBits = UART_STOPBITS_1;
434
+  huart3.Init.Parity = UART_PARITY_NONE;
435
+  huart3.Init.Mode = UART_MODE_TX_RX;
436
+  huart3.Init.HwFlowCtl = UART_HWCONTROL_NONE;
437
+  huart3.Init.OverSampling = UART_OVERSAMPLING_16;
438
+  if (HAL_UART_Init(&huart3) != HAL_OK)
439
+  {
440
+    Error_Handler();
441
+  }
442
+  /* USER CODE BEGIN USART3_Init 2 */
443
+
444
+  /* USER CODE END USART3_Init 2 */
445
+
446
+}
447
+
448
+/** 
449
+  * Enable DMA controller clock
450
+  */
451
+static void MX_DMA_Init(void) 
452
+{
453
+
454
+  /* DMA controller clock enable */
455
+  __HAL_RCC_DMA1_CLK_ENABLE();
456
+
457
+}
458
+
459
+/**
460
+  * @brief GPIO Initialization Function
461
+  * @param None
462
+  * @retval None
463
+  */
464
+static void MX_GPIO_Init(void)
465
+{
466
+  GPIO_InitTypeDef GPIO_InitStruct = {0};
467
+
468
+  /* GPIO Ports Clock Enable */
469
+  __HAL_RCC_GPIOC_CLK_ENABLE();
470
+  __HAL_RCC_GPIOA_CLK_ENABLE();
471
+  __HAL_RCC_GPIOB_CLK_ENABLE();
472
+
473
+  /*Configure GPIO pin Output Level */
474
+  HAL_GPIO_WritePin(BOOT_LED_GPIO_Port, BOOT_LED_Pin, GPIO_PIN_RESET);
475
+
476
+  /*Configure GPIO pin Output Level */
477
+  HAL_GPIO_WritePin(GPIOA, PAU_RESERVED0_Pin|PAU_RESERVED1_Pin|AMP_EN_Pin, GPIO_PIN_RESET);
478
+
479
+  /*Configure GPIO pin Output Level */
480
+  HAL_GPIO_WritePin(GPIOB, PAU_RESERVED3_Pin|PAU_RESERVED2_Pin|PAU_RESET_Pin, GPIO_PIN_RESET);
481
+
482
+  /*Configure GPIO pin : BOOT_LED_Pin */
483
+  GPIO_InitStruct.Pin = BOOT_LED_Pin;
484
+  GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
485
+  GPIO_InitStruct.Pull = GPIO_NOPULL;
486
+  GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
487
+  HAL_GPIO_Init(BOOT_LED_GPIO_Port, &GPIO_InitStruct);
488
+
489
+  /*Configure GPIO pins : DC_FAIL_ALARM_Pin OVER_INPUT_ALARM_Pin OVER_TEMP_ALARM_Pin */
490
+  GPIO_InitStruct.Pin = DC_FAIL_ALARM_Pin|OVER_INPUT_ALARM_Pin|OVER_TEMP_ALARM_Pin;
491
+  GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
492
+  GPIO_InitStruct.Pull = GPIO_NOPULL;
493
+  HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
494
+
495
+  /*Configure GPIO pins : PAU_RESERVED0_Pin PAU_RESERVED1_Pin AMP_EN_Pin */
496
+  GPIO_InitStruct.Pin = PAU_RESERVED0_Pin|PAU_RESERVED1_Pin|AMP_EN_Pin;
497
+  GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
498
+  GPIO_InitStruct.Pull = GPIO_NOPULL;
499
+  GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
500
+  HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
501
+
502
+  /*Configure GPIO pins : PAU_RESERVED3_Pin PAU_RESERVED2_Pin PAU_RESET_Pin */
503
+  GPIO_InitStruct.Pin = PAU_RESERVED3_Pin|PAU_RESERVED2_Pin|PAU_RESET_Pin;
504
+  GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
505
+  GPIO_InitStruct.Pull = GPIO_NOPULL;
506
+  GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
507
+  HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
508
+
509
+  /*Configure GPIO pins : OVER_POWER_ALARM_Pin VSWR_ALARM_Pin PAU_EN_Pin ALC_ALARM_Pin */
510
+  GPIO_InitStruct.Pin = OVER_POWER_ALARM_Pin|VSWR_ALARM_Pin|PAU_EN_Pin|ALC_ALARM_Pin;
511
+  GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
512
+  GPIO_InitStruct.Pull = GPIO_NOPULL;
513
+  HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
514
+
515
+}
516
+
517
+/* USER CODE BEGIN 4 */
518
+
519
+/* USER CODE END 4 */
520
+
521
+ /**
522
+  * @brief  Period elapsed callback in non blocking mode
523
+  * @note   This function is called  when TIM2 interrupt took place, inside
524
+  * HAL_TIM_IRQHandler(). It makes a direct call to HAL_IncTick() to increment
525
+  * a global variable "uwTick" used as application time base.
526
+  * @param  htim : TIM handle
527
+  * @retval None
528
+  */
529
+void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim)
530
+{
531
+  /* USER CODE BEGIN Callback 0 */
532
+
533
+  /* USER CODE END Callback 0 */
534
+  if (htim->Instance == TIM2) {
535
+    HAL_IncTick();
536
+  }
537
+  /* USER CODE BEGIN Callback 1 */
538
+  if(htim->Instance == TIM6){
539
+      UartRxTimerCnt++;
540
+          LED_TimerCnt++;
541
+          TDD_125ms_Cnt++;
542
+          TestTimer++;
543
+      
544
+      
545
+        if(HAL_GPIO_ReadPin(DC_FAIL_ALARM_GPIO_Port, DC_FAIL_ALARM_Pin) == GPIO_PIN_SET)
546
+            DC_FAIL_ALARM_CNT++;
547
+        else
548
+            DC_FAIL_ALARM_CNT = 0;
549
+            
550
+        if(HAL_GPIO_ReadPin(OVER_INPUT_ALARM_GPIO_Port, OVER_INPUT_ALARM_Pin)== GPIO_PIN_SET)
551
+            OVER_INPUT_ALARM_CNT++;
552
+        else
553
+            OVER_INPUT_ALARM_CNT = 0;
554
+            
555
+        if(HAL_GPIO_ReadPin(OVER_TEMP_ALARM_GPIO_Port, OVER_TEMP_ALARM_Pin)== GPIO_PIN_SET)
556
+            OVER_TEMP_ALARM_CNT++;
557
+        else
558
+            OVER_TEMP_ALARM_CNT = 0;
559
+            
560
+        if(HAL_GPIO_ReadPin(ALC_ALARM_GPIO_Port, ALC_ALARM_Pin)== GPIO_PIN_SET)
561
+            ALC_ALARM_CNT++;
562
+        else
563
+            ALC_ALARM_CNT = 0;
564
+            
565
+        if(HAL_GPIO_ReadPin(OVER_POWER_ALARM_GPIO_Port, OVER_POWER_ALARM_Pin)== GPIO_PIN_SET)
566
+            OVER_POWER_ALARM_CNT++;
567
+      
568
+        else
569
+            OVER_POWER_ALARM_CNT = 0;
570
+            
571
+        if(HAL_GPIO_ReadPin(VSWR_ALARM_GPIO_Port, VSWR_ALARM_Pin)== GPIO_PIN_SET)
572
+            VSWR_ALARM_CNT++;
573
+      
574
+        else
575
+            VSWR_ALARM_CNT = 0;
576
+
577
+  }
578
+  /* USER CODE END Callback 1 */
579
+}
580
+
581
+/**
582
+  * @brief  This function is executed in case of error occurrence.
583
+  * @retval None
584
+  */
585
+void Error_Handler(void)
586
+{
587
+  /* USER CODE BEGIN Error_Handler_Debug */
588
+  /* User can add his own implementation to report the HAL error return state */
589
+
590
+  /* USER CODE END Error_Handler_Debug */
591
+}
592
+
593
+#ifdef  USE_FULL_ASSERT
594
+/**
595
+  * @brief  Reports the name of the source file and the source line number
596
+  *         where the assert_param error has occurred.
597
+  * @param  file: pointer to the source file name
598
+  * @param  line: assert_param error line source number
599
+  * @retval None
600
+  */
601
+void assert_failed(uint8_t *file, uint32_t line)
602
+{ 
603
+  /* USER CODE BEGIN 6 */
604
+  /* User can add his own implementation to report the file name and line number,
605
+     tex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */
606
+  /* USER CODE END 6 */
607
+}
608
+#endif /* USE_FULL_ASSERT */
609
+
610
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

+ 608 - 0
insight/Nesslab_200M_System.si4project/Backup/main(5638).c

@@ -0,0 +1,608 @@
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) 2020 STMicroelectronics.
10
+  * All rights reserved.</center></h2>
11
+  *
12
+  * This software component is licensed by ST under Ultimate Liberty license
13
+  * SLA0044, the "License"; You may not use this file except in compliance with
14
+  * the License. You may obtain a copy of the License at:
15
+  *                             www.st.com/SLA0044
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
+#include <stdio.h>
27
+#include <string.h>
28
+#include "uart.h"
29
+#include "adc.h"
30
+#include "led.h"
31
+#include "flash.h"
32
+#include "NessLab.h"
33
+/* USER CODE END Includes */
34
+
35
+/* Private typedef -----------------------------------------------------------*/
36
+/* USER CODE BEGIN PTD */
37
+
38
+/* USER CODE END PTD */
39
+
40
+/* Private define ------------------------------------------------------------*/
41
+/* USER CODE BEGIN PD */
42
+/* USER CODE END PD */
43
+
44
+/* Private macro -------------------------------------------------------------*/
45
+/* USER CODE BEGIN PM */
46
+
47
+/* USER CODE END PM */
48
+
49
+/* Private variables ---------------------------------------------------------*/
50
+ADC_HandleTypeDef hadc1;
51
+DMA_HandleTypeDef hdma_adc1;
52
+
53
+TIM_HandleTypeDef htim6;
54
+
55
+UART_HandleTypeDef huart1;
56
+UART_HandleTypeDef huart3;
57
+DMA_HandleTypeDef hdma_usart1_tx;
58
+DMA_HandleTypeDef hdma_usart1_rx;
59
+DMA_HandleTypeDef hdma_usart3_tx;
60
+DMA_HandleTypeDef hdma_usart3_rx;
61
+
62
+/* USER CODE BEGIN PV */
63
+volatile uint32_t UartRxTimerCnt = 0;
64
+volatile uint32_t DC_FAIL_ALARM_CNT = 0;
65
+volatile uint32_t OVER_INPUT_ALARM_CNT = 0;
66
+volatile uint32_t OVER_TEMP_ALARM_CNT = 0;
67
+volatile uint32_t ALC_ALARM_CNT = 0;
68
+volatile uint32_t OVER_POWER_ALARM_CNT = 0;
69
+volatile uint32_t VSWR_ALARM_CNT = 0;
70
+
71
+
72
+
73
+volatile uint32_t TDD_125ms_Cnt = 0;
74
+
75
+volatile uint32_t TestTimer = 0;
76
+
77
+
78
+/* USER CODE END PV */
79
+
80
+/* Private function prototypes -----------------------------------------------*/
81
+void SystemClock_Config(void);
82
+static void MX_GPIO_Init(void);
83
+static void MX_DMA_Init(void);
84
+static void MX_ADC1_Init(void);
85
+static void MX_TIM6_Init(void);
86
+static void MX_USART1_UART_Init(void);
87
+static void MX_USART3_UART_Init(void);
88
+static void MX_NVIC_Init(void);
89
+/* USER CODE BEGIN PFP */
90
+extern void InitUartQueue(pUARTQUEUE pQueue);
91
+extern void Flash_InitRead();
92
+extern uint8_t FLASH_Write_Func(uint8_t* data,uint32_t size);
93
+
94
+
95
+/* USER CODE END PFP */
96
+
97
+/* Private user code ---------------------------------------------------------*/
98
+/* USER CODE BEGIN 0 */
99
+int _write (int file, uint8_t *ptr, uint16_t len)
100
+{
101
+#if 0 // PYJ.2020.06.03_BEGIN --
102
+    HAL_UART_Transmit(&hTest, ptr, len,10);
103
+#else
104
+    HAL_UART_Transmit(&hTerminal, ptr, len,10);
105
+#endif // PYJ.2020.06.03_END --
106
+
107
+    return len;
108
+}
109
+
110
+/* USER CODE END 0 */
111
+
112
+/**
113
+  * @brief  The application entry point.
114
+  * @retval int
115
+  */
116
+int main(void)
117
+{
118
+  /* USER CODE BEGIN 1 */
119
+
120
+
121
+  /* USER CODE END 1 */
122
+
123
+  /* MCU Configuration--------------------------------------------------------*/
124
+
125
+  /* Reset of all peripherals, Initializes the Flash interface and the Systick. */
126
+  HAL_Init();
127
+
128
+  /* USER CODE BEGIN Init */
129
+
130
+  /* USER CODE END Init */
131
+
132
+  /* Configure the system clock */
133
+  SystemClock_Config();
134
+
135
+  /* USER CODE BEGIN SysInit */
136
+
137
+  /* USER CODE END SysInit */
138
+
139
+  /* Initialize all configured peripherals */
140
+  MX_GPIO_Init();
141
+  MX_DMA_Init();
142
+  MX_ADC1_Init();
143
+  MX_TIM6_Init();
144
+  MX_USART1_UART_Init();
145
+  MX_USART3_UART_Init();
146
+
147
+  /* Initialize interrupts */
148
+  MX_NVIC_Init();
149
+  /* USER CODE BEGIN 2 */
150
+  HAL_TIM_Base_Start_IT(&htim6);
151
+
152
+  setbuf(stdout, NULL);
153
+  InitUartQueue(&MainQueue);
154
+  ADC_Initialize();
155
+#if 1 // PYJ.2020.05.06_BEGIN --
156
+    printf("****************************************\r\n");
157
+    printf("NESSLAB Project\r\n");
158
+    printf("Build at %s %s\r\n", __DATE__, __TIME__);
159
+    printf("Copyright (c) 2020. BLUECELL\r\n");
160
+    printf("****************************************\r\n");
161
+#if 0 // PYJ.2020.08.28_BEGIN -- 
162
+    uint8_t Flash_TestDataArray[200] = {0x33,};
163
+
164
+    Flash_InitRead();
165
+    DataErase_Func(FLASH_USER_USE_START_ADDR,200);
166
+    printf("Ram Data Display \r\n");
167
+    for(int i = 0; i < 200; i++){
168
+        Flash_TestDataArray[i] = 0x33;
169
+//        printf("%x ",Flash_TestDataArray[i]);
170
+    }
171
+    FLASH_Write_Func(&Flash_TestDataArray[0],200);
172
+    Flash_InitRead();    
173
+#endif // PYJ.2020.08.28_END -- 
174
+#endif // PYJ.2020.05.06_END --  
175
+  /* USER CODE END 2 */
176
+
177
+  /* Infinite loop */
178
+  /* USER CODE BEGIN WHILE */
179
+
180
+ 
181
+
182
+
183
+  while (1)
184
+  {
185
+#if 1 // PYJ.2020.08.31_BEGIN -- 
186
+    Boot_LED_Toggle(); /*LED Check*/
187
+    Uart_Check();      /*Usart Rx*/
188
+#else
189
+    NessLab_Operate(datatest);
190
+    datatest[4]++;
191
+
192
+    HAL_Delay(3000);
193
+
194
+#endif // PYJ.2020.08.31_END -- 
195
+//    ADC_Check();       /*Det Calc + DL/UL Alarm Check Function*/
196
+    /* USER CODE END WHILE */
197
+
198
+    /* USER CODE BEGIN 3 */
199
+  }
200
+  /* USER CODE END 3 */
201
+}
202
+
203
+/**
204
+  * @brief System Clock Configuration
205
+  * @retval None
206
+  */
207
+void SystemClock_Config(void)
208
+{
209
+  RCC_OscInitTypeDef RCC_OscInitStruct = {0};
210
+  RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};
211
+  RCC_PeriphCLKInitTypeDef PeriphClkInit = {0};
212
+
213
+  /** Initializes the CPU, AHB and APB busses clocks 
214
+  */
215
+  RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI;
216
+  RCC_OscInitStruct.HSIState = RCC_HSI_ON;
217
+  RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT;
218
+  RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
219
+  RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSI_DIV2;
220
+  RCC_OscInitStruct.PLL.PLLMUL = RCC_PLL_MUL6;
221
+  if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)
222
+  {
223
+    Error_Handler();
224
+  }
225
+  /** Initializes the CPU, AHB and APB busses clocks 
226
+  */
227
+  RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK
228
+                              |RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2;
229
+  RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
230
+  RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
231
+  RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV1;
232
+  RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1;
233
+
234
+  if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_0) != HAL_OK)
235
+  {
236
+    Error_Handler();
237
+  }
238
+  PeriphClkInit.PeriphClockSelection = RCC_PERIPHCLK_ADC;
239
+  PeriphClkInit.AdcClockSelection = RCC_ADCPCLK2_DIV2;
240
+  if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInit) != HAL_OK)
241
+  {
242
+    Error_Handler();
243
+  }
244
+}
245
+
246
+/**
247
+  * @brief NVIC Configuration.
248
+  * @retval None
249
+  */
250
+static void MX_NVIC_Init(void)
251
+{
252
+  /* ADC1_IRQn interrupt configuration */
253
+  HAL_NVIC_SetPriority(ADC1_IRQn, 0, 0);
254
+  HAL_NVIC_EnableIRQ(ADC1_IRQn);
255
+  /* USART1_IRQn interrupt configuration */
256
+  HAL_NVIC_SetPriority(USART1_IRQn, 0, 0);
257
+  HAL_NVIC_EnableIRQ(USART1_IRQn);
258
+  /* USART3_IRQn interrupt configuration */
259
+  HAL_NVIC_SetPriority(USART3_IRQn, 0, 0);
260
+  HAL_NVIC_EnableIRQ(USART3_IRQn);
261
+  /* TIM6_DAC_IRQn interrupt configuration */
262
+  HAL_NVIC_SetPriority(TIM6_DAC_IRQn, 0, 0);
263
+  HAL_NVIC_EnableIRQ(TIM6_DAC_IRQn);
264
+  /* DMA1_Channel2_IRQn interrupt configuration */
265
+  HAL_NVIC_SetPriority(DMA1_Channel2_IRQn, 0, 0);
266
+  HAL_NVIC_EnableIRQ(DMA1_Channel2_IRQn);
267
+  /* DMA1_Channel4_IRQn interrupt configuration */
268
+  HAL_NVIC_SetPriority(DMA1_Channel4_IRQn, 0, 0);
269
+  HAL_NVIC_EnableIRQ(DMA1_Channel4_IRQn);
270
+  /* DMA1_Channel3_IRQn interrupt configuration */
271
+  HAL_NVIC_SetPriority(DMA1_Channel3_IRQn, 0, 0);
272
+  HAL_NVIC_EnableIRQ(DMA1_Channel3_IRQn);
273
+  /* DMA1_Channel1_IRQn interrupt configuration */
274
+  HAL_NVIC_SetPriority(DMA1_Channel1_IRQn, 0, 0);
275
+  HAL_NVIC_EnableIRQ(DMA1_Channel1_IRQn);
276
+  /* DMA1_Channel5_IRQn interrupt configuration */
277
+  HAL_NVIC_SetPriority(DMA1_Channel5_IRQn, 0, 0);
278
+  HAL_NVIC_EnableIRQ(DMA1_Channel5_IRQn);
279
+}
280
+
281
+/**
282
+  * @brief ADC1 Initialization Function
283
+  * @param None
284
+  * @retval None
285
+  */
286
+static void MX_ADC1_Init(void)
287
+{
288
+
289
+  /* USER CODE BEGIN ADC1_Init 0 */
290
+
291
+  /* USER CODE END ADC1_Init 0 */
292
+
293
+  ADC_ChannelConfTypeDef sConfig = {0};
294
+
295
+  /* USER CODE BEGIN ADC1_Init 1 */
296
+
297
+  /* USER CODE END ADC1_Init 1 */
298
+  /** Common config 
299
+  */
300
+  hadc1.Instance = ADC1;
301
+  hadc1.Init.ScanConvMode = ADC_SCAN_ENABLE;
302
+  hadc1.Init.ContinuousConvMode = ENABLE;
303
+  hadc1.Init.DiscontinuousConvMode = DISABLE;
304
+  hadc1.Init.ExternalTrigConv = ADC_SOFTWARE_START;
305
+  hadc1.Init.DataAlign = ADC_DATAALIGN_RIGHT;
306
+  hadc1.Init.NbrOfConversion = 3;
307
+  if (HAL_ADC_Init(&hadc1) != HAL_OK)
308
+  {
309
+    Error_Handler();
310
+  }
311
+  /** Configure Regular Channel 
312
+  */
313
+  sConfig.Channel = ADC_CHANNEL_0;
314
+  sConfig.Rank = ADC_REGULAR_RANK_1;
315
+  sConfig.SamplingTime = ADC_SAMPLETIME_239CYCLES_5;
316
+  if (HAL_ADC_ConfigChannel(&hadc1, &sConfig) != HAL_OK)
317
+  {
318
+    Error_Handler();
319
+  }
320
+  /** Configure Regular Channel 
321
+  */
322
+  sConfig.Channel = ADC_CHANNEL_1;
323
+  sConfig.Rank = ADC_REGULAR_RANK_2;
324
+  if (HAL_ADC_ConfigChannel(&hadc1, &sConfig) != HAL_OK)
325
+  {
326
+    Error_Handler();
327
+  }
328
+  /** Configure Regular Channel 
329
+  */
330
+  sConfig.Channel = ADC_CHANNEL_3;
331
+  sConfig.Rank = ADC_REGULAR_RANK_3;
332
+  if (HAL_ADC_ConfigChannel(&hadc1, &sConfig) != HAL_OK)
333
+  {
334
+    Error_Handler();
335
+  }
336
+  /* USER CODE BEGIN ADC1_Init 2 */
337
+
338
+  /* USER CODE END ADC1_Init 2 */
339
+
340
+}
341
+
342
+/**
343
+  * @brief TIM6 Initialization Function
344
+  * @param None
345
+  * @retval None
346
+  */
347
+static void MX_TIM6_Init(void)
348
+{
349
+
350
+  /* USER CODE BEGIN TIM6_Init 0 */
351
+
352
+  /* USER CODE END TIM6_Init 0 */
353
+
354
+  TIM_MasterConfigTypeDef sMasterConfig = {0};
355
+
356
+  /* USER CODE BEGIN TIM6_Init 1 */
357
+
358
+  /* USER CODE END TIM6_Init 1 */
359
+  htim6.Instance = TIM6;
360
+  htim6.Init.Prescaler = 2400-1;
361
+  htim6.Init.CounterMode = TIM_COUNTERMODE_UP;
362
+  htim6.Init.Period = 10;
363
+  htim6.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE;
364
+  if (HAL_TIM_Base_Init(&htim6) != HAL_OK)
365
+  {
366
+    Error_Handler();
367
+  }
368
+  sMasterConfig.MasterOutputTrigger = TIM_TRGO_RESET;
369
+  sMasterConfig.MasterSlaveMode = TIM_MASTERSLAVEMODE_DISABLE;
370
+  if (HAL_TIMEx_MasterConfigSynchronization(&htim6, &sMasterConfig) != HAL_OK)
371
+  {
372
+    Error_Handler();
373
+  }
374
+  /* USER CODE BEGIN TIM6_Init 2 */
375
+
376
+  /* USER CODE END TIM6_Init 2 */
377
+
378
+}
379
+
380
+/**
381
+  * @brief USART1 Initialization Function
382
+  * @param None
383
+  * @retval None
384
+  */
385
+static void MX_USART1_UART_Init(void)
386
+{
387
+
388
+  /* USER CODE BEGIN USART1_Init 0 */
389
+
390
+  /* USER CODE END USART1_Init 0 */
391
+
392
+  /* USER CODE BEGIN USART1_Init 1 */
393
+
394
+  /* USER CODE END USART1_Init 1 */
395
+  huart1.Instance = USART1;
396
+  huart1.Init.BaudRate = 115200;
397
+  huart1.Init.WordLength = UART_WORDLENGTH_8B;
398
+  huart1.Init.StopBits = UART_STOPBITS_1;
399
+  huart1.Init.Parity = UART_PARITY_NONE;
400
+  huart1.Init.Mode = UART_MODE_TX_RX;
401
+  huart1.Init.HwFlowCtl = UART_HWCONTROL_NONE;
402
+  huart1.Init.OverSampling = UART_OVERSAMPLING_16;
403
+  if (HAL_UART_Init(&huart1) != HAL_OK)
404
+  {
405
+    Error_Handler();
406
+  }
407
+  /* USER CODE BEGIN USART1_Init 2 */
408
+
409
+  /* USER CODE END USART1_Init 2 */
410
+
411
+}
412
+
413
+/**
414
+  * @brief USART3 Initialization Function
415
+  * @param None
416
+  * @retval None
417
+  */
418
+static void MX_USART3_UART_Init(void)
419
+{
420
+
421
+  /* USER CODE BEGIN USART3_Init 0 */
422
+
423
+  /* USER CODE END USART3_Init 0 */
424
+
425
+  /* USER CODE BEGIN USART3_Init 1 */
426
+
427
+  /* USER CODE END USART3_Init 1 */
428
+  huart3.Instance = USART3;
429
+  huart3.Init.BaudRate = 115200;
430
+  huart3.Init.WordLength = UART_WORDLENGTH_8B;
431
+  huart3.Init.StopBits = UART_STOPBITS_1;
432
+  huart3.Init.Parity = UART_PARITY_NONE;
433
+  huart3.Init.Mode = UART_MODE_TX_RX;
434
+  huart3.Init.HwFlowCtl = UART_HWCONTROL_NONE;
435
+  huart3.Init.OverSampling = UART_OVERSAMPLING_16;
436
+  if (HAL_UART_Init(&huart3) != HAL_OK)
437
+  {
438
+    Error_Handler();
439
+  }
440
+  /* USER CODE BEGIN USART3_Init 2 */
441
+
442
+  /* USER CODE END USART3_Init 2 */
443
+
444
+}
445
+
446
+/** 
447
+  * Enable DMA controller clock
448
+  */
449
+static void MX_DMA_Init(void) 
450
+{
451
+
452
+  /* DMA controller clock enable */
453
+  __HAL_RCC_DMA1_CLK_ENABLE();
454
+
455
+}
456
+
457
+/**
458
+  * @brief GPIO Initialization Function
459
+  * @param None
460
+  * @retval None
461
+  */
462
+static void MX_GPIO_Init(void)
463
+{
464
+  GPIO_InitTypeDef GPIO_InitStruct = {0};
465
+
466
+  /* GPIO Ports Clock Enable */
467
+  __HAL_RCC_GPIOC_CLK_ENABLE();
468
+  __HAL_RCC_GPIOA_CLK_ENABLE();
469
+  __HAL_RCC_GPIOB_CLK_ENABLE();
470
+
471
+  /*Configure GPIO pin Output Level */
472
+  HAL_GPIO_WritePin(BOOT_LED_GPIO_Port, BOOT_LED_Pin, GPIO_PIN_RESET);
473
+
474
+  /*Configure GPIO pin Output Level */
475
+  HAL_GPIO_WritePin(GPIOA, PAU_RESERVED0_Pin|PAU_RESERVED1_Pin|AMP_EN_Pin, GPIO_PIN_RESET);
476
+
477
+  /*Configure GPIO pin Output Level */
478
+  HAL_GPIO_WritePin(GPIOB, PAU_RESERVED3_Pin|PAU_RESERVED2_Pin|PAU_RESET_Pin, GPIO_PIN_RESET);
479
+
480
+  /*Configure GPIO pin : BOOT_LED_Pin */
481
+  GPIO_InitStruct.Pin = BOOT_LED_Pin;
482
+  GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
483
+  GPIO_InitStruct.Pull = GPIO_NOPULL;
484
+  GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
485
+  HAL_GPIO_Init(BOOT_LED_GPIO_Port, &GPIO_InitStruct);
486
+
487
+  /*Configure GPIO pins : DC_FAIL_ALARM_Pin OVER_INPUT_ALARM_Pin OVER_TEMP_ALARM_Pin */
488
+  GPIO_InitStruct.Pin = DC_FAIL_ALARM_Pin|OVER_INPUT_ALARM_Pin|OVER_TEMP_ALARM_Pin;
489
+  GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
490
+  GPIO_InitStruct.Pull = GPIO_NOPULL;
491
+  HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
492
+
493
+  /*Configure GPIO pins : PAU_RESERVED0_Pin PAU_RESERVED1_Pin AMP_EN_Pin */
494
+  GPIO_InitStruct.Pin = PAU_RESERVED0_Pin|PAU_RESERVED1_Pin|AMP_EN_Pin;
495
+  GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
496
+  GPIO_InitStruct.Pull = GPIO_NOPULL;
497
+  GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
498
+  HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
499
+
500
+  /*Configure GPIO pins : PAU_RESERVED3_Pin PAU_RESERVED2_Pin PAU_RESET_Pin */
501
+  GPIO_InitStruct.Pin = PAU_RESERVED3_Pin|PAU_RESERVED2_Pin|PAU_RESET_Pin;
502
+  GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
503
+  GPIO_InitStruct.Pull = GPIO_NOPULL;
504
+  GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
505
+  HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
506
+
507
+  /*Configure GPIO pins : OVER_POWER_ALARM_Pin VSWR_ALARM_Pin PAU_EN_Pin ALC_ALARM_Pin */
508
+  GPIO_InitStruct.Pin = OVER_POWER_ALARM_Pin|VSWR_ALARM_Pin|PAU_EN_Pin|ALC_ALARM_Pin;
509
+  GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
510
+  GPIO_InitStruct.Pull = GPIO_NOPULL;
511
+  HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
512
+
513
+}
514
+
515
+/* USER CODE BEGIN 4 */
516
+
517
+/* USER CODE END 4 */
518
+
519
+ /**
520
+  * @brief  Period elapsed callback in non blocking mode
521
+  * @note   This function is called  when TIM2 interrupt took place, inside
522
+  * HAL_TIM_IRQHandler(). It makes a direct call to HAL_IncTick() to increment
523
+  * a global variable "uwTick" used as application time base.
524
+  * @param  htim : TIM handle
525
+  * @retval None
526
+  */
527
+void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim)
528
+{
529
+  /* USER CODE BEGIN Callback 0 */
530
+
531
+  /* USER CODE END Callback 0 */
532
+  if (htim->Instance == TIM2) {
533
+    HAL_IncTick();
534
+  }
535
+  /* USER CODE BEGIN Callback 1 */
536
+  if(htim->Instance == TIM6){
537
+      UartRxTimerCnt++;
538
+          LED_TimerCnt++;
539
+          TDD_125ms_Cnt++;
540
+          TestTimer++;
541
+      
542
+      
543
+        if(HAL_GPIO_ReadPin(DC_FAIL_ALARM_GPIO_Port, DC_FAIL_ALARM_Pin) == GPIO_PIN_SET)
544
+            DC_FAIL_ALARM_CNT++;
545
+        else
546
+            DC_FAIL_ALARM_CNT = 0;
547
+            
548
+        if(HAL_GPIO_ReadPin(OVER_INPUT_ALARM_GPIO_Port, OVER_INPUT_ALARM_Pin)== GPIO_PIN_SET)
549
+            OVER_INPUT_ALARM_CNT++;
550
+        else
551
+            OVER_INPUT_ALARM_CNT = 0;
552
+            
553
+        if(HAL_GPIO_ReadPin(OVER_TEMP_ALARM_GPIO_Port, OVER_TEMP_ALARM_Pin)== GPIO_PIN_SET)
554
+            OVER_TEMP_ALARM_CNT++;
555
+        else
556
+            OVER_TEMP_ALARM_CNT = 0;
557
+            
558
+        if(HAL_GPIO_ReadPin(ALC_ALARM_GPIO_Port, ALC_ALARM_Pin)== GPIO_PIN_SET)
559
+            ALC_ALARM_CNT++;
560
+        else
561
+            ALC_ALARM_CNT = 0;
562
+            
563
+        if(HAL_GPIO_ReadPin(OVER_POWER_ALARM_GPIO_Port, OVER_POWER_ALARM_Pin)== GPIO_PIN_SET)
564
+            OVER_POWER_ALARM_CNT++;
565
+      
566
+        else
567
+            OVER_POWER_ALARM_CNT = 0;
568
+            
569
+        if(HAL_GPIO_ReadPin(VSWR_ALARM_GPIO_Port, VSWR_ALARM_Pin)== GPIO_PIN_SET)
570
+            VSWR_ALARM_CNT++;
571
+      
572
+        else
573
+            VSWR_ALARM_CNT = 0;
574
+
575
+  }
576
+  /* USER CODE END Callback 1 */
577
+}
578
+
579
+/**
580
+  * @brief  This function is executed in case of error occurrence.
581
+  * @retval None
582
+  */
583
+void Error_Handler(void)
584
+{
585
+  /* USER CODE BEGIN Error_Handler_Debug */
586
+  /* User can add his own implementation to report the HAL error return state */
587
+
588
+  /* USER CODE END Error_Handler_Debug */
589
+}
590
+
591
+#ifdef  USE_FULL_ASSERT
592
+/**
593
+  * @brief  Reports the name of the source file and the source line number
594
+  *         where the assert_param error has occurred.
595
+  * @param  file: pointer to the source file name
596
+  * @param  line: assert_param error line source number
597
+  * @retval None
598
+  */
599
+void assert_failed(uint8_t *file, uint32_t line)
600
+{ 
601
+  /* USER CODE BEGIN 6 */
602
+  /* User can add his own implementation to report the file name and line number,
603
+     tex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */
604
+  /* USER CODE END 6 */
605
+}
606
+#endif /* USE_FULL_ASSERT */
607
+
608
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

+ 23 - 2
insight/Nesslab_200M_System.si4project/Nesslab_200M_System.SearchResults

@@ -1,2 +1,23 @@
1
----- Nesslab_Prot Matches (1 in 1 files) ----
2
-adc.c (D:\CubeIDE_Workspace\Nesslab_200M_System\Bluecell_Src) line 14 : extern Nesslab_Prot Currstatus;
1
+---- + 2 Matches (22 in 11 files) ----
2
+core_armv8mml.h (D:\CubeIDE_Workspace\Nesslab_200M_System\Drivers\CMSIS\Include) line 780 : #define SCB_CFSR_IMPRECISERR_Pos          (SCB_CFSR_BUSFAULTSR_Pos + 2U)                  /*!< SCB CFSR (BFSR): IMPRECISERR Position */
3
+core_armv8mml.h (D:\CubeIDE_Workspace\Nesslab_200M_System\Drivers\CMSIS\Include) line 802 : #define SCB_CFSR_INVPC_Pos                (SCB_CFSR_USGFAULTSR_Pos + 2U)                  /*!< SCB CFSR (UFSR): INVPC Position */
4
+core_cm3.h (D:\CubeIDE_Workspace\Nesslab_200M_System\Drivers\CMSIS\Include) line 588 : #define SCB_CFSR_IMPRECISERR_Pos          (SCB_CFSR_BUSFAULTSR_Pos + 2U)                  /*!< SCB CFSR (BFSR): IMPRECISERR Position */
5
+core_cm3.h (D:\CubeIDE_Workspace\Nesslab_200M_System\Drivers\CMSIS\Include) line 607 : #define SCB_CFSR_INVPC_Pos                (SCB_CFSR_USGFAULTSR_Pos + 2U)                  /*!< SCB CFSR (UFSR): INVPC Position */
6
+core_cm33.h (D:\CubeIDE_Workspace\Nesslab_200M_System\Drivers\CMSIS\Include) line 780 : #define SCB_CFSR_IMPRECISERR_Pos          (SCB_CFSR_BUSFAULTSR_Pos + 2U)                  /*!< SCB CFSR (BFSR): IMPRECISERR Position */
7
+core_cm33.h (D:\CubeIDE_Workspace\Nesslab_200M_System\Drivers\CMSIS\Include) line 802 : #define SCB_CFSR_INVPC_Pos                (SCB_CFSR_USGFAULTSR_Pos + 2U)                  /*!< SCB CFSR (UFSR): INVPC Position */
8
+core_cm4.h (D:\CubeIDE_Workspace\Nesslab_200M_System\Drivers\CMSIS\Include) line 652 : #define SCB_CFSR_IMPRECISERR_Pos          (SCB_CFSR_BUSFAULTSR_Pos + 2U)                  /*!< SCB CFSR (BFSR): IMPRECISERR Position */
9
+core_cm4.h (D:\CubeIDE_Workspace\Nesslab_200M_System\Drivers\CMSIS\Include) line 671 : #define SCB_CFSR_INVPC_Pos                (SCB_CFSR_USGFAULTSR_Pos + 2U)                  /*!< SCB CFSR (UFSR): INVPC Position */
10
+core_cm7.h (D:\CubeIDE_Workspace\Nesslab_200M_System\Drivers\CMSIS\Include) line 705 : #define SCB_CFSR_IMPRECISERR_Pos          (SCB_CFSR_BUSFAULTSR_Pos + 2U)                  /*!< SCB CFSR (BFSR): IMPRECISERR Position */
11
+core_cm7.h (D:\CubeIDE_Workspace\Nesslab_200M_System\Drivers\CMSIS\Include) line 724 : #define SCB_CFSR_INVPC_Pos                (SCB_CFSR_USGFAULTSR_Pos + 2U)                  /*!< SCB CFSR (UFSR): INVPC Position */
12
+core_sc300.h (D:\CubeIDE_Workspace\Nesslab_200M_System\Drivers\CMSIS\Include) line 585 : #define SCB_CFSR_IMPRECISERR_Pos          (SCB_CFSR_BUSFAULTSR_Pos + 2U)                  /*!< SCB CFSR (BFSR): IMPRECISERR Position */
13
+core_sc300.h (D:\CubeIDE_Workspace\Nesslab_200M_System\Drivers\CMSIS\Include) line 604 : #define SCB_CFSR_INVPC_Pos                (SCB_CFSR_USGFAULTSR_Pos + 2U)                  /*!< SCB CFSR (UFSR): INVPC Position */
14
+FLASH_Write_Func in flash.c (D:\CubeIDE_Workspace\Nesslab_200M_System\Bluecell_Src) :        writedata += data[downindex + 2] << 16;
15
+NessLab_Init in NessLab.c (D:\CubeIDE_Workspace\Nesslab_200M_System\Bluecell_Src) :     FLASH_Read_Func(FLASH_USER_USE_START_ADDR + 2,&DB_Define[0],104);
16
+NessLab_Adc_Convert_db in NessLab.c (D:\CubeIDE_Workspace\Nesslab_200M_System\Bluecell_Src) :            Curr_DB = i + 2;
17
+NessLab_Operate in NessLab.c (D:\CubeIDE_Workspace\Nesslab_200M_System\Bluecell_Src) :             FLASH_Read_Func(FLASH_USER_USE_START_ADDR + 2,&DB_Define[0],104);
18
+HAL_RCC_GetSysClockFreq in stm32f1xx_hal_rcc.c (D:\CubeIDE_Workspace\Nesslab_200M_System\Drivers\STM32F1xx_HAL_Driver\Src) :           pll2mul = ((RCC->CFGR2 & RCC_CFGR2_PLL2MUL) >> RCC_CFGR2_PLL2MUL_Pos) + 2;
19
+HAL_RCCEx_GetPeriphCLKFreq in stm32f1xx_hal_rcc_ex.c (D:\CubeIDE_Workspace\Nesslab_200M_System\Drivers\STM32F1xx_HAL_Driver\Src) :             pll2mul = ((RCC->CFGR2 & RCC_CFGR2_PLL2MUL) >> RCC_CFGR2_PLL2MUL_Pos) + 2;
20
+HAL_RCCEx_GetPeriphCLKFreq in stm32f1xx_hal_rcc_ex.c (D:\CubeIDE_Workspace\Nesslab_200M_System\Drivers\STM32F1xx_HAL_Driver\Src) :           pll3mul = ((RCC->CFGR2 & RCC_CFGR2_PLL3MUL) >> RCC_CFGR2_PLL3MUL_Pos) + 2;
21
+HAL_RCCEx_GetPeriphCLKFreq in stm32f1xx_hal_rcc_ex.c (D:\CubeIDE_Workspace\Nesslab_200M_System\Drivers\STM32F1xx_HAL_Driver\Src) :           pll3mul = ((RCC->CFGR2 & RCC_CFGR2_PLL3MUL) >> RCC_CFGR2_PLL3MUL_Pos) + 2;
22
+SystemCoreClockUpdate in system_stm32f1xx.c (D:\CubeIDE_Workspace\Nesslab_200M_System\Src) :       pllmull = ( pllmull >> 18U) + 2U;
23
+SystemCoreClockUpdate in system_stm32f1xx.c (D:\CubeIDE_Workspace\Nesslab_200M_System\Src) :           pll2mull = ((RCC->CFGR2 & RCC_CFGR2_PLL2MUL) >> 8U) + 2U; 

+ 1 - 1
insight/Nesslab_200M_System.si4project/Nesslab_200M_System.bookmarks.xml

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

二进制
insight/Nesslab_200M_System.si4project/Nesslab_200M_System.sip_sym


二进制
insight/Nesslab_200M_System.si4project/Nesslab_200M_System.sip_xm


二进制
insight/Nesslab_200M_System.si4project/Nesslab_200M_System.siwork


二进制
insight/Nesslab_200M_System.si4project/cache/parse/.._Bluecell_Inc_NessLab.h.sisc


二进制
insight/Nesslab_200M_System.si4project/cache/parse/.._Bluecell_Inc_adc.h.sisc


二进制
insight/Nesslab_200M_System.si4project/cache/parse/.._Bluecell_Inc_crc.h.sisc


二进制
insight/Nesslab_200M_System.si4project/cache/parse/.._Bluecell_Inc_flash.h.sisc


二进制
insight/Nesslab_200M_System.si4project/cache/parse/.._Bluecell_Inc_uart.h.sisc


二进制
insight/Nesslab_200M_System.si4project/cache/parse/.._Bluecell_Src_NessLab.c.sisc


二进制
insight/Nesslab_200M_System.si4project/cache/parse/.._Bluecell_Src_adc.c.sisc


二进制
insight/Nesslab_200M_System.si4project/cache/parse/.._Bluecell_Src_crc.c.sisc


二进制
insight/Nesslab_200M_System.si4project/cache/parse/.._Bluecell_Src_flash.c.sisc


二进制
insight/Nesslab_200M_System.si4project/cache/parse/.._Bluecell_Src_led.c.sisc


二进制
insight/Nesslab_200M_System.si4project/cache/parse/.._Bluecell_Src_uart.c.sisc


二进制
insight/Nesslab_200M_System.si4project/cache/parse/.._Drivers_CMSIS_Device_ST_STM32F1xx_Include_system_stm32f1xx.h.sisc


二进制
insight/Nesslab_200M_System.si4project/cache/parse/.._Drivers_CMSIS_Include_tz_context.h.sisc


二进制
insight/Nesslab_200M_System.si4project/cache/parse/.._Drivers_STM32F1xx_HAL_Driver_Inc_stm32f1xx_hal.h.sisc


二进制
insight/Nesslab_200M_System.si4project/cache/parse/.._Drivers_STM32F1xx_HAL_Driver_Inc_stm32f1xx_hal_adc.h.sisc


二进制
insight/Nesslab_200M_System.si4project/cache/parse/.._Drivers_STM32F1xx_HAL_Driver_Inc_stm32f1xx_hal_adc_ex.h.sisc


二进制
insight/Nesslab_200M_System.si4project/cache/parse/.._Drivers_STM32F1xx_HAL_Driver_Inc_stm32f1xx_hal_cortex.h.sisc


二进制
insight/Nesslab_200M_System.si4project/cache/parse/.._Drivers_STM32F1xx_HAL_Driver_Inc_stm32f1xx_hal_dma.h.sisc


二进制
insight/Nesslab_200M_System.si4project/cache/parse/.._Drivers_STM32F1xx_HAL_Driver_Inc_stm32f1xx_hal_dma_ex.h.sisc


二进制
insight/Nesslab_200M_System.si4project/cache/parse/.._Drivers_STM32F1xx_HAL_Driver_Inc_stm32f1xx_hal_exti.h.sisc


二进制
insight/Nesslab_200M_System.si4project/cache/parse/.._Drivers_STM32F1xx_HAL_Driver_Inc_stm32f1xx_hal_flash.h.sisc


二进制
insight/Nesslab_200M_System.si4project/cache/parse/.._Drivers_STM32F1xx_HAL_Driver_Inc_stm32f1xx_hal_flash_ex.h.sisc


二进制
insight/Nesslab_200M_System.si4project/cache/parse/.._Drivers_STM32F1xx_HAL_Driver_Inc_stm32f1xx_hal_gpio.h.sisc


二进制
insight/Nesslab_200M_System.si4project/cache/parse/.._Drivers_STM32F1xx_HAL_Driver_Inc_stm32f1xx_hal_gpio_ex.h.sisc


二进制
insight/Nesslab_200M_System.si4project/cache/parse/.._Drivers_STM32F1xx_HAL_Driver_Inc_stm32f1xx_hal_pwr.h.sisc


二进制
insight/Nesslab_200M_System.si4project/cache/parse/.._Drivers_STM32F1xx_HAL_Driver_Inc_stm32f1xx_hal_tim_ex.h.sisc


二进制
insight/Nesslab_200M_System.si4project/cache/parse/.._Drivers_STM32F1xx_HAL_Driver_Src_stm32f1xx_hal.c.sisc


二进制
insight/Nesslab_200M_System.si4project/cache/parse/.._Drivers_STM32F1xx_HAL_Driver_Src_stm32f1xx_hal_adc.c.sisc


二进制
insight/Nesslab_200M_System.si4project/cache/parse/.._Drivers_STM32F1xx_HAL_Driver_Src_stm32f1xx_hal_cortex.c.sisc


二进制
insight/Nesslab_200M_System.si4project/cache/parse/.._Drivers_STM32F1xx_HAL_Driver_Src_stm32f1xx_hal_dma.c.sisc


二进制
insight/Nesslab_200M_System.si4project/cache/parse/.._Drivers_STM32F1xx_HAL_Driver_Src_stm32f1xx_hal_exti.c.sisc


二进制
insight/Nesslab_200M_System.si4project/cache/parse/.._Drivers_STM32F1xx_HAL_Driver_Src_stm32f1xx_hal_gpio.c.sisc


二进制
insight/Nesslab_200M_System.si4project/cache/parse/.._Drivers_STM32F1xx_HAL_Driver_Src_stm32f1xx_hal_gpio_ex.c.sisc


二进制
insight/Nesslab_200M_System.si4project/cache/parse/.._Drivers_STM32F1xx_HAL_Driver_Src_stm32f1xx_hal_pwr.c.sisc


二进制
insight/Nesslab_200M_System.si4project/cache/parse/.._Drivers_STM32F1xx_HAL_Driver_Src_stm32f1xx_hal_tim_ex.c.sisc


二进制
insight/Nesslab_200M_System.si4project/cache/parse/.._Drivers_STM32F1xx_HAL_Driver_Src_stm32f1xx_hal_uart.c.sisc


二进制
insight/Nesslab_200M_System.si4project/cache/parse/.._Inc_main.h.sisc


二进制
insight/Nesslab_200M_System.si4project/cache/parse/.._Src_main.c.sisc


二进制
insight/Nesslab_200M_System.si4project/cache/parse/.._Src_sysmem.c.sisc