2
2
//!
3
3
//! **NOTE** This HAL is still is active development. Expect the traits presented here to be
4
4
//! tweaked, split or be replaced wholesale before being stabilized, i.e. before hitting the 1.0.0
5
- //! release. That being said there's a part of the HAL that's currently considered unproven and is
6
- //! hidden behind an "unproven" Cargo feature. This API is even more volatile and it's exempt from
7
- //! semver rules: it can change in a non-backward compatible fashion or even disappear in between
8
- //! patch releases.
5
+ //! release.
9
6
//!
10
7
//! # Design goals
11
8
//!
@@ -702,8 +699,6 @@ pub mod watchdog;
702
699
703
700
/// Input capture
704
701
///
705
- /// *This trait is available if embedded-hal is built with the `"unproven"` feature.*
706
- ///
707
702
/// # Examples
708
703
///
709
704
/// You can use this interface to measure the period of (quasi) periodic signals
@@ -742,17 +737,15 @@ pub mod watchdog;
742
737
/// # type Error = Infallible;
743
738
/// # type Capture = u16;
744
739
/// # type Channel = Channel;
745
- /// # type Error = Infallible;
746
740
/// # type Time = MilliSeconds;
747
741
/// # fn try_capture(&mut self, _: Channel) -> ::nb::Result<u16, Self::Error> { Ok(0) }
748
742
/// # fn try_disable(&mut self, _: Channel) -> Result<(), Self::Error> { unimplemented!() }
749
743
/// # fn try_enable(&mut self, _: Channel) -> Result<(), Self::Error> { unimplemented!() }
750
744
/// # fn try_get_resolution(&self) -> Result<MilliSeconds, Self::Error> { unimplemented!() }
751
- /// # fn try_set_resolution<T>(&mut self, _: T) -> Result<(), Self::Error> where T: Into<MilliSeconds> {}
745
+ /// # fn try_set_resolution<T>(&mut self, _: T) -> Result<(), Self::Error> where T: Into<MilliSeconds> { Ok(()) }
752
746
/// # }
753
747
/// ```
754
- #[ cfg( feature = "unproven" ) ]
755
- // reason: pre-singletons API. With singletons a `CapturePin` (cf. `PwmPin`) trait seems more
748
+ // unproven reason: pre-singletons API. With singletons a `CapturePin` (cf. `PwmPin`) trait seems more
756
749
// appropriate
757
750
pub trait Capture {
758
751
/// Enumeration of `Capture` errors
@@ -799,8 +792,6 @@ pub trait Capture {
799
792
800
793
/// Pulse Width Modulation
801
794
///
802
- /// *This trait is available if embedded-hal is built with the `"unproven"` feature.*
803
- ///
804
795
/// # Examples
805
796
///
806
797
/// Use this interface to control the power output of some actuator
@@ -841,14 +832,13 @@ pub trait Capture {
841
832
/// # fn try_disable(&mut self, _: Channel) -> Result<(), Self::Error> { unimplemented!() }
842
833
/// # fn try_enable(&mut self, _: Channel) -> Result<(), Self::Error> { unimplemented!() }
843
834
/// # fn try_get_duty(&self, _: Channel) -> Result<u16, Self::Error> { unimplemented!() }
844
- /// # fn try_get_max_duty(&self) -> Result<u16, Self::Error> { 0 }
845
- /// # fn try_set_duty(&mut self, _: Channel, _: u16) -> Result<(), Self::Error> {}
835
+ /// # fn try_get_max_duty(&self) -> Result<u16, Self::Error> { Ok(0) }
836
+ /// # fn try_set_duty(&mut self, _: Channel, _: u16) -> Result<(), Self::Error> { Ok(()) }
846
837
/// # fn try_get_period(&self) -> Result<KiloHertz, Self::Error> { unimplemented!() }
847
- /// # fn try_set_period<T>(&mut self, _: T) -> Result<(), Self::Error> where T: Into<KiloHertz> {}
838
+ /// # fn try_set_period<T>(&mut self, _: T) -> Result<(), Self::Error> where T: Into<KiloHertz> { Ok(()) }
848
839
/// # }
849
840
/// ```
850
- #[ cfg( feature = "unproven" ) ]
851
- // reason: pre-singletons API. The `PwmPin` trait seems more useful because it models independent
841
+ // unproven reason: pre-singletons API. The `PwmPin` trait seems more useful because it models independent
852
842
// PWM channels. Here a certain number of channels are multiplexed in a single implementer.
853
843
pub trait Pwm {
854
844
/// Enumeration of `Pwm` errors
@@ -925,8 +915,6 @@ pub trait PwmPin {
925
915
926
916
/// Quadrature encoder interface
927
917
///
928
- /// *This trait is available if embedded-hal is built with the `"unproven"` feature.*
929
- ///
930
918
/// # Examples
931
919
///
932
920
/// You can use this interface to measure the speed of a motor
@@ -971,13 +959,13 @@ pub trait PwmPin {
971
959
/// # }
972
960
/// # struct Timer6;
973
961
/// # impl hal::timer::CountDown for Timer6 {
962
+ /// # type Error = Infallible;
974
963
/// # type Time = Seconds;
975
964
/// # fn try_start<T>(&mut self, _: T) -> Result<(), Infallible> where T: Into<Seconds> { Ok(()) }
976
965
/// # fn try_wait(&mut self) -> ::nb::Result<(), Infallible> { Ok(()) }
977
966
/// # }
978
967
/// ```
979
- #[ cfg( feature = "unproven" ) ]
980
- // reason: needs to be re-evaluated in the new singletons world. At the very least this needs a
968
+ // unproven reason: needs to be re-evaluated in the new singletons world. At the very least this needs a
981
969
// reference implementation
982
970
pub trait Qei {
983
971
/// Enumeration of `Qei` errors
@@ -994,11 +982,7 @@ pub trait Qei {
994
982
}
995
983
996
984
/// Count direction
997
- ///
998
- /// *This enumeration is available if embedded-hal is built with the `"unproven"` feature.*
999
985
#[ derive( Clone , Copy , Debug , Eq , PartialEq ) ]
1000
- #[ cfg( feature = "unproven" ) ]
1001
- // reason: part of the unproven `Qei` interface
1002
986
pub enum Direction {
1003
987
/// 3, 2, 1
1004
988
Downcounting ,
0 commit comments