54 #define TICKSPERUS (F_CPU/ 1000000)
57 #define ACCEL_INT_IN P2IN
58 #define ACCEL_INT_OUT P2OUT
59 #define ACCEL_INT_DIR P2DIR
60 #define ACCEL_SCK_SEL P2SEL
61 #define ACCEL_INT_IE P2IE
62 #define ACCEL_INT_IES P2IES
63 #define ACCEL_INT_IFG P2IFG
64 #define ACCEL_INT_VECTOR PORT2_VECTOR
65 #define ACCEL_OUT P3OUT
66 #define ACCEL_DIR P3DIR
67 #define ACCEL_SEL P3SEL
70 #define ACCEL_INT BIT5
72 #define ACCEL_SIMO BIT3
73 #define ACCEL_SOMI BIT4
74 #define ACCEL_SCK BIT7
75 #define ACCEL_PWR BIT6
80 #define MODE_400 0x04 // Measurement mode 400 Hz ODR
84 #define G_RANGE_2 0x80 // 2g range
85 #define I2C_DIS 0x10 // I2C disabled
accel_state_t
Enumerate possible states for the accelerometer finite state machine (FSM)
Definition: accel.h:102
We have completed, there is a full set of valid data in the SampleBuffer.
Definition: accel.h:120
int8_t Cma3000_writeRegister(uint8_t Address, int8_t accelData)
Writes data to the accelerometer.
Definition: accel.c:272
int8_t Cma3000_xAccel
Data value x from the accelerometer.
Definition: accel.c:58
We have no or invalid data in the SampleBuffer.
Definition: accel.h:105
A structure to contain one 'set' of samples from the vehicle.
Definition: logger.h:92
int8_t Cma3000_zAccel
Data value z from the accelerometer.
Definition: accel.c:60
int8_t Cma3000_readRegister(uint8_t Address)
Reads data from the accelerometer.
Definition: accel.c:193
void Cma3000_disable(void)
Disables the CMA3000-D01 3-Axis Ultra Low Power Accelerometer.
Definition: accel.c:148
void Cma3000_readAccelFSM(void)
Commence reading of data into the SampleBuffer.
Definition: accel.c:243
void Cma3000_readAccel(void)
Reads data from the accelerometer.
Definition: accel.c:173
We have requested the data value for Y.
Definition: accel.h:111
We have requested the data value for Z.
Definition: accel.h:115
A data value for Y is ready.
Definition: accel.h:113
int8_t Cma3000_yAccel
Data value y from the accelerometer.
Definition: accel.c:59
A data value for X is ready.
Definition: accel.h:109
void Cma3000_init(volatile SampleBuffer *samplebuffer)
Configures the CMA3000-D01 3-Axis Ultra Low Power Accelerometer.
Definition: accel.c:76
A data value for Z is ready.
Definition: accel.h:117
accel_state_t Cma3000_getState(void)
Get the current state of the accelerometer.
Definition: accel.c:261
We have requested the data value for X.
Definition: accel.h:107