Package comm

Class SPI

extends Object

With this class the iLCD controllerJoC might be used as either SPI master or SPI slave device.

The Serial Peripheral Interface (SPI) is a synchronous and full duplex communication interface. This means that data can be transmitted and received at the same time. SPI can be used in master or in slave mode and is connected via MISO, MOSI, SCK, SSEL, GND pins to another device.

The frequency range is adjustable via the open method and can be adjusted from 500kHz to 7MHz. The number of bits transferred in each frame can also be adjusted via the open method and ranging from 8 to 16-bits per frame.

Separate RX and TX buffers are used for data transmission. The TX buffer can be written with the writeTXBuffer method and the RX buffer can be read with the readRXBuffer method. Both methods can not initiat an data transfer. A data transfer can be initiated in master mode with the transferData method. This counts for both master and slave mode. Each buffer has a fixed size of 63 frames.

In order to receive SPI data as slave a OnSPIListener has to be added to the SPIEventDispatcher of the EventManagement system.

Notes

_INSERT_CONSTRUCTOR_ENTRY_HERE_

Public Methods

Methods inherited from java.lang.Object

_INSERT_INHERITED_METHOD_ENTRY_HERE_

Public Fields

  • static final byte MASTER
  • static final byte RXBUFFER
  • static final byte SLAVE
  • static final byte TXBUFFER

_INSERT_FIELDS_ENTRY_HERE_