/* This file may be #included with any C source 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 typedefs used by D-Bug12 */ typedef char * Address; typedef int Boolean; typedef unsigned char Byte; typedef enum Vect { UserPortHKWU = 7, UserPortJKWU = 8, UserAtoD = 9, UserSCI1 = 10, UserSCI0 = 11, UserSPI0 = 12, UserTimerCh0 = 13, UserTimerCh1 = 14, UserTimerCh2 = 15, UserTimerCh3 = 16, UserTimerCh4 = 17, UserTimerCh5 = 18, UserTimerCh6 = 19, UserTimerCh7 = 20, UserPAccOvf = 21, UserPAccEdge = 22, UserTimerOvf = 23, UserRTI = 24, UserIRQ = 25, UserXIRQ = 26, UserSWI = 27, UserTrap = 28, RAMVectAddr = -1 }; /* structure that defines the functions in D-Bug12's user accessable */ /* 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 (*DB12main)(void); int (*DB12getchar)(void); int (*DB12putchar)(int); int (*DB12printf)(const char *, ...); int (*GetCmdLine)(char *CmdLineStr, int CmdLineLen); char * (*sscanhex)(char *HexStr, unsigned int *BinNum); int (*DB12isxdigit)(int c); int (*DB12toupper)(int c); int (*DB12isalpha)(int c); unsigned int (*DB12strlen)(const char *cs); char * (*DB12strcpy)(char *s1, char *s2); void (*out2hex)(unsigned int num); void (*out4hex)(unsigned int num); int (*SetUserVector)(int VectNum, Address UserAddress); Boolean (*WriteEEByte)(Address EEAddress, Byte EEData); int (*EraseEE)(void); int (*ReadMem)(Address StartAddress, Byte *MemDataP, unsigned int NumBytes); int (*WriteMem)(Address StartAddress, Byte *MemDataP, unsigned int NumBytes); } UserFN, * UserFNP; /* defines a pointer to the start of D-Bug12's user accessable functable */ #define MyUserFNP ((UserFNP)0xfe00) /* The following #defines are used to provide for portability and avoid a linker */ /* conflict with the standard library functions of the same name. No #define is */ /* included for DB12main() since all C programs must contain a main() function */ #define printf DB12printf #define getchar DB12getchar #define putchar DB12putchar #define isxdigit DB12isxdigit #define toupper DB12toupper #define isalpha DB12isalpha #define strlen DB12strlen #define strcpy DB12strcpy