diff options
| author | Ha Thach <[email protected]> | 2021-08-29 21:49:10 +0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-08-29 21:49:10 +0700 |
| commit | 4492a7021cb33cb3079f2e949d6e22ddd3d33f49 (patch) | |
| tree | b14be02e6d0a7d632e320431cc3543e123de78fa /src/common | |
| parent | 61592526928be9626317ef82bbe42d0edaf7fa14 (diff) | |
| parent | 31959295965f6b19c35bb770b1e430bdfa7b4606 (diff) | |
Merge branch 'master' into merge-waveshare-h7
Diffstat (limited to 'src/common')
| -rw-r--r-- | src/common/tusb_common.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/common/tusb_common.h b/src/common/tusb_common.h index c8a66a879..c2356ffee 100644 --- a/src/common/tusb_common.h +++ b/src/common/tusb_common.h @@ -73,6 +73,23 @@ #include "tusb_error.h" // TODO remove #include "tusb_timeout.h" // TODO remove +//--------------------------------------------------------------------+ +// Internal Helper used by Host and Device Stack +//--------------------------------------------------------------------+ + +// Check if endpoint descriptor is valid per USB specs +bool tu_edpt_validate(tusb_desc_endpoint_t const * desc_ep, tusb_speed_t speed); + +// Bind all endpoint of a interface descriptor to class driver +void tu_edpt_bind_driver(uint8_t ep2drv[][2], tusb_desc_interface_t const* p_desc, uint16_t desc_len, uint8_t driver_id); + +// Calculate total length of n interfaces (depending on IAD) +uint16_t tu_desc_get_interface_total_len(tusb_desc_interface_t const* desc_itf, uint8_t itf_count, uint16_t max_len); + +//--------------------------------------------------------------------+ +// Internal Inline Functions +//--------------------------------------------------------------------+ + //------------- Mem -------------// #define tu_memclr(buffer, size) memset((buffer), 0, (size)) #define tu_varclr(_var) tu_memclr(_var, sizeof(*(_var))) |
