Вы здесь

DlnSpiSlaveSetReplyMode() Function

The DlnSpiSlaveSetReplyMode() function sets SPI slave reply mode.

Syntax
C/C++
DLN_RESULT DlnSpiSlaveSetReplyMode(
    HDLN handle, 
    uint8_t port, 
    uint8_t replyMode
);
Parameters
handle

A handle to the DLN-series adapter.

port

A number of the SPI slave port.

replyMode

Reply mode value. The following values are possible:

  • 0 or DLN_SPI_SLAVE_REPLY_MODE_OFF - No reply, transmitter is disabled.

  • 1 or DLN_SPI_SLAVE_REPLY_MODE_SS_BASED - Transmitting the reply stops when the SS line releases. If the reply was not transmitted completely, the rest part of the reply is lost. The next reply transmission starts after the new SS line assertion.

  • 2 or DLN_SPI_SLAVE_REPLY_MODE_COUNT_BASED - Only after the reply transmission is completed, the next reply can start. Transmission occurs regardless of the SS line state.

Return Value
DLN_RES_SUCCESS (0x00)

The function successfully configured the reply mode.

DLN_RES_INVALID_PORT_NUMBER (0xA8)

The port number is not valid. Use the DlnSpiSlaveGetPortCount() function to find the maximum possible port number.

DLN_RES_INVALID_REPLY_TYPE (0xC5)

The specified reply type is not valid.

Remarks

The DLN_SPI_SLAVE_REPLY_MODE_COUNT_BASED reply mode allows to send data regardless of how many (or few) words are framed by the SS line. The DLN_SPI_SLAVE_REPLY_MODE_SS_BASED reply mode is set by default, it begins new data transmission/reply regardless of the data length. The DLN_SPI_SLAVE_REPLY_MODE_OFF mode disables transmission, it can be set for half-duplex write communication (for details, read SPI Data Transmission).

The DlnSpiSlaveSetReplyMode() function is defined in the dln_spi_slave.h file.

Языки

Вход на сайт