use crate::{Register, IIR_FCR};
impl<R: Register> IIR_FCR<R> {
#[inline]
pub fn write(&self, val: FifoControl) {
unsafe { self.0.get().write_volatile(R::from(val.0)) }
}
}
#[derive(Clone, Copy, PartialEq, Eq, Default, Debug)]
#[repr(transparent)]
pub struct FifoControl(u8);
#[repr(u8)]
pub enum TriggerLevel {
_1 = 0b00 << 6,
_4 = 0b01 << 6,
_8 = 0b10 << 6,
_14 = 0b11 << 6,
}
impl TriggerLevel {
#[inline]
pub const fn and_reset(self) -> FifoControl {
FifoControl(self as u8 | 0b110)
}
#[inline]
pub const fn without_reset(self) -> FifoControl {
FifoControl(self as u8)
}
}