implement msc device class
usbd auto stall control for not supported return from class control request usbd implement xfer isr callback mechanism DCD - implement dcd multiple qtd support - dcd dcd_pipe_stall - implement dcd_pipe_queue_xfer - xfer_complete_isr - flush control endpoint if received new setup while previous transfer is not complete change msc_cmd_block_wrapper_t flags field to dir force full speed for easy testing NOTEs: somehow unable to get endpoint IN interrupt with ioc
This commit is contained in:
@@ -51,6 +51,14 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// MACROS
|
||||
//--------------------------------------------------------------------+
|
||||
#define STRING_(x) #x // stringify without expand
|
||||
#define XSTRING_(x) STRING_(x) // expand then stringify
|
||||
#define STRING_CONCAT_(a, b) a##b // concat without expand
|
||||
#define XSTRING_CONCAT_(a, b) STRING_CONCAT_(a, b) // expand then concat
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// INCLUDES
|
||||
//--------------------------------------------------------------------+
|
||||
@@ -75,6 +83,7 @@
|
||||
#include "std_descriptors.h"
|
||||
#include "std_request.h"
|
||||
|
||||
|
||||
//--------------------------------------------------------------------+
|
||||
// MACROS
|
||||
//--------------------------------------------------------------------+
|
||||
|
||||
@@ -86,11 +86,14 @@
|
||||
ENTRY(TUSB_ERROR_CDCH_UNSUPPORTED_SUBCLASS )\
|
||||
ENTRY(TUSB_ERROR_CDCH_UNSUPPORTED_PROTOCOL )\
|
||||
ENTRY(TUSB_ERROR_CDCH_DEVICE_NOT_MOUNTED )\
|
||||
ENTRY(TUSB_ERROR_MSCH_UNSUPPORTED_PROTOCOL )\
|
||||
ENTRY(TUSB_ERROR_MSC_UNSUPPORTED_PROTOCOL )\
|
||||
ENTRY(TUSB_ERROR_MSCH_UNKNOWN_SCSI_COMMAND )\
|
||||
ENTRY(TUSB_ERROR_MSCH_DEVICE_NOT_MOUNTED )\
|
||||
ENTRY(TUSB_ERROR_HUB_FEATURE_NOT_SUPPORTED )\
|
||||
ENTRY(TUSB_ERROR_DESCRIPTOR_CORRUPTED )\
|
||||
ENTRY(TUSB_ERROR_DCD_FAILED )\
|
||||
ENTRY(TUSB_ERROR_DCD_CONTROL_REQUEST_NOT_SUPPORT )\
|
||||
ENTRY(TUSB_ERROR_DCD_NOT_ENOUGH_QTD )\
|
||||
ENTRY(TUSB_ERROR_NOT_SUPPORTED_YET )\
|
||||
ENTRY(TUSB_ERROR_FAILED )\
|
||||
|
||||
|
||||
@@ -36,12 +36,6 @@
|
||||
*/
|
||||
/**************************************************************************/
|
||||
|
||||
/** \file
|
||||
* \brief TBD
|
||||
*
|
||||
* \note TBD
|
||||
*/
|
||||
|
||||
/** \ingroup TBD
|
||||
* \defgroup TBD
|
||||
* \brief TBD
|
||||
@@ -72,7 +66,7 @@ typedef ATTR_PACKED_STRUCT(struct){
|
||||
uint16_t wLength;
|
||||
} tusb_control_request_t;
|
||||
|
||||
//STATIC_ASSERT(sizeof(tusb_control_request_t) == 8, "mostly compiler option issue");
|
||||
STATIC_ASSERT( sizeof(tusb_control_request_t) == 8, "mostly compiler option issue");
|
||||
|
||||
// TODO move to somewhere suitable
|
||||
static inline uint8_t bm_request_type(uint8_t direction, uint8_t type, uint8_t recipient) ATTR_CONST ATTR_ALWAYS_INLINE;
|
||||
|
||||
@@ -210,6 +210,18 @@ enum {
|
||||
DESCRIPTOR_OFFSET_TYPE = 1
|
||||
};
|
||||
|
||||
static inline uint8_t std_class_code_to_index(uint8_t std_class_code) ATTR_CONST ATTR_ALWAYS_INLINE;
|
||||
static inline uint8_t std_class_code_to_index(uint8_t std_class_code)
|
||||
{
|
||||
return (std_class_code <= TUSB_CLASS_AUDIO_VIDEO ) ? std_class_code :
|
||||
(std_class_code == TUSB_CLASS_DIAGNOSTIC ) ? TUSB_CLASS_MAPPED_INDEX_START :
|
||||
(std_class_code == TUSB_CLASS_WIRELESS_CONTROLLER ) ? TUSB_CLASS_MAPPED_INDEX_START + 1 :
|
||||
(std_class_code == TUSB_CLASS_MISC ) ? TUSB_CLASS_MAPPED_INDEX_START + 2 :
|
||||
(std_class_code == TUSB_CLASS_APPLICATION_SPECIFIC ) ? TUSB_CLASS_MAPPED_INDEX_START + 3 :
|
||||
(std_class_code == TUSB_CLASS_VENDOR_SPECIFIC ) ? TUSB_CLASS_MAPPED_INDEX_START + 4 : 0;
|
||||
}
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user