Skip to content
Snippets Groups Projects
Commit fe7cc1e2 authored by Jared Boone's avatar Jared Boone
Browse files

Audio: Add I2S mode for TX external SCK/WS.

parent 58e0432b
No related branches found
No related tags found
No related merge requests found
......@@ -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,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment