00001 /*--------------------------------------------------------------------------------- 00002 $Id: ndsmotion.h,v 1.9 2008-04-07 03:54:56 dovoto Exp $ 00003 00004 DS Motion Card/DS Motion Pak functionality 00005 00006 Copyright (C) 2007 00007 Michael Noland (joat) 00008 Jason Rogers (dovoto) 00009 Dave Murphy (WinterMute) 00010 Keith Epstein (KeithE) 00011 00012 This software is provided 'as-is', without any express or implied 00013 warranty. In no event will the authors be held liable for any 00014 damages arising from the use of this software. 00015 00016 Permission is granted to anyone to use this software for any 00017 purpose, including commercial applications, and to alter it and 00018 redistribute it freely, subject to the following restrictions: 00019 00020 1. The origin of this software must not be misrepresented; you 00021 must not claim that you wrote the original software. If you use 00022 this software in a product, an acknowledgment in the product 00023 documentation would be appreciated but is not required. 00024 2. Altered source versions must be plainly marked as such, and 00025 must not be misrepresented as being the original software. 00026 3. This notice may not be removed or altered from any source 00027 distribution. 00028 00029 ---------------------------------------------------------------------------------*/ 00030 00035 #ifndef NDS_MOTION_INCLUDE 00036 #define NDS_MOTION_INCLUDE 00037 //--------------------------------------------------------------------------------- 00038 00039 00040 typedef struct MotionCalibration 00041 { 00042 short xoff, yoff, zoff, goff; 00043 short xsens, ysens, zsens, gsens; 00044 }MotionCalibration; 00045 00046 #ifdef __cplusplus 00047 extern "C" { 00048 #endif 00049 00055 int motion_init(void); 00056 00060 void motion_deinit(void); 00061 00065 signed int motion_read_x(void); 00066 00070 signed int motion_read_y(void); 00071 00075 signed int motion_read_z(void); 00076 00080 signed int motion_read_gyro(void); 00081 00085 int motion_acceleration_x(void); 00086 00090 int motion_acceleration_y(void); 00091 00095 int motion_acceleration_z(void); 00096 00103 void motion_set_sens_x(int sens); 00104 00111 void motion_set_sens_y(int sens); 00112 00119 void motion_set_sens_z(int sens); 00120 00127 void motion_set_sens_gyro(int sens); 00128 00133 void motion_set_offs_x(void); 00134 00139 void motion_set_offs_y(void); 00140 00145 void motion_set_offs_z(void); 00146 00151 void motion_set_offs_gyro(void); 00152 00156 int motion_rotation(void); 00157 00161 MotionCalibration* motion_get_calibration(void); 00162 00168 void motion_set_calibration(MotionCalibration* cal); 00169 00174 void motion_enable_ain_1(void); 00175 00180 void motion_enable_ain_2(void); 00181 00186 int motion_read_ain_1(void); 00187 00192 int motion_read_ain_2(void); 00193 00194 #ifdef __cplusplus 00195 } 00196 #endif 00197 00198 #endif 00199 00200 00201