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

The fxos8700_poll_spi.c file implements the ISSDK FXOS8700 SPI sensor driver example demonstration for SPI Mode with polling. More...

#include "board.h"
#include "pin_mux.h"
#include "clock_config.h"
#include "fsl_debug_console.h"
#include "issdk_hal.h"
#include "gpio_driver.h"
#include "fxos8700_drv.h"
#include "Driver_SPI.h"
Include dependency graph for fxos8700_poll_spi.c:

Go to the source code of this file.

Macros

#define RAW_ACCELMAG_DATA_SIZE   (12)
 

Functions

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

Variables

const registerwritelist_t fxos8700_Config_Hybrid []
 
const registerreadlist_t FXOS8700_STATUS_READ [] = {{.readFrom = FXOS8700_STATUS, .numBytes = 1}, __END_READ_DATA__}
 
const registerreadlist_t FXOS8700_ACCELMAG_READ []
 

Detailed Description

The fxos8700_poll_spi.c file implements the ISSDK FXOS8700 SPI sensor driver example demonstration for SPI Mode with polling.

Definition in file fxos8700_poll_spi.c.

Macro Definition Documentation

◆ RAW_ACCELMAG_DATA_SIZE

#define RAW_ACCELMAG_DATA_SIZE   (12)

Definition at line 38 of file fxos8700_poll_spi.c.

Referenced by main().

Function Documentation

◆ main()

int main ( void  )

Main function.

Initialize the MCU hardware.

Initialize the SPI driver.

Set the SPI Power mode.

Set the SPI Slave speed.

Initialize the FXOS8700 sensor driver.

Set the task to be executed while waiting for SPI transactions to complete.

Configure the FXAS21002 sensor driver.

Wait for data ready from the FXAS21002.

Read the raw sensor data from the fxos8700.

Convert the raw sensor data for display to the debug port.

Definition at line 67 of file fxos8700_poll_spi.c.

References fxos8700_accelmagdata_t::accel, BOARD_BootClockRUN, BOARD_InitDebugConsole(), BOARD_InitPins(), data, FXOS8700_CS, FXOS8700_DR_STATUS_ZYXDR_MASK, FXOS8700_SPI_Configure(), FXOS8700_SPI_Initialize(), FXOS8700_SPI_ReadData(), FXOS8700_SPI_SetIdleTask(), FXOS8700_WHO_AM_I_PROD_VALUE, int32_t(), fxos8700_accelmagdata_t::mag, RAW_ACCELMAG_DATA_SIZE, rawData, SENSOR_ERROR_NONE, SMC, SMC_SetPowerModeVlpr(), SPI_S_BAUDRATE, SPI_S_DEVICE_INDEX, SPI_S_DRIVER, SPI_S_SIGNAL_EVENT, and status.

Here is the call graph for this function:

Variable Documentation

◆ FXOS8700_ACCELMAG_READ

const registerreadlist_t FXOS8700_ACCELMAG_READ[]
Initial value:
= {{.readFrom = FXOS8700_OUT_X_MSB, .numBytes = 12},
#define __END_READ_DATA__
Definition: sensor_drv.h:51

Command definition to read the Accel + Mag Data

Definition at line 58 of file fxos8700_poll_spi.c.

◆ fxos8700_Config_Hybrid

const registerwritelist_t fxos8700_Config_Hybrid[]
Initial value:
= {
#define FXOS8700_M_CTRL_REG2_M_AUTOINC_MASK
Definition: fxos8700.h:2634
#define FXOS8700_M_CTRL_REG1_M_HMS_MASK
Definition: fxos8700.h:2547
#define FXOS8700_CTRL_REG1_DR_MASK
Definition: fxos8700.h:1504
#define FXOS8700_M_CTRL_REG1_M_HMS_HYBRID_MODE
Definition: fxos8700.h:2595
#define FXOS8700_CTRL_REG1_DR_SINGLE_12P5_HZ
Definition: fxos8700.h:1523
#define __END_WRITE_DATA__
Definition: sensor_drv.h:45
#define FXOS8700_M_CTRL_REG2_M_AUTOINC_HYBRID_MODE
Definition: fxos8700.h:2641
#define FXOS8700_M_CTRL_REG1_M_ACAL_EN
Definition: fxos8700.h:2566
#define FXOS8700_M_CTRL_REG1_M_ACAL_MASK
Definition: fxos8700.h:2559
#define FXOS8700_M_CTRL_REG2_M_RST_CNT_DISABLE
Definition: fxos8700.h:2667
#define FXOS8700_M_CTRL_REG2_M_RST_CNT_MASK
Definition: fxos8700.h:2622

Prepare the register write list to configure FXOS8700 in Hybrid mode.

Definition at line 44 of file fxos8700_poll_spi.c.

◆ FXOS8700_STATUS_READ

const registerreadlist_t FXOS8700_STATUS_READ[] = {{.readFrom = FXOS8700_STATUS, .numBytes = 1}, __END_READ_DATA__}

Command definition to read the Data Ready Status

Definition at line 55 of file fxos8700_poll_spi.c.