pub struct TsNbus {
data_pins: [Option<GpioPin>; 8],
csn: Option<GpioPin>,
txrx: Option<GpioPin>,
strobe: Option<GpioPin>,
ale: Option<GpioPin>,
rdy: Option<GpioPin>,
power_state: PowerState,
children: Vec<BusChild>,
}Fields§
§data_pins: [Option<GpioPin>; 8]§csn: Option<GpioPin>§txrx: Option<GpioPin>§strobe: Option<GpioPin>§ale: Option<GpioPin>§rdy: Option<GpioPin>§power_state: PowerState§children: Vec<BusChild>Implementations§
Source§impl TsNbus
impl TsNbus
Sourcepub fn set_data_pin(
&mut self,
index: usize,
pin: GpioPin,
) -> Result<(), BusError>
pub fn set_data_pin( &mut self, index: usize, pin: GpioPin, ) -> Result<(), BusError>
Wires one of the 8 data lines (index 0..8) to a GPIO pin.
Returns BusError::InvalidArgument when index >= 8.
Sourcepub fn set_control_pin(&mut self, which: NbusControlPin, pin: GpioPin)
pub fn set_control_pin(&mut self, which: NbusControlPin, pin: GpioPin)
Wires a control line to a GPIO pin.
Sourcefn validate_pins(&self) -> Result<(), BusError>
fn validate_pins(&self) -> Result<(), BusError>
Verifies that every pin required by the bit-banging protocol is configured, so transactions fail loudly instead of silently no-op’ing.
Sourcefn set_data_direction(&self, output: bool)
fn set_data_direction(&self, output: bool)
Sets data direction.
Sourcefn write_byte(&self, val: u8)
fn write_byte(&self, val: u8)
Writes byte.
Sourcefn start_transaction(&self)
fn start_transaction(&self)
Starts transaction.
Sourcefn end_transaction(&self)
fn end_transaction(&self)
Performs the end transaction operation.
Trait Implementations§
Source§impl BusDriver for TsNbus
impl BusDriver for TsNbus
Source§fn compatible(&self) -> &[&str]
fn compatible(&self) -> &[&str]
Performs the compatible operation.
Source§fn as_firewall(&self) -> Option<&dyn FirewallController>
fn as_firewall(&self) -> Option<&dyn FirewallController>
Returns the optional [
FirewallController] capability, if any. Read moreSource§fn error_count(&self) -> u64
fn error_count(&self) -> u64
Performs the error count operation.
Source§fn handle_irq(&mut self) -> bool
fn handle_irq(&mut self) -> bool
Handles irq.
Auto Trait Implementations§
impl Freeze for TsNbus
impl RefUnwindSafe for TsNbus
impl Send for TsNbus
impl Sync for TsNbus
impl Unpin for TsNbus
impl UnsafeUnpin for TsNbus
impl UnwindSafe for TsNbus
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more