ser.h

00001 /* SER.H
00002  * Header file for serial drivers for EMAC uP-HC12*/
00003 /*********************************************************************/
00004 /*                          SERIAL                                   */
00005 /*********************************************************************/
00006 
00016 
00017 #ifndef _SER_H_
00018 #define _SER_H_
00019 
00020 #include <GNU_defs.h>
00021 
00022 #ifndef SERIALCODE
00023 #define SERIALCODE
00024 #endif
00025 
00029 #define COM0PROTOCOL    RS232   
00030 #define COM1PROTOCOL    RS232
00031 
00032 
00033 #define ECHO 1 //echo flag used for ser_getline
00034 #define NO_ECHO 0
00035 
00036 #define _USE_INTERRUPTS_
00037 
00038 /* Mode flags */    
00039 #define EIGHT_BIT   0x00/* com0 */      
00040 #define NINE_BIT    0x10
00041 #define EVEN_PARITY 0x02
00042 #define ODD_PARITY  0x03
00043 #define NO_PARITY   0
00044 
00045 typedef void __attribute__((far))(*SCICallback)(int,void *);
00046 
00047 
00060 int __attribute__((far))Serial_Initialize(int channel, char mode, long baud);
00061 
00072 char __attribute__((far)) Ser_Send_Byte(char channel, char sendta);/* does not block */
00073 
00084 char __attribute__((far)) Ser_Send_String(char channel, char *sendta);
00085 
00098 ssize_t __attribute__((far))SCIrx(int port,int count, u8 *buffer);
00099 
00100 
00109 char __attribute__((far))ser_getch(int port);
00110 
00123 int __attribute__((far))ser_getline(int port,char *buffer, int max,int echo);
00124 
00132 int __attribute__((far))SCItx_En(int port);
00133 
00141 int __attribute__((far))SCItx_Dis(int port);
00142 
00143 int __attribute__((far)) Serial_Init(char channel, char mode, long baud, 
00144     char snd_en, char rcv_en, char snd_int, char rcv_int);
00145 ssize_t __attribute__((far)) SCItx(int port,int count, char *buffer);
00146 void __attribute__((far))SCIdisable(int port);
00147 void __attribute__((far))SCIenable(int port);
00148 int __attribute__((far)) SCI_IdleTick(int port);
00149 
00154 #endif
00155 
00156 

Generated on Fri Mar 3 17:25:45 2006 for EMAC-HCS12-SDK by  doxygen 1.4.6