📄 cw6695.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 + -