Developer World
Spresense SDK Library v3.3.0-375c679
Step Counter API

Files

file  step_counter_command.h
 

Classes

class  StepCounterClass
 
struct  step_counter_param_s
 
struct  step_counter_setting_s
 
struct  StepCounterDebugDumpInfo
 
struct  SensorInitStepCounter
 the structure of Accelstep setting for initilaize. More...
 
struct  SensorExecStepCounter
 the command of STEP_COUNTER execute by a frame(a few sample). More...
 
struct  SensorFlushStepCounter
 the command of STEP_COUNTER terminate. More...
 
struct  StepCounterStepInfo
 the structure of STEP_COUNTER results. More...
 
struct  SensorResultStepCounter
 the structure of sensor result on step counter commands. More...
 
struct  SensorCmdStepCounter
 the structure of step counter commands. More...
 
struct  StepCounterSetParam
 the structure of step setting for initialize. More...
 
struct  StepCounterSetting
 the structure of Accelstep user setting. More...
 

Macros

#define STEP_COUNTER_INITIAL_WALK_STEP_LENGTH   60
 
#define STEP_COUNTER_INITIAL_RUN_STEP_LENGTH   80
 
#define STEP_COUNTER_SAMPLING_MAX   (32)
 Indicates the maximum number of samples.
 

Typedefs

typedef struct step_counter_param_s StepCounterSetParam
 
typedef struct step_counter_setting_s StepCounterSetting
 

Enumerations

enum  StepCounterStepMode { STEP_COUNTER_MODE_FIXED_LENGTH = 0 , STEP_COUNTER_MODE_NEW_TABLE , STEP_COUNTER_MODE_STEP_TABLE }
 Step modes. More...
 
enum  StepCounterMovementType { STEP_COUNTER_MOVEMENT_TYPE_OTHER = 0 , STEP_COUNTER_MOVEMENT_TYPE_STILL , STEP_COUNTER_MOVEMENT_TYPE_WALK , STEP_COUNTER_MOVEMENT_TYPE_RUN }
 Activity Class. More...
 
enum  StepCounterCmdType { STEP_COUNTER_CMD_UPDATE_ACCELERATION = 0 , STEP_COUNTER_CMD_UPDATE_GPS , STEP_COUNTER_CMD_STEP_SET }
 Publishers. More...
 

Functions

StepCounterClassStepCounterCreate (MemMgrLite::PoolId cmd_pool_id)
 Create StepCounterClass instance. More...
 
StepCounterClassStepCounterCreate (uint8_t cmd_pool_id)
 
int StepCounterOpen (FAR StepCounterClass *ins)
 Load StepCounter library and boot up as worker task. After booted up, send initialize and wait complete. More...
 
int StepCounterClose (FAR StepCounterClass *ins)
 Destory StepCounter worker task. More...
 
int StepCounterWrite (FAR StepCounterClass *ins, FAR sensor_command_data_mh_t *command)
 Send data to StepCounter worker task. More...
 
int StepCounterSet (FAR StepCounterClass *ins, FAR StepCounterSetting *set)
 User step set function. More...
 

Detailed Description

Macro Definition Documentation

◆ STEP_COUNTER_INITIAL_WALK_STEP_LENGTH

#define STEP_COUNTER_INITIAL_WALK_STEP_LENGTH   60

Walking stride [cm]

◆ STEP_COUNTER_INITIAL_RUN_STEP_LENGTH

#define STEP_COUNTER_INITIAL_RUN_STEP_LENGTH   80

Running stride [cm]

Enumeration Type Documentation

◆ StepCounterStepMode

Step modes.

Enumerator
STEP_COUNTER_MODE_FIXED_LENGTH 

Using fixed length (not using existing stride table).

STEP_COUNTER_MODE_NEW_TABLE 

Create a new stride table with stepLength, and use the table. (not supported)

STEP_COUNTER_MODE_STEP_TABLE 

Using existing stride table (not using fixed length). (not supported)

◆ StepCounterMovementType

Activity Class.

Enumerator
STEP_COUNTER_MOVEMENT_TYPE_OTHER 

It can not be recognized.

STEP_COUNTER_MOVEMENT_TYPE_STILL 

It is stopped.

STEP_COUNTER_MOVEMENT_TYPE_WALK 

It is walking.

STEP_COUNTER_MOVEMENT_TYPE_RUN 

It is running.

◆ StepCounterCmdType

Publishers.

Enumerator
STEP_COUNTER_CMD_UPDATE_ACCELERATION 

Acceleration sensor data is used to update acceleration.

STEP_COUNTER_CMD_UPDATE_GPS 

Update GPS information using GPS sensor data.

STEP_COUNTER_CMD_STEP_SET 

Set user step setting.

Function Documentation

◆ StepCounterCreate()

StepCounterClass * StepCounterCreate ( MemMgrLite::PoolId  cmd_pool_id)

Create StepCounterClass instance.

Parameters
[in]cmd_pool_id: Pool id for DSP communication data
Returns
Address for instance of StepCounterClass

◆ StepCounterOpen()

int StepCounterOpen ( FAR StepCounterClass ins)

Load StepCounter library and boot up as worker task. After booted up, send initialize and wait complete.

Parameters
[in]ins: instance address of StepCounterClass
Returns
result of process.

◆ StepCounterClose()

int StepCounterClose ( FAR StepCounterClass ins)

Destory StepCounter worker task.

Parameters
[in]ins: instance address of StepCounterClass
Returns
result of process.

◆ StepCounterWrite()

int StepCounterWrite ( FAR StepCounterClass ins,
FAR sensor_command_data_mh_t command 
)

Send data to StepCounter worker task.

Parameters
[in]ins: instance address of StepCounterClass
[in]command: command including data to send
Returns
result of process

◆ StepCounterSet()

int StepCounterSet ( FAR StepCounterClass ins,
FAR StepCounterSetting set 
)

User step set function.

Parameters
[in]ins: instance address of StepCounterClass
[in]set: user step set pointer
Returns
result of process