initial commit
This commit is contained in:
+36
@@ -0,0 +1,36 @@
|
||||
#ifndef USB_HOST_H_
|
||||
#define USB_HOST_H_
|
||||
|
||||
#define REPORT_MAX_SIZE 64
|
||||
#define REPORT_BUF_SIZE 256
|
||||
#define DESCRIPTOR_MAX_SIZE 256
|
||||
|
||||
typedef enum {
|
||||
HOST_INACTIVE=0,
|
||||
HOST_MOUNTED,
|
||||
HOST_UNMOUNTED,
|
||||
HOST_START_LISTEN,
|
||||
HOST_LISTENING,
|
||||
HOST_STOP_LISTEN,
|
||||
} host_state_t;
|
||||
|
||||
struct report_desc {
|
||||
uint8_t dev_addr;
|
||||
uint8_t instance;
|
||||
uint8_t descriptor[DESCRIPTOR_MAX_SIZE];
|
||||
uint16_t desc_len;
|
||||
struct report_desc *next;
|
||||
bool listening;
|
||||
};
|
||||
|
||||
#define REPORT_DESC_ALLOC() (struct report_desc *)malloc(sizeof(struct report_desc))
|
||||
|
||||
extern host_state_t host_state;
|
||||
extern struct report_desc *descriptors;
|
||||
extern uint8_t num_mounted;
|
||||
|
||||
void usb_host_main(void);
|
||||
struct report_desc * report_desc_find(uint8_t dev_addr, uint8_t instance);
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user