home *** CD-ROM | disk | FTP | other *** search
/ RISC DISC 1 / RISC_DISC_1.iso / pd_share / code / oslib / h / parallel < prev    next >
Encoding:
Text File  |  1994-09-07  |  3.4 KB  |  114 lines

  1. #ifndef parallel_H
  2. #define parallel_H
  3.  
  4. /* C header file for Parallel
  5.  * written by DefMod (Sep  7 1994) on Wed Sep  7 21:20:00 1994
  6.  * Copyright © Acorn Computers Ltd, 1994
  7.  */
  8.  
  9. /*************************************************************************
  10.  * This source file was written by Acorn Computers Limited. It is part   *
  11.  * of the OSLib library for writing applications for RISC OS. It may be  *
  12.  * used freely in the creation of programs for RISC OS.                  *
  13.  *************************************************************************/
  14.  
  15. #ifndef types_H
  16.    #include "types.h"
  17. #endif
  18.  
  19. #ifndef os_H
  20.    #include "os.h"
  21. #endif
  22.  
  23. /**********************************
  24.  * SWI names and SWI reason codes *
  25.  **********************************/
  26. #undef  Parallel_HardwareAddress
  27. #define Parallel_HardwareAddress                0x42EC0
  28. #undef  XParallel_HardwareAddress
  29. #define XParallel_HardwareAddress               0x62EC0
  30. #undef  Parallel_Op
  31. #define Parallel_Op                             0x42EC1
  32. #undef  XParallel_Op
  33. #define XParallel_Op                            0x62EC1
  34. #undef  ParallelOp_Read
  35. #define ParallelOp_Read                         0x0
  36. #undef  ParallelOp_WriteData
  37. #define ParallelOp_WriteData                    0x1
  38. #undef  ParallelOp_WriteControl
  39. #define ParallelOp_WriteControl                 0x2
  40.  
  41. /*************************
  42.  * Function declarations *
  43.  *************************/
  44.  
  45. #ifdef __cplusplus
  46.    extern "C" {
  47. #endif
  48.  
  49. /*************************************************************
  50.  * NOTE: The following functions provide direct access to    *
  51.  *       the SWI's noted in the function description.        *
  52.  *       Please read the relevant PRM section for more       *
  53.  *       information on their input/output parameters.       *
  54.  *************************************************************/
  55.  
  56. /* ------------------------------------------------------------------------
  57.  * Function:      parallelop_read()
  58.  *
  59.  * Description:   Reads the data and status registers
  60.  *
  61.  * Output:        data_register - value of R1 on exit
  62.  *                status_register - value of R2 on exit
  63.  *
  64.  * Other notes:   Calls SWI 0x42EC1 with R0 = 0x0.
  65.  */
  66.  
  67. extern os_error *xparallelop_read (bits *data_register,
  68.       bits *status_register);
  69. extern void parallelop_read (bits *data_register,
  70.       bits *status_register);
  71.  
  72. /* ------------------------------------------------------------------------
  73.  * Function:      parallelop_write_data()
  74.  *
  75.  * Description:   Writes the data register
  76.  *
  77.  * Input:         data - value of R1 on entry
  78.  *
  79.  * Other notes:   Calls SWI 0x42EC1 with R0 = 0x1.
  80.  */
  81.  
  82. extern os_error *xparallelop_write_data (bits data);
  83. extern void parallelop_write_data (bits data);
  84.  
  85. /* ------------------------------------------------------------------------
  86.  * Function:      parallelop_write_control()
  87.  *
  88.  * Description:   Reads/writes the control register
  89.  *
  90.  * Input:         eor_mask - value of R1 on entry
  91.  *                and_mask - value of R2 on entry
  92.  *
  93.  * Output:        old_control - value of R1 on exit (X version only)
  94.  *                new_control - value of R2 on exit
  95.  *
  96.  * Returns:       R1 (non-X version only)
  97.  *
  98.  * Other notes:   Calls SWI 0x42EC1 with R0 = 0x2.
  99.  */
  100.  
  101. extern os_error *xparallelop_write_control (bits eor_mask,
  102.       bits and_mask,
  103.       bits *old_control,
  104.       bits *new_control);
  105. extern bits parallelop_write_control (bits eor_mask,
  106.       bits and_mask,
  107.       bits *new_control);
  108.  
  109. #ifdef __cplusplus
  110.    }
  111. #endif
  112.  
  113. #endif
  114.