AEM
YADXL345 Class Reference

#include <adxl345.h>

Inheritance diagram for YADXL345:
YADC

Public Member Functions

 YADXL345 (const YSPI *const y)
 
float acquireChannel (uint8_t channel)
 
bool selftest (void)
 
- Public Member Functions inherited from YADC
 YADC (const YSPI *const y)
 

Protected Member Functions

void powerOn () const
 
void writeToSPI (byte __reg_address, byte __val) const
 
void readFromSPI (byte __reg_address, int num, byte _buff[]) const
 
void setRegisterBit (byte regAdress, int bitPos, bool state) const
 
void setSpiBit (bool spiBit) const
 
void setRangeSetting (int val) const
 
void readAccel (int *x, int *y, int *z)
 
- Protected Member Functions inherited from YADC
void selfTestFailed () const
 

Protected Attributes

byte _buff [ADXL345_TO_READ]
 
float gains [3]
 
- Protected Attributes inherited from YADC
const YSPI *const yspi = NULL
 

Detailed Description

Represents the ADXL345, acts like an ADC with 3 channels and 16 bit resolution. Encapsulates tha Adafruit driver and integrates YSPI functionality

Constructor & Destructor Documentation

YADXL345::YADXL345 ( const YSPI *const  y)

Member Function Documentation

float YADXL345::acquireChannel ( uint8_t  channel)
virtual

0=x, 1=y, 2=z : see getEvent for multipliers !!!

Implements YADC.

void YADXL345::powerOn ( ) const
protected
void YADXL345::readAccel ( int *  x,
int *  y,
int *  z 
)
protected
void YADXL345::readFromSPI ( byte  __reg_address,
int  num,
byte  _buff[] 
) const
protected
bool YADXL345::selftest ( void  )
virtual

0=x, 1=y, 2=z

Implements YADC.

void YADXL345::setRangeSetting ( int  val) const
protected
void YADXL345::setRegisterBit ( byte  regAdress,
int  bitPos,
bool  state 
) const
protected
void YADXL345::setSpiBit ( bool  spiBit) const
protected
void YADXL345::writeToSPI ( byte  __reg_address,
byte  __val 
) const
protected

Field Documentation

byte YADXL345::_buff[ADXL345_TO_READ]
protected
float YADXL345::gains[3]
protected

The documentation for this class was generated from the following files: