-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcc112x_regs.h
238 lines (211 loc) · 4.19 KB
/
cc112x_regs.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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
/*
* cc112x_regs.h
*
* Created on: 13 maj 2020
* Author: kurzawa.p
*/
#ifndef CC112X_REGS_H
#define CC112X_REGS_H
#ifdef __cplusplus
extern "C"
{
#endif
/*********************
* INCLUDES
*********************/
#include "cc112x_enums.h"
/*********************
* DEFINES
*********************/
/**********************
* TYPEDEFS
**********************/
typedef union __attribute__((__packed__, aligned(1)))
{
struct
{
uint8_t srate_m_7_0;
uint8_t srate_m_15_8;
uint8_t srate_m_19_16 :4;
};
uint32_t srate_m;
}srate_m_t;
typedef union __attribute__((__packed__, aligned(1)))
{
struct
{
uint8_t srate_e :4;
uint8_t srate_m_19_16 :4;
};
uint8_t reg;
}symbol_rate2_t;
typedef union __attribute__((__packed__, aligned(1)))
{
struct
{
uint8_t reserve_3_0 :3;
state_t state :3;
uint8_t chip_rdy :1;
};
uint8_t reg;
}chip_status_t;
typedef union __attribute__((__packed__, aligned(1)))
{
struct
{
uint8_t iqic_imgch_level_thr :2;
uint8_t iqic_blen :2;
uint8_t iqic_blen_settle :2;
uint8_t iqic_update_coeff_en :1;
uint8_t iqic_en :1;
};
uint8_t reg;
}iqic_t;
typedef union __attribute__((__packed__, aligned(1)))
{
struct
{
uint8_t bb_cic_decfact :6;
uint8_t adc_cic_decfact :1;
uint8_t chfilt_bypass :1;
};
uint8_t reg;
}chan_bw_t;
typedef union __attribute__((__packed__, aligned(1)))
{
struct
{
uint8_t rssi_valid :1;
uint8_t carrier_sense_valid :1;
uint8_t carrier_sense :1;
uint8_t rssi_3_0 :4;
uint8_t rssi0_not_used :1;
};
uint8_t reg;
}rssi0_t;
typedef union __attribute__((__packed__, aligned(1)))
{
struct
{
marcstate_e marc_state :5;
uint8_t marc_2pin_state :2;
uint8_t marcstate_not_used :1;
};
uint8_t reg;
}marcstate_t;
typedef union __attribute__((__packed__, aligned(1)))
{
struct
{
uint8_t mdmcfg0_reserved_1_0 :2;
uint8_t viterbi_en : 1;
uint8_t data_filter_en : 1;
transparent_infact_t transparent_intfact : 2;
uint8_t transparent_mode_en : 1;
uint8_t mdmcfg0_not_used : 1;
};
uint8_t reg;
}mdmcfg0_t;
typedef union __attribute__((__packed__, aligned(1)))
{
struct
{
uint8_t agc_settle_wait : 2;
uint8_t agc_win_size : 3;
uint8_t agc_sync_behaviour : 3;
};
uint8_t reg;
}agc_cfg1_t;
typedef union __attribute__((__packed__, aligned(1)))
{
struct
{
uint8_t agc_ask_decay : 2;
uint8_t rssi_valid_cnt : 2;
uint8_t agc_slewrate_limit : 2;
uint8_t agc_hyst_level : 2;
};
uint8_t reg;
}agc_cfg0_t;
typedef union __attribute__((__packed__, aligned(1)))
{
struct __attribute__((__packed__, aligned(1)))
{
gpiox_cfg_t gpiox_cfg :6;
uint8_t gpiox_inv :1;
uint8_t gpiox_atran :1;
};
uint8_t reg;
}iocfgx_t;
typedef union __attribute__((__packed__, aligned(1)))
{
struct __attribute__((__packed__, aligned(1)))
{
uint8_t dev_e :3;
mod_format_t mod_format :3;
uint8_t modem_mode :2;
};
uint8_t reg;
}modcfg_dev_e_t;
typedef union __attribute__((__packed__, aligned(1)))
{
struct __attribute__((__packed__, aligned(1)))
{
uint8_t pa_power_ramp :6;
uint8_t pa_cfg_reserved6 :1;
uint8_t pa_cfg2_not_used :1;
};
uint8_t reg;
}pa_cfg2_t;
typedef union __attribute__((__packed__, aligned(1)))
{
struct __attribute__((__packed__, aligned(1)))
{
uint8_t ramp_shape :2;
uint8_t second_ipl :3;
uint8_t first_ipl :3;
};
uint8_t reg;
}pa_cfg1_t;
typedef union __attribute__((__packed__, aligned(1)))
{
struct __attribute__((__packed__, aligned(1)))
{
uint8_t upsampler_p :3;
uint8_t ask_depth :4;
uint8_t pa_cfg0_not_used :1;
};
uint8_t reg;
}pa_cfg0_t;
typedef union __attribute__((__packed__, aligned(1)))
{
struct __attribute__((__packed__, aligned(1)))
{
uint8_t cfm_data_en :1;
uint8_t cfm_data_reserved4_1 :4;
uint8_t symbol_map_cfg :2;
uint8_t cfm_data_cfg_not_used :1;
};
uint8_t reg;
}cfm_data_cfg_t;
typedef union __attribute__((__packed__, aligned(1)))
{
struct __attribute__((__packed__, aligned(1)))
{
uint8_t pkt_format :2;
uint8_t cca_mode :3;
uint8_t pkt_cfg2_reserved5 :1;
uint8_t pkt_cfg2_not_used :2;
};
uint8_t reg;
}pkt_cfg2_t;
/**********************
* GLOBAL PROTOTYPES
**********************/
/**********************
* MACROS
**********************/
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* CC112X_REGS_H */