Loading...
Searching...
No Matches
ds75lx.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2019 Inria
3 * SPDX-License-Identifier: LGPL-2.1-only
4 */
5
6#pragma once
7
21
22#include "saul.h"
23#include "periph/i2c.h"
24
25#ifdef __cplusplus
26extern "C" {
27#endif
28
38
47
51typedef struct {
53} ds75lx_t;
54
58enum {
61};
62
72int ds75lx_init(ds75lx_t *dev, const ds75lx_params_t *params);
73
83int ds75lx_read_temperature(const ds75lx_t *dev, int16_t *temperature);
84
93int ds75lx_wakeup(const ds75lx_t *dev);
94
103int ds75lx_shutdown(const ds75lx_t *dev);
104
105#ifdef __cplusplus
106}
107#endif
108
Definition of the generic [S]ensor [A]ctuator [U]ber [L]ayer.
int ds75lx_init(ds75lx_t *dev, const ds75lx_params_t *params)
Initialize the given DS75LX device.
ds75lx_resolution_t
Thermometer resolution.
Definition ds75lx.h:32
int ds75lx_shutdown(const ds75lx_t *dev)
Shutdown the sensor.
int ds75lx_read_temperature(const ds75lx_t *dev, int16_t *temperature)
Read temperature value from the given DS75LX device, returned in c°C.
int ds75lx_wakeup(const ds75lx_t *dev)
Wakeup the sensor.
@ DS75LX_RESOLUTION_12
12 bits resolution, 200ms max conversion time
Definition ds75lx.h:36
@ DS75LX_RESOLUTION_9
9 bits resolution, 25ms max conversion time
Definition ds75lx.h:33
@ DS75LX_RESOLUTION_11
11 bits resolution, 100ms max conversion time
Definition ds75lx.h:35
@ DS75LX_RESOLUTION_10
10 bits resolution, 50ms max conversion time
Definition ds75lx.h:34
@ DS75LX_OK
everything was fine
Definition ds75lx.h:59
@ DS75LX_ERR_I2C
error when reading/writing I2C bus
Definition ds75lx.h:60
uint_fast8_t i2c_t
Default i2c_t type definition.
Definition i2c.h:155
Low-level I2C peripheral driver interface definition.
Device initialization parameters.
Definition ds75lx.h:42
ds75lx_resolution_t resolution
Thermometer resolution.
Definition ds75lx.h:45
i2c_t i2c
I2C device which is used.
Definition ds75lx.h:43
uint8_t addr
I2C address.
Definition ds75lx.h:44
Device descriptor for the DS75LX sensor.
Definition ds75lx.h:51
ds75lx_params_t params
Device initialization parameters.
Definition ds75lx.h:52