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

Subversion Repositories or1k

[/] [or1k/] [tags/] [stable_0_2_0_rc3/] [or1ksim/] [peripheral/] [gpio_i.h] - Blame information for rev 1778

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 1461 nogj
  /* Is peripheral enabled */
47
  int enabled;
48
 
49 444 erez
  /* Base address in memory */
50 1350 nogj
  oraddr_t baseaddr;
51 444 erez
 
52
  /* Which IRQ to generate */
53
  int irq;
54
 
55
  /* Which GPIO is this? */
56
  unsigned gpio_number;
57
 
58
  /* VAPI IDs */
59 477 erez
  unsigned long base_vapi_id;
60 444 erez
 
61
  /* Auxiliary inputs */
62
  unsigned long auxiliary_inputs;
63
 
64
  /* Visible registers */
65
  struct
66
  {
67
    unsigned long in;
68
    unsigned long out;
69
    unsigned long oe;
70
    unsigned long inte;
71
    unsigned long ptrig;
72
    unsigned long aux;
73
    unsigned long ctrl;
74 502 erez
    unsigned long ints;
75 444 erez
 
76
    int external_clock;
77
  } curr, next;
78
};
79
 
80
 
81
 
82
 
83
#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.