24#include <etl/string.h>
25#include <etl/vector.h>
69 static constexpr float fsv = 23.9883;
363 etl::string<32> m_name;
365 const uint32_t m_addr;
395 get_temperature_internal()
const;
398 get_temperature_external()
const;
404 set_int_temp_high_lim(
float int_temp_high_lim = 85.0f)
const;
407 set_int_temp_low_lim(
float int_temp_low_lim = -128.0f)
const;
410 set_ext_temp_high_lim(
float ext_temp_high_lim = 85.0f)
const;
413 set_ext_temp_low_lim(
float ext_temp_low_lim = -128.0f)
const;
416 get_one_shot_meas()
const;
419 set_t_crit(
float ext_t_crit = 100.0f,
float int_t_crit = 100.0f,
420 float t_crit_hysterisis = 10.0f)
const;
423 get_diode_fault()
const;
436 get_high_limit_status()
const;
439 get_low_limit_status()
const;
442 get_crit_limit_status()
const;
448 get_sensor_info()
const;
461 set_v_sense_lim(
float v_sense_lim_low = 2032.0f,
462 float v_sense_lim_high = -2033.0f)
const;
465 set_v_source_lim(
float v_source_lim_low = 0.0f,
466 float v_source_lim_high = 23.9063f)
const;
469 set_v_crit_lim(
float v_sense_lim_crit = 2032.0f,
470 float v_source_lim_crit = 23.9063f,
471 float v_sense_hysterisis = 160.0f,
472 float v_source_hysterisis = 0.9375f)
const;
491 error_msg{
"Thermal Shutdon is required (from emc1702)",
511 error_msg{
"Error in getting sensor info. Probably there "
512 "is an error in communication",
532 error_msg{
"The ADCs of emc1702 currently converting. Readings not "
A dummy GPIO implementation with no effect. Can be used for CI testing or default construction of gpi...
emc1702_incorrect_sensor_info(string_type file_name, numeric_type line)
emc1702_inval(string_type file_name, numeric_type line)
emc1702_not_ready(string_type file_name, numeric_type line)
emc1702_thermal_shutdown_needed(string_type file_name, numeric_type line)
ideality_factor
Settings to set the Ideality Factor in the External Diode Ideality Factor Registers.
float get_sense_current() const
Retrieves current measurement from the EMC1702 sensor.
float get_temperature_average() const
Retrieves temperature from the EMC1702 sensor by averaging the internal and external diode measuremen...
averaging_control
Settings to set the digital averaging on mesurements in the Averaging Control Register,...
sensor_mode
Selects the mode of operation of the EMC1702 sensor.
conversion_rate
Settings to set the frequency of measurements in the Conversion Rate Register.
void get_status(status &s)
consecutive_alert_voltage
Settings to set the threshold for consecutive voltage out-of-limit measurements in the Voltage Sampli...
emc1702(const char *name, bsp::i2c &i2c, uint16_t addr, bsp::gpio &alert)
Constructs an EMC1702 sensor object with an ALERT GPIO pin.
current_sampling_time
Settings to set the Current Sensing Sampling Time in the Current Sense Sampling Configuration Registe...
static constexpr float fsv
Full Scale Voltage in volts.
static constexpr float r_sense
External sense resistor value in Ohms.
max_expected_voltage
Settings to set the Current Sense maximum expected voltage (full scale range) in the Current Sense Sa...
@ CURRENT_SENSOR_RANGE_20_mV
@ CURRENT_SENSOR_RANGE_80_mV
@ CURRENT_SENSOR_RANGE_10_mV
@ CURRENT_SENSOR_RANGE_40_mV
consecutive_alert_current
Settings to set the threshold for consecutive current out-of-limit measurements in the Current Sense ...
float get_source_voltage() const
Retrieves source voltage measurement from the EMC1702 sensor.
peak_detection_duration
Settings to set the peak detector minimum time threshold in the Peak Detection Configuration Register...
peak_detection_threshold
Settings to set the peak detector threshold level in the Peak Detection Configuration Register.
beta_config
Settings to set the Beta Compensation factor in the Beta Configuration Registers.
void set_config(sensor_mode m) const
consecutive_alert_diode_fault
Settings to set the threshold for consecutive diode fault alerts in the Consecutive Alert Register.
A class representing error messages in the SatNOGS-COMMS system.
severity
Severity levels of exceptions.
@ MINOR
Failure having minimal impact.
exception(severity sev, const char *file, int lineno, const error_msg &err_msg)
Constructor for the exception class.
#define EBADINFSENS
Parsing bad sensor info.
#define EINVALSENS
Invalid sensor.
#define ETHERMSHUT
Thermal shutdown is required.
#define EBUSYSENS
Readings from sensor not available yet.