feat(i2s): enable i2s test on c5

This commit is contained in:
laokaiyao
2024-09-14 18:27:27 +08:00
committed by Kevin (Lao Kaiyao)
parent 0cb4bdc54e
commit ae36f84945
15 changed files with 135 additions and 61 deletions

View File

@@ -35,7 +35,6 @@ const i2s_signal_conn_t i2s_periph_signal[SOC_I2S_NUM] = {
.data_in_sigs[3] = I2S0_I_SD3_PAD_IN_IDX,
.irq = ETS_I2S0_INTR_SOURCE,
.retention_module = SLEEP_RETENTION_MODULE_I2S0,
},
[1] = {
.mck_out_sig = I2S1_MCLK_PAD_OUT_IDX,
@@ -59,7 +58,6 @@ const i2s_signal_conn_t i2s_periph_signal[SOC_I2S_NUM] = {
.data_in_sigs[3] = -1,
.irq = ETS_I2S1_INTR_SOURCE,
.retention_module = SLEEP_RETENTION_MODULE_I2S1,
},
[2] = {
.mck_out_sig = I2S2_MCLK_PAD_OUT_IDX,
@@ -83,7 +81,6 @@ const i2s_signal_conn_t i2s_periph_signal[SOC_I2S_NUM] = {
.data_in_sigs[3] = -1,
.irq = ETS_I2S2_INTR_SOURCE,
.retention_module = SLEEP_RETENTION_MODULE_I2S2,
},
};
@@ -131,6 +128,7 @@ const i2s_signal_conn_t lp_i2s_periph_signal[SOC_LP_I2S_NUM] = {
#define I2S_RETENTION_REGS_BASE(i) I2S_RX_CONF_REG(i)
static const uint32_t i2s_regs_map[4] = {0x12370f, 0x0, 0x0, 0x0};
#define I2S_SLEEP_RETENTION_ENTRIES(i2s_port) { \
/* Save/restore the register values */ \
[0] = { .config = REGDMA_LINK_ADDR_MAP_INIT( \
REGDMA_I2S_LINK(0x00), \
I2S_RETENTION_REGS_BASE(i2s_port), \
@@ -139,9 +137,11 @@ static const uint32_t i2s_regs_map[4] = {0x12370f, 0x0, 0x0, 0x0};
i2s_regs_map[0], i2s_regs_map[1], \
i2s_regs_map[2], i2s_regs_map[3]), \
.owner = ENTRY(0)}, \
/* Set the RX_UPDATE after the retention to make sure the RX configurations are synchronized */ \
[1] = { .config = REGDMA_LINK_WRITE_INIT( \
REGDMA_I2S_LINK(0x01), I2S_RX_CONF_REG(i2s_port), I2S_RX_UPDATE, I2S_RX_UPDATE_M, 1, 0), \
.owner = ENTRY(0) | ENTRY(2)}, \
/* Set the TX_UPDATE after the retention to make sure the TX configurations are synchronized */ \
[2] = { .config = REGDMA_LINK_WRITE_INIT( \
REGDMA_I2S_LINK(0x02), I2S_TX_CONF_REG(i2s_port), I2S_TX_UPDATE, I2S_TX_UPDATE_M, 1, 0), \
.owner = ENTRY(0) | ENTRY(2)} \
@@ -153,14 +153,17 @@ static const regdma_entries_config_t i2s2_regs_retention[] = I2S_SLEEP_RETENTION
const i2s_reg_retention_info_t i2s_reg_retention_info[SOC_I2S_NUM] = {
[0] = {
.retention_module = SLEEP_RETENTION_MODULE_I2S0,
.entry_array = i2s0_regs_retention,
.array_size = ARRAY_SIZE(i2s0_regs_retention)
},
[1] = {
.retention_module = SLEEP_RETENTION_MODULE_I2S1,
.entry_array = i2s1_regs_retention,
.array_size = ARRAY_SIZE(i2s1_regs_retention)
},
[2] = {
.retention_module = SLEEP_RETENTION_MODULE_I2S2,
.entry_array = i2s2_regs_retention,
.array_size = ARRAY_SIZE(i2s2_regs_retention)
},