From: Erik M. <er...@us...> - 2002-01-02 01:19:01
|
Update of /cvsroot/blob/blob/include/blob In directory usw-pr-cvs1:/tmp/cvs-serv8566/include/blob Modified Files: serial.h Log Message: Happy new year! This is the start of a new serial driver that should make porting blob to non-StrongARM architectures easier. The SA11x0 driver is implemented, but completely untested at the moment. It's trivial to do the rest of the serial code, but I'd better go to bed, or otherwise Jan-Derk will complain that I'm working too late ;) Part two follows tomorrow. Index: serial.h =================================================================== RCS file: /cvsroot/blob/blob/include/blob/serial.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- serial.h 2001/10/07 15:27:35 1.2 +++ serial.h 2002/01/02 01:18:57 1.3 @@ -11,7 +11,7 @@ /* * serial.h: Serial utilities for blob * - * Copyright (C) 1999 Erik Mouw (J.A...@it...) + * Copyright (C) 1999 2002 Erik Mouw (J.A...@it...) * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -37,6 +37,50 @@ #include <blob/types.h> + +typedef enum { + baud_1200, + baud_2400, + baud_4800, + baud_9600, + baud_19200, + baud_38400, + baud_57600, + baud_115200, + baud_230400 +} serial_baud_t; + + +typedef int (*serial_init_func_t)(serial_baud_t); +typedef int (*serial_read_func_t)(void); +typedef int (*serial_write_func_t)(int); +typedef int (*serial_poll_func_t)(void); +typedef int (*serial_flush_in_func_t)(void); +typedef int (*serial_flush_out_func_t)(void); + + +typedef struct { + serial_init_func_t init; + + serial_read_func_t read; + serial_write_func_t write; + + serial_poll_func_t poll; + + serial_flush_in_func_t flush_in; + serial_flush_out_func_t flush_out; +} serial_driver_t; + + +/* implemented serial drivers */ +extern serial_driver_t sa11x0_serial_driver; + + +/* should be filled out by the architecture dependent files */ +extern serial_driver_t *serial_driver; + + +/* ---- OLD STUFF BELOW ----------------------------------- */ typedef enum { /* Some useful SA-1100 baud rates */ baud1k2 = 191, |