You are here

DlnI2cSlaveEnable() Function

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

DLN_RESULT DlnI2cSlaveEnable(
   HDLN handle,
   uint8_t port,
   uint16_t* conflict

A handle to the DLN-series adapter.


A number of the I2C slave port.


A number of the pin that is currently occupied by another module. To fix this, check which module uses the pin (call the DlnGetPinCfg()function), disconnect the pin from that module and call the DlnI2cSlaveEnable() function once again.

Return Value

The function successfully activated the I2C slave port.


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


At least one pin of the port is assigned to another module. The conflict parameter contains the number of the conflicting pin.


The I2C slave address is not specified for this device. Use the DlnI2cSlaveSetAddress() function to specify the address.


The I2C bus interface requires two lines for data transmission and synchronization (SDA and SCL). If any of these lines is used by another module, the DLN adapter cannot activate the I2C slave port. The DlnI2cSlaveEnable() function returns only one conflicting pin. If both SCL and SDA lines are in use, you need to call this function three times: two times to detect both conflicting pins and the third time to enable the I2C slave port.

The DlnI2cSlaveEnable() function is defined in the dln_i2c_slave.h file.

User login