/*
 * i2c0.h
 *
 *  Created on: Dec 1, 2022
 *      Author: thomm
 */

#ifndef I2C0_H_
#define I2C0_H_

extern void i2c0_init(bool bFast);

int i2c0_read(uint8_t i2c_addr, uint8_t reg_addr, uint8_t* data, uint8_t length);
int i2c0_write(uint8_t i2c_addr, uint8_t reg_addr, uint8_t* data, uint8_t length);

uint8_t i2c0_read8(uint8_t i2c_addr, uint8_t reg_addr);
uint16_t i2c0_read16(uint8_t i2c_addr, uint8_t reg_addr);

int i2c0_write_reg_byte(uint8_t i2c_addr, uint8_t reg_addr, uint8_t data);
//int i2c0_write16(uint8_t i2c_addr, uint8_t reg_addr, uint16_t data16);

int i2c0_busScan(void);

#endif /* I2C0_H_ */
