/* Selects the specified I2C NACK position in master receiver mode. This function is useful in I2C Master Receiver mode when the number of data to be received is equal to 2. In this case, this function should be called (with parameter I2C_NACKPosition_Next) before data reception starts,as described in the 2-byte reception procedure recommended in Reference Manual in Section: Master receiver. */
void I2CNACKPositionConfig(unsigned long ulBase, unsigned long ulNACKPosition)
/* Selects the specified I2C NACK position in master receiver mode. This function is useful in I2C Master Receiver mode when the number of data to be received is equal to 2. In this case, this function should be called (with parameter I2C_NACKPosition_Next) before data reception starts,as described in the 2-byte reception procedure recommended in Reference Manual in Section: Master receiver. */
void I2CNACKPositionConfig(unsigned long ulBase, unsigned long ulNACKPosition)
{
    xASSERT((ulBase == I2C1_BASE) || (ulBase == I2C2_BASE));
    xASSERT((ulNACKPosition == I2C_NACKPOS_NEXT) ||
            (ulNACKPosition == I2C_NACKPOS_CURRENT));
    xHWREG(ulBase + I2C_CR1) &= ~I2C_CR1_POS;
    xHWREG(ulBase + I2C_CR1) |= ulNACKPosition;
}