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.
65 lines
2.2 KiB
65 lines
2.2 KiB
4 years ago
|
//////////////////////////////////////////////////////////////////////////
|
||
|
/// COPYRIGHT NOTICE
|
||
|
/// Copyright (c) 2018, ���ؿƼ�
|
||
|
/// All rights reserved.
|
||
|
///
|
||
|
/// @file iic_sim
|
||
|
/// @brief iic ģ��io �汾�� ��cpu�أ�Ψһ��Ҫ�ĵľ���ͷ�����еĹܽŶ���
|
||
|
/// @info ����io���� ,�����ط����ޱ�Ҫ������
|
||
|
///�����ļ�ʵ�ֵĹ��ܵ�������
|
||
|
///
|
||
|
/// @version 1.1 CCsens technology
|
||
|
/// @author CC
|
||
|
/// @date 20180102
|
||
|
|
||
|
//
|
||
|
//////////////////////////////////////////////////////////////////////////
|
||
|
|
||
|
#ifndef _IIC_SIM_H_
|
||
|
#define _IIC_SIM_H_
|
||
|
|
||
|
#include "../clib/type.h"
|
||
|
#include "../clib/clib.h"
|
||
|
#include "../ctask/tick.h"
|
||
|
|
||
|
|
||
|
///>>>�˿�λ���壬����!!!!!!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
|
||
|
|
||
|
#include "../bsp/bsp_config.h"
|
||
|
|
||
|
|
||
|
|
||
|
#if 0
|
||
|
//// for stc 11.0M
|
||
|
#define delay10us() NOP();NOP();NOP();NOP();NOP();NOP();NOP();NOP();NOP();NOP();///Lc_delay_us(1) //����cpu�����ʽ�����Ӧ�ĵ���
|
||
|
#define L0_I2C_delay(x) NOP();NOP();///Lc_delay_us(x)
|
||
|
#else
|
||
|
///#define delay10us() NOP();NOP();NOP();NOP();NOP();NOP();NOP();NOP();NOP();NOP();NOP();NOP();NOP();NOP();NOP();NOP();NOP();NOP();NOP();NOP();NOP();NOP();NOP();NOP();NOP();NOP();NOP();NOP();NOP();NOP();NOP();NOP();NOP();NOP();NOP();NOP();///Lc_delay_us(1) //����cpu�����ʽ�����Ӧ�ĵ���
|
||
|
///#define L0_I2C_delay(x) NOP();NOP();NOP();NOP();NOP();NOP();NOP();NOP();NOP();NOP();///Lc_delay_us(x)
|
||
|
|
||
|
//#define delay10us() Lc_delay_us(3000) //����cpu�����ʽ�����Ӧ�ĵ���
|
||
|
//#define L0_I2C_delay(x) Lc_delay_us(10000)
|
||
|
///#define delay10us() Lc_delay_us(80) //20us
|
||
|
///#define L0_I2C_delay(x) Lc_delay_us(300) //25us
|
||
|
|
||
|
#define L0_slc_1_delay() Lc_delay_nop(4);
|
||
|
#define L0_slc_0_delay() Lc_delay_nop(1); // 4us
|
||
|
|
||
|
#define L0_I2C_delay(x) ///Lc_delay_us(80)
|
||
|
|
||
|
#endif
|
||
|
|
||
|
//<<<<�˿�λ���壬����!!!!!!<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
|
||
|
|
||
|
|
||
|
extern void L2_I2C_ReadReg(unsigned char sla,unsigned char reg,unsigned char *r,unsigned char n);
|
||
|
extern void L2_I2C_WriteCmd(unsigned char sla,unsigned char reg,unsigned char cmd);
|
||
|
extern void L0_I2C_INIT(unsigned char v);
|
||
|
////extern void L2_tws_ReadReg(unsigned char sla,unsigned char reg,
|
||
|
//// unsigned char *v);
|
||
|
#define L2_tws_ReadReg(x,y,z) L2_I2C_ReadReg((x),(y),(z),1)
|
||
|
|
||
|
|
||
|
#endif// #ifndef _IIC_H_
|
||
|
|