SPI Slave Events

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() function. There are three types of events:

DLN_SPI_SLAVE_EVENT_NONE No SPI slave events are generated.
DLN_SPI_SLAVE_EVENT_SS_RISE SPI slave events are generated when an SS line is released.
DLN_SPI_SLAVE_EVENT_SS_BUFFER_FULL SPI slave events are generated when the allocated buffer becomes full.

No SPI slave events are generated

No SPI slave events are generated.

In order to choose this event type, call the DlnSpiSlaveSetEvent() function and set 0 or SPI_SLAVE_EVENT_NONE as the eventType parameter.

In this case the bufferSize parameter is ignored.

SPI slave events are generated when an SS line is released

SPI slave events are generated when an SS line is released. This event type ignores the amount of transmitted data and only monitors the state of the SS line.

SPI slave events are generated when an SS line is released

In order to choose this event type, call the DlnSpiSlaveSetEvent() function and specify 1 or SPI_SLAVE_EVENT_SS_RISE as the eventType parameter.

In this case the bufferSize parameter is ignored.

SPI slave events are generated when the allocated buffer becomes full

SPI slave events are generated when the allocated buffer becomes full.

SPI slave events are generated when the allocated buffer becomes full

In order to choose this event type, call the DlnSpiSlaveSetEvent() function and set 2 or SPI_SLAVE_EVENT_SS_BUFFER_FULL as the eventType parameter.

In this case the bufferSize parameter defines the size of the buffer that stores data received from a SPI master device. This parameter is set in bytes. The maximum value is 256 bytes.