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

The fxos8700_interrupt.c file implements the ISSDK FXOS8700 sensor driver example demonstration with interrupt mode. More...

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

Go to the source code of this file.

Macros

#define RAW_ACCEL_DATA_SIZE   (6)
 

Functions

void fxos8700_isr_callback (void *pUserData)
 This is the Sensor Data Ready ISR implementation. More...
 
int main (void)
 This is the The main function implementation. More...
 

Variables

const registerwritelist_t fxos8700_Config_Interrupt []
 
const registerreadlist_t FXOS8700_STATUS_READ [] = {{.readFrom = FXOS8700_STATUS, .numBytes = 1}, __END_READ_DATA__}
 
const registerreadlist_t FXOS8700_ACCEL_READ []
 
volatile bool fxos8700Interrupt = false
 

Detailed Description

The fxos8700_interrupt.c file implements the ISSDK FXOS8700 sensor driver example demonstration with interrupt mode.

Definition in file fxos8700_interrupt.c.

Macro Definition Documentation

◆ RAW_ACCEL_DATA_SIZE

#define RAW_ACCEL_DATA_SIZE   (6)

Definition at line 38 of file fxos8700_interrupt.c.

Referenced by main().

Function Documentation

◆ fxos8700_isr_callback()

void fxos8700_isr_callback ( void *  pUserData)

This is the Sensor Data Ready ISR implementation.


This function sets the flag which indicates if a new sample(s) is available for reading.

Parameters
[in]pUserDataThis is a void pointer to the instance of the user specific data structure for the ISR.
Returns
void There is no return value.
Constraints:
None

Yes

Set flag to indicate Sensor has signalled data ready.

Definition at line 80 of file fxos8700_interrupt.c.

References fxos8700Interrupt.

Referenced by main().

Here is the caller graph for this function:

◆ main()

int main ( void  )

This is the The main function implementation.


This function invokes board initializes routines, then then brings up the sensor and finally enters an endless loop to continuously read available samples.

Parameters
[in]voidThis is no input parameter.
Returns
void There is no return value.
Constraints:
None

No

Initialize the MCU hardware.

Initialize INT1_FXOS8700 pin used by FRDM board

Initialize RGB LED pin used by FRDM board

Initialize the I2C driver.

Set the I2C Power mode.

Set the I2C bus speed.

Initialize the FXOS8700 sensor driver.

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

Configure the fxos8700 sensor driver.

Clear the data ready flag, it will be set again by the ISR.

Read the raw sensor data from the fxos8700.

Convert the raw sensor data to signed 16-bit container for display to the debug port.

Definition at line 94 of file fxos8700_interrupt.c.

References fxos8700_accelmagdata_t::accel, ASK_USER_TO_RESUME, BOARD_BootClockRUN, BOARD_InitDebugConsole(), BOARD_InitPins(), data, Driver_GPIO_KSDK, FXOS8700_I2C_ADDR, FXOS8700_I2C_Configure(), FXOS8700_I2C_Initialize(), FXOS8700_I2C_ReadData(), FXOS8700_I2C_SetIdleTask(), FXOS8700_INT2, fxos8700_isr_callback(), FXOS8700_WHO_AM_I_PROD_VALUE, fxos8700Interrupt, GPIO_DIRECTION_IN, GPIO_DIRECTION_OUT, GREEN_LED, I2C_S_DEVICE_INDEX, I2C_S_DRIVER, I2C_S_SIGNAL_EVENT, I2Cdrv, int32_t(), GENERIC_DRIVER_GPIO::pin_init, RAW_ACCEL_DATA_SIZE, rawData, SENSOR_ERROR_NONE, SMC, SMC_SetPowerModeVlpr(), SMC_SetPowerModeWait(), status, and GENERIC_DRIVER_GPIO::toggle_pin.

Here is the call graph for this function:

Variable Documentation

◆ FXOS8700_ACCEL_READ

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

Command definition to read the Accel Data

Definition at line 61 of file fxos8700_interrupt.c.

◆ fxos8700_Config_Interrupt

const registerwritelist_t fxos8700_Config_Interrupt[]
Initial value:
= {
#define FXOS8700_M_CTRL_REG2_M_AUTOINC_MASK
Definition: fxos8700.h:2634
#define FXOS8700_CTRL_REG5_INT_CFG_DRDY_MASK
Definition: fxos8700.h:1784
#define FXOS8700_CTRL_REG4_INT_EN_DRDY_EN
Definition: fxos8700.h:1755
#define FXOS8700_CTRL_REG1_DR_MASK
Definition: fxos8700.h:1504
#define FXOS8700_CTRL_REG1_DR_SINGLE_12P5_HZ
Definition: fxos8700.h:1523
#define __END_WRITE_DATA__
Definition: sensor_drv.h:45
#define FXOS8700_CTRL_REG3_PP_OD_MASK
Definition: fxos8700.h:1629
#define FXOS8700_CTRL_REG4_INT_EN_DRDY_MASK
Definition: fxos8700.h:1711
#define FXOS8700_CTRL_REG5_INT_CFG_DRDY_INT2
Definition: fxos8700.h:1826
#define FXOS8700_M_CTRL_REG2_M_AUTOINC_ACCEL_ONLY_MODE
Definition: fxos8700.h:2653
#define FXOS8700_CTRL_REG3_PP_OD_PUSH_PULL
Definition: fxos8700.h:1681
#define FXOS8700_CTRL_REG3_IPOL_MASK
Definition: fxos8700.h:1632
#define FXOS8700_CTRL_REG3_IPOL_ACTIVE_HIGH
Definition: fxos8700.h:1680

Prepare the register write list to configure FXAS21002 in non-FIFO mode.

Definition at line 44 of file fxos8700_interrupt.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 58 of file fxos8700_interrupt.c.

◆ fxos8700Interrupt

volatile bool fxos8700Interrupt = false

Definition at line 67 of file fxos8700_interrupt.c.

Referenced by fxos8700_isr_callback(), and main().