@@ -184,6 +184,7 @@ TU_ATTR_ALWAYS_INLINE static inline uint16_t pcd_aligned_buffer_size(uint16_t si
184
184
TU_ATTR_ALWAYS_INLINE static inline void pcd_set_endpoint (USB_TypeDef * USBx , uint32_t bEpIdx , uint32_t wRegValue )
185
185
{
186
186
#ifdef PMA_32BIT_ACCESS
187
+ (void ) USBx ;
187
188
__O uint32_t * reg = (__O uint32_t * )(USB_DRD_BASE + bEpIdx * 4 );
188
189
* reg = wRegValue ;
189
190
#else
@@ -195,6 +196,7 @@ TU_ATTR_ALWAYS_INLINE static inline void pcd_set_endpoint(USB_TypeDef * USBx, ui
195
196
/* GetENDPOINT */
196
197
TU_ATTR_ALWAYS_INLINE static inline uint32_t pcd_get_endpoint (USB_TypeDef * USBx , uint32_t bEpIdx ) {
197
198
#ifdef PMA_32BIT_ACCESS
199
+ (void ) USBx ;
198
200
__I uint32_t * reg = (__I uint32_t * )(USB_DRD_BASE + bEpIdx * 4 );
199
201
#else
200
202
__I uint16_t * reg = (__I uint16_t * )((& USBx -> EP0R ) + bEpIdx * 2u );
@@ -249,6 +251,7 @@ TU_ATTR_ALWAYS_INLINE static inline void pcd_clear_tx_ep_ctr(USB_TypeDef * USBx,
249
251
TU_ATTR_ALWAYS_INLINE static inline uint32_t pcd_get_ep_tx_cnt (USB_TypeDef * USBx , uint32_t bEpIdx )
250
252
{
251
253
#ifdef PMA_32BIT_ACCESS
254
+ (void ) USBx ;
252
255
return (pma32 [2 * bEpIdx ] & 0x03FF0000 ) >> 16 ;
253
256
#else
254
257
__I uint16_t * regPtr = pcd_ep_tx_cnt_ptr (USBx , bEpIdx );
@@ -259,6 +262,7 @@ TU_ATTR_ALWAYS_INLINE static inline uint32_t pcd_get_ep_tx_cnt(USB_TypeDef * USB
259
262
TU_ATTR_ALWAYS_INLINE static inline uint32_t pcd_get_ep_rx_cnt (USB_TypeDef * USBx , uint32_t bEpIdx )
260
263
{
261
264
#ifdef PMA_32BIT_ACCESS
265
+ (void ) USBx ;
262
266
return (pma32 [2 * bEpIdx + 1 ] & 0x03FF0000 ) >> 16 ;
263
267
#else
264
268
__I uint16_t * regPtr = pcd_ep_rx_cnt_ptr (USBx , bEpIdx );
@@ -285,6 +289,7 @@ TU_ATTR_ALWAYS_INLINE static inline void pcd_set_ep_address(USB_TypeDef * USBx,
285
289
TU_ATTR_ALWAYS_INLINE static inline uint32_t pcd_get_ep_tx_address (USB_TypeDef * USBx , uint32_t bEpIdx )
286
290
{
287
291
#ifdef PMA_32BIT_ACCESS
292
+ (void ) USBx ;
288
293
return pma32 [2 * bEpIdx ] & 0x0000FFFFu ;
289
294
#else
290
295
return * pcd_btable_word_ptr (USBx ,(bEpIdx )* 4u + 0u );
@@ -294,6 +299,7 @@ TU_ATTR_ALWAYS_INLINE static inline uint32_t pcd_get_ep_tx_address(USB_TypeDef *
294
299
TU_ATTR_ALWAYS_INLINE static inline uint32_t pcd_get_ep_rx_address (USB_TypeDef * USBx , uint32_t bEpIdx )
295
300
{
296
301
#ifdef PMA_32BIT_ACCESS
302
+ (void ) USBx ;
297
303
return pma32 [2 * bEpIdx + 1 ] & 0x0000FFFFu ;
298
304
#else
299
305
return * pcd_btable_word_ptr (USBx ,(bEpIdx )* 4u + 2u );
@@ -303,6 +309,7 @@ TU_ATTR_ALWAYS_INLINE static inline uint32_t pcd_get_ep_rx_address(USB_TypeDef *
303
309
TU_ATTR_ALWAYS_INLINE static inline void pcd_set_ep_tx_address (USB_TypeDef * USBx , uint32_t bEpIdx , uint32_t addr )
304
310
{
305
311
#ifdef PMA_32BIT_ACCESS
312
+ (void ) USBx ;
306
313
pma32 [2 * bEpIdx ] = (pma32 [2 * bEpIdx ] & 0xFFFF0000u ) | (addr & 0x0000FFFCu );
307
314
#else
308
315
* pcd_btable_word_ptr (USBx ,(bEpIdx )* 4u + 0u ) = addr ;
@@ -312,6 +319,7 @@ TU_ATTR_ALWAYS_INLINE static inline void pcd_set_ep_tx_address(USB_TypeDef * USB
312
319
TU_ATTR_ALWAYS_INLINE static inline void pcd_set_ep_rx_address (USB_TypeDef * USBx , uint32_t bEpIdx , uint32_t addr )
313
320
{
314
321
#ifdef PMA_32BIT_ACCESS
322
+ (void ) USBx ;
315
323
pma32 [2 * bEpIdx + 1 ] = (pma32 [2 * bEpIdx + 1 ] & 0xFFFF0000u ) | (addr & 0x0000FFFCu );
316
324
#else
317
325
* pcd_btable_word_ptr (USBx ,(bEpIdx )* 4u + 2u ) = addr ;
@@ -321,6 +329,7 @@ TU_ATTR_ALWAYS_INLINE static inline void pcd_set_ep_rx_address(USB_TypeDef * USB
321
329
TU_ATTR_ALWAYS_INLINE static inline void pcd_set_ep_tx_cnt (USB_TypeDef * USBx , uint32_t bEpIdx , uint32_t wCount )
322
330
{
323
331
#ifdef PMA_32BIT_ACCESS
332
+ (void ) USBx ;
324
333
pma32 [2 * bEpIdx ] = (pma32 [2 * bEpIdx ] & ~0x03FF0000u ) | ((wCount & 0x3FFu ) << 16 );
325
334
#else
326
335
__IO uint16_t * reg = pcd_ep_tx_cnt_ptr (USBx , bEpIdx );
@@ -331,6 +340,7 @@ TU_ATTR_ALWAYS_INLINE static inline void pcd_set_ep_tx_cnt(USB_TypeDef * USBx, u
331
340
TU_ATTR_ALWAYS_INLINE static inline void pcd_set_ep_rx_cnt (USB_TypeDef * USBx , uint32_t bEpIdx , uint32_t wCount )
332
341
{
333
342
#ifdef PMA_32BIT_ACCESS
343
+ (void ) USBx ;
334
344
pma32 [2 * bEpIdx + 1 ] = (pma32 [2 * bEpIdx + 1 ] & ~0x03FF0000u ) | ((wCount & 0x3FFu ) << 16 );
335
345
#else
336
346
__IO uint16_t * reg = pcd_ep_rx_cnt_ptr (USBx , bEpIdx );
@@ -342,6 +352,7 @@ TU_ATTR_ALWAYS_INLINE static inline void pcd_set_ep_blsize_num_blocks(USB_TypeDe
342
352
{
343
353
/* Encode into register. When BLSIZE==1, we need to subtract 1 block count */
344
354
#ifdef PMA_32BIT_ACCESS
355
+ (void ) USBx ;
345
356
pma32 [rxtx_idx ] = (pma32 [rxtx_idx ] & 0x0000FFFFu ) | (blocksize << 31 ) | ((numblocks - blocksize ) << 26 );
346
357
#else
347
358
__IO uint16_t * pdwReg = pcd_btable_word_ptr (USBx , rxtx_idx * 2u + 1u );
0 commit comments