bmx055_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 BMX055_PARAMS_H
20 #define BMX055_PARAMS_H
21 
22 #ifdef __cplusplus
23 extern "C" {
24 #endif
25 
26 #include "board.h"
27 
32 #ifndef BMX055_PARAM_I2C
33 #define BMX055_PARAM_I2C I2C_DEV(0)
34 #endif
35 #ifndef BMX055_PARAM_MAG_ADDR
36 #define BMX055_PARAM_MAG_ADDR CONFIG_BMX055_MAG_ADDR_DEFAULT
37 #endif
38 #ifndef BMX055_PARAM_ACC_ADDR
39 #define BMX055_PARAM_ACC_ADDR CONFIG_BMX055_ACC_ADDR_DEFAULT
40 #endif
41 #ifndef BMX055_PARAM_GYRO_ADDR
42 #define BMX055_PARAM_GYRO_ADDR CONFIG_BMX055_GYRO_ADDR_DEFAULT
43 #endif
44 #ifndef BMX055_PARAM_INT1
45 #define BMX055_PARAM_INT1 GPIO_PIN(0, 0)
46 #endif
47 #ifndef BMX055_PARAM_INT2
48 #define BMX055_PARAM_INT2 GPIO_PIN(0, 1)
49 #endif
50 #ifndef BMX055_PARAM_MAG_RATE
51 #define BMX055_PARAM_MAG_RATE BMX055_MAG_DRATE_DEFAULT
52 #endif
53 #ifndef BMX055_PARAM_ACC_RANGE
54 #define BMX055_PARAM_ACC_RANGE BMX055_ACC_RANGE_2G
55 #endif
56 #ifndef BMX055_PARAM_GYRO_SCALE
57 #define BMX055_PARAM_GYRO_SCALE BMX055_GYRO_SCALE_2000DPS
58 #endif
59 
60 #ifndef BMX055_PARAMS
61 #define BMX055_PARAMS \
62  { .i2c = BMX055_PARAM_I2C, \
63  .addr_mag = BMX055_PARAM_MAG_ADDR, \
64  .addr_acc = BMX055_PARAM_ACC_ADDR, \
65  .addr_gyro = BMX055_PARAM_GYRO_ADDR, \
66  .int1_pin = BMX055_PARAM_INT1, \
67  .int2_pin = BMX055_PARAM_INT2, \
68  .mag_rate = BMX055_PARAM_MAG_RATE, \
69  .acc_range = BMX055_PARAM_ACC_RANGE, \
70  .gyro_scale = BMX055_PARAM_GYRO_SCALE, \
71  }
72 #endif
73 
74 #ifndef BMX055_SAULINFO
75 #define BMX055_SAULINFO \
76  { { .name = "Magnetometer (bmx055)" }, \
77  { .name = "Accelerometer (bmx055)" }, \
78  { .name = "Gyroscope (bmx055)" }, \
79  }
80 #endif
81 
86 static const bmx055_params_t bmx055_params[] = {
87  BMX055_PARAMS
88 };
89 
93 static const saul_reg_info_t bmx055_saul_info[][3] = {
94  BMX055_SAULINFO
95 };
96 
97 #ifdef __cplusplus
98 }
99 #endif
100 
101 #endif /* BMX055_PARAMS_H */
102 
saul_reg_info_t
Additional data to collect for each entry.
Definition: saul_reg.h:49
bmx055_saul_info
static const saul_reg_info_t bmx055_saul_info[][3]
SAUL registry entries.
Definition: bmx055_params.h:93
bmx055_params
static const bmx055_params_t bmx055_params[]
BMX055 configuration.
Definition: bmx055_params.h:86
bmx055_params_t
Data structure holding the device parameters needed for initialization.
Definition: bmx055.h:127