/* dbug12.h - Interface to DBug12 built-in utility routines. */

#ifndef DBUG12_H_
#define DBUG12_H_
/* This file may be included with any C file that uses the D-Bug12 user callable      */
/* routines. It provides a simple, portable way to access the routines from C without */
/* having to use any assembly language "glue code" 				      */
/* Some defaults used by D-Bug12 						      */
/* Modified by Navid Mohaghegh (MC9S912DP256 - 2006/12/13)		   	      */

/* Example: 
 *   DB12FNP->dbug12_printf("Hello, %s!\r\n", name);
 *   This writes the formatted string to the DBug12 serial port.
 */

/* The symbol "Version" should be set to the D-Bug12 version number that is being     */
/* used. For example, if the D-Bug12 version number is 1.0.4, Version should be 104.  */
#define Version 400

/* Structure that defines the functions in D-Bug12's user accessible 		*/
/* function table. Also provides a function prototype for each function 	*/
/* Documentation for each of these functions can be found in Application 	*/
/* Note AN-xxxx text 								*/

typedef struct
{
	void (*_dummy0)(void);
	void (*_dummy1)(void);
	int (*dbug12_getchar)(void);
	int (*dbug12_putchar)(int);
	int (*dbug12_printf)(const char *, ...);
	void (*_dummy2)(void);
	void (*_dummy3)(void);
	void (*_dummy4)(void);
	void (*_dummy5)(void);
	int (*dbug12_isxdigit)(int c);
	int (*dbug12_toupper)(int c);
	int (*dbug12_isalpha)(int c);
	unsigned int (*dbug12_strlen)(const char *cs);
	char *(*dbug12_strcpy)(char *s1, char *s2);
	void (*_dummy6)(void);
	void (*_dummy7)(void);
	void (*_dummy8)(void);
	void (*_dummy9)(void);
	int (*dbug12_set_user_vector)(int vect_num, void *user_address);
} UserFN, *UserFNP;

/* Defines a pointer to the start of D-Bug12's user accessible functable 	*/
/* in D-Bug12 version 4.x.x the user accessible table begins at $ee80 		*/
#define DB12FNP ((UserFNP)0xee80) 

#endif /* DBUG12_H_ */

