MIP_SDK  latest-2-g34f3e39
MicroStrain Communications Library for embedded systems
commands_system.h
Go to the documentation of this file.
1 #pragma once
2 
4 #include <mip/mip_descriptors.h>
5 #include <mip/mip_result.h>
6 #include <mip/mip_interface.h>
7 
8 #include <stdint.h>
9 #include <stddef.h>
10 #include <stdbool.h>
11 
12 #ifdef __cplusplus
13 namespace mip {
14 namespace C {
15 extern "C" {
16 
17 #endif // __cplusplus
18 
25 
27 // Descriptors
29 
30 enum
31 {
33 
39 
44 };
45 
47 // Shared Type Definitions
49 
55 {
63 };
65 
66 static inline void insert_mip_comms_interface(microstrain_serializer* serializer, const mip_comms_interface self)
67 {
68  microstrain_insert_u8(serializer, (uint8_t)(self));
69 }
70 static inline void extract_mip_comms_interface(microstrain_serializer* serializer, mip_comms_interface* self)
71 {
72  uint8_t tmp = 0;
73  microstrain_extract_u8(serializer, &tmp);
74  *self = tmp;
75 }
76 
77 typedef uint32_t mip_comms_protocol;
78 static const mip_comms_protocol MIP_COMMS_PROTOCOL_NONE = 0x00000000;
79 static const mip_comms_protocol MIP_COMMS_PROTOCOL_MIP_COMMANDS = 0x00000001;
80 static const mip_comms_protocol MIP_COMMS_PROTOCOL_MIP_DATA = 0x00000002;
81 static const mip_comms_protocol MIP_COMMS_PROTOCOL_NMEA = 0x00000004;
82 static const mip_comms_protocol MIP_COMMS_PROTOCOL_RTCM = 0x00000008;
83 static const mip_comms_protocol MIP_COMMS_PROTOCOL_SPARTN = 0x00000010;
84 static const mip_comms_protocol MIP_COMMS_PROTOCOL_ALL = 0x0000001F;
85 static inline void insert_mip_comms_protocol(microstrain_serializer* serializer, const mip_comms_protocol self)
86 {
87  microstrain_insert_u32(serializer, (uint32_t)(self));
88 }
89 static inline void extract_mip_comms_protocol(microstrain_serializer* serializer, mip_comms_protocol* self)
90 {
91  uint32_t tmp = 0;
92  microstrain_extract_u32(serializer, &tmp);
93  *self = tmp;
94 }
95 
96 
98 // Mip Fields
100 
114 
116 {
118  uint8_t mode;
119 };
121 
124 
126 {
127  uint8_t mode;
128 };
130 
133 
135 mip_cmd_result mip_system_read_comm_mode(mip_interface* device, uint8_t* mode_out);
137 
158 
160 {
165 };
167 
170 
172 {
176 };
178 
181 
183 mip_cmd_result mip_system_read_interface_control(mip_interface* device, mip_comms_interface port, mip_comms_protocol* protocols_incoming_out, mip_comms_protocol* protocols_outgoing_out);
187 
190 
195 #ifdef __cplusplus
196 } // extern "C"
197 } // namespace C
198 } // namespace mip
199 #endif // __cplusplus
200 
mip
A collection of C++ classes and functions covering the full mip api.
Definition: commands_3dm.c:11
mip::C::mip_system_read_comm_mode
mip_cmd_result mip_system_read_comm_mode(mip_interface *device, uint8_t *mode_out)
Definition: commands_system.c:68
mip::C::mip_comms_protocol
uint32_t mip_comms_protocol
Definition: commands_system.h:77
mip::C::mip_comms_interface
mip_comms_interface
Definition: commands_system.h:54
mip::C::extract_mip_system_interface_control_command
void extract_mip_system_interface_control_command(microstrain_serializer *serializer, mip_system_interface_control_command *self)
Definition: commands_system.c:120
mip::C::MIP_COMMS_INTERFACE_UART_3
@ MIP_COMMS_INTERFACE_UART_3
Definition: commands_system.h:60
mip::C::mip_cmd_result
mip_cmd_result
Represents the status of a MIP command.
Definition: mip_result.h:27
mip::C::MIP_COMMS_INTERFACE_UART_1
@ MIP_COMMS_INTERFACE_UART_1
Depending on your device, this may mean either the first UART currently configured,...
Definition: commands_system.h:58
mip::C::MIP_SYSTEM_COMMAND_COMM_MODE_GPS
@ MIP_SYSTEM_COMMAND_COMM_MODE_GPS
Definition: commands_system.h:53
mip::C::mip_system_default_comm_mode
mip_cmd_result mip_system_default_comm_mode(mip_interface *device)
Definition: commands_system.c:94
mip::C::MIP_REPLY_DESC_SYSTEM_HARDWARE_CONTROL_2
@ MIP_REPLY_DESC_SYSTEM_HARDWARE_CONTROL_2
Definition: commands_system.h:42
microstrain::C::microstrain_extract_u32
void microstrain_extract_u32(microstrain_serializer *serializer, uint32_t *value)
mip::C::mip_system_read_interface_control
mip_cmd_result mip_system_read_interface_control(mip_interface *device, mip_comms_interface port, mip_comms_protocol *protocols_incoming_out, mip_comms_protocol *protocols_outgoing_out)
Definition: commands_system.c:172
mip::C::insert_mip_system_comm_mode_response
void insert_mip_system_comm_mode_response(microstrain_serializer *serializer, const mip_system_comm_mode_response *self)
Definition: commands_system.c:43
mip::C::MIP_SYSTEM_COMMAND_COMM_MODE_IMU
@ MIP_SYSTEM_COMMAND_COMM_MODE_IMU
Definition: commands_system.h:52
mip::C::extract_mip_system_interface_control_response
void extract_mip_system_interface_control_response(microstrain_serializer *serializer, mip_system_interface_control_response *self)
Definition: commands_system.c:144
microstrain::C::microstrain_serializer
struct microstrain::C::microstrain_serializer microstrain_serializer
Structure used for serialization.
mip::C::mip_system_comm_mode_command
Definition: commands_system.h:115
mip::C::mip_system_comm_mode_response
Definition: commands_system.h:125
mip::C::mip_system_default_interface_control
mip_cmd_result mip_system_default_interface_control(mip_interface *device, mip_comms_interface port)
Definition: commands_system.c:233
mip_result.h
mip::C::extract_mip_system_comm_mode_command
void extract_mip_system_comm_mode_command(microstrain_serializer *serializer, mip_system_comm_mode_command *self)
Definition: commands_system.c:32
microstrain::C::microstrain_extract_u8
void microstrain_extract_u8(microstrain_serializer *serializer, uint8_t *value)
mip::C::MIP_SYSTEM_COMMAND_COMM_MODE_PASSTHRU
@ MIP_SYSTEM_COMMAND_COMM_MODE_PASSTHRU
Definition: commands_system.h:50
microstrain::C::microstrain_insert_u32
void microstrain_insert_u32(microstrain_serializer *serializer, uint32_t value)
mip::C::insert_mip_system_interface_control_command
void insert_mip_system_interface_control_command(microstrain_serializer *serializer, const mip_system_interface_control_command *self)
Definition: commands_system.c:106
mip::C::mip_system_interface_control_response::port
mip_comms_interface port
Which physical interface is being selected (USB, serial, etc)
Definition: commands_system.h:173
microstrain::C::microstrain_serializer
Structure used for serialization.
Definition: serialization.h:42
mip::C::MIP_CMD_DESC_SYSTEM_HARDWARE_CONTROL_2
@ MIP_CMD_DESC_SYSTEM_HARDWARE_CONTROL_2
Definition: commands_system.h:38
mip::C::mip_system_comm_mode_command::mode
uint8_t mode
Definition: commands_system.h:118
microstrain::C::microstrain_insert_u8
void microstrain_insert_u8(microstrain_serializer *serializer, uint8_t value)
mip::C::MIP_SYSTEM_COMMAND_COMM_MODE_NORMAL
@ MIP_SYSTEM_COMMAND_COMM_MODE_NORMAL
Definition: commands_system.h:51
mip::C::mip_system_interface_control_command
Definition: commands_system.h:159
mip::C::MIP_COMMS_INTERFACE_ALL
@ MIP_COMMS_INTERFACE_ALL
Definition: commands_system.h:56
mip::C::MIP_REPLY_DESC_SYSTEM_INTERFACE_CONTROL
@ MIP_REPLY_DESC_SYSTEM_INTERFACE_CONTROL
Definition: commands_system.h:43
mip::C::MIP_COMMS_INTERFACE_UART_2
@ MIP_COMMS_INTERFACE_UART_2
Definition: commands_system.h:59
mip::C::MIP_COMMS_INTERFACE_MAIN
@ MIP_COMMS_INTERFACE_MAIN
An alias that directs to Main USB if it's connected, or Main UART otherwise.
Definition: commands_system.h:57
mip::C::mip_system_interface_control_command::port
mip_comms_interface port
Which physical interface is being selected (USB, serial, etc)
Definition: commands_system.h:162
mip::C::mip_system_write_interface_control
mip_cmd_result mip_system_write_interface_control(mip_interface *device, mip_comms_interface port, mip_comms_protocol protocols_incoming, mip_comms_protocol protocols_outgoing)
Definition: commands_system.c:154
mip::C::mip_system_interface_control_command::protocols_incoming
mip_comms_protocol protocols_incoming
Input protocol(s) the port will accept. If the protocol supports ACK/NACK or detailed responses,...
Definition: commands_system.h:163
mip::C::mip_interface
State of the interface for communicating with a MIP device.
Definition: mip_interface.h:44
mip::C::MIP_CMD_DESC_SYSTEM_COM_MODE
@ MIP_CMD_DESC_SYSTEM_COM_MODE
Definition: commands_system.h:36
mip::C::extract_mip_system_comm_mode_response
void extract_mip_system_comm_mode_response(microstrain_serializer *serializer, mip_system_comm_mode_response *self)
Definition: commands_system.c:48
mip::C::mip_system_interface_control_command::protocols_outgoing
mip_comms_protocol protocols_outgoing
Data protocol(s) the port will output.
Definition: commands_system.h:164
mip_interface.h
common.h
mip::C::mip_system_interface_control_response::protocols_outgoing
mip_comms_protocol protocols_outgoing
Data protocol(s) the port will output.
Definition: commands_system.h:175
mip::C::MIP_COMMS_INTERFACE_USB_1
@ MIP_COMMS_INTERFACE_USB_1
The first virtual serial port over USB (ie. COM5)
Definition: commands_system.h:61
mip::C::insert_mip_system_interface_control_response
void insert_mip_system_interface_control_response(microstrain_serializer *serializer, const mip_system_interface_control_response *self)
Definition: commands_system.c:135
mip_descriptors.h
mip::C::MIP_CMD_DESC_SYSTEM_INTERFACE_CONTROL
@ MIP_CMD_DESC_SYSTEM_INTERFACE_CONTROL
Definition: commands_system.h:35
mip::C::mip_system_interface_control_response
Definition: commands_system.h:171
mip::C::mip_system_load_interface_control
mip_cmd_result mip_system_load_interface_control(mip_interface *device, mip_comms_interface port)
Definition: commands_system.c:219
mip::C::MIP_SYSTEM_CMD_DESC_SET
@ MIP_SYSTEM_CMD_DESC_SET
Definition: commands_system.h:32
mip::C::insert_mip_system_comm_mode_command
void insert_mip_system_comm_mode_command(microstrain_serializer *serializer, const mip_system_comm_mode_command *self)
Definition: commands_system.c:22
mip::C::MIP_CMD_DESC_MIPNET_ENUMERATE
@ MIP_CMD_DESC_MIPNET_ENUMERATE
Definition: commands_system.h:34
mip::C::MIP_COMMS_INTERFACE_USB_2
@ MIP_COMMS_INTERFACE_USB_2
The second virtual serial port over USB (ie. COM6), only available on GNSS/INS devices....
Definition: commands_system.h:62
mip::C::mip_system_write_comm_mode
mip_cmd_result mip_system_write_comm_mode(mip_interface *device, uint8_t mode)
Definition: commands_system.c:54
mip::C::mip_system_comm_mode_response::mode
uint8_t mode
Definition: commands_system.h:127
mip::C::mip_function_selector
mip_function_selector
Definition: mip_descriptors.h:42
mip::C::MIP_REPLY_DESC_SYSTEM_COM_MODE
@ MIP_REPLY_DESC_SYSTEM_COM_MODE
Definition: commands_system.h:40
mip::C::mip_system_save_interface_control
mip_cmd_result mip_system_save_interface_control(mip_interface *device, mip_comms_interface port)
Definition: commands_system.c:205
mip::C::MIP_CMD_DESC_SYSTEM_HARDWARE_CONTROL
@ MIP_CMD_DESC_SYSTEM_HARDWARE_CONTROL
Definition: commands_system.h:37
mip::C::MIP_REPLY_DESC_SYSTEM_HARDWARE_CONTROL
@ MIP_REPLY_DESC_SYSTEM_HARDWARE_CONTROL
Definition: commands_system.h:41
mip::C::mip_system_interface_control_response::protocols_incoming
mip_comms_protocol protocols_incoming
Input protocol(s) the port will accept. If the protocol supports ACK/NACK or detailed responses,...
Definition: commands_system.h:174