Struct Board

Source
pub struct Board {
Show 46 fields pub pins: Pins, pub edge: Edge, pub display_pins: DisplayPins, pub buttons: Buttons, pub i2c: I2CPins, pub uart: UartPins, pub CBP: CBP, pub CPUID: CPUID, pub DCB: DCB, pub DWT: DWT, pub FPB: FPB, pub ITM: ITM, pub MPU: MPU, pub NVIC: NVIC, pub SCB: SCB, pub SYST: SYST, pub TPIU: TPIU, pub ADC: ADC, pub CLOCK: CLOCK, pub FICR: FICR, pub GPIOTE: GPIOTE, pub PPI: PPI, pub RADIO: RADIO, pub RNG: RNG, pub RTC0: RTC0, pub TEMP: TEMP, pub TIMER0: TIMER0, pub TIMER1: TIMER1, pub TIMER2: TIMER2, pub TWI0: TWI0, pub UART0: UART0, pub POWER: POWER, pub SPI0: SPI0, pub SPI1: SPI1, pub TWI1: TWI1, pub SPIS1: SPIS1, pub ECB: ECB, pub AAR: AAR, pub CCM: CCM, pub WDT: WDT, pub RTC1: RTC1, pub QDEC: QDEC, pub LPCOMP: LPCOMP, pub SWI: SWI, pub NVMC: NVMC, pub UICR: UICR,
}
Expand description

Provides access to the microbit

Fields§

§pins: Pins

GPIO pins that are not otherwise used

§edge: Edge

Unused GPIO pins on edge connector

§display_pins: DisplayPins

display pins

§buttons: Buttons

buttons

§i2c: I2CPins

I2C shared internal and external bus pins

§uart: UartPins

UART to debugger pins

§CBP: CBP

Core peripheral: Cache and branch predictor maintenance operations

§CPUID: CPUID

Core peripheral: CPUID

§DCB: DCB

Core peripheral: Debug Control Block

§DWT: DWT

Core peripheral: Data Watchpoint and Trace unit

§FPB: FPB

Core peripheral: Flash Patch and Breakpoint unit

§ITM: ITM

Core peripheral: Instrumentation Trace Macrocell

§MPU: MPU

Core peripheral: Memory Protection Unit

§NVIC: NVIC

Core peripheral: Nested Vector Interrupt Controller

§SCB: SCB

Core peripheral: System Control Block

§SYST: SYST

Core peripheral: SysTick Timer

§TPIU: TPIU

Core peripheral: Trace Port Interface Unit

§ADC: ADC

nRF51 peripheral: ADC

§CLOCK: CLOCK

nRF51 peripheral: CLOCK

§FICR: FICR

nRF51 peripheral: FICR

§GPIOTE: GPIOTE

nRF51 peripheral: GPIOTE

§PPI: PPI

nRF51 preipheral: PPI

§RADIO: RADIO

nRF51 peripheral: RADIO

§RNG: RNG

nRF51 peripheral: RNG

§RTC0: RTC0

nRF51 peripheral: RTC0

§TEMP: TEMP

nRF51 peripheral: TEMP
Can be used with Temp::new()

§TIMER0: TIMER0

nRF51 peripheral: TIMER0

§TIMER1: TIMER1

nRF51 peripheral: TIMER1

§TIMER2: TIMER2

nRF51 peripheral: TIMER2

§TWI0: TWI0

nRF51 peripheral: TWI0

§UART0: UART0

nrf51 peripheral: UART0

§POWER: POWER

nrf51 peripheral: POWER

§SPI0: SPI0

nrf51 peripheral: SPI0

§SPI1: SPI1

nrf51 peripheral: SPI1

§TWI1: TWI1

nrf51 peripheral: TWI1

§SPIS1: SPIS1

nrf51 peripheral: SPIS1

§ECB: ECB

nrf51 peripheral: ECB

§AAR: AAR

nrf51 peripheral: AAR

§CCM: CCM

nrf51 peripheral: CCM

§WDT: WDT

nrf51 peripheral: WDT

§RTC1: RTC1

nrf51 peripheral: RTC1

§QDEC: QDEC

nrf51 peripheral: QDEC

§LPCOMP: LPCOMP

nrf51 peripheral: LPCOMP

§SWI: SWI

nrf51 peripheral: SWI

§NVMC: NVMC

nrf51 peripheral: NVMC

§UICR: UICR

nrf51 peripheral: UICR

Implementations§

Source§

impl Board

Source

pub fn take() -> Option<Board>

Take the peripherals safely

This method will return an instance of the board the first time it is called. It will return only None on subsequent calls. This function can also return None if one of the the peripherals was already taken.

Source

pub fn new(p: Peripherals, cp: Peripherals) -> Board

Fallback method in the case peripherals and core peripherals were taken elsewhere already.

This method will take the peripherals and core peripherals and return an instance of the board.

An exemplary usecase is shown in the rtic display example.

Auto Trait Implementations§

§

impl Freeze for Board

§

impl RefUnwindSafe for Board

§

impl Send for Board

§

impl !Sync for Board

§

impl Unpin for Board

§

impl UnwindSafe for Board

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> Az for T

Source§

fn az<Dst>(self) -> Dst
where T: Cast<Dst>,

Casts the value.
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<Src, Dst> CastFrom<Src> for Dst
where Src: Cast<Dst>,

Source§

fn cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<T> CheckedAs for T

Source§

fn checked_as<Dst>(self) -> Option<Dst>
where T: CheckedCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> CheckedCastFrom<Src> for Dst
where Src: CheckedCast<Dst>,

Source§

fn checked_cast_from(src: Src) -> Option<Dst>

Casts the value.
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<Src, Dst> LosslessTryInto<Dst> for Src
where Dst: LosslessTryFrom<Src>,

Source§

fn lossless_try_into(self) -> Option<Dst>

Performs the conversion.
Source§

impl<Src, Dst> LossyInto<Dst> for Src
where Dst: LossyFrom<Src>,

Source§

fn lossy_into(self) -> Dst

Performs the conversion.
Source§

impl<T> OverflowingAs for T

Source§

fn overflowing_as<Dst>(self) -> (Dst, bool)
where T: OverflowingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> OverflowingCastFrom<Src> for Dst
where Src: OverflowingCast<Dst>,

Source§

fn overflowing_cast_from(src: Src) -> (Dst, bool)

Casts the value.
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> SaturatingAs for T

Source§

fn saturating_as<Dst>(self) -> Dst
where T: SaturatingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> SaturatingCastFrom<Src> for Dst
where Src: SaturatingCast<Dst>,

Source§

fn saturating_cast_from(src: Src) -> Dst

Casts the value.
Source§

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

Source§

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>,

Source§

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.
Source§

impl<T> UnwrappedAs for T

Source§

fn unwrapped_as<Dst>(self) -> Dst
where T: UnwrappedCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> UnwrappedCastFrom<Src> for Dst
where Src: UnwrappedCast<Dst>,

Source§

fn unwrapped_cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<T> WrappingAs for T

Source§

fn wrapping_as<Dst>(self) -> Dst
where T: WrappingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> WrappingCastFrom<Src> for Dst
where Src: WrappingCast<Dst>,

Source§

fn wrapping_cast_from(src: Src) -> Dst

Casts the value.