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