| Linduino 1.3.0 Linear Technology Arduino-Compatible Demonstration Board

Functions | Macros
LTC6115.h File Reference
Power Monitors and Coulomb Counters » LTC6115: High-Voltage High Side Current and Voltage Sense

LTC6115 High Voltage High Side Current and Voltage Sense. More...

## Detailed Description

LTC6115 High Voltage High Side Current and Voltage Sense.

    The LTC6115 is a versatile combination of a high voltage, high side current
    sense amplifier and a voltage sense amplifier.

https://www.analog.com/en/products/ltc6115.html

Copyright 2018(c) Analog Devices, Inc.

All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
- Neither the name of Analog Devices, Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
- The use of this software may or may not infringe the patent rights of one or more patent holders. This license does not release you from the requirement that you obtain separate licenses from these patent holders to use this software.
- Use of the software either in source or binary form, must be run on or directly connected to an Analog Devices Inc. component.

THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, 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.

The views and conclusions contained in the software and documentation are those of the authors and should not be interpreted as representing official policies, either expressed or implied, of Analog Devices Inc.

The Analog Devices Linduino is not affiliated with the official Arduino team. However, the Linduino is only possible because of the Arduino team's commitment to the open-source community. Please, visit http://www.arduino.cc and http://store.arduino.cc , and consider a purchase that will help fund their ongoing work.

Copyright 2018 Analog Devices Inc. (ADI)

Header for LTC6115: High-V High Side Current and Voltage Sense.

Definition in file LTC6115.h.

Go to the source code of this file.

## Functions
void | LTC6115_initialize ()
| |Function Declarations| More...
float | LTC6115ConvertToVolts (uint32_t val)
| This function converts ADC code to Voltage. More...
float | LTC6115ConvertToAmps (uint32_t val)
| This function converts ADC code to Current. More...
void | LTC6115ChangeVGain (float val)
| This function changes the Voltage gain. More...
void | LTC6115ChangeIGain (float val)
| This function changes the Current gain. More...
float | LTC6115ToVolts (uint32_t val)
| This function converts ADC code to Voltage without the converted voltage print statement. More...
float | LTC6115ToAmps (uint32_t val)
| This function converts ADC code to Current without the converted current print statement. More...
uint32_t | millsToHz (uint32_t val)
| This function converts milliseconds to frequency (Hz). More...
float | getVGain ()
| This function returns the voltage gain (V/V). More...
float | getIGain ()
| This function returns the current gain (V/A). More...

## Macros
#define | NUMBITS 10
#define | MAXADCVAL 1023
#define | AREF float(5)
#define | LTC6115_VIN 3
| Pin Mapping. More...
#define | LTC6115_IIN 0
| Maps to DC2026 J7.1, ADC channel 1. More...

## Function Documentation

## ◆ getIGain()

float getIGain | ( |  | ) |

This function returns the current gain (V/A).

Returns
  float

Definition at line 109 of file LTC6115.cpp.

## ◆ getVGain()

float getVGain | ( |  | ) |

This function returns the voltage gain (V/V).

Returns
  float

Definition at line 100 of file LTC6115.cpp.

## ◆ LTC6115_initialize()

void LTC6115_initialize | ( |  | ) |

|Function Declarations|

This function will initialize 6115 variables.

Returns
  void

|Function Declarations|

Returns
  void

Definition at line 92 of file LTC6115.cpp.

## ◆ LTC6115ChangeIGain()

void LTC6115ChangeIGain | ( | float | val | ) |

This function changes the Current gain.

Returns
  float

Parameters

  val | The value to change the Current gain to

Definition at line 162 of file LTC6115.cpp.

## ◆ LTC6115ChangeVGain()

void LTC6115ChangeVGain | ( | float | val | ) |

This function changes the Voltage gain.

Returns
  void

Parameters

  val | The value to change the Voltage gain to

Definition at line 155 of file LTC6115.cpp.

## ◆ LTC6115ConvertToAmps()

float LTC6115ConvertToAmps | ( | uint32_t | val | ) |

This function converts ADC code to Current.

Returns
  float

Parameters

  val | The ADC code value to convert to Current

Definition at line 137 of file LTC6115.cpp.

## ◆ LTC6115ConvertToVolts()

float LTC6115ConvertToVolts | ( | uint32_t | val | ) |

This function converts ADC code to Voltage.

Returns
  float

Parameters

  val | The ADC code value to convert to Voltage

Definition at line 118 of file LTC6115.cpp.

## ◆ LTC6115ToAmps()

float LTC6115ToAmps | ( | uint32_t | val | ) |

This function converts ADC code to Current without the converted current print statement.

Returns
  float

Definition at line 146 of file LTC6115.cpp.

## ◆ LTC6115ToVolts()

float LTC6115ToVolts | ( | uint32_t | val | ) |

This function converts ADC code to Voltage without the converted voltage print statement.

Returns
  float

Definition at line 128 of file LTC6115.cpp.

## ◆ millsToHz()

uint32_t millsToHz | ( | uint32_t | val | ) |

This function converts milliseconds to frequency (Hz).

Returns
  uint32_t

Parameters

  val | The milliseconds to convert to Hz

Definition at line 169 of file LTC6115.cpp.

## Macro Definition Documentation

## ◆ AREF

#define AREF float(5)

Definition at line 71 of file LTC6115.h.

## ◆ LTC6115_IIN

#define LTC6115_IIN 0

Maps to DC2026 J7.1, ADC channel 1.

Definition at line 77 of file LTC6115.h.

## ◆ LTC6115_VIN

#define LTC6115_VIN 3

Pin Mapping.

Maps to DC2026 J7.4, ADC channel 4

Definition at line 76 of file LTC6115.h.

## ◆ MAXADCVAL

#define MAXADCVAL 1023

Definition at line 70 of file LTC6115.h.

## ◆ NUMBITS

#define NUMBITS 10

Definition at line 69 of file LTC6115.h.