K64 SPI - what are the function to read and write single byte or short?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi
In the SPI demo for k64 there are examples that show how to transfer block of data from master to slave.
but suppose i have an external hardware that connect to k64 as a SPI slave device.
this device can be any kind of device that's its interface has SPI where we need to write and read single register
they can be byte or short.
So what are the single atomic functions to read and write for the master
are they?
DSP_ReadData for reading
and
DSPI_MasterWriteCommandDataBlocking(EXAMPLE_DSPI_MASTER_BASEADDR, data);
for writing?
Thanks!


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Eli,
The function of "DSPI_MasterTransferNonBlocking()" can used as both receive and send .
The butter and size is configured in a structure like the demo :
If you want send one byte , set the dataSize to 1 : slaveXfer.dataSize =1;
Hope it helps
Have a great day,
Alice
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi
And if want just writing and then reading?
Should I set it to zero read?
Can I use function just for read and write?
And not the API that do transfer?
Eli


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Eli,
I checked the code of "DSPI_ReadData" and "DSPI_MasterWriteCommandDataBlocking" ,
i think yes , you can use it to read and write .
BR
Alice
