ds75lx.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2019 Inria
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 
25 #include "saul.h"
26 #include "periph/i2c.h"
27 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31 
35 typedef enum {
41 
45 typedef struct {
47  uint8_t addr;
50 
54 typedef struct {
56 } ds75lx_t;
57 
61 enum {
62  DS75LX_OK = 0,
64 };
65 
75 int ds75lx_init(ds75lx_t *dev, const ds75lx_params_t *params);
76 
86 int ds75lx_read_temperature(const ds75lx_t *dev, int16_t *temperature);
87 
96 int ds75lx_wakeup(const ds75lx_t *dev);
97 
106 int ds75lx_shutdown(const ds75lx_t *dev);
107 
108 #ifdef __cplusplus
109 }
110 #endif
111 
int ds75lx_init(ds75lx_t *dev, const ds75lx_params_t *params)
Initialize the given DS75LX device.
ds75lx_resolution_t
Thermometer resolution.
Definition: ds75lx.h:35
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_OK
everything was fine
Definition: ds75lx.h:62
@ DS75LX_ERR_I2C
error when reading/writing I2C bus
Definition: ds75lx.h:63
@ DS75LX_RESOLUTION_12
12 bits resolution, 200ms max conversion time
Definition: ds75lx.h:39
@ DS75LX_RESOLUTION_9
9 bits resolution, 25ms max conversion time
Definition: ds75lx.h:36
@ DS75LX_RESOLUTION_11
11 bits resolution, 100ms max conversion time
Definition: ds75lx.h:38
@ DS75LX_RESOLUTION_10
10 bits resolution, 50ms max conversion time
Definition: ds75lx.h:37
uint_fast8_t i2c_t
Default i2c_t type definition.
Definition: i2c.h:144
Low-level I2C peripheral driver interface definition.
Device initialization parameters.
Definition: ds75lx.h:45
ds75lx_resolution_t resolution
Thermometer resolution.
Definition: ds75lx.h:48
i2c_t i2c
I2C device which is used.
Definition: ds75lx.h:46
uint8_t addr
I2C address.
Definition: ds75lx.h:47
Device descriptor for the DS75LX sensor.
Definition: ds75lx.h:54
ds75lx_params_t params
Device initialization parameters.
Definition: ds75lx.h:55
Functionality for reading [S]ensor [A]ctuator [U]ber [L]ayer sensors as SenML.