MetaWear C++ API  0.20.0
C++ implementation of the MetaWear protocol
comparator.h
Go to the documentation of this file.
1 
6 #pragma once
7 
8 #include "processor_common.h"
9 
10 #ifdef __cplusplus
11 extern "C" {
12 #endif
13 
17 typedef enum {
25 
29 typedef enum {
35 
47  void *context, MblMwFnDataProcessor processor_created);
59  void *context, MblMwFnDataProcessor processor_created);
71  void *context, MblMwFnDataProcessor processor_created);
90  MblMwDataSignal *reference_signal);
104  float references[], uint8_t references_length, void *context, MblMwFnDataProcessor processor_created);
118  float references[], uint8_t references_length, void *context, MblMwFnDataProcessor processor_created);
132  float references[], uint8_t references_length, void *context, MblMwFnDataProcessor processor_created);
144  uint8_t references_length);
145 
146 #ifdef __cplusplus
147 }
148 #endif
MblMwComparatorMode
Output modes for the comparator, only supported in firmware v1.2.3 and higher.
Definition: comparator.h:29
@ MBL_MW_COMPARATOR_MODE_ABSOLUTE
Return the data as is.
Definition: comparator.h:30
@ MBL_MW_COMPARATOR_MODE_ZONE
Return the position of the reference value satisfying the comparison, n + 1 for not satisfied.
Definition: comparator.h:32
@ MBL_MW_COMPARATOR_MODE_BINARY
Return 1 if any reference values satisfy the comparison, 0 if none do.
Definition: comparator.h:33
@ MBL_MW_COMPARATOR_MODE_REFERENCE
Return the reference value for the satisfied comparison.
Definition: comparator.h:31
METAWEAR_API int32_t mbl_mw_dataprocessor_comparator_modify_signal(MblMwDataProcessor *comparator, MblMwComparatorOperation op, MblMwDataSignal *reference_signal)
Modifies the comparator processor for a feedback or feedforward loop.
METAWEAR_API int32_t mbl_mw_dataprocessor_multi_comparator_create(MblMwDataSignal *source, MblMwComparatorOperation op, MblMwComparatorMode mode, float references[], uint8_t references_length, void *context, MblMwFnDataProcessor processor_created)
Create a multi-value comparator where a signed/unsigned comparison is inferred.
METAWEAR_API int32_t mbl_mw_dataprocessor_multi_comparator_create_unsigned(MblMwDataSignal *source, MblMwComparatorOperation op, MblMwComparatorMode mode, float references[], uint8_t references_length, void *context, MblMwFnDataProcessor processor_created)
Create a multi-value comparator for unsigned comparisons.
METAWEAR_API int32_t mbl_mw_dataprocessor_comparator_create(MblMwDataSignal *source, MblMwComparatorOperation op, float reference, void *context, MblMwFnDataProcessor processor_created)
Create a comparator processor where signed/unsigned is inferred.
METAWEAR_API int32_t mbl_mw_dataprocessor_comparator_modify(MblMwDataProcessor *comparator, MblMwComparatorOperation op, float reference)
Modifies the comparator processor, changing the operation and reference value.
METAWEAR_API int32_t mbl_mw_dataprocessor_comparator_create_unsigned(MblMwDataSignal *source, MblMwComparatorOperation op, float reference, void *context, MblMwFnDataProcessor processor_created)
Create a comparator processor specifically for an unsigned comparison.
METAWEAR_API int32_t mbl_mw_dataprocessor_comparator_create_signed(MblMwDataSignal *source, MblMwComparatorOperation op, float reference, void *context, MblMwFnDataProcessor processor_created)
Create a comparator processor specifically for a signed comparison.
METAWEAR_API int32_t mbl_mw_dataprocessor_multi_comparator_modify(MblMwDataProcessor *comparator, MblMwComparatorOperation op, float references[], uint8_t references_length)
Modifies the multi-value comparator, changing the operation and reference values.
MblMwComparatorOperation
Available operations for the processor.
Definition: comparator.h:17
@ MBL_MW_COMPARATOR_OP_LT
Less than.
Definition: comparator.h:20
@ MBL_MW_COMPARATOR_OP_EQ
Equals to.
Definition: comparator.h:18
@ MBL_MW_COMPARATOR_OP_LTE
Less than or equals to.
Definition: comparator.h:21
@ MBL_MW_COMPARATOR_OP_GT
Greater than.
Definition: comparator.h:22
@ MBL_MW_COMPARATOR_OP_NEQ
Not equals to.
Definition: comparator.h:19
@ MBL_MW_COMPARATOR_OP_GTE
Greater than or equals to.
Definition: comparator.h:23
METAWEAR_API int32_t mbl_mw_dataprocessor_multi_comparator_create_signed(MblMwDataSignal *source, MblMwComparatorOperation op, MblMwComparatorMode mode, float references[], uint8_t references_length, void *context, MblMwFnDataProcessor processor_created)
Create a multi-value comparator for signed comparisons.
void(* MblMwFnDataProcessor)(void *context, MblMwDataProcessor *processor)
Definition for callback functions that accept an MblMwDataProcessor pointer.
Definition: dataprocessor_fwd.h:23
struct MblMwDataProcessor MblMwDataProcessor
Data signal from the on board data processor.
Definition: dataprocessor_fwd.h:15
struct MblMwDataSignal MblMwDataSignal
A event fired from the MetaWear board that also contains data.
Definition: datasignal_fwd.h:15
#define METAWEAR_API
Indicates the function should be exported to the symbol table
Definition: dllmarker.h:27