-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
439 additions
and
331 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,24 @@ | ||
cmake_minimum_required(VERSION 3.12) | ||
|
||
set(PICO_SDK_PATH ${CMAKE_CURRENT_LIST_DIR}/../pico-sdk) | ||
|
||
# Pull in PICO SDK (must be before project) | ||
include(pico_sdk_import.cmake) | ||
|
||
# We also need PICO EXTRAS | ||
include(pico_extras_import.cmake) | ||
|
||
set(project_name "sine_wave" C CXX) | ||
project(${project_name}) | ||
set(CMAKE_C_STANDARD 11) | ||
set(CMAKE_CXX_STANDARD 17) | ||
|
||
pico_sdk_init() | ||
|
||
add_subdirectory(my_pico_audio) | ||
add_subdirectory(my_pico_audio_i2s) | ||
|
||
set(bin_name "sine_wave") | ||
add_executable(${bin_name} | ||
sine_wave.c | ||
) | ||
|
||
pico_enable_stdio_usb(${bin_name} 1) | ||
pico_enable_stdio_uart(${bin_name} 1) | ||
|
||
target_link_libraries(${bin_name} PRIVATE | ||
pico_stdlib | ||
my_pico_audio_i2s | ||
) | ||
|
||
target_compile_definitions(${bin_name} PRIVATE | ||
#define for our example code | ||
USE_AUDIO_I2S=1 | ||
) | ||
|
||
pico_add_extra_outputs(${bin_name}) | ||
if (NOT TARGET pico_audio_i2s_32b) | ||
add_library(pico_audio_i2s_32b INTERFACE) | ||
|
||
pico_generate_pio_header(pico_audio_i2s_32b | ||
${CMAKE_CURRENT_LIST_DIR}/src/audio_i2s.pio | ||
) | ||
|
||
target_sources(pico_audio_i2s_32b INTERFACE | ||
${CMAKE_CURRENT_LIST_DIR}/src/audio_i2s.c | ||
) | ||
|
||
target_link_libraries(pico_audio_i2s_32b INTERFACE | ||
pico_stdlib | ||
pico_multicore | ||
hardware_dma | ||
hardware_pio | ||
hardware_irq | ||
pico_audio_32b | ||
) | ||
|
||
target_include_directories(pico_audio_i2s_32b INTERFACE | ||
${CMAKE_CURRENT_LIST_DIR}/src/include | ||
) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
cmake_minimum_required(VERSION 3.13) | ||
|
||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON) | ||
|
||
include($ENV{PICO_SDK_PATH}/external/pico_sdk_import.cmake) | ||
include($ENV{PICO_EXTRAS_PATH}/external/pico_extras_import.cmake) | ||
|
||
set(project_name "sine_wave_i2s_32b" C CXX ASM) | ||
project(${project_name}) | ||
set(CMAKE_C_STANDARD 11) | ||
set(CMAKE_CXX_STANDARD 17) | ||
|
||
pico_sdk_init() | ||
|
||
add_subdirectory(../../src/pico_audio_32b pico_audio_32b) | ||
add_subdirectory(../.. pico_audio_i2s_32b) | ||
|
||
set(bin_name ${PROJECT_NAME}) | ||
add_executable(${PROJECT_NAME} | ||
sine_wave.cpp | ||
) | ||
|
||
pico_enable_stdio_usb(${bin_name} 1) | ||
pico_enable_stdio_uart(${bin_name} 1) | ||
|
||
target_link_libraries(${bin_name} PRIVATE | ||
pico_stdlib | ||
pico_audio_32b | ||
pico_audio_i2s_32b | ||
) | ||
|
||
# set PIO and DMA for I2S | ||
# set core1 process i2s_callback | ||
#target_compile_definitions(${PROJECT_NAME} PRIVATE | ||
# PICO_AUDIO_I2S_PIO=1 | ||
# PICO_AUDIO_I2S_DMA_IRQ=1 | ||
# CORE1_PROCESS_I2S_CALLBACK | ||
#) | ||
|
||
pico_add_extra_outputs(${bin_name}) |
Oops, something went wrong.