Files
Bionic_sphere/Lib/I2C_Driver/I2C_Driver.h
T
Misaki 5d79f88918 1. 进一步拓展了语音识别,目前可以从sd卡导入模型,避免了model文件占用flash分区大小
2. 进一步修改了语音识别,关闭了关键词唤醒功能,只保留了指令识别功能
3. 构建了业务层的基本框架(增加了底层驱动对于的C++兼容),业务代码采用C++编写,启用了RTTI(运行时类型识别)
2025-09-03 00:19:14 +08:00

33 lines
1.1 KiB
C

#pragma once
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#include <string.h> // For memcpy
#include "esp_log.h"
#include "driver/gpio.h"
#include "driver/i2c.h"
/********************* I2C *********************/
#define I2C_SCL_IO 10 /*!< GPIO number used for I2C master clock */
#define I2C_SDA_IO 11 /*!< GPIO number used for I2C master data */
#define I2C_MASTER_NUM 0 /*!< I2C master i2c port number, the number of i2c peripheral interfaces available will depend on the chip */
#define I2C_MASTER_FREQ_HZ 400000 /*!< I2C master clock frequency */
#define I2C_MASTER_TX_BUF_DISABLE 0 /*!< I2C master doesn't need buffer */
#define I2C_MASTER_RX_BUF_DISABLE 0 /*!< I2C master doesn't need buffer */
#define I2C_MASTER_TIMEOUT_MS 1000
void I2C_Init(void);
// Reg addr is 8 bit
esp_err_t I2C_Write(uint8_t Driver_addr, uint8_t Reg_addr, const uint8_t *Reg_data, uint32_t Length);
esp_err_t I2C_Read(uint8_t Driver_addr, uint8_t Reg_addr, uint8_t *Reg_data, uint32_t Length);
#ifdef __cplusplus
}
#endif