95 lines
3.5 KiB
C
95 lines
3.5 KiB
C
|
/****************************************************************************
|
||
|
|
||
|
Copyright(c) 2019 by Aerospace C.Power (Chongqing) Microelectronics. ALL RIGHTS RESERVED.
|
||
|
|
||
|
This Information is proprietary to Aerospace C.Power (Chongqing) Microelectronics and MAY NOT
|
||
|
be copied by any method or incorporated into another program without
|
||
|
the express written consent of Aerospace C.Power. This Information or any portion
|
||
|
thereof remains the property of Aerospace C.Power. The Information contained herein
|
||
|
is believed to be accurate and Aerospace C.Power assumes no responsibility or
|
||
|
liability for its use in any way and conveys no license or title under
|
||
|
any patent or copyright and makes no representation or warranty that this
|
||
|
Information is free from patent or copyright infringement.
|
||
|
|
||
|
****************************************************************************/
|
||
|
#ifndef IOT_BRM_MSG_H
|
||
|
#define IOT_BRM_MSG_H
|
||
|
|
||
|
/* os shim includes */
|
||
|
#include "os_types_api.h"
|
||
|
|
||
|
/* common includes */
|
||
|
#include "iot_task_api.h"
|
||
|
|
||
|
#ifdef __cplusplus
|
||
|
extern "C" {
|
||
|
#endif
|
||
|
|
||
|
/* define the sg message queue count and priorities, the higer the priority
|
||
|
* the lower the queue number.
|
||
|
*/
|
||
|
#define IOT_BRM_MSG_QUEUE_HP 0
|
||
|
#define IOT_BRM_MSG_QUEUE_LP 1
|
||
|
#define IOT_BRM_MSG_QUEUE_MAX_PRIO 2
|
||
|
|
||
|
/* message type definition */
|
||
|
#define IOT_BRM_MSG_TYPE_SG_APP 1 /* messages from sg app */
|
||
|
#define IOT_BRM_MSG_TYPE_PLC 2 /* messages from PLC */
|
||
|
#define IOT_BRM_MSG_TYPE_UART 3 /* messages from ir interface */
|
||
|
#define IOT_BRM_MSG_TYPE_TIMER 4 /* messages from timer */
|
||
|
#define IOT_BRM_MSG_TYPE_GPS 5 /* messages from gps data */
|
||
|
#define IOT_BRM_MSG_TYPE_INTERNAL 6 /* messages from brm internal */
|
||
|
#define IOT_BRM_MSG_TYPE_BRK 7 /* messages from breaker data */
|
||
|
|
||
|
/* breaker message id definition */
|
||
|
/* breaker message id brk rsp data */
|
||
|
#define IOT_BRM_MSG_ID_BRK_DATA 1
|
||
|
/* breaker message id brk timer msg id */
|
||
|
#define IOT_BRM_MSG_ID_BRK_TIMER 2
|
||
|
/* breaker message id brk check event interrupt timer msg id */
|
||
|
#define IOT_BRM_MSG_ID_BRK_EVENT 3
|
||
|
|
||
|
/* SG_APP type message id definition */
|
||
|
#define IOT_BRM_MSG_ID_SG_APP 1 /* messages from SG APP */
|
||
|
|
||
|
/* UART type message id definition */
|
||
|
#define IOT_BRM_MSG_ID_RS485_DATA 1 /* data delivered from IR */
|
||
|
#define IOT_BRM_MSG_ID_MF_RS485_DATA 2 /* data delivered from mf rs485 */
|
||
|
|
||
|
/* PLC type message id definition */
|
||
|
#define IOT_BRM_MSG_ID_PLC_MSG 1 /* message delivered from PLC */
|
||
|
|
||
|
/* TIMER type message id definition */
|
||
|
#define IOT_BRM_MSG_ID_TIMER_PERIOD 1 /* period timer */
|
||
|
/* timer node list updated to nv storage */
|
||
|
#define IOT_BRM_MSG_ID_TIMER_NODE_LIST 2
|
||
|
#define IOT_BRM_MSG_ID_TIMER_RS485 3
|
||
|
#define IOT_BRM_MSG_ID_TIMER_ASS_CHK 4
|
||
|
|
||
|
/* gps message id definition */
|
||
|
#define IOT_BRM_MSG_ID_GPS_INFO 1 /* messages from gps driver */
|
||
|
|
||
|
/* intenal type message id definition */
|
||
|
#define IOT_BRM_MSG_ID_INTERNAL_PD 1 /* power down */
|
||
|
#define IOT_BRM_MSG_ID_INTERNAL_HW_TSFM 2 /* tsfm and branch ident recv*/
|
||
|
#define IOT_BRM_MSG_ID_INTERNAL_EM 3 /* em module */
|
||
|
#define IOT_BRM_MSG_ID_INTERNAL_HW_TSFM_INFO 4 /* recv hw_tsfm info */
|
||
|
#define IOT_BRM_MSG_ID_INTERNAL_HW_TOPO_INFO 5 /* recv branch topo info */
|
||
|
|
||
|
/* sg message */
|
||
|
typedef struct _iot_brm_msg {
|
||
|
/* iot task message */
|
||
|
iot_task_msg_t task_msg;
|
||
|
/* pointer to message data */
|
||
|
void *data;
|
||
|
/* another data field */
|
||
|
uint32_t data2;
|
||
|
} iot_brm_msg_t;
|
||
|
|
||
|
|
||
|
#ifdef __cplusplus
|
||
|
}
|
||
|
#endif
|
||
|
|
||
|
#endif /* IOT_BRM_MSG_H */
|