PSoC4S MAX : Configuring I2S with DMA

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
MiNe_85951
Level 7
Level 7
Distributor - TED (Japan)
50 likes received 500 replies posted 50 solutions authored

Dear Sirs and Madams,

 

We are having trouble setting the I2S address to DST of DMA.

We know can configure DMA for I2S with HAL, but can't configure it with PDL only.

 

It seems that I2S cannot be set as "Destination" for DMA.

The I2S of this PSoC4S MAX cannot be connected with the DMAC without using HAL. right?

 

Regards,

0 Likes
1 Solution
RodolfoGL
Employee
Employee
250 solutions authored 250 sign-ins 5 comments on KBA

Hello,

I'm more familiar with the PSoC 6 I2S block, which let you establish a connection between I2S and a DMA.

I looked at the design.modus from a PSoC 4S MAX device, it is actually quite different. The I2S block does not have trigger level output signal. That means you have to use software trigger on the DMA.

If you are using I2S TX, you need to setup the destination address as the TX FIFO register. In this case, you will be better off to use the I2S HAL. Using I2S and DMA PDL will not give you much benefit.

If you still want to use the I2S + DMA PDL, you can check the I2S Write API how to define the destination address for your DMA.

__STATIC_INLINE void Cy_I2S_WriteTxData(I2S_Type * base, uint32_t data)
{
    I2S_TX_FIFO_WR(base) = data;
}

 

#define I2S_TX_FIFO_WR(base)            (((I2S_Type*)(base))->TX_FIFO_WR)

 

View solution in original post

6 Replies
ncbs
Moderator
Moderator
Moderator
500 replies posted 50 likes received 250 sign-ins

Hi @MiNe_85951 ,

HAL APIs use PDL APIs internally, so you should be able to configure DMA using PDL APIs too.

Can you share your HAL and PDL projects here?

Regards,
Nikhil

MiNe_85951
Level 7
Level 7
Distributor - TED (Japan)
50 likes received 500 replies posted 50 solutions authored

Nikhil-san,

 

We would like to configure the HAL API snipet_cyhal_i2s_async_transmit_streaming() in PDL.

Do you know how to configure it in PDL?

 

Regards,

0 Likes
RodolfoGL
Employee
Employee
250 solutions authored 250 sign-ins 5 comments on KBA

Currently, the HAL API implementation of the I2S uses DMA, but it doesn't establish a hardware connection between the I2S FIFO and the DMA trigger. It actually uses DMA software triggers.

If you want to establish a hardware connection between the I2S and DMA, you need to use the device-configurator tool, which means you need to use the PDL driver to configure the I2S and DMA.

MiNe_85951
Level 7
Level 7
Distributor - TED (Japan)
50 likes received 500 replies posted 50 solutions authored

Rodolfo-san,

 

Thank you for your reply.

 

We understand that too.

However, I have actually enabled DMA in Device Configurator and tried to set DMA, but I don't know how to set the I2S address to DST of DMA.

It looks like I2S is not assigned that address.

 

Regards,

 

0 Likes
RodolfoGL
Employee
Employee
250 solutions authored 250 sign-ins 5 comments on KBA

Hello,

I'm more familiar with the PSoC 6 I2S block, which let you establish a connection between I2S and a DMA.

I looked at the design.modus from a PSoC 4S MAX device, it is actually quite different. The I2S block does not have trigger level output signal. That means you have to use software trigger on the DMA.

If you are using I2S TX, you need to setup the destination address as the TX FIFO register. In this case, you will be better off to use the I2S HAL. Using I2S and DMA PDL will not give you much benefit.

If you still want to use the I2S + DMA PDL, you can check the I2S Write API how to define the destination address for your DMA.

__STATIC_INLINE void Cy_I2S_WriteTxData(I2S_Type * base, uint32_t data)
{
    I2S_TX_FIFO_WR(base) = data;
}

 

#define I2S_TX_FIFO_WR(base)            (((I2S_Type*)(base))->TX_FIFO_WR)

 

MiNe_85951
Level 7
Level 7
Distributor - TED (Japan)
50 likes received 500 replies posted 50 solutions authored

Rodolfo-san,

 

Thank you for your support.

Since Modus Toolbox does not have a sample project using I2S for PSoC4S MAX, we were thinking of configuring it with reference to the I2S sample project for PSoC6.

However, since the HAL is also different between PSoC4S MAX and PSoC6, it is not easy to port, so I was thinking of configuring it with PDL, but from your explanation, I understand that I have to use a software trigger.

 

Regards,

0 Likes