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 __HAL_MEMSC_H__ 16 #define __HAL_MEMSC_H__ 17 18 #ifdef __cplusplus 19 extern "C" { 20 #endif 21 22 #include "stdint.h" 23 #include "stdbool.h" 24 25 enum HAL_MEMSC_ID_T { 26 HAL_MEMSC_ID_0, 27 HAL_MEMSC_ID_1, 28 HAL_MEMSC_ID_2, 29 HAL_MEMSC_ID_3, 30 31 HAL_MEMSC_ID_QTY 32 }; 33 34 #define HAL_MEMSC_ID_TRACE HAL_MEMSC_ID_0 35 #define HAL_MEMSC_ID_TRNG HAL_MEMSC_ID_1 36 37 enum HAL_MEMSC_AON_ID_T { 38 HAL_MEMSC_AON_ID_0, 39 HAL_MEMSC_AON_ID_1, 40 HAL_MEMSC_AON_ID_2, 41 HAL_MEMSC_AON_ID_3, 42 43 HAL_MEMSC_AON_ID_QTY 44 }; 45 46 int hal_memsc_lock(enum HAL_MEMSC_ID_T id); 47 48 void hal_memsc_unlock(enum HAL_MEMSC_ID_T id); 49 50 bool hal_memsc_avail(enum HAL_MEMSC_ID_T id); 51 52 int hal_memsc_aon_lock(enum HAL_MEMSC_AON_ID_T id); 53 54 void hal_memsc_aon_unlock(enum HAL_MEMSC_AON_ID_T id); 55 56 bool hal_memsc_aon_avail(enum HAL_MEMSC_AON_ID_T id); 57 58 #ifdef __cplusplus 59 } 60 #endif 61 62 #endif 63 64