| 1 | #![allow (clippy::missing_safety_doc)] |
| 2 | #![allow (clippy::identity_op)] |
| 3 | #![allow (clippy::unnecessary_cast)] |
| 4 | #![allow (clippy::erasing_op)] |
| 5 | |
| 6 | #[doc = "Device Factory programmed 96-bit unique device identifier" ] |
| 7 | #[derive (Copy, Clone, Eq, PartialEq)] |
| 8 | pub struct Uid { |
| 9 | ptr: *mut u8, |
| 10 | } |
| 11 | unsafe impl Send for Uid {} |
| 12 | unsafe impl Sync for Uid {} |
| 13 | impl Uid { |
| 14 | #[inline (always)] |
| 15 | pub const unsafe fn from_ptr(ptr: *mut ()) -> Self { |
| 16 | Self { ptr: ptr as _ } |
| 17 | } |
| 18 | #[inline (always)] |
| 19 | pub const fn as_ptr(&self) -> *mut () { |
| 20 | self.ptr as _ |
| 21 | } |
| 22 | #[doc = "Factory programmed 96-bit unique device identifier word 0" ] |
| 23 | #[inline (always)] |
| 24 | pub const fn uid(self, n: usize) -> crate::common::Reg<u32, crate::common::R> { |
| 25 | assert!(n < 3usize); |
| 26 | unsafe { crate::common::Reg::from_ptr(self.ptr.add(count:0x0usize + n * 4usize) as _) } |
| 27 | } |
| 28 | } |
| 29 | |