Skip to content
Snippets Groups Projects
pcie40_b2slc.h 933 B
Newer Older
Patrick Robbe's avatar
Patrick Robbe committed
#ifndef PCIE40_B2SLC_H
#define PCIE40_B2SLC_H
// Header file for B2 Slow control functions with PCIe40 

// Constants
// BAR number for Slow control interface
#define SLC_BAR 2
// Address of the register to reset the write FIFO and bit to use
#define SLC_WFIFO_RESET_ADD 0x00050400
#define SLC_WFIFO_RESET_BIT 8
#define SLC_WFIFO_START_ADD 0x00050480
#define SLC_WFIFO_EMIT_BIT 0
#define SLC_WFIFO_ADD 0x00060000
#define SLC_RFIFO_STATUS 0x00060010
#define SLC_RFIFO_ADD 0x00060000

// Functions to read/write registers and stream files to Front End

int pcie40_readfee8(int dev, int ch, int adr);
int pcie40_writefee8(int dev, int ch, int adr, int val);
unsigned long pcie40_readfee32(int dev, int ch, int adr);
int pcie40_writefee32(int dev, int ch, int adr, int val);
int pcie40_writestream(int dev, int ch, char *filename);
Patrick Robbe's avatar
Patrick Robbe committed
int pcie40_writebytestream(int dev, int ch, int len, const char *bytes);

#endif // PCIE40_B2SLC_H