mma8x5x_params.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2015 Freie Universität Berlin
3  *
4  * This file is subject to the terms and conditions of the GNU Lesser
5  * General Public License v2.1. See the file LICENSE in the top level
6  * directory for more details.
7  */
8 
19 #ifndef MMA8X5X_PARAMS_H
20 #define MMA8X5X_PARAMS_H
21 
22 #include "board.h"
23 #include "saul_reg.h"
24 #include "mma8x5x.h"
25 
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29 
34 #ifndef MMA8X5X_PARAM_I2C
35 #define MMA8X5X_PARAM_I2C (I2C_DEV(0))
36 #endif
37 #ifndef MMA8X5X_PARAM_ADDR
38 #define MMA8X5X_PARAM_ADDR (CONFIG_MMA8X5X_I2C_ADDRESS)
39 #endif
40 #ifndef MMA8X5X_PARAM_RATE
41 #define MMA8X5X_PARAM_RATE (MMA8X5X_RATE_200HZ)
42 #endif
43 #ifndef MMA8X5X_PARAM_RANGE
44 #define MMA8X5X_PARAM_RANGE (MMA8X5X_RANGE_2G)
45 #endif
46 #ifndef MMA8X5X_PARAM_OFFSET
47 #define MMA8X5X_PARAM_OFFSET { 0, 0, 0 }
48 #endif
49 
50 #ifndef MMA8X5X_PARAMS
51 #define MMA8X5X_PARAMS { .i2c = MMA8X5X_PARAM_I2C, \
52  .addr = MMA8X5X_PARAM_ADDR, \
53  .rate = MMA8X5X_PARAM_RATE, \
54  .range = MMA8X5X_PARAM_RANGE, \
55  .offset = MMA8X5X_PARAM_OFFSET }
56 #endif
57 #ifndef MMA8X5X_SAUL_INFO
58 #define MMA8X5X_SAUL_INFO { .name = "mma8x5x" }
59 #endif
60 
66 {
67  MMA8X5X_PARAMS
68 };
69 
74 {
75  MMA8X5X_SAUL_INFO
76 };
77 
78 #ifdef __cplusplus
79 }
80 #endif
81 
82 #endif /* MMA8X5X_PARAMS_H */
83 
mma8x5x_params
static const mma8x5x_params_t mma8x5x_params[]
MMA8x5x configuration.
Definition: mma8x5x_params.h:65
mma8x5x_params_t
Configuration parameters.
Definition: mma8x5x.h:107
saul_reg_info_t
Additional data to collect for each entry.
Definition: saul_reg.h:49
mma8x5x_saul_info
static const saul_reg_info_t mma8x5x_saul_info[]
Additional meta information to keep in the SAUL registry.
Definition: mma8x5x_params.h:73
saul_reg.h
SAUL registry interface definition.
mma8x5x.h
Interface definition for the MMA8x5x accelerometer driver.