USB DMA Read Endian Select

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

USB DMA Read Endian Select

ソリューションへジャンプ
2,975件の閲覧回数
amwilhite
Contributor III

Operating in USB Host Mode, I'm using the USB Audio class to read 16-bit, 16kHz PCM audio from a connected microphone.

The algorithm that processes the audio requires that the samples be in big-endian format; however, it appears that all USB data is transferred in little-endian.

I noticed that the USB Device Mode has an Endian Select field to switch between the two types, but I have not been able to find any mechanism for converting from little-endian to big-endian when reading USB audio in host mode.

Can anyone suggest a mechanism to accomplish this?

ラベル(1)
0 件の賞賛
返信
1 解決策
2,869件の閲覧回数
Hui_Ma
NXP TechSupport
NXP TechSupport

Hi,

I checked the USB OS Adapter has the ENDIANNESS definition at <usb_osa.h>:

/*! @brief Define big endian */
#define USB_BIG_ENDIAN (0U)
/*! @brief Define little endian */
#define USB_LITTLE_ENDIAN (1U)

/*! @brief Define current endian */
#define ENDIANNESS USB_LITTLE_ENDIAN

The OS adapter (OSA) is used to wrap the differences between RTOSes and enable a USB stack with the
same code base and behavior.

Note
OSA should not be used in the USB application. Therefore, from the USB application viewpoint, OSA is invisible.

If your application doesn't use RTOS, it need to software convert data from little endian to big endian.

best regards,

Mike

元の投稿で解決策を見る

0 件の賞賛
返信
1 返信
2,870件の閲覧回数
Hui_Ma
NXP TechSupport
NXP TechSupport

Hi,

I checked the USB OS Adapter has the ENDIANNESS definition at <usb_osa.h>:

/*! @brief Define big endian */
#define USB_BIG_ENDIAN (0U)
/*! @brief Define little endian */
#define USB_LITTLE_ENDIAN (1U)

/*! @brief Define current endian */
#define ENDIANNESS USB_LITTLE_ENDIAN

The OS adapter (OSA) is used to wrap the differences between RTOSes and enable a USB stack with the
same code base and behavior.

Note
OSA should not be used in the USB application. Therefore, from the USB application viewpoint, OSA is invisible.

If your application doesn't use RTOS, it need to software convert data from little endian to big endian.

best regards,

Mike

0 件の賞賛
返信