Changeset 1cbabbe in multiio


Ignore:
Timestamp:
Jun 17, 2009, 8:34:51 PM (10 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
master
Children:
6d769b4
Parents:
758418e
Message:

2009-06-17 Joel Sherrill <joel.sherrill@…>

  • buffered.c, dacbuff.c, dacout.c, flash.c, getall.c, getvolt.c, kbhit.c, mio_io.c, mio_io_linux.c, mio_io_rtems.c, pcmmio.c, poll.c, repeat.c, rtems_config.c: Clean up. Worked on RTEMS IRQ support code.
Location:
pcmmio/original
Files:
15 edited

Legend:

Unmodified
Added
Removed
  • pcmmio/original/ChangeLog

    r758418e r1cbabbe  
     12009-06-17      Joel Sherrill <joel.sherrill@oarcorp.com>
     2
     3        * buffered.c, dacbuff.c, dacout.c, flash.c, getall.c, getvolt.c,
     4        kbhit.c, mio_io.c, mio_io_linux.c, mio_io_rtems.c, pcmmio.c, poll.c,
     5        repeat.c, rtems_config.c: Clean up. Worked on RTEMS IRQ support code.
     6
    172009-06-10      Joel Sherrill <joel.sherrill@oarcorp.com>
    28
  • pcmmio/original/buffered.c

    r758418e r1cbabbe  
    33/*
    44*
    5 * $Header$
    6 *
    75* $Id$
    86*
    9 * $Log$
     7* Compile for GNU/Linux with:
    108*
    11 *       Compile with :
    12 *
    13 *               gcc buffered.c kbhit.c mio_io.o -o buffered -lpthread
     9*   gcc buffered.c kbhit.c mio_io.o -o buffered -lpthread
    1410*
    1511*
    16 *       This program demonstrates the adc_buffered_channel_conversions function
    17 *       which allows for a programmed sequence of conversions to be accomplished
    18 *       with a single call.
    19 *
     12*  This program demonstrates the adc_buffered_channel_conversions function
     13*  which allows for a programmed sequence of conversions to be accomplished
     14*  with a single call.
    2015*/
    21 
    2216
    2317/* Our IOCTL definitions and all function prototypes */
  • pcmmio/original/dacbuff.c

    r758418e r1cbabbe  
    33/*
    44*
    5 * $Header$
    6 *
    75* $Id$
    86*
    9 * $Log$
    107*
    11 *       Compile with :
     8* Compile for GNU/Linux with:
    129*
    13 *               gcc dacbuff.c kbhit.c mio_io.o -o dacbuff
     10*     gcc dacbuff.c kbhit.c mio_io.o -o dacbuff
    1411*
    1512*
    16 *       This program demonstrates the adc_buffered_channel_conversions function
    17 *       which allows for a programmed sequence of conversions to be accomplished
    18 *       with a single call.
    19 *
     13* This program demonstrates the adc_buffered_channel_conversions function
     14* which allows for a programmed sequence of conversions to be accomplished
     15* with a single call.
    2016*/
    21 
    2217
    2318#include "mio_io.h"   
  • pcmmio/original/dacout.c

    r758418e r1cbabbe  
    11/* dacout.c WinSystems PCM-MIO driver Demonstration Program
    2 *
    3 *  $Header$
    42*
    53*  $Id$
    64*
    7 *  $Log$
     5* Compile for GNU/Linux with:
     6*
     7*   gcc dacout.c mio_io.o -o dacout
    88*
    99*
    10 *  Compile with :
    11 *
    12 *
    13 *       gcc dacout.c mio_io.o -o dacout
    14 *
    15 *
    16 *       This extremely simple program uses the set_dac_voltage function to update
    17 *   the dac output to a specific voltage.
     10* This extremely simple program uses the set_dac_voltage function to update
     11*  the dac output to a specific voltage.
    1812*/
    1913
  • pcmmio/original/flash.c

    r758418e r1cbabbe  
    11/* Flash.c WinSystems PCM-MIO driver Demonstration Program
    2 *
    3 *  $Header$
    42*
    53*  $Id$
    64*
    7 *  $Log$
    8 *  Revision 1.1.1.1  2009/06/08 14:52:43  joel
    9 *  Initial import.
     5*  Compile for GNU/Linux with:
    106*
     7*    gcc flash.c kbhit.c mio_io.o -o flash
    118*
    12 *
    13 *  Compile with :
    14 *
    15 *
    16 *       gcc flash.c kbhit.c mio_io.o -o flash
    17 *
    18 *   This very simple program, toggles each of the 48  DIO lines in succession, holding it low
    19 *   for 250ms and then releasing it.
     9*  This very simple program, toggles each of the 48  DIO lines in succession,
     10*  holding it low for 250ms and then releasing it.
    2011*
    2112*/
  • pcmmio/original/getall.c

    r758418e r1cbabbe  
    1 /* getall.c Demonstration program for use with the WinSystems PCM-MIO Linux driver
    2 *
    3 *       $Header$
    4 *
    5 *       $Id$
    6 *
    7 *       $Log$
    8 *
    9 *       Compile with :
    10 *
    11 *                       gcc -static getall.c mio_io.o -o getall
    12 */
     1/*
     2 * Demonstration program for use with the WinSystems PCM-MIO driver
     3 *
     4 *      $Id$
     5 *
     6 * Compile for GNU/Linux with:
     7 *
     8 *    gcc -static getall.c mio_io.o -o getall
     9 */
    1310
    1411#include <stdio.h>
     
    1613#include "mio_io.h"
    1714
    18 /* This program demonstrates usage of the adc_convert_all_channels function call.
    19    This allows for all 16 channels to be quickly converted and the results passed
    20    back in an 16 element array. Note that this function does not return voltage values,
    21    it returns raw 16-bit data directly from the converter.
    22 */
     15/* This program demonstrates usage of the adc_convert_all_channels
     16 * function call.  This allows for all 16 channels to be quickly converted
     17 * and the results passed back in an 16 element array. Note that this
     18 * function does not return voltage values, it returns raw 16-bit data
     19 * directly from the converter.
     20 */
    2321
    2422
  • pcmmio/original/getvolt.c

    r758418e r1cbabbe  
    11/* getvolt.c WinSystems PCM-MIO driver Demonstration Program
    2 *
    3 *  $Header$
    4 *
    5 *  $Id$
    6 *
    7 *  $Log$
    8 *
    9 *
    10 *  Compile with :
    11 *
    12 *
    13 *       gcc getvolt.c mio_io.o -o getvolt
    14 *
    15 *
    16 *       This program demonstrates the adc_auto_get_channel_voltage
    17 *       function. It reads the voltage on the channel specified
    18 *       prints the value and then exits.
    19 *
    20 */
     2 *
     3 *  $Id$
     4 *
     5 * Compile for GNU/Linux with:
     6 *
     7 *
     8 *   gcc getvolt.c mio_io.o -o getvolt
     9 *
     10 *
     11 * This program demonstrates the adc_auto_get_channel_voltage
     12 * function. It reads the voltage on the channel specified
     13 * prints the value and then exits.
     14 */
    2115
    2216#include <stdio.h>
  • pcmmio/original/kbhit.c

    r758418e r1cbabbe  
    1 /* $Header$
    2 *
    3 *
    4 *   Filename : $RCSfile$
    5 *
    6 *   $Id$
    7 *
    8 *   $Log$
    9 *   Revision 1.1.1.1  2009/06/08 14:52:43  joel
    10 *   Initial import.
    11 *
    12 *   Revision 1.1  2005/04/19 20:39:11  steve
    13 *   Initial revision
    14 *
    15 *
    16 *
    17 */
     1/*
     2 * $Id$
     3 */
    184
    195
    206/* These functions are from the Wrox Press Book "Beginning Linux
    21    Programming - Second Edition" by Richard Stones and Neil Matthew.
    22    (C) 1996 & 1999 and are included here in compliance with the GNU
    23    Public license.
    24 
    25 */
     7 * Programming - Second Edition" by Richard Stones and Neil Matthew.
     8 * (C) 1996 & 1999 and are included here in compliance with the GNU
     9 * Public license.
     10 */
    2611
    2712#include <stdio.h>
    2813#include <termios.h>
    2914#if defined(__linux__)
    30 #include <term.h>
    31 #include <curses.h>
     15  #include <term.h>
     16  #include <curses.h>
    3217#endif
    3318#include <unistd.h>
  • pcmmio/original/mio_io.c

    r758418e r1cbabbe  
    1 /* mio_io.c WinSystems support module file for the  PCM-MIO Linux driver */
    2 /*
    3 *  $Header$
    4 *
    5 *  $Id$
    6 *
    7 *  $Log$
    8 *  Revision 1.2  2009/06/08 18:21:56  joel
    9 *  2009-06-08   Joel Sherrill <joel.sherrill@oarcorp.com>
    10 *
    11 *       * Makefile, kbhit.c, mio_io.c, mio_io.h: First successful compilation
    12 *       under RTEMS. Added some Linux ifdef's.
    13 *       * rtems_config.c: New file.
    14 *
    15 *  Revision 1.1.1.1  2009/06/08 14:52:43  joel
    16 *  Initial import.
    17 *
    18 *
    19 *  This file implements all of the supported 'C' language functions. Where necessary
    20 *  call are made into a porting layer to access the actual hardware.
    21 */
     1/* mio_io.c
     2 * WinSystems support module file for the  PCM-MIO Linux driver
     3 *
     4 *  $Id$
     5 *
     6 *
     7 *  This file implements all of the supported 'C' language functions.
     8 *  Where necessary calls are made into a porting layer to access the
     9 *  actual hardware.
     10 */
    2211
    2312#define LIB_DEFINED
  • pcmmio/original/mio_io_linux.c

    r758418e r1cbabbe  
    1 /* mio_io.c WinSystems support module file for the  PCM-MIO Linux driver */
    2 /*
    3 *  $Header$
    4 *
    5 *  $Id$
    6 *
    7 *  $Log$
    8 *  Revision 1.2  2009/06/08 18:21:56  joel
    9 *  2009-06-08   Joel Sherrill <joel.sherrill@oarcorp.com>
    10 *
    11 *       * Makefile, kbhit.c, mio_io.c, mio_io.h: First successful compilation
    12 *       under RTEMS. Added some Linux ifdef's.
    13 *       * rtems_config.c: New file.
    14 *
    15 *  Revision 1.1.1.1  2009/06/08 14:52:43  joel
    16 *  Initial import.
    17 *
    18 *
    19 *  This file implements all of the supported 'C' language functions. Where necessary
    20 *  ioctl call are made into the kernel driver to access the actual hardware.
    21 */
     1/* mio_io.c
     2 * WinSystems support module file for the  PCM-MIO Linux driver
     3 *
     4 *
     5 *  $Id$
     6 *
     7 *
     8 *  This file implements all of the supported 'C' language functions.
     9 *  Where necessary ioctl calls are made into the kernel driver to access
     10 *  the actual hardware.
     11 */
    2212
    2313/* #define DEBUG 1 */
  • pcmmio/original/mio_io_rtems.c

    r758418e r1cbabbe  
    1 /* mio_io.c WinSystems support module file for the  PCM-MIO RTEMS driver */
    2 /*
     1/* mio_io.c WinSystems support module file for the  PCM-MIO RTEMS driver
     2 *
    33 *  $Id$
    44 *
     
    460460void common_handler(void);
    461461
    462 void pcmmio_interrupt_handler(
     462void pcmmio_irq_handler(
    463463  rtems_irq_hdl_param param
    464464)
    465465{
     466  common_handler();
     467}
     468
     469static void pcmmio_irq_disable(const rtems_irq_connect_data *irq)
     470{
     471  BSP_irq_disable_at_i8259s(irq->name - BSP_IRQ_VECTOR_BASE);
     472}
     473static void pcmmio_irq_enable(const rtems_irq_connect_data *irq)
     474{
     475  BSP_irq_enable_at_i8259s(irq->name - BSP_IRQ_VECTOR_BASE);
     476}
     477
     478static int pcmmio_irq_is_on(const rtems_irq_connect_data *irq)
     479{
     480  return BSP_irq_enabled_at_i8259s( irq->name );
    466481}
    467482
    468483rtems_irq_connect_data pcmmio_irq = {
    469484  0,                            // name
    470   pcmmio_interrupt_handler,     // handler
     485  pcmmio_irq_handler,           // handler
    471486  NULL,                         // parameter
    472   NULL,                         // enable IRQ
    473   NULL,                         // disable IRQ
    474   NULL,                         // is IRQ enabled
     487  pcmmio_irq_enable,            // enable IRQ
     488  pcmmio_irq_disable,           // disable IRQ
     489  pcmmio_irq_is_on,             // is IRQ enabled
    475490};
    476491
     
    495510  /* install IRQ handler */
    496511  if ( irq ) {
     512    int status = 0;
    497513    pcmmio_irq.name = irq;
    498514    #if defined(BSP_SHARED_HANDLER_SUPPORT)
     
    502518      BSP_install_rtems_irq_handler( &pcmmio_irq );
    503519    #endif
     520    if ( !status ) {
     521      printk("Error installing PCMMIO interrupt handler!\n" );
     522      rtems_fatal_error_occurred( status );
     523    }
    504524  }
    505525}
     
    525545
    526546static DIO_Int_t int_buffer[MAX_INTS];
    527 static int inptr = 0;
    528 static int outptr = 0;
     547static int       inptr = 0;
     548static int       outptr = 0;
    529549
    530550/* real copy is in mio_io.c */
     
    579599      #endif
    580600
    581       /* Buffer the interrupt */
     601      /*
     602       * Buffer the interrupt
     603       *
     604       * NOTE: No need to worry about disabling interrupts,
     605       *       we are in interrupts.
     606       */
    582607
    583608      int_buffer[inptr].timestamp = rdtsc();
     
    719744)
    720745{
    721   int                line;
     746  rtems_interrupt_level level;
     747  int                   line;
    722748
    723749  if (irq == 0) {
     
    728754  }
    729755
    730   if (outptr != inptr) {
    731     if ( timestamp )
    732       *timestamp = int_buffer[outptr].timestamp;
    733     line = int_buffer[outptr].line;
    734     outptr++;
    735     if (outptr == MAX_INTS)
    736       outptr = 0;
    737     return line;
    738   }
    739 
    740   return 0;
    741 }
     756  line = 0;
     757
     758  rtems_interrupt_disable( level );
     759    if (outptr != inptr) {
     760      if ( timestamp )
     761        *timestamp = int_buffer[outptr].timestamp;
     762      line = int_buffer[outptr].line;
     763      outptr++;
     764      if (outptr == MAX_INTS)
     765        outptr = 0;
     766    }
     767  rtems_interrupt_enable( level );
     768 
     769  return line;
     770}
  • pcmmio/original/pcmmio.c

    r758418e r1cbabbe  
    1 /* PCMMIO.C    WinSystems PCM-MIO Linux Driver */
    2 
    3 /*
    4  * $Header$
     1/*
     2 * WinSystems PCM-MIO Linux Device Driver
     3 *
    54 * $Id$
    6  *
    7  * Filename : $RCSfile$
    8  *
    9  * $Log$
    10  *
    11  *
    12  * WinSystems PCM-MIO Linux Device Driver
    135 */
    146
     
    10251017}
    10261018
    1027        
  • pcmmio/original/poll.c

    r758418e r1cbabbe  
    1 /* Poll.c Demonstration program for WinSystems PCM-MIO Driver */
    2 
    3 /*
    4 *
    5 * $Header$
    6 *
    7 * $Id$
    8 *
    9 * $Log$
    10 *
    11 */
    12 
    13 /* This program demonstrates one manner in which an unprivledged
    14    application running in user space can sychronize to hardware events
    15    handled by a device driver running in Kernel space.
    16 */
    17 
     1/* poll.c
     2 * Demonstration program for WinSystems PCM-MIO Driver
     3 *
     4 * $Id$
     5 */
     6
     7/* This program demonstrates one manner in which an unprivileged
     8 * application running in user space can synchronize to hardware events
     9 * handled by a device driver running in Kernel space.
     10 */
    1811
    1912#include "mio_io.h"   
     
    2720
    2821
    29 /* This function will be a sub-processe using the Posix threads
     22/* This function will be a sub-processes using the Posix threads
    3023   capability of Linux. This thread will simulate a type of
    3124   Interrupt service routine in that it will start up and then suspend
  • pcmmio/original/repeat.c

    r758418e r1cbabbe  
    1 /* repeat.c Demonstration program for WinSystems PCM-MIO Driver */
    2 
    3 /*
    4 *
    5 * $Header$
    6 *
    7 * $Id$
    8 *
    9 * $Log$
    10 *
    11 *       Compile with :
    12 *
    13 *               gcc repeat.c kbhit.c mio_io.o -o repeat
    14 *
    15 *
    16 *       This program demonstrates the adc_convert_single_repeated function
    17 *       which allows for a sequence of conversions to be accomplished
    18 *       with a single call on the same channel.
    19 *
    20 */
     1/* repeat.c
     2 * Demonstration program for WinSystems PCM-MIO Driver
     3 *
     4 * $Id$
     5 *
     6 * Compile for GNU/Linux with:
     7 *
     8 *    gcc repeat.c kbhit.c mio_io.o -o repeat
     9 *
     10 * This program demonstrates the adc_convert_single_repeated function
     11 * which allows for a sequence of conversions to be accomplished
     12 * with a single call on the same channel.
     13 */
    2114
    2215#include "mio_io.h"   
  • pcmmio/original/rtems_config.c

    r758418e r1cbabbe  
    11/*
     2 *  RTEMS Configuration and Initialization for PCMMIO Demonstration Programs   
     3 *
    24 *  $Id$
    35 */
     
    1416)
    1517{
    16    
    1718  pcmmio_initialize(0, 0);
    1819  main(0,NULL);
Note: See TracChangeset for help on using the changeset viewer.