Expand description
Safe, Rusty driver for the EspoTek Labrador electronics lab board.
This crate provides direct access to the Labrador test board by
wrapping the librador driver library in a safe, Rusty API. The primary
entry point of the crate is the Labrador
struct.
The Labrador multiplexes a variety of peripherals through two
data buffers, so before you start to use it, you need to configure
the appropriate mode. See the mode
module for more details.
Examples
Find the Labrador board and get the firmware version
use librador::Labrador;
let mut labrador = match Labrador::find() {
Err(_) => panic!("Unable to find Labrador..."),
Ok(l) => l,
};
let variant = labrador.firmware_variant();
let version = labrador.firmware_version();
println!("Labrador found, variant {}, version {}", variant, version);
Set a digital output pin
use librador::Labrador;
let mut labrador = match Labrador::find() {
Err(_) => panic!("Unable to find Labrador..."),
Ok(l) => l,
};
labrador.digital_out_ch1().set_high();
Get recent digital data from the logic analyzer
use std::time::Duration;
use librador::Labrador;
let mut labrador = match Labrador::find() {
Err(_) => panic!("Unable to find Labrador..."),
Ok(l) => l,
};
let mut labrador = labrador.set_mode::<librador::mode::Mode3>();
let mut logic1 = labrador.logic_analyzer_ch1();
let data = logic1.data();
match data {
None => println!("Unable to get data!"),
Some(data) => println!("Data: {:?}", data),
}
Modules
Four channels of digital outputs.
The two channel logic analyzer.
Labrador mode control.
An arbitrary waveform generator.
Structs
A Labrador device.
Common configuration of sampling windows.
The specified voltage is not supported by the power supply.
Enums
An error arising during initialization.
Traits
One of the Labrador’s peripheral channels.