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

Subversion Repositories or1k

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /
    from Rev 1723 to Rev 1724
    Reverse comparison

Rev 1723 → Rev 1724

/trunk/or1ksim/peripheral/gpio.c
29,7 → 29,6
#include "arch.h"
#include "abstract.h"
#include "gpio.h"
#include "gpio_i.h"
#include "sim-config.h"
#include "pic.h"
#include "vapi.h"
38,10 → 37,60
 
DEFAULT_DEBUG_CHANNEL(gpio);
 
 
/*
* The various VAPI IDs each GPIO device has
*/
enum { GPIO_VAPI_DATA = 0,
GPIO_VAPI_AUX,
GPIO_VAPI_CLOCK,
GPIO_VAPI_RGPIO_OE,
GPIO_VAPI_RGPIO_INTE,
GPIO_VAPI_RGPIO_PTRIG,
GPIO_VAPI_RGPIO_AUX,
GPIO_VAPI_RGPIO_CTRL,
GPIO_NUM_VAPI_IDS };
 
/*
* Implementatino of GPIO Code Registers and State
*/
struct gpio_device
{
/* Is peripheral enabled */
int enabled;
 
/* Base address in memory */
oraddr_t baseaddr;
 
/* Which IRQ to generate */
int irq;
 
/* Which GPIO is this? */
unsigned gpio_number;
 
/* VAPI IDs */
unsigned long base_vapi_id;
 
/* Auxiliary inputs */
unsigned long auxiliary_inputs;
 
/* Visible registers */
struct
{
unsigned long in;
unsigned long out;
unsigned long oe;
unsigned long inte;
unsigned long ptrig;
unsigned long aux;
unsigned long ctrl;
unsigned long ints;
 
int external_clock;
} curr, next;
};
 
static void gpio_vapi_read( unsigned long id, unsigned long data, void *dat );
static uint32_t gpio_read32( oraddr_t addr, void *dat );
static void gpio_write32( oraddr_t addr, uint32_t value, void *dat );
 
static void gpio_external_clock( unsigned long value, struct gpio_device *gpio );
static void gpio_device_clock( struct gpio_device *gpio );
static void gpio_clock( void *dat );

powered by: WebSVN 2.1.0

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