资源简介
ATA8510.c
代码片段和文件信息
void main(void)
{
unsigned char temptemp0temp1;
MCU_INIT();
ATA8510_WAKEUP();
while(1)
{
if(P_IRQ)
{
temp=GET_EVENT_BYTE();
if(temp & (1 << 4))
{
temp=GET_RX_FIFO_LENTH();
if(temp&&(temp<=32))
{
READ_ATA8510_BUF(RF_BUFFERtemp);
if(temp==16)
{
;//C处理数据
}
}
else
{
if(temp>32)SET_ATA8510_SYSTEM_MODE(0xA20x40);
}
}
}
}
}
void MCU_INIT(void)
{
}
//1ms
void DELAY(unsigned short x)
{
unsigned short i;
unsigned short j;
for(i=0;i {
for(j=0;j<115;j++);
}
}
void ATA8510_WAKEUP(void)
{
P_PWRON=1;
DELAY(5);
GET_EVENT_BYTE();
}
unsigned char GET_EVENT_BYTE(void)
{
unsigned char i;
P_CS=0;
DELAY_25US();
P_SCK=0;
WRITE_ATA8510_A_BYTE(0x04);
i=WRITE_ATA8510_A_BYTE(0x00);
WRITE_ATA8510_A_BYTE(0x00);
WRITE_ATA8510_A_BYTE(0x00);
P_SCK=1;
P_CS=1;
DELAY_25US();
P_PWRON=1;
return
- 上一篇:硬盘检查实用代码(hdd_check.c)
- 下一篇:mpu6050 52单片机
评论
共有 条评论