Skip to content

Commit 215e4b8

Browse files
KonstantinKondrashovradimkarnis
authored andcommitted
feat(espefuse): Adds ADC calibration data for ESP32-P4
1 parent 88319db commit 215e4b8

File tree

6 files changed

+82
-31
lines changed

6 files changed

+82
-31
lines changed

espefuse/efuse/esp32p4/fields.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -102,12 +102,11 @@ def __init__(
102102
for efuse in self.Fields.BLOCK2_CALIBRATION_EFUSES
103103
]
104104
else:
105-
# TODO add processing of self.Fields.BLOCK2_CALIBRATION_EFUSES
106-
# if self["BLK_VERSION_MINOR"].get() == 1:
107-
# self.efuses += [
108-
# EfuseField.convert(self, efuse)
109-
# for efuse in self.Fields.BLOCK2_CALIBRATION_EFUSES
110-
# ]
105+
if self.get_block_version() >= 1:
106+
self.efuses += [
107+
EfuseField.convert(self, efuse)
108+
for efuse in self.Fields.BLOCK2_CALIBRATION_EFUSES
109+
]
111110
self.efuses += [
112111
EfuseField.convert(self, efuse) for efuse in self.Fields.CALC
113112
]

espefuse/efuse/esp32p4/mem_definition.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,12 +114,8 @@ class EfuseDefineFields(EfuseFieldsBase):
114114
def __init__(self, extend_efuse_table) -> None:
115115
# List of efuse fields from TRM the chapter eFuse Controller.
116116
self.EFUSES = []
117-
118117
self.KEYBLOCKS = []
119-
120-
# if BLK_VERSION_MINOR is 1, these efuse fields are in BLOCK2
121118
self.BLOCK2_CALIBRATION_EFUSES = []
122-
123119
self.CALC: List = []
124120

125121
dir_name = os.path.dirname(os.path.abspath(__file__))

espefuse/efuse/esp32p4/operations.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,11 @@ def set_flash_voltage(esp, efuses, args):
189189

190190

191191
def adc_info(esp, efuses, args):
192-
print("not supported yet")
192+
print("Block version:", efuses.get_block_version())
193+
if efuses.get_block_version() >= 1:
194+
for efuse in efuses:
195+
if efuse.category == "calibration":
196+
print(f"{efuse.name:<30} = ", efuses[efuse.name].get())
193197

194198

195199
def key_block_is_unused(block, key_purpose_block):

0 commit comments

Comments
 (0)