Blame view

RIOT/drivers/lsm6dsl/include/lsm6dsl_params.h 2.46 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
91
92
93
94
95
96
  /*
   * Copyright (C) 2017 OTA keys S.A.
   *
   * 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_lsm6dsl
   * @{
   *
   * @file
   * @brief       Default configuration for LSM6DSL devices
   *
   * @author      Vincent Dupont <vincent@otakeys.com>
   *
   */
  
  #ifndef LSM6DSL_PARAMS_H
  #define LSM6DSL_PARAMS_H
  
  #include "board.h"
  #include "lsm6dsl.h"
  #include "saul_reg.h"
  
  #ifdef __cplusplus
  extern "C" {
  #endif
  
  /**
   * @name    Set default configuration parameters
   * @{
   */
  #ifndef LSM6DSL_PARAM_I2C
  #define LSM6DSL_PARAM_I2C            I2C_DEV(0)
  #endif
  #ifndef LSM6DSL_PARAM_ADDR
  #define LSM6DSL_PARAM_ADDR           (0x6B) /* (0x6A) */
  #endif
  #ifndef LSM6DSL_PARAM_ACC_ODR
  #define LSM6DSL_PARAM_ACC_ODR        (LSM6DSL_DATA_RATE_52HZ)
  #endif
  #ifndef LSM6DSL_PARAM_GYRO_ODR
  #define LSM6DSL_PARAM_GYRO_ODR       (LSM6DSL_DATA_RATE_52HZ)
  #endif
  #ifndef LSM6DSL_PARAM_ACC_FS
  #define LSM6DSL_PARAM_ACC_FS         (LSM6DSL_ACC_FS_2G)
  #endif
  #ifndef LSM6DSL_PARAM_GYRO_FS
  #define LSM6DSL_PARAM_GYRO_FS        (LSM6DSL_GYRO_FS_245DPS)
  #endif
  #ifndef LSM6DSL_PARAM_ACC_FIFO_DEC
  #define LSM6DSL_PARAM_ACC_FIFO_DEC   (LSM6DSL_DECIMATION_NO)
  #endif
  #ifndef LSM6DSL_PARAM_GYRO_FIFO_DEC
  #define LSM6DSL_PARAM_GYRO_FIFO_DEC  (LSM6DSL_DECIMATION_NO)
  #endif
  
  #define LSM6DSL_PARAMS_DEFAULT       { .i2c             = LSM6DSL_PARAM_I2C, \
                                         .addr            = LSM6DSL_PARAM_ADDR, \
                                         .acc_odr         = LSM6DSL_PARAM_ACC_ODR, \
                                         .gyro_odr        = LSM6DSL_PARAM_GYRO_ODR, \
                                         .acc_fs          = LSM6DSL_PARAM_ACC_FS, \
                                         .gyro_fs         = LSM6DSL_PARAM_GYRO_FS, \
                                         .acc_decimation  = LSM6DSL_PARAM_ACC_FIFO_DEC, \
                                         .gyro_decimation = LSM6DSL_PARAM_GYRO_FIFO_DEC }
  /** @} */
  
  /**
   * @brief   Allocate some memory to store the actual configuration
   */
  static const lsm6dsl_params_t lsm6dsl_params[] =
  {
  #ifdef LSM6DSL_PARAMS_CUSTOM
      LSM6DSL_PARAMS_CUSTOM,
  #else
      LSM6DSL_PARAMS_DEFAULT,
  #endif
  };
  
  /**
   * @brief   Additional meta information to keep in the SAUL registry
   */
  static const saul_reg_info_t lsm6dsl_saul_info[] =
  {
      { .name = "lsm6dsl" }
  };
  
  #ifdef __cplusplus
  }
  #endif
  
  #endif /* LSM6DSL_PARAMS_H */
  /** @} */