- Main Page
- Related Pages
- Modules
- Files

- File List
- Globals

# hal_vti_cma3000_D01_accelerometer.h

Go to the documentation of this file.

    00001
    00012 #ifndef hal_vti_cma3000_d01_H
    00013 #define hal_vti_cma3000_d01_H
    00014
    00015 unsigned char readAccelerometerRegister(unsigned char Address);
    00016 unsigned char writeAccelerometerRegister(unsigned char Address, unsigned char Data);
    00017 char* getAccelerometerInterruptReason(unsigned char interruptReason);
    00018
    00019 // CMA3000 Registers
    00020 #define ACCEL_WHO_AM_I        0x00
    00021 #define ACCEL_REVID           0x01
    00022 #define ACCEL_CTRL            0x02
    00023 #define ACCEL_STATUS          0x03
    00024 #define ACCEL_RSTR            0x04
    00025 #define ACCEL_INT_STATUS      0x05
    00026 #define ACCEL_DOUTX           0x06
    00027 #define ACCEL_DOUTY           0x07
    00028 #define ACCEL_DOUTZ           0x08
    00029 #define ACCEL_MDTHR           0x09
    00030 #define ACCEL_MDFFTMR         0x0A
    00031 #define ACCEL_FFTHR           0x0B
    00032 #define ACCEL_I2C_ADDR        0x0C
    00033
    00034 // Control Register setup
    00035 #define G_RANGE_2       0x80  // 2g range
    00036 #define INT_LEVEL_LOW   0x40  // INT active high
    00037 #define MDET_NO_EXIT    0x20  // Remain in motion detection mode
    00038 #define I2C_DIS         0x10  // I2C disabled
    00039 #define MODE_PD         0x00  // Power Down
    00040 #define MODE_100        0x02  // Measurement mode 100 Hz ODR
    00041 #define MODE_400        0x04  // Measurement mode 400 Hz ODR
    00042 #define MODE_40         0x06  // Measurement mode 40 Hz ODR
    00043 #define MODE_MD_10      0x08  // Motion detection mode 10 Hz ODR
    00044 #define MODE_FF_100     0x0A  // Free fall detection mode 100 Hz ODR
    00045 #define MODE_FF_400     0x0C  // Free fall detection mode 400 Hz ODR
    00046 #define INT_DIS         0x01  // Interrupts enabled
    00047
    00048 //Note: According to app note "Interface CMA3000-D01 to MSP430", there must be at least 11 SCK clock periods between SPI frames.
    00049 #define ACCELEROMETER_DELAY_BETWEEN_OPERATIONS_US  44
    00050
    00051
    00052
    00053 #endif

All Files Functions Variables Defines