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
pins_init: &'a [(&'a G, ActivationMode)]
Methods
impl<'a, G: Pin + PinCtl> LED<'a, G>
[src]
pub fn new(pins_init: &'a [(&'a G, ActivationMode)]) -> LED<'a, G>
[src]
Trait Implementations
impl<'a, G: Pin + PinCtl> Driver for LED<'a, G>
[src]
fn command(
&self,
command_num: usize,
data: usize,
_: usize,
_: AppId
) -> ReturnCode
[src]
&self,
command_num: usize,
data: usize,
_: usize,
_: AppId
) -> ReturnCode
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 bydata
on. ReturnsEINVAL
if the LED index is not valid.2
: Turn the LED at index specified bydata
off. ReturnsEINVAL
if the LED index is not valid.3
: Toggle the LED at index specified bydata
on or off. ReturnsEINVAL
if the LED index is not valid.
fn subscribe(&self, minor_num: usize, callback: Callback) -> ReturnCode
[src]
subscribe
lets an application pass a callback to the driver to be called later. This returns ENOSUPPORT
if not used. Read more
fn allow(
&self,
app: AppId,
minor_num: usize,
slice: AppSlice<Shared, u8>
) -> ReturnCode
[src]
&self,
app: AppId,
minor_num: usize,
slice: AppSlice<Shared, u8>
) -> ReturnCode
allow
lets an application give the driver access to a buffer in the application's memory. This returns ENOSUPPORT
if not used. Read more