99 #define LTC4245_I2C_ADDRESS 0x20 //ADDR2 = L, ADDR1 = L, ADDR0 = L 100 #define LTC4245_I2C_ALERT_RESPONSE 0x0C 101 #define LTC4245_I2C_MASS_WRITE 0x17 107 #define LTC4245_STATUS_REG 0x00 108 #define LTC4245_ALERT_REG 0x01 109 #define LTC4245_CONTROL_REG 0x02 110 #define LTC4245_ON_REG 0x03 111 #define LTC4245_FAULT1_REG 0x04 112 #define LTC4245_FAULT2_REG 0x05 113 #define LTC4245_GPIO_REG 0x06 114 #define LTC4245_ADCADR_REG 0x07 120 #define LTC4245_12VIN_REG 0x10 121 #define LTC4245_12VSENSE_REG 0x11 122 #define LTC4245_12VOUT_REG 0x12 123 #define LTC4245_5VIN_REG 0x13 124 #define LTC4245_5VSENSE_REG 0x14 125 #define LTC4245_5VOUT_REG 0x15 126 #define LTC4245_3_3VIN_REG 0x16 127 #define LTC4245_3_3VSENSE_REG 0x17 128 #define LTC4245_3_3VOUT_REG 0x18 129 #define LTC4245_VEEIN_REG 0x19 130 #define LTC4245_VEESENSE_REG 0x1A 131 #define LTC4245_VEEOUT_REG 0x1B 132 #define LTC4245_GPIOADC1_REG 0x1C 133 #define LTC4245_GPIOADC2_REG 0x1D 134 #define LTC4245_GPIOADC3_REG 0x1E 135 #define LTC4245_GPIOADC4_REG 0x1F 141 #define LTC4245_GPIO1_STATE_CHANGE_ENABLE 0x80 142 #define LTC4245_GPIO1_STATE_CHANGE_DISABLE 0x7F 143 #define LTC4245_BD_SEL_STATE_CHANGE_ENABLE 0x40 144 #define LTC4245_BD_SEL_STATE_CHANGE_DISABLE 0xBF 145 #define LTC4245_FET_SHORT_ENABLE 0x20 146 #define LTC4245_FET_SHORT_DISABLE 0xDF 147 #define LTC4245_PGI_FAULT_ENABLE 0x10 148 #define LTC4245_PGI_FAULT_DISABLE 0xEF 149 #define LTC4245_ALERT_PRESENT_ENABLE 0x08 150 #define LTC4245_ALERT_PRESENT_DISABLE 0xF7 151 #define LTC4245_POWER_BAD_ENABLE 0x04 152 #define LTC4245_POWER_BAD_DISABLE 0xFB 153 #define LTC4245_OVERCURRENT_ENABLE 0x02 154 #define LTC4245_OVERCURRENT_DISABLE 0xFD 155 #define LTC4245_UNDERVOLTAGE_ENABLE 0x01 156 #define LTC4245_UNDERVOLTAGE_DISABLE 0xFE 162 #define LTC4245_ADC_FREE_RUN_DISABLE 0x80 163 #define LTC4245_ADC_FREE_RUN_ENABLE 0x7F 165 #define LTC4245_SEQUENCING_ENABLE 0x40 166 #define LTC4245_SEQUENCING_DISABLE 0xBF 168 #define LTC4245_MASS_WRITE_ENABLE 0x20 169 #define LTC4245_MASS_WRITE_DISABLE 0xDF 171 #define LTC4245_PGI_FAULT_AUTO_RETRY_ENABLE 0x10 172 #define LTC4245_PGI_FAULT_AUTO_RETRY_DISABLE 0xEF 174 #define LTC4245_PGI_DISABLE 0x08 175 #define LTC4245_PGI_ENABLE 0xF7 177 #define LTC4245_OVERCURRENT_AUTO_RETRY_ENABLE 0x02 178 #define LTC4245_OVERCURRENT_AUTO_RETRY_DISABLE 0xFD 180 #define LTC4245_UNDERVOLTAGE_AUTO_RETRY_ENABLE 0x01 181 #define LTC4245_UNDERVOLTAGE_AUTO_RETRY_DISABLE 0xFE 189 #define LTC4245_NEG12V_OVERCURRENT_FAULT 0x80 190 #define LTC4245_3_3V_OVERCURRENT_FAULT 0x40 191 #define LTC4245_5V_OVERCURRENT_FAULT 0x20 192 #define LTC4245_12V_OVERCURRENT_FAULT 0x10 193 #define LTC4245_NEG12V_UNDERVOLTAGE_FAULT 0x08 194 #define LTC4245_3_3V_UNDERVOLTAGE_FAULT 0x04 195 #define LTC4245_5V_UNDERVOLTAGE_FAULT 0x02 196 #define LTC4245_12V_UNDERVOLTAGE_FAULT 0x01 198 #define LTC4245_GPIO1_STATE_CHANGE 0x80 199 #define LTC4245_BD_SEL_STATE_CHANGE 0x40 200 #define LTC4245_FET_SHORT_FAULT 0x20 201 #define LTC4245_PGI_FAULT 0x10 202 #define LTC4245_NEG12V_POWER_BAD_FAULT 0x08 203 #define LTC4245_3_3V_POWER_BAD_FAULT 0x04 204 #define LTC4245_5V_POWER_BAD_FAULT 0x02 205 #define LTC4245_12V_POWER_BAD_FAULT 0x01 213 float full_scale_voltage
int8_t LTC4245_write(uint8_t i2c_address, uint8_t command, uint8_t code)
Write an 8-bit code to the LTC4245.
float LTC4245_code_to_voltage(uint8_t register_code, float full_scale_voltage)
Calculates voltage from register code data.
int8_t LTC4245_read(uint8_t i2c_address, uint8_t command, uint8_t *code)
Reads an 8-bit adc_code from LTC4245.
int8_t LTC4245_ARA(uint8_t alert_response_address, uint8_t *i2c_address)
SMBus Alert ResponseProtocol: Sends an alert response command and releases /ALERT pin...