{% macro getAccessType(access) %} {% set mapping = ["RO", "WO", "R/W"] %} {{ mapping[access.value] }} {% endmacro %} {% macro getGroup(group) %}
{{ group.name | upper }} Group
NAME
{{ group.name }}
DESCRIPTION
{{ group.description }}
ADDRESS
{{ "0x{:08X}".format(group | absoluteAddress) }}
HIERARCHY
{{ group | hierarchy }}
INSTANCES
{% for instance in group | instancesInfo %}
{{ instance[0] }}
{{ "0x{:08X}".format(instance[1]) }}
{% endfor %}
{% for register in group.registers | sort(attribute="address")%} {{ getRegister(register) }} {% endfor %} {% for subGroup in group.groups | sort(attribute="address") recursive %} {{ getGroup(subGroup) }} {% endfor %}
{% endmacro %} {% macro getRegister(register) %}
{{ register.name | upper }} Register
NAME
{{ register.name }}
DESCRIPTION
{{ register.description }}
ADDRESS
{{ "0x{:08X}".format(register | absoluteAddress) }}
RESET VALUE
{{ "0x{:08X}".format(register.reset_value) }}
HIERARCHY
{{ register | hierarchy }}
INSTANCES
{% for instance in register | instancesInfo %}
{{ instance[0] }}
{{ "0x{:08X}".format(instance[1]) }}
{% endfor %}
BIT
NAME
FUNCTION
ACCESS
RESET
{% for field in register.fields | sort(attribute="position", reverse=True) %}
{{ field.position }}{% if field.width > 1 %}:{{ field.position + field.width - 1}}{% endif %}
{{ field.name }}
{{ field.description }}
{{ getAccessType(register.access) }}
{{ "0x{:02X}".format(field.reset_value) }}
{% endfor %}
{% endmacro %}