mirror of
https://github.com/rvtr/twl_wrapsdk.git
synced 2025-10-31 06:11:10 -04:00
git-svn-id: file:///Users/lillianskinner/Downloads/platinum/twl/twl_wrapsdk/trunk@295 4ee2a332-4b2b-5046-8439-1ba90f034370
64 lines
1.9 KiB
C
64 lines
1.9 KiB
C
/*---------------------------------------------------------------------------*
|
|
Project: TwlFirm - library - pxi
|
|
File: pxi_intf.c
|
|
|
|
Copyright 2007 Nintendo. All rights reserved.
|
|
|
|
These coded instructions, statements, and computer programs contain
|
|
proprietary information of Nintendo of America Inc. and/or Nintendo
|
|
Company Ltd., and are protected by Federal copyright law. They may
|
|
not be disclosed to third parties or copied or duplicated in any form,
|
|
in whole or in part, without the prior written consent of Nintendo.
|
|
|
|
$Log: $
|
|
$NoKeywords: $
|
|
*---------------------------------------------------------------------------*/
|
|
#include <twl/os.h>
|
|
#include <twl/pxi.h>
|
|
|
|
|
|
/*---------------------------------------------------------------------------*
|
|
Name: PXI_SendByIntf
|
|
|
|
Description: Send 4bit data to the other processor
|
|
|
|
Arguments: id sending id
|
|
|
|
Returns: None
|
|
*---------------------------------------------------------------------------*/
|
|
void PXI_SendByIntf( u32 data )
|
|
{
|
|
reg_PXI_INTF = (u16)(data << REG_PXI_INTF_SEND_SHIFT);
|
|
}
|
|
|
|
/*---------------------------------------------------------------------------*
|
|
Name: PXI_RecvByIntf
|
|
|
|
Description: Receive 4bit data from the other processor
|
|
|
|
Arguments: None
|
|
|
|
Returns: received id
|
|
*---------------------------------------------------------------------------*/
|
|
u32 PXI_RecvByIntf( void )
|
|
{
|
|
return (u32)(((reg_PXI_INTF & REG_PXI_INTF_RECV_MASK) >> REG_PXI_INTF_RECV_SHIFT));
|
|
}
|
|
|
|
/*---------------------------------------------------------------------------*
|
|
Name: PXI_WaitByIntf
|
|
|
|
Description: Wait 4bit data from the other processor
|
|
|
|
Arguments: id waiting id
|
|
|
|
Returns: None
|
|
*---------------------------------------------------------------------------*/
|
|
void PXI_WaitByIntf( u32 data )
|
|
{
|
|
while (PXI_RecvByIntf() != data)
|
|
{
|
|
}
|
|
}
|
|
|