Contiki 3.x
acc-sensor.h
Go to the documentation of this file.
1 /**
2  * \addtogroup mbxxx-platform
3  *
4  * @{
5  */
6 /*
7  * Copyright (c) 2010, STMicroelectronics.
8  * All rights reserved.
9  *
10  * Redistribution and use in source and binary forms, with or without
11  * modification, are permitted provided that the following conditions
12  * are met:
13  * 1. Redistributions of source code must retain the above copyright
14  * notice, this list of conditions and the following disclaimer.
15  * 2. Redistributions in binary form must reproduce the above
16  * copyright notice, this list of conditions and the following
17  * disclaimer in the documentation and/or other materials provided
18  * with the distribution.
19  * 3. The name of the author may not be used to endorse or promote
20  * products derived from this software without specific prior
21  * written permission.
22  *
23  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
24  * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
25  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26  * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
27  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
29  * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
30  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
31  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
32  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
33  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34  *
35  * This file is part of the Contiki OS
36  *
37  */
38 /*---------------------------------------------------------------------------*/
39 /**
40 * \file
41 * Accelerometer header file.
42 * \author
43 * Salvatore Pitrulli <salvopitru@users.sourceforge.net>
44 */
45 /*---------------------------------------------------------------------------*/
46 
47 #ifndef ACC_SENSOR_H_
48 #define ACC_SENSOR_H_
49 
50 #include "lib/sensors.h"
51 #include "mems.h"
52 
53 extern const struct sensors_sensor acc_sensor;
54 
55 #define ACC_SENSOR "Acc"
56 
57 /* The type values used in the configure() function.
58 */
59 
60 /* Full-scale*/
61 #define ACC_RANGE 1 // type
62 
63 #define ACC_LOW_RANGE MEMS_LOW_RANGE // Values
64 #define ACC_HIGH_RANGE MEMS_HIGH_RANGE
65 
66 /* High pass filter and cut-off frequencies*/
67 #define ACC_HPF 2 // type
68 
69 #define ACC_HPF_DISABLE 4 // Values
70 #define ACC_1HZ 3
71 #define ACC_2HZ 2
72 #define ACC_4HZ 1
73 #define ACC_8HZ 0
74 
75 /* The type values used in the value() function.
76  * The returned value is expressed in mg units and can be negative.
77 */
78 #define ACC_X_AXIS 1
79 #define ACC_Y_AXIS 2
80 #define ACC_Z_AXIS 3
81 
82 #endif /* ACC_SENSOR_H_ */
83 /** @} */