当前位置:网站首页>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 ).
边栏推荐
- QT common macro definitions
- Skillfully use 5 keys to improve office efficiency
- Deploying web projects using idea
- I graduated this year, but I don't know what I want to do
- 【docsify基本使用】
- [resolved] MySQL exception: error 1045 (28000): unknown error 1045, forgetting the initial password
- Egret engine P2 physics engine (2) - Funny physical phenomenon of small balls hitting the ground
- [daily question] 535 Encryption and decryption of tinyurl
- Connection Flood攻击原理
- QT wmic command obtains some hardware information
猜你喜欢

QT generate random number qrandomgenerator
![[docsify basic use]](/img/9d/db689f5f13708f3e241474afeca1d0.png)
[docsify basic use]

Egret P2 pit encountered by physical engine (1)

网络安全-ARP协议和防御

Assembly language learning I (with stack co process, 32-bit registers and related instructions, to be continued 06/29)
![[most complete] install MySQL on a Linux server](/img/5d/8d95033fe577c161dfaedd2accc533.png)
[most complete] install MySQL on a Linux server

【最全】linux服务器上安装Mysql

Connection Flood攻击原理

2、 Layout system

社招两年半10个公司28轮面试面经
随机推荐
oracle数据库报列表中最大表达式为1000错误
Win10踩坑-开机0xc0000225
[daily question] 535 Encryption and decryption of tinyurl
[my advanced OpenGL learning journey] about the access methods of vector and matrix classification of OpenGL shaders: xyzw/rgba/stpq and array subscripts
[semidrive source code analysis] [x9 chip startup process] 34 - RTOS side display module SDM_ display_ Init display initialization source code analysis
How to set the hot deployment of idea web project
Introduction to go project directory structure
Qtcreator debug code after configuring CDB debugger view variable value display card
JS create PDF file
Idea shortcut key
Introduction to go language pointer
Linu基础-分区规划与使用
【Hot100】15. Sum of three numbers
QT generate random number qrandomgenerator
【已解决】Failed! Error: Unknown error 1130
vs2019和sql
Ad usage notes
Error reporting record
【Hot100】11. Container with the most water
Go common commands