| поискавой системы для электроныых деталей |
|
UM0290 датащи(PDF) 45 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
UM0290 датащи(HTML) 45 Page - STMicroelectronics |
|
45 / 76 page ![]() UM0290 Mass storage demo 45/76 For the bulk pipes (endpoints 1 and 2) the configuration depends on the transfer mode. For the simple buffered mode the endpoint configuration consists of these steps: ● Configure the endpoint 1 as bulk IN ● Configure the endpoint 1 Tx count and data buffer address in the BTABLE (file usb_conf.h) ● Disable the endpoint 1 Rx ● Configure the endpoint 1 Tx status to NAK ● Configure the endpoint 2 as bulk OUT ● Configure the endpoint 2 Rx count and data buffer address in the BTABLE (file usb_conf.h) ● Disable the endpoint 2 Tx ● Configure the endpoint 2 Rx status to VALID In the double buffer mode, each unidirectional endpoint uses two buffers in the Packet Memory Area (PMA). For additional information about the double buffer transfer mode please refer to the STR71x/91x Reference Manual, USB SLAVE INTERFACE, section Double-Buffered Endpoints. To configure the bulk endpoint in double buffer mode, it is necessary to use the same steps as with the simple buffer mode and to modify the transfer mode by setting the EP_KIND bit in the USB_EPxR register of each bulk endpoint. Also, provide for each bulk endpoint tow data buffer (ENDPx_BUF0Addr and ENDPx_BUF1Addr, x can be 1 or 2 according to the endpoint number) in the BTABLE (file usb_conf.h). To manage the double buffer Endpoint configuration the firmware uses dedicated functions: ● SetEPDoubleBuff(): to set the EP_KIND bit in the USB_EPxR register ● SetEPDblBuffCount(): used to set the double buffer endpoint count ● SetEPDblBuffAddr(): used to set the buffer address Data Management Data transfer management depends on the transfer mode. In fact, for the simple buffer mode, only one data buffer is used for each endpoint. So the data management consists of the transfer of the needed data directly from the specified data buffer address in the PMA, according to the related endpoint (IN: ENDP1TXADDR; OUT: ENDP2RXADDR). For these transfers, the following two functions are used (file usb_mem.c): ● PMAToUserBufferCopy (): this function transfers the specified number of bytes from the Packet Memory Area to the internal RAM. This function is used copy the data sent by the host to the device. ● UserToPMABufferCopy (): this function transfers the specified number of bytes from the internal RAM to the Packet Memory Area. This function is used to send the data from the device to the host. However, for the double buffer mode, each endpoint uses two data buffers in the Packet Memory Area. So, to transfer the data from/to the PMA, it is necessary to take care of the current usage of each buffer. In fact, the firmware has to manage the swap between the ENDPx_BUF0Addr and ENDPx_BUF1Addr. The swap depends directly on the firmware and IP buffer usage, so before the access to the PMA (for write operations) the firmware tests the SW_BUF bit or/and the DTOG bit to select the free buffer. This operation is managed in the demo by the EP2_OUT_Callback() function for data out transfer and by both Send_Data() and EP1_IN_Callback() function for data in transfer. |
|
ссылки URL |
| Вашему бизинису помогли Аллдатащит? [ DONATE ] |
Что такое Аллдатащит | реклама | контакт | Конфиденциальность | Ссылка на техническое описание | обмен ссыками | поиск по производителю 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 |