代码:
//安全寄存器页写
Ack_t SecRegWritePage(u8* data, u8 addr, u16 len)
{
int i = 0;
Ack_t ack = ACK;
DELAY_HTSS();
ack &= AT21CS01_SendByte(SECURITY_REG_ACCESS | WRITE);
ack &= AT21CS01_SendByte(addr);
for(i = 0; i < len; i++)
{
ack &= AT21CS01_SendByte(data[i]);
}
DELAY_HTSS();
delay_ms(5); //t_WR
return ack;
}
|