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

Subversion Repositories or1k

[/] [or1k/] [branches/] [stable_0_2_x/] [or1ksim/] [peripheral/] [gpio.c] - Diff between revs 1489 and 1564

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 1489 Rev 1564
Line 42... Line 42...
static uint32_t gpio_read32( oraddr_t addr, 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_write32( oraddr_t addr, uint32_t value, void *dat );
 
 
static void gpio_external_clock( unsigned long value, struct gpio_device *gpio );
static void gpio_external_clock( unsigned long value, struct gpio_device *gpio );
static void gpio_device_clock( struct gpio_device *gpio );
static void gpio_device_clock( struct gpio_device *gpio );
 
static void gpio_clock( void *dat );
 
 
/* Initialize all parameters and state */
/* Initialize all parameters and state */
void gpio_reset( void *dat )
void gpio_reset( void *dat )
{
{
  struct gpio_device *gpio = dat;
  struct gpio_device *gpio = dat;
Line 54... Line 55...
    /* Possibly connect to VAPI */
    /* Possibly connect to VAPI */
    if ( gpio->base_vapi_id ) {
    if ( gpio->base_vapi_id ) {
      vapi_install_multi_handler( gpio->base_vapi_id, GPIO_NUM_VAPI_IDS, gpio_vapi_read, dat );
      vapi_install_multi_handler( gpio->base_vapi_id, GPIO_NUM_VAPI_IDS, gpio_vapi_read, dat );
    }
    }
  }
  }
 
  SCHED_ADD(gpio_clock, dat, 1);
}
}
 
 
 
 
/* Dump status */
/* Dump status */
void gpio_status( void *dat )
void gpio_status( void *dat )
Line 153... Line 155...
    break;
    break;
  case GPIO_VAPI_CLOCK:
  case GPIO_VAPI_CLOCK:
    gpio_external_clock( data, gpio );
    gpio_external_clock( data, gpio );
    break;
    break;
  }
  }
 
}
 
 
 
/* System Clock. */
 
static void gpio_clock( void *dat )
 
{
 
  struct gpio_device *gpio = dat;
 
 
  /* Clock the device */
  /* Clock the device */
  if ( !(gpio->curr.ctrl & RGPIO_CTRL_ECLK) )
  if ( !(gpio->curr.ctrl & RGPIO_CTRL_ECLK) )
    gpio_device_clock( gpio );
    gpio_device_clock( gpio );
 
  SCHED_ADD(gpio_clock, dat, 1);
}
}
 
 
/* External Clock. */
/* External Clock. */
static void gpio_external_clock( unsigned long value, struct gpio_device *gpio )
static void gpio_external_clock( unsigned long value, struct gpio_device *gpio )
{
{

powered by: WebSVN 2.1.0

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