DlnSpiSlaveEnable() Function

The DlnSpiSlaveEnable() function activates the specified SPI slave port at your DLN-series adapter.

Syntax
C/C++
DLN_RESULT DlnSpiSlaveEnable(
   HDLN handle,
   uint8_t port,
   uint16_t* conflict
);
Parameters
handle

A handle to the DLN-series adapter.

port

A number of the SPI slave port.

conflict

A pointer to an unsigned 16-bit integer that receives a number of the conflicted pin, if any.

A conflict arises if a pin is already assigned to another module of the DLN-series adapter and cannot be used by the SPI slave module. To fix this, check which module uses the pin (call the DlnGetPinCfg()function), disconnect the pin from that module and call the DlnSpiSlaveEnable() function once again. If there is another conflicting pin, its number will be returned.

Return Value
DLN_RES_SUCCESS (0x00)

The function enabled the SPI slave module successfully.

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_PIN_IN_USE (0xA5)

The port cannot be activated as the SPI slave port because one or more pins of the port are assigned to another module. The conflict parameter contains the number of a conflicting pin.

DLN_RES_SPI_SLAVE_SS_IDLE_TIMEOUT (0xCB)

The port cannot be activated as the SPI slave port because its SS line is busy transmitting some data and was not released for time defined by the DlnSpiSlaveSetSSIdleTimeout() function.

Remarks

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