![]() |
M480 BSP V3.05.006
The Board Support Package for M480 Series
|
M480 series I2C driver source file. More...
#include "NuMicro.h"
Go to the source code of this file.
Functions | |
uint32_t | I2C_Open (I2C_T *i2c, uint32_t u32BusClock) |
Enable specify I2C Controller and set Clock Divider. More... | |
void | I2C_Close (I2C_T *i2c) |
Disable specify I2C Controller. More... | |
void | I2C_ClearTimeoutFlag (I2C_T *i2c) |
Clear Time-out Counter flag. More... | |
void | I2C_Trigger (I2C_T *i2c, uint8_t u8Start, uint8_t u8Stop, uint8_t u8Si, uint8_t u8Ack) |
Set Control bit of I2C Controller. More... | |
void | I2C_DisableInt (I2C_T *i2c) |
Disable Interrupt of I2C Controller. More... | |
void | I2C_EnableInt (I2C_T *i2c) |
Enable Interrupt of I2C Controller. More... | |
uint32_t | I2C_GetBusClockFreq (I2C_T *i2c) |
Get I2C Bus Clock. More... | |
uint32_t | I2C_SetBusClockFreq (I2C_T *i2c, uint32_t u32BusClock) |
Set I2C Bus Clock. More... | |
uint32_t | I2C_GetIntFlag (I2C_T *i2c) |
Get Interrupt Flag. More... | |
uint32_t | I2C_GetStatus (I2C_T *i2c) |
Get I2C Bus Status Code. More... | |
uint8_t | I2C_GetData (I2C_T *i2c) |
Read a Byte from I2C Bus. More... | |
void | I2C_SetData (I2C_T *i2c, uint8_t u8Data) |
Send a byte to I2C Bus. More... | |
void | I2C_SetSlaveAddr (I2C_T *i2c, uint8_t u8SlaveNo, uint8_t u8SlaveAddr, uint8_t u8GCMode) |
Set 7-bit Slave Address and GC Mode. More... | |
void | I2C_SetSlaveAddrMask (I2C_T *i2c, uint8_t u8SlaveNo, uint8_t u8SlaveAddrMask) |
Configure the mask bits of 7-bit Slave Address. More... | |
void | I2C_EnableTimeout (I2C_T *i2c, uint8_t u8LongTimeout) |
Enable Time-out Counter Function and support Long Time-out. More... | |
void | I2C_DisableTimeout (I2C_T *i2c) |
Disable Time-out Counter Function. More... | |
void | I2C_EnableWakeup (I2C_T *i2c) |
Enable I2C Wake-up Function. More... | |
void | I2C_DisableWakeup (I2C_T *i2c) |
Disable I2C Wake-up Function. More... | |
uint32_t | I2C_SMBusGetStatus (I2C_T *i2c) |
To get SMBus Status. More... | |
void | I2C_SMBusClearInterruptFlag (I2C_T *i2c, uint8_t u8SMBusIntFlag) |
Clear SMBus Interrupt Flag. More... | |
void | I2C_SMBusSetPacketByteCount (I2C_T *i2c, uint32_t u32PktSize) |
Set SMBus Bytes Counts of Transmission or Reception. More... | |
void | I2C_SMBusOpen (I2C_T *i2c, uint8_t u8HostDevice) |
Init SMBus Host/Device Mode. More... | |
void | I2C_SMBusClose (I2C_T *i2c) |
Disable SMBus function. More... | |
void | I2C_SMBusPECTxEnable (I2C_T *i2c, uint8_t u8PECTxEn) |
Enable SMBus PEC Transmit Function. More... | |
uint8_t | I2C_SMBusGetPECValue (I2C_T *i2c) |
Get SMBus CRC value. More... | |
void | I2C_SMBusIdleTimeout (I2C_T *i2c, uint32_t us, uint32_t u32Hclk) |
Calculate Time-out of SMBus idle period. More... | |
void | I2C_SMBusTimeout (I2C_T *i2c, uint32_t ms, uint32_t u32Pclk) |
Calculate Time-out of SMBus active period. More... | |
void | I2C_SMBusClockLoTimeout (I2C_T *i2c, uint32_t ms, uint32_t u32Pclk) |
Calculate Cumulative Clock low Time-out of SMBus active period. More... | |
uint8_t | I2C_WriteByte (I2C_T *i2c, uint8_t u8SlaveAddr, uint8_t data) |
Write a byte to Slave. More... | |
uint32_t | I2C_WriteMultiBytes (I2C_T *i2c, uint8_t u8SlaveAddr, uint8_t data[], uint32_t u32wLen) |
Write multi bytes to Slave. More... | |
uint8_t | I2C_WriteByteOneReg (I2C_T *i2c, uint8_t u8SlaveAddr, uint8_t u8DataAddr, uint8_t data) |
Specify a byte register address and write a byte to Slave. More... | |
uint32_t | I2C_WriteMultiBytesOneReg (I2C_T *i2c, uint8_t u8SlaveAddr, uint8_t u8DataAddr, uint8_t data[], uint32_t u32wLen) |
Specify a byte register address and write multi bytes to Slave. More... | |
uint8_t | I2C_WriteByteTwoRegs (I2C_T *i2c, uint8_t u8SlaveAddr, uint16_t u16DataAddr, uint8_t data) |
Specify two bytes register address and Write a byte to Slave. More... | |
uint32_t | I2C_WriteMultiBytesTwoRegs (I2C_T *i2c, uint8_t u8SlaveAddr, uint16_t u16DataAddr, uint8_t data[], uint32_t u32wLen) |
Specify two bytes register address and write multi bytes to Slave. More... | |
uint8_t | I2C_ReadByte (I2C_T *i2c, uint8_t u8SlaveAddr) |
Read a byte from Slave. More... | |
uint32_t | I2C_ReadMultiBytes (I2C_T *i2c, uint8_t u8SlaveAddr, uint8_t rdata[], uint32_t u32rLen) |
Read multi bytes from Slave. More... | |
uint8_t | I2C_ReadByteOneReg (I2C_T *i2c, uint8_t u8SlaveAddr, uint8_t u8DataAddr) |
Specify a byte register address and read a byte from Slave. More... | |
uint32_t | I2C_ReadMultiBytesOneReg (I2C_T *i2c, uint8_t u8SlaveAddr, uint8_t u8DataAddr, uint8_t rdata[], uint32_t u32rLen) |
Specify a byte register address and read multi bytes from Slave. More... | |
uint8_t | I2C_ReadByteTwoRegs (I2C_T *i2c, uint8_t u8SlaveAddr, uint16_t u16DataAddr) |
Specify two bytes register address and read a byte from Slave. More... | |
uint32_t | I2C_ReadMultiBytesTwoRegs (I2C_T *i2c, uint8_t u8SlaveAddr, uint16_t u16DataAddr, uint8_t rdata[], uint32_t u32rLen) |
Specify two bytes register address and read multi bytes from Slave. More... | |
Variables | |
int32_t | g_I2C_i32ErrCode = 0 |
M480 series I2C driver source file.
SPDX-License-Identifier: Apache-2.0
Definition in file i2c.c.