/*************************************************************************** * * Copyright 2015-2019 BES. * All rights reserved. All unpublished rights reserved. * * No part of this work may be used or reproduced in any form or by any * means, or stored in a database or retrieval system, without prior written * permission of BES. * * Use of this work is governed by a license granted by BES. * This work contains confidential and proprietary information of * BES. which is protected by copyright, trade secret, * trademark and other intellectual property rights. * ****************************************************************************/ #include "plat_addr_map.h" #ifdef BTPCM_BASE #include "plat_types.h" #include "reg_btpcmip.h" #include "hal_btpcmip.h" #include "hal_btpcm.h" #include "hal_uart.h" #include "hal_trace.h" #include "hal_timer.h" #include "hal_cmu.h" //#define BTPCM_CLOCK_SOURCE 240000000 #define BTPCM_CLOCK_SOURCE 22579200 //#define BTPCM_CLOCK_SOURCE 48000000 //#define BTPCM_CLOCK_SOURCE 3072000 //#define BTPCM_CLOCK_SOURCE 76800000 //#define BTPCM_CLOCK_SOURCE 84672000 //#define HAL_BTPCM_TX_FIFO_TRIGGER_LEVEL (BTPCMIP_FIFO_DEPTH/2) //#define HAL_BTPCM_RX_FIFO_TRIGGER_LEVEL (BTPCMIP_FIFO_DEPTH/2) #define HAL_BTPCM_TX_FIFO_TRIGGER_LEVEL (1) #define HAL_BTPCM_RX_FIFO_TRIGGER_LEVEL (0) #define HAL_BTPCM_YES 1 #define HAL_BTPCM_NO 0 static const char * const invalid_id = "Invalid BTPCM ID: %d\n"; //static const char * const invalid_ch = "Invalid BTPCM CH: %d\n"; static bool btpcm_opened[HAL_BTPCM_ID_NUM][AUD_STREAM_NUM]; static inline POSSIBLY_UNUSED unsigned char reverse(unsigned char in) { uint8_t out = 0; uint32_t i = 0; for (i = 0; i < 8; ++i) { if((1<