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);
}
}