9.7 Arduino SPI Functions

9.7.1 @device/delete

: delete (dev)

Free resources of a device object.

Inputs

dev - object to free

See also: device.

9.7.2 @device/display

: display (dev)

Display device object.

Inputs

dev - device object to display

See also: device.

9.7.3 @device/subsref

: val = subsref (dev, sub)

subref for device

See also: device.

9.7.4 @device/writeRead

: dataOut = readWrite (spi, dataIn)

Write uint8 data to spi device and return back clocked out response data of same size.

Inputs

spi - connected spi device on arduino

dataIn - uint8 sized data to send to spi device framed between SS frame.

Outputs

dataOut - uint8 data clocked out during send to dataIn.

See also: arduino, device.

9.7.5 @spidev/delete

: delete (dev)

Free resources of a spidev object.

Inputs

dev - spidev object to free

See also: spidev.

9.7.6 @spidev/display

: display (dev)

Display spidev object.

Inputs

dev - spidev object to display

See also: spidev.

9.7.7 @spidev/spidev

: dev = spidev (ar, cspin)
: dev = spidev (ar, cspin, propname, propvalue)

spidev is depreciated and will be removed in a future version. Use device instead.

Create an spidev object to communicate to the SPI port on a connected arduino.

Inputs

ar - connected arduino object

cspin - chip select pin for attached spi device.

propname, propvalue - property name/value pair for values to pass to devices.

Currently known properties:

bitrate

bit rate speed in Mbs

bitorder

’msbfirst’ or ’lsbfirst’

mode

SPI mode 0 - 3.

Outputs

dev - created spidev object

Properties

The spidev object has the following public properties:

parent

The parent (arduino) for this device

pins

pins used by this object

mode

mode used for created object

bitrate

Bitrate set for object

bitorder

Bitorder set for object

chipselectpin

Pin used for chipselect

See also: arduino, readWrite.

9.7.8 @spidev/subsref

: val = subsref (dev, sub)

subref for spidev

See also: spidev.

9.7.9 @spidev/writeRead

: dataOut = readWrite (spi, dataIn)

Write uint8 data to spi device and return back clocked out response data of same size.

Inputs

spi - connected spi device on arduino

dataIn - uint8 sized data to send to spi device framed between SS frame.

Outputs

dataOut - uint8 data clocked out during send to dataIn.

See also: arduino, spidev.


Next: Arduino Serial Functions, Previous: Arduino Shiftregister Functions, Up: Function Reference   [Contents][Index]