no-OS
|
Go to the source code of this file.
Classes | |
struct | lt7170_dev |
struct | lt7170_init_param |
struct | lt7170_chip_info |
struct | lt7170_status |
Functions | |
int | lt7170_init (struct lt7170_dev **dev, struct lt7170_init_param *init_param) |
Initialize the device structure. More... | |
int | lt7170_remove (struct lt7170_dev *dev) |
Free or remove device instance. More... | |
int | lt7170_send_byte (struct lt7170_dev *dev, uint8_t cmd) |
Send a PMBus command to the device. More... | |
int | lt7170_read_byte (struct lt7170_dev *dev, uint8_t cmd, uint8_t *data) |
Perform a raw PMBus read byte operation. More... | |
int | lt7170_write_byte (struct lt7170_dev *dev, uint8_t cmd, uint8_t value) |
Perform a raw PMBus write byte operation. More... | |
int | lt7170_read_word (struct lt7170_dev *dev, uint8_t cmd, uint16_t *word) |
Perform a raw PMBus read word operation. More... | |
int | lt7170_write_word (struct lt7170_dev *dev, uint8_t cmd, uint16_t word) |
Perform a raw PMBus write word operation. More... | |
int | lt7170_read_word_data (struct lt7170_dev *dev, uint8_t cmd, int *data) |
Perform a PMBus read word operation and converts to actual value. More... | |
int | lt7170_write_word_data (struct lt7170_dev *dev, uint8_t cmd, int data) |
Converts value to register data and do PMBus write word operation. More... | |
int | lt7170_read_block_data (struct lt7170_dev *dev, uint8_t cmd, uint8_t *data, size_t nbytes) |
Perform a PMBus read block operation. More... | |
int | lt7170_read_value (struct lt7170_dev *dev, enum lt7170_value_type value_type, int *value) |
Read a value. More... | |
int | lt7170_read_status (struct lt7170_dev *dev, enum lt7170_status_type status_type, struct lt7170_status *status) |
Read statuses. More... | |
int | lt7170_vout_value (struct lt7170_dev *dev, int vout_command, int vout_max) |
Set output voltage and its upper limit. More... | |
int | lt7170_vout_tr (struct lt7170_dev *dev, int tr) |
Set output voltage transition rate. More... | |
int | lt7170_vout_margin (struct lt7170_dev *dev, int margin_high, int margin_low) |
Set output voltage margin. More... | |
int | lt7170_set_vin (struct lt7170_dev *dev, int vin_on, int vin_off) |
Set input voltage window at which power conversion will proceed. More... | |
int | lt7170_set_timing (struct lt7170_dev *dev, enum lt7170_timing_type timing_type, int time) |
Set timing values. More... | |
int | lt7170_switch_freq (struct lt7170_dev *dev, int freq) |
Set switching frequency. More... | |
int | lt7170_pwm_mode (struct lt7170_dev *dev, enum lt7170_pwm_mode pwm_mode) |
Set output PWM mode. More... | |
int | lt7170_pwm_phase (struct lt7170_dev *dev, int phase) |
Set output PWM phase. More... | |
int | lt7170_set_limit (struct lt7170_dev *dev, enum lt7170_limit_type limit, int limit_val) |
Set overvalue and undervalue limits. More... | |
int | lt7170_set_operation (struct lt7170_dev *dev, enum lt7170_operation_type operation) |
Set channel operation. More... | |
int | lt7170_set_channel_state (struct lt7170_dev *dev, bool state) |
Set channel state using the RUN pin. More... | |
int | lt7170_sync_config (struct lt7170_dev *dev, bool input_clk, bool output_clk) |
Configure SYNC pin for clock synchronization. More... | |
int | lt7170_adc_control (struct lt7170_dev *dev, bool low_freq_telemetry, bool debug_telemetry) |
Configure ADC control. More... | |
int | lt7170_nvm_cmd (struct lt7170_dev *dev, enum lt7170_nvm_cmd_type cmd) |
Perform commands for non-volatile memory (NVM) More... | |
int | lt7170_clear_faults (struct lt7170_dev *dev) |
Clear all asserted faults. More... | |
int | lt7170_software_reset (struct lt7170_dev *dev) |
Perform a device software reset. More... | |
#define LT7170_ADC_CTRL_DEBUG_BIT NO_OS_BIT(0) |
#define LT7170_ADC_CTRL_LOW_FREQ_BIT NO_OS_BIT(1) |
#define LT7170_CAPABILITY 0x19 |
#define LT7170_CLEAR_FAULTS 0x03 |
#define LT7170_CONFIG_ALL_PEC_BIT NO_OS_BIT(2) |
#define LT7170_CRC_POLYNOMIAL 0x7 |
#define LT7170_FREQ_MAX 4000000 |
#define LT7170_FREQ_MIN 400000 |
#define LT7170_FREQUENCY_SWITCH 0x33 |
#define LT7170_IC_DEVICE_ID 0xAD |
#define LT7170_IC_DEVICE_REV 0xAE |
#define LT7170_IEEE754_EXPONENT_MSK NO_OS_GENMASK(14, 10) |
#define LT7170_IEEE754_MANTISSA_MSK NO_OS_GENMASK(9, 0) |
#define LT7170_IEEE754_MAX_MANTISSA 0x7ff |
#define LT7170_IEEE754_MIN_MANTISSA 0x400 |
#define LT7170_IEEE754_SIGN_BIT NO_OS_BIT(15) |
#define LT7170_IOUT_CAL_OFFSET 0x39 |
#define LT7170_IOUT_OC_FAULT_RESPONSE 0x47 |
#define LT7170_IOUT_OC_WARN_LIMIT 0x4A |
#define LT7170_MFR_ADC_CONTROL 0xD8 |
#define LT7170_MFR_CHAN_CONFIG 0xD0 |
#define LT7170_MFR_CHANNEL_STATE 0xF1 |
#define LT7170_MFR_CLEAR_PEAKS 0xE3 |
#define LT7170_MFR_COMMON 0xEF |
#define LT7170_MFR_COMPARE_USER_ALL 0xF0 |
#define LT7170_MFR_CONFIG_ALL 0xD1 |
#define LT7170_MFR_DISABLE_OUTPUT 0xFB |
#define LT7170_MFR_DISCHARGE_THRESHOLD 0xE4 |
#define LT7170_MFR_FAULT_PROPAGATE 0xD2 |
#define LT7170_MFR_FAULT_RESPONSE 0xD5 |
#define LT7170_MFR_I2C_ADDRESS 0xE6 |
#define LT7170_MFR_ID 0x99 |
#define LT7170_MFR_IOUT_PEAK 0xD7 |
#define LT7170_MFR_NOT_PGOOD_DELAY 0xF3 |
#define LT7170_MFR_NVM_DATA 0xBF |
#define LT7170_MFR_NVM_UNLOCK 0xBD |
#define LT7170_MFR_NVM_USER_WP 0xFC |
#define LT7170_MFR_NVM_USER_WRITES_REMAINING 0xBE |
#define LT7170_MFR_PADS 0xE5 |
#define LT7170_MFR_PGOOD_DELAY 0xF2 |
#define LT7170_MFR_PIN_CONFIG_STATUS 0xF7 |
#define LT7170_MFR_PWM_MODE 0xD4 |
#define LT7170_MFR_PWM_PHASE 0xF5 |
#define LT7170_MFR_RAIL_ADDRESS 0xFA |
#define LT7170_MFR_READ_ASEL 0xD3 |
#define LT7170_MFR_READ_EXTVCC 0xCD |
#define LT7170_MFR_READ_ITH 0xCE |
#define LT7170_MFR_READ_PWM_CFG 0xE0 |
#define LT7170_MFR_READ_VOUT_CFG 0xE1 |
#define LT7170_MFR_RESET 0xFD |
#define LT7170_MFR_RETRY_DELAY 0xDB |
#define LT7170_MFR_SERIAL 0x9E |
#define LT7170_MFR_SPECIAL_ID 0xE7 |
#define LT7170_MFR_SYNC_CONFIG 0xF6 |
#define LT7170_MFR_TEMPERATURE_1_PEAK 0xDF |
#define LT7170_MFR_USER_DATA_00 0xC9 |
#define LT7170_MFR_USER_DATA_01 0xCA |
#define LT7170_MFR_VIN_PEAK 0xDE |
#define LT7170_MFR_VOUT_PEAK 0xDD |
#define LT7170_ON_OFF_CONFIG 0x02 |
#define LT7170_OPERATION 0x01 |
#define LT7170_OT_FAULT_LIMIT 0x4F |
#define LT7170_OT_FAULT_RESPONSE 0x50 |
#define LT7170_OT_WARN_LIMIT 0x51 |
#define LT7170_PADS_RUN_BIT NO_OS_BIT(2) |
#define LT7170_PAGE 0x00 |
#define LT7170_PAGE_PLUS_READ 0x06 |
#define LT7170_PAGE_PLUS_WRITE 0x05 |
#define LT7170_PHASE_FULL_MILLI 360000 |
#define LT7170_PWM_OP_MODE_BIT NO_OS_BIT(0) |
#define LT7170_QUERY 0x1A |
#define LT7170_READ_FREQUENCY 0x95 |
#define LT7170_READ_IOUT 0x8C |
#define LT7170_READ_TEMPERATURE_1 0x8D |
#define LT7170_READ_VIN 0x88 |
#define LT7170_READ_VOUT 0x8B |
#define LT7170_RESTORE_USER_ALL 0x16 |
#define LT7170_REVISION 0x98 |
#define LT7170_SMBALERT_MASK 0x1B |
#define LT7170_SPECIAL_ID_VALUE 0x1C1D |
#define LT7170_STATUS_ALL_TYPE_MSK 0xFF |
#define LT7170_STATUS_BYTE 0x78 |
#define LT7170_STATUS_BYTE_TYPE_MSK 0x01 |
#define LT7170_STATUS_CML 0x7E |
#define LT7170_STATUS_CML_TYPE_MSK 0x20 |
#define LT7170_STATUS_INPUT 0x7C |
#define LT7170_STATUS_INPUT_TYPE_MSK 0x08 |
#define LT7170_STATUS_IOUT 0x7B |
#define LT7170_STATUS_IOUT_TYPE_MSK 0x04 |
#define LT7170_STATUS_MFR_SPECIFIC 0x80 |
#define LT7170_STATUS_MFR_SPECIFIC_TYPE_MSK 0x40 |
#define LT7170_STATUS_TEMP_TYPE_MSK 0x10 |
#define LT7170_STATUS_TEMPERATURE 0x7D |
#define LT7170_STATUS_VOUT 0x7A |
#define LT7170_STATUS_VOUT_TYPE_MSK 0x02 |
#define LT7170_STATUS_WORD 0x79 |
#define LT7170_STATUS_WORD_TYPE_MSK 0x80 |
#define LT7170_STORE_USER_ALL 0x15 |
#define LT7170_SYNC_CLK_INPUT_BIT NO_OS_BIT(1) |
#define LT7170_SYNC_CLK_OUTPUT_BIT NO_OS_BIT(0) |
#define LT7170_TOFF_DELAY 0x64 |
#define LT7170_TOFF_FALL 0x65 |
#define LT7170_TOFF_MAX_WARN_LIMIT 0x66 |
#define LT7170_TON_DELAY 0x60 |
#define LT7170_TON_MAX_FAULT_LIMIT 0x62 |
#define LT7170_TON_MAX_FAULT_RESPONSE 0x63 |
#define LT7170_TON_RISE 0x61 |
#define LT7170_VIN_OFF 0x36 |
#define LT7170_VIN_OFF_MAX 16000 |
#define LT7170_VIN_OFF_MIN 1350 |
#define LT7170_VIN_ON 0x35 |
#define LT7170_VIN_ON_MAX 16000 |
#define LT7170_VIN_ON_MIN 1400 |
#define LT7170_VIN_OV_FAULT_RESPONSE 0x56 |
#define LT7170_VIN_UV_WARN_LIMIT 0x58 |
#define LT7170_VOUT_COMMAND 0x21 |
#define LT7170_VOUT_MARGIN_HIGH 0x25 |
#define LT7170_VOUT_MARGIN_LOW 0x26 |
#define LT7170_VOUT_MAX 0x24 |
#define LT7170_VOUT_MODE 0x20 |
#define LT7170_VOUT_MODE_VAL_MSK NO_OS_GENMASK(4,0) |
#define LT7170_VOUT_OV_FAULT_LIMIT 0x40 |
#define LT7170_VOUT_OV_FAULT_RESPONSE 0x41 |
#define LT7170_VOUT_OV_WARN_LIMIT 0x42 |
#define LT7170_VOUT_TRANSITION_RATE 0x27 |
#define LT7170_VOUT_UV_FAULT_LIMIT 0x44 |
#define LT7170_VOUT_UV_FAULT_RESPONSE 0x45 |
#define LT7170_VOUT_UV_WARN_LIMIT 0x43 |
#define LT7170_WRITE_PROTECT 0x10 |
#define LT7170_ZONE_ACTIVE 0x08 |
#define LT7170_ZONE_CONFIG 0x07 |
enum lt7170_chip_id |
enum lt7170_limit_type |
enum lt7170_nvm_cmd_type |
enum lt7170_pwm_mode |
enum lt7170_status_type |
enum lt7170_timing_type |
enum lt7170_value_type |
int lt7170_adc_control | ( | struct lt7170_dev * | dev, |
bool | low_freq_telemetry, | ||
bool | debug_telemetry | ||
) |
Configure ADC control.
dev | - Device structure |
low_freq_telemetry | - Enable for low frequency telemetry (every 100ms) |
debug_telemetry | - Enable for debug telemetry with EXTVcc and Ith |
int lt7170_clear_faults | ( | struct lt7170_dev * | dev | ) |
Clear all asserted faults.
dev | - Device structure |
int lt7170_init | ( | struct lt7170_dev ** | device, |
struct lt7170_init_param * | init_param | ||
) |
Initialize the device structure.
device | - Device structure |
init_param | - Initialization parameters |
int lt7170_nvm_cmd | ( | struct lt7170_dev * | dev, |
enum lt7170_nvm_cmd_type | cmd | ||
) |
Perform commands for non-volatile memory (NVM)
dev | - Device structure |
cmd | - NVM commands. Example: LT7170_LOCK_USER LT7170_UNLOCK_USER LT7170_STORE_USER LT7170_COMPARE_USER LT7170_RESTORE_USER |
int lt7170_pwm_mode | ( | struct lt7170_dev * | dev, |
enum lt7170_pwm_mode | pwm_mode | ||
) |
Set output PWM mode.
dev | - Device structure |
pwm_mode | - PWM mode of the output channel. Example: LT7170_PWM_FORCED_CONTINUOUS_MODE LT7170_PWM_PULSE_SKIP_MODE |
int lt7170_pwm_phase | ( | struct lt7170_dev * | dev, |
int | phase | ||
) |
Set output PWM phase.
dev | - Device structure |
phase | - Phase in milli-degrees |
int lt7170_read_block_data | ( | struct lt7170_dev * | dev, |
uint8_t | cmd, | ||
uint8_t * | data, | ||
size_t | nbytes | ||
) |
Perform a PMBus read block operation.
dev | - Device structure |
cmd | - PMBus command |
data | - Address of the read block |
nbytes | - Size of the block in bytes |
int lt7170_read_byte | ( | struct lt7170_dev * | dev, |
uint8_t | cmd, | ||
uint8_t * | data | ||
) |
Perform a raw PMBus read byte operation.
dev | - Device structure |
cmd | - PMBus command |
data | - Address of the byte read |
int lt7170_read_status | ( | struct lt7170_dev * | dev, |
enum lt7170_status_type | status_type, | ||
struct lt7170_status * | status | ||
) |
Read statuses.
dev | - Device structure |
status_type | - Status type. Example values: LT7170_STATUS_BYTE_TYPE LT7170_STATUS_VOUT_TYPE LT7170_STATUS_IOUT_TYPE LT7170_STATUS_INPUT_TYPE LT7170_STATUS_CML_TYPE |
status | - Address of the status structure |
int lt7170_read_value | ( | struct lt7170_dev * | dev, |
enum lt7170_value_type | value_type, | ||
int * | value | ||
) |
Read a value.
dev | - Device structure |
value_type | - Value type. Example values: LT7170_VIN LT7170_VOUT LT7170_IOUT LT7170_TEMP LT7170_FREQUENCY |
value | - Address of the read value |
int lt7170_read_word | ( | struct lt7170_dev * | dev, |
uint8_t | cmd, | ||
uint16_t * | word | ||
) |
Perform a raw PMBus read word operation.
dev | - Device structure |
cmd | - PMBus command |
word | - Address of the read word |
int lt7170_read_word_data | ( | struct lt7170_dev * | dev, |
uint8_t | cmd, | ||
int * | data | ||
) |
Perform a PMBus read word operation and converts to actual value.
dev | - Device structure |
cmd | - PMBus command |
data | - Address of data read |
int lt7170_remove | ( | struct lt7170_dev * | dev | ) |
Free or remove device instance.
dev | - The device structure |
int lt7170_send_byte | ( | struct lt7170_dev * | dev, |
uint8_t | cmd | ||
) |
Send a PMBus command to the device.
dev | - Device structure |
cmd | - PMBus command |
int lt7170_set_channel_state | ( | struct lt7170_dev * | dev, |
bool | state | ||
) |
Set channel state using the RUN pin.
dev | - Device structure |
state | - true for ON, false for OFF |
int lt7170_set_limit | ( | struct lt7170_dev * | dev, |
enum lt7170_limit_type | limit, | ||
int | limit_val | ||
) |
Set overvalue and undervalue limits.
dev | - Device structure |
limit | - Limit value type. Example: LT7170_VOUT_OV_FAULT_LIMIT_TYPE LT7170_OT_WARN_LIMIT_TYPE LT7170_TON_MAX_FAULT_LIMIT_TYPE LT7170_VIN_UV_WARN_LIMIT_TYPE |
limit_val | - Limit value in milli-units for voltage and current, and microseconds for timing. |
int lt7170_set_operation | ( | struct lt7170_dev * | dev, |
enum lt7170_operation_type | operation | ||
) |
Set channel operation.
dev | - Device structure |
operation | - Operation. Accepted values are: LT7170_OPERATION_OFF LT7170_OPERATION_ON LT7170_OPERATION_MARGIN_HIGH LT7170_OPERATION_MARGIN_LOW LT7170_OPERATION_SEQ_OFF |
int lt7170_set_timing | ( | struct lt7170_dev * | dev, |
enum lt7170_timing_type | timing_type, | ||
int | time | ||
) |
Set timing values.
dev | - Device structure |
timing_type | - Timing value type. Example: LT7170_TON_DELAY_TYPE LT7170_TON_RISE_TYPE LT7170_TOFF_DELAY_TYPE LT7170_RETRY_DELAY_TYPE |
time | - Time value in microseconds |
int lt7170_set_vin | ( | struct lt7170_dev * | dev, |
int | vin_on, | ||
int | vin_off | ||
) |
Set input voltage window at which power conversion will proceed.
dev | - Device structure |
vin_on | - Input voltage in millivolts at which conversion will start |
vin_off | - Input voltage in millivolts at which conversion will stop |
int lt7170_software_reset | ( | struct lt7170_dev * | dev | ) |
Perform a device software reset.
dev | - Device structure |
int lt7170_switch_freq | ( | struct lt7170_dev * | dev, |
int | freq | ||
) |
Set switching frequency.
dev | - Device structure |
freq | - Frequency to set in Hz. Value should be between 400000 Hz and 4000000 Hz. |
int lt7170_sync_config | ( | struct lt7170_dev * | dev, |
bool | input_clk, | ||
bool | output_clk | ||
) |
Configure SYNC pin for clock synchronization.
dev | - Device structure |
input_clk | - Enable to use SYNC clock input |
output_clk | - Enable to use SYNC output clock |
int lt7170_vout_margin | ( | struct lt7170_dev * | dev, |
int | margin_high, | ||
int | margin_low | ||
) |
Set output voltage margin.
dev | - Device structure |
margin_high | - Upper margin in millivolts |
margin_low | - Lower margin in millivolts |
int lt7170_vout_tr | ( | struct lt7170_dev * | dev, |
int | tr | ||
) |
Set output voltage transition rate.
dev | - Device structure |
tr | - Transition rate in V/s or mV/ms |
int lt7170_vout_value | ( | struct lt7170_dev * | dev, |
int | vout_command, | ||
int | vout_max | ||
) |
Set output voltage and its upper limit.
dev | - Device structure |
vout_command | - Output voltage in millivolts |
vout_max | - Output voltage upper limit in millivolts |
int lt7170_write_byte | ( | struct lt7170_dev * | dev, |
uint8_t | cmd, | ||
uint8_t | value | ||
) |
Perform a raw PMBus write byte operation.
dev | - Device structure |
cmd | - PMBus command |
value | - Byte to be written |
int lt7170_write_word | ( | struct lt7170_dev * | dev, |
uint8_t | cmd, | ||
uint16_t | word | ||
) |
Perform a raw PMBus write word operation.
dev | - Device structure |
cmd | - PMBus command |
word | - Word to write |
int lt7170_write_word_data | ( | struct lt7170_dev * | dev, |
uint8_t | cmd, | ||
int | data | ||
) |
Converts value to register data and do PMBus write word operation.
dev | - Device structure |
cmd | - PMBus command |
data | - Value to write |