Struct capsules::led::LED [] [src]

pub struct LED<'a, G: Pin + 'a> {
    pins_init: &'a [(&'a G, ActivationMode)],
}

Holds the array of GPIO pins attached to the LEDs and implements a Driver interface to control them.

Fields

Methods

impl<'a, G: Pin + PinCtl> LED<'a, G>
[src]

[src]

Trait Implementations

impl<'a, G: Pin + PinCtl> Driver for LED<'a, G>
[src]

[src]

Control the LEDs.

command_num

  • 0: Returns the number of LEDs on the board. This will always be 0 or greater, and therefore also allows for checking for this driver.
  • 1: Turn the LED at index specified by data on. Returns EINVAL if the LED index is not valid.
  • 2: Turn the LED at index specified by data off. Returns EINVAL if the LED index is not valid.
  • 3: Toggle the LED at index specified by data on or off. Returns EINVAL if the LED index is not valid.

[src]

subscribe lets an application pass a callback to the driver to be called later. This returns ENOSUPPORT if not used. Read more

[src]

allow lets an application give the driver access to a buffer in the application's memory. This returns ENOSUPPORT if not used. Read more