![]() |
Linduino
1.3.0
Linear Technology Arduino-Compatible Demonstration Board
|
Library for LTC4151: High Voltage I2C Current and Voltage Monitor. More...
Library for LTC4151: High Voltage I2C Current and Voltage Monitor.
Definition in file LTC4151.cpp.
Go to the source code of this file.
Functions | |
| int8_t | LTC4151_write (uint8_t i2c_address, uint8_t adc_command, uint8_t code) |
| Write one byte to an LTC4151 register. More... | |
| int8_t | LTC4151_read_12_bits (uint8_t i2c_address, uint8_t adc_command, uint16_t *adc_code) |
| Reads a 12-bit value from LTC4151. More... | |
| float | LTC4151_code_to_sense_current (uint16_t adc_code, float resistor, float LTC4151_sense_lsb) |
| Calculates the LTC4151 sense current in Amps given "resistor" value in ohms and "LTC4151_sense_lsb" LSB weight in volts. More... | |
| float | LTC4151_code_to_vin_voltage (uint16_t adc_code, float LTC4151_vin_lsb) |
| Calculates the LTC4151 V_IN voltage given "LTC_vin_lsb" LSB weight in volts. More... | |
| float | LTC4151_code_to_ADIN_voltage (uint16_t adc_code, float LTC4151_adin_lsb) |
| Calculates the LTC4151 ADIN voltage in mV given "LTC4151_adin_lsb" LSB weight in mV. More... | |
| float LTC4151_code_to_ADIN_voltage | ( | uint16_t | adc_code, |
| float | LTC4151_adin_lsb | ||
| ) |
Calculates the LTC4151 ADIN voltage in mV given "LTC4151_adin_lsb" LSB weight in mV.
| adc_code | Code read from the adc (from a function such as LTC4151_read_12_bits) |
| LTC4151_adin_lsb | ADIN voltage LSB weight. |
Definition at line 117 of file LTC4151.cpp.
| float LTC4151_code_to_sense_current | ( | uint16_t | adc_code, |
| float | resistor, | ||
| float | LTC4151_sense_lsb | ||
| ) |
Calculates the LTC4151 sense current in Amps given "resistor" value in ohms and "LTC4151_sense_lsb" LSB weight in volts.
| adc_code | Code read from the adc (from a function such as LTC4151_read_12_bits) |
| resistor | The sense resistor value |
| LTC4151_sense_lsb | Current LSB weight. |
Definition at line 100 of file LTC4151.cpp.
| float LTC4151_code_to_vin_voltage | ( | uint16_t | adc_code, |
| float | LTC4151_vin_lsb | ||
| ) |
Calculates the LTC4151 V_IN voltage given "LTC_vin_lsb" LSB weight in volts.
| adc_code | Code read from the adc (from a function such as LTC4151_read_12_bits) |
| LTC4151_vin_lsb | Voltage LSB weight. |
Definition at line 109 of file LTC4151.cpp.
| int8_t LTC4151_read_12_bits | ( | uint8_t | i2c_address, |
| uint8_t | adc_command, | ||
| uint16_t * | adc_code | ||
| ) |
Reads a 12-bit value from LTC4151.
| i2c_address | I2C address of the LTC4151. Configured by tying the ADR0 and ADR1 pins high or low. See Table 1 of datasheet. |
| adc_command | The "command byte" for the LTC4151. |
| adc_code | Returns 12-bit value read from the adc |
Definition at line 83 of file LTC4151.cpp.
| int8_t LTC4151_write | ( | uint8_t | i2c_address, |
| uint8_t | adc_command, | ||
| uint8_t | code | ||
| ) |
Write one byte to an LTC4151 register.
| i2c_address | I2C address of the LTC4151. Configured by tying the ADR0 and ADR1 pins high or low. See Table 1 of datasheet. |
| adc_command | The "command byte" for the LTC4151. |
| code | Value that will be written to the register. |
Definition at line 73 of file LTC4151.cpp.