Device driver for the Freescale MMA845x family of accelerometers.

Dependents:   MMA845x_test KL05_accel-test

Embed: (wiki syntax)

« Back to documentation index

MMA845x_DATA Class Reference

MMA845x_DATA Class Reference

Using the Sparkfun SEN-10955. More...

#include <MMA845x.h>

Public Member Functions

 MMA845x_DATA (uint16_t x=0, uint16_t y=0, uint16_t z=0)
 Create the MMA845x_DATA object initialized to the parameter (or 0 if none)
MMA845x_DATAoperator= (MMA845x_DATA const &rhs)
 Overloaded '=' operator to allow shorthand coding, assigning objects to one another.
MMA845x_DATAoperator= (uint16_t const val)
 Overloaded '=' operator to allow shorthand coding, assigning objects to one another.
bool operator== (MMA845x_DATA const &rhs) const
 Overloaded '==' operator to allow shorthand coding, test objects to one another.

Data Fields

volatile uint16_t _x
volatile uint16_t _y
volatile uint16_t _z

Detailed Description

Using the Sparkfun SEN-10955.

Example:

  #include "mbed.h"
  #include "MMA845x.h"


 
  int main() 
  {

  }

API abstraction for the MMA845x 3-axis accelerometer IC data

Definition at line 51 of file MMA845x.h.


Constructor & Destructor Documentation

MMA845x_DATA ( uint16_t  x = 0,
uint16_t  y = 0,
uint16_t  z = 0 
)

Create the MMA845x_DATA object initialized to the parameter (or 0 if none)

Parameters:
x- the init value of _x
y- the init value of _y
x- the init value of _z

Definition at line 64 of file MMA845x.h.


Member Function Documentation

MMA845x_DATA& operator= ( MMA845x_DATA const &  rhs )

Overloaded '=' operator to allow shorthand coding, assigning objects to one another.

Parameters:
rhs- an object of the same type to assign ourself the same values of
Returns:
this

Definition at line 70 of file MMA845x.h.

MMA845x_DATA& operator= ( uint16_t const   val )

Overloaded '=' operator to allow shorthand coding, assigning objects to one another.

Parameters:
val- Assign each data member (_x, _y, _z) this value
Returns:
this

Definition at line 83 of file MMA845x.h.

bool operator== ( MMA845x_DATA const &  rhs ) const

Overloaded '==' operator to allow shorthand coding, test objects to one another.

Parameters:
rhs- the object to compare against
Returns:
1 if the data members are the same and 0 otherwise

Definition at line 94 of file MMA845x.h.


Field Documentation

volatile uint16_t _x

volatile data variable

Definition at line 55 of file MMA845x.h.

volatile uint16_t _y

volatile data variable

Definition at line 56 of file MMA845x.h.

volatile uint16_t _z

volatile data variable

Definition at line 57 of file MMA845x.h.