1- //! Tier 2 features.
2- //!
3- //! These are the features included only in ADS1x14, ADS1x15
1+ //! Features only included in ADS1x14, ADS1x15.
42
53use crate :: {
64 conversion, ic, Ads1x1x , BitFlags as BF , ComparatorLatching , ComparatorMode ,
1311 IC : ic:: Tier2Features ,
1412 CONV : conversion:: ConvertThreshold < E > ,
1513{
16- /// Set the input voltage measurable range
14+ /// Sets the input voltage measurable range.
1715 ///
18- /// This configures the programmable gain amplifier and determines the measurable input voltage range.
16+ /// This configures the programmable gain amplifier (PGA) and determines the measurable input voltage range.
1917 pub fn set_full_scale_range ( & mut self , range : FullScaleRange ) -> Result < ( ) , Error < E > > {
2018 use crate :: FullScaleRange as FSR ;
2119 let cfg = self . config . clone ( ) ;
@@ -47,29 +45,31 @@ where
4745 Ok ( ( ) )
4846 }
4947
50- /// Set raw comparator lower threshold
48+ /// Sets the raw comparator lower threshold.
49+ ///
50+ /// The voltage that these values correspond to must be calculated using the
51+ /// full-scale range ([`FullScaleRange`]) selected.
5152 ///
5253 /// The input value must be within `[2047..-2048]` for 12-bit devices (`ADS101x`)
53- /// and within `[32767..-32768]` for 16-bit devices (`ADS111x`). The voltage that
54- /// these values correspond to must be calculated using the full-scale range
55- /// selected. See [`FullScaleRange`](enum.FullScaleRange.html).
54+ /// and within `[32767..-32768]` for 16-bit devices (`ADS111x`).
5655 pub fn set_low_threshold_raw ( & mut self , value : i16 ) -> Result < ( ) , Error < E > > {
5756 let register_value = CONV :: convert_threshold ( value) ?;
5857 self . write_register ( Register :: LOW_TH , register_value)
5958 }
6059
61- /// Set raw comparator upper threshold
60+ /// Sets the raw comparator upper threshold.
61+ ///
62+ /// The voltage that these values correspond to must be calculated using the
63+ /// full-scale range ([`FullScaleRange`]) selected.
6264 ///
6365 /// The input value must be within `[2047..-2048]` for 12-bit devices (`ADS101x`)
64- /// and within `[32767..-32768]` for 16-bit devices (`ADS111x`). The voltage that
65- /// these values correspond to must be calculated using the full-scale range
66- /// selected. See [`FullScaleRange`](enum.FullScaleRange.html).
66+ /// and within `[32767..-32768]` for 16-bit devices (`ADS111x`).
6767 pub fn set_high_threshold_raw ( & mut self , value : i16 ) -> Result < ( ) , Error < E > > {
6868 let register_value = CONV :: convert_threshold ( value) ?;
6969 self . write_register ( Register :: HIGH_TH , register_value)
7070 }
7171
72- /// Set comparator mode
72+ /// Sets the comparator mode.
7373 pub fn set_comparator_mode ( & mut self , mode : ComparatorMode ) -> Result < ( ) , Error < E > > {
7474 let config = match mode {
7575 ComparatorMode :: Traditional => self . config . with_low ( BF :: COMP_MODE ) ,
8080 Ok ( ( ) )
8181 }
8282
83- /// Set comparator polarity
83+ /// Sets the comparator polarity.
8484 pub fn set_comparator_polarity (
8585 & mut self ,
8686 polarity : ComparatorPolarity ,
9494 Ok ( ( ) )
9595 }
9696
97- /// Set comparator latching
97+ /// Sets the comparator latching.
9898 pub fn set_comparator_latching (
9999 & mut self ,
100100 latching : ComparatorLatching ,
@@ -108,9 +108,9 @@ where
108108 Ok ( ( ) )
109109 }
110110
111- /// Activate comparator and set the alert queue
111+ /// Activates the comparator and sets the alert queue.
112112 ///
113- /// The comparator can be disabled with [`disable_comparator() `](struct.Ads1x1x.html#method. disable_comparator)
113+ /// The comparator can be disabled with [`disable_comparator`](Self:: disable_comparator).
114114 pub fn set_comparator_queue ( & mut self , queue : ComparatorQueue ) -> Result < ( ) , Error < E > > {
115115 let config = match queue {
116116 ComparatorQueue :: One => self . config . with_low ( BF :: COMP_QUE1 ) . with_low ( BF :: COMP_QUE0 ) ,
@@ -122,11 +122,12 @@ where
122122 Ok ( ( ) )
123123 }
124124
125- /// Disable comparator (default)
125+ /// Disables the comparator. (default)
126+ ///
127+ /// This sets the ALERT/RDY pin to high-impedance.
126128 ///
127- /// This will set the ALERT/RDY pin to high-impedance.
128- /// The comparator can be enabled by setting the comparator queue.
129- /// See [`set_comparator_queue()`](struct.Ads1x1x.html#method.set_comparator_queue)
129+ /// The comparator can be enabled by setting the comparator queue using
130+ /// the [`set_comparator_queue`](Self::set_comparator_queue) method.
130131 pub fn disable_comparator ( & mut self ) -> Result < ( ) , Error < E > > {
131132 let config = self
132133 . config
@@ -137,13 +138,12 @@ where
137138 Ok ( ( ) )
138139 }
139140
140- /// Use the ALERT/RDY pin as conversion-ready pin .
141+ /// Enables the ALERT/RDY pin as conversion-ready function .
141142 ///
142- /// This the ALERT/RDY pin outputs the OS bit when in OneShot mode, and
143- /// provides a continuous-conversion ready pulse when in
144- /// continuous-conversion mode.
143+ /// When in one-shot mode, this makes the ALERT/RDY pin output the OS bit,
144+ /// in continuous-conversion mode, provides a continuous-conversion ready pulse.
145145 ///
146- /// When calling this the comparator will be reset to default and the thresholds will be cleared.
146+ /// When calling this the comparator will be reset to default and any thresholds will be cleared.
147147 pub fn use_alert_rdy_pin_as_ready ( & mut self ) -> Result < ( ) , Error < E > > {
148148 if self . config
149149 != self
0 commit comments