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.
72 lines
2.2 KiB
72 lines
2.2 KiB
1 year 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 _SIICx_H_
|
||
|
#define _SIICx_H_
|
||
|
|
||
|
#include "../clib/type.h"
|
||
|
#include "../clib/clib.h"
|
||
|
#include "../ctask/tick.h"
|
||
|
|
||
|
|
||
|
///>>>�˿�λ���壬����!!!!!!>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
|
||
|
|
||
|
#include "../bsp/bsp_config.h"
|
||
|
|
||
|
#include "../msp/msp_siicx.h"
|
||
|
|
||
|
|
||
|
typedef struct
|
||
|
{
|
||
|
vU32 n;
|
||
|
vType sh;
|
||
|
unsigned char sal;
|
||
|
void (*pf_SDA_out)(vType x);
|
||
|
void (*pf_SDA_set)(vType x);
|
||
|
vType (*pf_SDA_get)(void);
|
||
|
|
||
|
void (*pf_SCL_out)(vType x);
|
||
|
void (*pf_SCL_set)(vType x);
|
||
|
|
||
|
/// void (*pf_init)(void);
|
||
|
void (*pf_close)(void);
|
||
|
|
||
|
}TS_siic;
|
||
|
|
||
|
extern TS_siic ts_siic1;
|
||
|
extern TS_siic ts_siic2;
|
||
|
|
||
|
//<<<<�˿�λ���壬����!!!!!!<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
|
||
|
extern void L0_iicx_INIT(TS_siic *p,unsigned char v);
|
||
|
extern void L0_iicx_SendData(TS_siic *p,unsigned char c);
|
||
|
extern unsigned char L0_iicx_ReceiveData(TS_siic *p);
|
||
|
extern void L1_iicx_ReadNByte(TS_siic *p,unsigned char *b,unsigned char n);
|
||
|
///////////////////////////////
|
||
|
///д��һ��reg Ϊ������д�������߶�ȡ����
|
||
|
extern void L1_iicx_Write1Reg(TS_siic *p,unsigned char reg);
|
||
|
// sla.(reg)=cmd
|
||
|
extern void L2_iicx_Write1Reg1Cmd(TS_siic *p,unsigned char reg,unsigned char cmd);
|
||
|
//��ȡreg��ַ��n������ sla.(reg) sla.(reg+1)................ sla.(reg+n)
|
||
|
extern void L2_iicx_Read1Reg(TS_siic *p,unsigned char reg,
|
||
|
unsigned char *r,unsigned char n);
|
||
|
extern void L1_iicx_Read2cmd(TS_siic *p, unsigned char *c,unsigned char *b,unsigned char n);
|
||
|
extern void L2_iicx_Write2Cmd(TS_siic *p, unsigned char reg,unsigned char cmd,unsigned char cmd2);
|
||
|
extern void L2_iicx_Read2Cmd(TS_siic *p, unsigned char cmd,unsigned char cmd2,
|
||
|
unsigned char *buf,unsigned char n);
|
||
|
#endif// #ifndef _IIC_H_
|
||
|
|