JH71xx PAC


jh71xx-pac is a PAC (peripheral access crate) for devices based on the JH7110 SoC from StarFive.

The plan was to originally also support the JH7100 SoC (predecessor to JH7110), but all hardware based on the JH7100 is no longer being produced.

If anyone would like to donate hardware to add support for JH7100 SoCs, please get in contact.

Creating a PAC

Not all PACs use the same methods to create code for low-level access to peripheral registers.

In general, as I understand it, most do use some form of code generation.

jh71xx-pac uses svd2rust to generate code from the jh7110.svd file packaged with the repository.

jh7110.svd is programmatically generated from the jh7110.dtb flat device tree file using the svd-generator tool.

jh7110.dtb is derived from U-Boot and Linux sources.

Code is regularly re-generated to:

Using a PAC

PACs provide the lowest-level access to peripheral registers, while still providing idiomatic Rust types and functions.

There are a number of use-cases for directly using a PAC for bare-metal programming.

The most common use-case is inclusion in a HAL (hardware abstraction layer) library, typically targetting the embedded-hal traits.