I am using SPI to control a device. There is already a driver in C for this device. So, now, I am using this driver in RLP to “construct” my buffer to transmit.
The process to send data and read data is:
[ol]Call native function with a byte array (the transmit buffer) in parameter
Send this buffer with managed code and read the response
Call native function to check the response[/ol]
And sometime, for just one command, I have to send 2 bytes, check 1 byte in the received buffer, then send others data. For one command, I have 4 calls in native code.
Is this bad for performance ? I have to be as fast as possible.
Can I create my SPI Object in managed code and, when I need it in RLP, send some data over SPI directly from RLP ?