| Line 233... |
Line 233... |
| 233 |
const struct usb_interface* interfaces[];
|
233 |
const struct usb_interface* interfaces[];
|
| 234 |
};
|
234 |
};
|
| 235 |
|
235 |
|
| 236 |
struct __attribute__((packed,aligned(4))) usb_state
|
236 |
struct __attribute__((packed,aligned(4))) usb_state
|
| 237 |
{
|
237 |
{
|
| 238 |
bool (*ep0_rx_callback)(const struct usb_instance* data, int bytesleft);
|
238 |
bool (*ep0_rx_callback)(const struct usb_instance* data, union usb_endpoint_number epnum, int bytesleft);
|
| 239 |
bool (*ep0_tx_callback)(const struct usb_instance* data, int bytesleft);
|
239 |
bool (*ep0_tx_callback)(const struct usb_instance* data, union usb_endpoint_number epnum, int bytesleft);
|
| 240 |
const void* ep0_tx_ptr;
|
240 |
const void* ep0_tx_ptr;
|
| 241 |
uint16_t ep0_tx_len;
|
241 |
uint16_t ep0_tx_len;
|
| 242 |
uint8_t current_address;
|
242 |
uint8_t current_address;
|
| 243 |
uint8_t current_configuration;
|
243 |
uint8_t current_configuration;
|
| 244 |
uint8_t interface_altsetting[];
|
244 |
uint8_t interface_altsetting[];
|
| Line 246... |
Line 246... |
| 246 |
|
246 |
|
| 247 |
struct __attribute__((packed,aligned(4))) usb_driver
|
247 |
struct __attribute__((packed,aligned(4))) usb_driver
|
| 248 |
{
|
248 |
{
|
| 249 |
void (*init)(const struct usb_instance* data);
|
249 |
void (*init)(const struct usb_instance* data);
|
| 250 |
void (*exit)(const struct usb_instance* data);
|
250 |
void (*exit)(const struct usb_instance* data);
|
| 251 |
void (*ep0_start_rx)(const struct usb_instance* data, int non_setup);
|
251 |
void (*ep0_start_rx)(const struct usb_instance* data, bool non_setup, int len);
|
| 252 |
void (*ep0_start_tx)(const struct usb_instance* data, const void* buf, int len);
|
252 |
void (*ep0_start_tx)(const struct usb_instance* data, const void* buf, int len);
|
| 253 |
void (*start_rx)(const struct usb_instance* data, union usb_endpoint_number ep, void* buf, int size);
|
253 |
void (*start_rx)(const struct usb_instance* data, union usb_endpoint_number ep, void* buf, int size);
|
| 254 |
void (*start_tx)(const struct usb_instance* data, union usb_endpoint_number ep, const void* buf, int size);
|
254 |
void (*start_tx)(const struct usb_instance* data, union usb_endpoint_number ep, const void* buf, int size);
|
| 255 |
int (*get_stall)(const struct usb_instance* data, union usb_endpoint_number ep);
|
255 |
int (*get_stall)(const struct usb_instance* data, union usb_endpoint_number ep);
|
| 256 |
void (*set_stall)(const struct usb_instance* data, union usb_endpoint_number ep, int stall);
|
256 |
void (*set_stall)(const struct usb_instance* data, union usb_endpoint_number ep, bool stall);
|
| 257 |
void (*set_address)(const struct usb_instance* data, uint8_t address);
|
257 |
void (*set_address)(const struct usb_instance* data, uint8_t address);
|
| 258 |
void (*configure_ep)(const struct usb_instance* data, union usb_endpoint_number ep, enum usb_endpoint_type type, int maxpacket);
|
258 |
void (*configure_ep)(const struct usb_instance* data, union usb_endpoint_number ep, enum usb_endpoint_type type, int maxpacket);
|
| 259 |
void (*unconfigure_ep)(const struct usb_instance* data, union usb_endpoint_number ep);
|
259 |
void (*unconfigure_ep)(const struct usb_instance* data, union usb_endpoint_number ep);
|
| 260 |
int (*get_max_transfer_size)(const struct usb_instance* data, union usb_endpoint_number ep);
|
260 |
int (*get_max_transfer_size)(const struct usb_instance* data, union usb_endpoint_number ep);
|
| 261 |
};
|
261 |
};
|
| Line 283... |
Line 283... |
| 283 |
extern void usb_exit(const struct usb_instance* data);
|
283 |
extern void usb_exit(const struct usb_instance* data);
|
| 284 |
extern void usb_handle_bus_reset(const struct usb_instance* data, int highspeed);
|
284 |
extern void usb_handle_bus_reset(const struct usb_instance* data, int highspeed);
|
| 285 |
extern void usb_handle_timeout(const struct usb_instance* data, union usb_endpoint_number epnum, int bytesleft);
|
285 |
extern void usb_handle_timeout(const struct usb_instance* data, union usb_endpoint_number epnum, int bytesleft);
|
| 286 |
extern void usb_handle_xfer_complete(const struct usb_instance* data, union usb_endpoint_number epnum, int bytesleft);
|
286 |
extern void usb_handle_xfer_complete(const struct usb_instance* data, union usb_endpoint_number epnum, int bytesleft);
|
| 287 |
extern void usb_handle_setup_received(const struct usb_instance* data, union usb_endpoint_number epnum);
|
287 |
extern void usb_handle_setup_received(const struct usb_instance* data, union usb_endpoint_number epnum);
|
| 288 |
extern void usb_ep0_start_rx(const struct usb_instance* data, int non_setup, bool (*callback)(const struct usb_instance* data, int bytesleft));
|
288 |
extern void usb_ep0_start_rx(const struct usb_instance* data, bool non_setup, int len, bool (*callback)(const struct usb_instance* data, union usb_endpoint_number epnum, int bytesleft));
|
| 289 |
extern void usb_ep0_start_tx(const struct usb_instance* data, const void* buf, int len, bool last, bool (*callback)(const struct usb_instance* data, int bytesleft));
|
289 |
extern void usb_ep0_start_tx(const struct usb_instance* data, const void* buf, int len, bool (*callback)(const struct usb_instance* data, union usb_endpoint_number epnum, int bytesleft));
|
| 290 |
extern void usb_start_rx(const struct usb_instance* data, union usb_endpoint_number ep, void* buf, int size);
|
290 |
extern void usb_start_rx(const struct usb_instance* data, union usb_endpoint_number ep, void* buf, int size);
|
| 291 |
extern void usb_start_tx(const struct usb_instance* data, union usb_endpoint_number ep, const void* buf, int size);
|
291 |
extern void usb_start_tx(const struct usb_instance* data, union usb_endpoint_number ep, const void* buf, int size);
|
| 292 |
extern void usb_set_stall(const struct usb_instance* data, union usb_endpoint_number ep, int stall);
|
292 |
extern void usb_set_stall(const struct usb_instance* data, union usb_endpoint_number ep, bool stall);
|
| 293 |
extern void usb_configure_ep(const struct usb_instance* data, union usb_endpoint_number ep, enum usb_endpoint_type type, int maxpacket);
|
293 |
extern void usb_configure_ep(const struct usb_instance* data, union usb_endpoint_number ep, enum usb_endpoint_type type, int maxpacket);
|
| 294 |
extern void usb_unconfigure_ep(const struct usb_instance* data, union usb_endpoint_number ep);
|
294 |
extern void usb_unconfigure_ep(const struct usb_instance* data, union usb_endpoint_number ep);
|
| 295 |
extern int usb_get_max_transfer_size(const struct usb_instance* data, union usb_endpoint_number ep);
|
295 |
extern int usb_get_max_transfer_size(const struct usb_instance* data, union usb_endpoint_number ep);
|
| 296 |
extern bool usb_ep0_tx_callback(const struct usb_instance* data, int bytesleft);
|
296 |
extern bool usb_ep0_tx_callback(const struct usb_instance* data, union usb_endpoint_number epnum, int bytesleft);
|
| - |
|
297 |
extern bool usb_ep0_short_tx_callback(const struct usb_instance* data, union usb_endpoint_number epnum, int bytesleft);
|
| - |
|
298 |
extern bool usb_ep0_ack_callback(const struct usb_instance* data, union usb_endpoint_number epnum, int bytesleft);
|
| 297 |
|
299 |
|
| 298 |
|
300 |
|
| 299 |
#endif
|
301 |
#endif
|