API to control EISmultiplexer devices.
More...
|
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
} |
|
API to control EISmultiplexer devices.
This API allows you to control the EISmultiplexer device.
◆ eismultiplexer_connect()
int eismultiplexer_connect |
( |
struct eismultiplexer * |
muliplexer, |
|
|
uint16_t |
serial |
|
) |
| |
Attempts to connect to a EISmultiplexer device and initializes a eismultiplexer struct.
- Parameters
-
multiplexer | pointer to a eismultiplexer struct to initialize |
serial | The 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
-
multiplexer | pointer to a eismultiplexer struct |
channel | A 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
-
multiplexer | pointer to a eismultiplexer struct |
channel | A 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
-
multiplexer | pointer to a eismultiplexer struct |
channel | A 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
-
multiplexer | pointer 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
-
multiplexer | pointer to a eismultiplexer struct |
on | true to turn the led on, false to turn it off |
- Returns
- 0 on success and < 0 on failure