79 uint8_t begining_value
103 void pecAdd(uint8_t byte_value);
117 uint8_t
getCRC (uint8_t *data);
122 uint8_t begining_value,
148 virtual uint8_t
readByte(uint8_t address,
161 virtual uint16_t
readWord(uint8_t address,
178 uint16_t block_out_size,
180 uint16_t block_in_size
185 virtual uint8_t
readBlock(uint8_t address,
193 virtual void sendByte(uint8_t address,
205 virtual uint8_t *
probe(uint8_t command
virtual uint8_t readAlert(void)=0
Perform ARA.
virtual void sendByte(uint8_t address, uint8_t command)=0
SMBus send byte command.
bool pecEnabled(void)
Check if PEC is enabled.
uint8_t getCRC(uint8_t *data)
Get CRC of block data organized as 31 bytes pluse CRC.
virtual void writeWord(uint8_t address, uint8_t command, uint16_t data)=0
SMBus write word command.
union LT_union_int32_4bytes data
uint8_t doCalculate(uint8_t data, uint8_t begining_value)
Helper function for pec.
virtual void writeBytes(uint8_t *addresses, uint8_t *commands, uint8_t *data, uint8_t no_addresses)=0
SMBus write byte command for a list of addresses.
void constructTable(uint16_t user_polynomial)
Initialize the table used to speed up pec calculations.
bool checkCRC(uint8_t *data)
Check CRC of block data organized as 31 data bytes plus CRC.
uint8_t pecGet(void)
Get the current pec result.
virtual uint8_t waitForAck(uint8_t address, uint8_t command)=0
Read with the address and command in loop until ack, then issue stop.
LT_I2CBus: Routines to communicate to I2C by Wire Library.
unsigned char poly_
The poly used in the calc.
uint16_t crc_polynomial_
The crc poly used in the calc.
virtual uint8_t * probeUnique(uint8_t command)=0
SMBus bus probe.
virtual void writeByte(uint8_t address, uint8_t command, uint8_t data)=0
SMBus write byte command.
virtual uint8_t readByte(uint8_t address, uint8_t command)=0
SMBus read byte command.
uint8_t running_pec_
Temporary pec calc value.
virtual uint8_t * probe(uint8_t command)=0
SMBus bus probe.
virtual LT_I2CBus * i2cbus(void)=0
void pecClear(void)
Clear the pec value so it can start a new calculation.
virtual uint8_t readBlock(uint8_t address, uint8_t command, uint8_t *block, uint16_t block_size)=0
SMBus read block command.
uint8_t calculate(uint8_t *data, uint8_t begining_value, uint8_t start_index, uint8_t length)
Helper function for pec.
virtual void writeBlock(uint8_t address, uint8_t command, uint8_t *block, uint16_t block_size)=0
SMBus write block command.
virtual uint8_t writeReadBlock(uint8_t address, uint8_t command, uint8_t *block_out, uint16_t block_out_size, uint8_t *block_in, uint16_t block_in_size)=0
SMBus write then read block command.
void pecAdd(uint8_t byte_value)
Add a byte to the pec calculation.
virtual uint16_t readWord(uint8_t address, uint8_t command)=0
SMBus read word command.