pub enum DeviceCommand {
Show 29 variants
Start,
Pause,
Terminate,
Restart,
GetStatus,
SetDigitalOutput {
pin: u32,
value: bool,
},
SetAnalogOutput {
pin: u32,
value: u32,
},
SetPwmDuty {
channel: usize,
duty: u32,
},
ConfigureServo {
pin: u8,
config: ServoConfig,
},
SetServoAngle {
pin: u8,
angle: f32,
},
SetServoSpeed {
pin: u8,
speed: f32,
},
StopServo {
pin: u8,
},
I2cWrite {
address: u8,
data: Vec<u8>,
},
I2cRead {
address: u8,
length: u8,
},
I2cWriteRead {
address: u8,
write_data: Vec<u8>,
read_length: u8,
},
I2cScan,
ConfigureUSPIBridge {
config: USPIBridgeConfig,
},
USPIBridgeCommand {
command: Vec<u8>,
},
SetDigitalOutputsBulk {
pin_states: Vec<(u32, bool)>,
},
SetPwmDutiesBulk {
channel_duties: Vec<(usize, u32)>,
},
ReadAnalogInputsBulk {
pins: Vec<u32>,
},
CheckPinCapability {
pin: u8,
capability: String,
},
ValidatePinOperation {
pin: u8,
operation: String,
},
ConfigureEncoder {
encoder_index: u32,
pin_a: u32,
pin_b: u32,
enabled: bool,
sampling_4x: bool,
},
ResetDigitalCounter {
pin: u32,
},
SetPinFunction {
pin: u32,
pin_function: PinFunction,
},
Custom {
request_type: u8,
param1: u8,
param2: u8,
param3: u8,
param4: u8,
},
SetLogLevel(LevelFilter),
UpdateModel(DeviceModel),
}Expand description
Commands that can be sent to device threads
Variants§
Start
Start the device thread
Pause
Pause the device thread
Terminate
Terminate the device thread
Restart
Restart the device thread
GetStatus
Get the current status of the device thread
SetDigitalOutput
Set a digital output pin
SetAnalogOutput
Set an analog output
SetPwmDuty
Set PWM duty cycle
ConfigureServo
Configure a servo
SetServoAngle
Set servo angle
SetServoSpeed
Set servo speed
StopServo
Stop servo
I2cWrite
I2C write operation
I2cRead
I2C read operation
I2cWriteRead
I2C write then read operation
I2cScan
I2C bus scan
ConfigureUSPIBridge
Configure uSPIBridge
Fields
§
config: USPIBridgeConfigUSPIBridgeCommand
Send uSPIBridge command
SetDigitalOutputsBulk
Bulk set digital outputs
SetPwmDutiesBulk
Bulk set PWM duty cycles
ReadAnalogInputsBulk
Bulk read analog inputs
CheckPinCapability
Check pin capability
ValidatePinOperation
Validate pin operation
ConfigureEncoder
Configure an encoder
ResetDigitalCounter
Reset a digital counter
SetPinFunction
Set pin function
Custom
Custom command with raw parameters
SetLogLevel(LevelFilter)
Set log level
UpdateModel(DeviceModel)
Update device model
Trait Implementations§
Source§impl Clone for DeviceCommand
impl Clone for DeviceCommand
Source§fn clone(&self) -> DeviceCommand
fn clone(&self) -> DeviceCommand
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 moreAuto Trait Implementations§
impl Freeze for DeviceCommand
impl RefUnwindSafe for DeviceCommand
impl Send for DeviceCommand
impl Sync for DeviceCommand
impl Unpin for DeviceCommand
impl UnwindSafe for DeviceCommand
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