Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove package-level type exports #1275

Merged
merged 3 commits into from
Mar 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions esp-hal/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added

### Fixed

- Fixing `esp-wifi` + `TRNG` issue on `ESP32-S2` (#1272)

### Changed

- Prefer mutable references over moving for DMA transactions (#1238)

### Removed

- Remove package-level type exports (#1275)

## [0.16.1] - 2024-03-12

- Resolved an issue with the `defmt` dependency/feature (#1264)
Expand Down
2 changes: 1 addition & 1 deletion esp-hal/src/analog/adc/calibration/basic.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use core::marker::PhantomData;

use crate::adc::{
use crate::analog::adc::{
AdcCalEfuse,
AdcCalScheme,
AdcCalSource,
Expand Down
2 changes: 1 addition & 1 deletion esp-hal/src/analog/adc/calibration/curve.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use core::marker::PhantomData;

use crate::adc::{
use crate::analog::adc::{
AdcCalEfuse,
AdcCalLine,
AdcCalScheme,
Expand Down
2 changes: 1 addition & 1 deletion esp-hal/src/analog/adc/calibration/line.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use core::marker::PhantomData;

use crate::adc::{
use crate::analog::adc::{
AdcCalBasic,
AdcCalEfuse,
AdcCalScheme,
Expand Down
20 changes: 0 additions & 20 deletions esp-hal/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,6 @@ pub use xtensa_lx;
#[cfg(all(xtensa, feature = "rt"))]
pub use xtensa_lx_rt::{self, entry};

#[cfg(adc)]
pub use self::analog::adc;
#[cfg(dac)]
pub use self::analog::dac;
#[cfg(any(xtensa, all(riscv, systimer)))]
pub use self::delay::Delay;
#[cfg(gpio)]
pub use self::gpio::IO;
#[cfg(rmt)]
pub use self::rmt::Rmt;
#[cfg(rng)]
pub use self::rng::Rng;
#[cfg(any(lp_clkrst, rtc_cntl))]
pub use self::rtc_cntl::{Rtc, Rwdt};
#[cfg(any(esp32, esp32s3))]
pub use self::soc::cpu_control;
#[cfg(efuse)]
Expand All @@ -53,12 +39,6 @@ pub use self::soc::peripherals;
pub use self::soc::psram;
#[cfg(ulp_riscv_core)]
pub use self::soc::ulp_core;
#[cfg(any(timg0, timg1))]
pub use self::timer::Timer;
#[cfg(any(uart0, uart1, uart2))]
pub use self::uart::{Uart, UartRx, UartTx};
#[cfg(usb_device)]
pub use self::usb_serial_jtag::UsbSerialJtag;

#[cfg(aes)]
pub mod aes;
Expand Down
14 changes: 11 additions & 3 deletions esp-hal/src/rtc_cntl/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -270,15 +270,23 @@ impl<'d> Rtc<'d> {

/// enter deep sleep and wake with the provided `wake_sources`
#[cfg(any(esp32, esp32s3, esp32c3, esp32c6))]
pub fn sleep_deep(&mut self, wake_sources: &[&dyn WakeSource], delay: &mut crate::Delay) -> ! {
pub fn sleep_deep(
&mut self,
wake_sources: &[&dyn WakeSource],
delay: &mut crate::delay::Delay,
) -> ! {
let config = RtcSleepConfig::deep();
self.sleep(&config, wake_sources, delay);
unreachable!();
}

/// enter light sleep and wake with the provided `wake_sources`
#[cfg(any(esp32, esp32s3, esp32c3, esp32c6))]
pub fn sleep_light(&mut self, wake_sources: &[&dyn WakeSource], delay: &mut crate::Delay) {
pub fn sleep_light(
&mut self,
wake_sources: &[&dyn WakeSource],
delay: &mut crate::delay::Delay,
) {
let config = RtcSleepConfig::default();
self.sleep(&config, wake_sources, delay);
}
Expand All @@ -290,7 +298,7 @@ impl<'d> Rtc<'d> {
&mut self,
config: &RtcSleepConfig,
wake_sources: &[&dyn WakeSource],
delay: &mut crate::Delay,
delay: &mut crate::delay::Delay,
) {
let mut config = *config;
let mut wakeup_triggers = WakeTriggers::default();
Expand Down
3 changes: 1 addition & 2 deletions esp-hal/src/rtc_cntl/sleep/esp32.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
use super::{Ext0WakeupSource, Ext1WakeupSource, TimerWakeupSource, WakeSource, WakeTriggers};
use crate::{
gpio::{RTCPin, RtcFunction},
rtc_cntl::{sleep::WakeupLevel, Clock, RtcClock},
Rtc,
rtc_cntl::{sleep::WakeupLevel, Clock, Rtc, RtcClock},
};

// Approximate mapping of voltages to RTC_CNTL_DBIAS_WAK, RTC_CNTL_DBIAS_SLP,
Expand Down
3 changes: 1 addition & 2 deletions esp-hal/src/rtc_cntl/sleep/esp32c3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ use super::{TimerWakeupSource, WakeSource, WakeTriggers, WakeupLevel};
use crate::{
gpio::{RTCPinWithResistors, RtcFunction},
regi2c_write_mask,
rtc_cntl::{sleep::RtcioWakeupSource, Clock, RtcClock},
Rtc,
rtc_cntl::{sleep::RtcioWakeupSource, Clock, Rtc, RtcClock},
};

const I2C_DIG_REG: u32 = 0x6D;
Expand Down
2 changes: 1 addition & 1 deletion esp-hal/src/rtc_cntl/sleep/esp32c6.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ use crate::{
SavedClockConfig,
},
sleep::{Ext1WakeupSource, TimerWakeupSource, WakeSource, WakeTriggers, WakeupLevel},
Rtc,
RtcClock,
},
Rtc,
};

impl WakeSource for TimerWakeupSource {
Expand Down
3 changes: 1 addition & 2 deletions esp-hal/src/rtc_cntl/sleep/esp32s3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ use super::{
use crate::{
gpio::{RTCPin, RtcFunction},
regi2c_write_mask,
rtc_cntl::{sleep::RtcioWakeupSource, Clock, RtcClock},
Rtc,
rtc_cntl::{sleep::RtcioWakeupSource, Clock, Rtc, RtcClock},
};

const I2C_DIG_REG: u32 = 0x6d;
Expand Down
2 changes: 1 addition & 1 deletion esp-hal/src/rtc_cntl/sleep/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ use core::time::Duration;
use crate::gpio::RTCPin as RtcIoWakeupPinType;
#[cfg(any(esp32c3, esp32c6))]
use crate::gpio::RTCPinWithResistors as RtcIoWakeupPinType;
use crate::Rtc;
use crate::rtc_cntl::Rtc;

#[cfg_attr(esp32, path = "esp32.rs")]
#[cfg_attr(esp32s3, path = "esp32s3.rs")]
Expand Down
2 changes: 1 addition & 1 deletion esp-hal/src/soc/esp32/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
//! for interacting with various system-related peripherals on `ESP32` chip.

use self::peripherals::{LPWR, TIMG0, TIMG1};
use crate::{timer::Wdt, Rtc};
use crate::{rtc_cntl::Rtc, timer::Wdt};

pub mod cpu_control;
pub mod efuse;
Expand Down
2 changes: 1 addition & 1 deletion esp-hal/src/soc/esp32c2/efuse/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
//! ```

pub use self::fields::*;
use crate::{adc::Attenuation, peripherals::EFUSE};
use crate::{analog::adc::Attenuation, peripherals::EFUSE};

mod fields;

Expand Down
2 changes: 1 addition & 1 deletion esp-hal/src/soc/esp32c2/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
//! for interacting with various system-related peripherals on `ESP32-C2` chip.

use self::peripherals::{LPWR, TIMG0};
use crate::{timer::Wdt, Rtc};
use crate::{rtc_cntl::Rtc, timer::Wdt};

pub mod efuse;
pub mod gpio;
Expand Down
2 changes: 1 addition & 1 deletion esp-hal/src/soc/esp32c3/efuse/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
//! ```

pub use self::fields::*;
use crate::{adc::Attenuation, peripherals::EFUSE};
use crate::{analog::adc::Attenuation, peripherals::EFUSE};

mod fields;

Expand Down
2 changes: 1 addition & 1 deletion esp-hal/src/soc/esp32c3/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
//! * I2S_DEFAULT_CLK_SRC: 2 - I2S clock source

use self::peripherals::{LPWR, TIMG0, TIMG1};
use crate::{timer::Wdt, Rtc};
use crate::{rtc_cntl::Rtc, timer::Wdt};

pub mod efuse;
pub mod gpio;
Expand Down
2 changes: 1 addition & 1 deletion esp-hal/src/soc/esp32c6/efuse/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
//! ```

pub use self::fields::*;
use crate::{adc::Attenuation, peripherals::EFUSE};
use crate::{analog::adc::Attenuation, peripherals::EFUSE};

mod fields;

Expand Down
2 changes: 1 addition & 1 deletion esp-hal/src/soc/esp32c6/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
//! * I2S_SCLK: 160_000_000 - I2S clock frequency

use self::peripherals::{LPWR, TIMG0, TIMG1};
use crate::{timer::Wdt, Rtc};
use crate::{rtc_cntl::Rtc, timer::Wdt};

pub mod efuse;
pub mod gpio;
Expand Down
2 changes: 1 addition & 1 deletion esp-hal/src/soc/esp32h2/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
//! * I2S_SCLK: 96_000_000 - I2S clock frequency

use self::peripherals::{LPWR, TIMG0, TIMG1};
use crate::{timer::Wdt, Rtc};
use crate::{rtc_cntl::Rtc, timer::Wdt};

pub mod efuse;
pub mod gpio;
Expand Down
2 changes: 1 addition & 1 deletion esp-hal/src/soc/esp32s2/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
//! * I2S_DEFAULT_CLK_SRC: 2 - I2S clock source

use self::peripherals::{LPWR, TIMG0, TIMG1};
use crate::{timer::Wdt, Rtc};
use crate::{rtc_cntl::Rtc, timer::Wdt};

pub mod efuse;
pub mod gpio;
Expand Down
2 changes: 1 addition & 1 deletion esp-hal/src/soc/esp32s3/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
//! * I2S_DEFAULT_CLK_SRC: 2 - I2S clock source

use self::peripherals::{LPWR, TIMG0, TIMG1};
use crate::{timer::Wdt, Rtc};
use crate::{rtc_cntl::Rtc, timer::Wdt};

pub mod cpu_control;
pub mod efuse;
Expand Down
7 changes: 1 addition & 6 deletions esp-hal/src/uart.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1434,12 +1434,7 @@ mod asynch {
use procmacros::interrupt;

use super::{Error, Instance};
use crate::{
uart::{RegisterBlock, UART_FIFO_SIZE},
Uart,
UartRx,
UartTx,
};
use crate::uart::{RegisterBlock, Uart, UartRx, UartTx, UART_FIFO_SIZE};

cfg_if! {
if #[cfg(all(uart0, uart1, uart2))] {
Expand Down
4 changes: 2 additions & 2 deletions examples/src/bin/adc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@

use esp_backtrace as _;
use esp_hal::{
adc::{AdcConfig, Attenuation, ADC},
analog::adc::{AdcConfig, Attenuation, ADC},
clock::ClockControl,
delay::Delay,
gpio::IO,
peripherals::{Peripherals, ADC1},
prelude::*,
Delay,
};
use esp_println::println;

Expand Down
4 changes: 2 additions & 2 deletions examples/src/bin/adc_cal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@

use esp_backtrace as _;
use esp_hal::{
adc::{AdcConfig, Attenuation, ADC},
analog::adc::{AdcConfig, Attenuation, ADC},
clock::ClockControl,
delay::Delay,
gpio::IO,
peripherals::{Peripherals, ADC1},
prelude::*,
Delay,
};
use esp_println::println;

Expand Down
4 changes: 2 additions & 2 deletions examples/src/bin/advanced_serial.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@
use esp_backtrace as _;
use esp_hal::{
clock::ClockControl,
delay::Delay,
gpio::IO,
peripherals::Peripherals,
prelude::*,
uart::{
config::{Config, DataBits, Parity, StopBits},
TxRxPins,
Uart,
},
Delay,
Uart,
};
use esp_println::println;
use nb::block;
Expand Down
2 changes: 1 addition & 1 deletion examples/src/bin/blinky.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#![no_main]

use esp_backtrace as _;
use esp_hal::{clock::ClockControl, gpio::IO, peripherals::Peripherals, prelude::*, Delay};
use esp_hal::{clock::ClockControl, delay::Delay, gpio::IO, peripherals::Peripherals, prelude::*};

#[entry]
fn main() -> ! {
Expand Down
2 changes: 1 addition & 1 deletion examples/src/bin/blinky_erased_pins.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
use esp_backtrace as _;
use esp_hal::{
clock::ClockControl,
delay::Delay,
gpio::{AnyPin, Input, Output, PullDown, PushPull, IO},
peripherals::Peripherals,
prelude::*,
Delay,
};

#[entry]
Expand Down
2 changes: 1 addition & 1 deletion examples/src/bin/clock_monitor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use esp_hal::{
interrupt::{self, Priority},
peripherals::{Interrupt, Peripherals},
prelude::*,
Rtc,
rtc_cntl::Rtc,
};
use esp_println::println;

Expand Down
2 changes: 1 addition & 1 deletion examples/src/bin/crc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use esp_hal::{
prelude::*,
rom::{crc, md5},
timer::TimerGroup,
Uart,
uart::Uart,
};
use nb::block;

Expand Down
4 changes: 2 additions & 2 deletions examples/src/bin/dac.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@

use esp_backtrace as _;
use esp_hal::{
analog::dac::{DAC1, DAC2},
clock::ClockControl,
dac::{DAC1, DAC2},
delay::Delay,
gpio::IO,
peripherals::Peripherals,
prelude::*,
Delay,
};

#[entry]
Expand Down
2 changes: 1 addition & 1 deletion examples/src/bin/ecc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ use esp_hal::{
ecc::{Ecc, EllipticCurve, Error, WorkMode},
peripherals::Peripherals,
prelude::*,
rng::Rng,
systimer::SystemTimer,
Rng,
};
use esp_println::{print, println};
use hex_literal::hex;
Expand Down
2 changes: 1 addition & 1 deletion examples/src/bin/embassy_i2c.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ use esp_backtrace as _;
use esp_hal::{
clock::ClockControl,
embassy::{self},
gpio::IO,
i2c::I2C,
peripherals::Peripherals,
prelude::*,
timer::TimerGroup,
IO,
};
use lis3dh_async::{Lis3dh, Range, SlaveAddr};

Expand Down
Loading
Loading