TICC2640 模拟IIC

这里使用的引脚如下:

驱动文件如下:

添加user_i2c.h文件:

#ifndef __USER_I2C_H__
#define __USER_I2C_H__

#include "Board.h"
#include 

#define  SCL_PIN    CC2640R2_LAUNCHXL_GPIO_OLED_CLK
#define  SDA_PIN    CC2640R2_LAUNCHXL_GPIO_OLED_SDA

#define SCL_PIN_HIGHT  (GPIO_write(SCL_PIN,1))
#define SCL_PIN_LOW    (GPIO_write(SCL_PIN,0))


#define SDA_OUT (GPIO_setConfig(SDA_PIN, GPIO_CFG_OUT_STD | GPIO_CFG_OUT_LOW))
#define SDA_IN  (GPIO_setConfig(SDA_PIN, GPIO_CFG_INPUT))

#define SDA_PIN_HIGHT  GPIO_write(SDA_PIN,1)
#define SDA_PIN_LOW    GPIO_write(SDA_PIN,0)
#define SDA_PIN_READ   GPIO_read(SDA_PIN)





void IIC_PIN_Init(void);
void IIC_Start(void);
void IIC_Stop(void);
void Write_IIC_Byte(unsigned char IIC_Byte);
void Write_Add(uint8_t add,uint8_t wdata,uint8_t comd);
uint8_t Read_Add(uint8_t add,ui

你可能感兴趣的:(CC2640R2F(驱动))