Analog Devices ADXL355 Component
Installation
The component requires ESP-IDF 5.3 and higher and is installed using IDF Component Manager.
Add this to the idf_component.yml
in the project main
directory or in the component directory:
dependencies:
plasmapper/pl_adxl355: "^1.0.0"
Add this to the source code:
#include "pl_adxl355.h"
Add extern "C"
to the app_main
function:
extern "C" void app_main(void) {...}
Add this to the sdkconfig.defaults
in the project directory or configure the values using Project Configuration:
CONFIG_COMPILER_CXX_RTTI=y
Functions
Initialization
Range Configuration and Scale Factor
PL::Adxl355::ReadRange()
, PL::Adxl355::SetRange()
, PL::Adxl355::ReadAccelerationScaleFactor()
.
Measurement Frequency Configuration
PL::Adxl355::ReadOutputDataRate()
, PL::Adxl355::SetOutputDataRate()
.
Measurement Enable/Disable
Use PL::Adxl355::EnableMeasurement()
, PL::Adxl355::DisableMeasurement()
,
PL::Adxl355::IsMeasurementEnabled()
.
Single Measurement
PL::Adxl355::ReadAccelerations()
/PL::Adxl355::ReadRawAccelerations()
.
Waveform Measurement
PL::Adxl355::ReadNumberOfFifoSamples()
, PL::Adxl355::ClearFifo()
,
PL::Adxl355::ReadAccelerationsFromFifo()
/PL::Adxl355::ReadRawAccelerationsFromFifo()
.
Offset Configuration
PL::Adxl355::ReadOffsets()
/PL::Adxl355::ReadRawOffsets()
,
PL::Adxl355::SetOffsets()
/PL::Adxl355::SetRawOffsets()
.
Activity Detection
PL::Adxl355::ReadActivityDetectionAxes()
, PL::Adxl355::SetActivityDetectionAxes()
,
PL::Adxl355::ReadActivityDetectionThreshold()
/PL::Adxl355::ReadRawActivityDetectionThreshold()
,
PL::Adxl355::SetActivityDetectionThreshold()
/PL::Adxl355::SetRawActivityDetectionThreshold()
,
PL::Adxl355::ReadActivityDetectionCount()
, PL::Adxl355::SetActivityDetectionCount()
.
Temperature Measurement
PL::Adxl355::EnableTemperature()
, PL::Adxl355::DisableTemperature()
,
PL::Adxl355::IsTemperatureEnabled()
,
PL::Adxl355::ReadTemperature()
/PL::Adxl355::ReadRawTemperature()
.
Interrupt Configuration
PL::Adxl355::ReadInterrupts()
, PL::Adxl355::SetInterrupts()
.
Device Information and Status
Self-test and Reset
Other
PL::Adxl355::ReadHpfFrequency()
, PL::Adxl355::SetHpfFrequency()
,
PL::Adxl355::ReadFifoWatermark()
, PL::Adxl355::SetFifoWatermark()
,
PL::Adxl355::ReadSynchronization()
, PL::Adxl355::SetSynchronization()
,
PL::Adxl355::EnableExternalClock()
, PL::Adxl355::DisableExternalClock()
,
PL::Adxl355::IsExternalClockEnabled()
PL::Adxl355::ReadInterruptPolarity()
, PL::Adxl355::SetInterruptPolarity()
,
PL::Adxl355::ReadI2CSpeed()
, PL::Adxl355::SetI2CSpeed()
,
PL::Adxl355::EnableDataReady()
, PL::Adxl355::DisableDataReady()
,
PL::Adxl355::IsDataReadyEnabled()
.
Thread safety
Class method thread safety is implemented by having the PL::Lockable
as a base class and creating the class object lock guard at the beginning of the methods.
PL::Adxl355::Initialize()
and all transaction methods lock both
the PL::Adxl355
and the PL::Spi
objects for the duration of the method.
Examples
API reference
- PL::Adxl355 class
Adxl355
Adxl355::Adxl355()
Adxl355::Lock()
Adxl355::Unlock()
Adxl355::Initialize()
Adxl355::ReadDeviceInfo()
Adxl355::ReadStatus()
Adxl355::ReadNumberOfFifoSamples()
Adxl355::ReadRawTemperature()
Adxl355::ReadTemperature()
Adxl355::ReadRawAccelerations()
Adxl355::ReadAccelerations()
Adxl355::ClearFifo()
Adxl355::ReadRawAccelerationsFromFifo()
Adxl355::ReadAccelerationsFromFifo()
Adxl355::ReadRawOffsets()
Adxl355::ReadOffsets()
Adxl355::SetRawOffsets()
Adxl355::SetOffsets()
Adxl355::ReadActivityDetectionAxes()
Adxl355::SetActivityDetectionAxes()
Adxl355::ReadRawActivityDetectionThreshold()
Adxl355::ReadActivityDetectionThreshold()
Adxl355::SetRawActivityDetectionThreshold()
Adxl355::SetActivityDetectionThreshold()
Adxl355::ReadActivityDetectionCount()
Adxl355::SetActivityDetectionCount()
Adxl355::ReadHpfFrequency()
Adxl355::SetHpfFrequency()
Adxl355::ReadOutputDataRate()
Adxl355::SetOutputDataRate()
Adxl355::ReadFifoWatermark()
Adxl355::SetFifoWatermark()
Adxl355::ReadInterrupts()
Adxl355::SetInterrupts()
Adxl355::ReadSynchronization()
Adxl355::SetSynchronization()
Adxl355::EnableExternalClock()
Adxl355::DisableExternalClock()
Adxl355::IsExternalClockEnabled()
Adxl355::ReadRange()
Adxl355::ReadAccelerationScaleFactor()
Adxl355::SetRange()
Adxl355::ReadInterruptPolarity()
Adxl355::SetInterruptPolarity()
Adxl355::ReadI2CSpeed()
Adxl355::SetI2CSpeed()
Adxl355::EnableMeasurement()
Adxl355::DisableMeasurement()
Adxl355::IsMeasurementEnabled()
Adxl355::EnableTemperature()
Adxl355::DisableTemperature()
Adxl355::IsTemperatureEnabled()
Adxl355::EnableDataReady()
Adxl355::DisableDataReady()
Adxl355::IsDataReadyEnabled()
Adxl355::SelfTest()
Adxl355::Reset()
Adxl355::defaultSpiFrequency
Adxl355::temperatureInterceptLsb
Adxl355::temperatureInterceptDegC
Adxl355::temperatureSlope
Adxl355::accelerationScaleFactorRange2G
Adxl355::accelerationScaleFactorRange4G
Adxl355::accelerationScaleFactorRange8G
Adxl355::maxNumberOfFifoSamples