Changeset d810c06 in multiio


Ignore:
Timestamp:
Mar 18, 2011, 1:19:31 PM (9 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
master
Children:
e38d987
Parents:
1662ede
Message:

2011-03-18 Joel Sherrill <joel.sherrill@…>

  • Makefile, mio_io.h, mio_io_rtems.c, pcmmio_shell.c, rtems_config.c: Initial implementation.
  • .cvsignore, multiio_pcmmio.c: New files.
Location:
pcmmio
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • pcmmio/ChangeLog

    r1662ede rd810c06  
     12011-03-18      Joel Sherrill <joel.sherrill@oarcorp.com>
     2
     3        * Makefile, mio_io.h, mio_io_rtems.c, pcmmio_shell.c, rtems_config.c:
     4        Initial implementation.
     5        * .cvsignore, multiio_pcmmio.c: New files.
     6
    172009-12-14      Joel Sherrill <joel.sherrill@oarcorp.com>
    28
  • pcmmio/mio_io.h

    r1662ede rd810c06  
    142142
    143143#endif
     144
     145#include <sys/types.h>
    144146
    145147/* part of the porting layer */
     
    186188int dio_get_int(void);
    187189int dio_get_int_with_timestamp(
    188   unsigned long long *timestamp
     190  struct timespec *timestamp
    189191);
    190192int wait_adc_int(int adc_num);
     
    193195
    194196#if defined(__rtems__)
     197
    195198  void pcmmio_initialize(
    196199    unsigned short _base_port,
     
    203206  int wait_dio_int_with_timeout(int milliseconds);
    204207  int wait_dio_int_with_timestamp(
    205     int                 milliseconds,
    206     unsigned long long *timestamp
     208    int              milliseconds,
     209    struct timespec *timestamp
    207210  );
    208211  int dio_get_missed_interrupts(void);
  • pcmmio/mio_io_rtems.c

    r1662ede rd810c06  
    3232/* Function prototypes for local functions */
    3333static int get_buffered_int(
    34   unsigned long long *timestamp
     34  struct timespec *timestamp
    3535);
    3636static void init_io(unsigned short io_address);
     
    5353///////////////////////////////////////////////////////////////////////////////
    5454typedef struct {
    55   unsigned long long timestamp;
    56   int                pin;
     55  struct timespec timestamp;
     56  int             pin;
    5757} din_message_t;
    5858
     
    340340
    341341int dio_get_int_with_timestamp(
    342   unsigned long long *timestamp
     342  struct timespec *timestamp
    343343)
    344344{
     
    405405
    406406int wait_dio_int_with_timestamp(
    407   int                 milliseconds,
    408   unsigned long long *timestamp
     407  int              milliseconds,
     408  struct timespec *timestamp
    409409)
    410410{
     
    651651}
    652652
    653 #include <libcpu/cpuModel.h> /* for rdtsc */
    654 
    655653/*
    656654 *  From this point down, we should be able to share easily with the Linux
     
    709707      din_message_t      din;
    710708
    711       din.timestamp = rdtsc();
    712       din.pin       = int_num;
     709      rtems_clock_get_uptime( &din.timestamp );
     710      din.pin = int_num;
    713711
    714712      rc = rtems_message_queue_send( wq_dio, &din, sizeof(din_message_t) );
     
    861859
    862860int get_buffered_int(
    863   unsigned long long *timestamp
     861  struct timespec *timestamp
    864862)
    865863{
  • pcmmio/pcmmio_shell.c

    r1662ede rd810c06  
    11/*
    2  *  COPYRIGHT (c) 1989-2009.
     2 *  COPYRIGHT (c) 1989-2011.
    33 *  On-Line Applications Research Corporation (OAR).
    44 *
     
    1010 */
    1111
    12 #include "pcmmio_commands.h"
     12#include <rtems.h>
     13#include <multiio_commands.h>
     14#include <multiio.h>
    1315
    1416rtems_task Init(
     
    1719{
    1820  /*
    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    */
    23   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   }
    29 
    30   /*
    3121   *  Display a herald with some hints on usage
    3222   */
     
    3424    "\n"
    3525    "\n"
    36     "*** Shell Configured with WinSystems PCMMIO Commands ***\n"
    37     "Type \"help pcmmio\" for more information\n"
    38     "\n"
     26    "*** Shell Configured with Multi IO Commands ***\n"
     27    "Multi IO Configuration: %s\n"
     28    "Type \"help multiio\" for more information\n"
     29    "\n",
     30    rtems_multiio_get_name()
    3931  );
    4032  rtems_shell_init(
     
    8476
    8577#define CONFIGURE_SHELL_USER_COMMANDS \
    86   CONFIGURE_PCMMIO_COMMANDS
     78  CONFIGURE_MULTIIO_COMMANDS
    8779#define CONFIGURE_SHELL_USER_ALIASES \
    88   CONFIGURE_PCMMIO_ALIASES
     80  CONFIGURE_MULTIIO_ALIASES
    8981
    9082#define CONFIGURE_SHELL_COMMANDS_INIT
Note: See TracChangeset for help on using the changeset viewer.