read(into:count:)

Read an array of binary integer from the slave device.

SPI.swift:409
@discardableResult func read<Element>(into buffer: inout [Element], count: Int? = nil) -> Result<(), Errno> where Element : BinaryInteger

Parameters

buffer

An array used to store the received data in specified format.

count

The number of bytes to read. Make sure it doesn’t exceed the length of the buffer. If it’s nil, the number equals the length of the buffer.

Returns

Whether the communication succeeds. If not, it returns the specific error.