ISSDK  1.8
IoT Sensing Software Development Kit
Data Structures | Macros | Typedefs | Functions
pedometer.h File Reference

The pedometer.h file contains the interface and structure definitions for pedometer application. More...

#include <stddef.h>
#include <stdint.h>
#include <stdbool.h>
#include "KeynetikPedometer.h"
Include dependency graph for pedometer.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  ped_accel_t
 This defines the acceleration input data for the pedometer. More...
 
struct  pedometer_config_t
 This defines the configuration structure of the pedometer. More...
 
struct  pedometer_t
 This defines the pedometer instance. More...
 
struct  pedometer_t::pedometer_status_tag
 
struct  pedometer_t::pedometer_private_tag
 

Macros

#define PEDO_ONEG_8G   4096 /* One G value for 8G mode.*/
 
#define PEDO_ONEG_4G   8192 /* One G value for 4G mode.*/
 
#define PEDO_ONEG_2G   16384 /* One G value for 2G mode.*/
 
#define PEDO_FREQHZ_DEFAULT   50 /* Default frequency*/
 
#define PEDO_STEP_THRESHOLD_DEFAULT   130
 
#define PEDO_SPEED_PERIOD_DEFAULT   5
 
#define PEDO_FILTER_TIME_DEFAULT   3
 
#define PEDO_FILTER_STEPS_DEFAULT   4
 

Typedefs

typedef KeynetikActivityLevel activitylevel_t
 
typedef uint16_t debounce_count_t
 

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.h file contains the interface and structure definitions for pedometer application.

Definition in file pedometer.h.

Macro Definition Documentation

◆ PEDO_FILTER_STEPS_DEFAULT

#define PEDO_FILTER_STEPS_DEFAULT   4

Definition at line 35 of file pedometer.h.

◆ PEDO_FILTER_TIME_DEFAULT

#define PEDO_FILTER_TIME_DEFAULT   3

Definition at line 34 of file pedometer.h.

◆ PEDO_FREQHZ_DEFAULT

#define PEDO_FREQHZ_DEFAULT   50 /* Default frequency*/

Definition at line 31 of file pedometer.h.

◆ PEDO_ONEG_2G

#define PEDO_ONEG_2G   16384 /* One G value for 2G mode.*/

Definition at line 30 of file pedometer.h.

◆ PEDO_ONEG_4G

#define PEDO_ONEG_4G   8192 /* One G value for 4G mode.*/

Definition at line 29 of file pedometer.h.

◆ PEDO_ONEG_8G

#define PEDO_ONEG_8G   4096 /* One G value for 8G mode.*/

Definition at line 28 of file pedometer.h.

◆ PEDO_SPEED_PERIOD_DEFAULT

#define PEDO_SPEED_PERIOD_DEFAULT   5

Definition at line 33 of file pedometer.h.

◆ PEDO_STEP_THRESHOLD_DEFAULT

#define PEDO_STEP_THRESHOLD_DEFAULT   130

Definition at line 32 of file pedometer.h.

Typedef Documentation

◆ activitylevel_t

typedef KeynetikActivityLevel activitylevel_t

Definition at line 26 of file pedometer.h.

◆ debounce_count_t

typedef uint16_t debounce_count_t

Definition at line 27 of file pedometer.h.

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 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().

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 97 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 125 of file pedometer.c.

Referenced by main().

Here is the caller graph for this function: