34#include "usbcommands.h"
174int coincellhell_write_eeprom(
struct coincellhell* hell, uint16_t addr, uint16_t value);
175uint16_t coincellhell_read_eeprom(
struct coincellhell* hell, uint16_t addr);
176uint8_t coincellhell_read_oscal(
struct coincellhell* hell);
177uint32_t coincellhell_get_seconds(
struct coincellhell* hell);
178const uint8_t* coincellhell_get_fw_git_revision(
struct coincellhell* hell);
179int coincellhell_enable_watchdog(
struct coincellhell* hell);
180int coincellhell_set_periodic_recal(
struct coincellhell* hell,
bool recal);
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_reset(struct coincellhell *hell)
resets the device
int coincellhell_get_state(struct coincellhell *hell, uint8_t heater, struct heater_state *state)
Gets the state struct for the given heater.
const char * coincellhell_string_for_fault(fault_t fault)
Returns a human readable string for a given fault.
int coincellhell_set_temperature(struct coincellhell *hell, uint8_t heater, float temperature)
Sets the target temperature of the given heater.
int coincellhell_check_ready(struct coincellhell *hell, bool *ready)
Checks if all temperatures are close to their set points.
int coincellhell_set_enabled(struct coincellhell *hell, uint8_t heater, bool enabled)
Sets the enabled state for a give heater.
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.
void coincellhell_disconnect(struct coincellhell *hell)
Disconnects from the coincellhell.
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_connect(struct coincellhell *hell, uint16_t serial)
Attempts to connect to a EISmultiplexer device and initializes a coincellhell struct.
int coincellhell_get_temperature_setpoint(struct coincellhell *hell, uint8_t heater, float *temperature)
Gets the target temperature of the given heater.
Definition coincellhell.h:48
Definition coincellhell.h:53
time_t rampStartTime
if a ramp is currently being executed, the UNIX timestamp at which it was started
Definition coincellhell.h:72
float setpoint
current target temperature for this heater
Definition coincellhell.h:67
float rampTarget
if a ramp is currently being executed, its final temperature will be set here
Definition coincellhell.h:70
bool ramp
true if heater is currently executing a ramp
Definition coincellhell.h:59
fault_t faultType
the detected fault type as a fault_t enum
Definition coincellhell.h:63
bool fault
true if the system has detected a fault with this heater
Definition coincellhell.h:61
bool enabled
true if heater is enabled
Definition coincellhell.h:55
bool ready
true if heater is close to its set point
Definition coincellhell.h:57
uint8_t dacCommand
current command (0-255) that is being sent to the DAC for this heater
Definition coincellhell.h:65
time_t rampStopTime
if a ramp is currently being executed, the UNIX timestamp at it will complete
Definition coincellhell.h:74