53 #define TWI_STATUS_TXRDY(status) ((status & TWIHS_SR_TXRDY) == TWIHS_SR_TXRDY) 57 #define TWI_STATUS_RXRDY(status) ((status & TWIHS_SR_RXRDY) == TWIHS_SR_RXRDY) 61 #define TWI_STATUS_TXCOMP(status) ((status & TWIHS_SR_TXCOMP) == TWIHS_SR_TXCOMP) uint8_t TWI_TransferComplete(Twihs *pTwi)
Check if current transmission is completed.
Definition: twi.c:307
void TWI_WriteByte(Twihs *pTwi, uint8_t byte)
Sends a byte of data to one of the TWI slaves on the bus.
Definition: twi.c:237
void TWI_DisableIt(Twihs *pTwi, uint32_t sources)
Disables the selected interrupts sources on a TWI peripheral.
Definition: twi.c:330
uint8_t TWI_ReadByte(Twihs *pTwi)
Reads a byte from the TWI bus. The read operation must have been started using TWI_StartRead() and a ...
Definition: twi.c:222
void TWI_ConfigureSlave(Twihs *pTwi, uint8_t slaveAddress)
Configures a TWI peripheral to operate in slave mode.
Definition: twi.c:151
uint8_t TWI_ByteSent(Twihs *pTwi)
Check if a byte have been sent to TWI.
Definition: twi.c:296
uint32_t TWI_GetStatus(Twihs *pTwi)
Get the current status register of the given TWI peripheral.
Definition: twi.c:345
uint8_t TWI_ByteReceived(Twihs *pTwi)
Check if a byte have been received from TWI.
Definition: twi.c:285
void TWI_EnableIt(Twihs *pTwi, uint32_t sources)
Enables the selected interrupts sources on a TWI peripheral.
Definition: twi.c:317
void TWI_SendSTOPCondition(Twihs *pTwi)
Sends a STOP condition. STOP Condition is sent just after completing the current byte transmission in...
Definition: twi.c:376
uint32_t TWI_GetMaskedStatus(Twihs *pTwi)
Returns the current status register of the given TWI peripheral, but masking interrupt sources which ...
Definition: twi.c:359
Twihs hardware registers.
Definition: component_twihs.h:41
void TWI_StartRead(Twihs *pTwi, uint8_t address, uint32_t iaddress, uint8_t isize)
Starts a read operation on the TWI bus with the specified slave, it returns immediately. Data must then be read using TWI_ReadByte() whenever a byte is available (poll using TWI_ByteReceived()).
Definition: twi.c:188
void TWI_ConfigureMaster(Twihs *pTwi, uint32_t twck, uint32_t mck)
Configures a TWI peripheral to operate in master mode, at the given frequency (in Hz)...
Definition: twi.c:112
void TWI_Stop(Twihs *pTwi)
Sends a STOP condition on the TWI.
Definition: twi.c:172
void TWI_StartWrite(Twihs *pTwi, uint8_t address, uint32_t iaddress, uint8_t isize, uint8_t byte)
Starts a write operation on the TWI to access the selected slave, then returns immediately. A byte of data must be provided to start the write; other bytes are written next. after that to send the remaining bytes.
Definition: twi.c:255