Loading...
Searching...
No Matches
sdp3x_params.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2019 Dirk Ehmen
3 * SPDX-FileCopyrightText: 2020 Nishchay Agrawal
4 * SPDX-License-Identifier: LGPL-2.1-only
5 */
6
7#pragma once
8
19
20#include "board.h"
21#include "sdp3x.h"
22#include "saul_reg.h"
23#include "periph/gpio.h"
24
25#ifdef __cplusplus
26extern "C" {
27#endif
28
33#define SDP3X_ADDR1 (0x21) /* 7 bit address */
34#define SDP3X_ADDR2 (0x22) /* 7 bit address */
35#define SDP3X_ADDR3 (0x23) /* 7 bit address */
37
42#define SDP3X_MODEL_31 1
43#define SDP3X_MODEL_32 2
44
45#define SDP31_PRODUCT_NO_BYTE_0 0x03
46#define SDP31_PRODUCT_NO_BYTE_1 0x01
47#define SDP31_PRODUCT_NO_BYTE_3 0x01
49
54#ifndef SDP3X_PARAM_I2C_DEV
55#define SDP3X_PARAM_I2C_DEV I2C_DEV(0)
56#endif
57#ifndef SDP3X_PARAM_I2C_ADDR
58#define SDP3X_PARAM_I2C_ADDR SDP3X_ADDR1
59#endif
60#ifndef SDP3X_PARAM_IRQ_PIN
61#define SDP3X_PARAM_IRQ_PIN GPIO_UNDEF
62#endif
63
64#ifndef SDP3X_PARAMS
65#define SDP3X_PARAMS { .i2c_dev = SDP3X_PARAM_I2C_DEV, \
66 .i2c_addr = SDP3X_PARAM_I2C_ADDR, \
67 .irq_pin = SDP3X_PARAM_IRQ_PIN }
68#endif
69
70#ifndef SDP3X_SAUL_INFO
71#define SDP3X_SAUL_INFO { .name = "sdp3x" }
72#endif
73
75
80{
81 SDP3X_PARAMS
82};
83
87#define SDP3X_NUMOF ARRAY_SIZE(sdp3x_params)
88
93{
94 SDP3X_SAUL_INFO
95};
96
97#ifdef __cplusplus
98}
99#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.
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:48
Device initialization parameters.
Definition sdp3x.h:47