+/**
+ * Allocate a new trigger match and add it to the specified trigger stage.
+ *
+ * The caller is responsible to free the trigger (including all stages and
+ * matches) using sr_trigger_free() once it is no longer needed.
+ *
+ * @param stage The trigger stage to add the match to. Must not be NULL.
+ * @param ch The channel for this trigger match. Must not be NULL. Must be
+ * either of type SR_CHANNEL_LOGIC or SR_CHANNEL_ANALOG.
+ * @param trigger_match The type of trigger match. Must be a valid trigger
+ * type from enum sr_trigger_matches. The trigger type
+ * must be valid for the respective channel type as well.
+ * @param value Trigger value.
+ *
+ * @retval SR_OK Success.
+ * @retval SR_ERR_ARG Invalid argument(s) were passed to this functions.
+ *
+ * @since 0.4.0
+ */