Skip to content

Commit 1f25953

Browse files
Remove Peripheral
It appears to be unused by cortex-m and generated PACs
1 parent 37bcf7b commit 1f25953

File tree

1 file changed

+0
-30
lines changed

1 file changed

+0
-30
lines changed

src/lib.rs

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -7,36 +7,6 @@
77
use core::cell::UnsafeCell;
88
use core::marker::PhantomData;
99

10-
/// A peripheral
11-
#[derive(Debug)]
12-
pub struct Peripheral<T>
13-
where
14-
T: 'static,
15-
{
16-
address: *mut T,
17-
}
18-
19-
impl<T> Peripheral<T> {
20-
/// Creates a new peripheral
21-
///
22-
/// `address` is the base address of the register block
23-
pub const unsafe fn new(address: usize) -> Self {
24-
Peripheral {
25-
address: address as *mut T,
26-
}
27-
}
28-
29-
/// Borrows the peripheral for the duration of a critical section
30-
pub fn borrow<'cs>(&self, _ctxt: CriticalSection<'cs>) -> &'cs T {
31-
unsafe { &*self.get() }
32-
}
33-
34-
/// Returns a pointer to the register block
35-
pub fn get(&self) -> *mut T {
36-
self.address as *mut T
37-
}
38-
}
39-
4010
/// Critical section token
4111
///
4212
/// Indicates that you are executing code within a critical section

0 commit comments

Comments
 (0)