This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Yuri,
The HSPDemo included in the CC256XSTBTBLESW is for out of box demo purposes on the CC2564 (QFN or module) EM + CC256xEM-STADAPT + STM3240G-EVAL HW configuration.
In this demo, the I2S interface is being initialized in the initializeAudio function of the AUDIO.c. This function is only called from the application (HSPDemo.c) when the demo in Headset mode is connected to a phone and the etHDSET_Audio_Connection_Indication event occurs in the HDSET_Event_Callback function of the HSPDemo.c. Meaning that the I2S is only initialized when the phone is answering/receiving a call and the audio is needed. So, you will only be able to observe the I2S signals on a scope when this happens.
Moreover, as documented in the HDSET_Event_Callback function, the initializeAudio function is setting the STM32F I2S as master, the CC256X PCM as slave and the DAC CS43L22 as slave. All at 8KHz sample rate. Since the master STM32F will be providing clock signals to the slaves, you might want to probe on the master pins to observe the clock signals in case the HW is not properly set up for the HSPDemo. The HW modifications required on the CC256xEM-STADAPT boards can be found in the Quick Start Guide for this board.
Best regards,
Vihang
Best regards,
Vihang
I am running the cc2564 module on my custom board which MCU is STM32L476M.
The cc2564 is my master and it provides the clocks (and hopfully data in the future) for an audio codec which is connected to him.
Both the master (cc2564 ) and slave (audiocodec) lines were verified.
I have made some minimal changes to the code:
* instead of using the whole ( initializeAudio() ) function i am only using the ( VS_PCM_Codec_Config_Slave_I2S() ) with the relevent parameters.
* i have added code for initializing my audio codec right after the ( VS_PCM_Codec_Config_Slave_I2S() ) command.
i can share the code if it helps.
Vihang Hello!
first to the code, this is the part of the "etHDSET_Audio_Connection_Indication" event,
As i explained before, i am not using the "initializeAudio" function since it contains many things i do not need.
Actually the only thing needed (as i see it) is "VS_PCM_Codec_Config_Slave_I2S", i also tried to use "HCI_VS_Write_CODEC_Config_Enhanced".
here is the code:
case etHDSET_Audio_Connection_Indication:
/* An Audio Connection Indication was received, display the */
/* relevant information. */
Display(("HDSET Audio Connection Indication, ID: 0x%04X.\r\n", HDSET_Event_Data->Event_Data.HDSET_Audio_Connection_Indication_Data->HDSETPortID));
CurrentConnectionState = csAudioConnected;
/* Initialize the STM32F I2S as master, the CC256X PCM as slave and DAC CS43L22 I2S as slave. all at 8KHz sample rate */
//(void) initializeAudio(BluetoothStackID, CVSD_FREQUENCY);
int status;
// Hold the codec at reset state while configuring the PCM lines
HAL_GPIO_WritePin(GPIOB, AUD_EN_1V8_Pin, GPIO_PIN_RESET);
HAL_Delay(1000);
status = VS_PCM_Codec_Config_Slave_I2S(BluetoothStackID, I2S_CLK_FREQ_IN_FS_8KHZ, CVSD_FREQUENCY);
status = HCI_VS_Write_CODEC_Config_Enhanced(BluetoothStackID);
HAL_GPIO_WritePin(GPIOB, AUD_EN_1V8_Pin, GPIO_PIN_SET);
HAL_Delay(1000);
//status = VS_Set_Pcm_Loopback(BluetoothStackID,0x01);
TLV320AIC3100_Init(I2CHandle);
TLV320AIC3100_SetVolume(220);
TLV320AIC3100_GenerateBeep(63, 2000, 10000);//
Regarding the platform, i will look into it and if it will be possible i will let you know that i am trying.
let me know what you think about the code, is there something missing?
Thank you,
Why you use VS_PCM_Codec_Config_Slave_I2S() if your cc2564 in master mode?
VS_PCM_Codec_Config_Slave_I2S() - The following function is used to write the codec interface as Slave