HiFi player project, first commit.
This commit is contained in:
commit
4126ea13a1
49 files changed
+6333
No files matched your search
@@ -0,0 +1,41 @@
|
||||
/**
|
||||
****************************************************************************************************
|
||||
* @file led.c
|
||||
* @author 正点原子团队(ALIENTEK)
|
||||
* @version V1.0
|
||||
* @date 2025-01-01
|
||||
* @brief LED驱动代码
|
||||
* @license Copyright (c) 2020-2032, 广州市星翼电子科技有限公司
|
||||
****************************************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* 实验平台:正点原子 ESP32-S3 开发板
|
||||
* 在线视频:www.yuanzige.com
|
||||
* 技术论坛:www.openedv.com
|
||||
* 公司网址:www.alientek.com
|
||||
* 购买地址:openedv.taobao.com
|
||||
*
|
||||
****************************************************************************************************
|
||||
*/
|
||||
|
||||
#include "led.h"
|
||||
|
||||
|
||||
/**
|
||||
* @brief 初始化LED
|
||||
* @param 无
|
||||
* @retval 无
|
||||
*/
|
||||
void led_init(void)
|
||||
{
|
||||
gpio_config_t gpio_init_struct = {0};
|
||||
|
||||
gpio_init_struct.intr_type = GPIO_INTR_DISABLE; /* 失能引脚中断 */
|
||||
gpio_init_struct.mode = GPIO_MODE_INPUT_OUTPUT; /* 输入输出模式 */
|
||||
gpio_init_struct.pull_up_en = GPIO_PULLUP_DISABLE; /* 失能上拉 */
|
||||
gpio_init_struct.pull_down_en = GPIO_PULLDOWN_DISABLE; /* 失能下拉 */
|
||||
gpio_init_struct.pin_bit_mask = 1ull << LED0_GPIO_PIN; /* 设置的引脚的位掩码 */
|
||||
ESP_ERROR_CHECK(gpio_config(&gpio_init_struct)); /* 配置GPIO */
|
||||
|
||||
LED0(1); /* 关闭LED0 */
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
/**
|
||||
****************************************************************************************************
|
||||
* @file led.h
|
||||
* @author 正点原子团队(ALIENTEK)
|
||||
* @version V1.0
|
||||
* @date 2025-01-01
|
||||
* @brief LED驱动代码
|
||||
* @license Copyright (c) 2020-2032, 广州市星翼电子科技有限公司
|
||||
****************************************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* 实验平台:正点原子 ESP32-S3 开发板
|
||||
* 在线视频:www.yuanzige.com
|
||||
* 技术论坛:www.openedv.com
|
||||
* 公司网址:www.alientek.com
|
||||
* 购买地址:openedv.taobao.com
|
||||
*
|
||||
****************************************************************************************************
|
||||
*/
|
||||
|
||||
#ifndef __LED_H
|
||||
#define __LED_H
|
||||
|
||||
#include "driver/gpio.h"
|
||||
|
||||
|
||||
/* 引脚定义 */
|
||||
#define LED0_GPIO_PIN GPIO_NUM_1 /* LED0连接的GPIO端口 */
|
||||
|
||||
/* LED0端口定义 */
|
||||
#define LED0(x) do { x ? \
|
||||
gpio_set_level(LED0_GPIO_PIN, 1): \
|
||||
gpio_set_level(LED0_GPIO_PIN, 0); \
|
||||
} while(0) /* LED0翻转 */
|
||||
|
||||
/* LED取反定义 */
|
||||
#define LED0_TOGGLE() do { gpio_set_level(LED0_GPIO_PIN, !gpio_get_level(LED0_GPIO_PIN)); } while(0) /* LED0翻转 */
|
||||
|
||||
/* 函数声明*/
|
||||
void led_init(void); /* 初始化LED */
|
||||
|
||||
#endif
|
||||
Reference in new issue
Block a user