1.34.25.10 TWIHSx_LastByteAckStatusGet Function

C

/* x = TWIHS instance number */

/* TWIHS slave mode */
TWIHS_SLAVE_ACK_STATUS TWIHSx_LastByteAckStatusGet(void)

Summary

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

Description

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

Precondition

TWIHSx_Initialize must have been called for the associated TWIHS instance.

Parameters

None.

Returns

TWIHS_SLAVE_ACK_STATUS_RECEIVED_ACK - TWIHS master acknowledged the last byte

TWIHS_SLAVE_ACK_STATUS_RECEIVED_NAK - TWIHS master sent NAK

Example

TWIHS_SLAVE_ACK_STATUS ackStatus;
ackStatus = TWIHS1_LastByteAckStatusGet();

Remarks

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