ISSDK  1.7
IoT Sensing Software Development Kit
Macros | Functions
pedometer.c File Reference

The pedometer.c file contains the interface definitions for pedometer application. More...

#include "pedometer.h"
Include dependency graph for pedometer.c:

Go to the source code of this file.

Macros

#define PEDOMETER_STATUS_ACTIVITY_BITNUM   0
 
#define PEDOMETER_STATUS_SUSPEND_BITNUM   3
 
#define PEDOMETER_STATUS_ACTCHG_BITNUM   4
 
#define PEDOMETER_STATUS_STEPCHG_BITNUM   5
 
#define PEDOMETER_STATUS_SUSPCHG_BITNUM   6
 
#define PEDOMETER_STATUS_MRGFLG_BITNUM   7
 
#define PEDOMETER_STATUS_ACTIVITY_MASK   (7 << PEDOMETER_STATUS_ACTIVITY_BITNUM)
 
#define PEDOMETER_STATUS_SUSPEND_MASK   (1 << PEDOMETER_STATUS_SUSPEND_BITNUM)
 
#define PEDOMETER_STATUS_ACTCHG_MASK   (1 << PEDOMETER_STATUS_ACTCHG_BITNUM)
 
#define PEDOMETER_STATUS_STEPCHG_MASK   (1 << PEDOMETER_STATUS_STEPCHG_BITNUM)
 
#define PEDOMETER_STATUS_SUSPCHG_MASK   (1 << PEDOMETER_STATUS_SUSPCHG_BITNUM)
 
#define PEDOMETER_STATUS_MRGFLG_MASK   (1 << PEDOMETER_STATUS_MRGFLG_BITNUM)
 
#define PEDOMETER_STATUS_CHG_MASK   (PEDOMETER_STATUS_ACTCHG_MASK | PEDOMETER_STATUS_STEPCHG_MASK | PEDOMETER_STATUS_SUSPCHG_MASK)
 
#define SQUARED(x)   ((x) * (x))
 

Functions

void pedometer_init (pedometer_t *pPedometer)
 The interface function initialize the pedometer. More...
 
void pedometer_configure (pedometer_t *pPedometer, const pedometer_config_t *pConfig)
 The interface function to configure the pedometer. More...
 
int32_t pedometer_run (pedometer_t *pPedometer, ped_accel_t *pData)
 The interface function excutes the pedometer algorithm. More...
 

Detailed Description

The pedometer.c file contains the interface definitions for pedometer application.

Definition in file pedometer.c.

Macro Definition Documentation

◆ PEDOMETER_STATUS_ACTCHG_BITNUM

#define PEDOMETER_STATUS_ACTCHG_BITNUM   4

Definition at line 51 of file pedometer.c.

◆ PEDOMETER_STATUS_ACTCHG_MASK

#define PEDOMETER_STATUS_ACTCHG_MASK   (1 << PEDOMETER_STATUS_ACTCHG_BITNUM)

Definition at line 58 of file pedometer.c.

◆ PEDOMETER_STATUS_ACTIVITY_BITNUM

#define PEDOMETER_STATUS_ACTIVITY_BITNUM   0

Definition at line 49 of file pedometer.c.

◆ PEDOMETER_STATUS_ACTIVITY_MASK

#define PEDOMETER_STATUS_ACTIVITY_MASK   (7 << PEDOMETER_STATUS_ACTIVITY_BITNUM)

Definition at line 56 of file pedometer.c.

◆ PEDOMETER_STATUS_CHG_MASK

Definition at line 63 of file pedometer.c.

◆ PEDOMETER_STATUS_MRGFLG_BITNUM

#define PEDOMETER_STATUS_MRGFLG_BITNUM   7

Definition at line 54 of file pedometer.c.

◆ PEDOMETER_STATUS_MRGFLG_MASK

#define PEDOMETER_STATUS_MRGFLG_MASK   (1 << PEDOMETER_STATUS_MRGFLG_BITNUM)

Definition at line 61 of file pedometer.c.

◆ PEDOMETER_STATUS_STEPCHG_BITNUM

#define PEDOMETER_STATUS_STEPCHG_BITNUM   5

Definition at line 52 of file pedometer.c.

◆ PEDOMETER_STATUS_STEPCHG_MASK

#define PEDOMETER_STATUS_STEPCHG_MASK   (1 << PEDOMETER_STATUS_STEPCHG_BITNUM)

Definition at line 59 of file pedometer.c.

◆ PEDOMETER_STATUS_SUSPCHG_BITNUM

#define PEDOMETER_STATUS_SUSPCHG_BITNUM   6

Definition at line 53 of file pedometer.c.

◆ PEDOMETER_STATUS_SUSPCHG_MASK

#define PEDOMETER_STATUS_SUSPCHG_MASK   (1 << PEDOMETER_STATUS_SUSPCHG_BITNUM)

Definition at line 60 of file pedometer.c.

◆ PEDOMETER_STATUS_SUSPEND_BITNUM

#define PEDOMETER_STATUS_SUSPEND_BITNUM   3

Definition at line 50 of file pedometer.c.

◆ PEDOMETER_STATUS_SUSPEND_MASK

#define PEDOMETER_STATUS_SUSPEND_MASK   (1 << PEDOMETER_STATUS_SUSPEND_BITNUM)

Definition at line 57 of file pedometer.c.

◆ SQUARED

#define SQUARED (   x)    ((x) * (x))

Definition at line 65 of file pedometer.c.

Function Documentation

◆ pedometer_configure()

void pedometer_configure ( pedometer_t pPedometer,
const pedometer_config_t pConfig 
)

The interface function to configure the pedometer.

Parameters
[in]pedometer_thandle to the pedometer.
[in]configconfiguration value.
Returns
void.
Constraints:
None
Reentrant: Yes

Definition at line 137 of file pedometer.c.

References pedometer_t::config, pedometer_config_t::frequency, pedometer_config_t::keynetik, pedometer_config_t::oneG, pedometer_t::private, and pedometer_t::pedometer_private_tag::stepchg_stepcount.

Referenced by main().

Here is the caller graph for this function:

◆ pedometer_init()

void pedometer_init ( pedometer_t pPedometer)

The interface function initialize the pedometer.

This function initialize the pedometer structure and return the handle.

Parameters
[in]pPedometerhandle to the pedometer.
Returns
void.
Constraints:
None
Reentrant: Yes

Definition at line 123 of file pedometer.c.

Referenced by main().

Here is the caller graph for this function:

◆ pedometer_run()

int32_t pedometer_run ( pedometer_t pPedometer,
ped_accel_t pData 
)

The interface function excutes the pedometer algorithm.

Call this function the rate at which accelerometer runs.

Parameters
[in]pPedometerhandle to the pedometer.
[in]accel_dataacceleration data.
Returns
pedometer_run() returns the status .
Constraints:
None
Reentrant: Yes

Definition at line 151 of file pedometer.c.

Referenced by main().

Here is the caller graph for this function: