summaryrefslogtreecommitdiff
path: root/n/accel/calcul.h
diff options
context:
space:
mode:
Diffstat (limited to 'n/accel/calcul.h')
-rw-r--r--n/accel/calcul.h53
1 files changed, 53 insertions, 0 deletions
diff --git a/n/accel/calcul.h b/n/accel/calcul.h
new file mode 100644
index 0000000..744df17
--- /dev/null
+++ b/n/accel/calcul.h
@@ -0,0 +1,53 @@
+#ifndef calcul_h
+#define calcul_h
+/* calcul.h */
+/* Accelerometre {{{
+ *
+ * Copyright (C) 2004 Thomas Burg
+ *
+ * Robot APB Team/Efrei 2005.
+ * Web: http://assos.efrei.fr/robot/
+ * Email: robot AT efrei DOT fr
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ *
+ * }}} */
+
+/* +AutoDec */
+/* -AutoDec */
+
+/* Variable globale, propre au calcul
+ */
+#include <inttypes.h>
+
+#define BIT_SCALE_FACTOR 60000
+
+enum T_etat {strt_at_Ta, rd_at_Tb, rd_at_Tc, rd_at_Td, calcul };
+
+extern uint16_t T2_cal;
+extern uint16_t T1x_cal;
+extern uint16_t T1y_cal;
+extern uint32_t K;
+
+extern volatile uint16_t Tb,Td,Tc;
+
+extern volatile enum T_etat etat;
+
+/* Fonction
+ */
+void calibration(void);
+int16_t calculG(uint16_t T1, uint16_t T2,uint16_t Zcal);
+
+#endif /* calcul_h */