AnsweredDoes this DRV_SPI_BufferAddWriteRead function writes and then reads?

Author
epareja
Super Member
  • Total Posts : 333
  • Reward points : 0
  • Joined: 2003/11/07 12:53:08
  • Location: Colombia
  • Status: offline
2017/12/03 20:31:00 (permalink)
0

Does this DRV_SPI_BufferAddWriteRead function writes and then reads?

Hello,
 
I would like to know if this function (DRV_SPI_BufferAddWriteRead) first writes to SPI and then reads from it?
Thank you


Ernesto Pareja J
www.dcctrains.netne.net

#1
Totem
Super Member
  • Total Posts : 266
  • Reward points : 0
  • Joined: 2014/12/04 02:18:11
  • Location: Mars
  • Status: offline
Re: Does this DRV_SPI_BufferAddWriteRead function writes and then reads? 2017/12/03 20:41:15 (permalink) ☄ Helpfulby epareja 2017/12/06 20:16:09
5 (1)
SPI is a ring protocol and you can expect this API to write and read simultaneously.
This means, for each byte sent out of transmit buffer, a byte will be processed to the receive buffer.
 

Everything is Relative!
#2
arpananand
Super Member
  • Total Posts : 370
  • Reward points : 0
  • Joined: 2009/11/18 04:35:42
  • Location: 0
  • Status: offline
Re: Does this DRV_SPI_BufferAddWriteRead function writes and then reads? 2017/12/06 06:47:06 (permalink) ☼ Best Answerby epareja 2017/12/06 20:15:59
5 (2)
epareja
Hello,
 
I would like to know if this function (DRV_SPI_BufferAddWriteRead) first writes to SPI and then reads from it?
Thank you


No, this API write and read simultaneously, but if you are looking for write followed by read, then that also can be achieved by this API. Eg. if you want to write 3 bytes first and then read 5 bytes, you should have txSize as 3 and rxSize as 3+5=8.
#3
epareja
Super Member
  • Total Posts : 333
  • Reward points : 0
  • Joined: 2003/11/07 12:53:08
  • Location: Colombia
  • Status: offline
Re: Does this DRV_SPI_BufferAddWriteRead function writes and then reads? 2017/12/06 20:15:23 (permalink)
0
arpananand
 
No, this API write and read simultaneously, but if you are looking for write followed by read, then that also can be achieved by this API. Eg. if you want to write 3 bytes first and then read 5 bytes, you should have txSize as 3 and rxSize as 3+5=8.




Hello arpananand
 
Your post was very helpfull because that way I reduced the overhead time of the routine!!!
Thank you very much!


Ernesto Pareja J
www.dcctrains.netne.net

#4
arpananand
Super Member
  • Total Posts : 370
  • Reward points : 0
  • Joined: 2009/11/18 04:35:42
  • Location: 0
  • Status: offline
Re: Does this DRV_SPI_BufferAddWriteRead function writes and then reads? 2017/12/07 03:25:11 (permalink)
0
you are welcome :)
#5
Jump to:
© 2017 APG vNext Commercial Version 4.5