add class flags

change keyboard_info_pool to keyboard_data
This commit is contained in:
hathach
2013-03-24 17:29:07 +07:00
parent 92c137243d
commit a1b17be681
7 changed files with 62 additions and 28 deletions

View File

@@ -70,8 +70,6 @@ typedef enum pipe_status_{
PIPE_STATUS_ERROR
} pipe_status_t;
typedef uint32_t tusbh_flag_class_t;
typedef struct {
void (* const init) (void);
tusb_error_t (* const open_subtask)(uint8_t, uint8_t const *, uint16_t*);
@@ -86,7 +84,12 @@ typedef struct {
// APPLICATION API
//--------------------------------------------------------------------+
tusb_error_t tusbh_configuration_set (uint8_t dev_addr, uint8_t configure_number) ATTR_WARN_UNUSED_RESULT;
tusb_device_state_t tusbh_device_get_state (uint8_t const dev_addr) ATTR_WARN_UNUSED_RESULT;
tusb_device_state_t tusbh_device_get_state (uint8_t const dev_addr) ATTR_WARN_UNUSED_RESULT ATTR_PURE;
static inline bool tusbh_device_is_configured(uint8_t const dev_addr) ATTR_ALWAYS_INLINE ATTR_WARN_UNUSED_RESULT ATTR_PURE;
static inline bool tusbh_device_is_configured(uint8_t const dev_addr)
{
return tusbh_device_get_state(dev_addr) == TUSB_DEVICE_STATE_CONFIGURED;
}
//--------------------------------------------------------------------+
// APPLICATION CALLBACK

View File

@@ -103,6 +103,7 @@ typedef struct { // TODO internal structure, re-order members
extern usbh_device_info_t usbh_devices[TUSB_CFG_HOST_DEVICE_MAX+1]; // including zero-address
//------------- callback from HCD ISR-------------//
void usbh_isr(pipe_handle_t pipe_hdl, uint8_t class_code, tusb_bus_event_t event);
void usbh_device_plugged_isr(uint8_t hostid, tusb_speed_t speed);
void usbh_device_unplugged_isr(uint8_t hostid);