33use crate :: {
44 register:: { Config , Conversion12 , Conversion16 , HiThresh , LoThresh } ,
55 Ads1014 , Ads1015 , Ads1114 , Ads1115 , ComparatorLatching , ComparatorMode , ComparatorPolarity ,
6- ComparatorQueue , Error , FullScaleRange ,
6+ ComparatorQueue , FullScaleRange ,
77} ;
88
99macro_rules! doc_threshold {
@@ -34,7 +34,7 @@ macro_rules! impl_tier2_features {
3434 /// Sets the input voltage measurable range.
3535 ///
3636 /// This configures the programmable gain amplifier (PGA) and determines the measurable input voltage range.
37- pub fn set_full_scale_range( & mut self , range: FullScaleRange ) -> Result <( ) , Error < E > > {
37+ pub fn set_full_scale_range( & mut self , range: FullScaleRange ) -> Result <( ) , E > {
3838 let config = range. configure( self . config) ;
3939 self . write_reg_u16( config) ?;
4040 self . config = config;
@@ -47,7 +47,7 @@ macro_rules! impl_tier2_features {
4747 /// full-scale range ([`FullScaleRange`]) selected.
4848 ///
4949 #[ doc = doc_threshold!( $( $th_range) +) ]
50- pub fn set_low_threshold_raw( & mut self , value: i16 ) -> Result <( ) , Error < E > > {
50+ pub fn set_low_threshold_raw( & mut self , value: i16 ) -> Result <( ) , E > {
5151 let register_value = <$conv>:: convert_threshold( value) ;
5252 self . write_reg_u16( LoThresh ( register_value) )
5353 }
@@ -58,13 +58,13 @@ macro_rules! impl_tier2_features {
5858 /// full-scale range ([`FullScaleRange`]) selected.
5959 ///
6060 #[ doc = doc_threshold!( $( $th_range) +) ]
61- pub fn set_high_threshold_raw( & mut self , value: i16 ) -> Result <( ) , Error < E > > {
61+ pub fn set_high_threshold_raw( & mut self , value: i16 ) -> Result <( ) , E > {
6262 let register_value = <$conv>:: convert_threshold( value) ;
6363 self . write_reg_u16( HiThresh ( register_value) )
6464 }
6565
6666 /// Sets the comparator mode.
67- pub fn set_comparator_mode( & mut self , mode: ComparatorMode ) -> Result <( ) , Error < E > > {
67+ pub fn set_comparator_mode( & mut self , mode: ComparatorMode ) -> Result <( ) , E > {
6868 let config = match mode {
6969 ComparatorMode :: Traditional => self . config. difference( Config :: COMP_MODE ) ,
7070 ComparatorMode :: Window => self . config. union ( Config :: COMP_MODE ) ,
@@ -78,7 +78,7 @@ macro_rules! impl_tier2_features {
7878 pub fn set_comparator_polarity(
7979 & mut self ,
8080 polarity: ComparatorPolarity ,
81- ) -> Result <( ) , Error < E > > {
81+ ) -> Result <( ) , E > {
8282 let config = match polarity {
8383 ComparatorPolarity :: ActiveLow => self . config. difference( Config :: COMP_POL ) ,
8484 ComparatorPolarity :: ActiveHigh => self . config. union ( Config :: COMP_POL ) ,
@@ -92,7 +92,7 @@ macro_rules! impl_tier2_features {
9292 pub fn set_comparator_latching(
9393 & mut self ,
9494 latching: ComparatorLatching ,
95- ) -> Result <( ) , Error < E > > {
95+ ) -> Result <( ) , E > {
9696 let config = match latching {
9797 ComparatorLatching :: Nonlatching => self . config. difference( Config :: COMP_LAT ) ,
9898 ComparatorLatching :: Latching => self . config. union ( Config :: COMP_LAT ) ,
@@ -105,7 +105,7 @@ macro_rules! impl_tier2_features {
105105 /// Activates the comparator and sets the alert queue.
106106 ///
107107 /// The comparator can be disabled with [`disable_comparator`](Self::disable_comparator).
108- pub fn set_comparator_queue( & mut self , queue: ComparatorQueue ) -> Result <( ) , Error < E > > {
108+ pub fn set_comparator_queue( & mut self , queue: ComparatorQueue ) -> Result <( ) , E > {
109109 let config = match queue {
110110 ComparatorQueue :: One => {
111111 self . config. difference( Config :: COMP_QUE1 ) . difference( Config :: COMP_QUE0 )
@@ -128,7 +128,7 @@ macro_rules! impl_tier2_features {
128128 ///
129129 /// The comparator can be enabled by setting the comparator queue using
130130 /// the [`set_comparator_queue`](Self::set_comparator_queue) method.
131- pub fn disable_comparator( & mut self ) -> Result <( ) , Error < E > > {
131+ pub fn disable_comparator( & mut self ) -> Result <( ) , E > {
132132 let config = self
133133 . config
134134 . union ( Config :: COMP_QUE1 )
@@ -144,7 +144,7 @@ macro_rules! impl_tier2_features {
144144 /// in continuous-conversion mode, provides a continuous-conversion ready pulse.
145145 ///
146146 /// When calling this the comparator will be reset to default and any thresholds will be cleared.
147- pub fn use_alert_rdy_pin_as_ready( & mut self ) -> Result <( ) , Error < E > > {
147+ pub fn use_alert_rdy_pin_as_ready( & mut self ) -> Result <( ) , E > {
148148 if !self . config. contains( Config :: COMP_QUE )
149149 {
150150 self . set_comparator_queue( ComparatorQueue :: default ( ) ) ?;
0 commit comments