/* Sets i2s channel number, sample rate, word length.  */
void i2s_set_param(i2s_t *obj, int channel_num, int rate, int word_len)
/* Sets i2s channel number, sample rate, word length.  */
void i2s_set_param(i2s_t *obj, int channel_num, int rate, int word_len)
{
	obj->channel_num = channel_num;
	obj->sampling_rate = rate;
	obj->word_length = word_len;
	I2SInitStruct.I2S_ChNum = channel_num;
	I2SInitStruct.I2S_Rate = rate;
	I2SInitStruct.I2S_WordLen = word_len;
	I2S_SetChNum(I2S_DEV, I2SInitStruct.I2S_ChNum);
	I2S_SetRate(I2S_DEV, rate);
	I2S_SetWordLen(I2S_DEV, I2SInitStruct.I2S_WordLen);
}