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

The fxpq3115_oneshot.c file implements the ISSDK FXPQ3115BV sensor driver example demonstration with one-shot sampling 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_oneshot.c:

Go to the source code of this file.

Macros

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

Functions

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

Variables

const registerwritelist_t B3115ConfigAltitude []
 Register settings for Altitude readings in One-Shot mode. More...
 
const registerwritelist_t B3115SetOST []
 Register settings for Triggring One-Shot Sampling. More...
 
const registerreadlist_t B3115GetOST [] = {{.readFrom = FXPQ3115_CTRL_REG1, .numBytes = 1}, __END_READ_DATA__}
 Address of Register containing OST Bit. More...
 
const registerreadlist_t B3115OutputNormal []
 Address and size of Raw Altitude+Temperature Data. More...
 

Detailed Description

The fxpq3115_oneshot.c file implements the ISSDK FXPQ3115BV sensor driver example demonstration with one-shot sampling mode.

Definition in file fxpq3115_oneshot.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_oneshot.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 FXPQ3115 sensor driver.

We do not need to call FXPQ3115_I2C_Configure() in this case as we are going to read samples on demand. Instead we directly write register settings for One-Shot Mode...

The code contained withing the braces illustrate steps to read one-sample. These can be repated at desired intervals to acquire more samples.

Keep checking the OST FLAG for completion.

Read raw sensor data from the FXPQ3115.

Process the sample and convert the raw sensor data.

Definition at line 91 of file fxpq3115_oneshot.c.

References fxpq3115_altitudedata_t::altitude, ASK_USER_TO_RESUME, BOARD_BootClockRUN, BOARD_InitDebugConsole(), BOARD_InitPins(), data, PhysicalSensor::deviceInfo, registerDeviceInfo_t::deviceInstance, registerDeviceInfo_t::functionParam, FXPQ3115_ALTITUDE_CONV_FACTOR, FXPQ3115_CTRL_REG1_OST_MASK, FXPQ3115_DATA_SIZE, FXPQ3115_I2C_ADDR, FXPQ3115_I2C_Initialize(), FXPQ3115_I2C_ReadData(), FXPQ3115_TEMPERATURE_CONV_FACTOR, FXPQ3115_WHOAMI_VALUE, I2C_S_DEVICE_INDEX, I2C_S_DRIVER, I2C_S_SIGNAL_EVENT, registerDeviceInfo_t::idleFunction, int32_t(), fxpq3115_i2c_sensorhandle_t::pCommDrv, rawData, SENSOR_ERROR_NONE, SENSOR_ERROR_WRITE, Sensor_I2C_Write(), fxpq3115_i2c_sensorhandle_t::slaveAddress, SMC, SMC_SetPowerModeWait(), status, and fxpq3115_altitudedata_t::temperature.

Here is the call graph for this function:

Variable Documentation

◆ B3115ConfigAltitude

const registerwritelist_t B3115ConfigAltitude[]
Initial value:
= {
#define FXPQ3115_CTRL_REG1_ALT_MASK
Definition: fxpq3115.h:861
#define __END_WRITE_DATA__
Definition: sensor_drv.h:71
#define FXPQ3115_CTRL_REG1_ALT_ALT
Definition: fxpq3115.h:891

Register settings for Altitude readings in One-Shot mode.

Definition at line 67 of file fxpq3115_oneshot.c.

◆ B3115GetOST

const registerreadlist_t B3115GetOST[] = {{.readFrom = FXPQ3115_CTRL_REG1, .numBytes = 1}, __END_READ_DATA__}

Address of Register containing OST Bit.

Definition at line 79 of file fxpq3115_oneshot.c.

◆ B3115OutputNormal

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

Address and size of Raw Altitude+Temperature Data.

Definition at line 82 of file fxpq3115_oneshot.c.

◆ B3115SetOST

const registerwritelist_t B3115SetOST[]
Initial value:
= {
#define FXPQ3115_CTRL_REG1_OST_MASK
Definition: fxpq3115.h:849
#define __END_WRITE_DATA__
Definition: sensor_drv.h:71
#define FXPQ3115_CTRL_REG1_OST_SET
Definition: fxpq3115.h:871

Register settings for Triggring One-Shot Sampling.

Definition at line 73 of file fxpq3115_oneshot.c.