Azure Sphere MT3620 M4 API Reference Manual
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
os_hal_mbox.h
1 /*
2  * (C) 2005-2020 MediaTek Inc. All rights reserved.
3  *
4  * Copyright Statement:
5  *
6  * This MT3620 driver software/firmware and related documentation
7  * ("MediaTek Software") are protected under relevant copyright laws.
8  * The information contained herein is confidential and proprietary to
9  * MediaTek Inc. ("MediaTek"). You may only use, reproduce, modify, or
10  * distribute (as applicable) MediaTek Software if you have agreed to and been
11  * bound by this Statement and the applicable license agreement with MediaTek
12  * ("License Agreement") and been granted explicit permission to do so within
13  * the License Agreement ("Permitted User"). If you are not a Permitted User,
14  * please cease any access or use of MediaTek Software immediately.
15  *
16  * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
17  * THAT MEDIATEK SOFTWARE RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE
18  * PROVIDED TO RECEIVER ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS
19  * ANY AND ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
20  * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR
21  * NONINFRINGEMENT. NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH
22  * RESPECT TO THE SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY,
23  * INCORPORATED IN, OR SUPPLIED WITH MEDIATEK SOFTWARE, AND RECEIVER AGREES TO
24  * LOOK ONLY TO SUCH THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO.
25  * RECEIVER EXPRESSLY ACKNOWLEDGES THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO
26  * OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES CONTAINED IN MEDIATEK
27  * SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE
28  * RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
29  * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S
30  * ENTIRE AND CUMULATIVE LIABILITY WITH RESPECT TO MEDIATEK SOFTWARE RELEASED
31  * HEREUNDER WILL BE ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY
32  * RECEIVER TO MEDIATEK DURING THE PRECEDING TWELVE (12) MONTHS FOR SUCH
33  * MEDIATEK SOFTWARE AT ISSUE.
34  */
35 
36 #ifndef __OS_HAL_MBOX_H__
37 #define __OS_HAL_MBOX_H__
38 
39 #include "mhal_mbox.h"
40 
129 typedef enum {
137 
149 #define MBOX_NUM_SW_INT (8)
150 
167 };
168 
187 typedef void (*mtk_os_hal_mbox_cb)(struct mtk_os_hal_mbox_cb_data *data);
188 
198 #ifdef __cplusplus
199 extern "C" {
200 #endif
201 
210 
219 
233  struct mbox_fifo_item *buf, mbox_tr_type_t type);
234 
247  const struct mbox_fifo_item *buf, mbox_tr_type_t type);
248 
320  void *arg);
321 
334  mtk_os_hal_mbox_cb cb, u32 irq_status);
335 
345 
357  mtk_os_hal_mbox_cb cb, struct mbox_fifo_event *mask);
358 
368 
369 #ifdef __cplusplus
370 }
371 #endif
372 
382 #endif /* __OS_HAL_MBOX_H__ */
Invalid channel.
Definition: os_hal_mbox.h:135
int mtk_os_hal_mbox_fifo_write(mbox_channel_t channel, const struct mbox_fifo_item *buf, mbox_tr_type_t type)
This function is used to write data to MBOX channel FIFO.
int mtk_os_hal_mbox_ioctl(mbox_channel_t channel, mbox_ioctl_t ctrl, void *arg)
Control various hardware settings of MBOX.
enum mbox_ioctl_type mbox_ioctl_t
Users should specify the ioctl type when setting/getting information to/from MBOX HW...
The argument of user callback.
Definition: os_hal_mbox.h:162
int mtk_os_hal_mbox_fifo_register_cb(mbox_channel_t channel, mtk_os_hal_mbox_cb cb, struct mbox_fifo_event *mask)
This function is used to register user FIFO interrupt callback.
int mtk_os_hal_mbox_fifo_read(mbox_channel_t channel, struct mbox_fifo_item *buf, mbox_tr_type_t type)
This function is used to read MBOX channel FIFO data.
int mtk_os_hal_mbox_fifo_unregister_cb(mbox_channel_t channel)
This function is used to unregister user FIFO interrupt callback.
enum mbox_transfer_type mbox_tr_type_t
User should specify the transfer type when reading/writing FIFO.
For A7 <-> M4.
Definition: os_hal_mbox.h:131
mbox_channel_t
MBOX channel.
Definition: os_hal_mbox.h:129
void(* mtk_os_hal_mbox_cb)(struct mtk_os_hal_mbox_cb_data *data)
This defines the callback function prototype.
Definition: os_hal_mbox.h:187
Software interrupt information.
Definition: mhal_mbox.h:272
For M4 <-> M4.
Definition: os_hal_mbox.h:133
int mtk_os_hal_mbox_sw_int_unregister_cb(mbox_channel_t channel)
This function is used to unregister user software interrupt callback.
int mtk_os_hal_mbox_sw_int_register_cb(mbox_channel_t channel, mtk_os_hal_mbox_cb cb, u32 irq_status)
This function is used to register user software interrupt callback.
FIFO interrupt status information or enable mask.
Definition: mhal_mbox.h:246
struct mbox_fifo_event event
FIFO interrupt information.
Definition: os_hal_mbox.h:164
The data and cmd written to/read from MBOX FIFO.
Definition: mhal_mbox.h:217
int mtk_os_hal_mbox_close_channel(mbox_channel_t channel)
Close MBOX channel.
struct mbox_swint_info swint
Software interrupt information.
Definition: os_hal_mbox.h:166
int mtk_os_hal_mbox_open_channel(mbox_channel_t channel)
Open MBOX channel.