LibDriver HDC1080
Loading...
Searching...
No Matches
driver_hdc1080.c File Reference

driver hdc1080 source file More...

#include "driver_hdc1080.h"
Include dependency graph for driver_hdc1080.c:

Go to the source code of this file.

Macros

#define CHIP_NAME   "Texas Instruments HDC1080"
 chip information definition
#define MANUFACTURER_NAME   "Texas Instruments"
#define SUPPLY_VOLTAGE_MIN   2.7f
#define SUPPLY_VOLTAGE_MAX   5.5f
#define MAX_CURRENT   7.2f
#define TEMPERATURE_MIN   -40.0f
#define TEMPERATURE_MAX   125.0f
#define DRIVER_VERSION   1000
#define HDC1080_ADDRESS   0x80
 chip address definition
#define HDC1080_REG_TEMPERATURE   0x00
 chip register definition
#define HDC1080_REG_HUMIDITY   0x01
#define HDC1080_REG_CONFIG   0x02
#define HDC1080_REG_SERIAL_ID_0   0xFB
#define HDC1080_REG_SERIAL_ID_1   0xFC
#define HDC1080_REG_SERIAL_ID_2   0xFD
#define HDC1080_REG_MANUFACTURER_ID   0xFE
#define HDC1080_REG_DEVICE_ID   0xFF

Functions

uint8_t hdc1080_init (hdc1080_handle_t *handle)
 initialize the chip
uint8_t hdc1080_deinit (hdc1080_handle_t *handle)
 close the chip
uint8_t hdc1080_read_temperature_humidity (hdc1080_handle_t *handle, uint16_t *temperature_raw, float *temperature_s, uint16_t *humidity_raw, float *humidity_s)
 read the temperature and humidity data
uint8_t hdc1080_read_temperature (hdc1080_handle_t *handle, uint16_t *temperature_raw, float *temperature_s)
 read the temperature
uint8_t hdc1080_read_humidity (hdc1080_handle_t *handle, uint16_t *humidity_raw, float *humidity_s)
 read the humidity data
uint8_t hdc1080_software_reset (hdc1080_handle_t *handle)
 software reset
uint8_t hdc1080_set_heater (hdc1080_handle_t *handle, hdc1080_bool_t enable)
 enable or disable heater
uint8_t hdc1080_get_heater (hdc1080_handle_t *handle, hdc1080_bool_t *enable)
 get the heater status
uint8_t hdc1080_set_mode (hdc1080_handle_t *handle, hdc1080_mode_t mode)
 set the chip mode
uint8_t hdc1080_get_mode (hdc1080_handle_t *handle, hdc1080_mode_t *mode)
 get the chip mode
uint8_t hdc1080_get_battery_status (hdc1080_handle_t *handle, hdc1080_battery_status_t *status)
 get battery status
uint8_t hdc1080_set_temperature_resolution (hdc1080_handle_t *handle, hdc1080_temperature_resolution_t resolution)
 set temperature resolution
uint8_t hdc1080_get_temperature_resolution (hdc1080_handle_t *handle, hdc1080_temperature_resolution_t *resolution)
 get temperature resolution
uint8_t hdc1080_set_humidity_resolution (hdc1080_handle_t *handle, hdc1080_humidity_resolution_t resolution)
 set humidity resolution
uint8_t hdc1080_get_humidity_resolution (hdc1080_handle_t *handle, hdc1080_humidity_resolution_t *resolution)
 get humidity resolution
uint8_t hdc1080_get_serial_id (hdc1080_handle_t *handle, uint8_t id[6])
 get serial id
uint8_t hdc1080_set_reg (hdc1080_handle_t *handle, uint8_t reg, uint16_t data)
 set chip register
uint8_t hdc1080_get_reg (hdc1080_handle_t *handle, uint8_t reg, uint16_t *data)
 get chip register
uint8_t hdc1080_info (hdc1080_info_t *info)
 get chip's information

Detailed Description

driver hdc1080 source file

Copyright (c) 2015 - present LibDriver All rights reserved

The MIT License (MIT)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Version
1.0.0
Author
Shifeng Li
Date
2023-04-30

history

Date Version Author Description
2023/04/30 1.0 Shifeng Li first upload

Definition in file driver_hdc1080.c.

Macro Definition Documentation

◆ CHIP_NAME

#define CHIP_NAME   "Texas Instruments HDC1080"

chip information definition

chip name

Definition at line 42 of file driver_hdc1080.c.

◆ DRIVER_VERSION

#define DRIVER_VERSION   1000

driver version

Definition at line 49 of file driver_hdc1080.c.

◆ HDC1080_ADDRESS

#define HDC1080_ADDRESS   0x80

chip address definition

iic device address

Definition at line 54 of file driver_hdc1080.c.

◆ HDC1080_REG_CONFIG

#define HDC1080_REG_CONFIG   0x02

configuration register

Definition at line 61 of file driver_hdc1080.c.

◆ HDC1080_REG_DEVICE_ID

#define HDC1080_REG_DEVICE_ID   0xFF

device id register

Definition at line 66 of file driver_hdc1080.c.

◆ HDC1080_REG_HUMIDITY

#define HDC1080_REG_HUMIDITY   0x01

humidity register

Definition at line 60 of file driver_hdc1080.c.

◆ HDC1080_REG_MANUFACTURER_ID

#define HDC1080_REG_MANUFACTURER_ID   0xFE

manufacturer id register

Definition at line 65 of file driver_hdc1080.c.

◆ HDC1080_REG_SERIAL_ID_0

#define HDC1080_REG_SERIAL_ID_0   0xFB

serial id 0 register

Definition at line 62 of file driver_hdc1080.c.

◆ HDC1080_REG_SERIAL_ID_1

#define HDC1080_REG_SERIAL_ID_1   0xFC

serial id 1 register

Definition at line 63 of file driver_hdc1080.c.

◆ HDC1080_REG_SERIAL_ID_2

#define HDC1080_REG_SERIAL_ID_2   0xFD

serial id 2 register

Definition at line 64 of file driver_hdc1080.c.

◆ HDC1080_REG_TEMPERATURE

#define HDC1080_REG_TEMPERATURE   0x00

chip register definition

temperature register

Definition at line 59 of file driver_hdc1080.c.

◆ MANUFACTURER_NAME

#define MANUFACTURER_NAME   "Texas Instruments"

manufacturer name

Definition at line 43 of file driver_hdc1080.c.

◆ MAX_CURRENT

#define MAX_CURRENT   7.2f

chip max current

Definition at line 46 of file driver_hdc1080.c.

◆ SUPPLY_VOLTAGE_MAX

#define SUPPLY_VOLTAGE_MAX   5.5f

chip max supply voltage

Definition at line 45 of file driver_hdc1080.c.

◆ SUPPLY_VOLTAGE_MIN

#define SUPPLY_VOLTAGE_MIN   2.7f

chip min supply voltage

Definition at line 44 of file driver_hdc1080.c.

◆ TEMPERATURE_MAX

#define TEMPERATURE_MAX   125.0f

chip max operating temperature

Definition at line 48 of file driver_hdc1080.c.

◆ TEMPERATURE_MIN

#define TEMPERATURE_MIN   -40.0f

chip min operating temperature

Definition at line 47 of file driver_hdc1080.c.