home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 3 / TheARMClub_PDCD3.iso / hensa / programming / oslib / oslib_1 / OSLib / Computer / h / parallel < prev    next >
Encoding:
Text File  |  1995-06-22  |  2.7 KB  |  101 lines

  1. #ifndef parallel_H
  2. #define parallel_H
  3.  
  4. /* C header file for Parallel
  5.  * written by DefMod (Jun 20 1995) on Thu Jun 22 12:11:41 1995
  6.  * Jonathan Coxhead, Acorn Computers Ltd
  7.  */
  8.  
  9. #ifndef types_H
  10. #include "types.h"
  11. #endif
  12.  
  13. #ifndef os_H
  14. #include "os.h"
  15. #endif
  16.  
  17. /**********************************
  18.  * SWI names and SWI reason codes *
  19.  **********************************/
  20. #undef  Parallel_HardwareAddress
  21. #define Parallel_HardwareAddress                0x42EC0
  22. #undef  XParallel_HardwareAddress
  23. #define XParallel_HardwareAddress               0x62EC0
  24. #undef  Parallel_Op
  25. #define Parallel_Op                             0x42EC1
  26. #undef  XParallel_Op
  27. #define XParallel_Op                            0x62EC1
  28. #undef  ParallelOp_Read
  29. #define ParallelOp_Read                         0x0
  30. #undef  ParallelOp_WriteData
  31. #define ParallelOp_WriteData                    0x1
  32. #undef  ParallelOp_WriteControl
  33. #define ParallelOp_WriteControl                 0x2
  34.  
  35. /*************************
  36.  * Function declarations *
  37.  *************************/
  38.  
  39. #ifdef __cplusplus
  40.    extern "C" {
  41. #endif
  42.  
  43. /* ------------------------------------------------------------------------
  44.  * Function:      parallelop_read()
  45.  *
  46.  * Description:   Reads the data and status registers
  47.  *
  48.  * Output:        data_register - value of R1 on exit
  49.  *                status_register - value of R2 on exit
  50.  *
  51.  * Other notes:   Calls SWI 0x42EC1 with R0 = 0x0.
  52.  */
  53.  
  54. extern os_error *xparallelop_read (bits *data_register,
  55.       bits *status_register);
  56. extern void parallelop_read (bits *data_register,
  57.       bits *status_register);
  58.  
  59. /* ------------------------------------------------------------------------
  60.  * Function:      parallelop_write_data()
  61.  *
  62.  * Description:   Writes the data register
  63.  *
  64.  * Input:         data - value of R1 on entry
  65.  *
  66.  * Other notes:   Calls SWI 0x42EC1 with R0 = 0x1.
  67.  */
  68.  
  69. extern os_error *xparallelop_write_data (bits data);
  70. extern void parallelop_write_data (bits data);
  71.  
  72. /* ------------------------------------------------------------------------
  73.  * Function:      parallelop_write_control()
  74.  *
  75.  * Description:   Reads/writes the control register
  76.  *
  77.  * Input:         eor_mask - value of R1 on entry
  78.  *                and_mask - value of R2 on entry
  79.  *
  80.  * Output:        old_control - value of R1 on exit (X version only)
  81.  *                new_control - value of R2 on exit
  82.  *
  83.  * Returns:       R1 (non-X version only)
  84.  *
  85.  * Other notes:   Calls SWI 0x42EC1 with R0 = 0x2.
  86.  */
  87.  
  88. extern os_error *xparallelop_write_control (bits eor_mask,
  89.       bits and_mask,
  90.       bits *old_control,
  91.       bits *new_control);
  92. extern bits parallelop_write_control (bits eor_mask,
  93.       bits and_mask,
  94.       bits *new_control);
  95.  
  96. #ifdef __cplusplus
  97.    }
  98. #endif
  99.  
  100. #endif
  101.