LibDriver LM75B
Loading...
Searching...
No Matches
driver_lm75b.c File Reference

driver lm75b source file More...

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

Go to the source code of this file.

Macros

#define CHIP_NAME   "NXP LM75B"
 chip information definition
#define MANUFACTURER_NAME   "NXP"
#define SUPPLY_VOLTAGE_MIN   2.8f
#define SUPPLY_VOLTAGE_MAX   5.5f
#define MAX_CURRENT   10.0f
#define TEMPERATURE_MIN   -55.0f
#define TEMPERATURE_MAX   125.0f
#define DRIVER_VERSION   2000
#define LM75B_REG_CONF   0x01
 chip register definition
#define LM75B_REG_TEMP   0x00
#define LM75B_REG_TOS   0x03
#define LM75B_REG_THYST   0x02

Functions

uint8_t lm75b_set_addr_pin (lm75b_handle_t *handle, lm75b_address_t addr_pin)
 set the iic address pin
uint8_t lm75b_get_addr_pin (lm75b_handle_t *handle, lm75b_address_t *addr_pin)
 get the iic address pin
uint8_t lm75b_hysteresis_convert_to_register (lm75b_handle_t *handle, float c, uint16_t *reg)
 convert the hysteresis value to the register data
uint8_t lm75b_hysteresis_convert_to_data (lm75b_handle_t *handle, uint16_t reg, float *c)
 convert the register raw data to the hysteresis value
uint8_t lm75b_set_hysteresis (lm75b_handle_t *handle, uint16_t hysteresis)
 set the hysteresis value
uint8_t lm75b_get_hysteresis (lm75b_handle_t *handle, uint16_t *hysteresis)
 get the hysteresis value
uint8_t lm75b_over_temperature_threshold_convert_to_register (lm75b_handle_t *handle, float c, uint16_t *reg)
 convert the over temperature threshold to the register data
uint8_t lm75b_over_temperature_threshold_convert_to_data (lm75b_handle_t *handle, uint16_t reg, float *c)
 convert the register raw data to the over temperature threshold
uint8_t lm75b_set_over_temperature_threshold (lm75b_handle_t *handle, uint16_t threshold)
 set the over temperature threshold
uint8_t lm75b_get_over_temperature_threshold (lm75b_handle_t *handle, uint16_t *threshold)
 get the over temperature threshold
uint8_t lm75b_set_fault_queue (lm75b_handle_t *handle, lm75b_fault_queue_t fault_queue)
 set the chip fault queue
uint8_t lm75b_get_fault_queue (lm75b_handle_t *handle, lm75b_fault_queue_t *fault_queue)
 get the chip fault queue
uint8_t lm75b_set_os_polarity (lm75b_handle_t *handle, lm75b_os_polarity_t polarity)
 set the chip os polarity
uint8_t lm75b_get_os_polarity (lm75b_handle_t *handle, lm75b_os_polarity_t *polarity)
 get the chip os polarity
uint8_t lm75b_set_interrupt_mode (lm75b_handle_t *handle, lm75b_os_operation_mode_t mode)
 set the chip interrupt mode
uint8_t lm75b_get_interrupt_mode (lm75b_handle_t *handle, lm75b_os_operation_mode_t *mode)
 get the chip interrupt mode
uint8_t lm75b_set_mode (lm75b_handle_t *handle, lm75b_mode_t mode)
 set the chip mode
uint8_t lm75b_get_mode (lm75b_handle_t *handle, lm75b_mode_t *mode)
 get the chip mode
uint8_t lm75b_init (lm75b_handle_t *handle)
 initialize the chip
uint8_t lm75b_deinit (lm75b_handle_t *handle)
 close the chip
uint8_t lm75b_read (lm75b_handle_t *handle, uint16_t *raw, float *s)
 read data from the chip
uint8_t lm75b_set_reg (lm75b_handle_t *handle, uint8_t reg, uint8_t *buf, uint16_t len)
 set the chip register
uint8_t lm75b_get_reg (lm75b_handle_t *handle, uint8_t reg, uint8_t *buf, uint16_t len)
 get the chip register
uint8_t lm75b_info (lm75b_info_t *info)
 get chip's information

Detailed Description

driver lm75b 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
2.0.0
Author
Shifeng Li
Date
2021-03-10

history

Date Version Author Description
2021/03/10 2.0 Shifeng Li format the code
2020/11/15 1.0 Shifeng Li first upload

Definition in file driver_lm75b.c.

Macro Definition Documentation

◆ CHIP_NAME

#define CHIP_NAME   "NXP LM75B"

chip information definition

chip name

Definition at line 43 of file driver_lm75b.c.

◆ DRIVER_VERSION

#define DRIVER_VERSION   2000

driver version

Definition at line 50 of file driver_lm75b.c.

◆ LM75B_REG_CONF

#define LM75B_REG_CONF   0x01

chip register definition

configure register

Definition at line 55 of file driver_lm75b.c.

◆ LM75B_REG_TEMP

#define LM75B_REG_TEMP   0x00

temperature register

Definition at line 56 of file driver_lm75b.c.

◆ LM75B_REG_THYST

#define LM75B_REG_THYST   0x02

THYST register

Definition at line 58 of file driver_lm75b.c.

◆ LM75B_REG_TOS

#define LM75B_REG_TOS   0x03

TOS register

Definition at line 57 of file driver_lm75b.c.

◆ MANUFACTURER_NAME

#define MANUFACTURER_NAME   "NXP"

manufacturer name

Definition at line 44 of file driver_lm75b.c.

◆ MAX_CURRENT

#define MAX_CURRENT   10.0f

chip max current

Definition at line 47 of file driver_lm75b.c.

◆ SUPPLY_VOLTAGE_MAX

#define SUPPLY_VOLTAGE_MAX   5.5f

chip max supply voltage

Definition at line 46 of file driver_lm75b.c.

◆ SUPPLY_VOLTAGE_MIN

#define SUPPLY_VOLTAGE_MIN   2.8f

chip min supply voltage

Definition at line 45 of file driver_lm75b.c.

◆ TEMPERATURE_MAX

#define TEMPERATURE_MAX   125.0f

chip max operating temperature

Definition at line 49 of file driver_lm75b.c.

◆ TEMPERATURE_MIN

#define TEMPERATURE_MIN   -55.0f

chip min operating temperature

Definition at line 48 of file driver_lm75b.c.