Skip to content

Commit

Permalink
Get ready for v0.13 release (#462)
Browse files Browse the repository at this point in the history
* Add changelog

* Add deprecation notices in lib.rs

* Add deprecation notices to common and samd/same modules in lib.rs

* Add deprecation notice to gpio::v1

* Add deprecation notices for sercom::v1::{spi, uart}

* Add BPS tiers to README

* Deprecate spi_common module

* Update samd11_bare to v2 APIs

* Deprecate SpinTimer

* Update metro_m0 to uart::v2

* Deprecate atsamd_hal::hal and atsamd_hal::target_device

* Tie T2 boards to crates.io atsamd-hal dependency

* Tie all BSPs to atsamd-hal = 0.13

* Bump atsamd-hal to 0.13

* Bump T2 BSP versions
  • Loading branch information
jbeaurivage committed Sep 27, 2021
1 parent a65ceea commit 0359814
Show file tree
Hide file tree
Showing 66 changed files with 449 additions and 227 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
@@ -0,0 +1,5 @@
# Unreleased Changes

---

Changelog tracking started at v0.13
73 changes: 73 additions & 0 deletions README.md
Expand Up @@ -89,6 +89,79 @@ $ cargo build --examples

## How to use a BSP (i.e. getting started writing your own code)

A BSP (**B**oard **S**upport **P**ackage) is a crate that contains definitions specific to a particular board. These generally contain pin definitions, sometimes helper functions to setup certain peripherals, as well as examples to quickly get up and running with your board. BSPs are separated into 2 tiers:

* Tier 1 boards are guaranteed to be up to date with the latest version of `atsamd-hal`

* Tier 2 boards are tied to a specific version of `atsamd-hal`. They are not guaranteed to be updated when a new version of `atsamd-hal` gets released.

### Tier 1 BSPs

* `feather_m0`

* `feather_m4`

* `metro_m0`

* `metro_m4`

* `pygamer`

* `samd11_bare`

* `wio_terminal`


### Tier 2 BSPs

* `arduino_mkr1000`

* `arduino_mkrvidor4000`

* `arduino_mkrzero`

* `arduino_nano33iot`

* `atsame54_xpro`

* `circuit_playground_express`

* `edgebadge`

* `gemma_m0`

* `grand_central_m4`

* `itsybitsy_m0`

* `itsybitsy_m4`

* `p1am_100`

* `pfza_proto1`

* `pyportal`

* `qt_py_m0`

* `samd21_mini`

* `serpente`

* `sodaq_one`

* `sodaq_sara_aff`

* `trellis_m4`

* `trinket_m0`

* `wio_lite_mg126`

* `wio_lite_w600`

* `xiao_m0`

To bootstrap your own project you should be able to copy/paste the Rust code from the examples folder within the folder of the BSP you've chosen. But you shouldn't copy the `Cargo.toml` file from there, since that's not only used for the examples, but also for the whole BSP itself. You want to make your own `Cargo.toml` file. If you're new to this and have no clue what you're doing then this is probably the line you want in there:

```rust
Expand Down
5 changes: 2 additions & 3 deletions boards/arduino_mkr1000/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "arduino_mkr1000"
version = "0.3.0"
version = "0.4.0"
authors = ["Eric Rushing <rushinge@gmail.com>"]
description = "Board Support crate for the Arduino MKR 1000 WiFi"
keywords = ["no-std", "arm", "cortex-m", "embedded-hal"]
Expand All @@ -19,8 +19,7 @@ version = "0.6.12"
optional = true

[dependencies.atsamd-hal]
path = "../../hal"
version = "0.12"
version = "0.13"
default-features = false

[dependencies.usb-device]
Expand Down
5 changes: 2 additions & 3 deletions boards/arduino_mkrvidor4000/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "arduino_mkrvidor4000"
version = "0.4.0"
version = "0.5.0"
authors = ["Sameer Puri <purisame@spuri.io>"]
description = "Board Support crate for the Arduino MKR VIDOR 4000"
keywords = ["no-std", "arm", "cortex-m", "embedded-hal", "arduino"]
Expand All @@ -19,8 +19,7 @@ version = "0.6.12"
optional = true

[dependencies.atsamd-hal]
path = "../../hal"
version = "0.12"
version = "0.13"
default-features = false

[dev-dependencies]
Expand Down
5 changes: 2 additions & 3 deletions boards/arduino_mkrzero/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "arduino_mkrzero"
version = "0.10.0"
version = "0.11.0"
authors = ["Wez Furlong <wez@wezfurlong.org>", "David McGillicuddy <contact@djmcgill.co.uk>"]
description = "Board Support crate for the Arduino MKRZERO"
keywords = ["no-std", "arm", "cortex-m", "embedded-hal", "arduino"]
Expand All @@ -19,8 +19,7 @@ version = "0.6.12"
optional = true

[dependencies.atsamd-hal]
path = "../../hal"
version = "0.12"
version = "0.13"
default-features = false

[dependencies.usb-device]
Expand Down
5 changes: 2 additions & 3 deletions boards/arduino_nano33iot/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "arduino_nano33iot"
version = "0.4.0"
version = "0.5.0"
authors = ["Gus Wynn <guswynn@gmail.com>"]
description = "Board Support crate for the Arduino Nano 33 IOT"
keywords = ["no-std", "arm", "cortex-m", "embedded-hal", "arduino"]
Expand All @@ -19,8 +19,7 @@ version = "0.6.12"
optional = true

[dependencies.atsamd-hal]
path = "../../hal"
version = "0.12"
version = "0.13"
default-features = false

[dependencies.usb-device]
Expand Down
5 changes: 2 additions & 3 deletions boards/atsame54_xpro/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "atsame54_xpro"
version = "0.2.0"
version = "0.3.0"
authors = [
"Karsten Große <karsten.grosse@sympatron.de>"
]
Expand All @@ -21,8 +21,7 @@ version = "0.6.12"
optional = true

[dependencies.atsamd-hal]
path = "../../hal"
version = "0.12"
version = "0.13"
default-features = false

[dependencies.usb-device]
Expand Down
5 changes: 2 additions & 3 deletions boards/circuit_playground_express/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "circuit_playground_express"
version = "0.9.0"
version = "0.10.0"
authors = ["Paul Sajna <paulsajna@gmail.com>"]
description = "Board Support crate for the Adafruit Circuit Playground Express"
keywords = ["no-std", "arm", "cortex-m", "embedded-hal"]
Expand All @@ -15,8 +15,7 @@ embedded-hal = "0.2.3"
nb = "0.1"

[dependencies.atsamd-hal]
path = "../../hal"
version = "0.12"
version = "0.13"
default-features = false

[dev-dependencies]
Expand Down
5 changes: 2 additions & 3 deletions boards/edgebadge/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "edgebadge"
version = "0.7.0"
version = "0.8.0"
authors = ["Jacob Rosenthal <@jacobrosenthal>"]
description = "Board Support crate for the Adafruit EdgeBadge"
keywords = ["no-std", "arm", "cortex-m", "embedded-hal"]
Expand All @@ -22,8 +22,7 @@ version = "0.6.12"
optional = true

[dependencies.atsamd-hal]
path = "../../hal"
version = "0.12"
version = "0.13"
default-features = false

[dependencies.micromath]
Expand Down
2 changes: 1 addition & 1 deletion boards/feather_m0/Cargo.toml
Expand Up @@ -20,7 +20,7 @@ optional = true

[dependencies.atsamd-hal]
path = "../../hal"
version = "0.12"
version = "0.13"
default-features = false

[dependencies.panic_rtt]
Expand Down
5 changes: 2 additions & 3 deletions boards/feather_m4/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "feather_m4"
version = "0.7.0"
version = "0.8.0"
edition = "2018"
authors = ["Theodore DeRego <tderego94@gmail.com>"]
description = "Board Support crate for the Adafruit Feather M4"
Expand All @@ -20,8 +20,7 @@ version = "0.6.12"
optional = true

[dependencies.atsamd-hal]
path = "../../hal"
version = "0.12"
version = "0.13"
default-features = false

[dependencies.usb-device]
Expand Down
5 changes: 2 additions & 3 deletions boards/gemma_m0/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "gemma_m0"
version = "0.9.0"
version = "0.10.0"
authors = ["Wez Furlong <wez@wezfurlong.org>"]
description = "Board Support crate for the Adafruit Gemma M0"
keywords = ["no-std", "arm", "cortex-m", "embedded-hal"]
Expand All @@ -19,8 +19,7 @@ version = "0.6.12"
optional = true

[dependencies.atsamd-hal]
path = "../../hal"
version = "0.12"
version = "0.13"
default-features = false

[dev-dependencies]
Expand Down
5 changes: 2 additions & 3 deletions boards/grand_central_m4/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "grand_central_m4"
version = "0.3.0"
version = "0.4.0"
authors = [
"Dustin Little <dlittle@toyatech.net>"
]
Expand All @@ -22,8 +22,7 @@ version = "0.6.12"
optional = true

[dependencies.atsamd-hal]
path = "../../hal"
version = "0.12"
version = "0.13"
default-features = false

[dependencies.usb-device]
Expand Down
5 changes: 2 additions & 3 deletions boards/itsybitsy_m0/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "itsybitsy_m0"
version = "0.10.0"
version = "0.11.0"
authors = ["Ben Bergman <ben@benbergman.ca>"]
description = "Board Support crate for the Adafruit ItsyBitsy M0"
keywords = ["no-std", "arm", "cortex-m", "embedded-hal"]
Expand All @@ -22,8 +22,7 @@ version = "0.6.12"
optional = true

[dependencies.atsamd-hal]
path = "../../hal"
version = "0.12"
version = "0.13"
default-features = false

[dependencies.usb-device]
Expand Down
5 changes: 2 additions & 3 deletions boards/itsybitsy_m4/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "itsybitsy_m4"
version = "0.5.0"
version = "0.6.0"
authors = [
"Nic Hartley <nxh9052@rit.edu>",
"Tom <twitchyliquid64@ciphersink.net>",
Expand All @@ -25,8 +25,7 @@ version = "0.6.12"
optional = true

[dependencies.atsamd-hal]
path = "../../hal"
version = "0.12"
version = "0.13"
default-features = false

[dependencies.usb-device]
Expand Down
2 changes: 1 addition & 1 deletion boards/metro_m0/Cargo.toml
Expand Up @@ -20,7 +20,7 @@ optional = true

[dependencies.atsamd-hal]
path = "../../hal"
version = "0.12"
version = "0.13"
default-features = false

[dependencies.rtic-monotonic]
Expand Down
15 changes: 10 additions & 5 deletions boards/metro_m0/src/lib.rs
Expand Up @@ -9,8 +9,8 @@ pub use hal::pac;

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

#[cfg(feature = "usb")]
Expand Down Expand Up @@ -286,8 +286,11 @@ pub fn i2c_master(
I2CMaster3::new(clock, baud, sercom3, pm, sda, scl)
}

/// UART pads
pub type UartPads = uart::Pads<Sercom0, UartRx, UartTx>;

/// UART device for the labelled RX & TX pins
pub type Uart = UART0<UartRx, UartTx, (), ()>;
pub type Uart = uart::Uart<uart::Config<UartPads>, uart::Duplex>;

/// Convenience for setting up the labelled RX, TX pins to
/// operate as a UART device running at the specified baud.
Expand All @@ -302,8 +305,10 @@ pub fn uart(
let gclk0 = clocks.gclk0();
let clock = &clocks.sercom0_core(&gclk0).unwrap();
let baud = baud.into();
let pads = (uart_rx.into(), uart_tx.into());
UART0::new(clock, baud, sercom0, pm, pads)
let pads = uart::Pads::default().rx(uart_rx.into()).tx(uart_tx.into());
uart::Config::new(pm, sercom0, pads, clock.freq())
.baud(baud, uart::BaudMode::Fractional(uart::Oversampling::Bits16))
.enable()
}

#[cfg(feature = "usb")]
Expand Down
5 changes: 2 additions & 3 deletions boards/metro_m4/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "metro_m4"
version = "0.8.0"
version = "0.9.0"
authors = ["Paul Sajna <sajattack@gmail.com>", "Wez Furlong <wez@wezfurlong.org>"]
description = "Board Support crate for the Adafruit Metro M4"
keywords = ["no-std", "arm", "cortex-m", "embedded-hal"]
Expand All @@ -19,8 +19,7 @@ version = "0.6.13"
optional = true

[dependencies.atsamd-hal]
path = "../../hal"
version = "0.12"
version = "0.13"
default-features = false

[dependencies.usb-device]
Expand Down
5 changes: 2 additions & 3 deletions boards/p1am_100/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "p1am_100"
version = "0.1.0"
version = "0.2.0"
authors = ["Quentin Smith <quentin@mit.edu>"]
description = "Board Support crate for the Facts Engineering P1AM-100"
keywords = ["no-std", "arm", "cortex-m", "embedded-hal"]
Expand All @@ -23,8 +23,7 @@ version = "0.5.1"
optional = true

[dependencies.atsamd-hal]
path = "../../hal"
version = "0.12"
version = "0.13"
default-features = false

[dependencies.panic_rtt]
Expand Down

0 comments on commit 0359814

Please sign in to comment.