ISSDK  1.7
IoT Sensing Software Development Kit
Macros | Functions | Variables
mpl3115_fifo.c File Reference

The mpl3115_fifo.c file implements the ISSDK MPL3115 sensor driver example demonstration with polling mode. More...

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

Go to the source code of this file.

Macros

#define FIFO_WMRK_SIZE   (8) /* Buffer 8 Samples. */
 
#define MPL3115_DATA_SIZE   (5) /* 3 byte Pressure/Altitude and 2 byte Temperature. */
 
#define MPL3115_SAMPLING_EXPONENT   (0) /* 1 second. */
 

Functions

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

Variables

const registerwritelist_t cMpl3115ConfigFIFO []
 Register settings for FIFO (buffered) mode @ default 1 sample per second. More...
 
const registerreadlist_t cMpl3115Status [] = {{.readFrom = MPL3115_STATUS, .numBytes = 1}, __END_READ_DATA__}
 Address of Status Register. More...
 
const registerreadlist_t cMpl3115OutputFIFO []
 Address and size of Pressure+Temperature Data in FIFO Mode. More...
 

Detailed Description

The mpl3115_fifo.c file implements the ISSDK MPL3115 sensor driver example demonstration with polling mode.

Definition in file mpl3115_fifo.c.

Macro Definition Documentation

◆ FIFO_WMRK_SIZE

#define FIFO_WMRK_SIZE   (8) /* Buffer 8 Samples. */

Definition at line 61 of file mpl3115_fifo.c.

Referenced by main().

◆ MPL3115_DATA_SIZE

#define MPL3115_DATA_SIZE   (5) /* 3 byte Pressure/Altitude and 2 byte Temperature. */

Definition at line 62 of file mpl3115_fifo.c.

Referenced by main().

◆ MPL3115_SAMPLING_EXPONENT

#define MPL3115_SAMPLING_EXPONENT   (0) /* 1 second. */

In MPL3115 the Auto Acquisition Time Step (ODR) can be set only in powers of 2 (i.e. 2^x, where x is the SAMPLING_EXPONENT). This gives a range of 1 second to 2^15 seconds (9 hours).

Definition at line 66 of file mpl3115_fifo.c.

Function Documentation

◆ main()

int main ( void  )

Main function.

Initialize the I2C driver.

Set the I2C Power mode.

Set the I2C bus speed.

Initialize MPL3115 sensor driver.

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

Configure the MPL3115 sensor.

Wait for data ready from the MPL3115.

Read new raw sensor data from the MPL3115.

Process all samples and convert the raw sensor data.

Definition at line 98 of file mpl3115_fifo.c.

References ASK_USER_TO_RESUME, BOARD_BootClockRUN, BOARD_InitDebugConsole(), BOARD_InitPins(), data, FIFO_WMRK_SIZE, I2C_S_DEVICE_INDEX, I2C_S_DRIVER, I2C_S_SIGNAL_EVENT, int32_t(), MPL3115_DATA_SIZE, MPL3115_F_STATUS_F_WMKF_FLAG_MASK, MPL3115_I2C_ADDR, MPL3115_I2C_Configure(), MPL3115_I2C_Initialize(), MPL3115_I2C_ReadData(), MPL3115_I2C_SetIdleTask(), MPL3115_PRESSURE_CONV_FACTOR, MPL3115_TEMPERATURE_CONV_FACTOR, MPL3115_WHOAMI_VALUE, mpl3115_pressuredata_t::pressure, rawData, SENSOR_ERROR_NONE, SMC, SMC_SetPowerModeWait(), status, and mpl3115_pressuredata_t::temperature.

Here is the call graph for this function:

Variable Documentation

◆ cMpl3115ConfigFIFO

const registerwritelist_t cMpl3115ConfigFIFO[]
Initial value:
= {
#define __END_WRITE_DATA__
Definition: sensor_drv.h:71
#define FIFO_WMRK_SIZE
Definition: mpl3115_fifo.c:61
#define MPL3115_PT_DATA_CFG_PDEFE_ENABLED
Definition: mpl3115.h:567
#define MPL3115_CTRL_REG1_OS_OSR_128
Definition: mpl3115.h:884
#define MPL3115_PT_DATA_CFG_DREM_ENABLED
Definition: mpl3115.h:570
#define MPL3115_CTRL_REG1_OS_MASK
Definition: mpl3115.h:855
#define MPL3115_PT_DATA_CFG_PDEFE_MASK
Definition: mpl3115.h:553
#define MPL3115_PT_DATA_CFG_TDEFE_ENABLED
Definition: mpl3115.h:564
#define MPL3115_F_SETUP_F_MODE_MASK
Definition: mpl3115.h:410
#define MPL3115_SAMPLING_EXPONENT
Definition: mpl3115_fifo.c:66
#define MPL3115_F_SETUP_F_WMRK_MASK
Definition: mpl3115.h:407
#define MPL3115_CTRL_REG2_ST_MASK
Definition: mpl3115.h:916
#define MPL3115_PT_DATA_CFG_DREM_MASK
Definition: mpl3115.h:556
#define MPL3115_F_SETUP_F_MODE_STOP_MODE
Definition: mpl3115.h:420
#define MPL3115_PT_DATA_CFG_TDEFE_MASK
Definition: mpl3115.h:550

Register settings for FIFO (buffered) mode @ default 1 sample per second.

Definition at line 72 of file mpl3115_fifo.c.

◆ cMpl3115OutputFIFO

const registerreadlist_t cMpl3115OutputFIFO[]
Initial value:
= {
#define MPL3115_DATA_SIZE
Definition: mpl3115_fifo.c:62
#define FIFO_WMRK_SIZE
Definition: mpl3115_fifo.c:61
#define __END_READ_DATA__
Definition: sensor_drv.h:77

Address and size of Pressure+Temperature Data in FIFO Mode.

Definition at line 89 of file mpl3115_fifo.c.

◆ cMpl3115Status

const registerreadlist_t cMpl3115Status[] = {{.readFrom = MPL3115_STATUS, .numBytes = 1}, __END_READ_DATA__}

Address of Status Register.

Definition at line 86 of file mpl3115_fifo.c.