You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
78 lines
2.0 KiB
78 lines
2.0 KiB
//////////////////////////////////////////////////////////////////////////
|
|
/// COPYRIGHT NOTICE
|
|
/// Copyright (c) 2023 CCSENS
|
|
/// All rights reserved.
|
|
///
|
|
/// @file iic_sim
|
|
/// @brief iic 模拟io 版本ï¼? å’Œcpuæ— å…³ï¼Œå”¯ä¸?éœ?è¦�修改的就是头函数ä¸çš„管脚定ä¹?
|
|
/// @info 除了ioé…�ç½® ,å…¶ä»–åœ°æ–¹å¦‚æ— å¿…è¦�请勿修改
|
|
///(本文件实现的功能的详述�
|
|
///
|
|
/// @version 1.1 CCsens technology
|
|
/// @author CC
|
|
/// @date 20180102
|
|
|
|
//
|
|
//////////////////////////////////////////////////////////////////////////
|
|
|
|
#ifndef _msp_iicM1_H_
|
|
#define _msp_iicM1_H_
|
|
|
|
#include "c_lib.h"
|
|
#include "bsp_config.h"
|
|
#define D_iic_chnum 2
|
|
|
|
|
|
///>>>端��定义,�修�!!!!!!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
|
|
|
|
typedef struct
|
|
{
|
|
u8 t1[D_iic_chnum];
|
|
u8 t0[D_iic_chnum];
|
|
|
|
}TS_iicm_;
|
|
extern TS_iicm_ ts_iicm;
|
|
|
|
|
|
#if 0
|
|
|
|
#else
|
|
|
|
#if 10
|
|
#define L0_slc_1_delay(x) Lc_delay_nop(x);
|
|
#define L0_slc_0_delay(x) Lc_delay_nop(x); // 4us
|
|
|
|
#define L0_IICMx_delay(x) ///Lc_delay_us(1)
|
|
|
|
|
|
#else
|
|
#define L0_slc_1_delay() Lc_delay_nop(16);
|
|
#define L0_slc_0_delay() Lc_delay_nop(8); // 4us
|
|
#endif
|
|
|
|
#endif
|
|
|
|
//<<<<端��定义,�修 !!!!!!<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
|
|
extern void L2_IICMx_Write1Reg(vtype ch,unsigned char sla,unsigned char reg );
|
|
|
|
extern void L2_IICMx_ReadReg(vtype ch,unsigned char sla,unsigned char reg,unsigned char *r,unsigned char n);
|
|
extern void L2_IICMx_WriteCmd(vtype ch,unsigned char sla,unsigned char reg,unsigned char cmd);
|
|
extern void L0_IICMx_INIT(vtype ch,unsigned char v);
|
|
////extern void L2_tws_ReadReg(unsigned char sla,unsigned char reg,
|
|
//// unsigned char *v);
|
|
#define L2_tws_ReadReg(ch,x,y,z) L2_IICMx_ReadReg((ch),(x),(y),(z),1)
|
|
|
|
extern unsigned char L2_IICMx_Read1Reg1D(vtype ch,unsigned char sla,unsigned char reg);
|
|
|
|
void L0_IICMx_SCL(vtype ch,vtype v);
|
|
|
|
void L0_IICMx_SDA(vtype ch,vtype v);
|
|
|
|
|
|
void L0_IICMx_Stop(vtype ch);
|
|
|
|
|
|
|
|
|
|
#endif// #ifndef _IIC_H_
|
|
|
|
|