Skip to content

Commit

Permalink
Merge pull request #21 from nerwalt/nrf9120
Browse files Browse the repository at this point in the history
nrf9120
  • Loading branch information
Dirbaio authored Jul 13, 2024
2 parents 9097749 + 5ce90e2 commit 4588855
Show file tree
Hide file tree
Showing 694 changed files with 163,357 additions and 39 deletions.
File renamed without changes.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ cortex-m-rt = ">=0.6.15,<0.8"

# meta-dependencies (upgrade as needed, they apply to all PACs):
# @svd2rust = 0.25.1
# @form = 0.10.0
# @form = 0.12.1
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ Every nRF chip has its own PAC, listed below:
| `nrf5340-app-pac` | [![docs.rs](https://docs.rs/nrf5340-app-pac/badge.svg)](https://docs.rs/nrf5340-app-pac) | [![crates.io](https://img.shields.io/crates/d/nrf5340-app-pac.svg)](https://crates.io/crates/nrf5340-app-pac) | `thumbv8m.main-none-eabihf` |
| `nrf5340-net-pac` | [![docs.rs](https://docs.rs/nrf5340-net-pac/badge.svg)](https://docs.rs/nrf5340-net-pac) | [![crates.io](https://img.shields.io/crates/d/nrf5340-net-pac.svg)](https://crates.io/crates/nrf5340-net-pac) | `thumbv8m.main-none-eabihf` |
| `nrf9160-pac` | [![docs.rs](https://docs.rs/nrf9160-pac/badge.svg)](https://docs.rs/nrf9160-pac) | [![crates.io](https://img.shields.io/crates/d/nrf9160-pac.svg)](https://crates.io/crates/nrf9160-pac) | `thumbv8m.main-none-eabihf` |
| `nrf9120-pac` | [![docs.rs](https://docs.rs/nrf9120-pac/badge.svg)](https://docs.rs/nrf9120-pac) | [![crates.io](https://img.shields.io/crates/d/nrf9120-pac.svg)](https://crates.io/crates/nrf9120-pac) | `thumbv8m.main-none-eabihf` |
<!-- TODO: this table could be autogenerated -->

## Device Reference Manuals from Nordic
Expand All @@ -46,5 +47,9 @@ Every nRF chip has its own PAC, listed below:
| [`nRF52840`](https://www.nordicsemi.com/Products/nRF52840) | [`v1.1`](https://infocenter.nordicsemi.com/pdf/nRF52840_PS_v1.1.pdf) | [`v1.2`](https://infocenter.nordicsemi.com/pdf/nRF52840_DK_User_Guide_v1.2.pdf) |
| [`nRF5340`](https://www.nordicsemi.com/Products/nRF5340) | [`v1.1`](https://infocenter.nordicsemi.com/pdf/nRF5340_PS_v1.1.pdf) | [`v1.0.0`](https://infocenter.nordicsemi.com/pdf/nRF5340_DK_User_Guide_20210304.pdf) |
| [`nRF9160`](https://www.nordicsemi.com/Products/nrf9160) | [`v2.0`](https://infocenter.nordicsemi.com/pdf/nRF9160_PS_v2.0.pdf) | [`v0.9.3`](https://infocenter.nordicsemi.com/pdf/nRF9160_DK_HW_User_Guide_v0.9.3.pdf) |
| [`nRF9161 (nrf9120)`](https://www.nordicsemi.com/Products/nRF9161) | [`v1.0`](https://infocenter.nordicsemi.com/pdf/nRF9161_PS_v1.0.pdf) | [`v0.9.1`](https://infocenter.nordicsemi.com/pdf/nRF9161_DK_HW_User_Guide_v0.9.1.pdf) |
| [`nRF9151 (nrf9120)`](https://www.nordicsemi.com/Products/nRF9151) | ** | ** |

\* These devices do not have a separate development kit and share the [NRF52 DK](https://www.nordicsemi.com/Software-and-tools/Development-Kits/nRF52-DK)

\*\* As of 2024-6-28, the Product Specification and the DK Reference Guide have not been published for the nRF9151.
2 changes: 0 additions & 2 deletions pacs/nrf51-pac/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#![doc = "Peripheral access API for NRF51 microcontrollers (generated using svd2rust v0.25.1 ( ))\n\nYou can find an overview of the generated API [here].\n\nAPI features to be included in the [next]
svd2rust release can be generated by cloning the svd2rust [repository], checking out the above commit, and running `cargo doc --open`.\n\n[here]: https://docs.rs/svd2rust/0.25.1/svd2rust/#peripheral-api\n[next]: https://github.com/rust-embedded/svd2rust/blob/master/CHANGELOG.md#unreleased\n[repository]: https://github.com/rust-embedded/svd2rust"]
#![deny(const_err)]
#![deny(dead_code)]
#![deny(improper_ctypes)]
#![deny(missing_docs)]
Expand All @@ -9,7 +8,6 @@ svd2rust release can be generated by cloning the svd2rust [repository], checking
#![deny(overflowing_literals)]
#![deny(path_statements)]
#![deny(patterns_in_fns_without_body)]
#![deny(private_in_public)]
#![deny(unconditional_recursion)]
#![deny(unused_allocation)]
#![deny(unused_comparisons)]
Expand Down
2 changes: 0 additions & 2 deletions pacs/nrf52805-pac/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#![doc = "Peripheral access API for NRF52805 microcontrollers (generated using svd2rust v0.25.1 ( ))\n\nYou can find an overview of the generated API [here].\n\nAPI features to be included in the [next]
svd2rust release can be generated by cloning the svd2rust [repository], checking out the above commit, and running `cargo doc --open`.\n\n[here]: https://docs.rs/svd2rust/0.25.1/svd2rust/#peripheral-api\n[next]: https://github.com/rust-embedded/svd2rust/blob/master/CHANGELOG.md#unreleased\n[repository]: https://github.com/rust-embedded/svd2rust"]
#![deny(const_err)]
#![deny(dead_code)]
#![deny(improper_ctypes)]
#![deny(missing_docs)]
Expand All @@ -9,7 +8,6 @@ svd2rust release can be generated by cloning the svd2rust [repository], checking
#![deny(overflowing_literals)]
#![deny(path_statements)]
#![deny(patterns_in_fns_without_body)]
#![deny(private_in_public)]
#![deny(unconditional_recursion)]
#![deny(unused_allocation)]
#![deny(unused_comparisons)]
Expand Down
2 changes: 0 additions & 2 deletions pacs/nrf52810-pac/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#![doc = "Peripheral access API for NRF52810 microcontrollers (generated using svd2rust v0.25.1 ( ))\n\nYou can find an overview of the generated API [here].\n\nAPI features to be included in the [next]
svd2rust release can be generated by cloning the svd2rust [repository], checking out the above commit, and running `cargo doc --open`.\n\n[here]: https://docs.rs/svd2rust/0.25.1/svd2rust/#peripheral-api\n[next]: https://github.com/rust-embedded/svd2rust/blob/master/CHANGELOG.md#unreleased\n[repository]: https://github.com/rust-embedded/svd2rust"]
#![deny(const_err)]
#![deny(dead_code)]
#![deny(improper_ctypes)]
#![deny(missing_docs)]
Expand All @@ -9,7 +8,6 @@ svd2rust release can be generated by cloning the svd2rust [repository], checking
#![deny(overflowing_literals)]
#![deny(path_statements)]
#![deny(patterns_in_fns_without_body)]
#![deny(private_in_public)]
#![deny(unconditional_recursion)]
#![deny(unused_allocation)]
#![deny(unused_comparisons)]
Expand Down
2 changes: 0 additions & 2 deletions pacs/nrf52811-pac/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#![doc = "Peripheral access API for NRF52811 microcontrollers (generated using svd2rust v0.25.1 ( ))\n\nYou can find an overview of the generated API [here].\n\nAPI features to be included in the [next]
svd2rust release can be generated by cloning the svd2rust [repository], checking out the above commit, and running `cargo doc --open`.\n\n[here]: https://docs.rs/svd2rust/0.25.1/svd2rust/#peripheral-api\n[next]: https://github.com/rust-embedded/svd2rust/blob/master/CHANGELOG.md#unreleased\n[repository]: https://github.com/rust-embedded/svd2rust"]
#![deny(const_err)]
#![deny(dead_code)]
#![deny(improper_ctypes)]
#![deny(missing_docs)]
Expand All @@ -9,7 +8,6 @@ svd2rust release can be generated by cloning the svd2rust [repository], checking
#![deny(overflowing_literals)]
#![deny(path_statements)]
#![deny(patterns_in_fns_without_body)]
#![deny(private_in_public)]
#![deny(unconditional_recursion)]
#![deny(unused_allocation)]
#![deny(unused_comparisons)]
Expand Down
2 changes: 0 additions & 2 deletions pacs/nrf52820-pac/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#![doc = "Peripheral access API for NRF52820 microcontrollers (generated using svd2rust v0.25.1 ( ))\n\nYou can find an overview of the generated API [here].\n\nAPI features to be included in the [next]
svd2rust release can be generated by cloning the svd2rust [repository], checking out the above commit, and running `cargo doc --open`.\n\n[here]: https://docs.rs/svd2rust/0.25.1/svd2rust/#peripheral-api\n[next]: https://github.com/rust-embedded/svd2rust/blob/master/CHANGELOG.md#unreleased\n[repository]: https://github.com/rust-embedded/svd2rust"]
#![deny(const_err)]
#![deny(dead_code)]
#![deny(improper_ctypes)]
#![deny(missing_docs)]
Expand All @@ -9,7 +8,6 @@ svd2rust release can be generated by cloning the svd2rust [repository], checking
#![deny(overflowing_literals)]
#![deny(path_statements)]
#![deny(patterns_in_fns_without_body)]
#![deny(private_in_public)]
#![deny(unconditional_recursion)]
#![deny(unused_allocation)]
#![deny(unused_comparisons)]
Expand Down
2 changes: 0 additions & 2 deletions pacs/nrf52832-pac/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#![doc = "Peripheral access API for NRF52 microcontrollers (generated using svd2rust v0.25.1 ( ))\n\nYou can find an overview of the generated API [here].\n\nAPI features to be included in the [next]
svd2rust release can be generated by cloning the svd2rust [repository], checking out the above commit, and running `cargo doc --open`.\n\n[here]: https://docs.rs/svd2rust/0.25.1/svd2rust/#peripheral-api\n[next]: https://github.com/rust-embedded/svd2rust/blob/master/CHANGELOG.md#unreleased\n[repository]: https://github.com/rust-embedded/svd2rust"]
#![deny(const_err)]
#![deny(dead_code)]
#![deny(improper_ctypes)]
#![deny(missing_docs)]
Expand All @@ -9,7 +8,6 @@ svd2rust release can be generated by cloning the svd2rust [repository], checking
#![deny(overflowing_literals)]
#![deny(path_statements)]
#![deny(patterns_in_fns_without_body)]
#![deny(private_in_public)]
#![deny(unconditional_recursion)]
#![deny(unused_allocation)]
#![deny(unused_comparisons)]
Expand Down
2 changes: 0 additions & 2 deletions pacs/nrf52833-pac/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#![doc = "Peripheral access API for NRF52833 microcontrollers (generated using svd2rust v0.25.1 ( ))\n\nYou can find an overview of the generated API [here].\n\nAPI features to be included in the [next]
svd2rust release can be generated by cloning the svd2rust [repository], checking out the above commit, and running `cargo doc --open`.\n\n[here]: https://docs.rs/svd2rust/0.25.1/svd2rust/#peripheral-api\n[next]: https://github.com/rust-embedded/svd2rust/blob/master/CHANGELOG.md#unreleased\n[repository]: https://github.com/rust-embedded/svd2rust"]
#![deny(const_err)]
#![deny(dead_code)]
#![deny(improper_ctypes)]
#![deny(missing_docs)]
Expand All @@ -9,7 +8,6 @@ svd2rust release can be generated by cloning the svd2rust [repository], checking
#![deny(overflowing_literals)]
#![deny(path_statements)]
#![deny(patterns_in_fns_without_body)]
#![deny(private_in_public)]
#![deny(unconditional_recursion)]
#![deny(unused_allocation)]
#![deny(unused_comparisons)]
Expand Down
2 changes: 0 additions & 2 deletions pacs/nrf52840-pac/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#![doc = "Peripheral access API for NRF52840 microcontrollers (generated using svd2rust v0.25.1 ( ))\n\nYou can find an overview of the generated API [here].\n\nAPI features to be included in the [next]
svd2rust release can be generated by cloning the svd2rust [repository], checking out the above commit, and running `cargo doc --open`.\n\n[here]: https://docs.rs/svd2rust/0.25.1/svd2rust/#peripheral-api\n[next]: https://github.com/rust-embedded/svd2rust/blob/master/CHANGELOG.md#unreleased\n[repository]: https://github.com/rust-embedded/svd2rust"]
#![deny(const_err)]
#![deny(dead_code)]
#![deny(improper_ctypes)]
#![deny(missing_docs)]
Expand All @@ -9,7 +8,6 @@ svd2rust release can be generated by cloning the svd2rust [repository], checking
#![deny(overflowing_literals)]
#![deny(path_statements)]
#![deny(patterns_in_fns_without_body)]
#![deny(private_in_public)]
#![deny(unconditional_recursion)]
#![deny(unused_allocation)]
#![deny(unused_comparisons)]
Expand Down
2 changes: 0 additions & 2 deletions pacs/nrf5340-app-pac/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#![doc = "Peripheral access API for NRF5340_APPLICATION microcontrollers (generated using svd2rust v0.25.1 ( ))\n\nYou can find an overview of the generated API [here].\n\nAPI features to be included in the [next]
svd2rust release can be generated by cloning the svd2rust [repository], checking out the above commit, and running `cargo doc --open`.\n\n[here]: https://docs.rs/svd2rust/0.25.1/svd2rust/#peripheral-api\n[next]: https://github.com/rust-embedded/svd2rust/blob/master/CHANGELOG.md#unreleased\n[repository]: https://github.com/rust-embedded/svd2rust"]
#![deny(const_err)]
#![deny(dead_code)]
#![deny(improper_ctypes)]
#![deny(missing_docs)]
Expand All @@ -9,7 +8,6 @@ svd2rust release can be generated by cloning the svd2rust [repository], checking
#![deny(overflowing_literals)]
#![deny(path_statements)]
#![deny(patterns_in_fns_without_body)]
#![deny(private_in_public)]
#![deny(unconditional_recursion)]
#![deny(unused_allocation)]
#![deny(unused_comparisons)]
Expand Down
2 changes: 0 additions & 2 deletions pacs/nrf5340-net-pac/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#![doc = "Peripheral access API for NRF5340_NETWORK microcontrollers (generated using svd2rust v0.25.1 ( ))\n\nYou can find an overview of the generated API [here].\n\nAPI features to be included in the [next]
svd2rust release can be generated by cloning the svd2rust [repository], checking out the above commit, and running `cargo doc --open`.\n\n[here]: https://docs.rs/svd2rust/0.25.1/svd2rust/#peripheral-api\n[next]: https://github.com/rust-embedded/svd2rust/blob/master/CHANGELOG.md#unreleased\n[repository]: https://github.com/rust-embedded/svd2rust"]
#![deny(const_err)]
#![deny(dead_code)]
#![deny(improper_ctypes)]
#![deny(missing_docs)]
Expand All @@ -9,7 +8,6 @@ svd2rust release can be generated by cloning the svd2rust [repository], checking
#![deny(overflowing_literals)]
#![deny(path_statements)]
#![deny(patterns_in_fns_without_body)]
#![deny(private_in_public)]
#![deny(unconditional_recursion)]
#![deny(unused_allocation)]
#![deny(unused_comparisons)]
Expand Down
21 changes: 21 additions & 0 deletions pacs/nrf9120-pac/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[package]
name = "nrf9120-pac"
description = "Peripheral Access Crate for Nordic's nrf9120 microcontroller"
documentation = "https://docs.rs/nrf9120-pac"
version.workspace = true
edition.workspace = true
keywords.workspace = true
license.workspace = true
repository.workspace = true
readme.workspace = true

[dependencies]
cortex-m.workspace = true
vcell.workspace = true

[dependencies.cortex-m-rt]
optional = true
workspace = true

[features]
rt = ["cortex-m-rt/device"]
16 changes: 16 additions & 0 deletions pacs/nrf9120-pac/build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
use std::env;
use std::fs::File;
use std::io::Write;
use std::path::PathBuf;
fn main() {
if env::var_os("CARGO_FEATURE_RT").is_some() {
let out = &PathBuf::from(env::var_os("OUT_DIR").unwrap());
File::create(out.join("device.x"))
.unwrap()
.write_all(include_bytes!("device.x"))
.unwrap();
println!("cargo:rustc-link-search={}", out.display());
println!("cargo:rerun-if-changed=device.x");
}
println!("cargo:rerun-if-changed=build.rs");
}
32 changes: 32 additions & 0 deletions pacs/nrf9120-pac/device.x
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
PROVIDE(SPU = DefaultHandler);
PROVIDE(CLOCK_POWER = DefaultHandler);
PROVIDE(SPIM0_SPIS0_TWIM0_TWIS0_UARTE0 = DefaultHandler);
PROVIDE(SPIM1_SPIS1_TWIM1_TWIS1_UARTE1 = DefaultHandler);
PROVIDE(SPIM2_SPIS2_TWIM2_TWIS2_UARTE2 = DefaultHandler);
PROVIDE(SPIM3_SPIS3_TWIM3_TWIS3_UARTE3 = DefaultHandler);
PROVIDE(GPIOTE0 = DefaultHandler);
PROVIDE(SAADC = DefaultHandler);
PROVIDE(TIMER0 = DefaultHandler);
PROVIDE(TIMER1 = DefaultHandler);
PROVIDE(TIMER2 = DefaultHandler);
PROVIDE(RTC0 = DefaultHandler);
PROVIDE(RTC1 = DefaultHandler);
PROVIDE(WDT = DefaultHandler);
PROVIDE(EGU0 = DefaultHandler);
PROVIDE(EGU1 = DefaultHandler);
PROVIDE(EGU2 = DefaultHandler);
PROVIDE(EGU3 = DefaultHandler);
PROVIDE(EGU4 = DefaultHandler);
PROVIDE(EGU5 = DefaultHandler);
PROVIDE(PWM0 = DefaultHandler);
PROVIDE(PWM1 = DefaultHandler);
PROVIDE(PWM2 = DefaultHandler);
PROVIDE(PWM3 = DefaultHandler);
PROVIDE(PDM = DefaultHandler);
PROVIDE(I2S = DefaultHandler);
PROVIDE(IPC = DefaultHandler);
PROVIDE(FPU = DefaultHandler);
PROVIDE(GPIOTE1 = DefaultHandler);
PROVIDE(KMU = DefaultHandler);
PROVIDE(CRYPTOCELL = DefaultHandler);

20 changes: 20 additions & 0 deletions pacs/nrf9120-pac/src/approtect_ns.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#[doc = r"Register block"]
#[repr(C)]
pub struct RegisterBlock {
_reserved0: [u8; 0x0e00],
#[doc = "0xe00 - Unspecified"]
pub secureapprotect: SECUREAPPROTECT,
_reserved1: [u8; 0x0c],
#[doc = "0xe10 - Unspecified"]
pub approtect: APPROTECT,
}
#[doc = "Unspecified"]
pub use secureapprotect::SECUREAPPROTECT;
#[doc = r"Cluster"]
#[doc = "Unspecified"]
pub mod secureapprotect;
#[doc = "Unspecified"]
pub use approtect::APPROTECT;
#[doc = r"Cluster"]
#[doc = "Unspecified"]
pub mod approtect;
25 changes: 25 additions & 0 deletions pacs/nrf9120-pac/src/approtect_ns/approtect.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#[doc = r"Register block"]
#[repr(C)]
pub struct APPROTECT {
_reserved_0_disable: [u8; 0x04],
}
impl APPROTECT {
#[doc = "0x00 - Software force APPROTECT mechanism"]
#[inline(always)]
pub fn forceprotect(&self) -> &FORCEPROTECT {
unsafe { &*(((self as *const Self) as *const u8).add(0usize) as *const FORCEPROTECT) }
}
#[doc = "0x00 - Software disable APPROTECT mechanism"]
#[inline(always)]
pub fn disable(&self) -> &DISABLE {
unsafe { &*(((self as *const Self) as *const u8).add(0usize) as *const DISABLE) }
}
}
#[doc = "DISABLE (rw) register accessor: an alias for `Reg<DISABLE_SPEC>`"]
pub type DISABLE = crate::Reg<disable::DISABLE_SPEC>;
#[doc = "Software disable APPROTECT mechanism"]
pub mod disable;
#[doc = "FORCEPROTECT (rw) register accessor: an alias for `Reg<FORCEPROTECT_SPEC>`"]
pub type FORCEPROTECT = crate::Reg<forceprotect::FORCEPROTECT_SPEC>;
#[doc = "Software force APPROTECT mechanism"]
pub mod forceprotect;
Loading

0 comments on commit 4588855

Please sign in to comment.