You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
135 lines
2.5 KiB
135 lines
2.5 KiB
#include "asp_oid.h"
|
|
///#include "myfun.h"
|
|
////#include "sd_type.h" asp_oid.c
|
|
|
|
|
|
|
|
void L1_oid_init(void)
|
|
{
|
|
|
|
L0_Oid_Init();
|
|
LD_Oid_SCK_LOW();
|
|
}
|
|
|
|
|
|
|
|
void L1_oid_main(void)
|
|
{
|
|
|
|
}
|
|
|
|
#ifdef doc2342342
|
|
命令1个字节
|
|
|
|
//// fa 00 |00 04 00 03 46 A9
|
|
//// buf 0 1 |2 3 4 5 6 7
|
|
|
|
//// fa 00 |35 20 10 55 05 06
|
|
| | |cmd
|
|
|-filter | dat
|
|
oid cmd -|
|
|
|
|
////读取2010 fa 0d |36 20 10 55 05 06
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
void L1_oid_debug(u8 *para)
|
|
{
|
|
uint32_t r;
|
|
TS_oid_cmd *t =(TS_oid_cmd *)para;
|
|
// ET0 = 0;
|
|
L0_uart0_sendArray("\r\noid debug:",13);
|
|
//// fa 00 |00 04 00 03 46 A9
|
|
//// buf 0 1 |2 3 4 5 6 7
|
|
|
|
//// fa 00 |11 20 10 55 05 06
|
|
//// UDCMD_wakeup
|
|
|
|
//// fa 00 |22 20 42 53 64 75
|
|
//// cmd=20
|
|
switch(t->cmd)
|
|
{
|
|
case UDCMD_wakeup:
|
|
L0_uart0_sendstr("\r\nL1_OID_WakeUp ");
|
|
L1_OID_WakeUp();
|
|
break;
|
|
case UDCMD_cmdsend:
|
|
///fa 00 22 cmd 42 53 64 75
|
|
///fa 00 |22 cmd 42 53 64 75
|
|
L0_uart0_sendstr("\r\ncmd:");
|
|
L0_uart0_uchex(t->dat);L0_uart0_0d0a();
|
|
L1_oid_TransCmd(t->dat);
|
|
break;
|
|
case UDCMD_log:
|
|
L0_uart0_sendstr("\r\nLogRegister");
|
|
/// LogRegister();
|
|
break;
|
|
case UDCMD_CheckVersion:
|
|
L0_uart0_sendstr("\r\n CheckVersion");
|
|
/// L1_oid_CheckVersionAndInit(eAppDevice);
|
|
// while(1)
|
|
{
|
|
// OidTaskLoop();
|
|
}
|
|
break;
|
|
case UDCMD_get:
|
|
L0_uart0_sendstr("\r\n UDCMD_get");
|
|
while(9)
|
|
{
|
|
L1_Oid_readoid();
|
|
|
|
}
|
|
|
|
break;
|
|
case UDCMD_readreg:
|
|
|
|
///fa 00 22 cmd 42 53 64 75
|
|
///fa 00 |22 cmd 42 53 64 75
|
|
r = L1_oidReadRegister (t->reg);
|
|
|
|
L0_uart0_sendstr("\r\n read reg:");
|
|
L0_uart0_ushex(t->reg);
|
|
Lc_delay_ms(1);
|
|
L0_uart0_sendstr(" = ");
|
|
L0_uart0_ulhex(r);
|
|
|
|
L0_uart0_uc(0x09);
|
|
break;
|
|
#if 0
|
|
case UDCMD_testtime_us:
|
|
L0_uart0_sendstr("\r\nUDCMD_testtime_us");
|
|
L0_uart0_uchex(t->dat);L0_uart0_0d0a();
|
|
while(9)
|
|
{
|
|
/// delay_us(t->dat);
|
|
D_IO_LEDkey1_ON();
|
|
// delay_us(t->dat);
|
|
D_IO_LEDkey1_OFF();
|
|
}
|
|
break;
|
|
|
|
case UDCMD_testtime_ms:
|
|
L0_uart0_sendstr("\r\nUDCMD_testtime_ms");
|
|
L0_uart0_uchex(t->dat);L0_uart0_0d0a();
|
|
|
|
while(9)
|
|
{
|
|
/// delay_ms(t->dat);
|
|
D_IO_LEDkey1_ON();
|
|
// delay_ms(t->dat);
|
|
D_IO_LEDkey1_OFF();
|
|
}
|
|
break;
|
|
#endif
|
|
default:
|
|
L0_uart0_sendstr("\r\ncmd error!!");
|
|
L0_uart0_0d0a();
|
|
break;
|
|
}
|
|
ET0 = 1;
|
|
}
|
|
|
|
|
|
|