Skip to content

Commit 4f9d1f7

Browse files
TremoneckAdrian Geipertjbeaurivage
authored andcommitted
Update PAC's to svd2rust 0.30.2 (atsamd-rs#683)
* Update svd2rust and form version * CreatePatch file for the EVSYS channel * Regenerate PAC's with svd2rut 0.30.2 * Apply manual patch for wrong generation of svd2rust See rust-embedded/svd2rust#713 * Update Cargo.toml to the new Versions of the pacs * Update hal to the new pacs The Parts changed where adding SELECT to a few Registers ending with _A, as they were renamed frm *_A to *SELECT_A * Make the tier one examples compileable * Update the changelog * Change the rename in EVSYS to the Channel struct. This change keeps the register names in sync with the datasheet. --------- Co-authored-by: Adrian Geipert <adrian.git@geipert.eu> Co-authored-by: Justin Beaurivage <justin@wearableavionics.com>
1 parent df47ff1 commit 4f9d1f7

File tree

11,908 files changed

+669225
-2159168
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

11,908 files changed

+669225
-2159168
lines changed

boards/atsame54_xpro/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Unreleased
22

3+
- Update the PACs to svd2rust 0.30.2.
4+
35
# v0.6.0
46
- Limit RAM memory to avoid HardFaults when `UROW:ECCRAM` is enabled
57
- Remove re-export of `cortex-m-rt::entry`

boards/atsame54_xpro/Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ readme = "README.md"
1717
version = "0.7"
1818
optional = true
1919

20+
[dependencies.cortex-m]
21+
version = "0.7"
22+
features = ["critical-section-single-core"]
23+
2024
[dependencies.atsamd-hal]
2125
path = "../../hal"
2226
version = "0.16.0"

boards/atsame54_xpro/src/devices.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -367,10 +367,10 @@ pub fn usb_allocator(
367367
dm: impl Into<UsbDm>,
368368
dp: impl Into<UsbDp>,
369369
) -> UsbBusAllocator<UsbBus> {
370-
use pac::gclk::{genctrl::SRC_A, pchctrl::GEN_A};
370+
use pac::gclk::{genctrl::SRCSELECT_A, pchctrl::GENSELECT_A};
371371

372-
clocks.configure_gclk_divider_and_source(GEN_A::GCLK2, 1, SRC_A::DFLL, false);
373-
let usb_gclk = clocks.get_gclk(GEN_A::GCLK2).unwrap();
372+
clocks.configure_gclk_divider_and_source(GENSELECT_A::GCLK2, 1, SRCSELECT_A::DFLL, false);
373+
let usb_gclk = clocks.get_gclk(GENSELECT_A::GCLK2).unwrap();
374374
let usb_clock = &clocks.usb(&usb_gclk).unwrap();
375375
let (dm, dp) = (dm.into(), dp.into());
376376
UsbBusAllocator::new(UsbBus::new(usb_clock, mclk, dm, dp, usb))

boards/feather_m0/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Unreleased
22

3+
- Update the PACs to svd2rust 0.30.2.
4+
35
# v0.13.0
46

57
- Replace homebrew time library with `fugit` (#672)

boards/feather_m0/Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ path = "../../hal"
2424
version = "0.16.0"
2525
default-features = false
2626

27+
[dependencies.cortex-m]
28+
version = "0.7"
29+
features = ["critical-section-single-core"]
30+
2731
[dependencies.usb-device]
2832
version = "0.2"
2933
optional = true

boards/feather_m4/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Unreleased
22

3+
- Update the PACs to svd2rust 0.30.2.
4+
35
# v0.11.0
46

57
- Replace homebrew time library with `fugit` (#672)

boards/feather_m4/Cargo.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ chip = "ATSAMD51J19A"
1919
version = "0.7"
2020
optional = true
2121

22+
[dependencies.cortex-m]
23+
version = "0.7"
24+
features = ["critical-section-single-core"]
25+
2226
[dependencies.atsamd-hal]
2327
path = "../../hal"
2428
version = "0.16.0"
@@ -29,7 +33,6 @@ version = "0.2"
2933
optional = true
3034

3135
[dev-dependencies]
32-
cortex-m = "0.7"
3336
usbd-serial = "0.1"
3437
cortex-m-rtic = "0.6.0-rc.2"
3538
panic-halt = "0.2"

boards/feather_m4/examples/serial.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ use panic_semihosting as _;
1212
use bsp::{entry, periph_alias, pin_alias};
1313
use hal::clock::GenericClockController;
1414
use hal::delay::Delay;
15-
use hal::pac::gclk::genctrl::SRC_A;
16-
use hal::pac::gclk::pchctrl::GEN_A;
15+
use hal::pac::gclk::genctrl::SRCSELECT_A;
16+
use hal::pac::gclk::pchctrl::GENSELECT_A;
1717
use hal::pac::{CorePeripherals, Peripherals};
1818
use hal::prelude::*;
1919

@@ -28,7 +28,7 @@ fn main() -> ! {
2828
&mut peripherals.OSCCTRL,
2929
&mut peripherals.NVMCTRL,
3030
);
31-
clocks.configure_gclk_divider_and_source(GEN_A::GCLK2, 1, SRC_A::DFLL, false);
31+
clocks.configure_gclk_divider_and_source(GENSELECT_A::GCLK2, 1, SRCSELECT_A::DFLL, false);
3232

3333
let pins = bsp::Pins::new(peripherals.PORT);
3434
let uart_rx = pin_alias!(pins.uart_rx);

boards/feather_m4/examples/uart_poll_echo.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ use panic_semihosting as _;
1919
use bsp::{entry, periph_alias, pin_alias};
2020
use hal::clock::GenericClockController;
2121
use hal::delay::Delay;
22-
use hal::pac::gclk::genctrl::SRC_A;
23-
use hal::pac::gclk::pchctrl::GEN_A;
22+
use hal::pac::gclk::genctrl::SRCSELECT_A;
23+
use hal::pac::gclk::pchctrl::GENSELECT_A;
2424
use hal::pac::{CorePeripherals, Peripherals};
2525
use hal::prelude::*;
2626

@@ -35,7 +35,7 @@ fn main() -> ! {
3535
&mut peripherals.OSCCTRL,
3636
&mut peripherals.NVMCTRL,
3737
);
38-
clocks.configure_gclk_divider_and_source(GEN_A::GCLK2, 1, SRC_A::DFLL, false);
38+
clocks.configure_gclk_divider_and_source(GENSELECT_A::GCLK2, 1, SRCSELECT_A::DFLL, false);
3939

4040
let pins = bsp::Pins::new(peripherals.PORT);
4141
let mut delay = Delay::new(core.SYST, &mut clocks);

boards/feather_m4/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -267,10 +267,10 @@ pub fn usb_allocator(
267267
clocks: &mut GenericClockController,
268268
mclk: &mut pac::MCLK,
269269
) -> UsbBusAllocator<UsbBus> {
270-
use pac::gclk::{genctrl::SRC_A, pchctrl::GEN_A};
270+
use pac::gclk::{genctrl::SRCSELECT_A, pchctrl::GENSELECT_A};
271271

272-
clocks.configure_gclk_divider_and_source(GEN_A::GCLK2, 1, SRC_A::DFLL, false);
273-
let usb_gclk = clocks.get_gclk(GEN_A::GCLK2).unwrap();
272+
clocks.configure_gclk_divider_and_source(GENSELECT_A::GCLK2, 1, SRCSELECT_A::DFLL, false);
273+
let usb_gclk = clocks.get_gclk(GENSELECT_A::GCLK2).unwrap();
274274
let usb_clock = &clocks.usb(&usb_gclk).unwrap();
275275
let (dm, dp) = (dm.into(), dp.into());
276276
UsbBusAllocator::new(UsbBus::new(usb_clock, mclk, dm, dp, usb))

boards/metro_m0/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Unreleased
22

3+
- Update the PACs to svd2rust 0.30.2.
4+
35
# v0.13.0
46

57
- Replace homebrew time library with `fugit` (#672)

boards/metro_m0/Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ chip = "ATSAMD21G18A"
1818
version = "0.7"
1919
optional = true
2020

21+
[dependencies.cortex-m]
22+
version = "0.7"
23+
features = ["critical-section-single-core"]
24+
2125
[dependencies.atsamd-hal]
2226
path = "../../hal"
2327
version = "0.16.0"

boards/metro_m4/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Unreleased
22

3+
- Update the PACs to svd2rust 0.30.2.
4+
35
# v0.12.0
46

57
- Use correct alternate for USB (#661)

boards/metro_m4/Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ default-features = false
2727
version = "0.2"
2828
optional = true
2929

30+
[dependencies.cortex-m]
31+
version = "0.7"
32+
features = ["critical-section-single-core"]
33+
3034
[dev-dependencies]
3135
cortex-m = "0.7"
3236
usbd-serial = "0.1"

boards/metro_m4/examples/adc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use hal::adc::Adc;
1818
use hal::clock::GenericClockController;
1919
use hal::gpio::B;
2020
use hal::prelude::*;
21-
use pac::gclk::pchctrl::GEN_A::GCLK11;
21+
use pac::gclk::pchctrl::GENSELECT_A::GCLK11;
2222
use pac::{CorePeripherals, Peripherals};
2323

2424
#[entry]

boards/metro_m4/examples/clock_out.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ use bsp::entry;
1515
use hal::clock::GenericClockController;
1616
use hal::gpio::M;
1717

18-
use pac::gclk::genctrl::SRC_A::DPLL0;
19-
use pac::gclk::pchctrl::GEN_A::GCLK2;
18+
use pac::gclk::genctrl::SRCSELECT_A::DPLL0;
19+
use pac::gclk::pchctrl::GENSELECT_A::GCLK2;
2020
use pac::Peripherals;
2121

2222
#[entry]

boards/metro_m4/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -360,10 +360,10 @@ pub fn usb_allocator(
360360
dm: impl Into<UsbDm>,
361361
dp: impl Into<UsbDp>,
362362
) -> UsbBusAllocator<UsbBus> {
363-
use pac::gclk::{genctrl::SRC_A, pchctrl::GEN_A};
363+
use pac::gclk::{genctrl::SRCSELECT_A, pchctrl::GENSELECT_A};
364364

365-
clocks.configure_gclk_divider_and_source(GEN_A::GCLK2, 1, SRC_A::DFLL, false);
366-
let usb_gclk = clocks.get_gclk(GEN_A::GCLK2).unwrap();
365+
clocks.configure_gclk_divider_and_source(GENSELECT_A::GCLK2, 1, SRCSELECT_A::DFLL, false);
366+
let usb_gclk = clocks.get_gclk(GENSELECT_A::GCLK2).unwrap();
367367
let usb_clock = &clocks.usb(&usb_gclk).unwrap();
368368
let (dm, dp) = (dm.into(), dp.into());
369369
UsbBusAllocator::new(UsbBus::new(usb_clock, mclk, dm, dp, usb))

boards/samd11_bare/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Unreleased
22

3+
- Update the PACs to svd2rust 0.30.2.
4+
35
# v0.9.0
46
- Update to `atsamd-hal` version `0.16.0`
57

boards/samd11_bare/Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ chip = "ATSAMD11C14A"
1717
version = "0.7"
1818
optional = true
1919

20+
[dependencies.cortex-m]
21+
version = "0.7"
22+
features = ["critical-section-single-core"]
23+
2024
[dependencies.atsamd-hal]
2125
path = "../../hal"
2226
version = "0.16.0"

boards/samd11_bare/examples/serial.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use panic_semihosting as _;
1616
use hal::delay::Delay;
1717
use hal::pac::{CorePeripherals, Peripherals};
1818

19-
use hal::pac::gclk::{clkctrl::GEN_A, genctrl::SRC_A};
19+
use hal::pac::gclk::{clkctrl::GENSELECT_A, genctrl::SRCSELECT_A};
2020
use hal::sercom::{
2121
uart::{self, BaudMode, Oversampling},
2222
Sercom0,
@@ -34,9 +34,9 @@ fn main() -> ! {
3434
&mut peripherals.NVMCTRL,
3535
);
3636

37-
clocks.configure_gclk_divider_and_source(GEN_A::GCLK2, 1, SRC_A::DFLL48M, false);
37+
clocks.configure_gclk_divider_and_source(GENSELECT_A::GCLK2, 1, SRCSELECT_A::DFLL48M, false);
3838
let gclk2 = clocks
39-
.get_gclk(GEN_A::GCLK2)
39+
.get_gclk(GENSELECT_A::GCLK2)
4040
.expect("Could not get clock 2");
4141

4242
let pins = bsp::Pins::new(peripherals.PORT);

hal/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Unreleased Changes
22

3+
- Update the PACs to svd2rust 0.30.2.
4+
35
# v0.16.0
46

57
- Implement `Debug, Clone, Copy, Eq, PartialEq` for all HAL error types (#691).

hal/Cargo.toml

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -69,27 +69,27 @@ defmt = {version = "0.3.4", optional = true}
6969
# users should specify a corresponding variant (see below). The variant features
7070
# will select the correct PAC, as well as other configuration features.
7171

72-
atsamd11c = {version = "0.12.0", path = "../pac/atsamd11c", optional = true}
73-
atsamd11d = {version = "0.12.0", path = "../pac/atsamd11d", optional = true}
72+
atsamd11c = {version = "0.13.0", path = "../pac/atsamd11c", optional = true}
73+
atsamd11d = {version = "0.13.0", path = "../pac/atsamd11d", optional = true}
7474

75-
atsamd21e = {version = "0.12.0", path = "../pac/atsamd21e", optional = true}
76-
atsamd21g = {version = "0.12.0", path = "../pac/atsamd21g", optional = true}
77-
atsamd21j = {version = "0.12.0", path = "../pac/atsamd21j", optional = true}
75+
atsamd21e = {version = "0.13.0", path = "../pac/atsamd21e", optional = true}
76+
atsamd21g = {version = "0.13.0", path = "../pac/atsamd21g", optional = true}
77+
atsamd21j = {version = "0.13.0", path = "../pac/atsamd21j", optional = true}
7878

79-
atsamd51g = {version = "0.12.0", path = "../pac/atsamd51g", optional = true}
80-
atsamd51j = {version = "0.12.0", path = "../pac/atsamd51j", optional = true}
81-
atsamd51n = {version = "0.12.0", path = "../pac/atsamd51n", optional = true}
82-
atsamd51p = {version = "0.12.0", path = "../pac/atsamd51p", optional = true}
79+
atsamd51g = {version = "0.13.0", path = "../pac/atsamd51g", optional = true}
80+
atsamd51j = {version = "0.13.0", path = "../pac/atsamd51j", optional = true}
81+
atsamd51n = {version = "0.13.0", path = "../pac/atsamd51n", optional = true}
82+
atsamd51p = {version = "0.13.0", path = "../pac/atsamd51p", optional = true}
8383

84-
atsame51g = {version = "0.12.0", path = "../pac/atsame51g", optional = true}
85-
atsame51j = {version = "0.12.0", path = "../pac/atsame51j", optional = true}
86-
atsame51n = {version = "0.12.0", path = "../pac/atsame51n", optional = true}
84+
atsame51g = {version = "0.13.0", path = "../pac/atsame51g", optional = true}
85+
atsame51j = {version = "0.13.0", path = "../pac/atsame51j", optional = true}
86+
atsame51n = {version = "0.13.0", path = "../pac/atsame51n", optional = true}
8787

88-
atsame53j = {version = "0.12.0", path = "../pac/atsame53j", optional = true}
89-
atsame53n = {version = "0.12.0", path = "../pac/atsame53n", optional = true}
88+
atsame53j = {version = "0.13.0", path = "../pac/atsame53j", optional = true}
89+
atsame53n = {version = "0.13.0", path = "../pac/atsame53n", optional = true}
9090

91-
atsame54n = {version = "0.12.0", path = "../pac/atsame54n", optional = true}
92-
atsame54p = {version = "0.12.0", path = "../pac/atsame54p", optional = true}
91+
atsame54n = {version = "0.13.0", path = "../pac/atsame54n", optional = true}
92+
atsame54p = {version = "0.13.0", path = "../pac/atsame54p", optional = true}
9393

9494
#===============================================================================
9595
# Features
@@ -178,14 +178,14 @@ default = ["unproven"]
178178

179179
can = ["mcan-core"]
180180
dma = ["unproven"]
181+
defmt = ["dep:defmt"]
181182
enable_unsafe_aes_newblock_cipher = []
182183
max-channels = ["dma"]
183184
rtic = ["rtic-monotonic"]
184185
sdmmc = ["embedded-sdmmc"]
185186
unproven = ["embedded-hal/unproven"]
186187
usb = ["usb-device"]
187188
use_rtt = ["jlink_rtt"]
188-
defmt = ["dep:defmt"]
189189

190190
#===============================================================================
191191
# Implementation-details

hal/src/dmac/dma_controller.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,17 @@ use seq_macro::seq;
2424

2525
#[cfg(feature = "thumbv6")]
2626
pub use crate::pac::dmac::chctrlb::{
27-
LVL_A as PriorityLevel, TRIGACT_A as TriggerAction, TRIGSRC_A as TriggerSource,
27+
LVLSELECT_A as PriorityLevel, TRIGACTSELECT_A as TriggerAction,
28+
TRIGSRCSELECT_A as TriggerSource,
2829
};
2930

3031
#[cfg(feature = "thumbv7")]
3132
pub use crate::pac::dmac::channel::{
3233
chctrla::{
33-
BURSTLEN_A as BurstLength, THRESHOLD_A as FifoThreshold, TRIGACT_A as TriggerAction,
34-
TRIGSRC_A as TriggerSource,
34+
BURSTLENSELECT_A as BurstLength, THRESHOLDSELECT_A as FifoThreshold,
35+
TRIGACTSELECT_A as TriggerAction, TRIGSRCSELECT_A as TriggerSource,
3536
},
36-
chprilvl::PRILVL_A as PriorityLevel,
37+
chprilvl::PRILVLSELECT_A as PriorityLevel,
3738
};
3839

3940
use super::{

hal/src/rtc.rs

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@ use rtic_monotonic::Monotonic;
2323
// SAMx5x imports
2424
#[cfg(feature = "thumbv7")]
2525
use crate::pac::{
26-
rtc::mode0::ctrla::PRESCALER_A, rtc::mode0::CTRLA as MODE0_CTRLA,
26+
rtc::mode0::ctrla::PRESCALERSELECT_A, rtc::mode0::CTRLA as MODE0_CTRLA,
2727
rtc::mode2::CTRLA as MODE2_CTRLA, MCLK as PM,
2828
};
2929

3030
// SAMD11/SAMD21 imports
3131
#[cfg(feature = "thumbv6")]
3232
use crate::pac::{
33-
rtc::mode0::ctrl::PRESCALER_A, rtc::mode0::CTRL as MODE0_CTRLA,
33+
rtc::mode0::ctrl::PRESCALERSELECT_A, rtc::mode0::CTRL as MODE0_CTRLA,
3434
rtc::mode2::CTRL as MODE2_CTRLA, PM,
3535
};
3636

@@ -412,7 +412,7 @@ impl TimeSource for Rtc<ClockMode> {
412412
/// Helper type for computing cycles and divider given frequency
413413
#[derive(Debug, Clone, Copy)]
414414
pub struct TimerParams {
415-
pub divider: PRESCALER_A,
415+
pub divider: PRESCALERSELECT_A,
416416
pub cycles: u32,
417417
}
418418

@@ -440,19 +440,19 @@ impl TimerParams {
440440
fn new_from_ticks(ticks: u32) -> Self {
441441
let divider_value = ((ticks >> 16) + 1).next_power_of_two();
442442
let divider = match divider_value {
443-
1 => PRESCALER_A::DIV1,
444-
2 => PRESCALER_A::DIV2,
445-
4 => PRESCALER_A::DIV4,
446-
8 => PRESCALER_A::DIV8,
447-
16 => PRESCALER_A::DIV16,
448-
32 => PRESCALER_A::DIV32,
449-
64 => PRESCALER_A::DIV64,
450-
128 => PRESCALER_A::DIV128,
451-
256 => PRESCALER_A::DIV256,
452-
512 => PRESCALER_A::DIV512,
453-
1024 => PRESCALER_A::DIV1024,
454-
_ => PRESCALER_A::DIV1024, /* would be nice to catch this at compile time
455-
* (rust-lang/rust#51999) */
443+
1 => PRESCALERSELECT_A::DIV1,
444+
2 => PRESCALERSELECT_A::DIV2,
445+
4 => PRESCALERSELECT_A::DIV4,
446+
8 => PRESCALERSELECT_A::DIV8,
447+
16 => PRESCALERSELECT_A::DIV16,
448+
32 => PRESCALERSELECT_A::DIV32,
449+
64 => PRESCALERSELECT_A::DIV64,
450+
128 => PRESCALERSELECT_A::DIV128,
451+
256 => PRESCALERSELECT_A::DIV256,
452+
512 => PRESCALERSELECT_A::DIV512,
453+
1024 => PRESCALERSELECT_A::DIV1024,
454+
_ => PRESCALERSELECT_A::DIV1024, /* would be nice to catch this at compile time
455+
* (rust-lang/rust#51999) */
456456
};
457457

458458
let cycles: u32 = ticks / divider_value as u32;

0 commit comments

Comments
 (0)