Event Trigger Configuration (0x0C,0x2E)

Description

Configures various types of event triggers.

Notes
Parameter Name Data Type Description
Field Length u8 5
Descriptor u8 0x2E
Function Selector u8 This command supports the following MIP function selectors:
Write Read Save Load Default [WRSLD]
Instance [WRSLD] u8 Trigger number. When function is SAVE, LOAD, or DEFAULT, this can be 0 to apply to all instances.
Type [W] u8 enum Type of trigger to configure.
NameValueDescription
NONE0No trigger selected. The state will always be inactive.
GPIO1Trigger based on the state of a GPIO pin. See GpioParams.
THRESHOLD2Compare a data quantity against a high and low threshold. See ThresholdParams.
COMBINATION3Logical combination of two or more triggers. See CombinationParams.
[W]
Ack/Nack Reply See standard MIP ack/nack reply format.
Response Data Data Type Description
Response Length u8 4
Response Descriptor u8 0xB8
Instance u8 Trigger number. When function is SAVE, LOAD, or DEFAULT, this can be 0 to apply to all instances.
Type u8 enum Type of trigger to configure.
NameValueDescription
NONE0No trigger selected. The state will always be inactive.
GPIO1Trigger based on the state of a GPIO pin. See GpioParams.
THRESHOLD2Compare a data quantity against a high and low threshold. See ThresholdParams.
COMBINATION3Logical combination of two or more triggers. See CombinationParams.

Structures

GpioParams

Description

Parameter Name Data Type Description
Pin u8 GPIO pin number.
Mode u8 enum How the pin state affects the trigger.
NameValueDescription
DISABLED0The pin will have no effect and the trigger will never activate.
WHILE_HIGH1The trigger will be active while the pin is high.
WHILE_LOW2The trigger will be active while the pin is low.
EDGE4Use if the pin is configured for timestamping via the 3DM Gpio Configuration command (0x0C41).

ThresholdParams

Description

Comparison of a supported MIP field parameter against a set of thresholds.

Notes Triggers when a data quantity meets the comparison criteria. The comparison can be either a window comparison with high and low thresholds or a periodic interval. The data quantity is identified by the MIP descriptor set, field descriptor, and parameter number. E.g. Scaled acceleration in the Z direction is specified with desc_set=0x80 (sensor data), field_desc=0x04 (scaled accel), and param_id=3 (the third parameter and Z axis). The window comparison can be used for a variety of purposes, such as disabling a robot's drive motors if it tips over. In this case, a window comparison could be set up to monitor the roll angle, (0x80,0x0C,3). The lower threshold would be set to -pi/2 radians and the upper threshold to pi/2 radians. The interval trigger can be used to perform an action periodically if used with a time field. E.g. to execute the action every 16 ms, set an interval comparison on the GPS time of week parameter (0x80,0xD3,1) with high_thres set to 0.016. The lower threshold determines how long the trigger is active within the 16-ms period. Either comparison type can be inverted by reversing the threshold values; setting low_thres > high_thres will result in the reverse condition.
Parameter Name Data Type Description
Desc Set u8 Descriptor set of target data quantity.
Field Desc u8 Field descriptor of target data quantity.
Param Id u8 1-based index of the target parameter within the MIP field. E.g. for Scaled Accel (0x80,0x04) a value of 2 would represent the Y axis.
Type u8 enum Determines the type of comparison.
NameValueDescription
WINDOW1Window comparison. Trigger is active if low_thres <= value <= high_thres. If the thresholds are reversed, the trigger is active when value < high_thres or value > low_thres.
INTERVAL2Trigger at evenly-spaced intervals. Normally used with time fields to trigger periodically. Trigger is active when (value % interval) <= int_thres. If the thresholds are reversed (high_thres < low_thres) then the trigger is active when (value % low_thres) > high_thres.

CombinationParams

Description

Parameter Name Data Type Description
Logic Table u16 The last column of a truth table describing the output given the state of each input.
Input Triggers u8[4] List of trigger IDs for inputs. Use 0 for unused inputs.