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

52811 #227

Merged
merged 9 commits into from
Sep 28, 2020
Merged

52811 #227

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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
- PWM module ([#200]).
- I2S module ([#201]).
- SPIS module ([#226]).
- Add support for the nRF52811 ([#227]).

### Fixes

Expand Down
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
members = [
"xtask",
"nrf52810-hal",
"nrf52811-hal",
"nrf52832-hal",
"nrf52833-hal",
"nrf52840-hal",
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Every nRF chip has its own crate, listed below:
|-------|------|-----------|
| [`nrf51-hal`](./nrf51-hal) | [![docs.rs](https://docs.rs/nrf51-hal/badge.svg)](https://docs.rs/nrf51-hal) | [![crates.io](https://img.shields.io/crates/d/nrf51-hal.svg)](https://crates.io/crates/nrf51-hal) |
| [`nrf52810-hal`](./nrf52810-hal) | [![docs.rs](https://docs.rs/nrf52810-hal/badge.svg)](https://docs.rs/nrf52810-hal) | [![crates.io](https://img.shields.io/crates/d/nrf52810-hal.svg)](https://crates.io/crates/nrf52810-hal) |
| [`nrf52811-hal`](./nrf52811-hal) | [![docs.rs](https://docs.rs/nrf52811-hal/badge.svg)](https://docs.rs/nrf52811-hal) | [![crates.io](https://img.shields.io/crates/d/nrf52811-hal.svg)](https://crates.io/crates/nrf52811-hal) |
| [`nrf52832-hal`](./nrf52832-hal) | [![docs.rs](https://docs.rs/nrf52832-hal/badge.svg)](https://docs.rs/nrf52832-hal) | [![crates.io](https://img.shields.io/crates/d/nrf52832-hal.svg)](https://crates.io/crates/nrf52832-hal) |
| [`nrf52833-hal`](./nrf52833-hal) | [![docs.rs](https://docs.rs/nrf52833-hal/badge.svg)](https://docs.rs/nrf52833-hal) | [![crates.io](https://img.shields.io/crates/d/nrf52833-hal.svg)](https://crates.io/crates/nrf52833-hal) |
| [`nrf52840-hal`](./nrf52840-hal) | [![docs.rs](https://docs.rs/nrf52840-hal/badge.svg)](https://docs.rs/nrf52840-hal) | [![crates.io](https://img.shields.io/crates/d/nrf52840-hal.svg)](https://crates.io/crates/nrf52840-hal) |
Expand All @@ -28,6 +29,7 @@ Every nRF chip has its own crate, listed below:
| Device | Product Specification | DK Reference Guide |
|-------|------|-----------|
| [`nRF52810`](https://www.nordicsemi.com/Products/Low-power-short-range-wireless/nRF52810) | [`v1.3`](https://infocenter.nordicsemi.com/pdf/nRF52810_PS_v1.3.pdf) | [`v1.3.1*`](https://infocenter.nordicsemi.com/pdf/nRF52_DK_User_Guide_v1.3.1.pdf) |
| [`nRF52811`](https://www.nordicsemi.com/Products/Low-power-short-range-wireless/nRF52811) | [`v1.0`](https://infocenter.nordicsemi.com/pdf/nRF52811_PS_v1.0.pdf) | [`v1.3.1*`](https://infocenter.nordicsemi.com/pdf/nRF52_DK_User_Guide_v1.3.1.pdf) |
| [`nRF52832`](https://www.nordicsemi.com/Products/Low-power-short-range-wireless/nRF52832) | [`v1.4`](https://infocenter.nordicsemi.com/pdf/nRF52832_PS_v1.4.pdf) | [`v1.3.1*`](https://infocenter.nordicsemi.com/pdf/nRF52_DK_User_Guide_v1.3.1.pdf) |
| [`nRF52833`](https://www.nordicsemi.com/Products/Low-power-short-range-wireless/nRF52833) | [`v1.3`](https://infocenter.nordicsemi.com/pdf/nRF52833_PS_v1.3.pdf) | [`v1.0.1`](http://infocenter.nordicsemi.com/pdf/nRF52833_DK_User_Guide_v1.0.1.pdf) |
| [`nRF52840`](https://www.nordicsemi.com/Products/Low-power-short-range-wireless/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) |
Expand Down
2 changes: 2 additions & 0 deletions examples/ccm-demo/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ rtt-target = {version = "0.2.0", features = ["cortex-m"] }
rand_core = "0.5.1"

nrf52810-hal = { path = "../../nrf52810-hal", features = ["rt"], optional = true }
nrf52811-hal = { path = "../../nrf52811-hal", features = ["rt"], optional = true }
nrf52832-hal = { path = "../../nrf52832-hal", features = ["rt"], optional = true }
nrf52840-hal = { path = "../../nrf52840-hal", features = ["rt"], optional = true }
nrf52833-hal = { path = "../../nrf52833-hal", features = ["rt"], optional = true }
Expand All @@ -23,6 +24,7 @@ test = false

[features]
52810 = ["nrf52810-hal"]
52811 = ["nrf52811-hal"]
52832 = ["nrf52832-hal"]
52840 = ["nrf52840-hal"]
52833 = ["nrf52833-hal"]
1 change: 1 addition & 0 deletions examples/ccm-demo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

Choose the microcontroller with one of the following features:
- 52810
- 52811
- 52832
- 52840

Expand Down
2 changes: 2 additions & 0 deletions examples/ccm-demo/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
// Import the right HAL/PAC crate, depending on the target chip
#[cfg(feature = "52810")]
pub use nrf52810_hal as hal;
#[cfg(feature = "52811")]
pub use nrf52811_hal as hal;
#[cfg(feature = "52832")]
pub use nrf52832_hal as hal;
#[cfg(feature = "52833")]
Expand Down
2 changes: 2 additions & 0 deletions examples/ecb-demo/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ cortex-m-rt = "0.6.12"
rtt-target = {version = "0.2.0", features = ["cortex-m"] }

nrf52810-hal = { path = "../../nrf52810-hal", features = ["rt"], optional = true }
nrf52811-hal = { path = "../../nrf52811-hal", features = ["rt"], optional = true }
nrf52832-hal = { path = "../../nrf52832-hal", features = ["rt"], optional = true }
nrf52840-hal = { path = "../../nrf52840-hal", features = ["rt"], optional = true }
nrf52833-hal = { path = "../../nrf52833-hal", features = ["rt"], optional = true }
Expand All @@ -24,6 +25,7 @@ test = false
[features]
51 = ["nrf51-hal"]
52810 = ["nrf52810-hal"]
52811 = ["nrf52811-hal"]
52832 = ["nrf52832-hal"]
52840 = ["nrf52840-hal"]
52833 = ["nrf52833-hal"]
1 change: 1 addition & 0 deletions examples/ecb-demo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
Choose the microcontroller with one of the following features:
- 51
- 52810
- 52811
- 52832
- 52840

Expand Down
2 changes: 2 additions & 0 deletions examples/ecb-demo/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
pub use nrf51_hal as hal;
#[cfg(feature = "52810")]
pub use nrf52810_hal as hal;
#[cfg(feature = "52811")]
pub use nrf52811_hal as hal;
#[cfg(feature = "52832")]
pub use nrf52832_hal as hal;
#[cfg(feature = "52833")]
Expand Down
2 changes: 2 additions & 0 deletions examples/ppi-demo/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ cortex-m-rt = "0.6.12"
rtt-target = {version = "0.2.0", features = ["cortex-m"] }

nrf52810-hal = { path = "../../nrf52810-hal", features = ["rt"], optional = true }
nrf52811-hal = { path = "../../nrf52811-hal", features = ["rt"], optional = true }
nrf52832-hal = { path = "../../nrf52832-hal", features = ["rt"], optional = true }
nrf52840-hal = { path = "../../nrf52840-hal", features = ["rt"], optional = true }
nrf52833-hal = { path = "../../nrf52833-hal", features = ["rt"], optional = true }
Expand All @@ -24,6 +25,7 @@ test = false
[features]
51 = ["nrf51-hal"]
52810 = ["nrf52810-hal"]
52811 = ["nrf52811-hal"]
52832 = ["nrf52832-hal"]
52840 = ["nrf52840-hal"]
52833 = ["nrf52833-hal"]
1 change: 1 addition & 0 deletions examples/ppi-demo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
Choose the microcontroller with one of the following features:
- 51
- 52810
- 52811
- 52832
- 52840

Expand Down
4 changes: 4 additions & 0 deletions examples/ppi-demo/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#[cfg(not(any(
feature = "51",
feature = "52810",
feature = "52811",
feature = "52832",
feature = "52833",
feature = "52840"
Expand All @@ -12,6 +13,7 @@ compile_error!(
"This example requires one of the following device features enabled:
51
52810
52811
52832
52833
52840"
Expand All @@ -22,6 +24,8 @@ compile_error!(
pub use nrf51_hal as hal;
#[cfg(feature = "52810")]
pub use nrf52810_hal as hal;
#[cfg(feature = "52811")]
pub use nrf52811_hal as hal;
#[cfg(feature = "52832")]
pub use nrf52832_hal as hal;
#[cfg(feature = "52833")]
Expand Down
5 changes: 5 additions & 0 deletions examples/rtic-demo/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ optional = true
path = "../../nrf52810-hal"
optional = true

[dependencies.nrf52811-hal]
path = "../../nrf52811-hal"
optional = true

[dependencies.nrf52832-hal]
path = "../../nrf52832-hal"
optional = true
Expand All @@ -29,5 +33,6 @@ optional = true
[features]
51 = ["nrf51-hal"]
52810 = ["nrf52810-hal"]
52811 = ["nrf52811-hal"]
52832 = ["nrf52832-hal"]
52840 = ["nrf52840-hal"]
3 changes: 3 additions & 0 deletions examples/rtic-demo/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ use nrf51_hal as hal;
#[cfg(feature = "52810")]
use nrf52810_hal as hal;

#[cfg(feature = "52811")]
use nrf52811_hal as hal;

#[cfg(feature = "52832")]
use nrf52832_hal as hal;

Expand Down
5 changes: 5 additions & 0 deletions nrf-hal-common/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ version = "0.9.0"
optional = true
version = "0.9.0"

[dependencies.nrf52811-pac]
optional = true
version = "0.9.0"

[dependencies.nrf52832-pac]
optional = true
version = "0.9.0"
Expand All @@ -66,6 +70,7 @@ version = "0.2.4"
doc = []
51 = ["nrf51"]
52810 = ["nrf52810-pac"]
52811 = ["nrf52811-pac"]
52832 = ["nrf52832-pac"]
52833 = ["nrf52833-pac"]
52840 = ["nrf52840-pac"]
Expand Down
14 changes: 12 additions & 2 deletions nrf-hal-common/src/ccm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,12 @@ impl Ccm {
let length_variant = if payload_len <= MAXIMUM_LENGTH_5BITS - MIC_SIZE {
LENGTH_A::DEFAULT
} else {
#[cfg(any(feature = "52840", feature = "52833", feature = "52810"))]
#[cfg(any(
feature = "52840",
feature = "52833",
feature = "52811",
feature = "52810"
))]
// NOTE(unsafe) Any 8bits pattern is safe to write to this register
self.regs
.maxpacketsize
Expand Down Expand Up @@ -373,7 +378,12 @@ impl Ccm {
let length_variant = if payload_len <= MAXIMUM_LENGTH_5BITS {
LENGTH_A::DEFAULT
} else {
#[cfg(any(feature = "52840", feature = "52833", feature = "52810"))]
#[cfg(any(
feature = "52840",
feature = "52833",
feature = "52811",
feature = "52810"
))]
// NOTE(unsafe) Any 8bits pattern is safe to write to this register
self.regs
.maxpacketsize
Expand Down
4 changes: 2 additions & 2 deletions nrf-hal-common/src/comp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ comp_ref_pins! {
P0_31<Input<Floating>> => EXTREFSEL_A::ANALOGREFERENCE7,
}

#[cfg(not(feature = "52810"))]
#[cfg(not(any(feature = "52811", feature = "52810")))]
comp_input_pins! {
P0_02<Input<Floating>> => PSEL_A::ANALOGINPUT0,
P0_03<Input<Floating>> => PSEL_A::ANALOGINPUT1,
Expand All @@ -305,7 +305,7 @@ comp_input_pins! {
P0_31<Input<Floating>> => PSEL_A::ANALOGINPUT7,
}

#[cfg(feature = "52810")]
#[cfg(any(feature = "52811", feature = "52810"))]
comp_input_pins! {
P0_02<Input<Floating>> => PSEL_A::ANALOGINPUT0,
P0_03<Input<Floating>> => PSEL_A::ANALOGINPUT1,
Expand Down
14 changes: 11 additions & 3 deletions nrf-hal-common/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ pub use nrf51 as pac;
#[cfg(feature = "52810")]
pub use nrf52810_pac as pac;

#[cfg(feature = "52811")]
pub use nrf52811_pac as pac;

#[cfg(feature = "52832")]
pub use nrf52832_pac as pac;

Expand All @@ -38,9 +41,9 @@ pub mod ecb;
pub mod gpio;
#[cfg(not(feature = "9160"))]
pub mod gpiote;
#[cfg(not(any(feature = "51", feature = "52810")))]
#[cfg(not(any(feature = "51", feature = "52810", feature = "52811")))]
pub mod i2s;
#[cfg(not(any(feature = "52810", feature = "9160")))]
#[cfg(not(any(feature = "52811", feature = "52810", feature = "9160")))]
pub mod lpcomp;
#[cfg(not(feature = "9160"))]
pub mod ppi;
Expand Down Expand Up @@ -88,7 +91,12 @@ pub mod prelude {
}

/// Length of Nordic EasyDMA differs for MCUs
#[cfg(any(feature = "52810", feature = "52832", feature = "51"))]
#[cfg(any(
feature = "52810",
feature = "52811",
feature = "52832",
feature = "51"
))]
pub mod target_constants {
// NRF52832 8 bits1..0xFF
pub const EASY_DMA_SIZE: usize = 255;
Expand Down
Loading