Convert register dumps in hex format to html including bitfield values and meanings.
Relies on:
- Register map in csv format (see below details).
- Register dump in csv format (see below details).
- python 3+
Generates html file with following features:
- register and bitfield definitions from the map file.
- bitfield values from dump file.
- ability in the html file to hide/show bitfields with values equal to reset values.
- ability in the html file to hide/show bitfields with values equal between different dumps.
| Address | Bit Field Range | Bit Field Enumerations | Bit Field Reset Value | REGISTER from: dump.csv | Meaning | 0x000F: Reserved 0x0000 0x003E 0x0003 AINP = AIN1, AINN = AIN2 0x0000| 7..4 |
- 0x0000: AINP = AIN0, AINN = AIN1 (default)
- 0x0001: AINP = AIN0, AINN = AIN2
- 0x0002: AINP = AIN0, AINN = AIN3
- 0x0003: AINP = AIN1, AINN = AIN2
- 0x0004: AINP = AIN1, AINN = AIN3
- ...
to display help message
python Hex4Humans -h
to decipher a register dump and/or compare against reset values, use a single dump file:
python Hex4Humans.py -m map_ads1220.csv -d dump_ads1220_table22.csv -o ads1220_table22.htm
to compare different register dumps to one another and/or reset values, specify multiple dump files:
python Hex4Humans.py -m map_ads1220.csv -d dump_ads1220_table22.csv dump_ads1220_table24.csv -o ads1220_table22_24.htm
Register Map is a unique file per device which defines the register mapping, the bitfield definitions and bitfield enumerations.
- csv format
- UTF-8 encoded
- all relevant values are coded in hexa with 4 digits, upper case, preceeded by 0x
- Bit Field Name should be where possible a unique identifier for a featureset to allow comparing across multiple devices (more details to come later)
Bit Field Description
should contain the feature description and required explanation to be self-standing (no need to open another document)Bit Field Enumerations
should be a pure list of different values that the bit field can be. For large enumeration (organisation ID, ADC values, ...) a code will be added to handle this.
see map_ads1220.csv
for full details
Register Long Name | Register Short Name | Register Page | Register Address | Bit Field Number | Bit Field Name | Bit Field Reset Value | Bit Field Access | Bit Field Description | Bit Field Enumerations |
---|---|---|---|---|---|---|---|---|---|
Configuration Register 0 | CONF0 | 0x0000 | 0x0000 | 7..4 | MUX[3:0] | 0x0000 | R/W | Input multiplexer configuration |
|
... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
see map_dp83822.csv
for full details
Register Long Name | Register Short Name | Register Page | Register Address | Bit Field Number | Bit Field Name | Bit Field Reset Value | Bit Field Description | Bit Field Enumerations |
---|---|---|---|---|---|---|---|---|
Control | CTRL | 0x0000 | 0x0000 | 15 | Reset | 0x0001 | "PHY Software Reset: Writing a 1 to this bit resets the PHY PCS registers. When the reset operation is completed, this bit is cleared to 0 automatically. PHY Vendor Specific registers will not be cleared." |
|
Register Dumps are generated during development/debug to allow closing the gap between expected IC behaviour and observed behaviour.
Following examples illustrate how a dump file should look like and how to generate the HEX4Humans html output.
running against table 22 in datasheet, see file dump_ads1220_table22.csv in repository
Register Address | Register Value |
---|---|
0x0000 | 0x000A |
0x0001 | 0x0004 |
0x0002 | 0x0010 |
0x0003 | 0x0000 |
to have the HEX4Humans output, type in console:
python Hex4Humans.py -d dump_ads1220_table22.csv -m map_ads1220.csv -o ads1220_table22.htm
running against table 24 in datasheet, see file see file dump_ads1220_table24.csv in repository
Register Address | Register Value |
---|---|
0x0000 | 0x0066 |
0x0001 | 0x0004 |
0x0002 | 0x0055 |
0x0003 | 0x0070 |
to have the HEX4Humans output, type in console:
python Hex4Humans.py -d dump_ads1220_table24.csv -m map_ads1220.csv -o ads1220_table24.htm
running against table 26 in datasheet, see file see file dump_ads1220_table24.csv in repository
Register Address | Register Value |
---|---|
0x0000 | 0x003E |
0x0001 | 0x0004 |
0x0002 | 0x0098 |
0x0003 | 0x0000 |
to have the HEX4Humans output, type in console:
python Hex4Humans.py -d dump_ads1220_table26.csv -m map_ads1220.csv -o ads1220_table26.htm
see dump822_20201029.csv for full details
Register Address | Register Value |
---|---|
0x0000 | 0x3800 |
... | ... |
to have the HEX4Humans output, type in console:
python Hex4Humans.py -d dump822_20201029.csv -m map_dp83822.csv -o 822_20201029.htm