add pm extensions.

git-svn-id: file:///Users/lillianskinner/Downloads/platinum/twl/twl_wrapsdk/trunk@98 4ee2a332-4b2b-5046-8439-1ba90f034370
This commit is contained in:
nakasima 2007-05-31 05:23:00 +00:00
parent 0dba10e72f
commit 361d7a0ab1
8 changed files with 218 additions and 9 deletions

View File

@ -176,6 +176,7 @@ TWL_LIBS_BASE ?= \
libmi_sp \ libmi_sp \
libvlink_sp \ libvlink_sp \
libnvram_sp \ libnvram_sp \
libpm_sp \
libaes_sp \ libaes_sp \
libi2c_sp \ libi2c_sp \
libcdc_sp \ libcdc_sp \

View File

@ -15,7 +15,7 @@
# $NoKeywords: $ # $NoKeywords: $
#---------------------------------------------------------------------------- #----------------------------------------------------------------------------
SUBDIRS = nvram # tp mic pm SUBDIRS = nvram pm # tp mic
#---------------------------------------------------------------------------- #----------------------------------------------------------------------------

View File

@ -0,0 +1,61 @@
#! make -f
#----------------------------------------------------------------------------
# Project: TwlSDK - libraries - spi
# File: Makefile
#
# 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: $
#----------------------------------------------------------------------------
SUBDIRS =
#----------------------------------------------------------------------------
# build ARM & THUMB libraries
TWL_CODEGEN_ALL ?= True
TWL_PROC = ARM7
SRCDIR = .
SRCDIR += $(TWL_NITROSDK_ROOT)/build/libraries/spi/ARM7/pm/src \
SRCS = pm_sp.c \
pm_send.c \
pm_pmic.c \
pm_pmic_ex.c \
pm_utility.c \
pm_sleep.c \
pm_selfBlink.c \
TARGET_LIB = libpm_sp$(TWL_LIBSUFFIX).a
INCDIR = $(TWL_NITROSDK_ROOT)/build/libraries/spi/ARM7/include
#----------------------------------------------------------------------------
# DEBUG版ビルドの場合、RELEASE版でビルドして
# DEBUG版のライブラリを装います。
ifdef NITRO_DEBUG
NITRO_BUILD_TYPE = RELEASE
endif
include $(TWLSDK_ROOT)/build/buildtools/commondefs
INSTALL_TARGETS = $(TARGETS)
INSTALL_DIR = $(TWL_INSTALL_LIBDIR)
#----------------------------------------------------------------------------
do-build: $(TARGETS)
include $(TWLSDK_ROOT)/build/buildtools/modulerules
#===== End of Makefile =====

View File

@ -0,0 +1,73 @@
/*---------------------------------------------------------------------------*
Project: TwlSDK - libraries - spi - pm
File: pm_pmic_ex.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_PM_PMIC_EX_H_
#define TWL_PM_PMIC_EX_H_
#include <twl/misc.h>
#include <twl/types.h>
#include "../include/pm_pmic.h"
#ifdef __cplusplus
extern "C" {
#endif
//================================================================================
// PMIC ACCESS
//================================================================================
/*---------------------------------------------------------------------------*
Name: PMi_SetParams
Description: set control bit to device register
Arguments: reg : device register
setBits : bits to set
maskBits : bits to mask
Returns: None
*---------------------------------------------------------------------------*/
void PMi_SetParams( u8 reg, u8 setBits, u8 maskBits );
/*---------------------------------------------------------------------------*
Name: PMi_SetFlags
Description: set control bit to device register
Arguments: reg : device register
setBits : bits to set
Returns: None
*---------------------------------------------------------------------------*/
void PMi_SetFlags( u8 reg, u8 setBits );
/*---------------------------------------------------------------------------*
Name: PMi_ResetFlags
Description: clear control bit to device register
Arguments: reg : device register
clrBits : bits to set
Returns: None
*---------------------------------------------------------------------------*/
void PMi_ResetFlags( u8 reg, u8 clrBits );
#ifdef __cplusplus
} /* extern "C" */
#endif
/* TWL_PM_PMIC_EX_H_ */
#endif

View File

@ -0,0 +1,73 @@
/*---------------------------------------------------------------------------*
Project: TwlSDK - libraties - spi - pm
File: pm_pmic_ex.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/pm.h>
#include "./include/pm_pmic_ex.h"
//================================================================================
// PMIC BIT CONTROL
//================================================================================
/*---------------------------------------------------------------------------*
Name: PMi_SetParams
Description: set control bit to device register
Arguments: reg : device register
setBits : bits to set
maskBits : bits to mask
Returns: None
*---------------------------------------------------------------------------*/
void PMi_SetParams( u8 reg, u8 setBits, u8 maskBits )
{
u8 tmp;
tmp = PMi_GetRegister( reg );
tmp &= ~maskBits;
setBits &= maskBits;
tmp |= setBits;
PMi_SetRegister( reg, tmp );
}
/*---------------------------------------------------------------------------*
Name: PMi_SetFlags
Description: set control bit to device register
Arguments: reg : device register
setBits : bits to set
Returns: None
*---------------------------------------------------------------------------*/
void PMi_SetFlags( u8 reg, u8 setBits )
{
PMi_SetParams( reg, setBits, setBits );
}
/*---------------------------------------------------------------------------*
Name: PMi_ResetFlags
Description: clear control bit to device register
Arguments: reg : device register
clrBits : bits to set
Returns: None
*---------------------------------------------------------------------------*/
void PMi_ResetFlags( u8 reg, u8 clrBits )
{
PMi_SetParams( reg, 0, clrBits );
}

View File

@ -17,13 +17,14 @@
#ifndef TWL_SPI_SPI_H_ #ifndef TWL_SPI_SPI_H_
#define TWL_SPI_SPI_H_ #define TWL_SPI_SPI_H_
#include <twl/misc.h>
#include <nitro/ioreg.h>
#include <nitro/hw/ARM7/ioreg_SPI.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
#include <nitro/ioreg.h>
#include <nitro/hw/ARM7/ioreg_SPI.h>
//---------------------------------------------------------------- //----------------------------------------------------------------
// enums // enums
// //

View File

@ -19,7 +19,7 @@
#include <nitro/spi.h> #include <nitro/spi.h>
#include <twl/pm/common/pm_ex_reg.h> #include <twl/pm/common/pm_reg_ex.h>
/* TWL_PM_H_ */ /* TWL_PM_H_ */
#endif #endif

View File

@ -1,6 +1,6 @@
/*---------------------------------------------------------------------------* /*---------------------------------------------------------------------------*
Project: TwlSDK - PM - include - common Project: TwlSDK - PM - include - common
File: pm_ex_reg.h File: pm_reg_ex.h
Copyright 2006 Nintendo. All rights reserved. Copyright 2006 Nintendo. All rights reserved.
@ -13,8 +13,8 @@
$Log: $ $Log: $
$NoKeywords: $ $NoKeywords: $
*---------------------------------------------------------------------------*/ *---------------------------------------------------------------------------*/
#ifndef TWL_PM_PM_EX_REG_H_ #ifndef TWL_PM_PM_REG_EX_H_
#define TWL_PM_PM_EX_REG_H_ #define TWL_PM_PM_REG_EX_H_
#ifdef __cplusplus #ifdef __cplusplus
@ -581,5 +581,5 @@ PMBackLightBrightness;
} /* extern "C" */ } /* extern "C" */
#endif #endif
/* TWL_PM_PM_EX_REG_H_ */ /* TWL_PM_PM_REG_EX_H_ */
#endif #endif