NHS31xx msg - Message Handler Protocol
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
;
35
}
MSG_CMD_READREGISTER_T
;
36
38
typedef
struct
MSG_CMD_WRITEREGISTER_S {
39
uint32_t
address
;
40
uint32_t
data
;
41
}
MSG_CMD_WRITEREGISTER_T
;
42
44
typedef
struct
MSG_CMD_READMEMORY_S {
45
uint32_t
address
;
46
uint8_t
length
;
47
}
MSG_CMD_READMEMORY_T
;
48
50
typedef
struct
MSG_CMD_WRITEMEMORY_S {
51
uint32_t
address
;
52
uint8_t
length
;
53
uint8_t data[32];
54
}
MSG_CMD_WRITEMEMORY_T
;
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
111
pMsg_CmdHandler_t handler;
112
} MSG_CMD_HANDLER_T;
113
116
#endif
MSG_CMD_READREGISTER_T::address
uint32_t address
Definition:
msg_cmd.h:34
MSG_CMD_WRITEREGISTER_T::data
uint32_t data
Definition:
msg_cmd.h:40
MSG_CMD_READMEMORY_T::length
uint8_t length
Definition:
msg_cmd.h:46
MSG_CMD_WRITEMEMORY_T
Definition:
msg_cmd.h:50
MSG_CMD_READREGISTER_T
Definition:
msg_cmd.h:33
MSG_CMD_WRITEREGISTER_T
Definition:
msg_cmd.h:38
MSG_CMD_READMEMORY_T
Definition:
msg_cmd.h:44
sw
nss
mods
msg
msg_cmd.h
Generated on Tue Oct 20 2020 08:17:13 for NHS31xx msg - Message Handler Protocol by
1.8.14