adding bulk/int support

still does not work though
This commit is contained in:
hathach
2018-03-17 02:17:40 +07:00
parent 87a2c935df
commit 7a628f4dfc
8 changed files with 255 additions and 194 deletions

View File

@@ -213,6 +213,22 @@ static inline uint8_t std_class_code_to_index(uint8_t std_class_code)
(std_class_code == TUSB_CLASS_VENDOR_SPECIFIC ) ? TUSB_CLASS_MAPPED_INDEX_START + 4 : 0;
}
// Get direction from Endpoint address
static inline tusb_dir_t edpt_dir(uint8_t addr)
{
return (addr & TUSB_DIR_IN_MASK) ? TUSB_DIR_IN : TUSB_DIR_OUT;
}
// Get Endpoint number from address
static inline uint8_t edpt_number(uint8_t addr)
{
return addr & (~TUSB_DIR_IN_MASK);
}
static inline uint8_t edpt_addr(uint8_t num, tusb_dir_t dir)
{
return num | (dir == TUSB_DIR_IN ? TUSB_DIR_IN_MASK : 0);
}
#ifdef __cplusplus
}