adxl345_params.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2017 Mesotic SAS
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 ADXL345_PARAMS_H
20 #define ADXL345_PARAMS_H
21 
22 #include "board.h"
23 #include "saul_reg.h"
24 #include "adxl345.h"
25 
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29 
34 #ifndef ADXL345_PARAM_I2C
35 #define ADXL345_PARAM_I2C (I2C_DEV(0))
36 #endif
37 #ifndef ADXL345_PARAM_ADDR
38 #define ADXL345_PARAM_ADDR (ADXL345_ADDR_53)
39 #endif
40 #ifndef ADXL345_PARAM_RATE
41 #define ADXL345_PARAM_RATE (ADXL345_RATE_200HZ)
42 #endif
43 #ifndef ADXL345_PARAM_RANGE
44 #define ADXL345_PARAM_RANGE (ADXL345_RANGE_16G)
45 #endif
46 #ifndef ADXL345_PARAM_INTERRUPT
47 #define ADXL345_PARAM_INTERRUPT {0x0F, 0xBF, 0x40, 0xF0, 0xFF, 0x00, 0x00, \
48  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F}
49 #endif
50 #ifndef ADXL345_PARAM_FULL_RES
51 #define ADXL345_PARAM_FULL_RES (1)
52 #endif
53 #ifndef ADXL345_PARAM_OFFSET
54 #define ADXL345_PARAM_OFFSET { 0, 0, 0 }
55 #endif
56 
57 #ifndef ADXL345_PARAMS
58 #define ADXL345_PARAMS { .i2c = ADXL345_PARAM_I2C, \
59  .addr = ADXL345_PARAM_ADDR, \
60  .offset = ADXL345_PARAM_OFFSET, \
61  .range = ADXL345_PARAM_RANGE, \
62  .rate = ADXL345_PARAM_RATE, \
63  .full_res = ADXL345_PARAM_FULL_RES }
64 #endif
65 #ifndef ADXL345_SAUL_INFO
66 #define ADXL345_SAUL_INFO { .name = "adxl345" }
67 #endif
68 
74 {
75  ADXL345_PARAMS
76 };
77 
82 {
83  ADXL345_SAUL_INFO
84 };
85 
86 #ifdef __cplusplus
87 }
88 #endif
89 
90 #endif /* ADXL345_PARAMS_H */
91 
saul_reg_info_t
Additional data to collect for each entry.
Definition: saul_reg.h:49
adxl345.h
Interface definition for the ADXL345.
adxl345_saul_info
static const saul_reg_info_t adxl345_saul_info[]
Additional meta information to keep in the SAUL registry.
Definition: adxl345_params.h:81
adxl345_params
static const adxl345_params_t adxl345_params[]
ADXL345 configuration.
Definition: adxl345_params.h:73
saul_reg.h
SAUL registry interface definition.
adxl345_params_t
Configuration struct for the ADXL345 sensor.
Definition: adxl345.h:145