![]() |
Linduino
1.3.0
Linear Technology Arduino-Compatible Demonstration Board
|
Library for LTC2946 12-Bit Wide Range Power, Charge and Energy Monitor. More...
Library for LTC2946 12-Bit Wide Range Power, Charge and Energy Monitor.
Definition in file LTC2946.cpp.
Go to the source code of this file.
Functions | |
int8_t | LTC2946_write (uint8_t i2c_address, uint8_t adc_command, uint8_t code) |
Write an 8-bit code to the LTC2946. More... | |
int8_t | LTC2946_write_16_bits (uint8_t i2c_address, uint8_t adc_command, uint16_t code) |
Write a 16-bit code to the LTC2946. More... | |
int8_t | LTC2946_write_24_bits (uint8_t i2c_address, uint8_t adc_command, uint32_t code) |
Write a 24-bit code to the LTC2946. More... | |
int8_t | LTC2946_write_32_bits (uint8_t i2c_address, uint8_t adc_command, uint32_t code) |
Write a 32-bit code to the LTC2946. More... | |
int8_t | LTC2946_read (uint8_t i2c_address, uint8_t adc_command, uint8_t *adc_code) |
Reads an 8-bit adc_code from LTC2946. More... | |
int8_t | LTC2946_read_12_bits (uint8_t i2c_address, uint8_t adc_command, uint16_t *adc_code) |
Reads a 12-bit adc_code from LTC2946. More... | |
int8_t | LTC2946_read_16_bits (uint8_t i2c_address, uint8_t adc_command, uint16_t *adc_code) |
Reads a 16-bit adc_code from LTC2946. More... | |
int8_t | LTC2946_read_24_bits (uint8_t i2c_address, uint8_t adc_command, uint32_t *adc_code) |
Reads a 24-bit adc_code from LTC2946. More... | |
int8_t | LTC2946_read_32_bits (uint8_t i2c_address, uint8_t adc_command, uint32_t *adc_code) |
Reads a 32-bit adc_code from LTC2946. More... | |
float | LTC2946_VIN_code_to_voltage (uint16_t adc_code, float LTC2946_VIN_lsb) |
Calculate the LTC2946 VIN voltage. More... | |
float | LTC2946_ADIN_code_to_voltage (uint16_t adc_code, float LTC2946_ADIN_lsb) |
Calculate the LTC2946 ADIN voltage. More... | |
float | LTC2946_code_to_current (uint16_t adc_code, float resistor, float LTC2946_DELTA_SENSE_lsb) |
Calculate the LTC2946 current with a sense resistor. More... | |
float | LTC2946_code_to_power (int32_t adc_code, float resistor, float LTC2946_Power_lsb) |
Calculate the LTC2946 power. More... | |
float | LTC2946_code_to_energy (int32_t adc_code, float resistor, float LTC2946_Power_lsb, float LTC2946_TIME_lsb) |
Calculate the LTC2946 energy. More... | |
float | LTC2946_code_to_coulombs (int32_t adc_code, float resistor, float LTC2946_DELTA_SENSE_lsb, float LTC2946_TIME_lsb) |
Calculate the LTC2946 coulombs. More... | |
float | LTC2946_code_to_time (float time_code, float LTC2946_TIME_lsb) |
Calculate the LTC2946 internal time base. More... | |
float LTC2946_ADIN_code_to_voltage | ( | uint16_t | adc_code, |
float | LTC2946_ADIN_lsb | ||
) |
Calculate the LTC2946 ADIN voltage.
adc_code | The ADC value |
LTC2946_ADIN_lsb | ADIN lsb weight |
Definition at line 203 of file LTC2946.cpp.
float LTC2946_code_to_coulombs | ( | int32_t | adc_code, |
float | resistor, | ||
float | LTC2946_DELTA_SENSE_lsb, | ||
float | LTC2946_Time_lsb | ||
) |
Calculate the LTC2946 coulombs.
adc_code | The ADC value |
resistor | The resistor value |
LTC2946_DELTA_SENSE_lsb | Delta sense lsb weight |
LTC2946_TIME_lsb | Time lsb weight |
Definition at line 243 of file LTC2946.cpp.
float LTC2946_code_to_current | ( | uint16_t | adc_code, |
float | resistor, | ||
float | LTC2946_DELTA_SENSE_lsb | ||
) |
Calculate the LTC2946 current with a sense resistor.
adc_code | The ADC value |
resistor | The resistor value |
LTC2946_DELTA_SENSE_lsb | Delta sense lsb weight |
Definition at line 212 of file LTC2946.cpp.
float LTC2946_code_to_energy | ( | int32_t | adc_code, |
float | resistor, | ||
float | LTC2946_Power_lsb, | ||
float | LTC2946_TIME_lsb | ||
) |
Calculate the LTC2946 energy.
adc_code | The ADC value |
resistor | The resistor value |
LTC2946_Power_lsb | Power lsb weight |
LTC2946_TIME_lsb | Time lsb weight |
Definition at line 233 of file LTC2946.cpp.
float LTC2946_code_to_power | ( | int32_t | adc_code, |
float | resistor, | ||
float | LTC2946_Power_lsb | ||
) |
Calculate the LTC2946 power.
adc_code | The ADC value |
resistor | The resistor value |
Definition at line 222 of file LTC2946.cpp.
float LTC2946_code_to_time | ( | float | time_code, |
float | LTC2946_Time_lsb | ||
) |
Calculate the LTC2946 internal time base.
time_code | Time adc code |
LTC2946_TIME_lsb | Time lsb weight |
Definition at line 253 of file LTC2946.cpp.
int8_t LTC2946_read | ( | uint8_t | i2c_address, |
uint8_t | adc_command, | ||
uint8_t * | adc_code | ||
) |
Reads an 8-bit adc_code from LTC2946.
i2c_address | Register address for the LTC2946 |
adc_command | The "command byte" for the LTC2946 |
adc_code | Value that will be read from the register. |
Definition at line 130 of file LTC2946.cpp.
int8_t LTC2946_read_12_bits | ( | uint8_t | i2c_address, |
uint8_t | adc_command, | ||
uint16_t * | adc_code | ||
) |
Reads a 12-bit adc_code from LTC2946.
i2c_address | Register address for the LTC2946 |
adc_command | The "command byte" for the LTC2946 |
adc_code | Value that will be read from the register. |
Definition at line 141 of file LTC2946.cpp.
int8_t LTC2946_read_16_bits | ( | uint8_t | i2c_address, |
uint8_t | adc_command, | ||
uint16_t * | adc_code | ||
) |
Reads a 16-bit adc_code from LTC2946.
i2c_address | Register address for the LTC2946 |
adc_command | The "command byte" for the LTC2946 |
adc_code | Value that will be read from the register. |
Definition at line 155 of file LTC2946.cpp.
int8_t LTC2946_read_24_bits | ( | uint8_t | i2c_address, |
uint8_t | adc_command, | ||
uint32_t * | adc_code | ||
) |
Reads a 24-bit adc_code from LTC2946.
i2c_address | Register address for the LTC2946 |
adc_command | The "command byte" for the LTC2946 |
adc_code | Value that will be read from the register. |
Definition at line 166 of file LTC2946.cpp.
int8_t LTC2946_read_32_bits | ( | uint8_t | i2c_address, |
uint8_t | adc_command, | ||
uint32_t * | adc_code | ||
) |
Reads a 32-bit adc_code from LTC2946.
i2c_address | Register address for the LTC2946 |
adc_command | The "command byte" for the LTC2946 |
adc_code | Value that will be read from the register. |
Definition at line 180 of file LTC2946.cpp.
float LTC2946_VIN_code_to_voltage | ( | uint16_t | adc_code, |
float | LTC2946_VIN_lsb | ||
) |
Calculate the LTC2946 VIN voltage.
adc_code | The ADC value |
LTC2946_VIN_lsb | VIN lsb weight |
Definition at line 194 of file LTC2946.cpp.
int8_t LTC2946_write | ( | uint8_t | i2c_address, |
uint8_t | adc_command, | ||
uint8_t | code | ||
) |
Write an 8-bit code to the LTC2946.
i2c_address | Register address for the LTC2946 |
adc_command | The "command byte" for the LTC2946 |
code | Value that will be written to the register. |
Definition at line 81 of file LTC2946.cpp.
int8_t LTC2946_write_16_bits | ( | uint8_t | i2c_address, |
uint8_t | adc_command, | ||
uint16_t | code | ||
) |
Write a 16-bit code to the LTC2946.
i2c_address | Register address for the LTC2946 |
adc_command | The "command byte" for the LTC2946 |
code | Value that will be written to the register. |
Definition at line 93 of file LTC2946.cpp.
int8_t LTC2946_write_24_bits | ( | uint8_t | i2c_address, |
uint8_t | adc_command, | ||
uint32_t | code | ||
) |
Write a 24-bit code to the LTC2946.
i2c_address | Register address for the LTC2946 |
adc_command | The "command byte" for the LTC2946 |
code | Value that will be written to the register. |
Definition at line 103 of file LTC2946.cpp.
int8_t LTC2946_write_32_bits | ( | uint8_t | i2c_address, |
uint8_t | adc_command, | ||
uint32_t | code | ||
) |
Write a 32-bit code to the LTC2946.
i2c_address | Register address for the LTC2946 |
adc_command | The "command byte" for the LTC2946 |
code | Value that will be written to the register. |
Definition at line 116 of file LTC2946.cpp.