宏定义 | |
#define | PER_LIB_MCU_MUODEL STC8Ax |
如果没有定义这个宏,默认为STC8Ax。 If the mirco is undefined,select to STC8Ax 更多... | |
#define | PER_LIB_I2C_CTRL 1 |
如果没有定义这个宏,默认为1。 If the mirco is undefined,select to "1" 更多... | |
#define | PER_LIB_I2C_INIT_CTRL 1 |
如果没有定义这个宏,默认为1。 If the mirco is undefined,select to "1" 更多... | |
#define | PER_LIB_I2C_NVIC_CTRL 1 |
如果没有定义这个宏,默认为1。 If the mirco is undefined,select to "1" 更多... | |
#define | PER_LIB_I2C_WORK_CTRL 1 |
如果没有定义这个宏,默认为1。 If the mirco is undefined,select to "1" 更多... | |
#define | NVIC_I2C_HOST_CTRL(run) |
I2C主机中断开关控制宏函数。 更多... | |
#define | NVIC_I2C_SLAVE_CTRL(run) |
I2C从机中断开关控制宏函数。 更多... | |
#define | NVIC_I2C_PRI(pri) |
I2C选择中断优先级宏函数。 更多... | |
#define | I2C_GET_HOST_FLAG() (I2CMSST & 0x40) |
I2C获取主机中断请求标志位宏函数。 更多... | |
#define | I2C_GET_HOST_BUSY_STATE() (I2CMSST & 0x80) |
I2C获取主机忙/空闲状态宏函数。 更多... | |
#define | I2C_CLEAR_HOST_MASTER_FLAG() {I2CMSST &= 0xBF;} |
I2C清除主机中断请求标志位宏函数。 更多... | |
#define | I2C_GET_SLAVE_BUSY_STATE() (I2CMSST & 0x80) |
I2C获取从机状态(忙/空闲)宏函数。 更多... | |
#define | I2C_GET_SLAVE_REVSTART_FLAG() (I2CSLST & 0x40) |
I2C获取,从机接收开始信号中断请求标志位,宏函数。 更多... | |
#define | I2C_GET_SLAVE_REVDATA_FLAG() (I2CSLST & 0x20) |
I2C获取,从机接收一字节数据中断请求标志位,宏函数。 更多... | |
#define | I2C_GET_SLAVE_SENDATA_FLAG() (I2CSLST & 0x10) |
I2C获取,从机发送一字节数据中断请求标志位,宏函数。 更多... | |
#define | I2C_GET_SLAVE_REVSTOP_FLAG() (I2CSLST & 0x08) |
I2C获取,从机接收停止信号中断请求标志位,宏函数。 更多... | |
#define | I2C_CLEAR_SLAVE_REVSTART_FLAG() {I2CSLST &= 0xBF;} |
I2C清除,从机接收开始信号中断请求标志位,宏函数。 更多... | |
#define | I2C_CLEAR_SLAVE_REVDATA_FLAG() {I2CSLST &= 0xDF;} |
I2C清除,从机接收一字节数据中断请求标志位,宏函数。 更多... | |
#define | I2C_CLEAR_SLAVE_SENDATA_FLAG() {I2CSLST &= 0xEF;} |
I2C清除,从机发送一字节数据中断请求标志位,宏函数。 更多... | |
#define | I2C_CLEAR_SLAVE_REVSTOP_FLAG() {I2CSLST &= 0xF7;} |
I2C清除,从机接收停止信号中断请求标志位,宏函数。 更多... | |
枚举 | |
enum | I2CType_Type { I2C_Type_Host = 0x01 , I2C_Type_Slave = 0x00 } |
I2C工作类型枚举体。 更多... | |
enum | I2CSTri_Type { I2C_STri_RevStart_Done = 0x40 , I2C_STri_RevData_Done = 0x20 , I2C_STri_SendData_Done = 0x10 , I2C_STri_RevStop_Done = 0x80 } |
I2C从机中断触发方式枚举体。 更多... | |
函数 | |
FSCSTATE | I2C_Init (I2CType_Type type, uint8_t wTime, BOOL state) |
I2C初始化函数。 更多... | |
FSCSTATE | NVCI_I2C_Master_Init (NVICPri_Type pri, BOOL run) |
I2C主机中断初始化函数。 更多... | |
FSCSTATE | NVCI_I2C_Slave_Init (NVICPri_Type pri, I2CSTri_Type triMode) |
I2C从机中断初始化函数。 更多... | |
FSCSTATE | I2C_Send_Start (void) |
I2C发送开始信号函数。 更多... | |
FSCSTATE | I2C_Send_Stop (void) |
I2C发送停止信号函数。 更多... | |
FSCSTATE | I2C_Send_ACK (void) |
I2C发送ACK信号函数。 更多... | |
FSCSTATE | I2C_Send_NACK (void) |
I2C发送NACK信号函数。 更多... | |
FSCSTATE | I2C_Read_ACK (void) |
I2C读取ACK信号函数。 更多... | |
FSCSTATE | I2C_Send_Btye (uint8_t dat) |
I2C发送一个字节函数。 更多... | |
uint8_t | I2C_Read_Byte (void) |
I2C读取一个字节函数。 更多... | |
FSCSTATE | GPIO_I2C_SWPort (GPIOSWPort_Type port) |
I2C切换复用IO函数。 更多... | |
#define I2C_CLEAR_HOST_MASTER_FLAG | ( | ) | {I2CMSST &= 0xBF;} |
I2C清除主机中断请求标志位宏函数。
I2C clears host interrupt request flag bit macro function.
#define I2C_CLEAR_SLAVE_REVDATA_FLAG | ( | ) | {I2CSLST &= 0xDF;} |
I2C清除,从机接收一字节数据中断请求标志位,宏函数。
I2C clears the slave receives one byte data, interrupt request flag bit, macro function.
#define I2C_CLEAR_SLAVE_REVSTART_FLAG | ( | ) | {I2CSLST &= 0xBF;} |
I2C清除,从机接收开始信号中断请求标志位,宏函数。
I2C clears the slave receives start signal, interrupt request flag bit, macro function.
#define I2C_CLEAR_SLAVE_REVSTOP_FLAG | ( | ) | {I2CSLST &= 0xF7;} |
I2C清除,从机接收停止信号中断请求标志位,宏函数。
I2C clears the slave receives stop signal, interrupt request flag bit, macro function.
#define I2C_CLEAR_SLAVE_SENDATA_FLAG | ( | ) | {I2CSLST &= 0xEF;} |
I2C清除,从机发送一字节数据中断请求标志位,宏函数。
I2C clears the slave sends one byte data, interrupt request flag bit, macro function.
#define I2C_GET_HOST_BUSY_STATE | ( | ) | (I2CMSST & 0x80) |
I2C获取主机忙/空闲状态宏函数。
I2C get the host working state (busy / idle) macro function.
#define I2C_GET_HOST_FLAG | ( | ) | (I2CMSST & 0x40) |
I2C获取主机中断请求标志位宏函数。
I2C gets host interrupt request flag bit macro function.
#define I2C_GET_SLAVE_BUSY_STATE | ( | ) | (I2CMSST & 0x80) |
I2C获取从机状态(忙/空闲)宏函数。
I2C get the slave working state (busy / idle) macro function.
#define I2C_GET_SLAVE_REVDATA_FLAG | ( | ) | (I2CSLST & 0x20) |
I2C获取,从机接收一字节数据中断请求标志位,宏函数。
I2C acquisition, slave receives one byte data, interrupt request flag bit, macro function.
#define I2C_GET_SLAVE_REVSTART_FLAG | ( | ) | (I2CSLST & 0x40) |
I2C获取,从机接收开始信号中断请求标志位,宏函数。
I2C acquisition, slave receives start signal, interrupt request flag bit, macro function.
#define I2C_GET_SLAVE_REVSTOP_FLAG | ( | ) | (I2CSLST & 0x08) |
I2C获取,从机接收停止信号中断请求标志位,宏函数。
I2C acquisition, slave receives stop signal, interrupt request flag bit, macro function.
#define I2C_GET_SLAVE_SENDATA_FLAG | ( | ) | (I2CSLST & 0x10) |
I2C获取,从机发送一字节数据中断请求标志位,宏函数。
I2C acquisition, slave sends one byte data, interrupt request flag bit, macro function.
#define NVIC_I2C_HOST_CTRL | ( | run | ) |
I2C主机中断开关控制宏函数。
I2C host interrupt switch control macro function.
[in] | run | 使能控制位。Enable control bit. |
#define NVIC_I2C_PRI | ( | pri | ) |
#define NVIC_I2C_SLAVE_CTRL | ( | run | ) |
#define PER_LIB_I2C_CTRL 1 |
如果没有定义这个宏,默认为1。 If the mirco is undefined,select to "1"
#define PER_LIB_I2C_INIT_CTRL 1 |
如果没有定义这个宏,默认为1。 If the mirco is undefined,select to "1"
#define PER_LIB_I2C_NVIC_CTRL 1 |
如果没有定义这个宏,默认为1。 If the mirco is undefined,select to "1"
#define PER_LIB_I2C_WORK_CTRL 1 |
如果没有定义这个宏,默认为1。 If the mirco is undefined,select to "1"
#define PER_LIB_MCU_MUODEL STC8Ax |
如果没有定义这个宏,默认为STC8Ax。 If the mirco is undefined,select to STC8Ax
enum I2CSTri_Type |
I2C从机中断触发方式枚举体。
I2C slave interrupt trigger mode enumeration body.
enum I2CType_Type |
FSCSTATE GPIO_I2C_SWPort | ( | GPIOSWPort_Type | port | ) |
I2C切换复用IO函数。
I2C switch out port control function.
[in] | port | 复用IO枚举体。IO switch enumerator. |
FSCSTATE I2C_Init | ( | I2CType_Type | type, |
uint8_t | wTime, | ||
BOOL | state | ||
) |
I2C初始化函数。
I2C initialization function.
[in] | type | I2C工作模式(主从机)。I2C working mode (master-slave). |
[in] | wTime | I2C等待时间。value of wait time. |
[in] | run | 运行控制位。Operation control bit. |
FSCSTATE I2C_Read_ACK | ( | void | ) |
I2C读取ACK信号函数。
I2C reads signal of ACK function.
None. |
uint8_t I2C_Read_Byte | ( | void | ) |
I2C读取一个字节函数。
I2C reads a byte data function.
None. |
FSCSTATE I2C_Send_ACK | ( | void | ) |
I2C发送ACK信号函数。
I2C sends signal of ACK function.
None. |
I2C发送一个字节函数。
I2C sends a byte data function.
[in] | dat | 字节数据。byte data. |
FSCSTATE I2C_Send_NACK | ( | void | ) |
I2C发送NACK信号函数。
I2C sends signal of NACK function.
None. |
FSCSTATE I2C_Send_Start | ( | void | ) |
I2C发送开始信号函数。
I2C sends signal of start function.
None. |
FSCSTATE I2C_Send_Stop | ( | void | ) |
I2C发送停止信号函数。
I2C sends signal of stop function.
None. |
FSCSTATE NVCI_I2C_Master_Init | ( | NVICPri_Type | pri, |
BOOL | run | ||
) |
I2C主机中断初始化函数。
I2C Master init NVIC function.
[in] | pri | 中断优先级。interrupt priority. |
[in] | run | 使能控制位。enable control. |
FSCSTATE NVCI_I2C_Slave_Init | ( | NVICPri_Type | pri, |
I2CSTri_Type | triMode | ||
) |
I2C从机中断初始化函数。
I2C Slave init NVIC function.
[in] | pri | 中断优先级。interrupt priority. |
[in] | triMode | 触发模式,可以选择多个,并用或运算符连接。 Trigger mode, multiple can be selected and connected with or operator. |