You are here

DlnSpiSlaveEnqueueReply() Function

The DlnSpiSlaveEnqueueReply() function adds a buffer to queue.

Syntax
C/C++
DLN_RESULT DlnSpiSlaveEnqueueReply(
    HDLN handle, 
    uint8_t port, 
    uint16_t size, 
    uint8_t *buffer
);
Parameters
handle

A handle to the DLN-series adapter.

port

A number of the SPI-slave port.

size

A size of the message buffer. This parameter is specified in bytes. The maximum value is 256 bytes.

buffer

A pointer to an array of unsigned 8-bit integers (max 256-elements array). The buffer must contain the data to be sent to an SPI bus master.

Return Value
DLN_RES_SUCCESS (0x00)

The function successfully added data to reply queue.

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_BUFFER_SIZE (0xAE)

The buffer size is not valid. The DLN-series adapters support up to 256 bytes of the buffer.

Remarks

If the queue is empty (after enabling), the DlnSpiSlaveEnqueueReply() function is equal to the DlnSpiSlaveLoadReply() function. If the queue is not empty, the DlnSpiSlaveEnqueueReply() function does not remove replies from the queue.

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

Contents

Languages

User login