优化模拟i2c时序逻辑,使模拟I2C时序更加接近设定的延迟时间 模拟I2C的IO翻转时间单位改为ns,使I2C通讯速率可调节度更准确
This commit is contained in:
@ -11,6 +11,9 @@
|
||||
#ifndef __I2C_BIT_OPS_H__
|
||||
#define __I2C_BIT_OPS_H__
|
||||
|
||||
#include <rtdef.h>
|
||||
#include <rtdevice.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
@ -23,9 +26,9 @@ struct rt_i2c_bit_ops
|
||||
rt_int32_t (*get_sda)(void *data);
|
||||
rt_int32_t (*get_scl)(void *data);
|
||||
|
||||
void (*udelay)(rt_uint32_t us);
|
||||
void (*ndelay)(rt_uint32_t us);
|
||||
|
||||
rt_uint32_t delay_us; /* scl and sda line delay */
|
||||
rt_uint32_t delay_ns; /* scl and sda line delay */
|
||||
rt_uint32_t timeout; /* in tick */
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user