16 changed files with 279 additions and 76 deletions
@ -0,0 +1,71 @@ |
|||
////////////////////////////////////////////////////////////////////////////
|
|||
///@copyright Copyright (c) 2018, 传控科技 All rights reserved.
|
|||
///-------------------------------------------------------------------------
|
|||
/// @file bsp_drv.c
|
|||
/// @brief bsp @ driver config
|
|||
///-------------------------------------------------------------------------
|
|||
/// @version 1.0
|
|||
/// @author CC
|
|||
/// @date 20180331
|
|||
/// @note cc_AS_stc02
|
|||
//////////////////////////////////////////////////////////////////////////////
|
|||
|
|||
#include "task_nfc.h" |
|||
#include "../app/app_config.h" |
|||
#include "../bsp/bsp_config.h" |
|||
#include "../msp/uart0.h" |
|||
#include "../msp/uart3.h" |
|||
|
|||
S_TASK_NFC _s_task_nfc; |
|||
TPC_NFC tpc_nfc; |
|||
|
|||
//=============================================
|
|||
void L3_task_nfc_init(void) |
|||
{ |
|||
L1_task_init(&_s_task_nfc.task); |
|||
L3_task_s_go(_s_task_nfc,D_task_init); |
|||
} |
|||
|
|||
#define D_task_NFC_READ 0x50 |
|||
#define D_task_NFC_PRINT 0x51 |
|||
|
|||
void L3_task_nfc_handler(S_TASK_NFC *s) |
|||
{ |
|||
TTSS_Task_init() |
|||
L2_task_go(D_task_NFC_READ); |
|||
|
|||
TTSS_Task_step(D_task_NFC_READ) |
|||
if(ts_uart3_recv_buf.ok == 1) |
|||
{ |
|||
ts_uart3_recv_buf.ok = 0; |
|||
Lc_buf_copy_uc((U8*)&tpc_nfc, ts_uart3_recv_buf.buf, ts_uart3_recv_buf.num); |
|||
tpc_nfc.ocr = tpc_nfc.buf[tpc_nfc.num[0] << 8 | tpc_nfc.num[1]]; |
|||
L2_task_go_Tdelay(D_task_NFC_PRINT,0); |
|||
} |
|||
|
|||
TTSS_Task_step(D_task_NFC_PRINT) |
|||
L0_uart0_sendstr("\r\n--------- Recv NFC --------\r\n"); |
|||
L0_uart0_sendstr("id : "); |
|||
L0_uart0_uchex(tpc_nfc.slaveId); |
|||
L0_uart0_0d0a(); |
|||
L0_uart0_sendstr("num: "); |
|||
L0_uart0_uchex(tpc_nfc.num[0]); |
|||
L0_uart0_uchex(tpc_nfc.num[1]); |
|||
L0_uart0_0d0a(); |
|||
L0_uart0_sendstr("cmd: "); |
|||
L0_uart0_uchex(tpc_nfc.cmd); |
|||
L0_uart0_0d0a(); |
|||
L0_uart0_sendstr("no : "); |
|||
L0_uart0_sendArrayHex(tpc_nfc.buf, tpc_nfc.num[0] << 8 | tpc_nfc.num[1]); |
|||
L0_uart0_0d0a(); |
|||
L0_uart0_sendstr("ocr: "); |
|||
L0_uart0_uchex(tpc_nfc.ocr); |
|||
L0_uart0_0d0a(); |
|||
L2_task_go_Tdelay(D_task_NFC_READ,0); |
|||
|
|||
TTSS_Task_end(); |
|||
} |
|||
|
|||
|
|||
|
|||
|
@ -0,0 +1,33 @@ |
|||
////////////////////////////////////////////////////////////////////////////
|
|||
///@copyright Copyright (c) 2018, 传控科技 All rights reserved.
|
|||
///-------------------------------------------------------------------------
|
|||
/// @file bsp_drv.h
|
|||
/// @brief bsp @ driver config
|
|||
///-------------------------------------------------------------------------
|
|||
/// @version 1.0
|
|||
/// @author CC
|
|||
/// @date 20180331
|
|||
/// @note cc_AS_stc02
|
|||
|
|||
//////////////////////////////////////////////////////////////////////////////
|
|||
|
|||
#ifndef _APP_TASK_NFC_H |
|||
#define _APP_TASK_NFC_H |
|||
|
|||
#include "../ctask/task.h" |
|||
#include "../clib/clib.h" |
|||
#include "../tpc/debug.h" |
|||
|
|||
typedef struct _s_task_nfc |
|||
{ |
|||
TS_task task; |
|||
}S_TASK_NFC; |
|||
|
|||
extern S_TASK_NFC _s_task_nfc; |
|||
|
|||
extern void L3_task_nfc_init(void); |
|||
extern void L3_task_nfc_handler(S_TASK_NFC *s); |
|||
|
|||
|
|||
#endif // #ifndef _APP_TASK_NFC_H
|
|||
|
Loading…
Reference in new issue