Struct hts221::Builder
[−]
[src]
pub struct Builder<Comm, E> { /* fields omitted */ }
Builder for an HTS221 structure. This builder allows you to configure the chip without needing to access the device:device module.
Defaults are:
- Averaged samples - untouched
- Powered on
- Block update mode
- One-shot mode
- No boot
- Data ready polarity and output mode are unchanged
- Data ready interrupt is disabled
Methods
impl<Comm, E> Builder<Comm, E> where
Comm: Write<Error = E> + WriteRead<Error = E>,
[src]
Comm: Write<Error = E> + WriteRead<Error = E>,
pub fn new(comm: Comm) -> Self
[src]
Initialize a new Builder for an HTS221 that will use comm
for all communication.
pub fn with_avg_t(self, avg_t: AvgT) -> Self
[src]
Configures the number of internal temperature samples that will be averaged into one output sample.
pub fn with_avg_h(self, avg_h: AvgH) -> Self
[src]
Configures the number of internal humidity samples that will be averaged into one output sample.
pub fn powered_up(self) -> Self
[src]
Powers up the device on initialization (default).
pub fn powered_down(self) -> Self
[src]
Keeps the device powered down on initialization.
pub fn with_update_mode(self, mode: UpdateMode) -> Self
[src]
Sets the update mode on initialization
pub fn with_data_rate(self, rate: DataRate) -> Self
[src]
Sets the data rate on initialization
pub fn with_boot(self) -> Self
[src]
Boots the device (resets stored values) on initialization
pub fn without_boot(self) -> Self
[src]
Does not boot the device on initialization (default)
pub fn with_data_ready_polarity(self, polarity: Polarity) -> Self
[src]
Sets the polarity of the data-ready output pin.
pub fn with_data_ready_mode(self, mode: PinMode) -> Self
[src]
Sets the output mode of the data-ready output pin.
pub fn with_data_ready_enabled(self) -> Self
[src]
Enables the data-ready external interrupt pin.
pub fn with_data_ready_disabled(self) -> Self
[src]
Disables the data-ready external interrupt pin (default).
pub fn build(self) -> Result<HTS221<Comm, E>, E>
[src]
Builds an HTS221 handle using the current builder configuration. Consumes the builder.