You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
540 B

#ifndef __I2C_MASTER_H__
#define __I2C_MASTER_H__
#include <stdbool.h>
// Global structs
#include "drivers/drivers.h"
#define i2c_master_wait os_delay_us
void i2c_master_stop(i2c_t* i2c);
void i2c_master_start(i2c_t* i2c);
void i2c_master_setAck(i2c_t* i2c, uint8_t level);
uint8_t i2c_master_getAck(i2c_t* i2c);
uint8_t i2c_master_readByte(i2c_t* i2c);
void i2c_master_writeByte(i2c_t* i2c, uint8_t wrdata);
bool i2c_master_checkAck(i2c_t* i2c);
void i2c_master_send_ack(i2c_t* i2c);
void i2c_master_send_nack(i2c_t* i2c);