ESP32-P4 OBC Firmware
ESP-IDF firmware for Plant-B CubeSat OBC
 
Loading...
Searching...
No Matches
i2c_master.h
Go to the documentation of this file.
1
25
26#ifndef __I2C_MASTER_H__
27#define __I2C_MASTER_H__
28
29#include "esp_err.h"
30#include "i2c_bus.h"
31#include "esp_log.h"
32
42
46#define I2C_MASTER_SCL_IO (8)
47#define I2C_MASTER_SDA_IO (7)
48#define I2C_MASTER_NUM I2C_NUM_0
49#define I2C_MASTER_FREQ_HZ (100000)
51
52#ifdef __cplusplus
53extern "C" {
54#endif
55
60typedef float i2c_freq_t;
61
66typedef uint8_t i2c_sda_t;
67
72typedef uint8_t i2c_scl_t;
73
91i2c_bus_handle_t i2c_master_bus_init(
92 i2c_port_t p,
93 i2c_sda_t d,
94 i2c_scl_t c,
96);
97
108esp_err_t i2c_master_bus_scan(i2c_bus_handle_t bus);
109
119void i2c_master_bus_deinit(i2c_bus_handle_t bus);
120
121#ifdef __cplusplus
122}
123#endif
124 // end of i2c_master group
126
127#endif // __I2C_MASTER_H__
128
void i2c_master_bus_deinit(i2c_bus_handle_t bus)
Deinitialize the I²C master bus.
Definition i2c_master.c:70
uint8_t i2c_scl_t
Type for I²C SCL pin number.
Definition i2c_master.h:72
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.
Definition i2c_master.c:30
uint8_t i2c_sda_t
Type for I²C SDA pin number.
Definition i2c_master.h:66
float i2c_freq_t
Type for I²C clock frequency in Hz.
Definition i2c_master.h:60
esp_err_t i2c_master_bus_scan(i2c_bus_handle_t bus)
Scan for devices on the given I²C bus.
Definition i2c_master.c:54