I2C peripheral selected, should be I2C0, I2C1 or I2C2
[in]
TransferCfg
Pointer to a I2C_M_SETUP_Type structure that contains specified information about the configuration for master transfer.
[in]
Opt
a I2C_TRANSFER_OPT_Type type that selected for interrupt or polling mode.
Returns:
SUCCESS or ERROR
Note:
In case of using I2C to transmit data only, either transmit length set to 0 or transmit data pointer set to NULL.
In case of using I2C to receive data only, either receive length set to 0 or receive data pointer set to NULL.
In case of using I2C to transmit followed by receive data, transmit length, transmit data pointer, receive length and receive data pointer should be set corresponding.
I2C peripheral selected, should be I2C0, I2C1 or I2C2
Returns:
None Note: In monitor mode, the I2C module may lose the ability to stretch the clock (stall the bus) if the ENA_SCL bit is not set. This means that the processor will have a limited amount of time to read the contents of the data received on the bus. If the processor reads the I2DAT shift register, as it ordinarily would, it could have only one bit-time to respond to the interrupt before the received data is overwritten by new data.
I2C peripheral selected, should be I2C0, I2C1 or I2C2
[in]
TransferCfg
Pointer to a I2C_S_SETUP_Type structure that contains specified information about the configuration for master transfer.
[in]
Opt
I2C_TRANSFER_OPT_Type type that selected for interrupt or polling mode.
Returns:
SUCCESS or ERROR
Note: The mode of slave's operation depends on the command sent from master on the I2C bus. If the master send a SLA+W command, this sub-routine will use receive data length and receive data pointer. If the master send a SLA+R command, this sub-routine will use transmit data length and transmit data pointer. If the master issue an repeat start command or a stop command, the slave will enable an time out condition, during time out condition, if there's no activity on I2C bus, the slave will exit, otherwise (i.e. the master send a SLA+R/W), the slave then switch to relevant operation mode. The time out should be used because the return status code can not show difference from stop and repeat start command in slave operation. In case of the expected data length from master is greater than data length that slave can support:
In case of reading operation (from master): slave will return I2C_I2DAT_IDLE_CHAR value.
In case of writing operation (from master): slave will ignore remain data from master.
This site uses cookies to store information on your computer.
By continuing to use our site, you consent to our cookies.
If you are not happy with the use of these cookies, please review our
Cookie Policy
to learn how they can be disabled.
By disabling cookies, some features of the site will not work.
Access Warning
You do not have the correct permissions to perform this operation.