Mux Entity

group MuxEntity

MuxClass: 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

Returns common entity return values

Parameters:
  • id – ID assigned through “module_createStem”

  • result – Object containing aErrNone and the requested value on success. Non-zero error code on failure. true: mux is enabled, false: the mux is disabled.

  • index – The index of the entity in question.

void mux_setEnable(unsigned int *id, struct Result *result, const int index, const unsigned char bEnable)

Enable the mux.

Returns common entity return values

Parameters:
  • id – ID assigned through “module_createStem”

  • result – Object containing aErrNone on success. Non-zero error code on failure.

  • index – The index of the entity in question.

  • bEnable – 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.

Returns common entity return values

Parameters:
  • id – ID assigned through “module_createStem”

  • result – Object containing aErrNone and the requested value on success. Non-zero error code on failure. Indicates which chanel is selected.

  • 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.

Returns common entity return values

Parameters:
  • id – ID assigned through “module_createStem”

  • result – Object containing aErrNone on success. Non-zero error code on failure.

  • 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.

Returns common entity return values

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 – Object containing aErrNone and the requested value on success. Non-zero error code on failure. 32 bit signed integer (in microvolts) based on the board’s ground and reference voltages.

  • 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.

Returns common entity return values

Parameters:
  • id – ID assigned through “module_createStem”

  • result – Object containing aErrNone and the requested value on success. Non-zero error code on failure. integer representing the mux configuration either default, or split-mode.

  • 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.

Returns common entity return values

Parameters:
  • id – ID assigned through “module_createStem”

  • result – Object containing aErrNone on success. Non-zero error code on failure.

  • 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.

Returns common entity return values

Parameters:
  • id – ID assigned through “module_createStem”

  • result – Object containing aErrNone and the requested value on success. Non-zero error code on failure. integer representing the channel selection for each sub-channel within the mux. See the data-sheet for the device for specific information.

  • 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.

Returns common entity return values

Parameters:
  • id – ID assigned through “module_createStem”

  • result – Object containing aErrNone on success. Non-zero error code on failure.

  • 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.