19 #include "clock_config.h" 21 #include "fsl_debug_console.h" 26 #include "Driver_I2C.h" 31 #include "issdk_hal.h" 32 #include "gpio_driver.h" 38 #define FXPQ3115_DATA_SIZE (5) 42 #define FXPQ3115_SAMPLING_EXPONENT (1) 101 int16_t tempInDegrees;
102 uint32_t pressureInPascals;
116 PRINTF(
"\r\n ISSDK FXPQ3115 sensor driver example demonstration with interrupt mode.\r\n");
126 if (ARM_DRIVER_OK != status)
128 PRINTF(
"\r\n I2C Initialization Failed\r\n");
133 status = I2Cdrv->PowerControl(ARM_POWER_FULL);
134 if (ARM_DRIVER_OK != status)
136 PRINTF(
"\r\n I2C Power Mode setting Failed\r\n");
141 status = I2Cdrv->Control(ARM_I2C_BUS_SPEED, ARM_I2C_BUS_SPEED_FAST);
142 if (ARM_DRIVER_OK != status)
144 PRINTF(
"\r\n I2C Control Mode setting Failed\r\n");
153 PRINTF(
"\r\n Sensor Initialization Failed\r\n");
156 PRINTF(
"\r\n Successfully Initiliazed Sensor\r\n");
167 PRINTF(
"\r\n FXPQ3115 Sensor Configuration Failed, Err = %d\r\n", status);
170 PRINTF(
"\r\n Successfully Applied FXPQ3115 Sensor Configuration\r\n");
188 if (ARM_DRIVER_OK != status)
190 PRINTF(
"\r\n Read Failed. \r\n");
195 rawData.
pressure = (uint32_t)((data[0]) << 16) | ((data[1]) << 8) | ((data[2]));
198 rawData.
temperature = (int16_t)((data[3]) << 8) | (data[4]);
202 PRINTF(
"\r\nPressure = %d Pa\r\n", pressureInPascals);
203 PRINTF(
"\r\nTemperature = %d degC\r\n", tempInDegrees);
#define FXPQ3115_PRESSURE_CONV_FACTOR
This structure defines the Write command List.
#define FXPQ3115_CTRL_REG5_INT_CFG_DRDY_MASK
#define FXPQ3115_CTRL_REG4_INT_EN_DRDY_INTENABLED
#define ASK_USER_TO_RESUME(x)
status_t SMC_SetPowerModeVlpr(void *arg)
Configures the system to VLPR power mode. API name used from Kinetis family to maintain compatibility...
Access structure of the GPIO Driver.
#define FXPQ3115_PT_DATA_CFG_TDEFE_MASK
#define FXPQ3115_SAMPLING_EXPONENT
#define FXPQ3115_PT_DATA_CFG_TDEFE_ENABLED
#define FXPQ3115_CTRL_REG3_IPOL1_HIGH
#define FXPQ3115_CTRL_REG1_OS_MASK
#define FXPQ3115_DATA_SIZE
#define __END_WRITE_DATA__
This structure defines the fxpq3115 data buffer in Pressure Mode.
typedef int32_t(DATA_FORMAT_Append_t))(void *pData
The interface function to append the data on the formated stream.
volatile uint8_t gB3115DataReady
#define FXPQ3115_PT_DATA_CFG_PDEFE_MASK
#define I2C_S_SIGNAL_EVENT
int32_t FXPQ3115_I2C_Configure(fxpq3115_i2c_sensorhandle_t *pSensorHandle, const registerwritelist_t *pRegWriteList)
The interface function to configure he sensor.
#define BOARD_BootClockRUN
void(* registeridlefunction_t)(void *userParam)
This is the register idle function type.
void FXPQ3115_I2C_SetIdleTask(fxpq3115_i2c_sensorhandle_t *pSensorHandle, registeridlefunction_t idleTask, void *userParam)
: The interface function to set the I2C Idle Task.
const registerwritelist_t B3115ConfigNormal[]
Register settings for Interrupt (non buffered) 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.
GENERIC_DRIVER_GPIO Driver_GPIO_KSDK
GENERIC_DRIVER_GPIO * pGpioDriver
#define FXPQ3115_PT_DATA_CFG_DREM_MASK
The fxpq3115_drv.h file describes the fxpq3115 driver interface and structures.
uint8_t data[FXLS8962_DATA_SIZE]
#define FXPQ3115_CTRL_REG4_INT_EN_DRDY_MASK
#define __END_READ_DATA__
#define FXPQ3115_CTRL_REG5_INT_CFG_DRDY_INT1
const registerreadlist_t B3115OutputNormal[]
Address and size of Raw Pressure+Temperature Data in Normal Mode.
#define FXPQ3115_CTRL_REG1_OS_OSR_128
fxos8700_accelmagdata_t rawData
#define FXPQ3115_CTRL_REG3_IPOL1_MASK
#define FXPQ3115_PT_DATA_CFG_PDEFE_ENABLED
void(* toggle_pin)(pinID_t aPinId)
#define FXPQ3115_WHOAMI_VALUE
status_t SMC_SetPowerModeWait(void *arg)
Configures the system to WAIT power mode. API name used from Kinetis family to maintain compatibility...
void fxpq3115_int_data_ready_callback(void *pUserData)
This is the Sensor Data Ready ISR implementation.
void(* pin_init)(pinID_t aPinId, gpio_direction_t dir, void *apPinConfig, gpio_isr_handler_t aIsrHandler, void *apUserData)
This structure defines the Read command List.
int main(void)
This is the The main function implementation.
#define FXPQ3115_I2C_ADDR
gpioHandleKSDK_t GREEN_LED
#define I2C_S_DEVICE_INDEX
This defines the sensor specific information.
void BOARD_InitDebugConsole(void)
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.
void BOARD_InitPins(void)
Configures pin routing and optionally pin electrical features.
#define FXPQ3115_PT_DATA_CFG_DREM_ENABLED
#define FXPQ3115_CTRL_REG2_ST_MASK
#define FXPQ3115_TEMPERATURE_CONV_FACTOR