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

The pedometer_stepcount_fxls8974cf.c file implements the ISSDK FXLS8974CF 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 "fxls8974_drv.h"
Include dependency graph for pedometer_stepcount_fxls8974cf.c:

Go to the source code of this file.

Macros

#define FXLS8974_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 cFxls8974ConfigInitialize []
 FXLS896x Motion based Pedometer Register Write List. More...
 
const registerreadlist_t cFxls8974DRDYEvent [] = {{.readFrom = FXLS8974_INT_STATUS, .numBytes = 1}, __END_READ_DATA__}
 Address of DATA Ready Status Register. More...
 
const registerreadlist_t cFxls8974Output [] = {{.readFrom = FXLS8974_OUT_X_LSB, .numBytes = FXLS8974_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_fxls8974cf.c file implements the ISSDK FXLS8974CF sensor driver example demonstration for Motion Activated Pedometer.

Definition in file pedometer_stepcount_fxls8974cf.c.

Macro Definition Documentation

◆ FXLS8974_DATA_SIZE

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

Definition at line 38 of file pedometer_stepcount_fxls8974cf.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 FXLS896x sensor driver.

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

Configure the FXLS896x sensor.

Initialize the pedometer

Configure the pedometer

Wait for data ready from the FXLS896x.

Read the Output from the FXLS896x.

Convert the raw sensor data for feeding to pedometer algorithm.

Execute the pedometer Algorithm

Definition at line 103 of file pedometer_stepcount_fxls8974cf.c.

References fxls8974_acceldata_t::accel, BOARD_BootClockRUN, BOARD_InitDebugConsole(), BOARD_InitPins(), data, Driver_GPIO_KSDK, FXLS8962_WHOAMI_VALUE, FXLS8964_WHOAMI_VALUE, FXLS8967_WHOAMI_VALUE, FXLS8968_WHOAMI_VALUE, FXLS8974_DATA_SIZE, FXLS8974_I2C_ADDR, FXLS8974_I2C_Configure(), FXLS8974_I2C_Initialize(), FXLS8974_I2C_ReadData(), FXLS8974_I2C_SetIdleTask(), FXLS8974_INT_STATUS_SRC_DRDY_MASK, FXLS8974_WHOAMI_VALUE, fxls8974Driver, 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

◆ cFxls8974ConfigInitialize

const registerwritelist_t cFxls8974ConfigInitialize[]
Initial value:

FXLS896x Motion based Pedometer Register Write List.

Definition at line 44 of file pedometer_stepcount_fxls8974cf.c.

◆ cFxls8974DRDYEvent

const registerreadlist_t cFxls8974DRDYEvent[] = {{.readFrom = FXLS8974_INT_STATUS, .numBytes = 1}, __END_READ_DATA__}

Address of DATA Ready Status Register.

Definition at line 52 of file pedometer_stepcount_fxls8974cf.c.

◆ cFxls8974Output

const registerreadlist_t cFxls8974Output[] = {{.readFrom = FXLS8974_OUT_X_LSB, .numBytes = FXLS8974_DATA_SIZE}, __END_READ_DATA__}

Address of Data Output Registers.

Definition at line 55 of file pedometer_stepcount_fxls8974cf.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_fxls8974cf.c.

◆ pActivity

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

Pedometer Mode Name Strings.

Definition at line 58 of file pedometer_stepcount_fxls8974cf.c.