1 #ifndef __BTPCM_CONFIG_H__ 2 #define __BTPCM_CONFIG_H__ 3 4 typedef uint32_t (*bt_sco_btpcm_data_callback_t)(uint8_t *buf, uint32_t len); 5 6 typedef enum SCO_SAMPRATE { 7 SCO_SAMPRATE_8000 = 8000, 8 SCO_SAMPRATE_16000 = 16000, 9 }SCO_SAMPRATE_T; 10 11 typedef enum { 12 BTPCM_HF_SCO_CODEC_NONE = 0, 13 BTPCM_HF_SCO_CODEC_CVSD = 1, 14 BTPCM_HF_SCO_CODEC_MSBC = 2, 15 } btpcm_sco_codec_t; 16 17 #ifdef __cplusplus 18 extern "C" { 19 #endif 20 21 /***************************************************************************** 22 function : bt_sco_btpcm_data_callback_register 23 Description : register btpcm callback function 24 Input : capture_callback receive len datas by sco 25 : playback_callback send len datas by sco 26 Output : None 27 Date : 2021/1/15 28 *****************************************************************************/ 29 void bt_sco_btpcm_data_callback_register(bt_sco_btpcm_data_callback_t capture_callback, 30 bt_sco_btpcm_data_callback_t playback_callback); 31 32 void btpcm_capture_start(SCO_SAMPRATE_T sample_rate,uint8_t*sco_buff,uint32_t data_size); 33 void btpcm_playback_start(SCO_SAMPRATE_T sample_rate,uint8_t*sco_buff,uint32_t data_size); 34 void btpcm_capture_stop(void); 35 void btpcm_playback_stop(void); 36 int app_btpcm_set_sco_codec_type(btpcm_sco_codec_t codec_id); 37 int app_btpcm_get_sco_codec_type(void); 38 #ifdef __cplusplus 39 } 40 #endif 41 42 #endif 43 44