pub type GpioComponentType<IP> = GPIO<'static, IP>;
Aliased Type§
struct GpioComponentType<IP> { /* private fields */ }
Implementations
Source§impl<'a, IP> GPIO<'a, IP>where
IP: InterruptPin<'a>,
impl<'a, IP> GPIO<'a, IP>where
IP: InterruptPin<'a>,
pub fn new( pins: &'a [Option<&'a InterruptValueWrapper<'a, IP>>], grant: Grant<(), UpcallCount<1>, AllowRoCount<0>, AllowRwCount<0>>, ) -> GPIO<'a, IP>
Trait Implementations
Source§impl<'a, IP> ClientWithValue for GPIO<'a, IP>where
IP: InterruptPin<'a>,
impl<'a, IP> ClientWithValue for GPIO<'a, IP>where
IP: InterruptPin<'a>,
Source§impl<'a, IP> SyscallDriver for GPIO<'a, IP>where
IP: InterruptPin<'a>,
impl<'a, IP> SyscallDriver for GPIO<'a, IP>where
IP: InterruptPin<'a>,
Source§fn command(
&self,
command_num: usize,
data1: usize,
data2: usize,
_: ProcessId,
) -> CommandReturn
fn command( &self, command_num: usize, data1: usize, data2: usize, _: ProcessId, ) -> CommandReturn
Query and control pin values and states.
Each byte of the data
argument is treated as its own field.
For all commands, the lowest order halfword is the pin number (pin
).
A few commands use higher order bytes for purposes documented below.
If the higher order bytes are not used, they must be set to 0
.
Other data bytes:
pin_config
: An internal resistor setting. Set to0
for a pull-up resistor. Set to1
for a pull-down resistor. Set to2
for none.irq_config
: Interrupt configuration setting. Set to0
to interrupt on either edge. Set to1
for rising edge. Set to2
for falling edge.
§command_num
0
: Driver existence check.1
: Enable output onpin
.2
: Setpin
.3
: Clearpin
.4
: Togglepin
.5
: Enable input onpin
withpin_config
in 0x00XX000006
: Readpin
value.7
: Configure interrupt onpin
withirq_config
in 0x00XX000008
: Disable interrupt onpin
.9
: Disablepin
.10
: Get number of GPIO ports supported.
Source§fn allocate_grant(&self, processid: ProcessId) -> Result<(), Error>
fn allocate_grant(&self, processid: ProcessId) -> Result<(), Error>
Request to allocate a capsule’s grant for a specific process. Read more
Source§fn allow_userspace_readable(
&self,
app: ProcessId,
which: usize,
slice: ReadWriteProcessBuffer,
) -> Result<ReadWriteProcessBuffer, (ReadWriteProcessBuffer, ErrorCode)>
fn allow_userspace_readable( &self, app: ProcessId, which: usize, slice: ReadWriteProcessBuffer, ) -> Result<ReadWriteProcessBuffer, (ReadWriteProcessBuffer, ErrorCode)>
System call for a process to pass a buffer (a
UserspaceReadableProcessBuffer
) to the kernel that the kernel can
either read or write. The kernel calls this method only after it checks
that the entire buffer is within memory the process can both read and
write. Read more