no-OS
Loading...
Searching...
No Matches
ltc7841.c File Reference

Source file for the LTC7841 Driver. More...

#include "ltc7841.h"
Include dependency graph for ltc7841.c:

Functions

int ltc7841_remove (struct ltc7841_desc *desc)
 Free the device descriptor.
 
int ltc7841_init (struct ltc7841_desc **device, struct ltc7841_init_param *init_param)
 Initialize the device structure.
 
int ltc7841_reg_read (struct ltc7841_desc *desc, uint8_t cmd, uint8_t *data)
 Read a raw value from a register.
 
int ltc7841_reg_write (struct ltc7841_desc *desc, uint8_t cmd, uint16_t value)
 Write a raw value to a register.
 
int ltc7841_reset (struct ltc7841_desc *desc)
 Perform a reset to the LTC7841.
 
int ltc7841_change_rail_address (struct ltc7841_desc *desc, uint8_t addr)
 Perform change of rail address of LTC7841.
 
int ltc7841_turn_off (struct ltc7841_desc *desc)
 Turn off LTC7841.
 
int ltc7841_turn_on (struct ltc7841_desc *desc)
 Turn on LTC7841.
 
int ltc7841_operation_margin_low (struct ltc7841_desc *desc)
 Margin Low for LTC7841 Operation.
 
int ltc7841_operation_margin_high (struct ltc7841_desc *desc)
 Margin High for LTC7841 Operation.
 
int ltc7841_change_to_nominal_slew_rate (struct ltc7841_desc *desc)
 Change to Nominal Slew Rate for LTC7841.
 
int ltc7841_change_to_slow_slew_rate (struct ltc7841_desc *desc)
 Change to Slow Slew Rate for LTC7841.
 
int ltc7841_change_to_fast_slew_rate (struct ltc7841_desc *desc)
 Change to Fast Slew Rate for LTC7841.
 
int ltc7841_change_to_internal_die_temperature (struct ltc7841_desc *desc)
 Change to Internal Die Temeperature Reading for LTC7841.
 
int ltc7841_change_to_tsns_pin_voltage (struct ltc7841_desc *desc)
 Change to TSNS PIN VOLTAGE for LTC7841.
 
int ltc7841_change_vout_command (struct ltc7841_desc *desc, uint16_t vout_level)
 Change Vout command.
 
int ltc7841_change_margin_low_command (struct ltc7841_desc *desc, uint16_t vout_level)
 Change margin low command.
 
int ltc7841_change_margin_high_command (struct ltc7841_desc *desc, uint16_t vout_level)
 Change margin high command.
 
int ltc7841_mfr_clear_peaks (struct ltc7841_desc *desc)
 This clears the MFR peak data values.
 
int ltc7841_clear_status_word_bits (struct ltc7841_desc *desc)
 This clears the STATUS_WORD BITS that are clearable.
 

Variables

const uint8_t ltc7841_write_only_registers [WRITE_ONLY_REGISTERS_NUMBER]
 

Detailed Description

Source file for the LTC7841 Driver.

Author
Marvin Cabuenas (marvi.nosp@m.nnei.nosp@m.l.cab.nosp@m.uena.nosp@m.s@ana.nosp@m.log..nosp@m.com)

Copyright 2025(c) Analog Devices, Inc.

SPDX-License-Identifier: BSD-3-Clause

Function Documentation

◆ ltc7841_change_margin_high_command()

int ltc7841_change_margin_high_command ( struct ltc7841_desc * desc,
uint16_t vout_level )

Change margin high command.

Parameters
desc- The device structure.
vout_level- value is from 0 to 0x1FF
Returns
0 in case of success, error code otherwise

◆ ltc7841_change_margin_low_command()

int ltc7841_change_margin_low_command ( struct ltc7841_desc * desc,
uint16_t vout_level )

Change margin low command.

Parameters
desc- The device structure.
vout_level- value is from 0 to 0x1FF
Returns
0 in case of success, error code otherwise

◆ ltc7841_change_rail_address()

int ltc7841_change_rail_address ( struct ltc7841_desc * desc,
uint8_t addr )

Perform change of rail address of LTC7841.

Parameters
desc- The device structure.
addr- 7 bit address
Returns
0 in case of success, error code otherwise

◆ ltc7841_change_to_fast_slew_rate()

int ltc7841_change_to_fast_slew_rate ( struct ltc7841_desc * desc)

Change to Fast Slew Rate for LTC7841.

Parameters
desc- The device structure.
Returns
0 in case of success, error code otherwise

◆ ltc7841_change_to_internal_die_temperature()

int ltc7841_change_to_internal_die_temperature ( struct ltc7841_desc * desc)

Change to Internal Die Temeperature Reading for LTC7841.

Parameters
desc- The device structure.
Returns
0 in case of success, error code otherwise

◆ ltc7841_change_to_nominal_slew_rate()

int ltc7841_change_to_nominal_slew_rate ( struct ltc7841_desc * desc)

Change to Nominal Slew Rate for LTC7841.

Parameters
desc- The device structure.
Returns
0 in case of success, error code otherwise

◆ ltc7841_change_to_slow_slew_rate()

int ltc7841_change_to_slow_slew_rate ( struct ltc7841_desc * desc)

Change to Slow Slew Rate for LTC7841.

Parameters
desc- The device structure.
Returns
0 in case of success, error code otherwise

◆ ltc7841_change_to_tsns_pin_voltage()

int ltc7841_change_to_tsns_pin_voltage ( struct ltc7841_desc * desc)

Change to TSNS PIN VOLTAGE for LTC7841.

Parameters
desc- The device structure.
Returns
0 in case of success, error code otherwise

◆ ltc7841_change_vout_command()

int ltc7841_change_vout_command ( struct ltc7841_desc * desc,
uint16_t vout_level )

Change Vout command.

Parameters
desc- The device structure.
vout_level- value is from 0 to 0x1FF
Returns
0 in case of success, error code otherwise

◆ ltc7841_clear_status_word_bits()

int ltc7841_clear_status_word_bits ( struct ltc7841_desc * desc)

This clears the STATUS_WORD BITS that are clearable.

Parameters
desc- The device structure.
Returns
0 in case of success, error code otherwise

◆ ltc7841_init()

int ltc7841_init ( struct ltc7841_desc ** device,
struct ltc7841_init_param * init_param )

Initialize the device structure.

Parameters
device- The device structure to be initialized.
init_param- Initialization parameter for the device descriptor.
Returns
0 in case of success, negative error code otherwise.

◆ ltc7841_mfr_clear_peaks()

int ltc7841_mfr_clear_peaks ( struct ltc7841_desc * desc)

This clears the MFR peak data values.

Parameters
desc- The device structure.
Returns
0 in case of success, error code otherwise

◆ ltc7841_operation_margin_high()

int ltc7841_operation_margin_high ( struct ltc7841_desc * desc)

Margin High for LTC7841 Operation.

Parameters
desc- The device structure.
Returns
0 in case of success, error code otherwise

◆ ltc7841_operation_margin_low()

int ltc7841_operation_margin_low ( struct ltc7841_desc * desc)

Margin Low for LTC7841 Operation.

Parameters
desc- The device structure.
Returns
0 in case of success, error code otherwise

◆ ltc7841_reg_read()

int ltc7841_reg_read ( struct ltc7841_desc * desc,
uint8_t cmd,
uint8_t * data )

Read a raw value from a register.

Parameters
desc- The device structure.
cmd- PMBus command
data- Address of the byte read
Returns
0 in case of success, error code otherwise

◆ ltc7841_reg_write()

int ltc7841_reg_write ( struct ltc7841_desc * desc,
uint8_t cmd,
uint16_t value )

Write a raw value to a register.

Parameters
desc- The device structure.
cmd- PMBus command
value- Byte to be written
Returns
0 in case of success, error code otherwise

◆ ltc7841_remove()

int ltc7841_remove ( struct ltc7841_desc * desc)

Free the device descriptor.

Parameters
desc- The device structure.
Returns
0 in case of success, -EINVAL otherwise.

◆ ltc7841_reset()

int ltc7841_reset ( struct ltc7841_desc * desc)

Perform a reset to the LTC7841.

Parameters
desc- The device structure.
Returns
0 in case of success, error code otherwise

◆ ltc7841_turn_off()

int ltc7841_turn_off ( struct ltc7841_desc * desc)

Turn off LTC7841.

Parameters
desc- The device structure.
Returns
0 in case of success, error code otherwise

◆ ltc7841_turn_on()

int ltc7841_turn_on ( struct ltc7841_desc * desc)

Turn on LTC7841.

Parameters
desc- The device structure.
Returns
0 in case of success, error code otherwise

Variable Documentation

◆ ltc7841_write_only_registers

const uint8_t ltc7841_write_only_registers[WRITE_ONLY_REGISTERS_NUMBER]
Initial value:
= {
}
#define LTC7841_MFR_RESET
Definition ltc7841.h:83
#define LTC7841_MFR_CLEAR_PEAKS
Definition ltc7841.h:76