no-OS
|
Header file of the LTM4686 driver. More...
Go to the source code of this file.
Classes | |
struct | ltm4686_dev |
struct | ltm4686_init_param |
struct | ltm4686_chip_info |
struct | ltm4686_status |
Functions | |
int | ltm4686_init (struct ltm4686_dev **device, struct ltm4686_init_param *init_param) |
Initialize the device structure. More... | |
int | ltm4686_remove (struct ltm4686_dev *dev) |
Free or remove device instance. More... | |
int | ltm4686_set_page (struct ltm4686_dev *dev, int page) |
Set page of the device. Page 0x0 - Channel 0 Page 0x1 - Channel 1 Page 0x2 - Channel 2 Page 0x3 - Channel 3 Page 0xff - All channels. More... | |
int | ltm4686_send_byte (struct ltm4686_dev *dev, int page, uint8_t cmd) |
Send a PMBus command to the device. More... | |
int | ltm4686_read_byte (struct ltm4686_dev *dev, int page, uint8_t cmd, uint8_t *data) |
Perform a raw PMBus read byte operation. More... | |
int | ltm4686_write_byte (struct ltm4686_dev *dev, int page, uint8_t cmd, uint8_t value) |
Perform a raw PMBus write byte operation. More... | |
int | ltm4686_read_word (struct ltm4686_dev *dev, int page, uint8_t cmd, uint16_t *word) |
Perform a raw PMBus read word operation. More... | |
int | ltm4686_write_word (struct ltm4686_dev *dev, int page, uint8_t cmd, uint16_t word) |
Perform a raw PMBus write word operation. More... | |
int | ltm4686_read_word_data (struct ltm4686_dev *dev, int page, uint8_t cmd, int *data) |
Perform a PMBus read word operation and converts to actual value. More... | |
int | ltm4686_write_word_data (struct ltm4686_dev *dev, int page, uint8_t cmd, int data) |
Converts value to register data and do PMBus write word operation. More... | |
int | ltm4686_read_block_data (struct ltm4686_dev *dev, int page, uint8_t cmd, uint8_t *data, size_t nbytes) |
Perform a PMBus read block operation. More... | |
int | ltm4686_read_value (struct ltm4686_dev *dev, uint8_t channel, enum ltm4686_value_type value_type, int *value) |
Read a value. More... | |
int | ltm4686_read_status (struct ltm4686_dev *dev, uint8_t channel, enum ltm4686_status_type status_type, struct ltm4686_status *status) |
Read statuses. More... | |
int | ltm4686_vout_value (struct ltm4686_dev *dev, uint8_t channel, int vout_command, int vout_max) |
Set output voltage and its upper limit. More... | |
int | ltm4686_vout_tr (struct ltm4686_dev *dev, uint8_t channel, int tr) |
Set output voltage transition rate. More... | |
int | ltm4686_vout_margin (struct ltm4686_dev *dev, uint8_t channel, int margin_low, int margin_high) |
Set output voltage margin. More... | |
int | ltm4686_set_vin (struct ltm4686_dev *dev, int vin_on, int vin_off) |
Set input voltage window at which power conversion will proceed. More... | |
int | ltm4686_set_timing (struct ltm4686_dev *dev, uint8_t channel, enum ltm4686_timing_type timing_type, int time) |
Set timing values. More... | |
int | ltm4686_switch_freq (struct ltm4686_dev *dev, enum ltm4686_freq freq) |
Set switching frequency. More... | |
int | ltm4686_pwm_mode (struct ltm4686_dev *dev, uint8_t channel, enum ltm4686_pwm_mode pwm_mode) |
Sets the PWM mode for a specific channel of the LTM4686 device. More... | |
int | ltm4686_set_operation (struct ltm4686_dev *dev, uint8_t channel, enum ltm4686_operation_type operation) |
Set channel operation. More... | |
int | ltm4686_nvm_cmd (struct ltm4686_dev *dev, enum ltm4686_nvm_cmd_type cmd) |
Perform commands for non-volatile memory/EEPROM. More... | |
int | ltm4686_software_reset (struct ltm4686_dev *dev) |
Perform a device software reset. More... | |
Header file of the LTM4686 driver.
Copyright 2024(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:
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.
#define LTM4673_MFR_CONFIG2 0xD9 |
#define LTM4673_MFR_CONFIG3 0xDA |
#define LTM4673_MFR_DAC 0xE0 |
#define LTM4673_MFR_FAULT_LOG_RESTORE 0xEB |
#define LTM4673_MFR_FAULT_LOG_STATUS 0xED |
#define LTM4673_MFR_FAULTB0_PROPAGATE 0xD2 |
#define LTM4673_MFR_FAULTB0_RESPONSE 0xD5 |
#define LTM4673_MFR_FAULTB1_PROPAGATE 0xD3 |
#define LTM4673_MFR_FAULTB1_RESPONSE 0xD6 |
#define LTM4673_MFR_IIN_CAL_GAIN 0xE8 |
#define LTM4673_MFR_IOUT_MIN 0xD8 |
#define LTM4673_MFR_IOUT_SENSE_VOLTAGE 0xFA |
#define LTM4673_MFR_PAGE_FF_MASK 0xE4 |
#define LTM4673_MFR_PGD_ASSERTION_DELAY 0xE1 |
#define LTM4673_MFR_PWRGD_ENABLE 0xD4 |
#define LTM4673_MFR_RETRY_COUNT 0xF7 |
#define LTM4673_MFR_TEMPERATURE_1_MIN 0xFD |
#define LTM4673_MFR_VIN_MIN 0xFC |
#define LTM4673_MFR_VOUT_DISCHARGE_THRESHOLD 0xE9 |
#define LTM4673_MFR_VOUT_MIN 0xFB |
#define LTM4673_MFR_WATCHDOG_T 0xE3 |
#define LTM4673_MFR_WATCHDOG_T_FIRST 0xE2 |
#define LTM4673_SPECIAL_ID_VALUE_REV_1 0x0230 |
#define LTM4673_SPECIAL_ID_VALUE_REV_2 0x4480 |
#define LTM4686_CAPABILITY 0x19 |
#define LTM4686_CHAN_0 0x0 |
#define LTM4686_CHAN_1 0x1 |
#define LTM4686_CHAN_2 0x2 |
#define LTM4686_CHAN_3 0x3 |
#define LTM4686_CHAN_ALL 0xFF |
#define LTM4686_CLEAR_FAULTS 0x03 |
#define LTM4686_CONFIG_ALL_DIS_SYNC_BIT NO_OS_BIT(4) |
#define LTM4686_CONFIG_ALL_PEC_BIT NO_OS_BIT(2) |
#define LTM4686_CRC_POLYNOMIAL 0x7 |
#define LTM4686_FREQUENCY_SWITCH 0x33 |
#define LTM4686_ID_MSK 0xFFF0 |
#define LTM4686_IIN_OC_WARN_LIMIT 0x5D |
#define LTM4686_IOUT_CAL_GAIN 0x38 |
#define LTM4686_IOUT_OC_FAULT_LIMIT 0x46 |
#define LTM4686_IOUT_OC_FAULT_RESPONSE 0x47 |
#define LTM4686_IOUT_OC_WARN_LIMIT 0x4A |
#define LTM4686_LIN11_EXPONENT | ( | x | ) | ((int16_t)(x) >> 11) |
#define LTM4686_LIN11_EXPONENT_MAX 15 |
#define LTM4686_LIN11_EXPONENT_MIN -15 |
#define LTM4686_LIN11_EXPONENT_MSK NO_OS_GENMASK(15,11) |
#define LTM4686_LIN11_MANTISSA | ( | x | ) | (((int16_t)((x & 0x7FF) << 5)) >> 5) |
#define LTM4686_LIN11_MANTISSA_MAX 1023L |
#define LTM4686_LIN11_MANTISSA_MIN 511L |
#define LTM4686_LIN11_MANTISSA_MSK NO_OS_GENMASK(10,0) |
#define LTM4686_LIN16_EXPONENT -12 |
#define LTM4686_MFR_ADC_CONTROL 0xD8 |
#define LTM4686_MFR_ADC_TELEMETRY_STATUS 0xDA |
#define LTM4686_MFR_ADDRESS 0xE6 |
#define LTM4686_MFR_CHAN_CONFIG 0xD0 |
#define LTM4686_MFR_CLEAR_PEAKS 0xE3 |
#define LTM4686_MFR_COMMON 0xEF |
#define LTM4686_MFR_COMPARE_USER_ALL 0xF0 |
#define LTM4686_MFR_CONFIG_ALL 0xD1 |
#define LTM4686_MFR_EE_DATA 0xBF |
#define LTM4686_MFR_EE_ERASE 0xBE |
#define LTM4686_MFR_EE_UNLOCK 0xBD |
#define LTM4686_MFR_FAULT_LOG 0xEE |
#define LTM4686_MFR_FAULT_LOG_CLEAR 0xEC |
#define LTM4686_MFR_FAULT_LOG_STORE 0xEA |
#define LTM4686_MFR_GPIO_PROPAGATE 0xD2 |
#define LTM4686_MFR_GPIO_RESPONSE 0xD5 |
#define LTM4686_MFR_ID 0x99 |
#define LTM4686_MFR_IIN_OFFSET 0xE9 |
#define LTM4686_MFR_INFO 0xB6 |
#define LTM4686_MFR_IOUT_CAL_GAIN_TC 0xF6 |
#define LTM4686_MFR_IOUT_PEAK 0xD7 |
#define LTM4686_MFR_MODEL 0x9A |
#define LTM4686_MFR_OT_FAULT_RESPONSE 0xD6 |
#define LTM4686_MFR_PADS 0xE5 |
#define LTM4686_MFR_PWM_CONFIG 0xF5 |
#define LTM4686_MFR_PWM_MODE 0xD4 |
#define LTM4686_MFR_RAIL_ADDRESS 0xFA |
#define LTM4686_MFR_READ_IIN 0xED |
#define LTM4686_MFR_RESET 0xFD |
#define LTM4686_MFR_RESTART_DELAY 0xDC |
#define LTM4686_MFR_RETRY_DELAY 0xDB |
#define LTM4686_MFR_SERIAL 0x9E |
#define LTM4686_MFR_SPECIAL_ID 0xE7 |
#define LTM4686_MFR_TEMP_1_GAIN 0xF8 |
#define LTM4686_MFR_TEMP_1_OFFSET 0xF9 |
#define LTM4686_MFR_TEMPERATURE_1_PEAK 0xDF |
#define LTM4686_MFR_TEMPERATURE_2_PEAK 0xF4 |
#define LTM4686_MFR_USER_DATA_00 0xB0 |
#define LTM4686_MFR_USER_DATA_01 0xB1 |
#define LTM4686_MFR_USER_DATA_02 0xB2 |
#define LTM4686_MFR_USER_DATA_03 0xB3 |
#define LTM4686_MFR_USER_DATA_04 0xB4 |
#define LTM4686_MFR_VIN_PEAK 0xDE |
#define LTM4686_MFR_VOUT_MAX 0xA5 |
#define LTM4686_MFR_VOUT_PEAK 0xDD |
#define LTM4686_ON_OFF_CONFIG 0x02 |
#define LTM4686_OPERATION 0x01 |
#define LTM4686_OT_FAULT_LIMIT 0x4F |
#define LTM4686_OT_FAULT_RESPONSE 0x50 |
#define LTM4686_OT_WARN_LIMIT 0x51 |
#define LTM4686_PAGE 0x00 |
#define LTM4686_PAGE_PLUS_READ 0x06 |
#define LTM4686_PAGE_PLUS_WRITE 0x05 |
#define LTM4686_PWM_OP_MODE_BIT NO_OS_BIT(0) |
#define LTM4686_READ_DUTY_CYCLE 0x94 |
#define LTM4686_READ_IIN 0x89 |
#define LTM4686_READ_IOUT 0x8C |
#define LTM4686_READ_POUT 0x96 |
#define LTM4686_READ_TEMPERATURE_1 0x8D |
#define LTM4686_READ_TEMPERATURE_2 0x8E |
#define LTM4686_READ_VIN 0x88 |
#define LTM4686_READ_VOUT 0x8B |
#define LTM4686_RESTORE_USER_ALL 0x16 |
#define LTM4686_REVISION 0x98 |
#define LTM4686_SMBALERT_MASK 0x1B |
#define LTM4686_SPECIAL_ID_VALUE 0x4770 |
#define LTM4686_STATUS_ALL_TYPE_MSK 0xFF |
#define LTM4686_STATUS_BYTE 0x78 |
#define LTM4686_STATUS_BYTE_TYPE_MSK 0x01 |
#define LTM4686_STATUS_CML 0x7E |
#define LTM4686_STATUS_CML_TYPE_MSK 0x20 |
#define LTM4686_STATUS_INPUT 0x7C |
#define LTM4686_STATUS_INPUT_TYPE_MSK 0x08 |
#define LTM4686_STATUS_IOUT 0x7B |
#define LTM4686_STATUS_IOUT_TYPE_MSK 0x04 |
#define LTM4686_STATUS_MFR_SPECIFIC 0x80 |
#define LTM4686_STATUS_MFR_SPECIFIC_TYPE_MSK 0x40 |
#define LTM4686_STATUS_TEMP_TYPE_MSK 0x10 |
#define LTM4686_STATUS_TEMPERATURE 0x7D |
#define LTM4686_STATUS_VOUT 0x7A |
#define LTM4686_STATUS_VOUT_TYPE_MSK 0x02 |
#define LTM4686_STATUS_WORD 0x79 |
#define LTM4686_STATUS_WORD_TYPE_MSK 0x80 |
#define LTM4686_STORE_USER_ALL 0x15 |
#define LTM4686_TOFF_DELAY 0x64 |
#define LTM4686_TOFF_FALL 0x65 |
#define LTM4686_TOFF_MAX_WARN_LIMIT 0x66 |
#define LTM4686_TON_DELAY 0x60 |
#define LTM4686_TON_MAX_FAULT_LIMIT 0x62 |
#define LTM4686_TON_MAX_FAULT_RESPONSE 0x63 |
#define LTM4686_TON_RISE 0x61 |
#define LTM4686_UT_FAULT_LIMIT 0x53 |
#define LTM4686_UT_FAULT_RESPONSE 0x54 |
#define LTM4686_VIN_OFF 0x36 |
#define LTM4686_VIN_ON 0x35 |
#define LTM4686_VIN_OV_FAULT_LIMIT 0x55 |
#define LTM4686_VIN_OV_FAULT_RESPONSE 0x56 |
#define LTM4686_VIN_UV_WARN_LIMIT 0x58 |
#define LTM4686_VOUT_COMMAND 0x21 |
#define LTM4686_VOUT_MARGIN_HIGH 0x25 |
#define LTM4686_VOUT_MARGIN_LOW 0x26 |
#define LTM4686_VOUT_MAX 0x24 |
#define LTM4686_VOUT_MODE 0x20 |
#define LTM4686_VOUT_MODE_VAL_MSK NO_OS_GENMASK(4,0) |
#define LTM4686_VOUT_OV_FAULT_LIMIT 0x40 |
#define LTM4686_VOUT_OV_FAULT_RESPONSE 0x41 |
#define LTM4686_VOUT_OV_WARN_LIMIT 0x42 |
#define LTM4686_VOUT_TRANSITION_RATE 0x27 |
#define LTM4686_VOUT_UV_FAULT_LIMIT 0x44 |
#define LTM4686_VOUT_UV_FAULT_RESPONSE 0x45 |
#define LTM4686_VOUT_UV_WARN_LIMIT 0x43 |
#define LTM4686_WRITE_PROTECT 0x10 |
enum ltm4686_chip_id |
enum ltm4686_freq |
enum ltm4686_nvm_cmd_type |
enum ltm4686_pwm_mode |
enum ltm4686_status_type |
enum ltm4686_timing_type |
enum ltm4686_value_type |
int ltm4686_init | ( | struct ltm4686_dev ** | device, |
struct ltm4686_init_param * | init_param | ||
) |
Initialize the device structure.
device | - Device structure |
init_param | - Initialization parameters |
int ltm4686_nvm_cmd | ( | struct ltm4686_dev * | dev, |
enum ltm4686_nvm_cmd_type | cmd | ||
) |
Perform commands for non-volatile memory/EEPROM.
dev | - Device structure |
cmd | - NVM commands. Example: LTM4686_STORE_USER LTM4686_COMPARE_USER LTM4686_RESTORE_USER |
int ltm4686_pwm_mode | ( | struct ltm4686_dev * | dev, |
uint8_t | channel, | ||
enum ltm4686_pwm_mode | pwm_mode | ||
) |
Sets the PWM mode for a specific channel of the LTM4686 device.
dev | The LTM4686 device structure. |
channel | The channel number. |
pwm_mode | The PWM mode to be set. |
int ltm4686_read_block_data | ( | struct ltm4686_dev * | dev, |
int | page, | ||
uint8_t | cmd, | ||
uint8_t * | data, | ||
size_t | nbytes | ||
) |
Perform a PMBus read block operation.
dev | - Device structure |
page | - Page/channel of the command |
cmd | - PMBus command |
data | - Address of the read block |
nbytes | - Size of the block in bytes |
int ltm4686_read_byte | ( | struct ltm4686_dev * | dev, |
int | page, | ||
uint8_t | cmd, | ||
uint8_t * | data | ||
) |
Perform a raw PMBus read byte operation.
dev | - Device structure |
page | - Page or channel of the command |
cmd | - PMBus command |
data | - Address of the byte read |
int ltm4686_read_status | ( | struct ltm4686_dev * | dev, |
uint8_t | channel, | ||
enum ltm4686_status_type | status_type, | ||
struct ltm4686_status * | status | ||
) |
Read statuses.
dev | - Device structure |
channel | - Channel of the status to read |
status_type | - Status type. Example values: LTM4686_STATUS_BYTE_TYPE LTM4686_STATUS_VOUT_TYPE LTM4686_STATUS_IOUT_TYPE LTM4686_STATUS_INPUT_TYPE LTM4686_STATUS_CML_TYPE |
status | - Address of the status structure |
int ltm4686_read_value | ( | struct ltm4686_dev * | dev, |
uint8_t | channel, | ||
enum ltm4686_value_type | value_type, | ||
int * | value | ||
) |
Read a value.
dev | - Device structure |
channel | - Channel selected |
value_type | - Value type. Example values: LTM4686_VIN LTM4686_VOUT LTM4686_IIN LTM4686_IOUT LTM4686_TEMP |
value | - Address of the read value |
int ltm4686_read_word | ( | struct ltm4686_dev * | dev, |
int | page, | ||
uint8_t | cmd, | ||
uint16_t * | word | ||
) |
Perform a raw PMBus read word operation.
dev | - Device structure |
page | - Page/channel of the command |
cmd | - PMBus command |
word | - Address of the read word |
int ltm4686_read_word_data | ( | struct ltm4686_dev * | dev, |
int | page, | ||
uint8_t | cmd, | ||
int * | data | ||
) |
Perform a PMBus read word operation and converts to actual value.
dev | - Device structure |
page | - Page/channel of the command |
cmd | - PMBus command |
data | - Address of data read |
int ltm4686_remove | ( | struct ltm4686_dev * | dev | ) |
Free or remove device instance.
dev | - The device structure |
int ltm4686_send_byte | ( | struct ltm4686_dev * | dev, |
int | page, | ||
uint8_t | cmd | ||
) |
Send a PMBus command to the device.
dev | - Device structure |
page | - Page or channel of the command |
cmd | - PMBus command |
int ltm4686_set_operation | ( | struct ltm4686_dev * | dev, |
uint8_t | channel, | ||
enum ltm4686_operation_type | operation | ||
) |
Set channel operation.
dev | - Device structure |
channel | - Channel |
operation | - Operation. Accepted values are: LTM4686_OPERATION_OFF LTM4686_OPERATION_ON LTM4686_OPERATION_MARGIN_HIGH LTM4686_OPERATION_MARGIN_LOW LTM4686_OPERATION_SEQ_OFF |
int ltm4686_set_page | ( | struct ltm4686_dev * | dev, |
int | page | ||
) |
Set page of the device. Page 0x0 - Channel 0 Page 0x1 - Channel 1 Page 0x2 - Channel 2 Page 0x3 - Channel 3 Page 0xff - All channels.
dev | - Device structure |
page | - Page to set |
int ltm4686_set_timing | ( | struct ltm4686_dev * | dev, |
uint8_t | channel, | ||
enum ltm4686_timing_type | timing_type, | ||
int | time | ||
) |
Set timing values.
dev | - Device structure |
channel | - Channel |
timing_type | - Timing value type. Example: LTM4686_TON_DELAY_TYPE LTM4686_TON_RISE_TYPE LTM4686_TOFF_DELAY_TYPE LTM4686_RETRY_DELAY_TYPE |
time | - Time value in microseconds |
int ltm4686_set_vin | ( | struct ltm4686_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 ltm4686_software_reset | ( | struct ltm4686_dev * | dev | ) |
Perform a device software reset.
dev | - Device structure |
int ltm4686_switch_freq | ( | struct ltm4686_dev * | dev, |
enum ltm4686_freq | freq | ||
) |
Set switching frequency.
dev | - Device structure |
freq | - Frequency to set. |
int ltm4686_vout_margin | ( | struct ltm4686_dev * | dev, |
uint8_t | channel, | ||
int | margin_low, | ||
int | margin_high | ||
) |
Set output voltage margin.
dev | - Device structure |
channel | - Channel |
margin_high | - Upper margin in millivolts |
margin_low | - Lower margin in millivolts |
int ltm4686_vout_tr | ( | struct ltm4686_dev * | dev, |
uint8_t | channel, | ||
int | tr | ||
) |
Set output voltage transition rate.
dev | - Device structure |
channel | - Channel |
tr | - Transition rate in microV/ms |
int ltm4686_vout_value | ( | struct ltm4686_dev * | dev, |
uint8_t | channel, | ||
int | vout_command, | ||
int | vout_max | ||
) |
Set output voltage and its upper limit.
dev | - Device structure |
channel | - Channel |
vout_command | - Output voltage in millivolts |
vout_max | - Output voltage upper limit in millivolts |
int ltm4686_write_byte | ( | struct ltm4686_dev * | dev, |
int | page, | ||
uint8_t | cmd, | ||
uint8_t | value | ||
) |
Perform a raw PMBus write byte operation.
dev | - Device structure |
page | - Page/channel of the command |
cmd | - PMBus command |
value | - Byte to be written |
int ltm4686_write_word | ( | struct ltm4686_dev * | dev, |
int | page, | ||
uint8_t | cmd, | ||
uint16_t | word | ||
) |
Perform a raw PMBus write word operation.
dev | - Device structure |
page | - Page/channel of the command |
cmd | - PMBus command |
word | - Word to write |
int ltm4686_write_word_data | ( | struct ltm4686_dev * | dev, |
int | page, | ||
uint8_t | cmd, | ||
int | data | ||
) |
Converts value to register data and do PMBus write word operation.
dev | - Device structure |
page | - Page/channel of the command |
cmd | - PMBus command |
data | - Value to write |