⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cs5550.h

📁 电子称重的程序
💻 H
字号:
#ifndef CS5550_H
#define CS5550_H
#include<config.h>
sbit	sdi=P1^3;
sbit	sdo=P1^5;
sbit	sclk=P1^6;
sbit	int0=P3^2;
sbit	reset=P1^2;
sbit	code_jmp=P3^3;

#define	Sync0				0xfe     //11111110B     ;0FEH
#define	Sync1				0xff     //11111111B     ;0FFH
#define	RReg_Config			0x00     //00000000B     ;000H
#define	WReg_Config		0x40     //01000000B     ;040H
#define	RRegA1_DcOffset	0x02     //00000010B     ;002H
#define	WRegA1_DcOffset	0x42     //01000010B     ;042H
#define	RRegA1_DcGain		0x04     //00000100B     ;004H
#define	WRegA1_DcGain		0x44     //01000100B     ;044H
#define	RReg_CycleCount	0x0a     //00001010B     ;00AH  //转换次数
#define	WReg_CycleCount	0x4a     //01001010B     ;04AH
#define	RRegA1_Output		0x0e     //00001110B     ;00EH
#define	WRegA1_Output		0x4e     //01001110B     ;04EH
#define	RRegA1_FILT		0x16     //00010110B     ;016H
#define	WRegA1_FILT		0x56     //01010110B     ;056H
#define	RReg_Status			0x1e     //00011110B     ;01EH
#define	WReg_Status		0x5e     //01011110B     ;05EH
#define	RReg_Mask			0x34     //00110100B     ;034H
#define	WReg_Mask			0x74     //01110100B     ;074H
#define	RRegA2_FILT		0x18     //00011000B     ;018H
#define	RRegA2_DcOffset	0x06     //00000110B     ;006H
#define	WRegA2_DcOffset	0x46     //01000110B     ;046H
#define	RRegA2_DcGain		0x08     //00001000B     ;008H
#define	ContnuConvs		0xe8     //11101000B     ;0E8H
BOOL	cs_clock(void);
void		inin5550(char gain,char Offset);
void		cs_writebyte(Uchar);
Uchar	int_cs_readbyte(void);
void		cs_writebyte_4(Uchar,Uchar,Uchar,Uchar);
long		readad();
BOOL	getad();
Uint		readvolt();
#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -