Struct microbit::Board

source ·
pub struct Board {
Show 61 fields pub pins: Pins, pub edge: Edge, pub display_pins: DisplayPins, pub buttons: Buttons, pub speaker_pin: P0_00<Disconnected>, pub microphone_pins: MicrophonePins, pub i2c_internal: I2CInternalPins, pub i2c_external: I2CExternalPins, pub uart: UartPins, pub CBP: CBP, pub CPUID: CPUID, pub DCB: DCB, pub DWT: DWT, pub FPB: FPB, pub FPU: FPU, pub ITM: ITM, pub MPU: MPU, pub NVIC: NVIC, pub SCB: SCB, pub SYST: SYST, pub TPIU: TPIU, pub CLOCK: CLOCK, pub FICR: FICR, pub GPIOTE: GPIOTE, pub PPI: PPI, pub PWM0: PWM0, pub PWM1: PWM1, pub PWM2: PWM2, pub PWM3: PWM3, pub RADIO: RADIO, pub RNG: RNG, pub RTC0: RTC0, pub RTC1: RTC1, pub RTC2: RTC2, pub TEMP: TEMP, pub TIMER0: TIMER0, pub TIMER1: TIMER1, pub TIMER2: TIMER2, pub TIMER3: TIMER3, pub TIMER4: TIMER4, pub TWIM0: TWIM0, pub TWIS0: TWIS0, pub UARTE0: UARTE0, pub UARTE1: UARTE1, pub ADC: SAADC, pub POWER: POWER, pub SPI0: SPI0, pub SPI1: SPI1, pub SPI2: SPI2, pub UART0: UART0, pub TWI0: TWI0, pub TWI1: TWI1, pub SPIS1: SPIS1, pub ECB: ECB, pub AAR: AAR, pub CCM: CCM, pub WDT: WDT, pub QDEC: QDEC, pub LPCOMP: LPCOMP, 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

§speaker_pin: P0_00<Disconnected>

speaker

§microphone_pins: MicrophonePins

microphone pins

§i2c_internal: I2CInternalPins

I2C internal bus pins

§i2c_external: I2CExternalPins

I2C 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

§FPU: FPU

Core peripheral: Floating Point 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

§CLOCK: CLOCK

nRF52 peripheral: CLOCK

§FICR: FICR

nRF52 peripheral: FICR

§GPIOTE: GPIOTE

nRF52 peripheral: GPIOTE

§PPI: PPI

nRF52 preipheral: PPI

§PWM0: PWM0

nRF52 peripheral: PWM0

§PWM1: PWM1

nRF52 peripheral: PWM1

§PWM2: PWM2

nRF52 peripheral: PWM2

§PWM3: PWM3

nRF52 peripheral: PWM3

§RADIO: RADIO

nRF52 peripheral: RADIO

§RNG: RNG

nRF52 peripheral: RNG

§RTC0: RTC0

nRF52 peripheral: RTC0

§RTC1: RTC1

nRF52 peripheral: RTC1

§RTC2: RTC2

nRF52 peripheral: RTC2

§TEMP: TEMP

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

§TIMER0: TIMER0

nRF52 peripheral: TIMER0

§TIMER1: TIMER1

nRF52 peripheral: TIMER1

§TIMER2: TIMER2

nRF52 peripheral: TIMER2

§TIMER3: TIMER3

nRF52 peripheral: TIMER3

§TIMER4: TIMER4

nRF52 peripheral: TIMER4

§TWIM0: TWIM0

nRF52 peripheral: TWIM0

§TWIS0: TWIS0

nRF52 peripheral: TWIS0

§UARTE0: UARTE0

nRF52 peripheral: UARTE0

§UARTE1: UARTE1

nRF52 peripheral: UARTE1

§ADC: SAADC

nRF52 peripheral: SAADC

§POWER: POWER

nRF52 peripheral: POWER

§SPI0: SPI0

nRF52 peripheral: SPI0

§SPI1: SPI1

nRF52 peripheral: SPI1

§SPI2: SPI2

nRF52 peripheral: SPI2

§UART0: UART0

nRF52 peripheral: UART0

§TWI0: TWI0

nRF52 peripheral: TWI0

§TWI1: TWI1

nRF52 peripheral: TWI1

§SPIS1: SPIS1

nRF52 peripheral: SPIS1

§ECB: ECB

nRF52 peripheral: ECB

§AAR: AAR

nRF52 peripheral: AAR

§CCM: CCM

nRF52 peripheral: CCM

§WDT: WDT

nRF52 peripheral: WDT

§QDEC: QDEC

nRF52 peripheral: QDEC

§LPCOMP: LPCOMP

nRF52 peripheral: LPCOMP

§NVMC: NVMC

nRF52 peripheral: NVMC

§UICR: UICR

nRF52 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

§

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

§

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