Skip to content

Commit

Permalink
docs(README): update doc structure and project status
Browse files Browse the repository at this point in the history
  • Loading branch information
andelf committed Aug 11, 2024
1 parent 47b904b commit 7abae9b
Showing 1 changed file with 47 additions and 12 deletions.
59 changes: 47 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,53 @@ The structured MCU DB of HPM MCUs. The home of [hpm-metapac][docs-rs].

All PRs and Issues are handled in [andelf/hpm-data](https://github.com/andelf/hpm-data).

## MCU Family
`hpm-metapac` is generated from this repo. For each commit(or push) of hpm-data, it's pushed to <https://github.com/hpmicro-rs/hpm-metapac>,
with a tag of `hpm-data-<commit-hash>`.

## hpm-metapac

- The `hpm-metapac` crate has a `metadata` feature, when enabled, it will provide the basic metadata of the currrent MCU
- Patch vectored interrupt mode, add `CORE_LOCAL` for Non-External Interrupts
- To best fit for HPM RISC-V's clustered register desigin, the following is added:
- All clocks, for `SYSCTL.CLOCK`, under `hpm_metapac::clocks::`
- All SYSCTL resources, under `hpm_metapac::resources::`
- All GPIOs and it's PADs, for `IOC`, under `hpm_metapac::pins::`
- All IOMUX settings (`FUNC_CTL`), under `hpm_metapac::iomux::`
- All TRGM const definitions, under `hpm_metapac::trgmmux::`
- The version on crates.io is not updated frequently, please use the git repo directly

### Usage

```toml
[dependencies]
hpm-metapac = { version = "0.0.3", git = "https://github.com/hpmicro-rs/hpm-metapac.git", tag = "hpm-data-6740ca6fd1ed6d9bb57944b42aa299761b974713" }

# If you want to use the metadata feature in build.rs
[build-dependencies]
hpm-metapac = { version = "0.0.3", git = "https://github.com/hpmicro-rs/hpm-metapac.git", tag = "hpm-data-6740ca6fd1ed6d9bb57944b42aa299761b974713", default-features = false, features = [
"metadata",
] }
```

A simple example to configure pin PA25 for PWM1_P1:

```rust
use hpm_metapac as pac;
use pac::{iomux, pins};

pac::IOC
.pad(pins::PA25)
.func_ctl()
.modify(|w| w.set_alt_select(iomux::IOC_PA25_FUNC_CTL_PWM1_P_1));
```

## Support Status

- All peripherals are supported
- All MCU families are supported
- Peripherals that have a HAL driver or raw PAC demo in [hpm-hal](https://github.com/hpmicro-rs/hpm-hal) is reviewed and tested

### MCU Family

(in order of release date)

Expand All @@ -26,24 +72,13 @@ All PRs and Issues are handled in [andelf/hpm-data](https://github.com/andelf/hp
- HPM6800 - display, user interface
- HPM6E00 - EtherCAT

### Support status

- [x] HPM6700/HPM6400
- [x] HPM6300
- [x] HPM6200
- [x] HPM5300
- [x] HPM6800
- [x] HPM6E00

## hpm-metapac

- The `hpm-metapac` crate has a `metadata` feature, when enabled, it will provide the basic metadata of the currrent MCU
- Patch vectored interrupt mode, add `CORE_LOCAL` for Non-External Interrupts
- To best fit for HPM RISC-V's cluster register desigin, the following is added:
- All clocks, for `SYSCTL.CLOCK`, in `hpm_metapac::clocks::`
- All GPIOs and it's PADs, for `IOC`, in `hpm_metapac::pins::`
- All IOMUX settings (`FUNC_CTL`) in `hpm_metapac::iomux::`

## Data Source

- <https://www.hpmicro.com/>
Expand Down

0 comments on commit 7abae9b

Please sign in to comment.