36#ifndef __INCLUDE_SENSING_LOGICAL_SENSOR_TRANSPORT_MODE_H
37#define __INCLUDE_SENSING_LOGICAL_SENSOR_TRANSPORT_MODE_H
51#include "sensing/sensor_api.h"
52#include "sensing/sensor_id.h"
53#include "sensing/sensor_ecode.h"
55#include "memutils/s_stl/queue.h"
62#define TRAM_NUMBER_OF_MODES 13
64#define ACCEL_SAMPLING_FREQUENCY_MS 16
65#define ACCEL_SAMPLING_FREQUENCY_CMD 64
66#define ACCEL_SAMPLING_FREQUENCY_TMI 64
67#define ACCEL_WATERMARK_NUM 320
68#define ACCEL_FIFO_NUM (ACCEL_WATERMARK_NUM * 2)
69#define ACCEL_TRIGGER_RISE_THRESS 50
70#define ACCEL_TRIGGER_RISE_COUNT0 2
71#define ACCEL_TRIGGER_RISE_COUNT1 20
72#define ACCEL_TRIGGER_RISE_DELAY 0
73#define ACCEL_TRIGGER_FALL_THRESS 49
74#define ACCEL_TRIGGER_FALL_COUNT0 2
75#define ACCEL_TRIGGER_FALL_COUNT1 4
76#define ACCEL_TRIGGER_FALL_DELAY 0
78#define GET_SCU_ACCEL_SAMPLING_FREQUENCY(_x_) (512 / (1 << (_x_)))
80#define MAG_SAMPLING_FREQUENCY 8
81#define MAG_WATERMARK_NUM 40
139 int open(FAR
float *likelihood);
144 void send_detection_result(uint32_t pred);
146 void set_power(uint32_t subscriptions);
147 void clear_power(uint32_t subscriptions);
148 void receive_sync_msg(
void);
149 void receive_async_msg(uint32_t param);
157 : m_cmd_pool_id(cmd_pool_id),
165 #define MAX_EXEC_COUNT 8
172 s_std::Queue<struct exe_mh_s, MAX_EXEC_COUNT> m_exe_que;
181 pthread_t m_thread_id;
187 int sendInit(FAR
float *likelihood);
Memory Handler Class for "Memory Manager Lite". This is only wrapper class for convert project-specif...
Definition: MemManager.h:107
Definition: transport_mode.h:135
TramEvent
Definition: transport_mode.h:104
int TramStop(FAR TramClass *ins)
Stop TRAM with Dsp analysing.
int TramHandleEvent(FAR TramClass *ins, TramEvent event)
Send event to TRAM to handle event.
TramNotification
Definition: transport_mode.h:112
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.
tram_state_e
Definition: transport_mode.h:92
TramClass * TramCreate(MemMgrLite::PoolId cmd_pool_id)
Create TramClass instance.
int TramWrite(FAR TramClass *ins, FAR sensor_command_data_mh_t *command)
Send data to TRAM worker task.
int TramClose(FAR TramClass *ins)
Destory TRAM worker task.
struct ScuSettings * TramGetAccelScuSettings(FAR TramClass *ins)
Get settings information of accelerator.
int TramStart(FAR TramClass *ins)
Start TRAM with Dsp analysing.
@ MathFuncEvent
Definition: transport_mode.h:105
@ ChangeScuSettings
Definition: transport_mode.h:113
@ TRAM_STATE_UNINITIALIZED
Definition: transport_mode.h:93
@ TRAM_STATE_CMD
Definition: transport_mode.h:95
@ TRAM_STATE_MS
Definition: transport_mode.h:94
@ TRAM_STATE_TMI
Definition: transport_mode.h:96
Definition: MemMgrTypes.h:88
Definition: transport_mode.h:120
FAR struct math_filter_s * mf
Definition: transport_mode.h:125
uint16_t fifosize
Definition: transport_mode.h:121
FAR struct scuev_notify_s * ev
Definition: transport_mode.h:124
FAR struct scufifo_wm_s * wm
Definition: transport_mode.h:126
uint8_t elements
Definition: transport_mode.h:123
uint8_t samplingrate
Definition: transport_mode.h:122
The command of send some sensor data with MemHandle to the sensor manager. This function only can cal...
Definition: sensor_api.h:134