![]() |
ISSDK
1.8
IoT Sensing Software Development Kit
|
The mma9553_pedometer_i2c.c file implements the ISSDK MMA9553L sensor driver example demonstration as a Pedometer in I2C Mode. More...
#include "pin_mux.h"
#include "clock_config.h"
#include "board.h"
#include "fsl_lptmr.h"
#include "fsl_debug_console.h"
#include "Driver_I2C.h"
#include "issdk_hal.h"
#include "mma9553_drv.h"
#include "systick_utils.h"
Go to the source code of this file.
Macros | |
#define | SAMPLING_RATE_ms (100) /* Timeout for the ODR Timer. */ |
#define | MMA9553_ACCEL_DATA_SIZE (6) /* 2 byte X,Y,Z Axis Data each. */ |
#define | mma9553_en_callback LPTMR0_IRQHandler /* Timer timeout Callback. */ |
Functions | |
void | mma9553_en_callback (void) |
int | main (void) |
Main function. More... | |
Variables | |
const registercommandlist_t | cMma9553Config30Hz [] |
const registerreadlist_t | cMma9553ReadRawOutput [] |
const registercommandlist_t | cMma9553ReadPedometerCommand [] |
const registerreadlist_t | cMma9553ReadPedometerOutput [] |
volatile bool | gMma9553DataReady |
The mma9553_pedometer_i2c.c file implements the ISSDK MMA9553L sensor driver example demonstration as a Pedometer in I2C Mode.
Definition in file mma9553_pedometer_i2c.c.
#define MMA9553_ACCEL_DATA_SIZE (6) /* 2 byte X,Y,Z Axis Data each. */ |
Definition at line 34 of file mma9553_pedometer_i2c.c.
#define mma9553_en_callback LPTMR0_IRQHandler /* Timer timeout Callback. */ |
Definition at line 35 of file mma9553_pedometer_i2c.c.
#define SAMPLING_RATE_ms (100) /* Timeout for the ODR Timer. */ |
Definition at line 33 of file mma9553_pedometer_i2c.c.
Referenced by main().
int main | ( | void | ) |
Main function.
Initialize the MCU hardware
Initialize the I2C driver.
Set the I2C Power mode.
Set the I2C bus speed.
Initialize the MMA9553 sensor driver.
Set the task to be executed while waiting for I2C transactions to complete.
Configure the MMA9553 sensor driver with 30Hz Mode settings.
Read the Pedometer data from the MMA9553.
Read the raw sensor data from the MMA9553.
Definition at line 78 of file mma9553_pedometer_i2c.c.
References mma9553_acceldata_t::accel, ASK_USER_TO_RESUME, BOARD_BootClockRUN, BOARD_InitDebugConsole(), BOARD_InitPins(), BOARD_SystickEnable(), gMma9553DataReady, I2C_S_DEVICE_INDEX, I2C_S_DRIVER, I2C_S_SIGNAL_EVENT, I2Cdrv, int32_t(), MMA9553_I2C_ADDR, MMA9553_I2C_CommandResponse(), MMA9553_I2C_Configure(), MMA9553_I2C_Initialize(), MMA9553_I2C_SetIdleTask(), rawData, SAMPLING_RATE_ms, SENSOR_ERROR_NONE, SMC, SMC_SetPowerModeVlpr(), and status.
void mma9553_en_callback | ( | void | ) |
Definition at line 69 of file mma9553_pedometer_i2c.c.
References gMma9553DataReady.
const registercommandlist_t cMma9553Config30Hz[] |
Prepare the register write list to configure MMA9553L in 30Hz Mode.
Definition at line 41 of file mma9553_pedometer_i2c.c.
const registercommandlist_t cMma9553ReadPedometerCommand[] |
Prepare the command list to read the Pedometer data from MMA9553.
Definition at line 53 of file mma9553_pedometer_i2c.c.
const registerreadlist_t cMma9553ReadPedometerOutput[] |
Prepare the read list to read the Pedometer data from MMA9553.
Definition at line 57 of file mma9553_pedometer_i2c.c.
const registerreadlist_t cMma9553ReadRawOutput[] |
Prepare the register read list to read the raw Accel data from MMA9553.
Definition at line 49 of file mma9553_pedometer_i2c.c.
volatile bool gMma9553DataReady |
Definition at line 63 of file mma9553_pedometer_i2c.c.
Referenced by main(), and mma9553_en_callback().