PropWare  3.0.0.229
C++ objects and CMake build system for Parallax Propeller
Classes | Namespaces
adxl345.h File Reference
#include <PropWare/serial/spi/spi.h>
+ Include dependency graph for adxl345.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  PropWare::ADXL345
 
union  PropWare::ADXL345::ActivityDetection
 Bit-mapping for Register::ACT_INACT_CTL. More...
 
union  PropWare::ADXL345::TapAxes
 Bit-mapping for Register::TAP_AXES. More...
 
union  PropWare::ADXL345::TapSource
 Bit-mapping for Register::TAP_SOURCE. More...
 
union  PropWare::ADXL345::RateAndPowerMode
 Bit-mapping for Register::RATE_AND_POWER_MODE. More...
 
union  PropWare::ADXL345::PowerControl
 Bit-mapping for Register::POWER_SAVINGS. More...
 
union  PropWare::ADXL345::InterruptEnable
 Bit-mapping for Register::INTERRUPT_ENABLE. More...
 
union  PropWare::ADXL345::InterruptMapping
 Bit-mapping for Register::INTERRUPT_MAPPING. More...
 
union  PropWare::ADXL345::InterruptSources
 Bit-mapping for Register::INTERRUPT_SOURCES. More...
 
union  PropWare::ADXL345::DataFormat
 Bit-mapping for Register::DATA_FORMAT. More...
 
union  PropWare::ADXL345::FIFOControl
 Bit-mapping for Register::FIFO_CONTROL. More...
 
union  PropWare::ADXL345::FIFOStatus
 Bit-mapping for Register::FIFO_STATUS. More...
 
struct  PropWare::ADXL345::ActivityDetection.fields
 
struct  PropWare::ADXL345::DataFormat.fields
 
struct  PropWare::ADXL345::FIFOControl.fields
 
struct  PropWare::ADXL345::FIFOStatus.fields
 
struct  PropWare::ADXL345::InterruptEnable.fields
 
struct  PropWare::ADXL345::InterruptMapping.fields
 
struct  PropWare::ADXL345::InterruptSources.fields
 
struct  PropWare::ADXL345::PowerControl.fields
 
struct  PropWare::ADXL345::RateAndPowerMode.fields
 
struct  PropWare::ADXL345::TapAxes.fields
 
struct  PropWare::ADXL345::TapSource.fields
 

Namespaces

 PropWare
 Generic definitions and functions for the Parallax Propeller.
 

Detailed Description

Author
David Zemon

Definition in file adxl345.h.


Class Documentation

◆ PropWare::ADXL345::ActivityDetection

union PropWare::ADXL345::ActivityDetection

Bit-mapping for Register::ACT_INACT_CTL.

Definition at line 299 of file adxl345.h.

+ Collaboration diagram for PropWare::ADXL345::ActivityDetection:
Class Members
struct ActivityDetection fields
uint8_t raw

◆ PropWare::ADXL345::TapAxes

union PropWare::ADXL345::TapAxes

Bit-mapping for Register::TAP_AXES.

Definition at line 324 of file adxl345.h.

+ Collaboration diagram for PropWare::ADXL345::TapAxes:
Class Members
struct TapAxes fields
uint8_t raw

◆ PropWare::ADXL345::TapSource

union PropWare::ADXL345::TapSource

Bit-mapping for Register::TAP_SOURCE.

Definition at line 344 of file adxl345.h.

+ Collaboration diagram for PropWare::ADXL345::TapSource:
Class Members
struct TapSource fields
uint8_t raw

◆ PropWare::ADXL345::RateAndPowerMode

union PropWare::ADXL345::RateAndPowerMode

Bit-mapping for Register::RATE_AND_POWER_MODE.

Definition at line 367 of file adxl345.h.

+ Collaboration diagram for PropWare::ADXL345::RateAndPowerMode:
Class Members
struct RateAndPowerMode fields
uint8_t raw

◆ PropWare::ADXL345::PowerControl

union PropWare::ADXL345::PowerControl

Bit-mapping for Register::POWER_SAVINGS.

Definition at line 385 of file adxl345.h.

+ Collaboration diagram for PropWare::ADXL345::PowerControl:
Class Members
struct PowerControl fields
uint8_t raw

◆ PropWare::ADXL345::InterruptEnable

union PropWare::ADXL345::InterruptEnable

Bit-mapping for Register::INTERRUPT_ENABLE.

Definition at line 432 of file adxl345.h.

+ Collaboration diagram for PropWare::ADXL345::InterruptEnable:
Class Members
struct InterruptEnable fields
uint8_t raw

◆ PropWare::ADXL345::InterruptMapping

union PropWare::ADXL345::InterruptMapping

Bit-mapping for Register::INTERRUPT_MAPPING.

Definition at line 449 of file adxl345.h.

+ Collaboration diagram for PropWare::ADXL345::InterruptMapping:
Class Members
struct InterruptMapping fields
uint8_t raw

◆ PropWare::ADXL345::InterruptSources

union PropWare::ADXL345::InterruptSources

Bit-mapping for Register::INTERRUPT_SOURCES.

Definition at line 490 of file adxl345.h.

+ Collaboration diagram for PropWare::ADXL345::InterruptSources:
Class Members
struct InterruptSources fields
uint8_t raw

◆ PropWare::ADXL345::DataFormat

union PropWare::ADXL345::DataFormat

Bit-mapping for Register::DATA_FORMAT.

Definition at line 507 of file adxl345.h.

+ Collaboration diagram for PropWare::ADXL345::DataFormat:
Class Members
struct DataFormat fields
uint8_t raw

◆ PropWare::ADXL345::FIFOControl

union PropWare::ADXL345::FIFOControl

Bit-mapping for Register::FIFO_CONTROL.

Definition at line 543 of file adxl345.h.

+ Collaboration diagram for PropWare::ADXL345::FIFOControl:
Class Members
struct FIFOControl fields
uint8_t raw

◆ PropWare::ADXL345::FIFOStatus

union PropWare::ADXL345::FIFOStatus

Bit-mapping for Register::FIFO_STATUS.

Definition at line 568 of file adxl345.h.

+ Collaboration diagram for PropWare::ADXL345::FIFOStatus:
Class Members
struct FIFOStatus fields
uint8_t raw

◆ PropWare::ADXL345::ActivityDetection.fields

struct PropWare::ADXL345::ActivityDetection.fields

Definition at line 300 of file adxl345.h.

Class Members
unsigned int activeAcDc: 1

Select between ac-coupled and dc-couple operation. Low for dc-coupled, high for ac-coupled.

unsigned int activeXEnable: 1

Enable x-axis participation in detecting activity

unsigned int activeYEnable: 1

Enable y-axis participation in detecting activity

unsigned int activeZEnable: 1

Enable z-axis participation in detecting activity

unsigned int inactiveAcDc: 1

Select between ac-coupled and dc-couple operation. Low for dc-coupled, high for ac-coupled.

unsigned int inactiveXEnable: 1

Enable x-axis participation in detecting inactivity

unsigned int inactiveYEnable: 1

Enable y-axis participation in detecting inactivity

unsigned int inactiveZEnable: 1

Enable z-axis participation in detecting inactivity

◆ PropWare::ADXL345::DataFormat.fields

struct PropWare::ADXL345::DataFormat.fields

Definition at line 508 of file adxl345.h.

Class Members
unsigned int fullResolution: 1

When set high, the resolution will always be 4 mg/LSB no matter the range. When set low, the resolution will change with the range and the data will remain 10 bits wide.

unsigned int invertedInterrupts: 1

When set high, interrupts will be active high instead of active low.

unsigned int justify: 1

When set high, data will be left (MSB) justified. When cleared low, it will be right justified and sign extended.

Range range: 2

Data range of the device

unsigned int selfTest

Setting high will enable self-test mode, causing a shift in the output data. Cleared low for normal operation.

unsigned int spiMode

When set high, the device will work in 3-wire SPI mode. Cleared low for 4-wire SPI mode.

◆ PropWare::ADXL345::FIFOControl.fields

struct PropWare::ADXL345::FIFOControl.fields

Definition at line 544 of file adxl345.h.

Class Members
FIFOMode fifoMode: 2

Set the mode that the FIFO will assume.

unsigned int samples: 5

The function of these bits depends on the FIFO mode selected via FIFOContro::fifoMode. Entering a value of 0 in the samples bits immediately sets the watermark status bit in Register::INTERRUPT_SOURCE, regardless of which FIFO mode is selected. Undesirable operation may occur if a value of 0 is used for the samples bits when trigger mode is used.

unsigned int trigger: 1

Clear low to link the trigger event of trigger mode to INT1, and set high to link the trigger event to INT2.

◆ PropWare::ADXL345::FIFOStatus.fields

struct PropWare::ADXL345::FIFOStatus.fields

Definition at line 569 of file adxl345.h.

Class Members
unsigned int entries: 6

These bits report how many data values are stored in FIFO.

unsigned int fifoTrigger: 1

Set high when a trigger event is occurring. Cleared low otherwise.

unsigned int unused: 1

Unused bit

◆ PropWare::ADXL345::InterruptEnable.fields

struct PropWare::ADXL345::InterruptEnable.fields

Definition at line 433 of file adxl345.h.

Class Members
unsigned int activity: 1

Enable interrupt generation for the activity event

unsigned int dataReady: 1

Enable interrupt generation for the data ready event

unsigned int doubleTap: 1

Enable interrupt generation for the double tap event

unsigned int freeFall: 1

Enable interrupt generation for the free fall event

unsigned int inactivity: 1

Enable interrupt generation for the inactivity event

unsigned int overrun: 1

Enable interrupt generation for the overrun event

unsigned int singleTap: 1

Enable interrupt generation for the single tap event

unsigned int watermark: 1

Enable interrupt generation for the watermark event

◆ PropWare::ADXL345::InterruptMapping.fields

struct PropWare::ADXL345::InterruptMapping.fields

Definition at line 450 of file adxl345.h.

Class Members
unsigned int activity: 1

When set high, the activity event will be mapped to pin INT1, otherwise INT0.

unsigned int dataReady: 1

When set high, the data ready event will be mapped to pin INT1, otherwise INT0.

unsigned int doubleTap: 1

When set high, the double tap event will be mapped to pin INT1, otherwise INT0.

unsigned int freeFall: 1

When set high, the free fall event will be mapped to pin INT1, otherwise INT0.

unsigned int inactivity: 1

When set high, the inactivity event will be mapped to pin INT1, otherwise INT0.

unsigned int overrun: 1

When set high, the overrun event will be mapped to pin INT1, otherwise INT0.

unsigned int singleTap: 1

When set high, the single tap event will be mapped to pin INT1, otherwise INT0.

unsigned int watermark: 1

When set high, the watermark event will be mapped to pin INT1, otherwise INT0.

◆ PropWare::ADXL345::InterruptSources.fields

struct PropWare::ADXL345::InterruptSources.fields

Definition at line 491 of file adxl345.h.

Class Members
unsigned int activity: 1

When set, an activity event has occurred.

unsigned int dataReady: 1

When set, a data ready event has occurred.

unsigned int doubleTap: 1

When set, a double tap event has occurred.

unsigned int freeFall: 1

When set, a free fall event has occurred.

unsigned int inactivity: 1

When set, an inactivity event has occurred.

unsigned int overrun: 1

When set, an overrun event has occurred.

unsigned int singleTap: 1

When set, a single tap event has occurred.

unsigned int watermark: 1

When set, a watermark event has occurred.

◆ PropWare::ADXL345::PowerControl.fields

struct PropWare::ADXL345::PowerControl.fields

Definition at line 386 of file adxl345.h.

Class Members
unsigned int autoSleep: 1

When set high, the device will automatically enter a low-power sleep mode any time the sampled activity dips below the threshold configured via Register::INACTIVITY_THRESHOLD for at least the amount of time configured via Register::INACTIVITY_TIME. Clearing the bit low will disable automatic sleep mode.

When clearing the AUTO_SLEEP bit, it is recommended that the part be placed into standby mode and then set back to measurement mode with a subsequent write. This is done to ensure that the device is properly biased if sleep mode is manually disabled; otherwise, the first few samples of data after the AUTO_SLEEP bit is cleared may have additional noise, especially if the device was asleep when the bit was cleared.

unsigned int link: 1

Set high to enable linked mode and clear low for concurrent functionality of inactivity and activity functions. See the datasheet for a far more verbose explanation.

unsigned int measure: 1

Set high for normal operation and low for standby mode. When in standby mode, power consumption is at a minimum but now measurements can be made. The device is booted in standby mode.

unsigned int sleep: 1

When set high, the device will be put into sleep mode. Low for normal operation. While in sleep mode, the device's sample rate is set by PowerControl::wakeup.

When clearing the sleep bit, it is recommended that the part be placed into standby mode and then set back to measurement mode with a subsequent write. This is done to ensure that the device is properly biased if sleep mode is manually disabled; otherwise, the first few samples of data after the sleep bit is cleared may have additional noise, especially if the device was asleep when the bit was cleared

WakeupFrequency wakeup: 2

Frequency of reading when in sleep mode

◆ PropWare::ADXL345::RateAndPowerMode.fields

struct PropWare::ADXL345::RateAndPowerMode.fields

Definition at line 368 of file adxl345.h.

Class Members
DataRate dataRate: 3

Set the data polling rate.

unsigned int lowPowerMode: 1

Enable or disable low-power mode. Low power mode has a somewhat higher noise but reduces power consumption. True to enable low power mode, false for normal operation.

◆ PropWare::ADXL345::TapAxes.fields

struct PropWare::ADXL345::TapAxes.fields

Definition at line 325 of file adxl345.h.

Class Members
unsigned int suppress: 1

When set high, suppress double-tap detection for too high of an acceleration (as set per Register::TAP_THRESHOLD)

unsigned int tapXEnable: 1

Enable x-axis participation in tap detection

unsigned int tapYEnable: 1

Enable y-axis participation in tap detection

unsigned int tapZEnable: 1

Enable z-axis participation in tap detection

◆ PropWare::ADXL345::TapSource.fields

struct PropWare::ADXL345::TapSource.fields

Definition at line 345 of file adxl345.h.

Class Members
unsigned int asleep: 1

When set, the device is sleeping

unsigned int xActivity: 1

When set, activity was detected on the x-axis

unsigned int xTapped: 1

When set, a tap was detected on the x-axis

unsigned int yActivity: 1

When set, activity was detected on the y-axis

unsigned int yTapped: 1

When set, a tap was detected on the y-axis

unsigned int zActivity: 1

When set, activity was detected on the z-axis

unsigned int zTapped: 1

When set, a tap was detected on the z-axis