sdp3x_params.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2019 Dirk Ehmen
3  * 2020 Nishchay Agrawal
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 
10 #pragma once
11 
23 #include "board.h"
24 #include "sdp3x.h"
25 #include "saul_reg.h"
26 #include "periph/gpio.h"
27 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31 
36 #define SDP3X_ADDR1 (0x21) /* 7 bit address */
37 #define SDP3X_ADDR2 (0x22) /* 7 bit address */
38 #define SDP3X_ADDR3 (0x23) /* 7 bit address */
45 #define SDP3X_MODEL_31 1
46 #define SDP3X_MODEL_32 2
47 
48 #define SDP31_PRODUCT_NO_BYTE_0 0x03
49 #define SDP31_PRODUCT_NO_BYTE_1 0x01
50 #define SDP31_PRODUCT_NO_BYTE_3 0x01
57 #ifndef SDP3X_PARAM_I2C_DEV
58 #define SDP3X_PARAM_I2C_DEV I2C_DEV(0)
59 #endif
60 #ifndef SDP3X_PARAM_I2C_ADDR
61 #define SDP3X_PARAM_I2C_ADDR SDP3X_ADDR1
62 #endif
63 #ifndef SDP3X_PARAM_IRQ_PIN
64 #define SDP3X_PARAM_IRQ_PIN GPIO_UNDEF
65 #endif
66 
67 #ifndef SDP3X_PARAMS
68 #define SDP3X_PARAMS { .i2c_dev = SDP3X_PARAM_I2C_DEV, \
69  .i2c_addr = SDP3X_PARAM_I2C_ADDR, \
70  .irq_pin = SDP3X_PARAM_IRQ_PIN }
71 #endif
72 
73 #ifndef SDP3X_SAUL_INFO
74 #define SDP3X_SAUL_INFO { .name = "sdp3x" }
75 #endif
76 
82 static const sdp3x_params_t sdp3x_params[] =
83 {
84  SDP3X_PARAMS
85 };
86 
90 #define SDP3X_NUMOF ARRAY_SIZE(sdp3x_params)
91 
96 {
97  SDP3X_SAUL_INFO
98 };
99 
100 #ifdef __cplusplus
101 }
102 #endif
Low-level GPIO peripheral driver interface definitions.
SAUL registry interface definition.
Device driver interface for the SDP3x sensor.
static const saul_reg_info_t sdp3x_saul_info[SDP3X_NUMOF]
Configure SAUL registry entries.
Definition: sdp3x_params.h:95
static const sdp3x_params_t sdp3x_params[]
Configure SDP3X.
Definition: sdp3x_params.h:82
#define SDP3X_NUMOF
Get the number of configured SDP3X devices.
Definition: sdp3x_params.h:90
Additional data to collect for each entry.
Definition: saul_reg.h:48
Device initialization parameters.
Definition: sdp3x.h:47