Skip to content

Commit 619bee7

Browse files
Merge pull request #172 from jonas-schievink/no-target
Stop reexporting the PAC under `target`
2 parents 897b576 + c229806 commit 619bee7

File tree

37 files changed

+1163
-1169
lines changed

37 files changed

+1163
-1169
lines changed

boards/adafruit-nrf52-bluefruit-le/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ pub mod prelude {
66

77
use nrf52832_hal::{
88
gpio::{p0, Floating, Input, Level, Output, Pin, PushPull},
9-
target::{self as pac, CorePeripherals, Peripherals},
9+
pac::{self as pac, CorePeripherals, Peripherals},
1010
uarte, Uarte,
1111
};
1212

examples/rtfm-demo/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ use nrf52832_hal as hal;
1919
#[cfg(feature = "52840")]
2020
use nrf52840_hal as hal;
2121

22-
#[app(device = crate::hal::target)]
22+
#[app(device = crate::hal::pac)]
2323
const APP: () = {
2424
#[init]
2525
fn init() {

nrf-hal-common/src/adc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use core::hint::unreachable_unchecked;
66

77
use crate::{
88
gpio::{Floating, Input},
9-
target::{
9+
pac::{
1010
adc::config::{INPSEL_A as InputSelection, REFSEL_A as Reference, RES_A as Resolution},
1111
ADC,
1212
},

nrf-hal-common/src/ccm.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,13 @@
4646
//! (16 + `Packet Length`) bytes, whatever is largest.
4747
4848
use crate::{
49+
pac::{AAR, CCM},
4950
slice_in_ram,
50-
target::{AAR, CCM},
5151
};
5252
use core::sync::atomic::{compiler_fence, Ordering};
5353

5454
#[cfg(not(feature = "51"))]
55-
use crate::target::ccm::mode::{DATARATE_A, LENGTH_A};
55+
use crate::pac::ccm::mode::{DATARATE_A, LENGTH_A};
5656

5757
const MINIMUM_SCRATCH_AREA_SIZE: usize = 43;
5858
const HEADER_SIZE: usize = 3;

nrf-hal-common/src/clocks.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
//! sources
33
44
#[cfg(feature = "9160")]
5-
use crate::target::CLOCK_NS as CLOCK;
5+
use crate::pac::CLOCK_NS as CLOCK;
66

77
#[cfg(not(feature = "9160"))]
8-
use crate::target::CLOCK;
8+
use crate::pac::CLOCK;
99

1010
// ZST Type States
1111

nrf-hal-common/src/ecb.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//!
33
//! The ECB encryption block supports 128 bit AES encryption (encryption only, not decryption).
44
5-
use crate::target::ECB;
5+
use crate::pac::ECB;
66
use core::sync::atomic::{compiler_fence, Ordering};
77

88
/// Error type to represent a sharing conflict during encryption.

nrf-hal-common/src/gpio.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,16 +61,16 @@ pub struct Pin<MODE> {
6161
}
6262

6363
#[cfg(feature = "51")]
64-
use crate::target::{gpio, GPIO as P0};
64+
use crate::pac::{gpio, GPIO as P0};
6565

6666
#[cfg(feature = "9160")]
67-
use crate::target::{p0_ns as gpio, P0_NS as P0};
67+
use crate::pac::{p0_ns as gpio, P0_NS as P0};
6868

6969
#[cfg(not(any(feature = "9160", feature = "51")))]
70-
use crate::target::{p0 as gpio, P0};
70+
use crate::pac::{p0 as gpio, P0};
7171

7272
#[cfg(any(feature = "52833", feature = "52840"))]
73-
use crate::target::P1;
73+
use crate::pac::P1;
7474

7575
use crate::hal::digital::v2::{InputPin, OutputPin, StatefulOutputPin};
7676
use void::Void;
@@ -293,13 +293,13 @@ pub enum OpenDrainConfig {
293293
}
294294

295295
#[cfg(feature = "51")]
296-
use crate::target::gpio::pin_cnf;
296+
use crate::pac::gpio::pin_cnf;
297297

298298
#[cfg(feature = "9160")]
299-
use crate::target::p0_ns::pin_cnf;
299+
use crate::pac::p0_ns::pin_cnf;
300300

301301
#[cfg(not(any(feature = "9160", feature = "51")))]
302-
use crate::target::p0::pin_cnf;
302+
use crate::pac::p0::pin_cnf;
303303

304304
impl OpenDrainConfig {
305305
fn variant(self) -> pin_cnf::DRIVE_A {

nrf-hal-common/src/lib.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,22 @@
66
use embedded_hal as hal;
77

88
#[cfg(feature = "51")]
9-
pub use nrf51 as target;
9+
pub use nrf51 as pac;
1010

1111
#[cfg(feature = "52810")]
12-
pub use nrf52810_pac as target;
12+
pub use nrf52810_pac as pac;
1313

1414
#[cfg(feature = "52832")]
15-
pub use nrf52832_pac as target;
15+
pub use nrf52832_pac as pac;
1616

1717
#[cfg(feature = "52833")]
18-
pub use nrf52833_pac as target;
18+
pub use nrf52833_pac as pac;
1919

2020
#[cfg(feature = "52840")]
21-
pub use nrf52840_pac as target;
21+
pub use nrf52840_pac as pac;
2222

2323
#[cfg(feature = "9160")]
24-
pub use nrf9160_pac as target;
24+
pub use nrf9160_pac as pac;
2525

2626
#[cfg(feature = "51")]
2727
pub mod adc;

nrf-hal-common/src/ppi/event_nrf51.rs

Lines changed: 56 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -7,59 +7,59 @@ use crate::ppi::Event;
77
// Find (regex):
88
// `^src/(.*)\.rs:pub type (.*) = .*$`
99
// Replace (regex):
10-
// `impl Event for crate::target::$1::$2 { }`
11-
impl Event for crate::target::ecb::EVENTS_ENDECB {}
12-
impl Event for crate::target::ecb::EVENTS_ERRORECB {}
13-
impl Event for crate::target::rng::EVENTS_VALRDY {}
14-
impl Event for crate::target::timer0::EVENTS_COMPARE {}
15-
impl Event for crate::target::uart0::EVENTS_CTS {}
16-
impl Event for crate::target::uart0::EVENTS_NCTS {}
17-
impl Event for crate::target::uart0::EVENTS_RXDRDY {}
18-
impl Event for crate::target::uart0::EVENTS_TXDRDY {}
19-
impl Event for crate::target::uart0::EVENTS_ERROR {}
20-
impl Event for crate::target::uart0::EVENTS_RXTO {}
21-
impl Event for crate::target::gpiote::EVENTS_IN {}
22-
impl Event for crate::target::gpiote::EVENTS_PORT {}
23-
impl Event for crate::target::power::EVENTS_POFWARN {}
24-
impl Event for crate::target::clock::EVENTS_HFCLKSTARTED {}
25-
impl Event for crate::target::clock::EVENTS_LFCLKSTARTED {}
26-
impl Event for crate::target::clock::EVENTS_DONE {}
27-
impl Event for crate::target::clock::EVENTS_CTTO {}
28-
impl Event for crate::target::spi0::EVENTS_READY {}
29-
impl Event for crate::target::twi0::EVENTS_STOPPED {}
30-
impl Event for crate::target::twi0::EVENTS_RXDREADY {}
31-
impl Event for crate::target::twi0::EVENTS_TXDSENT {}
32-
impl Event for crate::target::twi0::EVENTS_ERROR {}
33-
impl Event for crate::target::twi0::EVENTS_BB {}
34-
impl Event for crate::target::twi0::EVENTS_SUSPENDED {}
35-
impl Event for crate::target::spis1::EVENTS_END {}
36-
impl Event for crate::target::spis1::EVENTS_ENDRX {}
37-
impl Event for crate::target::spis1::EVENTS_ACQUIRED {}
38-
impl Event for crate::target::rtc0::EVENTS_TICK {}
39-
impl Event for crate::target::rtc0::EVENTS_OVRFLW {}
40-
impl Event for crate::target::rtc0::EVENTS_COMPARE {}
41-
impl Event for crate::target::wdt::EVENTS_TIMEOUT {}
42-
impl Event for crate::target::temp::EVENTS_DATARDY {}
43-
impl Event for crate::target::radio::EVENTS_READY {}
44-
impl Event for crate::target::radio::EVENTS_ADDRESS {}
45-
impl Event for crate::target::radio::EVENTS_PAYLOAD {}
46-
impl Event for crate::target::radio::EVENTS_END {}
47-
impl Event for crate::target::radio::EVENTS_DISABLED {}
48-
impl Event for crate::target::radio::EVENTS_DEVMATCH {}
49-
impl Event for crate::target::radio::EVENTS_DEVMISS {}
50-
impl Event for crate::target::radio::EVENTS_RSSIEND {}
51-
impl Event for crate::target::radio::EVENTS_BCMATCH {}
52-
impl Event for crate::target::lpcomp::EVENTS_READY {}
53-
impl Event for crate::target::lpcomp::EVENTS_DOWN {}
54-
impl Event for crate::target::lpcomp::EVENTS_UP {}
55-
impl Event for crate::target::lpcomp::EVENTS_CROSS {}
56-
impl Event for crate::target::ccm::EVENTS_ENDKSGEN {}
57-
impl Event for crate::target::ccm::EVENTS_ENDCRYPT {}
58-
impl Event for crate::target::ccm::EVENTS_ERROR {}
59-
impl Event for crate::target::aar::EVENTS_END {}
60-
impl Event for crate::target::aar::EVENTS_RESOLVED {}
61-
impl Event for crate::target::aar::EVENTS_NOTRESOLVED {}
62-
impl Event for crate::target::qdec::EVENTS_SAMPLERDY {}
63-
impl Event for crate::target::qdec::EVENTS_REPORTRDY {}
64-
impl Event for crate::target::qdec::EVENTS_ACCOF {}
65-
impl Event for crate::target::adc::EVENTS_END {}
10+
// `impl Event for crate::pac::$1::$2 { }`
11+
impl Event for crate::pac::ecb::EVENTS_ENDECB {}
12+
impl Event for crate::pac::ecb::EVENTS_ERRORECB {}
13+
impl Event for crate::pac::rng::EVENTS_VALRDY {}
14+
impl Event for crate::pac::timer0::EVENTS_COMPARE {}
15+
impl Event for crate::pac::uart0::EVENTS_CTS {}
16+
impl Event for crate::pac::uart0::EVENTS_NCTS {}
17+
impl Event for crate::pac::uart0::EVENTS_RXDRDY {}
18+
impl Event for crate::pac::uart0::EVENTS_TXDRDY {}
19+
impl Event for crate::pac::uart0::EVENTS_ERROR {}
20+
impl Event for crate::pac::uart0::EVENTS_RXTO {}
21+
impl Event for crate::pac::gpiote::EVENTS_IN {}
22+
impl Event for crate::pac::gpiote::EVENTS_PORT {}
23+
impl Event for crate::pac::power::EVENTS_POFWARN {}
24+
impl Event for crate::pac::clock::EVENTS_HFCLKSTARTED {}
25+
impl Event for crate::pac::clock::EVENTS_LFCLKSTARTED {}
26+
impl Event for crate::pac::clock::EVENTS_DONE {}
27+
impl Event for crate::pac::clock::EVENTS_CTTO {}
28+
impl Event for crate::pac::spi0::EVENTS_READY {}
29+
impl Event for crate::pac::twi0::EVENTS_STOPPED {}
30+
impl Event for crate::pac::twi0::EVENTS_RXDREADY {}
31+
impl Event for crate::pac::twi0::EVENTS_TXDSENT {}
32+
impl Event for crate::pac::twi0::EVENTS_ERROR {}
33+
impl Event for crate::pac::twi0::EVENTS_BB {}
34+
impl Event for crate::pac::twi0::EVENTS_SUSPENDED {}
35+
impl Event for crate::pac::spis1::EVENTS_END {}
36+
impl Event for crate::pac::spis1::EVENTS_ENDRX {}
37+
impl Event for crate::pac::spis1::EVENTS_ACQUIRED {}
38+
impl Event for crate::pac::rtc0::EVENTS_TICK {}
39+
impl Event for crate::pac::rtc0::EVENTS_OVRFLW {}
40+
impl Event for crate::pac::rtc0::EVENTS_COMPARE {}
41+
impl Event for crate::pac::wdt::EVENTS_TIMEOUT {}
42+
impl Event for crate::pac::temp::EVENTS_DATARDY {}
43+
impl Event for crate::pac::radio::EVENTS_READY {}
44+
impl Event for crate::pac::radio::EVENTS_ADDRESS {}
45+
impl Event for crate::pac::radio::EVENTS_PAYLOAD {}
46+
impl Event for crate::pac::radio::EVENTS_END {}
47+
impl Event for crate::pac::radio::EVENTS_DISABLED {}
48+
impl Event for crate::pac::radio::EVENTS_DEVMATCH {}
49+
impl Event for crate::pac::radio::EVENTS_DEVMISS {}
50+
impl Event for crate::pac::radio::EVENTS_RSSIEND {}
51+
impl Event for crate::pac::radio::EVENTS_BCMATCH {}
52+
impl Event for crate::pac::lpcomp::EVENTS_READY {}
53+
impl Event for crate::pac::lpcomp::EVENTS_DOWN {}
54+
impl Event for crate::pac::lpcomp::EVENTS_UP {}
55+
impl Event for crate::pac::lpcomp::EVENTS_CROSS {}
56+
impl Event for crate::pac::ccm::EVENTS_ENDKSGEN {}
57+
impl Event for crate::pac::ccm::EVENTS_ENDCRYPT {}
58+
impl Event for crate::pac::ccm::EVENTS_ERROR {}
59+
impl Event for crate::pac::aar::EVENTS_END {}
60+
impl Event for crate::pac::aar::EVENTS_RESOLVED {}
61+
impl Event for crate::pac::aar::EVENTS_NOTRESOLVED {}
62+
impl Event for crate::pac::qdec::EVENTS_SAMPLERDY {}
63+
impl Event for crate::pac::qdec::EVENTS_REPORTRDY {}
64+
impl Event for crate::pac::qdec::EVENTS_ACCOF {}
65+
impl Event for crate::pac::adc::EVENTS_END {}

0 commit comments

Comments
 (0)