mirror of
https://github.com/rvtr/twl_wrapsdk.git
synced 2025-10-31 06:11:10 -04:00
add pxi intf.
git-svn-id: file:///Users/lillianskinner/Downloads/platinum/twl/twl_wrapsdk/trunk@295 4ee2a332-4b2b-5046-8439-1ba90f034370
This commit is contained in:
parent
87cf0a089b
commit
1c28baf5e3
@ -24,11 +24,13 @@ TWL_CODEGEN_ALL ?= True
|
||||
|
||||
TWL_PROC = ARM7
|
||||
|
||||
SRCDIR = ../common/src .
|
||||
SRCDIR = ../common .
|
||||
SRCDIR += $(TWL_NITROSDK_ROOT)/build/libraries/pxi/common/src \
|
||||
$(TWL_NITROSDK_ROOT)/build/libraries/pxi/ARM7/src \
|
||||
|
||||
SRCS = pxi_init.c pxi_fifo.c
|
||||
SRCS = pxi_init.c \
|
||||
pxi_fifo.c \
|
||||
pxi_intf.c \
|
||||
|
||||
TARGET_LIB = libpxi_sp$(TWL_LIBSUFFIX).a
|
||||
|
||||
|
||||
@ -28,7 +28,9 @@ SRCDIR = ../common .
|
||||
SRCDIR += $(TWL_NITROSDK_ROOT)/build/libraries/pxi/common/src \
|
||||
$(TWL_NITROSDK_ROOT)/build/libraries/pxi/ARM9/src \
|
||||
|
||||
SRCS = pxi_init.c pxi_fifo.c
|
||||
SRCS = pxi_init.c \
|
||||
pxi_fifo.c \
|
||||
pxi_intf.c \
|
||||
|
||||
TARGET_LIB = libpxi$(TWL_LIBSUFFIX).a
|
||||
|
||||
|
||||
63
build/libraries/pxi/common/pxi_intf.c
Normal file
63
build/libraries/pxi/common/pxi_intf.c
Normal file
@ -0,0 +1,63 @@
|
||||
/*---------------------------------------------------------------------------*
|
||||
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)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
@ -19,6 +19,7 @@
|
||||
#include <nitro.h>
|
||||
|
||||
#include <twl/os.h>
|
||||
#include <twl/pxi.h>
|
||||
#include <twl/mi.h>
|
||||
#include <twl/pm.h>
|
||||
#include <twl/aes.h>
|
||||
|
||||
25
include/twl/pxi.h
Normal file
25
include/twl/pxi.h
Normal file
@ -0,0 +1,25 @@
|
||||
/*---------------------------------------------------------------------------*
|
||||
Project: TwlSDK - include - PXI
|
||||
File: pxi.h
|
||||
|
||||
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: $
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef TWL_PXI_H_
|
||||
#define TWL_PXI_H_
|
||||
|
||||
#include <nitro/pxi.h>
|
||||
|
||||
#include <twl/pxi/common/intf.h>
|
||||
|
||||
/* TWL_PXI_H_ */
|
||||
#endif
|
||||
67
include/twl/pxi/common/intf.h
Normal file
67
include/twl/pxi/common/intf.h
Normal file
@ -0,0 +1,67 @@
|
||||
/*---------------------------------------------------------------------------*
|
||||
Project: TwlSDK - -include - PXI
|
||||
File: intf.h
|
||||
|
||||
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: $
|
||||
*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef TWL_PXI_COMMON_INTF_H_
|
||||
#define TWL_PXI_COMMON_INTF_H_
|
||||
|
||||
#include <nitro/types.h>
|
||||
#include <nitro/memorymap.h>
|
||||
#include <nitro/pxi/common/regname.h>
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: PXI_SendByIntf
|
||||
|
||||
Description: send 4bit data to other processor
|
||||
|
||||
Arguments: id notifying id
|
||||
|
||||
Returns: None
|
||||
*---------------------------------------------------------------------------*/
|
||||
void PXI_SendByIntf( u32 data );
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: PXI_RecvByIntf
|
||||
|
||||
Description: receive 4bit data from the other processor
|
||||
|
||||
Arguments: None
|
||||
|
||||
Returns: received id
|
||||
*---------------------------------------------------------------------------*/
|
||||
u32 PXI_RecvByIntf( void );
|
||||
|
||||
/*---------------------------------------------------------------------------*
|
||||
Name: PXI_WaitByIntf
|
||||
|
||||
Description: Wait 4bit data from the other processor
|
||||
|
||||
Arguments: id waiting id
|
||||
|
||||
Returns: None
|
||||
*---------------------------------------------------------------------------*/
|
||||
void PXI_WaitByIntf( u32 data );
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* extern "C" */
|
||||
#endif
|
||||
|
||||
#endif /* TWL_PXI_COMMON_INTF_H_ */
|
||||
Loading…
Reference in New Issue
Block a user