8 #ifndef __MONITOR_PROFILE_H
9 #define __MONITOR_PROFILE_H
15 #define MONITOR_PROFILE_VERSION (2)
32 #define MONITOR_START_CMD (0x4850)
33 #define MONITOR_MAGIC_CMD (0x4D44)
34 #define MONITOR_END_CMD (0xA55A)
36 #define MONITOR_CMD_HOST_MASK (0x8000)
38 #define MONITOR_PAYLOAD_MAXSIZE (MONITOR_PROFILE_MAXSIZE - sizeof(monitor_profile_t))
40 #define MONITOR_PROFILE_MIN_SIZE (sizeof(monitor_profile_t) - 4)
42 #define MONITOR_PAYLOAD_DATA_OFFSET ((MONITOR_PROFILE_MIN_SIZE-2)+(sizeof(monitor_payload_t)-4)+(sizeof(data_payload_t)-4))
44 #define MONITOR_RESULT_ACK_MASK (0x8000)
51 #define MONITOR_PROFILE_CRC_OFFSET (14)
66 } __attribute__((packed,
aligned(1))) data_payload_t;
76 } __attribute__((packed,
aligned(1))) data_trigger_t;
86 data_payload_t *data_payload;
87 data_trigger_t *data_trigger;
89 } __attribute__((packed,
aligned(1))) monitor_payload_t;
95 uint64_t monitor_version;
100 } __attribute__((packed,
aligned(1))) monitor_info_t;
115 monitor_payload_t *monitor_payload;
117 } __attribute__((packed,
aligned(1))) monitor_profile_t;
203 #define MONITOR_PAYLOAD_CH_MASK (0xFFFF0000)
204 #define MONITOR_PAYLOAD_CH_DATA(ch) (ch & ~MONITOR_PAYLOAD_CH_MASK)
255 uint16_t
monitor_profile_parse(uint8_t *data, uint32_t length, uint32_t *drop_offset, uint32_t *expect_length);
uint16_t monitor_profile_parse(uint8_t *data, uint32_t length, uint32_t *drop_offset, uint32_t *expect_length)
Definition: monitor_profile.c:566
void monitor_profile_set_cmd(uint8_t *data, uint16_t cmd)
Definition: monitor_profile.c:333
const uint32_t d7d75a2a6eebafc3d2ec0a0be089e05322057c4c308d648b374b362ea7eff5fa
void monitor_profile_set_index(uint8_t *data, uint16_t index)
Definition: monitor_profile.c:321
uint16_t monitor_profile_info_process(uint8_t *data)
Definition: monitor_profile.c:501
uint16_t monitor_set_value(uint8_t type, uint32_t addr, uint8_t *data)
Definition: monitor_profile.c:137
const monitor_var_info_t * monitor_ch_info_find_by_channel(uint8_t channel)
Definition: monitor_profile.c:686
TRIGGER_EXPR
Definition: monitor_profile.h:194
@ TRIGGER_EXPR_OR
Definition: monitor_profile.h:196
@ TRIGGER_EXPR_AND
Definition: monitor_profile.h:195
const monitor_var_info_t * monitor_ch_info_find_by_name(const char *name)
Definition: monitor_profile.c:674
uint16_t monitor_get_value(uint8_t type, uint32_t addr, uint8_t *data)
Definition: monitor_profile.c:67
void monitor_ch_info_print_registry(void)
Definition: monitor_profile.c:703
void monitor_profile_set_length(uint8_t *data, uint32_t length)
Definition: monitor_profile.c:369
uint32_t monitor_profile_get_timing(uint8_t *data)
Definition: monitor_profile.c:351
uint32_t monitor_profile_crc32(uint8_t *data)
Definition: monitor_profile.c:281
uint32_t monitor_ch_info_get_registry_count(void)
Definition: monitor_profile.c:698
uint32_t monitor_profile_get_length(uint8_t *data)
Definition: monitor_profile.c:363
uint16_t monitor_profile_get_index(uint8_t *data)
Definition: monitor_profile.c:315
void monitor_profile_set_timing(uint8_t *data, uint32_t tick_us)
Definition: monitor_profile.c:357
bool payload_is_channel_type(uint32_t value)
Definition: monitor_profile.c:207
MONITOR_RESULT
Definition: monitor_profile.h:163
@ RESULT_GET_ERR
Definition: monitor_profile.h:169
@ RESULT_PAYLOAD_ERR
Definition: monitor_profile.h:168
@ RESULT_DATA_TYPE_ERR
Definition: monitor_profile.h:172
@ RESULT_VER_ERR
Definition: monitor_profile.h:166
@ RESULT_HEAD_ERR
Definition: monitor_profile.h:165
@ RESULT_OFF
Definition: monitor_profile.h:180
@ RESULT_CONFIG_ERR
Definition: monitor_profile.h:175
@ RESULT_CRC_ERR
Definition: monitor_profile.h:167
@ RESULT_RUNNING_ERR
Definition: monitor_profile.h:176
@ RESULT_LOSS
Definition: monitor_profile.h:181
@ RESULT_CMD_ERR
Definition: monitor_profile.h:174
@ RESULT_SET_ERR
Definition: monitor_profile.h:170
@ RESULT_PRFILE_OVERFLOW
Definition: monitor_profile.h:173
@ RESULT_BAD
Definition: monitor_profile.h:164
@ RESULT_ON
Definition: monitor_profile.h:179
@ RESULT_DATA_LEN_ERR
Definition: monitor_profile.h:171
@ RESULT_SUCCESS
Definition: monitor_profile.h:178
int monitor_type_convert_byte(DATA_TYPE type)
Definition: monitor_profile.c:212
const uint64_t be8443a5d67825271edb6f6bee202d6125a38e6aa8f2acbd54652d113af8793b
void monitor_profile_set_crc32(uint8_t *data, uint32_t crc32)
Definition: monitor_profile.c:303
DATA_TYPE
Definition: monitor_profile.h:135
@ TYPE_DOUBLE
Definition: monitor_profile.h:146
@ TYPE_INT32
Definition: monitor_profile.h:142
@ TYPE_INT64
Definition: monitor_profile.h:144
@ TYPE_INT8
Definition: monitor_profile.h:138
@ TYPE_ARRAY_FLOAT
Definition: monitor_profile.h:157
@ TYPE_FLOAT
Definition: monitor_profile.h:145
@ TYPE_ARRAY_DOUBLE
Definition: monitor_profile.h:158
@ TYPE_INT16
Definition: monitor_profile.h:140
@ TYPE_ARRAY_UINT16
Definition: monitor_profile.h:151
@ TYPE_BOOL
Definition: monitor_profile.h:136
@ TYPE_ARRAY_UINT64
Definition: monitor_profile.h:155
@ TYPE_ARRAY_UINT32
Definition: monitor_profile.h:153
@ TYPE_UNKNOWN
Definition: monitor_profile.h:159
@ TYPE_ARRAY_STRUCT
Definition: monitor_profile.h:148
@ TYPE_ARRAY_INT16
Definition: monitor_profile.h:152
@ TYPE_STRUCT
Definition: monitor_profile.h:147
@ TYPE_UINT8
Definition: monitor_profile.h:137
@ TYPE_UINT32
Definition: monitor_profile.h:141
@ TYPE_UINT16
Definition: monitor_profile.h:139
@ TYPE_ARRAY_UINT8
Definition: monitor_profile.h:149
@ TYPE_UINT64
Definition: monitor_profile.h:143
@ TYPE_ARRAY_INT64
Definition: monitor_profile.h:156
@ TYPE_ARRAY_INT8
Definition: monitor_profile.h:150
@ TYPE_ARRAY_INT32
Definition: monitor_profile.h:154
uint16_t monitor_profile_cmd_process(uint16_t cmd, uint16_t parse_result, uint8_t *data, uint32_t length)
Definition: monitor_profile.c:522
struct __attribute__ aligned
monitor_payload_t * monitor_profile_get_payload(uint8_t *data)
Definition: monitor_profile.c:375
monitor_info_t * monitor_profile_get_monitorinfo(uint8_t *data)
Definition: monitor_profile.c:381
uint16_t monitor_profile_payload_process(uint16_t cmd, uint8_t *data, uint32_t length)
Definition: monitor_profile.c:387
uint32_t monitor_profile_get_crc32(uint8_t *data)
Definition: monitor_profile.c:309
uint16_t monitor_profile_get_cmd(uint8_t *data)
Definition: monitor_profile.c:327
TRIGGER_MODE
Definition: monitor_profile.h:185
@ TRIGGER_MODE_EDGE_BOTH
Definition: monitor_profile.h:186
@ TRIGGER_MODE_LEVEL_HIGH
Definition: monitor_profile.h:190
@ TRIGGER_MODE_EDGE_RISING
Definition: monitor_profile.h:187
@ TRIGGER_MODE_EDGE_FALLING
Definition: monitor_profile.h:188
@ TRIGGER_MODE_LEVEL_LOW
Definition: monitor_profile.h:189
void monitor_profile_set_header(uint8_t *data)
Definition: monitor_profile.c:288
uint16_t monitor_profile_get_result(uint8_t *data)
Definition: monitor_profile.c:339
DEVICE_CMD
Definition: monitor_profile.h:120
@ CMD_CONNECT
Definition: monitor_profile.h:122
@ CMD_INVALID
Definition: monitor_profile.h:121
@ CMD_BUFFER
Definition: monitor_profile.h:130
@ CMD_STREAM
Definition: monitor_profile.h:129
@ CMD_TRIGGER
Definition: monitor_profile.h:131
@ CMD_GETVALUE
Definition: monitor_profile.h:125
@ CMD_GETINFO
Definition: monitor_profile.h:123
@ CMD_SETVALUE
Definition: monitor_profile.h:126
@ CMD_NOTIFY
Definition: monitor_profile.h:128
void monitor_profile_set_result(uint8_t *data, uint16_t result)
Definition: monitor_profile.c:345
void monitor_profile_set_end(uint8_t *data)
Definition: monitor_profile.c:297
Definition: monitor_kconfig.h:186