Created input types.

This commit is contained in:
Zachary Sunforge
2023-06-14 15:39:02 -07:00
parent 19b8bc607c
commit 45ec03dfd1
6 changed files with 59 additions and 3 deletions

View File

@ -1,2 +1,30 @@
use crate::cell::CellView;
#[cfg(feature = "embassy-sync")]
use embassy_sync::blocking_mutex::raw::RawMutex;
#[cfg(feature = "embassy-sync")]
use embassy_sync::pubsub::PubSubChannel;
pub use physical::transducer::input::*;
#[cfg(feature = "embassy-sync")]
pub struct ChannelInput<
T: Copy,
MutexT: RawMutex,
const CAPACITY: usize,
const NUM_SUBS: usize,
const NUM_PUBS: usize,
> {
channel: PubSubChannel<MutexT, T, CAPACITY, NUM_SUBS, NUM_PUBS>,
}
#[cfg(feature = "embassy-sync")]
pub struct StatefulChannelInput<
'a,
T: Copy,
MutexT: RawMutex,
const CAPACITY: usize,
const NUM_SUBS: usize,
const NUM_PUBS: usize,
> {
pub state_cell: CellView<'a, T>,
channel: PubSubChannel<MutexT, T, CAPACITY, NUM_SUBS, NUM_PUBS>,
}