46 #include "clock_config.h" 47 #include "fsl_debug_console.h" 52 #include "Driver_I2C.h" 55 #include "issdk_hal.h" 61 #define FIFO_WMRK_SIZE (8) 62 #define FXPQ3115_DATA_SIZE (5) 66 #define FXPQ3115_SAMPLING_EXPONENT (0) 100 int16_t tempInDegrees;
101 uint32_t pressureInPascals;
114 PRINTF(
"\r\n ISSDK FXPQ3115 sensor driver example demonstration with fifo mode\r\n");
118 if (ARM_DRIVER_OK != status)
120 PRINTF(
"\r\n I2C Initialization Failed\r\n");
125 status = I2Cdrv->PowerControl(ARM_POWER_FULL);
126 if (ARM_DRIVER_OK != status)
128 PRINTF(
"\r\n I2C Power Mode setting Failed\r\n");
133 status = I2Cdrv->Control(ARM_I2C_BUS_SPEED, ARM_I2C_BUS_SPEED_FAST);
134 if (ARM_DRIVER_OK != status)
136 PRINTF(
"\r\n I2C Control Mode setting Failed\r\n");
145 PRINTF(
"\r\n Sensor Initialization Failed\r\n");
148 PRINTF(
"\r\n Successfully Initiliazed Sensor\r\n");
157 PRINTF(
"\r\n FXPQ3115 sensor configuration failed.\r\n");
160 PRINTF(
"\r\n Successfully Applied FXPQ3115 Sensor Configuration\r\n");
173 if (ARM_DRIVER_OK != status)
175 PRINTF(
"\r\n Read Failed. \r\n");
180 pressureInPascals = 0;
193 PRINTF(
"\r\n Average Pressure = %d Pa\r\n", pressureInPascals / FIFO_WMRK_SIZE);
194 PRINTF(
"\r\n Average Temperature = %d degC\r\n", tempInDegrees / FIFO_WMRK_SIZE);
#define FXPQ3115_TEMPERATURE_CONV_FACTOR
#define FXPQ3115_CTRL_REG1_OS_MASK
#define __END_WRITE_DATA__
#define BOARD_BootClockRUN
uint8_t data[FXLS8962_DATA_SIZE]
This structure defines the fxpq3115 data buffer in Pressure Mode.
int32_t FXPQ3115_I2C_Initialize(fxpq3115_i2c_sensorhandle_t *pSensorHandle, ARM_DRIVER_I2C *pBus, uint8_t index, uint16_t sAddress, uint8_t whoAmi)
The interface function to initialize the sensor.
#define FXPQ3115_I2C_ADDR
void BOARD_InitDebugConsole(void)
#define FXPQ3115_F_STATUS_F_WMKF_FLAG_MASK
#define FXPQ3115_PT_DATA_CFG_TDEFE_MASK
void(* registeridlefunction_t)(void *userParam)
This is the register idle function type.
#define FXPQ3115_DATA_SIZE
#define FXPQ3115_PT_DATA_CFG_PDEFE_ENABLED
#define FXPQ3115_WHOAMI_VALUE
#define __END_READ_DATA__
#define FXPQ3115_CTRL_REG2_ST_MASK
#define FXPQ3115_PRESSURE_CONV_FACTOR
const registerwritelist_t B3115ConfigFIFO[]
Register settings for FIFO (buffered) mode @ default 1 sample per second.
#define FXPQ3115_CTRL_REG1_OS_OSR_128
#define FXPQ3115_PT_DATA_CFG_DREM_MASK
This defines the sensor specific information.
const registerreadlist_t B3115OutputFIFO[]
Address and size of Pressure+Temperature Data in FIFO Mode.
#define FXPQ3115_SAMPLING_EXPONENT
#define ASK_USER_TO_RESUME(x)
void FXPQ3115_I2C_SetIdleTask(fxpq3115_i2c_sensorhandle_t *pSensorHandle, registeridlefunction_t idleTask, void *userParam)
: The interface function to set the I2C Idle Task.
const registerreadlist_t B3115Status[]
Address of Status Register.
#define FXPQ3115_PT_DATA_CFG_DREM_ENABLED
int main(void)
Main function.
#define I2C_S_DEVICE_INDEX
#define FXPQ3115_F_SETUP_F_MODE_MASK
#define FXPQ3115_PT_DATA_CFG_PDEFE_MASK
int32_t FXPQ3115_I2C_Configure(fxpq3115_i2c_sensorhandle_t *pSensorHandle, const registerwritelist_t *pRegWriteList)
The interface function to configure he sensor.
fxls8962_acceldataUser_t rawData
This structure defines the Write command List.
int32_t FXPQ3115_I2C_ReadData(fxpq3115_i2c_sensorhandle_t *pSensorHandle, const registerreadlist_t *pReadList, uint8_t *pBuffer)
The interface function to read the sensor data.
This structure defines the Read command List.
status_t SMC_SetPowerModeWait(void *arg)
Configures the system to WAIT power mode. API name used from Kinetis family to maintain compatibility...
void BOARD_InitPins(void)
Configures pin routing and optionally pin electrical features.
#define FXPQ3115_PT_DATA_CFG_TDEFE_ENABLED
#define I2C_S_SIGNAL_EVENT
#define FXPQ3115_F_SETUP_F_MODE_STOP_MODE
The fxpq3115_drv.h file describes the fxpq3115 driver interface and structures.
#define FXPQ3115_F_SETUP_F_WMRK_MASK