[−][src]Struct punt::Page
A page in the punt microcontroller's flash memory.
Methods
impl Page
[src]
pub fn from_index(index: u8) -> Self
[src]
Creates a page from its index, starting at 0 at FLASH_BASE
, with each page being
PAGE_SIZE
bytes.
pub fn from_address(address: u32) -> Self
[src]
Refers to the page containing the given address.
pub fn begin(&self) -> u32
[src]
The first address in a page.
Examples
use punt::FLASH_BASE; let page = Page::from_index(0); assert_eq!(page.begin(), FLASH_BASE);
pub fn end(&self) -> u32
[src]
Returns the address of the last byte of a page.
Examples
use punt::{FLASH_BASE, PAGE_SIZE}; let page = Page::from_index(0); let end = page.end(); assert_eq!(end, FLASH_BASE + PAGE_SIZE - 1); let next_page = Page::from_address(end + 1); let next_page_index: u8 = next_page.into(); assert_eq!(next_page_index, 1);
Trait Implementations
impl Clone for Page
[src]
impl Debug for Page
[src]
impl Eq for Page
[src]
impl Into<u8> for Page
[src]
impl<'_> Into<u8> for &'_ Page
[src]
impl Ord for Page
[src]
fn cmp(&self, other: &Page) -> Ordering
[src]
fn max(self, other: Self) -> Self
1.21.0[src]
fn min(self, other: Self) -> Self
1.21.0[src]
fn clamp(self, min: Self, max: Self) -> Self
[src]
impl PartialEq<Page> for Page
[src]
impl PartialOrd<Page> for Page
[src]
fn partial_cmp(&self, other: &Page) -> Option<Ordering>
[src]
fn lt(&self, other: &Page) -> bool
[src]
fn le(&self, other: &Page) -> bool
[src]
fn gt(&self, other: &Page) -> bool
[src]
fn ge(&self, other: &Page) -> bool
[src]
impl StructuralEq for Page
[src]
impl StructuralPartialEq for Page
[src]
Auto Trait Implementations
impl RefUnwindSafe for Page
impl Send for Page
impl Sync for Page
impl Unpin for Page
impl UnwindSafe for Page
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,