Subversion Repositories shark

Rev

Rev 716 | Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
714 giacomo 1
/*
2
 * Project: S.Ha.R.K.
3
 *
4
 * Coordinators:
5
 *   Giorgio Buttazzo    <giorgio@sssup.it>
6
 *   Paolo Gai           <pj@gandalf.sssup.it>
7
 *
8
 * Authors     :
9
 *   Paolo Gai           <pj@gandalf.sssup.it>
10
 *   (see the web pages for full authors list)
11
 *
12
 * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
13
 *
14
 * http://www.sssup.it
15
 * http://retis.sssup.it
16
 * http://shark.sssup.it
17
 */
18
 
19
/*
20
 * Copyright (C) 2000 Michele Cirinei
21
 *
22
 * This program is free software; you can redistribute it and/or modify
23
 * it under the terms of the GNU General Public License as published by
24
 * the Free Software Foundation; either version 2 of the License, or
25
 * (at your option) any later version.
26
 *
27
 * This program is distributed in the hope that it will be useful,
28
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
29
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
30
 * GNU General Public License for more details.
31
 *
32
 * You should have received a copy of the GNU General Public License
33
 * along with this program; if not, write to the Free Software
34
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
35
 */
36
 
37
/*
38
 CVS :        $Id: scomirq.h,v 1.1 2004-06-01 14:08:28 giacomo Exp $
39
 
40
 scomirq.h:
41
 
42
 Layer for IRQ Serial Communication.
43
 
44
*/
45
#ifndef __SCOMIRQ_H__
46
#define __SCOMIRQ_H__
47
 
48
#include <drivers/scom.h>
49
 
50
#define bit0    (1 << 0)
51
#define bit1    (1 << 1)
52
#define bit2    (1 << 2)
53
#define bit3    (1 << 3)
54
#define bit4    (1 << 4)
55
#define bit5    (1 << 5)
56
#define bit6    (1 << 6)
57
#define bit7    (1 << 7)
58
 
59
#define RBRF_IRQ bit0
60
#define THRE_IRQ bit1
61
#define LSR_IRQ  bit2
62
#define ALL_IRQ  (RBRF_IRQ | THRE_IRQ | LSR_IRQ)
63
 
64
#define COM_OK    0
65
#define COM_ERROR 1
66
 
67
/****************************
68
 Variables
69
****************************/
70
struct SCom_Access_Type{
71
    void (*request)(unsigned port, BYTE len, BYTE *data);
72
    void (*confirm)(unsigned port, BYTE msg_id);
73
    void (*indication)(unsigned port, BYTE data);
74
};
75
 
76
extern struct SCom_Access_Type SCom_Access;
77
 
78
/*****************************
79
* Functions
80
*****************************/
81
void com_end(unsigned port);
82
 
83
void com_irq_enable(unsigned port, unsigned irq);
84
 
85
void com_irq_disable(unsigned port, unsigned irq);
86
 
87
void com_init(unsigned port, DWORD speed, BYTE parity, BYTE len, BYTE stop);
88
 
89
void com_set_functions(void (*confirm)(unsigned port, BYTE msg_status),void (*indication)(unsigned port, BYTE data));
90
 
91
#endif