/*---------------------------------------------------------------------------* 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 #include #ifdef __cplusplus extern "C" { #endif #define OS_TIMER_CLOCK_DEFAULT HW_CPU_CLOCK #define OSi_WATCHDOG_DISABLE_CODE_0 0x12345678 #define OSi_WATCHDOG_DISABLE_CODE_1 0x87654321 //---------------------------------------------------------------------- //---- 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 ); /*---------------------------------------------------------------------------* Name: osStartWatchdogWithUSec Description: Start Watchdog Arguments: micro second Returns: None *---------------------------------------------------------------------------*/ void osStartWatchdogWithUSec( u32 usec, u8 preScale, OSWatchdogMode watchdogMode ); /*---------------------------------------------------------------------------* Name: osStartWatchdogWithMSec Description: Start Watchdog Arguments: milli second Returns: None *---------------------------------------------------------------------------*/ void osStartWatchdogWithMSec( u32 msec, u8 preScale, OSWatchdogMode watchdogMode ); /*---------------------------------------------------------------------------* Name: osStartWatchdog Description: Start Watchdog Arguments: interval watchdogMode Returns: None *---------------------------------------------------------------------------*/ void osStartWatchDog( u32 count, u8 preScale, OSWatchdogMode watchdogMode ); /*---------------------------------------------------------------------------* Name: osStopWatchdog Description: Stop Watchdog Arguments: None Returns: None *---------------------------------------------------------------------------*/ void osStopWatchdog( void ); BOOL osEnableTimerAndWatchdog( void ); BOOL osDisableTimerAndWatchdog( void ); void osResetWatchdog( void ); void osDisableWatchdog( void ); #ifdef __cplusplus } // extern "C" #endif #endif // BROM_OS_TIMER_H_