[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[paparazzi-commits] [4610] add sonar module for booz
From: |
Gautier Hattenberger |
Subject: |
[paparazzi-commits] [4610] add sonar module for booz |
Date: |
Tue, 02 Mar 2010 17:56:36 +0000 |
Revision: 4610
http://svn.sv.gnu.org/viewvc/?view=rev&root=paparazzi&revision=4610
Author: gautier
Date: 2010-03-02 17:56:36 +0000 (Tue, 02 Mar 2010)
Log Message:
-----------
add sonar module for booz
Added Paths:
-----------
paparazzi3/trunk/conf/modules/sonar_maxbotix_booz.xml
paparazzi3/trunk/sw/airborne/modules/sonar/
paparazzi3/trunk/sw/airborne/modules/sonar/sonar_maxbotix_booz.c
paparazzi3/trunk/sw/airborne/modules/sonar/sonar_maxbotix_booz.h
Added: paparazzi3/trunk/conf/modules/sonar_maxbotix_booz.xml
===================================================================
--- paparazzi3/trunk/conf/modules/sonar_maxbotix_booz.xml
(rev 0)
+++ paparazzi3/trunk/conf/modules/sonar_maxbotix_booz.xml 2010-03-02
17:56:36 UTC (rev 4610)
@@ -0,0 +1,16 @@
+<!DOCTYPE module SYSTEM "module.dtd">
+
+<module name="sonar">
+ <header>
+ <file name="sonar_maxbotix_booz.h"/>
+ </header>
+ <init fun="maxbotix_init()"/>
+ <periodic fun="maxbotix_read()" freq="10"/>
+ <event fun="SonarEvent(booz_ins_update_sonar)"/>
+ <makefile target="ap">
+ <flag name="USE_EXTRA_ADC"/>
+ <flag name="USE_ADC_1"/>
+ <flag name="BOOZ2_SONAR"/>
+ <file name="sonar_maxbotix_booz.c"/>
+ </makefile>
+</module>
Added: paparazzi3/trunk/sw/airborne/modules/sonar/sonar_maxbotix_booz.c
===================================================================
--- paparazzi3/trunk/sw/airborne/modules/sonar/sonar_maxbotix_booz.c
(rev 0)
+++ paparazzi3/trunk/sw/airborne/modules/sonar/sonar_maxbotix_booz.c
2010-03-02 17:56:36 UTC (rev 4610)
@@ -0,0 +1,43 @@
+/*
+ * $Id: demo_module.c 3079 2009-03-11 16:55:42Z gautier $
+ *
+ * Copyright (C) 2010 Gautier Hattenberger
+ *
+ * This file is part of paparazzi.
+ *
+ * paparazzi 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, or (at your option)
+ * any later version.
+ *
+ * paparazzi 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 paparazzi; see the file COPYING. If not, write to
+ * the Free Software Foundation, 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ */
+
+#include "sonar_maxbotix_booz.h"
+#include "booz2_analog.h"
+
+uint16_t sonar_meas;
+bool_t sonar_data_available;
+
+void maxbotix_init(void) {
+ sonar_meas = 0;
+ sonar_data_available = FALSE;
+}
+
+/** Read ADC value to update sonar measurement
+ */
+void maxbotix_read(void) {
+ booz2_analog_extra_adc_read();
+ sonar_meas = booz2_adc_1;
+ sonar_data_available = TRUE;
+}
+
Added: paparazzi3/trunk/sw/airborne/modules/sonar/sonar_maxbotix_booz.h
===================================================================
--- paparazzi3/trunk/sw/airborne/modules/sonar/sonar_maxbotix_booz.h
(rev 0)
+++ paparazzi3/trunk/sw/airborne/modules/sonar/sonar_maxbotix_booz.h
2010-03-02 17:56:36 UTC (rev 4610)
@@ -0,0 +1,51 @@
+/*
+ * $Id: demo_module.h 3079 2009-03-11 16:55:42Z gautier $
+ *
+ * Copyright (C) 2010 Gautier Hattenberger
+ *
+ * This file is part of paparazzi.
+ *
+ * paparazzi 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, or (at your option)
+ * any later version.
+ *
+ * paparazzi 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 paparazzi; see the file COPYING. If not, write to
+ * the Free Software Foundation, 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ *
+ */
+
+/** \file sonar_maxbotix_booz.h
+ *
+ * simple driver to deal with one maxbotix sensor on booz AP
+ */
+
+#ifndef SONAR_MAXBOTIX_BOOZ_H
+#define SONAR_MAXBOTIX_BOOZ_H
+
+#include "std.h"
+
+extern uint16_t sonar_meas;
+
+extern bool_t sonar_data_available;
+
+extern void maxbotix_init(void);
+extern void maxbotix_read(void);
+
+#include "booz2_ins.h" // needed because booz_ins is not a module
+
+#define SonarEvent(_handler) { \
+ if (sonar_data_available) { \
+ _handler(); \
+ sonar_data_available = FALSE; \
+ } \
+}
+
+#endif
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [paparazzi-commits] [4610] add sonar module for booz,
Gautier Hattenberger <=