no-OS
All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
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.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  3. Neither the name of Analog Devices, Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES, INC. “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ANALOG DEVICES, INC. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

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
Here is the caller graph for this function:

◆ 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
Here is the caller graph for this function:

◆ 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.
Here is the caller graph for this function:

◆ 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
Here is the caller graph for this function:

◆ 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
Here is the caller graph for this function:

◆ 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
Here is the caller graph for this function:

◆ 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.
Here is the caller graph for this function:

◆ 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
Here is the caller graph for this function:

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:106
#define LTC7841_MFR_CLEAR_PEAKS
Definition ltc7841.h:99