rstubs::device::keyboard

Struct Status

source
#[repr(transparent)]
struct Status(u8);
Expand description

Flags in the PS/2 controller status register

Tuple Fields§

§0: u8

Implementations§

source§

impl Status

source

const HAS_OUTPUT_BITS: usize = 1usize

source

const HAS_OUTPUT_OFFSET: usize = 0usize

source

const INPUT_PENDING_BITS: usize = 1usize

source

const INPUT_PENDING_OFFSET: usize = 1usize

source

const SYSTEM_FLAG_BITS: usize = 1usize

source

const SYSTEM_FLAG_OFFSET: usize = 2usize

source

const IS_COMMAND_BITS: usize = 1usize

source

const IS_COMMAND_OFFSET: usize = 3usize

source

const IS_MOUSE_BITS: usize = 1usize

source

const IS_MOUSE_OFFSET: usize = 5usize

source

const TIMEOUT_ERR_BITS: usize = 1usize

source

const TIMEOUT_ERR_OFFSET: usize = 6usize

source

const PARITY_ERR_BITS: usize = 1usize

source

const PARITY_ERR_OFFSET: usize = 7usize

source

const fn new() -> Self

Creates a new default initialized bitfield.

source

const fn from_bits(bits: u8) -> Self

Convert from bits.

source

const fn into_bits(self) -> u8

Convert into bits.

source

const fn has_output(&self) -> bool

Output buffer non-empty?

Bits: 0..1

source

const fn with_has_output_checked(self, value: bool) -> Result<Self, ()>

Output buffer non-empty?

Bits: 0..1

source

const fn with_has_output(self, value: bool) -> Self

Output buffer non-empty?

Bits: 0..1

source

fn set_has_output(&mut self, value: bool)

Output buffer non-empty?

Bits: 0..1

source

fn set_has_output_checked(&mut self, value: bool) -> Result<(), ()>

Output buffer non-empty?

Bits: 0..1

source

const fn input_pending(&self) -> bool

Is input buffer full?

Bits: 1..2

source

const fn with_input_pending_checked(self, value: bool) -> Result<Self, ()>

Is input buffer full?

Bits: 1..2

source

const fn with_input_pending(self, value: bool) -> Self

Is input buffer full?

Bits: 1..2

source

fn set_input_pending(&mut self, value: bool)

Is input buffer full?

Bits: 1..2

source

fn set_input_pending_checked(&mut self, value: bool) -> Result<(), ()>

Is input buffer full?

Bits: 1..2

source

const fn system_flag(&self) -> bool

Set on soft reset, cleared on power up

Bits: 2..3

source

const fn with_system_flag_checked(self, value: bool) -> Result<Self, ()>

Set on soft reset, cleared on power up

Bits: 2..3

source

const fn with_system_flag(self, value: bool) -> Self

Set on soft reset, cleared on power up

Bits: 2..3

source

fn set_system_flag(&mut self, value: bool)

Set on soft reset, cleared on power up

Bits: 2..3

source

fn set_system_flag_checked(&mut self, value: bool) -> Result<(), ()>

Set on soft reset, cleared on power up

Bits: 2..3

source

const fn is_command(&self) -> bool

Is command Byte? (otherwise data)

Bits: 3..4

source

const fn with_is_command_checked(self, value: bool) -> Result<Self, ()>

Is command Byte? (otherwise data)

Bits: 3..4

source

const fn with_is_command(self, value: bool) -> Self

Is command Byte? (otherwise data)

Bits: 3..4

source

fn set_is_command(&mut self, value: bool)

Is command Byte? (otherwise data)

Bits: 3..4

source

fn set_is_command_checked(&mut self, value: bool) -> Result<(), ()>

Is command Byte? (otherwise data)

Bits: 3..4

source

const fn is_mouse(&self) -> bool

Mouse output has data

Bits: 5..6

source

const fn with_is_mouse_checked(self, value: bool) -> Result<Self, ()>

Mouse output has data

Bits: 5..6

source

const fn with_is_mouse(self, value: bool) -> Self

Mouse output has data

Bits: 5..6

source

fn set_is_mouse(&mut self, value: bool)

Mouse output has data

Bits: 5..6

source

fn set_is_mouse_checked(&mut self, value: bool) -> Result<(), ()>

Mouse output has data

Bits: 5..6

source

const fn timeout_err(&self) -> bool

Bits: 6..7

source

const fn with_timeout_err_checked(self, value: bool) -> Result<Self, ()>

Bits: 6..7

source

const fn with_timeout_err(self, value: bool) -> Self

Bits: 6..7

source

fn set_timeout_err(&mut self, value: bool)

Bits: 6..7

source

fn set_timeout_err_checked(&mut self, value: bool) -> Result<(), ()>

Bits: 6..7

source

const fn parity_err(&self) -> bool

Bits: 7..8

source

const fn with_parity_err_checked(self, value: bool) -> Result<Self, ()>

Bits: 7..8

source

const fn with_parity_err(self, value: bool) -> Self

Bits: 7..8

source

fn set_parity_err(&mut self, value: bool)

Bits: 7..8

source

fn set_parity_err_checked(&mut self, value: bool) -> Result<(), ()>

Bits: 7..8

Trait Implementations§

source§

impl Clone for Status

source§

fn clone(&self) -> Status

Returns a copy of the value. Read more
1.0.0§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Status

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for Status

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl From<Status> for u8

source§

fn from(v: Status) -> u8

Converts to this type from the input type.
source§

impl From<u8> for Status

source§

fn from(v: u8) -> Self

Converts to this type from the input type.
source§

impl Copy for Status

Auto Trait Implementations§

§

impl Freeze for Status

§

impl RefUnwindSafe for Status

§

impl Send for Status

§

impl Sync for Status

§

impl Unpin for Status

§

impl UnwindSafe for Status

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

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

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

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

impl<T> CloneToUninit for T
where T: Clone,

§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

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

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

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

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.