'Using SVD files from CMSIS for external ICs (e.g. connected via SPI or I2C)

I was wondering today if the SVD fileformat as well as the parser and code generation tools provided by CMSIS could be used to describe and generate headerfiles for an external IC (for example there are some rather complex battery management ics out there with tons of registers).

I am not expecting it to generate any logic but just register and command/address definitions.

The thought behind this questions is: At some point I need to spend the time to read the datasheet and translate it into a set of register and command definitions. Why not directly use a format that could be used to generate code also for other languages?

Edit: Link to the SVD file format added



Solution 1:[1]

Yes, you could generate header files from the SVD files.

svd2rust is one example of such usage.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Armandas