| Linduino 1.3.0 Linear Technology Arduino-Compatible Demonstration Board

Functions
LTC4282.cpp File Reference
Hot Swap » LTC4282: High Current Hot Swap Controller with I2C Compatible Monitoring and EEPROM

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

  code | Code to be converted to average power
  coulombs | Energy value
  tConv | Conversion 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

  code | Code to be converted to average power
  energy | Energy value
  tConv | Conversion 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

  code | Code to be converted to Coulombs
  resistor | Sense Resistor Value
  tConv | Conversion 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

  code | Code to be converted to current
  resistor | Sense 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

  code | Code to be converted to current
  resistor | Sense 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

  code | Code to be converted to energy
  fullscaleVoltage | Fullscale VSOURCE Voltage
  resistor | Sense Resistor Value
  tConv | Conversion 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

  code | Code 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

  code | Code to be converted to power
  fullscaleVoltage | Fullscale VSOURCE Voltage
  resistor | Sense 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

  code | Code to be converted to power
  fullscaleVoltage | Fullscale VSOURCE voltage
  resistor | Sense 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

  code | Code 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

  code | Code to be converted to voltage
  fullscaleVoltage | Fullscale 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

  code | Code to be converted to voltage
  fullscaleVoltage | Fullscale 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

  current | Current value to be converted to alarm code
  resistor | Sense 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

  power | Power value to be converted to alarm code
  resistor | Sense Resistor Value
  fullscaleVoltage | Fullsvale 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_address | Register address for the LTC4282
  adc_command | The "command byte" for the LTC4282
  adc_code | Value 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_address | Register address for the LTC4282
  adc_command | The "command byte" for the LTC4282
  adc_code | Value 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_address | Register address for the LTC4282
  adc_command | The "command byte" for the LTC4282
  adc_code | Value 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_address | Register address for the LTC4282
  adc_command | The "command byte" for the LTC4282
  adc_code | Value 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

  vgpio | VGPIO 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

  volt | Voltage to be converted to alarm code
  fullscaleVoltage | Fullscale 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_address | Register address for the LTC4282
  adc_command | The "command byte" for the LTC4282
  code | Value 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_address | Register address for the LTC4282
  adc_command | The "command byte" for the LTC4282
  code | Value 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_address | Register address for the LTC4282
  adc_command | The "command byte" for the LTC4282
  code | Value 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_address | Register address for the LTC4282
  adc_command | The "command byte" for the LTC4282
  code | Value that will be written to the register

Definition at line 105 of file LTC4282.cpp.