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

The pedometer_stepcount_fxls8962.c file implements the ISSDK FXLS896XAF sensor driver example demonstration for Motion Activated Pedometer. 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 "pedometer.h"
#include "gpio_driver.h"
#include "fxls8962_drv.h"
Include dependency graph for pedometer_stepcount_fxls8962.c:

Go to the source code of this file.

Macros

#define FXLS8962_DATA_SIZE   6 /* 2 byte X,Y,Z Axis Data each. */
 

Functions

int main (void)
 This is the The main function implementation. More...
 

Variables

const registerwritelist_t cFxls8962ConfigInitialize []
 FXLS8962 Motion based Pedometer Register Write List. More...
 
const registerreadlist_t cFxls8962DRDYEvent [] = {{.readFrom = FXLS8962_INT_STATUS, .numBytes = 1}, __END_READ_DATA__}
 Address of DATA Ready Status Register. More...
 
const registerreadlist_t cFxls8962Output [] = {{.readFrom = FXLS8962_OUT_X_LSB, .numBytes = FXLS8962_DATA_SIZE}, __END_READ_DATA__}
 Address of Data Output Registers. More...
 
const char * pActivity [5] = {"Unknown ", "Rest ", "Walking ", "Jogging ", "Running "}
 Pedometer Mode Name Strings. More...
 
gpioConfigKSDK_t gpioConfigINT1
 

Detailed Description

The pedometer_stepcount_fxls8962.c file implements the ISSDK FXLS896XAF sensor driver example demonstration for Motion Activated Pedometer.

The pedometer_stepcount_fxls8962.c file implements the ISSDK FXLS8962 sensor driver example demonstration for Motion Activated Pedometer.

Definition in file pedometer_stepcount_fxls8962.c.

Macro Definition Documentation

◆ FXLS8962_DATA_SIZE

#define FXLS8962_DATA_SIZE   6 /* 2 byte X,Y,Z Axis Data each. */

Definition at line 38 of file pedometer_stepcount_fxls8962.c.

Referenced by main().

Function Documentation

◆ 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.

void There is no return value.

Initialize the MCU hardware.

Initialize RGB LED pin used by FRDM board

Initialize the I2C driver.

Set the I2C Power mode.

Set the I2C bus speed.

Initialize FXLS8962 sensor driver.

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

Configure the FXLS8962 sensor.

Initialize the pedometer

Configure the pedometer

Wait for data ready from the FXLS8962.

Read the Output from the FXLS8962.

Convert the raw sensor data for feeding to pedometer algorithm.

Execute the pedometer Algorithm

Definition at line 103 of file pedometer_stepcount_fxls8962.c.

References fxls8962_acceldata_t::accel, BOARD_BootClockRUN, BOARD_InitDebugConsole(), BOARD_InitPins(), data, Driver_GPIO_KSDK, FXLS8962_DATA_SIZE, FXLS8962_I2C_ADDR, FXLS8962_I2C_Configure(), FXLS8962_I2C_Initialize(), FXLS8962_I2C_ReadData(), FXLS8962_I2C_SetIdleTask(), FXLS8962_INT_STATUS_SRC_DRDY_MASK, FXLS8962_WHOAMI_VALUE, FXLS8964_WHOAMI_VALUE, FXLS8967_WHOAMI_VALUE, FXLS8974_WHOAMI_VALUE, GPIO_DIRECTION_OUT, GREEN_LED, I2C_S_DEVICE_INDEX, I2C_S_DRIVER, I2C_S_SIGNAL_EVENT, I2Cdrv, int32_t(), pedometer_configure(), pedometer_init(), pedometer_run(), pGpioDriver, GENERIC_DRIVER_GPIO::pin_init, rawData, SENSOR_ERROR_NONE, GENERIC_DRIVER_GPIO::set_pin, SMC, SMC_SetPowerModeWait(), pedometer_t::status, status, pedometer_t::pedometer_status_tag::stepcount, and GENERIC_DRIVER_GPIO::toggle_pin.

Here is the call graph for this function:

Variable Documentation

◆ cFxls8962ConfigInitialize

const registerwritelist_t cFxls8962ConfigInitialize[]
Initial value:

FXLS8962 Motion based Pedometer Register Write List.

Definition at line 44 of file pedometer_stepcount_fxls8962.c.

◆ cFxls8962DRDYEvent

const registerreadlist_t cFxls8962DRDYEvent[] = {{.readFrom = FXLS8962_INT_STATUS, .numBytes = 1}, __END_READ_DATA__}

Address of DATA Ready Status Register.

Definition at line 52 of file pedometer_stepcount_fxls8962.c.

◆ cFxls8962Output

const registerreadlist_t cFxls8962Output[] = {{.readFrom = FXLS8962_OUT_X_LSB, .numBytes = FXLS8962_DATA_SIZE}, __END_READ_DATA__}

Address of Data Output Registers.

Definition at line 55 of file pedometer_stepcount_fxls8962.c.

◆ gpioConfigINT1

gpioConfigKSDK_t gpioConfigINT1
Initial value:
=
{
.pinConfig = {kGPIO_DigitalInput, 0},
.portPinConfig = {.pullSelect = kPORT_PullUp, .mux = kPORT_MuxAsGpio},
.interruptMode = kPORT_InterruptFallingEdge,
}

Definition at line 85 of file pedometer_stepcount_fxls8962.c.

◆ pActivity

const char* pActivity[5] = {"Unknown ", "Rest ", "Walking ", "Jogging ", "Running "}

Pedometer Mode Name Strings.

Definition at line 58 of file pedometer_stepcount_fxls8962.c.