Mux Class¶
- class MuxClass : public EntityClass¶
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 (multiplexor) 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).
Public Functions
- MuxClass()¶
Constructors.
- ~MuxClass()¶
Destructor.
- !MuxClass ()
Finalizer.
- void init (BrainStem2CLI::ModuleClass^ module, const unsigned char index)
Initializes the class. Should only be called when manually creating classes.
- Parameters:
pModule – The module.
index – The cmdMUX index to be addressed.
- aErr getEnable(unsigned char %bEnabled)¶
Get the mux enable/disable status
- Parameters:
bEnabled – true: mux is enabled, false: the mux is disabled.
- Returns:
Returns common entity return values
- aErr setEnable(const unsigned char bEnable)¶
Enable the mux.
- Parameters:
bEnable – true: enables the mux for the selected channel.
- Returns:
Returns common entity return values
- aErr getChannel(unsigned char %channel)¶
Get the current selected mux channel.
- Parameters:
channel – Indicates which chanel is selected.
- Returns:
Returns common entity return values
- aErr setChannel(const unsigned char channel)¶
Set the current mux channel.
- Parameters:
channel – mux channel to select.
- Returns:
Returns common entity return values
- aErr getChannelVoltage(const unsigned char channel, int %microvolts)¶
Get the voltage of the indicated mux channel.
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:
channel – The channel in which voltage was requested.
microvolts – 32 bit signed integer (in microvolts) based on the board’s ground and reference voltages.
- Returns:
Returns common entity return values
- aErr getConfiguration(int %config)¶
Get the configuration of the mux.
- Parameters:
config – integer representing the mux configuration either default, or split-mode.
- Returns:
Returns common entity return values
- aErr setConfiguration(const int config)¶
Set the configuration of the mux.
- Parameters:
config – integer representing the mux configuration either muxConfig_default, or muxConfig_splitMode.
- Returns:
Returns common entity return values
- aErr getSplitMode(int %splitMode)¶
Get the current mux mode.
- Parameters:
splitMode – integer representing the channel selection for each sub-channel within the mux. See the data-sheet for the device for specific information.
- Returns:
Returns common entity return values
- aErr setSplitMode(const int splitMode)¶
Set the current mux mode.
- Parameters:
splitMode – integer representing the channel selection for each sub-channel within the mux. See the data-sheet for the device for specific information.
- Returns:
Returns common entity return values