Loading...
Searching...
No Matches
hmc5883l_params.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2018 Gunar Schorcht
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
17#ifndef HMC5883L_PARAMS_H
18#define HMC5883L_PARAMS_H
19
20#include "board.h"
21#include "hmc5883l.h"
22#include "saul_reg.h"
23
24#ifdef __cplusplus
25extern "C" {
26#endif
27
32#ifndef HMC5883L_PARAM_DEV
33#define HMC5883L_PARAM_DEV I2C_DEV(0)
34#endif
35#ifndef HMC5883L_PARAM_DOR
36#define HMC5883L_PARAM_DOR (HMC5883L_DOR_15)
37#endif
38#ifndef HMC5883L_PARAM_MEAS_MODE
39#define HMC5883L_PARAM_MEAS_MODE (HMC5883L_MEAS_MODE_NORMAL)
40#endif
41#ifndef HMC5883L_PARAM_MEAS_AVG
42#define HMC5883L_PARAM_MEAS_AVG (HMC5883L_MEAS_AVG_NONE)
43#endif
44#ifndef HMC5883L_PARAM_OP_MODE
45#define HMC5883L_PARAM_OP_MODE (HMC5883L_OP_MODE_CONTINUOUS)
46#endif
47#ifndef HMC5883L_PARAM_GAIN
48#define HMC5883L_PARAM_GAIN (HMC5883L_GAIN_1090)
49#endif
50#ifndef HMC5883L_PARAM_INT_PIN
51#define HMC5883L_PARAM_INT_PIN (GPIO_UNDEF)
52#endif
53
54#ifdef MODULE_HMC5883L_INT
55#ifndef HMC5883L_PARAMS
56#define HMC5883L_PARAMS { \
57 .dev = HMC5883L_PARAM_DEV, \
58 .dor = HMC5883L_PARAM_DOR, \
59 .gain = HMC5883L_PARAM_GAIN, \
60 .int_pin = HMC5883L_PARAM_INT_PIN, \
61 .meas_mode = HMC5883L_PARAM_MEAS_MODE, \
62 .meas_avg = HMC5883L_PARAM_MEAS_AVG, \
63 .op_mode = HMC5883L_PARAM_OP_MODE, \
64 }
65#endif /* HMC5883L_PARAMS */
66#else /* MODULE_HMC5883L_INT */
67#define HMC5883L_PARAMS { \
68 .dev = HMC5883L_PARAM_DEV, \
69 .dor = HMC5883L_PARAM_DOR, \
70 .gain = HMC5883L_PARAM_GAIN, \
71 .meas_mode = HMC5883L_PARAM_MEAS_MODE, \
72 .meas_avg = HMC5883L_PARAM_MEAS_AVG, \
73 .op_mode = HMC5883L_PARAM_OP_MODE, \
74 }
75#endif /* MODULE_HMC5883L_INT */
76
77#ifndef HMC5883L_SAUL_INFO
78#define HMC5883L_SAUL_INFO { .name = "hmc5883l" }
79#endif
86{
87 HMC5883L_PARAMS
88};
89
94{
95 HMC5883L_SAUL_INFO
96};
97
98#ifdef __cplusplus
99}
100#endif
101
102#endif /* HMC5883L_PARAMS_H */
static const hmc5883l_params_t hmc5883l_params[]
Allocate some memory to store the actual configuration.
static const saul_reg_info_t hmc5883l_saul_info[]
Additional meta information to keep in the SAUL registry.
SAUL registry interface definition.
HMC5883L device initialization parameters.
Definition hmc5883l.h:158
Additional data to collect for each entry.
Definition saul_reg.h:49