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

Subversion Repositories or1k

[/] [or1k/] [branches/] [stable_0_2_x/] [or1ksim/] [peripheral/] [gpio_i.h] - Blame information for rev 1350

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 483 erez
enum { GPIO_VAPI_DATA = 0,
31
       GPIO_VAPI_AUX,
32
       GPIO_VAPI_CLOCK,
33
       GPIO_VAPI_RGPIO_OE,
34
       GPIO_VAPI_RGPIO_INTE,
35
       GPIO_VAPI_RGPIO_PTRIG,
36
       GPIO_VAPI_RGPIO_AUX,
37
       GPIO_VAPI_RGPIO_CTRL,
38 477 erez
       GPIO_NUM_VAPI_IDS };
39 444 erez
 
40
 
41
/*
42
 * Implementatino of GPIO Code Registers and State
43
 */
44
struct gpio_device
45
{
46
  /* Base address in memory */
47 1350 nogj
  oraddr_t baseaddr;
48 444 erez
 
49
  /* Which IRQ to generate */
50
  int irq;
51
 
52
  /* Which GPIO is this? */
53
  unsigned gpio_number;
54
 
55
  /* VAPI IDs */
56 477 erez
  unsigned long base_vapi_id;
57 444 erez
 
58
  /* Auxiliary inputs */
59
  unsigned long auxiliary_inputs;
60
 
61
  /* Visible registers */
62
  struct
63
  {
64
    unsigned long in;
65
    unsigned long out;
66
    unsigned long oe;
67
    unsigned long inte;
68
    unsigned long ptrig;
69
    unsigned long aux;
70
    unsigned long ctrl;
71 502 erez
    unsigned long ints;
72 444 erez
 
73
    int external_clock;
74
  } curr, next;
75
};
76
 
77
 
78
 
79
 
80
#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.