![]() |
no-OS
|
Implementation of ADT7420 Driver. More...
#include <stdint.h>#include <stdlib.h>#include "no_os_error.h"#include "no_os_alloc.h"#include "no_os_delay.h"#include "adt7420.h"Functions | |
| int | adt7420_reg_read (struct adt7420_dev *dev, uint16_t register_address, uint16_t *data) |
| Reads the value of a register. | |
| int | adt7420_reg_update_bits (struct adt7420_dev *dev, uint16_t register_address, uint8_t mask, uint8_t value) |
| Sets the value of a register SPI/I2C. | |
| int | adt7420_spi_reg_write (struct adt7420_dev *dev, uint16_t register_address, uint32_t data) |
| Write a value of a register via SPI. | |
| int | adt7420_i2c_reg_write (struct adt7420_dev *dev, uint16_t register_address, uint32_t data) |
| Write a value of a register via I2C. | |
| int | adt7420_reg_write (struct adt7420_dev *dev, uint16_t register_address, uint32_t data) |
| Sets the value of a register SPI/I2C. | |
| int32_t | adt7420_init (struct adt7420_dev **device, struct adt7420_init_param init_param) |
| Initializes the communication peripheral and checks if the device is present. | |
| int32_t | adt7420_remove (struct adt7420_dev *dev) |
| Free the resources allocated by adt7420_init(). | |
| int | adt7420_set_operation_mode (struct adt7420_dev *dev, uint8_t mode) |
| Sets the operational mode for ADT7420/ADT7320. | |
| int | adt7420_set_resolution (struct adt7420_dev *dev, uint8_t resolution) |
| Sets the resolution for ADT7420/ADT7320. | |
| int32_t | adt7420_reset (struct adt7420_dev *dev) |
| Resets the SPI or I2C inteface for the ADT7420/ADT7320. | |
| float | adt7420_get_temperature (struct adt7420_dev *dev) |
| Reads the temperature data and converts it to Celsius degrees. | |
| int | adt7420_spi_reg_read (struct adt7420_dev *dev, uint16_t register_address, uint16_t *data) |
| Reads the value of a register SPI interface device. | |
| int | adt7420_i2c_reg_read (struct adt7420_dev *dev, uint16_t register_address, uint16_t *data) |
| Reads the value of a register I2C interface device. | |
| bool | adt7420_is_spi (struct adt7420_dev *dev) |
| Check if the interface of the selected device is SPI. | |
Variables | |
| const struct adt7420_chip_info | chip_info [] |
Implementation of ADT7420 Driver.
Copyright 2012, 2019, 2021(c) Analog Devices, Inc.
SPDX-License-Identifier: BSD-3-Clause
| float adt7420_get_temperature | ( | struct adt7420_dev * | dev | ) |
Reads the temperature data and converts it to Celsius degrees.
| dev | - The device structure. |
Negative temperature
Positive temperature
Negative temperature
Positive temperature
| int adt7420_i2c_reg_read | ( | struct adt7420_dev * | dev, |
| uint16_t | register_address, | ||
| uint16_t * | data ) |
Reads the value of a register I2C interface device.
| dev | - The device structure. |
| register_address | - Address of the register. |
| data | - Pointer to the register value |
| int adt7420_i2c_reg_write | ( | struct adt7420_dev * | dev, |
| uint16_t | register_address, | ||
| uint32_t | data ) |
Write a value of a register via I2C.
| dev | - The device structure. |
| register_address | - Address of the register. |
| data | - Pointer to the register value |
| int32_t adt7420_init | ( | struct adt7420_dev ** | device, |
| struct adt7420_init_param | init_param ) |
Initializes the communication peripheral and checks if the device is present.
| device | - The device structure. |
| init_param | - The structure that contains the device initial parameters. |
| bool adt7420_is_spi | ( | struct adt7420_dev * | dev | ) |
Check if the interface of the selected device is SPI.
| dev | - The device structure. |
| int adt7420_reg_read | ( | struct adt7420_dev * | dev, |
| uint16_t | register_address, | ||
| uint16_t * | data ) |
Reads the value of a register.
| dev | - The device structure. |
| register_address | - Address of the register. |
| data | - Pointer to the register value |
| int adt7420_reg_update_bits | ( | struct adt7420_dev * | dev, |
| uint16_t | register_address, | ||
| uint8_t | mask, | ||
| uint8_t | value ) |
Sets the value of a register SPI/I2C.
| dev | - The device structure. |
| register_address | - Address of the register. |
| mask | - Bit Mask of the bit to be written |
| value | - Value of the bit |
| int adt7420_reg_write | ( | struct adt7420_dev * | dev, |
| uint16_t | register_address, | ||
| uint32_t | data ) |
Sets the value of a register SPI/I2C.
| dev | - The device structure. |
| register_address | - Address of the register. |
| data | - Data to be written in input register. |
| int32_t adt7420_remove | ( | struct adt7420_dev * | dev | ) |
Free the resources allocated by adt7420_init().
| dev | - The device structure. |
| int32_t adt7420_reset | ( | struct adt7420_dev * | dev | ) |
Resets the SPI or I2C inteface for the ADT7420/ADT7320.
| dev | - The device structure. |
| int adt7420_set_operation_mode | ( | struct adt7420_dev * | dev, |
| uint8_t | mode ) |
Sets the operational mode for ADT7420/ADT7320.
| dev | - The device structure. |
| mode | - Operation mode. Example: ADT7420_OP_MODE_CONT_CONV - continuous conversion; ADT7420_OP_MODE_ONE_SHOT - one shot; ADT7420_OP_MODE_1_SPS - 1 SPS mode; ADT7420_OP_MODE_SHUTDOWN - shutdown. |
| int adt7420_set_resolution | ( | struct adt7420_dev * | dev, |
| uint8_t | resolution ) |
Sets the resolution for ADT7420/ADT7320.
| dev | - The device structure. |
| resolution | - Resolution. Example: 0 - 13-bit resolution; 1 - 16-bit resolution. |
| int adt7420_spi_reg_read | ( | struct adt7420_dev * | dev, |
| uint16_t | register_address, | ||
| uint16_t * | data ) |
Reads the value of a register SPI interface device.
| dev | - The device structure. |
| register_address | - Address of the register. |
| data | - Pointer to the register value |
| int adt7420_spi_reg_write | ( | struct adt7420_dev * | dev, |
| uint16_t | register_address, | ||
| uint32_t | data ) |
Write a value of a register via SPI.
| dev | - The device structure. |
| register_address | - Address of the register. |
| data | - Pointer to the register value |
| const struct adt7420_chip_info chip_info[] |