/* * Bluecell_operate.h * * Created on: 2020. 4. 3. * Author: YJ */ #ifndef BLUECELL_OPERATE_H_ #define BLUECELL_OPERATE_H_ #include #include "Bluecell_operate.h" /* SYN Sub-UID R-Code TR-ID Seq-Num TTL Time ¿À·ù ÀÀ´ä CMD Length Header Checksum SUB-DATA SUB-DATA-CRC ETX */ /* * 0 80 Àüü »óÅ Á¶È¸ ¸ðµç AID Ç׸ñ¿¡ ´ëÇÑ »óÅ ¿äû ¹× ÀÀ´ä (¿äû FrameÀÇ SUB-DATA ´Â ±æÀÌ´Â 0) 1 81 Á¦¾î ¿äû Á¦¾î ¿äûÀÇ REQ´Â 0x01 À̰í ÀÀ´äÀº Àüü µ¥ÀÌÅÍ »óŸ¦ ÀÀ´ä 10 90 Download Notification ´Ù¿î·Îµå ÅëÁö 11 91 Download Data ´Ù¿î·Îµå data 12 92 Download Confirm ´Ù¿î·Îµå È®ÀÎ 13 93 Download Complete Download Complete Command 14 94 System-Reboot System Rebooting Command 40 C0 Å×À̺í Á¶È¸ ¹× ÀÀ´ä 41 C1 Å×ÀÌºí ¼³Á¤ ¹× ÀÀ´ä * * */ typedef enum{ AllDataReq = 0, // -> Response 80 DataCtrlReq, // -> Response 81 DownNotification, // -> Response 90 DownData, // -> Response 91 DownConfirm , // -> Response 92 DownComplete, // -> Response 93 SystemReboot, // -> Response 94 TableDataReq = 40, }; typedef enum{ MBIC_PREAMBLE_0 = 0, MBIC_PREAMBLE_1, MBIC_PREAMBLE_2, MBIC_PREAMBLE_3, MBIC_SUBUID_0, MBIC_SUBUID_1, MBIC_RCODE_0, MBIC_TRID_0, MBIC_TRID_1, MBIC_SEQSUM_0, // 10byte MBIC_TTL_0, MBIC_TIME_0, MBIC_TIME_1, MBIC_TIME_2, MBIC_TIME_3, MBIC_TIME_4, MBIC_TIME_5, MBIC_ERRRESPONSE_0, MBIC_CMD_0, MBIC_LENGTH_0, // 20byte MBIC_LENGTH_1, MBIC_HEADERCHECKSUM_0, MBIC_PAYLOADSTART, /* * PayLoadSTART */ }; typedef enum{ Alarm_Bit_List = 0xE000, Alarm_Mask, Alarm_Test_Mode, Alarm_Test_Dummy, CPU_Version, ModuleINFORMATION_null1, CPU_Current_Bank, CPU_Bank_Select_Reboot_by, CPU_Bank1_Image_Version, CPU_Bank1_Image_BuildTime, CPU_Bank1_Image_Name, CPU_Bank2_Image_Version, CPU_Bank2_Image_BuildTime, CPU_Bank2_Image_Name, SW_Reset, Factory_Set_Initialization, }ModuleINFORMATION; typedef enum{ Temperature = 0xE010, Temperature_Offset, Temp_High_Threshold, Temp_High_Threshold_Default, Temp_High_Alarm, LED_TEST, Node, Type, PCB_Version, Serial_Number, Manufacture, Manufacture_Date, ENVIRONMENT_INVENTORY_null1, Freq_ID, Carrier_ID, Carrier_ON_OFF, }ENVIRONMENT_INVENTORY; typedef enum{ DLI_P1_Level= 0xE020, DLI_P2_Level, DLI_P3_Level, DLI_P4_Level, ULO_P1_Level, ULO_P2_Level, ULO_P3_Level, ULO_P4_Level, }Current_Volt; typedef enum{ DLI_RF_Path1_ON_OFF= 0xE030, DLI_RF_Path2_ON_OFF, DLI_RF_Path3_ON_OFF, DLI_RF_Path4_ON_OFF, DLI_Gain_Atten1, DLI_Gain_Atten2, DLI_Gain_Atten3, DLI_Gain_Atten4, DLI_Gain_Atten_Offset1, DLI_Gain_Atten_Offset2, DLI_Gain_Atten_Offset3, DLI_Gain_Atten_Offset4, DLI_Level_High_Threshold, DLI_Level_Low_Threshold, DLI_Level_High_Low_Threshold_default, DLI_Level, }DL_Ctrl1; typedef enum{ DLI_Level_High_Alarm1= 0xE040, DLI_Level_High_Alarm2, DLI_Level_High_Alarm3, DLI_Level_High_Alarm4, DLI_Level_Low_Alarm1, DLI_Level_Low_Alarm2, DLI_Level_Low_Alarm3, DLI_Level_Low_Alarm4, }DL_Ctrl2; typedef enum{ DLI_AGC_ON_OFF= 0xE050, DLI_AGC_Threshold, DLI_AGC_Threshold_Default, DLI_Shutdown_ON_OFF, DLI_Shutdown_Threshold, DLI_Shutdown_Threshold_Default, DLI_Shutdown_Count, DLI_AGC_Alarm1, DLI_AGC_Alarm2, DLI_AGC_Alarm3, DLI_AGC_Alarm4, DLI_Shutdown_Alarm1, DLI_Shutdown_Alarm2, DLI_Shutdown_Alarm3, DLI_Shutdown_Alarm4, }DL_Ctrl3; typedef enum{ ULO_RF_Path1_ON_OFF= 0xE060, ULO_RF_Path2_ON_OFF, ULO_RF_Path3_ON_OFF, ULO_RF_Path4_ON_OFF, ULO_Gain_Atten1, ULO_Gain_Atten2, ULO_Gain_Atten3, ULO_Gain_Atten4, ULO_Gain_Atten_Offset1, ULO_Gain_Atten_Offset2, ULO_Gain_Atten_Offset3, ULO_Gain_Atten_Offset4, ULO_Level_High_Threshold, UL_Ctrl1_null1, ULO_Level_High_Threshold_default, ULO_Level, }UL_Ctrl1; typedef enum{ ULO_Level_High_Alarm1= 0xE070, ULO_Level_High_Alarm2, ULO_Level_High_Alarm3, ULO_Level_High_Alarm4, }UL_Ctrl2; typedef enum{ ULO_ALC_ON_OFF= 0xE080, ULO_ALC_Threshold, ULO_ALC_Threshold_Default, ULO_Shutdown_ON_OFF, ULO_Shutdown_Threshold, ULO_Shutdown_Threshold_Default, ULO_Shutdown_Retry_Count, ULO_ALC_Alarm1, ULO_ALC_Alarm2, ULO_ALC_Alarm3, ULO_ALC_Alarm4, ULO_Shutdown_Alarm1, ULO_Shutdown_Alarm2, ULO_Shutdown_Alarm3, ULO_Shutdown_Alarm4, }UL_Ctrl3; #define MBIC_PREAMBLE0 0x16 #define MBIC_PREAMBLE1 0x16 #define MBIC_PREAMBLE2 0x16 #define MBIC_PREAMBLE3 0x16 #define MBIC_SUBUID0 0x00 #define MBIC_SUBUID1 0xF1 #define MBIC_RCODE #define MBIC_TRID #define MBIC_SEQNUM #define MBIC_TTL #define MBIC_TIME #define MBIC_ERRRESPONSE #define MBIC_CMD #define MBIC_LENGTH #define MBIC_CHECKSHUM #define MBIC_ETX 0x03 /* * * * ALARM LIST * */ struct Alarm_ENVIRONMENT { uint8_t ENVIRONMENT_Temp_High ; uint8_t ENVIRONMENT_Reserved0 ; uint8_t ENVIRONMENT_Reserved1 ; uint8_t ENVIRONMENT_Reserved2 ; uint8_t ENVIRONMENT_Reserved3 ; uint8_t ENVIRONMENT_Reserved4 ; uint8_t ENVIRONMENT_Reserved5 ; uint8_t ENVIRONMENT_Reserved6 ; }; struct Alarm_DL { uint8_t DLI_P4_Level_Low ; uint8_t DLI_P3_Level_Low ; uint8_t DLI_P2_Level_Low ; uint8_t DLI_P1_Level_Low ; uint8_t ULO_P4_Level_High ; uint8_t ULO_P3_Level_High ; uint8_t ULO_P2_Level_High ; uint8_t ULO_P1_Level_High ; uint8_t DLI_P4_AGC_Alarm ; uint8_t DLI_P3_AGC_Alarm ; uint8_t DLI_P2_AGC_Alarm ; uint8_t DLI_P1_AGC_Alarm ; uint8_t DLI_P4_Shutdown_Alarm ; uint8_t DLI_P3_Shutdown_Alarm ; uint8_t DLI_P2_Shutdown_Alarm ; uint8_t DLI_P1_Shutdown_Alarm ; }; struct Alarm_UL { uint8_t Reserved0 ; uint8_t Reserved1 ; uint8_t Reserved2 ; uint8_t Reserved3 ; uint8_t ULO_P4_Level_High ; uint8_t ULO_P3_Level_High ; uint8_t ULO_P2_Level_High ; uint8_t ULO_P1_Level_High ; uint8_t ULO_P4_ALC_Alarm ; uint8_t ULO_P3_ALC_Alarm ; uint8_t ULO_P2_ALC_Alarm ; uint8_t ULO_P1_ALC_Alarm ; uint8_t ULO_P4_Shutdown ; uint8_t ULO_P3_Shutdown ; uint8_t ULO_P2_Shutdown ; uint8_t ULO_P1_Shutdown ; }; #define ALARM_ENVIRONMENT_FLAG 0x80 #define ALARM_DL1_FLAG 0xFF #define ALARM_DL2_FLAG 0xFF #define ALARM_UL1_FLAG 0x0F #define ALARM_UL2_FLAG 0xFF typedef enum{ ENVIRONMENT = 0, DL1, DL2, UL1, UL2, MAX_ALARM_Len, }AlarmList; #endif /* BLUECELL_OPERATE_H_ */