lps331ap.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2014 Freie Universität Berlin
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 
26 #ifndef LPS331AP_H
27 #define LPS331AP_H
28 
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32 
33 #include <stdint.h>
34 #include "periph/i2c.h"
35 
39 #define LPS331AP_DEFAULT_ADDRESS (0x5c)
40 
44 typedef enum {
50 
54 typedef struct {
56  uint8_t addr;
59 
63 typedef struct {
65 } lps331ap_t;
66 
76 int lps331ap_init(lps331ap_t *dev, const lps331ap_params_t * params);
77 
85 int lps331ap_read_temp(const lps331ap_t *dev);
86 
94 int lps331ap_read_pres(const lps331ap_t *dev);
95 
104 int lps331ap_enable(const lps331ap_t *dev);
105 
114 int lps331ap_disable(const lps331ap_t *dev);
115 
116 #ifdef __cplusplus
117 }
118 #endif
119 
120 #endif /* LPS331AP_H */
121 
sample with 25Hz
Definition: lps331ap.h:48
sample with 12.5Hz
Definition: lps331ap.h:47
Device descriptor for LPS331AP sensors.
Definition: lps331ap.h:63
unsigned int i2c_t
Default i2c_t type definition.
Definition: i2c.h:157
lps331ap_rate_t rate
tell sensor to sample with this rate
Definition: lps331ap.h:57
i2c_t i2c
I2C bus the sensor is connected to.
Definition: lps331ap.h:55
int lps331ap_read_temp(const lps331ap_t *dev)
Read a temperature value from the given sensor, returned in m°C.
int lps331ap_read_pres(const lps331ap_t *dev)
Read a pressure value from the given sensor, returned in mbar.
sample with 1Hz
Definition: lps331ap.h:45
int lps331ap_enable(const lps331ap_t *dev)
Enable the given sensor.
int lps331ap_init(lps331ap_t *dev, const lps331ap_params_t *params)
Initialize a given LPS331AP pressure sensor.
lps331ap_params_t params
device initialization parameters
Definition: lps331ap.h:64
sample with 7Hz
Definition: lps331ap.h:46
lps331ap_rate_t
Possible sampling rates for LPS331AP sensors.
Definition: lps331ap.h:44
uint8_t addr
the devices address on the bus
Definition: lps331ap.h:56
int lps331ap_disable(const lps331ap_t *dev)
Disable the given sensor.
Struct holding all parameters needed for device initialization.
Definition: lps331ap.h:54
Low-level I2C peripheral driver interface definition.