![Nations N32G43 Series Скачать руководство пользователя страница 546](http://html1.mh-extra.com/html/nations/n32g43-series/n32g43-series_user-manual_3408051546.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
523
/
631
clock).
Two-wire one-way receive-only mode or one-wire bidirectional receive mode for slave
1.
The SPI module can be turned off at any time (SPI_CTRL1.SPIEN = 0), and after the current transfer is over,
the SPI module will be turned off;
2.
If you want to enter the shutdown mode, you must wait for the BUSY flag (SPI_STS.BUSY) to be set to 0 before
entering the shutdown mode (or turn off the SPI module clock).
SPI communication using DMA
Users can choose DMA for SPI data transfer, the application program can be released, and the system efficiency can
be greatly improved.
When the send buffer DMA is enabled (SPI_CTRL2.TDMAEN = 1), each time the TE flag (SPI_STS.TE) bit is 1, a
DMA request will be generated, and the DMA will automatically write the data to the SPI_DAT register, which will
clear the TE flag (SPI_STS.TE) bit. When the receive buffer DMA is enabled (SPI_CTRL2.RDMAEN = 1), each
time the RNE flag (SPI_STS.RNE) bit is set to 1, a DMA request will be generated, and the DMA will automatically
read the SPI_DAT register, which will clear the RNE flag (SPI_STS.RNE) bit.
When the SPI is only used for sending data, only the send DMA channel of the SPI needs to be enabled
(SPI_CTRL2.TDMAEN = 1).
When the SPI is only used for receiving data, only the receive DMA channel of the SPI needs to be enabled
(SPI_CTRL2.RDMAEN = 1).
In send mode, after DMA has sent all the data to be sent (DMA_INTSTS.TXCF = 1), BUSY flag (SPI_STS.BUSY)
can monitor to confirm whether SPI communication is over, which can avoid destroying the transmission of the last
data when the SPI is turned off or enters the shutdown mode. Therefore, the software needs to wait for the TE flag
(SPI_STS.TE) bit to be set to 1, and wait for the BUSY flag (SPI_STS.BUSY) bit to be set to 0.