Subversion Repositories f9daq

Rev

Rev 100 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

  1. #ifndef _VME_H_
  2. #define _VME_H_
  3.  
  4. #include <stdint.h>
  5.  
  6. #ifndef _CVI_
  7. #define __stdcall
  8. #define UCHAR unsigned char
  9. #define  _VI_FUNC
  10. #endif
  11.  
  12. #define CAEN_V1718   0
  13. #define WIENER_VMEMM 1
  14. #define WIENER_VMUSB 2
  15. #define SIS3153_USB  3
  16.  
  17.  
  18. short VME_START( int interface );
  19. int VME_GetInterface();
  20. short VME_STOP();
  21. int VME_CONNECTED();
  22.  
  23. #define VME_A16 0x29
  24. #define VME_A24 0x39
  25. #define VME_A32 0x9
  26.  
  27. #define VME_D8  0x1
  28. #define VME_D16 0x2
  29. #define VME_D32 0x4
  30.  
  31. #define VME_A16D8_R(VME,DATA)  VME_R( VME_A16, VME_D8  , (VME), (DATA) )
  32. #define VME_A16D16_R(VME,DATA) VME_R( VME_A16, VME_D16 , (VME), (DATA) )
  33. #define VME_A16D32_R(VME,DATA) VME_R( VME_A16, VME_D32 , (VME), (DATA) )
  34.  
  35. #define VME_A24D8_R(VME,DATA)  VME_R( VME_A24, VME_D8  , (VME), (DATA) )
  36. #define VME_A24D16_R(VME,DATA) VME_R( VME_A24, VME_D16 , (VME), (DATA) )
  37. #define VME_A24D32_R(VME,DATA) VME_R( VME_A24, VME_D32 , (VME), (DATA) )
  38.  
  39. #define VME_A32D8_R(VME,DATA)  VME_R( VME_A32, VME_D8  , (VME), (DATA) )
  40. #define VME_A32D16_R(VME,DATA) VME_R( VME_A32, VME_D16 , (VME), (DATA) )
  41. #define VME_A32D32_R(VME,DATA) VME_R( VME_A32, VME_D32 , (VME), (DATA) )
  42.  
  43. #define VME_A16D8_W(VME,DATA)  VME_W( VME_A16, VME_D8  , (VME), (DATA) )
  44. #define VME_A16D16_W(VME,DATA) VME_W( VME_A16, VME_D16 , (VME), (DATA) )
  45. #define VME_A16D32_W(VME,DATA) VME_W( VME_A16, VME_D32 , (VME), (DATA) )
  46.  
  47. #define VME_A24D8_W(VME,DATA)  VME_W( VME_A24, VME_D8  , (VME), (DATA) )
  48. #define VME_A24D16_W(VME,DATA) VME_W( VME_A24, VME_D16 , (VME), (DATA) )
  49. #define VME_A24D32_W(VME,DATA) VME_W( VME_A24, VME_D32 , (VME), (DATA) )
  50.  
  51. #define VME_A32D8_W(VME,DATA)  VME_W( VME_A32, VME_D8  , (VME), (DATA) )
  52. #define VME_A32D16_W(VME,DATA) VME_W( VME_A32, VME_D16 , (VME), (DATA) )
  53. #define VME_A32D32_W(VME,DATA) VME_W( VME_A32, VME_D32 , (VME), (DATA) )
  54.  
  55.  
  56. #define  VME_R         (*VME_R_Ptr)
  57. #define  VME_W         (*VME_W_Ptr)
  58.  
  59. #define  VME_MWRST     (*VME_MWRST_Ptr)
  60. #define  VME_MW        (*VME_MW_Ptr)
  61. #define  VME_MWEXEC    (*VME_MWEXEC_Ptr)
  62.  
  63. #define  VME_MRRST     (*VME_MRRST_Ptr)
  64. #define  VME_MR        (*VME_MR_Ptr)
  65. #define  VME_MREXEC    (*VME_MREXEC_Ptr)
  66.  
  67.  
  68. extern short __stdcall VME_R( uint16_t AM, uint16_t DW, uint32_t VME_Address, uint32_t *Data);
  69. extern short __stdcall VME_W( uint16_t AM, uint16_t DW, uint32_t VME_Address, uint32_t Data);
  70.  
  71. extern short __stdcall VME_MWRST( void );
  72. extern short __stdcall VME_MW( uint16_t AM, uint16_t DW, uint32_t VME_Address, uint32_t Data);
  73. extern short __stdcall VME_MWEXEC( void );
  74.  
  75. extern short __stdcall VME_MRRST( void );
  76. extern short __stdcall VME_MR( uint16_t AM, uint16_t DW, uint32_t VME_Address, uint32_t *Data);
  77. extern short __stdcall VME_MREXEC( uint32_t *Data  );
  78.  
  79. #endif
  80.  
  81.