Struct nrf52832::power::Power

source ·
pub struct Power<'a> { /* private fields */ }
Expand description

The USB state machine needs to be notified of power events (USB detected, USB removed, USB power ready) in order to be initialized and shut down properly. These events come from the power management registers of this module; that’s this has a USB client to notify.

Implementations§

source§

impl<'a> Power<'a>

source

pub const fn new() -> Power<'a>

source

pub fn set_usb_client(&self, client: &'a dyn PowerClient)

source

pub fn handle_interrupt(&self)

source

pub fn enable_interrupts(&self)

source

pub fn enable_interrupt(&self, intr: u32)

source

pub fn clear_interrupt(&self, intr: u32)

source

pub fn disable_all_interrupts(&self)

source

pub fn get_main_supply_status(&self) -> MainVoltage

source

pub fn is_vbus_present(&self) -> bool

source

pub fn is_usb_power_ready(&self) -> bool

source

pub fn get_gpregret(&self) -> u8

Return the contents of the GPREGRET (general purpose retention register) register.

This register is a “retention” register because it preserves eight bits of its state across a soft reset.

This is used to set a flag before a reset to instruct the bootloader to stay in the bootloader mode.

source

pub fn set_gpregret(&self, val: u8)

Set the value of the GPREGRET (general purpose retention register) register.

This is used to set a flag before a reset to instruct the bootloader to stay in the bootloader mode.

Auto Trait Implementations§

§

impl<'a> !Freeze for Power<'a>

§

impl<'a> !RefUnwindSafe for Power<'a>

§

impl<'a> !Send for Power<'a>

§

impl<'a> !Sync for Power<'a>

§

impl<'a> Unpin for Power<'a>

§

impl<'a> !UnwindSafe for Power<'a>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.