Linduino  1.3.0
Linear Technology Arduino-Compatible Demonstration Board

Library for LTC4282: High Current Hot Swap Controller with I2C Compatible Monitoring and EEPROM. More...

Detailed Description

Library for LTC4282: High Current Hot Swap Controller with I2C Compatible Monitoring and EEPROM.

Definition in file LTC4282.cpp.

Go to the source code of this file.

Functions

int8_t LTC4282_write (uint8_t i2c_address, uint8_t adc_command, uint8_t code)
 Write an 8-bit code to the LTC4282. More...
 
int8_t LTC4282_write_16_bits (uint8_t i2c_address, uint8_t adc_command, uint16_t code)
 Write an 16-bit code to the LTC4282. More...
 
int8_t LTC4282_write_32_bits (uint8_t i2c_address, uint8_t adc_command, uint32_t code)
 Write an 32-bit code to the LTC4282. More...
 
int8_t LTC4282_write_48_bits (uint8_t i2c_address, uint8_t adc_command, uint64_t code)
 Write an 48-bit code to the LTC4282. More...
 
int8_t LTC4282_read (uint8_t i2c_address, uint8_t adc_command, uint8_t *adc_code)
 Read an 8-bit code from the LTC4282. More...
 
int8_t LTC4282_read_16_bits (uint8_t i2c_address, uint8_t adc_command, uint16_t *adc_code)
 Read a 16-bit code from the LTC4282. More...
 
int8_t LTC4282_read_32_bits (uint8_t i2c_address, uint8_t adc_command, uint32_t *adc_code)
 Read a 32-bit code from the LTC4282. More...
 
int8_t LTC4282_read_48_bits (uint8_t i2c_address, uint8_t adc_command, uint64_t *adc_code)
 Read a 48-bit code from the LTC4282. More...
 
float LTC4282_code_to_VGPIO (uint16_t code)
 Convert ADC code to VGPIO. More...
 
float LTC4282_code_to_voltage (uint16_t code, float fullscaleVoltage)
 Convert ADC code to voltage. More...
 
float LTC4282_code_to_current (uint16_t code, float resistor)
 Convert ADC code to current. More...
 
float LTC4282_code_to_power (uint16_t code, float fullscaleVoltage, float resistor)
 Convert ADC code to power. More...
 
float LTC4282_code_to_energy (uint64_t code, float fullscaleVoltage, float resistor, float tConv)
 Convert ADC code to energy. More...
 
float LTC4282_code_to_coulombs (uint64_t code, float resistor, float tConv)
 Convert ADC code to coulombs. More...
 
float LTC4282_code_to_avg_power (uint64_t code, float energy, float tConv)
 Convert ADC code to average power. More...
 
float LTC4282_code_to_avg_current (uint64_t code, float coulombs, float tConv)
 Convert ADC code to average current. More...
 
float LTC4282_code_to_GPIO_alarm (uint8_t code)
 Convert ADC code to GPIO alarm voltage. More...
 
float LTC4282_code_to_volt_alarm (uint8_t code, float fullscaleVoltage)
 Convert ADC code to alarm voltage. More...
 
float LTC4282_code_to_current_alarm (uint8_t code, float resistor)
 Convert ADC code to alarm current. More...
 
float LTC4282_code_to_power_alarm (uint8_t code, float fullscaleVoltage, float resistor)
 Convert ADC code to alarm power. More...
 
uint8_t LTC4282_VGPIO_to_code_alarm (float vgpio)
 Convert GPIO voltage to alarm code. More...
 
uint8_t LTC4282_volt_to_code_alarm (float volt, float fullscaleVoltage)
 Convert voltage to alarm code. More...
 
uint8_t LTC4282_current_to_code_alarm (float current, float resistor)
 Convert current to alarm code. More...
 
uint8_t LTC4282_power_to_code_alarm (float power, float resistor, float fullscaleVoltage)
 Convert power to alarm code. More...
 

Function Documentation

◆ LTC4282_code_to_avg_current()

float LTC4282_code_to_avg_current ( uint64_t  code,
float  coulombs,
float  tConv 
)

Convert ADC code to average current.

Returns
Returns floating point value of average current
Parameters
codeCode to be converted to average power
coulombsEnergy value
tConvConversion Time

Definition at line 224 of file LTC4282.cpp.

◆ LTC4282_code_to_avg_power()

float LTC4282_code_to_avg_power ( uint64_t  code,
float  energy,
float  tConv 
)

Convert ADC code to average power.

Returns
Returns floating point value of average power
Parameters
codeCode to be converted to average power
energyEnergy value
tConvConversion Time

Definition at line 216 of file LTC4282.cpp.

◆ LTC4282_code_to_coulombs()

float LTC4282_code_to_coulombs ( uint64_t  code,
float  resistor,
float  tConv 
)

Convert ADC code to coulombs.

Returns
Returns floating point value of coulombs
Parameters
codeCode to be converted to Coulombs
resistorSense Resistor Value
tConvConversion Time

Definition at line 208 of file LTC4282.cpp.

◆ LTC4282_code_to_current()

float LTC4282_code_to_current ( uint16_t  code,
float  resistor 
)

Convert ADC code to current.

Returns
Returns floating point value of current
Parameters
codeCode to be converted to current
resistorSense Resistor Value

Definition at line 185 of file LTC4282.cpp.

◆ LTC4282_code_to_current_alarm()

float LTC4282_code_to_current_alarm ( uint8_t  code,
float  resistor 
)

Convert ADC code to alarm current.

Returns
Returns floating point value of alarm current
Parameters
codeCode to be converted to current
resistorSense Resistor Value

Definition at line 248 of file LTC4282.cpp.

◆ LTC4282_code_to_energy()

float LTC4282_code_to_energy ( uint64_t  code,
float  fullscaleVoltage,
float  resistor,
float  tConv 
)

Convert ADC code to energy.

Returns
Returns floating point value of energy
Parameters
codeCode to be converted to energy
fullscaleVoltageFullscale VSOURCE Voltage
resistorSense Resistor Value
tConvConversion Time

Definition at line 200 of file LTC4282.cpp.

◆ LTC4282_code_to_GPIO_alarm()

float LTC4282_code_to_GPIO_alarm ( uint8_t  code)

Convert ADC code to GPIO alarm voltage.

Returns
Returns floating point value of GPIO alarm voltage
Parameters
codeCode to be converted to voltage

Definition at line 232 of file LTC4282.cpp.

◆ LTC4282_code_to_power()

float LTC4282_code_to_power ( uint16_t  code,
float  fullscaleVoltage,
float  resistor 
)

Convert ADC code to power.

Returns
Returns floating point value of power
Parameters
codeCode to be converted to power
fullscaleVoltageFullscale VSOURCE Voltage
resistorSense Resistor Value

Definition at line 193 of file LTC4282.cpp.

◆ LTC4282_code_to_power_alarm()

float LTC4282_code_to_power_alarm ( uint8_t  code,
float  fullscaleVoltage,
float  resistor 
)

Convert ADC code to alarm power.

Returns
Returns floating point value of alarm power
Parameters
codeCode to be converted to power
fullscaleVoltageFullscale VSOURCE voltage
resistorSense Resistor Value

Definition at line 256 of file LTC4282.cpp.

◆ LTC4282_code_to_VGPIO()

float LTC4282_code_to_VGPIO ( uint16_t  code)

Convert ADC code to VGPIO.

Returns
Returns floating point value of GPIO voltage
Parameters
codeCode to be converted to voltage

Definition at line 168 of file LTC4282.cpp.

◆ LTC4282_code_to_volt_alarm()

float LTC4282_code_to_volt_alarm ( uint8_t  code,
float  fullscaleVoltage 
)

Convert ADC code to alarm voltage.

Returns
Returns floating point value of alarm voltage
Parameters
codeCode to be converted to voltage
fullscaleVoltageFullscale VSOURCE voltage

Definition at line 240 of file LTC4282.cpp.

◆ LTC4282_code_to_voltage()

float LTC4282_code_to_voltage ( uint16_t  code,
float  fullscaleVoltage 
)

Convert ADC code to voltage.

Returns
Returns floating point value of voltage
Parameters
codeCode to be converted to voltage
fullscaleVoltageFullscale VSOURCE Voltage

Definition at line 177 of file LTC4282.cpp.

◆ LTC4282_current_to_code_alarm()

uint8_t LTC4282_current_to_code_alarm ( float  current,
float  resistor 
)

Convert current to alarm code.

Returns
Returns the ADC code of the floating point value parameter
Parameters
currentCurrent value to be converted to alarm code
resistorSense Resistor Value

Definition at line 280 of file LTC4282.cpp.

◆ LTC4282_power_to_code_alarm()

uint8_t LTC4282_power_to_code_alarm ( float  power,
float  resistor,
float  fullscaleVoltage 
)

Convert power to alarm code.

Returns
Returns the ADC code of the floating point value
Parameters
powerPower value to be converted to alarm code
resistorSense Resistor Value
fullscaleVoltageFullsvale voltage value to convert voltage into alarm code

Definition at line 288 of file LTC4282.cpp.

◆ LTC4282_read()

int8_t LTC4282_read ( uint8_t  i2c_address,
uint8_t  adc_command,
uint8_t *  adc_code 
)

Read an 8-bit code from the LTC4282.

Returns
Returns the state of the acknowledge bit after the I2C write/read. 0 = acknowledge, 1 = no acknowledge.
Parameters
i2c_addressRegister address for the LTC4282
adc_commandThe "command byte" for the LTC4282
adc_codeValue that will be read from the register

Definition at line 120 of file LTC4282.cpp.

◆ LTC4282_read_16_bits()

int8_t LTC4282_read_16_bits ( uint8_t  i2c_address,
uint8_t  adc_command,
uint16_t *  adc_code 
)

Read a 16-bit code from the LTC4282.

Returns
Returns the state of the acknowledge bit after the I2C write/read. 0 = acknowledge, 1 = no acknowledge.
Parameters
i2c_addressRegister address for the LTC4282
adc_commandThe "command byte" for the LTC4282
adc_codeValue that will be read from the

Definition at line 129 of file LTC4282.cpp.

◆ LTC4282_read_32_bits()

int8_t LTC4282_read_32_bits ( uint8_t  i2c_address,
uint8_t  adc_command,
uint32_t *  adc_code 
)

Read a 32-bit code from the LTC4282.

Returns
Returns the state of the acknowledge bit after the I2C write/read. 0 = acknowledge, 1 = no acknowledge.
Parameters
i2c_addressRegister address for the LTC4282
adc_commandThe "command byte" for the LTC4282
adc_codeValue that will be read from the

Definition at line 140 of file LTC4282.cpp.

◆ LTC4282_read_48_bits()

int8_t LTC4282_read_48_bits ( uint8_t  i2c_address,
uint8_t  adc_command,
uint64_t *  adc_code 
)

Read a 48-bit code from the LTC4282.

Returns
Returns the state of the acknowledge bit after the I2C write/read. 0 = acknowledge, 1 = no acknowledge.
Parameters
i2c_addressRegister address for the LTC4282
adc_commandThe "command byte" for the LTC4282
adc_codeValue that will be read from the

Definition at line 154 of file LTC4282.cpp.

◆ LTC4282_VGPIO_to_code_alarm()

uint8_t LTC4282_VGPIO_to_code_alarm ( float  vgpio)

Convert GPIO voltage to alarm code.

Returns
Returns the ADC code of the floating point value parameter
Parameters
vgpioVGPIO voltage to be converted to alarm code

Definition at line 264 of file LTC4282.cpp.

◆ LTC4282_volt_to_code_alarm()

uint8_t LTC4282_volt_to_code_alarm ( float  volt,
float  fullscaleVoltage 
)

Convert voltage to alarm code.

Returns
Returns the ADC code of the floating point value parameter
Parameters
voltVoltage to be converted to alarm code
fullscaleVoltageFullscale voltage value to convert voltage into alarm code

Definition at line 272 of file LTC4282.cpp.

◆ LTC4282_write()

int8_t LTC4282_write ( uint8_t  i2c_address,
uint8_t  adc_command,
uint8_t  code 
)

Write an 8-bit code to the LTC4282.

Returns
Returns the state of the acknowledge bit after the I2C write/read. 0 = acknowledge, 1 = no acknowledge.
Parameters
i2c_addressRegister address for the LTC4282
adc_commandThe "command byte" for the LTC4282
codeValue that will be written to the register

Definition at line 69 of file LTC4282.cpp.

◆ LTC4282_write_16_bits()

int8_t LTC4282_write_16_bits ( uint8_t  i2c_address,
uint8_t  adc_command,
uint16_t  code 
)

Write an 16-bit code to the LTC4282.

Returns
Returns the state of the acknowledge bit after the I2C write/read. 0 = acknowledge, 1 = no acknowledge.
Parameters
i2c_addressRegister address for the LTC4282
adc_commandThe "command byte" for the LTC4282
codeValue that will be written to the register

Definition at line 81 of file LTC4282.cpp.

◆ LTC4282_write_32_bits()

int8_t LTC4282_write_32_bits ( uint8_t  i2c_address,
uint8_t  adc_command,
uint32_t  code 
)

Write an 32-bit code to the LTC4282.

Returns
Returns the state of the acknowledge bit after the I2C write/read. 0 = acknowledge, 1 = no acknowledge.
Parameters
i2c_addressRegister address for the LTC4282
adc_commandThe "command byte" for the LTC4282
codeValue that will be written to the register

Definition at line 91 of file LTC4282.cpp.

◆ LTC4282_write_48_bits()

int8_t LTC4282_write_48_bits ( uint8_t  i2c_address,
uint8_t  adc_command,
uint64_t  code 
)

Write an 48-bit code to the LTC4282.

Returns
Returns the state of the acknowledge bit after the I2C write/read. 0 = acknowledge, 1 = no acknowledge.
Parameters
i2c_addressRegister address for the LTC4282
adc_commandThe "command byte" for the LTC4282
codeValue that will be written to the register

Definition at line 105 of file LTC4282.cpp.