use drone_core::bitfield::Bitfield;
#[derive(Clone, Copy, Bitfield)]
#[bitfield(
double_sec(rw, 0, 5, "Second / 2 (0..29, e.g. 25 for 50)."),
min(rw, 5, 6, "Minute (0..59)."),
hour(rw, 11, 5, "Hour (0..23)."),
day(rw, 16, 5, "Day of the month(1..31)."),
month(rw, 21, 4, "Month (1..12)."),
year(
rw,
25,
7,
"Year origin from the 1980 (0..127, e.g. 37 for 2017)."
),
default = 0x0021_0000
)]
pub struct FatTime(u32);
#[cfg_attr(feature = "cargo-clippy", allow(new_without_default_derive))]
impl FatTime {
pub fn new() -> Self {
unsafe { Self::default() }
}
}
impl From<u32> for FatTime {
fn from(raw: u32) -> Self {
FatTime(raw)
}
}