|
EV Logger
A MSP430 based datalogger for an electric vehicle
|
Typedefs | |
| typedef enum accel_state_t | accel_state_t |
| Enumerate possible states for the accelerometer finite state machine (FSM) | |
Enumerations | |
| enum | accel_state_t { STATE_ACCEL_NONE, STATE_ACCEL_XREQ, STATE_ACCEL_XRDY, STATE_ACCEL_YREQ, STATE_ACCEL_YRDY, STATE_ACCEL_ZREQ, STATE_ACCEL_ZRDY, STATE_ACCEL_DONE } |
| Enumerate possible states for the accelerometer finite state machine (FSM) More... | |
Functions | |
| void | Cma3000_init (volatile SampleBuffer *samplebuffer) |
| Configures the CMA3000-D01 3-Axis Ultra Low Power Accelerometer. More... | |
| void | Cma3000_disable (void) |
| Disables the CMA3000-D01 3-Axis Ultra Low Power Accelerometer. | |
| void | Cma3000_readAccel (void) |
| Reads data from the accelerometer. | |
| int8_t | Cma3000_readRegister (uint8_t Address) |
| Reads data from the accelerometer. More... | |
| void | Cma3000_readAccelFSM (void) |
| Commence reading of data into the SampleBuffer. | |
| accel_state_t | Cma3000_getState (void) |
| Get the current state of the accelerometer. More... | |
| int8_t | Cma3000_writeRegister (uint8_t Address, int8_t accelData) |
| Writes data to the accelerometer. More... | |
| interrupt (USCI_A0_VECTOR) | |
| Interrupt whenever we get a new byte from the accelerometer. More... | |
Variables | |
| static int8_t | accelData |
| static int8_t | RevID |
| int8_t | Cma3000_xAccel |
| Data value x from the accelerometer. | |
| int8_t | Cma3000_yAccel |
| Data value y from the accelerometer. | |
| int8_t | Cma3000_zAccel |
| Data value z from the accelerometer. | |
| static volatile SampleBuffer * | sb |
| static volatile accel_state_t | accel_state |
| Contain the current accelerometer state. More... | |
| int8_t | Cma3000_xAccel |
| Data value x from the accelerometer. | |
| int8_t | Cma3000_yAccel |
| Data value y from the accelerometer. | |
| int8_t | Cma3000_zAccel |
| Data value z from the accelerometer. | |
| enum accel_state_t |
Enumerate possible states for the accelerometer finite state machine (FSM)
| Enumerator | |
|---|---|
| STATE_ACCEL_NONE |
We have no or invalid data in the SampleBuffer. |
| STATE_ACCEL_XREQ |
We have requested the data value for X. |
| STATE_ACCEL_XRDY |
A data value for X is ready. |
| STATE_ACCEL_YREQ |
We have requested the data value for Y. |
| STATE_ACCEL_YRDY |
A data value for Y is ready. |
| STATE_ACCEL_ZREQ |
We have requested the data value for Z. |
| STATE_ACCEL_ZRDY |
A data value for Z is ready. |
| STATE_ACCEL_DONE |
We have completed, there is a full set of valid data in the SampleBuffer. |
| accel_state_t Cma3000_getState | ( | void | ) |
Get the current state of the accelerometer.
| void Cma3000_init | ( | volatile SampleBuffer * | samplebuffer | ) |
Configures the CMA3000-D01 3-Axis Ultra Low Power Accelerometer.
| samplebuffer | The SampleBuffer in which to place accelerometer data samples. |
| int8_t Cma3000_readRegister | ( | uint8_t | Address | ) |
Reads data from the accelerometer.
| Address | Address of register |
| int8_t Cma3000_writeRegister | ( | uint8_t | Address, |
| int8_t | accelData | ||
| ) |
Writes data to the accelerometer.
| Address | Address of register |
| accelData | Data to be written to the accelerometer |
| interrupt | ( | USCI_A0_VECTOR | ) |
Interrupt whenever we get a new byte from the accelerometer.
We should update the state machine and process the byte accordingly.
|
static |
Contain the current accelerometer state.
This is volatile since it is modified in the interrupt service routine.
1.8.6