SensorLib 0.5.0
Multi-platform sensor driver library for Arduino, PlatformIO, and ESP-IDF
Loading...
Searching...
No Matches
i2c_driver.cpp File Reference
#include <cstring>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "driver/gpio.h"
#include "esp_log.h"
#include "sdkconfig.h"
#include "i2c_driver.h"
Include dependency graph for esp_idf_touch/main/i2c_driver.cpp:

Go to the source code of this file.

Macros

#define I2C_MASTER_NUM   (i2c_port_t)CONFIG_I2C_MASTER_PORT_NUM
 
#define I2C_MASTER_SDA_IO   (gpio_num_t)CONFIG_SENSOR_SDA
 
#define I2C_MASTER_SCL_IO   (gpio_num_t)CONFIG_SENSOR_SCL
 
#define I2C_MASTER_FREQ_HZ   CONFIG_I2C_MASTER_FREQUENCY
 
#define I2C_MASTER_TX_BUF_DISABLE   0
 
#define I2C_MASTER_RX_BUF_DISABLE   0
 

Functions

esp_err_t i2c_drv_init (void)
 i2c master initialization
 
void i2c_drv_scan ()
 
bool i2c_drv_probe (uint8_t devAddr)
 

Macro Definition Documentation

◆ I2C_MASTER_FREQ_HZ

#define I2C_MASTER_FREQ_HZ   CONFIG_I2C_MASTER_FREQUENCY

I2C master clock frequency

Definition at line 43 of file esp_idf_touch/main/i2c_driver.cpp.

◆ I2C_MASTER_NUM

#define I2C_MASTER_NUM   (i2c_port_t)CONFIG_I2C_MASTER_PORT_NUM

Definition at line 40 of file esp_idf_touch/main/i2c_driver.cpp.

◆ I2C_MASTER_RX_BUF_DISABLE

#define I2C_MASTER_RX_BUF_DISABLE   0

I2C master doesn't need buffer

Definition at line 45 of file esp_idf_touch/main/i2c_driver.cpp.

◆ I2C_MASTER_SCL_IO

#define I2C_MASTER_SCL_IO   (gpio_num_t)CONFIG_SENSOR_SCL

Definition at line 42 of file esp_idf_touch/main/i2c_driver.cpp.

◆ I2C_MASTER_SDA_IO

#define I2C_MASTER_SDA_IO   (gpio_num_t)CONFIG_SENSOR_SDA

Definition at line 41 of file esp_idf_touch/main/i2c_driver.cpp.

◆ I2C_MASTER_TX_BUF_DISABLE

#define I2C_MASTER_TX_BUF_DISABLE   0

I2C master doesn't need buffer

Definition at line 44 of file esp_idf_touch/main/i2c_driver.cpp.

Function Documentation

◆ i2c_drv_init()

esp_err_t i2c_drv_init ( void  )

◆ i2c_drv_probe()

bool i2c_drv_probe ( uint8_t  devAddr)

Definition at line 261 of file esp_idf_touch/main/i2c_driver.cpp.

References cmd, and I2C_MASTER_NUM.

Referenced by touch_drv_init().

◆ i2c_drv_scan()

void i2c_drv_scan ( )

Definition at line 208 of file esp_idf_touch/main/i2c_driver.cpp.

References cmd, i, and I2C_MASTER_NUM.

Referenced by app_main(), and touch_drv_init().