Data Gator
Hardware and software documentation for the Data Gator project.
Loading...
Searching...
No Matches
MUX_74HC40520 Class Reference

Defines a firmware interface for the 74HC40520 multiplexer. More...

#include <74HC40520.hpp>

Public Types

enum  Mux_Channel { X , Y }
 Defines the two MUX signal channels X and Y. More...
 

Public Member Functions

void setPins (int mux_inh, int mux_a, int mux_b)
 Sets the output level of the two selector pins (A&B) and the inhibitor pin and stores the pin values.
 
void select (int channel)
 Select the channels to connect to the X and Y output pins.
 
int readChannel (int pin)
 Reads the analog value at the channel.
 
void writeChannel (int pin, int value)
 Writes a channel.
 

Private Attributes

uint8_t mux_inh
 
uint8_t mux_a
 
uint8_t mux_b
 

Detailed Description

Defines a firmware interface for the 74HC40520 multiplexer.

Chip Pin Truth Table

MUX_INH B A Selected Channels
L L L 0X, 0Y
L L H 1X, 1Y
L H L 2X, 2Y
L H H 3X, 3Y
H X X XXXXXX

Member Enumeration Documentation

◆ Mux_Channel

Defines the two MUX signal channels X and Y.

Use these channesl to select which channel you want to write or read a value to/from.

Enumerator

X channel.

Y channel.

Member Function Documentation

◆ readChannel()

int MUX_74HC40520::readChannel ( int  pin)
inline

Reads the analog value at the channel.

Parameters
[in]outputChannelThe output channel, can be enum Mux_Channel

◆ select()

void MUX_74HC40520::select ( int  channel)
inline

Select the channels to connect to the X and Y output pins.

Parameters
[in]channelThe channel

◆ setPins()

void MUX_74HC40520::setPins ( int  mux_inh,
int  mux_a,
int  mux_b 
)
inline

Sets the output level of the two selector pins (A&B) and the inhibitor pin and stores the pin values.

Parameters
[in]mux_inhThe multiplexer inhibitor pin, if HIGH no channel is connected to X/Y pins.
[in]mux_aThe multiplexer a selector pin
[in]mux_bThe multiplexer b selector pin

◆ writeChannel()

void MUX_74HC40520::writeChannel ( int  pin,
int  value 
)
inline

Writes a channel.

Parameters
[in]inputChannelThe input channel
[in]valueThe integer value to write to the pin, HIGH or LOW.

The documentation for this class was generated from the following file: