summaryrefslogtreecommitdiff
path: root/modules/sensors/dynamic_sensor/HidUtils/HidUtils.h
diff options
context:
space:
mode:
authorErik Staats <estaats@google.com>2021-11-29 15:39:47 -0800
committerErik Staats <estaats@google.com>2021-12-01 14:45:36 -0800
commit4cb45aba7f1bab4465e61b517b6784de4e98529e (patch)
tree64a175e6023257cfc74629165745afadc6f5e478 /modules/sensors/dynamic_sensor/HidUtils/HidUtils.h
parentf99f73ceebb4a0cfe7b8554194b9dc54f05a902f (diff)
dynamic_sensor: Support non-8-bit sized HID report items.
Bug: 207008609 Test: Verified dynamic sensor sampling. Test: Verified unit tests pass. Change-Id: I797ccabadefa0dde59fd0f3e8541f9853d657f3f
Diffstat (limited to 'modules/sensors/dynamic_sensor/HidUtils/HidUtils.h')
-rw-r--r--modules/sensors/dynamic_sensor/HidUtils/HidUtils.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/modules/sensors/dynamic_sensor/HidUtils/HidUtils.h b/modules/sensors/dynamic_sensor/HidUtils/HidUtils.h
new file mode 100644
index 00000000..54aa31e9
--- /dev/null
+++ b/modules/sensors/dynamic_sensor/HidUtils/HidUtils.h
@@ -0,0 +1,29 @@
+/*
+ * Copyright (C) 2021 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#ifndef HIDUTIL_HIDUTILS_H_
+#define HIDUTIL_HIDUTILS_H_
+
+#include <stddef.h>
+
+namespace HidUtil {
+
+void copyBits(const void *src, void *dst, size_t dst_size,
+ unsigned int src_bit_offset, unsigned int dst_bit_offset,
+ unsigned int bit_count);
+
+} // namespace HidUtil
+
+#endif // HIDUTIL_HIDUTILS_H_