pub struct DriverStatus { /* private fields */ }Expand description
驱动器状态位域(Byte 5: 8 位)
协议定义(Motorola MSB 高位在前):
- Bit 0: 电源电压是否过低(0:正常 1:过低)
- Bit 1: 电机是否过温(0:正常 1:过温)
- Bit 2: 驱动器是否过流(0:正常 1:过流)
- Bit 3: 驱动器是否过温(0:正常 1:过温)
- Bit 4: 碰撞保护状态(0:正常 1:触发保护)
- Bit 5: 驱动器错误状态(0:正常 1:错误)
- Bit 6: 驱动器使能状态(0:失能 1:使能)
- Bit 7: 堵转保护状态(0:正常 1:触发保护)
Implementations§
Source§impl DriverStatus
impl DriverStatus
pub fn new( arg_voltage_low: bool, arg_motor_over_temp: bool, arg_driver_over_current: bool, arg_driver_over_temp: bool, arg_collision_protection: bool, arg_driver_error: bool, arg_enabled: bool, arg_stall_protection: bool, ) -> Self
pub fn voltage_low(&self) -> bool
pub fn set_voltage_low(&mut self, value: bool)
pub fn motor_over_temp(&self) -> bool
pub fn set_motor_over_temp(&mut self, value: bool)
pub fn driver_over_current(&self) -> bool
pub fn set_driver_over_current(&mut self, value: bool)
pub fn driver_over_temp(&self) -> bool
pub fn set_driver_over_temp(&mut self, value: bool)
pub fn collision_protection(&self) -> bool
pub fn set_collision_protection(&mut self, value: bool)
pub fn driver_error(&self) -> bool
pub fn set_driver_error(&mut self, value: bool)
pub fn enabled(&self) -> bool
pub fn set_enabled(&mut self, value: bool)
pub fn stall_protection(&self) -> bool
pub fn set_stall_protection(&mut self, value: bool)
Trait Implementations§
Source§impl Bitsized for DriverStatus
impl Bitsized for DriverStatus
Source§impl Clone for DriverStatus
impl Clone for DriverStatus
Source§fn clone(&self) -> DriverStatus
fn clone(&self) -> DriverStatus
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 DriverStatus
impl Debug for DriverStatus
Source§impl Default for DriverStatus
impl Default for DriverStatus
Source§impl From<DriverStatus> for u8
impl From<DriverStatus> for u8
Source§fn from(value: DriverStatus) -> Self
fn from(value: DriverStatus) -> Self
Converts to this type from the input type.
Source§impl From<u8> for DriverStatus
impl From<u8> for DriverStatus
impl Copy for DriverStatus
Auto Trait Implementations§
impl Freeze for DriverStatus
impl RefUnwindSafe for DriverStatus
impl Send for DriverStatus
impl Sync for DriverStatus
impl Unpin for DriverStatus
impl UnwindSafe for DriverStatus
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