Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
ESP32
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
C-Fu
ESP32
Commits
b1102e37
Commit
b1102e37
authored
4 years ago
by
Carsten Fuhrmann
Browse files
Options
Downloads
Patches
Plain Diff
externer DAC code anpassung
parent
1c65ed8c
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
Audio_Test/Audio_Test.ino
+15
-8
15 additions, 8 deletions
Audio_Test/Audio_Test.ino
with
15 additions
and
8 deletions
Audio_Test/Audio_Test.ino
+
15
−
8
View file @
b1102e37
...
...
@@ -18,17 +18,22 @@ int amplitude = 100;
int
freq
=
10
;
i2s_config_t
i2s_config
=
{
.
mode
=
(
i2s_mode_t
)(
I2S_MODE_MASTER
|
I2S_MODE_TX
|
I2S_MODE_DAC_BUILT_IN
),
.
mode
=
(
i2s_mode_t
)(
I2S_MODE_MASTER
|
I2S_MODE_TX
),
.
sample_rate
=
48000
,
// corrected by info from bluetooth
.
bits_per_sample
=
I2S_BITS_PER_SAMPLE_16BIT
,
//the DAC module will only take the 8bits from MSB
.
channel_format
=
I2S_CHANNEL_FMT_RIGHT_LEFT
,
.
communication_format
=
I2S_COMM_FORMAT_I2S
_MSB
,
.
communication_format
=
I2S_COMM_FORMAT_I2S
,
.
intr_alloc_flags
=
0
,
// default interrupt priority
.
dma_buf_count
=
8
,
.
dma_buf_len
=
64
,
.
use_apll
=
false
,
.
tx_desc_auto_clear
=
false
,
.
fixed_mclk
=
0
.
use_apll
=
false
};
static
const
i2s_pin_config_t
pin_config
=
{
.
bck_io_num
=
26
,
.
ws_io_num
=
25
,
.
data_out_num
=
27
,
.
data_in_num
=
I2S_PIN_NO_CHANGE
};
void
cb_a2d
(
esp_a2d_cb_event_t
event
,
esp_a2d_cb_param_t
*
param
)
{
...
...
@@ -52,7 +57,8 @@ void cb_a2d(esp_a2d_cb_event_t event, esp_a2d_cb_param_t* param) {
Serial
.
println
(
i2s_config
.
sample_rate
);
i2s_set_clk
(
I2S_NUM_0
,
i2s_config
.
sample_rate
,
i2s_config
.
bits_per_sample
,
I2S_CHANNEL_STEREO
);
//i2s_set_clk(I2S_NUM_0, i2s_config.sample_rate, i2s_config.bits_per_sample, I2S_CHANNEL_STEREO);
i2s_set_sample_rates
(
I2S_NUM_0
,
i2s_config
.
sample_rate
);
}
else
if
(
param
->
audio_cfg
.
mcc
.
type
==
ESP_A2D_MCT_M12
)
{
Serial
.
write
(
"MPEG-1, 2 Audio"
);
...
...
@@ -125,8 +131,9 @@ void setup_bti2s() {
bt_init
(
"ESP32 Audiotest"
,
cb_a2d
,
cb_audiodata
);
i2s_driver_install
(
I2S_NUM_0
,
&
i2s_config
,
0
,
NULL
);
i2s_set_pin
(
I2S_NUM_0
,
NULL
);
i2s_set_dac_mode
(
I2S_DAC_CHANNEL_BOTH_EN
);
i2s_set_pin
(
I2S_NUM_0
,
&
pin_config
);
//i2s_set_pin(I2S_NUM_0, NULL);
//i2s_set_dac_mode(I2S_DAC_CHANNEL_BOTH_EN);
i2s_set_sample_rates
(
I2S_NUM_0
,
i2s_config
.
sample_rate
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment