ESP32-P4 OBC Firmware
ESP-IDF firmware for Plant-B CubeSat OBC
 
Loading...
Searching...
No Matches
i2c_master.h File Reference

ESP-IDF wrapper for default I²C master bus management. More...

#include "esp_err.h"
#include "i2c_bus.h"
#include "esp_log.h"

Go to the source code of this file.

Macros

I²C Master Default Pins and Settings
#define I2C_MASTER_SCL_IO   (8)
 GPIO number for I²C SCL.
 
#define I2C_MASTER_SDA_IO   (7)
 GPIO number for I²C SDA.
 
#define I2C_MASTER_NUM   I2C_NUM_0
 I²C port number.
 
#define I2C_MASTER_FREQ_HZ   (100000)
 I²C clock frequency in Hz.
 

Typedefs

typedef float i2c_freq_t
 Type for I²C clock frequency in Hz.
 
typedef uint8_t i2c_sda_t
 Type for I²C SDA pin number.
 
typedef uint8_t i2c_scl_t
 Type for I²C SCL pin number.
 

Functions

i2c_bus_handle_t i2c_master_bus_init (i2c_port_t p, i2c_sda_t d, i2c_scl_t c, i2c_freq_t f)
 Initialize an I²C master bus.
 
esp_err_t i2c_master_bus_scan (i2c_bus_handle_t bus)
 Scan for devices on the given I²C bus.
 
void i2c_master_bus_deinit (i2c_bus_handle_t bus)
 Deinitialize the I²C master bus.
 

Detailed Description

ESP-IDF wrapper for default I²C master bus management.

Author
Adrien Chevrier

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see https://www.gnu.org/licenses/.

Version
0.1
Date
2026-02-05