Files | |
file | transport_mode_command.h |
Classes | |
struct | ScuSettings |
class | TramClass |
struct | TramDebugDumpInfo |
struct | SensorInitTram |
struct | SensorExecTram |
struct | SensorFlushTram |
struct | SensorResultTram |
the structure of sensor result on transport mode commands. More... | |
struct | SensorCmdTram |
the structure of transport mode commands. More... | |
Macros | |
#define | TRAM_NUMBER_OF_MODES 13 |
#define | ACCEL_SAMPLING_FREQUENCY_MS 16 |
#define | ACCEL_SAMPLING_FREQUENCY_CMD 64 |
#define | ACCEL_SAMPLING_FREQUENCY_TMI 64 |
#define | ACCEL_WATERMARK_NUM 320 |
#define | ACCEL_FIFO_NUM (ACCEL_WATERMARK_NUM * 2) |
#define | ACCEL_TRIGGER_RISE_THRESS 50 |
#define | ACCEL_TRIGGER_RISE_COUNT0 2 |
#define | ACCEL_TRIGGER_RISE_COUNT1 20 |
#define | ACCEL_TRIGGER_RISE_DELAY 0 |
#define | ACCEL_TRIGGER_FALL_THRESS 49 |
#define | ACCEL_TRIGGER_FALL_COUNT0 2 |
#define | ACCEL_TRIGGER_FALL_COUNT1 4 |
#define | ACCEL_TRIGGER_FALL_DELAY 0 |
#define | GET_SCU_ACCEL_SAMPLING_FREQUENCY(_x_) (512 / (1 << (_x_))) |
#define | MAG_SAMPLING_FREQUENCY 8 |
#define | MAG_WATERMARK_NUM 40 |
#define | TRAM_ACC_SAMPLING 64 |
#define | TRAM_MAG_SAMPLING 8 |
#define | TRAM_BAR_SAMPLING 8 |
Enumerations | |
enum | tram_state_e { TRAM_STATE_UNINITIALIZED = 0 , TRAM_STATE_MS , TRAM_STATE_CMD , TRAM_STATE_TMI , TRAM_STATE_NUM } |
enum | TramEvent { MathFuncEvent } |
enum | TramNotification { ChangeScuSettings } |
enum | TramCmdType { TramCmdTypeResult = 0 , TramCmdTypeTrans , TramCmdTypeNum } |
enum | TramState { TramStateMs = 0 , TramStateCmd , TramStateTmi , TramStateNum } |
enum | TramSensorType { TramSensorAcc = 0 , TramSensorMag , TramSensorBar } |
enum | { TRAM_CLASS_UNDETERMINED = 0 , TRAM_CLASS_STAY , TRAM_CLASS_WALK , TRAM_CLASS_RUN , TRAM_CLASS_UPSTAIRS , TRAM_CLASS_DOWNSTAIRS , TRAM_CLASS_ESCUP , TRAM_CLASS_ESCDOWN , TRAM_CLASS_ELEVUP , TRAM_CLASS_ELEVDOWN , TRAM_CLASS_TRAIN , TRAM_CLASS_BUS , TRAM_CLASS_CAR , TRAM_CLASS_BICYCLE } |
Functions | |
TramClass * | TramCreate (MemMgrLite::PoolId cmd_pool_id) |
Create TramClass instance. More... | |
int | TramOpen (FAR TramClass *ins, FAR float *likelihood=NULL) |
Load TRAM library and boot up as worker task. After booted up, send initialize and wait complete. More... | |
int | TramClose (FAR TramClass *ins) |
Destory TRAM worker task. More... | |
int | TramStart (FAR TramClass *ins) |
Start TRAM with Dsp analysing. More... | |
int | TramStop (FAR TramClass *ins) |
Stop TRAM with Dsp analysing. More... | |
int | TramWrite (FAR TramClass *ins, FAR sensor_command_data_mh_t *command) |
Send data to TRAM worker task. More... | |
int | TramHandleEvent (FAR TramClass *ins, TramEvent event) |
Send event to TRAM to handle event. More... | |
struct ScuSettings * | TramGetAccelScuSettings (FAR TramClass *ins) |
Get settings information of accelerator. More... | |
#define TRAM_NUMBER_OF_MODES 13 |
Number of transportation mode
#define ACCEL_SAMPLING_FREQUENCY_MS 16 |
Accel sensor frequency in MS state[Hz]
#define ACCEL_SAMPLING_FREQUENCY_CMD 64 |
Accel sensor frequency in CMD state[Hz]
#define ACCEL_SAMPLING_FREQUENCY_TMI 64 |
Accel sensor frequency in TMI state[Hz]
#define ACCEL_WATERMARK_NUM 320 |
Accel sensor sample data watermark
#define ACCEL_FIFO_NUM (ACCEL_WATERMARK_NUM * 2) |
FIFO sample data watermark
#define ACCEL_TRIGGER_RISE_THRESS 50 |
Accel sensor rise threshold
#define ACCEL_TRIGGER_RISE_COUNT0 2 |
Accel sensor rise preventing counts
#define ACCEL_TRIGGER_RISE_COUNT1 20 |
Accel sensor rise actual counts
#define ACCEL_TRIGGER_RISE_DELAY 0 |
Rise event notification delay in samples
#define ACCEL_TRIGGER_FALL_THRESS 49 |
Accel sensor fall threshold
#define ACCEL_TRIGGER_FALL_COUNT0 2 |
Accel sensor fall preventing counts
#define ACCEL_TRIGGER_FALL_COUNT1 4 |
Accel sensor fall actual counts
#define ACCEL_TRIGGER_FALL_DELAY 0 |
Fall event notification delay in samples
#define GET_SCU_ACCEL_SAMPLING_FREQUENCY | ( | _x_ | ) | (512 / (1 << (_x_))) |
sampling rate = 32768 / 64 / (2 ^ (x) )Hz
#define MAG_SAMPLING_FREQUENCY 8 |
Mag sensor frequency[Hz]
#define MAG_WATERMARK_NUM 40 |
Mag sensor sample data watermark
#define TRAM_ACC_SAMPLING 64 |
Accelerometer sensor sampling frequency[Hz]
#define TRAM_MAG_SAMPLING 8 |
Magnetmeter sensor sampling frequency[Hz]
#define TRAM_BAR_SAMPLING 8 |
Barometer sensor sampling frequency[Hz]
enum tram_state_e |
enum TramEvent |
enum TramNotification |
enum TramCmdType |
enum TramState |
enum TramSensorType |
anonymous enum |
Result of transportation mode inference
TramClass * TramCreate | ( | MemMgrLite::PoolId | cmd_pool_id | ) |
int TramOpen | ( | FAR TramClass * | ins, |
FAR float * | likelihood = NULL |
||
) |
Load TRAM library and boot up as worker task. After booted up, send initialize and wait complete.
[in] | ins | : instance address of TramClass |
[in] | likelihood | : buffer address to contain likelihood |
int TramClose | ( | FAR TramClass * | ins | ) |
Destory TRAM worker task.
[in] | ins | : instance address of TramClass |
int TramStart | ( | FAR TramClass * | ins | ) |
Start TRAM with Dsp analysing.
[in] | ins | : instance address of TramClass |
int TramStop | ( | FAR TramClass * | ins | ) |
Stop TRAM with Dsp analysing.
[in] | ins | : instance address of TramClass |
int TramWrite | ( | FAR TramClass * | ins, |
FAR sensor_command_data_mh_t * | command | ||
) |
Send data to TRAM worker task.
[in] | ins | : instance address of TramClass |
[in] | command | : command including data to send |
Send event to TRAM to handle event.
[in] | ins | : instance address of TramClass |
[in] | event | : event to handle |
struct ScuSettings * TramGetAccelScuSettings | ( | FAR TramClass * | ins | ) |
Get settings information of accelerator.
[in] | ins | : instance address of TramClass |