I have read the programming guide section on parallel tasks and communication and am learning about how XMOS uses interfaces and clients, but am still a little hazy on exactly the implementation for my purposes. Since I2C is used across several functions in audiohw.xc, do each one of these functions now need to be a client, or can I just make the usb_audio_io() the client, since it calls audio(), which calls the functions in audiohw.xc?
Would the snippet from my main() i2C setup be something like this?
Code: Select all
i2c_master_if i2c[2];
par
{
/* ........setup XUD_Tile, etc..... */
on tile[AUDIO_IO_TILE]:
par
{
i2c_master_single_port(i2c, 2, p_i2c, 100, 1, 2, 0xC);
usb_audio_io(i2c[0], c_mix_out, c_adc
#if defined(SPDIF_TX) && (SPDIF_TX_TILE != AUDIO_IO_TILE)
, c_spdif_tx
#endif
#ifdef MIXER
, c_mix_ctl
#endif
,c_aud_cfg, c_spdif_rx, c_adat_rx, c_clk_ctl, c_clk_int
#if XUD_TILE != 0
, dfuInterface
#endif
#if (NUM_PDM_MICS > 0)
, c_pdm_pcm
#endif
);
PGA_GAIN_CNTRL(i2c[1], Gain_Value);
}
/* ........setup other Tiles, etc..... */
}