![]() |
no-OS
|
Implementation of ADHV4710 Driver. More...
#include "adhv4710.h"#include <stdbool.h>#include <stdint.h>#include <string.h>#include "no_os_util.h"#include "no_os_spi.h"#include "no_os_gpio.h"#include "no_os_irq.h"#include "no_os_delay.h"#include "no_os_units.h"#include "no_os_alloc.h"#include "no_os_crc16.h"#include "no_os_print_log.h"#include <stdlib.h>#include <errno.h>#include <math.h>Functions | |
| int | adhv4710_init (struct adhv4710_dev **device, struct adhv4710_init_param init_param) |
| Initialize the device. | |
| int | adhv4710_read (struct adhv4710_dev *dev, uint8_t reg_addr, int8_t *reg_data) |
| Read device register. | |
| int | adhv4710_write (struct adhv4710_dev *dev, uint8_t reg_addr, uint8_t reg_data) |
| Write device register. | |
| int | adhv4710_update_bits (struct adhv4710_dev *dev, uint8_t reg_addr, uint8_t mask, uint8_t reg_data) |
| Update specific register bits. | |
| int | adhv4710_get_status (struct adhv4710_dev *dev, uint8_t reg_addr, uint8_t msk, uint8_t *status) |
| Get indicator of settings. | |
| int | adhv4710_remove (struct adhv4710_dev *dev) |
| Remove the device and release resources. | |
| int | adhv4710_sw_reset (struct adhv4710_dev *dev) |
| Reset the device using SW reset. | |
| int | adhv4710_hw_reset (struct adhv4710_dev *dev) |
| Reset the device using HW reset. | |
| int | adhv4710_clear_shutdown_latch (struct adhv4710_dev *dev) |
| Clear shutdown latch and re-enable amplifier from shutdown. | |
| int | adhv4710_shutdown_amplifier (struct adhv4710_dev *dev) |
| Shutdown the amplifier. | |
| int | adhv4710_set_quiescent_current (struct adhv4710_dev *dev, uint8_t value, uint8_t direction) |
| Program quiescent current of amplifier. | |
| int | adhv4710_enable_source_overcurrent_protection (struct adhv4710_dev *dev) |
| Enable source overcurrent protection. | |
| int | adhv4710_set_source_overcurrent_level (struct adhv4710_dev *dev, uint8_t level) |
| Set level of overcurrent source protection. | |
| int | adhv4710_enable_sink_overcurrent_protection (struct adhv4710_dev *dev) |
| Enable sink overcurrent protection. | |
| int | adhv4710_set_sink_overcurrent_level (struct adhv4710_dev *dev, uint8_t level) |
| Set level of overcurrent sink protection. | |
| int | adhv4710_enable_overvoltage_pos_protection (struct adhv4710_dev *dev) |
| Enable overvoltage positive protection. | |
| int | adhv4710_set_overvoltage_pos_level (struct adhv4710_dev *dev, uint8_t level) |
| Set level of overvoltage positive protection. | |
| int | adhv4710_enable_overvoltage_neg_protection (struct adhv4710_dev *dev) |
| Enable overvoltage negative protection. | |
| int | adhv4710_set_overvoltage_neg_level (struct adhv4710_dev *dev, uint8_t level) |
| Set level of overvoltage negative protection. | |
| int | adhv4710_enable_overtemperature_protection (struct adhv4710_dev *dev) |
| Enable overtemperature protection. | |
| int | adhv4710_set_overtemperature_level (struct adhv4710_dev *dev, uint8_t level) |
| Set level of overtemperature protection. | |
| int | adhv4710_version_product (struct adhv4710_dev *dev, uint8_t *data_read) |
| Version product. | |
Implementation of ADHV4710 Driver.
Copyright 2025(c) Analog Devices, Inc.
SPDX-License-Identifier: BSD-3-Clause
| int adhv4710_clear_shutdown_latch | ( | struct adhv4710_dev * | dev | ) |
Clear shutdown latch and re-enable amplifier from shutdown.
| dev | - The device structure. |
| int adhv4710_enable_overtemperature_protection | ( | struct adhv4710_dev * | dev | ) |
Enable overtemperature protection.
| dev | - The device structure. |
| int adhv4710_enable_overvoltage_neg_protection | ( | struct adhv4710_dev * | dev | ) |
Enable overvoltage negative protection.
| dev | - The device structure. |
| int adhv4710_enable_overvoltage_pos_protection | ( | struct adhv4710_dev * | dev | ) |
Enable overvoltage positive protection.
| dev | - The device structure. |
| int adhv4710_enable_sink_overcurrent_protection | ( | struct adhv4710_dev * | dev | ) |
Enable sink overcurrent protection.
| dev | - The device structure. |
| int adhv4710_enable_source_overcurrent_protection | ( | struct adhv4710_dev * | dev | ) |
Enable source overcurrent protection.
| dev | - The device structure. |
| int adhv4710_get_status | ( | struct adhv4710_dev * | dev, |
| uint8_t | reg_addr, | ||
| uint8_t | msk, | ||
| uint8_t * | status ) |
Get indicator of settings.
| dev | - The device structure. |
| reg_addr | - The register address. |
| msk | - Bit that needs to be tested. |
| status | - Status indicator. |
| int adhv4710_hw_reset | ( | struct adhv4710_dev * | dev | ) |
Reset the device using HW reset.
| dev | - The device structure. |
| int adhv4710_init | ( | struct adhv4710_dev ** | device, |
| struct adhv4710_init_param | init_param ) |
Initialize the device.
| device | - The device structure. |
| init_param | - The structure that contains the device initial parameters. |
| int adhv4710_read | ( | struct adhv4710_dev * | dev, |
| uint8_t | reg_addr, | ||
| int8_t * | reg_data ) |
Read device register.
| dev | - The device structure. |
| reg_addr | - The register address. |
| reg_data | - The data read from 32bit register. |
| int adhv4710_remove | ( | struct adhv4710_dev * | dev | ) |
Remove the device and release resources.
| dev | - The device structure. |
| int adhv4710_set_overtemperature_level | ( | struct adhv4710_dev * | dev, |
| uint8_t | level ) |
Set level of overtemperature protection.
| dev | - The device structure. |
| level | - The level of overtemperature protection (level = round( (threshold[℃] + 266.64[℃]) / 6.51[℃/LSB]) ). |
| int adhv4710_set_overvoltage_neg_level | ( | struct adhv4710_dev * | dev, |
| uint8_t | level ) |
Set level of overvoltage negative protection.
| dev | - The device structure. |
| level | - The level of overvoltage negative protection (level = round(threshold[V] / 1.953[V/LSB])). |
| int adhv4710_set_overvoltage_pos_level | ( | struct adhv4710_dev * | dev, |
| uint8_t | level ) |
Set level of overvoltage positive protection.
| dev | - The device structure. |
| level | - The level of overvoltage positive protection (level = round(threshold[V] / 1.953[V/LSB])). |
| int adhv4710_set_quiescent_current | ( | struct adhv4710_dev * | dev, |
| uint8_t | value, | ||
| uint8_t | direction ) |
Program quiescent current of amplifier.
| dev | - The device structure. |
| value | - The quiescent current value to be set (0x0 for nominal supply current). |
| direction | - The direction of the quiescent current (0 for reduction, 1 for increase). |
| int adhv4710_set_sink_overcurrent_level | ( | struct adhv4710_dev * | dev, |
| uint8_t | level ) |
Set level of overcurrent sink protection.
| dev | - The device structure. |
| level | - The level of overcurrent source protection (level = round(threshold[mA] / 15.625[mA/LSB])). |
| int adhv4710_set_source_overcurrent_level | ( | struct adhv4710_dev * | dev, |
| uint8_t | level ) |
Set level of overcurrent source protection.
| dev | - The device structure. |
| level | - The level of overcurrent source protection (level = round(threshold[mA] / 15.625[mA/LSB])). |
| int adhv4710_shutdown_amplifier | ( | struct adhv4710_dev * | dev | ) |
Shutdown the amplifier.
| dev | - The device structure. |
| int adhv4710_sw_reset | ( | struct adhv4710_dev * | dev | ) |
Reset the device using SW reset.
| dev | - The device structure. |
| int adhv4710_update_bits | ( | struct adhv4710_dev * | dev, |
| uint8_t | reg_addr, | ||
| uint8_t | mask, | ||
| uint8_t | reg_data ) |
Update specific register bits.
| dev | - The device structure. |
| reg_addr | - The register address. |
| mask | - Specific bits mask. |
| reg_data | - The data to be written. |
| int adhv4710_version_product | ( | struct adhv4710_dev * | dev, |
| uint8_t * | data_read ) |
Version product.
| dev | - The device structure. |
| data_read | - The version product read value |
| int adhv4710_write | ( | struct adhv4710_dev * | dev, |
| uint8_t | reg_addr, | ||
| uint8_t | reg_data ) |
Write device register.
| dev- | The device structure. |
| reg_addr | - The register address. |
| reg_data | - The data to be written. |