Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
portapack-mayhem
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mcules
portapack-mayhem
Commits
fe7cc1e2
Commit
fe7cc1e2
authored
7 years ago
by
Jared Boone
Browse files
Options
Downloads
Patches
Plain Diff
Audio: Add I2S mode for TX external SCK/WS.
parent
58e0432b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
firmware/application/audio.cpp
+29
-0
29 additions, 0 deletions
firmware/application/audio.cpp
with
29 additions
and
0 deletions
firmware/application/audio.cpp
+
29
−
0
View file @
fe7cc1e2
...
...
@@ -33,6 +33,8 @@ namespace audio {
namespace
{
// "Master": I2S peripheral generates SCK/WS, transmits to audio codec.
constexpr
i2s
::
ConfigTX
i2s0_config_tx_master_base_clk
{
.
dao
=
i2s
::
DAO
{
.
wordwidth
=
i2s
::
WordWidth
::
Bits16
,
...
...
@@ -82,6 +84,33 @@ constexpr i2s::ConfigRX i2s0_config_rx_four_wire {
.
sck_in_sel
=
0
,
};
// "Slave": I2S controlled by external SCK/WS, received from audio codec.
constexpr
i2s
::
ConfigTX
i2s0_config_tx_slave_base_clk
{
.
dao
=
i2s
::
DAO
{
.
wordwidth
=
i2s
::
WordWidth
::
Bits16
,
.
mono
=
0
,
.
stop
=
1
,
.
reset
=
0
,
.
ws_sel
=
1
,
.
ws_halfperiod
=
0x0f
,
.
mute
=
1
,
},
.
txrate
=
i2s
::
MCLKRate
{
.
x_divider
=
0
,
.
y_divider
=
0
,
},
.
txbitrate
=
i2s
::
BitRate
{
.
bitrate
=
0
,
},
.
txmode
=
i2s
::
Mode
{
.
clksel
=
i2s
::
ClockSelect
::
FractionalDivider
,
.
four_pin
=
0
,
.
mclk_out_en
=
1
,
},
.
sck_in_sel
=
1
,
};
constexpr
i2s
::
ConfigDMA
i2s0_config_dma
{
.
dma1
=
i2s
::
DMA
{
.
rx_enable
=
1
,
...
...
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