[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

parllel port programming + ppdev



 hi all,

       i wrote parallel port programming using
ppdev.This program is executing on PC perfectly. But
when i am trying to do on the Axis developer board ,
it is not working. While cross compiling the program i

didn't get any errors. 

	this program requires paport0 device driver, that is
why i reconfigured the kernel to get parport0 device
driver. But even then the program is not
working.........



Can anyone tell me what could be the reason?


thanks in advance


regards

Latha
 

Here is the souce code of the program
*****************************************************************************
             program

****************************************************************************
#include <stdio.h>
#include <linux/ioctl.h>
#include <linux/parport.h>
#include <linux/ppdev.h>
#include <fcntl.h>


int main(int argc, char *argv[])
{
  int fd, mode;
  unsigned char status, data;


  fd = open("/dev/parport0",O_RDWR);
  if (fd == -1)
  {
    perror("open");
    exit(1);
  }


  if (ioctl(fd,PPCLAIM))
  {
    perror("PPCLAIM");
    close(fd);
    exit(1);
  }


  mode = IEEE1284_MODE_COMPAT;
  if (ioctl(fd, PPNEGOT, &mode))
  {
    perror ("PPNEGOT");
    close (fd);
    return 1;
  }

  ioctl(fd,PPWDATA,argv[1]);

  ioctl (fd, PPRELEASE);

  close(fd);
}


*****************************************************************************

________________________________________________________________________
Want to sell your car? advertise on Yahoo Autos Classifieds. It's Free!!
       visit http://in.autos.yahoo.com