![Nations N32G43 Series Скачать руководство пользователя страница 622](http://html1.mh-extra.com/html/nations/n32g43-series/n32g43-series_user-manual_3408051622.webp)
Nations Technologies Inc.
Tel
:
+86-755-86309900
:
Address: Nations Tower, #109 Baoshen Road, Hi-tech Park North.
Nanshan District, Shenzhen, 518057, P.R.China
599
/
631
Figure 26-2 The user applications on the microcontrollers and the USB modules access Packet Buffer Memory
Buffer description table
The buffer description table defines the buffer address, size and the number of bytes to be transmitted for the endpoint
used in the communication process. Each endpoint corresponds to two endpoint data packet buffers, one for sending
and one for receiving. These endpoint packet buffers can be stored anywhere in the entire Packet Buffer Memory,
and the buffer description table is also located in the Packet Buffer Memory, whose starting address is determined by
the USB_BUFTAB register.
The buffer description table has a total of 8 entries, each entry corresponds to an endpoint register, each register has
two directions of sending and receiving, and each direction requires two 16-bit word buffer description tables, so
each table items consist of four 16-bit words, so the start address of the buffer description table must be 8-byte aligned.
Endpoint packet buffers for unused endpoints or in the unused direction of a used endpoint may be used for other
purposes. The relationship between the buffer description table and the endpoint packet buffer is shown in Figure 26-
3 below.
Whether the endpoint is used for receiving or sending, the buffer description table starts with the first entry, which is
the very bottom of the buffer description table. The USB module cannot access/modify the data of other endpoint
packet buffers other than the currently allocated endpoint packet buffer area,
For example: when the endpoint 0 packet
receive buffer receives a data larger than the current endpoint 0 packet receive buffer from the PC host, the endpoint
0 only receives data up to the endpoint 0 packet receive buffer size, other redundant data is discarded and a buffer
overflow exception occurs.
Packet Buffer Memory
Filling
Filling
Filling
Filling
Filling
Data
Data
Data
Data
Data
0
4
8
12
16
APB1
bus
0
2
4
6
8
USB
module