Rename embassy-extras to embassy-hal-common

This commit is contained in:
Dario Nieuwenhuis 2021-07-29 13:44:51 +02:00
parent c8a48d726a
commit 7bfb763e09
66 changed files with 59 additions and 59 deletions

View File

@ -21,7 +21,7 @@ members = [
"embassy",
"embassy-traits",
"embassy-macros",
"embassy-extras",
"embassy-hal-common",
"embassy-net",
# Uncomment ONLY ONE of the groups below.

View File

@ -1,5 +1,5 @@
[package]
name = "embassy-extras"
name = "embassy-hal-common"
version = "0.1.0"
authors = ["Dario Nieuwenhuis <dirbaio@dirbaio.net>"]
edition = "2018"

View File

@ -30,7 +30,7 @@ nrf52840 = ["nrf52840-pac"]
[dependencies]
embassy = { version = "0.1.0", path = "../embassy", features = ["time-tick-32768hz"] }
embassy-macros = { version = "0.1.0", path = "../embassy-macros", features = ["nrf"]}
embassy-extras = {version = "0.1.0", path = "../embassy-extras" }
embassy-hal-common = {version = "0.1.0", path = "../embassy-hal-common" }
defmt = { version = "0.2.0", optional = true }
log = { version = "0.4.11", optional = true }

View File

@ -7,9 +7,9 @@ use core::task::{Context, Poll};
use embassy::interrupt::InterruptExt;
use embassy::io::{AsyncBufRead, AsyncWrite, Result};
use embassy::util::{Unborrow, WakerRegistration};
use embassy_extras::peripheral::{PeripheralMutex, PeripheralState};
use embassy_extras::ring_buffer::RingBuffer;
use embassy_extras::{low_power_wait_until, unborrow};
use embassy_hal_common::peripheral::{PeripheralMutex, PeripheralState};
use embassy_hal_common::ring_buffer::RingBuffer;
use embassy_hal_common::{low_power_wait_until, unborrow};
use crate::gpio::sealed::Pin as _;
use crate::gpio::{OptionalPin as GpioOptionalPin, Pin as GpioPin};

View File

@ -3,7 +3,7 @@ pub use nrf52805_pac as pac;
pub const EASY_DMA_SIZE: usize = (1 << 14) - 1;
pub const FORCE_COPY_BUFFER_SIZE: usize = 256;
embassy_extras::peripherals! {
embassy_hal_common::peripherals! {
// RTC
RTC0,
RTC1,

View File

@ -3,7 +3,7 @@ pub use nrf52810_pac as pac;
pub const EASY_DMA_SIZE: usize = (1 << 10) - 1;
pub const FORCE_COPY_BUFFER_SIZE: usize = 256;
embassy_extras::peripherals! {
embassy_hal_common::peripherals! {
// RTC
RTC0,
RTC1,

View File

@ -3,7 +3,7 @@ pub use nrf52811_pac as pac;
pub const EASY_DMA_SIZE: usize = (1 << 14) - 1;
pub const FORCE_COPY_BUFFER_SIZE: usize = 256;
embassy_extras::peripherals! {
embassy_hal_common::peripherals! {
// RTC
RTC0,
RTC1,

View File

@ -3,7 +3,7 @@ pub use nrf52820_pac as pac;
pub const EASY_DMA_SIZE: usize = (1 << 15) - 1;
pub const FORCE_COPY_BUFFER_SIZE: usize = 512;
embassy_extras::peripherals! {
embassy_hal_common::peripherals! {
// RTC
RTC0,
RTC1,

View File

@ -3,7 +3,7 @@ pub use nrf52832_pac as pac;
pub const EASY_DMA_SIZE: usize = (1 << 8) - 1;
pub const FORCE_COPY_BUFFER_SIZE: usize = 255;
embassy_extras::peripherals! {
embassy_hal_common::peripherals! {
// RTC
RTC0,
RTC1,

View File

@ -3,7 +3,7 @@ pub use nrf52833_pac as pac;
pub const EASY_DMA_SIZE: usize = (1 << 16) - 1;
pub const FORCE_COPY_BUFFER_SIZE: usize = 512;
embassy_extras::peripherals! {
embassy_hal_common::peripherals! {
// RTC
RTC0,
RTC1,

View File

@ -3,7 +3,7 @@ pub use nrf52840_pac as pac;
pub const EASY_DMA_SIZE: usize = (1 << 16) - 1;
pub const FORCE_COPY_BUFFER_SIZE: usize = 512;
embassy_extras::peripherals! {
embassy_hal_common::peripherals! {
// RTC
RTC0,
RTC1,

View File

@ -5,7 +5,7 @@ use core::hint::unreachable_unchecked;
use core::marker::PhantomData;
use embassy::util::Unborrow;
use embassy_extras::{unborrow, unsafe_impl_unborrow};
use embassy_hal_common::{unborrow, unsafe_impl_unborrow};
use embedded_hal::digital::v2::{InputPin, OutputPin, StatefulOutputPin};
use gpio::pin_cnf::DRIVE_A;

View File

@ -5,7 +5,7 @@ use core::task::{Context, Poll};
use embassy::interrupt::{Interrupt, InterruptExt};
use embassy::traits::gpio::{WaitForAnyEdge, WaitForHigh, WaitForLow};
use embassy::util::AtomicWaker;
use embassy_extras::unsafe_impl_unborrow;
use embassy_hal_common::unsafe_impl_unborrow;
use embedded_hal::digital::v2::{InputPin, StatefulOutputPin};
use futures::future::poll_fn;

View File

@ -76,7 +76,7 @@ pub mod interrupt {
pub use crate::chip::irqs::*;
pub use cortex_m::interrupt::{CriticalSection, Mutex};
pub use embassy::interrupt::{declare, take, Interrupt};
pub use embassy_extras::interrupt::Priority3 as Priority;
pub use embassy_hal_common::interrupt::Priority3 as Priority;
}
pub use embassy_macros::interrupt;

View File

@ -12,7 +12,7 @@
use core::marker::PhantomData;
use core::ptr::NonNull;
use embassy::util::Unborrow;
use embassy_extras::{unborrow, unsafe_impl_unborrow};
use embassy_hal_common::{unborrow, unsafe_impl_unborrow};
use crate::{pac, peripherals};

View File

@ -4,7 +4,7 @@ use core::cell::UnsafeCell;
use core::marker::PhantomData;
use core::sync::atomic::{compiler_fence, Ordering};
use embassy::util::Unborrow;
use embassy_extras::unborrow;
use embassy_hal_common::unborrow;
use crate::gpio::sealed::Pin as _;
use crate::gpio::OptionalPin as GpioOptionalPin;

View File

@ -7,7 +7,7 @@ use core::task::Poll;
use embassy::interrupt::{Interrupt, InterruptExt};
use embassy::traits::flash::{Error, Flash};
use embassy::util::{AtomicWaker, DropBomb, Unborrow};
use embassy_extras::unborrow;
use embassy_hal_common::unborrow;
use futures::future::poll_fn;
use crate::gpio::sealed::Pin as _;

View File

@ -11,7 +11,7 @@ use embassy::traits;
use embassy::util::AtomicWaker;
use embassy::util::OnDrop;
use embassy::util::Unborrow;
use embassy_extras::unborrow;
use embassy_hal_common::unborrow;
use futures::future::poll_fn;
use rand_core::RngCore;

View File

@ -3,7 +3,7 @@ use core::marker::PhantomData;
use core::sync::atomic::{compiler_fence, Ordering};
use core::task::Poll;
use embassy::util::{wake_on_interrupt, Unborrow};
use embassy_extras::unborrow;
use embassy_hal_common::unborrow;
use futures::future::poll_fn;
use crate::interrupt;

View File

@ -7,7 +7,7 @@ use core::task::Poll;
use embassy::interrupt::InterruptExt;
use embassy::traits;
use embassy::util::{AtomicWaker, Unborrow};
use embassy_extras::unborrow;
use embassy_hal_common::unborrow;
use futures::future::poll_fn;
use traits::spi::{FullDuplex, Read, Spi, Write};

View File

@ -7,7 +7,7 @@ use embassy::interrupt::Interrupt;
use embassy::interrupt::InterruptExt;
use embassy::util::OnDrop;
use embassy::util::Unborrow;
use embassy_extras::unborrow;
use embassy_hal_common::unborrow;
use futures::future::poll_fn;
use crate::pac;

View File

@ -13,7 +13,7 @@ use core::task::Poll;
use embassy::interrupt::{Interrupt, InterruptExt};
use embassy::traits;
use embassy::util::{AtomicWaker, Unborrow};
use embassy_extras::unborrow;
use embassy_hal_common::unborrow;
use futures::future::poll_fn;
use traits::i2c::I2c;

View File

@ -9,7 +9,7 @@ use core::task::Poll;
use embassy::interrupt::InterruptExt;
use embassy::traits::uart::{Error, Read, ReadUntilIdle, Write};
use embassy::util::{AtomicWaker, OnDrop, Unborrow};
use embassy_extras::unborrow;
use embassy_hal_common::unborrow;
use futures::future::poll_fn;
use crate::chip::EASY_DMA_SIZE;

View File

@ -20,7 +20,7 @@ defmt-error = [ ]
[dependencies]
embassy = { version = "0.1.0", path = "../embassy", features = [ "time-tick-1mhz" ] }
embassy-extras = {version = "0.1.0", path = "../embassy-extras" }
embassy-hal-common = {version = "0.1.0", path = "../embassy-hal-common" }
embassy-macros = { version = "0.1.0", path = "../embassy-macros", features = ["rp"]}
defmt = { version = "0.2.0", optional = true }

View File

@ -6,7 +6,7 @@ use crate::pac::SIO;
use crate::peripherals;
use embassy::util::Unborrow;
use embassy_extras::{unborrow, unsafe_impl_unborrow};
use embassy_hal_common::{unborrow, unsafe_impl_unborrow};
use embedded_hal::digital::v2 as digital;
/// Represents a digital input or output level.

View File

@ -5,7 +5,7 @@
// Re-exports
pub use embassy::interrupt::{declare, take, Interrupt};
pub use embassy_extras::interrupt::Priority3 as Priority;
pub use embassy_hal_common::interrupt::Priority3 as Priority;
mod irqs {
use super::*;

View File

@ -25,7 +25,7 @@ pub mod uart;
mod clocks;
mod reset;
embassy_extras::peripherals! {
embassy_hal_common::peripherals! {
PIN_0,
PIN_1,
PIN_2,

View File

@ -1,7 +1,7 @@
use core::marker::PhantomData;
use embassy::util::Unborrow;
use embassy_extras::unborrow;
use embassy_hal_common::unborrow;
use embedded_hal::blocking::spi as eh;
use embedded_hal::spi as ehnb;

View File

@ -1,7 +1,7 @@
use core::marker::PhantomData;
use embassy::util::Unborrow;
use embassy_extras::unborrow;
use embassy_hal_common::unborrow;
use gpio::Pin;
use crate::{gpio, pac, peripherals};

View File

@ -8,7 +8,7 @@ resolver = "2"
[dependencies]
embassy = { version = "0.1.0", path = "../embassy", features = ["time-tick-32768hz"] }
embassy-macros = { version = "0.1.0", path = "../embassy-macros", features = ["stm32"] }
embassy-extras = {version = "0.1.0", path = "../embassy-extras" }
embassy-hal-common = {version = "0.1.0", path = "../embassy-hal-common" }
embassy-traits = {version = "0.1.0", path = "../embassy-traits" }
embassy-net = { version = "0.1.0", path = "../embassy-net", default-features = false, optional = true }

View File

@ -85,4 +85,4 @@ with open(output_file, 'w') as f:
for (channel_id, defn) in core['dma_channels'].items():
singletons.append( channel_id )
f.write(f"embassy_extras::peripherals!({','.join(singletons)});")
f.write(f"embassy_hal_common::peripherals!({','.join(singletons)});")

View File

@ -1,7 +1,7 @@
use crate::adc::{AdcPin, Instance};
use core::marker::PhantomData;
use embassy::util::Unborrow;
use embassy_extras::unborrow;
use embassy_hal_common::unborrow;
use embedded_hal::blocking::delay::DelayUs;
pub const VDDA_CALIB_MV: u32 = 3000;

View File

@ -3,7 +3,7 @@ use crate::gpio::AnyPin;
use crate::pac::dac;
use core::marker::PhantomData;
use embassy::util::Unborrow;
use embassy_extras::unborrow;
use embassy_hal_common::unborrow;
#[derive(Debug)]
#[cfg_attr(feature = "defmt", derive(defmt::Format))]

View File

@ -4,8 +4,8 @@ use core::sync::atomic::{fence, Ordering};
use core::task::Waker;
use embassy::util::{AtomicWaker, Unborrow};
use embassy_extras::peripheral::{PeripheralMutex, PeripheralState};
use embassy_extras::unborrow;
use embassy_hal_common::peripheral::{PeripheralMutex, PeripheralState};
use embassy_hal_common::unborrow;
use embassy_net::{Device, DeviceCapabilities, LinkState, PacketBuf, MTU};
use crate::gpio::sealed::Pin as __GpioPin;

View File

@ -42,7 +42,7 @@ mod _version;
pub use _version::*;
use crate::peripherals;
use embassy_extras::unsafe_impl_unborrow;
use embassy_hal_common::unsafe_impl_unborrow;
pub(crate) mod sealed {
pub trait Channel {}

View File

@ -2,7 +2,7 @@
use core::convert::Infallible;
use core::marker::PhantomData;
use embassy::util::Unborrow;
use embassy_extras::{unborrow, unsafe_impl_unborrow};
use embassy_hal_common::{unborrow, unsafe_impl_unborrow};
use embedded_hal::digital::v2::{toggleable, InputPin, OutputPin, StatefulOutputPin};
use crate::pac;

View File

@ -2,7 +2,7 @@ use crate::i2c::{Error, Instance, SclPin, SdaPin};
use crate::time::Hertz;
use core::marker::PhantomData;
use embassy::util::Unborrow;
use embassy_extras::unborrow;
use embassy_hal_common::unborrow;
use embedded_hal::blocking::i2c::Read;
use embedded_hal::blocking::i2c::Write;
use embedded_hal::blocking::i2c::WriteRead;

View File

@ -1,7 +1,7 @@
use core::cmp;
use core::marker::PhantomData;
use embassy::util::Unborrow;
use embassy_extras::unborrow;
use embassy_hal_common::unborrow;
use embedded_hal::blocking::i2c::Read;
use embedded_hal::blocking::i2c::Write;
use embedded_hal::blocking::i2c::WriteRead;

View File

@ -1,7 +1,7 @@
pub use bare_metal::Mutex;
pub use critical_section::CriticalSection;
pub use embassy::interrupt::{take, Interrupt};
pub use embassy_extras::interrupt::Priority4 as Priority;
pub use embassy_hal_common::interrupt::Priority4 as Priority;
use crate::pac::Interrupt as InterruptEnum;
use embassy::interrupt::declare;

View File

@ -6,7 +6,7 @@ use crate::time::Hertz;
use crate::time::U32Ext;
use core::marker::PhantomData;
use embassy::util::Unborrow;
use embassy_extras::unborrow;
use embassy_hal_common::unborrow;
use pac::rcc::vals::{Hpre, Ppre, Sw};
/// Most of clock setup is copied from stm32l0xx-hal, and adopted to the generated PAC,

View File

@ -6,7 +6,7 @@ use crate::time::Hertz;
use crate::time::U32Ext;
use core::marker::PhantomData;
use embassy::util::Unborrow;
use embassy_extras::unborrow;
use embassy_hal_common::unborrow;
use pac::rcc::vals::{Hpre, Msirange, Plldiv, Pllmul, Pllsrc, Ppre, Sw};
/// Most of clock setup is copied from stm32l0xx-hal, and adopted to the generated PAC,

View File

@ -6,7 +6,7 @@ use crate::time::Hertz;
use crate::time::U32Ext;
use core::marker::PhantomData;
use embassy::util::Unborrow;
use embassy_extras::unborrow;
use embassy_hal_common::unborrow;
/// Most of clock setup is copied from stm32l0xx-hal, and adopted to the generated PAC,
/// and with the addition of the init function to configure a system clock.

View File

@ -6,7 +6,7 @@ use crate::time::Hertz;
use crate::time::U32Ext;
use core::marker::PhantomData;
use embassy::util::Unborrow;
use embassy_extras::unborrow;
use embassy_hal_common::unborrow;
/// Most of clock setup is copied from stm32l0xx-hal, and adopted to the generated PAC,
/// and with the addition of the init function to configure a system clock.

View File

@ -6,7 +6,7 @@ use crate::time::Hertz;
use crate::time::U32Ext;
use core::marker::PhantomData;
use embassy::util::Unborrow;
use embassy_extras::unborrow;
use embassy_hal_common::unborrow;
/// Most of clock setup is copied from stm32l0xx-hal, and adopted to the generated PAC,
/// and with the addition of the init function to configure a system clock.

View File

@ -4,7 +4,7 @@ use core::future::Future;
use core::task::Poll;
use embassy::traits;
use embassy::util::{AtomicWaker, Unborrow};
use embassy_extras::unborrow;
use embassy_hal_common::unborrow;
use futures::future::poll_fn;
use rand_core::{CryptoRng, RngCore};

View File

@ -6,7 +6,7 @@ use core::task::Poll;
use embassy::interrupt::InterruptExt;
use embassy::util::{AtomicWaker, OnDrop, Unborrow};
use embassy_extras::unborrow;
use embassy_hal_common::unborrow;
use futures::future::poll_fn;
use sdio_host::{BusWidth, CardCapacity, CardStatus, CurrentState, SDStatus, CID, CSD, OCR, SCR};

View File

@ -12,7 +12,7 @@ use core::future::Future;
use core::marker::PhantomData;
use core::ptr;
use embassy::util::Unborrow;
use embassy_extras::unborrow;
use embassy_hal_common::unborrow;
use embassy_traits::spi as traits;
pub use embedded_hal::spi::{Mode, Phase, Polarity, MODE_0, MODE_1, MODE_2, MODE_3};
use futures::future::join3;

View File

@ -14,7 +14,7 @@ use core::future::Future;
use core::marker::PhantomData;
use core::ptr;
use embassy::util::Unborrow;
use embassy_extras::unborrow;
use embassy_hal_common::unborrow;
use embassy_traits::spi as traits;
pub use embedded_hal::spi::{Mode, Phase, Polarity, MODE_0, MODE_1, MODE_2, MODE_3};
use futures::future::join3;

View File

@ -14,7 +14,7 @@ use core::future::Future;
use core::marker::PhantomData;
use core::ptr;
use embassy::util::Unborrow;
use embassy_extras::unborrow;
use embassy_hal_common::unborrow;
use embassy_traits::spi as traits;
pub use embedded_hal::spi::{Mode, Phase, Polarity, MODE_0, MODE_1, MODE_2, MODE_3};

View File

@ -1,7 +1,7 @@
use core::future::Future;
use core::marker::PhantomData;
use embassy::util::Unborrow;
use embassy_extras::unborrow;
use embassy_hal_common::unborrow;
use futures::TryFutureExt;
use super::*;

View File

@ -1,7 +1,7 @@
use core::future::Future;
use core::marker::PhantomData;
use embassy::util::Unborrow;
use embassy_extras::unborrow;
use embassy_hal_common::unborrow;
use futures::TryFutureExt;
use super::*;

View File

@ -20,7 +20,7 @@ defmt-error = []
embassy = { version = "0.1.0", path = "../../embassy", features = ["defmt", "defmt-trace"] }
embassy-traits = { version = "0.1.0", path = "../../embassy-traits", features = ["defmt"] }
embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["defmt", "defmt-trace", "stm32f429zi", "unstable-pac"] }
embassy-extras = {version = "0.1.0", path = "../../embassy-extras" }
embassy-hal-common = {version = "0.1.0", path = "../../embassy-hal-common" }
defmt = "0.2.0"
defmt-rtt = "0.2.0"

View File

@ -20,7 +20,7 @@ defmt-error = []
embassy = { version = "0.1.0", path = "../../embassy", features = ["defmt", "defmt-trace"] }
embassy-traits = { version = "0.1.0", path = "../../embassy-traits", features = ["defmt"] }
embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["defmt", "defmt-trace", "stm32h743zi", "net"] }
embassy-extras = {version = "0.1.0", path = "../../embassy-extras" }
embassy-hal-common = {version = "0.1.0", path = "../../embassy-hal-common" }
embassy-net = { path = "../../embassy-net", default-features = false, features = ["defmt-debug", "defmt", "tcp", "medium-ethernet", "pool-16"] }
stm32-metapac = { path = "../../stm32-metapac", features = ["stm32h743zi"] }
embassy-macros = { path = "../../embassy-macros" }

View File

@ -20,7 +20,7 @@ defmt-error = []
embassy = { version = "0.1.0", path = "../../embassy", features = ["defmt", "defmt-trace"] }
embassy-traits = { version = "0.1.0", path = "../../embassy-traits", features = ["defmt"] }
embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["defmt", "defmt-trace", "stm32l072cz"] }
embassy-extras = {version = "0.1.0", path = "../../embassy-extras" }
embassy-hal-common = {version = "0.1.0", path = "../../embassy-hal-common" }
defmt = "0.2.0"
defmt-rtt = "0.2.0"

View File

@ -20,7 +20,7 @@ defmt-error = []
embassy = { version = "0.1.0", path = "../../embassy", features = ["defmt", "defmt-trace"] }
embassy-traits = { version = "0.1.0", path = "../../embassy-traits", features = ["defmt"] }
embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["defmt", "defmt-trace", "unstable-pac", "stm32l4s5vi"] }
embassy-extras = {version = "0.1.0", path = "../../embassy-extras" }
embassy-hal-common = {version = "0.1.0", path = "../../embassy-hal-common" }
defmt = "0.2.0"
defmt-rtt = "0.2.0"

View File

@ -20,7 +20,7 @@ defmt-error = []
embassy = { version = "0.1.0", path = "../../embassy", features = ["defmt", "defmt-trace"] }
embassy-traits = { version = "0.1.0", path = "../../embassy-traits", features = ["defmt"] }
embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["defmt", "defmt-trace", "stm32wb55cc"] }
embassy-extras = {version = "0.1.0", path = "../../embassy-extras" }
embassy-hal-common = {version = "0.1.0", path = "../../embassy-hal-common" }
defmt = "0.2.0"
defmt-rtt = "0.2.0"