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.
|
|||||||||||||||
Parameters
[W]
|
Parameters | ||||||||||||||||
| 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.
|
|||||||||||||||
| Parameters | Parameters | ||||||||||||||||
Structures
GpioParams
| Description |
|
||||||||||||||||
| Parameter Name | Data Type | Description | |||||||||||||||
| Pin | u8 | GPIO pin number. | |||||||||||||||
| Mode | u8 enum |
How the pin state affects the trigger.
|
|||||||||||||||
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.
|
|||||||||
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. |
Parameters
| Description |
|
|
| Parameter Name | Data Type | Description |
| Gpio | GpioParams | |
| Threshold | ThresholdParams | |
| Combination | CombinationParams | |