![]() |
ISSDK
1.8
IoT Sensing Software Development Kit
|
The pedometer.c file contains the interface definitions for pedometer application. More...
#include "pedometer.h"
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... | |
The pedometer.c file contains the interface definitions for pedometer application.
Definition in file pedometer.c.
#define PEDOMETER_STATUS_ACTCHG_BITNUM 4 |
Definition at line 25 of file pedometer.c.
#define PEDOMETER_STATUS_ACTCHG_MASK (1 << PEDOMETER_STATUS_ACTCHG_BITNUM) |
Definition at line 32 of file pedometer.c.
#define PEDOMETER_STATUS_ACTIVITY_BITNUM 0 |
Definition at line 23 of file pedometer.c.
#define PEDOMETER_STATUS_ACTIVITY_MASK (7 << PEDOMETER_STATUS_ACTIVITY_BITNUM) |
Definition at line 30 of file pedometer.c.
#define PEDOMETER_STATUS_CHG_MASK (PEDOMETER_STATUS_ACTCHG_MASK | PEDOMETER_STATUS_STEPCHG_MASK | PEDOMETER_STATUS_SUSPCHG_MASK) |
Definition at line 37 of file pedometer.c.
#define PEDOMETER_STATUS_MRGFLG_BITNUM 7 |
Definition at line 28 of file pedometer.c.
#define PEDOMETER_STATUS_MRGFLG_MASK (1 << PEDOMETER_STATUS_MRGFLG_BITNUM) |
Definition at line 35 of file pedometer.c.
#define PEDOMETER_STATUS_STEPCHG_BITNUM 5 |
Definition at line 26 of file pedometer.c.
#define PEDOMETER_STATUS_STEPCHG_MASK (1 << PEDOMETER_STATUS_STEPCHG_BITNUM) |
Definition at line 33 of file pedometer.c.
#define PEDOMETER_STATUS_SUSPCHG_BITNUM 6 |
Definition at line 27 of file pedometer.c.
#define PEDOMETER_STATUS_SUSPCHG_MASK (1 << PEDOMETER_STATUS_SUSPCHG_BITNUM) |
Definition at line 34 of file pedometer.c.
#define PEDOMETER_STATUS_SUSPEND_BITNUM 3 |
Definition at line 24 of file pedometer.c.
#define PEDOMETER_STATUS_SUSPEND_MASK (1 << PEDOMETER_STATUS_SUSPEND_BITNUM) |
Definition at line 31 of file pedometer.c.
#define SQUARED | ( | x | ) | ((x) * (x)) |
Definition at line 39 of file pedometer.c.
void pedometer_configure | ( | pedometer_t * | pPedometer, |
const pedometer_config_t * | pConfig | ||
) |
The interface function to configure the pedometer.
[in] | pedometer_t | handle to the pedometer. |
[in] | config | configuration value. |
Definition at line 111 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().
void pedometer_init | ( | pedometer_t * | pPedometer | ) |
The interface function initialize the pedometer.
This function initialize the pedometer structure and return the handle.
[in] | pPedometer | handle to the pedometer. |
Definition at line 97 of file pedometer.c.
Referenced by main().
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.
[in] | pPedometer | handle to the pedometer. |
[in] | accel_data | acceleration data. |
Definition at line 125 of file pedometer.c.
Referenced by main().