no-OS
All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
lt3074.h File Reference
#include <stdint.h>
#include <string.h>
#include "no_os_util.h"
#include "no_os_i2c.h"
Include dependency graph for lt3074.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  lt3074_dev
 
struct  lt3074_init_param
 
struct  lt3074_status
 

Macros

#define LT3074_SEND_BYTE   0 /* Send-only command */
 
#define LT3074_BYTE   1 /* Byte */
 
#define LT3074_WORD   2 /* Word */
 
#define LT3074_R0B   (LT3074_SEND_BYTE << 8)
 
#define LT3074_R1B   (LT3074_BYTE << 8)
 
#define LT3074_R2B   (LT3074_WORD << 8)
 
#define LT3074_R6B   (6 << 8) /* Block of size 6*/
 
#define LT3074_SIZE_MSK   NO_OS_GENMASK(15,8)
 
#define LT3074_CMD(x)
 
#define LT3074_ADDR_SIZE(x)
 
#define LT3074_PAGE   (LT3074_R1B | 0x00)
 
#define LT3074_OPERATION   (LT3074_R1B | 0x01)
 
#define LT3074_ON_OFF_CONFIG   (LT3074_R1B | 0x02)
 
#define LT3074_CLEAR_FAULTS   (LT3074_R0B | 0x03)
 
#define LT3074_WRITE_PROTECT   (LT3074_R1B | 0x10)
 
#define LT3074_CAPABILITY   (LT3074_R1B | 0x19)
 
#define LT3074_VOUT_MODE   (LT3074_R1B | 0x20)
 
#define LT3074_VOUT_OV_WARN_LIMIT   (LT3074_R2B | 0x42)
 
#define LT3074_VOUT_UV_WARN_LIMIT   (LT3074_R2B | 0x43)
 
#define LT3074_IOUT_OC_FAULT_LIMIT   (LT3074_R2B | 0x46)
 
#define LT3074_IOUT_OC_FAULT_RESPONSE   (LT3074_R1B | 0x47)
 
#define LT3074_OT_WARN_LIMIT   (LT3074_R2B | 0x51)
 
#define LT3074_VIN_OV_WARN_LIMIT   (LT3074_R2B | 0x57)
 
#define LT3074_VIN_UV_WARN_LIMIT   (LT3074_R2B | 0x58)
 
#define LT3074_STATUS_BYTE   (LT3074_R1B | 0x78)
 
#define LT3074_STATUS_WORD   (LT3074_R2B | 0x79)
 
#define LT3074_STATUS_VOUT   (LT3074_R1B | 0x7A)
 
#define LT3074_STATUS_IOUT   (LT3074_R1B | 0x7B)
 
#define LT3074_STATUS_INPUT   (LT3074_R1B | 0x7C)
 
#define LT3074_STATUS_TEMPERATURE   (LT3074_R1B | 0x7D)
 
#define LT3074_STATUS_CML   (LT3074_R1B | 0x7E)
 
#define LT3074_STATUS_MFR_SPECIFIC   (LT3074_R1B | 0x80)
 
#define LT3074_READ_VIN   (LT3074_R2B | 0x88)
 
#define LT3074_READ_VOUT   (LT3074_R2B | 0x8B)
 
#define LT3074_READ_IOUT   (LT3074_R2B | 0x8C)
 
#define LT3074_READ_TEMPERATURE_1   (LT3074_R2B | 0x8D)
 
#define LT3074_REVISION   (LT3074_R1B | 0x98)
 
#define LT3074_IC_DEVICE_ID   (LT3074_R6B | 0xAD)
 
#define LT3074_IC_DEVICE_REV   (LT3074_R2B | 0xAE)
 
#define LT3074_MFR_MARGIN   (LT3074_R1B | 0xC4)
 
#define LT3074_MFR_READ_VBIAS   (LT3074_R2B | 0xC6)
 
#define LT3074_MFR_BIAS_OV_WARN_LIMIT   (LT3074_R2B | 0xC7)
 
#define LT3074_MFR_BIAS_UV_WARN_LIMIT   (LT3074_R2B | 0xC8)
 
#define LT3074_MFR_IOUT_MIN_WARN_LIMIT   (LT3074_R2B | 0xC9)
 
#define LT3074_MFR_SPECIAL_ID   (LT3074_R2B | 0xE7)
 
#define LT3074_MFR_DEFAULT_CONFIG   (LT3074_R1B | 0xF5)
 
#define LT3074_MFR_RAIL_ADDRESS   (LT3074_R1B | 0xFA)
 
#define LT3074_MFR_RESET   (LT3074_R0B | 0xFD)
 
#define LT3074_CRC_POLYNOMIAL   0x7
 
#define LT3074_MARGIN_HIGH_MSK   0xF0
 
#define LT3074_MARGIN_LOW_MSK   0x0F
 
#define LT3074_OPERATION_ACCESS_MSK   (NO_OS_GENMASK(5,4) | NO_OS_BIT(7))
 
#define LT3074_SPECIAL_ID_VALUE   0x1C1D
 
#define LT3074_STATUS_BYTE_TYPE_MSK   0x01
 
#define LT3074_STATUS_VOUT_TYPE_MSK   0x02
 
#define LT3074_STATUS_IOUT_TYPE_MSK   0x04
 
#define LT3074_STATUS_INPUT_TYPE_MSK   0x08
 
#define LT3074_STATUS_TEMP_TYPE_MSK   0x10
 
#define LT3074_STATUS_CML_TYPE_MSK   0x20
 
#define LT3074_STATUS_MFR_SPECIFIC_TYPE_MSK   0x40
 
#define LT3074_STATUS_WORD_TYPE_MSK   0x80
 
#define LT3074_STATUS_ALL_TYPE_MSK   0xFF
 

Enumerations

enum  lt3074_operation_type {
  LT3074_OPERATION_OFF ,
  LT3074_OPERATION_ON = 0x80 ,
  LT3074_OPERATION_MARGIN_HIGH = 0xA0 ,
  LT3074_OPERATION_MARGIN_LOW = 0x90
}
 
enum  lt3074_value_type {
  LT3074_VIN = LT3074_READ_VIN ,
  LT3074_VOUT = LT3074_READ_VOUT ,
  LT3074_IOUT = LT3074_READ_IOUT ,
  LT3074_TEMP = LT3074_READ_TEMPERATURE_1 ,
  LT3074_VBIAS = LT3074_MFR_READ_VBIAS
}
 
enum  lt3074_limit_type {
  LT3074_VOUT_OV_WARN_LIMIT_TYPE = LT3074_VOUT_OV_WARN_LIMIT ,
  LT3074_VOUT_UV_WARN_LIMIT_TYPE = LT3074_VOUT_UV_WARN_LIMIT ,
  LT3074_IOUT_OC_FAULT_LIMIT_TYPE = LT3074_IOUT_OC_FAULT_LIMIT ,
  LT3074_OT_WARN_LIMIT_TYPE = LT3074_OT_WARN_LIMIT ,
  LT3074_VIN_OV_WARN_LIMIT_TYPE = LT3074_VIN_OV_WARN_LIMIT ,
  LT3074_VIN_UV_WARN_LIMIT_TYPE = LT3074_VIN_UV_WARN_LIMIT ,
  LT3074_VBIAS_OV_WARN_LIMIT_TYPE = LT3074_MFR_BIAS_OV_WARN_LIMIT ,
  LT3074_VBIAS_UV_WARN_LIMIT_TYPE = LT3074_MFR_BIAS_UV_WARN_LIMIT ,
  LT3074_IOUT_MIN_WARN_LIMIT_TYPE = LT3074_MFR_IOUT_MIN_WARN_LIMIT
}
 
enum  lt3074_status_type {
  LT3074_STATUS_BYTE_TYPE = LT3074_STATUS_BYTE_TYPE_MSK ,
  LT3074_STATUS_VOUT_TYPE = LT3074_STATUS_VOUT_TYPE_MSK ,
  LT3074_STATUS_IOUT_TYPE = LT3074_STATUS_IOUT_TYPE_MSK ,
  LT3074_STATUS_INPUT_TYPE = LT3074_STATUS_INPUT_TYPE_MSK ,
  LT3074_STATUS_TEMP_TYPE = LT3074_STATUS_TEMP_TYPE_MSK ,
  LT3074_STATUS_CML_TYPE = LT3074_STATUS_CML_TYPE_MSK ,
  LT3074_STATUS_MFR_SPECIFIC_TYPE = LT3074_STATUS_MFR_SPECIFIC_TYPE_MSK ,
  LT3074_STATUS_WORD_TYPE = LT3074_STATUS_WORD_TYPE_MSK ,
  LT3074_STATUS_ALL_TYPE = LT3074_STATUS_ALL_TYPE_MSK
}
 
enum  lt3074_margin {
  LT3074_MARGIN_PERCENTAGE_0 ,
  LT3074_MARGIN_PERCENTAGE_1 ,
  LT3074_MARGIN_PERCENTAGE_3 ,
  LT3074_MARGIN_PERCENTAGE_5 ,
  LT3074_MARGIN_PERCENTAGE_10 ,
  LT3074_MARGIN_PERCENTAGE_15 ,
  LT3074_MARGIN_PERCENTAGE_20 ,
  LT3074_MARGIN_PERCENTAGE_25 ,
  LT3074_MARGIN_PERCENTAGE_30
}
 

Functions

int lt3074_init (struct lt3074_dev **dev, struct lt3074_init_param *init_param)
 Initialize the device structure.
 
int lt3074_remove (struct lt3074_dev *dev)
 Free or remove device instance.
 
int lt3074_send_byte (struct lt3074_dev *dev, uint32_t cmd)
 Send a PMBus command to the device.
 
int lt3074_read_byte (struct lt3074_dev *dev, uint32_t cmd, uint8_t *data)
 Perform a raw PMBus read byte operation.
 
int lt3074_write_byte (struct lt3074_dev *dev, uint32_t cmd, uint8_t value)
 Perform a raw PMBus write byte operation.
 
int lt3074_read_word (struct lt3074_dev *dev, uint32_t cmd, uint16_t *word)
 Perform a raw PMBus read word operation.
 
int lt3074_write_word (struct lt3074_dev *dev, uint32_t cmd, uint16_t word)
 Perform a raw PMBus write word operation.
 
int lt3074_read_word_data (struct lt3074_dev *dev, uint32_t cmd, int *data)
 Perform a PMBus read word operation and converts to actual value.
 
int lt3074_write_word_data (struct lt3074_dev *dev, uint32_t cmd, int data)
 Converts value to register data and do PMBus write word operation.
 
int lt3074_read_block_data (struct lt3074_dev *dev, uint32_t cmd, uint8_t *data, size_t nbytes)
 Perform a PMBus read block operation.
 
int lt3074_reg_read (struct lt3074_dev *dev, uint32_t reg, uint32_t *data)
 Generic register read wrapper.
 
int lt3074_reg_write (struct lt3074_dev *dev, uint32_t reg, uint32_t val)
 Generic register write wrapper.
 
int lt3074_read_value (struct lt3074_dev *dev, enum lt3074_value_type value_type, int *value)
 Read a value.
 
int lt3074_read_status (struct lt3074_dev *dev, enum lt3074_status_type status_type, struct lt3074_status *status)
 Read statuses.
 
int lt3074_vout_margin (struct lt3074_dev *dev, enum lt3074_margin margin_high, enum lt3074_margin margin_low)
 Set output voltage margin.
 
int lt3074_set_limit (struct lt3074_dev *dev, enum lt3074_limit_type limit, int limit_val)
 Sets the limit value for a specific fault/warning limits.
 
int lt3074_set_operation (struct lt3074_dev *dev, enum lt3074_operation_type operation)
 Set operation.
 
int lt3074_clear_faults (struct lt3074_dev *dev)
 Clear status registers.
 
int lt3074_set_enable_pin (struct lt3074_dev *dev, bool state)
 Enable/Disable the device using the EN pin.
 
int lt3074_software_reset (struct lt3074_dev *dev)
 Perform a device software reset.
 

Macro Definition Documentation

◆ LT3074_ADDR_SIZE

#define LT3074_ADDR_SIZE ( x)
Value:
#define LT3074_SIZE_MSK
Definition lt3074.h:50
uint32_t no_os_field_get(uint32_t mask, uint32_t word)

◆ LT3074_BYTE

#define LT3074_BYTE   1 /* Byte */

◆ LT3074_CAPABILITY

#define LT3074_CAPABILITY   (LT3074_R1B | 0x19)

◆ LT3074_CLEAR_FAULTS

#define LT3074_CLEAR_FAULTS   (LT3074_R0B | 0x03)

◆ LT3074_CMD

#define LT3074_CMD ( x)
Value:
((uint8_t)(x & 0xFF))

◆ LT3074_CRC_POLYNOMIAL

#define LT3074_CRC_POLYNOMIAL   0x7

◆ LT3074_IC_DEVICE_ID

#define LT3074_IC_DEVICE_ID   (LT3074_R6B | 0xAD)

◆ LT3074_IC_DEVICE_REV

#define LT3074_IC_DEVICE_REV   (LT3074_R2B | 0xAE)

◆ LT3074_IOUT_OC_FAULT_LIMIT

#define LT3074_IOUT_OC_FAULT_LIMIT   (LT3074_R2B | 0x46)

◆ LT3074_IOUT_OC_FAULT_RESPONSE

#define LT3074_IOUT_OC_FAULT_RESPONSE   (LT3074_R1B | 0x47)

◆ LT3074_MARGIN_HIGH_MSK

#define LT3074_MARGIN_HIGH_MSK   0xF0

◆ LT3074_MARGIN_LOW_MSK

#define LT3074_MARGIN_LOW_MSK   0x0F

◆ LT3074_MFR_BIAS_OV_WARN_LIMIT

#define LT3074_MFR_BIAS_OV_WARN_LIMIT   (LT3074_R2B | 0xC7)

◆ LT3074_MFR_BIAS_UV_WARN_LIMIT

#define LT3074_MFR_BIAS_UV_WARN_LIMIT   (LT3074_R2B | 0xC8)

◆ LT3074_MFR_DEFAULT_CONFIG

#define LT3074_MFR_DEFAULT_CONFIG   (LT3074_R1B | 0xF5)

◆ LT3074_MFR_IOUT_MIN_WARN_LIMIT

#define LT3074_MFR_IOUT_MIN_WARN_LIMIT   (LT3074_R2B | 0xC9)

◆ LT3074_MFR_MARGIN

#define LT3074_MFR_MARGIN   (LT3074_R1B | 0xC4)

◆ LT3074_MFR_RAIL_ADDRESS

#define LT3074_MFR_RAIL_ADDRESS   (LT3074_R1B | 0xFA)

◆ LT3074_MFR_READ_VBIAS

#define LT3074_MFR_READ_VBIAS   (LT3074_R2B | 0xC6)

◆ LT3074_MFR_RESET

#define LT3074_MFR_RESET   (LT3074_R0B | 0xFD)

◆ LT3074_MFR_SPECIAL_ID

#define LT3074_MFR_SPECIAL_ID   (LT3074_R2B | 0xE7)

◆ LT3074_ON_OFF_CONFIG

#define LT3074_ON_OFF_CONFIG   (LT3074_R1B | 0x02)

◆ LT3074_OPERATION

#define LT3074_OPERATION   (LT3074_R1B | 0x01)

◆ LT3074_OPERATION_ACCESS_MSK

#define LT3074_OPERATION_ACCESS_MSK   (NO_OS_GENMASK(5,4) | NO_OS_BIT(7))

◆ LT3074_OT_WARN_LIMIT

#define LT3074_OT_WARN_LIMIT   (LT3074_R2B | 0x51)

◆ LT3074_PAGE

#define LT3074_PAGE   (LT3074_R1B | 0x00)

◆ LT3074_R0B

#define LT3074_R0B   (LT3074_SEND_BYTE << 8)

◆ LT3074_R1B

#define LT3074_R1B   (LT3074_BYTE << 8)

◆ LT3074_R2B

#define LT3074_R2B   (LT3074_WORD << 8)

◆ LT3074_R6B

#define LT3074_R6B   (6 << 8) /* Block of size 6*/

◆ LT3074_READ_IOUT

#define LT3074_READ_IOUT   (LT3074_R2B | 0x8C)

◆ LT3074_READ_TEMPERATURE_1

#define LT3074_READ_TEMPERATURE_1   (LT3074_R2B | 0x8D)

◆ LT3074_READ_VIN

#define LT3074_READ_VIN   (LT3074_R2B | 0x88)

◆ LT3074_READ_VOUT

#define LT3074_READ_VOUT   (LT3074_R2B | 0x8B)

◆ LT3074_REVISION

#define LT3074_REVISION   (LT3074_R1B | 0x98)

◆ LT3074_SEND_BYTE

#define LT3074_SEND_BYTE   0 /* Send-only command */

◆ LT3074_SIZE_MSK

#define LT3074_SIZE_MSK   NO_OS_GENMASK(15,8)

◆ LT3074_SPECIAL_ID_VALUE

#define LT3074_SPECIAL_ID_VALUE   0x1C1D

◆ LT3074_STATUS_ALL_TYPE_MSK

#define LT3074_STATUS_ALL_TYPE_MSK   0xFF

◆ LT3074_STATUS_BYTE

#define LT3074_STATUS_BYTE   (LT3074_R1B | 0x78)

◆ LT3074_STATUS_BYTE_TYPE_MSK

#define LT3074_STATUS_BYTE_TYPE_MSK   0x01

◆ LT3074_STATUS_CML

#define LT3074_STATUS_CML   (LT3074_R1B | 0x7E)

◆ LT3074_STATUS_CML_TYPE_MSK

#define LT3074_STATUS_CML_TYPE_MSK   0x20

◆ LT3074_STATUS_INPUT

#define LT3074_STATUS_INPUT   (LT3074_R1B | 0x7C)

◆ LT3074_STATUS_INPUT_TYPE_MSK

#define LT3074_STATUS_INPUT_TYPE_MSK   0x08

◆ LT3074_STATUS_IOUT

#define LT3074_STATUS_IOUT   (LT3074_R1B | 0x7B)

◆ LT3074_STATUS_IOUT_TYPE_MSK

#define LT3074_STATUS_IOUT_TYPE_MSK   0x04

◆ LT3074_STATUS_MFR_SPECIFIC

#define LT3074_STATUS_MFR_SPECIFIC   (LT3074_R1B | 0x80)

◆ LT3074_STATUS_MFR_SPECIFIC_TYPE_MSK

#define LT3074_STATUS_MFR_SPECIFIC_TYPE_MSK   0x40

◆ LT3074_STATUS_TEMP_TYPE_MSK

#define LT3074_STATUS_TEMP_TYPE_MSK   0x10

◆ LT3074_STATUS_TEMPERATURE

#define LT3074_STATUS_TEMPERATURE   (LT3074_R1B | 0x7D)

◆ LT3074_STATUS_VOUT

#define LT3074_STATUS_VOUT   (LT3074_R1B | 0x7A)

◆ LT3074_STATUS_VOUT_TYPE_MSK

#define LT3074_STATUS_VOUT_TYPE_MSK   0x02

◆ LT3074_STATUS_WORD

#define LT3074_STATUS_WORD   (LT3074_R2B | 0x79)

◆ LT3074_STATUS_WORD_TYPE_MSK

#define LT3074_STATUS_WORD_TYPE_MSK   0x80

◆ LT3074_VIN_OV_WARN_LIMIT

#define LT3074_VIN_OV_WARN_LIMIT   (LT3074_R2B | 0x57)

◆ LT3074_VIN_UV_WARN_LIMIT

#define LT3074_VIN_UV_WARN_LIMIT   (LT3074_R2B | 0x58)

◆ LT3074_VOUT_MODE

#define LT3074_VOUT_MODE   (LT3074_R1B | 0x20)

◆ LT3074_VOUT_OV_WARN_LIMIT

#define LT3074_VOUT_OV_WARN_LIMIT   (LT3074_R2B | 0x42)

◆ LT3074_VOUT_UV_WARN_LIMIT

#define LT3074_VOUT_UV_WARN_LIMIT   (LT3074_R2B | 0x43)

◆ LT3074_WORD

#define LT3074_WORD   2 /* Word */

◆ LT3074_WRITE_PROTECT

#define LT3074_WRITE_PROTECT   (LT3074_R1B | 0x10)

Enumeration Type Documentation

◆ lt3074_limit_type

Enumerator
LT3074_VOUT_OV_WARN_LIMIT_TYPE 
LT3074_VOUT_UV_WARN_LIMIT_TYPE 
LT3074_IOUT_OC_FAULT_LIMIT_TYPE 
LT3074_OT_WARN_LIMIT_TYPE 
LT3074_VIN_OV_WARN_LIMIT_TYPE 
LT3074_VIN_UV_WARN_LIMIT_TYPE 
LT3074_VBIAS_OV_WARN_LIMIT_TYPE 
LT3074_VBIAS_UV_WARN_LIMIT_TYPE 
LT3074_IOUT_MIN_WARN_LIMIT_TYPE 

◆ lt3074_margin

Enumerator
LT3074_MARGIN_PERCENTAGE_0 
LT3074_MARGIN_PERCENTAGE_1 
LT3074_MARGIN_PERCENTAGE_3 
LT3074_MARGIN_PERCENTAGE_5 
LT3074_MARGIN_PERCENTAGE_10 
LT3074_MARGIN_PERCENTAGE_15 
LT3074_MARGIN_PERCENTAGE_20 
LT3074_MARGIN_PERCENTAGE_25 
LT3074_MARGIN_PERCENTAGE_30 

◆ lt3074_operation_type

Enumerator
LT3074_OPERATION_OFF 
LT3074_OPERATION_ON 
LT3074_OPERATION_MARGIN_HIGH 
LT3074_OPERATION_MARGIN_LOW 

◆ lt3074_status_type

Enumerator
LT3074_STATUS_BYTE_TYPE 
LT3074_STATUS_VOUT_TYPE 
LT3074_STATUS_IOUT_TYPE 
LT3074_STATUS_INPUT_TYPE 
LT3074_STATUS_TEMP_TYPE 
LT3074_STATUS_CML_TYPE 
LT3074_STATUS_MFR_SPECIFIC_TYPE 
LT3074_STATUS_WORD_TYPE 
LT3074_STATUS_ALL_TYPE 

◆ lt3074_value_type

Enumerator
LT3074_VIN 
LT3074_VOUT 
LT3074_IOUT 
LT3074_TEMP 
LT3074_VBIAS 

Function Documentation

◆ lt3074_clear_faults()

int lt3074_clear_faults ( struct lt3074_dev * dev)

Clear status registers.

Parameters
dev- Device structure
Returns
0 in case of success, negative error code otherwise
Here is the caller graph for this function:

◆ lt3074_init()

int lt3074_init ( struct lt3074_dev ** device,
struct lt3074_init_param * init_param )

Initialize the device structure.

Parameters
device- Device structure
init_param- Initialization parameters
Returns
0 in case of success, negative error code otherwise
Here is the caller graph for this function:

◆ lt3074_read_block_data()

int lt3074_read_block_data ( struct lt3074_dev * dev,
uint32_t cmd,
uint8_t * data,
size_t nbytes )

Perform a PMBus read block operation.

Parameters
dev- Device structure
cmd- PMBus command
data- Address of the read block
nbytes- Size of the block in bytes
Returns
0 in case of success, negative error code otherwise
Here is the caller graph for this function:

◆ lt3074_read_byte()

int lt3074_read_byte ( struct lt3074_dev * dev,
uint32_t cmd,
uint8_t * data )

Perform a raw PMBus read byte operation.

Parameters
dev- Device structure
cmd- PMBus command
data- Address of the byte read
Returns
0 in case of success, negative error code otherwise
Here is the caller graph for this function:

◆ lt3074_read_status()

int lt3074_read_status ( struct lt3074_dev * dev,
enum lt3074_status_type status_type,
struct lt3074_status * status )

Read statuses.

Parameters
dev- Device structure
status_type- Status type. Example values: LT3074_STATUS_BYTE_TYPE LT3074_STATUS_VOUT_TYPE LT3074_STATUS_IOUT_TYPE LT3074_STATUS_INPUT_TYPE LT3074_STATUS_CML_TYPE
status- Address of the status structure
Returns
0 in case of success, negative error code otherwise
Here is the caller graph for this function:

◆ lt3074_read_value()

int lt3074_read_value ( struct lt3074_dev * dev,
enum lt3074_value_type value_type,
int * value )

Read a value.

Parameters
dev- Device structure
value_type- Value type. Example values: LT3074_VIN LT3074_VOUT LT3074_IOUT LT3074_TEMP LT3074_VBIAS
value- Address of the read value
Returns
0 in case of success, negative error code otherwise
Here is the caller graph for this function:

◆ lt3074_read_word()

int lt3074_read_word ( struct lt3074_dev * dev,
uint32_t cmd,
uint16_t * word )

Perform a raw PMBus read word operation.

Parameters
dev- Device structure
cmd- PMBus command
word- Address of the read word
Returns
0 in case of success, negative error code otherwise
Here is the caller graph for this function:

◆ lt3074_read_word_data()

int lt3074_read_word_data ( struct lt3074_dev * dev,
uint32_t cmd,
int * data )

Perform a PMBus read word operation and converts to actual value.

Parameters
dev- Device structure
cmd- PMBus command
data- Address of data read
Returns
0 in case of success, negative error code otherwise
Here is the caller graph for this function:

◆ lt3074_reg_read()

int lt3074_reg_read ( struct lt3074_dev * dev,
uint32_t reg,
uint32_t * data )

Generic register read wrapper.

Parameters
dev- Device structure
reg- PMBus regiser
data- Address of the read data
Returns
0 in case of success, negative error code otherwise
Here is the caller graph for this function:

◆ lt3074_reg_write()

int lt3074_reg_write ( struct lt3074_dev * dev,
uint32_t reg,
uint32_t val )

Generic register write wrapper.

Parameters
dev- Device structure
reg- PMBus register
val- Value to write
Returns
0 in case of success, negative error code otherwise
Here is the caller graph for this function:

◆ lt3074_remove()

int lt3074_remove ( struct lt3074_dev * dev)

Free or remove device instance.

Parameters
dev- The device structure
Returns
0 in case of success, negative error code otherwise
Here is the caller graph for this function:

◆ lt3074_send_byte()

int lt3074_send_byte ( struct lt3074_dev * dev,
uint32_t cmd )

Send a PMBus command to the device.

Parameters
dev- Device structure
cmd- PMBus command
Returns
0 in case of success, negative error code otherwise
Here is the caller graph for this function:

◆ lt3074_set_enable_pin()

int lt3074_set_enable_pin ( struct lt3074_dev * dev,
bool state )

Enable/Disable the device using the EN pin.

Parameters
dev- Device structure
state- Enable/Disable state. 0 for disable, 1 for enable.
Returns
0 in case of success, negative error code otherwise

◆ lt3074_set_limit()

int lt3074_set_limit ( struct lt3074_dev * dev,
enum lt3074_limit_type limit,
int limit_val )

Sets the limit value for a specific fault/warning limits.

Parameters
dev- Device structure
limit- The type of limit to set.
limit_val- The value to set for the specified limit type.
Returns
Returns 0 on success, or a negative error code on failure.
Here is the caller graph for this function:

◆ lt3074_set_operation()

int lt3074_set_operation ( struct lt3074_dev * dev,
enum lt3074_operation_type operation )

Set operation.

Parameters
dev- Device structure
operation- Operation. Accepted values are: LT3074_OPERATION_OFF LT3074_OPERATION_ON LT3074_OPERATION_MARGIN_HIGH LT3074_OPERATION_MARGIN_LOW
Returns
0 in case of success, negative error code otherwise
Here is the caller graph for this function:

◆ lt3074_software_reset()

int lt3074_software_reset ( struct lt3074_dev * dev)

Perform a device software reset.

Parameters
dev- Device structure
Returns
0 in case of success, negative error code otherwise

◆ lt3074_vout_margin()

int lt3074_vout_margin ( struct lt3074_dev * dev,
enum lt3074_margin margin_high,
enum lt3074_margin margin_low )

Set output voltage margin.

Parameters
dev- Device structure
margin_high- Upper margin
margin_low- Lower margin
Returns
0 in case of success, negative error code otherwise
Here is the caller graph for this function:

◆ lt3074_write_byte()

int lt3074_write_byte ( struct lt3074_dev * dev,
uint32_t cmd,
uint8_t value )

Perform a raw PMBus write byte operation.

Parameters
dev- Device structure
cmd- PMBus command
value- Byte to be written
Returns
0 in case of success, negative error code otherwise
Here is the caller graph for this function:

◆ lt3074_write_word()

int lt3074_write_word ( struct lt3074_dev * dev,
uint32_t cmd,
uint16_t word )

Perform a raw PMBus write word operation.

Parameters
dev- Device structure
cmd- PMBus command
word- Word to write
Returns
0 in case of success, negative error code otherwise
Here is the caller graph for this function:

◆ lt3074_write_word_data()

int lt3074_write_word_data ( struct lt3074_dev * dev,
uint32_t cmd,
int data )

Converts value to register data and do PMBus write word operation.

Parameters
dev- Device structure
cmd- PMBus command
data- Value to write
Returns
0 in case of success, negative error code otherwise
Here is the caller graph for this function: