DAQ OS: front end libraries: Difference between revisions

From CLONWiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
(16 intermediate revisions by 3 users not shown)
Line 9: Line 9:
  vxMemProbe((char *)addr,int,int,(char *)&data)
  vxMemProbe((char *)addr,int,int,(char *)&data)


  usrVmeDmaShow()
  usrVmeDmaShow()  
  usrVmeDmaConfig(UINT32 addrType, UINT32 dataType)
  usrVmeDmaGetConfig(UINT32 *addrType, UINT32 *dataType, UINT32 *sstMode)
  usrVme2MemDmaStart(UCHAR *localVmeAddr, UCHAR *localAddr, UINT32 nbytes)
usrVmeDmaSetConfig(UINT32 addrType, UINT32 dataType, UINT32 sstMode)
  usrVme2MemDmaListSet(UINT32 *localVmeAddr, UINT32 *localAddr, int *size, int numt)
  usrVme2MemDmaStart(UCHAR *vmeAddr, UCHAR *destAddr, UINT32 nbytes) - vmeAddr is jumper setting, destAddr in user space
  usrVme2MemDmaListSet(UINT32 *vmeAddr, UINT32 *destAddr, int nbytes[], int numt) - vmeAddr is jumper setting, destAddr in user space
  usrVmeDmaListStart()
  usrVmeDmaListStart()
  usrVme2MemDmaDone()
  usrVme2MemDmaDone() - returns the number of bytes transfered, or ERROR


  val = vmeRead8(unsigned char *addr)
  val = vmeRead8(unsigned char *addr)
Line 23: Line 24:
  vmeWrite32(unsigned int *addr, unsigned int val)
  vmeWrite32(unsigned int *addr, unsigned int val)


* Every board has distinctive name, for example v1495 or tdc1190. That name must be used in the files name, as well as in function names and global names to avoid duplicates. At least two files must be provided, for example v1495.c and v1495.h, where header file will be used in user readout lists.


* '''DMA configuration''' procedures must be called outside of particular boards libraries before any board's '''Init''' functions are called.


 
* '''Boards initialization function''' called once before any other calles. It must have at least three following arguments (as first arguments):
* Every board has distinctive name, for example v1495 or tdc1190. That name must be used in the files name, as well as in function names and global names to avoid duplicates. At least two files must be provided, for example v1495.c and v1495.h, where header file will be used in user readout lists.
 
* Board initialization function must have at least three following arguments (as first arguments):


  first board address (as it set by onboard switches)
  first board address (as it set by onboard switches)
Line 34: Line 34:
  the number of boards
  the number of boards


It does a scan looking for all available boards and assign board IDs starting from 0. All individual board operations must be performed using that ID. It returns the number of boards found.
It does a scan looking for all available boards and assign board IDs starting from 0. It returns the number of boards found. All individual board operations must be performed using that ID.


*
* '''Boards configuration function''' can be called several times, it does generic boards initiaization.

Latest revision as of 15:02, 1 June 2011

All front end libraries are licated in $CODA/src/rol/code.s directory. To compile use gmake clean, gmake and gmake install. For vxWorks use clon10/clon00 servers only (it will work on RHEL as well, but historically we do it on sparc machines).

Generic software development rules

  • All vxWorks- or UNIX-specific functions must have identical names and interfaces and must be included in kernels, BSPs or separate libraries, so board-specific library will be generic. In particular following functions must be available:
sysBusToLocalAdrs(int modifier,(char *)addr,(char **)&laddr)
vxMemProbe((char *)addr,int,int,(char *)&data)
usrVmeDmaShow() 
usrVmeDmaGetConfig(UINT32 *addrType, UINT32 *dataType, UINT32 *sstMode)
usrVmeDmaSetConfig(UINT32 addrType, UINT32 dataType, UINT32 sstMode)
usrVme2MemDmaStart(UCHAR *vmeAddr, UCHAR *destAddr, UINT32 nbytes) - vmeAddr is jumper setting, destAddr in user space
usrVme2MemDmaListSet(UINT32 *vmeAddr, UINT32 *destAddr, int nbytes[], int numt) - vmeAddr is jumper setting, destAddr in user space
usrVmeDmaListStart()
usrVme2MemDmaDone() - returns the number of bytes transfered, or ERROR
val = vmeRead8(unsigned char *addr)
vmeWrite8(unsigned char *addr, unsigned char val)
val = vmeRead16(unsigned short *addr)
vmeWrite16(unsigned short *addr, unsigned short val)
val = vmeRead32(unsigned int *addr)
vmeWrite32(unsigned int *addr, unsigned int val)
  • Every board has distinctive name, for example v1495 or tdc1190. That name must be used in the files name, as well as in function names and global names to avoid duplicates. At least two files must be provided, for example v1495.c and v1495.h, where header file will be used in user readout lists.
  • DMA configuration procedures must be called outside of particular boards libraries before any board's Init functions are called.
  • Boards initialization function called once before any other calles. It must have at least three following arguments (as first arguments):
first board address (as it set by onboard switches)
address step between boards
the number of boards

It does a scan looking for all available boards and assign board IDs starting from 0. It returns the number of boards found. All individual board operations must be performed using that ID.

  • Boards configuration function can be called several times, it does generic boards initiaization.