123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330 |
- /*
- * Bluecell_operate.h
- *
- * Created on: 2020. 4. 3.
- * Author: YJ
- */
- #ifndef BLUECELL_OPERATE_H_
- #define BLUECELL_OPERATE_H_
- #include <stdbool.h>
- #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_ */
|