NHS31xx SW API
msg_cmd.h
1 /*
2  * Copyright 2015-2018 NXP
3  * This software is owned or controlled by NXP and may only be used strictly
4  * in accordance with the applicable license terms. By expressly accepting
5  * such terms or by downloading, installing, activating and/or otherwise using
6  * the software, you are agreeing that you have read, and that you agree to
7  * comply with and are bound by, such license terms. If you do not agree to
8  * be bound by the applicable license terms, then you may not retain, install,
9  * activate or otherwise use the software.
10  */
11 
16 #ifndef __MSG_CMD_H_
17 #define __MSG_CMD_H_
18 
19 /* -------------------------------------------------------------------------
20  * Include files
21  * ------------------------------------------------------------------------- */
22 
23 #include <stdint.h>
24 #include <stdbool.h>
25 
26 /* -------------------------------------------------------------------------
27  * Types and defines
28  * ------------------------------------------------------------------------- */
29 
30 #pragma pack(push, 1)
31 
33 typedef struct MSG_CMD_READREGISTER_S {
34  uint32_t address;
36 
38 typedef struct MSG_CMD_WRITEREGISTER_S {
39  uint32_t address;
40  uint32_t data;
42 
44 typedef struct MSG_CMD_READMEMORY_S {
45  uint32_t address;
46  uint8_t length;
48 
50 typedef struct MSG_CMD_WRITEMEMORY_S {
51  uint32_t address;
52  uint8_t length;
53  uint8_t data[32];
55 
56 #pragma pack(pop)
57 
58 /* ------------------------------------------------------------------------- */
59 
79 typedef uint32_t (*pMsg_CmdHandler_t)(uint8_t msgId, int payloadLen, const uint8_t* pPayload);
80 
98 typedef bool (*pMsg_AcceptCommandCb_t)(uint8_t msgId, int payloadLen, const uint8_t* pPayload);
99 
104 typedef struct MSG_CMD_HANDLER_S {
106  uint8_t id;
107 
113 
116 #endif
bool(* pMsg_AcceptCommandCb_t)(uint8_t msgId, int payloadLen, const uint8_t *pPayload)
Definition: msg_cmd.h:98
pMsg_CmdHandler_t handler
Definition: msg_cmd.h:111
uint32_t data
Definition: msg_cmd.h:40
uint8_t length
Definition: msg_cmd.h:46
uint32_t(* pMsg_CmdHandler_t)(uint8_t msgId, int payloadLen, const uint8_t *pPayload)
Definition: msg_cmd.h:79
uint8_t id
Definition: msg_cmd.h:106
Definition: msg_cmd.h:44
Definition: msg_cmd.h:50
Definition: msg_cmd.h:104
Definition: msg_cmd.h:33
Definition: msg_cmd.h:38
uint32_t address
Definition: msg_cmd.h:34