#ifndef NMonSrv_h
#define NMonSrv_h
/*******************************************************************************
NMonSrv - Nohau Monitor Services

Creator: Sten Larsson
$Header: /NCARM_Misc/Monitor/NMon/NMon/NSrv.h 15    11/12/02 10:16p Stenl $
--------------------------------------------------------------------------------
DO NOT MODIFY THIS FILE - IT IS A PART OF NMON (Nohau Monitor) AND MAY BE 
UPDATED IN FUTURE RELEASES OF SEEHAU.

This computer software is owned by Nohau Corp, and is protected by U.S. 
copyright laws and other laws and by international treaties. Customers of Nohau
emulators/debuggers are allowed include it in their products for the purpose of 
enhancing the debug capabilities of Nohau products. It is not allowed to use it 
for any other purpose. The source code may not be provided or otherwise made 
available to third parties, except with the purpose of using it with Nohau 
tools. Nohau may elect to grant exceptions to the above statement in a written 
agreement.

Copyright  ©  2002, Nohau Corporation. All Rights Reserved.
Copyright (c) 2002, Nohau Corporation. All Rights Reserved.
*******************************************************************************/
/*
Nohau Monitor Services are called from within NMon when commands are received.

The intention is for customers to modify those to support reading serial 
EEPROMs, writing to Flash etc.

NOTE - Seehau only supports NSPACE_FLASH and NSPACE_RAM at this time.
NSPACE_FLASH will be used when loading into flash, at all other times it will 
be NSPACE_RAM.
*/
#include "NDefs.h"

#ifdef __cplusplus
extern "C" {
#endif

/*##############################################################################
## EXPORTED FUNCTIONS
##############################################################################*/

         /* Init is called at program start and for command NMON_SET_DEFAULTS */
void     NSrv_Init      (void);

         /* Read and write - functions. 
         ** These operate on global data updated by NMon before any of the 
         ** functions in this module are called. The global parameters are:
         **     NMon_AddrLimit_Lo
         **     NMon_AddrLimit_Hi 
         **     NMon_Addr_Curr
         **     NMon_Addr_Last    
         **     NMon_Addr_Space
         ** See "NMon.h" for documentation.
         **
         ** When reading, put data into NMon_Buf.
         ** When writing, read data to write from NMon_Buf.
         ** 
         ** The functions will only be called if NSrv_WantXXX() returns TRUE
         ** 
         ** All functions that return a BYTE should return a NSTAT_xxx constant.
         ** At sucess, that would be NSTAT_OK, otherwise look in "NMon_Cmd.h" 
         ** for a suitable return value.
         */
         
         /* Write ----------------------------------------------------------- */
         /* Note that the functions are listed in the order they are called. */

BOOL     NSrv_WantWrite(void); /* Does the target specific code want to do the 
'                              ** write? If yes, return TRUE. Otherwise false.*/

BYTE     NSrv_PreWrite (void); /* Actions before write starts, erase mem etc. */
BYTE     NSrv_Write    (void); /* Do the actual write. */
BYTE     NSrv_PostWrite(void); /* Actions after mem write - enable flash etc. */


         /* Read ------------------------------------------------------------ */
         /* Note that the functions are listed in the order they are called.  */

BOOL     NSrv_WantRead (void); /* Does the target specific code want to do the
                               **  read? If yes, return TRUE. Otherwise false.*/

BYTE     NSrv_Read     (void); /* Do the actual read. */

#ifdef __cplusplus
}
#endif
#endif /* NMonSrv_h */
