初始化仓库
This commit is contained in:
20
Header/iic_soft.h
Normal file
20
Header/iic_soft.h
Normal file
@@ -0,0 +1,20 @@
|
||||
#ifndef __IIC_SOFT_H__
|
||||
#define __IIC_SOFT_H__
|
||||
|
||||
#include "common.h"
|
||||
#include "gpio.h"
|
||||
|
||||
typedef struct
|
||||
{
|
||||
PIN_enum scl_pin; // SCL引脚
|
||||
PIN_enum sda_pin; // SDA引脚
|
||||
uint16 wait_time; // 等待时间,用于I2C总线速度控制
|
||||
} IIC_Soft_Config;
|
||||
|
||||
void soft_iic_init(IIC_Soft_Config *config);
|
||||
|
||||
uint8 soft_iic_read_reg(IIC_Soft_Config *config, uint8 dev_addr, uint8 reg_addr, uint8 *dat);
|
||||
|
||||
void soft_iic_write_reg(IIC_Soft_Config *config, uint8 dev_addr, uint8 reg_addr, uint8 dat);
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user