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