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

Warning Code 전부 제거 모든 Function 최적화

YJ пре 6 година
родитељ
комит
19167bfd04
68 измењених фајлова са 9594 додато и 8846 уклоњено
  1. BIN
      Debug/STM32F103_ATTEN_PLL_Zig.binary
  2. BIN
      Debug/STM32F103_ATTEN_PLL_Zig.elf
  3. 1256 1255
      Debug/STM32F103_ATTEN_PLL_Zig.hex
  4. 6950 6946
      Debug/STM32F103_ATTEN_PLL_Zig.list
  5. 558 556
      Debug/STM32F103_ATTEN_PLL_Zig.map
  6. BIN
      Debug/Src/AD5318.o
  7. 2 2
      Debug/Src/AD5318.su
  8. BIN
      Debug/Src/BDA4601.o
  9. BIN
      Debug/Src/CRC16.o
  10. BIN
      Debug/Src/PE43711.o
  11. 4 4
      Debug/Src/PE43711.su
  12. BIN
      Debug/Src/adf4153.o
  13. 9 9
      Debug/Src/adf4153.su
  14. BIN
      Debug/Src/flash.o
  15. 8 8
      Debug/Src/flash.su
  16. BIN
      Debug/Src/includes.o
  17. 9 9
      Debug/Src/includes.su
  18. BIN
      Debug/Src/main.o
  19. 5 5
      Debug/Src/main.su
  20. BIN
      Debug/Src/pll_4113.o
  21. 5 5
      Debug/Src/pll_4113.su
  22. BIN
      Debug/Src/stm32f1xx_hal_msp.o
  23. BIN
      Debug/Src/stm32f1xx_it.o
  24. BIN
      Debug/Src/uart.o
  25. 5 5
      Debug/Src/uart.su
  26. BIN
      Debug/Src/zig_operate.o
  27. 5 5
      Debug/Src/zig_operate.su
  28. 4 4
      Inc/adf4153.h
  29. 3 2
      Inc/includes.h
  30. 10 10
      Inc/main.h
  31. 7 6
      Inc/pll_4113.h
  32. 1 0
      Inc/zig_operate.h
  33. 2 0
      Src/AD5318.c
  34. 1 1
      Src/BDA4601.c
  35. 2 0
      Src/PE43711.c
  36. 5 0
      Src/adf4153.c
  37. 4 2
      Src/flash.c
  38. 7 3
      Src/includes.c
  39. 15 2
      Src/main.c
  40. 10 6
      Src/pll_4113.c
  41. 3 1
      Src/uart.c
  42. 14 0
      Src/zig_operate.c
  43. 319 0
      insight/STM32F103_ATTEN_PLL_Zig.si4project/Backup/includes(7006).c
  44. 44 0
      insight/STM32F103_ATTEN_PLL_Zig.si4project/Backup/includes(8164).h
  45. 327 0
      insight/STM32F103_ATTEN_PLL_Zig.si4project/Backup/pll_4113(8086).c
  46. BIN
      insight/STM32F103_ATTEN_PLL_Zig.si4project/STM32F103_ATTEN_PLL_Zig.sip_sym
  47. BIN
      insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Drivers_STM32F1xx_HAL_Driver_Src_stm32f1xx_hal_gpio.c.sisc
  48. BIN
      insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Inc_AD5318.h.sisc
  49. BIN
      insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Inc_BDA4601.h.sisc
  50. BIN
      insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Inc_CRC16.h.sisc
  51. BIN
      insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Inc_PE43711.h.sisc
  52. BIN
      insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Inc_adf4153.h.sisc
  53. BIN
      insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Inc_flash.h.sisc
  54. BIN
      insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Inc_includes.h.sisc
  55. BIN
      insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Inc_main.h.sisc
  56. BIN
      insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Inc_pll_4113.h.sisc
  57. BIN
      insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Inc_uart.h.sisc
  58. BIN
      insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Inc_zig_operate.h.sisc
  59. BIN
      insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Src_AD5318.c.sisc
  60. BIN
      insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Src_BDA4601.c.sisc
  61. BIN
      insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Src_PE43711.c.sisc
  62. BIN
      insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Src_adf4153.c.sisc
  63. BIN
      insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Src_flash.c.sisc
  64. BIN
      insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Src_includes.c.sisc
  65. BIN
      insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Src_main.c.sisc
  66. BIN
      insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Src_pll_4113.c.sisc
  67. BIN
      insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Src_uart.c.sisc
  68. BIN
      insight/STM32F103_ATTEN_PLL_Zig.si4project/cache/parse/.._.._Src_zig_operate.c.sisc

BIN
Debug/STM32F103_ATTEN_PLL_Zig.binary


BIN
Debug/STM32F103_ATTEN_PLL_Zig.elf


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


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


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


BIN
Debug/Src/AD5318.o


+ 2 - 2
Debug/Src/AD5318.su

@@ -1,2 +1,2 @@
1
-AD5318.c:23:6:AD5318_Ctrl	16	static
2
-AD5318.c:8:7:AD5318_Initialize	8	static
1
+AD5318.c:25:6:AD5318_Ctrl	16	static
2
+AD5318.c:10:7:AD5318_Initialize	8	static

BIN
Debug/Src/BDA4601.o


BIN
Debug/Src/CRC16.o


BIN
Debug/Src/PE43711.o


+ 4 - 4
Debug/Src/PE43711.su

@@ -1,4 +1,4 @@
1
-PE43711.c:79:6:Bit_Compare	0	static
2
-PE43711.c:87:6:PE43711_ALL_atten_ctrl	56	static
3
-PE43711.c:63:6:PE43711_PinInit	176	static
4
-PE43711.c:108:6:PE43711_atten_ctrl	40	static
1
+PE43711.c:81:6:Bit_Compare	0	static
2
+PE43711.c:89:6:PE43711_ALL_atten_ctrl	56	static
3
+PE43711.c:65:6:PE43711_PinInit	176	static
4
+PE43711.c:110:6:PE43711_atten_ctrl	40	static

BIN
Debug/Src/adf4153.o


+ 9 - 9
Debug/Src/adf4153.su

@@ -1,9 +1,9 @@
1
-adf4153.c:56:10:pow2	0	static
2
-adf4153.c:64:8:round_up	16	static
3
-adf4153.c:75:8:N_Reg_Value_Calc	8	static
4
-adf4153.c:78:10:N_Divider_Reg_Create	16	static
5
-adf4153.c:118:10:R_Divider_Reg_Create	20	static
6
-adf4153.c:163:20:ADF4153_Freq_Calc	48	static
7
-adf4153.c:238:6:ADF4153_Initialize	0	static
8
-adf4153.c:308:6:ADF4153_Module_Ctrl	56	static
9
-adf4153.c:290:6:ADF4153_Check	40	static
1
+adf4153.c:61:10:pow2	0	static
2
+adf4153.c:69:8:round_up	16	static
3
+adf4153.c:80:8:N_Reg_Value_Calc	8	static
4
+adf4153.c:83:10:N_Divider_Reg_Create	16	static
5
+adf4153.c:123:10:R_Divider_Reg_Create	20	static
6
+adf4153.c:168:20:ADF4153_Freq_Calc	48	static
7
+adf4153.c:243:6:ADF4153_Initialize	0	static
8
+adf4153.c:313:6:ADF4153_Module_Ctrl	56	static
9
+adf4153.c:295:6:ADF4153_Check	40	static

BIN
Debug/Src/flash.o


+ 8 - 8
Debug/Src/flash.su

@@ -1,8 +1,8 @@
1
-flash.c:14:6:Jump_App	16	static
2
-flash.c:27:6:FLASH_If_Init	8	static
3
-flash.c:38:6:Flash_InitRead	16	static
4
-flash.c:60:9:Flash_RGB_Data_Write	24	static
5
-flash.c:75:9:Flash_write	16	static
6
-flash.c:124:6:FLASH_Byte_Write	16	static
7
-flash.c:184:9:Bluecell_Flash_Write	8	static
8
-flash.c:191:6:Bluecell_Flash_Read	0	static
1
+flash.c:15:6:Jump_App	16	static
2
+flash.c:28:6:FLASH_If_Init	8	static
3
+flash.c:39:6:Flash_InitRead	0	static
4
+flash.c:61:9:Flash_RGB_Data_Write	24	static
5
+flash.c:76:9:Flash_write	16	static
6
+flash.c:125:6:FLASH_Byte_Write	16	static
7
+flash.c:185:9:Bluecell_Flash_Write	8	static
8
+flash.c:192:6:Bluecell_Flash_Read	0	static

BIN
Debug/Src/includes.o


+ 9 - 9
Debug/Src/includes.su

@@ -1,9 +1,9 @@
1
-includes.c:99:6:Path_Init	16	static
2
-includes.c:111:6:Power_ON_OFF_Ctrl	8	static
3
-includes.c:231:6:ATTEN_PLL_PATH_Initialize	8	static
4
-includes.c:241:6:Power_ON_OFF_Initialize	16	static
5
-includes.c:262:6:Error_Message_Occur	8	static
6
-includes.c:288:6:Pol_Delay_us	8	static
7
-includes.c:296:6:Boot_LED_Toggle	8	static
8
-includes.c:299:6:ADC_Check	20	static
9
-includes.c:312:6:Uart_Check	16	static
1
+includes.c:103:6:Path_Init	16	static
2
+includes.c:115:6:Power_ON_OFF_Ctrl	8	static
3
+includes.c:235:6:ATTEN_PLL_PATH_Initialize	8	static
4
+includes.c:245:6:Power_ON_OFF_Initialize	16	static
5
+includes.c:266:6:Error_Message_Occur	8	static
6
+includes.c:292:6:Pol_Delay_us	8	static
7
+includes.c:300:6:Boot_LED_Toggle	8	static
8
+includes.c:303:6:ADC_Check	20	static
9
+includes.c:316:6:Uart_Check	16	static


+ 5 - 5
Debug/Src/main.su

@@ -1,5 +1,5 @@
1
-main.c:83:6:HAL_TIM_PeriodElapsedCallback	0	static
2
-main.c:92:5:_write	8	static
3
-main.c:175:6:SystemClock_Config	96	static
4
-main.c:104:5:main	56	static
5
-main.c:617:6:Error_Handler	0	static
1
+main.c:96:6:HAL_TIM_PeriodElapsedCallback	0	static
2
+main.c:105:5:_write	8	static
3
+main.c:188:6:SystemClock_Config	96	static
4
+main.c:117:5:main	56	static
5
+main.c:630:6:Error_Handler	0	static

BIN
Debug/Src/pll_4113.o


+ 5 - 5
Debug/Src/pll_4113.su

@@ -1,5 +1,5 @@
1
-pll_4113.c:75:6:ADF4113_Initialize	0	static
2
-pll_4113.c:194:10:N_Counter_Latch_Create	16	static
3
-pll_4113.c:164:10:halSynSetFreq	0	static
4
-pll_4113.c:238:6:ADF4113_Module_Ctrl	48	static
5
-pll_4113.c:102:6:ADF4113_Check	40	static
1
+pll_4113.c:79:6:ADF4113_Initialize	0	static
2
+pll_4113.c:198:10:N_Counter_Latch_Create	16	static
3
+pll_4113.c:168:10:halSynSetFreq	0	static
4
+pll_4113.c:242:6:ADF4113_Module_Ctrl	48	static
5
+pll_4113.c:106:6:ADF4113_Check	40	static

BIN
Debug/Src/stm32f1xx_hal_msp.o


BIN
Debug/Src/stm32f1xx_it.o



+ 5 - 5
Debug/Src/uart.su

@@ -1,5 +1,5 @@
1
-uart.c:14:6:InitUartQueue	8	static
2
-uart.c:56:6:GetDataFromUartQueue	16	static
3
-uart.c:27:6:HAL_UART_RxCpltCallback	8	static
4
-uart.c:44:6:PutDataToUartQueue	16	static
5
-uart.c:97:6:Uart1_Data_Send	0	static
1
+uart.c:16:6:InitUartQueue	8	static
2
+uart.c:58:6:GetDataFromUartQueue	16	static
3
+uart.c:29:6:HAL_UART_RxCpltCallback	8	static
4
+uart.c:46:6:PutDataToUartQueue	16	static
5
+uart.c:99:6:Uart1_Data_Send	0	static

BIN
Debug/Src/zig_operate.o


+ 5 - 5
Debug/Src/zig_operate.su

@@ -1,5 +1,5 @@
1
-zig_operate.c:187:6:RF_Data_Check	8	static
2
-zig_operate.c:220:6:RF_Status_Get	8	static
3
-zig_operate.c:234:6:RF_Status_Ack	8	static
4
-zig_operate.c:248:6:RF_Operate	176	static
5
-zig_operate.c:680:6:RF_Ctrl_Main	16	static
1
+zig_operate.c:201:6:RF_Data_Check	8	static
2
+zig_operate.c:234:6:RF_Status_Get	8	static
3
+zig_operate.c:248:6:RF_Status_Ack	8	static
4
+zig_operate.c:262:6:RF_Operate	176	static
5
+zig_operate.c:694:6:RF_Ctrl_Main	16	static

+ 4 - 4
Inc/adf4153.h

@@ -42,10 +42,10 @@
42 42
 #ifndef __ADF4153_H__
43 43
 #define __ADF4153_H__
44 44
 
45
-#include "main.h"
46
-
47
-
45
+//#include "main.h"
48 46
 
47
+#include "main.h"
48
+#include "pll_4113.h"
49 49
 
50 50
 #define ADF4153_REFIN 40000000
51 51
 #define ADF4153_RCOUNTER 2
@@ -61,7 +61,7 @@ typedef struct {
61 61
 
62 62
 
63 63
 //void ADF4153_Module_Ctrl(PLL_Setting_st pll,uint32_t R0,uint32_t R1,uint32_t R2,uint32_t R3);
64
-//void ADF4153_Module_Ctrl(PLL_Setting_st pll,uint32_t R0,uint32_t R1,uint32_t R2,uint32_t R3);
64
+void ADF4153_Module_Ctrl(PLL_Setting_st pll,uint32_t R0,uint32_t R1,uint32_t R2,uint32_t R3);
65 65
 ADF4153_R_N_Reg_st ADF4153_Freq_Calc(unsigned long long Freq,unsigned long long REFin,uint8_t R_Counter,uint32_t chspacing);
66 66
 void ADF4153_Initialize(void);
67 67
 void ADF4153_Check(void);

+ 3 - 2
Inc/includes.h

@@ -7,6 +7,7 @@
7 7
 
8 8
 #ifndef INCLUDES_H_
9 9
 #define INCLUDES_H_
10
+//#include "main.h"
10 11
 #include "main.h"
11 12
 #if 0 // PYJ.2019.07.28_BEGIN -- 
12 13
 typedef enum{
@@ -29,11 +30,11 @@ typedef enum{
29 30
   UL_2_1,
30 31
 }PLL_Error;
31 32
 
33
+extern char *Bluecell_Prot_IndexStr[];
32 34
 void Power_ON_OFF_Ctrl(uint8_t type,uint8_t cmd);
33 35
 void Path_Init(void);
34 36
 void ATTEN_PLL_PATH_Initialize(void);
35
-char *Bluecell_Prot_IndexStr[];
36
-
37
+void Pol_Delay_us(volatile uint32_t microseconds);
37 38
 void Error_Message_Occur(PLL_Error mode);
38 39
 void Pol_Delay_us(volatile uint32_t microseconds);
39 40
 void Boot_LED_Toggle(void);

+ 10 - 10
Inc/main.h

@@ -34,15 +34,15 @@ extern "C" {
34 34
 /* USER CODE BEGIN Includes */
35 35
 #include <stdio.h>
36 36
 #include <stdbool.h>
37
-#include "PE43711.h"
38
-#include "BDA4601.h"
39
-#include "zig_operate.h"
40
-#include "pll_4113.h"
41
-#include "adf4153.h"
42
-#include "uart.h"
43
-#include "includes.h"
44
-#include "ad5318.h"
45
-#include "flash.h"
37
+//#include "PE43711.h"
38
+//#include "BDA4601.h"
39
+//#include "zig_operate.h"
40
+//#include "pll_4113.h"
41
+//#include "adf4153.h"
42
+//#include "uart.h"
43
+//#include "includes.h"
44
+//#include "ad5318.h"
45
+//#include "flash.h"
46 46
 /* USER CODE END Includes */
47 47
 
48 48
 /* Exported types ------------------------------------------------------------*/
@@ -80,7 +80,7 @@ volatile uint32_t LedTimerCnt;
80 80
 void Error_Handler(void);
81 81
 
82 82
 /* USER CODE BEGIN EFP */
83
-extern void Pol_Delay_us(volatile uint32_t microseconds);
83
+//extern void Pol_Delay_us(volatile uint32_t microseconds);
84 84
 extern void ATTEN_PLL_PATH_Initialize(void);
85 85
 
86 86
 /* USER CODE END EFP */

+ 7 - 6
Inc/pll_4113.h

@@ -6,8 +6,8 @@
6 6
 **************************************************************************************************/
7 7
 #ifndef HAL_ADF4113_H
8 8
 #define HAL_ADF4113_H
9
+//#include "main.h"
9 10
 #include "main.h"
10
-
11 11
 typedef struct _PLL_Setting_st{
12 12
     GPIO_TypeDef * PLL_CLK_PORT;
13 13
     uint16_t       PLL_CLK_PIN;
@@ -22,11 +22,12 @@ PLL_Setting_st ADF4113_1_8G_DL;
22 22
 PLL_Setting_st ADF4113_1_8G_UL;
23 23
 PLL_Setting_st ADF4113_2_1G_DL;
24 24
 PLL_Setting_st ADF4113_2_1G_UL;
25
-uint8_t PLL_1_8_DL_Error_Cnt;
26
-uint8_t PLL_1_8_UL_Error_Cnt;
27
-uint8_t PLL_2_1_DL_Error_Cnt;
28
-uint8_t PLL_2_1_UL_Error_Cnt;
29
-
25
+/*
26
+extern uint8_t PLL_1_8_DL_Error_Cnt;
27
+extern uint8_t PLL_1_8_UL_Error_Cnt;
28
+extern uint8_t PLL_2_1_DL_Error_Cnt;
29
+extern uint8_t PLL_2_1_UL_Error_Cnt;
30
+*/
30 31
 uint32_t halSynSetFreq(uint32_t rf_Freq);
31 32
 void ADF4113_Module_Ctrl(PLL_Setting_st pll,uint32_t R0,uint32_t R1,uint32_t R2);
32 33
 void ADF4113_Initialize(void);

+ 1 - 0
Inc/zig_operate.h

@@ -7,6 +7,7 @@
7 7
 
8 8
 #ifndef ZIG_OPERATE_H_
9 9
 #define ZIG_OPERATE_H_
10
+#include <stdbool.h>
10 11
 #include "main.h"
11 12
 bool RF_Ctrl_Main(uint8_t* data_buf);
12 13
 
void RF_Status_Get(void);

+ 2 - 0
Src/AD5318.c

@@ -5,6 +5,8 @@
5 5
  *      Author: parkyj
6 6
  */
7 7
  #include "ad5318.h"
8
+
9
+extern void Pol_Delay_us(volatile uint32_t microseconds);
8 10
  void AD5318_Initialize(void){
9 11
    /* * * *DAC Setting* * * * */
10 12
     AD5318_Ctrl(0x800C);

+ 1 - 1
Src/BDA4601.c

@@ -126,7 +126,7 @@ void BDA4601_Initialize(void){
126 126
 
127 127
 void BDA4601_atten_ctrl(BDA4601_st BDA ,uint8_t data){
128 128
     uint8_t i = 0;
129
-    uint8_t temp = 0;
129
+//    uint8_t temp = 0;
130 130
 //    printf("BDA4601_atten_ctrl : %x \r\n",data);
131 131
 //    temp = 4|data;
132 132
     HAL_GPIO_WritePin(BDA.LE_PORT,BDA.LE_PIN,GPIO_PIN_RESET);

+ 2 - 0
Src/PE43711.c

@@ -7,9 +7,11 @@
7 7
  #include "PE43711.h"
8 8
 #if 1 // PYJ.2019.07.26_BEGIN -- 
9 9
 #define ATTEN_3_5G_Initial_Val 0
10
+extern void Pol_Delay_us(volatile uint32_t microseconds);
10 11
 void PE43711_ALL_atten_ctrl(ALL_PE43711_st ATT);
11 12
 
12 13
 void PE43711_atten_ctrl(PE43711_st ATT ,uint8_t data);
14
+
13 15
 ALL_PE43711_st ALL_ATT_3_5G;
14 16
 
15 17
 PE43711_st ATT_3_5G_LOW1 ={

+ 5 - 0
Src/adf4153.c

@@ -43,6 +43,11 @@
43 43
 /****************************** Include Files ********************************/
44 44
 /*****************************************************************************/
45 45
 #include "adf4153.h"
46
+#include "zig_operate.h"
47
+#include "main.h"
48
+#include "pll_4113.h"
49
+
50
+extern void Pol_Delay_us(volatile uint32_t microseconds);
46 51
 typedef struct _adf4153_st{
47 52
     unsigned long long PFD_Value;
48 53
     uint16_t MOD_Value;

+ 4 - 2
Src/flash.c

@@ -5,6 +5,7 @@
5 5
  *      Author: parkyj
6 6
  */
7 7
 #include "flash.h"
8
+#include "zig_operate.h"
8 9
 uint8_t flashinit = 0;
9 10
 uint32_t Address = FLASH_USER_START_ADDR;
10 11
 
@@ -40,7 +41,7 @@ void Flash_InitRead(void) // ?占쏙옙湲고븿?占쏙옙
40 41
     uint32_t  Address = 0;
41 42
     Address = FLASH_USER_START_ADDR;
42 43
     for(uint32_t i = 0; i < INDEX_BLUE_EOF + 1; i++ ){
43
-        printf("%08x : %02X \n",Address ,*(uint8_t*)Address);
44
+      //  printf("%08x : %02X \n",Address ,*(uint8_t*)Address);
44 45
         Address++;
45 46
     }
46 47
 #if 0 // PYJ.2019.03.27_BEGIN -- 
@@ -186,7 +187,7 @@ uint8_t Bluecell_Flash_Write(uint8_t* data){
186 187
   /*Variable used for Erase procedure*/
187 188
 //  flashtest();
188 189
   FLASH_Byte_Write(&data[INDEX_BLUE_HEADER]);
189
-
190
+  return true;
190 191
 }
191 192
 bool Bluecell_Flash_Read(uint8_t* data){
192 193
     for(int i = 0; i < INDEX_BLUE_EOF + 1; i += 2){
@@ -199,4 +200,5 @@ bool Bluecell_Flash_Read(uint8_t* data){
199 200
         printf("Data = %x\r\n",  data[i]);
200 201
     }
201 202
 #endif // PYJ.2019.07.31_END -- 
203
+    return true;
202 204
 }

+ 7 - 3
Src/includes.c

@@ -5,8 +5,12 @@
5 5
  *      Author: parkyj
6 6
  */
7 7
 #include "includes.h"
8
-
8
+#include "zig_operate.h"
9
+#include "main.h"
10
+#include "uart.h"
11
+#include "CRC16.h"
9 12
 #define MACROSTR(k) #k
13
+
10 14
 uint32_t ADCvalue[ADC_EA];
11 15
 
12 16
 
@@ -90,12 +94,12 @@ char *Bluecell_Prot_IndexStr[] = {
90 94
     MACROSTR(INDEX__T_SYNC_UL       ),   
91 95
 };
92 96
 
97
+#ifdef DEBUG_PRINT
93 98
 static void kConstPrinter(Bluecell_Prot_Index k)
94 99
 {
95
-#ifdef DEBUG_PRINT
96 100
     printf("%s", Bluecell_Prot_IndexStr[k]);
97
-#endif /* DEBUG_PRINT */
98 101
 }
102
+#endif /* DEBUG_PRINT */
99 103
 void Path_Init(void){
100 104
     Prev_data[INDEX_PATH_EN_1_8G_DL]   = HAL_GPIO_ReadPin(PATH_EN_1_8G_DL_GPIO_Port,PATH_EN_1_8G_DL_Pin);
101 105
     Prev_data[INDEX_PATH_EN_1_8G_UL]   = HAL_GPIO_ReadPin(PATH_EN_1_8G_UL_GPIO_Port,PATH_EN_1_8G_UL_Pin);

+ 15 - 2
Src/main.c

@@ -23,7 +23,9 @@
23 23
 
24 24
 /* Private includes ----------------------------------------------------------*/
25 25
 /* USER CODE BEGIN Includes */
26
-
26
+#include "zig_operate.h"
27
+#include "uart.h"
28
+#include "pll_4113.h"
27 29
 /* USER CODE END Includes */
28 30
 
29 31
 /* Private typedef -----------------------------------------------------------*/
@@ -73,7 +75,18 @@ static void MX_USART1_UART_Init(void);
73 75
 static void MX_TIM6_Init(void);
74 76
 static void MX_NVIC_Init(void);
75 77
 /* USER CODE BEGIN PFP */
76
-void ADF4153_Module_Ctrl(PLL_Setting_st pll,uint32_t R0,uint32_t R1,uint32_t R2,uint32_t R3);
78
+extern void ADF4153_Module_Ctrl(PLL_Setting_st pll,uint32_t R0,uint32_t R1,uint32_t R2,uint32_t R3);
79
+extern void ADF4153_Initialize(void);
80
+extern void Path_Init(void);
81
+extern void PE43711_PinInit(void);
82
+extern void BDA4601_Initialize(void);
83
+extern void Uart_Check(void);
84
+extern void Power_ON_OFF_Initialize(void);
85
+extern void Boot_LED_Toggle(void);
86
+extern uint8_t Bluecell_Flash_Write(uint8_t* data);
87
+extern void ADC_Check(void);
88
+extern void AD5318_Initialize(void);
89
+extern void Bluecell_Flash_Read(uint8_t* data);
77 90
 /* USER CODE END PFP */
78 91
 
79 92
 /* Private user code ---------------------------------------------------------*/

+ 10 - 6
Src/pll_4113.c

@@ -5,7 +5,11 @@
5 5
   Description:   This file contains the interface to the ADF4113 frequency synthesizer.
6 6
 **************************************************************************************************/
7 7
 #include "pll_4113.h"
8
+#include "includes.h"
9
+#include "zig_operate.h"
10
+#include "main.h"
8 11
 void ADF4113_Module_Ctrl(PLL_Setting_st pll,uint32_t R0,uint32_t R1,uint32_t R2);
12
+uint32_t halSynSetFreq(uint32_t rf_Freq);
9 13
 
10 14
 uint32_t N_Counter_Latch_Create(uint16_t _ACOUNTER,uint16_t _BCOUNTER,uint8_t _CPGAIN);
11 15
 
@@ -163,26 +167,26 @@ void ADF4113_Check(void){
163 167
 
164 168
 uint32_t halSynSetFreq(uint32_t rf_Freq)
165 169
 {
166
-    uint32_t  R, B;
167
-    uint32_t  A, P, p_mode;
170
+
171
+    uint32_t  B,A, P;
168 172
     uint32_t  N_val = 0;
169 173
     N_val = (rf_Freq / ADF4113_CH_STEP);
170 174
     if( N_val < ADF4113_PRE8_MIN_N) { 
171 175
         return HAL_SYN_INVALID_PRESCALE; 
172 176
     } else if(( N_val> ADF4113_PRE8_MIN_N) && (N_val < ADF4113_PRE16_MIN_N)) { 
173 177
         P = 8;  
174
-        p_mode = ADF4113_PRESCALE8;
178
+        //p_mode = ADF4113_PRESCALE8;
175 179
     } else if(( N_val > ADF4113_PRE16_MIN_N) && (N_val < ADF4113_PRE32_MIN_N)) { 
176 180
         P = 16;
177
-        p_mode = ADF4113_PRESCALE16;
181
+//        p_mode = ADF4113_PRESCALE16;
178 182
         
179 183
     } else if((N_val > ADF4113_PRE32_MIN_N) && ( N_val < ADF4113_PRE64_MIN_N)) { 
180 184
         P = 32;
181
-        p_mode = ADF4113_PRESCALE32;
185
+//        p_mode = ADF4113_PRESCALE32;
182 186
         
183 187
     } else if( N_val > ADF4113_PRE64_MIN_N) { 
184 188
         P = 64; 
185
-        p_mode = ADF4113_PRESCALE64;
189
+//        p_mode = ADF4113_PRESCALE64;
186 190
     }
187 191
     P = 32;
188 192
     B = N_val / P;

+ 3 - 1
Src/uart.c

@@ -6,6 +6,8 @@
6 6
  */
7 7
 
8 8
 #include "uart.h"
9
+#include "zig_operate.h"
10
+#include "string.h"
9 11
 
10 12
 UARTQUEUE TerminalQueue;
11 13
 UARTQUEUE WifiQueue;
@@ -59,7 +61,7 @@ void GetDataFromUartQueue(UART_HandleTypeDef *huart)
59 61
 
60 62
     
61 63
 //    UART_HandleTypeDef *dst = (huart->Instance == USART2 ? &hWifi:&hTerminal);
62
-    UART_HandleTypeDef *dst = &hTerminal;
64
+//    UART_HandleTypeDef *dst = &hTerminal;
63 65
     pUARTQUEUE pQueue = &TerminalQueue;
64 66
 //    if (HAL_UART_Transmit(dst, pQueue->Buffer + pQueue->tail, 1, 3000) != HAL_OK)
65 67
 //    {

+ 14 - 0
Src/zig_operate.c

@@ -5,6 +5,20 @@
5 5
  *      Author: parkyj
6 6
  */
7 7
 #include "zig_operate.h"
8
+#include "main.h"
9
+#include "pll_4113.h"
10
+#include "ADF4153.h"
11
+#include "PE43711.h"
12
+#include "BDA4601.h"
13
+#include "uart.h"
14
+#include "CRC16.h"
15
+extern void AD5318_Ctrl(uint16_t ShiftTarget) ;
16
+extern etError STH30_CheckCrc(uint8_t *data, uint8_t nbrOfBytes, uint8_t checksum);
17
+extern void ADF4153_Module_Ctrl(PLL_Setting_st pll,uint32_t R0,uint32_t R1,uint32_t R2,uint32_t R3);
18
+extern bool Bluecell_Flash_Read(uint8_t* data);
19
+extern void PE43711_ALL_atten_ctrl(ALL_PE43711_st ATT);
20
+extern void Power_ON_OFF_Ctrl(uint8_t type,uint8_t cmd);
21
+extern uint8_t Bluecell_Flash_Write(uint8_t* data);
8 22
 uint8_t Prev_data[INDEX_BLUE_EOF + 1];
9 23
 uint8_t Flash_Save_data[INDEX_BLUE_EOF + 1];
10 24
 

+ 319 - 0
insight/STM32F103_ATTEN_PLL_Zig.si4project/Backup/includes(7006).c

@@ -0,0 +1,319 @@
1
+/*
2
+ * includes.c
3
+ *
4
+ *  Created on: 2019. 7. 28.
5
+ *      Author: parkyj
6
+ */
7
+#include "includes.h"
8
+#include "zig_operate.h"
9
+#include "main.h"
10
+#include "uart.h"
11
+#define MACROSTR(k) #k
12
+
13
+void Pol_Delay_us(volatile uint32_t microseconds);
14
+uint32_t ADCvalue[ADC_EA];
15
+
16
+
17
+char *Bluecell_Prot_IndexStr[] = {
18
+    MACROSTR(INDEX_ATT_1_8G_DL1     ),
19
+    MACROSTR(INDEX_ATT_1_8G_DL2     ),
20
+    MACROSTR(INDEX_ATT_1_8G_UL1     ),
21
+    MACROSTR(INDEX_ATT_1_8G_UL2     ),
22
+    MACROSTR(INDEX_ATT_1_8G_UL3     ),
23
+    MACROSTR(INDEX_ATT_1_8G_UL4     ),
24
+    MACROSTR(INDEX_ATT_2_1G_DL1     ),
25
+    MACROSTR(INDEX_ATT_2_1G_DL2     ),
26
+    MACROSTR(INDEX_ATT_2_1G_UL1     ),
27
+    MACROSTR(INDEX_ATT_2_1G_UL2     ),
28
+    MACROSTR(INDEX_ATT_2_1G_UL3     ),
29
+    MACROSTR(INDEX_ATT_2_1G_UL4     ),
30
+    MACROSTR(INDEX_ATT_3_5G_LOW1      ),
31
+    MACROSTR(INDEX_ATT_3_5G_HIGH1      ),
32
+    MACROSTR(INDEX_ATT_3_5G_COM1    ),
33
+    MACROSTR(INDEX_ATT_3_5G_LOW2     ),
34
+    MACROSTR(INDEX_ATT_3_5G_HIGH2      ),
35
+    MACROSTR(INDEX_ATT_3_5G_COM2    ),
36
+    MACROSTR(INDEX_PLL_1_8G_DL_H    ),
37
+    MACROSTR(INDEX_PLL_1_8G_DL_L    ),
38
+    MACROSTR(INDEX_PLL_1_8G_UL_H    ),
39
+    MACROSTR(INDEX_PLL_1_8G_UL_L    ),
40
+    MACROSTR(INDEX_PLL_2_1G_DL_H    ),
41
+    MACROSTR(INDEX_PLL_2_1G_DL_L    ),
42
+    MACROSTR(INDEX_PLL_2_1G_UL_H    ),
43
+    MACROSTR(INDEX_PLL_2_1G_UL_L    ),
44
+    MACROSTR(INDEX_PLL_3_5G_LOW_H    ),
45
+    MACROSTR(INDEX_PLL_3_5G_LOW_M    ),    
46
+    MACROSTR(INDEX_PLL_3_5G_LOW_L    ),
47
+    MACROSTR(INDEX_PLL_3_5G_HIGH_H    ),
48
+    MACROSTR(INDEX_PLL_3_5G_HIGH_M    ),    
49
+    MACROSTR(INDEX_PLL_3_5G_HIGH_L    ),
50
+    MACROSTR(INDEX_PLL_LD_6_BIT     ),
51
+    MACROSTR(INDEX_DET_1_8G_DL_IN_H ),
52
+    MACROSTR(INDEX_DET_1_8G_DL_IN_L ),
53
+    MACROSTR(INDEX_DET_1_8G_DL_OUT_H),
54
+    MACROSTR(INDEX_DET_1_8G_DL_OUT_L),
55
+    MACROSTR(INDEX_DET_1_8G_UL_IN_H ),
56
+    MACROSTR(INDEX_DET_1_8G_UL_IN_L ),
57
+    MACROSTR(INDEX_DET_1_8G_UL_OUT_H),
58
+    MACROSTR(INDEX_DET_1_8G_UL_OUT_L),
59
+    MACROSTR(INDEX_DET_2_1G_DL_IN_H ),
60
+    MACROSTR(INDEX_DET_2_1G_DL_IN_L ),
61
+    MACROSTR(INDEX_DET_2_1G_DL_OUT_H),
62
+    MACROSTR(INDEX_DET_2_1G_DL_OUT_L),
63
+    MACROSTR(INDEX_DET_2_1G_UL_IN_H ),
64
+    MACROSTR(INDEX_DET_2_1G_UL_IN_L ),
65
+    MACROSTR(INDEX_DET_2_1G_UL_OUT_H),
66
+    MACROSTR(INDEX_DET_2_1G_UL_OUT_L),
67
+    MACROSTR(INDEX_DET_3_5G_DL_IN_H ),
68
+    MACROSTR(INDEX_DET_3_5G_DL_IN_L ),
69
+    MACROSTR(INDEX_DET_3_5G_DL_OUT_L),
70
+    MACROSTR(INDEX_DET_3_5G_DL_OUT_H),
71
+    MACROSTR(INDEX_DET_3_5G_UL_IN_H ),
72
+    MACROSTR(INDEX_DET_3_5G_UL_IN_L ),
73
+    MACROSTR(INDEX_DET_3_5G_UL_OUT_H),
74
+    MACROSTR(INDEX_DET_3_5G_UL_OUT_L),
75
+    MACROSTR(INDEX_RFU_TEMP_H       ),
76
+    MACROSTR(INDEX_RFU_TEMP_L       ),
77
+    MACROSTR(INDEX__28V_DET_H       ),
78
+    MACROSTR(INDEX__28V_DET_L       ),
79
+    MACROSTR(INDEX_ALARM_AC         ),
80
+    MACROSTR(INDEX_ALARM_DC         ),
81
+    MACROSTR(INDEX_PATH_EN_1_8G_DL  ),
82
+    MACROSTR(INDEX_PATH_EN_1_8G_UL  ),
83
+    MACROSTR(INDEX_PATH_EN_2_1G_DL  ),
84
+    MACROSTR(INDEX_PATH_EN_2_1G_UL  ),
85
+    MACROSTR(INDEX_PATH_EN_3_5G_L   ),
86
+    MACROSTR(INDEX_PATH_EN_3_5G_H   ),
87
+    MACROSTR(INDEX_PATH_EN_3_5G_DL  ),
88
+    MACROSTR(INDEX_PATH_EN_3_5G_UL  ),
89
+    MACROSTR(INDEX_PLL_ON_OFF_3_5G_H),
90
+    MACROSTR(INDEX_PLL_ON_OFF_3_5G_L),
91
+    MACROSTR(INDEX_T_SYNC_DL        ),
92
+    MACROSTR(INDEX__T_SYNC_DL       ),
93
+    MACROSTR(INDEX_T_SYNC_UL        ),
94
+    MACROSTR(INDEX__T_SYNC_UL       ),   
95
+};
96
+
97
+static void kConstPrinter(Bluecell_Prot_Index k)
98
+{
99
+#ifdef DEBUG_PRINT
100
+    printf("%s", Bluecell_Prot_IndexStr[k]);
101
+#endif /* DEBUG_PRINT */
102
+}
103
+void Path_Init(void){
104
+    Prev_data[INDEX_PATH_EN_1_8G_DL]   = HAL_GPIO_ReadPin(PATH_EN_1_8G_DL_GPIO_Port,PATH_EN_1_8G_DL_Pin);
105
+    Prev_data[INDEX_PATH_EN_1_8G_UL]   = HAL_GPIO_ReadPin(PATH_EN_1_8G_UL_GPIO_Port,PATH_EN_1_8G_UL_Pin);
106
+    Prev_data[INDEX_PATH_EN_2_1G_DL]   = HAL_GPIO_ReadPin(PATH_EN_2_1G_DL_GPIO_Port,PATH_EN_2_1G_DL_Pin);
107
+    Prev_data[INDEX_PATH_EN_2_1G_UL]   = HAL_GPIO_ReadPin(PATH_EN_2_1G_UL_GPIO_Port,PATH_EN_2_1G_UL_Pin);
108
+    Prev_data[INDEX_PATH_EN_3_5G_L]    = HAL_GPIO_ReadPin(PATH_EN_3_5G_L_GPIO_Port,PATH_EN_3_5G_L_Pin);
109
+    Prev_data[INDEX_PATH_EN_3_5G_H]    = HAL_GPIO_ReadPin(PATH_EN_3_5G_H_GPIO_Port,PATH_EN_3_5G_H_Pin);
110
+    Prev_data[INDEX_PATH_EN_3_5G_DL]   = HAL_GPIO_ReadPin(PATH_EN_3_5G_DL_GPIO_Port,PATH_EN_3_5G_DL_Pin);
111
+    Prev_data[INDEX_PATH_EN_3_5G_UL]   = HAL_GPIO_ReadPin(PATH_EN_3_5G_UL_GPIO_Port,PATH_EN_3_5G_UL_Pin);
112
+    Prev_data[INDEX_PLL_ON_OFF_3_5G_H] = HAL_GPIO_ReadPin(PLL_ON_OFF_3_5G_H_GPIO_Port,PLL_ON_OFF_3_5G_H_Pin);
113
+    Prev_data[INDEX_PLL_ON_OFF_3_5G_L] = HAL_GPIO_ReadPin(PLL_ON_OFF_3_5G_L_GPIO_Port,PLL_ON_OFF_3_5G_L_Pin);
114
+}
115
+void Power_ON_OFF_Ctrl(uint8_t type,uint8_t cmd){
116
+//    printf("\r\ntype : %s cmd : %d\r\n",Bluecell_Prot_IndexStr[type - 4],cmd);
117
+    switch(type){
118
+        case INDEX_PATH_EN_1_8G_DL  : 
119
+#if 0 // PYJ.2019.07.29_BEGIN -- 
120
+            printf("\r\n LINE %d\r\n",__LINE__);
121
+#endif // PYJ.2019.07.29_END -- 
122
+            if(cmd)
123
+                HAL_GPIO_WritePin(PATH_EN_1_8G_DL_GPIO_Port,PATH_EN_1_8G_DL_Pin, GPIO_PIN_SET);
124
+            else
125
+                HAL_GPIO_WritePin(PATH_EN_1_8G_DL_GPIO_Port,PATH_EN_1_8G_DL_Pin, GPIO_PIN_RESET);
126
+            break; 
127
+        case INDEX_PATH_EN_1_8G_UL  : 
128
+#if 0 // PYJ.2019.07.29_BEGIN -- 
129
+            printf("\r\n LINE %d\r\n",__LINE__);
130
+#endif // PYJ.2019.07.29_END -- 
131
+            if(cmd)
132
+                HAL_GPIO_WritePin(PATH_EN_1_8G_UL_GPIO_Port,PATH_EN_1_8G_UL_Pin, GPIO_PIN_SET);
133
+            else
134
+                HAL_GPIO_WritePin(PATH_EN_1_8G_UL_GPIO_Port,PATH_EN_1_8G_UL_Pin, GPIO_PIN_RESET);
135
+                
136
+            break;
137
+        case INDEX_PATH_EN_2_1G_DL  : 
138
+#ifdef DEBUG_PRINT
139
+            printf("\r\n LINE %d\r\n",__LINE__);
140
+#endif /* DEBUG_PRINT */
141
+            if(cmd)
142
+                HAL_GPIO_WritePin(PATH_EN_2_1G_DL_GPIO_Port,PATH_EN_2_1G_DL_Pin, GPIO_PIN_SET);
143
+            else
144
+                HAL_GPIO_WritePin(PATH_EN_2_1G_DL_GPIO_Port,PATH_EN_2_1G_DL_Pin, GPIO_PIN_RESET);                
145
+            break;
146
+        case INDEX_PATH_EN_2_1G_UL  : 
147
+#ifdef DEBUG_PRINT
148
+            printf("\r\n LINE %d\r\n",__LINE__);
149
+#endif /* DEBUG_PRINT */
150
+            if(cmd)
151
+                HAL_GPIO_WritePin(PATH_EN_2_1G_UL_GPIO_Port,PATH_EN_2_1G_UL_Pin, GPIO_PIN_SET);
152
+            else
153
+                HAL_GPIO_WritePin(PATH_EN_2_1G_UL_GPIO_Port,PATH_EN_2_1G_UL_Pin, GPIO_PIN_RESET);                
154
+            break;
155
+        case INDEX_PATH_EN_3_5G_L   : 
156
+            if(cmd){
157
+                HAL_GPIO_WritePin(PATH_EN_3_5G_L_GPIO_Port,PATH_EN_3_5G_L_Pin, GPIO_PIN_SET);
158
+//                printf("\r\n LINE %d\r\n",__LINE__);
159
+            }
160
+            else{
161
+                HAL_GPIO_WritePin(PATH_EN_3_5G_L_GPIO_Port,PATH_EN_3_5G_L_Pin, GPIO_PIN_RESET);
162
+//                printf("\r\n LINE %d\r\n",__LINE__);
163
+            }
164
+            break;
165
+        case INDEX_PATH_EN_3_5G_H   : 
166
+            if(cmd){
167
+                HAL_GPIO_WritePin(PATH_EN_3_5G_H_GPIO_Port,PATH_EN_3_5G_H_Pin, GPIO_PIN_SET);
168
+//                            printf("\r\n LINE %d\r\n",__LINE__);
169
+            }
170
+            else{
171
+                HAL_GPIO_WritePin(PATH_EN_3_5G_H_GPIO_Port,PATH_EN_3_5G_H_Pin, GPIO_PIN_RESET);
172
+//                            printf("\r\n LINE %d\r\n",__LINE__);
173
+            }
174
+            break;
175
+        case INDEX_PATH_EN_3_5G_DL  : 
176
+#ifdef DEBUG_PRINT
177
+            printf("\r\n LINE %d\r\n",__LINE__);
178
+#endif /* DEBUG_PRINT */
179
+            if(cmd)
180
+                HAL_GPIO_WritePin(PATH_EN_3_5G_DL_GPIO_Port,PATH_EN_3_5G_DL_Pin, GPIO_PIN_SET);
181
+            else
182
+                HAL_GPIO_WritePin(PATH_EN_3_5G_DL_GPIO_Port,PATH_EN_3_5G_DL_Pin, GPIO_PIN_RESET);
183
+            break;
184
+        case INDEX_PATH_EN_3_5G_UL  : 
185
+#ifdef DEBUG_PRINT
186
+            printf("\r\n LINE %d\r\n",__LINE__);
187
+#endif /* DEBUG_PRINT */
188
+            if(cmd)
189
+                HAL_GPIO_WritePin(PATH_EN_3_5G_UL_GPIO_Port,PATH_EN_3_5G_UL_Pin, GPIO_PIN_SET);
190
+            else
191
+                HAL_GPIO_WritePin(PATH_EN_3_5G_UL_GPIO_Port,PATH_EN_3_5G_UL_Pin, GPIO_PIN_RESET);
192
+            break;
193
+        case INDEX_PLL_ON_OFF_3_5G_H: 
194
+//            printf("\r\n LINE %d\r\n",__LINE__);
195
+            if(cmd)
196
+                HAL_GPIO_WritePin(PLL_ON_OFF_3_5G_H_GPIO_Port,PLL_ON_OFF_3_5G_H_Pin, GPIO_PIN_SET);
197
+            else
198
+                HAL_GPIO_WritePin(PLL_ON_OFF_3_5G_H_GPIO_Port,PLL_ON_OFF_3_5G_H_Pin, GPIO_PIN_RESET);
199
+            break;
200
+        case INDEX_PLL_ON_OFF_3_5G_L: 
201
+//            printf("\r\n LINE %d\r\n",__LINE__);
202
+            if(cmd)
203
+                HAL_GPIO_WritePin(PLL_ON_OFF_3_5G_L_GPIO_Port,PLL_ON_OFF_3_5G_L_Pin, GPIO_PIN_SET);  
204
+            else
205
+                HAL_GPIO_WritePin(PLL_ON_OFF_3_5G_L_GPIO_Port,PLL_ON_OFF_3_5G_L_Pin, GPIO_PIN_RESET);
206
+            break;
207
+        case INDEX_T_SYNC_DL:
208
+        case INDEX__T_SYNC_UL:
209
+        case INDEX_T_SYNC_UL:
210
+        case INDEX__T_SYNC_DL:
211
+            if(cmd){
212
+                HAL_GPIO_WritePin(_T_SYNC_UL_GPIO_Port,_T_SYNC_UL_Pin, GPIO_PIN_RESET);
213
+                HAL_GPIO_WritePin(T_SYNC_UL_GPIO_Port,T_SYNC_UL_Pin, GPIO_PIN_RESET);
214
+                HAL_GPIO_WritePin(_T_SYNC_DL_GPIO_Port,_T_SYNC_DL_Pin, GPIO_PIN_SET);
215
+                HAL_GPIO_WritePin(T_SYNC_DL_GPIO_Port,T_SYNC_DL_Pin, GPIO_PIN_SET);                
216
+            }
217
+            else{
218
+                HAL_GPIO_WritePin(_T_SYNC_UL_GPIO_Port,_T_SYNC_UL_Pin, GPIO_PIN_SET);
219
+                HAL_GPIO_WritePin(T_SYNC_UL_GPIO_Port,T_SYNC_UL_Pin, GPIO_PIN_SET);
220
+                HAL_GPIO_WritePin(_T_SYNC_DL_GPIO_Port,_T_SYNC_DL_Pin, GPIO_PIN_RESET);
221
+                HAL_GPIO_WritePin(T_SYNC_DL_GPIO_Port,T_SYNC_DL_Pin, GPIO_PIN_RESET);                
222
+            }
223
+#ifdef DEBUG_PRINT
224
+            printf("TDD SYNC OPERATE ; %d\r\n",cmd);
225
+#endif /* DEBUG_PRINT */
226
+            break;
227
+        default :
228
+#ifdef DEBUG_PRINT
229
+        printf("Function : %s LINE : %d   ERROR \r\n",__func__,__LINE__);
230
+#endif /* DEBUG_PRINT */
231
+    break;
232
+
233
+    }
234
+}
235
+void ATTEN_PLL_PATH_Initialize(void){
236
+#if 0 // PYJ.2019.07.31_BEGIN -- 
237
+        for(int i = 0; i < INDEX_BLUE_EOF + 1; i++){
238
+            printf("Data = %x\r\n",  Flash_Save_data[i]);
239
+        }
240
+#endif // PYJ.2019.07.31_END -- 
241
+    Flash_Save_data[INDEX_BLUE_CRC]      = STH30_CreateCrc(&Flash_Save_data[Type], Flash_Save_data[Length]);
242
+    RF_Ctrl_Main(&Flash_Save_data[INDEX_BLUE_HEADER]);
243
+    RF_Status_Get();
244
+}
245
+void Power_ON_OFF_Initialize(void){
246
+  /* * * PATH PLL ON OFF SECTION* * */
247
+  HAL_GPIO_WritePin(PATH_EN_3_5G_L_GPIO_Port   ,PATH_EN_3_5G_L_Pin   , GPIO_PIN_RESET);
248
+  HAL_GPIO_WritePin(PATH_EN_3_5G_H_GPIO_Port   ,PATH_EN_3_5G_H_Pin   , GPIO_PIN_RESET);
249
+  HAL_GPIO_WritePin(PATH_EN_3_5G_DL_GPIO_Port  ,PATH_EN_3_5G_DL_Pin  , GPIO_PIN_RESET);
250
+  HAL_GPIO_WritePin(PATH_EN_3_5G_UL_GPIO_Port  ,PATH_EN_3_5G_UL_Pin  , GPIO_PIN_RESET);
251
+  HAL_GPIO_WritePin(PATH_EN_3_5G_L_GPIO_Port   ,PATH_EN_3_5G_L_Pin   , GPIO_PIN_RESET);  
252
+  HAL_GPIO_WritePin(PLL_ON_OFF_3_5G_H_GPIO_Port,PLL_ON_OFF_3_5G_H_Pin, GPIO_PIN_RESET);
253
+  HAL_GPIO_WritePin(PLL_ON_OFF_3_5G_L_GPIO_Port,PLL_ON_OFF_3_5G_L_Pin, GPIO_PIN_RESET);  
254
+  HAL_GPIO_WritePin(PATH_EN_2_1G_DL_GPIO_Port  ,PATH_EN_2_1G_DL_Pin  , GPIO_PIN_RESET);
255
+  HAL_GPIO_WritePin(PATH_EN_2_1G_UL_GPIO_Port  ,PATH_EN_2_1G_UL_Pin  , GPIO_PIN_RESET);
256
+  HAL_GPIO_WritePin(PATH_EN_1_8G_DL_GPIO_Port  ,PATH_EN_1_8G_DL_Pin  , GPIO_PIN_RESET);
257
+  HAL_GPIO_WritePin(PATH_EN_1_8G_UL_GPIO_Port  ,PATH_EN_1_8G_UL_Pin  , GPIO_PIN_RESET);
258
+  /* * * TDD SECTION* * */
259
+  HAL_GPIO_WritePin(_T_SYNC_UL_GPIO_Port,_T_SYNC_UL_Pin, GPIO_PIN_RESET);
260
+  HAL_GPIO_WritePin(T_SYNC_UL_GPIO_Port,T_SYNC_UL_Pin, GPIO_PIN_RESET);
261
+  HAL_GPIO_WritePin(_T_SYNC_DL_GPIO_Port,_T_SYNC_DL_Pin, GPIO_PIN_SET);
262
+  HAL_GPIO_WritePin(T_SYNC_DL_GPIO_Port,T_SYNC_DL_Pin, GPIO_PIN_SET);   
263
+  HAL_Delay(1);
264
+}
265
+
266
+void Error_Message_Occur(PLL_Error mode){
267
+  static uint8_t temp_data[7]; 
268
+  temp_data[INDEX_BLUE_HEADER]       = BLUECELL_HEADER;
269
+  temp_data[INDEX_BLUE_TYPE]         = TYPE_BLUECELL_ERROR;
270
+  temp_data[INDEX_BLUE_LENGTH]       = 4;
271
+  temp_data[INDEX_BLUE_CRCINDEX + 0] = INDEX_BLUE_CRCINDEX + 2;
272
+ 
273
+ 
274
+  switch(mode){
275
+    case DL_1_8:
276
+      temp_data[INDEX_BLUE_CRCINDEX + 1] = DL_1_8;
277
+      break;
278
+    case UL_1_8:
279
+      temp_data[INDEX_BLUE_CRCINDEX + 1] = UL_1_8;
280
+      break;
281
+    case DL_2_1:
282
+      temp_data[INDEX_BLUE_CRCINDEX + 1] = DL_2_1;
283
+      break;
284
+    case UL_2_1:
285
+      temp_data[INDEX_BLUE_CRCINDEX + 1] = UL_2_1;
286
+      break;
287
+  }
288
+  temp_data[INDEX_BLUE_CRCINDEX + 2] = STH30_CreateCrc(&temp_data[Type], temp_data[Length]);
289
+  temp_data[INDEX_BLUE_CRCINDEX + 3] = BLUECELL_TAILER;
290
+  HAL_UART_Transmit_DMA(&huart1,&temp_data[INDEX_BLUE_HEADER],temp_data[INDEX_BLUE_LENGTH]  + 3); 
291
+}
292
+void Pol_Delay_us(volatile uint32_t microseconds)
293
+{
294
+  /* Go to number of cycles for system */
295
+  microseconds *= (SystemCoreClock / 1000000);
296
+ 
297
+  /* Delay till end */
298
+  while (microseconds--);
299
+}
300
+void Boot_LED_Toggle(void){
301
+  if(LedTimerCnt > 500){HAL_GPIO_TogglePin(BOOT_LED_GPIO_Port,GPIO_PIN_14);LedTimerCnt = 0;}
302
+}
303
+void ADC_Check(void){
304
+      if(AdcTimerCnt > 2500){
305
+          for(uint8_t i = 0; i< ADC_EA; i++ ){
306
+          Prev_data[INDEX_DET_1_8G_DL_IN_H + i*2]     = (uint16_t)((ADCvalue[i] & 0xFF00) >> 8);
307
+          Prev_data[INDEX_DET_1_8G_DL_IN_L + i*2]     = (uint16_t)(ADCvalue[i] & 0x00FF);
308
+          AdcTimerCnt = 0;
309
+#if 0 // PYJ.2019.08.09_BEGIN -- 
310
+          printf("Prev_data[%d] : %x",i,Prev_data[INDEX_DET_1_8G_DL_IN_H + i]);
311
+          printf("%x\r\n",i,Prev_data[INDEX_DET_1_8G_DL_IN_L + i]);            
312
+#endif // PYJ.2019.08.09_END -- 
313
+         }
314
+      }
315
+}
316
+void Uart_Check(void){
317
+  while (TerminalQueue.data > 0 && UartRxTimerCnt > 100) GetDataFromUartQueue(&hTerminal);
318
+}
319
+

+ 44 - 0
insight/STM32F103_ATTEN_PLL_Zig.si4project/Backup/includes(8164).h

@@ -0,0 +1,44 @@
1
+/*
2
+ * includes.h
3
+ *
4
+ *  Created on: 2019. 7. 28.
5
+ *      Author: parkyj
6
+ */
7
+
8
+#ifndef INCLUDES_H_
9
+#define INCLUDES_H_
10
+//#include "main.h"
11
+#if 0 // PYJ.2019.07.28_BEGIN -- 
12
+typedef enum{
13
+    TYPE_PATH_EN_1_8G_DL  = 0 , 
14
+    TYPE_PATH_EN_1_8G_UL  ,
15
+    TYPE_PATH_EN_2_1G_DL  ,
16
+    TYPE_PATH_EN_2_1G_UL  ,
17
+    TYPE_PATH_EN_3_5G_L   ,
18
+    TYPE_PATH_EN_3_5G_H   ,
19
+    TYPE_PATH_EN_3_5G_DL  ,
20
+    TYPE_PATH_EN_3_5G_UL  ,
21
+    TYPE_PLL_ON_OFF_3_5G_L,
22
+    TYPE_PLL_ON_OFF_3_5G_H,
23
+}Bluecell_Power_Index;
24
+#endif // PYJ.2019.07.28_END -- 
25
+typedef enum{
26
+  DL_1_8 = 0,
27
+  UL_1_8,
28
+  DL_2_1,
29
+  UL_2_1,
30
+}PLL_Error;
31
+
32
+void Power_ON_OFF_Ctrl(uint8_t type,uint8_t cmd);
33
+void Path_Init(void);
34
+void ATTEN_PLL_PATH_Initialize(void);
35
+char *Bluecell_Prot_IndexStr[];
36
+
37
+void Error_Message_Occur(PLL_Error mode);
38
+void Pol_Delay_us(volatile uint32_t microseconds);
39
+void Boot_LED_Toggle(void);
40
+void ADC_Check(void);
41
+void Uart_Check(void);
42
+
43
+
44
+#endif /* INCLUDES_H_ */

+ 327 - 0
insight/STM32F103_ATTEN_PLL_Zig.si4project/Backup/pll_4113(8086).c

@@ -0,0 +1,327 @@
1
+/**************************************************************************************************
2
+  Filename:       hal_adf4113.c
3
+  Revised:        $Date: 2013-11-17 $
4
+  Revision:       $Revision:  $
5
+  Description:   This file contains the interface to the ADF4113 frequency synthesizer.
6
+**************************************************************************************************/
7
+#include "pll_4113.h"
8
+#include "includes.h"
9
+#include "zig_operate.h"
10
+#include "main.h"
11
+void ADF4113_Module_Ctrl(PLL_Setting_st pll,uint32_t R0,uint32_t R1,uint32_t R2);
12
+
13
+uint32_t N_Counter_Latch_Create(uint16_t _ACOUNTER,uint16_t _BCOUNTER,uint8_t _CPGAIN);
14
+
15
+#define ADF4113_PRESCALE8         0
16
+#define ADF4113_PRESCALE16        1
17
+#define ADF4113_PRESCALE32        2
18
+#define ADF4113_PRESCALE64        3
19
+// ADF4113 Prescale value for minimum required division ratio
20
+#define ADF4113_PRE8_MIN_N        56
21
+#define ADF4113_PRE16_MIN_N       240
22
+#define ADF4113_PRE32_MIN_N       992
23
+#define ADF4113_PRE64_MIN_N       4032
24
+// Frequency Settings
25
+// Initally, the synthesizer will operate at 2450 MHz
26
+#define ADF4113_CH_STEP          50000
27
+#define HAL_SYN_INVALID_PRESCALE  0x04
28
+#define ADF4113_REF_FREQ_MHZ    13000000
29
+
30
+uint8_t PLL_1_8_DL_Error_Cnt = 0;
31
+uint8_t PLL_1_8_UL_Error_Cnt = 0;
32
+uint8_t PLL_2_1_DL_Error_Cnt = 0;
33
+uint8_t PLL_2_1_UL_Error_Cnt = 0;
34
+
35
+
36
+PLL_Setting_st ADF4113_1_8G_DL = {
37
+    PLL_CLK_GPIO_Port,
38
+    PLL_CLK_Pin,
39
+    PLL_DATA_GPIO_Port,
40
+    PLL_DATA_Pin,
41
+    PLL_EN_1_8G_DL_GPIO_Port,    
42
+    PLL_EN_1_8G_DL_Pin,
43
+};
44
+PLL_Setting_st ADF4113_1_8G_UL = {
45
+    PLL_CLK_GPIO_Port,
46
+    PLL_CLK_Pin,
47
+    PLL_DATA_GPIO_Port,
48
+    PLL_DATA_Pin,
49
+    PLL_EN_1_8G_UL_GPIO_Port,    
50
+    PLL_EN_1_8G_UL_Pin,
51
+};
52
+PLL_Setting_st ADF4113_2_1G_DL = {
53
+    PLL_CLK_GPIO_Port,
54
+    PLL_CLK_Pin,
55
+    PLL_DATA_GPIO_Port,
56
+    PLL_DATA_Pin,
57
+    PLL_EN_2_1G_DL_GPIO_Port,    
58
+    PLL_EN_2_1G_DL_Pin,
59
+};
60
+PLL_Setting_st ADF4113_2_1G_UL = {
61
+    PLL_CLK_GPIO_Port,
62
+    PLL_CLK_Pin,
63
+    PLL_DATA_GPIO_Port,
64
+    PLL_DATA_Pin,
65
+    PLL_EN_2_1G_UL_GPIO_Port,    
66
+    PLL_EN_2_1G_UL_Pin,
67
+};
68
+
69
+
70
+
71
+// Error Code
72
+typedef struct{
73
+    uint16_t B;
74
+    uint16_t P;
75
+    uint16_t A;   
76
+    uint16_t N;       
77
+}Adf4113_st;
78
+void ADF4113_Initialize(void){
79
+  if(Flash_Save_data[INDEX_PLL_1_8G_DL_H] == 0 && Flash_Save_data[INDEX_PLL_1_8G_DL_L] == 0){
80
+    Flash_Save_data[INDEX_PLL_1_8G_DL_H] = ((16000 & 0xFF00) >> 8);//0x47;
81
+    Flash_Save_data[INDEX_PLL_1_8G_DL_L] = (16000& 0x00FF);
82
+  }
83
+  if(Flash_Save_data[INDEX_PLL_1_8G_UL_H] == 0 && Flash_Save_data[INDEX_PLL_1_8G_UL_L] == 0){
84
+    Flash_Save_data[INDEX_PLL_1_8G_UL_H] = ((14550 & 0xFF00) >> 8);
85
+    Flash_Save_data[INDEX_PLL_1_8G_UL_L] = (14550 & 0x00FF);
86
+  }
87
+  if(Flash_Save_data[INDEX_PLL_2_1G_DL_H] == 0 && Flash_Save_data[INDEX_PLL_2_1G_DL_L] == 0){
88
+    Flash_Save_data[INDEX_PLL_2_1G_DL_H] = ((19950 & 0xFF00) >> 8);
89
+    Flash_Save_data[INDEX_PLL_2_1G_DL_L] = (19950 & 0x00FF);
90
+  }
91
+  if(Flash_Save_data[INDEX_PLL_2_1G_UL_H] == 0 && Flash_Save_data[INDEX_PLL_2_1G_UL_L] == 0){
92
+    Flash_Save_data[INDEX_PLL_2_1G_UL_H] = ((22950 & 0xFF00) >> 8);
93
+    Flash_Save_data[INDEX_PLL_2_1G_UL_L] = (22950 & 0x00FF);    
94
+  }
95
+//    ADF4113_Module_Ctrl(ADF4113_1_8G_DL,0x000410,0x03E801,0x9F8092);
96
+//    HAL_Delay(1);
97
+//    ADF4113_Module_Ctrl(ADF4113_1_8G_UL,0x000410,0x038D31,0x9f8092);
98
+//    HAL_Delay(1);
99
+//    ADF4113_Module_Ctrl(ADF4113_2_1G_DL,0x410,0x4DE71,0x9F8092);
100
+//    HAL_Delay(1);
101
+//    ADF4113_Module_Ctrl(ADF4113_2_1G_UL,0x000410,0x59A31,0x9f8092);
102
+}
103
+
104
+
105
+void ADF4113_Check(void){
106
+  uint16_t temp_val = 0;
107
+    if(HAL_GPIO_ReadPin(PLL_LD_1_8G_DL_GPIO_Port, PLL_LD_1_8G_DL_Pin) == GPIO_PIN_RESET){
108
+      temp_val = (Prev_data[INDEX_PLL_1_8G_DL_H] << 8) | (Prev_data[INDEX_PLL_1_8G_DL_L]);
109
+//      ADF4113_Module_Ctrl(ADF4113_1_8G_DL,0x000410,halSynSetFreq((temp_val * 1000000) / 10 ),0x9F8092);
110
+            ADF4113_Module_Ctrl(ADF4113_1_8G_DL,0x000410,0x03E801,0x9F8092);
111
+      if(PLL_1_8_DL_Error_Cnt == 3){
112
+        Error_Message_Occur(DL_1_8);
113
+      }
114
+      if(PLL_1_8_DL_Error_Cnt < 4)
115
+        PLL_1_8_DL_Error_Cnt++;    
116
+      HAL_Delay(1);
117
+    }else{
118
+      PLL_1_8_DL_Error_Cnt = 0;
119
+    }
120
+
121
+    
122
+    if(HAL_GPIO_ReadPin(PLL_LD_1_8G_UL_GPIO_Port, PLL_LD_1_8G_UL_Pin) == GPIO_PIN_RESET){
123
+      temp_val = (Prev_data[INDEX_PLL_1_8G_UL_H] << 8) | (Prev_data[INDEX_PLL_1_8G_UL_L]);
124
+      ADF4113_Module_Ctrl(ADF4113_1_8G_UL,0x000410,halSynSetFreq((temp_val * 1000000) / 10 ),0x9F8092);
125
+    //      ADF4113_Module_Ctrl(ADF4113_1_8G_UL,0x000410,0x038D31,0x9f8092);
126
+      if(PLL_1_8_UL_Error_Cnt == 3){
127
+        Error_Message_Occur(UL_1_8);
128
+      }
129
+      if(PLL_1_8_UL_Error_Cnt < 4)
130
+        PLL_1_8_UL_Error_Cnt++;
131
+      HAL_Delay(1);
132
+    }else{
133
+      PLL_1_8_UL_Error_Cnt = 0;
134
+    }
135
+    if(HAL_GPIO_ReadPin(PLL_LD_2_1G_DL_GPIO_Port, PLL_LD_2_1G_DL_Pin) == GPIO_PIN_RESET){
136
+      temp_val = (Prev_data[INDEX_PLL_2_1G_DL_H] << 8) | (Prev_data[INDEX_PLL_2_1G_DL_L]);
137
+//      ADF4113_Module_Ctrl(ADF4113_2_1G_DL,0x000410,halSynSetFreq((temp_val * 1000000) / 10 ),0x9F8092);
138
+          ADF4113_Module_Ctrl(ADF4113_2_1G_DL,0x410,0x4DE71,0x9F8092);
139
+      if(PLL_2_1_DL_Error_Cnt == 3){
140
+        Error_Message_Occur(DL_2_1);
141
+      }
142
+      
143
+      if(PLL_2_1_DL_Error_Cnt < 4)
144
+        PLL_2_1_DL_Error_Cnt++;
145
+      HAL_Delay(1);
146
+    }else{
147
+      PLL_2_1_DL_Error_Cnt = 0;
148
+    }
149
+
150
+    
151
+    if(HAL_GPIO_ReadPin(PLL_LD_2_1G_UL_GPIO_Port, PLL_LD_2_1G_UL_Pin) == GPIO_PIN_RESET){
152
+      temp_val = (Prev_data[INDEX_PLL_2_1G_UL_H] << 8) | (Prev_data[INDEX_PLL_2_1G_UL_L]);
153
+//      ADF4113_Module_Ctrl(ADF4113_2_1G_UL,0x000410,halSynSetFreq((temp_val * 1000000) / 10 ),0x9F8092);
154
+          ADF4113_Module_Ctrl(ADF4113_2_1G_UL,0x000410,0x59A31,0x9f8092);
155
+      if(PLL_2_1_UL_Error_Cnt == 3){
156
+        Error_Message_Occur(UL_2_1);
157
+      }
158
+      if(PLL_2_1_UL_Error_Cnt < 4)
159
+        PLL_2_1_UL_Error_Cnt++;
160
+      HAL_Delay(1);
161
+    }else{
162
+      PLL_2_1_UL_Error_Cnt = 0;
163
+    }
164
+}
165
+
166
+
167
+uint32_t halSynSetFreq(uint32_t rf_Freq)
168
+{
169
+    uint32_t  R, B;
170
+    uint32_t  A, P, p_mode;
171
+    uint32_t  N_val = 0;
172
+    N_val = (rf_Freq / ADF4113_CH_STEP);
173
+    if( N_val < ADF4113_PRE8_MIN_N) { 
174
+        return HAL_SYN_INVALID_PRESCALE; 
175
+    } else if(( N_val> ADF4113_PRE8_MIN_N) && (N_val < ADF4113_PRE16_MIN_N)) { 
176
+        P = 8;  
177
+        p_mode = ADF4113_PRESCALE8;
178
+    } else if(( N_val > ADF4113_PRE16_MIN_N) && (N_val < ADF4113_PRE32_MIN_N)) { 
179
+        P = 16;
180
+        p_mode = ADF4113_PRESCALE16;
181
+        
182
+    } else if((N_val > ADF4113_PRE32_MIN_N) && ( N_val < ADF4113_PRE64_MIN_N)) { 
183
+        P = 32;
184
+        p_mode = ADF4113_PRESCALE32;
185
+        
186
+    } else if( N_val > ADF4113_PRE64_MIN_N) { 
187
+        P = 64; 
188
+        p_mode = ADF4113_PRESCALE64;
189
+    }
190
+    P = 32;
191
+    B = N_val / P;
192
+    A = N_val -(B * P);
193
+//    printf("FREQ:%f Mhz  B : %d , A  : %d    N_VAL  : %d \r\n",(float)(rf_Freq/1000000),B,A,N_val);
194
+//    printf("YJ 4113 : %x \r\n",N_Counter_Latch_Create(A,B,0));
195
+  return N_Counter_Latch_Create(A,B,0);
196
+}
197
+uint32_t N_Counter_Latch_Create(uint16_t _ACOUNTER,uint16_t _BCOUNTER,uint8_t _CPGAIN){
198
+    uint32_t ret = 0;
199
+    uint32_t shift_bit = 0x01;
200
+    uint8_t control_bit = 1;
201
+    uint8_t i = 0;
202
+    uint8_t reserve = 0;
203
+//    printf("_ACOUNTER : %d _BCOUNTER : %d \r\n",_ACOUNTER,_BCOUNTER);
204
+//    printf("\r\nLINE : %d  ret : %x\r\n",__LINE__,ret);
205
+    for(i = 0; i < 2; i++){
206
+        if(control_bit & 0x01)
207
+            ret += shift_bit << i;
208
+        control_bit = control_bit >> 1;
209
+    }
210
+#ifdef DEBUG_PRINT
211
+    printf("\r\nLINE : %d  ret : %x\r\n",__LINE__,ret);
212
+#endif /* DEBUG_PRINT */
213
+    for(i = 2; i < 8; i++){
214
+        if(_ACOUNTER & 0x01)
215
+            ret += shift_bit << i;
216
+        _ACOUNTER = _ACOUNTER >> 1;
217
+    }  
218
+#ifdef DEBUG_PRINT
219
+    printf("\r\nLINE : %d  ret : %x\r\n",__LINE__,ret);
220
+#endif /* DEBUG_PRINT */
221
+    for(i = 8; i < 21; i++){
222
+        if(_BCOUNTER & 0x01)
223
+            ret += shift_bit << i;
224
+        _BCOUNTER = _BCOUNTER >> 1;
225
+    }      
226
+#ifdef DEBUG_PRINT
227
+    printf("\r\nLINE : %d  ret : %x\r\n",__LINE__,ret);
228
+#endif /* DEBUG_PRINT */
229
+    if(_CPGAIN & 0x01)
230
+            ret += shift_bit << i++;
231
+    for(i = 22; i < 24; i++){
232
+        if(reserve & 0x01)
233
+            ret += shift_bit << i;
234
+        reserve = reserve >> 1;
235
+    }   
236
+#ifdef DEBUG_PRINT
237
+    printf("\r\nLINE : %d  ret : %x\r\n",__LINE__,ret);
238
+#endif /* DEBUG_PRINT */
239
+    return ret;
240
+}
241
+void ADF4113_Module_Ctrl(PLL_Setting_st pll,uint32_t R0,uint32_t R1,uint32_t R2){
242
+    R2 = R2 & 0xFFFFFF;
243
+    R1 = R1 & 0xFFFFFF;
244
+    R0 = R0 & 0xFFFFFF;
245
+    
246
+    HAL_GPIO_WritePin(pll.PLL_CLK_PORT, pll.PLL_CLK_PIN, GPIO_PIN_RESET);
247
+    HAL_GPIO_WritePin(pll.PLL_DATA_PORT, pll.PLL_DATA_PIN, GPIO_PIN_RESET);
248
+    HAL_GPIO_WritePin(pll.PLL_ENABLE_PORT, pll.PLL_ENABLE_PIN, GPIO_PIN_RESET);
249
+    /*   R2 Ctrl    */
250
+     for(int i =0; i < 24; i++){
251
+         if(R2 & 0x800000){
252
+#if 0 // PYJ.2019.08.11_BEGIN -- 
253
+            printf("1");
254
+#endif // PYJ.2019.08.11_END -- 
255
+             HAL_GPIO_WritePin(pll.PLL_DATA_PORT, pll.PLL_DATA_PIN, GPIO_PIN_SET);
256
+         }
257
+         else{
258
+#if 0 // PYJ.2019.08.11_BEGIN -- 
259
+            printf("0");
260
+#endif // PYJ.2019.08.11_END -- 
261
+             HAL_GPIO_WritePin(pll.PLL_DATA_PORT, pll.PLL_DATA_PIN, GPIO_PIN_RESET);
262
+         }
263
+          HAL_GPIO_WritePin(pll.PLL_CLK_PORT, pll.PLL_CLK_PIN, GPIO_PIN_SET);
264
+         Pol_Delay_us(10);
265
+          HAL_GPIO_WritePin(pll.PLL_CLK_PORT, pll.PLL_CLK_PIN, GPIO_PIN_RESET);
266
+         R2 = ((R2 << 1) & 0xFFFFFF);
267
+     }
268
+#if 0 // PYJ.2019.08.11_BEGIN -- 
269
+     printf("\r\n");
270
+#endif // PYJ.2019.08.11_END -- 
271
+     HAL_GPIO_WritePin(pll.PLL_ENABLE_PORT, pll.PLL_ENABLE_PIN, GPIO_PIN_SET);
272
+     Pol_Delay_us(10);
273
+     HAL_GPIO_WritePin(pll.PLL_ENABLE_PORT, pll.PLL_ENABLE_PIN, GPIO_PIN_RESET);
274
+        /*   R0 Ctrl    */
275
+   
276
+    for(int i =0; i < 24; i++){
277
+        if(R0 & 0x800000){
278
+            HAL_GPIO_WritePin(pll.PLL_DATA_PORT, pll.PLL_DATA_PIN, GPIO_PIN_SET);
279
+#if 0 // PYJ.2019.08.11_BEGIN -- 
280
+            printf("1");
281
+#endif // PYJ.2019.08.11_END -- 
282
+        }
283
+        else{
284
+            HAL_GPIO_WritePin(pll.PLL_DATA_PORT, pll.PLL_DATA_PIN, GPIO_PIN_RESET);
285
+#if 0 // PYJ.2019.08.11_BEGIN -- 
286
+            printf("0");
287
+#endif // PYJ.2019.08.11_END -- 
288
+        }
289
+         HAL_GPIO_WritePin(pll.PLL_CLK_PORT, pll.PLL_CLK_PIN, GPIO_PIN_SET);
290
+        Pol_Delay_us(10);
291
+         HAL_GPIO_WritePin(pll.PLL_CLK_PORT, pll.PLL_CLK_PIN, GPIO_PIN_RESET);
292
+        R0 = ((R0 << 1) & 0xFFFFFF);
293
+    }  
294
+#if 0 // PYJ.2019.08.11_BEGIN -- 
295
+        printf("\r\n");
296
+#endif // PYJ.2019.08.11_END -- 
297
+     HAL_GPIO_WritePin(pll.PLL_ENABLE_PORT, pll.PLL_ENABLE_PIN, GPIO_PIN_SET);
298
+     
299
+     Pol_Delay_us(10);
300
+     HAL_GPIO_WritePin(pll.PLL_ENABLE_PORT, pll.PLL_ENABLE_PIN, GPIO_PIN_RESET);    
301
+     /*   R1 Ctrl    */
302
+    for(int i =0; i < 24; i++){
303
+        if(R1 & 0x800000){
304
+#if 0 // PYJ.2019.08.11_BEGIN -- 
305
+            printf("1");
306
+#endif // PYJ.2019.08.11_END -- 
307
+            HAL_GPIO_WritePin(pll.PLL_DATA_PORT, pll.PLL_DATA_PIN, GPIO_PIN_SET);
308
+        }
309
+        else{
310
+#if 0 // PYJ.2019.08.11_BEGIN -- 
311
+            printf("0");            
312
+#endif // PYJ.2019.08.11_END -- 
313
+            HAL_GPIO_WritePin(pll.PLL_DATA_PORT, pll.PLL_DATA_PIN, GPIO_PIN_RESET);
314
+        }
315
+         HAL_GPIO_WritePin(pll.PLL_CLK_PORT, pll.PLL_CLK_PIN, GPIO_PIN_SET);
316
+        Pol_Delay_us(10);
317
+         HAL_GPIO_WritePin(pll.PLL_CLK_PORT, pll.PLL_CLK_PIN, GPIO_PIN_RESET);
318
+        R1 = ((R1 << 1) & 0xFFFFFF);
319
+    }
320
+#if 0 // PYJ.2019.08.11_BEGIN -- 
321
+        printf("\r\n");
322
+#endif // PYJ.2019.08.11_END -- 
323
+    HAL_GPIO_WritePin(pll.PLL_ENABLE_PORT, pll.PLL_ENABLE_PIN, GPIO_PIN_SET);
324
+    Pol_Delay_us(10);
325
+    HAL_GPIO_WritePin(pll.PLL_ENABLE_PORT, pll.PLL_ENABLE_PIN, GPIO_PIN_RESET);
326
+
327
+}

BIN
insight/STM32F103_ATTEN_PLL_Zig.si4project/STM32F103_ATTEN_PLL_Zig.sip_sym


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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


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