| | 240 | |
|---|
| | 241 | |
|---|
| | 242 | /* |
|---|
| | 243 | * Configure the receiver. |
|---|
| | 244 | */ |
|---|
| | 245 | typedef struct { |
|---|
| | 246 | uint8_t opcode; |
|---|
| | 247 | uint8_t len; |
|---|
| | 248 | uint16_t rid_mbz; |
|---|
| | 249 | // bitmask indicating which of the following fields are valid |
|---|
| | 250 | uint16_t valid; |
|---|
| | 251 | uint16_t gain; // fxpt_db (Q9.7) |
|---|
| | 252 | uint32_t target_freq_hi; // high 32-bits of 64-bit fxpt_freq (Q44.20) |
|---|
| | 253 | uint32_t target_freq_lo; // low 32-bits of 64-bit fxpt_freq (Q44.20) |
|---|
| | 254 | uint32_t interp; // desired interpolation factor (NOT -1) |
|---|
| | 255 | uint32_t scale_iq; // (scale_i << 16) | scale_q [16.0 format] |
|---|
| | 256 | } op_config_rx_v2_t; |
|---|
| | 257 | |
|---|
| | 258 | // bitmask for "valid" field. If the bit is set, there's |
|---|
| | 259 | // meaningful data in the corresonding field. |
|---|
| | 260 | |
|---|
| | 261 | #define CFGV_GAIN 0x0001 // gain field is valid |
|---|
| | 262 | #define CFGV_FREQ 0x0002 // target_freq field is valid |
|---|
| | 263 | #define CFGV_INTERP_DECIM 0x0004 // interp or decim is valid |
|---|
| | 264 | #define CFGV_SCALE_IQ 0x0008 // scale_iq is valid |
|---|
| | 265 | |
|---|
| | 266 | /* |
|---|
| | 267 | * Reply to receiver configuration |
|---|
| | 268 | */ |
|---|
| | 269 | typedef struct { |
|---|
| | 270 | uint8_t opcode; |
|---|
| | 271 | uint8_t len; |
|---|
| | 272 | uint16_t rid_mbz; |
|---|
| | 273 | |
|---|
| | 274 | uint16_t ok; // config was successful (bool) |
|---|
| | 275 | uint16_t inverted; // spectrum is inverted (bool) |
|---|
| | 276 | |
|---|
| | 277 | // RF frequency that corresponds to DC in the IF (fxpt_freq) |
|---|
| | 278 | uint32_t baseband_freq_hi; |
|---|
| | 279 | uint32_t baseband_freq_lo; |
|---|
| | 280 | // DDC frequency (fxpt_freq) |
|---|
| | 281 | uint32_t ddc_freq_hi; |
|---|
| | 282 | uint32_t ddc_freq_lo; |
|---|
| | 283 | // residual frequency (fxpt_freq) |
|---|
| | 284 | uint32_t residual_freq_hi; |
|---|
| | 285 | uint32_t residual_freq_lo; |
|---|
| | 286 | |
|---|
| | 287 | } op_config_rx_v2_reply_t; |
|---|
| | 288 | |
|---|
| | 289 | typedef struct { |
|---|
| | 290 | uint8_t opcode; |
|---|
| | 291 | uint8_t len; |
|---|
| | 292 | uint16_t rid_mbz; |
|---|
| | 293 | // bitmask indicating which of the following fields are valid |
|---|
| | 294 | uint16_t valid; |
|---|
| | 295 | uint16_t gain; // fxpt_db (Q9.7) |
|---|
| | 296 | uint32_t freq_hi; // high 32-bits of 64-bit fxpt_freq (Q44.20) |
|---|
| | 297 | uint32_t freq_lo; // low 32-bits of 64-bit fxpt_freq (Q44.20) |
|---|
| | 298 | uint32_t decim; // desired decimation factor (NOT -1) |
|---|
| | 299 | uint32_t scale_iq; // (scale_i << 16) | scale_q [16.0 format] |
|---|
| | 300 | } op_config_tx_v2_t; |
|---|
| | 301 | |
|---|