Changeset 8347

Show
Ignore:
Timestamp:
05/09/08 12:35:51
Author:
eb
Message:

work-in-progress

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • usrp2/trunk/firmware/include/usrp2_eth_packet.h

    r7967 r8347  
    166166#define OP_READ_TIME           11       // What time is it? (100 MHz counter) 
    167167#define OP_READ_TIME_REPLY     12       // This time. 
     168#define OP_CONFIG_RX_V2        13 
     169#define OP_CONFIG_TX_V2        14 
     170 
    168171 
    169172typedef struct { 
     
    182185  uint8_t       opcode; 
    183186  uint8_t       len; 
    184   uint16_t      rid_mbz; 
     187  uint16_t      rid_ok;                        // low bit is "OK" 
    185188  u2_mac_addr_t addr; 
    186189  uint16_t      hw_rev; 
     
    235238  uint32_t      time; 
    236239} op_read_time_reply_t; 
     240 
     241 
     242/* 
     243 * Configure the receiver. 
     244 */ 
     245typedef 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 */ 
     269typedef 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 
     289typedef 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 
    237302 
    238303 
     
    249314  op_read_time_t        op_read_time; 
    250315  op_read_time_reply_t  op_read_time_reply; 
     316  op_config_rx_v2_t     op_config_rx_v2; 
     317  op_config_tx_v2_t     op_config_tx_v2; 
    251318} u2_subpkt_t; 
    252319