no-OS
|
Go to the source code of this file.
Classes | |
struct | ltp8800_dev |
struct | ltp8800_init_param |
struct | ltp8800_status |
Enumerations | |
enum | ltp8800_value_type { LTP8800_VIN = LTP8800_READ_VIN, LTP8800_IIN = LTP8800_READ_IIN, LTP8800_VOUT = LTP8800_READ_VOUT, LTP8800_IOUT = LTP8800_READ_IOUT, LTP8800_FORWARD_DIODE_TEMP = LTP8800_READ_TEMPERATURE_2, LTP8800_REVERSE_DIODE_TEMP = LTP8800_READ_TEMPERATURE_3, LTP8800_DUTY_CYCLE = LTP8800_READ_DUTY_CYCLE, LTP8800_FREQUENCY = LTP8800_READ_FREQUENCY, LTP8800_POUT = LTP8800_READ_POUT } |
enum | ltp8800_limit_type { LTP8800_VIN_OV_FAULT_LIMIT_TYPE = LTP8800_VIN_OV_FAULT_LIMIT, LTP8800_VIN_UV_FAULT_LIMIT_TYPE = LTP8800_VIN_UV_FAULT_LIMIT, LTP8800_IIN_OC_FAULT_LIMIT_TYPE = LTP8800_IIN_OC_FAULT_LIMIT, LTP8800_POUT_OP_FAULT_LIMIT_TYPE = LTP8800_POUT_OP_FAULT_LIMIT } |
enum | ltp8800_status_type { LTP8800_STATUS_BYTE_TYPE = LTP8800_STATUS_BYTE_TYPE_MSK, LTP8800_STATUS_VOUT_TYPE = LTP8800_STATUS_VOUT_TYPE_MSK, LTP8800_STATUS_IOUT_TYPE = LTP8800_STATUS_IOUT_TYPE_MSK, LTP8800_STATUS_INPUT_TYPE = LTP8800_STATUS_INPUT_TYPE_MSK, LTP8800_STATUS_TEMP_TYPE = LTP8800_STATUS_TEMP_TYPE_MSK, LTP8800_STATUS_CML_TYPE = LTP8800_STATUS_CML_TYPE_MSK, LTP8800_STATUS_MFR_SPECIFIC_TYPE = LTP8800_STATUS_MFR_SPECIFIC_TYPE_MSK, LTP8800_STATUS_WORD_TYPE = LTP8800_STATUS_WORD_TYPE_MSK, LTP8800_STATUS_ALL_TYPE = LTP8800_STATUS_ALL_TYPE_MSK } |
enum | ltp8800_vout_settings { LTP8800_VOUT_SETTING_ADI_FACTORY = 0xB2A6, LTP8800_VOUT_SETTING_UNITY = 0xBA00 } |
Functions | |
int | ltp8800_init (struct ltp8800_dev **device, struct ltp8800_init_param *init_param) |
Initialize the device structure. More... | |
int | ltp8800_remove (struct ltp8800_dev *dev) |
Free or remove device instance. More... | |
int | ltp8800_send_byte (struct ltp8800_dev *dev, uint16_t cmd) |
Send a PMBus command to the device. More... | |
int | ltp8800_read_byte (struct ltp8800_dev *dev, uint16_t cmd, uint8_t *data) |
Perform a raw PMBus read byte operation. More... | |
int | ltp8800_write_byte (struct ltp8800_dev *dev, uint16_t cmd, uint8_t value) |
Perform a raw PMBus write byte operation. More... | |
int | ltp8800_read_word (struct ltp8800_dev *dev, uint16_t cmd, uint16_t *word) |
Perform a raw PMBus read word operation. More... | |
int | ltp8800_write_word (struct ltp8800_dev *dev, uint16_t cmd, uint16_t word) |
Perform a raw PMBus write word operation. More... | |
int | ltp8800_read_word_data (struct ltp8800_dev *dev, uint16_t cmd, int *data) |
Perform a PMBus read word operation and converts to actual value. More... | |
int | ltp8800_write_word_data (struct ltp8800_dev *dev, uint16_t cmd, int data) |
Converts value to register data and do PMBus write word operation. More... | |
int | ltp8800_read_block_data (struct ltp8800_dev *dev, uint16_t cmd, uint8_t *data, size_t nbytes) |
Perform a PMBus read block operation. More... | |
int | ltp8800_read_value (struct ltp8800_dev *dev, enum ltp8800_value_type value_type, int *value) |
Read a value. More... | |
int | ltp8800_read_status (struct ltp8800_dev *dev, enum ltp8800_status_type status_type, struct ltp8800_status *status) |
Read statuses. More... | |
int | ltp8800_vout_value (struct ltp8800_dev *dev, int vout_command) |
Set output voltage command. More... | |
int | ltp8800_vout_settings (struct ltp8800_dev *dev, enum ltp8800_vout_settings settings) |
Set output voltage and its upper limit. More... | |
int | ltp8800_set_vin (struct ltp8800_dev *dev, int vin_on, int vin_off) |
Set input voltage window at which power conversion will proceed. More... | |
int | ltp8800_set_fault_limit (struct ltp8800_dev *dev, enum ltp8800_limit_type limit, int limit_val) |
Set overvalue and undervalue limits. More... | |
int | ltp8800_sync_config (struct ltp8800_dev *dev, bool enable) |
Enable or disable sync pin. More... | |
int | ltp8800_interleave_order (struct ltp8800_dev *dev, uint8_t order) |
Set phase order for polyphase application. More... | |
int | ltp8800_loop_compensation (struct ltp8800_dev *dev, uint8_t pole, uint8_t zero, uint8_t hf_gain, uint8_t lf_gain) |
Program loop compensation for regulator transient response. More... | |
int | ltp8800_set_device_state (struct ltp8800_dev *dev, bool state) |
Set device state. More... | |
int | ltp8800_store_user_settings (struct ltp8800_dev *dev) |
Store user settings to EEPROM. More... | |
int | ltp8800_restore_user_settings (struct ltp8800_dev *dev) |
Restore user settings. More... | |
#define LTP8800_COMMAND_LSB_MSK NO_OS_GENMASK(7, 0) |
#define LTP8800_COMMAND_MSB_MSK NO_OS_GENMASK(15, 8) |
#define LTP8800_CRC_POLYNOMIAL 0x7 |
#define LTP8800_EEPROM_LOCK_VALUE 0xAB |
#define LTP8800_EEPROM_PASSWORD 0xD5 |
#define LTP8800_EEPROM_PASSWORD_VALUE 0xFF |
#define LTP8800_EXTENDED_COMMAND_BEGIN 0xFE00 |
#define LTP8800_EXTENDED_COMMAND_PREFIX 0xFE |
#define LTP8800_FREQUENCY_SWITCH 0x33 |
#define LTP8800_GO_CMD 0xFE00 |
#define LTP8800_IC_DEVICE_ID 0xAD |
#define LTP8800_IC_DEVICE_ID_VALUE {0x41, 0x55} |
#define LTP8800_IC_DEVICE_REV 0xAE |
#define LTP8800_IIN_OC_FAULT_LIMIT 0x5B |
#define LTP8800_INTERLEAVE 0x37 |
#define LTP8800_INTERLEAVE_ORDER_MSK NO_OS_GENMASK(3, 0) |
#define LTP8800_LIN11_EXPONENT | ( | x | ) | ((int16_t)(x) >> 11) |
#define LTP8800_LIN11_EXPONENT_MAX 15 |
#define LTP8800_LIN11_EXPONENT_MIN -15 |
#define LTP8800_LIN11_EXPONENT_MSK NO_OS_GENMASK(15,11) |
#define LTP8800_LIN11_MANTISSA | ( | x | ) | (((int16_t)((x & 0x7FF) << 5)) >> 5) |
#define LTP8800_LIN11_MANTISSA_MAX 1023L |
#define LTP8800_LIN11_MANTISSA_MIN 511L |
#define LTP8800_LIN11_MANTISSA_MSK NO_OS_GENMASK(10,0) |
#define LTP8800_LIN16_EXPONENT -14 |
#define LTP8800_MAX_INTERLEAVE_ORDER 0xF |
#define LTP8800_MFR_ID 0x99 |
#define LTP8800_MFR_MODEL 0x9A |
#define LTP8800_MFR_REVISION 0x9B |
#define LTP8800_MFR_SERIAL 0x9E |
#define LTP8800_NM_DIGFILT_HF_GAIN 0xFE04 |
#define LTP8800_NM_DIGFILT_LF_GAIN 0xFE01 |
#define LTP8800_NM_DIGFILT_POLE 0xFE03 |
#define LTP8800_NM_DIGFILT_ZERO 0xFE02 |
#define LTP8800_OPERATION 0x01 |
#define LTP8800_PAGE 0x00 |
#define LTP8800_POUT_OP_FAULT_LIMIT 0x68 |
#define LTP8800_READ_DUTY_CYCLE 0x94 |
#define LTP8800_READ_FREQUENCY 0x95 |
#define LTP8800_READ_IIN 0x89 |
#define LTP8800_READ_IOUT 0x8C |
#define LTP8800_READ_POUT 0x96 |
#define LTP8800_READ_TEMPERATURE_2 0x8E |
#define LTP8800_READ_TEMPERATURE_3 0x8F |
#define LTP8800_READ_VIN 0x88 |
#define LTP8800_READ_VOUT 0x8B |
#define LTP8800_RESTORE_USER_ALL 0x16 |
#define LTP8800_REVISION 0x98 |
#define LTP8800_STATE_OFF 0 |
#define LTP8800_STATE_ON 1 |
#define LTP8800_STATUS_ALL_TYPE_MSK 0xFF |
#define LTP8800_STATUS_BYTE 0x78 |
#define LTP8800_STATUS_BYTE_TYPE_MSK 0x01 |
#define LTP8800_STATUS_CML 0x7E |
#define LTP8800_STATUS_CML_TYPE_MSK 0x20 |
#define LTP8800_STATUS_INPUT 0x7C |
#define LTP8800_STATUS_INPUT_TYPE_MSK 0x08 |
#define LTP8800_STATUS_IOUT 0x7B |
#define LTP8800_STATUS_IOUT_TYPE_MSK 0x04 |
#define LTP8800_STATUS_MFR_SPECIFIC 0x80 |
#define LTP8800_STATUS_MFR_SPECIFIC_TYPE_MSK 0x40 |
#define LTP8800_STATUS_OTHER 0x7F |
#define LTP8800_STATUS_TEMP_TYPE_MSK 0x10 |
#define LTP8800_STATUS_TEMPERATURE 0x7D |
#define LTP8800_STATUS_VOUT 0x7A |
#define LTP8800_STATUS_VOUT_TYPE_MSK 0x02 |
#define LTP8800_STATUS_WORD 0x79 |
#define LTP8800_STATUS_WORD_TYPE_MSK 0x80 |
#define LTP8800_STORE_USER_ALL 0x15 |
#define LTP8800_SYNC 0xFE55 |
#define LTP8800_SYNC_ENABLE_BIT NO_OS_BIT(6) |
#define LTP8800_SYNC_LATCH_BIT NO_OS_BIT(6) |
#define LTP8800_VIN_OFF 0x36 |
#define LTP8800_VIN_ON 0x35 |
#define LTP8800_VIN_OV_FAULT_LIMIT 0x55 |
#define LTP8800_VIN_UV_FAULT_LIMIT 0x59 |
#define LTP8800_VOUT_COMMAND 0x21 |
#define LTP8800_VOUT_COMMAND_DEFAULT 0x3000 |
#define LTP8800_VOUT_COMMAND_MAX 1100 |
#define LTP8800_VOUT_COMMAND_MIN 500 |
#define LTP8800_VOUT_MODE 0x20 |
#define LTP8800_VOUT_MODE_VAL_MSK NO_OS_GENMASK(4,0) |
#define LTP8800_VOUT_SCALE_LOOP 0x29 |
#define LTP8800_VOUT_SCALE_MONITOR 0x2A |
#define LTP8800_WRITE_PROTECT 0x10 |
#define LTP8800_WRITE_PROTECT_1_BIT NO_OS_BIT(7) |
#define LTP8800_WRITE_PROTECT_2_BIT NO_OS_BIT(6) |
#define LTP8800_WRITE_PROTECT_3_BIT NO_OS_BIT(5) |
enum ltp8800_limit_type |
enum ltp8800_status_type |
enum ltp8800_value_type |
int ltp8800_init | ( | struct ltp8800_dev ** | device, |
struct ltp8800_init_param * | init_param | ||
) |
Initialize the device structure.
device | - Device structure |
init_param | - Initialization parameters |
int ltp8800_interleave_order | ( | struct ltp8800_dev * | dev, |
uint8_t | order | ||
) |
Set phase order for polyphase application.
dev | - Device structure |
order | - Order number. The resulting phase offset of the device is equivalent to this value multiplied by 22.5 degrees. |
int ltp8800_loop_compensation | ( | struct ltp8800_dev * | dev, |
uint8_t | pole, | ||
uint8_t | zero, | ||
uint8_t | hf_gain, | ||
uint8_t | lf_gain | ||
) |
Program loop compensation for regulator transient response.
dev | - Device structure |
pole | - Pole setting |
zero | - Zero setting |
hf_gain | - High frequency gain setting |
lf_gain | - Low frequence gain setting |
int ltp8800_read_block_data | ( | struct ltp8800_dev * | dev, |
uint16_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 ltp8800_read_byte | ( | struct ltp8800_dev * | dev, |
uint16_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 ltp8800_read_status | ( | struct ltp8800_dev * | dev, |
enum ltp8800_status_type | status_type, | ||
struct ltp8800_status * | status | ||
) |
Read statuses.
dev | - Device structure |
status_type | - Status type. Example values: LTP8800_STATUS_BYTE_TYPE LTP8800_STATUS_VOUT_TYPE LTP8800_STATUS_IOUT_TYPE LTP8800_STATUS_INPUT_TYPE LTP8800_STATUS_CML_TYPE |
status | - Address of the status structure |
int ltp8800_read_value | ( | struct ltp8800_dev * | dev, |
enum ltp8800_value_type | value_type, | ||
int * | value | ||
) |
Read a value.
dev | - Device structure |
value_type | - Value type. Example values: LTP8800_VIN LTP8800_VOUT LTP8800_IIN LTP8800_IOUT LTP8800_TEMP LTP8800_FREQUENCY |
value | - Address of the read value |
int ltp8800_read_word | ( | struct ltp8800_dev * | dev, |
uint16_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 ltp8800_read_word_data | ( | struct ltp8800_dev * | dev, |
uint16_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 ltp8800_remove | ( | struct ltp8800_dev * | dev | ) |
Free or remove device instance.
dev | - The device structure |
int ltp8800_restore_user_settings | ( | struct ltp8800_dev * | dev | ) |
Restore user settings.
dev | - Device structure |
int ltp8800_send_byte | ( | struct ltp8800_dev * | dev, |
uint16_t | cmd | ||
) |
Send a PMBus command to the device.
dev | - Device structure |
cmd | - PMBus command |
int ltp8800_set_device_state | ( | struct ltp8800_dev * | dev, |
bool | state | ||
) |
Set device state.
dev | - Device structure |
state | - Set to true to enable device, false to disable |
int ltp8800_set_fault_limit | ( | struct ltp8800_dev * | dev, |
enum ltp8800_limit_type | limit, | ||
int | limit_val | ||
) |
Set overvalue and undervalue limits.
dev | - Device structure |
limit | - Limit value type. Example: LTP8800_VIN_OV_FAULT_LIMIT_TYPE LTP8800_VIN_UV_FAULT_LIMIT_TYPE LTP8800_IIN_OC_FAULT_LIMIT_TYPE LTP8800_POUT_OP_FAULT_LIMIT_TYPE |
limit_val | - Limit value in milli-units for voltage and current, and microseconds for timing. |
int ltp8800_set_vin | ( | struct ltp8800_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 ltp8800_store_user_settings | ( | struct ltp8800_dev * | dev | ) |
Store user settings to EEPROM.
dev | - Device structure |
int ltp8800_sync_config | ( | struct ltp8800_dev * | dev, |
bool | enable | ||
) |
Enable or disable sync pin.
dev | - Device structure |
enable | - Set to true to enable, or false to disable |
int ltp8800_vout_settings | ( | struct ltp8800_dev * | dev, |
enum ltp8800_vout_settings | settings | ||
) |
Set output voltage and its upper limit.
dev | - Device structure |
settings | - Gain settings |
int ltp8800_vout_value | ( | struct ltp8800_dev * | dev, |
int | vout_command | ||
) |
Set output voltage command.
dev | - Device structure |
vout_command | - Output voltage in millivolts |
int ltp8800_write_byte | ( | struct ltp8800_dev * | dev, |
uint16_t | cmd, | ||
uint8_t | value | ||
) |
Perform a raw PMBus write byte operation.
dev | - Device structure |
cmd | - PMBus command |
value | - Byte to be written |
int ltp8800_write_word | ( | struct ltp8800_dev * | dev, |
uint16_t | cmd, | ||
uint16_t | word | ||
) |
Perform a raw PMBus write word operation.
dev | - Device structure |
cmd | - PMBus command |
word | - Word to write |
int ltp8800_write_word_data | ( | struct ltp8800_dev * | dev, |
uint16_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 |