• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021 Bestechnic (Shanghai) Co., Ltd. All rights reserved.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 #ifndef __APP_OVERLAY_H__
16 #define __APP_OVERLAY_H__
17 
18 #include "plat_types.h"
19 #include "hal_overlay.h"
20 
21 #define app_overlay_load(id)                hal_overlay_load((enum HAL_OVERLAY_ID_T)id)
22 #define app_overlay_unload(id)              hal_overlay_unload((enum HAL_OVERLAY_ID_T)id)
23 #define app_overlay_get_text_size(id)       hal_overlay_get_text_size((enum HAL_OVERLAY_ID_T)id)
24 #define app_overlay_get_text_all_size       hal_overlay_get_text_all_size
25 #define app_overlay_get_text_address        hal_overlay_get_text_address
26 #define app_overlay_get_text_free_size(id)  hal_overlay_get_text_free_size((enum HAL_OVERLAY_ID_T)id)
27 #define app_overlay_get_text_free_addr(id)  hal_overlay_get_text_free_addr((enum HAL_OVERLAY_ID_T)id)
28 //#define app_overlay_is_used                 hal_overlay_is_used
29 
30 enum APP_OVERLAY_ID_T {
31     APP_OVERLAY_HFP = HAL_OVERLAY_ID_0,
32     APP_OVERLAY_A2DP = HAL_OVERLAY_ID_1,
33     APP_OVERLAY_FM = HAL_OVERLAY_ID_2,
34     APP_OVERLAY_AAC = HAL_OVERLAY_ID_3,
35     APP_OVERLAY_A2DP_AAC = HAL_OVERLAY_ID_4,
36     APP_OVERLAY_MPA = HAL_OVERLAY_ID_5,
37 #if	defined(A2DP_SCALABLE_ON)
38     APP_OVERLAY_A2DP_SCALABLE= HAL_OVERLAY_ID_6,
39 #elif defined(A2DP_LHDC_ON)
40     APP_OVERLAY_A2DP_LHDC = HAL_OVERLAY_ID_6,
41 #elif defined(A2DP_SOURCE_LHDC_ON)
42     APP_OVERLAY_A2DP_LHDC_ENCODER = HAL_OVERLAY_ID_6,
43 #elif defined(A2DP_LDAC_ON)
44 	APP_OVERLAY_A2DP_LDAC = HAL_OVERLAY_ID_6,
45 #elif defined(A2DP_LC3_ON)
46     APP_OVERLAY_A2DP_LC3 = HAL_OVERLAY_ID_6,
47 #else
48     APP_OVERLAY_WAV = HAL_OVERLAY_ID_6,
49 #endif
50 #ifdef OPUS_IN_OVERLAY
51     APP_OVERLAY_OPUS = HAL_OVERLAY_ID_7,
52 #endif
53 
54     APP_OVERLAY_ID_QTY = HAL_OVERLAY_ID_QTY,
55     APP_OVERLAY_ID_IN_CFG = HAL_OVERLAY_ID_IN_CFG,
56 };
57 
58 #ifdef __cplusplus
59 extern "C" {
60 #endif
61 
62 void app_overlay_select(enum APP_OVERLAY_ID_T id);
63 
64 void app_overlay_unloadall(void);
65 
66 void app_overlay_open(void);
67 
68 void app_overlay_close(void);
69 
70 enum APP_OVERLAY_ID_T app_get_current_overlay(void);
71 
72 #ifdef __cplusplus
73 }
74 #endif
75 
76 #endif
77