src/core/interface.h (view raw)
1/* Copyright (c) 2013-2015 Jeffrey Pfau
2 *
3 * This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6#ifndef CORE_INTERFACE_H
7#define CORE_INTERFACE_H
8
9#include "util/common.h"
10
11struct mKeyCallback {
12 uint16_t (*readKeys)(struct mKeyCallback*);
13};
14
15struct mStopCallback {
16 void (*stop)(struct mStopCallback*);
17};
18
19struct mRotationSource {
20 void (*sample)(struct mRotationSource*);
21
22 int32_t (*readTiltX)(struct mRotationSource*);
23 int32_t (*readTiltY)(struct mRotationSource*);
24
25 int32_t (*readGyroZ)(struct mRotationSource*);
26};
27
28struct mRTCSource {
29 void (*sample)(struct mRTCSource*);
30
31 time_t (*unixTime)(struct mRTCSource*);
32};
33
34enum mRTCGenericType {
35 RTC_NO_OVERRIDE,
36 RTC_FIXED,
37 RTC_FAKE_EPOCH
38};
39
40struct mRTCGenericSource {
41 struct mRTCSource d;
42 struct mCore* p;
43 enum mRTCGenericType override;
44 int64_t value;
45};
46
47void mRTCGenericSourceInit(struct mRTCGenericSource* rtc, struct mCore* core);
48
49struct mRumble {
50 void (*setRumble)(struct mRumble*, int enable);
51};
52
53#endif