coincellhell 1.0.x
Data Structures | Functions
User API

API to control EISmultiplexer devices. More...

Data Structures

struct  coincellhell
 
struct  heater_state
 

Functions

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 (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_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_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_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)
 
uint32_t coincellhell_get_seconds (struct coincellhell *hell)
 
const uint8_t * coincellhell_get_fw_git_revision (struct coincellhell *hell)
 
int coincellhell_enable_watchdog (struct coincellhell *hell)
 
int coincellhell_set_periodic_recal (struct coincellhell *hell, bool recal)
 
void coincellhell_reset_bus (struct coincellhell *hell)
 

Detailed Description

API to control EISmultiplexer devices.

This API allows you to control the EISmultiplexer device.

Function Documentation

◆ coincellhell_cancle_ramp()

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.

Parameters
heaterheater for which to cancel the ramp
Returns
0 on success and < 0 on failure

◆ coincellhell_check_ready()

int coincellhell_check_ready ( struct coincellhell * hell,
bool * ready )

Checks if all temperatures are close to their set points.

Parameters
readya pointer to a bool where the result will be stored, true if all temperatures have been reach, false otherwise
Returns
0 on success and < 0 on failure

◆ coincellhell_connect()

int coincellhell_connect ( struct coincellhell * hell,
uint16_t serial )

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

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

◆ coincellhell_get_state()

int coincellhell_get_state ( struct coincellhell * hell,
uint8_t heater,
struct heater_state * state )

Gets the state struct for the given heater.

Parameters
heaterheater for which to set the temperature
stateA struct where the state will be stored
Returns
0 on success and < 0 on failure

◆ coincellhell_get_temperature()

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.

Parameters
heaterheater from which to get the temperature
locationPlace where temperature shall be measured
temperatureA float where the temperature in degrees Celsius will be stored
Returns
0 on success and < 0 on failure

◆ coincellhell_get_temperature_setpoint()

int coincellhell_get_temperature_setpoint ( struct coincellhell * hell,
uint8_t heater,
float * temperature )

Gets the target temperature of the given heater.

Parameters
heaterheater for which to set the temperature
temperatureA float where the temperature in degrees Celsius will be stored
Returns
0 on success and < 0 on failure

◆ coincellhell_reset()

int coincellhell_reset ( struct coincellhell * hell)

resets the device

Parameters
hellpointer to a coincellhell struct

◆ coincellhell_set_enabled()

int coincellhell_set_enabled ( struct coincellhell * hell,
uint8_t heater,
bool enabled )

Sets the enabled state for a give heater.

Parameters
heaterheater for which to set the enabled state
stateA struct where the state will be stored
Returns
0 on success and < 0 on failure

◆ coincellhell_set_led()

int coincellhell_set_led ( struct coincellhell * hell,
bool on )

Turns the led on the PCB on or off.

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

◆ coincellhell_set_temperature()

int coincellhell_set_temperature ( struct coincellhell * hell,
uint8_t heater,
float temperature )

Sets the target temperature of the given heater.

Parameters
heaterheater for which to set the temperature
temperaturetemperature to set
Returns
0 on success and < 0 on failure

◆ coincellhell_set_temperature_ramp()

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.

Parameters
heaterheater for which to set the ramp
temperaturetemperature to ramp to
Returns
0 on success and < 0 on failure

◆ coincellhell_string_for_fault()

const char * coincellhell_string_for_fault ( fault_t fault)

Returns a human readable string for a given fault.

Parameters
faultthe fault code
Returns
a const string describing the fault