pflib v3.9.0-rc3-11-g2537d8f
Pretty Fine HGCROC Interaction Library
Loading...
Searching...
No Matches
pflib::ECON Class Reference
Collaboration diagram for pflib::ECON:
[legend]

Classes

class  TestParameters
 

Public Member Functions

 ECON (I2C &i2c, uint8_t econ_base_addr, const std::string &type_version)
 
const std::stringtype () const
 
void setRunMode (bool active=true, int edgesel=-1, int fcmd_invert=-1)
 
int getPUSMRunValue ()
 
int getPUSMStateValue ()
 
bool isRunMode ()
 
std::vector< uint8_t > getValues (int reg_addr, int nbytes)
 
void setValue (int reg_addr, uint64_t value, int nbytes)
 
void setValues (int reg_addr, const std::vector< uint8_t > &values)
 
void setRegisters (const std::map< int, std::map< int, uint8_t > > &registers)
 
void loadParameters (const std::string &file_path, bool prepend_defaults)
 
std::map< int, std::map< int, uint8_t > > getRegisters (const std::map< int, std::map< int, uint8_t > > &selected)
 
std::map< int, std::map< int, uint8_t > > applyParameters (const std::map< std::string, std::map< std::string, uint64_t > > &parameters)
 
void applyParameter (const std::string &page, const std::string &param, const uint64_t &val)
 
std::map< std::string, std::map< std::string, uint64_t > > readParameters (const std::map< std::string, std::map< std::string, uint64_t > > &parameters, bool print_values=true)
 
std::map< std::string, std::map< std::string, uint64_t > > readParameters (const std::string &file_path)
 
uint64_t readParameter (const std::string &page, const std::string &param, bool print_values=false)
 
void dumpSettings (const std::string &filename, bool should_decompile)
 
TestParameters::Builder testParameters ()
 

Private Attributes

I2Ci2c_
 
uint8_t econ_base_
 
Compiler compiler_
 
std::string type_
 
std::map< uint16_t, size_t > econ_reg_nbytes_lut_
 
mutable::pflib::logging::logger the_log_ {::pflib::logging::get("econ")}
 

Member Function Documentation

◆ applyParameters()

std::map< int, std::map< int, uint8_t > > pflib::ECON::applyParameters ( const std::map< std::string, std::map< std::string, uint64_t > > & parameters)
  1. get registers YAML file contains by compiling without defaults
  1. get the current register values on the chip which is
  1. compile this parameter onto those register values we can use the lower-level compile here because the compile in step 1 checks that all of the page and param names are correct
  1. put these updated values onto the chip

◆ dumpSettings()

void pflib::ECON::dumpSettings ( const std::string & filename,
bool should_decompile )

decompile while being careful since we knowingly are attempting to read ALL of the parameters on the chip

◆ loadParameters()

void pflib::ECON::loadParameters ( const std::string & file_path,
bool prepend_defaults )

If we prepend defaults, then ALL of the parameters will be touched and so we do NOT need to bother reading the current values and overlaying the new ones, instead we jump straight to setting the registers.

If we don't prepend the defaults, then we use the other applyParameters function to overlay the parameters we passed on top of the ones currently on the chip after extracting them from the YAML file.


The documentation for this class was generated from the following files: