From c3d4ca9f2df5ddf9894b36d1554fdfc95d625d3f Mon Sep 17 00:00:00 2001 From: Nick Vaccaro Date: Thu, 5 Dec 2013 17:24:12 -0800 Subject: Motion Apps 5.2.0 HAL Release Add latest 5.2.0 version of InvenSense HAL for the mpu9250 into it's own unique folder named 6515 so that Hammerhead still uses it's original 65xx HAL. Change-Id: I90f1bbbc1de2283a8d337495b6af59261cd63f88 Signed-off-by: Nick Vaccaro --- 6515/libsensors_iio/InputEventReader.h | 50 ++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 6515/libsensors_iio/InputEventReader.h (limited to '6515/libsensors_iio/InputEventReader.h') diff --git a/6515/libsensors_iio/InputEventReader.h b/6515/libsensors_iio/InputEventReader.h new file mode 100644 index 0000000..4e33af3 --- /dev/null +++ b/6515/libsensors_iio/InputEventReader.h @@ -0,0 +1,50 @@ +/* +* Copyright (C) 2012 Invensense, Inc. +* +* 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 ANDROID_INPUT_EVENT_READER_H +#define ANDROID_INPUT_EVENT_READER_H + +#include +#include +#include +#include + +#include "SensorBase.h" + +/*****************************************************************************/ + +struct input_event; + +class InputEventCircularReader +{ + struct input_event* const mBuffer; + struct input_event* const mBufferEnd; + struct input_event* mHead; + struct input_event* mCurr; + ssize_t mFreeSpace; + int mLastFd; + +public: + InputEventCircularReader(size_t numEvents); + ~InputEventCircularReader(); + ssize_t fill(int fd); + ssize_t readEvent(input_event const** events); + void next(); +}; + +/*****************************************************************************/ + +#endif // ANDROID_INPUT_EVENT_READER_H -- cgit v1.2.3