MetaWear C++ API
0.20.0
C++ implementation of the MetaWear protocol
|
Performs arithmetic on sensor data. More...
#include "processor_common.h"
Go to the source code of this file.
Enumerations | |
enum | MblMwMathOperation { MBL_MW_MATH_OP_ADD = 1 , MBL_MW_MATH_OP_MULTIPLY , MBL_MW_MATH_OP_DIVIDE , MBL_MW_MATH_OP_MODULUS , MBL_MW_MATH_OP_EXPONENT , MBL_MW_MATH_OP_SQRT , MBL_MW_MATH_OP_LSHIFT , MBL_MW_MATH_OP_RSHIFT , MBL_MW_MATH_OP_SUBTRACT , MBL_MW_MATH_OP_ABS_VALUE , MBL_MW_MATH_OP_CONSTANT } |
Available operations for the math processor. More... | |
Functions | |
METAWEAR_API int32_t | mbl_mw_dataprocessor_math_create (MblMwDataSignal *source, MblMwMathOperation op, float rhs, void *context, MblMwFnDataProcessor processor_created) |
Create a math processor where signed/unsigned operation is inferred. More... | |
METAWEAR_API int32_t | mbl_mw_dataprocessor_math_create_signed (MblMwDataSignal *source, MblMwMathOperation op, float rhs, void *context, MblMwFnDataProcessor processor_created) |
Create a math processor using signed operations. More... | |
METAWEAR_API int32_t | mbl_mw_dataprocessor_math_create_unsigned (MblMwDataSignal *source, MblMwMathOperation op, float rhs, void *context, MblMwFnDataProcessor processor_created) |
Create a math processor using unsigned operations. More... | |
METAWEAR_API int32_t | mbl_mw_dataprocessor_math_modify_rhs (MblMwDataProcessor *math, float rhs) |
Modify the configuration of a math processor, changing the right side value of the operation. More... | |
METAWEAR_API int32_t | mbl_mw_dataprocessor_math_modify_rhs_signal (MblMwDataProcessor *math, MblMwDataSignal *rhs_signal) |
Modify the configuration of a math processor for a feedback or feedforward loop. More... | |
Performs arithmetic on sensor data.
enum MblMwMathOperation |
Available operations for the math processor.
METAWEAR_API int32_t mbl_mw_dataprocessor_math_create | ( | MblMwDataSignal * | source, |
MblMwMathOperation | op, | ||
float | rhs, | ||
void * | context, | ||
MblMwFnDataProcessor | processor_created | ||
) |
Create a math processor where signed/unsigned operation is inferred.
Performs simple arithmetic on sensor data. See MblMwMathOperation for allowed ops. A pointer representing the processor will be passed back to the user via a callback function.
source | Data signal providing the input for the processor |
op | Math operation to compute |
rhs | Right hand side of the operation that requires 2 inputs |
context | Pointer to additional data for the callback function |
processor_created | Callback function to be executed when the processor is created |
METAWEAR_API int32_t mbl_mw_dataprocessor_math_create_signed | ( | MblMwDataSignal * | source, |
MblMwMathOperation | op, | ||
float | rhs, | ||
void * | context, | ||
MblMwFnDataProcessor | processor_created | ||
) |
Create a math processor using signed operations.
Performs simple arithmetic on sensor data. See MblMwMathOperation for allowed ops. A pointer representing the processor will be passed back to the user via a callback function.
source | Data signal providing the input for the processor |
op | Math operation to compute |
rhs | Right hand side of the operation that requires 2 inputs |
context | Pointer to additional data for the callback function |
processor_created | Callback function to be executed when the processor is created |
METAWEAR_API int32_t mbl_mw_dataprocessor_math_create_unsigned | ( | MblMwDataSignal * | source, |
MblMwMathOperation | op, | ||
float | rhs, | ||
void * | context, | ||
MblMwFnDataProcessor | processor_created | ||
) |
Create a math processor using unsigned operations.
Performs simple arithmetic on sensor data. See MblMwMathOperation for allowed ops. A pointer representing the processor will be passed back to the user via a callback function.
source | Data signal providing the input for the processor |
op | Math operation to compute |
rhs | Right hand side of the operation that requires 2 inputs |
context | Pointer to additional data for the callback function |
processor_created | Callback function to be executed when the processor is created |
METAWEAR_API int32_t mbl_mw_dataprocessor_math_modify_rhs | ( | MblMwDataProcessor * | math, |
float | rhs | ||
) |
Modify the configuration of a math processor, changing the right side value of the operation.
math | Math processor to modify |
rhs | New right hand side of the operation |
METAWEAR_API int32_t mbl_mw_dataprocessor_math_modify_rhs_signal | ( | MblMwDataProcessor * | math, |
MblMwDataSignal * | rhs_signal | ||
) |
Modify the configuration of a math processor for a feedback or feedforward loop.
math | Math processor to modify |
rhs_signal | Data signal supplying the rhs value of the operation |