Data Sheet
UM7 DATASHEET
Rev. 1.6 – Released 1/10/2016
34
Command Operations
There are a variety of register address that do not correspond with actual physical registers
aboard the UM7. These "command" addresses are used to cause the sensor to execute specific
commands (there are commands for executing calibration operations, resetting the onboard
filters, etc. See the Register Overview in this document for more details).
To initiate a command, simply send a packet to the autopilot with the command's address in
the packet "Address" byte. The PT byte should be set to zero for a command operation.
If the UM7 successfully completes the specified command, then a COMMAND_COMPLETE
packet is returned with the command address in the "Address" byte of the response packet. If
the command fails, the device responds by sending a COMMAND_FAILED packet. The
COMMAND_FAILED packet is equivalent to the COMMAND_COMPLETE packet except that the
"Command Failed" bit in the PT byte is set (CF = 1).
In some cases, a command will cause specific packets to be sent other than the
COMMAND_COMPLETE packet. A GET_FW_VERSION command will, for example, return a
packet containing the version of the firmware installed on the UM7. In this and similar cases,
the COMMAND_COMPLETE packet is not sent.
Example Binary Communication Code
RECEIVING DATA FROM THE UM7
There are a lot of ways to parse the incoming data from the UM7. Often, it is easiest to write a
generalized parser that takes all incoming data and extracts the data, address, and packet type
information and then makes it easily accessible to the user program. The following code shows
an example of a good general parser that can be used to extract packet data.
// Structure for holding received packet information
typedef struct UM7_packet_struct
{
uint8_t Address;
uint8_t PT;
uint16_t Checksum;