Merge pull request #1828 from HiFiPhile/stm32_fsdev
stm32_fsdev & ISO EP buffer allocation improvements
This commit is contained in:
@@ -76,26 +76,19 @@
|
||||
// Linear buffer in case target MCU is not capable of handling a ring buffer FIFO e.g. no hardware buffer
|
||||
// is available or driver is would need to be changed dramatically
|
||||
|
||||
// Only STM32 synopsys and dcd_transdimension use non-linear buffer for now
|
||||
// Synopsys detection copied from dcd_synopsys.c (refactor later on)
|
||||
#if defined (STM32F105x8) || defined (STM32F105xB) || defined (STM32F105xC) || \
|
||||
defined (STM32F107xB) || defined (STM32F107xC)
|
||||
#define STM32F1_SYNOPSYS
|
||||
#endif
|
||||
|
||||
#if defined (STM32L475xx) || defined (STM32L476xx) || \
|
||||
defined (STM32L485xx) || defined (STM32L486xx) || defined (STM32L496xx) || \
|
||||
defined (STM32L4R5xx) || defined (STM32L4R7xx) || defined (STM32L4R9xx) || \
|
||||
defined (STM32L4S5xx) || defined (STM32L4S7xx) || defined (STM32L4S9xx)
|
||||
#define STM32L4_SYNOPSYS
|
||||
#endif
|
||||
|
||||
#if (CFG_TUSB_MCU == OPT_MCU_STM32F1 && defined(STM32F1_SYNOPSYS)) || \
|
||||
// Only STM32 and dcd_transdimension use non-linear buffer for now
|
||||
#if CFG_TUSB_MCU == OPT_MCU_STM32F0 || \
|
||||
CFG_TUSB_MCU == OPT_MCU_STM32F1 || \
|
||||
CFG_TUSB_MCU == OPT_MCU_STM32F2 || \
|
||||
CFG_TUSB_MCU == OPT_MCU_STM32F3 || \
|
||||
CFG_TUSB_MCU == OPT_MCU_STM32F4 || \
|
||||
CFG_TUSB_MCU == OPT_MCU_STM32F7 || \
|
||||
CFG_TUSB_MCU == OPT_MCU_STM32H7 || \
|
||||
(CFG_TUSB_MCU == OPT_MCU_STM32L4 && defined(STM32L4_SYNOPSYS)) || \
|
||||
CFG_TUSB_MCU == OPT_MCU_STM32L0 || \
|
||||
CFG_TUSB_MCU == OPT_MCU_STM32L1 || \
|
||||
CFG_TUSB_MCU == OPT_MCU_STM32L4 || \
|
||||
CFG_TUSB_MCU == OPT_MCU_STM32G4 || \
|
||||
CFG_TUSB_MCU == OPT_MCU_STM32WB || \
|
||||
CFG_TUSB_MCU == OPT_MCU_RX63X || \
|
||||
CFG_TUSB_MCU == OPT_MCU_RX65X || \
|
||||
CFG_TUSB_MCU == OPT_MCU_RX72N || \
|
||||
@@ -113,6 +106,33 @@
|
||||
#define USE_LINEAR_BUFFER 1
|
||||
#endif
|
||||
|
||||
#if defined(STM32F102x6) || defined(STM32F102xB) || \
|
||||
defined(STM32F103x6) || defined(STM32F103xB) || \
|
||||
defined(STM32F103xE) || defined(STM32F103xG)
|
||||
#define STM32F1_FSDEV
|
||||
#endif
|
||||
|
||||
#if defined(STM32L412xx) || defined(STM32L422xx) || \
|
||||
defined(STM32L432xx) || defined(STM32L433xx) || \
|
||||
defined(STM32L442xx) || defined(STM32L443xx) || \
|
||||
defined(STM32L452xx) || defined(STM32L462xx)
|
||||
#define STM32L4_FSDEV
|
||||
#endif
|
||||
|
||||
// Temporarily put the check here for stm32_fsdev
|
||||
#if CFG_TUSB_MCU == OPT_MCU_STM32F0 || \
|
||||
CFG_TUSB_MCU == OPT_MCU_STM32F3 || \
|
||||
CFG_TUSB_MCU == OPT_MCU_STM32L0 || \
|
||||
CFG_TUSB_MCU == OPT_MCU_STM32L1 || \
|
||||
CFG_TUSB_MCU == OPT_MCU_STM32G4 || \
|
||||
CFG_TUSB_MCU == OPT_MCU_STM32WB || \
|
||||
(TU_CHECK_MCU(OPT_MCU_STM32F1) && defined(STM32F1_FSDEV)) || \
|
||||
(TU_CHECK_MCU(OPT_MCU_STM32L4) && defined(STM32L4_FSDEV))
|
||||
#define USE_ISO_EP_ALLOCATION 1
|
||||
#else
|
||||
#define USE_ISO_EP_ALLOCATION 0
|
||||
#endif
|
||||
|
||||
// Declaration of buffers
|
||||
|
||||
// Check for maximum supported numbers
|
||||
@@ -1471,6 +1491,83 @@ uint16_t audiod_open(uint8_t rhport, tusb_desc_interface_t const * itf_desc, uin
|
||||
#endif
|
||||
}
|
||||
|
||||
#if USE_ISO_EP_ALLOCATION
|
||||
#if CFG_TUD_AUDIO_ENABLE_EP_IN
|
||||
uint8_t ep_in = 0;
|
||||
uint16_t ep_in_size = 0;
|
||||
#endif
|
||||
|
||||
#if CFG_TUD_AUDIO_ENABLE_EP_OUT
|
||||
uint8_t ep_out = 0;
|
||||
uint16_t ep_out_size = 0;
|
||||
#endif
|
||||
|
||||
#if CFG_TUD_AUDIO_ENABLE_FEEDBACK_EP
|
||||
uint8_t ep_fb = 0;
|
||||
#endif
|
||||
|
||||
uint8_t const *p_desc = _audiod_fct[i].p_desc;
|
||||
uint8_t const *p_desc_end = p_desc + _audiod_fct[i].desc_length - TUD_AUDIO_DESC_IAD_LEN;
|
||||
while (p_desc < p_desc_end)
|
||||
{
|
||||
if (tu_desc_type(p_desc) == TUSB_DESC_ENDPOINT)
|
||||
{
|
||||
tusb_desc_endpoint_t const *desc_ep = (tusb_desc_endpoint_t const *) p_desc;
|
||||
if (desc_ep->bmAttributes.xfer == TUSB_XFER_ISOCHRONOUS)
|
||||
{
|
||||
#if CFG_TUD_AUDIO_ENABLE_FEEDBACK_EP
|
||||
// Explicit feedback EP
|
||||
if (desc_ep->bmAttributes.usage == 1)
|
||||
{
|
||||
ep_fb = desc_ep->bEndpointAddress;
|
||||
}
|
||||
#endif
|
||||
// Data EP
|
||||
if (desc_ep->bmAttributes.usage == 0)
|
||||
{
|
||||
if (tu_edpt_dir(desc_ep->bEndpointAddress) == TUSB_DIR_IN)
|
||||
{
|
||||
#if CFG_TUD_AUDIO_ENABLE_EP_IN
|
||||
ep_in = desc_ep->bEndpointAddress;
|
||||
ep_in_size = TU_MAX(tu_edpt_packet_size(desc_ep), ep_in_size);
|
||||
#endif
|
||||
} else
|
||||
{
|
||||
#if CFG_TUD_AUDIO_ENABLE_EP_OUT
|
||||
ep_out = desc_ep->bEndpointAddress;
|
||||
ep_out_size = TU_MAX(tu_edpt_packet_size(desc_ep), ep_out_size);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
p_desc = tu_desc_next(p_desc);
|
||||
}
|
||||
|
||||
#if CFG_TUD_AUDIO_ENABLE_EP_IN
|
||||
if (ep_in)
|
||||
{
|
||||
usbd_edpt_iso_alloc(rhport, ep_in, ep_in_size);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if CFG_TUD_AUDIO_ENABLE_EP_OUT
|
||||
if (ep_out)
|
||||
{
|
||||
usbd_edpt_iso_alloc(rhport, ep_out, ep_out_size);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if CFG_TUD_AUDIO_ENABLE_FEEDBACK_EP
|
||||
if (ep_fb)
|
||||
{
|
||||
usbd_edpt_iso_alloc(rhport, ep_fb, 4);
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // USE_ISO_EP_ALLOCATION
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -1532,17 +1629,19 @@ static bool audiod_set_interface(uint8_t rhport, tusb_control_request_t const *
|
||||
if (audio->ep_in_as_intf_num == itf)
|
||||
{
|
||||
audio->ep_in_as_intf_num = 0;
|
||||
#if !USE_ISO_EP_ALLOCATION
|
||||
usbd_edpt_close(rhport, audio->ep_in);
|
||||
#endif
|
||||
|
||||
// Clear FIFOs, since data is no longer valid
|
||||
#if !CFG_TUD_AUDIO_ENABLE_ENCODING
|
||||
#if !CFG_TUD_AUDIO_ENABLE_ENCODING
|
||||
tu_fifo_clear(&audio->ep_in_ff);
|
||||
#else
|
||||
#else
|
||||
for (uint8_t cnt = 0; cnt < audio->n_tx_supp_ff; cnt++)
|
||||
{
|
||||
tu_fifo_clear(&audio->tx_supp_ff[cnt]);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// Invoke callback - can be used to stop data sampling
|
||||
if (tud_audio_set_itf_close_EP_cb) TU_VERIFY(tud_audio_set_itf_close_EP_cb(rhport, p_request));
|
||||
@@ -1550,23 +1649,25 @@ static bool audiod_set_interface(uint8_t rhport, tusb_control_request_t const *
|
||||
audio->ep_in = 0; // Necessary?
|
||||
|
||||
}
|
||||
#endif
|
||||
#endif // CFG_TUD_AUDIO_ENABLE_EP_IN
|
||||
|
||||
#if CFG_TUD_AUDIO_ENABLE_EP_OUT
|
||||
if (audio->ep_out_as_intf_num == itf)
|
||||
{
|
||||
audio->ep_out_as_intf_num = 0;
|
||||
#if !USE_ISO_EP_ALLOCATION
|
||||
usbd_edpt_close(rhport, audio->ep_out);
|
||||
#endif
|
||||
|
||||
// Clear FIFOs, since data is no longer valid
|
||||
#if !CFG_TUD_AUDIO_ENABLE_DECODING
|
||||
#if !CFG_TUD_AUDIO_ENABLE_DECODING
|
||||
tu_fifo_clear(&audio->ep_out_ff);
|
||||
#else
|
||||
#else
|
||||
for (uint8_t cnt = 0; cnt < audio->n_rx_supp_ff; cnt++)
|
||||
{
|
||||
tu_fifo_clear(&audio->rx_supp_ff[cnt]);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// Invoke callback - can be used to stop data sampling
|
||||
if (tud_audio_set_itf_close_EP_cb) TU_VERIFY(tud_audio_set_itf_close_EP_cb(rhport, p_request));
|
||||
@@ -1574,13 +1675,15 @@ static bool audiod_set_interface(uint8_t rhport, tusb_control_request_t const *
|
||||
audio->ep_out = 0; // Necessary?
|
||||
|
||||
// Close corresponding feedback EP
|
||||
#if CFG_TUD_AUDIO_ENABLE_FEEDBACK_EP
|
||||
#if CFG_TUD_AUDIO_ENABLE_FEEDBACK_EP
|
||||
#if !USE_ISO_EP_ALLOCATION
|
||||
usbd_edpt_close(rhport, audio->ep_fb);
|
||||
#endif
|
||||
audio->ep_fb = 0;
|
||||
tu_memclr(&audio->feedback, sizeof(audio->feedback));
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
#endif // CFG_TUD_AUDIO_ENABLE_EP_OUT
|
||||
|
||||
// Save current alternative interface setting
|
||||
audio->alt_setting[idxItf] = alt;
|
||||
@@ -1605,8 +1708,11 @@ static bool audiod_set_interface(uint8_t rhport, tusb_control_request_t const *
|
||||
if (tu_desc_type(p_desc) == TUSB_DESC_ENDPOINT)
|
||||
{
|
||||
tusb_desc_endpoint_t const* desc_ep = (tusb_desc_endpoint_t const *) p_desc;
|
||||
#if USE_ISO_EP_ALLOCATION
|
||||
TU_ASSERT(usbd_edpt_iso_activate(rhport, desc_ep));
|
||||
#else
|
||||
TU_ASSERT(usbd_edpt_open(rhport, desc_ep));
|
||||
|
||||
#endif
|
||||
uint8_t const ep_addr = desc_ep->bEndpointAddress;
|
||||
|
||||
//TODO: We need to set EP non busy since this is not taken care of right now in ep_close() - THIS IS A WORKAROUND!
|
||||
@@ -1621,11 +1727,11 @@ static bool audiod_set_interface(uint8_t rhport, tusb_control_request_t const *
|
||||
audio->ep_in_sz = tu_edpt_packet_size(desc_ep);
|
||||
|
||||
// If software encoding is enabled, parse for the corresponding parameters - doing this here means only AS interfaces with EPs get scanned for parameters
|
||||
#if CFG_TUD_AUDIO_ENABLE_ENCODING
|
||||
#if CFG_TUD_AUDIO_ENABLE_ENCODING
|
||||
audiod_parse_for_AS_params(audio, p_desc_parse_for_params, p_desc_end, itf);
|
||||
|
||||
// Reconfigure size of support FIFOs - this is necessary to avoid samples to get split in case of a wrap
|
||||
#if CFG_TUD_AUDIO_ENABLE_TYPE_I_ENCODING
|
||||
#if CFG_TUD_AUDIO_ENABLE_TYPE_I_ENCODING
|
||||
const uint16_t active_fifo_depth = (uint16_t) ((audio->tx_supp_ff_sz_max / audio->n_bytes_per_sampe_tx) * audio->n_bytes_per_sampe_tx);
|
||||
for (uint8_t cnt = 0; cnt < audio->n_tx_supp_ff; cnt++)
|
||||
{
|
||||
@@ -1633,9 +1739,8 @@ static bool audiod_set_interface(uint8_t rhport, tusb_control_request_t const *
|
||||
}
|
||||
audio->n_ff_used_tx = audio->n_channels_tx / audio->n_channels_per_ff_tx;
|
||||
TU_ASSERT( audio->n_ff_used_tx <= audio->n_tx_supp_ff );
|
||||
#endif
|
||||
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// Schedule first transmit if alternate interface is not zero i.e. streaming is disabled - in case no sample data is available a ZLP is loaded
|
||||
// It is necessary to trigger this here since the refill is done with an RX FIFO empty interrupt which can only trigger if something was in there
|
||||
@@ -1652,11 +1757,11 @@ static bool audiod_set_interface(uint8_t rhport, tusb_control_request_t const *
|
||||
audio->ep_out_as_intf_num = itf;
|
||||
audio->ep_out_sz = tu_edpt_packet_size(desc_ep);
|
||||
|
||||
#if CFG_TUD_AUDIO_ENABLE_DECODING
|
||||
#if CFG_TUD_AUDIO_ENABLE_DECODING
|
||||
audiod_parse_for_AS_params(audio, p_desc_parse_for_params, p_desc_end, itf);
|
||||
|
||||
// Reconfigure size of support FIFOs - this is necessary to avoid samples to get split in case of a wrap
|
||||
#if CFG_TUD_AUDIO_ENABLE_TYPE_I_DECODING
|
||||
#if CFG_TUD_AUDIO_ENABLE_TYPE_I_DECODING
|
||||
const uint16_t active_fifo_depth = (audio->rx_supp_ff_sz_max / audio->n_bytes_per_sampe_rx) * audio->n_bytes_per_sampe_rx;
|
||||
for (uint8_t cnt = 0; cnt < audio->n_rx_supp_ff; cnt++)
|
||||
{
|
||||
@@ -1664,18 +1769,18 @@ static bool audiod_set_interface(uint8_t rhport, tusb_control_request_t const *
|
||||
}
|
||||
audio->n_ff_used_rx = audio->n_channels_rx / audio->n_channels_per_ff_rx;
|
||||
TU_ASSERT( audio->n_ff_used_rx <= audio->n_rx_supp_ff );
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// Prepare for incoming data
|
||||
#if USE_LINEAR_BUFFER_RX
|
||||
#if USE_LINEAR_BUFFER_RX
|
||||
TU_VERIFY(usbd_edpt_xfer(rhport, audio->ep_out, audio->lin_buf_out, audio->ep_out_sz), false);
|
||||
#else
|
||||
#else
|
||||
TU_VERIFY(usbd_edpt_xfer_fifo(rhport, audio->ep_out, &audio->ep_out_ff, audio->ep_out_sz), false);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
#if CFG_TUD_AUDIO_ENABLE_FEEDBACK_EP
|
||||
#if CFG_TUD_AUDIO_ENABLE_FEEDBACK_EP
|
||||
if (tu_edpt_dir(ep_addr) == TUSB_DIR_IN && desc_ep->bmAttributes.usage == 1) // Check if usage is explicit data feedback
|
||||
{
|
||||
audio->ep_fb = ep_addr;
|
||||
@@ -1684,7 +1789,7 @@ static bool audiod_set_interface(uint8_t rhport, tusb_control_request_t const *
|
||||
// Enable SOF interrupt if callback is implemented
|
||||
if (tud_audio_feedback_interval_isr) usbd_sof_enable(rhport, true);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
#endif // CFG_TUD_AUDIO_ENABLE_EP_OUT
|
||||
|
||||
foundEPs += 1;
|
||||
@@ -1735,7 +1840,7 @@ static bool audiod_set_interface(uint8_t rhport, tusb_control_request_t const *
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#endif // CFG_TUD_AUDIO_ENABLE_FEEDBACK_EP
|
||||
|
||||
// We are done - abort loop
|
||||
break;
|
||||
|
@@ -167,6 +167,12 @@ void dcd_edpt_stall (uint8_t rhport, uint8_t ep_addr);
|
||||
// This API never calls with control endpoints, since it is auto cleared when receiving setup packet
|
||||
void dcd_edpt_clear_stall (uint8_t rhport, uint8_t ep_addr);
|
||||
|
||||
// Allocate packet buffer used by ISO endpoints
|
||||
// Some MCU need manual packet buffer allocation, we allocation largest size to avoid clustering
|
||||
TU_ATTR_WEAK bool dcd_edpt_iso_alloc(uint8_t rhport, uint8_t ep_addr, uint16_t largest_packet_size);
|
||||
|
||||
// Configure and enable an ISO endpoint according to descriptor
|
||||
TU_ATTR_WEAK bool dcd_edpt_iso_activate(uint8_t rhport, tusb_desc_endpoint_t const * p_endpoint_desc);
|
||||
//--------------------------------------------------------------------+
|
||||
// Event API (implemented by stack)
|
||||
//--------------------------------------------------------------------+
|
||||
|
@@ -1382,4 +1382,31 @@ void usbd_sof_enable(uint8_t rhport, bool en)
|
||||
dcd_sof_enable(rhport, en);
|
||||
}
|
||||
|
||||
bool usbd_edpt_iso_alloc(uint8_t rhport, uint8_t ep_addr, uint16_t largest_packet_size)
|
||||
{
|
||||
rhport = _usbd_rhport;
|
||||
|
||||
TU_ASSERT(dcd_edpt_iso_alloc);
|
||||
TU_ASSERT(tu_edpt_number(ep_addr) < CFG_TUD_ENDPPOINT_MAX);
|
||||
|
||||
return dcd_edpt_iso_alloc(rhport, ep_addr, largest_packet_size);
|
||||
}
|
||||
|
||||
bool usbd_edpt_iso_activate(uint8_t rhport, tusb_desc_endpoint_t const * desc_ep)
|
||||
{
|
||||
rhport = _usbd_rhport;
|
||||
|
||||
uint8_t const epnum = tu_edpt_number(desc_ep->bEndpointAddress);
|
||||
uint8_t const dir = tu_edpt_dir(desc_ep->bEndpointAddress);
|
||||
|
||||
TU_ASSERT(dcd_edpt_iso_activate);
|
||||
TU_ASSERT(epnum < CFG_TUD_ENDPPOINT_MAX);
|
||||
TU_ASSERT(tu_edpt_validate(desc_ep, (tusb_speed_t) _usbd_dev.speed));
|
||||
|
||||
_usbd_dev.ep_status[epnum][dir].stalled = false;
|
||||
_usbd_dev.ep_status[epnum][dir].busy = false;
|
||||
_usbd_dev.ep_status[epnum][dir].claimed = false;
|
||||
return dcd_edpt_iso_activate(rhport, desc_ep);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@@ -96,6 +96,12 @@ void usbd_edpt_clear_stall(uint8_t rhport, uint8_t ep_addr);
|
||||
// Check if endpoint is stalled
|
||||
bool usbd_edpt_stalled(uint8_t rhport, uint8_t ep_addr);
|
||||
|
||||
// Allocate packet buffer used by ISO endpoints
|
||||
bool usbd_edpt_iso_alloc(uint8_t rhport, uint8_t ep_addr, uint16_t largest_packet_size);
|
||||
|
||||
// Configure and enable an ISO endpoint according to descriptor
|
||||
bool usbd_edpt_iso_activate(uint8_t rhport, tusb_desc_endpoint_t const * p_endpoint_desc);
|
||||
|
||||
// Check if endpoint is ready (not busy and not stalled)
|
||||
TU_ATTR_ALWAYS_INLINE static inline
|
||||
bool usbd_edpt_ready(uint8_t rhport, uint8_t ep_addr)
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -120,76 +120,89 @@
|
||||
static __IO uint16_t * const pma = (__IO uint16_t*)USB_PMAADDR;
|
||||
|
||||
// prototypes
|
||||
static inline __IO uint16_t* pcd_ep_rx_cnt_ptr(USB_TypeDef * USBx, uint32_t bEpNum);
|
||||
static inline __IO uint16_t* pcd_ep_tx_cnt_ptr(USB_TypeDef * USBx, uint32_t bEpNum);
|
||||
static inline void pcd_set_endpoint(USB_TypeDef * USBx, uint32_t bEpNum, uint32_t wRegValue);
|
||||
TU_ATTR_ALWAYS_INLINE static inline __IO uint16_t* pcd_ep_rx_cnt_ptr(USB_TypeDef * USBx, uint32_t bEpIdx);
|
||||
TU_ATTR_ALWAYS_INLINE static inline __IO uint16_t* pcd_ep_tx_cnt_ptr(USB_TypeDef * USBx, uint32_t bEpIdx);
|
||||
TU_ATTR_ALWAYS_INLINE static inline void pcd_set_endpoint(USB_TypeDef * USBx, uint32_t bEpIdx, uint32_t wRegValue);
|
||||
|
||||
/* Aligned buffer size according to hardware */
|
||||
TU_ATTR_ALWAYS_INLINE static inline uint16_t pcd_aligned_buffer_size(uint16_t size)
|
||||
{
|
||||
/* The STM32 full speed USB peripheral supports only a limited set of
|
||||
* buffer sizes given by the RX buffer entry format in the USB_BTABLE. */
|
||||
uint16_t blocksize = (size > 62) ? 32 : 2;
|
||||
|
||||
// Round up while dividing requested size by blocksize
|
||||
uint16_t numblocks = (size + blocksize - 1) / blocksize ;
|
||||
|
||||
return numblocks * blocksize;
|
||||
}
|
||||
|
||||
/* SetENDPOINT */
|
||||
static inline void pcd_set_endpoint(USB_TypeDef * USBx, uint32_t bEpNum, uint32_t wRegValue)
|
||||
TU_ATTR_ALWAYS_INLINE static inline void pcd_set_endpoint(USB_TypeDef * USBx, uint32_t bEpIdx, uint32_t wRegValue)
|
||||
{
|
||||
__O uint16_t *reg = (__O uint16_t *)((&USBx->EP0R) + bEpNum*2u);
|
||||
__O uint16_t *reg = (__O uint16_t *)((&USBx->EP0R) + bEpIdx*2u);
|
||||
*reg = (uint16_t)wRegValue;
|
||||
}
|
||||
|
||||
/* GetENDPOINT */
|
||||
static inline uint16_t pcd_get_endpoint(USB_TypeDef * USBx, uint32_t bEpNum) {
|
||||
__I uint16_t *reg = (__I uint16_t *)((&USBx->EP0R) + bEpNum*2u);
|
||||
TU_ATTR_ALWAYS_INLINE static inline uint16_t pcd_get_endpoint(USB_TypeDef * USBx, uint32_t bEpIdx) {
|
||||
__I uint16_t *reg = (__I uint16_t *)((&USBx->EP0R) + bEpIdx*2u);
|
||||
return *reg;
|
||||
}
|
||||
|
||||
static inline void pcd_set_eptype(USB_TypeDef * USBx, uint32_t bEpNum, uint32_t wType)
|
||||
TU_ATTR_ALWAYS_INLINE static inline void pcd_set_eptype(USB_TypeDef * USBx, uint32_t bEpIdx, uint32_t wType)
|
||||
{
|
||||
uint32_t regVal = pcd_get_endpoint(USBx, bEpNum);
|
||||
uint32_t regVal = pcd_get_endpoint(USBx, bEpIdx);
|
||||
regVal &= (uint32_t)USB_EP_T_MASK;
|
||||
regVal |= wType;
|
||||
regVal |= USB_EP_CTR_RX | USB_EP_CTR_TX; // These clear on write0, so must set high
|
||||
pcd_set_endpoint(USBx, bEpNum, regVal);
|
||||
pcd_set_endpoint(USBx, bEpIdx, regVal);
|
||||
}
|
||||
|
||||
static inline uint32_t pcd_get_eptype(USB_TypeDef * USBx, uint32_t bEpNum)
|
||||
TU_ATTR_ALWAYS_INLINE static inline uint32_t pcd_get_eptype(USB_TypeDef * USBx, uint32_t bEpIdx)
|
||||
{
|
||||
uint32_t regVal = pcd_get_endpoint(USBx, bEpNum);
|
||||
uint32_t regVal = pcd_get_endpoint(USBx, bEpIdx);
|
||||
regVal &= USB_EP_T_FIELD;
|
||||
return regVal;
|
||||
}
|
||||
/**
|
||||
* @brief Clears bit CTR_RX / CTR_TX in the endpoint register.
|
||||
* @param USBx USB peripheral instance register address.
|
||||
* @param bEpNum Endpoint Number.
|
||||
* @param bEpIdx Endpoint Number.
|
||||
* @retval None
|
||||
*/
|
||||
static inline void pcd_clear_rx_ep_ctr(USB_TypeDef * USBx, uint32_t bEpNum)
|
||||
TU_ATTR_ALWAYS_INLINE static inline void pcd_clear_rx_ep_ctr(USB_TypeDef * USBx, uint32_t bEpIdx)
|
||||
{
|
||||
uint32_t regVal = pcd_get_endpoint(USBx, bEpNum);
|
||||
uint32_t regVal = pcd_get_endpoint(USBx, bEpIdx);
|
||||
regVal &= USB_EPREG_MASK;
|
||||
regVal &= ~USB_EP_CTR_RX;
|
||||
regVal |= USB_EP_CTR_TX; // preserve CTR_TX (clears on writing 0)
|
||||
pcd_set_endpoint(USBx, bEpNum, regVal);
|
||||
pcd_set_endpoint(USBx, bEpIdx, regVal);
|
||||
}
|
||||
static inline void pcd_clear_tx_ep_ctr(USB_TypeDef * USBx, uint32_t bEpNum)
|
||||
|
||||
TU_ATTR_ALWAYS_INLINE static inline void pcd_clear_tx_ep_ctr(USB_TypeDef * USBx, uint32_t bEpIdx)
|
||||
{
|
||||
uint32_t regVal = pcd_get_endpoint(USBx, bEpNum);
|
||||
uint32_t regVal = pcd_get_endpoint(USBx, bEpIdx);
|
||||
regVal &= USB_EPREG_MASK;
|
||||
regVal &= ~USB_EP_CTR_TX;
|
||||
regVal |= USB_EP_CTR_RX; // preserve CTR_RX (clears on writing 0)
|
||||
pcd_set_endpoint(USBx, bEpNum,regVal);
|
||||
pcd_set_endpoint(USBx, bEpIdx,regVal);
|
||||
}
|
||||
/**
|
||||
* @brief gets counter of the tx buffer.
|
||||
* @param USBx USB peripheral instance register address.
|
||||
* @param bEpNum Endpoint Number.
|
||||
* @param bEpIdx Endpoint Number.
|
||||
* @retval Counter value
|
||||
*/
|
||||
static inline uint32_t pcd_get_ep_tx_cnt(USB_TypeDef * USBx, uint32_t bEpNum)
|
||||
TU_ATTR_ALWAYS_INLINE static inline uint32_t pcd_get_ep_tx_cnt(USB_TypeDef * USBx, uint32_t bEpIdx)
|
||||
{
|
||||
__I uint16_t *regPtr = pcd_ep_tx_cnt_ptr(USBx, bEpNum);
|
||||
__I uint16_t *regPtr = pcd_ep_tx_cnt_ptr(USBx, bEpIdx);
|
||||
return *regPtr & 0x3ffU;
|
||||
}
|
||||
|
||||
static inline uint32_t pcd_get_ep_rx_cnt(USB_TypeDef * USBx, uint32_t bEpNum)
|
||||
TU_ATTR_ALWAYS_INLINE static inline uint32_t pcd_get_ep_rx_cnt(USB_TypeDef * USBx, uint32_t bEpIdx)
|
||||
{
|
||||
__I uint16_t *regPtr = pcd_ep_rx_cnt_ptr(USBx, bEpNum);
|
||||
__I uint16_t *regPtr = pcd_ep_rx_cnt_ptr(USBx, bEpIdx);
|
||||
return *regPtr & 0x3ffU;
|
||||
}
|
||||
|
||||
@@ -200,49 +213,36 @@ static inline uint32_t pcd_get_ep_rx_cnt(USB_TypeDef * USBx, uint32_t bEpNum)
|
||||
* @param wNBlocks no. of Blocks.
|
||||
* @retval None
|
||||
*/
|
||||
TU_ATTR_ALWAYS_INLINE static inline void pcd_set_ep_cnt_reg(__O uint16_t * pdwReg, size_t wCount)
|
||||
{
|
||||
/* We assume that the buffer size is already aligned to hardware requirements. */
|
||||
uint16_t blocksize = (wCount > 62) ? 1 : 0;
|
||||
uint16_t numblocks = wCount / (blocksize ? 32 : 2);
|
||||
|
||||
static inline void pcd_set_ep_cnt_rx_reg(__O uint16_t * pdwReg, size_t wCount) {
|
||||
uint32_t wNBlocks;
|
||||
if(wCount > 62u)
|
||||
{
|
||||
wNBlocks = wCount >> 5u;
|
||||
if((wCount & 0x1fU) == 0u)
|
||||
{
|
||||
wNBlocks--;
|
||||
}
|
||||
wNBlocks = wNBlocks << 10u;
|
||||
wNBlocks |= 0x8000u; // Mark block size as 32byte
|
||||
*pdwReg = (uint16_t)wNBlocks;
|
||||
}
|
||||
else
|
||||
{
|
||||
wNBlocks = wCount >> 1u;
|
||||
if((wCount & 0x1U) != 0u)
|
||||
{
|
||||
wNBlocks++;
|
||||
}
|
||||
*pdwReg = (uint16_t)((wNBlocks) << 10u);
|
||||
}
|
||||
/* There should be no remainder in the above calculation */
|
||||
TU_ASSERT((wCount - (numblocks * (blocksize ? 32 : 2))) == 0, /**/);
|
||||
|
||||
/* Encode into register. When BLSIZE==1, we need to subtract 1 block count */
|
||||
*pdwReg = (blocksize << 15) | ((numblocks - blocksize) << 10);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Sets address in an endpoint register.
|
||||
* @param USBx USB peripheral instance register address.
|
||||
* @param bEpNum Endpoint Number.
|
||||
* @param bEpIdx Endpoint Number.
|
||||
* @param bAddr Address.
|
||||
* @retval None
|
||||
*/
|
||||
static inline void pcd_set_ep_address(USB_TypeDef * USBx, uint32_t bEpNum, uint32_t bAddr)
|
||||
TU_ATTR_ALWAYS_INLINE static inline void pcd_set_ep_address(USB_TypeDef * USBx, uint32_t bEpIdx, uint32_t bAddr)
|
||||
{
|
||||
uint32_t regVal = pcd_get_endpoint(USBx, bEpNum);
|
||||
uint32_t regVal = pcd_get_endpoint(USBx, bEpIdx);
|
||||
regVal &= USB_EPREG_MASK;
|
||||
regVal |= bAddr;
|
||||
regVal |= USB_EP_CTR_RX|USB_EP_CTR_TX;
|
||||
pcd_set_endpoint(USBx, bEpNum,regVal);
|
||||
pcd_set_endpoint(USBx, bEpIdx,regVal);
|
||||
}
|
||||
|
||||
static inline __IO uint16_t * pcd_btable_word_ptr(USB_TypeDef * USBx, size_t x)
|
||||
TU_ATTR_ALWAYS_INLINE static inline __IO uint16_t * pcd_btable_word_ptr(USB_TypeDef * USBx, size_t x)
|
||||
{
|
||||
size_t total_word_offset = (((USBx)->BTABLE)>>1) + x;
|
||||
total_word_offset *= PMA_STRIDE;
|
||||
@@ -250,46 +250,61 @@ static inline __IO uint16_t * pcd_btable_word_ptr(USB_TypeDef * USBx, size_t x)
|
||||
}
|
||||
|
||||
// Pointers to the PMA table entries (using the ARM address space)
|
||||
static inline __IO uint16_t* pcd_ep_tx_address_ptr(USB_TypeDef * USBx, uint32_t bEpNum)
|
||||
TU_ATTR_ALWAYS_INLINE static inline __IO uint16_t* pcd_ep_tx_address_ptr(USB_TypeDef * USBx, uint32_t bEpIdx)
|
||||
{
|
||||
return pcd_btable_word_ptr(USBx,(bEpNum)*4u + 0u);
|
||||
return pcd_btable_word_ptr(USBx,(bEpIdx)*4u + 0u);
|
||||
}
|
||||
static inline __IO uint16_t* pcd_ep_tx_cnt_ptr(USB_TypeDef * USBx, uint32_t bEpNum)
|
||||
TU_ATTR_ALWAYS_INLINE static inline __IO uint16_t* pcd_ep_tx_cnt_ptr(USB_TypeDef * USBx, uint32_t bEpIdx)
|
||||
{
|
||||
return pcd_btable_word_ptr(USBx,(bEpNum)*4u + 1u);
|
||||
return pcd_btable_word_ptr(USBx,(bEpIdx)*4u + 1u);
|
||||
}
|
||||
|
||||
static inline __IO uint16_t* pcd_ep_rx_address_ptr(USB_TypeDef * USBx, uint32_t bEpNum)
|
||||
TU_ATTR_ALWAYS_INLINE static inline __IO uint16_t* pcd_ep_rx_address_ptr(USB_TypeDef * USBx, uint32_t bEpIdx)
|
||||
{
|
||||
return pcd_btable_word_ptr(USBx,(bEpNum)*4u + 2u);
|
||||
return pcd_btable_word_ptr(USBx,(bEpIdx)*4u + 2u);
|
||||
}
|
||||
|
||||
static inline __IO uint16_t* pcd_ep_rx_cnt_ptr(USB_TypeDef * USBx, uint32_t bEpNum)
|
||||
TU_ATTR_ALWAYS_INLINE static inline __IO uint16_t* pcd_ep_rx_cnt_ptr(USB_TypeDef * USBx, uint32_t bEpIdx)
|
||||
{
|
||||
return pcd_btable_word_ptr(USBx,(bEpNum)*4u + 3u);
|
||||
return pcd_btable_word_ptr(USBx,(bEpIdx)*4u + 3u);
|
||||
}
|
||||
|
||||
static inline void pcd_set_ep_tx_cnt(USB_TypeDef * USBx, uint32_t bEpNum, uint32_t wCount)
|
||||
TU_ATTR_ALWAYS_INLINE static inline void pcd_set_ep_tx_cnt(USB_TypeDef * USBx, uint32_t bEpIdx, uint32_t wCount)
|
||||
{
|
||||
*pcd_ep_tx_cnt_ptr(USBx, bEpNum) = (uint16_t)wCount;
|
||||
__IO uint16_t * reg = pcd_ep_tx_cnt_ptr(USBx, bEpIdx);
|
||||
*reg = (uint16_t) (*reg & (uint16_t) ~0x3FFU) | (wCount & 0x3FFU);
|
||||
}
|
||||
|
||||
static inline void pcd_set_ep_rx_cnt(USB_TypeDef * USBx, uint32_t bEpNum, uint32_t wCount)
|
||||
TU_ATTR_ALWAYS_INLINE static inline void pcd_set_ep_rx_cnt(USB_TypeDef * USBx, uint32_t bEpIdx, uint32_t wCount)
|
||||
{
|
||||
__IO uint16_t *pdwReg = pcd_ep_rx_cnt_ptr((USBx),(bEpNum));
|
||||
pcd_set_ep_cnt_rx_reg(pdwReg, wCount);
|
||||
__IO uint16_t * reg = pcd_ep_rx_cnt_ptr(USBx, bEpIdx);
|
||||
*reg = (uint16_t) (*reg & (uint16_t) ~0x3FFU) | (wCount & 0x3FFU);
|
||||
}
|
||||
|
||||
TU_ATTR_ALWAYS_INLINE static inline void pcd_set_ep_tx_bufsize(USB_TypeDef * USBx, uint32_t bEpIdx, uint32_t wCount)
|
||||
{
|
||||
__IO uint16_t *pdwReg = pcd_ep_tx_cnt_ptr((USBx),(bEpIdx));
|
||||
wCount = pcd_aligned_buffer_size(wCount);
|
||||
pcd_set_ep_cnt_reg(pdwReg, wCount);
|
||||
}
|
||||
|
||||
TU_ATTR_ALWAYS_INLINE static inline void pcd_set_ep_rx_bufsize(USB_TypeDef * USBx, uint32_t bEpIdx, uint32_t wCount)
|
||||
{
|
||||
__IO uint16_t *pdwReg = pcd_ep_rx_cnt_ptr((USBx),(bEpIdx));
|
||||
wCount = pcd_aligned_buffer_size(wCount);
|
||||
pcd_set_ep_cnt_reg(pdwReg, wCount);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief sets the status for tx transfer (bits STAT_TX[1:0]).
|
||||
* @param USBx USB peripheral instance register address.
|
||||
* @param bEpNum Endpoint Number.
|
||||
* @param bEpIdx Endpoint Number.
|
||||
* @param wState new state
|
||||
* @retval None
|
||||
*/
|
||||
static inline void pcd_set_ep_tx_status(USB_TypeDef * USBx, uint32_t bEpNum, uint32_t wState)
|
||||
TU_ATTR_ALWAYS_INLINE static inline void pcd_set_ep_tx_status(USB_TypeDef * USBx, uint32_t bEpIdx, uint32_t wState)
|
||||
{
|
||||
uint32_t regVal = pcd_get_endpoint(USBx, bEpNum);
|
||||
uint32_t regVal = pcd_get_endpoint(USBx, bEpIdx);
|
||||
regVal &= USB_EPTX_DTOGMASK;
|
||||
|
||||
/* toggle first bit ? */
|
||||
@@ -302,21 +317,22 @@ static inline void pcd_set_ep_tx_status(USB_TypeDef * USBx, uint32_t bEpNum, ui
|
||||
{
|
||||
regVal ^= USB_EPTX_DTOG2;
|
||||
}
|
||||
|
||||
regVal |= USB_EP_CTR_RX|USB_EP_CTR_TX;
|
||||
pcd_set_endpoint(USBx, bEpNum, regVal);
|
||||
pcd_set_endpoint(USBx, bEpIdx, regVal);
|
||||
} /* pcd_set_ep_tx_status */
|
||||
|
||||
/**
|
||||
* @brief sets the status for rx transfer (bits STAT_TX[1:0])
|
||||
* @param USBx USB peripheral instance register address.
|
||||
* @param bEpNum Endpoint Number.
|
||||
* @param bEpIdx Endpoint Number.
|
||||
* @param wState new state
|
||||
* @retval None
|
||||
*/
|
||||
|
||||
static inline void pcd_set_ep_rx_status(USB_TypeDef * USBx, uint32_t bEpNum, uint32_t wState)
|
||||
TU_ATTR_ALWAYS_INLINE static inline void pcd_set_ep_rx_status(USB_TypeDef * USBx, uint32_t bEpIdx, uint32_t wState)
|
||||
{
|
||||
uint32_t regVal = pcd_get_endpoint(USBx, bEpNum);
|
||||
uint32_t regVal = pcd_get_endpoint(USBx, bEpIdx);
|
||||
regVal &= USB_EPRX_DTOGMASK;
|
||||
|
||||
/* toggle first bit ? */
|
||||
@@ -329,13 +345,14 @@ static inline void pcd_set_ep_rx_status(USB_TypeDef * USBx, uint32_t bEpNum, ui
|
||||
{
|
||||
regVal ^= USB_EPRX_DTOG2;
|
||||
}
|
||||
|
||||
regVal |= USB_EP_CTR_RX|USB_EP_CTR_TX;
|
||||
pcd_set_endpoint(USBx, bEpNum, regVal);
|
||||
pcd_set_endpoint(USBx, bEpIdx, regVal);
|
||||
} /* pcd_set_ep_rx_status */
|
||||
|
||||
static inline uint32_t pcd_get_ep_rx_status(USB_TypeDef * USBx, uint32_t bEpNum)
|
||||
TU_ATTR_ALWAYS_INLINE static inline uint32_t pcd_get_ep_rx_status(USB_TypeDef * USBx, uint32_t bEpIdx)
|
||||
{
|
||||
uint32_t regVal = pcd_get_endpoint(USBx, bEpNum);
|
||||
uint32_t regVal = pcd_get_endpoint(USBx, bEpIdx);
|
||||
return (regVal & USB_EPRX_STAT) >> (12u);
|
||||
} /* pcd_get_ep_rx_status */
|
||||
|
||||
@@ -343,71 +360,71 @@ static inline uint32_t pcd_get_ep_rx_status(USB_TypeDef * USBx, uint32_t bEpNum
|
||||
/**
|
||||
* @brief Toggles DTOG_RX / DTOG_TX bit in the endpoint register.
|
||||
* @param USBx USB peripheral instance register address.
|
||||
* @param bEpNum Endpoint Number.
|
||||
* @param bEpIdx Endpoint Number.
|
||||
* @retval None
|
||||
*/
|
||||
static inline void pcd_rx_dtog(USB_TypeDef * USBx, uint32_t bEpNum)
|
||||
TU_ATTR_ALWAYS_INLINE static inline void pcd_rx_dtog(USB_TypeDef * USBx, uint32_t bEpIdx)
|
||||
{
|
||||
uint32_t regVal = pcd_get_endpoint(USBx, bEpNum);
|
||||
uint32_t regVal = pcd_get_endpoint(USBx, bEpIdx);
|
||||
regVal &= USB_EPREG_MASK;
|
||||
regVal |= USB_EP_CTR_RX|USB_EP_CTR_TX|USB_EP_DTOG_RX;
|
||||
pcd_set_endpoint(USBx, bEpNum, regVal);
|
||||
pcd_set_endpoint(USBx, bEpIdx, regVal);
|
||||
}
|
||||
|
||||
static inline void pcd_tx_dtog(USB_TypeDef * USBx, uint32_t bEpNum)
|
||||
TU_ATTR_ALWAYS_INLINE static inline void pcd_tx_dtog(USB_TypeDef * USBx, uint32_t bEpIdx)
|
||||
{
|
||||
uint32_t regVal = pcd_get_endpoint(USBx, bEpNum);
|
||||
uint32_t regVal = pcd_get_endpoint(USBx, bEpIdx);
|
||||
regVal &= USB_EPREG_MASK;
|
||||
regVal |= USB_EP_CTR_RX|USB_EP_CTR_TX|USB_EP_DTOG_TX;
|
||||
pcd_set_endpoint(USBx, bEpNum, regVal);
|
||||
pcd_set_endpoint(USBx, bEpIdx, regVal);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Clears DTOG_RX / DTOG_TX bit in the endpoint register.
|
||||
* @param USBx USB peripheral instance register address.
|
||||
* @param bEpNum Endpoint Number.
|
||||
* @param bEpIdx Endpoint Number.
|
||||
* @retval None
|
||||
*/
|
||||
|
||||
static inline void pcd_clear_rx_dtog(USB_TypeDef * USBx, uint32_t bEpNum)
|
||||
TU_ATTR_ALWAYS_INLINE static inline void pcd_clear_rx_dtog(USB_TypeDef * USBx, uint32_t bEpIdx)
|
||||
{
|
||||
uint32_t regVal = pcd_get_endpoint(USBx, bEpNum);
|
||||
uint32_t regVal = pcd_get_endpoint(USBx, bEpIdx);
|
||||
if((regVal & USB_EP_DTOG_RX) != 0)
|
||||
{
|
||||
pcd_rx_dtog(USBx,bEpNum);
|
||||
pcd_rx_dtog(USBx,bEpIdx);
|
||||
}
|
||||
}
|
||||
|
||||
static inline void pcd_clear_tx_dtog(USB_TypeDef * USBx, uint32_t bEpNum)
|
||||
TU_ATTR_ALWAYS_INLINE static inline void pcd_clear_tx_dtog(USB_TypeDef * USBx, uint32_t bEpIdx)
|
||||
{
|
||||
uint32_t regVal = pcd_get_endpoint(USBx, bEpNum);
|
||||
uint32_t regVal = pcd_get_endpoint(USBx, bEpIdx);
|
||||
if((regVal & USB_EP_DTOG_TX) != 0)
|
||||
{
|
||||
pcd_tx_dtog(USBx,bEpNum);
|
||||
pcd_tx_dtog(USBx,bEpIdx);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief set & clear EP_KIND bit.
|
||||
* @param USBx USB peripheral instance register address.
|
||||
* @param bEpNum Endpoint Number.
|
||||
* @param bEpIdx Endpoint Number.
|
||||
* @retval None
|
||||
*/
|
||||
|
||||
static inline void pcd_set_ep_kind(USB_TypeDef * USBx, uint32_t bEpNum)
|
||||
TU_ATTR_ALWAYS_INLINE static inline void pcd_set_ep_kind(USB_TypeDef * USBx, uint32_t bEpIdx)
|
||||
{
|
||||
uint32_t regVal = pcd_get_endpoint(USBx, bEpNum);
|
||||
uint32_t regVal = pcd_get_endpoint(USBx, bEpIdx);
|
||||
regVal |= USB_EP_KIND;
|
||||
regVal &= USB_EPREG_MASK;
|
||||
regVal |= USB_EP_CTR_RX|USB_EP_CTR_TX;
|
||||
pcd_set_endpoint(USBx, bEpNum, regVal);
|
||||
pcd_set_endpoint(USBx, bEpIdx, regVal);
|
||||
}
|
||||
static inline void pcd_clear_ep_kind(USB_TypeDef * USBx, uint32_t bEpNum)
|
||||
TU_ATTR_ALWAYS_INLINE static inline void pcd_clear_ep_kind(USB_TypeDef * USBx, uint32_t bEpIdx)
|
||||
{
|
||||
uint32_t regVal = pcd_get_endpoint(USBx, bEpNum);
|
||||
uint32_t regVal = pcd_get_endpoint(USBx, bEpIdx);
|
||||
regVal &= USB_EPKIND_MASK;
|
||||
regVal |= USB_EP_CTR_RX|USB_EP_CTR_TX;
|
||||
pcd_set_endpoint(USBx, bEpNum, regVal);
|
||||
pcd_set_endpoint(USBx, bEpIdx, regVal);
|
||||
}
|
||||
|
||||
// This checks if the device has "LPM"
|
||||
@@ -421,6 +438,7 @@ static inline void pcd_clear_ep_kind(USB_TypeDef * USBx, uint32_t bEpNum)
|
||||
USB_ISTR_RESET | USB_ISTR_SOF | USB_ISTR_ESOF | USB_ISTR_L1REQ_FORCED )
|
||||
|
||||
// Number of endpoints in hardware
|
||||
// TODO should use TUP_DCD_ENDPOINT_MAX
|
||||
#define STFSDEV_EP_COUNT (8u)
|
||||
|
||||
#endif /* PORTABLE_ST_STM32F0_DCD_STM32F0_FSDEV_PVT_ST_H_ */
|
||||
|
Reference in New Issue
Block a user