56 uint16_t hysteresis_check;
57 uint16_t threshold_check;
477 hysteresis = (rand() / 65535) & 0xFF80U;
499 threshold = (rand() / 65535) & 0xFF80U;
521 c = (float)(rand() % 3000) / 30.0f;
543 lm75b_interface_debug_print(
"lm75b: lm75b_over_temperature_threshold_convert_to_register/lm75b_over_temperature_threshold_convert_to_data test.\n");
544 c = -(float)(rand() % 3000) / 30.0f;
driver lm75b register test header file
struct lm75b_handle_s lm75b_handle_t
lm75b handle structure definition
lm75b_mode_t
lm75b os polarity enumeration definition
uint8_t lm75b_set_mode(lm75b_handle_t *handle, lm75b_mode_t mode)
set the chip mode
lm75b_fault_queue_t
lm75b fault queue enumeration definition
lm75b_address_t
lm75b address enumeration definition
uint8_t lm75b_get_mode(lm75b_handle_t *handle, lm75b_mode_t *mode)
get the chip mode
struct lm75b_info_s lm75b_info_t
lm75b information structure definition
lm75b_os_polarity_t
lm75b os polarity enumeration definition
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
lm75b_os_operation_mode_t
lm75b os operation enumeration definition
@ LM75B_OS_OPERATION_INTERRUPT
@ LM75B_OS_OPERATION_COMPARATOR
uint8_t lm75b_interface_iic_write(uint8_t addr, uint8_t reg, uint8_t *buf, uint16_t len)
interface iic bus write
uint8_t lm75b_interface_iic_init(void)
interface iic bus init
void lm75b_interface_debug_print(const char *const fmt,...)
interface print format data
uint8_t lm75b_interface_iic_deinit(void)
interface iic bus deinit
uint8_t lm75b_interface_iic_read(uint8_t addr, uint8_t reg, uint8_t *buf, uint16_t len)
interface iic bus read
void lm75b_interface_delay_ms(uint32_t ms)
interface delay ms
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_get_fault_queue(lm75b_handle_t *handle, lm75b_fault_queue_t *fault_queue)
get the chip fault queue
uint8_t lm75b_get_over_temperature_threshold(lm75b_handle_t *handle, uint16_t *threshold)
get the over temperature threshold
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_get_os_polarity(lm75b_handle_t *handle, lm75b_os_polarity_t *polarity)
get the chip os polarity
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_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_get_interrupt_mode(lm75b_handle_t *handle, lm75b_os_operation_mode_t *mode)
get the chip interrupt mode
uint8_t lm75b_set_os_polarity(lm75b_handle_t *handle, lm75b_os_polarity_t polarity)
set 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_set_fault_queue(lm75b_handle_t *handle, lm75b_fault_queue_t fault_queue)
set the chip fault queue
uint8_t lm75b_set_over_temperature_threshold(lm75b_handle_t *handle, uint16_t threshold)
set the over temperature threshold
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
#define DRIVER_LM75B_LINK_IIC_DEINIT(HANDLE, FUC)
link iic_deinit function
#define DRIVER_LM75B_LINK_IIC_INIT(HANDLE, FUC)
link iic_init function
#define DRIVER_LM75B_LINK_INIT(HANDLE, STRUCTURE)
initialize lm75b_handle_t structure
#define DRIVER_LM75B_LINK_DELAY_MS(HANDLE, FUC)
link delay_ms function
#define DRIVER_LM75B_LINK_DEBUG_PRINT(HANDLE, FUC)
link debug_print function
#define DRIVER_LM75B_LINK_IIC_WRITE(HANDLE, FUC)
link iic_write function
#define DRIVER_LM75B_LINK_IIC_READ(HANDLE, FUC)
link iic_read function
uint8_t lm75b_register_test(lm75b_address_t addr)
register test
float supply_voltage_max_v
char manufacturer_name[32]
float supply_voltage_min_v