hdl_registers.generator.c package
Submodules
hdl_registers.generator.c.header module
- class hdl_registers.generator.c.header.CHeaderGenerator(register_list: RegisterList, output_folder: Path, file_name: str | None = None)
Bases:
RegisterCodeGenerator
Generate a C header. See the C code generator article for usage details.
The header will contain:
Constant values for all register constants.
Enumeration types for all Enumeration fields.
A
struct
type with all registers as members, which can be memory mapped directly.For each register,
#define
constants with the index and address of the register.For each field in each register,
#define
constants with the bit shift, bit mask and inverse bit mask of the field.
- SHORT_DESCRIPTION = 'C header'
- __init__(register_list: RegisterList, output_folder: Path, file_name: str | None = None)
For argument description, please see the super class.
- Parameters:
file_name – Optionally specify an explicit result file name. If not specified, the name will be derived from the name of the register list.