ISSDK  1.8
IoT Sensing Software Development Kit
Macros | Functions | Variables
mma845x_fifo.c File Reference

The mma845x_fifo.c file implements the ISSDK MMA845x sensor driver example demonstration with FIFO mode. More...

#include "pin_mux.h"
#include "clock_config.h"
#include "board.h"
#include "fsl_debug_console.h"
#include "Driver_I2C.h"
#include "issdk_hal.h"
#include "mma845x_drv.h"
Include dependency graph for mma845x_fifo.c:

Go to the source code of this file.

Macros

#define FIFO_SIZE   4
 The watermark value configured for MMA845x FIFO Buffer. More...
 

Functions

int main (void)
 Main function. More...
 

Variables

const registerwritelist_t mma845x_Config_Fifo []
 
const registerreadlist_t mma845x_Fifo_Status [] = {{.readFrom = MMA845x_F_STATUS, .numBytes = 1}, __END_READ_DATA__}
 
const registerreadlist_t mma845x_Output_Values []
 

Detailed Description

The mma845x_fifo.c file implements the ISSDK MMA845x sensor driver example demonstration with FIFO mode.

Definition in file mma845x_fifo.c.

Macro Definition Documentation

◆ FIFO_SIZE

#define FIFO_SIZE   4

The watermark value configured for MMA845x FIFO Buffer.

Definition at line 38 of file mma845x_fifo.c.

Referenced by main().

Function Documentation

◆ main()

int main ( void  )

Main function.

Initialize the I2C driver.

Set the I2C Power mode.

Set the I2C bus speed.

Initialize the MMA845x sensor driver.

Set the task to be executed while waiting for I2C transactions to complete.

Configure the MMA845x sensor driver with FIFO mode.

Wait for data ready from the MMA845x.

Read the raw sensor data from the MMA845x.

Convert the raw sensor data to signed 16-bit container for display to the debug port.

Definition at line 66 of file mma845x_fifo.c.

References mma845x_acceldata_t::accel, ASK_USER_TO_RESUME, BOARD_BootClockRUN, BOARD_InitDebugConsole(), BOARD_InitPins(), data, FIFO_SIZE, I2C_S_DEVICE_INDEX, I2C_S_DRIVER, I2C_S_SIGNAL_EVENT, I2Cdrv, int32_t(), MMA8451_WHO_AM_I_WHOAMI_VALUE, MMA845x_ACCEL_DATA_SIZE, MMA845x_F_STATUS_F_WMRK_FLAG_MASK, MMA845x_I2C_ADDR, MMA845x_I2C_Configure(), MMA845x_I2C_Initialize(), MMA845x_I2C_ReadData(), MMA845x_I2C_SetIdleTask(), rawData, SENSOR_ERROR_NONE, SMC, SMC_SetPowerModeVlpr(), and status.

Here is the call graph for this function:

Variable Documentation

◆ mma845x_Config_Fifo

const registerwritelist_t mma845x_Config_Fifo[]
Initial value:
= {
#define MMA845x_CTRL_REG1_DR_12DOT5HZ
Definition: mma845x.h:1610
#define MMA845x_F_SETUP_F_MODE_FIFOSTOP
Definition: mma845x.h:288
#define __END_WRITE_DATA__
Definition: sensor_drv.h:45
#define MMA845x_CTRL_REG2_MODS_HIGHRES
Definition: mma845x.h:1669
#define FIFO_SIZE
The watermark value configured for MMA845x FIFO Buffer.
Definition: mma845x_fifo.c:38
#define MMA845x_CTRL_REG1_MODE_STANDBY
Definition: mma845x.h:1599

Prepare the register write list to configure MMA845x in FIFO mode.

Definition at line 44 of file mma845x_fifo.c.

◆ mma845x_Fifo_Status

const registerreadlist_t mma845x_Fifo_Status[] = {{.readFrom = MMA845x_F_STATUS, .numBytes = 1}, __END_READ_DATA__}

Prepare the register read list to read the FIFO event from MMA845x.

Definition at line 54 of file mma845x_fifo.c.

◆ mma845x_Output_Values

const registerreadlist_t mma845x_Output_Values[]
Initial value:
= {
#define __END_READ_DATA__
Definition: sensor_drv.h:51
#define MMA845x_ACCEL_DATA_SIZE
The size of the MMA845x accel data.
Definition: mma845x_drv.h:47
#define FIFO_SIZE
The watermark value configured for MMA845x FIFO Buffer.
Definition: mma845x_fifo.c:38

Prepare the register read list to read the raw Accel data from MMA845x.

Definition at line 57 of file mma845x_fifo.c.