![]() |
ISSDK
1.7
IoT Sensing Software Development Kit
|
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"
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 [] |
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.
#define RAW_ACCELMAG_DATA_SIZE (12) |
Definition at line 64 of file fxos8700_poll_spi.c.
Referenced by 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 93 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_SetPowerModeWait(), SPI_S_BAUDRATE, SPI_S_DEVICE_INDEX, SPI_S_DRIVER, SPI_S_SIGNAL_EVENT, and status.
const registerreadlist_t FXOS8700_ACCELMAG_READ[] |
Command definition to read the Accel + Mag Data
Definition at line 84 of file fxos8700_poll_spi.c.
const registerwritelist_t fxos8700_Config_Hybrid[] |
Prepare the register write list to configure FXOS8700 in Hybrid mode.
Definition at line 70 of file fxos8700_poll_spi.c.
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 81 of file fxos8700_poll_spi.c.