I2S from xsoftip

New to XMOS and XCore? Get started here.
Rammsteiner1988
Member
Posts: 12
Joined: Thu Dec 05, 2013 9:39 am

I2S from xsoftip

Post by Rammsteiner1988 »

Hallo, again
I tried to use the I²S libary from xsoftip for the DJ-Kit. But something went wrong.
Here is my main.xc

Code: Select all

#include <platform.h>
#include <xs1.h>
#include "i2c.h"
#include "i2s_master.h"

r_i2s i2s_resources = {
	XS1_CLKBLK_1,
	XS1_CLKBLK_2,
	XS1_PORT_1E,
	XS1_PORT_1A,
	XS1_PORT_1I,
	{XS1_PORT_1G,XS1_PORT_1L,},
	{XS1_PORT_1D,XS1_PORT_1C,}
};

void my_music(streaming chanend data)
{
	unsigned int x;

	while(1)
	{
		data :> x;
		data <: x;
	}
}

void main() {
	streaming chan c_i2s_data;
	unsigned mlk_blk_div = get_mclk_bclk_div(48000, 24576000);
	par
	{

			i2s_master(i2s_resources, c_i2s_data, mlk_blk_div);
			my_music(c_i2s_data);
	}

}
Is there more to change?


sivakumar
Member
Posts: 11
Joined: Tue Aug 02, 2011 3:24 pm

Post by sivakumar »

Hi,
You have missed the i2c port declaration and audio hardware configuration. You need to call audio_hw_init() and audio_hw_config()

Hope this solves your issue.
Rammsteiner1988
Member
Posts: 12
Joined: Thu Dec 05, 2013 9:39 am

Post by Rammsteiner1988 »

I included the "I2S Master Audio Driver" an the "I2C Master (Using A Single Multi Bit Port) Function Library"
there are no audio_hw_init() or audio_hw_config().
Where can I find them and which parameters do they need?
sivakumar
Member
Posts: 11
Joined: Tue Aug 02, 2011 3:24 pm

Post by sivakumar »

It is part of the I2S Master sliceKIT Loopback Demo. You could download it from xSOFTip window itself.