Lines Matching refs:i2c
38 uint32_t I2C_Open(I2C_T *i2c, uint32_t u32BusClock) in I2C_Open() argument
43 if( (i2c == I2C1) || (i2c == I2C3) ) in I2C_Open()
53 i2c->CLKDIV = u32Div; in I2C_Open()
56 i2c->CTL0 |= I2C_CTL0_I2CEN_Msk; in I2C_Open()
72 void I2C_Close(I2C_T *i2c) in I2C_Close() argument
75 if(i2c == I2C0) in I2C_Close()
80 else if(i2c == I2C1) in I2C_Close()
85 else if(i2c == I2C2) in I2C_Close()
90 else if(i2c == I2C3) in I2C_Close()
97 i2c->CTL0 &= ~I2C_CTL0_I2CEN_Msk; in I2C_Close()
110 void I2C_ClearTimeoutFlag(I2C_T *i2c) in I2C_ClearTimeoutFlag() argument
112 i2c->TOCTL |= I2C_TOCTL_TOIF_Msk; in I2C_ClearTimeoutFlag()
129 void I2C_Trigger(I2C_T *i2c, uint8_t u8Start, uint8_t u8Stop, uint8_t u8Si, uint8_t u8Ack) in I2C_Trigger() argument
153 i2c->CTL0 = (i2c->CTL0 & ~0x3CU) | u32Reg; in I2C_Trigger()
166 void I2C_DisableInt(I2C_T *i2c) in I2C_DisableInt() argument
168 i2c->CTL0 &= ~I2C_CTL0_INTEN_Msk; in I2C_DisableInt()
181 void I2C_EnableInt(I2C_T *i2c) in I2C_EnableInt() argument
183 i2c->CTL0 |= I2C_CTL0_INTEN_Msk; in I2C_EnableInt()
195 uint32_t I2C_GetBusClockFreq(I2C_T *i2c) in I2C_GetBusClockFreq() argument
197 uint32_t u32Divider = i2c->CLKDIV; in I2C_GetBusClockFreq()
200 if( (i2c == I2C1) || (i2c == I2C3) ) in I2C_GetBusClockFreq()
222 uint32_t I2C_SetBusClockFreq(I2C_T *i2c, uint32_t u32BusClock) in I2C_SetBusClockFreq() argument
227 if( (i2c == I2C1) || (i2c == I2C3) ) in I2C_SetBusClockFreq()
237 i2c->CLKDIV = u32Div; in I2C_SetBusClockFreq()
251 uint32_t I2C_GetIntFlag(I2C_T *i2c) in I2C_GetIntFlag() argument
255 if((i2c->CTL0 & I2C_CTL0_SI_Msk) == I2C_CTL0_SI_Msk) in I2C_GetIntFlag()
276 uint32_t I2C_GetStatus(I2C_T *i2c) in I2C_GetStatus() argument
278 return (i2c->STATUS0); in I2C_GetStatus()
290 uint8_t I2C_GetData(I2C_T *i2c) in I2C_GetData() argument
292 return (uint8_t)(i2c->DAT); in I2C_GetData()
305 void I2C_SetData(I2C_T *i2c, uint8_t u8Data) in I2C_SetData() argument
307 i2c->DAT = u8Data; in I2C_SetData()
324 void I2C_SetSlaveAddr(I2C_T *i2c, uint8_t u8SlaveNo, uint8_t u8SlaveAddr, uint8_t u8GCMode) in I2C_SetSlaveAddr() argument
329 i2c->ADDR1 = ((uint32_t)u8SlaveAddr << 1U) | u8GCMode; in I2C_SetSlaveAddr()
332 i2c->ADDR2 = ((uint32_t)u8SlaveAddr << 1U) | u8GCMode; in I2C_SetSlaveAddr()
335 i2c->ADDR3 = ((uint32_t)u8SlaveAddr << 1U) | u8GCMode; in I2C_SetSlaveAddr()
339 i2c->ADDR0 = ((uint32_t)u8SlaveAddr << 1U) | u8GCMode; in I2C_SetSlaveAddr()
356 void I2C_SetSlaveAddrMask(I2C_T *i2c, uint8_t u8SlaveNo, uint8_t u8SlaveAddrMask) in I2C_SetSlaveAddrMask() argument
361 i2c->ADDRMSK1 = (uint32_t)u8SlaveAddrMask << 1U; in I2C_SetSlaveAddrMask()
364 i2c->ADDRMSK2 = (uint32_t)u8SlaveAddrMask << 1U; in I2C_SetSlaveAddrMask()
367 i2c->ADDRMSK3 = (uint32_t)u8SlaveAddrMask << 1U; in I2C_SetSlaveAddrMask()
371 i2c->ADDRMSK0 = (uint32_t)u8SlaveAddrMask << 1U; in I2C_SetSlaveAddrMask()
388 void I2C_EnableTimeout(I2C_T *i2c, uint8_t u8LongTimeout) in I2C_EnableTimeout() argument
392 i2c->TOCTL |= I2C_TOCTL_TOCDIV4_Msk; in I2C_EnableTimeout()
396 i2c->TOCTL &= ~I2C_TOCTL_TOCDIV4_Msk; in I2C_EnableTimeout()
399 i2c->TOCTL |= I2C_TOCTL_TOCEN_Msk; in I2C_EnableTimeout()
412 void I2C_DisableTimeout(I2C_T *i2c) in I2C_DisableTimeout() argument
414 i2c->TOCTL &= ~I2C_TOCTL_TOCEN_Msk; in I2C_DisableTimeout()
427 void I2C_EnableWakeup(I2C_T *i2c) in I2C_EnableWakeup() argument
429 i2c->WKCTL |= I2C_WKCTL_WKEN_Msk; in I2C_EnableWakeup()
442 void I2C_DisableWakeup(I2C_T *i2c) in I2C_DisableWakeup() argument
444 i2c->WKCTL &= ~I2C_WKCTL_WKEN_Msk; in I2C_DisableWakeup()
461 void I2C_EnableTwoBufferMode(I2C_T *i2c, uint32_t u32BitCount) in I2C_EnableTwoBufferMode() argument
464 … i2c->CTL0 = (i2c->CTL0 & ~0xC33C) | (I2C_CTL0_SRCINTEN_Msk | I2C_CTL0_DPCINTEN_Msk | u32BitCount); in I2C_EnableTwoBufferMode()
467 i2c->CTL1 |= I2C_CTL1_TWOBUFEN_Msk; in I2C_EnableTwoBufferMode()
480 void I2C_DisableTwoBufferMode(I2C_T *i2c) in I2C_DisableTwoBufferMode() argument
483 …i2c->CTL0 = (i2c->CTL0 & ~0xC03C) & ~(I2C_CTL0_SRCINTEN_Msk | I2C_CTL0_DPCINTEN_Msk | I2C_CTL0_DPB… in I2C_DisableTwoBufferMode()
486 i2c->CTL1 &= ~I2C_CTL1_TWOBUFEN_Msk; in I2C_DisableTwoBufferMode()
499 uint32_t I2C_SMBusGetStatus(I2C_T *i2c) in I2C_SMBusGetStatus() argument
501 return (i2c->BUSSTS); in I2C_SMBusGetStatus()
515 void I2C_SMBusClearInterruptFlag(I2C_T *i2c, uint8_t u8SMBusIntFlag) in I2C_SMBusClearInterruptFlag() argument
517 i2c->BUSSTS = u8SMBusIntFlag; in I2C_SMBusClearInterruptFlag()
531 void I2C_SMBusSetPacketByteCount(I2C_T *i2c, uint32_t u32PktSize) in I2C_SMBusSetPacketByteCount() argument
533 i2c->PKTSIZE = u32PktSize; in I2C_SMBusSetPacketByteCount()
547 void I2C_SMBusOpen(I2C_T *i2c, uint8_t u8HostDevice) in I2C_SMBusOpen() argument
550 i2c->BUSCTL &= ~(I2C_BUSCTL_BMHEN_Msk | I2C_BUSCTL_BMDEN_Msk); in I2C_SMBusOpen()
555 i2c->BUSCTL |= (I2C_BUSCTL_BMHEN_Msk | I2C_BUSCTL_BUSEN_Msk); in I2C_SMBusOpen()
559 i2c->BUSCTL |= (I2C_BUSCTL_BMDEN_Msk | I2C_BUSCTL_BUSEN_Msk); in I2C_SMBusOpen()
573 void I2C_SMBusClose(I2C_T *i2c) in I2C_SMBusClose() argument
576 i2c->BUSCTL = 0x00U; in I2C_SMBusClose()
590 void I2C_SMBusPECTxEnable(I2C_T *i2c, uint8_t u8PECTxEn) in I2C_SMBusPECTxEnable() argument
592 i2c->BUSCTL &= ~I2C_BUSCTL_PECTXEN_Msk; in I2C_SMBusPECTxEnable()
596 i2c->BUSCTL |= (I2C_BUSCTL_PECEN_Msk | I2C_BUSCTL_PECTXEN_Msk); in I2C_SMBusPECTxEnable()
600 i2c->BUSCTL |= I2C_BUSCTL_PECEN_Msk; in I2C_SMBusPECTxEnable()
614 uint8_t I2C_SMBusGetPECValue(I2C_T *i2c) in I2C_SMBusGetPECValue() argument
616 return (uint8_t)i2c->PKTCRC; in I2C_SMBusGetPECValue()
632 void I2C_SMBusIdleTimeout(I2C_T *i2c, uint32_t us, uint32_t u32Hclk) in I2C_SMBusIdleTimeout() argument
636 i2c->BUSCTL |= I2C_BUSCTL_TIDLE_Msk; in I2C_SMBusIdleTimeout()
641 i2c->BUSTOUT = 0xFFU; in I2C_SMBusIdleTimeout()
645 i2c->BUSTOUT = u32Div; in I2C_SMBusIdleTimeout()
664 void I2C_SMBusTimeout(I2C_T *i2c, uint32_t ms, uint32_t u32Pclk) in I2C_SMBusTimeout() argument
668 i2c->BUSCTL &= ~I2C_BUSCTL_TIDLE_Msk; in I2C_SMBusTimeout()
671 i2c->TOCTL &= ~I2C_TOCTL_TOCEN_Msk; in I2C_SMBusTimeout()
676 i2c->BUSTOUT = u32Div; in I2C_SMBusTimeout()
681 i2c->TOCTL |= I2C_TOCTL_TOCEN_Msk; in I2C_SMBusTimeout()
682 …i2c->BUSTOUT = (((ms * u32Pclk_kHz) / (16U * 1024U * 4U)) - 1U) & 0xFFU; /* The max value is 255 */ in I2C_SMBusTimeout()
700 void I2C_SMBusClockLoTimeout(I2C_T *i2c, uint32_t ms, uint32_t u32Pclk) in I2C_SMBusClockLoTimeout() argument
704 i2c->BUSCTL &= ~I2C_BUSCTL_TIDLE_Msk; in I2C_SMBusClockLoTimeout()
707 i2c->TOCTL &= ~I2C_TOCTL_TOCEN_Msk; in I2C_SMBusClockLoTimeout()
712 i2c->CLKTOUT = u32Div; in I2C_SMBusClockLoTimeout()
717 i2c->TOCTL |= I2C_TOCTL_TOCEN_Msk; in I2C_SMBusClockLoTimeout()
718 …i2c->CLKTOUT = (((ms * u32Pclk_kHz) / (16U * 1024U * 4U)) - 1U) & 0xFFU; /* The max value is 255 */ in I2C_SMBusClockLoTimeout()
737 uint8_t I2C_WriteByte(I2C_T *i2c, uint8_t u8SlaveAddr, uint8_t data) in I2C_WriteByte() argument
744 I2C_START(i2c); in I2C_WriteByte()
748 I2C_WAIT_READY(i2c) in I2C_WriteByte()
758 switch(I2C_GET_STATUS(i2c)) in I2C_WriteByte()
761 … I2C_SET_DATA(i2c, (uint8_t)(u8SlaveAddr << 1u | 0x00u)); /* Write SLA+W to Register I2CDAT */ in I2C_WriteByte()
765 I2C_SET_DATA(i2c, data); /* Write data to I2CDAT */ in I2C_WriteByte()
778 I2C_SET_CONTROL_REG(i2c, I2C_CTL_STO_SI); /* Clear SI and send STOP */ in I2C_WriteByte()
783 …I2C_SET_CONTROL_REG(i2c, u8Ctrl); /* Write controlbit to I2C_CTL register */ in I2C_WriteByte()
802 uint32_t I2C_WriteMultiBytes(I2C_T *i2c, uint8_t u8SlaveAddr, uint8_t data[], uint32_t u32wLen) in I2C_WriteMultiBytes() argument
810 I2C_START(i2c); /* Send START */ in I2C_WriteMultiBytes()
814 I2C_WAIT_READY(i2c) in I2C_WriteMultiBytes()
824 switch(I2C_GET_STATUS(i2c)) in I2C_WriteMultiBytes()
827 … I2C_SET_DATA(i2c, (uint8_t)(u8SlaveAddr << 1u | 0x00u)); /* Write SLA+W to Register I2CDAT */ in I2C_WriteMultiBytes()
834 I2C_SET_DATA(i2c, data[u32txLen++]); /* Write Data to I2CDAT */ in I2C_WriteMultiBytes()
849 I2C_SET_CONTROL_REG(i2c, I2C_CTL_STO_SI); /* Clear SI and send STOP */ in I2C_WriteMultiBytes()
854 …I2C_SET_CONTROL_REG(i2c, u8Ctrl); /* Write controlbit to I2C_CTL register */ in I2C_WriteMultiBytes()
874 uint8_t I2C_WriteByteOneReg(I2C_T *i2c, uint8_t u8SlaveAddr, uint8_t u8DataAddr, uint8_t data) in I2C_WriteByteOneReg() argument
882 I2C_START(i2c); /* Send START */ in I2C_WriteByteOneReg()
886 I2C_WAIT_READY(i2c) in I2C_WriteByteOneReg()
896 switch(I2C_GET_STATUS(i2c)) in I2C_WriteByteOneReg()
899 …I2C_SET_DATA(i2c, (uint8_t)(u8SlaveAddr << 1u | 0x00u)); /* Send Slave address with write bit */ in I2C_WriteByteOneReg()
903 I2C_SET_DATA(i2c, u8DataAddr); /* Write Lo byte address of register */ in I2C_WriteByteOneReg()
913 I2C_SET_DATA(i2c, data); in I2C_WriteByteOneReg()
924 I2C_SET_CONTROL_REG(i2c, I2C_CTL_STO_SI); /* Clear SI and send STOP */ in I2C_WriteByteOneReg()
929 …I2C_SET_CONTROL_REG(i2c, u8Ctrl); /* Write controlbit to I2C_CTL register */ in I2C_WriteByteOneReg()
950 uint32_t I2C_WriteMultiBytesOneReg(I2C_T *i2c, uint8_t u8SlaveAddr, uint8_t u8DataAddr, uint8_t dat… in I2C_WriteMultiBytesOneReg() argument
958 I2C_START(i2c); /* Send START */ in I2C_WriteMultiBytesOneReg()
962 I2C_WAIT_READY(i2c) in I2C_WriteMultiBytesOneReg()
972 switch(I2C_GET_STATUS(i2c)) in I2C_WriteMultiBytesOneReg()
975 … I2C_SET_DATA(i2c, (uint8_t)(u8SlaveAddr << 1u | 0x00u)); /* Write SLA+W to Register I2CDAT */ in I2C_WriteMultiBytesOneReg()
979 I2C_SET_DATA(i2c, u8DataAddr); /* Write Lo byte address of register */ in I2C_WriteMultiBytesOneReg()
989 I2C_SET_DATA(i2c, data[u32txLen++]); in I2C_WriteMultiBytesOneReg()
999 I2C_SET_CONTROL_REG(i2c, I2C_CTL_STO_SI); /* Clear SI and send STOP */ in I2C_WriteMultiBytesOneReg()
1004 …I2C_SET_CONTROL_REG(i2c, u8Ctrl); /* Write controlbit to I2C_CTL register */ in I2C_WriteMultiBytesOneReg()
1025 uint8_t I2C_WriteByteTwoRegs(I2C_T *i2c, uint8_t u8SlaveAddr, uint16_t u16DataAddr, uint8_t data) in I2C_WriteByteTwoRegs() argument
1033 I2C_START(i2c); /* Send START */ in I2C_WriteByteTwoRegs()
1037 I2C_WAIT_READY(i2c) in I2C_WriteByteTwoRegs()
1047 switch(I2C_GET_STATUS(i2c)) in I2C_WriteByteTwoRegs()
1050 …I2C_SET_DATA(i2c, (uint8_t)(u8SlaveAddr << 1u | 0x00u)); /* Write SLA+W to Register … in I2C_WriteByteTwoRegs()
1054 …I2C_SET_DATA(i2c, (uint8_t)((u16DataAddr & 0xFF00u) >> 8u)); /* Write Hi byte address of regist… in I2C_WriteByteTwoRegs()
1064 … I2C_SET_DATA(i2c, (uint8_t)(u16DataAddr & 0xFFu)); /* Write Lo byte address of register */ in I2C_WriteByteTwoRegs()
1069 I2C_SET_DATA(i2c, data); in I2C_WriteByteTwoRegs()
1080 I2C_SET_CONTROL_REG(i2c, I2C_CTL_STO_SI); /* Clear SI and send STOP */ in I2C_WriteByteTwoRegs()
1085 …I2C_SET_CONTROL_REG(i2c, u8Ctrl); /* Write controlbit to I2C_CTL… in I2C_WriteByteTwoRegs()
1106 uint32_t I2C_WriteMultiBytesTwoRegs(I2C_T *i2c, uint8_t u8SlaveAddr, uint16_t u16DataAddr, uint8_t … in I2C_WriteMultiBytesTwoRegs() argument
1114 I2C_START(i2c); /* Send START */ in I2C_WriteMultiBytesTwoRegs()
1118 I2C_WAIT_READY(i2c) in I2C_WriteMultiBytesTwoRegs()
1128 switch(I2C_GET_STATUS(i2c)) in I2C_WriteMultiBytesTwoRegs()
1131 …I2C_SET_DATA(i2c, (uint8_t)(u8SlaveAddr << 1u | 0x00u)); /* Write SLA+W to Register … in I2C_WriteMultiBytesTwoRegs()
1135 …I2C_SET_DATA(i2c, (uint8_t)((u16DataAddr & 0xFF00u) >> 8u)); /* Write Hi byte address of regist… in I2C_WriteMultiBytesTwoRegs()
1145 … I2C_SET_DATA(i2c, (uint8_t)(u16DataAddr & 0xFFu)); /* Write Lo byte address of register */ in I2C_WriteMultiBytesTwoRegs()
1150 … I2C_SET_DATA(i2c, data[u32txLen++]); /* Write data to Register I2CDAT*/ in I2C_WriteMultiBytesTwoRegs()
1160 I2C_SET_CONTROL_REG(i2c, I2C_CTL_STO_SI); /* Clear SI and send STOP */ in I2C_WriteMultiBytesTwoRegs()
1165 …I2C_SET_CONTROL_REG(i2c, u8Ctrl); /* Write controlbit to I2C_CTL… in I2C_WriteMultiBytesTwoRegs()
1181 uint8_t I2C_ReadByte(I2C_T *i2c, uint8_t u8SlaveAddr) in I2C_ReadByte() argument
1188 I2C_START(i2c); /* Send START */ in I2C_ReadByte()
1192 I2C_WAIT_READY(i2c) in I2C_ReadByte()
1202 switch(I2C_GET_STATUS(i2c)) in I2C_ReadByte()
1205 … I2C_SET_DATA(i2c, (uint8_t)((u8SlaveAddr << 1u) | 0x01u)); /* Write SLA+R to Register I2CDAT */ in I2C_ReadByte()
1216 rdata = (uint8_t) I2C_GET_DATA(i2c); /* Receive Data */ in I2C_ReadByte()
1222 I2C_SET_CONTROL_REG(i2c, I2C_CTL_STO_SI); /* Clear SI and send STOP */ in I2C_ReadByte()
1227 …I2C_SET_CONTROL_REG(i2c, u8Ctrl); /* Write controlbit to I2C_CTL register… in I2C_ReadByte()
1251 uint32_t I2C_ReadMultiBytes(I2C_T *i2c, uint8_t u8SlaveAddr, uint8_t rdata[], uint32_t u32rLen) in I2C_ReadMultiBytes() argument
1259 I2C_START(i2c); /* Send START */ in I2C_ReadMultiBytes()
1263 I2C_WAIT_READY(i2c) in I2C_ReadMultiBytes()
1273 switch(I2C_GET_STATUS(i2c)) in I2C_ReadMultiBytes()
1276 … I2C_SET_DATA(i2c, (uint8_t)((u8SlaveAddr << 1u) | 0x01u)); /* Write SLA+R to Register I2CDAT */ in I2C_ReadMultiBytes()
1287 rdata[u32rxLen++] = (uint8_t) I2C_GET_DATA(i2c); /* Receive Data */ in I2C_ReadMultiBytes()
1298 rdata[u32rxLen++] = (uint8_t) I2C_GET_DATA(i2c); /* Receive Data */ in I2C_ReadMultiBytes()
1304 I2C_SET_CONTROL_REG(i2c, I2C_CTL_STO_SI); /* Clear SI and send STOP */ in I2C_ReadMultiBytes()
1309 …I2C_SET_CONTROL_REG(i2c, u8Ctrl); /* Write controlbit to I2C_CTL r… in I2C_ReadMultiBytes()
1328 uint8_t I2C_ReadByteOneReg(I2C_T *i2c, uint8_t u8SlaveAddr, uint8_t u8DataAddr) in I2C_ReadByteOneReg() argument
1335 I2C_START(i2c); /* Send START */ in I2C_ReadByteOneReg()
1339 I2C_WAIT_READY(i2c) in I2C_ReadByteOneReg()
1349 switch(I2C_GET_STATUS(i2c)) in I2C_ReadByteOneReg()
1352 … I2C_SET_DATA(i2c, (uint8_t)(u8SlaveAddr << 1u | 0x00u)); /* Write SLA+W to Register I2CDAT */ in I2C_ReadByteOneReg()
1356 … I2C_SET_DATA(i2c, u8DataAddr); /* Write Lo byte address of register */ in I2C_ReadByteOneReg()
1367 … I2C_SET_DATA(i2c, (uint8_t)((u8SlaveAddr << 1u) | 0x01u)); /* Write SLA+R to Register I2CDAT */ in I2C_ReadByteOneReg()
1378 rdata = (uint8_t) I2C_GET_DATA(i2c); /* Receive Data */ in I2C_ReadByteOneReg()
1384 I2C_SET_CONTROL_REG(i2c, I2C_CTL_STO_SI); /* Clear SI and send STOP */ in I2C_ReadByteOneReg()
1389 …I2C_SET_CONTROL_REG(i2c, u8Ctrl); /* Write controlbit to I2C_CTL register… in I2C_ReadByteOneReg()
1413 uint32_t I2C_ReadMultiBytesOneReg(I2C_T *i2c, uint8_t u8SlaveAddr, uint8_t u8DataAddr, uint8_t rdat… in I2C_ReadMultiBytesOneReg() argument
1421 I2C_START(i2c); /* Send START */ in I2C_ReadMultiBytesOneReg()
1425 I2C_WAIT_READY(i2c) in I2C_ReadMultiBytesOneReg()
1435 switch(I2C_GET_STATUS(i2c)) in I2C_ReadMultiBytesOneReg()
1438 … I2C_SET_DATA(i2c, (uint8_t)(u8SlaveAddr << 1u | 0x00u)); /* Write SLA+W to Register I2CDAT */ in I2C_ReadMultiBytesOneReg()
1442 … I2C_SET_DATA(i2c, u8DataAddr); /* Write Lo byte address of register */ in I2C_ReadMultiBytesOneReg()
1453 … I2C_SET_DATA(i2c, (uint8_t)((u8SlaveAddr << 1u) | 0x01u)); /* Write SLA+R to Register I2CDAT */ in I2C_ReadMultiBytesOneReg()
1464 rdata[u32rxLen++] = (uint8_t) I2C_GET_DATA(i2c); /* Receive Data */ in I2C_ReadMultiBytesOneReg()
1475 rdata[u32rxLen++] = (uint8_t) I2C_GET_DATA(i2c); /* Receive Data */ in I2C_ReadMultiBytesOneReg()
1481 I2C_SET_CONTROL_REG(i2c, I2C_CTL_STO_SI); /* Clear SI and send STOP */ in I2C_ReadMultiBytesOneReg()
1486 …I2C_SET_CONTROL_REG(i2c, u8Ctrl); /* Write controlbit to I2C_CTL register… in I2C_ReadMultiBytesOneReg()
1504 uint8_t I2C_ReadByteTwoRegs(I2C_T *i2c, uint8_t u8SlaveAddr, uint16_t u16DataAddr) in I2C_ReadByteTwoRegs() argument
1511 I2C_START(i2c); /* Send START */ in I2C_ReadByteTwoRegs()
1515 I2C_WAIT_READY(i2c) in I2C_ReadByteTwoRegs()
1525 switch(I2C_GET_STATUS(i2c)) in I2C_ReadByteTwoRegs()
1528 …I2C_SET_DATA(i2c, (uint8_t)(u8SlaveAddr << 1u | 0x00u)); /* Write SLA+W to Register … in I2C_ReadByteTwoRegs()
1532 …I2C_SET_DATA(i2c, (uint8_t)((u16DataAddr & 0xFF00u) >> 8u)); /* Write Hi byte address of regist… in I2C_ReadByteTwoRegs()
1542 … I2C_SET_DATA(i2c, (uint8_t)(u16DataAddr & 0xFFu)); /* Write Lo byte address of register */ in I2C_ReadByteTwoRegs()
1551 …I2C_SET_DATA(i2c, (uint8_t)((u8SlaveAddr << 1u) | 0x01u)); /* Write SLA+R to Register … in I2C_ReadByteTwoRegs()
1562 rdata = (uint8_t) I2C_GET_DATA(i2c); /* Receive Data */ in I2C_ReadByteTwoRegs()
1568 I2C_SET_CONTROL_REG(i2c, I2C_CTL_STO_SI); /* Clear SI and send STOP */ in I2C_ReadByteTwoRegs()
1573 …I2C_SET_CONTROL_REG(i2c, u8Ctrl); /* Write controlbit to I2C_CTL… in I2C_ReadByteTwoRegs()
1597 uint32_t I2C_ReadMultiBytesTwoRegs(I2C_T *i2c, uint8_t u8SlaveAddr, uint16_t u16DataAddr, uint8_t r… in I2C_ReadMultiBytesTwoRegs() argument
1605 I2C_START(i2c); /* Send START */ in I2C_ReadMultiBytesTwoRegs()
1609 I2C_WAIT_READY(i2c) in I2C_ReadMultiBytesTwoRegs()
1619 switch(I2C_GET_STATUS(i2c)) in I2C_ReadMultiBytesTwoRegs()
1622 …I2C_SET_DATA(i2c, (uint8_t)(u8SlaveAddr << 1u | 0x00u)); /* Write SLA+W to Register … in I2C_ReadMultiBytesTwoRegs()
1626 …I2C_SET_DATA(i2c, (uint8_t)((u16DataAddr & 0xFF00u) >> 8u)); /* Write Hi byte address of regist… in I2C_ReadMultiBytesTwoRegs()
1636 … I2C_SET_DATA(i2c, (uint8_t)(u16DataAddr & 0xFFu)); /* Write Lo byte address of register */ in I2C_ReadMultiBytesTwoRegs()
1645 …I2C_SET_DATA(i2c, (uint8_t)((u8SlaveAddr << 1u) | 0x01u)); /* Write SLA+R to Register … in I2C_ReadMultiBytesTwoRegs()
1656 rdata[u32rxLen++] = (uint8_t) I2C_GET_DATA(i2c); /* Receive Data */ in I2C_ReadMultiBytesTwoRegs()
1667 rdata[u32rxLen++] = (uint8_t) I2C_GET_DATA(i2c); /* Receive Data */ in I2C_ReadMultiBytesTwoRegs()
1673 I2C_SET_CONTROL_REG(i2c, I2C_CTL_STO_SI); /* Clear SI and send STOP */ in I2C_ReadMultiBytesTwoRegs()
1678 …I2C_SET_CONTROL_REG(i2c, u8Ctrl); /* Write controlbit to I2C_CTL… in I2C_ReadMultiBytesTwoRegs()