![]() |
ISSDK
1.8
IoT Sensing Software Development Kit
|
The mag3110_normal_interrupt.c file implements the ISSDK MAG3110 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 "mag3110_drv.h"
Go to the source code of this file.
Macros | |
#define | MAG3110_DATA_SIZE (6) /* 2 byte X,Y,Z Axis Data each. */ |
Functions | |
void | mag3110_int_data_ready_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 | cMag3110ConfigNormal [] |
Register settings for Normal (non buffered) mode since Interrupt is enabled implicitly. More... | |
const registerreadlist_t | cMag3110OutputNormal [] |
Address and size of Raw Pressure+Temperature Data in Normal Mode. More... | |
volatile bool | gMag3110DataReady |
The mag3110_normal_interrupt.c file implements the ISSDK MAG3110 sensor driver example demonstration with interrupt mode.
Definition in file mag3110_normal_interrupt.c.
#define MAG3110_DATA_SIZE (6) /* 2 byte X,Y,Z Axis Data each. */ |
Definition at line 38 of file mag3110_normal_interrupt.c.
Referenced by main().
void mag3110_int_data_ready_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.
[in] | pUserData | This is a void pointer to the instance of the user specific data structure for the ISR. |
Set flag to indicate Sensor has signalled data ready.
Definition at line 73 of file mag3110_normal_interrupt.c.
References gMag3110DataReady.
Referenced by 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.
[in] | void | This is no input parameter. |
Initialize the MCU hardware.
Initialize MAG3110 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 MAG3110 sensor driver.
Set the task to be executed while waiting for I2C transactions to complete.
Configure the MAG3110 sensor driver.
Clear the data ready flag, it will be set again by the ISR.
Read the raw sensor data from the MAG3110.
Process the sample and convert the raw sensor data to signed 16-bit container.
Definition at line 87 of file mag3110_normal_interrupt.c.
References ASK_USER_TO_RESUME, BOARD_BootClockRUN, BOARD_InitDebugConsole(), BOARD_InitPins(), data, Driver_GPIO_KSDK, gMag3110DataReady, GPIO_DIRECTION_IN, GPIO_DIRECTION_OUT, GREEN_LED, I2C_S_DEVICE_INDEX, I2C_S_DRIVER, I2C_S_SIGNAL_EVENT, I2Cdrv, int32_t(), mag3110_magdata_t::mag, MAG3110_CalibrateHardIronOffset(), MAG3110_DATA_SIZE, MAG3110_I2C_ADDR, MAG3110_I2C_Configure(), MAG3110_I2C_Initialize(), MAG3110_I2C_ReadData(), MAG3110_I2C_SetIdleTask(), MAG3110_INT1, mag3110_int_data_ready_callback(), MAG3110_WHOAMI_VALUE, pGpioDriver, GENERIC_DRIVER_GPIO::pin_init, rawData, SENSOR_ERROR_NONE, SMC, SMC_SetPowerModeVlpr(), SMC_SetPowerModeWait(), status, and GENERIC_DRIVER_GPIO::toggle_pin.
const registerwritelist_t cMag3110ConfigNormal[] |
Register settings for Normal (non buffered) mode since Interrupt is enabled implicitly.
Definition at line 44 of file mag3110_normal_interrupt.c.
const registerreadlist_t cMag3110OutputNormal[] |
Address and size of Raw Pressure+Temperature Data in Normal Mode.
Definition at line 54 of file mag3110_normal_interrupt.c.
volatile bool gMag3110DataReady |
Definition at line 60 of file mag3110_normal_interrupt.c.
Referenced by mag3110_int_data_ready_callback(), and main().