# Author: Dr. Konstantin Selyunin
# Version: {{ version }}
# Date: {{ date }}
import os.path

from um7py.{{ module }} import {{ classname }}

svd_file = 'rsl_xml_svd/{{ svd }}.svd'
script_dir = os.path.dirname(__file__)
device_file = os.path.join(script_dir, os.pardir, "um7py", "um7_A500CNHD.json")
{{ object }} = {{ classname }}(device=device_file)


print(f"\\n========== CONFIG REGISTERS ===================================")
{%- for register in cregs %}
print(f"{{ '{:<30s}'.format(register.name.lower()) }}: { {{ object }}.{{ register.name.lower() }}}")
{%- endfor %}


print(f"\\n========== DATA REGISTERS ===================================")
{%- for register in dregs %}
print(f"{{ '{:<30s}'.format(register.name.lower()) }}: { {{ object }}.{{ register.name.lower() }}}")
{%- endfor %}


print(f"\\n========== COMMAND REGISTERS ===================================")
{%- for register in commands %}
print(f"{{ '{:<30s}'.format(register.name.lower()) }}: { {{ object }}.{{ register.name.lower() }}}")
{%- endfor %}

