• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021 Chipsea Technologies (Shenzhen) Corp., 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 _REG_IPC_MUTEX_H_
16 #define _REG_IPC_MUTEX_H_
17 
18 #include "reg_access_wrapper.h"
19 #include "chip.h"
20 
21 /**
22  * IPC_MUTEX registers
23  */
24 #define IPC_MUTEX_BASE_ADDR   (CS_IPCAPP_BASE + 0x0040)
25 
ipc_mutex_get(int idx)26 __INLINE uint32_t ipc_mutex_get(int idx)
27 {
28     return PLATFORM_REG_READ(IPC_MUTEX_BASE_ADDR + (idx << 2));
29 }
30 
ipc_mutex_set(int idx,uint32_t value)31 __INLINE void ipc_mutex_set(int idx, uint32_t value)
32 {
33     PLATFORM_REG_WRITE(IPC_MUTEX_BASE_ADDR + (idx << 2), value);
34 }
35 
36 /**
37  * IPC_MUTEX ID definition
38  */
39 enum {
40     IPC_MUTEX_ID_UART0_OUTPUT   = 0,
41     IPC_MUTEX_ID_UART1_OUTPUT   = 1,
42     IPC_MUTEX_ID_UART2_OUTPUT   = 2,
43     IPC_MUTEX_ID_WIFI_A2E_TX    = 3,
44     IPC_MUTEX_ID_WIFI_E2A_MSG   = 4,
45     IPC_MUTEX_ID_WIFI_E2A_RX    = 5,
46     IPC_MUTEX_ID_WIFI_E2A_UF    = 6,
47     IPC_MUTEX_ID_7              = 7,
48     IPC_MUTEX_ID_MAX
49 };
50 
51 #endif /* _REG_IPC_MUTEX_H_ */
52