Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an RP2350 HAL. #834

Merged
merged 19 commits into from
Aug 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions .github/workflows/rp2040_hal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,20 @@ on: [push, pull_request]
name: Check rp2040-hal
env:
PACKAGE: rp2040-hal
TARGET: thumbv6m-none-eabi
jobs:
build:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
target: thumbv6m-none-eabi
target: ${{ env.TARGET }}
- name: Install cargo-hack
run: |
curl -sSL https://github.com/taiki-e/cargo-hack/releases/download/v0.6.17/cargo-hack-x86_64-unknown-linux-gnu.tar.gz | tar xvzf - -C ~/.cargo/bin
- name: Build rp2040-hal
run: cd ${PACKAGE} && cargo hack build --optional-deps --each-feature --target=thumbv6m-none-eabi
run: cd ${PACKAGE} && cargo hack build --optional-deps --each-feature --target=${TARGET}
- name: Build rp2040-hal-macros
run: cd ${PACKAGE}-macros && cargo hack build --optional-deps --each-feature
test:
Expand All @@ -23,7 +24,7 @@ jobs:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
target: thumbv6m-none-eabi
target: ${{ env.TARGET }}
- name: Install cargo-hack
run: |
curl -sSL https://github.com/taiki-e/cargo-hack/releases/download/v0.6.17/cargo-hack-x86_64-unknown-linux-gnu.tar.gz | tar xvzf - -C ~/.cargo/bin
Expand All @@ -42,15 +43,15 @@ jobs:
- uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly-2024-01-30
target: thumbv6m-none-eabi
target: ${{ env.TARGET }}
- name: Install cargo-hack
run: |
curl -sSL https://github.com/taiki-e/cargo-hack/releases/download/v0.6.17/cargo-hack-x86_64-unknown-linux-gnu.tar.gz | tar xvzf - -C ~/.cargo/bin
- name: Install cargo-udeps
run: |
curl -sSL https://github.com/est31/cargo-udeps/releases/download/v0.1.45/cargo-udeps-v0.1.45-x86_64-unknown-linux-gnu.tar.gz | tar xvzf - --strip-components=2 -C ~/.cargo/bin ./cargo-udeps-v0.1.45-x86_64-unknown-linux-gnu/cargo-udeps
- name: Run cargo-udeps on rp2040-hal
run: cd ${PACKAGE} && cargo hack udeps --optional-deps --each-feature --target=thumbv6m-none-eabi
run: cd ${PACKAGE} && cargo hack udeps --optional-deps --each-feature --target=${TARGET}
- name: Run cargo-udeps on rp2040-hal-macros
run: cd ${PACKAGE}-macros && cargo hack udeps --optional-deps --each-feature
msrv:
Expand All @@ -61,14 +62,14 @@ jobs:
- uses: dtolnay/rust-toolchain@master
with:
toolchain: 1.77
target: thumbv6m-none-eabi
target: ${{ env.TARGET }}
- name: Install cargo-hack
run: |
curl -sSL https://github.com/taiki-e/cargo-hack/releases/download/v0.6.17/cargo-hack-x86_64-unknown-linux-gnu.tar.gz | tar xvzf - -C ~/.cargo/bin
- name: Use older version of regex
run: cd ${PACKAGE}-examples && cargo update -p regex --precise 1.9.3
- name: Build rp2040-hal (on MSRV)
run: cd ${PACKAGE} && cargo hack build --optional-deps --each-feature --target=thumbv6m-none-eabi
run: cd ${PACKAGE} && cargo hack build --optional-deps --each-feature --target=${TARGET}
- name: Build rp2040-hal-macros (on MSRV)
run: cd ${PACKAGE}-macros && cargo hack build --optional-deps --each-feature
fmt:
Expand All @@ -92,7 +93,7 @@ jobs:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
target: thumbv6m-none-eabi
target: ${{ env.TARGET }}
components: clippy
- name: Run cargo clippy
run: cd ${PACKAGE} && cargo clippy --target=thumbv6m-none-eabi
run: cd ${PACKAGE} && cargo clippy --target=${TARGET}
24 changes: 8 additions & 16 deletions .github/workflows/rp2040_hal_examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,30 @@ on: [push, pull_request]
name: Check rp2040-hal-examples
env:
PACKAGE: rp2040-hal-examples
TARGET: thumbv6m-none-eabi
jobs:
build:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
target: thumbv6m-none-eabi
- name: Install cargo-hack
run: |
curl -sSL https://github.com/taiki-e/cargo-hack/releases/download/v0.6.17/cargo-hack-x86_64-unknown-linux-gnu.tar.gz | tar xvzf - -C ~/.cargo/bin
target: ${{ env.TARGET }}
- name: Build
run: cd ${PACKAGE} && cargo hack build --optional-deps --each-feature
run: cd ${PACKAGE} && cargo build
udeps:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly-2024-01-30
target: thumbv6m-none-eabi
- name: Install cargo-hack
run: |
curl -sSL https://github.com/taiki-e/cargo-hack/releases/download/v0.6.17/cargo-hack-x86_64-unknown-linux-gnu.tar.gz | tar xvzf - -C ~/.cargo/bin
target: ${{ env.TARGET }}
- name: Install cargo-udeps
run: |
curl -sSL https://github.com/est31/cargo-udeps/releases/download/v0.1.45/cargo-udeps-v0.1.45-x86_64-unknown-linux-gnu.tar.gz | tar xvzf - --strip-components=2 -C ~/.cargo/bin ./cargo-udeps-v0.1.45-x86_64-unknown-linux-gnu/cargo-udeps
- name: Run cargo-udeps
run: cd ${PACKAGE} && cargo hack udeps --optional-deps --each-feature
run: cd ${PACKAGE} && cargo udeps
msrv:
name: Verify build on MSRV
runs-on: ubuntu-20.04
Expand All @@ -39,14 +34,11 @@ jobs:
- uses: dtolnay/rust-toolchain@master
with:
toolchain: 1.77
target: thumbv6m-none-eabi
- name: Install cargo-hack
run: |
curl -sSL https://github.com/taiki-e/cargo-hack/releases/download/v0.6.17/cargo-hack-x86_64-unknown-linux-gnu.tar.gz | tar xvzf - -C ~/.cargo/bin
target: ${{ env.TARGET }}
- name: Use older version of regex
run: cd ${PACKAGE} && cargo update -p regex --precise 1.9.3
- name: Build on MSRV
run: cd ${PACKAGE} && cargo hack build --optional-deps --each-feature
run: cd ${PACKAGE} && cargo build
fmt:
runs-on: ubuntu-20.04
env:
Expand All @@ -66,7 +58,7 @@ jobs:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
target: thumbv6m-none-eabi
target: ${{ env.TARGET }}
components: clippy
- name: Run cargo clippy
run: cd ${PACKAGE} && cargo clippy
99 changes: 99 additions & 0 deletions .github/workflows/rp235x_hal_arm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
on: [push, pull_request]
name: Check rp235x-hal on Arm
env:
PACKAGE: rp235x-hal
TARGET: thumbv8m.main-none-eabihf
jobs:
build:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
target: ${{ env.TARGET }}
- name: Install cargo-hack
run: |
curl -sSL https://github.com/taiki-e/cargo-hack/releases/download/v0.6.17/cargo-hack-x86_64-unknown-linux-gnu.tar.gz | tar xvzf - -C ~/.cargo/bin
- name: Build rp235x-hal
run: cd ${PACKAGE} && cargo hack build --optional-deps --each-feature --target=${TARGET}
- name: Build rp235x-hal-macros
run: cd ${PACKAGE}-macros && cargo hack build --optional-deps --each-feature
test:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
target: ${{ env.TARGET }}
- name: Install cargo-hack
run: |
curl -sSL https://github.com/taiki-e/cargo-hack/releases/download/v0.6.17/cargo-hack-x86_64-unknown-linux-gnu.tar.gz | tar xvzf - -C ~/.cargo/bin
- name: Test rp235x-hal
run: cd ${PACKAGE} && cargo hack test --optional-deps --each-feature --tests --features critical-section-impl
- name: Test rp235x-hal docs
run: cd ${PACKAGE} && cargo hack test --optional-deps --each-feature --doc --features critical-section-impl
- name: Test rp235x-hal-macros
run: cd ${PACKAGE}-macros && cargo hack test --optional-deps --tests --each-feature
- name: Test rp235x-hal-macros docs
run: cd ${PACKAGE}-macros && cargo hack test --optional-deps --doc --each-feature
udeps:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly-2024-01-30
target: ${{ env.TARGET }}
- name: Install cargo-hack
run: |
curl -sSL https://github.com/taiki-e/cargo-hack/releases/download/v0.6.17/cargo-hack-x86_64-unknown-linux-gnu.tar.gz | tar xvzf - -C ~/.cargo/bin
- name: Install cargo-udeps
run: |
curl -sSL https://github.com/est31/cargo-udeps/releases/download/v0.1.45/cargo-udeps-v0.1.45-x86_64-unknown-linux-gnu.tar.gz | tar xvzf - --strip-components=2 -C ~/.cargo/bin ./cargo-udeps-v0.1.45-x86_64-unknown-linux-gnu/cargo-udeps
- name: Run cargo-udeps on rp235x-hal
run: cd ${PACKAGE} && cargo hack udeps --optional-deps --each-feature --target=${TARGET}
- name: Run cargo-udeps on rp235x-hal-macros
run: cd ${PACKAGE}-macros && cargo hack udeps --optional-deps --each-feature
msrv:
name: Verify build on MSRV
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: 1.77
target: ${{ env.TARGET }}
- name: Install cargo-hack
run: |
curl -sSL https://github.com/taiki-e/cargo-hack/releases/download/v0.6.17/cargo-hack-x86_64-unknown-linux-gnu.tar.gz | tar xvzf - -C ~/.cargo/bin
- name: Use older version of regex
run: cd ${PACKAGE}-examples && cargo update -p regex --precise 1.9.3
- name: Build rp235x-hal (on MSRV)
run: cd ${PACKAGE} && cargo hack build --optional-deps --each-feature --target=${TARGET}
- name: Build rp235x-hal-macros (on MSRV)
run: cd ${PACKAGE}-macros && cargo hack build --optional-deps --each-feature
fmt:
runs-on: ubuntu-20.04
env:
RUSTFLAGS: "-D warnings"
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- name: Check format of rp235x-hal
run: cd ${PACKAGE} && cargo fmt -- --check
- name: Check format of rp235x-hal-macros
run: cd ${PACKAGE}-macros && cargo fmt -- --check
clippy:
runs-on: ubuntu-20.04
env:
RUSTFLAGS: "-D warnings"
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
target: ${{ env.TARGET }}
components: clippy
- name: Run cargo clippy
run: cd ${PACKAGE} && cargo clippy --target=${TARGET}
64 changes: 64 additions & 0 deletions .github/workflows/rp235x_hal_examples_arm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
on: [push, pull_request]
name: Check rp235x-hal-examples on Arm
env:
PACKAGE: rp235x-hal-examples
TARGET: thumbv8m.main-none-eabihf
jobs:
build:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
target: ${{ env.TARGET }}
- name: Build
run: cd ${PACKAGE} && cargo build --target=${TARGET}
udeps:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: nightly-2024-01-30
target: ${{ env.TARGET }}
- name: Install cargo-udeps
run: |
curl -sSL https://github.com/est31/cargo-udeps/releases/download/v0.1.45/cargo-udeps-v0.1.45-x86_64-unknown-linux-gnu.tar.gz | tar xvzf - --strip-components=2 -C ~/.cargo/bin ./cargo-udeps-v0.1.45-x86_64-unknown-linux-gnu/cargo-udeps
- name: Run cargo-udeps
run: cd ${PACKAGE} && cargo udeps --target=${TARGET}
msrv:
name: Verify build on MSRV
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: 1.77
target: ${{ env.TARGET }}
- name: Use older version of regex
run: cd ${PACKAGE} && cargo update -p regex --precise 1.9.3
- name: Build on MSRV
run: cd ${PACKAGE} && cargo build --target=${TARGET}
fmt:
runs-on: ubuntu-20.04
env:
RUSTFLAGS: "-D warnings"
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- name: Check format
run: cd ${PACKAGE} && cargo fmt -- --check
clippy:
runs-on: ubuntu-20.04
env:
RUSTFLAGS: "-D warnings"
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
target: ${{ env.TARGET }}
components: clippy
- name: Run cargo clippy
run: cd ${PACKAGE} && cargo clippy --target=${TARGET}
66 changes: 66 additions & 0 deletions .github/workflows/rp235x_hal_examples_riscv.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
on: [push, pull_request]
name: Check rp235x-hal-examples on RISC-V
env:
PACKAGE: rp235x-hal-examples
TARGET: riscv32imac-unknown-none-elf
jobs:
build:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
target: ${{ env.TARGET }}
- name: Build
run: |
cd ${PACKAGE}
cat riscv_examples.txt | while read example; do
echo "Building $example"
cargo build --target=${TARGET} --bin $example
done
msrv:
name: Verify build on MSRV
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: 1.77
target: ${{ env.TARGET }}
- name: Use older version of regex
run: cd ${PACKAGE} && cargo update -p regex --precise 1.9.3
- name: Build on MSRV
run: |
cd ${PACKAGE}
cat riscv_examples.txt | while read example; do
echo "Building $example"
cargo build --target=${TARGET} --bin $example
done
fmt:
runs-on: ubuntu-20.04
env:
RUSTFLAGS: "-D warnings"
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- name: Check format
run: cd ${PACKAGE} && cargo fmt -- --check
clippy:
runs-on: ubuntu-20.04
env:
RUSTFLAGS: "-D warnings"
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
target: ${{ env.TARGET }}
components: clippy
- name: Run cargo clippy
run: |
cd ${PACKAGE}
cat riscv_examples.txt | while read example; do
echo "Checking $example"
cargo clippy --target=${TARGET} --bin $example
done
Loading