Skip to content

Commit

Permalink
revert i2s, swap 0/1 by TX/RX, iffifo fifo instance typo
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierre Guillod committed Oct 23, 2023
1 parent a28b550 commit e2ada1a
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion hw/ip/i2s/data/i2s.hjson
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
hwext: "true"
hwre: "true"
fields: [
{ bits: "31:0", name: "RXDATA", desc: "latest rx data if DATA_READY flag is set" }
{ bits: "31:0", name: "RXDATA", desc: "latest rx data if DATA_READY flag is set", hwaccess: "hrw"}
]
}

Expand Down
1 change: 1 addition & 0 deletions hw/ip/i2s/rtl/i2s.sv
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ module i2s #(
);



// Core logic
i2s_core #(
.MaxWordWidth(MaxWordWidth),
Expand Down
2 changes: 1 addition & 1 deletion hw/ip_examples/iffifo/rtl/iffifo.sv
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ module iffifo #(
fifo_v3 #(
.DEPTH(DEPTH),
.DATA_WIDTH(WIDTH)
) pdm2pcm_fifo_i (
) iffifo_fifo_i (
.clk_i,
.rst_ni,
.flush_i(1'b0),
Expand Down
8 changes: 5 additions & 3 deletions sw/applications/example_iffifo/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
int32_t to_fifo [3] __attribute__ ((aligned (4))) = { 1, 2, 3 };
int32_t from_fifo[3] __attribute__ ((aligned (4))) = { 0, 0, 0 };

int8_t dma_intr_flag;
int8_t dma_intr_flag = 0;
void dma_intr_handler_trans_done(void)
{
dma_intr_flag = 1;
Expand Down Expand Up @@ -72,7 +72,7 @@ int main(int argc, char *argv[]) {

tgt_dst.ptr = IFFIFO_START_ADDRESS + IFFIFO_FIFO_IN_REG_OFFSET;
tgt_dst.inc_du = 0;
tgt_dst.trig = DMA_TRIG_SLOT_EXT0;
tgt_dst.trig = DMA_TRIG_SLOT_TX;
tgt_dst.type = DMA_DATA_TYPE_WORD;

trans.src = &tgt_src;
Expand All @@ -89,9 +89,11 @@ int main(int argc, char *argv[]) {
PRINTF("Launch MM -> Stream DMA\n");
dma_launch( &trans );

if (!dma_intr_flag) { wait_for_interrupt(); }

tgt_src.ptr = IFFIFO_START_ADDRESS + IFFIFO_FIFO_OUT_REG_OFFSET;
tgt_src.inc_du = 0;
tgt_src.trig = DMA_TRIG_SLOT_EXT1;
tgt_src.trig = DMA_TRIG_SLOT_RX;
tgt_src.type = DMA_DATA_TYPE_WORD;
tgt_src.size_du = 3;

Expand Down
4 changes: 2 additions & 2 deletions sw/device/lib/drivers/dma/dma.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ typedef enum
DMA_TRIG_SLOT_SPI_FLASH_RX = 4, /*!< Slot 3 (MEM < SPI FLASH). */
DMA_TRIG_SLOT_SPI_FLASH_TX = 8, /*!< Slot 4 (MEM > SPI FLASH). */
DMA_TRIG_SLOT_I2S = 16,/*!< Slot 5 (I2S). */
DMA_TRIG_SLOT_EXT0 = 32,/*!< Slot 6 (External peripherals 0). */
DMA_TRIG_SLOT_EXT1 = 64,/*!< Slot 7 (External peripherals 1). */
DMA_TRIG_SLOT_TX = 32,/*!< Slot 6 (External peripherals TX). */
DMA_TRIG_SLOT_RX = 64,/*!< Slot 7 (External peripherals RX). */
DMA_TRIG__size, /*!< Not used, only for sanity checks. */
DMA_TRIG__undef, /*!< DMA will not be used. */
} dma_trigger_slot_mask_t;
Expand Down

0 comments on commit e2ada1a

Please sign in to comment.