pub struct Ka3005p { /* private fields */ }
Expand description
The power supply. The main object of the library.
Implementations§
source§impl Ka3005p
impl Ka3005p
sourcepub fn new(port_name: &str) -> Result<Self>
pub fn new(port_name: &str) -> Result<Self>
Create a power supply object from a serial port address.
sourcepub fn new_from_serial(serial: Box<dyn SerialPort>) -> Result<Self>
pub fn new_from_serial(serial: Box<dyn SerialPort>) -> Result<Self>
A convenience function to use if your power supply happens to be picky with the settings. Note the library defaults have fairly large margins so this should be unnecessary.
sourcepub fn execute(&mut self, command: Command) -> Result<()>
pub fn execute(&mut self, command: Command) -> Result<()>
Execute a command on the power supply. Note that these supplies do not return anything on a command so the result only indicates if the serial transfer was successful. You will need to check that status to make sure the power supply is now in the state you expect.
Auto Trait Implementations§
impl Freeze for Ka3005p
impl !RefUnwindSafe for Ka3005p
impl Send for Ka3005p
impl !Sync for Ka3005p
impl Unpin for Ka3005p
impl !UnwindSafe for Ka3005p
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