# hal_vti_cma3000_D01_accelerometer.c File Reference

Hardware Abstraction Layer (HAL) support file for VTI Technologies CMA3000-D01 Accelerometer. More...

`#include "../HAL/hal.h"`

## Functions
unsigned char | readAccelerometerRegister (unsigned char reg)
unsigned char | writeAccelerometerRegister (unsigned char reg, unsigned char data)
char * | getAccelerometerInterruptReason (unsigned char interruptReason)

## Detailed Description

Hardware Abstraction Layer (HAL) support file for VTI Technologies CMA3000-D01 Accelerometer.

Note:
  ACCELEROMETER_RX_BUF and ACCELEROMETER_SS_SET and ACCELEROMETER_SS_CLEAR, and spiWriteAccelerometer() must be defined

See also:
  VTI Technologies document: CMA3000-D01 datasheet
  VTI Technologies document: Product Family Specification, CMA3000-D0X Series 3-axis accelerometer
  VTI Technologies document: Interfacing CMA3000-D01 to an MSP430 ultra low-power microcontroller

Rev
  545

Author
  dsmith

Date
  2010-05-27 17:09:05 -0700 (Thu, 27 May 2010)

YOU ACKNOWLEDGE AND AGREE THAT THE SOFTWARE AND DOCUMENTATION ARE PROVIDED “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL TEXAS INSTRUMENTS OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.

## Function Documentation

char* getAccelerometerInterruptReason | ( | unsigned char | interruptReason | ) |

Returns the name of the Accelerometer Interrupt Status Register that caused the interrupt.

Parameters:

  | interruptReason | the value read from the ACCEL_INT_STATUS register.

Returns:
  the name of the reason for the interrupt, e.g. "Motion on X" or "Motion on Y" or "Free Fall" etc.

unsigned char readAccelerometerRegister | ( | unsigned char | reg | ) |

Read a byte from the accelerometer over SPI

Precondition:
  SPI port configured for the accelerometer correctly

Parameters:

  | reg | which register to read from

Returns:
  the value read from the register

unsigned char writeAccelerometerRegister | ( | unsigned char | reg,
|  | unsigned char | data |
| ) |  |  |

Write a byte to the acceleration sensor over SPI

Precondition:
  SPI port configured correctly

Parameters:

  | reg | which register to read from

Returns:
  the value returned by the write operation

All Files Functions Variables