/*---------------------------------------------------------------------------* 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 //---------------------------------------------------------------------- //---- timer ID typedef enum { OS_CPU_TIMER = 0, OS_CPU_WATCHDOG = 1 } OSTimerID; typedef enum { OS_WD_WATCHDOG_MODE = HW_CPUWD_WATCHDOG_MODE, OS_WD_TIMER_MODE = HW_CPUWD_TIMER_MODE } OSWatchdogMode; typedef enum { OS_TM_AUTO_RELOAD = HW_CPUTM_AUTO_RELOAD, OS_TM_SINGLE_SHOT = HW_CPUTM_SINGLE_SHOT } OSTimerRepeat; typedef enum { OS_TM_INTR_REQ_ENABLE = HW_CPUTM_INTR_ENABLE, 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_