00001 /* ************************************************************************************************ 00002 * 00003 * Copyright (C) 2008-2009 00004 * Martin Kornfeld (alias: el07b502), Email: el07b502@technikum-wien.at 00005 * 00006 * ************************************************************************************************ 00007 * 00008 * @file timer.h 00009 * @brief This is the header file for all timeout sepcific functions<br/> 00010 * 00011 * It handles all timeout specific functions/variables.<br/> 00012 * It could be used with C167 AND AVR90USB 00013 * 00014 ************************************************************************************************* */ 00015 00016 00017 #ifndef USART_H 00018 #define USART_H 00019 00020 #include "sysconfig.h" 00021 00022 /* Structure for working with RS232 to save working parameters */ 00023 typedef struct rs232_ { 00024 00025 char *last_read; 00026 char *last_write; 00027 char *last_transmit; 00028 char *last_receive; 00029 char tmp_readbuf[MAX_RS232_CHARACTERS + 1]; 00030 char readbuf[MAX_RS232_CHARACTERS + 1]; 00031 char writebuf[MAX_RS232_CHARACTERS + 1]; 00032 int adc[MAX_RS232_CHARACTERS]; 00033 00034 char temperature[4]; 00035 00036 } rs232_struct; 00037 00038 extern rs232_struct rs232_info; 00039 00040 /* Function which simply writes a string out on the USART, blocking */ 00041 int usart_write (char *buffer); 00042 00043 /* Function which simply reads a string out on the USART, blocking */ 00044 int usart_read (void); 00045 00046 #if 0 00047 /* Function which simply writes a formatted string out on the USART, blocking */ 00048 void usart_printf (char *fmt, ...); 00049 00050 /* Function which simply reads a formatted string out on the USART, blocking */ 00051 int usart_sscanf (char *source, long size, char *fmt, ...); 00052 #endif 00053 00054 /* This function is called to clear working parameters of RS232 */ 00055 void usart_clear_structure(rs232_struct_delete rs232_del); 00056 00057 #endif
1.5.8