mirror of
https://github.com/hathach/tinyusb.git
synced 2025-03-25 23:38:06 +00:00
Merge pull request #379 from hathach/add-usbd-edpt-open
add usbd edpt open
This commit is contained in:
commit
d54343e4a6
@ -84,7 +84,7 @@ endif
|
|||||||
ifeq ($(LOGGER),rtt)
|
ifeq ($(LOGGER),rtt)
|
||||||
RTT_SRC = lib/SEGGER_RTT
|
RTT_SRC = lib/SEGGER_RTT
|
||||||
|
|
||||||
CFLAGS += -DLOGGER_RTT
|
CFLAGS += -DLOGGER_RTT -DSEGGER_RTT_MODE_DEFAULT=SEGGER_RTT_MODE_BLOCK_IF_FIFO_FULL
|
||||||
INC += $(TOP)/$(RTT_SRC)/RTT
|
INC += $(TOP)/$(RTT_SRC)/RTT
|
||||||
SRC_C += $(RTT_SRC)/RTT/SEGGER_RTT_printf.c
|
SRC_C += $(RTT_SRC)/RTT/SEGGER_RTT_printf.c
|
||||||
SRC_C += $(RTT_SRC)/RTT/SEGGER_RTT.c
|
SRC_C += $(RTT_SRC)/RTT/SEGGER_RTT.c
|
||||||
|
@ -260,7 +260,7 @@ bool cdcd_open(uint8_t rhport, tusb_desc_interface_t const * itf_desc, uint16_t
|
|||||||
if ( TUSB_DESC_ENDPOINT == tu_desc_type(p_desc) )
|
if ( TUSB_DESC_ENDPOINT == tu_desc_type(p_desc) )
|
||||||
{
|
{
|
||||||
// notification endpoint if any
|
// notification endpoint if any
|
||||||
TU_ASSERT( dcd_edpt_open(rhport, (tusb_desc_endpoint_t const *) p_desc) );
|
TU_ASSERT( usbd_edpt_open(rhport, (tusb_desc_endpoint_t const *) p_desc) );
|
||||||
|
|
||||||
p_cdc->ep_notif = ((tusb_desc_endpoint_t const *) p_desc)->bEndpointAddress;
|
p_cdc->ep_notif = ((tusb_desc_endpoint_t const *) p_desc)->bEndpointAddress;
|
||||||
|
|
||||||
|
@ -339,7 +339,7 @@ bool midid_open(uint8_t rhport, tusb_desc_interface_t const * desc_itf, uint16_t
|
|||||||
{
|
{
|
||||||
if ( TUSB_DESC_ENDPOINT == p_desc[DESC_OFFSET_TYPE])
|
if ( TUSB_DESC_ENDPOINT == p_desc[DESC_OFFSET_TYPE])
|
||||||
{
|
{
|
||||||
TU_ASSERT( dcd_edpt_open(rhport, (tusb_desc_endpoint_t const *) p_desc), false);
|
TU_ASSERT( usbd_edpt_open(rhport, (tusb_desc_endpoint_t const *) p_desc), false);
|
||||||
uint8_t ep_addr = ((tusb_desc_endpoint_t const *) p_desc)->bEndpointAddress;
|
uint8_t ep_addr = ((tusb_desc_endpoint_t const *) p_desc)->bEndpointAddress;
|
||||||
if (tu_edpt_dir(ep_addr) == TUSB_DIR_IN) {
|
if (tu_edpt_dir(ep_addr) == TUSB_DIR_IN) {
|
||||||
p_midi->ep_in = ep_addr;
|
p_midi->ep_in = ep_addr;
|
||||||
|
@ -167,7 +167,7 @@ bool netd_open(uint8_t rhport, tusb_desc_interface_t const * itf_desc, uint16_t
|
|||||||
// notification endpoint (if any)
|
// notification endpoint (if any)
|
||||||
if ( TUSB_DESC_ENDPOINT == tu_desc_type(p_desc) )
|
if ( TUSB_DESC_ENDPOINT == tu_desc_type(p_desc) )
|
||||||
{
|
{
|
||||||
TU_ASSERT( dcd_edpt_open(rhport, (tusb_desc_endpoint_t const *) p_desc) );
|
TU_ASSERT( usbd_edpt_open(rhport, (tusb_desc_endpoint_t const *) p_desc) );
|
||||||
|
|
||||||
_netd_itf.ep_notif = ((tusb_desc_endpoint_t const *) p_desc)->bEndpointAddress;
|
_netd_itf.ep_notif = ((tusb_desc_endpoint_t const *) p_desc)->bEndpointAddress;
|
||||||
|
|
||||||
|
@ -309,7 +309,7 @@ bool usbtmcd_open_cb(uint8_t rhport, tusb_desc_interface_t const * itf_desc, uin
|
|||||||
default:
|
default:
|
||||||
TU_ASSERT(false);
|
TU_ASSERT(false);
|
||||||
}
|
}
|
||||||
TU_VERIFY( dcd_edpt_open(rhport, ep_desc));
|
TU_VERIFY( usbd_edpt_open(rhport, ep_desc));
|
||||||
found_endpoints++;
|
found_endpoints++;
|
||||||
}
|
}
|
||||||
(*p_length) = (uint8_t)((*p_length) + p_desc[DESC_OFFSET_LEN]);
|
(*p_length) = (uint8_t)((*p_length) + p_desc[DESC_OFFSET_LEN]);
|
||||||
|
@ -219,17 +219,25 @@ void tu_print_mem(void const *buf, uint16_t count, uint8_t indent);
|
|||||||
#define tu_printf printf
|
#define tu_printf printf
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
static inline
|
||||||
|
void tu_print_var(uint8_t const* buf, uint32_t bufsize)
|
||||||
|
{
|
||||||
|
for(uint32_t i=0; i<bufsize; i++) tu_printf("%02X ", buf[i]);
|
||||||
|
}
|
||||||
|
|
||||||
// Log with debug level 1
|
// Log with debug level 1
|
||||||
#define TU_LOG1 tu_printf
|
#define TU_LOG1 tu_printf
|
||||||
#define TU_LOG1_MEM tu_print_mem
|
#define TU_LOG1_MEM tu_print_mem
|
||||||
|
#define TU_LOG1_VAR(_x) tu_print_var((uint8_t const*)(_x), sizeof(*(_x)))
|
||||||
|
#define TU_LOG1_INT(_x) tu_printf(#_x " = %ld\n", (uint32_t) (_x) )
|
||||||
|
#define TU_LOG1_HEX(_x) tu_printf(#_x " = %lX\n", (uint32_t) (_x) )
|
||||||
#define TU_LOG1_LOCATION() tu_printf("%s: %d:\r\n", __PRETTY_FUNCTION__, __LINE__)
|
#define TU_LOG1_LOCATION() tu_printf("%s: %d:\r\n", __PRETTY_FUNCTION__, __LINE__)
|
||||||
#define TU_LOG1_INT(x) tu_printf(#x " = %ld\n", (uint32_t) (x) )
|
|
||||||
#define TU_LOG1_HEX(x) tu_printf(#x " = %lX\n", (uint32_t) (x) )
|
|
||||||
|
|
||||||
// Log with debug level 2
|
// Log with debug level 2
|
||||||
#if CFG_TUSB_DEBUG > 1
|
#if CFG_TUSB_DEBUG > 1
|
||||||
#define TU_LOG2 TU_LOG1
|
#define TU_LOG2 TU_LOG1
|
||||||
#define TU_LOG2_MEM TU_LOG1_MEM
|
#define TU_LOG2_MEM TU_LOG1_MEM
|
||||||
|
#define TU_LOG2_VAR TU_LOG1_VAR
|
||||||
#define TU_LOG2_LOCATION() TU_LOG1_LOCATION()
|
#define TU_LOG2_LOCATION() TU_LOG1_LOCATION()
|
||||||
#define TU_LOG2_INT TU_LOG1_INT
|
#define TU_LOG2_INT TU_LOG1_INT
|
||||||
#define TU_LOG2_HEX TU_LOG1_HEX
|
#define TU_LOG2_HEX TU_LOG1_HEX
|
||||||
@ -263,11 +271,17 @@ static inline char const* lookup_find(lookup_table_t const* p_table, uint32_t ke
|
|||||||
#ifndef TU_LOG1
|
#ifndef TU_LOG1
|
||||||
#define TU_LOG1(...)
|
#define TU_LOG1(...)
|
||||||
#define TU_LOG1_MEM(...)
|
#define TU_LOG1_MEM(...)
|
||||||
|
#define TU_LOG1_VAR(...)
|
||||||
|
#define TU_LOG1_INT(...)
|
||||||
|
#define TU_LOG1_HEX(...)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef TU_LOG2
|
#ifndef TU_LOG2
|
||||||
#define TU_LOG2(...)
|
#define TU_LOG2(...)
|
||||||
#define TU_LOG2_MEM(...)
|
#define TU_LOG2_MEM(...)
|
||||||
|
#define TU_LOG2_VAR(...)
|
||||||
|
#define TU_LOG2_INT(...)
|
||||||
|
#define TU_LOG2_HEX(...)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
@ -90,13 +90,13 @@
|
|||||||
volatile uint32_t* ARM_CM_DHCSR = ((volatile uint32_t*) 0xE000EDF0UL); /* Cortex M CoreDebug->DHCSR */ \
|
volatile uint32_t* ARM_CM_DHCSR = ((volatile uint32_t*) 0xE000EDF0UL); /* Cortex M CoreDebug->DHCSR */ \
|
||||||
if ( (*ARM_CM_DHCSR) & 1UL ) __asm("BKPT #0\n"); /* Only halt mcu if debugger is attached */ \
|
if ( (*ARM_CM_DHCSR) & 1UL ) __asm("BKPT #0\n"); /* Only halt mcu if debugger is attached */ \
|
||||||
} while(0)
|
} while(0)
|
||||||
#else
|
|
||||||
#if defined(__riscv)
|
#elif defined(__riscv)
|
||||||
#define TU_BREAKPOINT() do { __asm("ebreak\n"); } while(0)
|
#define TU_BREAKPOINT() do { __asm("ebreak\n"); } while(0)
|
||||||
|
|
||||||
#else
|
#else
|
||||||
#define TU_BREAKPOINT() do {} while (0)
|
#define TU_BREAKPOINT() do {} while (0)
|
||||||
#endif
|
#endif
|
||||||
#endif
|
|
||||||
|
|
||||||
/*------------------------------------------------------------------*/
|
/*------------------------------------------------------------------*/
|
||||||
/* Macro Generator
|
/* Macro Generator
|
||||||
|
@ -356,7 +356,8 @@ void tud_task (void)
|
|||||||
|
|
||||||
if ( !osal_queue_receive(_usbd_q, &event) ) return;
|
if ( !osal_queue_receive(_usbd_q, &event) ) return;
|
||||||
|
|
||||||
TU_LOG2("USBD: event %s\r\n", event.event_id < DCD_EVENT_COUNT ? _usbd_event_str[event.event_id] : "CORRUPTED");
|
TU_LOG2("USBD: %s", event.event_id < DCD_EVENT_COUNT ? _usbd_event_str[event.event_id] : "CORRUPTED");
|
||||||
|
TU_LOG2("%s", (event.event_id != DCD_EVENT_XFER_COMPLETE && event.event_id != DCD_EVENT_SETUP_RECEIVED) ? "\r\n" : " ");
|
||||||
|
|
||||||
switch ( event.event_id )
|
switch ( event.event_id )
|
||||||
{
|
{
|
||||||
@ -372,7 +373,8 @@ void tud_task (void)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case DCD_EVENT_SETUP_RECEIVED:
|
case DCD_EVENT_SETUP_RECEIVED:
|
||||||
TU_LOG2_MEM(&event.setup_received, 8, 2);
|
TU_LOG2_VAR(&event.setup_received);
|
||||||
|
TU_LOG2("\r\n");
|
||||||
|
|
||||||
// Mark as connected after receiving 1st setup packet.
|
// Mark as connected after receiving 1st setup packet.
|
||||||
// But it is easier to set it every time instead of wasting time to check then set
|
// But it is easier to set it every time instead of wasting time to check then set
|
||||||
@ -395,7 +397,7 @@ void tud_task (void)
|
|||||||
uint8_t const epnum = tu_edpt_number(ep_addr);
|
uint8_t const epnum = tu_edpt_number(ep_addr);
|
||||||
uint8_t const ep_dir = tu_edpt_dir(ep_addr);
|
uint8_t const ep_dir = tu_edpt_dir(ep_addr);
|
||||||
|
|
||||||
TU_LOG2(" Endpoint: 0x%02X, Bytes: %u\r\n", ep_addr, (unsigned int) event.xfer_complete.len);
|
TU_LOG2("on EP %02X with %u bytes\r\n", ep_addr, (unsigned int) event.xfer_complete.len);
|
||||||
|
|
||||||
_usbd_dev.ep_status[epnum][ep_dir].busy = false;
|
_usbd_dev.ep_status[epnum][ep_dir].busy = false;
|
||||||
|
|
||||||
@ -472,10 +474,11 @@ static bool process_control_request(uint8_t rhport, tusb_control_request_t const
|
|||||||
return tud_vendor_control_request_cb(rhport, p_request);
|
return tud_vendor_control_request_cb(rhport, p_request);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if CFG_TUSB_DEBUG > 1
|
#if CFG_TUSB_DEBUG >= 2
|
||||||
if (TUSB_REQ_TYPE_STANDARD == p_request->bmRequestType_bit.type && p_request->bRequest <= TUSB_REQ_SYNCH_FRAME)
|
if (TUSB_REQ_TYPE_STANDARD == p_request->bmRequestType_bit.type && p_request->bRequest <= TUSB_REQ_SYNCH_FRAME)
|
||||||
{
|
{
|
||||||
TU_LOG2(" %s\r\n", _tusb_std_request_str[p_request->bRequest]);
|
TU_LOG2(" %s", _tusb_std_request_str[p_request->bRequest]);
|
||||||
|
if (TUSB_REQ_GET_DESCRIPTOR != p_request->bRequest) TU_LOG2("\r\n");
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -702,7 +705,7 @@ static bool process_set_config(uint8_t rhport, uint8_t cfg_num)
|
|||||||
// Interface number must not be used already
|
// Interface number must not be used already
|
||||||
TU_ASSERT( DRVID_INVALID == _usbd_dev.itf2drv[desc_itf->bInterfaceNumber] );
|
TU_ASSERT( DRVID_INVALID == _usbd_dev.itf2drv[desc_itf->bInterfaceNumber] );
|
||||||
|
|
||||||
TU_LOG2(" %s open\r\n", _usbd_driver[drv_id].name);
|
TU_LOG2(" %s opened\r\n", _usbd_driver[drv_id].name);
|
||||||
_usbd_dev.itf2drv[desc_itf->bInterfaceNumber] = drv_id;
|
_usbd_dev.itf2drv[desc_itf->bInterfaceNumber] = drv_id;
|
||||||
|
|
||||||
// If IAD exist, assign all interfaces to the same driver
|
// If IAD exist, assign all interfaces to the same driver
|
||||||
@ -767,6 +770,8 @@ static bool process_get_descriptor(uint8_t rhport, tusb_control_request_t const
|
|||||||
{
|
{
|
||||||
case TUSB_DESC_DEVICE:
|
case TUSB_DESC_DEVICE:
|
||||||
{
|
{
|
||||||
|
TU_LOG2(" Device\r\n");
|
||||||
|
|
||||||
uint16_t len = sizeof(tusb_desc_device_t);
|
uint16_t len = sizeof(tusb_desc_device_t);
|
||||||
|
|
||||||
// Only send up to EP0 Packet Size if not addressed
|
// Only send up to EP0 Packet Size if not addressed
|
||||||
@ -785,6 +790,8 @@ static bool process_get_descriptor(uint8_t rhport, tusb_control_request_t const
|
|||||||
|
|
||||||
case TUSB_DESC_BOS:
|
case TUSB_DESC_BOS:
|
||||||
{
|
{
|
||||||
|
TU_LOG2(" BOS\r\n");
|
||||||
|
|
||||||
// requested by host if USB > 2.0 ( i.e 2.1 or 3.x )
|
// requested by host if USB > 2.0 ( i.e 2.1 or 3.x )
|
||||||
if (!tud_descriptor_bos_cb) return false;
|
if (!tud_descriptor_bos_cb) return false;
|
||||||
|
|
||||||
@ -798,6 +805,8 @@ static bool process_get_descriptor(uint8_t rhport, tusb_control_request_t const
|
|||||||
|
|
||||||
case TUSB_DESC_CONFIGURATION:
|
case TUSB_DESC_CONFIGURATION:
|
||||||
{
|
{
|
||||||
|
TU_LOG2(" Configuration[%u]\r\n", desc_index);
|
||||||
|
|
||||||
tusb_desc_configuration_t const* desc_config = (tusb_desc_configuration_t const*) tud_descriptor_configuration_cb(desc_index);
|
tusb_desc_configuration_t const* desc_config = (tusb_desc_configuration_t const*) tud_descriptor_configuration_cb(desc_index);
|
||||||
TU_ASSERT(desc_config);
|
TU_ASSERT(desc_config);
|
||||||
|
|
||||||
@ -809,6 +818,8 @@ static bool process_get_descriptor(uint8_t rhport, tusb_control_request_t const
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case TUSB_DESC_STRING:
|
case TUSB_DESC_STRING:
|
||||||
|
TU_LOG2(" String[%u]\r\n", desc_index);
|
||||||
|
|
||||||
// String Descriptor always uses the desc set from user
|
// String Descriptor always uses the desc set from user
|
||||||
if ( desc_index == 0xEE )
|
if ( desc_index == 0xEE )
|
||||||
{
|
{
|
||||||
@ -827,6 +838,8 @@ static bool process_get_descriptor(uint8_t rhport, tusb_control_request_t const
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case TUSB_DESC_DEVICE_QUALIFIER:
|
case TUSB_DESC_DEVICE_QUALIFIER:
|
||||||
|
TU_LOG2(" Device Qualifier\r\n");
|
||||||
|
|
||||||
// TODO If not highspeed capable stall this request otherwise
|
// TODO If not highspeed capable stall this request otherwise
|
||||||
// return the descriptor that could work in highspeed
|
// return the descriptor that could work in highspeed
|
||||||
return false;
|
return false;
|
||||||
@ -920,7 +933,7 @@ bool usbd_open_edpt_pair(uint8_t rhport, uint8_t const* p_desc, uint8_t ep_count
|
|||||||
tusb_desc_endpoint_t const * desc_ep = (tusb_desc_endpoint_t const *) p_desc;
|
tusb_desc_endpoint_t const * desc_ep = (tusb_desc_endpoint_t const *) p_desc;
|
||||||
|
|
||||||
TU_ASSERT(TUSB_DESC_ENDPOINT == desc_ep->bDescriptorType && xfer_type == desc_ep->bmAttributes.xfer);
|
TU_ASSERT(TUSB_DESC_ENDPOINT == desc_ep->bDescriptorType && xfer_type == desc_ep->bmAttributes.xfer);
|
||||||
TU_ASSERT(dcd_edpt_open(rhport, desc_ep));
|
TU_ASSERT(usbd_edpt_open(rhport, desc_ep));
|
||||||
|
|
||||||
if ( tu_edpt_dir(desc_ep->bEndpointAddress) == TUSB_DIR_IN )
|
if ( tu_edpt_dir(desc_ep->bEndpointAddress) == TUSB_DIR_IN )
|
||||||
{
|
{
|
||||||
@ -955,15 +968,24 @@ void usbd_defer_func(osal_task_func_t func, void* param, bool in_isr)
|
|||||||
// USBD Endpoint API
|
// USBD Endpoint API
|
||||||
//--------------------------------------------------------------------+
|
//--------------------------------------------------------------------+
|
||||||
|
|
||||||
|
bool usbd_edpt_open(uint8_t rhport, tusb_desc_endpoint_t const * desc_ep)
|
||||||
|
{
|
||||||
|
TU_LOG2(" Open EP %02X with Size = %u\r\n", desc_ep->bEndpointAddress, desc_ep->wMaxPacketSize.size);
|
||||||
|
|
||||||
|
return dcd_edpt_open(rhport, desc_ep);
|
||||||
|
}
|
||||||
|
|
||||||
bool usbd_edpt_xfer(uint8_t rhport, uint8_t ep_addr, uint8_t * buffer, uint16_t total_bytes)
|
bool usbd_edpt_xfer(uint8_t rhport, uint8_t ep_addr, uint8_t * buffer, uint16_t total_bytes)
|
||||||
{
|
{
|
||||||
uint8_t const epnum = tu_edpt_number(ep_addr);
|
uint8_t const epnum = tu_edpt_number(ep_addr);
|
||||||
uint8_t const dir = tu_edpt_dir(ep_addr);
|
uint8_t const dir = tu_edpt_dir(ep_addr);
|
||||||
|
|
||||||
|
TU_LOG2(" Queue EP %02X with %u bytes ... ", ep_addr, total_bytes);
|
||||||
|
|
||||||
TU_VERIFY( dcd_edpt_xfer(rhport, ep_addr, buffer, total_bytes) );
|
TU_VERIFY( dcd_edpt_xfer(rhport, ep_addr, buffer, total_bytes) );
|
||||||
_usbd_dev.ep_status[epnum][dir].busy = true;
|
_usbd_dev.ep_status[epnum][dir].busy = true;
|
||||||
|
|
||||||
TU_LOG2(" XFER Endpoint: 0x%02X, Bytes: %d\r\n", ep_addr, total_bytes);
|
TU_LOG2("OK\r\n");
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -63,7 +63,7 @@ static inline bool _status_stage_xact(uint8_t rhport, tusb_control_request_t con
|
|||||||
// Opposite to endpoint in Data Phase
|
// Opposite to endpoint in Data Phase
|
||||||
uint8_t const ep_addr = request->bmRequestType_bit.direction ? EDPT_CTRL_OUT : EDPT_CTRL_IN;
|
uint8_t const ep_addr = request->bmRequestType_bit.direction ? EDPT_CTRL_OUT : EDPT_CTRL_IN;
|
||||||
|
|
||||||
TU_LOG2(" XFER Endpoint: 0x%02X, Bytes: %d\r\n", ep_addr, 0);
|
TU_LOG2(" Queue EP %02X with zlp Status\r\n", ep_addr);
|
||||||
|
|
||||||
// status direction is reversed to one in the setup packet
|
// status direction is reversed to one in the setup packet
|
||||||
// Note: Status must always be DATA1
|
// Note: Status must always be DATA1
|
||||||
@ -96,7 +96,7 @@ static bool _data_stage_xact(uint8_t rhport)
|
|||||||
if ( xact_len ) memcpy(_usbd_ctrl_buf, _ctrl_xfer.buffer, xact_len);
|
if ( xact_len ) memcpy(_usbd_ctrl_buf, _ctrl_xfer.buffer, xact_len);
|
||||||
}
|
}
|
||||||
|
|
||||||
TU_LOG2(" XACT Control: 0x%02X, Bytes: %d\r\n", ep_addr, xact_len);
|
TU_LOG2(" Queue EP %02X with %u bytes\r\n", ep_addr, xact_len);
|
||||||
|
|
||||||
return dcd_edpt_xfer(rhport, ep_addr, xact_len ? _usbd_ctrl_buf : NULL, xact_len);
|
return dcd_edpt_xfer(rhport, ep_addr, xact_len ? _usbd_ctrl_buf : NULL, xact_len);
|
||||||
}
|
}
|
||||||
@ -118,7 +118,7 @@ bool tud_control_xfer(uint8_t rhport, tusb_control_request_t const * request, vo
|
|||||||
TU_ASSERT(buffer);
|
TU_ASSERT(buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
TU_LOG2(" XFER Endpoint: 0x%02X, Bytes: %d\r\n", request->bmRequestType_bit.direction ? EDPT_CTRL_IN : EDPT_CTRL_OUT, _ctrl_xfer.data_len);
|
// TU_LOG2(" Control total data length is %u bytes\r\n", _ctrl_xfer.data_len);
|
||||||
|
|
||||||
// Data stage
|
// Data stage
|
||||||
TU_ASSERT( _data_stage_xact(rhport) );
|
TU_ASSERT( _data_stage_xact(rhport) );
|
||||||
|
@ -37,7 +37,10 @@
|
|||||||
// USBD Endpoint API
|
// USBD Endpoint API
|
||||||
//--------------------------------------------------------------------+
|
//--------------------------------------------------------------------+
|
||||||
|
|
||||||
//bool usbd_edpt_open(uint8_t rhport, tusb_desc_endpoint_t const * p_endpoint_desc);
|
// Open an endpoint
|
||||||
|
bool usbd_edpt_open(uint8_t rhport, tusb_desc_endpoint_t const * desc_ep);
|
||||||
|
|
||||||
|
// Close an endpoint
|
||||||
void usbd_edpt_close(uint8_t rhport, uint8_t ep_addr);
|
void usbd_edpt_close(uint8_t rhport, uint8_t ep_addr);
|
||||||
|
|
||||||
// Submit a usb transfer
|
// Submit a usb transfer
|
||||||
|
@ -78,9 +78,11 @@ static void dump_str_line(uint8_t const* buf, uint16_t count)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// size : item size in bytes
|
/* Print out memory contents
|
||||||
// count : number of item
|
* - size : item size in bytes
|
||||||
// print offet or not (handfy for dumping large memory)
|
* - count : number of item
|
||||||
|
* - indent: prefix spaces on every line
|
||||||
|
*/
|
||||||
void tu_print_mem(void const *buf, uint16_t count, uint8_t indent)
|
void tu_print_mem(void const *buf, uint16_t count, uint8_t indent)
|
||||||
{
|
{
|
||||||
uint8_t const size = 1; // fixed 1 byte for now
|
uint8_t const size = 1; // fixed 1 byte for now
|
||||||
|
@ -52,7 +52,9 @@
|
|||||||
#define CFG_TUSB_OS OPT_OS_NONE
|
#define CFG_TUSB_OS OPT_OS_NONE
|
||||||
|
|
||||||
// CFG_TUSB_DEBUG is defined by compiler in DEBUG build
|
// CFG_TUSB_DEBUG is defined by compiler in DEBUG build
|
||||||
|
#ifndef CFG_TUSB_DEBUG
|
||||||
#define CFG_TUSB_DEBUG 0
|
#define CFG_TUSB_DEBUG 0
|
||||||
|
#endif
|
||||||
|
|
||||||
/* USB DMA on some MCUs can only access a specific SRAM region with restriction on alignment.
|
/* USB DMA on some MCUs can only access a specific SRAM region with restriction on alignment.
|
||||||
* Tinyusb use follows macros to declare transferring memory so that they can be put
|
* Tinyusb use follows macros to declare transferring memory so that they can be put
|
||||||
|
Loading…
x
Reference in New Issue
Block a user