Kestrel Interface
Loading...
Searching...
No Matches
kest_i2c.h
Go to the documentation of this file.
1#ifndef KEST_ESP32_I2C_H_
2#define KEST_ESP32_I2C_H_
3
4#include <stdint.h>
5
6#define I2C_MASTER_SCL_IO 7
7#define I2C_MASTER_SDA_IO 8
8#define I2C_MASTER_NUM 0
9#define I2C_MASTER_FREQ_HZ 100000
10#define I2C_MASTER_TX_BUF_DISABLE 0
11#define I2C_MASTER_RX_BUF_DISABLE 0
12#define I2C_MASTER_TIMEOUT_MS 10
13
14esp_err_t i2c_master_init();
15
16int i2c_transmit_persistent(uint8_t addr, uint8_t *buf, int n, int retries);
17int i2c_transmit(uint8_t addr, uint8_t *buf, int n);
18int i2c_receive(uint8_t addr, uint8_t *buf, int n);
19
20extern SemaphoreHandle_t i2c_mutex;
21
22#endif
23
int i2c_transmit(uint8_t addr, uint8_t *buf, int n)
int i2c_receive(uint8_t addr, uint8_t *buf, int n)
SemaphoreHandle_t i2c_mutex
int i2c_transmit_persistent(uint8_t addr, uint8_t *buf, int n, int retries)
esp_err_t i2c_master_init()