![]() |
ISSDK
1.7
IoT Sensing Software Development Kit
|
The diff_p_spi.c file implements the ISSDK DIFF_P sensor driver example demonstration with SPI Mode. More...
#include "board.h"
#include "pin_mux.h"
#include "clock_config.h"
#include "fsl_debug_console.h"
#include "Driver_SPI.h"
#include "issdk_hal.h"
#include "diff_p_drv.h"
#include "gpio_driver.h"
#include "systick_utils.h"
Go to the source code of this file.
Macros | |
#define | DIFF_P_DATA_SIZE (3) /* 2 byte Pressure and 1 byte Temperature. */ |
Functions | |
int | main (void) |
Main function. More... | |
Variables | |
const registerwritelist_t | cDiffPConfigNormal [] |
Register settings for Normal (non buffered) mode. More... | |
const registerwritelist_t | cDiffPClearStatusBits [] |
Register settings for Clearing Pressure and Temperature Data Ready Bits. More... | |
const registerreadlist_t | cDiffPStatus [] = {{.readFrom = DIFF_P_INT_STATUS_0, .numBytes = 1}, __END_READ_DATA__} |
Address of Status Register. More... | |
const registerreadlist_t | cDiffPOutputNormal [] |
Address and size of Raw Pressure+Temperature Data in Normal Mode. More... | |
The diff_p_spi.c file implements the ISSDK DIFF_P sensor driver example demonstration with SPI Mode.
Definition in file diff_p_spi.c.
Definition at line 62 of file diff_p_spi.c.
Referenced by main().
int main | ( | void | ) |
Main function.
Initialize the I2C driver.
Set the I2C Power mode.
Set the I2C bus speed.
Initialize DIFF_P sensor driver.
Set the task to be executed while waiting for SPI transactions to complete.
Configure the DIFF_P sensor.
Check for both data ready bits from the DIFF_P.
Read new raw sensor data from the DIFF_P.
Explicitly clear the Status Bits.
Process the sample and convert the raw sensor data.
Definition at line 90 of file diff_p_spi.c.
References BOARD_BootClockRUN, BOARD_InitDebugConsole(), BOARD_InitPins(), BOARD_SystickEnable(), data, diff_p_spi_sensorhandle_t::deviceInfo, DIFF_P_CS, DIFF_P_DATA_SIZE, DIFF_P_INT_STATUS_0_PDR_DRDY, DIFF_P_INT_STATUS_0_PDR_MASK, DIFF_P_INT_STATUS_0_TDR_DRDY, DIFF_P_INT_STATUS_0_TDR_MASK, DIFF_P_NPS3000VV_WHOAMI_VALUE, DIFF_P_NPS3001DV_WHOAMI_VALUE, DIFF_P_NPS3002VV_WHOAMI_VALUE, DIFF_P_NPS3005DV_WHOAMI_VALUE, DIFF_P_SPI_Configure(), DIFF_P_SPI_Initialize(), DIFF_P_SPI_ReadData(), DIFF_P_SPI_SetIdleTask(), int32_t(), NPS3000VV_PRESSURE_DIV_FACTOR, NPS3001DV_PRESSURE_DIV_FACTOR, NPS3002VV_PRESSURE_DIV_FACTOR, NPS3005DV_PRESSURE_DIV_FACTOR, diff_p_spi_sensorhandle_t::pCommDrv, diff_p_pressuredata_t::pressure, rawData, SENSOR_ERROR_NONE, Sensor_SPI_Write(), diff_p_spi_sensorhandle_t::slaveParams, SMC, SMC_SetPowerModeWait(), SPI_S_BAUDRATE, SPI_S_DEVICE_INDEX, SPI_S_DRIVER, SPI_S_SIGNAL_EVENT, SPIdrv, status, and diff_p_pressuredata_t::temperature.
const registerwritelist_t cDiffPClearStatusBits[] |
Register settings for Clearing Pressure and Temperature Data Ready Bits.
Definition at line 74 of file diff_p_spi.c.
const registerwritelist_t cDiffPConfigNormal[] |
Register settings for Normal (non buffered) mode.
Definition at line 68 of file diff_p_spi.c.
const registerreadlist_t cDiffPOutputNormal[] |
Address and size of Raw Pressure+Temperature Data in Normal Mode.
Definition at line 81 of file diff_p_spi.c.
const registerreadlist_t cDiffPStatus[] = {{.readFrom = DIFF_P_INT_STATUS_0, .numBytes = 1}, __END_READ_DATA__} |
Address of Status Register.
Definition at line 78 of file diff_p_spi.c.