EasyManua.ls Logo

Bouffalo Lab BL702 - Page 294

Default Icon
375 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
BL702/704/706 Reference Manual
17.7.2 Send data frame
Configure bit fields such as data frame format and interval in the EMAC_MODE register
By configuring the TXBDNUM field in the EMAC_TX_BD_NUM register to specify the number of BDs used for
transmission, the remaining BDs are RX BDs
Prepare the data frame to be sent in the memory
Fill in the address of the data frame into the data pointer field (word 1) corresponding to the sent BD
Clear the status flag in the control and status field (wrod 0) corresponding to the sent BD, and set the control field
(CRC enable, PAD enable, interrupt enable, etc.)
Write the length of the data frame and set the RD field to inform EMAC that this BD data needs to be sent; if
necessary, set the IRQ bit to enable interrupts
In particular, if it is the last BD sent, the WR bit needs to be set, and EMAC will ”wrap around” to the first sent BD
for processing after processing this BD
If there are multiple BDs to be sent, repeat the steps of setting BD to fill all sending BDs
If you need to enable the transmit interrupt, you also need to configure the TX related bits in the EMAC_INT_MASK
register
Configure the TXEN bit in the EMAC_MODE register to enable transmission
If the interrupt is enabled, in the interrupt sent, the current BD can be obtained through the TXBDNUM field in the
EMAC_TX_BD_NUM register
Perform corresponding processing according to the current BD status word
For the BD whose data has been sent, the RD bit in the control field will be cleared by hardware and will not be
sent again; after filling in new data, set RD, and this BD can be used for sending again
17.7.3 Receive data frame
Configure bit fields such as data frame format and interval in the EMAC_MODE register
By configuring the TXBDNUM field in the EMAC_TX_BD_NUM register to specify the number of BDs used for
transmission, the remaining BDs are RX BDs
The area in the memory that is ready to receive data
Fill in the address of the data frame into the data pointer field (word 1) corresponding to the received BD
Clear the status flag in the control and status field (wrod 0) corresponding to the sending BD, and set the control
field (interrupt enable, etc.)
Write the receivable data frame length and set the E bit field to inform EMAC that the BD is idle and can be used
for data reception; if necessary, set the IRQ bit to enable interrupts
BL702/704/706 Reference Manual 294/ 375
@2021 Bouffalo Lab
guest@bouffalolab

Table of Contents