![]() |
Linduino
1.3.0
Linear Technology Arduino-Compatible Demonstration Board
|
LTC2947: LTC2947 a high-precision power and energy monitor with an internal sense resistor supporting up to 30A. More...
LTC2947: LTC2947 a high-precision power and energy monitor with an internal sense resistor supporting up to 30A.
The LTC2947 is a high-precision power and energy monitor with an internal sense resistor supporting up to 30A. Three internal No Latency delta sigma ADCs ensure accurate measurement of voltage and current, while high- bandwidth analog multiplication of voltage and current provides accurate power measurement in a wide range of applications. Internal or external clocking options enable precise charge and energy measurements. An internal 300 micro ohms, temperature-compensated sense resistor minimizes efficiency loss and external compo- nents, simplifying energy measurement applications while enabling high accuracy current measurement over the full temperature range. For more details see following URLs:
http://www.linear.com/product/LTC2947
http://www.linear.com/product/LTC2947#demoboards
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:
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.
Header for LTC2947 a high-precision power and energy monitor with an internal sense resistor supporting up to 30A.
Definition in file LTC2947.h.
Go to the source code of this file.
Functions | |
serial communication wrapper macros | |
LTC2947's I2C / Spi functions are wrapped to common serial communication functions The user sets the active communication interface by calling LTC2947_InitI2C or LTC2947_InitSPI once at boot-up. | |
static int8_t | LTC2947_RD_BYTES (uint8_t REG_ADDR, uint8_t LENGTH, uint8_t *BYTES) |
read multiple bytes via I2C/SPI More... | |
static int8_t | LTC2947_WR_BYTES (uint8_t REG_ADDR, uint8_t LENGTH, uint8_t *BYTES) |
write byte array via I2C/SPI interface More... | |
static int8_t | LTC2947_RD_BYTE (uint8_t REG_ADDR, uint8_t *RESULT) |
read single byte via I2C/SPI More... | |
static int8_t | LTC2947_WR_BYTE (uint8_t REG_ADDR, uint8_t VALUE) |
write single byte via I2C More... | |
Variables | |
boolean | LTC2947_SPI_Mode_Enabled |
controlled by LTC2947_InitI2C / LTC2947_InitSPI to switch between I2C / SPI mode More... | |
uint8_t | LTC2947_I2C_Slave_Addr |
set by LTC2947_InitI2C to set slave address for I2C operation More... | |
function prototypes | |
#define | LTC2947_ARA_ERROR 0xFF |
general I2C communication error More... | |
#define | LTC2947_ARA_LTC2947_RESPONSE 1 |
got ARA response from LTC2947 More... | |
#define | LTC2947_ARA_OTHER_RESPONSE 2 |
got ARA response from some other I2C slave More... | |
#define | LTC2947_ARA_NO_RESPONSE 3 |
got NO ARA response More... | |
#define | LTC2947_ARA_RESPONSE_WO_WR 4 |
got ARA response from any slave but wihtout the expected WR bit More... | |
#define | LTC2947_ALERT_RESP_ADDR 0x0C |
The general alert response address. More... | |
void | LTC2947_InitI2C (uint8_t slvAddr) |
Initializes the LTC2947 library for I2C mode operation and configures the slave address see defines LTC2947_I2C_ADDR_LL to LTC2947_I2C_ADDR_RR for possible slave addresses. More... | |
void | LTC2947_InitSPI () |
Initializes the LTC2947 library for SPI mode operation. More... | |
uint16_t | LTC2947_2BytesToUInt16 (byte *bytes) |
Converts an array of 2 bytes to 16-bit unsigned integer. More... | |
uint32_t | LTC2947_3BytesToUInt32 (byte *bytes) |
converts an array of 3 bytes to 32-bit unsigned integer More... | |
uint32_t | LTC2947_4BytesToUInt32 (byte *bytes) |
Converts an array of 4 bytes to 32-bit unsigned integer. More... | |
int16_t | LTC2947_2BytesToInt16 (byte *bytes) |
converts an array of 2 bytes to 16-bit signed integer More... | |
int32_t | LTC2947_3BytesToInt32 (byte *bytes) |
converts an array of 3 bytes to 32-bit signed integer More... | |
int32_t | LTC2947_4BytesToInt32 (byte *bytes) |
Converts an array of 4 bytes to 32-bit signed integer. More... | |
double | LTC2947_UnsignedBytesToDouble (uint8_t *unsignedBytes, uint8_t length, double lsb) |
Converts an unsigned value of arbitrary number of bytes to a floating point value with the scaling factor lsb The input value must be usigned, use LTC2947_Abs to convert the bytes to an absolute (positive) value or use LTC2947_SignedBytesToDouble instead. More... | |
double | LTC2947_SignedBytesToDouble (uint8_t *signedBytes, uint8_t length, double lsb) |
Converts a signed value of arbitrary number of bytes to a floating point value with the scaling factor lsb The input value must be a signed format. More... | |
double | LTC2947_BytesToDouble (uint8_t *bytes, uint8_t length, boolean sig, double lsb) |
Converts a signed or unsigned value of arbitrary number of bytes to a floating point number. More... | |
void | LTC2947_DoubleToBytes (double value, double lsb, uint8_t *bytes, uint8_t length) |
Converts a floating point number that was scaled with a given LSB to an integer representation that will be stored in the given byte array. More... | |
void | LTC2947_SerialPrint8hex (uint8_t val) |
Prints a 8-bit value in 2-character hexadecimal format with left padded zeros. More... | |
void | LTC2947_SerialPrint16hex (uint16_t val) |
Prints a 16-bit value in 4-character hexadecimal format with left padded zeros. More... | |
void | LTC2947_SerialPrint32hex (uint32_t val) |
Prints a 32-bit value in 8-character hexadecimal format with left padded zeros. More... | |
void | LTC2947_SerialPrint64hex (uint64_t uint64Val) |
Prints a 64-bit value in 16-character hexadecimal format with left padded zeros. More... | |
boolean | LTC2947_Abs (uint8_t *bytes, uint8_t length) |
Calculates the absolute value of a signed value with arbitrary number of bytes. More... | |
void | LTC2947_Read_I_P_V_TEMP_VCC (float *I, float *P, float *V, float *TEMP, float *VCC) |
Reads current (I), power (P), voltage (V), temperature (TEMP) and supply voltage (VCC) from the device Make sure LTC2947's page 0 is selected before calling this function. More... | |
void | LTC2947_Read_Abs_C_E_TB (boolean accuSet1, double *C, boolean *signC, double *E, boolean *signE, double *TB) |
Reads charge (C), energy (E) and time (TB) from the device. More... | |
void | LTC2947_Read_C_E_TB (boolean accuSet1, double *C, double *E, double *TB) |
Reads charge (C), energy (E) and time (TB) from the device. More... | |
int8_t | LTC2947_SpiRdByte (uint8_t address, uint8_t *value) |
read single byte from SPI interface More... | |
int8_t | LTC2947_SpiWrByte (uint8_t address, uint8_t value) |
write single byte to SPI interface More... | |
int8_t | LTC2947_SpiRdBlock (uint8_t address, uint8_t length, uint8_t *values) |
read array of bytes from the SPI interface More... | |
int8_t | LTC2947_SpiWrBlock (uint8_t address, uint8_t length, uint8_t *values) |
writes block (array) of bytes to the SPI interface More... | |
int8_t | LTC2947_I2CRdByte (uint8_t slvAddr, uint8_t regAddr, uint8_t *value) |
read single byte via I2C More... | |
int8_t | LTC2947_I2CRdBlock (uint8_t slvAddr, uint8_t regAddr, uint8_t length, uint8_t *values) |
read multiple bytes via I2C More... | |
int8_t | LTC2947_I2CWrByte (uint8_t slvAddr, uint8_t regAddr, uint8_t value) |
write single byte via I2C More... | |
int8_t | LTC2947_I2CWrBlock (uint8_t slvAddr, uint8_t regAddr, uint8_t length, uint8_t *values) |
write byte array via I2C interface More... | |
uint8_t | LTC2947_Ara (uint8_t *svlAddr) |
Sends the Alert Response address to the I2C bus and reads the response If two or more devices on the same bus are generating alerts when the ARA is broadcasted, standard I2C arbitra- tion causes the device with the highest priority (lowest address) to reply first and the device with the lowest pri- ority (highest address) to reply last.The bus master will repeat the alert response protocol until the ALERT line is released. More... | |
void | LTC2947_SetPageSelect (boolean page) |
write LTC2947's page control register to selected one of two memory pages More... | |
int16_t | LTC2947_wake_up () |
Wake up LTC2947 from shutdown mode and measure the wakeup time. More... | |
boolean | LTC2947_GetCurrentPageSelect () |
reads LTC2947's page control register to determine the currently selected memory page More... | |
boolean | LTC2947_GPIO_Read () |
reads the current GPIO pin state Make sure LTC2947's page 0 is selected before calling this function. More... | |
void | LTC2947_GPIO_PinMode (uint8_t mode) |
Enables/disables the output driver on the GPIO pin Make sure LTC2947's page 0 is selected before calling this function. More... | |
void | LTC2947_GPIO_SetPinState (uint8_t val) |
Sets the level of the output driver on the GPIO pin This has only an effect if the output driver is enabled, see LTC2947_GPIO_PinMode Make sure LTC2947's page 0 is selected before calling this function. More... | |
int16_t LTC2947_2BytesToInt16 | ( | byte * | bytes | ) |
converts an array of 2 bytes to 16-bit signed integer
bytes | 2 byte array (MSB first) |
Definition at line 301 of file LTC2947.cpp.
uint16_t LTC2947_2BytesToUInt16 | ( | byte * | bytes | ) |
Converts an array of 2 bytes to 16-bit unsigned integer.
bytes | 2 byte array (MSB first) |
Definition at line 342 of file LTC2947.cpp.
int32_t LTC2947_3BytesToInt32 | ( | byte * | bytes | ) |
converts an array of 3 bytes to 32-bit signed integer
bytes | 3 byte array (MSB first) |
Definition at line 282 of file LTC2947.cpp.
uint32_t LTC2947_3BytesToUInt32 | ( | byte * | bytes | ) |
converts an array of 3 bytes to 32-bit unsigned integer
bytes | 3 byte array (MSB first) |
Definition at line 328 of file LTC2947.cpp.
int32_t LTC2947_4BytesToInt32 | ( | byte * | bytes | ) |
Converts an array of 4 bytes to 32-bit signed integer.
bytes | 4 byte array (MSB first) |
Definition at line 265 of file LTC2947.cpp.
uint32_t LTC2947_4BytesToUInt32 | ( | byte * | bytes | ) |
Converts an array of 4 bytes to 32-bit unsigned integer.
bytes | 4 byte array (MSB first) |
Definition at line 311 of file LTC2947.cpp.
boolean LTC2947_Abs | ( | uint8_t * | bytes, |
uint8_t | length | ||
) |
Calculates the absolute value of a signed value with arbitrary number of bytes.
bytes | bytes of the signed value (MSB first) |
length | number of bytes |
Definition at line 96 of file LTC2947.cpp.
uint8_t LTC2947_Ara | ( | uint8_t * | svlAddr | ) |
Sends the Alert Response address to the I2C bus and reads the response If two or more devices on the same bus are generating alerts when the ARA is broadcasted, standard I2C arbitra- tion causes the device with the highest priority (lowest address) to reply first and the device with the lowest pri- ority (highest address) to reply last.The bus master will repeat the alert response protocol until the ALERT line is released.
svlAddr | 7-bit address of the responding slave |
Definition at line 533 of file LTC2947.cpp.
double LTC2947_BytesToDouble | ( | uint8_t * | bytes, |
uint8_t | length, | ||
boolean | sig, | ||
double | lsb | ||
) |
Converts a signed or unsigned value of arbitrary number of bytes to a floating point number.
bytes | input value as byte array (MSB first) |
length | number of bytes of the input value |
sig | true for signed value, false for unsigned |
lsb | lsb value (scaling factor used to scale the input value) |
Definition at line 121 of file LTC2947.cpp.
void LTC2947_DoubleToBytes | ( | double | value, |
double | lsb, | ||
uint8_t * | bytes, | ||
uint8_t | length | ||
) |
Converts a floating point number that was scaled with a given LSB to an integer representation that will be stored in the given byte array.
value | floating point value |
lsb | lsb of the floating point value (integer = value / lsb) |
bytes | byte array of the integer representation |
length | length (<=8) of the byte array. Note: The function does not check for overflow of the integer representation |
Definition at line 175 of file LTC2947.cpp.
boolean LTC2947_GetCurrentPageSelect | ( | ) |
reads LTC2947's page control register to determine the currently selected memory page
Definition at line 591 of file LTC2947.cpp.
void LTC2947_GPIO_PinMode | ( | uint8_t | mode | ) |
Enables/disables the output driver on the GPIO pin Make sure LTC2947's page 0 is selected before calling this function.
Use LTC2947_SetPageSelect to change page if necessary
mode | OUTPUT (1): output driver enabled, INPUT (0): output driver disabled |
Definition at line 510 of file LTC2947.cpp.
boolean LTC2947_GPIO_Read | ( | ) |
reads the current GPIO pin state Make sure LTC2947's page 0 is selected before calling this function.
Use LTC2947_SetPageSelect to change page if necessary
Definition at line 526 of file LTC2947.cpp.
void LTC2947_GPIO_SetPinState | ( | uint8_t | val | ) |
Sets the level of the output driver on the GPIO pin This has only an effect if the output driver is enabled, see LTC2947_GPIO_PinMode Make sure LTC2947's page 0 is selected before calling this function.
Use LTC2947_SetPageSelect to change page if necessary
val | LOW (0): pin low, HIGH (1): pin high |
Definition at line 518 of file LTC2947.cpp.
int8_t LTC2947_I2CRdBlock | ( | uint8_t | slvAddr, |
uint8_t | regAddr, | ||
uint8_t | length, | ||
uint8_t * | values | ||
) |
read multiple bytes via I2C
slvAddr | The slv address. |
regAddr | The register address. |
length | number of bytes. |
values | read bytes |
Definition at line 436 of file LTC2947.cpp.
int8_t LTC2947_I2CRdByte | ( | uint8_t | slvAddr, |
uint8_t | regAddr, | ||
uint8_t * | value | ||
) |
read single byte via I2C
slvAddr | The slv address. |
regAddr | The register address. |
value | byte that was read |
Definition at line 485 of file LTC2947.cpp.
int8_t LTC2947_I2CWrBlock | ( | uint8_t | slvAddr, |
uint8_t | regAddr, | ||
uint8_t | length, | ||
uint8_t * | values | ||
) |
write byte array via I2C interface
slvAddr | The slv address. |
regAddr | The register address. |
length | number of bytes. |
values | bytes to be written |
Definition at line 414 of file LTC2947.cpp.
int8_t LTC2947_I2CWrByte | ( | uint8_t | slvAddr, |
uint8_t | regAddr, | ||
uint8_t | value | ||
) |
write single byte via I2C
slvAddr | The slv address. |
regAddr | The register address. |
value | byte to be written |
Definition at line 469 of file LTC2947.cpp.
void LTC2947_InitI2C | ( | uint8_t | slvAddr | ) |
Initializes the LTC2947 library for I2C mode operation and configures the slave address see defines LTC2947_I2C_ADDR_LL to LTC2947_I2C_ADDR_RR for possible slave addresses.
slvAddr | 7-bit I2C slave address of the LTC2947 (e.g. LTC2947_I2C_ADDR_LL) |
Definition at line 85 of file LTC2947.cpp.
void LTC2947_InitSPI | ( | ) |
Initializes the LTC2947 library for SPI mode operation.
Definition at line 91 of file LTC2947.cpp.
|
static |
|
static |
void LTC2947_Read_Abs_C_E_TB | ( | boolean | accuSet1, |
double * | C, | ||
boolean * | signC, | ||
double * | E, | ||
boolean * | signE, | ||
double * | TB | ||
) |
Reads charge (C), energy (E) and time (TB) from the device.
Charge and Energy are converted to absulte values (always positive!) and a separate sign bit. If the separation in absolute value and sign is not desired use LTC2947_Read_C_E_TB instead. Make sure LTC2947's page 0 is selected before calling this function. Use LTC2947_SetPageSelect to change page if necessary
accuSet1 | True: Read C1, E1, TB1. False: Read C2, E2, TB2. |
C | Absolute value of charge in As |
signC | Sign of charge (True: negative, False: positive) |
E | Absolute value of energy in Ws |
signE | Sign of energy (True: negative, False: positive) |
TB | Time in s |
Definition at line 622 of file LTC2947.cpp.
void LTC2947_Read_C_E_TB | ( | boolean | accuSet1, |
double * | C, | ||
double * | E, | ||
double * | TB | ||
) |
Reads charge (C), energy (E) and time (TB) from the device.
Make sure LTC2947's page 0 is selected before calling this function. Use LTC2947_SetPageSelect to change page if necessary
accuSet1 | True: Read C1, E1, TB1. False: Read C2, E2, TB2. |
C | Signed charge in As |
E | Signed energy in Ws |
TB | Time in s |
Definition at line 649 of file LTC2947.cpp.
void LTC2947_Read_I_P_V_TEMP_VCC | ( | float * | I, |
float * | P, | ||
float * | V, | ||
float * | TEMP, | ||
float * | VCC | ||
) |
Reads current (I), power (P), voltage (V), temperature (TEMP) and supply voltage (VCC) from the device Make sure LTC2947's page 0 is selected before calling this function.
Use LTC2947_SetPageSelect to change page if necessary
I | Current im amps |
P | Power in watts |
V | Voltage in volts |
TEMP | Temperature in degree celcius |
VCC | Supply voltage in volts |
Definition at line 603 of file LTC2947.cpp.
void LTC2947_SerialPrint16hex | ( | uint16_t | val | ) |
Prints a 16-bit value in 4-character hexadecimal format with left padded zeros.
val | 16-bit input value |
Definition at line 157 of file LTC2947.cpp.
void LTC2947_SerialPrint32hex | ( | uint32_t | val | ) |
Prints a 32-bit value in 8-character hexadecimal format with left padded zeros.
val | 32-bit input value |
Definition at line 163 of file LTC2947.cpp.
void LTC2947_SerialPrint64hex | ( | uint64_t | uint64Val | ) |
Prints a 64-bit value in 16-character hexadecimal format with left padded zeros.
uint64Val | 64-bit input value |
Definition at line 169 of file LTC2947.cpp.
void LTC2947_SerialPrint8hex | ( | uint8_t | val | ) |
Prints a 8-bit value in 2-character hexadecimal format with left padded zeros.
val | 8-bit input value |
Definition at line 152 of file LTC2947.cpp.
void LTC2947_SetPageSelect | ( | boolean | page | ) |
write LTC2947's page control register to selected one of two memory pages
page | false: select page 0, true: select page 1 |
Definition at line 598 of file LTC2947.cpp.
double LTC2947_SignedBytesToDouble | ( | uint8_t * | signedBytes, |
uint8_t | length, | ||
double | lsb | ||
) |
Converts a signed value of arbitrary number of bytes to a floating point value with the scaling factor lsb The input value must be a signed format.
For unsigned values use LTC2947_UnsignedBytesToDouble. For input values with up to 4 bytes use LTC2947_<X>BytesToInt<N> (e.g. LTC2947_4BytesToInt32, LTC2947_2BytesToInt16) and multiply the result by lsb for reduced calculation time, e.g. "LTC2947_4BytesToInt32(bytes)*lsb".
signedBytes | signed input value as byte array (MSB first) |
length | number of bytes of the signed value |
lsb | lsb value (scaling factor used to scale the signed value) |
Definition at line 247 of file LTC2947.cpp.
int8_t LTC2947_SpiRdBlock | ( | uint8_t | address, |
uint8_t | length, | ||
uint8_t * | values | ||
) |
read array of bytes from the SPI interface
address | register address |
length | Length of array |
values | Byte array to store read bytes |
Definition at line 374 of file LTC2947.cpp.
int8_t LTC2947_SpiRdByte | ( | uint8_t | address, |
uint8_t * | value | ||
) |
read single byte from SPI interface
address | register address |
value | Byte pointer to store read byte |
Definition at line 402 of file LTC2947.cpp.
int8_t LTC2947_SpiWrBlock | ( | uint8_t | address, |
uint8_t | length, | ||
uint8_t * | values | ||
) |
writes block (array) of bytes to the SPI interface
address | register address |
length | Length of array |
values | Byte array to be written |
Definition at line 358 of file LTC2947.cpp.
int8_t LTC2947_SpiWrByte | ( | uint8_t | address, |
uint8_t | value | ||
) |
write single byte to SPI interface
address | register address |
value | Byte to be written |
Definition at line 390 of file LTC2947.cpp.
double LTC2947_UnsignedBytesToDouble | ( | uint8_t * | unsignedBytes, |
uint8_t | length, | ||
double | lsb | ||
) |
Converts an unsigned value of arbitrary number of bytes to a floating point value with the scaling factor lsb The input value must be usigned, use LTC2947_Abs to convert the bytes to an absolute (positive) value or use LTC2947_SignedBytesToDouble instead.
For input values with up to 4 bytes use LTC2947_<X>BytesToUInt<N> (e.g. LTC2947_4BytesToUInt32, LTC2947_2BytesToUInt16) and multiply the result by lsb for reduced calculation time, e.g. "LTC2947_4BytesToUInt32(bytes)*lsb".
unsignedBytes | unsigned input value as byte array (MSB first) |
length | number of bytes of the unsigned value |
lsb | lsb value (scaling factor used to scale the unsigned value) |
Definition at line 137 of file LTC2947.cpp.
int16_t LTC2947_wake_up | ( | ) |
Wake up LTC2947 from shutdown mode and measure the wakeup time.
Definition at line 567 of file LTC2947.cpp.
|
static |
|
static |
#define bitMaskClr | ( | value, | |
bitMask | |||
) | (value &= ~(bitMask)) |
#define bitMaskClrChk | ( | value, | |
bitMask | |||
) | (((value) & (bitMask)) == 0) |
#define bitMaskSetChk | ( | value, | |
bitMask | |||
) | (((value) & (bitMask)) == (bitMask)) |
#define bitMaskSetClr | ( | value, | |
bitMask, | |||
setNotClr | |||
) | ((setNotClr) ? bitMaskSet(value,bitMask) : bitMaskClr(value,bitMask)) |
#define BM2BITPOS | ( | bm | ) |
#define LTC2947_ALERT_RESP_ADDR 0x0C |
#define LTC2947_ARA_ERROR 0xFF |
#define LTC2947_ARA_LTC2947_RESPONSE 1 |
#define LTC2947_ARA_OTHER_RESPONSE 2 |
#define LTC2947_ARA_RESPONSE_WO_WR 4 |
#define LTC2947_CS QUIKEVAL_CS |
#define LTC2947_DIV ((uint8_t)(LTC2947_EXTCLK/32768.0/(1 << LTC2947_PRE))) |
#define LTC2947_EXTCLK 4e6 |
defines ltc 2947 extclk.
PRE, DIV, ext. oscillator setting: Before include of LTC2947.h you may
In all cases after loading the header file you can
Note: All LSBs are calculated as a function of PRE, DIV and EXTCLK by pre-processor macros within LTC2947.h
must | be 4MHz in case of crystal operation, or 0.2 to 25 MHz in case of external oscillator |
#define LTC2947_EXTPER (1.0/LTC2947_EXTCLK) |
#define LTC2947_LSB_C1 (0.0384946 * (LTC2947_PRE == 7 ? LTC2947_INTC : LTC2947_EXTPER * (1 << LTC2947_PRE) * (LTC2947_DIV + 1))) |
#define LTC2947_LSB_C1TH (0.0384946 * (LTC2947_PRE == 7 ? LTC2947_INTC : LTC2947_EXTPER * (1 << LTC2947_PRE) * (LTC2947_DIV + 1))) |
#define LTC2947_LSB_C1TL (0.0384946 * (LTC2947_PRE == 7 ? LTC2947_INTC : LTC2947_EXTPER * (1 << LTC2947_PRE) * (LTC2947_DIV + 1))) |
#define LTC2947_LSB_C2 (0.0384946 * (LTC2947_PRE == 7 ? LTC2947_INTC : LTC2947_EXTPER * (1 << LTC2947_PRE) * (LTC2947_DIV + 1))) |
#define LTC2947_LSB_C2TH (0.0384946 * (LTC2947_PRE == 7 ? LTC2947_INTC : LTC2947_EXTPER * (1 << LTC2947_PRE) * (LTC2947_DIV + 1))) |
#define LTC2947_LSB_C2TL (0.0384946 * (LTC2947_PRE == 7 ? LTC2947_INTC : LTC2947_EXTPER * (1 << LTC2947_PRE) * (LTC2947_DIV + 1))) |
#define LTC2947_LSB_E1 (0.641576 * (LTC2947_PRE == 7 ? LTC2947_INTC : LTC2947_EXTPER * (1 << LTC2947_PRE) * (LTC2947_DIV + 1))) |
#define LTC2947_LSB_E1TH (0.641576 * (LTC2947_PRE == 7 ? LTC2947_INTC : LTC2947_EXTPER * (1 << LTC2947_PRE) * (LTC2947_DIV + 1))) |
#define LTC2947_LSB_E1TL (0.641576 * (LTC2947_PRE == 7 ? LTC2947_INTC : LTC2947_EXTPER * (1 << LTC2947_PRE) * (LTC2947_DIV + 1))) |
#define LTC2947_LSB_E2 (0.641576 * (LTC2947_PRE == 7 ? LTC2947_INTC : LTC2947_EXTPER * (1 << LTC2947_PRE) * (LTC2947_DIV + 1))) |
#define LTC2947_LSB_E2TH (0.641576 * (LTC2947_PRE == 7 ? LTC2947_INTC : LTC2947_EXTPER * (1 << LTC2947_PRE) * (LTC2947_DIV + 1))) |
#define LTC2947_LSB_E2TL (0.641576 * (LTC2947_PRE == 7 ? LTC2947_INTC : LTC2947_EXTPER * (1 << LTC2947_PRE) * (LTC2947_DIV + 1))) |
#define LTC2947_LSB_FACTOR_MILLI_HOURS (1.0 / 60.0 / 60.0 / 1.0e-3) |
#define LTC2947_LSB_TB1 (12.8315 * (LTC2947_PRE == 7 ? LTC2947_INTC : LTC2947_EXTPER * (1 << LTC2947_PRE) * (LTC2947_DIV + 1))) |
#define LTC2947_LSB_TB1TH (12.8315 * (LTC2947_PRE == 7 ? LTC2947_INTC : LTC2947_EXTPER * (1 << LTC2947_PRE) * (LTC2947_DIV + 1))) |
#define LTC2947_LSB_TB2 (12.8315 * (LTC2947_PRE == 7 ? LTC2947_INTC : LTC2947_EXTPER * (1 << LTC2947_PRE) * (LTC2947_DIV + 1))) |
#define LTC2947_LSB_TB2TH (12.8315 * (LTC2947_PRE == 7 ? LTC2947_INTC : LTC2947_EXTPER * (1 << LTC2947_PRE) * (LTC2947_DIV + 1))) |
#define LTC2947_PRE |
uint8_t LTC2947_I2C_Slave_Addr |
set by LTC2947_InitI2C to set slave address for I2C operation
Definition at line 83 of file LTC2947.cpp.
boolean LTC2947_SPI_Mode_Enabled |
controlled by LTC2947_InitI2C / LTC2947_InitSPI to switch between I2C / SPI mode
Definition at line 82 of file LTC2947.cpp.