Blame view

RIOT/drivers/adxl345/include/adxl345_params.h 2.08 KB
a752c7ab   elopes   add first test an...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
  /*
   * Copyright (C) 2017 Mesotic SAS
   *
   * This file is subject to the terms and conditions of the GNU Lesser
   * General Public License v2.1. See the file LICENSE in the top level
   * directory for more details.
   */
  
  /**
   * @ingroup     drivers_adxl345
   * @{
   *
   * @file
   * @brief       Default configuration for ADXL345 devices
   *
   * @author     Dylan Laduranty <dylan.laduranty@mesotic.com>
   */
  
  #ifndef ADXL345_PARAMS_H
  #define ADXL345_PARAMS_H
  
  #include "board.h"
  #include "saul_reg.h"
  #include "adxl345.h"
  
  #ifdef __cplusplus
  extern "C" {
  #endif
  
  /**
   * @name    Set default configuration parameters for the ADXL345 driver
   * @{
   */
  #ifndef ADXL345_PARAM_I2C
  #define ADXL345_PARAM_I2C           (I2C_DEV(0))
  #endif
  #ifndef ADXL345_PARAM_ADDR
  #define ADXL345_PARAM_ADDR          (ADXL345_ADDR_53)
  #endif
  #ifndef ADXL345_PARAM_RATE
  #define ADXL345_PARAM_RATE          (ADXL345_RATE_200HZ)
  #endif
  #ifndef ADXL345_PARAM_RANGE
  #define ADXL345_PARAM_RANGE         (ADXL345_RANGE_16G)
  #endif
  #ifndef ADXL345_PARAM_INTERRUPT
  #define ADXL345_PARAM_INTERRUPT     {0x0F, 0xBF, 0x40, 0xF0, 0xFF, 0x00, 0x00, \
                                       0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F}
  #endif
  #ifndef ADXL345_PARAM_FULL_RES
  #define ADXL345_PARAM_FULL_RES      (1)
  #endif
  #ifndef ADXL345_PARAM_OFFSET
  #define ADXL345_PARAM_OFFSET        { 0, 0, 0 }
  #endif
  #ifndef ADXL345_PARAM_SCALE_FACTOR
  #define ADXL345_PARAM_SCALE_FACTOR  (3.9)
  #endif
  #ifndef ADXL345_PARAMS
  #define ADXL345_PARAMS              { .offset = ADXL345_PARAM_OFFSET,    \
                                        .range  = ADXL345_PARAM_RANGE,     \
                                        .rate   = ADXL345_PARAM_RATE,      \
                                        .full_res = ADXL345_PARAM_FULL_RES }
  #endif
  /**@}*/
  
  /**
   * @brief   ADXL345 configuration
   */
  static const adxl345_params_t adxl345_params[] =
  {
      ADXL345_PARAMS
  };
  
  /**
   * @brief   Additional meta information to keep in the SAUL registry
   */
  static const saul_reg_info_t adxl345_saul_info[] =
  {
      {
          .name = "adxl345"
      }
  };
  
  #ifdef __cplusplus
  }
  #endif
  
  #endif /* ADXL345_PARAMS_H */
  /** @} */