lsm303dlhc_params.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2017 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 LSM303DLHC_PARAMS_H
20 #define LSM303DLHC_PARAMS_H
21 
22 #include "board.h"
23 #include "lsm303dlhc.h"
24 #include "saul_reg.h"
25 
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29 
34 #ifndef LSM303DLHC_PARAM_I2C
35 #define LSM303DLHC_PARAM_I2C I2C_DEV(0)
36 #endif
37 #ifndef LSM303DLHC_PARAM_ACC_ADDR
38 #define LSM303DLHC_PARAM_ACC_ADDR (0x19)
39 #endif
40 #ifndef LSM303DLHC_PARAM_ACC_PIN
41 #define LSM303DLHC_PARAM_ACC_PIN (GPIO_PIN(0, 0))
42 #endif
43 #ifndef LSM303DLHC_PARAM_ACC_RATE
44 #define LSM303DLHC_PARAM_ACC_RATE (LSM303DLHC_ACC_SAMPLE_RATE_10HZ)
45 #endif
46 #ifndef LSM303DLHC_PARAM_ACC_SCALE
47 #define LSM303DLHC_PARAM_ACC_SCALE (LSM303DLHC_ACC_SCALE_4G)
48 #endif
49 #ifndef LSM303DLHC_PARAM_MAG_ADDR
50 #define LSM303DLHC_PARAM_MAG_ADDR (0x1e)
51 #endif
52 #ifndef LSM303DLHC_PARAM_MAG_PIN
53 #define LSM303DLHC_PARAM_MAG_PIN (GPIO_PIN(0, 1))
54 #endif
55 #ifndef LSM303DLHC_PARAM_MAG_RATE
56 #define LSM303DLHC_PARAM_MAG_RATE (LSM303DLHC_MAG_SAMPLE_RATE_15HZ)
57 #endif
58 #ifndef LSM303DLHC_PARAM_MAG_GAIN
59 #define LSM303DLHC_PARAM_MAG_GAIN (LSM303DLHC_MAG_GAIN_450_400_GAUSS)
60 #endif
61 
62 #ifndef LSM303DLHC_PARAMS
63 #define LSM303DLHC_PARAMS { .i2c = LSM303DLHC_PARAM_I2C, \
64  .acc_addr = LSM303DLHC_PARAM_ACC_ADDR, \
65  .acc_pin = LSM303DLHC_PARAM_ACC_PIN, \
66  .acc_rate = LSM303DLHC_PARAM_ACC_RATE, \
67  .acc_scale = LSM303DLHC_PARAM_ACC_SCALE, \
68  .mag_addr = LSM303DLHC_PARAM_MAG_ADDR, \
69  .mag_pin = LSM303DLHC_PARAM_MAG_PIN, \
70  .mag_rate = LSM303DLHC_PARAM_MAG_RATE, \
71  .mag_gain = LSM303DLHC_PARAM_MAG_GAIN }
72 #endif
73 #ifndef LSM303DLHC_SAUL_INFO
74 #define LSM303DLHC_SAUL_INFO { .name = "lsm303dlhc" }
75 #endif
76 
82 {
83  LSM303DLHC_PARAMS
84 };
85 
90 {
91  LSM303DLHC_SAUL_INFO
92 };
93 
94 #ifdef __cplusplus
95 }
96 #endif
97 
98 #endif /* LSM303DLHC_PARAMS_H */
99 
lsm303dlhc_saul_info
static const saul_reg_info_t lsm303dlhc_saul_info[]
Additional meta information to keep in the SAUL registry.
Definition: lsm303dlhc_params.h:89
lsm303dlhc.h
Device driver interface for the LSM303DLHC 3D accelerometer/magnetometer.
saul_reg_info_t
Additional data to collect for each entry.
Definition: saul_reg.h:49
lsm303dlhc_params
static const lsm303dlhc_params_t lsm303dlhc_params[]
Allocate some memory to store the actual configuration.
Definition: lsm303dlhc_params.h:81
saul_reg.h
SAUL registry interface definition.
lsm303dlhc_params_t
Data structure holding all the information needed for initialization.
Definition: lsm303dlhc.h:108