DlnI2cSlaveSetEvent() Function
Syntax
- C/C++
-
DLN_RESULT DlnI2cSlaveSetEvent( HDLN handle, uint8_t port, uint8_t slaveAddressNumber, uint8_t eventType, );
The DlnI2cSlaveSetEvent() function configures the I2C slave events generation conditions for the specified I2C slave port and I2C slave address.
I2C slave events can be different for different I2C slave addresses. Specify the number of the I2C slave address in slaveAddressNumber parameter.
Parameters:
- handle
- A handle to the DLN-series adapter.
- port
- A number of the I2C slave port to be configured.
- slaveAddressNumber
- A number of the I2C slave address. The slaveAddressNumber parameter is zero base. Possible value are from zero up to (but not including) the value returned by the DlnI2cSlaveGetAddressCount() function.
- eventType
-
A condition for I2C slave event generation . The following values are available:
For additional details take a look at I2C Slave Events section.I2C_SLAVE_EVENT_NONE (0) no I2C slave events are generated I2C_SLAVE_EVENT_READ (1) I2C slave events are generated when an I2C master device reads data from PC-I2C adapter I2C_SLAVE_EVENT_WRITE (2) I2C slave events are generated when an I2C master device writes data to PC-I2C adapter I2C_SLAVE_EVENT_READ_WRITE (1) I2C slave events are generated both for read and write transactions
This function is defined in the dln_i2c_slave.h file.
2006-2012