1 /* 2 * Copyright (C) 2015-2020 Alibaba Group Holding Limited 3 */ 4 #ifndef __HAL_BTPCM_H__ 5 #define __HAL_BTPCM_H__ 6 7 #ifdef __cplusplus 8 extern "C" { 9 #endif 10 11 #include "plat_types.h" 12 #include "hal_aud.h" 13 14 enum HAL_BTPCM_ID_T { 15 HAL_BTPCM_ID_0 = 0, 16 HAL_BTPCM_ID_NUM, 17 }; 18 19 struct HAL_BTPCM_CONFIG_T { 20 uint32_t bits; 21 uint32_t channel_num; 22 uint32_t sample_rate; 23 24 uint32_t use_dma; 25 }; 26 27 int hal_btpcm_open(enum HAL_BTPCM_ID_T id, enum AUD_STREAM_T stream); 28 int hal_btpcm_close(enum HAL_BTPCM_ID_T id, enum AUD_STREAM_T stream); 29 int hal_btpcm_start_stream(enum HAL_BTPCM_ID_T id, enum AUD_STREAM_T stream); 30 int hal_btpcm_stop_stream(enum HAL_BTPCM_ID_T id, enum AUD_STREAM_T stream); 31 int hal_btpcm_setup_stream(enum HAL_BTPCM_ID_T id, enum AUD_STREAM_T stream, struct HAL_BTPCM_CONFIG_T *cfg); 32 int hal_btpcm_send(enum HAL_BTPCM_ID_T id, uint8_t *value, uint32_t value_len); 33 uint8_t hal_btpcm_recv(enum HAL_BTPCM_ID_T id, uint8_t *value, uint32_t value_len); 34 35 #ifdef __cplusplus 36 } 37 #endif 38 39 #endif 40