![]() |
ISSDK
1.8
IoT Sensing Software Development Kit
|
The mma8491q_example.c file implements the ISSDK MMA8491Q sensor driver example demonstration with Timers. 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 "gpio_driver.h"
#include "mma8491q_drv.h"
Go to the source code of this file.
Macros | |
#define | mma8491q_en_callback LPTMR0_IRQHandler |
#define | MMA8491Q_T_ODR_ms 100U |
#define | LPTMR_T_CORRECTION_ms 2 |
Functions | |
void | mma8491q_en_delay () |
void | mma8491q_en_callback (void) |
void | mma8491q_timer_fwk_init (uint32_t samplingInterval) |
int | main (void) |
Main function. More... | |
Variables | |
const registerreadlist_t | cMma8491qStatus [] = {{.readFrom = MMA8491Q_STATUS, .numBytes = 1}, __END_READ_DATA__} |
Address of Status Register. More... | |
const registerreadlist_t | cMma8491qOutput [] |
Address and size of Raw Acceleration Data. More... | |
volatile bool | bMma849qDataReady = false |
gpioConfigKSDK_t | gGpioConfigInPins |
GENERIC_DRIVER_GPIO * | pGpioDriver = &Driver_GPIO_KSDK |
The mma8491q_example.c file implements the ISSDK MMA8491Q sensor driver example demonstration with Timers.
Definition in file mma8491q_example.c.
#define LPTMR_T_CORRECTION_ms 2 |
Definition at line 44 of file mma8491q_example.c.
Referenced by mma8491q_timer_fwk_init().
#define mma8491q_en_callback LPTMR0_IRQHandler |
Definition at line 40 of file mma8491q_example.c.
#define MMA8491Q_T_ODR_ms 100U |
Definition at line 42 of file mma8491q_example.c.
Referenced by main().
int main | ( | void | ) |
Main function.
Initialize the MCU hardware.
Initialize GREEN LED pin used by FRDM board
Initialize the I2C driver.
Set the I2C Power mode.
Set the I2C bus speed.
Set the task to be executed while waiting for I2C transactions to complete.
Initialize MMA8491_ODR Timer framework.
Process packets on Data ready Timer Expiry
Process packets only when data ready is indicated by the MMA8491Q.
Read the raw sensor data from the MMA8491Q.
Process the sample and convert the raw sensor data.
Definition at line 109 of file mma8491q_example.c.
References mma8491q_acceldata_t::accel, ASK_USER_TO_RESUME, bMma849qDataReady, BOARD_BootClockRUN, BOARD_InitDebugConsole(), BOARD_InitPins(), GENERIC_DRIVER_GPIO::clr_pin, data, GPIO_DIRECTION_IN, GPIO_DIRECTION_OUT, GREEN_LED, I2C_S_DEVICE_INDEX, I2C_S_DRIVER, I2C_S_SIGNAL_EVENT, int32_t(), MMA8491_EN, MMA8491_I2C_ADDR, MMA8491_XOUT, MMA8491_YOUT, MMA8491_ZOUT, MMA8491Q_DATA_SIZE, mma8491q_en_delay(), MMA8491Q_I2C_Initialize(), MMA8491Q_I2C_ReadData(), MMA8491Q_I2C_SetIdleTask(), MMA8491Q_STATUS_ZYXDR_MASK, MMA8491Q_T_ODR_ms, mma8491q_timer_fwk_init(), GENERIC_DRIVER_GPIO::pin_init, rawData, GENERIC_DRIVER_GPIO::read_pin, SENSOR_ERROR_NONE, GENERIC_DRIVER_GPIO::set_pin, SMC, SMC_SetPowerModeVlpr(), SMC_SetPowerModeWait(), status, mma8491q_acceldata_t::tilt, fxos8700_accelmagdata_t::timestamp, and GENERIC_DRIVER_GPIO::toggle_pin.
void mma8491q_en_callback | ( | void | ) |
Definition at line 86 of file mma8491q_example.c.
References bMma849qDataReady.
void mma8491q_en_delay | ( | ) |
Definition at line 73 of file mma8491q_example.c.
References MMA8491Q_T_ON_TYPICAL.
Referenced by main().
void mma8491q_timer_fwk_init | ( | uint32_t | samplingInterval | ) |
Definition at line 93 of file mma8491q_example.c.
References LPTMR_T_CORRECTION_ms.
Referenced by main().
volatile bool bMma849qDataReady = false |
Definition at line 59 of file mma8491q_example.c.
Referenced by main(), and mma8491q_en_callback().
const registerreadlist_t cMma8491qOutput[] |
Address and size of Raw Acceleration Data.
Definition at line 53 of file mma8491q_example.c.
const registerreadlist_t cMma8491qStatus[] = {{.readFrom = MMA8491Q_STATUS, .numBytes = 1}, __END_READ_DATA__} |
Address of Status Register.
Definition at line 50 of file mma8491q_example.c.
gpioConfigKSDK_t gGpioConfigInPins |
Definition at line 60 of file mma8491q_example.c.
GENERIC_DRIVER_GPIO* pGpioDriver = &Driver_GPIO_KSDK |
Definition at line 67 of file mma8491q_example.c.
Referenced by main().