Imported Upstream version 3.0
[debian/gnuradio] / usrp / firmware / include / usrp_i2c_addr.h
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2004 Free Software Foundation, Inc.
4  * 
5  * This file is part of GNU Radio
6  * 
7  * GNU Radio is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2, or (at your option)
10  * any later version.
11  * 
12  * GNU Radio is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  * 
17  * You should have received a copy of the GNU General Public License
18  * along with GNU Radio; see the file COPYING.  If not, write to
19  * the Free Software Foundation, Inc., 51 Franklin Street,
20  * Boston, MA 02110-1301, USA.
21  */
22 #ifndef INCLUDED_USRP_I2C_ADDR_H
23 #define INCLUDED_USRP_I2C_ADDR_H
24
25 // I2C addresses
26
27 #define I2C_DEV_EEPROM  0x50            // 24LC02[45]:  7-bits 1010xxx
28
29 #define I2C_ADDR_BOOT   (I2C_DEV_EEPROM | 0x0)
30 #define I2C_ADDR_TX_A   (I2C_DEV_EEPROM | 0x4)
31 #define I2C_ADDR_RX_A   (I2C_DEV_EEPROM | 0x5)
32 #define I2C_ADDR_TX_B   (I2C_DEV_EEPROM | 0x6)
33 #define I2C_ADDR_RX_B   (I2C_DEV_EEPROM | 0x7)
34
35
36 // format of FX2 BOOT EEPROM
37 //      00: 0xC0        code for ``Read IDs from EEPROM''
38 //      01: 0xFE        USB Vendor ID (LSB)
39 //      02: 0xFF        USB Vendor ID (MSB)
40 //      03: 0x02        USB Product ID (LSB)
41 //      04: 0x00        USB Product ID (MSB)
42 //      05: 0x01        USB Device ID (LSB)     // rev1
43 //      06: 0x00        USB Device ID (MSB)     // 0 = unconfig'd (no firmware)
44 //      07: 0x00        option byte
45
46
47 // format of daughterboard EEPROM
48 //      00: 0xDB        code for ``I'm a daughterboard''
49 //      01:   ..        Daughterboard ID (LSB)
50 //      02:   ..        Daughterboard ID (MSB)
51 //      03:   ..        io bits  7-0 direction (bit set if it's an output from m'board)
52 //      04:   ..        io bits 15-8 direction (bit set if it's an output from m'board)
53 //      05:   ..        ADC0 DC offset correction (LSB)
54 //      06:   ..        ADC0 DC offset correction (MSB)
55 //      07:   ..        ADC1 DC offset correction (LSB)
56 //      08:   ..        ADC1 DC offset correction (MSB)
57 //      ...
58 //      1f:   ..        negative of the sum of bytes [0x00, 0x1e]
59
60 #define DB_EEPROM_MAGIC         0x00
61 #define   DB_EEPROM_MAGIC_VALUE                 0xDB
62 #define DB_EEPROM_ID_LSB                0x01
63 #define DB_EEPROM_ID_MSB                0x02
64 #define DB_EEPROM_OE_LSB                0x03
65 #define DB_EEPROM_OE_MSB                0x04
66 #define DB_EEPROM_OFFSET_0_LSB          0x05    // offset correction for ADC or DAC 0
67 #define DB_EEPROM_OFFSET_0_MSB          0x06
68 #define DB_EEPROM_OFFSET_1_LSB          0x07    // offset correction for ADC or DAC 1
69 #define DB_EEPROM_OFFSET_1_MSB          0x08
70 #define DB_EEPROM_CHKSUM                0x1f
71
72 #define DB_EEPROM_CLEN                  0x20    // length of common portion of eeprom
73
74 #define DB_EEPROM_CUSTOM_BASE           DB_EEPROM_CLEN  // first avail offset for
75                                                         //   daughterboard specific use
76
77 #endif /* INCLUDED_USRP_I2C_ADDR_H */
78