ifgen.svd.group package#
Submodules#
ifgen.svd.group.base module#
A module implementing base interfaces for processing a group of peripherals.
- class ifgen.svd.group.base.PeripheralGroup(root: Peripheral, derivatives: list[Peripheral])[source]#
Bases:
object
A container for peripherals that have the same register layout.
- derivatives: list[Peripheral]#
- property peripherals: Iterator[Peripheral]#
Get all peripheral instances.
- root: Peripheral#
- ifgen.svd.group.base.get_derived(peripheral: Peripheral, peripherals: list[Peripheral]) Peripheral | None [source]#
Determine if this peripheral is derived from any other peripheral.
- ifgen.svd.group.base.peripheral_groups(peripherals: dict[str, Peripheral]) dict[str, PeripheralGroup] [source]#
Organize peripherals into groups.
ifgen.svd.group.enums module#
A module for handling SVD bit-field enumerations.
- ifgen.svd.group.enums.get_enum_name(name: str, peripheral: str, raw_mapping: dict[str, Any]) str [source]#
Get the name of an enumeration.
- ifgen.svd.group.enums.handle_duplicate(existing: dict[str, Any], key: str, value: Any) None [source]#
Handle key de-duplication for enumerations.
- ifgen.svd.group.enums.handle_enum_name(name: str, description: str = None) str [source]#
Attempt to generate more useful enumeration names.
- ifgen.svd.group.enums.is_name_part(value: str) bool [source]#
Determine if a word should be part of an enumeration value name.
- ifgen.svd.group.enums.remove_common_prefixes(data: dict[str, Any]) dict[str, Any] [source]#
Attempt to remove common prefixes in enumeration names.
- ifgen.svd.group.enums.translate_enums(enum: EnumeratedValues) dict[str, Any] [source]#
Generate an enumeration definition.
ifgen.svd.group.fields module#
A module for generating configuration data for struct fields.
- ifgen.svd.group.fields.check_not_handled_fields(data: dict[str, Any], fields: Iterable[str]) None [source]#
Ensure that some keys aren’t present in data.
- ifgen.svd.group.fields.handle_cluster(cluster: Cluster, structs: dict[str, Any], enums: dict[str, Any], peripheral: str, min_enum_members: int) tuple[int, dict[str, Any]] [source]#
Handle a cluster element.
- ifgen.svd.group.fields.handle_item(item: Register | Cluster, structs: dict[str, Any], enums: dict[str, Any], peripheral: str, min_enum_width: int, groups_handled: set[str], register_map: dict[str, Register], groups: dict[str, list[Register]], by_name: dict[str, str]) tuple[int, dict[str, Any] | None] [source]#
Handle creating a struct field from a register or cluster.
- ifgen.svd.group.fields.handle_register(register: Register, register_map: dict[str, Register], enums: dict[str, Any], peripheral: str, min_enum_width: int) tuple[int, dict[str, Any]] [source]#
Handle a register entry.
- ifgen.svd.group.fields.handle_register_group(name: str, registers: list[Register], register_map: dict[str, Register], enums: dict[str, Any], peripheral: str, min_enum_width: int) tuple[int, dict[str, Any]] [source]#
Handle creating a struct field for a group of registers.
- ifgen.svd.group.fields.parse_offset(data: dict[str, str]) int [source]#
Parse a hex string to get decimal address offset.
- ifgen.svd.group.fields.process_bit_fields(register: Register, output: dict[str, Any], enums: dict[str, Any], peripheral: str, min_enum_width: int) None [source]#
Get bit-field declarations for a given register.
Module contents#
A module implementing interfaces for processing a group of peripherals.
- class ifgen.svd.group.PeripheralGroup(root: Peripheral, derivatives: list[Peripheral])[source]#
Bases:
object
A container for peripherals that have the same register layout.
- derivatives: list[Peripheral]#
- property peripherals: Iterator[Peripheral]#
Get all peripheral instances.
- root: Peripheral#
- ifgen.svd.group.handle_group(output_dir: Path, group: PeripheralGroup, includes: set[Path], min_enum_members: int) None [source]#
Handle a peripheral group.
- ifgen.svd.group.peripheral_groups(peripherals: dict[str, Peripheral]) dict[str, PeripheralGroup] [source]#
Organize peripherals into groups.