hts221_params.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2017 HAW Hamburg
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 "hts221.h"
23 #include "hts221_regs.h"
24 #include "saul_reg.h"
25 
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29 
34 #ifndef HTS221_PARAM_I2C
35 #define HTS221_PARAM_I2C I2C_DEV(0)
36 #endif
37 #ifndef HTS221_PARAM_ADDR
38 #define HTS221_PARAM_ADDR (HTS221_I2C_ADDRESS)
39 #endif
40 #ifndef HTS221_PARAM_AVGX
41 #define HTS221_PARAM_AVGX ((HTS221_REGS_AVGT_16 << HTS221_REGS_AVGT_SHIFT) | \
42  HTS221_REGS_AVGH_32)
43 #endif
44 #ifndef HTS221_PARAM_RATE
45 #define HTS221_PARAM_RATE (HTS221_REGS_CTRL_REG1_ODR_12HZ)
46 #endif
47 #ifndef HTS221_PARAMS
48 #define HTS221_PARAMS { .i2c = HTS221_PARAM_I2C, \
49  .addr = HTS221_PARAM_ADDR, \
50  .avgx = HTS221_PARAM_AVGX, \
51  .rate = HTS221_PARAM_RATE }
52 #endif /* HTS221_PARAMS */
53 
54 #ifndef HTS221_SAULINFO
55 #define HTS221_SAULINFO { .name = "hts221" }
56 #endif
63 {
64  HTS221_PARAMS,
65 };
66 
71 {
72  HTS221_SAULINFO
73 };
74 
75 #ifdef __cplusplus
76 }
77 #endif
78 
Interface definition for the ST HTS221 driver.
static const hts221_params_t hts221_params[]
HTS221 configuration.
Definition: hts221_params.h:62
static const saul_reg_info_t hts221_saul_info[]
Additional meta information to keep in the SAUL registry.
Definition: hts221_params.h:70
Register definitions for ST HTS221 devices.
SAUL registry interface definition.
Parameters needed for device initialization.
Definition: hts221.h:43
Additional data to collect for each entry.
Definition: saul_reg.h:48