read(into:count:)

Reads the data from the slave device into the specified buffer pointer.

SPI.swift:444
@discardableResult func read(into buffer: UnsafeMutableRawBufferPointer, count: Int? = nil) -> Result<(), Errno>

Parameters

buffer

A Raw buffer pointer to store the received data in a region of storage.

count

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

Returns

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