#[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
impl Clone for avr_bitbang_t
Source§fn clone(&self) -> avr_bitbang_t
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)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for avr_bitbang_t
impl Debug for avr_bitbang_t
impl Copy for avr_bitbang_t
Auto Trait Implementations§
impl Freeze for avr_bitbang_t
impl RefUnwindSafe for avr_bitbang_t
impl !Send for avr_bitbang_t
impl !Sync for avr_bitbang_t
impl Unpin for avr_bitbang_t
impl UnwindSafe for avr_bitbang_t
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