/* * Michael Fernandes * Shirley Gaw * CSE 466 Final Project - Shared Memory with I2C * * Specification of the serial port interface * * Created: 12/17/2001 * Modified: 12/17/2001 * */ #ifndef __SERIAL_H__ #define __SERIAL_H__ #define BAUD_RATE_9600 0xFD #define BAUD_RATE_4800 0xFA #define BAUD_RATE_2400 0xF4 #define BAUD_RATE_1200 0xE8 #define CARRIAGE_RETURN 13 // Initialize the processor for serial mode // Must be called before using any of the below functions void Serial_Init(unsigned char baudRate); // Send a single character void Serial_SendCharacter(unsigned char character); // Send the decimal value of the character void Serial_SendDecimal(unsigned char character); // Send a string of characters // If delimiter is found, no more of the string is sent (delimiter is not sent) // Else if maxSize characters are sent, no more of the string is sent void Serial_SendString(unsigned char* string, unsigned char delimiter, unsigned char maxSize); // Send a new line void Serial_SendNewLine(); // Receive a character void Serial_ReceiveCharacter(unsigned char* character); bit SERIAL_getReceivingString(); // Receive a string of characters // If delimiter is received, the string is returned terminated by the delimiter // Else if maxSize-1 characters are received, the delimiter is added no matter what void Serial_ReceiveString(unsigned char* string, unsigned char delimiter, unsigned char maxSize); #endif // __I2C_SERIAL__