97 uint8_t register_data;
100 bit_mask = 0x01 << bit_number;
102 register_data = register_data | bit_mask;
110 uint8_t register_data;
113 bit_mask = 0x01 << bit_number;
115 register_data = register_data & (~bit_mask);
124 uint8_t register_data;
127 bit_mask = 0x01 << bit_number;
129 register_data = register_data & (~bit_mask);
130 register_data = register_data | ((bit_data & 0x01) << bit_number);
139 uint8_t register_data;
142 register_data = register_data >> bit_number;
143 return (register_data & 0x01);
149 uint8_t register_data;
152 if (register_address == 0x0A | register_address == 0x0B)
157 if (register_address == 0x0C | register_address == 0x0D)
162 if (register_address == 0x0E | register_address == 0x0F)
167 if (register_address == 0x10 | register_address == 0x11)
178 uint8_t register_data;
179 uint8_t fb_ref_data = 0;
181 fb_ref_data = (uint8_t) ((fb_ref_voltage + 6.25 - 412.5) / 12.5);
184 register_data = register_data | fb_ref_data;
186 return (412.5 + (fb_ref_data * 12.5));
235 uint8_t user_register;
237 if (buck_number == 0xFF)
245 user_register = (buck_number*2) + 8;
246 if (ref_char ==
'A' || ref_char ==
'a')
248 else if (ref_char ==
'B' || ref_char ==
'b')
257 uint8_t register_data;
259 if (buck_number == 0xFF)
269 register_data = register_data | (mode << 5);
279 if (buck_number == 0xFF)
296 uint8_t dvbxb_register = (2*buck_number)+9;
297 if (buck_number == 0xFF)
314 uint8_t uv_warning_data = 0;
315 uint8_t register_data;
318 uv_warning_data = (uint8_t) ((uv_warning_threshold + 0.05 - 2.7) / 0.1);
319 register_data = register_data | (uv_warning_data << 2);
329 uint8_t ot_warning_data = 0;
330 uint8_t register_data;
333 ot_warning_data = (uint8_t) ((ot_warning_level + 5 - 10) / 10);
334 register_data = register_data | ot_warning_data;
344 uint8_t register_data;
347 register_data = register_data | (ldo4_output_voltage_code << 3);
357 uint8_t register_data;
358 sequence_phase = sequence_phase & (0x03);
361 register_data |= (sequence_phase << ((buck_number*2)- 2));
371 uint8_t register_data;
372 sequence_phase = sequence_phase & (0x03);
375 register_data |= (sequence_phase << ((ldo_number-2)* 2));
int8_t LTC3676_set_buck_mode(uint8_t i2c_address, uint8_t buck_number, uint8_t mode)
Sets the switching mode for the specified Buck regulator.
uint8_t LTC3676_bit_is_set(uint8_t i2c_address, uint8_t register_address, uint8_t bit_number)
Reads the value of any bit in any register or the LTC3676.
#define LTC3676_RES_BUCK1_RBOT
int8_t LTC3676_set_startup_mode(uint8_t i2c_address, uint8_t buck_number, uint8_t startup_bit)
Sets the start-up mode for all bucks.
#define LTC3676_REG_BUCK1
#define LTC3676_REG_BUCK2
#define LTC3676_I2C_ADDRESS
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".
int8_t LTC3676_register_write(uint8_t i2c_address, uint8_t register_address, uint8_t register_data)
Writes to an 8-bit register inside the LTC3676 using the standard I2C repeated start format...
int8_t LTC3676_set_ldo_sequence_down(uint8_t i2c_address, uint8_t ldo_number, uint8_t sequence_phase)
Sets the Sequence Down bits for any buck in the SQD1 register.
#define LTC3676_RES_BUCK2_RBOT
#define LTC3676_RES_BUCK1_RTOP
float LTC3676_buck_vout_max(uint8_t buck_number)
Calculates the maximum output voltage of any buck in mV based on the feedback resistors.
Header File for Linduino Libraries and Demo Code.
float LTC3676_set_buck_fb_ref(uint8_t i2c_address, uint8_t register_address, float fb_ref_voltage)
Writes the Feedback Reference Voltage of any buck.
int8_t LTC3676_select_buck_reference(uint8_t i2c_address, uint8_t buck_number, int8_t ref_char)
Selects the reference for the specified buck regulator(s).
#define LTC3676_REG_DVB2B
int8_t LTC3676_set_buck_sequence_down(uint8_t i2c_address, uint8_t buck_number, uint8_t sequence_phase)
Sets the Sequence Down bits for any buck in the SQD1 register.
#define LTC3676_RES_BUCK2_RTOP
#define LTC3676_BUCK_PG_MASK
float LTC3676_buck_vout_min(uint8_t buck_number)
Calculates the minimum output voltage of any buck in mV based on the feedback resistors.
#define LTC3676_REG_CNTRL
int8_t LTC3676_bit_write(uint8_t i2c_address, uint8_t register_address, uint8_t bit_number, uint8_t bit_data)
Writes any bit inside the LTC3676 using the standard I2C repeated start format.
#define LTC3676_REG_DVB4B
int8_t LTC3676_bit_clear(uint8_t i2c_address, uint8_t register_address, uint8_t bit_number)
Clears any bit inside the LTC3676 using the standard I2C repeated start format.
int8_t LTC3676_register_read(uint8_t i2c_address, uint8_t register_address, uint8_t *register_data)
Reads an 8-bit register from the LTC3676 using the standard repeated start format.
#define LTC3676_RES_BUCK3_RBOT
#define LTC3676_REG_DVB3B
LTC3676: Power management solution for application processors.
#define LTC3676_BUCK_MODE_MASK
#define LTC3676_UV_WARN_THRESH_MASK
int8_t LTC3676_set_uv_warning_threshold(uint8_t i2c_address, float uv_warning_threshold)
Writes a new UV warning threshold voltage in the CTRL register.
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".
#define LTC3676_RES_BUCK4_RTOP
int8_t LTC3676_bit_set(uint8_t i2c_address, uint8_t register_address, uint8_t bit_number)
Sets any bit inside the LTC3676 using the standard I2C repeated start format.
#define LTC3676_REG_BUCK3
float LTC3676_set_buck_output_voltage(uint8_t i2c_address, uint8_t register_address, float output_voltage)
Sets the output voltage of any buck.
#define LTC3676_RES_BUCK3_RTOP
int8_t LTC3676_set_buck_pgood_mask(uint8_t i2c_address, uint8_t buck_number, uint8_t pgood_bit)
Sets the PGOOD mask bit in the DVBxB register for all bucks.
#define LTC3676_OT_WARN_LEVEL_MASK
#define LTC3676_LDO_SEQ_MASK(num)
#define LTC3676_REG_DVB1B
#define LTC3676_1_LDO4_VOLTAGE_MASK
LT_I2C: Routines to communicate with ATmega328P's hardware I2C port.
#define LTC3676_BUCK_SEQ_MASK(num)
#define LTC3676_FB_REF_MASK
int8_t LTC3676_1_set_ldo4_voltage(uint8_t i2c_address, uint8_t ldo4_output_voltage_code)
Sets LDO4 output voltage on the LTC3676-1.
#define LTC3676_RES_BUCK4_RBOT
#define LTC3676_REG_BUCK4
int8_t LTC3676_set_overtemp_warning_level(uint8_t i2c_address, uint8_t ot_warning_level)
Writes the UV warning threshold of any buck.
#define LTC3676_BUCK_STARTUP