libeismultiplexer 1.0.x
Data Structures | Enumerations | Functions
User API

API to control EISmultiplexer devices. More...

Data Structures

struct  eismultiplexer
 

Enumerations

enum  channel_t {
  CHANNEL_A = (1 << 0) , CHANNEL_B = (1 << 1) , CHANNEL_C = (1 << 2) , CHANNEL_D = (1 << 3) ,
  CHANNEL_E = (1 << 4) , CHANNEL_F = (1 << 5) , CHANNEL_G = (1 << 6) , CHANNEL_NONE = 0
}
 

Functions

int eismultiplexer_connect (struct eismultiplexer *muliplexer, uint16_t serial)
 Attempts to connect to a EISmultiplexer device and initializes a eismultiplexer struct.
 
int eismultiplexer_connect_channel (struct eismultiplexer *muliplexer, channel_t channel)
 Connects the given channel(s) to the common inputs.
 
int eismultiplexer_connect_channel_exclusive (struct eismultiplexer *muliplexer, channel_t channel)
 Connects the given channel(s) to the common inputs disconnecting all others.
 
int eismultiplexer_disconnect_channel (struct eismultiplexer *muliplexer, channel_t channel)
 Disconnect the given channel(s) to the common inputs disconnecting all others.
 
channel_t eismultiplexer_get_connected (struct eismultiplexer *muliplexer)
 Returns the channels currently connected.
 
int eismultiplexer_set_led (struct eismultiplexer *muliplexer, bool on)
 Turns the led on the PCB on or off.
 
void eismultiplexer_disconnect (struct eismultiplexer *muliplexer)
 Disconnects from the eismultiplexer.
 
int eismultiplexer_write_eeprom (struct eismultiplexer *muliplexer, uint16_t addr, uint16_t value)
 
uint16_t eismultiplexer_read_eeprom (struct eismultiplexer *muliplexer, uint16_t addr)
 

Detailed Description

API to control EISmultiplexer devices.

This API allows you to control the EISmultiplexer device.

Function Documentation

◆ eismultiplexer_connect()

int eismultiplexer_connect ( struct eismultiplexer muliplexer,
uint16_t  serial 
)

Attempts to connect to a EISmultiplexer device and initializes a eismultiplexer struct.

Parameters
multiplexerpointer to a eismultiplexer struct to initialize
serialThe serial number of the device to connect to, or 0 for any
Returns
0 on success and < 0 on failure

◆ eismultiplexer_connect_channel()

int eismultiplexer_connect_channel ( struct eismultiplexer muliplexer,
channel_t  channel 
)

Connects the given channel(s) to the common inputs.

Parameters
multiplexerpointer to a eismultiplexer struct
channelA channel to connect, multiple channels can be specified by or'ing together the channel flags e.g. (CHANNEL_A | CHANNEL_B)
Returns
0 on success and < 0 on failure

◆ eismultiplexer_connect_channel_exclusive()

int eismultiplexer_connect_channel_exclusive ( struct eismultiplexer muliplexer,
channel_t  channel 
)

Connects the given channel(s) to the common inputs disconnecting all others.

Parameters
multiplexerpointer to a eismultiplexer struct
channelA channel to connect, multiple channels can be specified by or'ing together the channel flags e.g. (CHANNEL_A | CHANNEL_B)
Returns
0 on success and < 0 on failure

◆ eismultiplexer_disconnect_channel()

int eismultiplexer_disconnect_channel ( struct eismultiplexer muliplexer,
channel_t  channel 
)

Disconnect the given channel(s) to the common inputs disconnecting all others.

Parameters
multiplexerpointer to a eismultiplexer struct
channelA channel to connect, multiple channels can be specified by or'ing together the channel flags e.g. (CHANNEL_A | CHANNEL_B) All channels can be disconnected by passing CHANNEL_NONE
Returns
0 on success and < 0 on failure

◆ eismultiplexer_get_connected()

channel_t eismultiplexer_get_connected ( struct eismultiplexer muliplexer)

Returns the channels currently connected.

Parameters
multiplexerpointer to a eismultiplexer struct
Returns
channels connected as a bitfield

◆ eismultiplexer_set_led()

int eismultiplexer_set_led ( struct eismultiplexer muliplexer,
bool  on 
)

Turns the led on the PCB on or off.

Parameters
multiplexerpointer to a eismultiplexer struct
ontrue to turn the led on, false to turn it off
Returns
0 on success and < 0 on failure