Вы здесь

DlnSpiSlaveSetReplyShortageAction() Function

The DlnSpiSlaveSetReplyShortageAction() function sets the reply shortage action value. When the master sends a data block that is larger than the loaded reply, this function specifies how to fill empty bytes (repeat the reply bytes or send zeroes).

Syntax
C/C++
DLN_RESULT DlnSpiSlaveSetReplyShortageAction(
    HDLN handle, 
    uint8_t port,
    uint8_t action
);
Parameters
handle

A handle to the DLN-series adapter.

port

A number of the SPI slave port.

action

Shortage action value to be set. There are 2 possible values:

  • DLN_SPI_SLAVE_REPLY_SHORTAGE_SEND_ZEROES - To fill the missed bytes with 0.

  • DLN_SPI_SLAVE_REPLY_SHORTAGE_REUSE - To fill the missed bytes repeating the reply.

Return Value
DLN_RES_SUCCESS (0x00)

The function successfully configured the shortage action.

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_BUSY (0xB6)

The SPI slave is busy transmitting. The reply shortage action cannot be changed. To change configuration, use the DlnSpiSlaveDisable() function.

Remarks

When the master sends a data block that is larger than the loaded reply, this function specifies how to fill empty bytes (repeat the reply bytes or send zeroes). For example, the loaded reply includes 3 bytes (11 22 33), but the master sends 5 bytes. If the function sets the DLN_SPI_SLAVE_REPLY_SHORTAGE_SEND_ZEROES value, the slave sends 11 22 33 00 00. If the function sets the DLN_SPI_SLAVE_REPLY_SHORTAGE_REUSE value, the slave sends 11 22 33 11 22. For details, read Reply Shortage Actions.

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

Языки

Вход на сайт