lis3dh_params.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2017 Freie Universität Berlin
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 "lis3dh.h"
23 #include "saul_reg.h"
24 
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
33 #ifndef LIS3DH_PARAM_SPI
34 #define LIS3DH_PARAM_SPI (SPI_DEV(0))
35 #endif
36 #ifndef LIS3DH_PARAM_CS
37 #define LIS3DH_PARAM_CS (GPIO_PIN(0, 0))
38 #endif
39 #ifndef LIS3DH_PARAM_CLK
40 #define LIS3DH_PARAM_CLK (SPI_CLK_5MHZ)
41 #endif
42 #ifndef LIS3DH_PARAM_INT1
43 #define LIS3DH_PARAM_INT1 (GPIO_PIN(0, 1))
44 #endif
45 #ifndef LIS3DH_PARAM_INT2
46 #define LIS3DH_PARAM_INT2 (GPIO_PIN(0, 2))
47 #endif
48 #ifndef LIS3DH_PARAM_SCALE
49 #define LIS3DH_PARAM_SCALE (4)
50 #endif
51 #ifndef LIS3DH_PARAM_ODR
52 #define LIS3DH_PARAM_ODR (LIS3DH_ODR_100Hz)
53 #endif
54 
55 #ifndef LIS3DH_PARAMS
56 #define LIS3DH_PARAMS { .spi = LIS3DH_PARAM_SPI, \
57  .cs = LIS3DH_PARAM_CS, \
58  .clk = LIS3DH_PARAM_CLK, \
59  .int1 = LIS3DH_PARAM_INT1, \
60  .int2 = LIS3DH_PARAM_INT2, \
61  .scale = LIS3DH_PARAM_SCALE, \
62  .odr = LIS3DH_PARAM_ODR }
63 #endif
64 #ifndef LIS3DH_SAUL_INFO
65 #define LIS3DH_SAUL_INFO { .name = "lis3dh" }
66 #endif
73 {
74  LIS3DH_PARAMS
75 };
76 
81 {
82  LIS3DH_SAUL_INFO
83 };
84 
85 #ifdef __cplusplus
86 }
87 #endif
88 
Device driver interface for the LIS3DH accelerometer.
static const saul_reg_info_t lis3dh_saul_info[]
Additional meta information to keep in the SAUL registry.
Definition: lis3dh_params.h:80
static const lis3dh_params_t lis3dh_params[]
Allocate some memory to store the actual configuration.
Definition: lis3dh_params.h:72
SAUL registry interface definition.
Configuration parameters for LIS3DH devices.
Definition: lis3dh.h:727
Additional data to collect for each entry.
Definition: saul_reg.h:48