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

The mag3110_normal.c file implements the ISSDK MAG3110 sensor driver example demonstration with polling 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 "mag3110_drv.h"
Include dependency graph for mag3110_normal.c:

Go to the source code of this file.

Macros

#define MAG3110_DATA_SIZE   (6) /* 2 byte X,Y,Z Axis Data each. */
 

Functions

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

Variables

const registerwritelist_t cMag3110ConfigNormal []
 Register settings for Normal (non buffered) mode. More...
 
const registerreadlist_t cMag3110Status [] = {{.readFrom = MAG3110_DR_STATUS, .numBytes = 1}, __END_READ_DATA__}
 Address of Status Register. More...
 
const registerreadlist_t cMag3110OutputNormal []
 Address and size of Raw Pressure+Temperature Data in Normal Mode. More...
 

Detailed Description

The mag3110_normal.c file implements the ISSDK MAG3110 sensor driver example demonstration with polling mode.

Definition in file mag3110_normal.c.

Macro Definition Documentation

◆ MAG3110_DATA_SIZE

#define MAG3110_DATA_SIZE   (6) /* 2 byte X,Y,Z Axis Data each. */

Definition at line 37 of file mag3110_normal.c.

Referenced by main().

Function Documentation

◆ main()

int main ( void  )

Main function.

Initialize the I2C driver.

Set the I2C Power mode.

Set the I2C bus speed.

Initialize MAG3110 sensor driver.

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

Configure the MAG3110 sensor driver.

Wait for data ready from the FXAS21002.

Read the raw sensor data from the FXAS21002.

Process the sample and convert the raw sensor data to signed 16-bit container.

Definition at line 65 of file mag3110_normal.c.

References ASK_USER_TO_RESUME, BOARD_BootClockRUN, BOARD_InitDebugConsole(), BOARD_InitPins(), data, I2C_S_DEVICE_INDEX, I2C_S_DRIVER, I2C_S_SIGNAL_EVENT, I2Cdrv, int32_t(), mag3110_magdata_t::mag, MAG3110_CalibrateHardIronOffset(), MAG3110_DATA_SIZE, MAG3110_DR_STATUS_ZYXDR_MASK, MAG3110_I2C_ADDR, MAG3110_I2C_Configure(), MAG3110_I2C_Initialize(), MAG3110_I2C_ReadData(), MAG3110_I2C_SetIdleTask(), MAG3110_WHOAMI_VALUE, rawData, SENSOR_ERROR_NONE, SMC, SMC_SetPowerModeVlpr(), and status.

Here is the call graph for this function:

Variable Documentation

◆ cMag3110ConfigNormal

const registerwritelist_t cMag3110ConfigNormal[]
Initial value:
= {
#define MAG3110_CTRL_REG1_DR_ODR_2
Definition: mag3110.h:423
#define MAG3110_CTRL_REG2_MAG_RST_EN
Definition: mag3110.h:471
#define MAG3110_CTRL_REG2_MAG_RST_MASK
Definition: mag3110.h:458
#define __END_WRITE_DATA__
Definition: sensor_drv.h:45
#define MAG3110_CTRL_REG1_DR_MASK
Definition: mag3110.h:404
#define MAG3110_CTRL_REG1_OS_MASK
Definition: mag3110.h:401
#define MAG3110_CTRL_REG2_AUTO_MSRT_EN_MASK
Definition: mag3110.h:464
#define MAG3110_CTRL_REG2_RAW_RAW
Definition: mag3110.h:474
#define MAG3110_CTRL_REG2_AUTO_MSRT_EN_EN
Definition: mag3110.h:477
#define MAG3110_CTRL_REG1_OS_OSR_32
Definition: mag3110.h:418
#define MAG3110_CTRL_REG2_RAW_MASK
Definition: mag3110.h:461

Register settings for Normal (non buffered) mode.

Definition at line 43 of file mag3110_normal.c.

◆ cMag3110OutputNormal

const registerreadlist_t cMag3110OutputNormal[]
Initial value:
= {{.readFrom = MAG3110_OUT_X_MSB, .numBytes = MAG3110_DATA_SIZE},
#define __END_READ_DATA__
Definition: sensor_drv.h:51
#define MAG3110_DATA_SIZE

Address and size of Raw Pressure+Temperature Data in Normal Mode.

Definition at line 56 of file mag3110_normal.c.

◆ cMag3110Status

const registerreadlist_t cMag3110Status[] = {{.readFrom = MAG3110_DR_STATUS, .numBytes = 1}, __END_READ_DATA__}

Address of Status Register.

Definition at line 53 of file mag3110_normal.c.