write(_:count:)

Writes an array of UInt8 to the slave device.

SPI.swift:496
@discardableResult func write(_ data: [UInt8], count: Int? = nil) -> Result<(), Errno>

Parameters

data

An array of UInt8 to be sent to the slave device.

count

The number of bytes in data to be sent. Make sure it doesn’t exceed the length of the data. If it’s nil, all data will be sent.

Returns

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