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

📄 cw6695.c

📁 采用STC MCU(5410) + TI CC2500 做的无线对讲系统.2.4G 频段 有效距离15m.Keil uv 3下的源码
💻 C
字号:
#define		_CW6695_C_
#include"cw6695.h"
#include"intrins.h"
#undef		_CW6695_C_
/************************************************************************************
*	Function	:	The Reg. Transmit.(16 Bits)
*	Description	:	when the ssp start "1111" four bits logic "1" been transmited and 
*					the R/W bit followed then is the 3 bits address,last is the 8 bits 
*					data .MSB
*
*************************************************************************************/
//-------------------- Write Template ---------------
void ByteWrite(unsigned char _byte)
{
	unsigned char i;
	i=8;
	while(i)
	{
		SSPCLK=0;
		if(_byte&0x80)	SSPTR=1;
		else			SSPTR=0;
		SSPCLK=1;
		_byte<<=1;
		i--;
	}
}
void SSPWrite(unsigned char _rg,unsigned char _data)
{
	ByteWrite((_rg&0x03)|0xf0);
	ByteWrite(_data);
}

void InitCW6695(void)
{// Power On Inition CW6695
	RESET=0;
	_nop_();
	_nop_();
	_nop_();
	_nop_();
	_nop_();
	_nop_();
	RESET=1;

	SSPWrite(aCW_reg0,dCW_reg0);
	SSPWrite(aCW_reg1,dCW_reg1);
	SSPWrite(aCW_reg2,dCW_reg2);
	SSPWrite(aCW_reg3,dCW_reg3);
}


⌨️ 快捷键说明

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