;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; Copyright (c) 2000 - 2002 TIMEX Corporation.
; 
; This document is the property of, and contains information proprietary to
; TIMEX Corporation.  It is to be returned upon request.  Reproduction by any
; means, disclosure, or use of its contents for other than the expressed
; purpose for which it is loaned, without the written consent of TIMEX
; Corporation, is strictly prohibited.
;
; File Name      : ktmr.h
;
; Purpose        : Timer Resource Header File
;
; Change History : 06/12/2000 HSB - Created file
;
;   M851 Development:
;
;                  12/07/2001 FSU - Modified for M851
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;==============================================================================
;
; TIMER RESOURCE DEFINITIONS
;
;==============================================================================

;------------------------------------------------------------------------------
; Returned code if there is an error in a resource function call.
;------------------------------------------------------------------------------
KTMRERRORCODE       equ     0FFh        


;------------------------------------------------------------------------------
; Offset for Timer Second, Hour and minute from seconds address.
;------------------------------------------------------------------------------
KTMRSECONDOFFSET    equ     0
KTMRMINUTEOFFSET    equ     1 
KTMRHOUROFFSET      equ     2


;------------------------------------------------------------------------------
; Type of action that will be processed.
;   This will be the return value of a function when the timer has completed 
;   its countdown or reach the halfway point.
;------------------------------------------------------------------------------
KTMRSTOPATEND       equ     0
KTMRREPEATATEND     equ     1
KTMRSTPLINK         equ     2
KTMRTMRLINK         equ     3
KTMRPREWARNING      equ     4


;------------------------------------------------------------------------------
; Return value that would indicate the status of the specific resource.
;------------------------------------------------------------------------------
KTMRSTATUSRESET     equ     0                       ; bKActive = 0 ; bKNotReset = 0
KTMRSTATUSSTOPPED   equ     bKNotReset              ; bKActive = 0 ; bKNotReset = 1
KTMRSTATUSRUNNING   equ     (bKActive | bKNotReset) ; bKActive = 1 ; bKNotReset = 1


; Mask value to the resource flag to indicate its status.
KTMRSTATUSMASK      equ     (bKActive | bKNotReset)


;------------------------------------------------------------------------------
;
;   UPDATE FLAG
;
;       -> bKTMRSecondUpd           equ 00000001B   ; 1 - Seconds data is updated.
;       -> bKTMRMinuteUpd           equ 00000010B   ; 1 - Minute data is updated.
;       -> bKTMRHourUpd             equ 00000100B   ; 1 - Hour data is updated.
;       -> bKTMRPreWarnEnTracking   equ 00001000B   ; 1 - Pre-warning tracking is enabled.
;       -> bKTMRPreWarnReqTracking  equ 00010000B   ; 1 - Pre-warning tracking is requested.
;       -> bKTMRRepeat              equ 00100000B   ; 1 - Repeat count is done on expiry.
;       -> bKTMRDirection           equ 01000000B   ; 1 - Count up , 0 - Count down
;       -> UNUSED                                   
;
;   'bKTMRPreWarnEnTracking' | 'bKTMRPreWarnReqTracking'  
;
;               0                          0              = Pre-warning is disabled.  No pre-warning
;                                                             tracking should occur.
;
;               0                          1              = Pre-warning tracking is requested but no
;                                                             tracking is done.  This would happen if
;                                                             the pre-warning tracking is finished for
;                                                             the current timer operation.
;
;                                                           The 'bKTMRPreWarnEnTracking' bit will be
;                                                             set automatically when the current resource
;                                                             is set to repeat at end.  
;
;               1                          0              = Pre-warning tracking is enabled and is not
;                                                             requested so no tracking should occur.
;
;               1                          1              = Pre-warning tracking is enabled and is
;                                                             requested so tracking a pre-warning.
;
;                                                           The 'bKTMRPreWarnEnTracking' bit will be
;                                                             cleared when the pre-warning data have
;                                                             been achieved.  So, no more pre-warning
;                                                             tracking unless it is set to repeat at
;                                                             end.
;
;------------------------------------------------------------------------------


