Skip to content

Midas C++ API - hardware access (VME, CAMAC, Fastbus, USB)

This page contains the full API reference for the standard interfaces that frontends use to access VME, CAMAC and Fastbus crates and USB devices.

For an example of reading VME modules and handling their interrupts in a frontend, see Frontends: programming.

Each interface is a set of functions declared in a header in include. The functions are implemented by a driver for your interface hardware, e.g. in drivers/vme or drivers/camac, which you link with your frontend. A frontend can then change to different interface hardware by linking a different driver.

VME

VME Functions (mvme_xxx)

Functions

mvme_close

int mvme_close(MVME_INTERFACE *vme)

Close and release ALL the opened VME channel. See example in mvme_open()

Returns:

  • int –
    MVME_SUCCESS, MVME_ACCESS_ERROR

Defined in include/mvmestd.h:219

mvme_get_am

int mvme_get_am(MVME_INTERFACE *vme, int *am)

Get Address Modifier.

Returns:

  • int –
    MVME_SUCCESS

Defined in include/mvmestd.h:294

mvme_get_blt

int mvme_get_blt(MVME_INTERFACE *vme, int *mode)

Get current Data mode.

Returns:

  • int –
    MVME_SUCCESS

Defined in include/mvmestd.h:330

mvme_get_dmode

int mvme_get_dmode(MVME_INTERFACE *vme, int *dmode)

Get current Data mode.

Returns:

  • int –
    MVME_SUCCESS

Defined in include/mvmestd.h:312

mvme_interrupt_attach

int mvme_interrupt_attach(MVME_INTERFACE *mvme, int level, int vector, void (*isr)(int, void*, void *), void *info)

Defined in include/mvmestd.h:332

mvme_interrupt_detach

int mvme_interrupt_detach(MVME_INTERFACE *mvme, int level, int vector, void *info)

Defined in include/mvmestd.h:334

mvme_interrupt_disable

int mvme_interrupt_disable(MVME_INTERFACE *mvme, int level, int vector, void *info)

Defined in include/mvmestd.h:336

mvme_interrupt_enable

int mvme_interrupt_enable(MVME_INTERFACE *mvme, int level, int vector, void *info)

Defined in include/mvmestd.h:335

mvme_interrupt_generate

int mvme_interrupt_generate(MVME_INTERFACE *mvme, int level, int vector, void *info)

Defined in include/mvmestd.h:331

mvme_open

int mvme_open(MVME_INTERFACE **vme, int idx)

VME open The code below summarize the use of most of the mvme calls included in this interface.

#include "vmicvme.h"  // or other VME interface driver.

int main () {
  int i, status, vmeio_status, data;
  MVME_INTERFACE *myvme;

  // Open VME channel
  status = mvme_open(&myvme, 0);

  // Reset VME
  // Under VMIC reboot CPU!!
  //  status = mvme_sysreset(myvme);

  // Setup AM
  status = mvme_set_am(myvme, MVME_AM_A24_ND);

  // Setup Data size
  status = mvme_set_dmode(myvme, MVME_DMODE_D32);

  // Read VMEIO status
  status = mvme_read(myvme, &vmeio_status, 0x78001C, 4);
  printf("VMEIO status : 0x%x\n", vmeio_status);

  // Write Single value
  mvme_write_value(myvme, 0x780010, 0x3);

  // Read Single Value
  printf("Value : 0x%x\n", mvme_read_value(myvme, 0x780018));

  // Write to the VMEIO in latch mode
  for (i=0;i<10000;i++) {
    data = 0xF;
    status = mvme_write(myvme, 0x780010, &data, 4);
    data = 0x0;
    status = mvme_write(myvme, 0x780010, &data, 4);
  }

  // Close VME channel
  status = mvme_close(myvme);
  return 1;
}

Parameters:

  • vme (MVME_INTERFACE **)
  • idx (int)
  • index –
    interface number should be used to distingush multiple VME interface access within the same program.

Returns:

  • int –
    status MVME_SUCCESS, MVME_NO_INTERFACE, MVME_INVALID_PARAM, MVME_ACCESS_ERROR

Defined in include/mvmestd.h:210

mvme_read

int mvme_read(MVME_INTERFACE *vme, void *dst, mvme_addr_t vme_addr, mvme_size_t n_bytes)

Read from VME bus. Implementation of the read can include automatic DMA transfer based on the size of the data. See example in mvme_open()

Parameters:

  • vme (MVME_INTERFACE *)
  • dst (void *)
  • vme_addr (mvme_addr_t) –
    source address (VME location).
  • n_bytes (mvme_size_t) –
    requested transfer size.

Returns:

  • int –
    MVME_SUCCESS

Defined in include/mvmestd.h:242

mvme_read_value

unsigned int mvme_read_value(MVME_INTERFACE *vme, mvme_addr_t vme_addr)

Read single data from VME bus. Useful for register access. See example in mvme_open()

Parameters:

  • vme (MVME_INTERFACE *)
  • vme_addr (mvme_addr_t) –
    source address (VME location).

Returns:

  • unsigned int –
    MVME_SUCCESS

Defined in include/mvmestd.h:252

mvme_set_am

int mvme_set_am(MVME_INTERFACE *vme, int am)

Set Address Modifier.

Parameters:

  • vme (MVME_INTERFACE *)
  • am (int) –
    address modifier

Returns:

  • int –
    MVME_SUCCESS

Defined in include/mvmestd.h:285

mvme_set_blt

int mvme_set_blt(MVME_INTERFACE *vme, int mode)

Set Block Transfer mode.

Parameters:

  • vme (MVME_INTERFACE *)
  • mode (int) –
    BLT mode

Returns:

  • int –
    MVME_SUCCESS

Defined in include/mvmestd.h:321

mvme_set_dmode

int mvme_set_dmode(MVME_INTERFACE *vme, int dmode)

Set Data mode.

Parameters:

  • vme (MVME_INTERFACE *)
  • dmode (int) –
    Data mode

Returns:

  • int –
    MVME_SUCCESS

Defined in include/mvmestd.h:303

mvme_sysreset

int mvme_sysreset(MVME_INTERFACE *vme)

VME bus reset. Effect of the VME bus reset is dependent of the type of VME interface used. See example in mvme_open()

Returns:

  • int –
    MVME_SUCCESS, MVME_ACCESS_ERROR

Defined in include/mvmestd.h:229

mvme_write

int mvme_write(MVME_INTERFACE *vme, mvme_addr_t vme_addr, void *src, mvme_size_t n_bytes)

Write data to VME bus. Implementation of the write can include automatic DMA transfer based on the size of the data. See example in mvme_open()

Parameters:

  • vme (MVME_INTERFACE *)
  • vme_addr (mvme_addr_t) –
    source address (VME location).
  • src (void *)
  • n_bytes (mvme_size_t) –
    size of the array in bytes

Returns:

  • int –
    MVME_SUCCESS

Defined in include/mvmestd.h:265

mvme_write_value

int mvme_write_value(MVME_INTERFACE *vme, mvme_addr_t vme_addr, unsigned int value)

Write single data to VME bus. Useful for register access. See example in mvme_open()

Parameters:

  • vme (MVME_INTERFACE *)
  • vme_addr (mvme_addr_t) –
    source address (VME location).
  • value (unsigned int) –
    Value to be written to the VME bus

Returns:

  • int –
    MVME_SUCCESS

Defined in include/mvmestd.h:276

CAMAC

Camac Functions (camxxx)

Functions

cam16i

void cam16i(const int c, const int n, const int a, const int f, WORD * d)

16 bits input.

Parameters:

  • c (const int) –
    crate number (0..)
  • n (const int) –
    station number (0..30)
  • a (const int) –
    sub-address (0..15)
  • f (const int) –
    function (0..7)
  • d (WORD *) –
    data read out data

Returns:

  • void

Defined in include/mcstd.h:89

cam16i_q

void cam16i_q(const int c, const int n, const int a, const int f, WORD * d, int *x, int *q)

16 bits input with Q response.

Parameters:

  • c (const int) –
    crate number (0..)
  • n (const int) –
    station number (0..30)
  • a (const int) –
    sub-address (0..15)
  • f (const int) –
    function (0..7)
  • d (WORD *) –
    data read out data
  • x (int *) –
    X response (0:failed,1:success)
  • q (int *) –
    Q resonpse (0:no Q, 1: Q)

Returns:

  • void

Defined in include/mcstd.h:132

cam16i_r

void cam16i_r(const int c, const int n, const int a, const int f, WORD ** d, const int r)

Repeat 16 bits input.

Parameters:

  • c (const int) –
    crate number (0..)
  • n (const int) –
    station number (0..30)
  • a (const int) –
    sub-address (0..15)
  • f (const int) –
    function (0..7)
  • d (WORD **) –
    data read out data
  • r (const int) –
    repeat time

Returns:

  • void

Defined in include/mcstd.h:162

cam16i_rq

void cam16i_rq(const int c, const int n, const int a, const int f, WORD ** d, const int r)

Repeat 16 bits input with Q stop.

Parameters:

  • c (const int) –
    crate number (0..)
  • n (const int) –
    station number (0..30)
  • a (const int) –
    sub-address (0..15)
  • f (const int) –
    function (0..7)
  • d (WORD **) –
    pointer to data read out
  • r (const int) –
    repeat time

Returns:

  • void

Defined in include/mcstd.h:204

cam16i_sa

void cam16i_sa(const int c, const int n, const int a, const int f, WORD ** d, const int r)

Read the given CAMAC address and increment the sub-address by one. Repeat r times.

WORD pbkdat[4];
cam16i_sa(crate, 5, 0, 2, &pbkdat, 4);

equivalent to :

cam16i(crate, 5, 0, 2, &pbkdat[0]);
cam16i(crate, 5, 1, 2, &pbkdat[1]);
cam16i(crate, 5, 2, 2, &pbkdat[2]);
cam16i(crate, 5, 3, 2, &pbkdat[3]);

Parameters:

  • c (const int) –
    crate number (0..)
  • n (const int) –
    station number (0..30)
  • a (const int) –
    sub-address (0..15)
  • f (const int) –
    function (0..7)
  • d (WORD **) –
    pointer to data read out
  • r (const int) –
    number of consecutive sub-address to read

Returns:

  • void

Defined in include/mcstd.h:269

cam16i_sn

void cam16i_sn(const int c, const int n, const int a, const int f, WORD ** d, const int r)

Read the given CAMAC address and increment the station number by one. Repeat r times.

WORD pbkdat[4];
cam16i_sa(crate, 5, 0, 2, &pbkdat, 4);

equivalent to :

cam16i(crate, 5, 0, 2, &pbkdat[0]);
cam16i(crate, 6, 0, 2, &pbkdat[1]);
cam16i(crate, 7, 0, 2, &pbkdat[2]);
cam16i(crate, 8, 0, 2, &pbkdat[3]);

Parameters:

  • c (const int) –
    crate number (0..)
  • n (const int) –
    station number (0..30)
  • a (const int) –
    sub-address (0..15)
  • f (const int) –
    function (0..7)
  • d (WORD **) –
    pointer to data read out
  • r (const int) –
    number of consecutive station to read

Returns:

  • void

Defined in include/mcstd.h:347

cam16o

void cam16o(const int c, const int n, const int a, const int f, WORD d)

Write data to given CAMAC address.

Parameters:

  • c (const int) –
    crate number (0..)
  • n (const int) –
    station number (0..30)
  • a (const int) –
    sub-address (0..15)
  • f (const int) –
    function (16..31)
  • d (WORD) –
    data to be written to CAMAC

Returns:

  • void

Defined in include/mcstd.h:406

cam16o_q

void cam16o_q(const int c, const int n, const int a, const int f, WORD d, int *x, int *q)

Write data to given CAMAC address with Q response.

Parameters:

  • c (const int) –
    crate number (0..)
  • n (const int) –
    station number (0..30)
  • a (const int) –
    sub-address (0..15)
  • f (const int) –
    function (16..31)
  • d (WORD) –
    data to be written to CAMAC
  • x (int *) –
    X response (0:failed,1:success)
  • q (int *) –
    Q resonpse (0:no Q, 1: Q)

Returns:

  • void

Defined in include/mcstd.h:449

cam16o_r

void cam16o_r(const int c, const int n, const int a, const int f, WORD * d, const int r)

Repeat write data to given CAMAC address r times.

Parameters:

  • c (const int) –
    crate number (0..)
  • n (const int) –
    station number (0..30)
  • a (const int) –
    sub-address (0..15)
  • f (const int) –
    function (16..31)
  • d (WORD *) –
    data to be written to CAMAC
  • r (const int) –
    number of repeatition

Returns:

  • void

Defined in include/mcstd.h:492

cam24i

void cam24i(const int c, const int n, const int a, const int f, DWORD * d)

24 bits input.

Parameters:

  • c (const int) –
    crate number (0..)
  • n (const int) –
    station number (0..30)
  • a (const int) –
    sub-address (0..15)
  • f (const int) –
    function (0..7)
  • d (DWORD *) –
    data read out data

Returns:

  • void

Defined in include/mcstd.h:102

cam24i_q

void cam24i_q(const int c, const int n, const int a, const int f, DWORD * d, int *x, int *q)

24 bits input with Q response.

Parameters:

  • c (const int) –
    crate number (0..)
  • n (const int) –
    station number (0..30)
  • a (const int) –
    sub-address (0..15)
  • f (const int) –
    function (0..7)
  • d (DWORD *) –
    data read out data
  • x (int *) –
    X response (0:failed,1:success)
  • q (int *) –
    Q resonpse (0:no Q, 1: Q)

Returns:

  • void

Defined in include/mcstd.h:147

cam24i_r

void cam24i_r(const int c, const int n, const int a, const int f, DWORD ** d, const int r)

Repeat 24 bits input.

Parameters:

  • c (const int) –
    crate number (0..)
  • n (const int) –
    station number (0..30)
  • a (const int) –
    sub-address (0..15)
  • f (const int) –
    function (0..7)
  • d (DWORD **) –
    data read out
  • r (const int) –
    repeat time

Returns:

  • void

Defined in include/mcstd.h:176

cam24i_rq

void cam24i_rq(const int c, const int n, const int a, const int f, DWORD ** d, const int r)

Repeat 24 bits input with Q stop.

Parameters:

  • c (const int) –
    crate number (0..)
  • n (const int) –
    station number (0..30)
  • a (const int) –
    sub-address (0..15)
  • f (const int) –
    function (0..7)
  • d (DWORD **) –
    pointer to data read out
  • r (const int) –
    repeat time

Returns:

  • void

Defined in include/mcstd.h:218

cam24i_sa

void cam24i_sa(const int c, const int n, const int a, const int f, DWORD ** d, const int r)

Read the given CAMAC address and increment the sub-address by one. Repeat r times.

DWORD pbkdat[8];
cam24i_sa(crate, 5, 0, 2, &pbkdat, 8);

equivalent to

cam24i(crate, 5, 0, 2, &pbkdat[0]);
cam24i(crate, 6, 0, 2, &pbkdat[1]);
cam24i(crate, 7, 0, 2, &pbkdat[2]);
cam24i(crate, 8, 0, 2, &pbkdat[3]);

Parameters:

  • c (const int) –
    crate number (0..)
  • n (const int) –
    station number (0..30)
  • a (const int) –
    sub-address (0..15)
  • f (const int) –
    function (0..7)
  • d (DWORD **) –
    pointer to data read out
  • r (const int) –
    number of consecutive sub-address to read

Returns:

  • void

Defined in include/mcstd.h:295

cam24i_sn

void cam24i_sn(const int c, const int n, const int a, const int f, DWORD ** d, const int r)

Read the given CAMAC address and increment the station number by one. Repeat r times.

DWORD pbkdat[4];
cam24i_sa(crate, 5, 0, 2, &pbkdat, 4);

equivalent to :

cam24i(crate, 5, 0, 2, &pbkdat[0]);
cam24i(crate, 6, 0, 2, &pbkdat[1]);
cam24i(crate, 7, 0, 2, &pbkdat[2]);
cam24i(crate, 8, 0, 2, &pbkdat[3]);

Parameters:

  • c (const int) –
    crate number (0..)
  • n (const int) –
    station number (0..30)
  • a (const int) –
    sub-address (0..15)
  • f (const int) –
    function (0..7)
  • d (DWORD **) –
    pointer to data read out
  • r (const int) –
    number of consecutive station to read

Returns:

  • void

Defined in include/mcstd.h:373

cam24o

void cam24o(const int c, const int n, const int a, const int f, DWORD d)

Write data to given CAMAC address.

Parameters:

  • c (const int) –
    crate number (0..)
  • n (const int) –
    station number (0..30)
  • a (const int) –
    sub-address (0..15)
  • f (const int) –
    function (16..31)
  • d (DWORD) –
    data to be written to CAMAC

Returns:

  • void

Defined in include/mcstd.h:419

cam24o_q

void cam24o_q(const int c, const int n, const int a, const int f, DWORD d, int *x, int *q)

Write data to given CAMAC address with Q response.

Parameters:

  • c (const int) –
    crate number (0..)
  • n (const int) –
    station number (0..30)
  • a (const int) –
    sub-address (0..15)
  • f (const int) –
    function (16..31)
  • d (DWORD) –
    data to be written to CAMAC
  • x (int *) –
    X response (0:failed,1:success)
  • q (int *) –
    Q response (0:no Q, 1: Q)

Returns:

  • void

Defined in include/mcstd.h:464

cam24o_r

void cam24o_r(const int c, const int n, const int a, const int f, DWORD * d, const int r)

Repeat write data to given CAMAC address r times.

Parameters:

  • c (const int) –
    crate number (0..)
  • n (const int) –
    station number (0..30)
  • a (const int) –
    sub-address (0..15)
  • f (const int) –
    function (16..31)
  • d (DWORD *) –
    data to be written to CAMAC
  • r (const int) –
    number of repeatition

Returns:

  • void

Defined in include/mcstd.h:506

cam8i_q

void cam8i_q(const int c, const int n, const int a, const int f, BYTE * d, int *x, int *q)

8 bits input with Q response.

Parameters:

  • c (const int) –
    crate number (0..)
  • n (const int) –
    station number (0..30)
  • a (const int) –
    sub-address (0..15)
  • f (const int) –
    function (0..7)
  • d (BYTE *) –
    data read out data
  • x (int *) –
    X response (0:failed,1:success)
  • q (int *) –
    Q resonpse (0:no Q, 1: Q)

Returns:

  • void

Defined in include/mcstd.h:117

cam8i_rq

void cam8i_rq(const int c, const int n, const int a, const int f, BYTE ** d, const int r)

Repeat 8 bits input with Q stop.

Parameters:

  • c (const int) –
    crate number (0..)
  • n (const int) –
    station number (0..30)
  • a (const int) –
    sub-address (0..15)
  • f (const int) –
    function (0..7)
  • d (BYTE **) –
    pointer to data read out
  • r (const int) –
    repeat time

Returns:

  • void

Defined in include/mcstd.h:190

cam8i_sa

void cam8i_sa(const int c, const int n, const int a, const int f, BYTE ** d, const int r)

Read the given CAMAC address and increment the sub-address by one. Repeat r times.

BYTE pbkdat[4];
cam8i_sa(crate, 5, 0, 2, &pbkdat, 4);

equivalent to :

cam8i(crate, 5, 0, 2, &pbkdat[0]);
cam8i(crate, 5, 1, 2, &pbkdat[1]);
cam8i(crate, 5, 2, 2, &pbkdat[2]);
cam8i(crate, 5, 3, 2, &pbkdat[3]);

Parameters:

  • c (const int) –
    crate number (0..)
  • n (const int) –
    station number (0..30)
  • a (const int) –
    sub-address (0..15)
  • f (const int) –
    function (0..7)
  • d (BYTE **) –
    pointer to data read out
  • r (const int) –
    number of consecutive sub-address to read

Returns:

  • void

Defined in include/mcstd.h:244

cam8i_sn

void cam8i_sn(const int c, const int n, const int a, const int f, BYTE ** d, const int r)

Read the given CAMAC address and increment the station number by one. Repeat r times.

BYTE pbkdat[4];
cam8i_sa(crate, 5, 0, 2, &pbkdat, 4);

equivalent to :

cam8i(crate, 5, 0, 2, &pbkdat[0]);
cam8i(crate, 6, 0, 2, &pbkdat[1]);
cam8i(crate, 7, 0, 2, &pbkdat[2]);
cam8i(crate, 8, 0, 2, &pbkdat[3]);

Parameters:

  • c (const int) –
    crate number (0..)
  • n (const int) –
    station number (0..30)
  • a (const int) –
    sub-address (0..15)
  • f (const int) –
    function (0..7)
  • d (BYTE **) –
    pointer to data read out
  • r (const int) –
    number of consecutive station to read

Returns:

  • void

Defined in include/mcstd.h:321

cam8o

void cam8o(const int c, const int n, const int a, const int f, BYTE d)

Write data to given CAMAC address.

Parameters:

  • c (const int) –
    crate number (0..)
  • n (const int) –
    station number (0..30)
  • a (const int) –
    sub-address (0..15)
  • f (const int) –
    function (16..31)
  • d (BYTE) –
    data to be written to CAMAC

Returns:

  • void

Defined in include/mcstd.h:393

cam8o_q

void cam8o_q(const int c, const int n, const int a, const int f, BYTE d, int *x, int *q)

Write data to given CAMAC address with Q response.

Parameters:

  • c (const int) –
    crate number (0..)
  • n (const int) –
    station number (0..30)
  • a (const int) –
    sub-address (0..15)
  • f (const int) –
    function (16..31)
  • d (BYTE) –
    data to be written to CAMAC
  • x (int *) –
    X response (0:failed,1:success)
  • q (int *) –
    Q resonpse (0:no Q, 1: Q)

Returns:

  • void

Defined in include/mcstd.h:434

cam8o_r

void cam8o_r(const int c, const int n, const int a, const int f, BYTE * d, const int r)

Repeat write data to given CAMAC address r times.

Parameters:

  • c (const int) –
    crate number (0..)
  • n (const int) –
    station number (0..30)
  • a (const int) –
    sub-address (0..15)
  • f (const int) –
    function (16..31)
  • d (BYTE *) –
    data to be written to CAMAC
  • r (const int) –
    number of repeatition

Returns:

  • void

Defined in include/mcstd.h:478

cam_crate_clear

void cam_crate_clear(const int c)

Issue CLEAR to crate.

Parameters:

  • c (const int) –
    crate number (0..)

Returns:

  • void

Defined in include/mcstd.h:630

cam_crate_zinit

void cam_crate_zinit(const int c)

Issue Z to crate.

Parameters:

  • c (const int) –
    crate number (0..)

Returns:

  • void

Defined in include/mcstd.h:638

cam_exit

void cam_exit()

Close CAMAC accesss.

Defined in include/mcstd.h:598

cam_inhibit_clear

void cam_inhibit_clear(const int c)

Clear Crate inhibit.

Parameters:

  • c (const int) –
    crate number (0..)

Returns:

  • void

Defined in include/mcstd.h:614

cam_inhibit_set

void cam_inhibit_set(const int c)

Set Crate inhibit.

Parameters:

  • c (const int) –
    crate number (0..)

Returns:

  • void

Defined in include/mcstd.h:606

cam_inhibit_test

int cam_inhibit_test(const int c)

Test Crate Inhibit.

Parameters:

  • c (const int) –
    crate number (0..)

Returns:

  • int –
    1 for set, 0 for cleared

Defined in include/mcstd.h:622

cam_init

int cam_init()

Initialize CAMAC access.

Returns:

  • int –
    1: success

Defined in include/mcstd.h:579

cam_init_rpc

int cam_init_rpc(const char *host_name, const char *exp_name, const char *fe_name, const char *client_name, const char *rpc_server)

Initialize CAMAC access for rpc calls

Defined in include/mcstd.h:592

cam_interrupt_attach

void cam_interrupt_attach(const int c, const int n, void (*isr) (void))

Attach service routine to LAM of specific crate and station.

Parameters:

  • c (const int) –
    crate number (0..)
  • n (const int) –
    station number
  • isr (void (*) (void))

Returns:

  • void

Defined in include/mcstd.h:722

cam_interrupt_detach

void cam_interrupt_detach(const int c, const int n)

Detach service routine from LAM.

Parameters:

  • c (const int) –
    crate number (0..)
  • n (const int) –
    station number

Returns:

  • void

Defined in include/mcstd.h:732

cam_interrupt_disable

void cam_interrupt_disable(const int c)

Disables interrupts in specific crate

Parameters:

  • c (const int) –
    crate number (0..)

Returns:

  • void

Defined in include/mcstd.h:704

cam_interrupt_enable

void cam_interrupt_enable(const int c)

Enable interrupts in specific crate

Parameters:

  • c (const int) –
    crate number (0..)

Returns:

  • void

Defined in include/mcstd.h:696

cam_interrupt_test

int cam_interrupt_test(const int c)

Test Crate Interrupt.

Parameters:

  • c (const int) –
    crate number (0..)

Returns:

  • int –
    1 for set, 0 for cleared

Defined in include/mcstd.h:712

cam_lam_clear

void cam_lam_clear(const int c, const int n)

Clear the LAM register of the crate controller. It doesn't clear the LAM of the particular station.

Parameters:

  • c (const int) –
    crate number (0..)
  • n (const int) –
    LAM station

Returns:

  • void

Defined in include/mcstd.h:677

cam_lam_disable

void cam_lam_disable(const int c, const int n)

Disable LAM generation for given station to the Crate controller. It doesn't disable the LAM of the actual station itself.

Parameters:

  • c (const int) –
    crate number (0..)
  • n (const int) –
    LAM station

Returns:

  • void

Defined in include/mcstd.h:658

cam_lam_enable

void cam_lam_enable(const int c, const int n)

Enable LAM generation for given station to the Crate controller. It doesn't enable the LAM of the actual station itself.

Parameters:

  • c (const int) –
    crate number (0..)
  • n (const int) –
    LAM station

Returns:

  • void

Defined in include/mcstd.h:648

cam_lam_read

void cam_lam_read(const int c, DWORD * lam)

Reads in lam the lam pattern of the entire crate.

Parameters:

  • c (const int) –
    crate number (0..)
  • lam (DWORD *) –
    LAM pattern of the crate

Returns:

  • void

Defined in include/mcstd.h:667

cam_lam_wait

int cam_lam_wait(int *c, DWORD * n, const int millisec)

Wait for a LAM to occur with a certain timeout. Return crate and station if LAM occurs.

Parameters:

  • c (int *) –
    crate number (0..)
  • n (DWORD *) –
    LAM station
  • millisec (const int) –
    If there is no LAM after this timeout, the routine returns

Returns:

  • int –
    1 if LAM occured, 0 else

Defined in include/mcstd.h:688

cam_op

void cam_op()

Defined in include/mcstd.h:733

camc

void camc(const int c, const int n, const int a, const int f)

CAMAC command (no data).

Parameters:

  • c (const int) –
    crate number (0..)
  • n (const int) –
    station number (0..30)
  • a (const int) –
    sub-address (0..15)
  • f (const int) –
    function (8..15, 24..31)

Returns:

  • void

Defined in include/mcstd.h:533

camc_chk

int camc_chk(const int c)

Crate presence check.

Parameters:

  • c (const int) –
    crate number (0..)

Returns:

  • int –
    0:Success, -1:No CAMAC response

Defined in include/mcstd.h:522

camc_q

void camc_q(const int c, const int n, const int a, const int f, int *q)

CAMAC command with Q response (no data).

Parameters:

  • c (const int) –
    crate number (0..)
  • n (const int) –
    station number (0..30)
  • a (const int) –
    sub-address (0..15)
  • f (const int) –
    function (8..15, 24..31)
  • q (int *) –
    Q response (0:no Q, 1:Q)

Returns:

  • void

Defined in include/mcstd.h:545

camc_sa

void camc_sa(const int c, const int n, const int a, const int f, const int r)

Scan CAMAC command on sub-address.

Parameters:

  • c (const int) –
    crate number (0..)
  • n (const int) –
    station number (0..30)
  • a (const int) –
    sub-address (0..15)
  • f (const int) –
    function (8..15, 24..31)
  • r (const int) –
    number of consecutive sub-address to read

Returns:

  • void

Defined in include/mcstd.h:558

camc_sn

void camc_sn(const int c, const int n, const int a, const int f, const int r)

Scan CAMAC command on station.

Parameters:

  • c (const int) –
    crate number (0..)
  • n (const int) –
    station number (0..30)
  • a (const int) –
    sub-address (0..15)
  • f (const int) –
    function (8..15, 24..31)
  • r (const int) –
    number of consecutive station to read

Returns:

  • void

Defined in include/mcstd.h:571

cami

void cami(const int c, const int n, const int a, const int f, WORD * d)

Same as cam16i()

Defined in include/mcstd.h:380

camo

void camo(const int c, const int n, const int a, const int f, WORD d)

Same as cam16o()

Defined in include/mcstd.h:513

CAMAC (ESONE standard)

include/esone.h

Functions

cccc

INLINE void cccc(const int ext)

Defined in include/esone.h:45

cccd

INLINE void cccd(const int ext, int l)

Defined in include/esone.h:49

ccci

INLINE void ccci(const int ext, int l)

Defined in include/esone.h:47

cccz

INLINE void cccz(const int ext)

Defined in include/esone.h:46

ccinit

INLINE void ccinit()

Defined in include/esone.h:40

cclc

INLINE void cclc(const int lam)

Defined in include/esone.h:55

cclm

INLINE void cclm(const int lam, int l)

Defined in include/esone.h:54

cdlam

INLINE void cdlam(int *lam, const int b, const int c, const int n, const int a, const int inta[2])

Defined in include/esone.h:51

cdreg

INLINE void cdreg(int *ext, const int b, const int c, const int n, const int a)

Defined in include/esone.h:41

cfga

INLINE void cfga(int f[], int exta[], int intc[], int qa[], int cb[])

Defined in include/esone.h:57

cfmad

INLINE void cfmad(int f, int extb[], int intc[], int cb[])

Defined in include/esone.h:59

cfsa

INLINE void cfsa(const int f, const int ext, unsigned long *d, int *q)

Defined in include/esone.h:44

cfubc

INLINE void cfubc(const int f, int ext, int intc[], int cb[])

Defined in include/esone.h:61

cfubr

INLINE void cfubr(const int f, int ext, int intc[], int cb[])

Defined in include/esone.h:63

csga

INLINE void csga(int f[], int exta[], int intc[], int qa[], int cb[])

Defined in include/esone.h:58

csmad

INLINE void csmad(int f, int extb[], int intc[], int cb[])

Defined in include/esone.h:60

cssa

INLINE void cssa(const int f, int ext, unsigned short *d, int *q)

Defined in include/esone.h:43

csubc

INLINE void csubc(const int f, int ext, int intc[], int cb[])

Defined in include/esone.h:62

csubr

INLINE void csubr(const int f, int ext, int intc[], int cb[])

Defined in include/esone.h:64

ctcd

INLINE void ctcd(const int ext, int *l)

Defined in include/esone.h:50

ctci

INLINE void ctci(const int ext, int *l)

Defined in include/esone.h:48

ctgl

INLINE void ctgl(const int lam, int *l)

Defined in include/esone.h:53

ctlm

INLINE void ctlm(const int lam, int *l)

Defined in include/esone.h:56

Macros

EXPRT

#define EXPRT

Defined in include/esone.h:28

EXTERNAL

#define EXTERNAL extern

Defined in include/esone.h:22

INLINE

#define INLINE __inline__

Defined in include/esone.h:16

Fastbus

include/mfbstd.h

Type definitions

DWORD

typedef unsigned int DWORD

Defined in include/mfbstd.h:21

WORD

typedef unsigned short int WORD

Defined in include/mfbstd.h:18

Functions

fb_execute

int fb_execute(int addr, void *buffer, int *count)

Defined in include/mfbstd.h:60

fb_exit

void fb_exit()

Defined in include/mfbstd.h:44

fb_frc

int fb_frc(int paddr, int saddr, DWORD * data)

Defined in include/mfbstd.h:48

fb_frcm

int fb_frcm(int b_case, DWORD * data)

Defined in include/mfbstd.h:53

fb_frd

int fb_frd(int paddr, int saddr, DWORD * data)

Defined in include/mfbstd.h:47

fb_frdb

int fb_frdb(int paddr, int saddr, DWORD * data, int *count)

Defined in include/mfbstd.h:54

fb_frdba

void fb_frdba(int paddr, int saddr, int count)

Defined in include/mfbstd.h:57

fb_fwc

int fb_fwc(int paddr, int saddr, DWORD data)

Defined in include/mfbstd.h:50

fb_fwcm

int fb_fwcm(int b_case, int paddr, int saddr, DWORD data)

Defined in include/mfbstd.h:52

fb_fwd

int fb_fwd(int paddr, int saddr, DWORD data)

Defined in include/mfbstd.h:49

fb_fwdm

int fb_fwdm(int paddr, int saddr, DWORD data)

Defined in include/mfbstd.h:51

fb_in

int fb_in()

Defined in include/mfbstd.h:56

fb_init

int fb_init()

Defined in include/mfbstd.h:43

fb_load_begin

int fb_load_begin(int addr)

Defined in include/mfbstd.h:58

fb_load_end

int fb_load_end()

Defined in include/mfbstd.h:59

fb_out

int fb_out(DWORD data)

Defined in include/mfbstd.h:55

fb_reset

int fb_reset()

Defined in include/mfbstd.h:45

Macros

EXPRT

#define EXPRT

Defined in include/mfbstd.h:32

SUCCESS

#define SUCCESS 1

Defined in include/mfbstd.h:24

USB

include/musbstd.h

Functions

musb_close

int musb_close(MUSB_INTERFACE *musb_interface)

Defined in include/musbstd.h:84

musb_get_device

int musb_get_device(MUSB_INTERFACE *musb_interface)

Defined in include/musbstd.h:89

musb_open

int musb_open(MUSB_INTERFACE **musb_interface, int vendor, int product, int instance, int configuration, int usbinterface)

Defined in include/musbstd.h:83

musb_read

int musb_read(MUSB_INTERFACE *musb_interface, int endpoint, void *buf, int count, int timeout_ms)

Defined in include/musbstd.h:86

musb_reset

int musb_reset(MUSB_INTERFACE *musb_interface)

Defined in include/musbstd.h:87

musb_set_altinterface

int musb_set_altinterface(MUSB_INTERFACE *musb_interface, int index)

Defined in include/musbstd.h:88

musb_write

int musb_write(MUSB_INTERFACE *musb_interface, int endpoint, const void *buf, int count, int timeout_ms)

Defined in include/musbstd.h:85

Macros

EXPRT

#define EXPRT

Defined in include/musbstd.h:79

MUSB_ACCESS_ERROR

#define MUSB_ACCESS_ERROR 5

Defined in include/musbstd.h:67

MUSB_INVALID_PARAM

#define MUSB_INVALID_PARAM 3

Defined in include/musbstd.h:65

MUSB_NO_MEM

#define MUSB_NO_MEM 4

Defined in include/musbstd.h:66

MUSB_NOT_FOUND

#define MUSB_NOT_FOUND 2

Defined in include/musbstd.h:64

MUSB_SUCCESS

#define MUSB_SUCCESS 1

Defined in include/musbstd.h:63

Data formats of specific modules

include/hardware.h

Classes

CAEN775_DATA

Defined in include/hardware.h:69

Attributes
channel
WORD channel : 6

Defined in include/hardware.h:75

data
WORD data : 12

Defined in include/hardware.h:70

geo_addr
WORD geo_addr : 5

Defined in include/hardware.h:78

overflow
WORD overflow : 1

Defined in include/hardware.h:71

tag
WORD tag : 3

Defined in include/hardware.h:77

underflow
WORD underflow: 1

Defined in include/hardware.h:72

valid
WORD valid : 1

Defined in include/hardware.h:73

CAEN775_HEADER

Defined in include/hardware.h:60

Attributes
count
WORD count : 6

Defined in include/hardware.h:62

crate
WORD crate : 8

Defined in include/hardware.h:64

geo_addr
WORD geo_addr : 5

Defined in include/hardware.h:66

tag
WORD tag : 3

Defined in include/hardware.h:65

LRS1875_DATA

Defined in include/hardware.h:50

Attributes
channel
WORD channel : 6

Defined in include/hardware.h:53

data
WORD data : 12

Defined in include/hardware.h:51

event
WORD event : 3

Defined in include/hardware.h:56

geo_addr
WORD geo_addr : 5

Defined in include/hardware.h:57

range
WORD range : 1

Defined in include/hardware.h:55

LRS1877_DATA

Defined in include/hardware.h:32

Attributes
buffer
WORD buffer:2

Defined in include/hardware.h:36

channel
WORD channel:7

Defined in include/hardware.h:35

data
WORD data:16

Defined in include/hardware.h:33

edge
WORD edge:1

Defined in include/hardware.h:34

geo_addr
WORD geo_addr:5

Defined in include/hardware.h:38

parity
WORD parity:1

Defined in include/hardware.h:37

LRS1877_HEADER

Defined in include/hardware.h:41

Attributes
buffer
WORD buffer:3

Defined in include/hardware.h:43

count
WORD count:11

Defined in include/hardware.h:42

geo_addr
WORD geo_addr:5

Defined in include/hardware.h:47

parity
WORD parity:1

Defined in include/hardware.h:45

LRS1882_DATA

Defined in include/hardware.h:23

Attributes
channel
WORD channel:7

Defined in include/hardware.h:26

data
WORD data:12

Defined in include/hardware.h:24

event
WORD event:3

Defined in include/hardware.h:28

geo_addr
WORD geo_addr:5

Defined in include/hardware.h:29

range
WORD range:1

Defined in include/hardware.h:27

Macros

TID_LRS1875

#define TID_LRS1875 (4<<8)

Defined in include/hardware.h:19

TID_LRS1877

#define TID_LRS1877 (2<<8)

Defined in include/hardware.h:17

TID_LRS1882

#define TID_LRS1882 (1<<8)

Defined in include/hardware.h:16

TID_PCOS3

#define TID_PCOS3 (3<<8)

Defined in include/hardware.h:18