Mux Entity¶
See the Mux Entity for generic information.
- group MuxEntity
A MUX is a multiplexer that takes one or more similar inputs (bus, connection, or signal) and allows switching to one or more outputs. An analogy would be the switchboard of a telephone operator. Calls (inputs) come in and by re-connecting the input to an output, the operator (multiplexer) can direct that input to on or more outputs. One possible output is to not connect the input to anything which essentially disables that input’s connection to anything. Not every MUX has multiple inputs; some may simply be a single input that can be enabled (connected to a single output) or disabled (not connected to anything).
-
void mux_getEnable(unsigned int *id, struct Result *result, const int index)¶
Get the mux enable/disable status
The result parameter will output the following fields:
error: Common EntityClass Return Values common entity return value
value: true: mux is enabled, false: the mux is disabled.
- Parameters:
id – ID assigned through “module_createStem”
result – Output object containing result code and the requested value if successful.
index – The index of the entity in question.
-
void mux_setEnable(unsigned int *id, struct Result *result, const int index, const unsigned char enable)¶
Enable the mux.
The result parameter will output the following fields:
error: Common EntityClass Return Values common entity return value
- Parameters:
id – ID assigned through “module_createStem”
result – Output object containing result code.
index – The index of the entity in question.
enable – true: enables the mux for the selected channel.
-
void mux_getChannel(unsigned int *id, struct Result *result, const int index)¶
Get the current selected mux channel.
The result parameter will output the following fields:
error: Common EntityClass Return Values common entity return value
value: Indicates which chanel is selected.
- Parameters:
id – ID assigned through “module_createStem”
result – Output object containing result code and the requested value if successful.
index – The index of the entity in question.
-
void mux_setChannel(unsigned int *id, struct Result *result, const int index, const unsigned char channel)¶
Set the current mux channel.
The result parameter will output the following fields:
error: Common EntityClass Return Values common entity return value
- Parameters:
id – ID assigned through “module_createStem”
result – Output object containing result code.
index – The index of the entity in question.
channel – mux channel to select.
-
void mux_getChannelVoltage(unsigned int *id, struct Result *result, const int index, const unsigned char channel)¶
Get the voltage of the indicated mux channel.
The result parameter will output the following fields:
error: Common EntityClass Return Values common entity return value
value: 32 bit signed integer (in microvolts) based on the board’s ground and reference voltages.
Note
Not all modules provide 32 bits of accuracy; Refer to the module’s datasheet to determine the analog bit depth and reference voltage.
- Parameters:
id – ID assigned through “module_createStem”
result – Output object containing result code and the requested value if successful.
index – The index of the entity in question.
channel – The channel in which voltage was requested.
-
void mux_getConfiguration(unsigned int *id, struct Result *result, const int index)¶
Get the configuration of the mux.
The result parameter will output the following fields:
error: Common EntityClass Return Values common entity return value
value: integer representing the mux configuration either default, or split-mode.
- Parameters:
id – ID assigned through “module_createStem”
result – Output object containing result code and the requested value if successful.
index – The index of the entity in question.
-
void mux_setConfiguration(unsigned int *id, struct Result *result, const int index, const int config)¶
Set the configuration of the mux.
The result parameter will output the following fields:
error: Common EntityClass Return Values common entity return value
- Parameters:
id – ID assigned through “module_createStem”
result – Output object containing result code.
index – The index of the entity in question.
config – integer representing the mux configuration either muxConfig_default, or muxConfig_splitMode.
-
void mux_getSplitMode(unsigned int *id, struct Result *result, const int index)¶
Get the current split mode mux configuration.
The result parameter will output the following fields:
error: Common EntityClass Return Values common entity return value
value: integer representing the channel selection for each sub-channel within the mux. See the data-sheet for the device for specific information.
- Parameters:
id – ID assigned through “module_createStem”
result – Output object containing result code and the requested value if successful.
index – The index of the entity in question.
-
void mux_setSplitMode(unsigned int *id, struct Result *result, const int index, const int splitMode)¶
Sets the mux’s split mode configuration.
The result parameter will output the following fields:
error: Common EntityClass Return Values common entity return value
- Parameters:
id – ID assigned through “module_createStem”
result – Output object containing result code.
index – The index of the entity in question.
splitMode – integer representing the channel selection for each sub-channel within the mux. See the data-sheet for the device for specific information.