Apr 29

SPI Slave Events

Posted in SPI

The more powerful DLN-series adapters feature the event driven interface.
Those of them supporting SPI slave interface, can be configured to send SPI events, when functioning in SPI slave mode.

You can preconfigure the event generation conditions and carry on with your tasks. Once the SPI master addresses the USB-SPI adapter, the adapter takes part in the SPI bus transaction and sends the event to your application via asynchronous interface. You can check the received events at your convenience. Two event types are available:

A DLN-series adapter can be configured to send DLN_SPI_SLAVE_TRANSFER_EV events. They are generated when certain predefined conditions are met. The SPI slave events are configured using the DlnSpiSlaveSetEvent() function. The eventType parameter defines conditions for event generation. For some of the event types the bufferSize parameter can be defined. In this case an event will be sent once buffer size reaches the bufferSize value. You can retrieve current event generation conditions by calling the DlnSpiSlaveGetEvent(). There are three types of events:

  • DLN_SPI_SLAVE_EVENT_NONE – no events are generated;
  • DLN_SPI_SLAVE_EVENT_SS_RISE – events are generated when an SS line is released;
  • DLN_SPI_SLAVE_EVENT_SS_BUFFER_FULL – events are generated when the allocated buffer becomes full.

Similar events can be configured for other modules of a DLN-series USB interface adapter (e.g. USB to GPIO interface or USB to I2C bus).

comments: 71 »