/************************************************************************/ /* */ /* Serial_Interface.h -- Allows interface - computer <-> AVR */ /* */ /************************************************************************/ /* Author: Chris Keeser */ /* Revision History: */ /* created: (ChrisK) 7/1/05 */ /************************************************************************/ #ifndef SERIAL_INTERFACE #define SERIAL_INTERFACE /* ------------------------------------------------------------ */ /* Include File Definitions */ /* ------------------------------------------------------------ */ #include #include #include #include #include "GenDefs.h" // is necessary to use the interrput // handling macro INTERRUPT() #include // is necessary to use // sei() and cli() #include // command interface #include "SerialCommand.h" // choose usart 1 or 0 #define USART_ONE //#define USART_ZERO /* ------------------------------------------------------------ */ /* Local Definitions */ /* ------------------------------------------------------------ */ #define MAX_GET 256 // max stringlength for commands #define STRING_WAITING 255 // string recieved and ready indicator #define NO_STRING_WAITING 0 // string not recieved #define TX_DELAY 1 /*-------------------------------------- For this program to work, you must read the factory osccal value from the device! this value must then be written into EEPROM memory at address that matches value defined as EEPROM_OSCCAL_ADDRESS --------------------------------------*/ #define EEPROM_OSCCAL_ADDRESS 0x000 /* ------------------------------------------------------------ */ /* global Declarations */ /* ------------------------------------------------------------ */ volatile char szCommand[MAX_GET]; volatile uint8_t fStringWaiting; /* ------------------------------------------------------------ */ /* Forward Declarations */ /* ------------------------------------------------------------ */ void InitHardwareRS232(void); void tx_byte(char); void DeleteChar(void); // deletes a character from the terminal void ResetCommand(void); // clears the fstringReady flag, resets the string void tx_string(char * szMessage); // transmits a string to the serial terminal // converts an ascii string of 1's and zeros into // a BYTE value BYTE sz_to_int(char * sz); #endif