| Electronic Components Datasheet Search |
|
UM0290 Datasheet(PDF) 62 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
UM0290 Datasheet(HTML) 62 Page - STMicroelectronics |
|
62 / 76 page ![]() USB voice demos UM0290 62/76 to configure an isochronous OUT endpoint (see the file usb_prop.c function STRSpeaker_Reset () ). /* Initialize Endpoint 1 */ SetEPType(ENDP1, EP_ISOCHRONOUS); SetEPDblBuffAddr(ENDP1,ENDP1_BUF0Addr,ENDP1_BUF1Addr); SetEPDblBuffCount(ENDP1, EP_DBUF_OUT, 22); ClearDTOG_RX(ENDP1); ClearDTOG_TX(ENDP1); ToggleDTOG_TX(ENDP1); SetEPRxStatus(ENDP1, EP_RX_VALID); SetEPTxStatus(ENDP1, EP_TX_DIS); c) Class Specific Request This implementation supports only the Mute control. This feature is managed by the function Mute_command (file usb_prop.c). d) Isochronous Data Transfer Management: As detailed before, the STR7/9 manages the isochronous data transfer using double buffer mode. So to copy the received data from the PMA to the Stream_Buffer, we have to manage the swap between the two PMA buffers (ENDP1_BUF0Addr and ENDP1_BUF1Addr). This swapping access to the PMA is done according to the buffer usage between the USB IP and the firmware. This operation is provided by the function EP1_OUT_Callback () (file usb_endp.c). After the end of the copy process a global variable called IN_Data_Offset is updated by the number of bytes received and copied in the Stream_Buffer. e) Audio Playing Implementation: To playback the audio samples received from the host, Timer TIM3 is programmed to generate a 125.5 kHz PWM signal and the TIM0 is programmed to generate an interrupt at frequency equal to 22 kHz. On each TIM0 interrupt one Audio Stream is used to update the pulse of the PWM. A global variable (Out_Data_Offset) is used to point to the next Stream to play in Stream buffer. Note: Both “IN_Data_Offset” and “Out_Data_Offset” are initialized to 0 in each Start of frame interrupt (see file usb_istr.c function SOF_Callback()) to avoid the overflow of the “Stream_Buffer”. 7.3.3 STR91x USB audio speaker using the DMA For the STR91x, in order to decrease CPU usage, the Direct Memory Access Controller (DMAC) can be used to transfer the data from/to the PMA. This section describes the way to implement all DMA transfer modes in the USB speaker demo. STR91x USB audio speaker demo using DMA unlinked mode In this mode the CTR interrupt is not masked or cleared by the DMA. The CPU is interrupted by both the CTR and DMA terminal count interrupt. The initial configuration of the DMA is done in the file hw_config.c / .h by the function DMA_config() . The DMA_config() function sets the different values of the DMA_InitStruct structure with the source and destination addresses and widths, the correct transfer flow controller (USB) |
|
Link URL |
| Does ALLDATASHEET help your business so far? [ DONATE ] |
About Alldatasheet | Advertisement | Contact us | Privacy Policy | Link to Datasheet | Link Exchange | Manufacturer List All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |