
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; 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      :  ksyn.h
;
; Purpose        :  Synchro Stopwatch Resource Header File
;
; Change History :  06/08/2000 RVD - Created file
;
;   M851 Development:
;
;                   11/19/2001 FSU - Modified for M851 Development
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;******************************************************************************
;
; This design is limited to only one synchro resource.
;
;******************************************************************************

;==============================================================================
; Run-out value.
;==============================================================================

KSYNRUNOUTHUNDREDS                  equ     99h
KSYNRUNOUTSECONDS                   equ     59h
KSYNRUNOUTMINUTES                   equ     59h
KSYNRUNOUTHOURS                     equ     99h


;==============================================================================
; Bit 7 of 'COREStopwatchControl' will be used by synchro.  Make sure that 
;   STP will only have a maximum of 7 resources so that only 7 bits of 
;   'COREStopwatchControl' will be used and leaving the 8th bit to be used 
;   by SYN.
;==============================================================================
bKSYN16HzControl                    equ     10000000B


;==============================================================================
; Return value that would indicate the status of the specific resource.
;==============================================================================
KSYNTOTALSTATUSRESET        equ         0
KSYNTOTALSTATUSSTOPPED      equ         bKNotReset
KSYNTOTALSTATUSRUNNING      equ         (bKActive | bKNotReset)

KSYNTOTALSTATUSMASK         equ         (bKActive | bKNotReset)

KSYNSTOPSTATUSRESET         equ         0
KSYNSTOPSTATUSSTOPPED       equ         bKNotReset
KSYNSTOPSTATUSRUNNING       equ         (bKSYNStartStoppage | bKNotReset)

KSYNSTOPSTATUSMASK          equ         (bKSYNStartStoppage | bKNotReset)



;==============================================================================
; Miscellaneous
;==============================================================================

KSYNSYNCHROINDEX                    equ     00h

; Returned code if there is an error in a resource function call.
KSYNERRORCODE                       equ     0FFh            
                                                    
; All flags clear value for initialization  
KSYNFLAGSCLEAR                      equ     00h             

; Offset to the working hundredths data from the previous hundredths sample data.
KSYNWORKHUNDOFFSETFROMPREVHUND      equ     2

; Offset to the update flags from the working hundredths data.
KSYNUPDFLAGOFFSETFROMWORKHUND       equ     4




