1/*
2 * Copyright (C) 2018 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#ifndef CHRE_PLATFORM_SLPI_SEE_SEE_HELPER_INTERNAL_H_
18#define CHRE_PLATFORM_SLPI_SEE_SEE_HELPER_INTERNAL_H_
19
20#include <stddef.h>
21#include <stdint.h>
22
23#include "sns_suid.pb.h"
24
25#include "chre/util/optional.h"
26
27namespace chre {
28
29//! A struct to store a sensor's calibration data
30struct SeeCalData {
31  float bias[3];
32  float scale[3];
33  float matrix[9];
34  bool hasBias;
35  bool hasScale;
36  bool hasMatrix;
37  uint8_t accuracy;
38};
39
40//! A struct to store a cal sensor's UID and its cal data.
41struct SeeCalInfo {
42  Optional<sns_std_suid> suid;
43  SeeCalData cal;
44};
45
46//! The list of SEE cal sensors supported.
47enum class SeeCalSensor {
48  AccelCal,
49  GyroCal,
50  MagCal,
51  NumCalSensors,
52};
53
54//! A convenience constant.
55constexpr size_t kNumSeeCalSensors = static_cast<size_t>(
56    SeeCalSensor::NumCalSensors);
57
58}  // namespace chre
59
60#endif  // CHRE_PLATFORM_SLPI_SEE_SEE_HELPER_INTERNAL_H_
61