Changeset 1b7aa5a in multiio


Ignore:
Timestamp:
Aug 12, 2009, 8:40:31 PM (10 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
master
Children:
b1481d8
Parents:
b5c3d20
Message:

2009-08-12 Joel Sherrill <joel.sherrill@…>

  • Makefile, README, main_pcmmio_adc.c, main_pcmmio_dac.c, main_pcmmio_din.c, main_pcmmio_dout.c, mio_io_rtems.c, pcmmio_shell.c: Discrete input polled and interrupt now works.
Location:
pcmmio/original
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • pcmmio/original/ChangeLog

    rb5c3d20 r1b7aa5a  
     12009-08-12      Joel Sherrill <joel.sherrill@oarcorp.com>
     2
     3        * Makefile, README, main_pcmmio_adc.c, main_pcmmio_dac.c,
     4        main_pcmmio_din.c, main_pcmmio_dout.c, mio_io_rtems.c,
     5        pcmmio_shell.c: Discrete input polled and interrupt now works.
     6
    172009-07-23      Joel Sherrill <joel.sherrill@oarcorp.com>
    28
  • pcmmio/original/Makefile

    rb5c3d20 r1b7aa5a  
    1515# optional managers required
    1616MANAGERS=all
    17 DEFINES += -DTESTING
     17#DEFINES += -DTESTING
    1818
    1919# C source names
  • pcmmio/original/README

    rb5c3d20 r1b7aa5a  
    4444           the period is in milliseconds and defaults to 1000
    4545
    46 pcmmio_adc - Write Analog Output
     46pcmmio_dac - Write Analog Output
    4747    pcmmio_dac dac voltage
    4848    pcmmio_dac dac low high step time_per_step maximum_time
  • pcmmio/original/main_pcmmio_adc.c

    rb5c3d20 r1b7aa5a  
    1313
    1414#include "pcmmio_commands.h"
     15#include "mio_io.h"
    1516#include <rtems/stringto.h>
    1617
  • pcmmio/original/main_pcmmio_dac.c

    rb5c3d20 r1b7aa5a  
    1313
    1414#include "pcmmio_commands.h"
    15 #include <rtems/string2.h>
     15#include "mio_io.h"
     16#include <rtems/stringto.h>
    1617
    1718#include <stdlib.h>
  • pcmmio/original/main_pcmmio_din.c

    rb5c3d20 r1b7aa5a  
    1313
    1414#include "pcmmio_commands.h"
     15#include "mio_io.h"
    1516#include <rtems/stringto.h>
    1617
  • pcmmio/original/main_pcmmio_dout.c

    rb5c3d20 r1b7aa5a  
    1313
    1414#include "pcmmio_commands.h"
     15#include "mio_io.h"
    1516#include <rtems/stringto.h>
    1617
  • pcmmio/original/mio_io_rtems.c

    rb5c3d20 r1b7aa5a  
    1919#include <rtems.h>
    2020#include <i386_io.h>
     21#include <bsp/irq.h>
    2122
    2223/*
     
    493494static void pcmmio_irq_disable(const rtems_irq_connect_data *irq)
    494495{
    495   BSP_irq_disable_at_i8259s(irq->name - BSP_IRQ_VECTOR_BASE);
     496  BSP_irq_disable_at_i8259s(irq->name);
    496497}
    497498static void pcmmio_irq_enable(const rtems_irq_connect_data *irq)
    498499{
    499   BSP_irq_enable_at_i8259s(irq->name - BSP_IRQ_VECTOR_BASE);
     500  BSP_irq_enable_at_i8259s(irq->name);
    500501}
    501502
     
    514515};
    515516
     517/* from pcmmio.c - GNU/Linux driver */
     518void init_io(unsigned short io_address)
     519{
     520  int x;
     521  unsigned short port;
     522
     523  /* save the address for later use */
     524  port = io_address + 0X10;
     525
     526  /* Clear all of the I/O ports. This also makes them inputs */
     527  for(x=0; x < 7; x++)
     528    outb(0,port+x);
     529
     530  /* Set page 2 access, for interrupt enables */
     531  outb(0x80,port+7);
     532
     533  /* Clear all interrupt enables */
     534  outb(0,port+8);
     535  outb(0,port+9);
     536  outb(0,port+0x0a);
     537
     538  /* Restore page 0 register access */
     539  outb(0,port+7);
     540}
     541
    516542/*
    517543 * RTEMS specific initialization routine
     
    532558  pcmmio_barrier_create( rtems_build_name( 'd', 'i', 'o', ' ' ), &wq_dio );
    533559
     560  if ( base_port )
     561    init_io( base_port );
     562
    534563  /* install IRQ handler */
    535   if ( irq ) {
     564  if ( base_port && irq ) {
    536565    int status = 0;
    537566    pcmmio_irq.name = irq;
     
    544573    #endif
    545574    if ( !status ) {
    546       printk("Error installing PCMMIO interrupt handler!\n" );
     575      printk("Error installing PCMMIO interrupt handler! status=%d\n", status );
    547576    }
    548577  }
     
    636665        inptr = 0;
    637666
    638         /* Clear the interrupt */
    639         clr_int(int_num);
     667      /* Clear the interrupt */
     668      clr_int(int_num);
    640669    }
    641670
  • pcmmio/original/pcmmio_shell.c

    rb5c3d20 r1b7aa5a  
    1616)
    1717{
     18  /*
     19   *  Initialize the PCMMIO module to use IRQ6.  Ours is jumpered for 0x300
     20   *  base address.  We use discrete input interrupts so enable all of the
     21   *  as edge triggered on 1.
     22   */
    1823  pcmmio_initialize(0x300, 6);
     24  enable_dio_interrupt();
     25  { int i;
     26    for (i=1 ; i<=48 ; i++ )
     27      dio_enab_bit_int(i, 1);
     28  }
    1929
     30  /*
     31   *  Display a herald with some hints on usage
     32   */
    2033  printf(
    2134    "\n"
Note: See TracChangeset for help on using the changeset viewer.