You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
769 B
39 lines
769 B
/*
|
|
* Copyright 2024 Rockchip Electronics Co., Ltd
|
|
*/
|
|
#ifndef ANDROID_GYRO_SENSOR_H
|
|
#define ANDROID_GYRO_SENSOR_H
|
|
|
|
#pragma once
|
|
|
|
#include <aidl/android/hardware/sensors/BnSensors.h>
|
|
|
|
#include "Sensor.h"
|
|
|
|
namespace aidl {
|
|
namespace android {
|
|
namespace hardware {
|
|
namespace sensors {
|
|
|
|
class GyroSensor : public Sensor {
|
|
public:
|
|
GyroSensor(int32_t sensorHandle, ISensorsEventCallback* callback);
|
|
|
|
protected:
|
|
float mCurEventData[3];
|
|
float mLastEventData[3];
|
|
|
|
virtual void readEventPayload(EventPayload& payload) override;
|
|
virtual void driverActivate(bool enable) override;
|
|
virtual void driverSetDelay(int64_t samplingPeriodNs) override;
|
|
|
|
void processEvent(int code, int value);
|
|
};
|
|
|
|
} // sensors
|
|
} // hardware
|
|
} // android
|
|
} // aidl
|
|
|
|
#endif
|