#include <ND015A.h>
|
| ND015A (SPIBusInterface &bus, miosix::GpioPin cs, SPIBusConfig spiConfig, DMAStreamGuard *streamRx, DMAStreamGuard *streamTx, std::chrono::nanoseconds timeoutDma, IOWatchdogEnable iow=IOWatchdogEnable::DISABLED, BWLimitFilter bwl=BWLimitFilter::BWL_200, NotchEnable ntc=NotchEnable::ENABLED, uint8_t odr=0x1C) |
| Constructor for the ND015A sensor.
|
|
| ND015A (SPIBusInterface &bus, miosix::GpioPin cs, SPIBusConfig spiConfig, IOWatchdogEnable iow=IOWatchdogEnable::DISABLED, BWLimitFilter bwl=BWLimitFilter::BWL_200, NotchEnable ntc=NotchEnable::ENABLED, uint8_t odr=0x1C) |
| Constructor for the ND015A sensor.
|
|
bool | init () override |
| Initializes the sensor.
|
|
bool | selfTest () override |
| Not implemented.
|
|
void | setOutputDataRate (uint8_t odr) |
| function to set the output data rate
|
|
void | setIOWatchdog (IOWatchdogEnable iow) |
| function to enable the IO watchdog
|
|
void | setBWLimitFilter (BWLimitFilter bwl) |
| Sets the bandwidth limit filter for the sensor.
|
|
void | setNotch (NotchEnable ntc) |
| Enables or disables the notch filter.
|
|
bool | checkModelMatch () |
| Checks if the sensor model matches the expected model.
|
|
void | setOffset (float offset) |
| Set the offset of this sensor. The offset is stored as a int16_t and can be both postive or negative.
|
|
void | updateOffset (float offset) |
| Modify the offset of this sensor. The offset is stored as a int16_t and can be both postive or negative.
|
|
float | getOffset () |
| Get the current offset of this sensor. The offset is stored as a int16_t and can be both postive or negative.
|
|
| Sensor () |
|
| Sensor (Sensor &&other) |
|
virtual | ~Sensor () |
|
void | sample () override |
| Sample the sensor.
|
|
virtual ND015XData | getLastSample () |
|
virtual | ~AbstractSensor () |
|
SensorErrors | getLastError () |
| Get last error for debugging purposes. Avoid silent fails.
|
|
|
ND015XData | sampleImpl () override |
| Read a data sample from the sensor. In case of errors, the method should return the last available correct sample.
|
|
Definition at line 35 of file ND015A.h.
◆ BWLimitFilter
Enumerator |
---|
BWL_1 | |
BWL_2 | |
BWL_5 | |
BWL_10 | |
BWL_20 | |
BWL_50 | |
BWL_100 | |
BWL_200 | |
Definition at line 47 of file ND015A.h.
◆ IOWatchdogEnable
Enumerator |
---|
DISABLED | |
ENABLED | |
Definition at line 41 of file ND015A.h.
◆ NotchEnable
Enumerator |
---|
DISABLED | |
ENABLED | |
Definition at line 59 of file ND015A.h.
◆ ND015A() [1/2]
Constructor for the ND015A sensor.
- Parameters
-
bus | SPI bus interface. |
cs | Chip select GPIO pin. |
spiConfig | SPI bus configuration. |
streamRx | Dma receiving stream for the spi bus. |
streamTx | Dma transmitting stream for the spi bus. |
timeoutDma | Timeout for the dma transactions. |
Definition at line 52 of file ND015A.cpp.
◆ ND015A() [2/2]
Constructor for the ND015A sensor.
- Parameters
-
bus | SPI bus interface. |
cs | Chip select GPIO pin. |
spiConfig | SPI bus configuration. |
Definition at line 61 of file ND015A.cpp.
◆ checkModelMatch()
bool Boardcore::ND015A::checkModelMatch |
( |
| ) |
|
Checks if the sensor model matches the expected model.
- Returns
- True if the model matches, false otherwise.
- Warning
- The function might return false even when it should not as the SPI transaction sometimes ads some zeroes when it should not. This is because the sensore requires a clock cycle greater than the one we can provide
Definition at line 90 of file ND015A.cpp.
◆ getDefaultSPIConfig()
◆ getOffset()
float Boardcore::ND015A::getOffset |
( |
| ) |
|
Get the current offset of this sensor. The offset is stored as a int16_t and can be both postive or negative.
Definition at line 167 of file ND015A.cpp.
◆ init()
bool Boardcore::ND015A::init |
( |
| ) |
|
|
overridevirtual |
◆ 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< ND015XData >.
Definition at line 169 of file ND015A.cpp.
◆ selfTest()
bool Boardcore::ND015A::selfTest |
( |
| ) |
|
|
overridevirtual |
◆ setBWLimitFilter()
Sets the bandwidth limit filter for the sensor.
- Parameters
-
bwl | Bandwidth limit filter setting. |
Definition at line 143 of file ND015A.cpp.
◆ setIOWatchdog()
function to enable the IO watchdog
- Parameters
-
Definition at line 132 of file ND015A.cpp.
◆ setNotch()
Enables or disables the notch filter.
- Parameters
-
Definition at line 154 of file ND015A.cpp.
◆ setOffset()
void Boardcore::ND015A::setOffset |
( |
float |
offset | ) |
|
Set the offset of this sensor. The offset is stored as a int16_t and can be both postive or negative.
- Parameters
-
The | value the offset should be set to |
Definition at line 165 of file ND015A.cpp.
◆ setOutputDataRate()
void Boardcore::ND015A::setOutputDataRate |
( |
uint8_t |
odr | ) |
|
function to set the output data rate
- Parameters
-
odr | output data rate for the sensor, the actual odr is calculated as 444Hz / odr. Allowed values are 0x00 to 0xFF, 0x00 will select the auto-select rate mode |
Definition at line 121 of file ND015A.cpp.
◆ updateOffset()
void Boardcore::ND015A::updateOffset |
( |
float |
offset | ) |
|
Modify the offset of this sensor. The offset is stored as a int16_t and can be both postive or negative.
- Parameters
-
The | value to be added to the current offset |
Definition at line 166 of file ND015A.cpp.
◆ bwl
◆ fsr
uint8_t Boardcore::ND015A::fsr |
◆ FULLSCALE
const int Boardcore::ND015A::FULLSCALE = 15 |
|
static |
◆ iow
◆ MODEL_NAME
const char Boardcore::ND015A::MODEL_NAME = "ND015A" |
|
static |
◆ ntc
◆ odr
uint8_t Boardcore::ND015A::odr |
The documentation for this class was generated from the following files: