EEPROM max_power build/decode inconsistency
[libftdi] / src / ftdi_i.h
1 /***************************************************************************
2                           ftdi_i.h  -  description
3                              -------------------
4     begin                : Don Sep 9 2011
5     copyright            : (C) 2003-2011 by Intra2net AG and the libftdi developers
6     email                : opensource@intra2net.com
7  ***************************************************************************/
8
9 /***************************************************************************
10  *                                                                         *
11  *   This program is free software; you can redistribute it and/or modify  *
12  *   it under the terms of the GNU Lesser General Public License           *
13  *   version 2.1 as published by the Free Software Foundation;             *
14  *                                                                         *
15  ***************************************************************************
16
17  Non public definitions here
18
19 */
20
21 /* Even on 93xx66 at max 256 bytes are used (AN_121)*/
22 #define FTDI_MAX_EEPROM_SIZE 256
23
24 /** Max Power adjustment factor. */
25 #define MAX_POWER_MILLIAMP_PER_UNIT 2
26
27 /**
28     \brief FTDI eeprom structure
29 */
30 struct ftdi_eeprom
31 {
32     /** vendor id */
33     int vendor_id;
34     /** product id */
35     int product_id;
36
37     /** Was the eeprom structure initialized for the actual
38         connected device? **/
39     int initialized_for_connected_device;
40
41     /** self powered */
42     int self_powered;
43     /** remote wakeup */
44     int remote_wakeup;
45
46     int is_not_pnp;
47
48     /* Suspend on DBUS7 Low */
49     int suspend_dbus7;
50
51     /** input in isochronous transfer mode */
52     int in_is_isochronous;
53     /** output in isochronous transfer mode */
54     int out_is_isochronous;
55     /** suspend pull downs */
56     int suspend_pull_downs;
57
58     /** use serial */
59     int use_serial;
60     /** usb version */
61     int usb_version;
62     /** Use usb version on FT2232 devices*/
63     int use_usb_version;
64      /** maximum power */
65     int max_power;
66
67     /** manufacturer name */
68     char *manufacturer;
69     /** product name */
70     char *product;
71     /** serial number */
72     char *serial;
73
74     /* 2232D/H specific */
75     /* Hardware type, 0 = RS232 Uart, 1 = 245 FIFO, 2 = CPU FIFO, 
76        4 = OPTO Isolate */
77     int channel_a_type;
78     int channel_b_type;
79     /*  Driver Type, 1 = VCP */
80     int channel_a_driver;
81     int channel_b_driver;
82     int channel_c_driver;
83     int channel_d_driver;
84     /* 4232H specific */
85     int channel_a_rs485enable;
86     int channel_b_rs485enable;
87     int channel_c_rs485enable;
88     int channel_d_rs485enable;
89
90     /* Special function of FT232R/FT232H devices (and possibly others as well) */
91     /** CBUS pin function. See CBUS_xxx defines. */
92     int cbus_function[10];
93     /** Select hight current drive on R devices. */
94     int high_current;
95     /** Select hight current drive on A channel (2232C */
96     int high_current_a;
97     /** Select hight current drive on B channel (2232C). */
98     int high_current_b;
99     /** Select inversion of data lines (bitmask). */
100     int invert;
101
102     /*2232H/4432H Group specific values */
103     /* Group0 is AL on 2322H and A on 4232H
104        Group1 is AH on 2232H and B on 4232H
105        Group2 is BL on 2322H and C on 4232H
106        Group3 is BH on 2232H and C on 4232H*/
107     int group0_drive;
108     int group0_schmitt;
109     int group0_slew;
110     int group1_drive;
111     int group1_schmitt;
112     int group1_slew;
113     int group2_drive;
114     int group2_schmitt;
115     int group2_slew;
116     int group3_drive;
117     int group3_schmitt;
118     int group3_slew;
119
120     int powersave;
121
122     int clock_polarity;
123     int data_order;
124     int flow_control;
125
126     /** eeprom size in bytes. This doesn't get stored in the eeprom
127         but is the only way to pass it to ftdi_eeprom_build. */
128     int size;
129     /* EEPROM Type 0x46 for 93xx46, 0x56 for 93xx56 and 0x66 for 93xx66*/
130     int chip;
131     unsigned char buf[FTDI_MAX_EEPROM_SIZE];
132 };
133