transferInt8 method
Shifts out len
word counts of the data
budder, while shifting in the result buffer. If reuseBuffer
is true, data
will be used the result buffer, for false a new buffer
will be created.
Returns a ' Pointer
Implementation
Pointer<Uint8> transferInt8(Pointer<Uint8> data, bool reuseBuffer, int len) {
Pointer<Uint8> inPtr;
Pointer<Uint8> outPtr = nullptr;
if (reuseBuffer) {
inPtr = outPtr = data;
} else {
inPtr = data;
outPtr = malloc<Uint8>(len);
}
_checkError(_nativeTransfer(_spiHandle, inPtr, outPtr, len));
return outPtr;
}