OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [tags/] [nog_patch_34/] [or1ksim/] [peripheral/] [gpio_i.h] - Blame information for rev 444

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 444 erez
/* gpio_i.h -- Definition of internal types and structures for GPIO code
2
   Copyright (C) 2001 Erez Volk, erez@mailandnews.comopencores.org
3
 
4
   This file is part of OpenRISC 1000 Architectural Simulator.
5
 
6
   This program is free software; you can redistribute it and/or modify
7
   it under the terms of the GNU General Public License as published by
8
   the Free Software Foundation; either version 2 of the License, or
9
   (at your option) any later version.
10
 
11
   This program is distributed in the hope that it will be useful,
12
   but WITHOUT ANY WARRANTY; without even the implied warranty of
13
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
   GNU General Public License for more details.
15
 
16
   You should have received a copy of the GNU General Public License
17
   along with this program; if not, write to the Free Software
18
   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19
*/
20
 
21
#ifndef __OR1KSIM_PERIPHERAL_GPIO_I_H
22
#define __OR1KSIM_PERIPHERAL_GPIO_I_H
23
 
24
#include "gpio.h"
25
#include "config.h"
26
 
27
/*
28
 * The various VAPI IDs each GPIO device has
29
 */
30
enum { GPIO_VAPI_CONFIG = 0, GPIO_VAPI_DATA, GPIO_VAPI_AUX, GPIO_VAPI_CLOCK, GPIO_NUM_VAPI_IDS };
31
 
32
 
33
/*
34
 * Implementatino of GPIO Code Registers and State
35
 */
36
struct gpio_device
37
{
38
  /* Base address in memory */
39
  unsigned long baseaddr;
40
 
41
  /* Which IRQ to generate */
42
  int irq;
43
 
44
  /* Which GPIO is this? */
45
  unsigned gpio_number;
46
 
47
  /* VAPI IDs */
48
  unsigned long vapi_ids[GPIO_NUM_VAPI_IDS];
49
 
50
  /* Auxiliary inputs */
51
  unsigned long auxiliary_inputs;
52
 
53
  /* Visible registers */
54
  struct
55
  {
56
    unsigned long in;
57
    unsigned long out;
58
    unsigned long oe;
59
    unsigned long inte;
60
    unsigned long ptrig;
61
    unsigned long aux;
62
    unsigned long ctrl;
63
 
64
    int external_clock;
65
  } curr, next;
66
};
67
 
68
 
69
 
70
 
71
#endif /* __OR1KSIM_PERIPHERAL_GPIO_I_H */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.