2017-01-16 21:33:30 +01:00
|
|
|
#ifndef __I2C_SW_MASTER_H__
|
|
|
|
#define __I2C_SW_MASTER_H__
|
|
|
|
|
2023-01-31 07:07:54 +01:00
|
|
|
#include "esp_rom_sys.h"
|
2017-01-16 21:33:30 +01:00
|
|
|
|
|
|
|
#define I2C_NUM_MAX 1
|
|
|
|
|
2021-10-20 12:24:09 +02:00
|
|
|
void i2c_sw_master_gpio_init(uint8_t sda, uint8_t scl);
|
2017-01-16 21:33:30 +01:00
|
|
|
void i2c_sw_master_init(void);
|
|
|
|
|
2023-01-31 07:07:54 +01:00
|
|
|
#define i2c_sw_master_wait esp_rom_delay_us
|
2017-01-16 21:33:30 +01:00
|
|
|
void i2c_sw_master_stop(void);
|
|
|
|
void i2c_sw_master_start(void);
|
|
|
|
void i2c_sw_master_setAck(uint8_t level);
|
|
|
|
uint8_t i2c_sw_master_getAck(void);
|
|
|
|
uint8_t i2c_sw_master_readByte(void);
|
|
|
|
void i2c_sw_master_writeByte(uint8_t wrdata);
|
|
|
|
|
|
|
|
bool i2c_sw_master_checkAck(void);
|
|
|
|
void i2c_sw_master_send_ack(void);
|
|
|
|
void i2c_sw_master_send_nack(void);
|
|
|
|
|
|
|
|
uint8_t i2c_sw_master_get_pinSDA();
|
|
|
|
uint8_t i2c_sw_master_get_pinSCL();
|
|
|
|
|
|
|
|
#endif
|