aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/common/ad9361_driver/ad9361_device.h
blob: 0cb4b32a4f4ca8d41536f6e15a26ec4313461eb6 (plain)
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
//
// Copyright 2014 Ettus Research LLC
//

#ifndef INCLUDED_AD9361_CHIP_H
#define INCLUDED_AD9361_CHIP_H

#include <stdint.h>

#ifdef __cplusplus
extern "C" {
#endif

typedef enum {
    AD9361_GENERIC, AD9361_B200
} ad9361_product_t;

////////////////////////////////////////////////////////////
// shadow registers
typedef struct {
    uint8_t vcodivs;
    uint8_t inputsel;
    uint8_t rxfilt;
    uint8_t txfilt;
    uint8_t bbpll;
    uint8_t bbftune_config;
    uint8_t bbftune_mode;
} ad9361_chip_regs_t;

////////////////////////////////////////////////////////////
// other private data fields for VRQ handler
typedef struct {
    //Product
    ad9361_product_t    product;
    //Intermediate state
    double      rx_freq, tx_freq, req_rx_freq, req_tx_freq;
    double      baseband_bw, bbpll_freq, adcclock_freq;
    double      req_clock_rate, req_coreclk;
    uint16_t    rx_bbf_tunediv;
    uint8_t     curr_gain_table;
    uint32_t    rx1_gain, rx2_gain, tx1_gain, tx2_gain;
    int32_t     tfir_factor;
    //Register soft-copies
    ad9361_chip_regs_t regs;
    //IO Interface
    void*       io_iface;
} ad9361_device_t;

#ifdef __cplusplus
}
#endif

#endif /* INCLUDED_AD9361_CHIP_H */