Closed yibiao-h closed 2 years ago
Hello,
the TMC5130 IC requires two datagrams in a row for a read request.
The first datagram transfers the address to be read and the subsequent datagram then will receive the data from that read request.
The first call to tmc5130_readWriteArray
will replace the 5 bytes in the data array. We re-write the address byte into that array before calling tmc5130_readWriteArray
again to prevent an accidental write. After the second write, the reply data is extracted from the data array.
See also on the datasheet:
Correction of readInt function duplication readWriteArray