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

The fxpq3115_normal.c file implements the ISSDK FXPQ3115BV 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 "fxpq3115_drv.h"
Include dependency graph for fxpq3115_normal.c:

Go to the source code of this file.

Macros

#define FXPQ3115_DATA_SIZE   (5) /* 3 byte Pressure/Altitude and 2 byte Temperature. */
 
#define FXPQ3115_SAMPLING_EXPONENT   (1) /* 2 seconds */
 

Functions

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

Variables

const registerwritelist_t B3115ConfigPoll []
 Register settings for Normal (non buffered) mode. More...
 
const registerreadlist_t B3115Status [] = {{.readFrom = FXPQ3115_STATUS, .numBytes = 1}, __END_READ_DATA__}
 Address of Status Register. More...
 
const registerreadlist_t B3115OutputNormal []
 Address and size of Raw Pressure+Temperature Data in Normal Mode. More...
 

Detailed Description

The fxpq3115_normal.c file implements the ISSDK FXPQ3115BV sensor driver example demonstration with polling mode.

Definition in file fxpq3115_normal.c.

Macro Definition Documentation

◆ FXPQ3115_DATA_SIZE

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

Definition at line 61 of file fxpq3115_normal.c.

Referenced by main().

◆ FXPQ3115_SAMPLING_EXPONENT

#define FXPQ3115_SAMPLING_EXPONENT   (1) /* 2 seconds */

In FXPQ3115 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 65 of file fxpq3115_normal.c.

Function Documentation

◆ main()

int main ( void  )

Main function.

Initialize the I2C driver.

Set the I2C Power mode.

Set the I2C bus speed.

Initialize FXPQ3115 sensor driver.

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

Configure the FXPQ3115 sensor.

Wait for data ready from the FXPQ3115.

Read new raw sensor data from the FXPQ3115.

Process the sample and convert the raw sensor data.

Definition at line 95 of file fxpq3115_normal.c.

References ASK_USER_TO_RESUME, BOARD_BootClockRUN, BOARD_InitDebugConsole(), BOARD_InitPins(), data, FXPQ3115_DATA_SIZE, FXPQ3115_DR_STATUS_PTDR_MASK, FXPQ3115_I2C_ADDR, FXPQ3115_I2C_Configure(), FXPQ3115_I2C_Initialize(), FXPQ3115_I2C_ReadData(), FXPQ3115_I2C_SetIdleTask(), FXPQ3115_PRESSURE_CONV_FACTOR, FXPQ3115_TEMPERATURE_CONV_FACTOR, FXPQ3115_WHOAMI_VALUE, I2C_S_DEVICE_INDEX, I2C_S_DRIVER, I2C_S_SIGNAL_EVENT, int32_t(), fxpq3115_pressuredata_t::pressure, rawData, SENSOR_ERROR_NONE, SMC, SMC_SetPowerModeWait(), status, and fxpq3115_pressuredata_t::temperature.

Here is the call graph for this function:

Variable Documentation

◆ B3115ConfigPoll

const registerwritelist_t B3115ConfigPoll[]
Initial value:
= {
#define FXPQ3115_CTRL_REG1_OS_MASK
Definition: fxpq3115.h:855
#define __END_WRITE_DATA__
Definition: sensor_drv.h:71
#define FXPQ3115_PT_DATA_CFG_TDEFE_MASK
Definition: fxpq3115.h:550
#define FXPQ3115_PT_DATA_CFG_PDEFE_ENABLED
Definition: fxpq3115.h:567
#define FXPQ3115_CTRL_REG2_ST_MASK
Definition: fxpq3115.h:919
#define FXPQ3115_CTRL_REG1_OS_OSR_128
Definition: fxpq3115.h:887
#define FXPQ3115_PT_DATA_CFG_DREM_MASK
Definition: fxpq3115.h:556
#define FXPQ3115_PT_DATA_CFG_DREM_ENABLED
Definition: fxpq3115.h:570
#define FXPQ3115_SAMPLING_EXPONENT
#define FXPQ3115_PT_DATA_CFG_PDEFE_MASK
Definition: fxpq3115.h:553
#define FXPQ3115_PT_DATA_CFG_TDEFE_ENABLED
Definition: fxpq3115.h:564

Register settings for Normal (non buffered) mode.

Definition at line 71 of file fxpq3115_normal.c.

◆ B3115OutputNormal

const registerreadlist_t B3115OutputNormal[]
Initial value:
= {{.readFrom = FXPQ3115_OUT_P_MSB, .numBytes = FXPQ3115_DATA_SIZE},
#define FXPQ3115_DATA_SIZE
#define __END_READ_DATA__
Definition: sensor_drv.h:77

Address and size of Raw Pressure+Temperature Data in Normal Mode.

Definition at line 86 of file fxpq3115_normal.c.

◆ B3115Status

const registerreadlist_t B3115Status[] = {{.readFrom = FXPQ3115_STATUS, .numBytes = 1}, __END_READ_DATA__}

Address of Status Register.

Definition at line 83 of file fxpq3115_normal.c.