#[repr(C)]pub struct I2C {
pub m_port: I2CPort,
pub m_deviceAddress: c_int,
}Expand description
I2C bus interface class.
This class is intended to be used by sensor (and other I2C device) drivers. It probably should not be used directly.
Fields§
§m_port: I2CPort§m_deviceAddress: c_intImplementations§
Source§impl I2C
impl I2C
pub unsafe fn GetPort(&self) -> I2C_Port
pub unsafe fn GetDeviceAddress(&self) -> c_int
pub unsafe fn Transaction( &mut self, dataToSend: *mut u8, sendSize: c_int, dataReceived: *mut u8, receiveSize: c_int, ) -> bool
pub unsafe fn AddressOnly(&mut self) -> bool
pub unsafe fn Write(&mut self, registerAddress: c_int, data: u8) -> bool
pub unsafe fn WriteBulk(&mut self, data: *mut u8, count: c_int) -> bool
pub unsafe fn Read( &mut self, registerAddress: c_int, count: c_int, data: *mut u8, ) -> bool
pub unsafe fn ReadOnly(&mut self, count: c_int, buffer: *mut u8) -> bool
pub unsafe fn VerifySensor( &mut self, registerAddress: c_int, count: c_int, expected: *const u8, ) -> bool
pub unsafe fn new(port: I2C_Port, deviceAddress: c_int) -> Self
pub unsafe fn destruct(&mut self)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for I2C
impl RefUnwindSafe for I2C
impl Send for I2C
impl Sync for I2C
impl Unpin for I2C
impl UnwindSafe for I2C
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