Some documentation corrections and expansion
This commit is contained in:
parent
10a3a8bbed
commit
d4179ee2e4
2 changed files with 15 additions and 2 deletions
|
@ -29,7 +29,7 @@ use saadc::{
|
||||||
#[non_exhaustive]
|
#[non_exhaustive]
|
||||||
pub enum Error {}
|
pub enum Error {}
|
||||||
|
|
||||||
/// One-shot saadc. Continuous sample mode TODO.
|
/// One-shot and continuous SAADC.
|
||||||
pub struct Saadc<'d, const N: usize> {
|
pub struct Saadc<'d, const N: usize> {
|
||||||
phantom: PhantomData<&'d mut peripherals::SAADC>,
|
phantom: PhantomData<&'d mut peripherals::SAADC>,
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,8 +4,21 @@ use core::mem;
|
||||||
use core::task::{Context, Poll, Waker};
|
use core::task::{Context, Poll, Waker};
|
||||||
|
|
||||||
/// Synchronization primitive. Allows creating awaitable signals that may be passed between tasks.
|
/// Synchronization primitive. Allows creating awaitable signals that may be passed between tasks.
|
||||||
|
/// For a simple use-case where the receiver is only ever interested in the latest value of
|
||||||
|
/// something, Signals work well. For more advanced use cases, please consider [crate::channel::mpsc].
|
||||||
///
|
///
|
||||||
/// For more advanced use cases, please consider [futures-intrusive](https://crates.io/crates/futures-intrusive) channels or mutexes.
|
/// Signals are generally declared as being a static const and then borrowed as required.
|
||||||
|
///
|
||||||
|
/// ```
|
||||||
|
/// use embassy::channel::signal::Signal;
|
||||||
|
///
|
||||||
|
/// enum SomeCommand {
|
||||||
|
/// On,
|
||||||
|
/// Off,
|
||||||
|
/// }
|
||||||
|
///
|
||||||
|
/// static SOME_SIGNAL: Signal<SomeCommand> = Signal::new();
|
||||||
|
/// ```
|
||||||
pub struct Signal<T> {
|
pub struct Signal<T> {
|
||||||
state: UnsafeCell<State<T>>,
|
state: UnsafeCell<State<T>>,
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue