add mode module with basic defintions
This commit is contained in:
parent
72e560dd81
commit
d960c089fd
@ -26,6 +26,7 @@ pub mod events;
|
||||
pub mod executable;
|
||||
pub mod hal;
|
||||
pub mod hk;
|
||||
pub mod mode;
|
||||
pub mod objects;
|
||||
pub mod params;
|
||||
#[cfg(feature = "alloc")]
|
||||
|
@ -0,0 +1,25 @@
|
||||
use crate::tmtc::TargetId;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
|
||||
pub struct ModePair {
|
||||
mode: u32,
|
||||
submode: u16,
|
||||
}
|
||||
|
||||
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
|
||||
pub struct ModeCommand {
|
||||
address: TargetId,
|
||||
mode: ModePair,
|
||||
}
|
||||
|
||||
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
|
||||
pub enum ModeRequest {
|
||||
SetMode(ModeCommand),
|
||||
ReadMode(TargetId),
|
||||
AnnounceMode(TargetId),
|
||||
AnnounceModeRecursive(TargetId),
|
||||
}
|
@ -23,10 +23,12 @@ pub use ccsds_distrib::{CcsdsDistributor, CcsdsError, CcsdsPacketHandler};
|
||||
#[cfg(feature = "alloc")]
|
||||
pub use pus_distrib::{PusDistributor, PusServiceProvider};
|
||||
|
||||
pub type TargetId = u32;
|
||||
|
||||
#[derive(Copy, Clone, PartialEq, Eq, Debug, Hash)]
|
||||
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
|
||||
pub struct AddressableId {
|
||||
pub target_id: u32,
|
||||
pub target_id: TargetId,
|
||||
pub unique_id: u32,
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user