当前位置:网站首页>TC397 QSPI(CPU)
TC397 QSPI(CPU)
2022-06-30 07:16:00 【Delta-delta】
Hardware Setup




To configure QSPI
initQSPI() The function is initialized Master and Slave End .
QSPI Slave initialization
Related operations are in IfxQspi_SpiSlave.h in
QSPI Initialization from the module is done by defining
IfxQspi_SpiSlave_ConfigStructure .
This structure is populated with default values by functionsIfxQspi_SpiSlave_initModuleConfig().
then , Set pin 、ISR Terminal services and priorities .IfxQspi_SpiSlave_initModule()Function is used to initialize QSPI From the module .
Besides , initialization QSPI The buffer used by the slave .
QSPI Master initialization
Related operations are in IfxQspi_SpiMaster.h
QSPI The main module is initialized by defining
IfxQspi_SpiMaster_ConfigStructure .
This structure is populated with default values by functionsIfxQspi_SpiMaster_initModuleConfig().
after , Set the interface operation mode 、 Pin 、ISR Interrupt service and priority .IfxQspi_SpiMaster_initModule()Function is used to initialize QSPI The main module
One QSPI Module control 16 A separately programmable communication channel . In this example , functioninitQSPI2MasterChannel()Use structureIfxQspi_SpiMaster_ChannelConfigInstance of initializes channel zero . And then through the parameterssls.outputSet the slave to select the channel number , Through parametersbase.baudrateChange baud rate .IfxQspi_SpiMaster_initChannel()Function is used to initialize QSPI Main channel .
Besides ,QSPI The buffer used by the host is also initialized .
QSPI Master - Slave communication
function
transferData()Trigger SPI-Master and SPI-Slave Data transfer between .
IfxQspi_SpiSlave_getStatus()andIfxQspi_SpiMaster_getStatus()The function is used to check the status of the master and slave , To delay transmission until both are idle .function
IfxQspi_SpiSlave_exchange()Instructs the slave to receive a data stream of predefined length .
Call functionIfxQspi_SpiMaster_exchange()To instruct the host to send data .
Last , function verifyData() Check Slave Whether the received data is consistent with Master The data sent matches .
If no error occurs during communication , Then connect to the port pin 13.3 Of LED D110 It will light up , Indicates that the transmission was successful
Run and Test
After code compilation and device programming , Follow these steps :
1. stay Cpu0_main.c In Chinese, it means transferData() To set breakpoints , And check spiBuffers The structure of the spiMasterTxBuffer and spiSlaveRxBuffer.
2. Run the code example and check LED D110 (1) Whether it lights up ( Data transmission is correct ).
3.spiMasterTxBuffer and spiSlaveRxBuffer The same send and receive data should now be displayed .
4. Remove Cables ( for example SCLKx), Perform a reset and re run the application to see if the data transfer is interrupted and LED D110 (1) Extinguish ( Data transmission is blocked ).
边栏推荐
猜你喜欢

Network security ARP protocol and defense

How to determine the size of the platform byte order?

年轻人搞副业有多疯狂:月薪3000,副业收入3W

Daemon and user threads

FreeRTOS timer group

Jingwei Hengrun won the 10ppm quality award of paccar group again

The class imported by idea import clearly exists, but it is red?

Qtcreator debug code after configuring CDB debugger view variable value display card

JS widget wave JS implementation of wave progress bar animation style

Linux服务器安装Redis
随机推荐
Ad usage notes
网络安全-ARP协议和防御
MAX6675 usage notes
Embedded test process
failed to create symbolic link ‘/usr/bin/mysql’: File exists
[resolved] error 1290 (HY000): unknown error 1290
Assembly language learning I (with stack co process, 32-bit registers and related instructions, to be continued 06/29)
Install go language development tools
Network security - detailed explanation of VLAN and tunk methods
nRF52832 GPIO LED
Resolution: div failed to get keyboard event
JS widget wave JS implementation of wave progress bar animation style
QT wmic command obtains some hardware information
Go项目目录结构介绍
The class imported by idea import clearly exists, but it is red?
6、 Shopping ⻋ and orders
28 rounds of interviews with 10 companies in two and a half years
Installation du serveur linux redis
[introduction to Expo application] v Expert recommendation letter template
[my advanced OpenGL learning journey] about the access methods of vector and matrix classification of OpenGL shaders: xyzw/rgba/stpq and array subscripts