Skip to content

Conversation

cmantill
Copy link

The ECONs have a 16-bit I2C address (0x20 or 0x60 by default) with an 8-bit register space.

  • Some parameters span across multiple registers and that is identified with size_byte in the yaml files.
  • Some parameters only occupy part of the 8-bits and that is identified with the "param_mask" in the yaml files.
  • The structure of the input yaml file is generally:
BLOCK:
  GLOBAL OR CHANNEL: 
    PARAMETER_NAME:

But some parameters are simply:

BLOCK:
  PARAMETER_NAME:

And some other parameters have double nested structure:

BLOCK:
  GLOBAL OR CHANNEL: 
    ANOTHER LEVEL:
      PARAMETER_NAME:

All of these cases are handled.

This PR compiles this information into header files.

Tested with:

python econ-to-header.py ECONT_I2C_params_regmap.yaml econt.h
python econ-to-header.py ECOND_I2C_params_regmap.yaml econd.h

@cmantill cmantill linked an issue Sep 26, 2025 that may be closed by this pull request
Copy link
Member

@tomeichlersmith tomeichlersmith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does look good, I'm not certain when I'll sit down and give it a go myself, but this is a good start.

@tomeichlersmith
Copy link
Member

My notes/thoughts as I'm looking at this...

  • Are there versions of the ECON-D/T? We might want to specifically label this version in case we get a different version (with different parameters) in the future.
  • I think I'm going to convert the PageLUT you wrote into a ParameterLUT just with a "page address" of 0 for all pages. This allows us to use the same types as used for the HGCROC and then the object that is deciding how to set the registers (in the HGCROC case, this is ROC::setRegister which combines the "page" and "register" into a full address) can ignore the "page address" and just use the "register address" as the full address.
  • I still want to isolate the "compiler" into its own sub-library just because its complicated.
  • How would you want to specify the ECON parameters in YAML? The HGCROC uses the same syntax as what is stored in the ParameterLUT: (i.e. "page" and "parameter" are both specified), but we could add more flexibility to the extract method. Perhaps doing the same interpretation you did in the python script in terms of converting a more-deeply nested set of parameters into a page/parameter name pair.

@cmantill
Copy link
Author

cmantill commented Oct 1, 2025

  • There are prototype versions that are no longer used. There might be another version of ECOND in the future but the I2C registers will remain unchanged.
  • I'll wait for you to modify as you think is best.
  • I think the page/parameter simplification is ideal at this point.

@cmantill cmantill changed the title Add ECOND and ECONT I2C maps Add ECOND and ECONT I2C Oct 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ECON register Compiler
3 participants