precision-converters-firmware
Functions
adt7xxx_support.c File Reference

Support Source File for adt7xxx. More...

#include <stdint.h>
#include "adt7420.h"
#include "no_os_error.h"
#include "adt7xxx_support.h"
Include dependency graph for adt7xxx_support.c:

Functions

int32_t adt7420_get_register_address_and_value (struct adt7420_dev *dev, uint16_t register_address, uint16_t *reg_val)
 Reads the value of a register SPI/I2C. More...
 
uint16_t configure_write_type_registers (struct adt7420_dev *dev, uint16_t register_address)
 Configure write typev register based on communication interface. More...
 
int32_t adt7420_wr_setpoint_reg (struct adt7420_dev *dev, uint16_t register_value, uint16_t data)
 Write to a setpoint register. More...
 
int32_t adt7420_set_fault_queue (struct adt7420_dev *dev, uint8_t mode)
 Sets the Fault Queue option for ADT7420/ADT7320. More...
 
int32_t adt7420_set_ct_int_mode (struct adt7420_dev *dev, uint8_t setting)
 Sets comparator/interrupt (CT/INT) mode for ADT7420/ADT7320. More...
 
int32_t adt7420_set_ct_int_polarity (struct adt7420_dev *dev, uint8_t polarity)
 Sets output polarity for the pins CT/INT (Critical Temp - Over/Under Temp). More...
 

Detailed Description

Support Source File for adt7xxx.

Copyright (c) 2021-2022 Analog Devices, Inc. All rights reserved.

This software is proprietary to Analog Devices, Inc. and its licensors. By using this software you agree to the terms of the associated Analog Devices Software License Agreement.

Function Documentation

◆ adt7420_get_register_address_and_value()

int32_t adt7420_get_register_address_and_value ( struct adt7420_dev *  dev,
uint16_t  register_address,
uint16_t *  reg_val 
)

Reads the value of a register SPI/I2C.

Parameters
dev- The device structure.
register_address- Address of the register.
reg_val- Value of the concerned register
Returns
0 in case of success, negative error code otherwise

◆ adt7420_set_ct_int_mode()

int32_t adt7420_set_ct_int_mode ( struct adt7420_dev *  dev,
uint8_t  setting 
)

Sets comparator/interrupt (CT/INT) mode for ADT7420/ADT7320.

Parameters
dev- The device structure.
setting- Mode selection. Example: 0 - Interrupt (default). 1 - Comparator.
Returns
0 in case of success, negative error code otherwise.

◆ adt7420_set_ct_int_polarity()

int32_t adt7420_set_ct_int_polarity ( struct adt7420_dev *  dev,
uint8_t  polarity 
)

Sets output polarity for the pins CT/INT (Critical Temp - Over/Under Temp).

Parameters
dev- The device structure.
polarity- Polarity selection. Example: 0 - Active Low (default). 1 - Active High.
Returns
0 in case of success, negative error code otherwise.

◆ adt7420_set_fault_queue()

int32_t adt7420_set_fault_queue ( struct adt7420_dev *  dev,
uint8_t  mode 
)

Sets the Fault Queue option for ADT7420/ADT7320.

Parameters
dev- The device structure.
mode- Fault Queue selection. Example: 1 - 1 fault (default). 2 - 2 faults. 3 - 3 faults. 4 - 4 faults.
Returns
0 in case of success, negative error code otherwise.

◆ adt7420_wr_setpoint_reg()

int32_t adt7420_wr_setpoint_reg ( struct adt7420_dev *  dev,
uint16_t  register_value,
uint16_t  data 
)

Write to a setpoint register.

Parameters
dev- The device structure.
register_value- Command control bits.
data- Data to be written in input register.
Returns
0 in case of success, negative error code otherwise

◆ configure_write_type_registers()

uint16_t configure_write_type_registers ( struct adt7420_dev *  dev,
uint16_t  register_address 
)

Configure write typev register based on communication interface.

Parameters
dev- The device structure.
register_address- Register type.
Returns
register_address - Register Address.
Here is the caller graph for this function: