ibrpp.c 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /***************************************************************************
  2. sys/ibrpp.c
  3. -------------------
  4. copyright : (C) 2001, 2002 by Frank Mori Hess
  5. email : fmhess@users.sourceforge.net
  6. ***************************************************************************/
  7. /***************************************************************************
  8. * *
  9. * This program is free software; you can redistribute it and/or modify *
  10. * it under the terms of the GNU General Public License as published by *
  11. * the Free Software Foundation; either version 2 of the License, or *
  12. * (at your option) any later version. *
  13. * *
  14. ***************************************************************************/
  15. #include "gpibP.h"
  16. /*
  17. * IBRPP
  18. * Conduct a parallel poll and return the byte in buf.
  19. *
  20. * NOTE:
  21. * 1. Prior to conducting the poll the interface is placed
  22. * in the controller active state.
  23. */
  24. int ibrpp(gpib_board_t *board, uint8_t *result )
  25. {
  26. int retval = 0;
  27. osStartTimer( board, board->usec_timeout );
  28. retval = ibcac( board, 0 );
  29. if( retval ) return -1;
  30. if(board->interface->parallel_poll( board, result ) )
  31. {
  32. printk("gpib: parallel poll failed\n");
  33. retval = -1;
  34. }
  35. osRemoveTimer(board);
  36. return retval;
  37. }
  38. int ibppc( gpib_board_t *board, uint8_t configuration )
  39. {
  40. configuration &= 0x1f;
  41. board->interface->parallel_poll_configure( board, configuration );
  42. board->parallel_poll_configuration = configuration;
  43. return 0;
  44. }