149 *adc_code = 0xFFFFFFFF & data.
LT_int32;
163 *adc_code = 0xFFFFFFFFFFFFLL &data.
LT_uint64;
171 float value = (code*1.28)/(65535);
180 float value = (code*fullscaleVoltage)/((65536)-1);
188 float value = (code*.04)/(((65536)-1)*
resistor);
196 float value = (code*.04*fullscaleVoltage*65536.0)/(65535.0*65535.0*
resistor);
203 float value = (code*.04*fullscaleVoltage*tConv*256.0)/(65535.0*65535.0*
resistor);
211 float value = (code*.04*tConv)/(((65536)-1)*
resistor);
219 float value = energy/(tConv*code);
227 float value = coulombs/(tConv*code);
235 float value = code*1.280/255;
243 float value = code*fullscaleVoltage/255;
251 float value = (code*.04)/(255*
resistor);
259 float value = (code*fullscaleVoltage*.04*256)/(255.0*255.0*resistor);
267 uint8_t code = (int)(vgpio*255.0/1.280);
275 uint8_t code = (int)(volt*255.0/fullscaleVoltage);
283 uint8_t code = (current*255.0*
resistor)/(.04);
291 uint8_t code = (power*255.0*255.0*resistor/(256*.04*fullscaleVoltage));
float LTC4282_code_to_avg_power(uint64_t code, float energy, float tConv)
Convert ADC code to average power.
float LTC4282_code_to_voltage(uint16_t code, float fullscaleVoltage)
Convert ADC code to voltage.
uint8_t LTC4282_VGPIO_to_code_alarm(float vgpio)
Convert GPIO voltage to alarm code.
float LTC4282_code_to_coulombs(uint64_t code, float resistor, float tConv)
Convert ADC code to coulombs.
static uint8_t adc_command
int8_t i2c_read_block_data(uint8_t address, uint8_t command, uint8_t length, uint8_t *values)
Read a block of data, starting at register specified by "command" and ending at (command + length - 1...
uint8_t LT_byte[4]
4 bytes (unsigned 8-bit integers) to be converted to a 32-bit signed or unsigned integer ...
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.
int8_t i2c_read_byte_data(uint8_t address, uint8_t command, uint8_t *value)
Read a byte of data at register specified by "command", store in "value".
const float resistor
resistor value on demo board
float LTC4282_code_to_power(uint16_t code, float fullscaleVoltage, float resistor)
Convert ADC code to power.
Header File for Linduino Libraries and Demo Code.
float LTC4282_code_to_VGPIO(uint16_t code)
Convert ADC code to VGPIO.
uint64_t LT_uint64
32-bit unsigned integer to be converted to four bytes
uint8_t LTC4282_power_to_code_alarm(float power, float resistor, float fullscaleVoltage)
Convert power to alarm code.
float LTC4282_code_to_current(uint16_t code, float resistor)
Convert ADC code to current.
uint8_t LTC4282_current_to_code_alarm(float current, float resistor)
Convert current to alarm code.
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.
union LT_union_int32_4bytes data
int8_t i2c_write_word_data(uint8_t address, uint8_t command, uint16_t value)
Write a 16-bit word of data to register specified by "command".
float LTC4282_code_to_energy(uint64_t code, float fullscaleVoltage, float resistor, float tConv)
Convert ADC code to energy.
float LTC4282_code_to_GPIO_alarm(uint8_t code)
Convert ADC code to GPIO alarm voltage.
uint8_t LTC4282_volt_to_code_alarm(float volt, float fullscaleVoltage)
Convert voltage to alarm code.
int8_t i2c_write_byte_data(uint8_t address, uint8_t command, uint8_t value)
Write a byte of data to register specified by "command".
int8_t LTC4282_write(uint8_t i2c_address, uint8_t adc_command, uint8_t code)
Write an 8-bit code to the LTC4282.
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.
int32_t LT_int32
32-bit signed integer to be converted to four bytes
float LTC4282_code_to_volt_alarm(uint8_t code, float fullscaleVoltage)
Convert ADC code to alarm voltage.
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.
int8_t i2c_read_word_data(uint8_t address, uint8_t command, uint16_t *value)
Read a 16-bit word of data from register specified by "command".
LT_I2C: Routines to communicate with ATmega328P's hardware I2C port.
int8_t i2c_write_block_data(uint8_t address, uint8_t command, uint8_t length, uint8_t *values)
Write a block of data, starting at register specified by "command" and ending at (command + length - ...
uint8_t LT_byte[8]
4 bytes (unsigned 8-bit integers) to be converted to a 32-bit signed or unsigned integer ...
This union splits one int32_t (32-bit signed integer) or uint32_t (32-bit unsigned integer) four uint...
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.
LTC4282: High Current Hot Swap Controller with I2C Compatible Monitoring and EEPROM.
int8_t LTC4282_read(uint8_t i2c_address, uint8_t adc_command, uint8_t *adc_code)
Read an 8-bit code from the LTC4282.
static uint16_t current
the current measurement from the LTC3335's counter test mode.
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.
float LTC4282_code_to_current_alarm(uint8_t code, float resistor)
Convert ADC code to alarm current.
float LTC4282_code_to_avg_current(uint64_t code, float coulombs, float tConv)
Convert ADC code to average current.
float LTC4282_code_to_power_alarm(uint8_t code, float fullscaleVoltage, float resistor)
Convert ADC code to alarm power.