Bladeren bron

ADC Second Increase

PYJ 5 jaren geleden
bovenliggende
commit
8d136bfd3c
42 gewijzigde bestanden met toevoegingen van 14227 en 13145 verwijderingen
  1. 2 2
      .settings/language.settings.xml
  2. 1 1
      Bluecell_Inc/adc.h
  3. 1 1
      Bluecell_Src/adc.c
  4. BIN
      Debug/Bluecell_Src/NessLab.o
  5. BIN
      Debug/Bluecell_Src/adc.o
  6. BIN
      Debug/Bluecell_Src/crc.o
  7. BIN
      Debug/Bluecell_Src/flash.o
  8. BIN
      Debug/Bluecell_Src/led.o
  9. BIN
      Debug/Bluecell_Src/uart.o
  10. BIN
      Debug/Nesslab_200M_System.bin
  11. BIN
      Debug/Nesslab_200M_System.elf
  12. 12659 12519
      Debug/Nesslab_200M_System.list
  13. 623 620
      Debug/Nesslab_200M_System.map
  14. BIN
      Debug/Src/main.o
  15. BIN
      Debug/Src/stm32f1xx_hal_msp.o
  16. BIN
      Debug/Src/stm32f1xx_it.o
  17. 1 1
      Inc/main.h
  18. 1 1
      Src/main.c
  19. 205 0
      insight/Nesslab_200M_System.si4project/Backup/adc(1001).c
  20. 26 0
      insight/Nesslab_200M_System.si4project/Backup/adc(596).h
  21. 602 0
      insight/Nesslab_200M_System.si4project/Backup/main(6193).c
  22. 106 0
      insight/Nesslab_200M_System.si4project/Backup/main(6931).h
  23. BIN
      insight/Nesslab_200M_System.si4project/cache/parse/.._Bluecell_Inc_NessLab.h.sisc
  24. BIN
      insight/Nesslab_200M_System.si4project/cache/parse/.._Bluecell_Inc_adc.h.sisc
  25. BIN
      insight/Nesslab_200M_System.si4project/cache/parse/.._Bluecell_Inc_crc.h.sisc
  26. BIN
      insight/Nesslab_200M_System.si4project/cache/parse/.._Bluecell_Inc_flash.h.sisc
  27. BIN
      insight/Nesslab_200M_System.si4project/cache/parse/.._Bluecell_Inc_uart.h.sisc
  28. BIN
      insight/Nesslab_200M_System.si4project/cache/parse/.._Bluecell_Src_NessLab.c.sisc
  29. BIN
      insight/Nesslab_200M_System.si4project/cache/parse/.._Bluecell_Src_adc.c.sisc
  30. BIN
      insight/Nesslab_200M_System.si4project/cache/parse/.._Bluecell_Src_crc.c.sisc
  31. BIN
      insight/Nesslab_200M_System.si4project/cache/parse/.._Bluecell_Src_flash.c.sisc
  32. BIN
      insight/Nesslab_200M_System.si4project/cache/parse/.._Bluecell_Src_led.c.sisc
  33. BIN
      insight/Nesslab_200M_System.si4project/cache/parse/.._Bluecell_Src_uart.c.sisc
  34. BIN
      insight/Nesslab_200M_System.si4project/cache/parse/.._Drivers_STM32F1xx_HAL_Driver_Inc_stm32f1xx_hal_adc.h.sisc
  35. BIN
      insight/Nesslab_200M_System.si4project/cache/parse/.._Drivers_STM32F1xx_HAL_Driver_Inc_stm32f1xx_hal_flash.h.sisc
  36. BIN
      insight/Nesslab_200M_System.si4project/cache/parse/.._Drivers_STM32F1xx_HAL_Driver_Inc_stm32f1xx_hal_flash_ex.h.sisc
  37. BIN
      insight/Nesslab_200M_System.si4project/cache/parse/.._Drivers_STM32F1xx_HAL_Driver_Inc_stm32f1xx_hal_gpio.h.sisc
  38. BIN
      insight/Nesslab_200M_System.si4project/cache/parse/.._Drivers_STM32F1xx_HAL_Driver_Inc_stm32f1xx_hal_tim.h.sisc
  39. BIN
      insight/Nesslab_200M_System.si4project/cache/parse/.._Drivers_STM32F1xx_HAL_Driver_Src_stm32f1xx_hal_adc.c.sisc
  40. BIN
      insight/Nesslab_200M_System.si4project/cache/parse/.._Drivers_STM32F1xx_HAL_Driver_Src_stm32f1xx_hal_gpio.c.sisc
  41. BIN
      insight/Nesslab_200M_System.si4project/cache/parse/.._Inc_main.h.sisc
  42. BIN
      insight/Nesslab_200M_System.si4project/cache/parse/.._Src_main.c.sisc

+ 2 - 2
.settings/language.settings.xml

@@ -6,7 +6,7 @@
6 6
 			<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
7 7
 			<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
8 8
 			<provider copy-of="extension" id="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser"/>
9
-			<provider class="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" console="false" env-hash="-519424242177513674" id="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="MCU ARM GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
9
+			<provider class="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" console="false" env-hash="-1257656824187430384" id="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="MCU ARM GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
10 10
 				<language-scope id="org.eclipse.cdt.core.gcc"/>
11 11
 				<language-scope id="org.eclipse.cdt.core.g++"/>
12 12
 			</provider>
@@ -18,7 +18,7 @@
18 18
 			<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
19 19
 			<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
20 20
 			<provider copy-of="extension" id="org.eclipse.cdt.managedbuilder.core.GCCBuildCommandParser"/>
21
-			<provider class="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" console="false" env-hash="-519424242177513674" id="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="MCU ARM GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
21
+			<provider class="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" console="false" env-hash="-1257656824187430384" id="com.st.stm32cube.ide.mcu.toolchain.armnone.setup.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="MCU ARM GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
22 22
 				<language-scope id="org.eclipse.cdt.core.gcc"/>
23 23
 				<language-scope id="org.eclipse.cdt.core.g++"/>
24 24
 			</provider>

+ 1 - 1
Bluecell_Inc/adc.h

@@ -15,7 +15,7 @@ void ADC_Check();
15 15
 
16 16
 
17 17
 #define ADC1_CNT 3
18
-#define ADC_AVERAGECNT 100
18
+#define ADC_AVERAGECNT 50
19 19
 #if 1 // PYJ.2020.08.26_BEGIN -- 
20 20
 
21 21
 

+ 1 - 1
Bluecell_Src/adc.c

@@ -183,7 +183,7 @@ uint8_t ADC_Convert_Temperature(double val);
183 183
              if(TotalCnt > 2)
184 184
                  TotalCnt = 2;
185 185
              
186
-             for(int i = 0; i < 100; i++){/*ADC Data Dascending Complete*/
186
+             for(int i = 0; i < ADC_AVERAGECNT; i++){/*ADC Data Dascending Complete*/
187 187
                  if(ADC1_Arrage_Ret[i] <= ADC1_Arrage[i])
188 188
                      ADC1_Arrage_Ret[i] = ADC1_Arrage[i];
189 189
              } 

BIN
Debug/Bluecell_Src/NessLab.o


BIN
Debug/Bluecell_Src/adc.o


BIN
Debug/Bluecell_Src/crc.o


BIN
Debug/Bluecell_Src/flash.o


BIN
Debug/Bluecell_Src/led.o


BIN
Debug/Bluecell_Src/uart.o


BIN
Debug/Nesslab_200M_System.bin


BIN
Debug/Nesslab_200M_System.elf


File diff suppressed because it is too large
+ 12659 - 12519
Debug/Nesslab_200M_System.list


File diff suppressed because it is too large
+ 623 - 620
Debug/Nesslab_200M_System.map


BIN
Debug/Src/main.o


BIN
Debug/Src/stm32f1xx_hal_msp.o


BIN
Debug/Src/stm32f1xx_it.o


+ 1 - 1
Inc/main.h

@@ -94,7 +94,7 @@ void Error_Handler(void);
94 94
 #define ALC_ALARM_Pin GPIO_PIN_3
95 95
 #define ALC_ALARM_GPIO_Port GPIOB
96 96
 /* USER CODE BEGIN Private defines */
97
-#define ADC_DATA_CYCLE 500
97
+#define ADC_DATA_CYCLE 1000
98 98
 /* USER CODE END Private defines */
99 99
 
100 100
 #ifdef __cplusplus

+ 1 - 1
Src/main.c

@@ -185,7 +185,7 @@ int main(void)
185 185
     Boot_LED_Toggle(); /*LED Check*/
186 186
     Uart_Check();      /*Usart Rx*/
187 187
     NessLab_GPIO_Operate();
188
-//    ADC_TDD_Arrange();
188
+    ADC_TDD_Arrange();
189 189
 #else
190 190
     NessLab_Operate(datatest);
191 191
     datatest[4]++;

+ 205 - 0
insight/Nesslab_200M_System.si4project/Backup/adc(1001).c

@@ -0,0 +1,205 @@
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
+     if(TDD_125ms_Cnt > ADC_DATA_CYCLE)
131
+     {
132
+         
133
+ //        printf("================TotalCnt %d  =================\r\n",TotalCnt);
134
+#if 1 // PYJ.2020.09.09_BEGIN -- 
135
+         DascendigFunc(&ADC1_Arrage_Ret[0],ADC_AVERAGECNT); 
136
+ 
137
+ //        for(int i = 0; i < 100; i++){/*ADC Data Dascending Complete*/
138
+ //            printf("ADC1_Arrage_Ret[%d] : %d \r\n",i,ADC1_Arrage_Ret[i]);
139
+ //        }           
140
+ 
141
+         ADC1_Average_value = SumFunc(&ADC1_Arrage_Ret[0],Percent100);
142
+         
143
+ //        printf("ADC1_Average_value Sum  : %d \r\n",ADC1_Average_value);
144
+         ADC1_Average_value /=Percent100;    
145
+ //        printf("ADC1_Average_value : %d \r\n",ADC1_Average_value);
146
+     for(int i = 0; i < ADC_AVERAGECNT; i++){
147
+         ADC1_Arrage_Ret[i] = 0;
148
+     }       
149
+ 
150
+     Currstatus.DownLink_Forward_Det_H
151
+         = (((uint16_t)ADC1_Average_value & 0xFF00) >> 8);
152
+     Currstatus.DownLink_Forward_Det_L
153
+         = (((uint16_t)ADC1_Average_value & 0x00FF) );        
154
+#else
155
+         for(int i = 0; i < ADC_AVERAGECNT; i++){
156
+             ADC1_Arrage_Ret[i] = ADC1_Arrage[i];
157
+         }
158
+#endif // PYJ.2020.09.09_END -- 
159
+ 
160
+         
161
+         TotalCnt = 0;
162
+         TDD_125ms_Cnt = 0;
163
+     }
164
+ 
165
+ }
166
+ 
167
+ void HAL_ADC_ConvCpltCallback(ADC_HandleTypeDef* hadc)
168
+ {
169
+     if(hadc->Instance == hadc1.Instance && TDD_125ms_Cnt < 125)
170
+     {
171
+         
172
+         ADC1_Arrage[adc1cnt] = ADC1value[0];
173
+ //        for(int i = 0; i < 2; i++){
174
+ //            printf("ADC1value[%d] : %d , %f\r\n",i,ADC1value[i],(float)((ADC1value[i]) *3.3 /4095));
175
+ //        }
176
+         adc1cnt++;
177
+         
178
+         if(adc1cnt == ADC_AVERAGECNT){
179
+ //            DascendigFunc(&ADC1_Arrage[0],ADC_AVERAGECNT);
180
+ 
181
+             adc1cnt = 0;
182
+             TotalCnt++;
183
+             if(TotalCnt > 2)
184
+                 TotalCnt = 2;
185
+             
186
+             for(int i = 0; i < 100; i++){/*ADC Data Dascending Complete*/
187
+                 if(ADC1_Arrage_Ret[i] <= ADC1_Arrage[i])
188
+                     ADC1_Arrage_Ret[i] = ADC1_Arrage[i];
189
+             } 
190
+             DascendigFunc(&ADC1_Arrage_Ret[0],ADC_AVERAGECNT);              
191
+ //            for(int i = 0; i < 100; i++){/*ADC Data Dascending Complete*/
192
+ //                printf("ADC1_Arrage_Ret[%d] : %d \r\n",i,ADC1_Arrage_Ret[i]);
193
+ //            }             
194
+ //                else
195
+ //                ADC1_Arrage_Ret[i] /= TotalCnt;
196
+             
197
+         }
198
+ //        if(adc1cnt < ADC_AVERAGECNT){
199
+ //            for(int i = 0; i < ADC1_CNT; i++){
200
+ //                ADC1valuearray[i][adc1cnt] = ADC1value[i];
201
+ //            }
202
+ //            adc1cnt++;
203
+ //        }
204
+     }
205
+ }

+ 26 - 0
insight/Nesslab_200M_System.si4project/Backup/adc(596).h

@@ -0,0 +1,26 @@
1
+/*
2
+ * adc.h
3
+ *
4
+ *  Created on: 2020. 8. 3.
5
+ *      Author: parkyj
6
+ */
7
+
8
+#ifndef ADC_H_
9
+#define ADC_H_
10
+
11
+#include "main.h"
12
+
13
+void ADC_Initialize();
14
+void ADC_Check();
15
+
16
+
17
+#define ADC1_CNT 3
18
+#define ADC_AVERAGECNT 50
19
+#if 1 // PYJ.2020.08.26_BEGIN -- 
20
+
21
+
22
+
23
+
24
+#endif // PYJ.2020.08.26_END -- 
25
+//#define ADC_AVERAGECNT 100
26
+#endif /* ADC_H_ */

+ 602 - 0
insight/Nesslab_200M_System.si4project/Backup/main(6193).c

@@ -0,0 +1,602 @@
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_usart3_tx;
59
+
60
+/* USER CODE BEGIN PV */
61
+volatile uint32_t UartRxTimerCnt = 0;
62
+volatile uint32_t DC_FAIL_ALARM_CNT = 0;
63
+volatile uint32_t OVER_INPUT_ALARM_CNT = 0;
64
+volatile uint32_t OVER_TEMP_ALARM_CNT = 0;
65
+volatile uint32_t ALC_ALARM_CNT = 0;
66
+volatile uint32_t OVER_POWER_ALARM_CNT = 0;
67
+volatile uint32_t VSWR_ALARM_CNT = 0;
68
+
69
+
70
+
71
+volatile uint32_t TDD_125ms_Cnt = 0;
72
+
73
+volatile uint32_t TestTimer = 0;
74
+
75
+
76
+/* USER CODE END PV */
77
+
78
+/* Private function prototypes -----------------------------------------------*/
79
+void SystemClock_Config(void);
80
+static void MX_GPIO_Init(void);
81
+static void MX_DMA_Init(void);
82
+static void MX_ADC1_Init(void);
83
+static void MX_TIM6_Init(void);
84
+static void MX_USART1_UART_Init(void);
85
+static void MX_USART3_UART_Init(void);
86
+static void MX_NVIC_Init(void);
87
+/* USER CODE BEGIN PFP */
88
+extern void InitUartQueue(pUARTQUEUE pQueue);
89
+extern void Flash_InitRead();
90
+extern uint8_t FLASH_Write_Func(uint8_t* data,uint32_t size);
91
+
92
+
93
+/* USER CODE END PFP */
94
+
95
+/* Private user code ---------------------------------------------------------*/
96
+/* USER CODE BEGIN 0 */
97
+int _write (int file, uint8_t *ptr, uint16_t len)
98
+{
99
+#if 0 // PYJ.2020.06.03_BEGIN --
100
+    HAL_UART_Transmit(&hTest, ptr, len,10);
101
+#else
102
+    HAL_UART_Transmit(&hTerminal, ptr, len,10);
103
+#endif // PYJ.2020.06.03_END --
104
+
105
+    return len;
106
+}
107
+
108
+/* USER CODE END 0 */
109
+
110
+/**
111
+  * @brief  The application entry point.
112
+  * @retval int
113
+  */
114
+int main(void)
115
+{
116
+  /* USER CODE BEGIN 1 */
117
+
118
+
119
+  /* USER CODE END 1 */
120
+
121
+  /* MCU Configuration--------------------------------------------------------*/
122
+
123
+  /* Reset of all peripherals, Initializes the Flash interface and the Systick. */
124
+  HAL_Init();
125
+
126
+  /* USER CODE BEGIN Init */
127
+
128
+  /* USER CODE END Init */
129
+
130
+  /* Configure the system clock */
131
+  SystemClock_Config();
132
+
133
+  /* USER CODE BEGIN SysInit */
134
+
135
+  /* USER CODE END SysInit */
136
+
137
+  /* Initialize all configured peripherals */
138
+  MX_GPIO_Init();
139
+  MX_DMA_Init();
140
+  MX_ADC1_Init();
141
+  MX_TIM6_Init();
142
+  MX_USART1_UART_Init();
143
+  MX_USART3_UART_Init();
144
+
145
+  /* Initialize interrupts */
146
+  MX_NVIC_Init();
147
+  /* USER CODE BEGIN 2 */
148
+  HAL_TIM_Base_Start_IT(&htim6);
149
+
150
+  setbuf(stdout, NULL);
151
+  InitUartQueue(&MainQueue);
152
+  ADC_Initialize();
153
+  NessLab_Init();
154
+#if 1 // PYJ.2020.05.06_BEGIN --
155
+    printf("****************************************\r\n");
156
+    printf("NESSLAB Project\r\n");
157
+    printf("Build at %s %s\r\n", __DATE__, __TIME__);
158
+    printf("Copyright (c) 2020. BLUECELL\r\n");
159
+    printf("****************************************\r\n");
160
+#if 0 // PYJ.2020.08.28_BEGIN -- 
161
+    uint8_t Flash_TestDataArray[200] = {0x33,};
162
+
163
+    Flash_InitRead();
164
+    DataErase_Func(FLASH_USER_USE_START_ADDR,200);
165
+    printf("Ram Data Display \r\n");
166
+    for(int i = 0; i < 200; i++){
167
+        Flash_TestDataArray[i] = 0x33;
168
+//        printf("%x ",Flash_TestDataArray[i]);
169
+    }
170
+    FLASH_Write_Func(&Flash_TestDataArray[0],200);
171
+    Flash_InitRead();    
172
+#endif // PYJ.2020.08.28_END -- 
173
+#endif // PYJ.2020.05.06_END --  
174
+  /* USER CODE END 2 */
175
+
176
+  /* Infinite loop */
177
+  /* USER CODE BEGIN WHILE */
178
+
179
+ 
180
+
181
+
182
+  while (1)
183
+  {
184
+#if 1 // PYJ.2020.08.31_BEGIN -- 
185
+    Boot_LED_Toggle(); /*LED Check*/
186
+    Uart_Check();      /*Usart Rx*/
187
+    NessLab_GPIO_Operate();
188
+//    ADC_TDD_Arrange();
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_Channel1_IRQn interrupt configuration */
272
+  HAL_NVIC_SetPriority(DMA1_Channel1_IRQn, 0, 0);
273
+  HAL_NVIC_EnableIRQ(DMA1_Channel1_IRQn);
274
+}
275
+
276
+/**
277
+  * @brief ADC1 Initialization Function
278
+  * @param None
279
+  * @retval None
280
+  */
281
+static void MX_ADC1_Init(void)
282
+{
283
+
284
+  /* USER CODE BEGIN ADC1_Init 0 */
285
+
286
+  /* USER CODE END ADC1_Init 0 */
287
+
288
+  ADC_ChannelConfTypeDef sConfig = {0};
289
+
290
+  /* USER CODE BEGIN ADC1_Init 1 */
291
+
292
+  /* USER CODE END ADC1_Init 1 */
293
+  /** Common config 
294
+  */
295
+  hadc1.Instance = ADC1;
296
+  hadc1.Init.ScanConvMode = ADC_SCAN_ENABLE;
297
+  hadc1.Init.ContinuousConvMode = ENABLE;
298
+  hadc1.Init.DiscontinuousConvMode = DISABLE;
299
+  hadc1.Init.ExternalTrigConv = ADC_SOFTWARE_START;
300
+  hadc1.Init.DataAlign = ADC_DATAALIGN_RIGHT;
301
+  hadc1.Init.NbrOfConversion = 3;
302
+  if (HAL_ADC_Init(&hadc1) != HAL_OK)
303
+  {
304
+    Error_Handler();
305
+  }
306
+  /** Configure Regular Channel 
307
+  */
308
+  sConfig.Channel = ADC_CHANNEL_0;
309
+  sConfig.Rank = ADC_REGULAR_RANK_1;
310
+  sConfig.SamplingTime = ADC_SAMPLETIME_239CYCLES_5;
311
+  if (HAL_ADC_ConfigChannel(&hadc1, &sConfig) != HAL_OK)
312
+  {
313
+    Error_Handler();
314
+  }
315
+  /** Configure Regular Channel 
316
+  */
317
+  sConfig.Channel = ADC_CHANNEL_1;
318
+  sConfig.Rank = ADC_REGULAR_RANK_2;
319
+  if (HAL_ADC_ConfigChannel(&hadc1, &sConfig) != HAL_OK)
320
+  {
321
+    Error_Handler();
322
+  }
323
+  /** Configure Regular Channel 
324
+  */
325
+  sConfig.Channel = ADC_CHANNEL_3;
326
+  sConfig.Rank = ADC_REGULAR_RANK_3;
327
+  if (HAL_ADC_ConfigChannel(&hadc1, &sConfig) != HAL_OK)
328
+  {
329
+    Error_Handler();
330
+  }
331
+  /* USER CODE BEGIN ADC1_Init 2 */
332
+
333
+  /* USER CODE END ADC1_Init 2 */
334
+
335
+}
336
+
337
+/**
338
+  * @brief TIM6 Initialization Function
339
+  * @param None
340
+  * @retval None
341
+  */
342
+static void MX_TIM6_Init(void)
343
+{
344
+
345
+  /* USER CODE BEGIN TIM6_Init 0 */
346
+
347
+  /* USER CODE END TIM6_Init 0 */
348
+
349
+  TIM_MasterConfigTypeDef sMasterConfig = {0};
350
+
351
+  /* USER CODE BEGIN TIM6_Init 1 */
352
+
353
+  /* USER CODE END TIM6_Init 1 */
354
+  htim6.Instance = TIM6;
355
+  htim6.Init.Prescaler = 2400-1;
356
+  htim6.Init.CounterMode = TIM_COUNTERMODE_UP;
357
+  htim6.Init.Period = 10;
358
+  htim6.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE;
359
+  if (HAL_TIM_Base_Init(&htim6) != HAL_OK)
360
+  {
361
+    Error_Handler();
362
+  }
363
+  sMasterConfig.MasterOutputTrigger = TIM_TRGO_RESET;
364
+  sMasterConfig.MasterSlaveMode = TIM_MASTERSLAVEMODE_DISABLE;
365
+  if (HAL_TIMEx_MasterConfigSynchronization(&htim6, &sMasterConfig) != HAL_OK)
366
+  {
367
+    Error_Handler();
368
+  }
369
+  /* USER CODE BEGIN TIM6_Init 2 */
370
+
371
+  /* USER CODE END TIM6_Init 2 */
372
+
373
+}
374
+
375
+/**
376
+  * @brief USART1 Initialization Function
377
+  * @param None
378
+  * @retval None
379
+  */
380
+static void MX_USART1_UART_Init(void)
381
+{
382
+
383
+  /* USER CODE BEGIN USART1_Init 0 */
384
+
385
+  /* USER CODE END USART1_Init 0 */
386
+
387
+  /* USER CODE BEGIN USART1_Init 1 */
388
+
389
+  /* USER CODE END USART1_Init 1 */
390
+  huart1.Instance = USART1;
391
+  huart1.Init.BaudRate = 115200;
392
+  huart1.Init.WordLength = UART_WORDLENGTH_8B;
393
+  huart1.Init.StopBits = UART_STOPBITS_1;
394
+  huart1.Init.Parity = UART_PARITY_NONE;
395
+  huart1.Init.Mode = UART_MODE_TX_RX;
396
+  huart1.Init.HwFlowCtl = UART_HWCONTROL_NONE;
397
+  huart1.Init.OverSampling = UART_OVERSAMPLING_16;
398
+  if (HAL_UART_Init(&huart1) != HAL_OK)
399
+  {
400
+    Error_Handler();
401
+  }
402
+  /* USER CODE BEGIN USART1_Init 2 */
403
+
404
+  /* USER CODE END USART1_Init 2 */
405
+
406
+}
407
+
408
+/**
409
+  * @brief USART3 Initialization Function
410
+  * @param None
411
+  * @retval None
412
+  */
413
+static void MX_USART3_UART_Init(void)
414
+{
415
+
416
+  /* USER CODE BEGIN USART3_Init 0 */
417
+
418
+  /* USER CODE END USART3_Init 0 */
419
+
420
+  /* USER CODE BEGIN USART3_Init 1 */
421
+
422
+  /* USER CODE END USART3_Init 1 */
423
+  huart3.Instance = USART3;
424
+  huart3.Init.BaudRate = 115200;
425
+  huart3.Init.WordLength = UART_WORDLENGTH_8B;
426
+  huart3.Init.StopBits = UART_STOPBITS_1;
427
+  huart3.Init.Parity = UART_PARITY_NONE;
428
+  huart3.Init.Mode = UART_MODE_TX_RX;
429
+  huart3.Init.HwFlowCtl = UART_HWCONTROL_NONE;
430
+  huart3.Init.OverSampling = UART_OVERSAMPLING_16;
431
+  if (HAL_UART_Init(&huart3) != HAL_OK)
432
+  {
433
+    Error_Handler();
434
+  }
435
+  /* USER CODE BEGIN USART3_Init 2 */
436
+
437
+  /* USER CODE END USART3_Init 2 */
438
+
439
+}
440
+
441
+/** 
442
+  * Enable DMA controller clock
443
+  */
444
+static void MX_DMA_Init(void) 
445
+{
446
+
447
+  /* DMA controller clock enable */
448
+  __HAL_RCC_DMA1_CLK_ENABLE();
449
+
450
+}
451
+
452
+/**
453
+  * @brief GPIO Initialization Function
454
+  * @param None
455
+  * @retval None
456
+  */
457
+static void MX_GPIO_Init(void)
458
+{
459
+  GPIO_InitTypeDef GPIO_InitStruct = {0};
460
+
461
+  /* GPIO Ports Clock Enable */
462
+  __HAL_RCC_GPIOC_CLK_ENABLE();
463
+  __HAL_RCC_GPIOA_CLK_ENABLE();
464
+  __HAL_RCC_GPIOB_CLK_ENABLE();
465
+
466
+  /*Configure GPIO pin Output Level */
467
+  HAL_GPIO_WritePin(BOOT_LED_GPIO_Port, BOOT_LED_Pin, GPIO_PIN_RESET);
468
+
469
+  /*Configure GPIO pin Output Level */
470
+  HAL_GPIO_WritePin(GPIOA, PAU_RESERVED0_Pin|PAU_RESERVED1_Pin|AMP_EN_Pin, GPIO_PIN_RESET);
471
+
472
+  /*Configure GPIO pin Output Level */
473
+  HAL_GPIO_WritePin(GPIOB, PAU_RESERVED3_Pin|PAU_RESERVED2_Pin|PAU_RESET_Pin, GPIO_PIN_RESET);
474
+
475
+  /*Configure GPIO pin : BOOT_LED_Pin */
476
+  GPIO_InitStruct.Pin = BOOT_LED_Pin;
477
+  GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
478
+  GPIO_InitStruct.Pull = GPIO_NOPULL;
479
+  GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
480
+  HAL_GPIO_Init(BOOT_LED_GPIO_Port, &GPIO_InitStruct);
481
+
482
+  /*Configure GPIO pins : DC_FAIL_ALARM_Pin OVER_INPUT_ALARM_Pin OVER_TEMP_ALARM_Pin */
483
+  GPIO_InitStruct.Pin = DC_FAIL_ALARM_Pin|OVER_INPUT_ALARM_Pin|OVER_TEMP_ALARM_Pin;
484
+  GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
485
+  GPIO_InitStruct.Pull = GPIO_NOPULL;
486
+  HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
487
+
488
+  /*Configure GPIO pins : PAU_RESERVED0_Pin PAU_RESERVED1_Pin AMP_EN_Pin */
489
+  GPIO_InitStruct.Pin = PAU_RESERVED0_Pin|PAU_RESERVED1_Pin|AMP_EN_Pin;
490
+  GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
491
+  GPIO_InitStruct.Pull = GPIO_NOPULL;
492
+  GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
493
+  HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
494
+
495
+  /*Configure GPIO pins : PAU_RESERVED3_Pin PAU_RESERVED2_Pin PAU_RESET_Pin */
496
+  GPIO_InitStruct.Pin = PAU_RESERVED3_Pin|PAU_RESERVED2_Pin|PAU_RESET_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(GPIOB, &GPIO_InitStruct);
501
+
502
+  /*Configure GPIO pins : OVER_POWER_ALARM_Pin VSWR_ALARM_Pin PAU_EN_Pin ALC_ALARM_Pin */
503
+  GPIO_InitStruct.Pin = OVER_POWER_ALARM_Pin|VSWR_ALARM_Pin|PAU_EN_Pin|ALC_ALARM_Pin;
504
+  GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
505
+  GPIO_InitStruct.Pull = GPIO_NOPULL;
506
+  HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
507
+
508
+}
509
+
510
+/* USER CODE BEGIN 4 */
511
+
512
+/* USER CODE END 4 */
513
+
514
+ /**
515
+  * @brief  Period elapsed callback in non blocking mode
516
+  * @note   This function is called  when TIM2 interrupt took place, inside
517
+  * HAL_TIM_IRQHandler(). It makes a direct call to HAL_IncTick() to increment
518
+  * a global variable "uwTick" used as application time base.
519
+  * @param  htim : TIM handle
520
+  * @retval None
521
+  */
522
+void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim)
523
+{
524
+  /* USER CODE BEGIN Callback 0 */
525
+
526
+  /* USER CODE END Callback 0 */
527
+  if (htim->Instance == TIM2) {
528
+    HAL_IncTick();
529
+  }
530
+  /* USER CODE BEGIN Callback 1 */
531
+  if(htim->Instance == TIM6){
532
+      UartRxTimerCnt++;
533
+          LED_TimerCnt++;
534
+          TDD_125ms_Cnt++;
535
+      
536
+      
537
+        if(HAL_GPIO_ReadPin(DC_FAIL_ALARM_GPIO_Port, DC_FAIL_ALARM_Pin) == GPIO_PIN_SET)
538
+            DC_FAIL_ALARM_CNT++;
539
+        else
540
+            DC_FAIL_ALARM_CNT = 0;
541
+            
542
+        if(HAL_GPIO_ReadPin(OVER_INPUT_ALARM_GPIO_Port, OVER_INPUT_ALARM_Pin)== GPIO_PIN_SET)
543
+            OVER_INPUT_ALARM_CNT++;
544
+        else
545
+            OVER_INPUT_ALARM_CNT = 0;
546
+            
547
+        if(HAL_GPIO_ReadPin(OVER_TEMP_ALARM_GPIO_Port, OVER_TEMP_ALARM_Pin)== GPIO_PIN_SET)
548
+            OVER_TEMP_ALARM_CNT++;
549
+        else
550
+            OVER_TEMP_ALARM_CNT = 0;
551
+            
552
+        if(HAL_GPIO_ReadPin(ALC_ALARM_GPIO_Port, ALC_ALARM_Pin)== GPIO_PIN_SET)
553
+            ALC_ALARM_CNT++;
554
+        else
555
+            ALC_ALARM_CNT = 0;
556
+            
557
+        if(HAL_GPIO_ReadPin(OVER_POWER_ALARM_GPIO_Port, OVER_POWER_ALARM_Pin)== GPIO_PIN_SET)
558
+            OVER_POWER_ALARM_CNT++;
559
+      
560
+        else
561
+            OVER_POWER_ALARM_CNT = 0;
562
+            
563
+        if(HAL_GPIO_ReadPin(VSWR_ALARM_GPIO_Port, VSWR_ALARM_Pin)== GPIO_PIN_SET)
564
+            VSWR_ALARM_CNT++;
565
+      
566
+        else
567
+            VSWR_ALARM_CNT = 0;
568
+
569
+  }
570
+  /* USER CODE END Callback 1 */
571
+}
572
+
573
+/**
574
+  * @brief  This function is executed in case of error occurrence.
575
+  * @retval None
576
+  */
577
+void Error_Handler(void)
578
+{
579
+  /* USER CODE BEGIN Error_Handler_Debug */
580
+  /* User can add his own implementation to report the HAL error return state */
581
+
582
+  /* USER CODE END Error_Handler_Debug */
583
+}
584
+
585
+#ifdef  USE_FULL_ASSERT
586
+/**
587
+  * @brief  Reports the name of the source file and the source line number
588
+  *         where the assert_param error has occurred.
589
+  * @param  file: pointer to the source file name
590
+  * @param  line: assert_param error line source number
591
+  * @retval None
592
+  */
593
+void assert_failed(uint8_t *file, uint32_t line)
594
+{ 
595
+  /* USER CODE BEGIN 6 */
596
+  /* User can add his own implementation to report the file name and line number,
597
+     tex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */
598
+  /* USER CODE END 6 */
599
+}
600
+#endif /* USE_FULL_ASSERT */
601
+
602
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

+ 106 - 0
insight/Nesslab_200M_System.si4project/Backup/main(6931).h

@@ -0,0 +1,106 @@
1
+/* USER CODE BEGIN Header */
2
+/**
3
+  ******************************************************************************
4
+  * @file           : main.h
5
+  * @brief          : Header for main.c file.
6
+  *                   This file contains the common defines of the application.
7
+  ******************************************************************************
8
+  * @attention
9
+  *
10
+  * <h2><center>&copy; Copyright (c) 2020 STMicroelectronics.
11
+  * All rights reserved.</center></h2>
12
+  *
13
+  * This software component is licensed by ST under Ultimate Liberty license
14
+  * SLA0044, the "License"; You may not use this file except in compliance with
15
+  * the License. You may obtain a copy of the License at:
16
+  *                             www.st.com/SLA0044
17
+  *
18
+  ******************************************************************************
19
+  */
20
+/* USER CODE END Header */
21
+
22
+/* Define to prevent recursive inclusion -------------------------------------*/
23
+#ifndef __MAIN_H
24
+#define __MAIN_H
25
+
26
+#ifdef __cplusplus
27
+extern "C" {
28
+#endif
29
+
30
+/* Includes ------------------------------------------------------------------*/
31
+#include "stm32f1xx_hal.h"
32
+
33
+/* Private includes ----------------------------------------------------------*/
34
+/* USER CODE BEGIN Includes */
35
+#include <stdint.h>
36
+/* USER CODE END Includes */
37
+
38
+/* Exported types ------------------------------------------------------------*/
39
+/* USER CODE BEGIN ET */
40
+
41
+/* USER CODE END ET */
42
+
43
+/* Exported constants --------------------------------------------------------*/
44
+/* USER CODE BEGIN EC */
45
+
46
+/* USER CODE END EC */
47
+
48
+/* Exported macro ------------------------------------------------------------*/
49
+/* USER CODE BEGIN EM */
50
+extern ADC_HandleTypeDef hadc1;
51
+extern DMA_HandleTypeDef hdma_adc1;
52
+/* USER CODE END EM */
53
+
54
+/* Exported functions prototypes ---------------------------------------------*/
55
+void Error_Handler(void);
56
+
57
+/* USER CODE BEGIN EFP */
58
+
59
+/* USER CODE END EFP */
60
+
61
+/* Private defines -----------------------------------------------------------*/
62
+#define BOOT_LED_Pin GPIO_PIN_15
63
+#define BOOT_LED_GPIO_Port GPIOC
64
+#define DL_TX_DET_Pin GPIO_PIN_0
65
+#define DL_TX_DET_GPIO_Port GPIOA
66
+#define DL_RX_DET_Pin GPIO_PIN_1
67
+#define DL_RX_DET_GPIO_Port GPIOA
68
+#define DC_FAIL_ALARM_Pin GPIO_PIN_2
69
+#define DC_FAIL_ALARM_GPIO_Port GPIOA
70
+#define PAU_TEMP_Pin GPIO_PIN_3
71
+#define PAU_TEMP_GPIO_Port GPIOA
72
+#define PAU_RESERVED0_Pin GPIO_PIN_6
73
+#define PAU_RESERVED0_GPIO_Port GPIOA
74
+#define PAU_RESERVED1_Pin GPIO_PIN_7
75
+#define PAU_RESERVED1_GPIO_Port GPIOA
76
+#define PAU_RESERVED3_Pin GPIO_PIN_0
77
+#define PAU_RESERVED3_GPIO_Port GPIOB
78
+#define PAU_RESERVED2_Pin GPIO_PIN_1
79
+#define PAU_RESERVED2_GPIO_Port GPIOB
80
+#define OVER_POWER_ALARM_Pin GPIO_PIN_12
81
+#define OVER_POWER_ALARM_GPIO_Port GPIOB
82
+#define VSWR_ALARM_Pin GPIO_PIN_13
83
+#define VSWR_ALARM_GPIO_Port GPIOB
84
+#define PAU_RESET_Pin GPIO_PIN_14
85
+#define PAU_RESET_GPIO_Port GPIOB
86
+#define PAU_EN_Pin GPIO_PIN_15
87
+#define PAU_EN_GPIO_Port GPIOB
88
+#define AMP_EN_Pin GPIO_PIN_8
89
+#define AMP_EN_GPIO_Port GPIOA
90
+#define OVER_INPUT_ALARM_Pin GPIO_PIN_11
91
+#define OVER_INPUT_ALARM_GPIO_Port GPIOA
92
+#define OVER_TEMP_ALARM_Pin GPIO_PIN_12
93
+#define OVER_TEMP_ALARM_GPIO_Port GPIOA
94
+#define ALC_ALARM_Pin GPIO_PIN_3
95
+#define ALC_ALARM_GPIO_Port GPIOB
96
+/* USER CODE BEGIN Private defines */
97
+#define ADC_DATA_CYCLE 500
98
+/* USER CODE END Private defines */
99
+
100
+#ifdef __cplusplus
101
+}
102
+#endif
103
+
104
+#endif /* __MAIN_H */
105
+
106
+/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

BIN
insight/Nesslab_200M_System.si4project/cache/parse/.._Bluecell_Inc_NessLab.h.sisc


BIN
insight/Nesslab_200M_System.si4project/cache/parse/.._Bluecell_Inc_adc.h.sisc


BIN
insight/Nesslab_200M_System.si4project/cache/parse/.._Bluecell_Inc_crc.h.sisc


BIN
insight/Nesslab_200M_System.si4project/cache/parse/.._Bluecell_Inc_flash.h.sisc


BIN
insight/Nesslab_200M_System.si4project/cache/parse/.._Bluecell_Inc_uart.h.sisc


BIN
insight/Nesslab_200M_System.si4project/cache/parse/.._Bluecell_Src_NessLab.c.sisc


BIN
insight/Nesslab_200M_System.si4project/cache/parse/.._Bluecell_Src_adc.c.sisc


BIN
insight/Nesslab_200M_System.si4project/cache/parse/.._Bluecell_Src_crc.c.sisc


BIN
insight/Nesslab_200M_System.si4project/cache/parse/.._Bluecell_Src_flash.c.sisc


BIN
insight/Nesslab_200M_System.si4project/cache/parse/.._Bluecell_Src_led.c.sisc


BIN
insight/Nesslab_200M_System.si4project/cache/parse/.._Bluecell_Src_uart.c.sisc


BIN
insight/Nesslab_200M_System.si4project/cache/parse/.._Drivers_STM32F1xx_HAL_Driver_Inc_stm32f1xx_hal_adc.h.sisc


BIN
insight/Nesslab_200M_System.si4project/cache/parse/.._Drivers_STM32F1xx_HAL_Driver_Inc_stm32f1xx_hal_flash.h.sisc


BIN
insight/Nesslab_200M_System.si4project/cache/parse/.._Drivers_STM32F1xx_HAL_Driver_Inc_stm32f1xx_hal_flash_ex.h.sisc


BIN
insight/Nesslab_200M_System.si4project/cache/parse/.._Drivers_STM32F1xx_HAL_Driver_Inc_stm32f1xx_hal_gpio.h.sisc


BIN
insight/Nesslab_200M_System.si4project/cache/parse/.._Drivers_STM32F1xx_HAL_Driver_Inc_stm32f1xx_hal_tim.h.sisc


BIN
insight/Nesslab_200M_System.si4project/cache/parse/.._Drivers_STM32F1xx_HAL_Driver_Src_stm32f1xx_hal_adc.c.sisc


BIN
insight/Nesslab_200M_System.si4project/cache/parse/.._Drivers_STM32F1xx_HAL_Driver_Src_stm32f1xx_hal_gpio.c.sisc


BIN
insight/Nesslab_200M_System.si4project/cache/parse/.._Inc_main.h.sisc


BIN
insight/Nesslab_200M_System.si4project/cache/parse/.._Src_main.c.sisc