You are here

DlnI2cMasterEnable() Function

The DlnI2cMasterEnable() function assigns the specified port to the I2C Master module.

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

A handle to the DLN-series adapter.


A number of the I2C master port.


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 adapter and cannot be used by the I2C master module. To fix this, check which module uses the pin (call the DlnGetPinCfg()function), disconnect the pin from that module and call the DlnI2cMasterEnable() function once again. If there are any more conflicting pins, the next conflicted pin number will be returned.

Return Value

The function activated the I2C master port successfully.


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


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


The DlnI2cMasterEnable() function is defined in the dln_i2c_master.h file.

User login