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.
56 lines
1.3 KiB
56 lines
1.3 KiB
////////////////////////////////////////////////////////////////////////////
|
|
///@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_RS485_H
|
|
#define _APP_TASK_RS485_H
|
|
|
|
#include "../ctask/task.h"
|
|
#include "../clib/clib.h"
|
|
|
|
typedef struct _s_task_rs485
|
|
{
|
|
TS_task task;
|
|
}S_TASK_RS485;
|
|
|
|
#define TPC_RS485_DAT_MAX 32
|
|
typedef struct _tpc_rs485_
|
|
{
|
|
U8 head[1];
|
|
U8 slaveId;
|
|
U8 cmd;
|
|
U8 num[2];
|
|
U8 buf[TPC_RS485_DAT_MAX];
|
|
U8 ocr;
|
|
}TPC_RS485;
|
|
|
|
#define TPC_RS485_ACK_DAT_MAX 32
|
|
typedef struct _tpc_rs485_ack_
|
|
{
|
|
U8 head[1];
|
|
U8 slaveId;
|
|
U8 cmd;
|
|
U8 num[2];
|
|
U8 buf[TPC_RS485_ACK_DAT_MAX];
|
|
U8 ocr;
|
|
}TPC_RS485_ACK;
|
|
|
|
extern S_TASK_RS485 _s_task_rs485;
|
|
extern void L3_task_rs485_init(void);
|
|
extern void L3_task_rs485_handler(S_TASK_RS485 *s);
|
|
extern void parse_rs485_pkg();
|
|
extern void print_rs485_pkg(TPC_RS485 *p);
|
|
extern U8 constructor_rs485_ack();
|
|
|
|
|
|
#endif // #ifndef _APP_TASK_RS485_H
|
|
|
|
|