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

The mma865x_poll.c file implements the ISSDK MMA865x sensor driver example demonstration with Normal 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 "mma865x_drv.h"
Include dependency graph for mma865x_poll.c:

Go to the source code of this file.

Macros

#define MMA865x_ACCEL_DATA_SIZE   (6) /* 2 byte X,Y,Z Axis Data each. */
 

Functions

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

Variables

const registerwritelist_t cMma865xConfigNormal []
 
const registerreadlist_t cMma865xDataReady [] = {{.readFrom = MMA865x_STATUS, .numBytes = 1}, __END_READ_DATA__}
 
const registerreadlist_t cMma865xOutputValues []
 

Detailed Description

The mma865x_poll.c file implements the ISSDK MMA865x sensor driver example demonstration with Normal mode.

Definition in file mma865x_poll.c.

Macro Definition Documentation

◆ MMA865x_ACCEL_DATA_SIZE

#define MMA865x_ACCEL_DATA_SIZE   (6) /* 2 byte X,Y,Z Axis Data each. */

Definition at line 35 of file mma865x_poll.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 MMA865x sensor driver.

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

Configure the MMA865x sensor driver with Normal mode.

Wait for data ready from the MMA865x.

Read the raw sensor data from the MMA865x.

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

Definition at line 63 of file mma865x_poll.c.

References mma865x_acceldata_t::accel, ASK_USER_TO_RESUME, BOARD_BootClockRUN, BOARD_InitDebugConsole(), BOARD_InitPins(), data, I2C_S_DEVICE_INDEX, I2C_S_DRIVER, I2C_S_SIGNAL_EVENT, I2Cdrv, int32_t(), MMA8652_I2C_ADDR, MMA8652_WHOAMI_VALUE, MMA865x_ACCEL_DATA_SIZE, MMA865x_I2C_Configure(), MMA865x_I2C_Initialize(), MMA865x_I2C_ReadData(), MMA865x_I2C_SetIdleTask(), MMA865x_STATUS_ZYXDR_MASK, rawData, SENSOR_ERROR_NONE, SMC, SMC_SetPowerModeVlpr(), and status.

Here is the call graph for this function:

Variable Documentation

◆ cMma865xConfigNormal

const registerwritelist_t cMma865xConfigNormal[]
Initial value:

Prepare the register write list to configure MMA865x in Normal mode.

Definition at line 41 of file mma865x_poll.c.

◆ cMma865xDataReady

const registerreadlist_t cMma865xDataReady[] = {{.readFrom = MMA865x_STATUS, .numBytes = 1}, __END_READ_DATA__}

Prepare the register read list to read the Data Ready Status from MMA865x.

Definition at line 51 of file mma865x_poll.c.

◆ cMma865xOutputValues

const registerreadlist_t cMma865xOutputValues[]
Initial value:
= {{.readFrom = MMA865x_OUT_X_MSB, .numBytes = MMA865x_ACCEL_DATA_SIZE},
#define MMA865x_ACCEL_DATA_SIZE
Definition: mma865x_poll.c:35
#define __END_READ_DATA__
Definition: sensor_drv.h:51

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

Definition at line 54 of file mma865x_poll.c.