HiFi player project, first commit.
This commit is contained in:
commit
4126ea13a1
49 files changed
+6333
No files matched your search
@@ -0,0 +1,45 @@
|
||||
/**
|
||||
****************************************************************************************************
|
||||
* @file iic.c
|
||||
* @author 正点原子团队(ALIENTEK)
|
||||
* @version V1.0
|
||||
* @date 2025-01-01
|
||||
* @brief IIC驱动代码
|
||||
* @license Copyright (c) 2020-2032, 广州市星翼电子科技有限公司
|
||||
****************************************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* 实验平台:正点原子 ESP32-S3 开发板
|
||||
* 在线视频:www.yuanzige.com
|
||||
* 技术论坛:www.openedv.com
|
||||
* 公司网址:www.alientek.com
|
||||
* 购买地址:openedv.taobao.com
|
||||
*
|
||||
****************************************************************************************************
|
||||
*/
|
||||
|
||||
#include "myiic.h"
|
||||
|
||||
|
||||
i2c_master_bus_handle_t bus_handle; /* 总线句柄 */
|
||||
|
||||
/**
|
||||
* @brief 初始化MYIIC
|
||||
* @param 无
|
||||
* @retval ESP_OK:初始化成功
|
||||
*/
|
||||
esp_err_t myiic_init(void)
|
||||
{
|
||||
i2c_master_bus_config_t i2c_bus_config = {
|
||||
.clk_source = I2C_CLK_SRC_DEFAULT, /* 时钟源 */
|
||||
.i2c_port = IIC_NUM_PORT, /* I2C端口 */
|
||||
.scl_io_num = IIC_SCL_GPIO_PIN, /* SCL管脚 */
|
||||
.sda_io_num = IIC_SDA_GPIO_PIN, /* SDA管脚 */
|
||||
.glitch_ignore_cnt = 7, /* 故障周期 */
|
||||
.flags.enable_internal_pullup = true, /* 内部上拉 */
|
||||
};
|
||||
/* 新建I2C总线 */
|
||||
ESP_ERROR_CHECK(i2c_new_master_bus(&i2c_bus_config, &bus_handle));
|
||||
|
||||
return ESP_OK;
|
||||
}
|
||||
Reference in new issue
Block a user