CI130X SDK API手册  2.2.0
本手册用于描述CI130X SDK各个组件和驱动API
结构体 | 宏定义 | 函数 | 变量
ci130x_mailbox.c 文件参考
#include <stdint.h>
#include <string.h>
#include "FreeRTOS.h"
#include "semphr.h"
#include "romlib_runtime.h"
#include "ci130x_mailbox.h"
#include "ci130x_mailbox_bnpu.h"
#include "ci130x_system.h"
#include "ci_assert.h"
#include "ci130x_core_eclic.h"

结构体

struct  mailbox_reg_t
 
struct  mail_box_reg_t
 
struct  mailbox_t
 

宏定义

#define CORE_MAGIC_ID   (*(uint32_t *)0x0000001c)
 
#define BNPU_CORE_MAGIC_ID   0x55504E42
 
#define MBC_CI_ASSERT(x, msg)
 
#define MAIL_BOX_FULL   (1)/*other cpu not deal message*/
 
#define MAIL_BOX_EMPTY   (0)/*other cpu already deal message*/
 
#define MAIL_BOX_SEND_TIMEOUT   (0xfffffff)
 

函数

static uint32_t set_core_number (void)
 
uint32_t get_core_number (void)
 
void mailbox_preinit (void)
 
uint32_t mailbox_init (mailbox_irq_cmd_cb_t callback_func)
 
void mailbox_deinit (void)
 
uint32_t mailbox_send_msg (uint32_t data0, uint32_t data1, mailbox_cmd_t cmd)
 
static uint32_t mailbox_receive_msg (uint32_t *data0, uint32_t *data1, mailbox_cmd_t *cmd)
 
void mailboxboot_sync (void)
 
void MAIL_BOX_IRQHandler (void)
 

变量

static mailbox_irq_cmd_cb_t rpmsg_callback_func = NULL
 
static mailbox_irq_cmd_cb_t nuclear_com_callback_func = NULL
 
static SemaphoreHandle_t mailbox_semaphore = NULL
 
mailbox_tmailbox_ports [2] = {(mailbox_t*)HAL_MAILBOX0_BASE, (mailbox_t*)HAL_MAILBOX1_BASE}
 
static volatile int boot_sync_host = 0
 
static volatile int boot_sync_bnpu = 0
 

详细描述

作者

版本
V1.0.0
日期
2018.10.31

结构体说明

◆ mailbox_reg_t

struct mailbox_reg_t
成员变量
volatile uint32_t bnpu_core_cmd
volatile uint32_t bnpu_core_data0
volatile uint32_t bnpu_core_data1
volatile uint32_t bnpu_core_flag
volatile uint32_t host_core_cmd
volatile uint32_t host_core_data0
volatile uint32_t host_core_data1
volatile uint32_t host_core_flag

◆ mail_box_reg_t

struct mail_box_reg_t
成员变量
volatile uint32_t cmd
volatile uint32_t data0
volatile uint32_t data1
volatile uint32_t flag

◆ mailbox_t

struct mailbox_t
成员变量
mail_box_reg_t reg[2]

宏定义说明

◆ BNPU_CORE_MAGIC_ID

#define BNPU_CORE_MAGIC_ID   0x55504E42

◆ CORE_MAGIC_ID

#define CORE_MAGIC_ID   (*(uint32_t *)0x0000001c)

◆ MAIL_BOX_EMPTY

#define MAIL_BOX_EMPTY   (0)/*other cpu already deal message*/

◆ MAIL_BOX_FULL

#define MAIL_BOX_FULL   (1)/*other cpu not deal message*/

◆ MAIL_BOX_SEND_TIMEOUT

#define MAIL_BOX_SEND_TIMEOUT   (0xfffffff)

◆ MBC_CI_ASSERT

#define MBC_CI_ASSERT (   x,
  msg 
)
值:
if( ( x ) == 0 ) \
{ \
mprintf("%s",msg); \
mprintf("MBC Line:%d\n",__LINE__); \
while(1) asm volatile ("ebreak"); \
}

函数说明

◆ get_core_number()

uint32_t get_core_number ( void  )
inline

◆ MAIL_BOX_IRQHandler()

void MAIL_BOX_IRQHandler ( void  )

◆ mailbox_deinit()

void mailbox_deinit ( void  )

◆ mailbox_init()

uint32_t mailbox_init ( mailbox_irq_cmd_cb_t  callback_func)

◆ mailbox_preinit()

void mailbox_preinit ( void  )

◆ mailbox_receive_msg()

static uint32_t mailbox_receive_msg ( uint32_t *  data0,
uint32_t *  data1,
mailbox_cmd_t cmd 
)
static

◆ mailbox_send_msg()

uint32_t mailbox_send_msg ( uint32_t  data0,
uint32_t  data1,
mailbox_cmd_t  cmd 
)

◆ mailboxboot_sync()

void mailboxboot_sync ( void  )

◆ set_core_number()

static uint32_t set_core_number ( void  )
static

变量说明

◆ boot_sync_bnpu

volatile int boot_sync_bnpu = 0
static

◆ boot_sync_host

volatile int boot_sync_host = 0
static

◆ mailbox_ports

◆ mailbox_semaphore

SemaphoreHandle_t mailbox_semaphore = NULL
static

◆ nuclear_com_callback_func

mailbox_irq_cmd_cb_t nuclear_com_callback_func = NULL
static

◆ rpmsg_callback_func

mailbox_irq_cmd_cb_t rpmsg_callback_func = NULL
static