Struct stm32f3_discovery::leds::Leds[][src]

Fields

ld3: Switch<PEx<Output<PushPull>>, ActiveHigh>

North

ld4: Switch<PEx<Output<PushPull>>, ActiveHigh>

NorthWest

ld5: Switch<PEx<Output<PushPull>>, ActiveHigh>

NorthEast

ld6: Switch<PEx<Output<PushPull>>, ActiveHigh>

West

ld7: Switch<PEx<Output<PushPull>>, ActiveHigh>

East

ld8: Switch<PEx<Output<PushPull>>, ActiveHigh>

SouthWest

ld9: Switch<PEx<Output<PushPull>>, ActiveHigh>

SouthEast

ld10: Switch<PEx<Output<PushPull>>, ActiveHigh>

South

Implementations

Initializes the user LEDs to OFF

Mutably borrow a LED by the given direction (as noted on the board)

Example

let southLed = leds.for_direction(Direction::South);
southLed.on().ok();

Provides a mutable iterator for iterating over the on board leds. Starts at ld3 (N) and moves clockwise.
Stops once it has iterated through all 8 leds.

Examples

Iterate over the leds clockwise

let ms_delay = 50u16;
for led in &mut leds {
    led.on().ok();
    delay.delay_ms(ms_delay);
    led.off().ok();
    delay.delay_ms(ms_delay);
}

Iterate over the leds counter clockwise

let ms_delay = 50u16;
for led in leds.iter_mut().rev() {
    led.on().ok();
    delay.delay_ms(ms_delay);
    led.off().ok();
    delay.delay_ms(ms_delay);
}

Consumes the Leds struct and returns an array, where index 0 is N and each incrementing index.
Rotates clockwise around the compass.

Warning

This function is maintained solely for some level of compatibility with the old F3 crate.

Self::iter_mut() should be prefered. Testing suggests that using Self::iter_mut() results in an ~800 byte reduction in final binary size.

Trait Implementations

The type of the elements being iterated over.

Which kind of iterator are we turning this into?

Creates an iterator from a value. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

Consumes the IoPin returning a Switch of the appropriate ActiveLevel. Read more

Consumes the IoPin returning a Switch<IoPin, ActiveLow>. Read more

Consumes the IoPin returning a Switch<IoPin, ActiveHigh>. Read more

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.