|
57 | 57 | #define SI_CMD_INFO_LEN 1 |
58 | 58 | #define SI_CMD_INFO_RESP 3 |
59 | 59 |
|
60 | | -// GameCube controller commands |
61 | | -#define SI_CMD_GC_SHORT_POLL 0x40 |
62 | | -#define SI_CMD_GC_SHORT_POLL_LEN 3 |
63 | | -#define SI_CMD_GC_SHORT_POLL_RESP 8 |
64 | | - |
65 | | -#define SI_CMD_GC_READ_ORIGIN 0x41 |
66 | | -#define SI_CMD_GC_READ_ORIGIN_LEN 1 |
67 | | -#define SI_CMD_GC_READ_ORIGIN_RESP 10 |
68 | | - |
69 | | -#define SI_CMD_GC_CALIBRATE 0x42 |
70 | | -#define SI_CMD_GC_CALIBRATE_LEN 3 |
71 | | -#define SI_CMD_GC_CALIBRATE_RESP 10 |
72 | | - |
73 | | -#define SI_CMD_GC_LONG_POLL 0x43 |
74 | | -#define SI_CMD_GC_LONG_POLL_LEN 3 |
75 | | -#define SI_CMD_GC_LONG_POLL_RESP 10 |
76 | | - |
77 | | -#define SI_CMD_GC_PROBE_DEVICE 0x4D |
78 | | -#define SI_CMD_GC_PROBE_DEVICE_LEN 3 |
79 | | -#define SI_CMD_GC_PROBE_DEVICE_RESP 8 |
80 | | - |
81 | | -#define SI_CMD_GC_FIX_DEVICE 0x4E |
82 | | -#define SI_CMD_GC_FIX_DEVICE_LEN 3 |
83 | | -#define SI_CMD_GC_FIX_DEVICE_RESP 3 |
84 | | - |
85 | 60 | // SI device info flags |
86 | 61 | // On wireless controllers 0x00C0FF is reserved for the controller ID |
87 | 62 |
|
@@ -131,9 +106,9 @@ typedef bool (*si_byte_cb_t)(uint8_t byte, uint8_t byte_index); |
131 | 106 | /** |
132 | 107 | * Function type for transfer completion callbacks. |
133 | 108 | * |
134 | | - * @param result 0 on success, negative error code on failure |
| 109 | + * @param result positive number of bytes read on success, negative error code on failure |
135 | 110 | */ |
136 | | -typedef void (*si_complete_cb_t)(int result_or_bytes_read); |
| 111 | +typedef void (*si_complete_cb_t)(int result); |
137 | 112 |
|
138 | 113 | /** |
139 | 114 | * Initialize the SI bus. |
@@ -165,15 +140,6 @@ void si_write_bytes(const uint8_t *data, uint8_t length, si_complete_cb_t callba |
165 | 140 | */ |
166 | 141 | void si_read_bytes(uint8_t *buffer, uint8_t max_length, si_byte_cb_t byte_callback, si_complete_cb_t complete_callback); |
167 | 142 |
|
168 | | -/** |
169 | | - * Read a single command from the SI bus. |
170 | | - * |
171 | | - * @param buffer the buffer to read into |
172 | | - * @param max_length the maximum buffer size |
173 | | - * @param callback function to call when the command has been read |
174 | | - */ |
175 | | -void si_read_command(uint8_t *buffer, uint8_t max_length, si_complete_cb_t callback); |
176 | | - |
177 | 143 | /** |
178 | 144 | * Wait for the SI bus to be idle. |
179 | 145 | * |
|
0 commit comments