1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
//! Polling policy used after LTC2949 SPI commands.
//!
//! The LTC2949 driver keeps conversion timing host-owned. Operations such as
//! [`Client::start_wake_up`](crate::client::Client::start_wake_up) return the wait time that
//! the application must observe with its own timer, RTOS primitive, or delay provider.
//! [`PollMethod`] covers a narrower concern: what the SPI wrapper should do at the end of a
//! synchronous command transaction.
//!
//! Two policies are provided:
//!
//! * [`NoPolling`] is the default policy used by [`LTC2949::new`](crate::client::LTC2949::new).
//! It assumes the underlying [`SpiDevice`] owns chip-select handling and has no extra
//! end-of-command work to do.
//! * [`SDOLinePolling`] is for [`LatchingSpiDevice`]. That SPI wrapper keeps CS asserted across
//! an operation; this policy releases CS when the command finishes. It is the shape needed for
//! SDO-line polling style integrations, where chip-select ownership must be explicit.
//!
//! `PollMethod` does not itself sleep for conversion times. If a client method returns a wait,
//! call your platform delay/timer explicitly before the next phase.
//!
//! ```
//! use embedded_hal::delay::DelayNs;
//! use ltc2949::client::{Client, LTC2949, T_BOOT_US};
//! use ltc2949::example::{ExampleDelay, ExampleSPIDevice};
//!
//! let spi = ExampleSPIDevice::default();
//! let mut delay = ExampleDelay::default();
//! let mut client = LTC2949::new(spi); // Uses NoPolling.
//!
//! let boot_us = client.start_wake_up().unwrap();
//! assert_eq!(T_BOOT_US, boot_us);
//! delay.delay_us(boot_us);
//! client.confirm_wake_up().unwrap();
//! ```
use crateLatchingSpiDevice;
use OutputPin;
use ;
/// End-of-command SPI policy.
/// Releases a [`LatchingSpiDevice`] chip-select at the end of each synchronous command.
/// No extra end-of-command handling.