-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpacket_definitions.h
153 lines (115 loc) · 3.16 KB
/
packet_definitions.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
/**
* @file : packet_definitions.h
* @author : Srinidhi G, Pratik Aher
* @brief : This file contains the definitions of all the packet types used
* @version : 1.0
* @date : 2023-01-24
*
* @copyright Copyright (c) 2023
*
*/
#ifndef _PACKET_DEFINITIONS_
#define _PACKET_DEFINITIONS_
#define THERMISTOR_API_ID 20
#define THERMISTOR_PKT_LENGTH sizeof(thermistor_pkt_t)
#define THERMISTOR_FLETCHER_CODE 0xCDCD
#define ARIS_API_ID 50
#define ARIS_PKT_LENGTH sizeof(aris_pkt_t)
#define ARIS_FLETCHER_CODE 0x01
#define LOGS_API_ID 30
#define LOGS_PKT_LENGTH sizeof(log_packet_t)
#define LOGS_FLETCHER_CODE 0x00
#define HK_API_ID 10
#define HK_PKT_LENGTH sizeof(hk_pkt_t)
#define HK_FLETCHER_CODE 0xCDCD
#define SD_HK_API_ID 40
#define SD_HK_PKT_LENGTH sizeof(SD_HK_pkt_t)
#define SD_HK_FLETCHER_CODE 0xCDCD
typedef struct {
//CCSDS
uint16_t ccsds_p1;
uint16_t ccsds_p2;
uint16_t ccsds_p3;
uint32_t ccsds_s1;
uint16_t ccsds_s2;
uint16_t collection_time;
uint16_t collection_location;
uint16_t thermistor_set_A[8];
uint16_t thermistor_set_B[8];
uint16_t thermistor_set_C[8];
uint16_t Fletcher_Code;
}__attribute__((packed)) thermistor_pkt_t;
typedef struct {
uint32_t collect_time;
uint16_t aris_data[3];
}__attribute__((packed)) aris_sample_t;
typedef struct{
uint16_t ccsds_p1;
uint16_t ccsds_p2;
uint16_t ccsds_p3;
uint32_t ccsds_s1;
uint16_t ccsds_s2;
uint32_t start_time;
aris_sample_t aris_samples[20];
uint16_t Fletcher_Code;
}__attribute__((packed)) aris_pkt_t;
typedef struct {
//CCSDS
uint16_t ccsds_p1;
uint16_t ccsds_p2;
uint16_t ccsds_p3;
uint32_t ccsds_s1;
uint16_t ccsds_s2;
uint16_t q_head;
uint16_t q_tail;
uint8_t CDH_Periph_Status; //For all the 8 flags
uint16_t Acc[3]; // X,Y,Z Axis
uint16_t Angular_Rate[3]; //Pitch, Roll, Yaw
uint16_t Sensor_Board_VC[2];
uint16_t CDH_VC[2];
uint16_t Comms_VC[2];
uint32_t HK_Read_Pointer;
uint32_t HK_Write_Pointer;
uint32_t Thermistor_Read_Pointer;
uint32_t Thermistor_Write_Pointer;
uint32_t Logs_Read_Pointer;
uint32_t Logs_Write_Pointer;
uint32_t SD_Test_Read_Pointer;
uint32_t SD_Test_Write_Pointer;
uint32_t ARIS_Read_Pointer;
uint32_t ARIS_Write_Pointer;
//
uint16_t Fletcher_Code;
}__attribute__((packed)) hk_pkt_t;
/**
* @brief Each log entry has the below four fields for every task that occurs
*
*/
typedef struct {
uint32_t time_L;//lower time value
uint32_t time_H;//upper time value
uint8_t task_id;//task id
uint8_t task_status;//task status;
}__attribute__((packed)) log_entry_t;
typedef struct {
//CCSDS
uint16_t ccsds_p1;
uint16_t ccsds_p2;
uint16_t ccsds_p3;
uint32_t ccsds_s1;
uint16_t ccsds_s2;
log_entry_t logs[10];
uint16_t Fletcher_Code;
}__attribute__((packed)) log_packet_t;
typedef struct {
//CCSDS
uint16_t ccsds_p1;
uint16_t ccsds_p2;
uint16_t ccsds_p3;
uint32_t ccsds_s1;
uint16_t ccsds_s2;
uint16_t SD_Test_count[5];
uint16_t SD_Test_time[5];
uint16_t Fletcher_Code;
}__attribute__((packed)) SD_HK_Test;
#endif