pub struct WriteCanData<'a> { /* private fields */ }Expand description
Writer for appending data to a CAN-FD frame.
Implementations§
Source§impl<'a> WriteCanData<'a>
impl<'a> WriteCanData<'a>
Sourcepub fn new(frame: &'a mut CanFdFrame) -> Self
pub fn new(frame: &'a mut CanFdFrame) -> Self
Creates a new writer from a frame.
Sourcepub fn from_parts(data: &'a mut [u8; 64], size: &'a mut u8) -> Self
pub fn from_parts(data: &'a mut [u8; 64], size: &'a mut u8) -> Self
Creates a writer from raw pointers (for compatibility).
Sourcepub fn write_bytes(&mut self, bytes: &[u8])
pub fn write_bytes(&mut self, bytes: &[u8])
Writes raw bytes.
Sourcepub fn write_varuint(&mut self, value: u32)
pub fn write_varuint(&mut self, value: u32)
Writes a variable-length unsigned integer (varuint).
Sourcepub fn write_int(&mut self, value: i32, res: Resolution)
pub fn write_int(&mut self, value: i32, res: Resolution)
Writes an integer value with the specified resolution.
Sourcepub fn write_mapped(&mut self, value: f32, scaling: &Scaling, res: Resolution)
pub fn write_mapped(&mut self, value: f32, scaling: &Scaling, res: Resolution)
Writes a scaled value with the specified resolution and scaling.
Sourcepub fn write_position(&mut self, value: f32, res: Resolution)
pub fn write_position(&mut self, value: f32, res: Resolution)
Writes a position value (revolutions).
Sourcepub fn write_velocity(&mut self, value: f32, res: Resolution)
pub fn write_velocity(&mut self, value: f32, res: Resolution)
Writes a velocity value (revolutions/second).
Sourcepub fn write_accel(&mut self, value: f32, res: Resolution)
pub fn write_accel(&mut self, value: f32, res: Resolution)
Writes an acceleration value (revolutions/second^2).
Sourcepub fn write_torque(&mut self, value: f32, res: Resolution)
pub fn write_torque(&mut self, value: f32, res: Resolution)
Writes a torque value (Nm).
Sourcepub fn write_pwm(&mut self, value: f32, res: Resolution)
pub fn write_pwm(&mut self, value: f32, res: Resolution)
Writes a PWM/normalized value (0-1).
Sourcepub fn write_voltage(&mut self, value: f32, res: Resolution)
pub fn write_voltage(&mut self, value: f32, res: Resolution)
Writes a voltage value (V).
Sourcepub fn write_temperature(&mut self, value: f32, res: Resolution)
pub fn write_temperature(&mut self, value: f32, res: Resolution)
Writes a temperature value (C).
Sourcepub fn write_time(&mut self, value: f32, res: Resolution)
pub fn write_time(&mut self, value: f32, res: Resolution)
Writes a time value (seconds).
Sourcepub fn write_current(&mut self, value: f32, res: Resolution)
pub fn write_current(&mut self, value: f32, res: Resolution)
Writes a current value (A).
Trait Implementations§
Auto Trait Implementations§
impl<'a> !UnwindSafe for WriteCanData<'a>
impl<'a> Freeze for WriteCanData<'a>
impl<'a> RefUnwindSafe for WriteCanData<'a>
impl<'a> Send for WriteCanData<'a>
impl<'a> Sync for WriteCanData<'a>
impl<'a> Unpin for WriteCanData<'a>
impl<'a> UnsafeUnpin for WriteCanData<'a>
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