basic docs
All checks were successful
Rust/spacepackets/pipeline/head This commit looks good
Rust/spacepackets/pipeline/pr-main This commit looks good

This commit is contained in:
Robin Müller 2022-12-09 17:33:04 +01:00
parent bccbdf65a3
commit 7615e40e43
No known key found for this signature in database
GPG Key ID: BE6480244DFE612C
2 changed files with 18 additions and 5 deletions

View File

@ -1,4 +1,4 @@
//! Module to generate or read CDS timestamps as specified in //! Module to generate or read CCSDS Day Segmented (CDS) timestamps as specified in
//! [CCSDS 301.0-B-4](https://public.ccsds.org/Pubs/301x0b4e1.pdf) section 3.3 . //! [CCSDS 301.0-B-4](https://public.ccsds.org/Pubs/301x0b4e1.pdf) section 3.3 .
//! //!
//! The core data structure to do this is the [cds::TimeProvider] struct. //! The core data structure to do this is the [cds::TimeProvider] struct.

View File

@ -1,7 +1,13 @@
//! Module to generate or read CCSDS Unsegmented (CUC) timestamps as specified in
//! [CCSDS 301.0-B-4](https://public.ccsds.org/Pubs/301x0b4e1.pdf) section 3.2 .
//!
//! The core data structure to do this is the [TimeProviderCcsdsEpoch] struct.
use super::*; use super::*;
use core::fmt::Debug; use core::fmt::Debug;
const MIN_CUC_LEN: usize = 2; const MIN_CUC_LEN: usize = 2;
/// Maximum length if the preamble field is not extended.
pub const MAX_CUC_LEN_SMALL_PREAMBLE: usize = 8;
#[derive(Copy, Clone, PartialEq, Eq, Debug)] #[derive(Copy, Clone, PartialEq, Eq, Debug)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
@ -103,11 +109,18 @@ pub struct WidthCounterPair(u8, u32);
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct FractionalPart(FractionalResolution, u32); pub struct FractionalPart(FractionalResolution, u32);
/// This provider uses the CCSDS epoch. Furthermore the preamble field only has one byte, /// This object is the abstraction for the CCSDS Unsegmented Time Code (CUC) using the CCSDS epoch
/// which allows a time code representation through the year 2094. /// and a small preamble field.
/// ///
/// More specifically, only having a preamble field of one byte limits the width of the counter /// It has the capability to generate and read timestamps as specified in the CCSDS 301.0-B-4
/// type (generally seconds) to 4 bytes and the width of the fractions type to 3 bytes. /// section 3.2 . The preamble field only has one byte, which allows a time code representation
/// through the year 2094. The time is represented as a simple binary counter starting from the
/// fixed CCSDS epoch (1958-01-01 00:00:00). It is possible to provide subsecond accuracy using the
/// fractional field with various available resolutions.
///
/// Having a preamble field of one byte limits the width of the counter
/// type (generally seconds) to 4 bytes and the width of the fractions type to 3 bytes. This limits
/// the maximum time stamp size to [MAX_CUC_LEN_SMALL_PREAMBLE] (8 bytes).
#[derive(Copy, Clone, PartialEq, Eq, Debug)] #[derive(Copy, Clone, PartialEq, Eq, Debug)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct TimeProviderCcsdsEpoch { pub struct TimeProviderCcsdsEpoch {