JH71xx HAL


jh71xx-hal is a HAL (hardware abstraction layer) 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 HAL

In general, HAL crates rely on a corresponding PAC.

jh71xx-hal unsurprisingly depends on jh71xx-pac.

Once the PAC is reasonably complete, one can move on to targetting the HAL features desired for the SoC.

embedded-hal supplies traits for common peripherals found in embedded environments. At the time of writing, the v1.0.0 stable release was recently published!

For the time being, it is still recommended to target both the traits in the v1.0.0 release, and the latest previous minor release.

Pre-v1.0.0 releases include a number of additional traits, and have a much larger set of drivers targetting those traits.

jh71xx-hal currently only supports the v1.0.0 traits, and support for v0.2.7 is still a WIP.

There is a guide for HAL maintainers on migrating from `v0.2.x` to `v1.0.0`.

Using a HAL

HAL traits provide a standard, hardware-independent interface for driver authors to target.

For instance, UART is a common debugging/communication peripheral present on most embedded boards and SBCs. Driver authors can target the embedded_hal_nb::serial traits, without concern for the specific hardware implementation, e.g. uart8250, uart16550, etc.

HALs are also a good place to experiment with abstractions that could make it into upstream in a future embedded-hal release.

As an example, there is current discussion for (re-)introducing a Clock API. There is a rough initial implementation in jh71xx_hal::clocks, though these are mostly convenience structs at the time of writing.

For full API documentation, see https://docs.rs/jh71xx-hal.