Subversion Repositories shark

Rev

Rev 106 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
106 pj 1
/*****************************************************************************
2
* Filename:    Dio.h                                                         *
3
* Author:      Ziglioli Marco                                                *
4
* Date:        16/03/2001                                                    *
5
* Last update:                                                               *
6
* Description: Header file for routines used to configure and use the digital*
7
*              IO lines of PCI6025E NI board                                 *
8
*----------------------------------------------------------------------------*
9
* Notes:       At this time only the eight digital IO lines are programmed   *
10
*              In the future also the 24 lines of 8255 will be programmed    *
11
*****************************************************************************/
12
 
13
/* This file is part of the S.Ha.R.K. Project - http://shark.sssup.it
14
 *
15
 * Copyright (C) 2001 Marco Ziglioli
16
 *
17
 * This program is free software; you can redistribute it and/or modify
18
 * it under the terms of the GNU General Public License as published by
19
 * the Free Software Foundation; either version 2 of the License, or
20
 * (at your option) any later version.
21
 *
22
 * This program is distributed in the hope that it will be useful,
23
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
24
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
25
 * GNU General Public License for more details.
26
 *
27
 * You should have received a copy of the GNU General Public License
28
 * along with this program; if not, write to the Free Software
29
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
30
 *
31
 */
32
 
33
#ifndef _MY_DIO_H_
34
#define _MY_DIO_H_
35
 
36
#include <drivers/pci6025e/pci6025e.h>
1689 fabio 37
#include <arch/sys/cdefs.h>
106 pj 38
 
39
__BEGIN_DECLS
40
 
41
#define ALL_IN          0x0000      //All 8 STC line in input
42
#define ALL_OUT         0x00FF      //All 8 STC line in output
43
 
44
#define DIO_setup(b)    config(b)   //ALIAS
45
 
46
#ifndef FALSE
47
#define FALSE           0
48
#endif
49
 
50
#ifndef TRUE
51
#define TRUE            1
52
#endif
53
 
54
void  config(BYTE b);
55
 
56
void  DIO_init(void);
57
void  DIO_resetReg(void);
58
void  DIO_config(BYTE);
59
BYTE  DIO_read(void);
60
BYTE  DIO_write(BYTE b);
61
WORD  DIO_setConfig(char *);
62
WORD  DIO_getConfig(void);
63
 
64
void  PPI_init(void);
65
void  PPI_resetReg(void);
66
void  PPI_config(BYTE);
67
BYTE  PPI_read(BYTE);
68
void  PPI_write(BYTE, BYTE);
69
WORD  PPI_setConfig(BYTE, BYTE, BYTE, BYTE, BYTE, BYTE);
70
WORD  PPI_getConfig(BYTE);
71
BYTE  PPI_getAddress(BYTE);
72
 
73
__END_DECLS
74
#endif
75
/*--------------------------------------------------------------------------*/