ctr_firmware/trunk/bootrom/include/brom/os/ARM11/timer.h
nakasima d58a354198 タイマーレジスタの二重定義を整理。
git-svn-id: file:///Volumes/Transfer/gigaleak_20231201/2020-09-30%20-%20paladin.7z/paladin/ctr_firmware@104 b871894f-2f95-9b40-918c-086798483c85
2008-12-12 08:43:31 +00:00

124 lines
3.0 KiB
C

/*---------------------------------------------------------------------------*
Project: CtrBrom - OS - include
File: timer.h
Copyright 2008 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.
$Date:: $
$Rev$
$Author$
*---------------------------------------------------------------------------*/
#ifndef BROM_OS_TIMER_H_
#define BROM_OS_TIMER_H_
#include <brom/types.h>
#include <ctr/arm_reg.h>
#ifdef __cplusplus
extern "C" {
#endif
#define OS_TIMER_CLOCK_DEFAULT HW_CPU_CLOCK
//----------------------------------------------------------------------
//---- timer ID
typedef enum
{
OS_CPU_TIMER = 0,
OS_CPU_WATCHDOG = 1
}
OSTimerID;
typedef enum
{
OS_WD_WATCHDOG_MODE = REG_OS_WD_CNT_M_MASK,
OS_WD_TIMER_MODE = 0
}
OSWatchdogMode;
typedef enum
{
OS_TM_AUTO_RELOAD = REG_OS_TM_CNT_RLD_MASK,
OS_TM_SINGLE_SHOT = 0
}
OSTimerRepeat;
typedef enum
{
OS_TM_INTR_REQ_ENABLE = REG_OS_TM_CNT_IT_MASK,
OS_TM_INTR_REQ_DISABLE = 0
}
OSTimerIntrReq;
void osInitTimer( void );
/*---------------------------------------------------------------------------*
Name: osStartTimerWithUSec
Description: Start Timer
Arguments: micro second
Returns: None
*---------------------------------------------------------------------------*/
void osStartTimerWithUSec( u32 usec, u8 preScale );
/*---------------------------------------------------------------------------*
Name: osStartTimerWithMSec
Description: Start Timer
Arguments: milli second
Returns: None
*---------------------------------------------------------------------------*/
void osStartTimerWithMSec( u32 msec, u8 preScale );
/*---------------------------------------------------------------------------*
Name: osStartTimer
Description: Start Timer
Arguments: interval
Returns: None
*---------------------------------------------------------------------------*/
void osStartTimer( u32 count, u8 preScale );
/*---------------------------------------------------------------------------*
Name: osStopTimer
Description: Stop Timer
Arguments: None
Returns: None
*---------------------------------------------------------------------------*/
void osStopTimer( void );
BOOL osEnableTimerAndWatchdog( void );
BOOL osDisableTimerAndWatchdog( void );
void osStartWatchDog( u32 count, u8 preScale, OSWatchdogMode watchdogMode );
void osStopWatchDog( void );
void osResetWatchdog( void );
void osDisableWatchdog( void );
#ifdef __cplusplus
} // extern "C"
#endif
#endif // BROM_OS_TIMER_H_