Skip to content

Commit 36a264c

Browse files
committed
riscv-peripheral crate
1 parent 4c72d57 commit 36a264c

File tree

17 files changed

+155
-256
lines changed

17 files changed

+155
-256
lines changed

.github/workflows/changelog.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ jobs:
2323
- 'riscv-rt/**'
2424
riscv-pac:
2525
- 'riscv-pac/**'
26+
riscv-peripheral:
27+
- 'riscv-peripheral/**'
2628
2729
- name: Check for CHANGELOG.md (riscv)
2830
if: steps.changes.outputs.riscv == 'true'
@@ -47,3 +49,11 @@ jobs:
4749
changeLogPath: ./riscv-pac/CHANGELOG.md
4850
skipLabels: 'skip changelog'
4951
missingUpdateErrorMessage: 'Please add a changelog entry in the riscv-pac/CHANGELOG.md file.'
52+
53+
- name: Check for CHANGELOG.md (riscv-peripheral)
54+
if: steps.changes.outputs.riscv-peripheral == 'true'
55+
uses: dangoslen/changelog-enforcer@v3
56+
with:
57+
changeLogPath: ./riscv-peripheral/CHANGELOG.md
58+
skipLabels: 'skip changelog'
59+
missingUpdateErrorMessage: 'Please add a changelog entry in the riscv-peripheral/CHANGELOG.md file.'
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
on:
2+
push:
3+
branches: [ master ]
4+
pull_request:
5+
merge_group:
6+
7+
name: Build check (riscv-peripheral)
8+
9+
jobs:
10+
# We check that the crate builds and links for all the toolchains and targets.
11+
build-riscv:
12+
strategy:
13+
matrix:
14+
# All generated code should be running on stable now, MRSV is 1.61.0
15+
toolchain: [ stable, nightly, 1.61.0 ]
16+
target:
17+
- riscv32i-unknown-none-elf
18+
- riscv32imc-unknown-none-elf
19+
- riscv32imac-unknown-none-elf
20+
- riscv64imac-unknown-none-elf
21+
- riscv64gc-unknown-none-elf
22+
include:
23+
# Nightly is only for reference and allowed to fail
24+
- toolchain: nightly
25+
experimental: true
26+
runs-on: ubuntu-latest
27+
continue-on-error: ${{ matrix.experimental || false }}
28+
steps:
29+
- uses: actions/checkout@v4
30+
- uses: dtolnay/rust-toolchain@master
31+
with:
32+
toolchain: ${{ matrix.toolchain }}
33+
targets: ${{ matrix.target }}
34+
- name: Build (no features)
35+
run: cargo build --package riscv-peripheral --target ${{ matrix.target }}
36+
- name: Build (all features)
37+
run: cargo build --package riscv-peripheral --target ${{ matrix.target }} --all-features
38+
39+
# On MacOS, Ubuntu, and Windows, we run the tests.
40+
build-others:
41+
strategy:
42+
matrix:
43+
os: [ macos-latest, ubuntu-latest, windows-latest ]
44+
runs-on: ${{ matrix.os }}
45+
steps:
46+
- uses: actions/checkout@v3
47+
- uses: dtolnay/rust-toolchain@stable
48+
- name: Build (no features)
49+
run: cargo test --package riscv-peripheral
50+
- name: Build (all features)
51+
run: cargo test --package riscv-peripheral --all-features
52+
53+
# Job to check that all the builds succeeded
54+
build-check:
55+
needs:
56+
- build-riscv
57+
- build-others
58+
runs-on: ubuntu-latest
59+
if: always()
60+
steps:
61+
- run: jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}'

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@ resolver = "2"
33
members = [
44
"riscv",
55
"riscv-pac",
6+
"riscv-peripheral",
67
"riscv-rt",
78
]

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ This repository contains various crates useful for writing Rust programs on RISC
44

55
* [`riscv`]: CPU registers access and intrinsics
66
* [`riscv-pac`]: Common traits to be implemented by RISC-V PACs
7+
* [`riscv-peripheral`]: Interfaces for standard RISC-V peripherals
78
* [`riscv-rt`]: Startup code and interrupt handling
89

910

@@ -22,6 +23,8 @@ Conduct][CoC], the maintainer of this crate, the [RISC-V team][team], promises
2223
to intervene to uphold that code of conduct.
2324

2425
[`riscv`]: https://crates.io/crates/riscv
26+
[`riscv-pac`]: https://crates.io/crates/riscv-pac
27+
[`riscv-peripheral`]: https://crates.io/crates/riscv-peripheral
2528
[`riscv-rt`]: https://crates.io/crates/riscv-rt
2629
[team]: https://github.com/rust-embedded/wg#the-risc-v-team
2730
[CoC]: CODE_OF_CONDUCT.md

riscv-pac/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
1010
### Added
1111

1212
- Add `InterruptNumber`, `PriorityNumber`, and `HartIdNumber` traits.
13+
14+
### Changed
15+
16+
- Update `README.md`

riscv-pac/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
[![crates.io](https://img.shields.io/crates/d/riscv.svg)](https://crates.io/crates/riscv)
2-
[![crates.io](https://img.shields.io/crates/v/riscv.svg)](https://crates.io/crates/riscv)
1+
[![crates.io](https://img.shields.io/crates/d/riscv-pac.svg)](https://crates.io/crates/riscv-pac)
2+
[![crates.io](https://img.shields.io/crates/v/riscv-pac.svg)](https://crates.io/crates/riscv-pac)
33

44
# `riscv-pac`
55

66
> Target-specific traits to be implemented by PACs
77
88
This project is developed and maintained by the [RISC-V team][team].
99

10-
## [Documentation](https://docs.rs/crate/riscv)
10+
## [Documentation](https://docs.rs/crate/riscv-pac)
1111

1212
## Minimum Supported Rust Version (MSRV)
1313

riscv-peripheral/.github/workflows/clippy.yml

Lines changed: 0 additions & 44 deletions
This file was deleted.

riscv-peripheral/.github/workflows/rust.yml

Lines changed: 0 additions & 22 deletions
This file was deleted.

riscv-peripheral/.github/workflows/rustfmt.yml

Lines changed: 0 additions & 18 deletions
This file was deleted.

riscv-peripheral/.gitignore

Lines changed: 0 additions & 17 deletions
This file was deleted.

0 commit comments

Comments
 (0)