Developer World
Spresense SDK Library v3.2.0-ebc0364
Compass API

Files

file  compass_command.h
 

Classes

struct  CompassResult
 The structure of result on compass commands. More...
 
class  CompassClass
 
struct  CompassDebugDumpInfo
 
struct  SensorInitCompass
 the structure of Accelstep setting for initilaize. More...
 
struct  CompassSetSoftIron
 Adjust parameter of magnetometer sensor. More...
 
struct  SensorExecCompass
 the command of Compass execute by a frame(a few sample). More...
 
struct  SensorFlushCompass
 the command of compass terminate. More...
 
struct  CompassData
 the structure of Compass results. the result is returned only when COMPASS_CMD_UPDATE_MAG is specified as the command type. More...
 
struct  SensorResultCompass
 the structure of sensor result on compass commands. More...
 
struct  SensorCmdCompass
 the structure of compass commands. More...
 

Macros

#define COMPASS_ACCEL_SAMPLING_MAX   16
 Acceleration sensor Indicates the maximum number of data samples.
 
#define COMPASS_MAG_SAMPLING_MAX   8
 Magnetometer sensor Indicates the maximum number of data samples.
 

Enumerations

enum  CompassCmdType {
  COMPASS_CMD_UPDATE_ACCEL = 0 , COMPASS_CMD_UPDATE_MAG , COMPASS_CMD_SET_SOFTIRON_PARAM , COMPASS_CMD_SET_WALKSTATE ,
  COMPASS_CMD_RESET_CALIB
}
 Publishers. More...
 
enum  CompassWalkStateType { COMPASS_WALK_STATE_DISABLED = -1 , COMPASS_WALK_STATE_STOPPING , COMPASS_WALK_STATE_WALKING }
 Sensor state specified by COMPASS_CMD_SET_WALKSTATE. More...
 

Functions

FAR CompassClassCompassCreate (MemMgrLite::PoolId cmd_pool_id, MemMgrLite::PoolId rst_pool_id)
 Create CompassClass instance. More...
 
int CompassOpen (FAR CompassClass *ins)
 Load Compass library and boot up as worker task. After booted up, send initialize and wait complete. More...
 
int CompassClose (FAR CompassClass *ins)
 Destory Compass worker task. More...
 
int CompassWrite (FAR CompassClass *ins, FAR sensor_command_data_mh_t *command)
 Send data to Compass worker task. More...
 

Detailed Description

Enumeration Type Documentation

◆ CompassCmdType

Publishers.

Enumerator
COMPASS_CMD_UPDATE_ACCEL 

Used to update acceleration sensor data.

COMPASS_CMD_UPDATE_MAG 

Used to update magnetometer sensor data.

COMPASS_CMD_SET_SOFTIRON_PARAM 

Used to adjust magnetometer sensor data.

COMPASS_CMD_SET_WALKSTATE 

Used to update magnetometer sensor state.

COMPASS_CMD_RESET_CALIB 

Used to reset calibration info of magnetometer sensor.

◆ CompassWalkStateType

Sensor state specified by COMPASS_CMD_SET_WALKSTATE.

Enumerator
COMPASS_WALK_STATE_DISABLED 

Disable state information.

COMPASS_WALK_STATE_STOPPING 

Stopping state setting.

COMPASS_WALK_STATE_WALKING 

Walking state setting.

Function Documentation

◆ CompassCreate()

FAR CompassClass * CompassCreate ( MemMgrLite::PoolId  cmd_pool_id,
MemMgrLite::PoolId  rst_pool_id 
)

Create CompassClass instance.

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

◆ CompassOpen()

int CompassOpen ( FAR CompassClass ins)

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

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

◆ CompassClose()

int CompassClose ( FAR CompassClass ins)

Destory Compass worker task.

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

◆ CompassWrite()

int CompassWrite ( FAR CompassClass ins,
FAR sensor_command_data_mh_t command 
)

Send data to Compass worker task.

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