/* Returns the current status register of the given TWI peripheral, but masking interrupt sources which are not currently enabled. This resets the internal value of the status register, so further read may yield different values.  */
unsigned int TWI_GetMaskedStatus(AT91S_TWI *pTwi)
/* Returns the current status register of the given TWI peripheral, but masking interrupt sources which are not currently enabled. This resets the internal value of the status register, so further read may yield different values.  */
unsigned int TWI_GetMaskedStatus(AT91S_TWI *pTwi)
{
    unsigned int status;
    SANITY_CHECK(pTwi);
    status = pTwi->TWI_SR;
    status &= pTwi->TWI_IMR;
    return status;
}