Chirp SonicLib  4.5.2
ch_helper.h
Go to the documentation of this file.
1 
7 /*
8  Copyright 2016-2023, InvenSense, Inc. All rights reserved.
9 
10  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
11  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
12  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
13  DISCLAIMED.
14 
15  */
16 
17 #ifndef CH_HELPER_H_
18 #define CH_HELPER_H_
19 
20 #include <stdbool.h>
21 #include <stdint.h>
22 
23 #ifdef INCLUDE_SHASTA_SUPPORT
24 #include "invn/icu_interface/shasta_pmut_cmds.h"
25 #endif
26 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30 
31 #ifdef INCLUDE_SHASTA_SUPPORT
32 
33 #define GET_INSTRUCTION_CMD_TYPE(inst) ((inst.cmd_config) & PMUT_CMD_BITS)
34 #define IS_INSTRUCTION_CMD_RX(cmd) (((cmd)&PMUT_CMD_BITS) == PMUT_CMD_RX)
35 #define IS_INSTRUCTION_CMD_TX(cmd) (((cmd)&PMUT_CMD_BITS) == PMUT_CMD_TX)
36 #define IS_INSTRUCTION_CMD_EOF(cmd) (((cmd)&PMUT_CMD_BITS) == PMUT_CMD_EOF)
37 
38 #endif
39 
40 #ifdef __cplusplus
41 }
42 #endif
43 
44 #endif /* CH_HELPER_H_ */