avr_bitbang_t

Struct avr_bitbang_t 

Source
#[repr(C)]
pub struct avr_bitbang_t {
Show 17 fields pub avr: *mut avr_t, pub enabled: u8, pub clk_generate: u8, pub clk_pol: u8, pub clk_phase: u8, pub clk_cycles: u32, pub data_order: u8, pub buffer_size: u8, pub callback_param: *mut c_void, pub callback_bit_read: Option<unsafe extern "C" fn(bit: u8, param: *mut c_void)>, pub callback_bit_write: Option<unsafe extern "C" fn(bit: u8, param: *mut c_void)>, pub callback_transfer_finished: Option<unsafe extern "C" fn(data: u32, param: *mut c_void) -> u32>, pub p_clk: avr_iopin_t, pub p_in: avr_iopin_t, pub p_out: avr_iopin_t, pub data: u32, pub clk_count: i8,
}
Expand description

SPI Module initialization and state structure

Fields§

§avr: *mut avr_t

< avr we are attached to

§enabled: u8

< bit-bang enabled flag

§clk_generate: u8

< generate clock and write to clock pin (if available) -> master / slave mode

§clk_pol: u8

< clock polarity, base (inactive) value of clock

§clk_phase: u8

< clock phase / data sampling edge

§clk_cycles: u32

< cycles per clock period - must be multiple of 2! (used if clk_generate is enabled)

§data_order: u8

< data order / shift

§buffer_size: u8

< size of buffer in bits (1…32)

§callback_param: *mut c_void§callback_bit_read: Option<unsafe extern "C" fn(bit: u8, param: *mut c_void)>

< callback function to notify about bit read

§callback_bit_write: Option<unsafe extern "C" fn(bit: u8, param: *mut c_void)>

< callback function to notify about bit write

§callback_transfer_finished: Option<unsafe extern "C" fn(data: u32, param: *mut c_void) -> u32>

< callback function to notify about a complete transfer

§p_clk: avr_iopin_t

< clock pin (optional)

§p_in: avr_iopin_t

< data in pin

§p_out: avr_iopin_t

< data out pin

§data: u32

< data buffer

§clk_count: i8

< internal clock edge count

Trait Implementations§

Source§

impl Clone for avr_bitbang_t

Source§

fn clone(&self) -> avr_bitbang_t

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for avr_bitbang_t

Source§

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

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

impl Copy for avr_bitbang_t

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

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

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

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

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

Source§

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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = Infallible

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

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

Performs the conversion.
Source§

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

Source§

type Error = <U as TryFrom<T>>::Error

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

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.