Developer World
Spresense Arduino Library v3.3.0-b2e6327
Aesm.h
Go to the documentation of this file.
1/*
2 * Aesm.h - Sensing include file for the Spresense SDK
3 * Copyright 2019 Sony Semiconductor Solutions Corporation
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 */
19
29#ifndef __AESM_H
30#define __AESM_H
31
32#include <SensorClient.h>
33#include <sensing/logical_sensor/step_counter.h>
34
35
42#define AESM_ECODE_CREATE_ERROR 0x10
43
46#define AESM_ECODE_OPEN_ERROR 0x11
47
50#define AESM_ECODE_CLOSE_ERROR 0x12
51
54#define AESM_ECODE_SET_ERROR 0x13
55
56
57class AesmClass : public SensorClient
58{
59public:
60
66 bool begin(int id,
67 uint32_t subscriptions,
68 int input_rate,
69 int input_sample_watermark_num,
70 int input_size_per_sample);
71
77 bool end();
78
79 int subscribe(sensor_command_data_mh_t& data);
80
81 int set(uint8_t walking_stride, uint8_t running_stride);
82
83private:
84 int startAesm(void);
85
86private:
87 int m_input_rate;
88 int m_input_sample_watermark_num;
89 int m_input_size_per_sample;
90
91
92 FAR StepCounterClass *step_counter_ins;
93
94};
95
96extern AesmClass Aesm;
97
98#endif /* __AESM_H */
Sensor Library Class for Arduino on Spresense.
Definition: Aesm.h:58
bool end()
Stop sensing of StepCounter.
bool begin(int id, uint32_t subscriptions, int input_rate, int input_sample_watermark_num, int input_size_per_sample)
Start sensing of StepCounter.
Definition: SensorClient.h:160