Struct l3gd20::L3gd20
[−]
[src]
pub struct L3gd20<SPI, CS> { /* fields omitted */ }
L3GD20 driver
Methods
impl<SPI, CS, E> L3gd20<SPI, CS> where
SPI: Transfer<u8, Error = E> + Write<u8, Error = E>,
CS: OutputPin,
[src]
SPI: Transfer<u8, Error = E> + Write<u8, Error = E>,
CS: OutputPin,
pub fn new(spi: SPI, cs: CS) -> Result<Self, E>
[src]
Creates a new driver from a SPI peripheral and a NCS pin
pub fn all(&mut self) -> Result<Measurements, E>
[src]
Temperature measurement + gyroscope measurements
pub fn gyro(&mut self) -> Result<I16x3, E>
[src]
Gyroscope measurements
pub fn temp(&mut self) -> Result<i8, E>
[src]
Temperature sensor measurement
pub fn who_am_i(&mut self) -> Result<u8, E>
[src]
Reads the WHO_AM_I register; should return 0xD4
pub fn status(&mut self) -> Result<Status, E>
[src]
Read STATUS_REG
of sensor
pub fn odr(&mut self) -> Result<Odr, E>
[src]
Get the current Output Data Rate
pub fn set_odr(&mut self, odr: Odr) -> Result<&mut Self, E>
[src]
Set the Output Data Rate
pub fn bandwidth(&mut self) -> Result<Bandwidth, E>
[src]
Get current Bandwidth
pub fn set_bandwidth(&mut self, bw: Bandwidth) -> Result<&mut Self, E>
[src]
Set low-pass cut-off frequency (i.e. bandwidth)
See Bandwidth
for further explanation
pub fn scale(&mut self) -> Result<Scale, E>
[src]
Get the current Full Scale Selection
This is the sensitivity of the sensor, see Scale
for more information
pub fn set_scale(&mut self, scale: Scale) -> Result<&mut Self, E>
[src]
Set the Full Scale Selection
This sets the sensitivity of the sensor, see Scale
for more
information