Skip to content

Commit

Permalink
Big Refactor (#90)
Browse files Browse the repository at this point in the history
* upstream svd2rust again

* fix hal for upstream svd2rust

* version bumps

* fix issue #88

* very WIP and broken

* fix

* Move PAC stuff behind pac:: in each BSP

Also fiddle with Trellis M4 and PyGamer OutputPins

* bugfixes

* more bugfixes

* one more fix
  • Loading branch information
sajattack authored Sep 3, 2019
1 parent c21fcb5 commit 61e3ee1
Show file tree
Hide file tree
Showing 3,478 changed files with 367,026 additions and 810,853 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
4 changes: 0 additions & 4 deletions .rustfmt.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
# Run `rustfmt --config-help` to see available config options.
# Please keep these in alphabetical order.
condense_wildcard_suffixes = true
error_on_line_overflow = false
error_on_unformatted = false
# Too many derives can cause line length limits to be exceeded. rustfmt-nightly
# 0.2.5 doesn't appear to pay attention to this.
merge_derives = false
struct_lit_single_line = true
# Override the Nuclide/Atom default tab spacing.
tab_spaces = 4
use_field_init_shorthand = true
Expand Down
4 changes: 2 additions & 2 deletions boards/arduino_mkrzero/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "arduino_mkrzero"
version = "0.4.0"
version = "0.5.0"
authors = ["Wez Furlong <[email protected]>", "David McGillicuddy <[email protected]>"]
description = "Board Support crate for the Arduino MKRZERO"
keywords = ["no-std", "arm", "cortex-m", "embedded-hal", "arduino"]
Expand All @@ -24,7 +24,7 @@ optional = true

[dependencies.atsamd-hal]
path = "../../hal"
version = "~0.6"
version = "~0.7"
default-features = false

[features]
Expand Down
3 changes: 2 additions & 1 deletion boards/arduino_mkrzero/examples/blinky_basic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ extern crate arduino_mkrzero as hal;
use hal::clock::GenericClockController;
use hal::delay::Delay;
use hal::prelude::*;
use hal::{entry, CorePeripherals, Peripherals};
use hal::entry;
use hal::pac::{CorePeripherals, Peripherals};

#[entry]
fn main() -> ! {
Expand Down
7 changes: 5 additions & 2 deletions boards/arduino_mkrzero/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,11 @@ pub use cortex_m_rt::entry;
pub extern crate panic_halt;

use hal::prelude::*;
pub use hal::target_device::*;
pub use hal::*;
use hal::*;

pub use hal::target_device as pac;
pub use hal::common::*;
pub use hal::samd21::*;

use gpio::{Floating, Input, Port};

Expand Down
4 changes: 2 additions & 2 deletions boards/circuit_playground_express/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "circuit_playground_express"
version = "0.4.0"
version = "0.5.0"
authors = ["Paul Sajna <[email protected]>"]
description = "Board Support crate for the Adafruit Circuit Playground Express"
keywords = ["no-std", "arm", "cortex-m", "embedded-hal"]
Expand All @@ -16,7 +16,7 @@ nb = "~0.1"

[dependencies.atsamd-hal]
path = "../../hal"
version = "~0.6"
version = "~0.7"
default-features = false

[dev-dependencies]
Expand Down
2 changes: 1 addition & 1 deletion boards/circuit_playground_express/examples/blinky_basic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ extern crate panic_halt;
use hal::clock::GenericClockController;
use hal::delay::Delay;
use hal::prelude::*;
use hal::{CorePeripherals, Peripherals};
use hal::pac::{CorePeripherals, Peripherals};

use cortex_m_rt::entry;

Expand Down
15 changes: 9 additions & 6 deletions boards/circuit_playground_express/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@
extern crate atsamd_hal as hal;

use hal::prelude::*;
pub use hal::target_device::*;
pub use hal::*;
use hal::*;

pub use hal::target_device as pac;
pub use hal::common::*;
pub use hal::samd21::*;

use gpio::{Floating, Input, Output, Port, PushPull};
use hal::clock::GenericClockController;
Expand Down Expand Up @@ -66,8 +69,8 @@ define_pins!(
/// SPI Master.
pub fn flash_spi_master(
clocks: &mut GenericClockController,
sercom3: SERCOM3,
pm: &mut PM,
sercom3: pac::SERCOM3,
pm: &mut pac::PM,
sck: gpio::Pa21<Input<Floating>>,
mosi: gpio::Pa20<Input<Floating>>,
miso: gpio::Pa16<Input<Floating>>,
Expand Down Expand Up @@ -105,8 +108,8 @@ pub fn flash_spi_master(
pub fn i2c_master<F: Into<Hertz>>(
clocks: &mut GenericClockController,
bus_speed: F,
sercom5: SERCOM5,
pm: &mut PM,
sercom5: pac::SERCOM5,
pm: &mut pac::PM,
sda: gpio::Pb2<Input<Floating>>,
scl: gpio::Pb3<Input<Floating>>,
port: &mut Port,
Expand Down
4 changes: 2 additions & 2 deletions boards/feather_m0/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "feather_m0"
version = "0.4.0"
version = "0.5.0"
authors = ["Ben Bergman <[email protected]>"]
description = "Board Support crate for the Adafruit Feather M0"
keywords = ["no-std", "arm", "cortex-m", "embedded-hal"]
Expand All @@ -20,7 +20,7 @@ optional = true

[dependencies.atsamd-hal]
path = "../../hal"
version = "~0.6"
version = "~0.7"
default-features = false

[dependencies.panic-abort]
Expand Down
3 changes: 2 additions & 1 deletion boards/feather_m0/examples/blinky_basic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ extern crate panic_semihosting;
use hal::clock::GenericClockController;
use hal::delay::Delay;
use hal::prelude::*;
use hal::{entry, CorePeripherals, Peripherals};
use hal::entry;
use hal::pac::{CorePeripherals, Peripherals};

#[entry]
fn main() -> ! {
Expand Down
2 changes: 1 addition & 1 deletion boards/feather_m0/examples/pwm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ extern crate feather_m0 as hal;
extern crate cortex_m_rt;

use hal::clock::GenericClockController;
use hal::{Peripherals, CorePeripherals};
use hal::pac::{Peripherals, CorePeripherals};
use hal::prelude::*;
use hal::delay::Delay;
use hal::pwm::Pwm3;
Expand Down
23 changes: 13 additions & 10 deletions boards/feather_m0/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@ extern crate cortex_m_rt;
pub use cortex_m_rt::entry;

use hal::prelude::*;
pub use hal::target_device::*;
pub use hal::*;
use hal::*;

pub use hal::target_device as pac;
pub use hal::common::*;
pub use hal::samd21::*;

use gpio::{Floating, Input, PfC, Port};
use hal::clock::GenericClockController;
Expand Down Expand Up @@ -89,8 +92,8 @@ define_pins!(
pub fn spi_master<F: Into<Hertz>>(
clocks: &mut GenericClockController,
bus_speed: F,
sercom4: SERCOM4,
pm: &mut PM,
sercom4: pac::SERCOM4,
pm: &mut pac::PM,
sck: gpio::Pb11<Input<Floating>>,
mosi: gpio::Pb10<Input<Floating>>,
miso: gpio::Pa12<Input<Floating>>,
Expand Down Expand Up @@ -119,8 +122,8 @@ pub fn spi_master<F: Into<Hertz>>(
pub fn i2c_master<F: Into<Hertz>>(
clocks: &mut GenericClockController,
bus_speed: F,
sercom3: SERCOM3,
pm: &mut PM,
sercom3: pac::SERCOM3,
pm: &mut pac::PM,
sda: gpio::Pa22<Input<Floating>>,
scl: gpio::Pa23<Input<Floating>>,
port: &mut Port,
Expand All @@ -144,8 +147,8 @@ pub fn i2c_master<F: Into<Hertz>>(
pub fn uart<F: Into<Hertz>>(
clocks: &mut GenericClockController,
baud: F,
sercom0: SERCOM0,
pm: &mut PM,
sercom0: pac::SERCOM0,
pm: &mut pac::PM,
d0: gpio::Pa11<Input<Floating>>,
d1: gpio::Pa10<Input<Floating>>,
port: &mut Port,
Expand All @@ -168,9 +171,9 @@ pub fn uart<F: Into<Hertz>>(

#[cfg(feature = "usb")]
pub fn usb_bus(
usb: USB,
usb: pac::USB,
clocks: &mut GenericClockController,
pm: &mut PM,
pm: &mut pac::PM,
dm: gpio::Pa24<Input<Floating>>,
dp: gpio::Pa25<Input<Floating>>,
port: &mut Port,
Expand Down
4 changes: 2 additions & 2 deletions boards/feather_m4/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "feather_m4"
version = "0.2.0"
version = "0.3.0"
authors = ["Theodore DeRego <[email protected]>"]
description = "Board Support crate for the Adafruit Feather M4"
keywords = ["no-std", "arm", "cortex-m", "embedded-hal"]
Expand All @@ -20,7 +20,7 @@ optional = true

[dependencies.atsamd-hal]
path = "../../hal"
version = "~0.6"
version = "~0.7"
default-features = false

[dev-dependencies]
Expand Down
3 changes: 2 additions & 1 deletion boards/feather_m4/examples/blinky_basic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ extern crate panic_semihosting;
use hal::clock::GenericClockController;
use hal::delay::Delay;
use hal::prelude::*;
use hal::{entry, CorePeripherals, Peripherals};
use hal::entry;
use hal::pac::{CorePeripherals, Peripherals};

#[entry]
fn main() -> ! {
Expand Down
19 changes: 11 additions & 8 deletions boards/feather_m4/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,12 @@ extern crate cortex_m_rt;
#[cfg(feature = "rt")]
pub use cortex_m_rt::entry;

pub use target_device::*;
use hal::prelude::*;
pub use hal::*;
use hal::*;

pub use hal::target_device as pac;
pub use hal::common::*;
pub use hal::samd51::*;

use gpio::{Floating, Input, Port, PfC};
use hal::clock::GenericClockController;
Expand Down Expand Up @@ -95,8 +98,8 @@ define_pins!(
pub fn spi_master<F: Into<Hertz>>(
clocks: &mut GenericClockController,
bus_speed: F,
sercom1: SERCOM1,
mclk: &mut MCLK,
sercom1: pac::SERCOM1,
mclk: &mut pac::MCLK,
sck: gpio::Pa17<Input<Floating>>,
mosi: gpio::Pb23<Input<Floating>>,
miso: gpio::Pb22<Input<Floating>>,
Expand Down Expand Up @@ -125,8 +128,8 @@ pub fn spi_master<F: Into<Hertz>>(
pub fn i2c_master<F: Into<Hertz>>(
clocks: &mut GenericClockController,
bus_speed: F,
sercom2: SERCOM2,
mclk: &mut MCLK,
sercom2: pac::SERCOM2,
mclk: &mut pac::MCLK,
sda: gpio::Pa12<Input<Floating>>,
scl: gpio::Pa13<Input<Floating>>,
port: &mut Port,
Expand All @@ -150,8 +153,8 @@ pub fn i2c_master<F: Into<Hertz>>(
pub fn uart<F: Into<Hertz>>(
clocks: &mut GenericClockController,
baud: F,
sercom5: SERCOM5,
mclk: &mut MCLK,
sercom5: pac::SERCOM5,
mclk: &mut pac::MCLK,
d0: gpio::Pb17<Input<Floating>>,
d1: gpio::Pb16<Input<Floating>>,
port: &mut Port,
Expand Down
4 changes: 2 additions & 2 deletions boards/gemma_m0/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "gemma_m0"
version = "0.4.0"
version = "0.5.0"
authors = ["Wez Furlong <[email protected]>"]
description = "Board Support crate for the Adafruit Gemma M0"
keywords = ["no-std", "arm", "cortex-m", "embedded-hal"]
Expand All @@ -20,7 +20,7 @@ optional = true

[dependencies.atsamd-hal]
path = "../../hal"
version = "~0.6"
version = "~0.7"
default-features = false

[dev-dependencies]
Expand Down
3 changes: 2 additions & 1 deletion boards/gemma_m0/examples/blinky_basic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ extern crate panic_halt;
use hal::clock::GenericClockController;
use hal::delay::Delay;
use hal::prelude::*;
use hal::{entry, CorePeripherals, Peripherals};
use hal::entry;
use hal::pac::{CorePeripherals, Peripherals};

#[entry]
fn main() -> ! {
Expand Down
11 changes: 7 additions & 4 deletions boards/gemma_m0/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@ extern crate cortex_m_rt;
pub use cortex_m_rt::entry;

use hal::prelude::*;
pub use hal::target_device::*;
pub use hal::*;
use hal::*;

pub use hal::target_device as pac;
pub use hal::common::*;
pub use hal::samd21::*;

use gpio::{Floating, Input, PfD, Port};

Expand Down Expand Up @@ -45,8 +48,8 @@ define_pins!(
pub fn uart<F: Into<Hertz>>(
clocks: &mut GenericClockController,
baud: F,
sercom0: SERCOM0,
pm: &mut PM,
sercom0: pac::SERCOM0,
pm: &mut pac::PM,
d2: gpio::Pa5<Input<Floating>>,
d0: gpio::Pa4<Input<Floating>>,
port: &mut Port,
Expand Down
4 changes: 2 additions & 2 deletions boards/itsybitsy_m0/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "itsybitsy_m0"
version = "0.4.0"
version = "0.5.0"
authors = ["Ben Bergman <[email protected]>"]
description = "Board Support crate for the Adafruit ItsyBitsy M0"
keywords = ["no-std", "arm", "cortex-m", "embedded-hal"]
Expand All @@ -20,7 +20,7 @@ optional = true

[dependencies.atsamd-hal]
path = "../../hal"
version = "~0.6"
version = "~0.7"
default-features = false

[dev-dependencies]
Expand Down
3 changes: 2 additions & 1 deletion boards/itsybitsy_m0/examples/blinky_basic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ extern crate panic_halt;
use hal::clock::GenericClockController;
use hal::delay::Delay;
use hal::prelude::*;
use hal::{entry, CorePeripherals, Peripherals};
use hal::entry;
use hal::pac::{CorePeripherals, Peripherals};

#[entry]
fn main() -> ! {
Expand Down
3 changes: 2 additions & 1 deletion boards/itsybitsy_m0/examples/i2c_ssd1306.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ use hal::clock::GenericClockController;
use hal::delay::Delay;
use hal::prelude::*;
use hal::time::KiloHertz;
use hal::{entry, CorePeripherals, Peripherals};
use hal::entry;
use hal::pac::{CorePeripherals, Peripherals};

use embedded_graphics::prelude::*;
use embedded_graphics::primitives::{Circle, Line, Rect};
Expand Down
3 changes: 2 additions & 1 deletion boards/itsybitsy_m0/examples/spi_ssd1306.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ use hal::clock::GenericClockController;
use hal::delay::Delay;
use hal::prelude::*;
use hal::time::MegaHertz;
use hal::{entry, CorePeripherals, Peripherals};
use hal::entry;
use hal::pac::{CorePeripherals, Peripherals};

use embedded_graphics::prelude::*;
use embedded_graphics::primitives::{Circle, Line, Rect};
Expand Down
Loading

0 comments on commit 61e3ee1

Please sign in to comment.