;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; Copyright (c) 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 :   usg.h
;
; Purpose   :   USAGE Header File
;
; File Change History:
;
;               01/02/2002 FSU - Created usg.h for m851
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;


; Starting address allocated for usage counters in EEPROM.
USGEEPROMALLOCSTART         equ     COREUSAGEADDRESSINEEPROM



;------------------------------------------------------------------------------
; Starting addresses of each counter in the EEPROM.
;   The definition of the equate determines the starting address of the 
;   previous counter plus the number of bytes allocated for the previous 
;   counter.
;   Refer to the IC Programming Spec for the definition of each counter. 
;   The arrangement in the EEPROM and IC Spec is the same. 
;   The LSD has the lowest address in all counters.
;
;   W A R N I N G !!! Do not rearrange.  PC software should have this 
;     arrangement.
;------------------------------------------------------------------------------

USGNUMOFDAYSUSED                    equ     USGEEPROMALLOCSTART + 0

USGCWPULSES                         equ     USGNUMOFDAYSUSED + 2                                    

USGCCWPULSES                        equ     USGCWPULSES + 3

USGELSWCONTACTS                     equ     USGCCWPULSES + 3                        

USGSETCONTACTS                      equ     USGELSWCONTACTS + 3                     

USGSTARTSPLITCONTACTS               equ     USGSETCONTACTS + 3                      

USGSTOPRESETCONTACTS                equ     USGSTARTSPLITCONTACTS + 3

USGMODECONTACTS                     equ     USGSTOPRESETCONTACTS + 3                

USGPEEKATTOD                        equ     USGMODECONTACTS + 3                     

USGPEEKATTZ2                        equ     USGPEEKATTOD + 2

USGPEEKATTZ3                        equ     USGPEEKATTZ2 + 2                        

USGPEEKATNEXTAPPT                   equ     USGPEEKATTZ3 + 2                        

USGPEEKATNEXTOCCASION               equ     USGPEEKATNEXTAPPT + 2                   

USGSNOOZEUSES                       equ     USGPEEKATNEXTOCCASION + 2

USGCHRSTARTFROMRESET                equ     USGSNOOZEUSES + 2                       

USGCHRSPLITSTAKEN                   equ     USGCHRSTARTFROMRESET + 2                

USGCHRWORKOUTSTORED                 equ     USGCHRSPLITSTAKEN + 2                   

USGHIGHESTNUMFORLAPCOUNT            equ     USGCHRWORKOUTSTORED + 2                 

USGLOWESTNUMOFLAPSFREE              equ     USGHIGHESTNUMFORLAPCOUNT + 1            

USGCHRRESULTINFULLMEMORY            equ     USGLOWESTNUMOFLAPSFREE + 1              

USGENTRANCESRECALLSETSTATE          equ     USGCHRRESULTINFULLMEMORY + 2            

USGENTRANCESFORMATSETSTATE          equ     USGENTRANCESRECALLSETSTATE + 2          

USGTMRPOPUPSTOPATEND                equ     USGENTRANCESFORMATSETSTATE + 2          

USGTMRPOPUPREPEATATEND              equ     USGTMRPOPUPSTOPATEND + 2                

USGTMRPOPUPCHRONOATEND              equ     USGTMRPOPUPREPEATATEND + 2              

USGINTPOPUPS                        equ     USGTMRPOPUPCHRONOATEND + 2              

USGHALFWAYREMINDERS                 equ     USGINTPOPUPS + 2                        

USGENTRANCESTOANYTMRSETSTATE        equ     USGHALFWAYREMINDERS + 2                 

USGENTRANCESTOTRAININGLOGMODE       equ     USGENTRANCESTOANYTMRSETSTATE + 2        

USGENTRANCESTOSYNCHROMODE           equ     USGENTRANCESTOTRAININGLOGMODE + 2       

USGENTRANCESTOCOUNTERMODE           equ     USGENTRANCESTOSYNCHROMODE + 2           

USGINCREMENTSINCOUNTERMODE          equ     USGENTRANCESTOCOUNTERMODE + 2           
    
USGDECREMENTSINCOUNTERMODE          equ     USGINCREMENTSINCOUNTERMODE + 2          
                                                
USGENTRANCESTOSCHEDULEMODE          equ     USGDECREMENTSINCOUNTERMODE + 2          

USGALARMPOPUPS                      equ     USGENTRANCESTOSCHEDULEMODE + 2          

USGALARMENTRIESDELETED              equ     USGALARMPOPUPS + 2                      

USGALARMENTRIESCREATED              equ     USGALARMENTRIESDELETED + 2              

USGALARMENTRIESEDITED               equ     USGALARMENTRIESCREATED + 2              

USGAPPTPOPUPS                       equ     USGALARMENTRIESEDITED + 2       

USGAPPTENTRIESDELETED               equ     USGAPPTPOPUPS + 2           

USGAPPTENTRIESCREATED               equ     USGAPPTENTRIESDELETED + 2               

USGAPPTENTRIESEDITED                equ     USGAPPTENTRIESCREATED + 2               

USGENTRANCESTOOCCASSIONMODE         equ     USGAPPTENTRIESEDITED + 2                

USGENTRANCESTOCONTACTMODE           equ     USGENTRANCESTOOCCASSIONMODE + 2         

USGPAUSEINCONTACTMODE               equ     USGENTRANCESTOCONTACTMODE + 2           

USGMANUALSCROLLINGCONTACTMODE       equ     USGPAUSEINCONTACTMODE + 2               

USGENTRACESTONOTEMODE               equ     USGMANUALSCROLLINGCONTACTMODE + 2       

USGPAUSEINNOTEMODE                  equ     USGENTRACESTONOTEMODE + 2               

USGMANUALSCROLLINNOTEMODE           equ     USGPAUSEINNOTEMODE + 2                  

USGNOTEENTRIESDELETED               equ     USGMANUALSCROLLINNOTEMODE + 2           

USGNOTEENTRIESCREATED               equ     USGNOTEENTRIESDELETED + 2               

USGNOTEENTRIESEDITED                equ     USGNOTEENTRIESCREATED + 2               

USGENTRANCESTOOPTIONMODE            equ     USGNOTEENTRIESEDITED + 2                

USGCHANGESTONMSTATUSINOPTIONMODE    equ     USGENTRANCESTOOPTIONMODE + 2            

USGCHANGESTONMSTATUSBYHOLDINGELSW   equ     USGCHANGESTONMSTATUSINOPTIONMODE + 2    

USGENTRANCESTOCOMMSTATE             equ     USGCHANGESTONMSTATUSBYHOLDINGELSW + 2

USGENTRANCESTOCOMMERRORSTATE        equ     USGENTRANCESTOCOMMSTATE + 2             

USGINITIALIZATIONDUETOCOMMERROR     equ     USGENTRANCESTOCOMMERRORSTATE + 2        

USGCROWNOUTPOPUPS                   equ     USGINITIALIZATIONDUETOCOMMERROR + 2     

USGSUCCESSFULENTRIESOFPASSWORD      equ     USGCROWNOUTPOPUPS + 2   

USGPORFROMANYSOURCE                 equ     USGSUCCESSFULENTRIESOFPASSWORD + 2

USGPORCAUSEDBYWATCHDOG              equ     USGPORFROMANYSOURCE + 2

USGENDADDRESSOFEEPROMCOUNTERS       equ     USGPORCAUSEDBYWATCHDOG + 2


;------------------------------------------------------------------------------
; Type of RAM counters to update/increment.
;------------------------------------------------------------------------------

USGRAMCWPULSES                      equ     USGBufferCWPulses           

USGRAMCCWPULSES                     equ     USGBufferCCWPulses          

USGRAMELSWCONTACTS                  equ     USGBufferELSWContacts       

USGRAMSETCONTACTS                   equ     USGBufferSETContacts        

USGRAMSTARTSPLITCONTACTS            equ     USGBufferSTARTSPLITContacts

USGRAMSTOPRESETCONTACTS             equ     USGBufferSTOPRESETContacts  

USGRAMMODECONTACTS                  equ     USGBufferMODEContacts       


;------------------------------------------------------------------------------
; Miscellaneous
;------------------------------------------------------------------------------

; Number of bytes used in the EEPROM.
USGNUMBEROFEEPROMBYTESUSED              equ     (USGENDADDRESSOFEEPROMCOUNTERS - USGNUMOFDAYSUSED) + 1

; Assumption:  The EEPROM counter for the lowest number of laps free must be on the first
;                64 bytes.
; This will be the offset from the COREWorkBuffer to know where the lowest number
;   of laps free will be initialize.
USGLOWESTNUMLAPSFREEOFFSET              equ     (USGLOWESTNUMOFLAPSFREE - USGNUMOFDAYSUSED)


; Number of RAM counters.
USGNUMBEROFRAMCOUNTERS                  equ     7

; Number of bytes occupied for each RAM counters in RAM.
USGNUMBEROFBYTESPERRAMCOUNTERINRAM      equ     2

; Number of bytes occupied for each RAM counters in EEPROM.
USGNUMBEROFBYTESPERRAMCOUNTERINEEPROM   equ     3

; Number of bytes allocated for RAM counters.
USGNUMOFRAMBYTESALLOCFORRAM             equ     (USGNUMBEROFRAMCOUNTERS * USGNUMBEROFBYTESPERRAMCOUNTERINRAM)

; Number of bytes allocated for RAM counters in EEPROM.
USGNUMOFRAMBYTESALLOCFOREEPROM          equ     (USGNUMBEROFRAMCOUNTERS * USGNUMBEROFBYTESPERRAMCOUNTERINEEPROM)