|
coincellhell 1.0.x
|
API to control EISmultiplexer devices. More...
Data Structures | |
| struct | coincellhell |
| struct | heater_state |
| struct | cell_state |
| struct | trigger_state |
Functions | |
| uint16_t * | coincellhell_list_available_devices (size_t *count) |
| Lists the available coincellhell devices. | |
| int | coincellhell_connect (struct coincellhell *hell, uint16_t serial) |
| Attempts to connect to a coincellhell device and initializes a coincellhell struct. | |
| void | coincellhell_register_disconnect_callback (struct coincellhell *hell, void(*deviceDisconnectedCb)(struct coincellhell *hell, 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 | coincellhell_get_temperature (struct coincellhell *hell, uint8_t heater, temperature_sensor_location_t location, float *temperature) |
| Reads the current temperature of the given heater at given location. | |
| int | coincellhell_set_temperature (struct coincellhell *hell, uint8_t heater, float temperature) |
| Sets the target temperature of the given heater. | |
| int | coincellhell_set_max_current (struct coincellhell *hell, uint8_t heater, uint8_t maxCurrent) |
| Sets the maximum current (really just the maximum dac commend) of the given heater. | |
| int | coincellhell_get_temperature_setpoint (struct coincellhell *hell, uint8_t heater, float *temperature) |
| Gets the target temperature of the given heater. | |
| int | coincellhell_get_state (struct coincellhell *hell, uint8_t heater, struct heater_state *state) |
| Gets the state struct for the given heater. | |
| int | coincellhell_set_enabled (struct coincellhell *hell, uint8_t heater, bool enabled) |
| Sets the enabled state for a give heater. | |
| int | coincellhell_check_ready (struct coincellhell *hell, bool *ready) |
| Checks if all temperatures are close to their set points. | |
| int | coincellhell_set_temperature_ramp (struct coincellhell *hell, uint8_t heater, time_t end_time, float temperature) |
| Will linearly ramp the temperature to the one provided from now until end_time. | |
| int | coincellhell_cancle_ramp (struct coincellhell *hell, uint8_t heater) |
| Cancels any previously set ramp, the set points of the heater will hold the current temperature. | |
| int | coincellhell_set_led (struct coincellhell *hell, bool on) |
| Turns the led on the PCB on or off. | |
| int | coincellhell_set_pid (struct coincellhell *hell, float kp, float ki, float kd) |
| Sets the heater pid coefficants. | |
| int | coincellhell_get_pid (struct coincellhell *hell, float *kp, float *ki, float *kd) |
| Gets the heater pid coefficants. | |
| int | coincellhell_cell_set_voltage_limits (struct coincellhell *hell, uint8_t cell, float max, float min) |
| Sets the voltage limits of the given cell. | |
| int | coincellhell_cell_set_charge_current (struct coincellhell *hell, uint8_t cell, float current) |
| Sets the charge current for the given cell, chargeing is not commenced until the cell is put in the corrisponding state. | |
| int | coincellhell_cell_get_state (struct coincellhell *hell, uint8_t cell, struct cell_state *state) |
| Gets the status struct for the specified cell. | |
| int | coincellhell_cell_set_state (struct coincellhell *hell, uint8_t cell, cell_state_t state) |
| Gets the status struct for the specified cell. | |
| int | coincellhell_reset (struct coincellhell *hell) |
| resets the device | |
| void | coincellhell_disconnect (struct coincellhell *hell) |
| Disconnects from the coincellhell. | |
| const char * | coincellhell_string_for_fault (fault_t fault) |
| Returns a human readable string for a given fault. | |
| int | coincellhell_get_trigger_state (struct coincellhell *hell, uint8_t trigger, struct trigger_state *state) |
| int | coincellhell_set_trigger_state (struct coincellhell *hell, uint8_t trigger, trigger_state_t state) |
| int | coincellhell_get_trigger_count (struct coincellhell *hell, uint8_t *count) |
| int | coincellhell_write_eeprom (struct coincellhell *hell, uint16_t addr, uint16_t value) |
| uint16_t | coincellhell_read_eeprom (struct coincellhell *hell, uint16_t addr) |
| uint8_t | coincellhell_read_oscal (struct coincellhell *hell) |
| uint8_t | coincellhell_read_oscal_error (struct coincellhell *hell) |
| uint32_t | coincellhell_get_seconds (struct coincellhell *hell) |
| int | coincellhell_cell_set_ignore_limits (struct coincellhell *hell, uint8_t cell, bool ignore_limits) |
| const char * | coincellhell_get_fw_git_revision (struct coincellhell *hell) |
| int | coincellhell_enable_watchdog (struct coincellhell *hell) |
| void | coincellhell_reset_bus (struct coincellhell *hell) |
| int | coincellhell_reboot_to_bootloader (struct coincellhell *hell) |
| int | coincellhell_read_print_buffer (struct coincellhell *hell, char *buffer, size_t length) |
| int | coincellhell_testcase (struct coincellhell *hell) |
API to control EISmultiplexer devices.
This API allows you to control the EISmultiplexer device.
| int coincellhell_cancle_ramp | ( | struct coincellhell * | hell, |
| uint8_t | heater | ||
| ) |
Cancels any previously set ramp, the set points of the heater will hold the current temperature.
| heater | heater for which to cancel the ramp |
| int coincellhell_cell_get_state | ( | struct coincellhell * | hell, |
| uint8_t | cell, | ||
| struct cell_state * | state | ||
| ) |
Gets the status struct for the specified cell.
| cell | cell id |
| state | state struct to fill with the information on the cell |
| int coincellhell_cell_set_charge_current | ( | struct coincellhell * | hell, |
| uint8_t | cell, | ||
| float | current | ||
| ) |
Sets the charge current for the given cell, chargeing is not commenced until the cell is put in the corrisponding state.
| cell | cell id |
| float | max maximum voltage in volts |
| float | minimume voltage in volts |
| int coincellhell_cell_set_state | ( | struct coincellhell * | hell, |
| uint8_t | cell, | ||
| cell_state_t | state | ||
| ) |
Gets the status struct for the specified cell.
| cell | cell id |
| state | state struct to fill with the information on the cell |
| int coincellhell_cell_set_voltage_limits | ( | struct coincellhell * | hell, |
| uint8_t | cell, | ||
| float | max, | ||
| float | min | ||
| ) |
Sets the voltage limits of the given cell.
| cell | cell id |
| float | max maximum voltage in volts |
| float | minimume voltage in volts |
| int coincellhell_check_ready | ( | struct coincellhell * | hell, |
| bool * | ready | ||
| ) |
Checks if all temperatures are close to their set points.
| ready | a pointer to a bool where the result will be stored, true if all temperatures have been reach, false otherwise |
| int coincellhell_connect | ( | struct coincellhell * | hell, |
| uint16_t | serial | ||
| ) |
Attempts to connect to a coincellhell device and initializes a coincellhell struct.
| hell | pointer to a coincellhell struct to initialize |
| serial | The serial number of the device to connect to, or 0 for any |
| int coincellhell_get_pid | ( | struct coincellhell * | hell, |
| float * | kp, | ||
| float * | ki, | ||
| float * | kd | ||
| ) |
Gets the heater pid coefficants.
| hell | pointer to a coincellhell struct |
| kp | the proportional coefficant |
| ki | the integral coefficant |
| kd | the derivative coefficant |
| int coincellhell_get_state | ( | struct coincellhell * | hell, |
| uint8_t | heater, | ||
| struct heater_state * | state | ||
| ) |
Gets the state struct for the given heater.
| heater | heater for which to set the temperature |
| state | A struct where the state will be stored |
| int coincellhell_get_temperature | ( | struct coincellhell * | hell, |
| uint8_t | heater, | ||
| temperature_sensor_location_t | location, | ||
| float * | temperature | ||
| ) |
Reads the current temperature of the given heater at given location.
| heater | heater from which to get the temperature |
| location | Place where temperature shall be measured |
| temperature | A float where the temperature in degrees Celsius will be stored |
| int coincellhell_get_temperature_setpoint | ( | struct coincellhell * | hell, |
| uint8_t | heater, | ||
| float * | temperature | ||
| ) |
Gets the target temperature of the given heater.
| heater | heater for which to set the temperature |
| temperature | A float where the temperature in degrees Celsius will be stored |
| uint16_t * coincellhell_list_available_devices | ( | size_t * | count | ) |
Lists the available coincellhell devices.
| count | The number of available coincellhell devices |
| void coincellhell_register_disconnect_callback | ( | struct coincellhell * | hell, |
| void(*)(struct coincellhell *hell, 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.
| hell | pointer to a coincellhell 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 coincellhell_reset | ( | struct coincellhell * | hell | ) |
resets the device
| hell | pointer to a coincellhell struct |
| int coincellhell_set_enabled | ( | struct coincellhell * | hell, |
| uint8_t | heater, | ||
| bool | enabled | ||
| ) |
Sets the enabled state for a give heater.
| heater | heater for which to set the enabled state |
| state | A struct where the state will be stored |
| int coincellhell_set_led | ( | struct coincellhell * | hell, |
| bool | on | ||
| ) |
Turns the led on the PCB on or off.
| hell | pointer to a coincellhell struct |
| on | true to turn the led on, false to turn it off |
| int coincellhell_set_max_current | ( | struct coincellhell * | hell, |
| uint8_t | heater, | ||
| uint8_t | maxCurrent | ||
| ) |
Sets the maximum current (really just the maximum dac commend) of the given heater.
| heater | heater for which to set the temperature |
| maxCurrent | the unitless "current" to set |
| int coincellhell_set_pid | ( | struct coincellhell * | hell, |
| float | kp, | ||
| float | ki, | ||
| float | kd | ||
| ) |
Sets the heater pid coefficants.
| hell | pointer to a coincellhell struct |
| kp | the proportional coefficant |
| ki | the integral coefficant |
| kd | the derivative coefficant |
| int coincellhell_set_temperature | ( | struct coincellhell * | hell, |
| uint8_t | heater, | ||
| float | temperature | ||
| ) |
Sets the target temperature of the given heater.
| heater | heater for which to set the temperature |
| temperature | temperature to set |
| int coincellhell_set_temperature_ramp | ( | struct coincellhell * | hell, |
| uint8_t | heater, | ||
| time_t | end_time, | ||
| float | temperature | ||
| ) |
Will linearly ramp the temperature to the one provided from now until end_time.
| heater | heater for which to set the ramp |
| temperature | temperature to ramp to |
| const char * coincellhell_string_for_fault | ( | fault_t | fault | ) |
Returns a human readable string for a given fault.
| fault | the fault code |