#include <L3GD20.h>
|
| L3GD20 (SPIBusInterface &bus, miosix::GpioPin cs, FullScaleRange range=FullScaleRange::FS_250, OutPutDataRate odr=OutPutDataRate::ODR_95, uint8_t cutoffFreq=0x03) |
| Creates an instance of an L3GD20 sensor.
|
|
| L3GD20 (SPIBusInterface &bus, miosix::GpioPin cs, SPIBusConfig cfg, FullScaleRange range=FullScaleRange::FS_250, OutPutDataRate odr=OutPutDataRate::ODR_95, uint8_t cutoffFreq=0x03) |
| Creates an instance of an L3GD20 sensor.
|
|
void | enableFifo (unsigned int fifoWatermark) |
| Enables storing samples in a FIFO, must be called before init().
|
|
bool | init () |
| Initialize the sensor.
|
|
bool | selfTest () |
| Check if the sensor is working.
|
|
L3GD20Data | sampleImpl () |
| Read a data sample from the sensor. In case of errors, the method should return the last available correct sample.
|
|
| SensorFIFO () |
|
| SensorFIFO (SensorFIFO &&other) |
|
const std::array< L3GD20Data, FifoSize > | getLastFifo (uint16_t &lastFifoSize) |
|
virtual void | IRQupdateTimestamp (uint64_t ts) |
| Called by the interrupt handling routine: provides the timestamp of the last interrupt (if FIFO is disabled) or the last watermark interrupt (if FIFO enabled)
|
|
| Sensor () |
|
| Sensor (Sensor &&other) |
|
virtual | ~Sensor () |
|
void | sample () override |
| Sample the sensor.
|
|
virtual Data | getLastSample () |
|
virtual | ~AbstractSensor () |
|
SensorErrors | getLastError () |
| Get last error for debugging purposes. Avoid silent fails.
|
|
Definition at line 41 of file L3GD20.h.
◆ FullScaleRange
Enumerator |
---|
FS_250 | |
FS_500 | |
FS_2000 | |
Definition at line 44 of file L3GD20.h.
◆ OutPutDataRate
Enumerator |
---|
ODR_95 | |
ODR_190 | |
ODR_380 | |
ODR_760 | |
Definition at line 51 of file L3GD20.h.
◆ L3GD20() [1/2]
Creates an instance of an L3GD20 sensor.
- Parameters
-
bus | SPI bus the sensor is connected to |
cs | Chip Select GPIO |
range | Full Scale Range (See datasheet) |
odr | Output Data Rate (See datasheet) |
cutoffFreq | Low pass filter cutoff frequency (See datasheet) |
Definition at line 68 of file L3GD20.h.
◆ L3GD20() [2/2]
Creates an instance of an L3GD20 sensor.
- Parameters
-
bus | SPI bus the sensor is connected to |
cs | Chip Select GPIO |
cfg | Custom SPI bus configuration |
range | Full Scale Range (See datasheet) |
odr | Output Data Rate (See datasheet) |
cutoffFreq | Low pass filter cutoff selector (See datasheet) |
Definition at line 88 of file L3GD20.h.
◆ enableFifo()
void Boardcore::L3GD20::enableFifo |
( |
unsigned int | fifoWatermark | ) |
|
|
inline |
Enables storing samples in a FIFO, must be called before init().
- Parameters
-
fifoWatermark | How many samples in the FIFO when the fifo watermark input is generated on INT2. |
Definition at line 114 of file L3GD20.h.
◆ init()
bool Boardcore::L3GD20::init |
( |
| ) |
|
|
inlinevirtual |
◆ sampleImpl()
Read a data sample from the sensor. In case of errors, the method should return the last available correct sample.
- Returns
- sensor data sample
Implements Boardcore::Sensor< Data >.
Definition at line 198 of file L3GD20.h.
◆ selfTest()
bool Boardcore::L3GD20::selfTest |
( |
| ) |
|
|
inlinevirtual |
Check if the sensor is working.
- Returns
- boolean indicating whether the sensor is correctly working or not
Implements Boardcore::AbstractSensor.
Definition at line 196 of file L3GD20.h.
The documentation for this class was generated from the following file: