1 /* ============================================================================
2 Copyright (C) 2010 nomrasco
3 Nom Rasco <nomrasco@gmail.com>
5 This file is part of libnomaccel.
7 libnomaccel is free software: you can redistribute it and/or modify
8 it under the terms of the GNU Lesser General Public License as published by
9 the Free Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
12 libnomaccel is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU Lesser General Public License for more details.
17 You should have received a copy of the GNU Lesser General Public License
18 along with libnomaccel. If not, see <http://www.gnu.org/licenses/>.
19 ============================================================================ */
20 #include "../include/accel.h"
25 _accel_read_real_values ();
26 return _accel_proxy.x;
31 _accel_read_real_values ();
32 return _accel_proxy.y;
37 _accel_read_real_values ();
38 return _accel_proxy.z;
42 nom_accel_get_xyz (value* x, value* y, value* z) {
43 _accel_read_real_values ();
50 nom_accel_get_pitch () {
51 _accel_read_real_values ();
52 _accel_recalculate_pitch ();
53 return _accel_proxy.pitch;
57 nom_accel_get_roll () {
58 _accel_read_real_values ();
59 _accel_recalculate_roll ();
60 return _accel_proxy.roll;
64 nom_accel_get_pitch_roll (angle* pitch, angle* roll) {
65 _accel_read_real_values ();
66 _accel_recalculate_pitch_roll ();
67 *pitch = _accel_proxy.pitch;
68 *roll = _accel_proxy.roll;
72 nom_accel_get_all (value* x, value* y, value* z,
73 angle* pitch, angle* roll)
75 _accel_read_real_values ();
76 _accel_recalculate_pitch_roll ();
77 *pitch = _accel_proxy.pitch;
78 *roll = _accel_proxy.roll;