Files
kunlun/driver/inc/mailbox.h

78 lines
2.4 KiB
C
Raw Normal View History

2024-09-28 14:24:04 +08:00
/****************************************************************************
Copyright(c) 2019 by Aerospace C.Power (Chongqing) Microelectronics. ALL RIGHTS RESERVED.
This Information is proprietary to Aerospace C.Power (Chongqing) Microelectronics and MAY NOT
be copied by any method or incorporated into another program without
the express written consent of Aerospace C.Power. This Information or any portion
thereof remains the property of Aerospace C.Power. The Information contained herein
is believed to be accurate and Aerospace C.Power assumes no responsibility or
liability for its use in any way and conveys no license or title under
any patent or copyright and makes no representation or warranty that this
Information is free from patent or copyright infringement.
****************************************************************************/
#ifndef _MAILBOX_H_
#define _MAILBOX_H_
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief iot_mb_msg_cb() - core收到数据时
* @param core_id: core发来的
*/
typedef void(*iot_mb_msg_cb)(int core_id);
/**
* @brief iot_mb_open() - mailbox并注册中断回调函数
* @param cb:
*/
uint32_t iot_mb_open(iot_mb_msg_cb cb);
/**
* @brief iot_mb_close() - mailbox
*/
uint32_t iot_mb_close(void);
/**
* @brief iot_mb_write() - core发送数据
* @param core_id: core
* @param data
*/
uint32_t iot_mb_write(uint32_t core_id, uint32_t data);
/**
* @brief iot_mb_read() - core发来的数据
* @param core_id: core读取数据
* @param p_data
*/
uint32_t iot_mb_read(uint32_t core_id, uint32_t *p_data);
/**
* @brief iot_mb_get_read_space() - core向本core发了多少字节的数据WORD
* @param core_id: core
*/
uint32_t iot_mb_get_read_space(uint32_t core_id);
/**
* @brief iot_mb_get_write_space() - core还能接收多少字节的数据WORD
* @param core_id: core
*/
uint32_t iot_mb_get_write_space(uint32_t core_id);
/**
* @brief iot_mb_init() - mailbox
*/
void iot_mb_init(void);
uint32_t iot_mb_mask();
uint32_t iot_mb_unmask();
#ifdef __cplusplus
}
#endif
#endif