Skip to content

Commit

Permalink
Prepare for v0.15 release (atsamd-rs#570)
Browse files Browse the repository at this point in the history
* Remove gpio::v1 and promote gpio::v2 to gpio

* Remove sercom::v1

* Fix eic modules

* Fix thumbv7em::{pwm, qspi}

* Fix usb modules

* Promote sercom::v2 to sercom

* Fix Tier 1 BSPs

* Remove all deprecated modules

* Adjust HAL readme to point to feather_m0 examples
  • Loading branch information
jbeaurivage authored and rtsuk committed Mar 29, 2022
1 parent 02fa5eb commit 088610a
Show file tree
Hide file tree
Showing 103 changed files with 623 additions and 4,709 deletions.
1 change: 1 addition & 0 deletions boards/feather_m0/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Unreleased

- Update `lib.rs` and examples to reflect removal of `v1` APIs and promotion of `v2` APIs
- Update `i2c_master` convenience function to use the new `sercom::v2::i2c` API
- Add an `i2c` example
- Make use of `bsp_peripherals`, `periph_alias` and `pin_alias` macros
Expand Down
2 changes: 1 addition & 1 deletion boards/feather_m0/examples/eic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use hal::clock::GenericClockController;
use hal::delay::Delay;
use hal::eic::pin::{ExtInt2, Sense};
use hal::eic::EIC;
use hal::gpio::v2::{Pin, PullUpInterrupt};
use hal::gpio::{Pin, PullUpInterrupt};
use hal::prelude::*;
use pac::{interrupt, CorePeripherals, Peripherals};

Expand Down
4 changes: 2 additions & 2 deletions boards/feather_m0/examples/i2c.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! This example showcases the i2c::v2 module.
//! This example showcases the i2c module.
#![no_std]
#![no_main]
Expand All @@ -21,7 +21,7 @@ use hal::clock::GenericClockController;
use hal::dmac::{DmaController, PriorityLevel};
use hal::ehal::blocking::i2c::WriteRead;
use hal::prelude::*;
use hal::sercom::v2::i2c;
use hal::sercom::i2c;

const LENGTH: usize = 1;
const ADDRESS: u8 = 0x77;
Expand Down
2 changes: 1 addition & 1 deletion boards/feather_m0/examples/uart.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! This example showcases the uart::v2 module.
//! This example showcases the uart module.
#![no_std]
#![no_main]
Expand Down
2 changes: 1 addition & 1 deletion boards/feather_m0/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ pub use hal::ehal;
pub use hal::pac;

use hal::clock::GenericClockController;
use hal::sercom::v2::{
use hal::sercom::{
i2c, spi,
uart::{self, BaudMode, Oversampling},
};
Expand Down
1 change: 1 addition & 0 deletions boards/feather_m4/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Unreleased

- Update `lib.rs` and examples to reflect removal of `v1` APIs and promotion of `v2` APIs
- Add an `i2c` example
- Update `i2c_master` convenience function to use the new `sercom::v2::i2c` API
- Updated to 2021 edition, updated dependencies, removed unused dependencies (#562)
Expand Down
4 changes: 2 additions & 2 deletions boards/feather_m4/examples/i2c.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! This example showcases the i2c::v2 module.
//! This example showcases the i2c module.
#![no_std]
#![no_main]
Expand All @@ -21,7 +21,7 @@ use hal::clock::GenericClockController;
use hal::dmac::{DmaController, PriorityLevel};
use hal::ehal::blocking::i2c::WriteRead;
use hal::prelude::*;
use hal::sercom::v2::i2c;
use hal::sercom::i2c;

const LENGTH: usize = 1;
const ADDRESS: u8 = 0x77;
Expand Down
2 changes: 1 addition & 1 deletion boards/feather_m4/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ pub use hal::ehal;
pub use hal::pac;

use hal::clock::GenericClockController;
use hal::sercom::v2::{
use hal::sercom::{
i2c, spi,
uart::{self, BaudMode, Oversampling},
IoSet1, Sercom1, Sercom2, Sercom5, UndocIoSet1,
Expand Down
1 change: 1 addition & 0 deletions boards/metro_m0/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Unreleased

- Update `lib.rs` and examples to reflect removal of `v1` APIs and promotion of `v2` APIs
- Update `i2c_master` convenience function to use the new `sercom::v2::i2c` API
- Add an `i2c` example
- Updated to 2021 edition, updated dependencies, removed unused dependencies (#562)
Expand Down
4 changes: 2 additions & 2 deletions boards/metro_m0/examples/i2c.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! This example showcases the i2c::v2 module.
//! This example showcases the i2c module.
#![no_std]
#![no_main]
Expand All @@ -21,7 +21,7 @@ use hal::clock::GenericClockController;
use hal::dmac::{DmaController, PriorityLevel};
use hal::ehal::blocking::i2c::WriteRead;
use hal::prelude::*;
use hal::sercom::v2::i2c;
use hal::sercom::i2c;

const LENGTH: usize = 1;
const ADDRESS: u8 = 0x77;
Expand Down
2 changes: 1 addition & 1 deletion boards/metro_m0/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ pub use hal::pac;

use hal::clock::GenericClockController;
use hal::prelude::*;
use hal::sercom::v2::{i2c, spi, uart, Sercom0, Sercom3, Sercom4, Sercom5};
use hal::sercom::{i2c, spi, uart, Sercom0, Sercom3, Sercom4, Sercom5};
use hal::time::{Hertz, MegaHertz};

#[cfg(feature = "usb")]
Expand Down
1 change: 1 addition & 0 deletions boards/metro_m4/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Unreleased

- Update `lib.rs` and examples to reflect removal of `v1` APIs and promotion of `v2` APIs
- Update `i2c_master` convenience function to use the new `sercom::v2::i2c` API
- Add an `i2c` example
- Fix incorrect clocking in `uart` helper function
Expand Down
2 changes: 1 addition & 1 deletion boards/metro_m4/examples/adc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use cortex_m_semihosting::hprintln;
use bsp::entry;
use hal::adc::Adc;
use hal::clock::GenericClockController;
use hal::gpio::v2::B;
use hal::gpio::B;
use hal::prelude::*;
use pac::gclk::pchctrl::GEN_A::GCLK11;
use pac::{CorePeripherals, Peripherals};
Expand Down
2 changes: 1 addition & 1 deletion boards/metro_m4/examples/clock_out.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use panic_semihosting as _;

use bsp::entry;
use hal::clock::GenericClockController;
use hal::gpio::v2::M;
use hal::gpio::M;

use pac::gclk::genctrl::SRC_A::DPLL0;
use pac::gclk::pchctrl::GEN_A::GCLK2;
Expand Down
4 changes: 2 additions & 2 deletions boards/metro_m4/examples/i2c.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! This example showcases the i2c::v2 module.
//! This example showcases the i2c module.
#![no_std]
#![no_main]
Expand All @@ -21,7 +21,7 @@ use hal::clock::GenericClockController;
use hal::dmac::{DmaController, PriorityLevel};
use hal::ehal::blocking::i2c::WriteRead;
use hal::prelude::*;
use hal::sercom::v2::i2c;
use hal::sercom::i2c;

const LENGTH: usize = 1;
const ADDRESS: u8 = 0x77;
Expand Down
2 changes: 1 addition & 1 deletion boards/metro_m4/examples/pwm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use metro_m4 as bsp;

use hal::clock::GenericClockController;
use hal::delay::Delay;
use hal::gpio::v2::E;
use hal::gpio::E;
use hal::prelude::*;
use hal::pwm::{Pwm2, TC2Pinout};
use pac::{CorePeripherals, Peripherals};
Expand Down
2 changes: 1 addition & 1 deletion boards/metro_m4/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ pub use cortex_m_rt::entry;
use hal::{
clock::GenericClockController,
qspi::{OneShot, Qspi},
sercom::v2::{
sercom::{
i2c, spi,
uart::{self, BaudMode, Oversampling},
IoSet1, IoSet6, Sercom2, Sercom3, Sercom5,
Expand Down
1 change: 1 addition & 0 deletions boards/samd11_bare/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Unreleased

- Update `lib.rs` and examples to reflect removal of `v1` APIs and promotion of `v2` APIs
- Update `i2c_master` convenience function to use the new `sercom::v2::i2c` API
- Add an `i2c` example

Expand Down
3 changes: 3 additions & 0 deletions boards/samd11_bare/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ use_semihosting = []
[profile.release]
debug = true

[profile.dev]
opt-level = "s"

# for cargo flash
[package.metadata]
chip = "ATSAMD11C14A"
Expand Down
2 changes: 1 addition & 1 deletion boards/samd11_bare/examples/adc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use samd11_bare as bsp;
use bsp::entry;
use hal::adc::Adc;
use hal::clock::GenericClockController;
use hal::gpio::v2::*;
use hal::gpio::*;
use hal::pac::{CorePeripherals, Peripherals};
use hal::prelude::*;
use rtt_target::{rprintln, rtt_init_print};
Expand Down
2 changes: 1 addition & 1 deletion boards/samd11_bare/examples/i2c.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use hal::clock::GenericClockController;
use hal::dmac::{DmaController, PriorityLevel};
use hal::ehal::blocking::i2c::WriteRead;
use hal::prelude::*;
use hal::sercom::v2::i2c;
use hal::sercom::i2c;

const LENGTH: usize = 1;
const ADDRESS: u8 = 0x77;
Expand Down
2 changes: 1 addition & 1 deletion boards/samd11_bare/examples/pwm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use bsp::{hal, pac};
use bsp::entry;
use hal::clock::GenericClockController;
use hal::delay::Delay;
use hal::gpio::v2::*;
use hal::gpio::*;
use hal::prelude::*;
use hal::pwm::{Channel, Pwm0};
use pac::{CorePeripherals, Peripherals};
Expand Down
2 changes: 1 addition & 1 deletion boards/samd11_bare/examples/serial.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use hal::delay::Delay;
use hal::pac::{CorePeripherals, Peripherals};

use hal::pac::gclk::{clkctrl::GEN_A, genctrl::SRC_A};
use hal::sercom::v2::{
use hal::sercom::{
uart::{self, BaudMode, Oversampling},
Sercom0,
};
Expand Down
2 changes: 1 addition & 1 deletion boards/samd11_bare/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ pub use hal::ehal;
pub use hal::pac;

use hal::clock::GenericClockController;
use hal::sercom::v2::{
use hal::sercom::{
i2c,
uart::{self, BaudMode, Oversampling},
Sercom0,
Expand Down
2 changes: 2 additions & 0 deletions boards/wio_terminal/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Unreleased

- Fix removed deprecated modules from HAL
- Update `lib.rs` and examples to reflect removal of `v1` APIs and promotion of `v2` APIs
- Update `i2c_master` convenience function to use the new `sercom::v2::i2c` API
- Add an `i2c` example

Expand Down
4 changes: 2 additions & 2 deletions boards/wio_terminal/src/buttons.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use atsamd_hal::clock::GenericClockController;
use atsamd_hal::common::eic;
use atsamd_hal::common::eic::pin::{
use atsamd_hal::eic;
use atsamd_hal::eic::pin::{
ExtInt10, ExtInt11, ExtInt12, ExtInt3, ExtInt4, ExtInt5, ExtInt7, Sense,
};
use atsamd_hal::pac::{interrupt, EIC, MCLK};
Expand Down
8 changes: 4 additions & 4 deletions boards/wio_terminal/src/display.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
use atsamd_hal::clock::GenericClockController;
use atsamd_hal::ehal::blocking::delay::DelayMs;
use atsamd_hal::ehal::digital::v2::OutputPin;
use atsamd_hal::hal::blocking::delay::DelayMs;
use atsamd_hal::hal::spi::{Phase, Polarity};
use atsamd_hal::ehal::spi::{Phase, Polarity};
use atsamd_hal::pac::{MCLK, SERCOM7};
use atsamd_hal::sercom::v2::spi;
use atsamd_hal::sercom::v2::{IoSet4, Sercom7};
use atsamd_hal::sercom::spi;
use atsamd_hal::sercom::{IoSet4, Sercom7};
use atsamd_hal::time::Hertz;
use atsamd_hal::typelevel::NoneT;
use display_interface_spi::SPIInterface;
Expand Down
2 changes: 1 addition & 1 deletion boards/wio_terminal/src/pins.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use super::sound::{Buzzer, Microphone};
use super::storage::{QSPIFlash, SDCard};
use super::wifi::WifiPins;

/// [`Pin`](atsamd_hal::gpio::v2::Pin) aliases defined by the
/// [`Pin`](atsamd_hal::gpio::Pin) aliases defined by the
/// [`bsp_pins!`](atsamd_hal::bsp_pins) macro
pub mod aliases {
atsamd_hal::bsp_pins!(
Expand Down
5 changes: 1 addition & 4 deletions boards/wio_terminal/src/sensors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@ use atsamd_hal::adc::Adc;
use atsamd_hal::clock::GenericClockController;
use atsamd_hal::pac::gclk::pchctrl::GEN_A::GCLK11;
use atsamd_hal::pac::{ADC1, MCLK, SERCOM4};
use atsamd_hal::sercom::{
v2::{i2c, IoSet3, Sercom4},
PadPin,
};
use atsamd_hal::sercom::{i2c, IoSet3, Sercom4};
use atsamd_hal::time::U32Ext;

use lis3dh::{Lis3dh, SlaveAddr};
Expand Down
2 changes: 1 addition & 1 deletion boards/wio_terminal/src/serial.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use atsamd_hal::clock::GenericClockController;
use atsamd_hal::pac::{self, MCLK, SERCOM2};
use atsamd_hal::sercom::v2::{uart, IoSet2, Sercom2};
use atsamd_hal::sercom::{uart, IoSet2, Sercom2};
use atsamd_hal::time::Hertz;

#[cfg(feature = "usb")]
Expand Down
2 changes: 1 addition & 1 deletion boards/wio_terminal/src/storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use atsamd_hal::{
clock::{GenericClockController, Sercom6CoreClock},
pac::{MCLK, QSPI, SERCOM6},
qspi,
sercom::v2::{spi, IoSet1, Sercom6},
sercom::{spi, IoSet1, Sercom6},
time::{Hertz, U32Ext},
typelevel::NoneT,
};
Expand Down
4 changes: 1 addition & 3 deletions boards/wio_terminal/src/wifi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use atsamd_hal::{
ehal::serial::{Read, Write},
pac::{interrupt, MCLK, SERCOM0},
prelude::nb,
sercom::v2::{uart, IoSet2, Sercom0},
sercom::{uart, IoSet2, Sercom0},
time::{Hertz, U32Ext},
};
use bbqueue::{self, BBBuffer, Consumer, Producer};
Expand Down Expand Up @@ -288,10 +288,8 @@ impl Wifi {
/// Imports necessary for using `wifi_singleton`.
pub mod wifi_prelude {
pub use crate::wifi::*;
pub use atsamd_hal::gpio::Port;
pub use atsamd_hal::pac::SERCOM0;
pub use atsamd_hal::pac::{interrupt, MCLK};
pub use atsamd_hal::sercom::{Sercom0Pad0, Sercom0Pad2, UART0};
pub use bbqueue::{BBBuffer, Producer};

pub use cortex_m::interrupt::CriticalSection;
Expand Down
11 changes: 10 additions & 1 deletion hal/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Unreleased Changes
# v0.15.0

- Remove deprecated modules:
- Remove `gpio::v1`, `sercom::v1` module, promote `gpio::v2` to `gpio` and `sercom::v2` to `sercom`.
- Remove deprecated `hal` in favour of `ehal`
- Remove deprecated `target_device` in favour of `pac`
- Remove deprecated `spi_common` module
- Remove deprecated `common` module
- Remove deprecated `samd51`, `same51`, `same53`, `same54` modules
- Remove deprecated `SpinTimer`
- Provide the necessary fixes to support those changes.
- Cleanup most `clippy` lints
- Update `seq_macro` and remove `replace_with` dependencies (#568)
- Add a `bsp_peripherals!` macro and fix a bug in `bsp_pins!` (#515)
Expand Down
4 changes: 2 additions & 2 deletions hal/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ This crate can support other variants in a similar fashion; pull requests for th

## Examples?

Check out the metro_m0 board support crate examples:
Check out the `feather_m0` board support crate examples:

https://github.com/atsamd-rs/atsamd/tree/master/boards/metro_m0/examples
https://github.com/atsamd-rs/atsamd/tree/master/boards/feather_m0/examples

## License

Expand Down
File renamed without changes.
Loading

0 comments on commit 088610a

Please sign in to comment.