riscv 0.16.0

Low level access to RISC-V processors
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
//! dscratch1

read_write_csr_as_usize!(0x7b3);

#[cfg(test)]
mod tests {
    use super::*;
    use crate::result::Error;

    #[test]
    fn test_dscratch1_read_write() {
        for i in 0..usize::BITS {
            let val = 1usize << i;
            assert_eq!(unsafe { try_write(val) }, Err(Error::Unimplemented));
            assert_eq!(try_read(), Err(Error::Unimplemented));
        }
    }
}