shorten descriptor type
This commit is contained in:
@@ -118,9 +118,9 @@ void test_dcd_init(void)
|
||||
|
||||
void test_dcd_configure_endpoint_in(void)
|
||||
{
|
||||
tusb_descriptor_endpoint_t const desc_endpoint =
|
||||
tusb_desc_endpoint_t const desc_endpoint =
|
||||
{
|
||||
.bLength = sizeof(tusb_descriptor_endpoint_t),
|
||||
.bLength = sizeof(tusb_desc_endpoint_t),
|
||||
.bDescriptorType = TUSB_DESC_TYPE_ENDPOINT,
|
||||
.bEndpointAddress = 0x83,
|
||||
.bmAttributes = { .xfer = TUSB_XFER_INTERRUPT },
|
||||
|
||||
@@ -65,7 +65,7 @@ void test_dcd_init_failed(void)
|
||||
TEST_ASSERT_EQUAL(TUSB_ERROR_FAILED, usbd_init() );
|
||||
}
|
||||
|
||||
tusb_error_t stub_hidd_init(uint8_t coreid, tusb_descriptor_interface_t const* p_interface_desc, uint16_t* p_length, int num_call)
|
||||
tusb_error_t stub_hidd_init(uint8_t coreid, tusb_desc_interface_t const* p_interface_desc, uint16_t* p_length, int num_call)
|
||||
{
|
||||
switch(num_call)
|
||||
{
|
||||
|
||||
@@ -47,7 +47,7 @@ const cdc_configuration_desc_t cdc_config_descriptor =
|
||||
{
|
||||
.configuration =
|
||||
{
|
||||
.bLength = sizeof(tusb_descriptor_configuration_t),
|
||||
.bLength = sizeof(tusb_desc_configuration_t),
|
||||
.bDescriptorType = TUSB_DESC_TYPE_CONFIGURATION,
|
||||
|
||||
.wTotalLength = sizeof(cdc_configuration_desc_t),
|
||||
@@ -62,7 +62,7 @@ const cdc_configuration_desc_t cdc_config_descriptor =
|
||||
// IAD points to CDC Interfaces
|
||||
.cdc_iad =
|
||||
{
|
||||
.bLength = sizeof(tusb_descriptor_interface_association_t),
|
||||
.bLength = sizeof(tusb_desc_interface_assoc_t),
|
||||
.bDescriptorType = TUSB_DESC_TYPE_INTERFACE_ASSOCIATION,
|
||||
|
||||
.bFirstInterface = 1,
|
||||
@@ -80,7 +80,7 @@ const cdc_configuration_desc_t cdc_config_descriptor =
|
||||
//------------- CDC Communication Interface -------------//
|
||||
.cdc_comm_interface =
|
||||
{
|
||||
.bLength = sizeof(tusb_descriptor_interface_t),
|
||||
.bLength = sizeof(tusb_desc_interface_t),
|
||||
.bDescriptorType = TUSB_DESC_TYPE_INTERFACE,
|
||||
.bInterfaceNumber = 1,
|
||||
.bAlternateSetting = 0,
|
||||
@@ -121,7 +121,7 @@ const cdc_configuration_desc_t cdc_config_descriptor =
|
||||
|
||||
.cdc_endpoint_notification =
|
||||
{
|
||||
.bLength = sizeof(tusb_descriptor_endpoint_t),
|
||||
.bLength = sizeof(tusb_desc_endpoint_t),
|
||||
.bDescriptorType = TUSB_DESC_TYPE_ENDPOINT,
|
||||
.bEndpointAddress = 0x81,
|
||||
.bmAttributes = { .xfer = TUSB_XFER_INTERRUPT },
|
||||
@@ -132,7 +132,7 @@ const cdc_configuration_desc_t cdc_config_descriptor =
|
||||
//------------- CDC Data Interface -------------//
|
||||
.cdc_data_interface =
|
||||
{
|
||||
.bLength = sizeof(tusb_descriptor_interface_t),
|
||||
.bLength = sizeof(tusb_desc_interface_t),
|
||||
.bDescriptorType = TUSB_DESC_TYPE_INTERFACE,
|
||||
.bInterfaceNumber = 2,
|
||||
.bAlternateSetting = 0x00,
|
||||
@@ -145,7 +145,7 @@ const cdc_configuration_desc_t cdc_config_descriptor =
|
||||
|
||||
.cdc_endpoint_out =
|
||||
{
|
||||
.bLength = sizeof(tusb_descriptor_endpoint_t),
|
||||
.bLength = sizeof(tusb_desc_endpoint_t),
|
||||
.bDescriptorType = TUSB_DESC_TYPE_ENDPOINT,
|
||||
.bEndpointAddress = 2,
|
||||
.bmAttributes = { .xfer = TUSB_XFER_BULK },
|
||||
@@ -155,7 +155,7 @@ const cdc_configuration_desc_t cdc_config_descriptor =
|
||||
|
||||
.cdc_endpoint_in =
|
||||
{
|
||||
.bLength = sizeof(tusb_descriptor_endpoint_t),
|
||||
.bLength = sizeof(tusb_desc_endpoint_t),
|
||||
.bDescriptorType = TUSB_DESC_TYPE_ENDPOINT,
|
||||
.bEndpointAddress = 0x82,
|
||||
.bmAttributes = { .xfer = TUSB_XFER_BULK },
|
||||
@@ -173,7 +173,7 @@ const cdc_configuration_desc_t rndis_config_descriptor =
|
||||
{
|
||||
.configuration =
|
||||
{
|
||||
.bLength = sizeof(tusb_descriptor_configuration_t),
|
||||
.bLength = sizeof(tusb_desc_configuration_t),
|
||||
.bDescriptorType = TUSB_DESC_TYPE_CONFIGURATION,
|
||||
|
||||
.wTotalLength = sizeof(cdc_configuration_desc_t),
|
||||
@@ -188,7 +188,7 @@ const cdc_configuration_desc_t rndis_config_descriptor =
|
||||
// IAD points to CDC Interfaces
|
||||
.cdc_iad =
|
||||
{
|
||||
.bLength = sizeof(tusb_descriptor_interface_association_t),
|
||||
.bLength = sizeof(tusb_desc_interface_assoc_t),
|
||||
.bDescriptorType = TUSB_DESC_TYPE_INTERFACE_ASSOCIATION,
|
||||
|
||||
.bFirstInterface = 1,
|
||||
@@ -206,7 +206,7 @@ const cdc_configuration_desc_t rndis_config_descriptor =
|
||||
//------------- CDC Communication Interface -------------//
|
||||
.cdc_comm_interface =
|
||||
{
|
||||
.bLength = sizeof(tusb_descriptor_interface_t),
|
||||
.bLength = sizeof(tusb_desc_interface_t),
|
||||
.bDescriptorType = TUSB_DESC_TYPE_INTERFACE,
|
||||
.bInterfaceNumber = 1,
|
||||
.bAlternateSetting = 0,
|
||||
@@ -244,7 +244,7 @@ const cdc_configuration_desc_t rndis_config_descriptor =
|
||||
|
||||
.cdc_endpoint_notification =
|
||||
{
|
||||
.bLength = sizeof(tusb_descriptor_endpoint_t),
|
||||
.bLength = sizeof(tusb_desc_endpoint_t),
|
||||
.bDescriptorType = TUSB_DESC_TYPE_ENDPOINT,
|
||||
.bEndpointAddress = 0x81,
|
||||
.bmAttributes = { .xfer = TUSB_XFER_INTERRUPT },
|
||||
@@ -255,7 +255,7 @@ const cdc_configuration_desc_t rndis_config_descriptor =
|
||||
//------------- CDC Data Interface -------------//
|
||||
.cdc_data_interface =
|
||||
{
|
||||
.bLength = sizeof(tusb_descriptor_interface_t),
|
||||
.bLength = sizeof(tusb_desc_interface_t),
|
||||
.bDescriptorType = TUSB_DESC_TYPE_INTERFACE,
|
||||
.bInterfaceNumber = 2,
|
||||
.bAlternateSetting = 0x00,
|
||||
@@ -268,7 +268,7 @@ const cdc_configuration_desc_t rndis_config_descriptor =
|
||||
|
||||
.cdc_endpoint_out =
|
||||
{
|
||||
.bLength = sizeof(tusb_descriptor_endpoint_t),
|
||||
.bLength = sizeof(tusb_desc_endpoint_t),
|
||||
.bDescriptorType = TUSB_DESC_TYPE_ENDPOINT,
|
||||
.bEndpointAddress = 2,
|
||||
.bmAttributes = { .xfer = TUSB_XFER_BULK },
|
||||
@@ -278,7 +278,7 @@ const cdc_configuration_desc_t rndis_config_descriptor =
|
||||
|
||||
.cdc_endpoint_in =
|
||||
{
|
||||
.bLength = sizeof(tusb_descriptor_endpoint_t),
|
||||
.bLength = sizeof(tusb_desc_endpoint_t),
|
||||
.bDescriptorType = TUSB_DESC_TYPE_ENDPOINT,
|
||||
.bEndpointAddress = 0x82,
|
||||
.bmAttributes = { .xfer = TUSB_XFER_BULK },
|
||||
|
||||
@@ -55,21 +55,21 @@
|
||||
|
||||
typedef struct
|
||||
{
|
||||
tusb_descriptor_configuration_t configuration;
|
||||
tusb_desc_configuration_t configuration;
|
||||
|
||||
tusb_descriptor_interface_association_t cdc_iad;
|
||||
tusb_desc_interface_assoc_t cdc_iad;
|
||||
|
||||
//CDC Control Interface
|
||||
tusb_descriptor_interface_t cdc_comm_interface;
|
||||
tusb_desc_interface_t cdc_comm_interface;
|
||||
cdc_desc_func_header_t cdc_header;
|
||||
cdc_desc_func_abstract_control_management_t cdc_acm;
|
||||
cdc_desc_func_union_t cdc_union;
|
||||
tusb_descriptor_endpoint_t cdc_endpoint_notification;
|
||||
tusb_desc_endpoint_t cdc_endpoint_notification;
|
||||
|
||||
//CDC Data Interface
|
||||
tusb_descriptor_interface_t cdc_data_interface;
|
||||
tusb_descriptor_endpoint_t cdc_endpoint_out;
|
||||
tusb_descriptor_endpoint_t cdc_endpoint_in;
|
||||
tusb_desc_interface_t cdc_data_interface;
|
||||
tusb_desc_endpoint_t cdc_endpoint_out;
|
||||
tusb_desc_endpoint_t cdc_endpoint_in;
|
||||
|
||||
} cdc_configuration_desc_t;
|
||||
|
||||
|
||||
@@ -58,10 +58,10 @@
|
||||
static uint8_t dev_addr;
|
||||
static uint16_t length;
|
||||
|
||||
static tusb_descriptor_interface_t const * p_comm_interface = &cdc_config_descriptor.cdc_comm_interface;
|
||||
static tusb_descriptor_endpoint_t const * p_endpoint_notification = &cdc_config_descriptor.cdc_endpoint_notification;
|
||||
static tusb_descriptor_endpoint_t const * p_endpoint_out = &cdc_config_descriptor.cdc_endpoint_out;
|
||||
static tusb_descriptor_endpoint_t const * p_endpoint_in = &cdc_config_descriptor.cdc_endpoint_in;
|
||||
static tusb_desc_interface_t const * p_comm_interface = &cdc_config_descriptor.cdc_comm_interface;
|
||||
static tusb_desc_endpoint_t const * p_endpoint_notification = &cdc_config_descriptor.cdc_endpoint_notification;
|
||||
static tusb_desc_endpoint_t const * p_endpoint_out = &cdc_config_descriptor.cdc_endpoint_out;
|
||||
static tusb_desc_endpoint_t const * p_endpoint_in = &cdc_config_descriptor.cdc_endpoint_in;
|
||||
|
||||
extern cdch_data_t cdch_data[TUSB_CFG_HOST_DEVICE_MAX];
|
||||
static cdch_data_t * p_cdc = &cdch_data[0];
|
||||
@@ -124,11 +124,11 @@ void test_cdch_open_length_check(void)
|
||||
{
|
||||
const uint16_t expected_length =
|
||||
//------------- Comm Interface -------------//
|
||||
sizeof(tusb_descriptor_interface_t) + sizeof(cdc_desc_func_header_t) +
|
||||
sizeof(tusb_desc_interface_t) + sizeof(cdc_desc_func_header_t) +
|
||||
sizeof(cdc_desc_func_abstract_control_management_t) + sizeof(cdc_desc_func_union_t) +
|
||||
sizeof(tusb_descriptor_endpoint_t) +
|
||||
sizeof(tusb_desc_endpoint_t) +
|
||||
//------------- Data Interface -------------//
|
||||
sizeof(tusb_descriptor_interface_t) + 2*sizeof(tusb_descriptor_endpoint_t);
|
||||
sizeof(tusb_desc_interface_t) + 2*sizeof(tusb_desc_endpoint_t);
|
||||
|
||||
pipe_handle_t dummy_hld = { .dev_addr = 1 };
|
||||
hcd_pipe_open_IgnoreAndReturn(dummy_hld);
|
||||
|
||||
@@ -63,10 +63,10 @@ void tearDown(void)
|
||||
static uint8_t dev_addr;
|
||||
static uint16_t length;
|
||||
|
||||
static tusb_descriptor_interface_t const * p_comm_interface = &rndis_config_descriptor.cdc_comm_interface;
|
||||
static tusb_descriptor_endpoint_t const * p_endpoint_notification = &rndis_config_descriptor.cdc_endpoint_notification;
|
||||
static tusb_descriptor_endpoint_t const * p_endpoint_out = &rndis_config_descriptor.cdc_endpoint_out;
|
||||
static tusb_descriptor_endpoint_t const * p_endpoint_in = &rndis_config_descriptor.cdc_endpoint_in;
|
||||
static tusb_desc_interface_t const * p_comm_interface = &rndis_config_descriptor.cdc_comm_interface;
|
||||
static tusb_desc_endpoint_t const * p_endpoint_notification = &rndis_config_descriptor.cdc_endpoint_notification;
|
||||
static tusb_desc_endpoint_t const * p_endpoint_out = &rndis_config_descriptor.cdc_endpoint_out;
|
||||
static tusb_desc_endpoint_t const * p_endpoint_in = &rndis_config_descriptor.cdc_endpoint_in;
|
||||
|
||||
static pipe_handle_t pipe_notification = { .dev_addr = 1, .xfer_type = TUSB_XFER_INTERRUPT };
|
||||
static pipe_handle_t pipe_out = { .dev_addr = 1, .xfer_type = TUSB_XFER_BULK, .index = 0 };
|
||||
|
||||
@@ -157,9 +157,9 @@ void test_isr_disconnect_then_async_advance_control_pipe(void)
|
||||
|
||||
void test_bulk_pipe_close(void)
|
||||
{
|
||||
tusb_descriptor_endpoint_t const desc_ept_bulk_in =
|
||||
tusb_desc_endpoint_t const desc_ept_bulk_in =
|
||||
{
|
||||
.bLength = sizeof(tusb_descriptor_endpoint_t),
|
||||
.bLength = sizeof(tusb_desc_endpoint_t),
|
||||
.bDescriptorType = TUSB_DESC_TYPE_ENDPOINT,
|
||||
.bEndpointAddress = 0x81,
|
||||
.bmAttributes = { .xfer = TUSB_XFER_BULK },
|
||||
|
||||
@@ -107,9 +107,9 @@ void verify_open_qhd(ehci_qhd_t *p_qhd, uint8_t endpoint_addr, uint16_t max_pack
|
||||
//--------------------------------------------------------------------+
|
||||
// PIPE OPEN
|
||||
//--------------------------------------------------------------------+
|
||||
tusb_descriptor_endpoint_t const desc_ept_bulk_in =
|
||||
tusb_desc_endpoint_t const desc_ept_bulk_in =
|
||||
{
|
||||
.bLength = sizeof(tusb_descriptor_endpoint_t),
|
||||
.bLength = sizeof(tusb_desc_endpoint_t),
|
||||
.bDescriptorType = TUSB_DESC_TYPE_ENDPOINT,
|
||||
.bEndpointAddress = 0x81,
|
||||
.bmAttributes = { .xfer = TUSB_XFER_BULK },
|
||||
@@ -117,9 +117,9 @@ tusb_descriptor_endpoint_t const desc_ept_bulk_in =
|
||||
.bInterval = 0
|
||||
};
|
||||
|
||||
tusb_descriptor_endpoint_t const desc_ept_bulk_out =
|
||||
tusb_desc_endpoint_t const desc_ept_bulk_out =
|
||||
{
|
||||
.bLength = sizeof(tusb_descriptor_endpoint_t),
|
||||
.bLength = sizeof(tusb_desc_endpoint_t),
|
||||
.bDescriptorType = TUSB_DESC_TYPE_ENDPOINT,
|
||||
.bEndpointAddress = 0x01,
|
||||
.bmAttributes = { .xfer = TUSB_XFER_BULK },
|
||||
@@ -127,7 +127,7 @@ tusb_descriptor_endpoint_t const desc_ept_bulk_out =
|
||||
.bInterval = 0
|
||||
};
|
||||
|
||||
void verify_bulk_open_qhd(ehci_qhd_t *p_qhd, tusb_descriptor_endpoint_t const * desc_endpoint, uint8_t class_code)
|
||||
void verify_bulk_open_qhd(ehci_qhd_t *p_qhd, tusb_desc_endpoint_t const * desc_endpoint, uint8_t class_code)
|
||||
{
|
||||
verify_open_qhd(p_qhd, desc_endpoint->bEndpointAddress, desc_endpoint->wMaxPacketSize.size);
|
||||
|
||||
@@ -152,7 +152,7 @@ void test_open_bulk_qhd_data(void)
|
||||
{
|
||||
ehci_qhd_t *p_qhd;
|
||||
pipe_handle_t pipe_hdl;
|
||||
tusb_descriptor_endpoint_t const * desc_endpoint = &desc_ept_bulk_in;
|
||||
tusb_desc_endpoint_t const * desc_endpoint = &desc_ept_bulk_in;
|
||||
|
||||
//------------- Code Under TEST -------------//
|
||||
pipe_hdl = hcd_pipe_open(dev_addr, desc_endpoint, TUSB_CLASS_MSC);
|
||||
@@ -186,7 +186,7 @@ void test_open_bulk_hs_out_pingstate(void)
|
||||
//--------------------------------------------------------------------+
|
||||
void test_bulk_close(void)
|
||||
{
|
||||
tusb_descriptor_endpoint_t const * desc_endpoint = &desc_ept_bulk_in;
|
||||
tusb_desc_endpoint_t const * desc_endpoint = &desc_ept_bulk_in;
|
||||
pipe_handle_t pipe_hdl = hcd_pipe_open(dev_addr, desc_endpoint, TUSB_CLASS_MSC);
|
||||
ehci_qhd_t *p_qhd = &ehci_data.device[ pipe_hdl.dev_addr-1].qhd[ pipe_hdl.index ];
|
||||
|
||||
|
||||
@@ -64,9 +64,9 @@ static ehci_qhd_t *async_head;
|
||||
static ehci_qhd_t *p_qhd_bulk;
|
||||
static pipe_handle_t pipe_hdl_bulk;
|
||||
|
||||
tusb_descriptor_endpoint_t const desc_ept_bulk_in =
|
||||
tusb_desc_endpoint_t const desc_ept_bulk_in =
|
||||
{
|
||||
.bLength = sizeof(tusb_descriptor_endpoint_t),
|
||||
.bLength = sizeof(tusb_desc_endpoint_t),
|
||||
.bDescriptorType = TUSB_DESC_TYPE_ENDPOINT,
|
||||
.bEndpointAddress = 0x81,
|
||||
.bmAttributes = { .xfer = TUSB_XFER_BULK },
|
||||
@@ -74,9 +74,9 @@ tusb_descriptor_endpoint_t const desc_ept_bulk_in =
|
||||
.bInterval = 0
|
||||
};
|
||||
|
||||
tusb_descriptor_endpoint_t const desc_ept_bulk_out =
|
||||
tusb_desc_endpoint_t const desc_ept_bulk_out =
|
||||
{
|
||||
.bLength = sizeof(tusb_descriptor_endpoint_t),
|
||||
.bLength = sizeof(tusb_desc_endpoint_t),
|
||||
.bDescriptorType = TUSB_DESC_TYPE_ENDPOINT,
|
||||
.bEndpointAddress = 0x01,
|
||||
.bmAttributes = { .xfer = TUSB_XFER_BULK },
|
||||
|
||||
@@ -113,16 +113,16 @@ void verify_open_qhd(ehci_qhd_t *p_qhd, uint8_t endpoint_addr, uint16_t max_pack
|
||||
//--------------------------------------------------------------------+
|
||||
// PIPE OPEN
|
||||
//--------------------------------------------------------------------+
|
||||
tusb_descriptor_endpoint_t const desc_ept_interrupt_out =
|
||||
tusb_desc_endpoint_t const desc_ept_interrupt_out =
|
||||
{
|
||||
.bLength = sizeof(tusb_descriptor_endpoint_t),
|
||||
.bLength = sizeof(tusb_desc_endpoint_t),
|
||||
.bDescriptorType = TUSB_DESC_TYPE_ENDPOINT,
|
||||
.bEndpointAddress = 0x02,
|
||||
.bmAttributes = { .xfer = TUSB_XFER_INTERRUPT },
|
||||
.wMaxPacketSize = 16,
|
||||
.bInterval = 4
|
||||
};
|
||||
void verify_int_qhd(ehci_qhd_t *p_qhd, tusb_descriptor_endpoint_t const * desc_endpoint, uint8_t class_code)
|
||||
void verify_int_qhd(ehci_qhd_t *p_qhd, tusb_desc_endpoint_t const * desc_endpoint, uint8_t class_code)
|
||||
{
|
||||
verify_open_qhd(p_qhd, desc_endpoint->bEndpointAddress, desc_endpoint->wMaxPacketSize.size);
|
||||
|
||||
@@ -158,7 +158,7 @@ void test_open_interrupt_qhd_hs(void)
|
||||
|
||||
void test_open_interrupt_hs_interval_1(void)
|
||||
{
|
||||
tusb_descriptor_endpoint_t int_edp_interval = desc_ept_interrupt_out;
|
||||
tusb_desc_endpoint_t int_edp_interval = desc_ept_interrupt_out;
|
||||
int_edp_interval.bInterval = 1;
|
||||
|
||||
//------------- Code Under TEST -------------//
|
||||
@@ -173,7 +173,7 @@ void test_open_interrupt_hs_interval_1(void)
|
||||
|
||||
void test_open_interrupt_hs_interval_2(void)
|
||||
{
|
||||
tusb_descriptor_endpoint_t int_edp_interval = desc_ept_interrupt_out;
|
||||
tusb_desc_endpoint_t int_edp_interval = desc_ept_interrupt_out;
|
||||
int_edp_interval.bInterval = 2;
|
||||
|
||||
//------------- Code Under TEST -------------//
|
||||
@@ -187,7 +187,7 @@ void test_open_interrupt_hs_interval_2(void)
|
||||
|
||||
void test_open_interrupt_hs_interval_3(void)
|
||||
{
|
||||
tusb_descriptor_endpoint_t int_edp_interval = desc_ept_interrupt_out;
|
||||
tusb_desc_endpoint_t int_edp_interval = desc_ept_interrupt_out;
|
||||
int_edp_interval.bInterval = 3;
|
||||
|
||||
//------------- Code Under TEST -------------//
|
||||
@@ -201,7 +201,7 @@ void test_open_interrupt_hs_interval_3(void)
|
||||
|
||||
void test_open_interrupt_hs_interval_4(void)
|
||||
{
|
||||
tusb_descriptor_endpoint_t int_edp_interval = desc_ept_interrupt_out;
|
||||
tusb_desc_endpoint_t int_edp_interval = desc_ept_interrupt_out;
|
||||
int_edp_interval.bInterval = 4;
|
||||
|
||||
//------------- Code Under TEST -------------//
|
||||
@@ -215,7 +215,7 @@ void test_open_interrupt_hs_interval_4(void)
|
||||
|
||||
void test_open_interrupt_hs_interval_5(void)
|
||||
{
|
||||
tusb_descriptor_endpoint_t int_edp_interval = desc_ept_interrupt_out;
|
||||
tusb_desc_endpoint_t int_edp_interval = desc_ept_interrupt_out;
|
||||
int_edp_interval.bInterval = 5;
|
||||
|
||||
//------------- Code Under TEST -------------//
|
||||
@@ -229,7 +229,7 @@ void test_open_interrupt_hs_interval_5(void)
|
||||
|
||||
void test_open_interrupt_hs_interval_6(void)
|
||||
{
|
||||
tusb_descriptor_endpoint_t int_edp_interval = desc_ept_interrupt_out;
|
||||
tusb_desc_endpoint_t int_edp_interval = desc_ept_interrupt_out;
|
||||
int_edp_interval.bInterval = 6;
|
||||
|
||||
//------------- Code Under TEST -------------//
|
||||
@@ -243,7 +243,7 @@ void test_open_interrupt_hs_interval_6(void)
|
||||
|
||||
void test_open_interrupt_hs_interval_7(void)
|
||||
{
|
||||
tusb_descriptor_endpoint_t int_edp_interval = desc_ept_interrupt_out;
|
||||
tusb_desc_endpoint_t int_edp_interval = desc_ept_interrupt_out;
|
||||
int_edp_interval.bInterval = 7;
|
||||
|
||||
//------------- Code Under TEST -------------//
|
||||
@@ -257,7 +257,7 @@ void test_open_interrupt_hs_interval_7(void)
|
||||
|
||||
void test_open_interrupt_hs_interval_8(void)
|
||||
{
|
||||
tusb_descriptor_endpoint_t int_edp_interval = desc_ept_interrupt_out;
|
||||
tusb_desc_endpoint_t int_edp_interval = desc_ept_interrupt_out;
|
||||
int_edp_interval.bInterval = 16;
|
||||
|
||||
//------------- Code Under TEST -------------//
|
||||
@@ -291,7 +291,7 @@ void test_open_interrupt_qhd_non_hs(void)
|
||||
|
||||
void test_open_interrupt_qhd_non_hs_9(void)
|
||||
{
|
||||
tusb_descriptor_endpoint_t int_edp_interval = desc_ept_interrupt_out;
|
||||
tusb_desc_endpoint_t int_edp_interval = desc_ept_interrupt_out;
|
||||
int_edp_interval.bInterval = 32;
|
||||
|
||||
usbh_devices[dev_addr].speed = TUSB_SPEED_FULL;
|
||||
@@ -325,7 +325,7 @@ void test_interrupt_close(void)
|
||||
|
||||
void test_interrupt_256ms_close(void)
|
||||
{
|
||||
tusb_descriptor_endpoint_t int_edp_interval = desc_ept_interrupt_out;
|
||||
tusb_desc_endpoint_t int_edp_interval = desc_ept_interrupt_out;
|
||||
int_edp_interval.bInterval = 9;
|
||||
|
||||
pipe_hdl = hcd_pipe_open(dev_addr, &int_edp_interval, TUSB_CLASS_HID);
|
||||
|
||||
@@ -64,9 +64,9 @@ static ehci_qhd_t *period_head_arr;
|
||||
static ehci_qhd_t *p_qhd_interrupt;
|
||||
static pipe_handle_t pipe_hdl_interrupt;
|
||||
|
||||
static tusb_descriptor_endpoint_t const desc_ept_interrupt_in =
|
||||
static tusb_desc_endpoint_t const desc_ept_interrupt_in =
|
||||
{
|
||||
.bLength = sizeof(tusb_descriptor_endpoint_t),
|
||||
.bLength = sizeof(tusb_desc_endpoint_t),
|
||||
.bDescriptorType = TUSB_DESC_TYPE_ENDPOINT,
|
||||
.bEndpointAddress = 0x81,
|
||||
.bmAttributes = { .xfer = TUSB_XFER_INTERRUPT },
|
||||
@@ -74,9 +74,9 @@ static tusb_descriptor_endpoint_t const desc_ept_interrupt_in =
|
||||
.bInterval = 2
|
||||
};
|
||||
|
||||
static tusb_descriptor_endpoint_t const desc_ept_interupt_out =
|
||||
static tusb_desc_endpoint_t const desc_ept_interupt_out =
|
||||
{
|
||||
.bLength = sizeof(tusb_descriptor_endpoint_t),
|
||||
.bLength = sizeof(tusb_desc_endpoint_t),
|
||||
.bDescriptorType = TUSB_DESC_TYPE_ENDPOINT,
|
||||
.bEndpointAddress = 0x01,
|
||||
.bmAttributes = { .xfer = TUSB_XFER_INTERRUPT },
|
||||
@@ -217,7 +217,7 @@ void test_interrupt_xfer_complete_isr_interval_less_than_1ms(void)
|
||||
|
||||
void test_interrupt_xfer_complete_isr_interval_2ms(void)
|
||||
{
|
||||
tusb_descriptor_endpoint_t desc_endpoint_2ms = desc_ept_interrupt_in;
|
||||
tusb_desc_endpoint_t desc_endpoint_2ms = desc_ept_interrupt_in;
|
||||
desc_endpoint_2ms.bInterval = 5;
|
||||
|
||||
pipe_handle_t pipe_hdl_2ms = hcd_pipe_open(dev_addr, &desc_endpoint_2ms, TUSB_CLASS_HID);
|
||||
|
||||
@@ -82,9 +82,9 @@ void tearDown(void)
|
||||
//--------------------------------------------------------------------+
|
||||
// TODO ISOCRHONOUS PIPE
|
||||
//--------------------------------------------------------------------+
|
||||
tusb_descriptor_endpoint_t const desc_ept_iso_in =
|
||||
tusb_desc_endpoint_t const desc_ept_iso_in =
|
||||
{
|
||||
.bLength = sizeof(tusb_descriptor_endpoint_t),
|
||||
.bLength = sizeof(tusb_desc_endpoint_t),
|
||||
.bDescriptorType = TUSB_DESC_TYPE_ENDPOINT,
|
||||
.bEndpointAddress = 0x83,
|
||||
.bmAttributes = { .xfer = TUSB_XFER_ISOCHRONOUS },
|
||||
|
||||
@@ -56,9 +56,9 @@ pipe_handle_t pipe_hdl;
|
||||
|
||||
extern hidh_interface_info_t keyboardh_data[TUSB_CFG_HOST_DEVICE_MAX];
|
||||
|
||||
tusb_descriptor_interface_t const *p_kbd_interface_desc = &desc_configuration.keyboard_interface;
|
||||
tusb_desc_interface_t const *p_kbd_interface_desc = &desc_configuration.keyboard_interface;
|
||||
tusb_hid_descriptor_hid_t const *p_kbh_hid_desc = &desc_configuration.keyboard_hid;
|
||||
tusb_descriptor_endpoint_t const *p_kdb_endpoint_desc = &desc_configuration.keyboard_endpoint;
|
||||
tusb_desc_endpoint_t const *p_kdb_endpoint_desc = &desc_configuration.keyboard_endpoint;
|
||||
|
||||
void setUp(void)
|
||||
{
|
||||
@@ -80,7 +80,7 @@ void tearDown(void)
|
||||
// //------------- Code Under TEST -------------//
|
||||
// TEST_ASSERT_EQUAL(TUSB_ERROR_NONE, hidh_open_subtask(dev_addr, p_kbd_interface_desc, &length) );
|
||||
//
|
||||
// TEST_ASSERT_EQUAL(sizeof(tusb_descriptor_interface_t) + sizeof(tusb_hid_descriptor_hid_t) + sizeof(tusb_descriptor_endpoint_t),
|
||||
// TEST_ASSERT_EQUAL(sizeof(tusb_desc_interface_t) + sizeof(tusb_hid_descriptor_hid_t) + sizeof(tusb_desc_endpoint_t),
|
||||
// length);
|
||||
//}
|
||||
|
||||
|
||||
@@ -58,8 +58,8 @@ extern hidh_interface_info_t mouseh_data[TUSB_CFG_HOST_DEVICE_MAX];
|
||||
hidh_interface_info_t *p_hidh_mouse;
|
||||
hid_mouse_report_t report;
|
||||
|
||||
tusb_descriptor_interface_t const *p_mouse_interface_desc = &desc_configuration.mouse_interface;
|
||||
tusb_descriptor_endpoint_t const *p_mouse_endpoint_desc = &desc_configuration.mouse_endpoint;
|
||||
tusb_desc_interface_t const *p_mouse_interface_desc = &desc_configuration.mouse_interface;
|
||||
tusb_desc_endpoint_t const *p_mouse_endpoint_desc = &desc_configuration.mouse_endpoint;
|
||||
|
||||
uint8_t dev_addr;
|
||||
|
||||
|
||||
@@ -67,8 +67,8 @@ hidh_interface_info_t *p_hidh_kbd;
|
||||
|
||||
hid_keyboard_report_t report;
|
||||
|
||||
tusb_descriptor_interface_t const *p_kbd_interface_desc = &desc_configuration.keyboard_interface;
|
||||
tusb_descriptor_endpoint_t const *p_kdb_endpoint_desc = &desc_configuration.keyboard_endpoint;
|
||||
tusb_desc_interface_t const *p_kbd_interface_desc = &desc_configuration.keyboard_interface;
|
||||
tusb_desc_endpoint_t const *p_kdb_endpoint_desc = &desc_configuration.keyboard_endpoint;
|
||||
|
||||
void setUp(void)
|
||||
{
|
||||
@@ -154,7 +154,7 @@ void test_keyboard_open_ok(void)
|
||||
|
||||
TEST_ASSERT_PIPE_HANDLE(pipe_hdl, p_hidh_kbd->pipe_hdl);
|
||||
TEST_ASSERT_EQUAL(8, p_hidh_kbd->report_size);
|
||||
TEST_ASSERT_EQUAL(sizeof(tusb_descriptor_interface_t) + sizeof(tusb_hid_descriptor_hid_t) + sizeof(tusb_descriptor_endpoint_t),
|
||||
TEST_ASSERT_EQUAL(sizeof(tusb_desc_interface_t) + sizeof(tusb_hid_descriptor_hid_t) + sizeof(tusb_desc_endpoint_t),
|
||||
length);
|
||||
TEST_ASSERT_EQUAL(p_kbd_interface_desc->bInterfaceNumber, p_hidh_kbd->interface_number);
|
||||
|
||||
|
||||
@@ -53,8 +53,8 @@ extern hidh_interface_info_t mouseh_data[TUSB_CFG_HOST_DEVICE_MAX];
|
||||
hidh_interface_info_t *p_hidh_mouse;
|
||||
hid_mouse_report_t report;
|
||||
|
||||
tusb_descriptor_interface_t const *p_mouse_interface_desc = &desc_configuration.mouse_interface;
|
||||
tusb_descriptor_endpoint_t const *p_mouse_endpoint_desc = &desc_configuration.mouse_endpoint;
|
||||
tusb_desc_interface_t const *p_mouse_interface_desc = &desc_configuration.mouse_interface;
|
||||
tusb_desc_endpoint_t const *p_mouse_endpoint_desc = &desc_configuration.mouse_endpoint;
|
||||
|
||||
uint8_t dev_addr;
|
||||
|
||||
@@ -125,7 +125,7 @@ void test_mouse_open_ok(void)
|
||||
|
||||
TEST_ASSERT_PIPE_HANDLE(pipe_hdl, p_hidh_mouse->pipe_hdl);
|
||||
TEST_ASSERT_EQUAL(8, p_hidh_mouse->report_size);
|
||||
TEST_ASSERT_EQUAL(sizeof(tusb_descriptor_interface_t) + sizeof(tusb_hid_descriptor_hid_t) + sizeof(tusb_descriptor_endpoint_t),
|
||||
TEST_ASSERT_EQUAL(sizeof(tusb_desc_interface_t) + sizeof(tusb_hid_descriptor_hid_t) + sizeof(tusb_desc_endpoint_t),
|
||||
length);
|
||||
TEST_ASSERT_EQUAL(p_mouse_interface_desc->bInterfaceNumber, p_hidh_mouse->interface_number);
|
||||
|
||||
|
||||
@@ -53,9 +53,9 @@
|
||||
|
||||
extern msch_interface_t msch_data[TUSB_CFG_HOST_DEVICE_MAX];
|
||||
|
||||
static tusb_descriptor_interface_t const *p_msc_interface_desc = &desc_configuration.msc_interface;
|
||||
static tusb_descriptor_endpoint_t const *p_edp_in = &desc_configuration.msc_endpoint_in;
|
||||
static tusb_descriptor_endpoint_t const *p_edp_out = &desc_configuration.msc_endpoint_out;
|
||||
static tusb_desc_interface_t const *p_msc_interface_desc = &desc_configuration.msc_interface;
|
||||
static tusb_desc_endpoint_t const *p_edp_in = &desc_configuration.msc_endpoint_in;
|
||||
static tusb_desc_endpoint_t const *p_edp_out = &desc_configuration.msc_endpoint_out;
|
||||
|
||||
static msch_interface_t* p_msc;
|
||||
|
||||
@@ -131,7 +131,7 @@ void test_open_desc_length(void)
|
||||
//------------- Code Under Test -------------//
|
||||
TEST_ASSERT_STATUS( msch_open_subtask(dev_addr, p_msc_interface_desc, &length) );
|
||||
|
||||
TEST_ASSERT_EQUAL(sizeof(tusb_descriptor_interface_t) + 2*sizeof(tusb_descriptor_endpoint_t),
|
||||
TEST_ASSERT_EQUAL(sizeof(tusb_desc_interface_t) + 2*sizeof(tusb_desc_endpoint_t),
|
||||
length);
|
||||
}
|
||||
|
||||
|
||||
@@ -186,27 +186,27 @@ tusb_error_t control_xfer_stub(uint8_t dev_addr, const tusb_control_request_t *
|
||||
return TUSB_ERROR_NONE;
|
||||
}
|
||||
|
||||
tusb_error_t stub_hidh_open(uint8_t dev_addr, tusb_descriptor_interface_t const *descriptor, uint16_t *p_length, int num_call)
|
||||
tusb_error_t stub_hidh_open(uint8_t dev_addr, tusb_desc_interface_t const *descriptor, uint16_t *p_length, int num_call)
|
||||
{
|
||||
*p_length = sizeof(tusb_descriptor_interface_t) + sizeof(tusb_hid_descriptor_hid_t) + sizeof(tusb_descriptor_endpoint_t);
|
||||
*p_length = sizeof(tusb_desc_interface_t) + sizeof(tusb_hid_descriptor_hid_t) + sizeof(tusb_desc_endpoint_t);
|
||||
return TUSB_ERROR_NONE;
|
||||
}
|
||||
|
||||
tusb_error_t stub_msch_open(uint8_t dev_addr, tusb_descriptor_interface_t const *descriptor, uint16_t *p_length, int num_call)
|
||||
tusb_error_t stub_msch_open(uint8_t dev_addr, tusb_desc_interface_t const *descriptor, uint16_t *p_length, int num_call)
|
||||
{
|
||||
*p_length = sizeof(tusb_descriptor_interface_t) + 2*sizeof(tusb_descriptor_endpoint_t);
|
||||
*p_length = sizeof(tusb_desc_interface_t) + 2*sizeof(tusb_desc_endpoint_t);
|
||||
return TUSB_ERROR_NONE;
|
||||
}
|
||||
|
||||
tusb_error_t stub_cdch_open(uint8_t dev_addr, tusb_descriptor_interface_t const *descriptor, uint16_t *p_length, int num_call)
|
||||
tusb_error_t stub_cdch_open(uint8_t dev_addr, tusb_desc_interface_t const *descriptor, uint16_t *p_length, int num_call)
|
||||
{
|
||||
*p_length =
|
||||
//------------- Comm Interface -------------//
|
||||
sizeof(tusb_descriptor_interface_t) + sizeof(cdc_desc_func_header_t) +
|
||||
sizeof(tusb_desc_interface_t) + sizeof(cdc_desc_func_header_t) +
|
||||
sizeof(cdc_desc_func_abstract_control_management_t) + sizeof(cdc_desc_func_union_t) +
|
||||
sizeof(tusb_descriptor_endpoint_t) +
|
||||
sizeof(tusb_desc_endpoint_t) +
|
||||
//------------- Data Interface -------------//
|
||||
sizeof(tusb_descriptor_interface_t) + 2*sizeof(tusb_descriptor_endpoint_t);
|
||||
sizeof(tusb_desc_interface_t) + 2*sizeof(tusb_desc_endpoint_t);
|
||||
|
||||
return TUSB_ERROR_NONE;
|
||||
}
|
||||
@@ -271,7 +271,7 @@ void test_enum_failed_get_9byte_config_desc(void)
|
||||
osal_mutex_reset_Expect( usbh_devices[0].control.mutex_hdl );
|
||||
|
||||
hcd_pipe_control_open_ExpectAndReturn(1, desc_device.bMaxPacketSize0, TUSB_ERROR_NONE);
|
||||
tusbh_device_attached_cb_ExpectAndReturn((tusb_descriptor_device_t*) enum_data_buffer, 1);
|
||||
tusbh_device_attached_cb_ExpectAndReturn((tusb_desc_device_t*) enum_data_buffer, 1);
|
||||
// tusbh_device_mount_failed_cb_Expect(TUSB_ERROR_USBH_MOUNT_DEVICE_NOT_RESPOND, NULL);
|
||||
|
||||
usbh_enumeration_task(NULL);
|
||||
@@ -290,7 +290,7 @@ void test_enum_failed_get_full_config_desc(void)
|
||||
osal_semaphore_reset_Expect( usbh_devices[0].control.sem_hdl );
|
||||
osal_mutex_reset_Expect( usbh_devices[0].control.mutex_hdl );
|
||||
hcd_pipe_control_open_ExpectAndReturn(1, desc_device.bMaxPacketSize0, TUSB_ERROR_NONE);
|
||||
tusbh_device_attached_cb_ExpectAndReturn((tusb_descriptor_device_t*) enum_data_buffer, 1);
|
||||
tusbh_device_attached_cb_ExpectAndReturn((tusb_desc_device_t*) enum_data_buffer, 1);
|
||||
// tusbh_device_mount_failed_cb_Expect(TUSB_ERROR_USBH_MOUNT_DEVICE_NOT_RESPOND, NULL);
|
||||
|
||||
usbh_enumeration_task(NULL);
|
||||
@@ -305,7 +305,7 @@ void test_enum_parse_config_desc(void)
|
||||
osal_semaphore_reset_Expect( usbh_devices[0].control.sem_hdl );
|
||||
osal_mutex_reset_Expect( usbh_devices[0].control.mutex_hdl );
|
||||
hcd_pipe_control_open_ExpectAndReturn(1, desc_device.bMaxPacketSize0, TUSB_ERROR_NONE);
|
||||
tusbh_device_attached_cb_ExpectAndReturn((tusb_descriptor_device_t*) enum_data_buffer, 1);
|
||||
tusbh_device_attached_cb_ExpectAndReturn((tusb_desc_device_t*) enum_data_buffer, 1);
|
||||
|
||||
// tusbh_device_mount_failed_cb_Expect(TUSB_ERROR_USBH_MOUNT_DEVICE_NOT_RESPOND, NULL); // fail to set configure
|
||||
|
||||
@@ -323,7 +323,7 @@ void test_enum_set_configure(void)
|
||||
osal_semaphore_reset_Expect( usbh_devices[0].control.sem_hdl );
|
||||
osal_mutex_reset_Expect( usbh_devices[0].control.mutex_hdl );
|
||||
hcd_pipe_control_open_ExpectAndReturn(1, desc_device.bMaxPacketSize0, TUSB_ERROR_NONE);
|
||||
tusbh_device_attached_cb_ExpectAndReturn((tusb_descriptor_device_t*) enum_data_buffer, 1);
|
||||
tusbh_device_attached_cb_ExpectAndReturn((tusb_desc_device_t*) enum_data_buffer, 1);
|
||||
|
||||
// class open TODO more class expect
|
||||
hidh_open_subtask_StubWithCallback(stub_hidh_open);
|
||||
|
||||
@@ -119,9 +119,9 @@ const uint8_t mouse_report_descriptor[] = {
|
||||
|
||||
|
||||
TUSB_CFG_ATTR_USBRAM ATTR_ALIGNED(4)
|
||||
tusb_descriptor_device_t const desc_device =
|
||||
tusb_desc_device_t const desc_device =
|
||||
{
|
||||
.bLength = sizeof(tusb_descriptor_device_t),
|
||||
.bLength = sizeof(tusb_desc_device_t),
|
||||
.bDescriptorType = TUSB_DESC_TYPE_DEVICE,
|
||||
.bcdUSB = 0x0200,
|
||||
.bDeviceClass = 0x00,
|
||||
@@ -147,7 +147,7 @@ const app_configuration_desc_t desc_configuration =
|
||||
{
|
||||
.configuration =
|
||||
{
|
||||
.bLength = sizeof(tusb_descriptor_configuration_t),
|
||||
.bLength = sizeof(tusb_desc_configuration_t),
|
||||
.bDescriptorType = TUSB_DESC_TYPE_CONFIGURATION,
|
||||
|
||||
.wTotalLength = sizeof(app_configuration_desc_t) - 1, // exclude termination
|
||||
@@ -162,7 +162,7 @@ const app_configuration_desc_t desc_configuration =
|
||||
//------------- HID Keyboard -------------//
|
||||
.keyboard_interface =
|
||||
{
|
||||
.bLength = sizeof(tusb_descriptor_interface_t),
|
||||
.bLength = sizeof(tusb_desc_interface_t),
|
||||
.bDescriptorType = TUSB_DESC_TYPE_INTERFACE,
|
||||
.bInterfaceNumber = 1,
|
||||
.bAlternateSetting = 0x00,
|
||||
@@ -186,7 +186,7 @@ const app_configuration_desc_t desc_configuration =
|
||||
|
||||
.keyboard_endpoint =
|
||||
{
|
||||
.bLength = sizeof(tusb_descriptor_endpoint_t),
|
||||
.bLength = sizeof(tusb_desc_endpoint_t),
|
||||
.bDescriptorType = TUSB_DESC_TYPE_ENDPOINT,
|
||||
.bEndpointAddress = 0x81,
|
||||
.bmAttributes = { .xfer = TUSB_XFER_INTERRUPT },
|
||||
@@ -197,7 +197,7 @@ const app_configuration_desc_t desc_configuration =
|
||||
//------------- HID Mouse -------------//
|
||||
.mouse_interface =
|
||||
{
|
||||
.bLength = sizeof(tusb_descriptor_interface_t),
|
||||
.bLength = sizeof(tusb_desc_interface_t),
|
||||
.bDescriptorType = TUSB_DESC_TYPE_INTERFACE,
|
||||
.bInterfaceNumber = 2,
|
||||
.bAlternateSetting = 0x00,
|
||||
@@ -221,7 +221,7 @@ const app_configuration_desc_t desc_configuration =
|
||||
|
||||
.mouse_endpoint =
|
||||
{
|
||||
.bLength = sizeof(tusb_descriptor_endpoint_t),
|
||||
.bLength = sizeof(tusb_desc_endpoint_t),
|
||||
.bDescriptorType = TUSB_DESC_TYPE_ENDPOINT,
|
||||
.bEndpointAddress = 0x82,
|
||||
.bmAttributes = { .xfer = TUSB_XFER_INTERRUPT },
|
||||
@@ -232,7 +232,7 @@ const app_configuration_desc_t desc_configuration =
|
||||
//------------- Mass Storage -------------//
|
||||
.msc_interface =
|
||||
{
|
||||
.bLength = sizeof(tusb_descriptor_interface_t),
|
||||
.bLength = sizeof(tusb_desc_interface_t),
|
||||
.bDescriptorType = TUSB_DESC_TYPE_INTERFACE,
|
||||
.bInterfaceNumber = 3,
|
||||
.bAlternateSetting = 0x00,
|
||||
@@ -245,7 +245,7 @@ const app_configuration_desc_t desc_configuration =
|
||||
|
||||
.msc_endpoint_in =
|
||||
{
|
||||
.bLength = sizeof(tusb_descriptor_endpoint_t),
|
||||
.bLength = sizeof(tusb_desc_endpoint_t),
|
||||
.bDescriptorType = TUSB_DESC_TYPE_ENDPOINT,
|
||||
.bEndpointAddress = 0x83,
|
||||
.bmAttributes = { .xfer = TUSB_XFER_BULK },
|
||||
@@ -255,7 +255,7 @@ const app_configuration_desc_t desc_configuration =
|
||||
|
||||
.msc_endpoint_out =
|
||||
{
|
||||
.bLength = sizeof(tusb_descriptor_endpoint_t),
|
||||
.bLength = sizeof(tusb_desc_endpoint_t),
|
||||
.bDescriptorType = TUSB_DESC_TYPE_ENDPOINT,
|
||||
.bEndpointAddress = 0x03,
|
||||
.bmAttributes = { .xfer = TUSB_XFER_BULK },
|
||||
@@ -266,7 +266,7 @@ const app_configuration_desc_t desc_configuration =
|
||||
//------------- CDC Serial -------------//
|
||||
.cdc_comm_interface =
|
||||
{
|
||||
.bLength = sizeof(tusb_descriptor_interface_t),
|
||||
.bLength = sizeof(tusb_desc_interface_t),
|
||||
.bDescriptorType = TUSB_DESC_TYPE_INTERFACE,
|
||||
.bInterfaceNumber = 4,
|
||||
.bAlternateSetting = 0,
|
||||
@@ -307,7 +307,7 @@ const app_configuration_desc_t desc_configuration =
|
||||
|
||||
.cdc_endpoint_notification =
|
||||
{
|
||||
.bLength = sizeof(tusb_descriptor_endpoint_t),
|
||||
.bLength = sizeof(tusb_desc_endpoint_t),
|
||||
.bDescriptorType = TUSB_DESC_TYPE_ENDPOINT,
|
||||
.bEndpointAddress = 0x84,
|
||||
.bmAttributes = { .xfer = TUSB_XFER_INTERRUPT },
|
||||
@@ -318,7 +318,7 @@ const app_configuration_desc_t desc_configuration =
|
||||
//------------- CDC Data Interface -------------//
|
||||
.cdc_data_interface =
|
||||
{
|
||||
.bLength = sizeof(tusb_descriptor_interface_t),
|
||||
.bLength = sizeof(tusb_desc_interface_t),
|
||||
.bDescriptorType = TUSB_DESC_TYPE_INTERFACE,
|
||||
.bInterfaceNumber = 5,
|
||||
.bAlternateSetting = 0x00,
|
||||
@@ -331,7 +331,7 @@ const app_configuration_desc_t desc_configuration =
|
||||
|
||||
.cdc_endpoint_out =
|
||||
{
|
||||
.bLength = sizeof(tusb_descriptor_endpoint_t),
|
||||
.bLength = sizeof(tusb_desc_endpoint_t),
|
||||
.bDescriptorType = TUSB_DESC_TYPE_ENDPOINT,
|
||||
.bEndpointAddress = 5,
|
||||
.bmAttributes = { .xfer = TUSB_XFER_BULK },
|
||||
@@ -341,7 +341,7 @@ const app_configuration_desc_t desc_configuration =
|
||||
|
||||
.cdc_endpoint_in =
|
||||
{
|
||||
.bLength = sizeof(tusb_descriptor_endpoint_t),
|
||||
.bLength = sizeof(tusb_desc_endpoint_t),
|
||||
.bDescriptorType = TUSB_DESC_TYPE_ENDPOINT,
|
||||
.bEndpointAddress = 0x85,
|
||||
.bmAttributes = { .xfer = TUSB_XFER_BULK },
|
||||
|
||||
@@ -63,60 +63,60 @@
|
||||
|
||||
typedef struct
|
||||
{
|
||||
tusb_descriptor_configuration_t configuration;
|
||||
tusb_desc_configuration_t configuration;
|
||||
|
||||
#if 0 //&& IAD_DESC_REQUIRED
|
||||
tusb_descriptor_interface_association_t CDC_IAD;
|
||||
tusb_desc_interface_assoc_t CDC_IAD;
|
||||
#endif
|
||||
|
||||
#if 0 //&& TUSB_CFG_DEVICE_CDC
|
||||
//CDC - Serial
|
||||
//CDC Control Interface
|
||||
tusb_descriptor_interface_t CDC_CCI_Interface;
|
||||
tusb_desc_interface_t CDC_CCI_Interface;
|
||||
CDC_HEADER_DESCRIPTOR CDC_Header;
|
||||
CDC_ABSTRACT_CONTROL_MANAGEMENT_DESCRIPTOR CDC_ACM;
|
||||
CDC_UNION_1SLAVE_DESCRIPTOR CDC_Union;
|
||||
tusb_descriptor_endpoint_t CDC_NotificationEndpoint;
|
||||
tusb_desc_endpoint_t CDC_NotificationEndpoint;
|
||||
|
||||
//CDC Data Interface
|
||||
tusb_descriptor_interface_t CDC_DCI_Interface;
|
||||
tusb_descriptor_endpoint_t CDC_DataOutEndpoint;
|
||||
tusb_descriptor_endpoint_t CDC_DataInEndpoint;
|
||||
tusb_desc_interface_t CDC_DCI_Interface;
|
||||
tusb_desc_endpoint_t CDC_DataOutEndpoint;
|
||||
tusb_desc_endpoint_t CDC_DataInEndpoint;
|
||||
#endif
|
||||
|
||||
//------------- HID Keyboard -------------//
|
||||
tusb_descriptor_interface_t keyboard_interface;
|
||||
tusb_desc_interface_t keyboard_interface;
|
||||
tusb_hid_descriptor_hid_t keyboard_hid;
|
||||
tusb_descriptor_endpoint_t keyboard_endpoint;
|
||||
tusb_desc_endpoint_t keyboard_endpoint;
|
||||
|
||||
//------------- HID Mouse -------------//
|
||||
tusb_descriptor_interface_t mouse_interface;
|
||||
tusb_desc_interface_t mouse_interface;
|
||||
tusb_hid_descriptor_hid_t mouse_hid;
|
||||
tusb_descriptor_endpoint_t mouse_endpoint;
|
||||
tusb_desc_endpoint_t mouse_endpoint;
|
||||
|
||||
//------------- Mass Storage -------------//
|
||||
tusb_descriptor_interface_t msc_interface;
|
||||
tusb_descriptor_endpoint_t msc_endpoint_in;
|
||||
tusb_descriptor_endpoint_t msc_endpoint_out;
|
||||
tusb_desc_interface_t msc_interface;
|
||||
tusb_desc_endpoint_t msc_endpoint_in;
|
||||
tusb_desc_endpoint_t msc_endpoint_out;
|
||||
|
||||
//------------- CDC Serial -------------//
|
||||
//CDC Control Interface
|
||||
tusb_descriptor_interface_t cdc_comm_interface;
|
||||
tusb_desc_interface_t cdc_comm_interface;
|
||||
cdc_desc_func_header_t cdc_header;
|
||||
cdc_desc_func_abstract_control_management_t cdc_acm;
|
||||
cdc_desc_func_union_t cdc_union;
|
||||
tusb_descriptor_endpoint_t cdc_endpoint_notification;
|
||||
tusb_desc_endpoint_t cdc_endpoint_notification;
|
||||
|
||||
//CDC Data Interface
|
||||
tusb_descriptor_interface_t cdc_data_interface;
|
||||
tusb_descriptor_endpoint_t cdc_endpoint_out;
|
||||
tusb_descriptor_endpoint_t cdc_endpoint_in;
|
||||
tusb_desc_interface_t cdc_data_interface;
|
||||
tusb_desc_endpoint_t cdc_endpoint_out;
|
||||
tusb_desc_endpoint_t cdc_endpoint_in;
|
||||
|
||||
|
||||
unsigned char ConfigDescTermination;
|
||||
} app_configuration_desc_t;
|
||||
|
||||
extern tusb_descriptor_device_t const desc_device;
|
||||
extern tusb_desc_device_t const desc_device;
|
||||
extern app_configuration_desc_t const desc_configuration;
|
||||
extern const uint8_t keyboard_report_descriptor[];
|
||||
|
||||
|
||||
@@ -60,9 +60,9 @@
|
||||
#include "usbh.h"
|
||||
|
||||
//------------- core -------------//
|
||||
uint8_t tusbh_device_attached_cb (tusb_descriptor_device_t const *p_desc_device) ATTR_WEAK ATTR_WARN_UNUSED_RESULT;
|
||||
uint8_t tusbh_device_attached_cb (tusb_desc_device_t const *p_desc_device) ATTR_WEAK ATTR_WARN_UNUSED_RESULT;
|
||||
void tusbh_device_mount_succeed_cb (uint8_t dev_addr) ATTR_WEAK;
|
||||
void tusbh_device_mount_failed_cb(tusb_error_t error, tusb_descriptor_device_t const *p_desc_device) ATTR_WEAK;
|
||||
void tusbh_device_mount_failed_cb(tusb_error_t error, tusb_desc_device_t const *p_desc_device) ATTR_WEAK;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user