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.
11 // Protocol engine command codes, device commands
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
23 // Protocol engine command codes, endpoint commands
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
32 // Set address command
34 #define DEV_ADDR (1<<0)
38 // Configure device command
40 #define CONF_DEVICE (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)
54 // Set get device status command
63 // Get error code command
68 // Select Endpoint command read bits
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)
79 // CMD_EP_SET_STATUS command
83 #define EP_RF_MO (1<<6)
84 #define EP_CND_ST (1<<7)
87 // Read error status command
89 #define PID_ERR (1<<0)
92 #define TIMEOUT (1<<3)
96 #define TGL_ERR (1<<7)