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((uint32_t)i2c == I2C0_BASE) in I2C_Close()
80 else if((uint32_t)i2c == I2C1_BASE) in I2C_Close()
85 else if((uint32_t)i2c == I2C2_BASE) in I2C_Close()
90 else if((uint32_t)i2c == I2C3_BASE) in I2C_Close()
95 else if((uint32_t)i2c == I2C4_BASE) in I2C_Close()
101 i2c->CTL0 &= ~I2C_CTL0_I2CEN_Msk; in I2C_Close()
114 void I2C_ClearTimeoutFlag(I2C_T *i2c) in I2C_ClearTimeoutFlag() argument
116 i2c->TOCTL |= I2C_TOCTL_TOIF_Msk; in I2C_ClearTimeoutFlag()
133 void I2C_Trigger(I2C_T *i2c, uint8_t u8Start, uint8_t u8Stop, uint8_t u8Si, uint8_t u8Ack) in I2C_Trigger() argument
157 i2c->CTL0 = (i2c->CTL0 & ~0x3CU) | u32Reg; in I2C_Trigger()
170 void I2C_DisableInt(I2C_T *i2c) in I2C_DisableInt() argument
172 i2c->CTL0 &= ~I2C_CTL0_INTEN_Msk; in I2C_DisableInt()
185 void I2C_EnableInt(I2C_T *i2c) in I2C_EnableInt() argument
187 i2c->CTL0 |= I2C_CTL0_INTEN_Msk; in I2C_EnableInt()
199 uint32_t I2C_GetBusClockFreq(I2C_T *i2c) in I2C_GetBusClockFreq() argument
201 uint32_t u32Divider = i2c->CLKDIV; in I2C_GetBusClockFreq()
204 if( (i2c == I2C1) || (i2c == I2C3) ) in I2C_GetBusClockFreq()
226 uint32_t I2C_SetBusClockFreq(I2C_T *i2c, uint32_t u32BusClock) in I2C_SetBusClockFreq() argument
231 if( (i2c == I2C1) || (i2c == I2C3) ) in I2C_SetBusClockFreq()
241 i2c->CLKDIV = u32Div; in I2C_SetBusClockFreq()
255 uint32_t I2C_GetIntFlag(I2C_T *i2c) in I2C_GetIntFlag() argument
259 if((i2c->CTL0 & I2C_CTL0_SI_Msk) == I2C_CTL0_SI_Msk) in I2C_GetIntFlag()
280 uint32_t I2C_GetStatus(I2C_T *i2c) in I2C_GetStatus() argument
282 return (i2c->STATUS0); in I2C_GetStatus()
294 uint8_t I2C_GetData(I2C_T *i2c) in I2C_GetData() argument
296 return (uint8_t)(i2c->DAT); in I2C_GetData()
309 void I2C_SetData(I2C_T *i2c, uint8_t u8Data) in I2C_SetData() argument
311 i2c->DAT = u8Data; in I2C_SetData()
328 void I2C_SetSlaveAddr(I2C_T *i2c, uint8_t u8SlaveNo, uint16_t u16SlaveAddr, uint8_t u8GCMode) in I2C_SetSlaveAddr() argument
334 i2c->ADDR1 = u32AddrRegValue; in I2C_SetSlaveAddr()
337 i2c->ADDR2 = u32AddrRegValue; in I2C_SetSlaveAddr()
340 i2c->ADDR3 = u32AddrRegValue; in I2C_SetSlaveAddr()
344 i2c->ADDR0 = u32AddrRegValue; in I2C_SetSlaveAddr()
361 void I2C_SetSlaveAddrMask(I2C_T *i2c, uint8_t u8SlaveNo, uint16_t u16SlaveAddrMask) in I2C_SetSlaveAddrMask() argument
367 i2c->ADDRMSK1 = u32AddrMskRegValue; in I2C_SetSlaveAddrMask()
370 i2c->ADDRMSK2 = u32AddrMskRegValue; in I2C_SetSlaveAddrMask()
373 i2c->ADDRMSK3 = u32AddrMskRegValue; in I2C_SetSlaveAddrMask()
377 i2c->ADDRMSK0 = u32AddrMskRegValue; in I2C_SetSlaveAddrMask()
394 void I2C_EnableTimeout(I2C_T *i2c, uint8_t u8LongTimeout) in I2C_EnableTimeout() argument
398 i2c->TOCTL |= I2C_TOCTL_TOCDIV4_Msk; in I2C_EnableTimeout()
402 i2c->TOCTL &= ~I2C_TOCTL_TOCDIV4_Msk; in I2C_EnableTimeout()
405 i2c->TOCTL |= I2C_TOCTL_TOCEN_Msk; in I2C_EnableTimeout()
418 void I2C_DisableTimeout(I2C_T *i2c) in I2C_DisableTimeout() argument
420 i2c->TOCTL &= ~I2C_TOCTL_TOCEN_Msk; in I2C_DisableTimeout()
433 void I2C_EnableWakeup(I2C_T *i2c) in I2C_EnableWakeup() argument
435 i2c->WKCTL |= I2C_WKCTL_WKEN_Msk; in I2C_EnableWakeup()
448 void I2C_DisableWakeup(I2C_T *i2c) in I2C_DisableWakeup() argument
450 i2c->WKCTL &= ~I2C_WKCTL_WKEN_Msk; in I2C_DisableWakeup()
463 uint32_t I2C_SMBusGetStatus(I2C_T *i2c) in I2C_SMBusGetStatus() argument
465 return (i2c->BUSSTS); in I2C_SMBusGetStatus()
479 void I2C_SMBusClearInterruptFlag(I2C_T *i2c, uint8_t u8SMBusIntFlag) in I2C_SMBusClearInterruptFlag() argument
481 i2c->BUSSTS = u8SMBusIntFlag; in I2C_SMBusClearInterruptFlag()
495 void I2C_SMBusSetPacketByteCount(I2C_T *i2c, uint32_t u32PktSize) in I2C_SMBusSetPacketByteCount() argument
497 i2c->PKTSIZE = u32PktSize; in I2C_SMBusSetPacketByteCount()
511 void I2C_SMBusOpen(I2C_T *i2c, uint8_t u8HostDevice) in I2C_SMBusOpen() argument
514 i2c->BUSCTL &= ~(I2C_BUSCTL_BMHEN_Msk | I2C_BUSCTL_BMDEN_Msk); in I2C_SMBusOpen()
519 i2c->BUSCTL |= (I2C_BUSCTL_BMHEN_Msk | I2C_BUSCTL_BUSEN_Msk); in I2C_SMBusOpen()
523 i2c->BUSCTL |= (I2C_BUSCTL_BMDEN_Msk | I2C_BUSCTL_BUSEN_Msk); in I2C_SMBusOpen()
537 void I2C_SMBusClose(I2C_T *i2c) in I2C_SMBusClose() argument
540 i2c->BUSCTL = 0x00U; in I2C_SMBusClose()
554 void I2C_SMBusPECTxEnable(I2C_T *i2c, uint8_t u8PECTxEn) in I2C_SMBusPECTxEnable() argument
556 i2c->BUSCTL &= ~I2C_BUSCTL_PECTXEN_Msk; in I2C_SMBusPECTxEnable()
560 i2c->BUSCTL |= (I2C_BUSCTL_PECEN_Msk | I2C_BUSCTL_PECTXEN_Msk); in I2C_SMBusPECTxEnable()
564 i2c->BUSCTL |= I2C_BUSCTL_PECEN_Msk; in I2C_SMBusPECTxEnable()
578 uint8_t I2C_SMBusGetPECValue(I2C_T *i2c) in I2C_SMBusGetPECValue() argument
580 return (uint8_t)i2c->PKTCRC; in I2C_SMBusGetPECValue()
596 void I2C_SMBusIdleTimeout(I2C_T *i2c, uint32_t us, uint32_t u32Hclk) in I2C_SMBusIdleTimeout() argument
600 i2c->BUSCTL |= I2C_BUSCTL_TIDLE_Msk; in I2C_SMBusIdleTimeout()
605 i2c->BUSTOUT = 0xFFU; in I2C_SMBusIdleTimeout()
609 i2c->BUSTOUT = u32Div; in I2C_SMBusIdleTimeout()
628 void I2C_SMBusTimeout(I2C_T *i2c, uint32_t ms, uint32_t u32Pclk) in I2C_SMBusTimeout() argument
632 i2c->BUSCTL &= ~I2C_BUSCTL_TIDLE_Msk; in I2C_SMBusTimeout()
635 i2c->TOCTL &= ~I2C_TOCTL_TOCEN_Msk; in I2C_SMBusTimeout()
640 i2c->BUSTOUT = u32Div; in I2C_SMBusTimeout()
645 i2c->TOCTL |= I2C_TOCTL_TOCEN_Msk; in I2C_SMBusTimeout()
646i2c->BUSTOUT = (((ms * u32Pclk_kHz) / (16U * 1024U * 4U)) - 1U) & 0xFFU; /* The max value is 255 */ in I2C_SMBusTimeout()
664 void I2C_SMBusClockLoTimeout(I2C_T *i2c, uint32_t ms, uint32_t u32Pclk) in I2C_SMBusClockLoTimeout() argument
668 i2c->BUSCTL &= ~I2C_BUSCTL_TIDLE_Msk; in I2C_SMBusClockLoTimeout()
671 i2c->TOCTL &= ~I2C_TOCTL_TOCEN_Msk; in I2C_SMBusClockLoTimeout()
676 i2c->CLKTOUT = u32Div; in I2C_SMBusClockLoTimeout()
681 i2c->TOCTL |= I2C_TOCTL_TOCEN_Msk; in I2C_SMBusClockLoTimeout()
682i2c->CLKTOUT = (((ms * u32Pclk_kHz) / (16U * 1024U * 4U)) - 1U) & 0xFFU; /* The max value is 255 */ in I2C_SMBusClockLoTimeout()
703 uint8_t I2C_WriteByte(I2C_T *i2c, uint8_t u8SlaveAddr, uint8_t data) in I2C_WriteByte() argument
710 I2C_START(i2c); in I2C_WriteByte()
714 I2C_WAIT_READY(i2c) in I2C_WriteByte()
724 switch(I2C_GET_STATUS(i2c)) in I2C_WriteByte()
727 … I2C_SET_DATA(i2c, (uint8_t)(u8SlaveAddr << 1u | 0x00u)); /* Write SLA+W to Register I2CDAT */ in I2C_WriteByte()
731 I2C_SET_DATA(i2c, data); /* Write data to I2CDAT */ in I2C_WriteByte()
744 I2C_SET_CONTROL_REG(i2c, I2C_CTL_STO_SI); /* Clear SI and send STOP */ in I2C_WriteByte()
749 …I2C_SET_CONTROL_REG(i2c, u8Ctrl); /* Write controlbit to I2C_CTL register */ in I2C_WriteByte()
770 uint32_t I2C_WriteMultiBytes(I2C_T *i2c, uint8_t u8SlaveAddr, uint8_t data[], uint32_t u32wLen) in I2C_WriteMultiBytes() argument
777 I2C_START(i2c); /* Send START */ in I2C_WriteMultiBytes()
781 I2C_WAIT_READY(i2c) in I2C_WriteMultiBytes()
791 switch(I2C_GET_STATUS(i2c)) in I2C_WriteMultiBytes()
794 … I2C_SET_DATA(i2c, (uint8_t)(u8SlaveAddr << 1u | 0x00u)); /* Write SLA+W to Register I2CDAT */ in I2C_WriteMultiBytes()
801 I2C_SET_DATA(i2c, data[u32txLen++]); /* Write Data to I2CDAT */ in I2C_WriteMultiBytes()
816 I2C_SET_CONTROL_REG(i2c, I2C_CTL_STO_SI); /* Clear SI and send STOP */ in I2C_WriteMultiBytes()
821 …I2C_SET_CONTROL_REG(i2c, u8Ctrl); /* Write controlbit to I2C_CTL register */ in I2C_WriteMultiBytes()
843 uint8_t I2C_WriteByteOneReg(I2C_T *i2c, uint8_t u8SlaveAddr, uint8_t u8DataAddr, uint8_t data) in I2C_WriteByteOneReg() argument
850 I2C_START(i2c); /* Send START */ in I2C_WriteByteOneReg()
854 I2C_WAIT_READY(i2c) in I2C_WriteByteOneReg()
864 switch(I2C_GET_STATUS(i2c)) in I2C_WriteByteOneReg()
867 …I2C_SET_DATA(i2c, (uint8_t)(u8SlaveAddr << 1u | 0x00u)); /* Send Slave address with write bit */ in I2C_WriteByteOneReg()
871 I2C_SET_DATA(i2c, u8DataAddr); /* Write Lo byte address of register */ in I2C_WriteByteOneReg()
881 I2C_SET_DATA(i2c, data); in I2C_WriteByteOneReg()
892 I2C_SET_CONTROL_REG(i2c, I2C_CTL_STO_SI); /* Clear SI and send STOP */ in I2C_WriteByteOneReg()
897 …I2C_SET_CONTROL_REG(i2c, u8Ctrl); /* Write controlbit to I2C_CTL register */ in I2C_WriteByteOneReg()
920 uint32_t I2C_WriteMultiBytesOneReg(I2C_T *i2c, uint8_t u8SlaveAddr, uint8_t u8DataAddr, uint8_t dat… in I2C_WriteMultiBytesOneReg() argument
927 I2C_START(i2c); /* Send START */ in I2C_WriteMultiBytesOneReg()
931 I2C_WAIT_READY(i2c) in I2C_WriteMultiBytesOneReg()
941 switch(I2C_GET_STATUS(i2c)) in I2C_WriteMultiBytesOneReg()
944 … I2C_SET_DATA(i2c, (uint8_t)(u8SlaveAddr << 1u | 0x00u)); /* Write SLA+W to Register I2CDAT */ in I2C_WriteMultiBytesOneReg()
948 I2C_SET_DATA(i2c, u8DataAddr); /* Write Lo byte address of register */ in I2C_WriteMultiBytesOneReg()
958 I2C_SET_DATA(i2c, data[u32txLen++]); in I2C_WriteMultiBytesOneReg()
968 I2C_SET_CONTROL_REG(i2c, I2C_CTL_STO_SI); /* Clear SI and send STOP */ in I2C_WriteMultiBytesOneReg()
973 …I2C_SET_CONTROL_REG(i2c, u8Ctrl); /* Write controlbit to I2C_CTL register */ in I2C_WriteMultiBytesOneReg()
996 uint8_t I2C_WriteByteTwoRegs(I2C_T *i2c, uint8_t u8SlaveAddr, uint16_t u16DataAddr, uint8_t data) in I2C_WriteByteTwoRegs() argument
1003 I2C_START(i2c); /* Send START */ in I2C_WriteByteTwoRegs()
1007 I2C_WAIT_READY(i2c) in I2C_WriteByteTwoRegs()
1017 switch(I2C_GET_STATUS(i2c)) in I2C_WriteByteTwoRegs()
1020 …I2C_SET_DATA(i2c, (uint8_t)(u8SlaveAddr << 1u | 0x00u)); /* Write SLA+W to Register … in I2C_WriteByteTwoRegs()
1024 …I2C_SET_DATA(i2c, (uint8_t)((u16DataAddr & 0xFF00u) >> 8u)); /* Write Hi byte address of regist… in I2C_WriteByteTwoRegs()
1034 … I2C_SET_DATA(i2c, (uint8_t)(u16DataAddr & 0xFFu)); /* Write Lo byte address of register */ in I2C_WriteByteTwoRegs()
1039 I2C_SET_DATA(i2c, data); in I2C_WriteByteTwoRegs()
1050 I2C_SET_CONTROL_REG(i2c, I2C_CTL_STO_SI); /* Clear SI and send STOP */ in I2C_WriteByteTwoRegs()
1055 …I2C_SET_CONTROL_REG(i2c, u8Ctrl); /* Write controlbit to I2C_CTL… in I2C_WriteByteTwoRegs()
1078 uint32_t I2C_WriteMultiBytesTwoRegs(I2C_T *i2c, uint8_t u8SlaveAddr, uint16_t u16DataAddr, uint8_t … in I2C_WriteMultiBytesTwoRegs() argument
1085 I2C_START(i2c); /* Send START */ in I2C_WriteMultiBytesTwoRegs()
1089 I2C_WAIT_READY(i2c) in I2C_WriteMultiBytesTwoRegs()
1099 switch(I2C_GET_STATUS(i2c)) in I2C_WriteMultiBytesTwoRegs()
1102 …I2C_SET_DATA(i2c, (uint8_t)(u8SlaveAddr << 1u | 0x00u)); /* Write SLA+W to Register … in I2C_WriteMultiBytesTwoRegs()
1106 …I2C_SET_DATA(i2c, (uint8_t)((u16DataAddr & 0xFF00u) >> 8u)); /* Write Hi byte address of regist… in I2C_WriteMultiBytesTwoRegs()
1116 … I2C_SET_DATA(i2c, (uint8_t)(u16DataAddr & 0xFFu)); /* Write Lo byte address of register */ in I2C_WriteMultiBytesTwoRegs()
1121 … I2C_SET_DATA(i2c, data[u32txLen++]); /* Write data to Register I2CDAT*/ in I2C_WriteMultiBytesTwoRegs()
1131 I2C_SET_CONTROL_REG(i2c, I2C_CTL_STO_SI); /* Clear SI and send STOP */ in I2C_WriteMultiBytesTwoRegs()
1136 …I2C_SET_CONTROL_REG(i2c, u8Ctrl); /* Write controlbit to I2C_CTL… in I2C_WriteMultiBytesTwoRegs()
1154 uint8_t I2C_ReadByte(I2C_T *i2c, uint8_t u8SlaveAddr) in I2C_ReadByte() argument
1161 I2C_START(i2c); /* Send START */ in I2C_ReadByte()
1165 I2C_WAIT_READY(i2c) in I2C_ReadByte()
1175 switch(I2C_GET_STATUS(i2c)) in I2C_ReadByte()
1178 … I2C_SET_DATA(i2c, (uint8_t)((u8SlaveAddr << 1u) | 0x01u)); /* Write SLA+R to Register I2CDAT */ in I2C_ReadByte()
1189 rdata = (unsigned char) I2C_GET_DATA(i2c); /* Receive Data */ in I2C_ReadByte()
1195 I2C_SET_CONTROL_REG(i2c, I2C_CTL_STO_SI); /* Clear SI and send STOP */ in I2C_ReadByte()
1200 …I2C_SET_CONTROL_REG(i2c, u8Ctrl); /* Write controlbit to I2C_CTL register… in I2C_ReadByte()
1225 uint32_t I2C_ReadMultiBytes(I2C_T *i2c, uint8_t u8SlaveAddr, uint8_t rdata[], uint32_t u32rLen) in I2C_ReadMultiBytes() argument
1232 I2C_START(i2c); /* Send START */ in I2C_ReadMultiBytes()
1236 I2C_WAIT_READY(i2c) in I2C_ReadMultiBytes()
1246 switch(I2C_GET_STATUS(i2c)) in I2C_ReadMultiBytes()
1249 … I2C_SET_DATA(i2c, (uint8_t)((u8SlaveAddr << 1u) | 0x01u)); /* Write SLA+R to Register I2CDAT */ in I2C_ReadMultiBytes()
1260 rdata[u32rxLen++] = (unsigned char) I2C_GET_DATA(i2c); /* Receive Data */ in I2C_ReadMultiBytes()
1271 rdata[u32rxLen++] = (unsigned char) I2C_GET_DATA(i2c); /* Receive Data */ in I2C_ReadMultiBytes()
1277 I2C_SET_CONTROL_REG(i2c, I2C_CTL_STO_SI); /* Clear SI and send STOP */ in I2C_ReadMultiBytes()
1282 …I2C_SET_CONTROL_REG(i2c, u8Ctrl); /* Write controlbit to I2C_CTL r… in I2C_ReadMultiBytes()
1302 uint8_t I2C_ReadByteOneReg(I2C_T *i2c, uint8_t u8SlaveAddr, uint8_t u8DataAddr) in I2C_ReadByteOneReg() argument
1309 I2C_START(i2c); /* Send START */ in I2C_ReadByteOneReg()
1313 I2C_WAIT_READY(i2c) in I2C_ReadByteOneReg()
1323 switch(I2C_GET_STATUS(i2c)) in I2C_ReadByteOneReg()
1326 … I2C_SET_DATA(i2c, (uint8_t)(u8SlaveAddr << 1u | 0x00u)); /* Write SLA+W to Register I2CDAT */ in I2C_ReadByteOneReg()
1330 … I2C_SET_DATA(i2c, u8DataAddr); /* Write Lo byte address of register */ in I2C_ReadByteOneReg()
1341 … I2C_SET_DATA(i2c, (uint8_t)((u8SlaveAddr << 1u) | 0x01u)); /* Write SLA+R to Register I2CDAT */ in I2C_ReadByteOneReg()
1352 rdata = (uint8_t) I2C_GET_DATA(i2c); /* Receive Data */ in I2C_ReadByteOneReg()
1358 I2C_SET_CONTROL_REG(i2c, I2C_CTL_STO_SI); /* Clear SI and send STOP */ in I2C_ReadByteOneReg()
1363 …I2C_SET_CONTROL_REG(i2c, u8Ctrl); /* Write controlbit to I2C_CTL register… in I2C_ReadByteOneReg()
1388 uint32_t I2C_ReadMultiBytesOneReg(I2C_T *i2c, uint8_t u8SlaveAddr, uint8_t u8DataAddr, uint8_t rdat… in I2C_ReadMultiBytesOneReg() argument
1395 I2C_START(i2c); /* Send START */ in I2C_ReadMultiBytesOneReg()
1399 I2C_WAIT_READY(i2c) in I2C_ReadMultiBytesOneReg()
1409 switch(I2C_GET_STATUS(i2c)) in I2C_ReadMultiBytesOneReg()
1412 … I2C_SET_DATA(i2c, (uint8_t)(u8SlaveAddr << 1u | 0x00u)); /* Write SLA+W to Register I2CDAT */ in I2C_ReadMultiBytesOneReg()
1416 … I2C_SET_DATA(i2c, u8DataAddr); /* Write Lo byte address of register */ in I2C_ReadMultiBytesOneReg()
1427 … I2C_SET_DATA(i2c, (uint8_t)((u8SlaveAddr << 1u) | 0x01u)); /* Write SLA+R to Register I2CDAT */ in I2C_ReadMultiBytesOneReg()
1438 rdata[u32rxLen++] = (uint8_t) I2C_GET_DATA(i2c); /* Receive Data */ in I2C_ReadMultiBytesOneReg()
1449 rdata[u32rxLen++] = (uint8_t) I2C_GET_DATA(i2c); /* Receive Data */ in I2C_ReadMultiBytesOneReg()
1455 I2C_SET_CONTROL_REG(i2c, I2C_CTL_STO_SI); /* Clear SI and send STOP */ in I2C_ReadMultiBytesOneReg()
1460 …I2C_SET_CONTROL_REG(i2c, u8Ctrl); /* Write controlbit to I2C_CTL register… in I2C_ReadMultiBytesOneReg()
1479 uint8_t I2C_ReadByteTwoRegs(I2C_T *i2c, uint8_t u8SlaveAddr, uint16_t u16DataAddr) in I2C_ReadByteTwoRegs() argument
1486 I2C_START(i2c); /* Send START */ in I2C_ReadByteTwoRegs()
1490 I2C_WAIT_READY(i2c) in I2C_ReadByteTwoRegs()
1500 switch(I2C_GET_STATUS(i2c)) in I2C_ReadByteTwoRegs()
1503 …I2C_SET_DATA(i2c, (uint8_t)(u8SlaveAddr << 1u | 0x00u)); /* Write SLA+W to Register … in I2C_ReadByteTwoRegs()
1507 …I2C_SET_DATA(i2c, (uint8_t)((u16DataAddr & 0xFF00u) >> 8u)); /* Write Hi byte address of regist… in I2C_ReadByteTwoRegs()
1517 … I2C_SET_DATA(i2c, (uint8_t)(u16DataAddr & 0xFFu)); /* Write Lo byte address of register */ in I2C_ReadByteTwoRegs()
1526 …I2C_SET_DATA(i2c, (uint8_t)((u8SlaveAddr << 1u) | 0x01u)); /* Write SLA+R to Register … in I2C_ReadByteTwoRegs()
1537 rdata = (unsigned char) I2C_GET_DATA(i2c); /* Receive Data */ in I2C_ReadByteTwoRegs()
1543 I2C_SET_CONTROL_REG(i2c, I2C_CTL_STO_SI); /* Clear SI and send STOP */ in I2C_ReadByteTwoRegs()
1548 …I2C_SET_CONTROL_REG(i2c, u8Ctrl); /* Write controlbit to I2C_CTL… in I2C_ReadByteTwoRegs()
1573 uint32_t I2C_ReadMultiBytesTwoRegs(I2C_T *i2c, uint8_t u8SlaveAddr, uint16_t u16DataAddr, uint8_t r… in I2C_ReadMultiBytesTwoRegs() argument
1580 I2C_START(i2c); /* Send START */ in I2C_ReadMultiBytesTwoRegs()
1584 I2C_WAIT_READY(i2c) in I2C_ReadMultiBytesTwoRegs()
1594 switch(I2C_GET_STATUS(i2c)) in I2C_ReadMultiBytesTwoRegs()
1597 …I2C_SET_DATA(i2c, (uint8_t)(u8SlaveAddr << 1u | 0x00u)); /* Write SLA+W to Register … in I2C_ReadMultiBytesTwoRegs()
1601 …I2C_SET_DATA(i2c, (uint8_t)((u16DataAddr & 0xFF00u) >> 8u)); /* Write Hi byte address of regist… in I2C_ReadMultiBytesTwoRegs()
1611 … I2C_SET_DATA(i2c, (uint8_t)(u16DataAddr & 0xFFu)); /* Write Lo byte address of register */ in I2C_ReadMultiBytesTwoRegs()
1620 …I2C_SET_DATA(i2c, (uint8_t)((u8SlaveAddr << 1u) | 0x01u)); /* Write SLA+R to Register … in I2C_ReadMultiBytesTwoRegs()
1631 rdata[u32rxLen++] = (unsigned char) I2C_GET_DATA(i2c); /* Receive Data */ in I2C_ReadMultiBytesTwoRegs()
1642 rdata[u32rxLen++] = (unsigned char) I2C_GET_DATA(i2c); /* Receive Data */ in I2C_ReadMultiBytesTwoRegs()
1648 I2C_SET_CONTROL_REG(i2c, I2C_CTL_STO_SI); /* Clear SI and send STOP */ in I2C_ReadMultiBytesTwoRegs()
1653 …I2C_SET_CONTROL_REG(i2c, u8Ctrl); /* Write controlbit to I2C_CTL… in I2C_ReadMultiBytesTwoRegs()