Use the I2C Slave Interface functions to control and monitor the I2C Slave module of a DLN-series adapter. The dln_i2c_slave.h
file declares the I2C Slave Interface functions.
General port information:
Retrieves the total number of I2C slave ports available at your DLN-series adapter.
Assigns a port to the I2C Slave module.
Releases a port from the I2C Slave module.
Retrieves whether a port is assigned to the I2C Slave module.
Loads data to be transmitted to an I2C master device.
I2C Slave module configuration functions:
Activates I2C general call support.
Disables I2C general call support.
Retrieves whether I2C general call support is activated.
Retrieves the number of I2C slave addresses supported by the DLN adapter.
Assigns an I2C slave address to the specified I2C slave module.
Retrieves one of the I2C slave addresses assigned to the specified I2C slave module.
I2C Slave event functions:
Configures event generation for an I2C slave port.
Retrieves event generation configuration for an I2C slave port.
Retrieves the list of event types available for an I2C slave port.
The DlnI2cSlaveDisable()
function deactivates the specified I2C slave port at your DLN-series adapter and releases the pins previously used for SDA and SCL lines.
The DlnI2cSlaveEnable()
function activates the specified I2C slave port at your DLN-series adapter.
The DlnI2cSlaveGeneralCallDisable()
function disables the I2C general call support to make this slave ignore general call addressing.
The DlnI2cSlaveGeneralCallEnable()
function activates I2C general call support. With general call all I2C slave devices on the circuit can be addressed by sending zero as I2C slave address.
The DlnI2cSlaveGeneralCallIsEnabled()
function checks whether I2C general call support is enabled for the specified I2C slave port.
The DlnI2cSlaveGetAddress()
function retrieves one of the I2C slave addresses, assigned to the specified I2C slave module. The total number of simultaneously assigned addresses can be retrieved with the DlnI2cSlaveGetAddressCount() function.
The DlnI2cSlaveGetAddressCount()
function retrieves the number of I2C slave addresses supported by the DLN adapter.
DLN-series adapters can acknowledge any I2C slave address. The limitation is only in the amount of slave addresses to be used simultaneously. You can use the DlnI2cSlaveSetAddress() function to configure the I2C slave module to acknowledge specific addresses.
The DlnI2cSlaveGetEvent()
function retrieves settings for I2C event generation for the specified I2C slave port and I2C slave address.
The DlnI2cSlaveGetPortCount()
function retrieves the total number of I2C slave ports available in your DLN-series adapter.
The DlnI2cSlaveGetSupportedEventTypes()
function returns all supported I2C slave event types for opened DLN-series adapter.
The DlnI2cSlaveIsEnabled()
function checks whether the specified I2C slave port is active or not.
The DlnI2cSlaveLoadReply()
function loads data to be transferred to an I2C master device.
The DlnI2cSlaveSetAddress()
function assigns I2C addresses to the specified I2C slave module. You can assign any 7-bit address, the limitation is only in quantity of addresses that can be used simultaneously. Use the DlnI2cSlaveGetAddressCount() function to retrieve the number of simultaneously supported I2C slave addresses.
The DlnI2cSlaveSetEvent()
function configures the I2C slave events generation conditions for the specified I2C slave port and I2C slave address.I2C slave events can vary for different I2C slave addresses. Specify the number of the I2C slave address in the slaveAddressNumber
parameter.