commit
e9145fb911
@ -1 +1,6 @@
|
||||
*.a binary
|
||||
# Default conflict marker size is 7 which causes some of the headings in
|
||||
# release-notes.txt to trigger git diff --check: 'leftover conflict marker'
|
||||
# when the heading is exactly 7 characters long.
|
||||
*.md conflict-marker-size=100
|
||||
*.txt conflict-marker-size=100
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1 +1 @@
|
||||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer\. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and or other materials provided with the distribution\. Neither the name of Texas Instruments Incorporated nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission\. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED\. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES \(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION\) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT \(INCLUDING NEGLIGENCE OR OTHERWISE\) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE\.
|
||||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer\. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and or other materials provided with the distribution\. Neither the name of Texas Instruments Incorporated nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission\. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED\. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES \(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION\) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT \(INCLUDING NEGLIGENCE OR OTHERWISE\) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE\.
|
||||
|
@ -1,138 +1,138 @@
|
||||
/*
|
||||
* Copyright (C) 2014 PHYTEC Messtechnik GmbH
|
||||
*
|
||||
* This file is subject to the terms and conditions of the GNU Lesser
|
||||
* General Public License v2.1. See the file LICENSE in the top level
|
||||
* directory for more details.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @defgroup drivers_hdc1000 HDC1000 Humidity and Temperature Sensor
|
||||
* @ingroup drivers
|
||||
* @brief Driver for the Texas Instruments HDC1000
|
||||
* Humidity and Temperature Sensor.
|
||||
* The driver will initialize the sensor for best
|
||||
* resolution (14 bit). Currently the driver doesn't use the heater.
|
||||
* Temperature and humidity are acquired in sequence.
|
||||
* The sensor is always in sleep mode. The measurement must
|
||||
* be started by a write access to the address 0x00
|
||||
* (HDC1000_TEMPERATURE). After completing the measurement
|
||||
* the sensor will return to sleep mode. Typical
|
||||
* Conversion Time by 14 bit resolution is 6.50ms
|
||||
* for humidity and 6.35ms for temperature.
|
||||
* HDC1000_CONVERSION_TIME is twice as large to prevent
|
||||
* the problems with timer resolution.
|
||||
*
|
||||
* @{
|
||||
*
|
||||
* @file
|
||||
* @brief Interface definition for the HDC1000 sensor driver.
|
||||
*
|
||||
* @author Johann Fischer <j.fischer@phytec.de>
|
||||
*/
|
||||
|
||||
#ifndef HDC1000_H
|
||||
#define HDC1000_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include "periph/i2c.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
#ifndef HDC1000_I2C_ADDRESS
|
||||
#define HDC1000_I2C_ADDRESS 0x43 /**< Default Device Address */
|
||||
#endif
|
||||
|
||||
#ifndef HDC1000_CONVERSION_TIME
|
||||
#define HDC1000_CONVERSION_TIME 26000 /**< Default Conversion Time */
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Device descriptor for HDC1000 sensors.
|
||||
*/
|
||||
typedef struct {
|
||||
i2c_t i2c; /**< I2C device the sensor is connected to */
|
||||
uint8_t addr; /**< the sensor's slave address on the I2C bus */
|
||||
bool initialized; /**< sensor status, true if sensor is initialized */
|
||||
} hdc1000_t;
|
||||
|
||||
/**
|
||||
* @brief HDC1000 sensor test.
|
||||
* This function looks for Manufacturer ID of the HDC1000 sensor.
|
||||
*
|
||||
* @param[in] dev device descriptor of sensor
|
||||
*
|
||||
* @return 0 on success
|
||||
* @return -1 on error
|
||||
*/
|
||||
int hdc1000_test(hdc1000_t *dev);
|
||||
|
||||
/**
|
||||
* @brief Initialise the HDC1000 sensor driver.
|
||||
* 14 bit resolution, heater off, temperature and humidity
|
||||
* are acquired in sequence.
|
||||
*
|
||||
* @param[out] dev device descriptor of sensor to initialize
|
||||
* @param[in] i2c I2C bus the sensor is connected to
|
||||
* @param[in] address sensor's I2C slave address
|
||||
*
|
||||
* @return 0 on success
|
||||
* @return -1 if initialization of I2C bus failed
|
||||
* @return -2 if sensor test failed
|
||||
* @return -3 if sensor configuration failed
|
||||
*/
|
||||
int hdc1000_init(hdc1000_t *dev, i2c_t i2c, uint8_t address);
|
||||
|
||||
/**
|
||||
* @brief Reset the HDC1000 sensor. After that sensor should be reinitialized.
|
||||
*
|
||||
* @param[out] dev device descriptor of sensor to reset
|
||||
*
|
||||
* @return 0 on success
|
||||
* @return -1 on error
|
||||
*/
|
||||
|