# uip.rs - source
Source of the Rust file `/home/runner/.cargo/git/checkouts/riscv-ab2abd16c438337b/11d43cf/src/register/uip.rs`.
Keywords: rust, rustlang, rust-lang

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37

    //! uip register

    use bit_field::BitField;

    /// uip register
    #[derive(Clone, Copy, Debug)]
    pub struct Uip {
        bits: usize,
    }

    impl Uip {
        /// Returns the contents of the register as raw bits
        #[inline]
        pub fn bits(&self) -> usize {
            self.bits
        }

        /// User Software Interrupt Pending
        #[inline]
        pub fn usoft(&self) -> bool {
            self.bits.get_bit(0)
        }

        /// User Timer Interrupt Pending
        #[inline]
        pub fn utimer(&self) -> bool {
            self.bits.get_bit(4)
        }

        /// User External Interrupt Pending
        #[inline]
        pub fn uext(&self) -> bool {
            self.bits.get_bit(8)
        }
    }

    read_csr_as!(Uip, 0x044, __read_uip);