pub fn from_byte_offset(offset: usize) -> Option<Self> {
        if offset % Self::SIZE == 0 {
            let idx: usize = offset / Self::SIZE;
            if idx >= usize::from(num_pages()) {
                None
            } else {
                Some(Page { idx: idx as u8 })
            }
        } else {
            None
        }
    }
/// Create a page address from an offset from the base of the flash memory.
///
/// Returns `None` if the address is out of bounds, or not page aligned.
///
/// # Example
///
/// ```no_run
/// use stm32wlxx_hal::flash::Page;
///
/// assert_eq!(Page::from_byte_offset(0), Page::from_index(0));
/// assert_eq!(Page::from_byte_offset(2048), Page::from_index(1));
/// assert!(Page::from_byte_offset(2047).is_none());
/// assert!(Page::from_byte_offset(usize::MAX).is_none());
/// ```
Create a page address from an offset from the base of the flash memory.
Returns `None` if the address is out of bounds, or not page aligned.
Create a page address from an offset from the base of the flash memory . Returns ` None ` if the address is out of bounds or not page aligned .
pub fn from_byte_offset(offset: usize) -> Option<Self> {
        if offset % Self::SIZE == 0 {
            let idx: usize = offset / Self::SIZE;
            if idx >= usize::from(num_pages()) {
                None
            } else {
                Some(Page { idx: idx as u8 })
            }
        } else {
            None
        }
    }
pub fn from_byte_offset ( offset : usize ) -> Option < Self > { if offset % Self :: SIZE == 0 { let idx : usize = offset / Self :: SIZE ; if idx >= usize :: from ( num_pages ( ) ) { None } else { Some ( Page { idx : idx as u8 } ) } } else { None } }
Create a page address from an offset from the base of the flash memory.
Create a page address from an offset from the base of the flash memory .
offset
usize
example
```no_run
use stm32wlxx_hal::flash::Page.


` ` ` no_run use stm32wlxx_hal :: flash :: Page .