Loading...
Searching...
No Matches
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
21#ifndef SDP3X_PARAMS_H
22#define SDP3X_PARAMS_H
23
24#include "board.h"
25#include "sdp3x.h"
26#include "saul_reg.h"
27#include "periph/gpio.h"
28
29#ifdef __cplusplus
30extern "C" {
31#endif
32
37#define SDP3X_ADDR1 (0x21) /* 7 bit address */
38#define SDP3X_ADDR2 (0x22) /* 7 bit address */
39#define SDP3X_ADDR3 (0x23) /* 7 bit address */
46#define SDP3X_MODEL_31 1
47#define SDP3X_MODEL_32 2
48
49#define SDP31_PRODUCT_NO_BYTE_0 0x03
50#define SDP31_PRODUCT_NO_BYTE_1 0x01
51#define SDP31_PRODUCT_NO_BYTE_3 0x01
58#ifndef SDP3X_PARAM_I2C_DEV
59#define SDP3X_PARAM_I2C_DEV I2C_DEV(0)
60#endif
61#ifndef SDP3X_PARAM_I2C_ADDR
62#define SDP3X_PARAM_I2C_ADDR SDP3X_ADDR1
63#endif
64#ifndef SDP3X_PARAM_IRQ_PIN
65#define SDP3X_PARAM_IRQ_PIN GPIO_UNDEF
66#endif
67
68#ifndef SDP3X_PARAMS
69#define SDP3X_PARAMS { .i2c_dev = SDP3X_PARAM_I2C_DEV, \
70 .i2c_addr = SDP3X_PARAM_I2C_ADDR, \
71 .irq_pin = SDP3X_PARAM_IRQ_PIN }
72#endif
73
74#ifndef SDP3X_SAUL_INFO
75#define SDP3X_SAUL_INFO { .name = "sdp3x" }
76#endif
77
84{
85 SDP3X_PARAMS
86};
87
91#define SDP3X_NUMOF ARRAY_SIZE(sdp3x_params)
92
97{
98 SDP3X_SAUL_INFO
99};
100
101#ifdef __cplusplus
102}
103#endif
104
105#endif /* SDP3X_PARAMS_H */
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.
static const sdp3x_params_t sdp3x_params[]
Configure SDP3X.
#define SDP3X_NUMOF
Get the number of configured SDP3X devices.
Additional data to collect for each entry.
Definition saul_reg.h:49
Device initialization parameters.
Definition sdp3x.h:48