first commit

This commit is contained in:
David R.
2025-09-05 18:58:05 +02:00
parent fc13e0779b
commit ed05c83ac6
3678 changed files with 832193 additions and 0 deletions
@@ -0,0 +1,10 @@
# The following five lines of boilerplate have to be in your project's
# CMakeLists in this exact order for cmake to work correctly
cmake_minimum_required(VERSION 3.16)
set(EXTRA_COMPONENT_DIRS
../common_components
)
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(mp3_player)
@@ -0,0 +1,222 @@
dependencies:
chmorgan/esp-audio-player:
component_hash: c8ac1998e9af863bc41b57e592f88d1a5791a0f891485122336ddabbf7a65033
dependencies:
- name: chmorgan/esp-libhelix-mp3
registry_url: https://components.espressif.com
require: private
version: '>=1.0.0,<2.0.0'
- name: idf
require: private
version: '>=5.0'
source:
registry_url: https://components.espressif.com/
type: service
version: 1.0.7
chmorgan/esp-file-iterator:
component_hash: 327091394b9ef5c2cd395a960ab70ae64479e0a8831cbd9925e38895fad93719
dependencies:
- name: idf
require: private
version: '>=4.1.0'
source:
registry_url: https://components.espressif.com/
type: service
version: 1.0.0
chmorgan/esp-libhelix-mp3:
component_hash: cbb76089dc2c5749f7b470e2e70aedc44c9da519e04eb9a67d4c7ec275229e53
dependencies:
- name: idf
require: private
version: '>=4.1.0'
source:
registry_url: https://components.espressif.com
type: service
version: 1.0.3
espressif/button:
component_hash: f53face2ab21fa0ffaf4cf0f6e513d393f56df6586bb2ad1146120f03f19ee05
dependencies:
- name: espressif/cmake_utilities
registry_url: https://components.espressif.com
require: private
version: '*'
- name: idf
require: private
version: '>=4.0'
source:
registry_url: https://components.espressif.com/
type: service
version: 4.1.3
espressif/cmake_utilities:
component_hash: 351350613ceafba240b761b4ea991e0f231ac7a9f59a9ee901f751bddc0bb18f
dependencies:
- name: idf
require: private
version: '>=4.1'
source:
registry_url: https://components.espressif.com
type: service
version: 0.5.3
espressif/esp32_p4_function_ev_board:
dependencies:
- name: espressif/esp_codec_dev
public: true
version: 1.2.*
- name: espressif/esp_lcd_ek79007
version: 1.*
- name: espressif/esp_lcd_ili9881c
version: 1.*
- name: espressif/esp_lcd_touch_gt911
version: ^1
- name: waveshare/esp_lcd_jd9365_10_1
version: ^1.0.3
- name: espressif/esp_lvgl_port
public: true
version: ^2
- name: idf
version: '>=5.3'
- name: lvgl/lvgl
version: '>=8,<10'
source:
path: /home/jczn/esp/JC-ESP32P4-M3-DEV/common_components/espressif__esp32_p4_function_ev_board
type: local
targets:
- esp32p4
version: 4.1.1
espressif/esp_codec_dev:
component_hash: 014948481bda426cd46714f297fe1891711246c62bea288863a8cc8cf13ef1f0
dependencies:
- name: idf
require: private
version: '>=4.0'
source:
registry_url: https://components.espressif.com/
type: service
version: 1.2.0
espressif/esp_lcd_ek79007:
component_hash: 07c1afab7e9fd4dd2fd06ff9245e65327c5bbd5485efec199496e19a9304d47b
dependencies:
- name: espressif/cmake_utilities
registry_url: https://components.espressif.com
require: private
version: 0.*
- name: idf
require: private
version: '>=5.3'
source:
registry_url: https://components.espressif.com/
type: service
targets:
- esp32p4
version: 1.0.2
espressif/esp_lcd_ili9881c:
component_hash: f4f374226b62baf13f735864e8fae58e17c537df34d598e059f6caad4761ef65
dependencies:
- name: idf
require: private
version: '>=5.3'
source:
registry_url: https://components.espressif.com/
type: service
targets:
- esp32p4
version: 1.0.1
espressif/esp_lcd_touch:
component_hash: 779b4ba2464a3ae85681e4b860caa5fdc35801458c23f3039ee761bae7f442a4
dependencies:
- name: idf
require: private
version: '>=4.4.2'
source:
registry_url: https://components.espressif.com
type: service
version: 1.1.2
espressif/esp_lcd_touch_gt911:
component_hash: acc1c184358aa29ef72506f618c9c76a8cc2bf12af38a2bff3d44d84f3a08857
dependencies:
- name: espressif/esp_lcd_touch
registry_url: https://components.espressif.com
require: public
version: ^1.1.0
- name: idf
require: private
version: '>=4.4.2'
source:
registry_url: https://components.espressif.com/
type: service
version: 1.1.3
espressif/esp_lvgl_port:
component_hash: e720c95cf0667554a204591bb5fade4655fb2990465557041200fa44b5bc7556
dependencies:
- name: idf
require: private
version: '>=4.4'
- name: lvgl/lvgl
registry_url: https://components.espressif.com
require: public
version: '>=8,<10'
source:
registry_url: https://components.espressif.com/
type: service
version: 2.6.0
espressif/i2c_bus:
component_hash: e3dddc78baa172f4768f3973fbecbd6c6c1f2cb23cc6a36cf3132758be092482
dependencies:
- name: espressif/cmake_utilities
registry_url: https://components.espressif.com
require: private
version: 0.*
- name: idf
require: private
version: '>=4.0'
source:
registry_url: https://components.espressif.com
type: service
version: 1.4.0
idf:
source:
type: idf
version: 5.5.0
lvgl/lvgl:
component_hash: b702d642e03e95928046d5c6726558e6444e112420c77efa5fdb6650b0a13c5d
dependencies: []
source:
registry_url: https://components.espressif.com/
type: service
version: 9.3.0
waveshare/esp_lcd_jd9365_10_1:
component_hash: 148d03ade699a7fa0f08c98e86c1df3d32e92580fac421c04e0ee5b779e86267
dependencies:
- name: espressif/cmake_utilities
registry_url: https://components.espressif.com
require: private
version: 0.*
- name: espressif/i2c_bus
registry_url: https://components.espressif.com
require: private
version: ^1.3.0
- name: idf
require: private
version: '>=5.3'
source:
registry_url: https://components.espressif.com/
type: service
targets:
- esp32p4
version: 1.0.3
direct_dependencies:
- chmorgan/esp-audio-player
- chmorgan/esp-file-iterator
- espressif/button
- espressif/esp32_p4_function_ev_board
- espressif/esp_codec_dev
- espressif/esp_lcd_ek79007
- espressif/esp_lcd_ili9881c
- espressif/esp_lcd_touch_gt911
- espressif/esp_lvgl_port
- idf
- lvgl/lvgl
- waveshare/esp_lcd_jd9365_10_1
manifest_hash: 229ed32ff9200019cd1a12c5bf4b55456c8c469acd0d6599875ec89a02c14973
target: esp32p4
version: 2.0.0
@@ -0,0 +1,2 @@
idf_component_register(SRCS "mp3_player.c"
INCLUDE_DIRS ".")
@@ -0,0 +1,17 @@
## IDF Component Manager Manifest File
dependencies:
## Required IDF version
idf:
version: '>=4.1.0'
# # Put list of dependencies here
# # For components maintained by Espressif:
# component: "~1.0.0"
# # For 3rd party components:
# username/component: ">=1.0.0,<2.0.0"
# username2/component2:
# version: "~1.0.0"
# # For transient dependencies `public` flag can be set.
# # `public` flag doesn't have an effect dependencies of the `main` component.
# # All dependencies of `main` are public by default.
# public: true
espressif/button: ^4.1.3
@@ -0,0 +1,78 @@
#include <stdio.h>
#include "sdkconfig.h"
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "freertos/semphr.h"
#include "driver/gpio.h"
#include "driver/ledc.h"
#include "esp_err.h"
#include "esp_log.h"
#include "esp_check.h"
#include "esp_spiffs.h"
#include "esp_vfs_fat.h"
#include "bsp/esp-bsp.h"
#include "bsp/display.h"
#include "bsp_board_extra.h"
#include "audio_player.h"
#include "file_iterator.h"
#include "iot_button.h"
#include "button_gpio.h"
#define TAG "mp3_player"
#define MUSIC_DIR "/sdcard/music"
#define BUTTON_IO_NUM 35
#define BUTTON_ACTIVE_LEVEL 0
file_iterator_instance_t *_file_iterator;
static audio_player_cb_t audio_idle_callback = NULL;
static QueueHandle_t event_queue;
static SemaphoreHandle_t semph_event;
int music_cnt = 0;
int cnt = 0;
static void audio_player_callback(audio_player_cb_ctx_t *ctx)
{
ESP_LOGI(TAG,"audio_player_callback %d",ctx->audio_event);
if(ctx->audio_event == AUDIO_PLAYER_CALLBACK_EVENT_SHUTDOWN || ctx->audio_event == AUDIO_PLAYER_CALLBACK_EVENT_IDLE)
xSemaphoreGive(semph_event);
// xQueueSend(event_queue, &(ctx->audio_event), 0);
}
static void mp3_player_task(void *arg)
{
audio_player_callback_event_t event;
while(true)
{
bsp_extra_player_play_index(_file_iterator,cnt);
cnt++;
if(cnt > music_cnt)
cnt = 0;
xSemaphoreTake(semph_event, portMAX_DELAY);
}
bsp_extra_player_del();
vTaskDelete(NULL);
}
void app_main(void)
{
esp_err_t ret = bsp_sdcard_mount();
if(ret == ESP_OK)
ESP_LOGI(TAG, "SD card mount successfully");
ESP_ERROR_CHECK(bsp_extra_codec_init());
bsp_extra_codec_volume_set(40,NULL);
bsp_extra_player_init();
_file_iterator = file_iterator_new(MUSIC_DIR);
music_cnt = file_iterator_get_count(_file_iterator);
event_queue = xQueueCreate(1, sizeof(audio_player_callback_event_t));
semph_event = xSemaphoreCreateBinary();
bsp_extra_player_register_callback(audio_player_callback,NULL);
xTaskCreatePinnedToCore(mp3_player_task,"mp3_player",4096,NULL,4,NULL,1);
}
@@ -0,0 +1,6 @@
# Name, Type, SubType, Offset, Size, Flags
# Note: if you change the phy_init or app partition offset, make sure to change the offset in Kconfig.projbuild
nvs, data, nvs, 0x9000, 0x6000,
phy_init, data, phy, 0xf000, 0x1000,
factory, app, factory, , 9M,
storage, data, spiffs, , 5M,
1 # Name, Type, SubType, Offset, Size, Flags
2 # Note: if you change the phy_init or app partition offset, make sure to change the offset in Kconfig.projbuild
3 nvs, data, nvs, 0x9000, 0x6000,
4 phy_init, data, phy, 0xf000, 0x1000,
5 factory, app, factory, , 9M,
6 storage, data, spiffs, , 5M,
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,45 @@
# This file was generated using idf.py save-defconfig. It can be edited manually.
# Espressif IoT Development Framework (ESP-IDF) 5.5.0 Project Minimal Configuration
#
CONFIG_IDF_TARGET="esp32p4"
CONFIG_ESPTOOLPY_FLASHMODE_QIO=y
CONFIG_ESPTOOLPY_FLASHSIZE_16MB=y
CONFIG_PARTITION_TABLE_CUSTOM=y
CONFIG_COMPILER_OPTIMIZATION_PERF=y
CONFIG_SPIRAM=y
CONFIG_SPIRAM_SPEED_200M=y
CONFIG_SPIRAM_XIP_FROM_PSRAM=y
CONFIG_CACHE_L2_CACHE_256KB=y
CONFIG_CACHE_L2_CACHE_LINE_128B=y
CONFIG_ESP_MAIN_TASK_STACK_SIZE=4096
CONFIG_FATFS_LFN_HEAP=y
CONFIG_FATFS_API_ENCODING_UTF_8=y
CONFIG_FREERTOS_HZ=1000
CONFIG_FREERTOS_VTASKLIST_INCLUDE_COREID=y
CONFIG_FREERTOS_GENERATE_RUN_TIME_STATS=y
CONFIG_LV_USE_CLIB_MALLOC=y
CONFIG_LV_USE_CLIB_STRING=y
CONFIG_LV_USE_CLIB_SPRINTF=y
CONFIG_LV_DEF_REFR_PERIOD=15
CONFIG_LV_OS_FREERTOS=y
CONFIG_LV_DRAW_SW_DRAW_UNIT_CNT=2
CONFIG_LV_ATTRIBUTE_FAST_MEM_USE_IRAM=y
CONFIG_LV_FONT_MONTSERRAT_12=y
CONFIG_LV_FONT_MONTSERRAT_16=y
CONFIG_LV_FONT_MONTSERRAT_18=y
CONFIG_LV_FONT_MONTSERRAT_22=y
CONFIG_LV_USE_FONT_COMPRESSED=y
CONFIG_LV_TXT_BREAK_CHARS=" ,.;:-_"
CONFIG_LV_USE_SYSMON=y
CONFIG_LV_USE_PERF_MONITOR=y
CONFIG_LV_USE_IMGFONT=y
CONFIG_LV_USE_DEMO_BENCHMARK=y
CONFIG_LV_USE_DEMO_RENDER=y
CONFIG_LV_USE_DEMO_SCROLL=y
CONFIG_LV_USE_DEMO_STRESS=y
CONFIG_LV_USE_DEMO_TRANSFORM=y
CONFIG_LV_USE_DEMO_MUSIC=y
CONFIG_LV_DEMO_MUSIC_AUTO_PLAY=y
CONFIG_LV_USE_DEMO_FLEX_LAYOUT=y
CONFIG_LV_USE_DEMO_MULTILANG=y
CONFIG_IDF_EXPERIMENTAL_FEATURES=y
File diff suppressed because it is too large Load Diff