|
libeismultiplexer 1.6.4
|
API to control EISmultiplexer devices. More...
Data Structures | |
| struct | eismultiplexer |
Functions | |
| uint16_t * | eismultiplexer_list_available_devices (size_t *count) |
| Lists the available eismultiplexer devices. | |
| int | eismultiplexer_connect (struct eismultiplexer *muliplexer, uint16_t serial) |
| Attempts to connect to a EISmultiplexer device and initializes a eismultiplexer struct. | |
| void | eismultiplexer_register_disconnect_callback (struct eismultiplexer *muliplexer, void(*deviceDisconnectedCb)(struct eismultiplexer *muliplexer, void *user_data), void *user_data) |
| Registers a callback that will be called when the device disconnects, the callback is called from a different thread and must be thread-safe. | |
| 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. | |
| int | eismultiplexer_set_trigger_state (struct eismultiplexer *muliplexer, uint16_t index, trigger_state_t state) |
| Sets the state of the trigger pin. | |
| int | eismultiplexer_get_trigger_state (struct eismultiplexer *muliplexer, uint16_t index, trigger_state_t *state, bool *level) |
| Gets the logic level and state of the trigger pin. | |
| int | eismultiplexer_wait_trigger (struct eismultiplexer *muliplexer, uint16_t index, trigger_wait_t wait, uint64_t timeout) |
| Sets the state of the trigger pin. | |
| int | eismultiplexer_get_trigger_count (struct eismultiplexer *muliplexer) |
| gets the nummber of trigger pins available on the device | |
| int | eismultiplexer_get_channel_count (struct eismultiplexer *muliplexer, uint16_t *count) |
| Gets the number of channels on the device. | |
| 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) |
API to control EISmultiplexer devices.
This API allows you to control the EISmultiplexer device.
| int eismultiplexer_connect | ( | struct eismultiplexer * | muliplexer, |
| uint16_t | serial | ||
| ) |
Attempts to connect to a EISmultiplexer device and initializes a eismultiplexer struct.
| multiplexer | pointer to a eismultiplexer struct to initialize |
| serial | The serial number of the device to connect to, or 0 for any |
| int eismultiplexer_connect_channel | ( | struct eismultiplexer * | muliplexer, |
| channel_t | channel | ||
| ) |
Connects the given channel(s) to the common inputs.
| 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) |
| int eismultiplexer_connect_channel_exclusive | ( | struct eismultiplexer * | muliplexer, |
| channel_t | channel | ||
| ) |
Connects the given channel(s) to the common inputs disconnecting all others.
| 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) |
| int eismultiplexer_disconnect_channel | ( | struct eismultiplexer * | muliplexer, |
| channel_t | channel | ||
| ) |
Disconnect the given channel(s) to the common inputs disconnecting all others.
| 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 |
| int eismultiplexer_get_channel_count | ( | struct eismultiplexer * | muliplexer, |
| uint16_t * | count | ||
| ) |
Gets the number of channels on the device.
| multiplexer | pointer to an eismultiplexer struct |
| count | a pointer where the nummber of channels will be stored. |
| channel_t eismultiplexer_get_connected | ( | struct eismultiplexer * | muliplexer | ) |
Returns the channels currently connected.
| multiplexer | pointer to a eismultiplexer struct |
| int eismultiplexer_get_trigger_count | ( | struct eismultiplexer * | muliplexer | ) |
gets the nummber of trigger pins available on the device
| int eismultiplexer_get_trigger_state | ( | struct eismultiplexer * | muliplexer, |
| uint16_t | index, | ||
| trigger_state_t * | state, | ||
| bool * | level | ||
| ) |
Gets the logic level and state of the trigger pin.
| multiplexer | pointer to a eismultiplexer struct |
| index | the index of the trigger |
| state | a pointer where the current state of the trigger will be stored, can be NULL |
| level | a pointer where the current logic level of the trigger will be stored, only relevant if state is TRIGGER_INPUT, can be NULL |
| uint16_t * eismultiplexer_list_available_devices | ( | size_t * | count | ) |
Lists the available eismultiplexer devices.
| count | The number of available eismultiplexer devices |
| void eismultiplexer_register_disconnect_callback | ( | struct eismultiplexer * | muliplexer, |
| void(*)(struct eismultiplexer *muliplexer, void *user_data) | deviceDisconnectedCb, | ||
| void * | user_data | ||
| ) |
Registers a callback that will be called when the device disconnects, the callback is called from a different thread and must be thread-safe.
| multiplexer | pointer to a eismultiplexer struct to initialize |
| deviceDisconnectedCb | Callback function to call, Set to NULL to deregister |
| user_data | A user data pointer to be given to the callback function |
| int eismultiplexer_set_led | ( | struct eismultiplexer * | muliplexer, |
| bool | on | ||
| ) |
Turns the led on the PCB on or off.
| multiplexer | pointer to a eismultiplexer struct |
| on | true to turn the led on, false to turn it off |
| int eismultiplexer_set_trigger_state | ( | struct eismultiplexer * | muliplexer, |
| uint16_t | index, | ||
| trigger_state_t | state | ||
| ) |
Sets the state of the trigger pin.
| multiplexer | pointer to a eismultiplexer struct |
| state | state to put the trigger in |
| index | the index of the trigger to set |
| int eismultiplexer_wait_trigger | ( | struct eismultiplexer * | muliplexer, |
| uint16_t | index, | ||
| trigger_wait_t | wait, | ||
| uint64_t | timeout | ||
| ) |
Sets the state of the trigger pin.
| multiplexer | pointer to a eismultiplexer struct |
| index | the index of the trigger |
| wait | wait type |
| timeout | maximum time in milliseconds to wait |