From 631f2d43c709dd9fb0e6808a102911db65565480 Mon Sep 17 00:00:00 2001 From: Rahix Date: Sat, 13 Mar 2021 12:19:13 +0100 Subject: [PATCH] arduino-hal: Reexport ADC types and module Reexport the `adc` module from the HAL crate to make the ADC easily usable. --- arduino-hal/src/lib.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/arduino-hal/src/lib.rs b/arduino-hal/src/lib.rs index 5a115f0236..03f1f80d92 100644 --- a/arduino-hal/src/lib.rs +++ b/arduino-hal/src/lib.rs @@ -46,6 +46,18 @@ pub mod i2c { #[cfg(feature = "board-selected")] pub use i2c::I2c; +#[cfg(feature = "board-selected")] +pub mod adc { + pub use crate::hal::adc::{ + channel, AdcChannel, AdcOps, AdcSettings, ClockDivider, ReferenceVoltage, + }; + + /// Check the [`avr_hal_generic::adc::Adc`] documentation. + pub type Adc = crate::hal::Adc; +} +#[cfg(feature = "board-selected")] +pub use adc::Adc; + #[cfg(feature = "board-selected")] pub mod usart { pub use crate::hal::usart::{Baudrate, UsartOps};