/*
 * soft_i2c.h
 */

#ifndef USER_COMM_SOFT_I2C_MASTER_H_
#define USER_COMM_SOFT_I2C_MASTER_H_

#include <CH59x_common.h>
#include <stdint.h>



void i2cm_init();

void i2cm_start();
void i2cm_restart();
void i2cm_stop();

uint8_t i2cm_rd(uint8_t ack);
uint8_t i2cm_wr(uint8_t dat);
uint8_t i2cm_addr(uint8_t addr, uint8_t reading_bit);

void i2cm_rdbuf(uint8_t *dat, uint16_t len);
void i2cm_wrbuf(const uint8_t *dat, uint16_t len);



#endif /* USER_COMM_SOFT_I2C_MASTER_H_ */
