I'm having trouble doing a simple practice in C
The I2S library from xSoftTip has a typedef struct called r_i2s
I have two clock blocks defined for it as well as buffered ports for input and output, both placed in their respective arrays. Although XTime composer community gives me an error for the initialization of both of the arrays (data_in and data_out)
I should note that I have the i2s.h and the startKIT port mapping library I made (from here):
https://github.com/funkyguy4000/XMOS-St ... _mapping.h
Code: Select all
//XS1 Clock mapping
clock MCLK_CLK = XS1_CLKBLK_1;
clock BCLK_CLK = XS1_CLKBLK_2;
in buffered port:32 ADC_DATA0 = XS1_PORT_1K;
in buffered port:32 ADC_DATA1 = XS1_PORT_1L;
out buffered port:32 DAC_DATA0 = XS1_PORT_1G;
out buffered port:32 DAC_DATA1 = XS1_PORT_1H;
int main(void){
//Set up I2C
//The I2C bus is only for configuring the Codec
i2c_master_init(SCL_SDA);
CS4270_Init(SCL_SDA);
//Set up I2S
in buffered port:32 data_in[2] = {ADC_DATA1, ADC_DATA0};
out buffered port:32 data_out[2] = {DAC_DATA1, DAC_DATA0};
streaming chanend channel_data;
r_i2s i2s_resources = {.cb1 = MCLK_CLK, .cb2 = BCLK_CLK, .mck = MCLK, .bck = BCLK, .wck = LRCLK, .din = data_in, .dout = data_out};