1.7.23.74 SERCOMx_I2C_AckActionSet Function

C

/* x = SERCOM instance number */

/* I2C slave mode */

void SERCOMx_I2C_AckActionSet(SERCOM_I2C_SLAVE_ACK_ACTION_SEND ackAction)

Summary

Sets the ACK action for the next byte that will be received from the I2C master

Description

Sets the ACK action for the next byte that will be received from the I2C master. This API must be used when the Smart mode is enabled. In Smart mode, SERCOM automatically sends the ACK/NAK based on the Acknowledgement action set. This API allows the application to set the Acknowledgement action for the next character is received.

Preconditions

SERCOMx_I2C_Initialize must have been called for the associated SERCOM I2C instance.

Parameters

Param Description
SERCOM_I2C_SLAVE_ACK_ACTION_SEND_ACK Acknowledge the next byte thatwill be received.
SERCOM_I2C_SLAVE_ACK_ACTION_SEND_NAK Send NAK for the next byte thatwill be received.

Returns

None.

Example

// Send ACK for the next byte that will be received from the I2C master.
SERCOM0_I2C_AckActionSet(SERCOM_I2C_SLAVE_ACK_ACTION_SEND_ACK);

Remarks

This API is only generated when smart mode is enabled in I2C slave mode