52 #define TWI_STATUS_TXRDY(status) (((status) & TWI_SR_TXRDY) == TWI_SR_TXRDY) 55 #define TWI_STATUS_RXRDY(status) (((status) & TWI_SR_RXRDY) == TWI_SR_RXRDY) 58 #define TWI_STATUS_TXCOMP(status) (((status) & TWI_SR_TXCOMP) == TWI_SR_TXCOMP) 70 extern void TWI_SetClock(
Twi *pTwi, uint32_t dwTwCk, uint32_t dwMCk );
uint8_t TWI_TransferComplete(Twi *pTwi)
Check if current transmission is complet.
Definition: twi.c:323
void TWI_ConfigureSlave(Twi *pTwi, uint8_t slaveAddress)
Configures a TWI peripheral to operate in slave mode.
Definition: twi.c:150
uint32_t TWI_GetMaskedStatus(Twi *pTwi)
Returns the current status register of the given TWI peripheral, but masking interrupt sources which ...
Definition: twi.c:375
uint8_t TWI_ByteReceived(Twi *pTwi)
Check if a byte have been receiced from TWI.
Definition: twi.c:301
void TWI_SendSTOPCondition(Twi *pTwi)
Sends a STOP condition. STOP Condition is sent just after completing the current byte transmission in...
Definition: twi.c:392
void TWI_DisableIt(Twi *pTwi, uint32_t sources)
Disables the selected interrupts sources on a TWI peripheral.
Definition: twi.c:346
uint32_t TWI_GetStatus(Twi *pTwi)
Get the current status register of the given TWI peripheral.
Definition: twi.c:361
void TWI_EnableIt(Twi *pTwi, uint32_t sources)
Enables the selected interrupts sources on a TWI peripheral.
Definition: twi.c:333
void TWI_Disable(Twi *pTwi)
Disables the TWI.
Definition: twi.c:172
void TWI_Stop(Twi *pTwi)
Sends a STOP condition on the TWI.
Definition: twi.c:193
uint8_t TWI_ReadByte(Twi *pTwi)
Reads a byte from the TWI bus. The read operation must have been started using TWI_StartRead() and a ...
Definition: twi.c:238
void TWI_ConfigureMaster(Twi *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:97
void TWI_WriteByte(Twi *pTwi, uint8_t byte)
Sends a byte of data to one of the TWI slaves on the bus.
Definition: twi.c:253
void TWI_StartWrite(Twi *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:271
void TWI_StartRead(Twi *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:209
Twi hardware registers.
Definition: component_twi.h:41
uint8_t TWI_ByteSent(Twi *pTwi)
Check if a byte have been sent to TWI.
Definition: twi.c:312