lpsxxx_params.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2017 Freie Universität Berlin
3  * 2018 Inria
4  *
5  * This file is subject to the terms and conditions of the GNU Lesser
6  * General Public License v2.1. See the file LICENSE in the top level
7  * directory for more details.
8  */
9 
21 #ifndef LPSXXX_PARAMS_H
22 #define LPSXXX_PARAMS_H
23 
24 #include "board.h"
25 #include "lpsxxx.h"
26 #include "saul_reg.h"
27 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31 
36 #ifndef LPSXXX_PARAM_I2C
37 #define LPSXXX_PARAM_I2C I2C_DEV(0)
38 #endif
39 #ifndef LPSXXX_PARAM_ADDR
40 #define LPSXXX_PARAM_ADDR (CONFIG_LPSXXX_DEFAULT_ADDRESS)
41 #endif
42 #ifndef LPSXXX_PARAM_RATE
43 #define LPSXXX_PARAM_RATE (LPSXXX_DEFAULT_RATE)
44 #endif
45 
46 #ifndef LPSXXX_PARAMS
47 #define LPSXXX_PARAMS { .i2c = LPSXXX_PARAM_I2C, \
48  .addr = LPSXXX_PARAM_ADDR, \
49  .rate = LPSXXX_PARAM_RATE }
50 #endif
51 
52 #if MODULE_LPS331AP
53 #define LPSXXX_SAUL_NAME "lps331ap"
54 #elif MODULE_LPS25HB
55 #define LPSXXX_SAUL_NAME "lps25hb"
56 #elif MODULE_LPS22HB
57 #define LPSXXX_SAUL_NAME "lps22hb"
58 #endif
59 #ifndef LPSXXX_SAUL_INFO
60 #define LPSXXX_SAUL_INFO { .name = LPSXXX_SAUL_NAME }
61 #endif
62 
68 {
69  LPSXXX_PARAMS
70 };
71 
76 {
77  LPSXXX_SAUL_INFO
78 };
79 
80 #ifdef __cplusplus
81 }
82 #endif
83 
84 #endif /* LPSXXX_PARAMS_H */
85 
saul_reg_info_t
Additional data to collect for each entry.
Definition: saul_reg.h:49
lpsxxx.h
lpsxxx_saul_info
static const saul_reg_info_t lpsxxx_saul_info[]
Additional meta information to keep in the SAUL registry.
Definition: lpsxxx_params.h:75
lpsxxx_params
static const lpsxxx_params_t lpsxxx_params[]
Allocate some memory to store the actual configuration.
Definition: lpsxxx_params.h:67
saul_reg.h
SAUL registry interface definition.
lpsxxx_params_t
Struct holding all parameters needed for device initialization.
Definition: lpsxxx.h:99