changing circuitry to disable RTC, update initialization to match
[fw/openalt] / usb / usbISR.h
1 //
2 //  These really need to be normalized to the names in lp210x.h and included there.
3 //  A #define like "DEV_ADDR" is just too ambiguous when it's unqualified with 
4 //  what sub-system it belongs to.
5 //
6
7 #ifndef _USBISR_H_
8 #define _USBISR_H_
9
10 //
11 //  Protocol engine command codes, device commands 
12 //
13 #define CMD_DEV_SET_ADDRESS       0xD0
14 #define CMD_DEV_CONFIG            0xD8
15 #define CMD_DEV_SET_MODE          0xF3
16 #define CMD_DEV_READ_CUR_FRAME_NR 0xF5
17 #define CMD_DEV_READ_TEST_REG     0xFD
18 #define CMD_DEV_STATUS            0xFE    /* read/write */
19 #define CMD_DEV_GET_ERROR_CODE    0xFF
20 #define CMD_DEV_READ_ERROR_STATUS 0xFB
21
22 //
23 //  Protocol engine command codes, endpoint commands 
24 //
25 #define CMD_EP_SELECT             0x00
26 #define CMD_EP_SELECT_CLEAR       0x40
27 #define CMD_EP_SET_STATUS         0x40
28 #define CMD_EP_CLEAR_BUFFER       0xF2
29 #define CMD_EP_VALIDATE_BUFFER    0xFA
30
31 //
32 //  Set address command 
33 //
34 #define DEV_ADDR          (1<<0)
35 #define DEV_EN            (1<<7)
36
37 //
38 //  Configure device command 
39 //
40 #define CONF_DEVICE       (1<<0)
41
42 //
43 //  Set mode command 
44 //
45 #define AP_CLK            (1<<0)
46 #define INAK_CI           (1<<1)
47 #define INAK_CO           (1<<2)
48 #define INAK_II           (1<<3)
49 #define INAK_IO           (1<<4)
50 #define INAK_BI           (1<<5)
51 #define INAK_BO           (1<<6)
52
53 //
54 //  Set get device status command 
55 //  
56 #define CON               (1<<0)
57 #define CON_CH            (1<<1)
58 #define SUS               (1<<2)
59 #define SUS_CH            (1<<3)
60 #define RST               (1<<4)
61
62 //
63 //  Get error code command
64 //  ...
65 //
66
67 //
68 //  Select Endpoint command read bits 
69 //
70 #define EPSTAT_FE         (1<<0)
71 #define EPSTAT_ST         (1<<1)
72 #define EPSTAT_STP        (1<<2)
73 #define EPSTAT_PO         (1<<3)
74 #define EPSTAT_EPN        (1<<4)
75 #define EPSTAT_B1FULL     (1<<5)
76 #define EPSTAT_B2FULL     (1<<6)
77
78 //
79 //  CMD_EP_SET_STATUS command 
80 //
81 #define EP_ST             (1<<0)
82 #define EP_DA             (1<<5)
83 #define EP_RF_MO          (1<<6)
84 #define EP_CND_ST         (1<<7)
85
86 //
87 //  Read error status command 
88 //
89 #define PID_ERR           (1<<0)
90 #define UEPKT             (1<<1)
91 #define DCRC              (1<<2)
92 #define TIMEOUT           (1<<3)
93 #define EOP               (1<<4)
94 #define B_OVRN            (1<<5)
95 #define BTSTF             (1<<6)
96 #define TGL_ERR           (1<<7)
97
98 #endif