![]() |
no-OS
|
Source file for the LT8722 Driver. More...
#include <errno.h>#include <stdlib.h>#include <string.h>#include "no_os_alloc.h"#include "no_os_crc8.h"#include "no_os_delay.h"#include "no_os_error.h"#include "no_os_print_log.h"#include "lt8722.h"Functions | |
| NO_OS_DECLARE_CRC8_TABLE (lt8722_crc8) | |
| int32_t | lt8722_voltage_to_dac (int64_t voltage) |
| Convert voltage to DAC code. | |
| int64_t | lt8722_dac_to_voltage (int32_t dac) |
| Convert DAC code to nanovolts. | |
| int | lt8722_transaction (struct lt8722_dev *dev, struct lt8722_packet *packet) |
| LT8722 device SPI transaction. | |
| int | lt8722_reg_read (struct lt8722_dev *dev, uint8_t address, uint32_t *data) |
| Read data from LT8722 device. | |
| int | lt8722_reg_write (struct lt8722_dev *dev, uint8_t address, uint32_t data) |
| Write data to LT8722 device. | |
| int | lt8722_reg_write_mask (struct lt8722_dev *dev, uint8_t address, uint32_t mask, uint32_t data) |
| Write to LT8722 device register with mask. | |
| int | lt8722_get_status (struct lt8722_dev *dev, uint16_t *status) |
| Get LT8722 device status. | |
| int | lt8722_clear_faults (struct lt8722_dev *dev) |
| Clear LT8722 device faults. | |
| int | lt8722_set_enable_req (struct lt8722_dev *dev, bool value) |
| Set ENABLE_REQ field in LT8722 device. | |
| int | lt8722_get_enable_req (struct lt8722_dev *dev, bool *value) |
| Get ENABLE_REQ field in LT8722 device. | |
| int | lt8722_set_swen_req (struct lt8722_dev *dev, bool value) |
| Set switching enable of LT8722 device. | |
| int | lt8722_get_swen_req (struct lt8722_dev *dev, bool *value) |
| Get switching enable of LT8722 device. | |
| int | lt8722_set_sw_frq_set (struct lt8722_dev *dev, enum lt8722_sw_frq_set value) |
| Set switching frequency of LT8722 device. | |
| int | lt8722_get_sw_frq_set (struct lt8722_dev *dev, enum lt8722_sw_frq_set *value) |
| Get switching frequency of LT8722 device. | |
| int | lt8722_set_sw_frq_adj (struct lt8722_dev *dev, enum lt8722_sw_frq_adj value) |
| Set switching frequency adjustment of LT8722 device. | |
| int | lt8722_get_sw_frq_adj (struct lt8722_dev *dev, enum lt8722_sw_frq_adj *value) |
| Get switching frequency adjustment of LT8722 device. | |
| int | lt8722_set_vcc_vreg (struct lt8722_dev *dev, enum lt8722_vcc_vreg value) |
| Set internal circuitry voltage source of LT8722 device. | |
| int | lt8722_get_vcc_vreg (struct lt8722_dev *dev, enum lt8722_vcc_vreg *value) |
| Get internal circuitry voltage source of LT8722 device. | |
| int | lt8722_set_sw_vc_int (struct lt8722_dev *dev, enum lt8722_sw_vc_int value) |
| Set initial peak inductor current of LT8722 device. | |
| int | lt8722_get_sw_vc_int (struct lt8722_dev *dev, enum lt8722_sw_vc_int *value) |
| Get initial peak inductor current of LT8722 device. | |
| int | lt8722_set_pwr_lim (struct lt8722_dev *dev, enum lt8722_pwr_lim value) |
| Set LDR power dissipation limit of LT8722 device. | |
| int | lt8722_get_pwr_lim (struct lt8722_dev *dev, enum lt8722_pwr_lim *value) |
| Get LDR power dissipation limit of LT8722 device. | |
| int | lt8722_set_sys_dc (struct lt8722_dev *dev, enum lt8722_sys_dc value) |
| Set PWM duty cycle of LT8722 device. | |
| int | lt8722_get_sys_dc (struct lt8722_dev *dev, enum lt8722_sys_dc *value) |
| Get PWM duty cycle of LT8722 device. | |
| int | lt8722_set_spis_dac_ilimn (struct lt8722_dev *dev, uint16_t value) |
| Set negative output current limit of LT8722 device. | |
| int | lt8722_get_spis_dac_ilimn (struct lt8722_dev *dev, uint16_t *value) |
| Get negative output current limit of LT8722 device. | |
| int | lt8722_set_spis_dac_ilimp (struct lt8722_dev *dev, uint16_t value) |
| Set positive output current limit of LT8722 device. | |
| int | lt8722_get_spis_dac_ilimp (struct lt8722_dev *dev, uint16_t *value) |
| Get positive output current limit of LT8722 device. | |
| int | lt8722_set_dac (struct lt8722_dev *dev, uint32_t value) |
| Set DAC code of LT8722 device. | |
| int | lt8722_get_dac (struct lt8722_dev *dev, uint32_t *value) |
| Get DAC code of LT8722 device. | |
| int | lt8722_set_spis_ov_clamp (struct lt8722_dev *dev, uint8_t value) |
| Set positive output voltage limit of LT8722 device. | |
| int | lt8722_get_spis_ov_clamp (struct lt8722_dev *dev, uint8_t *value) |
| Get positive output voltage limit of LT8722 device. | |
| int | lt8722_set_spis_uv_clamp (struct lt8722_dev *dev, uint8_t value) |
| Set negative output voltage limit of LT8722 device. | |
| int | lt8722_get_spis_uv_clamp (struct lt8722_dev *dev, uint8_t *value) |
| Get negative output voltage limit of LT8722 device. | |
| int | lt8722_set_aout_en (struct lt8722_dev *dev, bool value) |
| Set analog output buffer status of LT8722 device. | |
| int | lt8722_get_aout_en (struct lt8722_dev *dev, bool *value) |
| Get analog output buffer status of LT8722 device. | |
| int | lt8722_set_amux (struct lt8722_dev *dev, enum lt8722_amux value, uint8_t test) |
| Set analot output signal source of LT8722 device. | |
| int | lt8722_get_amux (struct lt8722_dev *dev, enum lt8722_amux *value, uint8_t *test) |
| Get analot output signal source of LT8722 device. | |
| int | lt8722_set_output_voltage (struct lt8722_dev *dev, int64_t value) |
| Set output volatge of LT8722 device. | |
| int | lt8722_get_output_voltage (struct lt8722_dev *dev, int64_t *value) |
| Get output volatge of LT8722 device. | |
| int | lt8722_shutdown (struct lt8722_dev *dev) |
| Reset the LT8722 device. | |
| int | lt8722_reset (struct lt8722_dev *dev) |
| Shutdown the LT8722 device. | |
| int | lt8722_set_swen_pin (struct lt8722_dev *dev, uint8_t value) |
| Set SWEN pin of LT8722 device. | |
| int | lt8722_get_swen_pin (struct lt8722_dev *dev, uint8_t *value) |
| Get SWEN pin of LT8722 device. | |
| int | lt8722_set_en_pin (struct lt8722_dev *dev, uint8_t value) |
| Set EN pin of LT8722 device. | |
| int | lt8722_get_en_pin (struct lt8722_dev *dev, uint8_t *value) |
| Get EN pin of LT8722 device. | |
| int | lt8722_init (struct lt8722_dev **device, struct lt8722_init_param *init_param) |
| Initialize the LT8722 device. | |
| int | lt8722_remove (struct lt8722_dev *dev) |
| Free the resources allocated by the lt8722_init() | |
Variables | |
| struct lt8722_reg | lt8722_regs [LT8722_NUM_REGISTERS] |
Source file for the LT8722 Driver.
Copyright 2024(c) Analog Devices, Inc.
SPDX-License-Identifier: BSD-3-Clause
| int lt8722_clear_faults | ( | struct lt8722_dev * | dev | ) |
Clear LT8722 device faults.
| dev | - LT8722 device descriptor |
| int64_t lt8722_dac_to_voltage | ( | int32_t | dac | ) |
Convert DAC code to nanovolts.
| dac | - DAC code. |
| int lt8722_get_amux | ( | struct lt8722_dev * | dev, |
| enum lt8722_amux * | value, | ||
| uint8_t * | test ) |
Get analot output signal source of LT8722 device.
| dev | - LT8722 device descriptor |
| value | - Analog output signal source value. |
| test | - AMUX_TEST value. |
| int lt8722_get_aout_en | ( | struct lt8722_dev * | dev, |
| bool * | value ) |
Get analog output buffer status of LT8722 device.
| dev | - LT8722 device descriptor |
| value | - Analog output buffer status value |
| int lt8722_get_dac | ( | struct lt8722_dev * | dev, |
| uint32_t * | value ) |
Get DAC code of LT8722 device.
| dev | - LT8722 device descriptor |
| value | - DAC value |
| int lt8722_get_en_pin | ( | struct lt8722_dev * | dev, |
| uint8_t * | value ) |
Get EN pin of LT8722 device.
| dev | - LT8722 device descriptor |
| value | - EN pin value. |
| int lt8722_get_enable_req | ( | struct lt8722_dev * | dev, |
| bool * | value ) |
Get ENABLE_REQ field in LT8722 device.
| dev | - LT8722 device descriptor |
| value | - Enable if true, disabled otherwise |
| int lt8722_get_output_voltage | ( | struct lt8722_dev * | dev, |
| int64_t * | value ) |
Get output volatge of LT8722 device.
| dev | - LT8722 device descriptor |
| value | - Output voltage value in nanovolts. |
| int lt8722_get_pwr_lim | ( | struct lt8722_dev * | dev, |
| enum lt8722_pwr_lim * | value ) |
Get LDR power dissipation limit of LT8722 device.
| dev | - LT8722 device descriptor |
| value | - LDR power dissipation limit value |
| int lt8722_get_spis_dac_ilimn | ( | struct lt8722_dev * | dev, |
| uint16_t * | value ) |
Get negative output current limit of LT8722 device.
| dev | - LT8722 device descriptor |
| value | - Negative output current limit value |
| int lt8722_get_spis_dac_ilimp | ( | struct lt8722_dev * | dev, |
| uint16_t * | value ) |
Get positive output current limit of LT8722 device.
| dev | - LT8722 device descriptor |
| value | - Positive output current limit value |
| int lt8722_get_spis_ov_clamp | ( | struct lt8722_dev * | dev, |
| uint8_t * | value ) |
Get positive output voltage limit of LT8722 device.
| dev | - LT8722 device descriptor |
| value | - Positive output voltage limit value |
| int lt8722_get_spis_uv_clamp | ( | struct lt8722_dev * | dev, |
| uint8_t * | value ) |
Get negative output voltage limit of LT8722 device.
| dev | - LT8722 device descriptor |
| value | - Negative output voltage limit value |
| int lt8722_get_status | ( | struct lt8722_dev * | dev, |
| uint16_t * | status ) |
Get LT8722 device status.
| dev | - LT8722 device descriptor |
| status | - Status value to be returned. |
| int lt8722_get_sw_frq_adj | ( | struct lt8722_dev * | dev, |
| enum lt8722_sw_frq_adj * | value ) |
Get switching frequency adjustment of LT8722 device.
| dev | - LT8722 device descriptor |
| value | - Switching frequency value |
| int lt8722_get_sw_frq_set | ( | struct lt8722_dev * | dev, |
| enum lt8722_sw_frq_set * | value ) |
Get switching frequency of LT8722 device.
| dev | - LT8722 device descriptor |
| value | - Switching frequency value |
| int lt8722_get_sw_vc_int | ( | struct lt8722_dev * | dev, |
| enum lt8722_sw_vc_int * | value ) |
Get initial peak inductor current of LT8722 device.
| dev | - LT8722 device descriptor |
| value | - Peak inductor current value |
| int lt8722_get_swen_pin | ( | struct lt8722_dev * | dev, |
| uint8_t * | value ) |
Get SWEN pin of LT8722 device.
| dev | - LT8722 device descriptor |
| value | - SWEN pin value. |
| int lt8722_get_swen_req | ( | struct lt8722_dev * | dev, |
| bool * | value ) |
Get switching enable of LT8722 device.
| dev | - LT8722 device descriptor |
| value | - Enable if true, disabled otherwise |
| int lt8722_get_sys_dc | ( | struct lt8722_dev * | dev, |
| enum lt8722_sys_dc * | value ) |
Get PWM duty cycle of LT8722 device.
| dev | - LT8722 device descriptor |
| value | - PWM duty cycle value |
| int lt8722_get_vcc_vreg | ( | struct lt8722_dev * | dev, |
| enum lt8722_vcc_vreg * | value ) |
Get internal circuitry voltage source of LT8722 device.
| dev | - LT8722 device descriptor |
| value | - VCC voltage regulator output |
| int lt8722_init | ( | struct lt8722_dev ** | device, |
| struct lt8722_init_param * | init_param ) |
Initialize the LT8722 device.
| device | - LT8722 device descriptor |
| init_param | - Initialization parameter containing information about the LT8722 device to be initialized. |
| int lt8722_reg_read | ( | struct lt8722_dev * | dev, |
| uint8_t | address, | ||
| uint32_t * | data ) |
Read data from LT8722 device.
| dev | - LT8722 device descriptor |
| address | - Register address. |
| data | - Received data. |
| int lt8722_reg_write | ( | struct lt8722_dev * | dev, |
| uint8_t | address, | ||
| uint32_t | data ) |
Write data to LT8722 device.
| dev | - LT8722 device descriptor |
| address | - Register address. |
| data | - Data to be written. |
| int lt8722_reg_write_mask | ( | struct lt8722_dev * | dev, |
| uint8_t | address, | ||
| uint32_t | mask, | ||
| uint32_t | data ) |
Write to LT8722 device register with mask.
| dev | - LT8722 device descriptor |
| address | - Register address. |
| mask | - Mask to be applied. |
| data | - Data to be written. |
| int lt8722_remove | ( | struct lt8722_dev * | dev | ) |
Free the resources allocated by the lt8722_init()
| dev | - LT8722 device descriptor |
| int lt8722_reset | ( | struct lt8722_dev * | dev | ) |
Shutdown the LT8722 device.
| dev | - LT8722 device descriptor |
| int lt8722_set_amux | ( | struct lt8722_dev * | dev, |
| enum lt8722_amux | value, | ||
| uint8_t | test ) |
Set analot output signal source of LT8722 device.
| dev | - LT8722 device descriptor |
| value | - Analog output signal source value |
| test | - AMUX_TEST value |
| int lt8722_set_aout_en | ( | struct lt8722_dev * | dev, |
| bool | value ) |
Set analog output buffer status of LT8722 device.
| dev | - LT8722 device descriptor |
| value | - Analog output buffer status value |
| int lt8722_set_dac | ( | struct lt8722_dev * | dev, |
| uint32_t | value ) |
Set DAC code of LT8722 device.
| dev | - LT8722 device descriptor |
| value | - DAC value |
| int lt8722_set_en_pin | ( | struct lt8722_dev * | dev, |
| uint8_t | value ) |
Set EN pin of LT8722 device.
| dev | - LT8722 device descriptor |
| value | - EN pin value. |
| int lt8722_set_enable_req | ( | struct lt8722_dev * | dev, |
| bool | value ) |
Set ENABLE_REQ field in LT8722 device.
| dev | - LT8722 device descriptor |
| value | - Enable if true, disabled otherwise |
| int lt8722_set_output_voltage | ( | struct lt8722_dev * | dev, |
| int64_t | value ) |
Set output volatge of LT8722 device.
| dev | - LT8722 device descriptor |
| value | - Output voltage value in nanovolts. |
| int lt8722_set_pwr_lim | ( | struct lt8722_dev * | dev, |
| enum lt8722_pwr_lim | value ) |
Set LDR power dissipation limit of LT8722 device.
| dev | - LT8722 device descriptor |
| value | - LDR power dissipation limit value |
| int lt8722_set_spis_dac_ilimn | ( | struct lt8722_dev * | dev, |
| uint16_t | value ) |
Set negative output current limit of LT8722 device.
| dev | - LT8722 device descriptor |
| value | - Negative output current limit value |
| int lt8722_set_spis_dac_ilimp | ( | struct lt8722_dev * | dev, |
| uint16_t | value ) |
Set positive output current limit of LT8722 device.
| dev | - LT8722 device descriptor |
| value | - Positive output current limit value |
| int lt8722_set_spis_ov_clamp | ( | struct lt8722_dev * | dev, |
| uint8_t | value ) |
Set positive output voltage limit of LT8722 device.
| dev | - LT8722 device descriptor |
| value | - Positive output voltage limit value |
| int lt8722_set_spis_uv_clamp | ( | struct lt8722_dev * | dev, |
| uint8_t | value ) |
Set negative output voltage limit of LT8722 device.
| dev | - LT8722 device descriptor |
| value | - Negative output voltage limit value |
| int lt8722_set_sw_frq_adj | ( | struct lt8722_dev * | dev, |
| enum lt8722_sw_frq_adj | value ) |
Set switching frequency adjustment of LT8722 device.
| dev | - LT8722 device descriptor |
| value | - Switching frequency adjustment value |
| int lt8722_set_sw_frq_set | ( | struct lt8722_dev * | dev, |
| enum lt8722_sw_frq_set | value ) |
Set switching frequency of LT8722 device.
| dev | - LT8722 device descriptor |
| value | - Switching frequency value |
| int lt8722_set_sw_vc_int | ( | struct lt8722_dev * | dev, |
| enum lt8722_sw_vc_int | value ) |
Set initial peak inductor current of LT8722 device.
| dev | - LT8722 device descriptor |
| value | - Peak inductor current value |
| int lt8722_set_swen_pin | ( | struct lt8722_dev * | dev, |
| uint8_t | value ) |
Set SWEN pin of LT8722 device.
| dev | - LT8722 device descriptor |
| value | - SWEN pin value. |
| int lt8722_set_swen_req | ( | struct lt8722_dev * | dev, |
| bool | value ) |
Set switching enable of LT8722 device.
| dev | - LT8722 device descriptor |
| value | - Enable if true, disabled otherwise |
| int lt8722_set_sys_dc | ( | struct lt8722_dev * | dev, |
| enum lt8722_sys_dc | value ) |
Set PWM duty cycle of LT8722 device.
| dev | - LT8722 device descriptor |
| value | - PWM duty cycle value |
| int lt8722_set_vcc_vreg | ( | struct lt8722_dev * | dev, |
| enum lt8722_vcc_vreg | value ) |
Set internal circuitry voltage source of LT8722 device.
| dev | - LT8722 device descriptor |
| value | - VCC voltage regulator output |
| int lt8722_shutdown | ( | struct lt8722_dev * | dev | ) |
Reset the LT8722 device.
| dev | - LT8722 device descriptor |
| int lt8722_transaction | ( | struct lt8722_dev * | dev, |
| struct lt8722_packet * | packet ) |
LT8722 device SPI transaction.
| dev | - LT8722 device descriptor |
| packet | - LT8722 packet. |
| int32_t lt8722_voltage_to_dac | ( | int64_t | voltage | ) |
Convert voltage to DAC code.
| voltage | - Voltage value in nanovolts. |
| NO_OS_DECLARE_CRC8_TABLE | ( | lt8722_crc8 | ) |
| struct lt8722_reg lt8722_regs[LT8722_NUM_REGISTERS] |