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 
23 #ifndef LPS331AP_H
24 #define LPS331AP_H
25 
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29 
30 #include <stdint.h>
31 #include "periph/i2c.h"
32 
36 #define LPS331AP_DEFAULT_ADDRESS (0x5c)
37 
41 typedef enum {
47 
51 typedef struct {
53  uint8_t addr;
56 
60 typedef struct {
62 } lps331ap_t;
63 
73 int lps331ap_init(lps331ap_t *dev, const lps331ap_params_t * params);
74 
82 int lps331ap_read_temp(const lps331ap_t *dev);
83 
91 int lps331ap_read_pres(const lps331ap_t *dev);
92 
101 int lps331ap_enable(const lps331ap_t *dev);
102 
111 int lps331ap_disable(const lps331ap_t *dev);
112 
113 #ifdef __cplusplus
114 }
115 #endif
116 
117 #endif /* LPS331AP_H */
118 
sample with 25Hz
Definition: lps331ap.h:45
sample with 12.5Hz
Definition: lps331ap.h:44
Device descriptor for LPS331AP sensors.
Definition: lps331ap.h:60
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:54
i2c_t i2c
I2C bus the sensor is connected to.
Definition: lps331ap.h:52
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:42
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:61
sample with 7Hz
Definition: lps331ap.h:43
lps331ap_rate_t
Possible sampling rates for LPS331AP sensors.
Definition: lps331ap.h:41
uint8_t addr
the devices address on the bus
Definition: lps331ap.h:53
int lps331ap_disable(const lps331ap_t *dev)
Disable the given sensor.
Struct holding all parameters needed for device initialization.
Definition: lps331ap.h:51
Low-level I2C peripheral driver interface definition.