Lines Matching refs:i2c
37 uint32_t I2C_Open(I2C_T *i2c, uint32_t u32BusClock) in I2C_Open() argument
42 if(i2c == I2C1) in I2C_Open()
52 i2c->CLKDIV = u32Div; in I2C_Open()
55 i2c->CTL0 |= I2C_CTL0_I2CEN_Msk; in I2C_Open()
71 void I2C_Close(I2C_T *i2c) in I2C_Close() argument
74 if((uint32_t)i2c == I2C0_BASE) in I2C_Close()
79 else if((uint32_t)i2c == I2C1_BASE) in I2C_Close()
86 i2c->CTL0 &= ~I2C_CTL0_I2CEN_Msk; in I2C_Close()
99 void I2C_ClearTimeoutFlag(I2C_T *i2c) in I2C_ClearTimeoutFlag() argument
101 i2c->TOCTL |= I2C_TOCTL_TOIF_Msk; in I2C_ClearTimeoutFlag()
118 void I2C_Trigger(I2C_T *i2c, uint8_t u8Start, uint8_t u8Stop, uint8_t u8Si, uint8_t u8Ack) in I2C_Trigger() argument
142 i2c->CTL0 = (i2c->CTL0 & ~0x3CU) | u32Reg; in I2C_Trigger()
155 void I2C_DisableInt(I2C_T *i2c) in I2C_DisableInt() argument
157 i2c->CTL0 &= ~I2C_CTL0_INTEN_Msk; in I2C_DisableInt()
170 void I2C_EnableInt(I2C_T *i2c) in I2C_EnableInt() argument
172 i2c->CTL0 |= I2C_CTL0_INTEN_Msk; in I2C_EnableInt()
184 uint32_t I2C_GetBusClockFreq(I2C_T *i2c) in I2C_GetBusClockFreq() argument
186 uint32_t u32Divider = i2c->CLKDIV; in I2C_GetBusClockFreq()
189 if(i2c == I2C1) in I2C_GetBusClockFreq()
211 uint32_t I2C_SetBusClockFreq(I2C_T *i2c, uint32_t u32BusClock) in I2C_SetBusClockFreq() argument
216 if(i2c == I2C1) in I2C_SetBusClockFreq()
226 i2c->CLKDIV = u32Div; in I2C_SetBusClockFreq()
240 uint32_t I2C_GetIntFlag(I2C_T *i2c) in I2C_GetIntFlag() argument
244 if((i2c->CTL0 & I2C_CTL0_SI_Msk) == I2C_CTL0_SI_Msk) in I2C_GetIntFlag()
265 uint32_t I2C_GetStatus(I2C_T *i2c) in I2C_GetStatus() argument
267 return (i2c->STATUS0); in I2C_GetStatus()
279 uint8_t I2C_GetData(I2C_T *i2c) in I2C_GetData() argument
281 return (uint8_t)(i2c->DAT); in I2C_GetData()
294 void I2C_SetData(I2C_T *i2c, uint8_t u8Data) in I2C_SetData() argument
296 i2c->DAT = u8Data; in I2C_SetData()
313 void I2C_SetSlaveAddr(I2C_T *i2c, uint8_t u8SlaveNo, uint8_t u8SlaveAddr, uint8_t u8GCMode) in I2C_SetSlaveAddr() argument
318 i2c->ADDR1 = ((uint32_t)u8SlaveAddr << 1U) | u8GCMode; in I2C_SetSlaveAddr()
321 i2c->ADDR2 = ((uint32_t)u8SlaveAddr << 1U) | u8GCMode; in I2C_SetSlaveAddr()
324 i2c->ADDR3 = ((uint32_t)u8SlaveAddr << 1U) | u8GCMode; in I2C_SetSlaveAddr()
328 i2c->ADDR0 = ((uint32_t)u8SlaveAddr << 1U) | u8GCMode; in I2C_SetSlaveAddr()
345 void I2C_SetSlaveAddrMask(I2C_T *i2c, uint8_t u8SlaveNo, uint8_t u8SlaveAddrMask) in I2C_SetSlaveAddrMask() argument
350 i2c->ADDRMSK1 = (uint32_t)u8SlaveAddrMask << 1U; in I2C_SetSlaveAddrMask()
353 i2c->ADDRMSK2 = (uint32_t)u8SlaveAddrMask << 1U; in I2C_SetSlaveAddrMask()
356 i2c->ADDRMSK3 = (uint32_t)u8SlaveAddrMask << 1U; in I2C_SetSlaveAddrMask()
360 i2c->ADDRMSK0 = (uint32_t)u8SlaveAddrMask << 1U; in I2C_SetSlaveAddrMask()
377 void I2C_EnableTimeout(I2C_T *i2c, uint8_t u8LongTimeout) in I2C_EnableTimeout() argument
381 i2c->TOCTL |= I2C_TOCTL_TOCDIV4_Msk; in I2C_EnableTimeout()
385 i2c->TOCTL &= ~I2C_TOCTL_TOCDIV4_Msk; in I2C_EnableTimeout()
388 i2c->TOCTL |= I2C_TOCTL_TOCEN_Msk; in I2C_EnableTimeout()
401 void I2C_DisableTimeout(I2C_T *i2c) in I2C_DisableTimeout() argument
403 i2c->TOCTL &= ~I2C_TOCTL_TOCEN_Msk; in I2C_DisableTimeout()
416 void I2C_EnableWakeup(I2C_T *i2c) in I2C_EnableWakeup() argument
418 i2c->WKCTL |= I2C_WKCTL_WKEN_Msk; in I2C_EnableWakeup()
431 void I2C_DisableWakeup(I2C_T *i2c) in I2C_DisableWakeup() argument
433 i2c->WKCTL &= ~I2C_WKCTL_WKEN_Msk; in I2C_DisableWakeup()
446 uint32_t I2C_SMBusGetStatus(I2C_T *i2c) in I2C_SMBusGetStatus() argument
448 return (i2c->BUSSTS); in I2C_SMBusGetStatus()
462 void I2C_SMBusClearInterruptFlag(I2C_T *i2c, uint8_t u8SMBusIntFlag) in I2C_SMBusClearInterruptFlag() argument
464 i2c->BUSSTS = u8SMBusIntFlag; in I2C_SMBusClearInterruptFlag()
478 void I2C_SMBusSetPacketByteCount(I2C_T *i2c, uint32_t u32PktSize) in I2C_SMBusSetPacketByteCount() argument
480 i2c->PKTSIZE = u32PktSize; in I2C_SMBusSetPacketByteCount()
494 void I2C_SMBusOpen(I2C_T *i2c, uint8_t u8HostDevice) in I2C_SMBusOpen() argument
497 i2c->BUSCTL &= ~(I2C_BUSCTL_BMHEN_Msk | I2C_BUSCTL_BMDEN_Msk); in I2C_SMBusOpen()
502 i2c->BUSCTL |= (I2C_BUSCTL_BMHEN_Msk | I2C_BUSCTL_BUSEN_Msk); in I2C_SMBusOpen()
506 i2c->BUSCTL |= (I2C_BUSCTL_BMDEN_Msk | I2C_BUSCTL_BUSEN_Msk); in I2C_SMBusOpen()
520 void I2C_SMBusClose(I2C_T *i2c) in I2C_SMBusClose() argument
523 i2c->BUSCTL = 0x00U; in I2C_SMBusClose()
537 void I2C_SMBusPECTxEnable(I2C_T *i2c, uint8_t u8PECTxEn) in I2C_SMBusPECTxEnable() argument
539 i2c->BUSCTL &= ~I2C_BUSCTL_PECTXEN_Msk; in I2C_SMBusPECTxEnable()
543 i2c->BUSCTL |= (I2C_BUSCTL_PECEN_Msk | I2C_BUSCTL_PECTXEN_Msk); in I2C_SMBusPECTxEnable()
547 i2c->BUSCTL |= I2C_BUSCTL_PECEN_Msk; in I2C_SMBusPECTxEnable()
561 uint8_t I2C_SMBusGetPECValue(I2C_T *i2c) in I2C_SMBusGetPECValue() argument
563 return (uint8_t)i2c->PKTCRC; in I2C_SMBusGetPECValue()
579 void I2C_SMBusIdleTimeout(I2C_T *i2c, uint32_t us, uint32_t u32Hclk) in I2C_SMBusIdleTimeout() argument
583 i2c->BUSCTL |= I2C_BUSCTL_TIDLE_Msk; in I2C_SMBusIdleTimeout()
588 i2c->BUSTOUT = 0xFFU; in I2C_SMBusIdleTimeout()
592 i2c->BUSTOUT = u32Div; in I2C_SMBusIdleTimeout()
611 void I2C_SMBusTimeout(I2C_T *i2c, uint32_t ms, uint32_t u32Pclk) in I2C_SMBusTimeout() argument
615 i2c->BUSCTL &= ~I2C_BUSCTL_TIDLE_Msk; in I2C_SMBusTimeout()
618 i2c->TOCTL &= ~I2C_TOCTL_TOCEN_Msk; in I2C_SMBusTimeout()
623 i2c->BUSTOUT = u32Div; in I2C_SMBusTimeout()
628 i2c->TOCTL |= I2C_TOCTL_TOCEN_Msk; in I2C_SMBusTimeout()
629 …i2c->BUSTOUT = (((ms * u32Pclk_kHz) / (16U * 1024U * 4U)) - 1U) & 0xFFU; /* The max value is 255 */ in I2C_SMBusTimeout()
647 void I2C_SMBusClockLoTimeout(I2C_T *i2c, uint32_t ms, uint32_t u32Pclk) in I2C_SMBusClockLoTimeout() argument
651 i2c->BUSCTL &= ~I2C_BUSCTL_TIDLE_Msk; in I2C_SMBusClockLoTimeout()
654 i2c->TOCTL &= ~I2C_TOCTL_TOCEN_Msk; in I2C_SMBusClockLoTimeout()
659 i2c->CLKTOUT = u32Div; in I2C_SMBusClockLoTimeout()
664 i2c->TOCTL |= I2C_TOCTL_TOCEN_Msk; in I2C_SMBusClockLoTimeout()
665 …i2c->CLKTOUT = (((ms * u32Pclk_kHz) / (16U * 1024U * 4U)) - 1U) & 0xFFU; /* The max value is 255 */ in I2C_SMBusClockLoTimeout()
684 uint8_t I2C_WriteByte(I2C_T *i2c, uint8_t u8SlaveAddr, uint8_t data) in I2C_WriteByte() argument
688 I2C_START(i2c); in I2C_WriteByte()
691 I2C_WAIT_READY(i2c) {} in I2C_WriteByte()
692 switch(I2C_GET_STATUS(i2c)) in I2C_WriteByte()
695 … I2C_SET_DATA(i2c, (uint8_t)(u8SlaveAddr << 1u | 0x00u)); /* Write SLA+W to Register I2CDAT */ in I2C_WriteByte()
699 I2C_SET_DATA(i2c, data); /* Write data to I2CDAT */ in I2C_WriteByte()
712 I2C_SET_CONTROL_REG(i2c, I2C_CTL_STO_SI); /* Clear SI and send STOP */ in I2C_WriteByte()
717 …I2C_SET_CONTROL_REG(i2c, u8Ctrl); /* Write controlbit to I2C_CTL register */ in I2C_WriteByte()
736 uint32_t I2C_WriteMultiBytes(I2C_T *i2c, uint8_t u8SlaveAddr, uint8_t data[], uint32_t u32wLen) in I2C_WriteMultiBytes() argument
741 I2C_START(i2c); /* Send START */ in I2C_WriteMultiBytes()
744 I2C_WAIT_READY(i2c) {} in I2C_WriteMultiBytes()
745 switch(I2C_GET_STATUS(i2c)) in I2C_WriteMultiBytes()
748 … I2C_SET_DATA(i2c, (uint8_t)(u8SlaveAddr << 1u | 0x00u)); /* Write SLA+W to Register I2CDAT */ in I2C_WriteMultiBytes()
755 I2C_SET_DATA(i2c, data[u32txLen++]); /* Write Data to I2CDAT */ in I2C_WriteMultiBytes()
770 I2C_SET_CONTROL_REG(i2c, I2C_CTL_STO_SI); /* Clear SI and send STOP */ in I2C_WriteMultiBytes()
775 …I2C_SET_CONTROL_REG(i2c, u8Ctrl); /* Write controlbit to I2C_CTL register */ in I2C_WriteMultiBytes()
795 uint8_t I2C_WriteByteOneReg(I2C_T *i2c, uint8_t u8SlaveAddr, uint8_t u8DataAddr, uint8_t data) in I2C_WriteByteOneReg() argument
800 I2C_START(i2c); /* Send START */ in I2C_WriteByteOneReg()
803 I2C_WAIT_READY(i2c) {} in I2C_WriteByteOneReg()
804 switch(I2C_GET_STATUS(i2c)) in I2C_WriteByteOneReg()
807 …I2C_SET_DATA(i2c, (uint8_t)(u8SlaveAddr << 1u | 0x00u)); /* Send Slave address with write bit */ in I2C_WriteByteOneReg()
811 I2C_SET_DATA(i2c, u8DataAddr); /* Write Lo byte address of register */ in I2C_WriteByteOneReg()
821 I2C_SET_DATA(i2c, data); in I2C_WriteByteOneReg()
832 I2C_SET_CONTROL_REG(i2c, I2C_CTL_STO_SI); /* Clear SI and send STOP */ in I2C_WriteByteOneReg()
837 …I2C_SET_CONTROL_REG(i2c, u8Ctrl); /* Write controlbit to I2C_CTL register */ in I2C_WriteByteOneReg()
858 uint32_t I2C_WriteMultiBytesOneReg(I2C_T *i2c, uint8_t u8SlaveAddr, uint8_t u8DataAddr, uint8_t dat… in I2C_WriteMultiBytesOneReg() argument
863 I2C_START(i2c); /* Send START */ in I2C_WriteMultiBytesOneReg()
866 I2C_WAIT_READY(i2c) {} in I2C_WriteMultiBytesOneReg()
867 switch(I2C_GET_STATUS(i2c)) in I2C_WriteMultiBytesOneReg()
870 … I2C_SET_DATA(i2c, (uint8_t)(u8SlaveAddr << 1u | 0x00u)); /* Write SLA+W to Register I2CDAT */ in I2C_WriteMultiBytesOneReg()
874 I2C_SET_DATA(i2c, u8DataAddr); /* Write Lo byte address of register */ in I2C_WriteMultiBytesOneReg()
884 I2C_SET_DATA(i2c, data[u32txLen++]); in I2C_WriteMultiBytesOneReg()
894 I2C_SET_CONTROL_REG(i2c, I2C_CTL_STO_SI); /* Clear SI and send STOP */ in I2C_WriteMultiBytesOneReg()
899 …I2C_SET_CONTROL_REG(i2c, u8Ctrl); /* Write controlbit to I2C_CTL register */ in I2C_WriteMultiBytesOneReg()
920 uint8_t I2C_WriteByteTwoRegs(I2C_T *i2c, uint8_t u8SlaveAddr, uint16_t u16DataAddr, uint8_t data) in I2C_WriteByteTwoRegs() argument
925 I2C_START(i2c); /* Send START */ in I2C_WriteByteTwoRegs()
928 I2C_WAIT_READY(i2c) {} in I2C_WriteByteTwoRegs()
929 switch(I2C_GET_STATUS(i2c)) in I2C_WriteByteTwoRegs()
932 …I2C_SET_DATA(i2c, (uint8_t)(u8SlaveAddr << 1u | 0x00u)); /* Write SLA+W to Register … in I2C_WriteByteTwoRegs()
936 …I2C_SET_DATA(i2c, (uint8_t)((u16DataAddr & 0xFF00u) >> 8u)); /* Write Hi byte address of regist… in I2C_WriteByteTwoRegs()
946 … I2C_SET_DATA(i2c, (uint8_t)(u16DataAddr & 0xFFu)); /* Write Lo byte address of register */ in I2C_WriteByteTwoRegs()
951 I2C_SET_DATA(i2c, data); in I2C_WriteByteTwoRegs()
962 I2C_SET_CONTROL_REG(i2c, I2C_CTL_STO_SI); /* Clear SI and send STOP */ in I2C_WriteByteTwoRegs()
967 …I2C_SET_CONTROL_REG(i2c, u8Ctrl); /* Write controlbit to I2C_CTL… in I2C_WriteByteTwoRegs()
988 uint32_t I2C_WriteMultiBytesTwoRegs(I2C_T *i2c, uint8_t u8SlaveAddr, uint16_t u16DataAddr, uint8_t … in I2C_WriteMultiBytesTwoRegs() argument
993 I2C_START(i2c); /* Send START */ in I2C_WriteMultiBytesTwoRegs()
996 I2C_WAIT_READY(i2c) {} in I2C_WriteMultiBytesTwoRegs()
997 switch(I2C_GET_STATUS(i2c)) in I2C_WriteMultiBytesTwoRegs()
1000 …I2C_SET_DATA(i2c, (uint8_t)(u8SlaveAddr << 1u | 0x00u)); /* Write SLA+W to Register … in I2C_WriteMultiBytesTwoRegs()
1004 …I2C_SET_DATA(i2c, (uint8_t)((u16DataAddr & 0xFF00u) >> 8u)); /* Write Hi byte address of regist… in I2C_WriteMultiBytesTwoRegs()
1014 … I2C_SET_DATA(i2c, (uint8_t)(u16DataAddr & 0xFFu)); /* Write Lo byte address of register */ in I2C_WriteMultiBytesTwoRegs()
1019 … I2C_SET_DATA(i2c, data[u32txLen++]); /* Write data to Register I2CDAT*/ in I2C_WriteMultiBytesTwoRegs()
1029 I2C_SET_CONTROL_REG(i2c, I2C_CTL_STO_SI); /* Clear SI and send STOP */ in I2C_WriteMultiBytesTwoRegs()
1034 …I2C_SET_CONTROL_REG(i2c, u8Ctrl); /* Write controlbit to I2C_CTL… in I2C_WriteMultiBytesTwoRegs()
1050 uint8_t I2C_ReadByte(I2C_T *i2c, uint8_t u8SlaveAddr) in I2C_ReadByte() argument
1054 I2C_START(i2c); /* Send START */ in I2C_ReadByte()
1057 I2C_WAIT_READY(i2c) {} in I2C_ReadByte()
1058 switch(I2C_GET_STATUS(i2c)) in I2C_ReadByte()
1061 … I2C_SET_DATA(i2c, (uint8_t)((u8SlaveAddr << 1u) | 0x01u)); /* Write SLA+R to Register I2CDAT */ in I2C_ReadByte()
1072 rdata = (unsigned char) I2C_GET_DATA(i2c); /* Receive Data */ in I2C_ReadByte()
1078 I2C_SET_CONTROL_REG(i2c, I2C_CTL_STO_SI); /* Clear SI and send STOP */ in I2C_ReadByte()
1083 …I2C_SET_CONTROL_REG(i2c, u8Ctrl); /* Write controlbit to I2C_CTL register… in I2C_ReadByte()
1107 uint32_t I2C_ReadMultiBytes(I2C_T *i2c, uint8_t u8SlaveAddr, uint8_t rdata[], uint32_t u32rLen) in I2C_ReadMultiBytes() argument
1112 I2C_START(i2c); /* Send START */ in I2C_ReadMultiBytes()
1115 I2C_WAIT_READY(i2c) {} in I2C_ReadMultiBytes()
1116 switch(I2C_GET_STATUS(i2c)) in I2C_ReadMultiBytes()
1119 … I2C_SET_DATA(i2c, (uint8_t)((u8SlaveAddr << 1u) | 0x01u)); /* Write SLA+R to Register I2CDAT */ in I2C_ReadMultiBytes()
1130 rdata[u32rxLen++] = (unsigned char) I2C_GET_DATA(i2c); /* Receive Data */ in I2C_ReadMultiBytes()
1141 rdata[u32rxLen++] = (unsigned char) I2C_GET_DATA(i2c); /* Receive Data */ in I2C_ReadMultiBytes()
1147 I2C_SET_CONTROL_REG(i2c, I2C_CTL_STO_SI); /* Clear SI and send STOP */ in I2C_ReadMultiBytes()
1152 …I2C_SET_CONTROL_REG(i2c, u8Ctrl); /* Write controlbit to I2C_CTL r… in I2C_ReadMultiBytes()
1171 uint8_t I2C_ReadByteOneReg(I2C_T *i2c, uint8_t u8SlaveAddr, uint8_t u8DataAddr) in I2C_ReadByteOneReg() argument
1175 I2C_START(i2c); /* Send START */ in I2C_ReadByteOneReg()
1178 I2C_WAIT_READY(i2c) {} in I2C_ReadByteOneReg()
1179 switch(I2C_GET_STATUS(i2c)) in I2C_ReadByteOneReg()
1182 … I2C_SET_DATA(i2c, (uint8_t)(u8SlaveAddr << 1u | 0x00u)); /* Write SLA+W to Register I2CDAT */ in I2C_ReadByteOneReg()
1186 … I2C_SET_DATA(i2c, u8DataAddr); /* Write Lo byte address of register */ in I2C_ReadByteOneReg()
1197 … I2C_SET_DATA(i2c, (uint8_t)((u8SlaveAddr << 1u) | 0x01u)); /* Write SLA+R to Register I2CDAT */ in I2C_ReadByteOneReg()
1208 rdata = (uint8_t) I2C_GET_DATA(i2c); /* Receive Data */ in I2C_ReadByteOneReg()
1214 I2C_SET_CONTROL_REG(i2c, I2C_CTL_STO_SI); /* Clear SI and send STOP */ in I2C_ReadByteOneReg()
1219 …I2C_SET_CONTROL_REG(i2c, u8Ctrl); /* Write controlbit to I2C_CTL register… in I2C_ReadByteOneReg()
1243 uint32_t I2C_ReadMultiBytesOneReg(I2C_T *i2c, uint8_t u8SlaveAddr, uint8_t u8DataAddr, uint8_t rdat… in I2C_ReadMultiBytesOneReg() argument
1248 I2C_START(i2c); /* Send START */ in I2C_ReadMultiBytesOneReg()
1251 I2C_WAIT_READY(i2c) {} in I2C_ReadMultiBytesOneReg()
1252 switch(I2C_GET_STATUS(i2c)) in I2C_ReadMultiBytesOneReg()
1255 … I2C_SET_DATA(i2c, (uint8_t)(u8SlaveAddr << 1u | 0x00u)); /* Write SLA+W to Register I2CDAT */ in I2C_ReadMultiBytesOneReg()
1259 … I2C_SET_DATA(i2c, u8DataAddr); /* Write Lo byte address of register */ in I2C_ReadMultiBytesOneReg()
1270 … I2C_SET_DATA(i2c, (uint8_t)((u8SlaveAddr << 1u) | 0x01u)); /* Write SLA+R to Register I2CDAT */ in I2C_ReadMultiBytesOneReg()
1281 rdata[u32rxLen++] = (uint8_t) I2C_GET_DATA(i2c); /* Receive Data */ in I2C_ReadMultiBytesOneReg()
1292 rdata[u32rxLen++] = (uint8_t) I2C_GET_DATA(i2c); /* Receive Data */ in I2C_ReadMultiBytesOneReg()
1298 I2C_SET_CONTROL_REG(i2c, I2C_CTL_STO_SI); /* Clear SI and send STOP */ in I2C_ReadMultiBytesOneReg()
1303 …I2C_SET_CONTROL_REG(i2c, u8Ctrl); /* Write controlbit to I2C_CTL register… in I2C_ReadMultiBytesOneReg()
1321 uint8_t I2C_ReadByteTwoRegs(I2C_T *i2c, uint8_t u8SlaveAddr, uint16_t u16DataAddr) in I2C_ReadByteTwoRegs() argument
1325 I2C_START(i2c); /* Send START */ in I2C_ReadByteTwoRegs()
1328 I2C_WAIT_READY(i2c) {} in I2C_ReadByteTwoRegs()
1329 switch(I2C_GET_STATUS(i2c)) in I2C_ReadByteTwoRegs()
1332 …I2C_SET_DATA(i2c, (uint8_t)(u8SlaveAddr << 1u | 0x00u)); /* Write SLA+W to Register … in I2C_ReadByteTwoRegs()
1336 …I2C_SET_DATA(i2c, (uint8_t)((u16DataAddr & 0xFF00u) >> 8u)); /* Write Hi byte address of regist… in I2C_ReadByteTwoRegs()
1346 … I2C_SET_DATA(i2c, (uint8_t)(u16DataAddr & 0xFFu)); /* Write Lo byte address of register */ in I2C_ReadByteTwoRegs()
1355 …I2C_SET_DATA(i2c, (uint8_t)((u8SlaveAddr << 1u) | 0x01u)); /* Write SLA+R to Register … in I2C_ReadByteTwoRegs()
1366 rdata = (unsigned char) I2C_GET_DATA(i2c); /* Receive Data */ in I2C_ReadByteTwoRegs()
1372 I2C_SET_CONTROL_REG(i2c, I2C_CTL_STO_SI); /* Clear SI and send STOP */ in I2C_ReadByteTwoRegs()
1377 …I2C_SET_CONTROL_REG(i2c, u8Ctrl); /* Write controlbit to I2C_CTL… in I2C_ReadByteTwoRegs()
1401 uint32_t I2C_ReadMultiBytesTwoRegs(I2C_T *i2c, uint8_t u8SlaveAddr, uint16_t u16DataAddr, uint8_t r… in I2C_ReadMultiBytesTwoRegs() argument
1406 I2C_START(i2c); /* Send START */ in I2C_ReadMultiBytesTwoRegs()
1409 I2C_WAIT_READY(i2c) {} in I2C_ReadMultiBytesTwoRegs()
1410 switch(I2C_GET_STATUS(i2c)) in I2C_ReadMultiBytesTwoRegs()
1413 …I2C_SET_DATA(i2c, (uint8_t)(u8SlaveAddr << 1u | 0x00u)); /* Write SLA+W to Register … in I2C_ReadMultiBytesTwoRegs()
1417 …I2C_SET_DATA(i2c, (uint8_t)((u16DataAddr & 0xFF00u) >> 8u)); /* Write Hi byte address of regist… in I2C_ReadMultiBytesTwoRegs()
1427 … I2C_SET_DATA(i2c, (uint8_t)(u16DataAddr & 0xFFu)); /* Write Lo byte address of register */ in I2C_ReadMultiBytesTwoRegs()
1436 …I2C_SET_DATA(i2c, (uint8_t)((u8SlaveAddr << 1u) | 0x01u)); /* Write SLA+R to Register … in I2C_ReadMultiBytesTwoRegs()
1447 rdata[u32rxLen++] = (unsigned char) I2C_GET_DATA(i2c); /* Receive Data */ in I2C_ReadMultiBytesTwoRegs()
1458 rdata[u32rxLen++] = (unsigned char) I2C_GET_DATA(i2c); /* Receive Data */ in I2C_ReadMultiBytesTwoRegs()
1464 I2C_SET_CONTROL_REG(i2c, I2C_CTL_STO_SI); /* Clear SI and send STOP */ in I2C_ReadMultiBytesTwoRegs()
1469 …I2C_SET_CONTROL_REG(i2c, u8Ctrl); /* Write controlbit to I2C_CTL… in I2C_ReadMultiBytesTwoRegs()