I want to realize audio playing function in 9160, according to the specification, there are 9160 I2S interface. However, the specification only describe the definition of some registers in the book, I didn't find related sample code in ncs1.2, and I don't know how to define it in overlay file, I can't get the I2S device binding, is the I2S device name "I2S" or "I2S_0" string?
my code:
#define I2S_DEV_NAME "I2S"
#define NUM_BLOCKS 20
#define SAMPLE_NO 64
#define TIMEOUT 2000
#define FRAME_CLK_FREQ 44000
static void test_i2s_tx_transfer_configure(void)
{
struct device *dev_i2s;
struct i2s_config i2s_cfg;
int ret;
dev_i2s = device_get_binding(I2S_DEV_NAME);
if(!dev_i2s)
{
LOG_INF("ERROR SETTING UP I2S\n");
return;
}
/* Configure */
i2s_cfg.word_size = 16U;
i2s_cfg.channels = 2U;
i2s_cfg.format = I2S_FMT_DATA_FORMAT_I2S;
i2s_cfg.options = I2S_OPT_FRAME_CLK_SLAVE | I2S_OPT_BIT_CLK_SLAVE;
i2s_cfg.frame_clk_freq = FRAME_CLK_FREQ;
i2s_cfg.block_size = BLOCK_SIZE;
i2s_cfg.mem_slab = &tx_0_mem_slab;
i2s_cfg.timeout = TIMEOUT;
i2s_cfg.options = I2S_OPT_LOOPBACK;
ret = i2s_configure(dev_i2s, I2S_DIR_TX, &i2s_cfg);
}