HF-TMC51x0 Driver (TMC5130 & TMC5160) 0.1.0-dev
Hardware Agnostic C++ Driver for the TMC51x0 (TMC5130 & TMC5160)
Loading...
Searching...
No Matches
i2c_scan.cpp File Reference

Simple I2C bus scanner for the OLED UI board wiring. More...

#include <cinttypes>
#include <cstdio>
#include "driver/i2c_master.h"
#include "esp_err.h"
#include "esp_log.h"
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "tmc51x0.hpp"
Include dependency graph for i2c_scan.cpp:

Functions

static esp_err_t scan_address (i2c_master_bus_handle_t bus, uint8_t addr, TickType_t timeout_ticks, uint32_t freq_hz)
 
static void scan_at_frequency (i2c_master_bus_handle_t bus_handle, uint32_t freq_hz)
 
void app_main (void)
 

Variables

static const char * TAG = "I2C_SCAN"
 
static constexpr i2c_port_t I2C_PORT = I2C_NUM_0
 
static constexpr gpio_num_t I2C_SDA_PIN = GPIO_NUM_5
 
static constexpr gpio_num_t I2C_SCL_PIN = GPIO_NUM_23
 
static constexpr uint32_t I2C_FREQ_FAST = 400000
 
static constexpr uint32_t I2C_FREQ_STD = 100000
 

Detailed Description

Simple I2C bus scanner for the OLED UI board wiring.

Uses the same pins as the fatigue_test_espnow_ui app to probe all 7-bit addresses (0x03-0x77) and logs any devices that acknowledge.

Function Documentation

◆ app_main()

void app_main ( void )
Here is the call graph for this function:

◆ scan_address()

static esp_err_t scan_address ( i2c_master_bus_handle_t bus,
uint8_t addr,
TickType_t timeout_ticks,
uint32_t freq_hz )
static
Here is the caller graph for this function:

◆ scan_at_frequency()

static void scan_at_frequency ( i2c_master_bus_handle_t bus_handle,
uint32_t freq_hz )
static
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ I2C_FREQ_FAST

constexpr uint32_t I2C_FREQ_FAST = 400000
staticconstexpr

◆ I2C_FREQ_STD

constexpr uint32_t I2C_FREQ_STD = 100000
staticconstexpr

◆ I2C_PORT

constexpr i2c_port_t I2C_PORT = I2C_NUM_0
staticconstexpr

◆ I2C_SCL_PIN

constexpr gpio_num_t I2C_SCL_PIN = GPIO_NUM_23
staticconstexpr

◆ I2C_SDA_PIN

constexpr gpio_num_t I2C_SDA_PIN = GPIO_NUM_5
staticconstexpr

◆ TAG

const char* TAG = "I2C_SCAN"
static