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

driver lm75b header file More...

#include <stdio.h>
#include <stdint.h>
#include <string.h>
Include dependency graph for driver_lm75b.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  lm75b_handle_s
 lm75b handle structure definition More...
struct  lm75b_info_s
 lm75b information structure definition More...

Macros

#define DRIVER_LM75B_LINK_INIT(HANDLE, STRUCTURE)
 initialize lm75b_handle_t structure
#define DRIVER_LM75B_LINK_IIC_INIT(HANDLE, FUC)
 link iic_init function
#define DRIVER_LM75B_LINK_IIC_DEINIT(HANDLE, FUC)
 link iic_deinit function
#define DRIVER_LM75B_LINK_IIC_READ(HANDLE, FUC)
 link iic_read function
#define DRIVER_LM75B_LINK_IIC_WRITE(HANDLE, FUC)
 link iic_write function
#define DRIVER_LM75B_LINK_DELAY_MS(HANDLE, FUC)
 link delay_ms function
#define DRIVER_LM75B_LINK_DEBUG_PRINT(HANDLE, FUC)
 link debug_print function

Typedefs

typedef struct lm75b_handle_s lm75b_handle_t
 lm75b handle structure definition
typedef struct lm75b_info_s lm75b_info_t
 lm75b information structure definition

Enumerations

enum  lm75b_address_t {
  LM75B_ADDRESS_A000 = 0 , LM75B_ADDRESS_A001 = 1 , LM75B_ADDRESS_A010 = 2 , LM75B_ADDRESS_A011 = 3 ,
  LM75B_ADDRESS_A100 = 4 , LM75B_ADDRESS_A101 = 5 , LM75B_ADDRESS_A110 = 6 , LM75B_ADDRESS_A111 = 7
}
 lm75b address enumeration definition More...
enum  lm75b_fault_queue_t { LM75B_FAULT_QUEUE_1 = 0 , LM75B_FAULT_QUEUE_2 = 1 , LM75B_FAULT_QUEUE_3 = 2 , LM75B_FAULT_QUEUE_6 = 3 }
 lm75b fault queue enumeration definition More...
enum  lm75b_os_polarity_t { LM75B_OS_POLARITY_LOW = 0 , LM75B_OS_POLARITY_HIGH = 1 }
 lm75b os polarity enumeration definition More...
enum  lm75b_mode_t { LM75B_MODE_NORMAL = 0 , LM75B_MODE_SHUTDOWN = 1 }
 lm75b os polarity enumeration definition More...
enum  lm75b_os_operation_mode_t { LM75B_OS_OPERATION_COMPARATOR = 0 , LM75B_OS_OPERATION_INTERRUPT = 1 }
 lm75b os operation enumeration definition More...

Functions

uint8_t lm75b_info (lm75b_info_t *info)
 get chip's information
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_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_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_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_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_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_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

Detailed Description

driver lm75b header 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.h.