1.25.6.64 FLEXCOMx_TWI_LastByteAckStatusGet Function

C

/* x = FLEXCOM instance number */

/* TWI slave mode */
FLEXCOM_TWI_SLAVE_ACK_STATUS FLEXCOMx_TWI_LastByteAckStatusGet(void)

Summary

Returns the ACK status of the last byte written to the TWI master.

Description

This function returns the ACK status of the last byte written to the TWI master.

Precondition

FLEXCOMx_TWI_Initialize must have been called for the associated FLEXCOM TWI instance.

Parameters

None.

Returns

FLEXCOM_TWI_SLAVE_ACK_STATUS_RECEIVED_ACK - TWI master acknowledged the last byte

FLEXCOM_TWI_SLAVE_ACK_STATUS_RECEIVED_NAK - TWI master sent NAK

Example

FLEXCOM_TWI_SLAVE_ACK_STATUS ackStatus;
ackStatus = FLEXCOM1_TWI_LastByteAckStatusGet();

Remarks

Since this API indicates the status of the last byte sent to the TWI master; for sending the first byte to the TWI master, the application must not call this API. Instead, the application should always send the first byte to TWI master's read request. The application would use this API when the FLEXCOM TWI slave PLIB is used in polled mode (interrupt is disabled).