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

The fxpq3115_fifo_interrupt.c file implements the ISSDK FXPQ3115BV sensor driver example demonstration with fifo in interrupt 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 "gpio_driver.h"
#include "fxpq3115_drv.h"
Include dependency graph for fxpq3115_fifo_interrupt.c:

Go to the source code of this file.

Macros

#define FIFO_WMRK_SIZE   (8) /* Buffer 8 Samples. */
 
#define FXPQ3115_DATA_SIZE   (5) /* 3 byte Pressure/Altitude and 2 byte Temperature. */
 
#define FXPQ3115_SAMPLING_EXPONENT   (0) /* 1 seconds. */
 

Functions

void fxpq3115_int_data_ready_callback (void *pUserData)
 This is the Sensor Data Ready ISR implementation. More...
 
int main (void)
 This is the The main function implementation. More...
 

Variables

const registerwritelist_t B3115ConfigFIFOInt []
 Register settings for FIFO (buffered) mode @ default 1 sample per second with Interrupts. More...
 
const registerreadlist_t B3115Status [] = {{.readFrom = FXPQ3115_STATUS, .numBytes = 1}, __END_READ_DATA__}
 Address of Status Register. More...
 
const registerreadlist_t B3115OutputFIFO []
 Address and size of Pressure+Temperature Data in FIFO Mode. More...
 
volatile uint8_t gB3115DataReady
 

Detailed Description

The fxpq3115_fifo_interrupt.c file implements the ISSDK FXPQ3115BV sensor driver example demonstration with fifo in interrupt mode.

Definition in file fxpq3115_fifo_interrupt.c.

Macro Definition Documentation

◆ FIFO_WMRK_SIZE

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

Definition at line 39 of file fxpq3115_fifo_interrupt.c.

Referenced by main().

◆ FXPQ3115_DATA_SIZE

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

Definition at line 40 of file fxpq3115_fifo_interrupt.c.

Referenced by main().

◆ FXPQ3115_SAMPLING_EXPONENT

#define FXPQ3115_SAMPLING_EXPONENT   (0) /* 1 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 44 of file fxpq3115_fifo_interrupt.c.

Function Documentation

◆ fxpq3115_int_data_ready_callback()

void fxpq3115_int_data_ready_callback ( void *  pUserData)

This is the Sensor Data Ready ISR implementation.


This function sets the flag which indicates if a new sample(s) is available for reading.

Parameters
[in]pUserDataThis is a void pointer to the instance of the user specific data structure for the ISR.
Returns
void There is no return value.
Constraints:
None

Yes

Set flag to indicate Sensor has signalled data ready.

Definition at line 92 of file fxpq3115_fifo_interrupt.c.

References gB3115DataReady.

Referenced by main().

Here is the caller graph for this function:

◆ main()

int main ( void  )

This is the The main function implementation.


This function invokes board initializes routines, then then brings up the sensor and finally enters an endless loop to continuously read available samples.

Parameters
[in]voidThis is no input parameter.
Returns
void There is no return value.
Constraints:
None

No

Initialize the MCU hardware.

Initialize FXPQ3115 pin used by FRDM board

Initialize RGB LED pin used by FRDM board

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 driver.

Clear the data ready flag, it will be set again by the ISR.

Read new raw sensor data from the FXPQ3115.

Process all samples and convert the raw sensor data.

Definition at line 106 of file fxpq3115_fifo_interrupt.c.

References ASK_USER_TO_RESUME, BOARD_BootClockRUN, BOARD_InitDebugConsole(), BOARD_InitPins(), data, Driver_GPIO_KSDK, FIFO_WMRK_SIZE, FXPQ3115_DATA_SIZE, FXPQ3115_I2C_ADDR, FXPQ3115_I2C_Configure(), FXPQ3115_I2C_Initialize(), FXPQ3115_I2C_ReadData(), FXPQ3115_I2C_SetIdleTask(), FXPQ3115_INT1, fxpq3115_int_data_ready_callback(), FXPQ3115_PRESSURE_CONV_FACTOR, FXPQ3115_TEMPERATURE_CONV_FACTOR, FXPQ3115_WHOAMI_VALUE, gB3115DataReady, GPIO_DIRECTION_IN, GPIO_DIRECTION_OUT, GREEN_LED, I2C_S_DEVICE_INDEX, I2C_S_DRIVER, I2C_S_SIGNAL_EVENT, I2Cdrv, int32_t(), pGpioDriver, GENERIC_DRIVER_GPIO::pin_init, fxpq3115_pressuredata_t::pressure, rawData, SENSOR_ERROR_NONE, SMC, SMC_SetPowerModeVlpr(), SMC_SetPowerModeWait(), status, fxpq3115_pressuredata_t::temperature, and GENERIC_DRIVER_GPIO::toggle_pin.

Here is the call graph for this function:

Variable Documentation

◆ B3115ConfigFIFOInt

const registerwritelist_t B3115ConfigFIFOInt[]
Initial value:
= {
#define FXPQ3115_F_SETUP_F_WMRK_MASK
Definition: fxpq3115.h:407
#define FXPQ3115_CTRL_REG5_INT_CFG_FIFO_INT1
Definition: fxpq3115.h:1151
#define FXPQ3115_PT_DATA_CFG_TDEFE_MASK
Definition: fxpq3115.h:550
#define FXPQ3115_PT_DATA_CFG_TDEFE_ENABLED
Definition: fxpq3115.h:564
#define FXPQ3115_CTRL_REG3_IPOL1_HIGH
Definition: fxpq3115.h:993
#define FXPQ3115_CTRL_REG1_OS_MASK
Definition: fxpq3115.h:855
#define __END_WRITE_DATA__
Definition: sensor_drv.h:45
#define FXPQ3115_CTRL_REG4_INT_EN_FIFO_INTENABLED
Definition: fxpq3115.h:1071
#define FXPQ3115_PT_DATA_CFG_PDEFE_MASK
Definition: fxpq3115.h:553
#define FXPQ3115_F_SETUP_F_MODE_MASK
Definition: fxpq3115.h:410
#define FXPQ3115_SAMPLING_EXPONENT
#define FXPQ3115_PT_DATA_CFG_DREM_MASK
Definition: fxpq3115.h:556
#define FXPQ3115_CTRL_REG4_INT_EN_FIFO_MASK
Definition: fxpq3115.h:1048
#define FXPQ3115_CTRL_REG1_OS_OSR_128
Definition: fxpq3115.h:887
#define FXPQ3115_CTRL_REG3_IPOL1_MASK
Definition: fxpq3115.h:979
#define FXPQ3115_PT_DATA_CFG_PDEFE_ENABLED
Definition: fxpq3115.h:567
#define FIFO_WMRK_SIZE
#define FXPQ3115_F_SETUP_F_MODE_STOP_MODE
Definition: fxpq3115.h:420
#define FXPQ3115_CTRL_REG5_INT_CFG_FIFO_MASK
Definition: fxpq3115.h:1128
#define FXPQ3115_PT_DATA_CFG_DREM_ENABLED
Definition: fxpq3115.h:570
#define FXPQ3115_CTRL_REG2_ST_MASK
Definition: fxpq3115.h:919

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

Definition at line 50 of file fxpq3115_fifo_interrupt.c.

◆ B3115OutputFIFO

const registerreadlist_t B3115OutputFIFO[]
Initial value:
= {
#define FXPQ3115_DATA_SIZE
#define __END_READ_DATA__
Definition: sensor_drv.h:51
#define FIFO_WMRK_SIZE

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

Definition at line 73 of file fxpq3115_fifo_interrupt.c.

◆ B3115Status

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

Address of Status Register.

Definition at line 70 of file fxpq3115_fifo_interrupt.c.

◆ gB3115DataReady

volatile uint8_t gB3115DataReady

Definition at line 79 of file fxpq3115_fifo_interrupt.c.

Referenced by fxpq3115_int_data_ready_callback(), and main().