AlcapDAQ
1
|
#include <map>
#include <stdlib.h>
#include <stdio.h>
#include <stdarg.h>
#include <string.h>
#include <errno.h>
#include <time.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <sys/ioctl.h>
#include <sys/time.h>
#include <sys/socket.h>
#include <net/if.h>
#include <net/ethernet.h>
#include <netinet/in.h>
#include <linux/if_packet.h>
#include "midas.h"
#include "crate.h"
#include "vme.h"
#include "odb_wrapper.h"
#include "diag.h"
Go to the source code of this file.
Data Structures | |
struct | fadc_packet |
struct | fadc_board |
Functions | |
INT | new_fadc_pre_bor () |
INT | new_fadc_eor () |
INT | new_fadc_read (char *pevent) |
bool | allPacketsReceived (bool diag=false) |
void | receivePackets () |
void | forgetPackets (bool reallyAll=false) |
void | setReg (char *if_name, int board, int fadc, int reg, unsigned long long value, bool acquire) |
void | setupRegs () |
Variables | |
const int | TP_BLOCK_SIZE = 8192 |
const int | TP_NUM_BLOCKS = 1024 |
const int | FRAME_SIZE = 2048 |
const int | NUM_FRAMES = 4096 |
unsigned char * | packet_space = 0 |
bool | frame_examined [NUM_FRAMES] |
struct readout_module | new_fadc_module |
int | packet_socket |
const int | max_boards = 256 |
struct fadc_board | board [max_boards] |
static struct timeval | tv_start |
bool allPacketsReceived | ( | bool | diag = false ) |
Definition at line 165 of file new_fadc.cpp.
References board, enabled, fadc_board::first_packet, i, fadc_board::last_packet, max_boards, printf(), fadc_board::start_packet, and fadc_board::stop_packet.
Referenced by new_fadc_read(), and receivePackets().
void forgetPackets | ( | bool | reallyAll = false ) |
Definition at line 142 of file new_fadc.cpp.
References board, fadc_board::buffer_full, enabled, fadc_board::first_packet_time, frame_examined, FRAME_SIZE, i, max_boards, NUM_FRAMES, packet_space, fadc_board::packets, fadc_board::start_packet_seen, and fadc_board::stop_packet_seen.
Referenced by new_fadc_bor(), new_fadc_pre_bor(), and new_fadc_read().
INT new_fadc_eor | ( | ) |
Definition at line 424 of file new_fadc.cpp.
References packet_socket, packet_space, SUCCESS, TP_BLOCK_SIZE, and TP_NUM_BLOCKS.
INT new_fadc_pre_bor | ( | ) |
Definition at line 387 of file new_fadc.cpp.
References forgetPackets(), FRAME_SIZE, NUM_FRAMES, packet_socket, packet_space, setupRegs(), status, SUCCESS, TP_BLOCK_SIZE, and TP_NUM_BLOCKS.
INT new_fadc_read | ( | char * | pevent) |
Definition at line 436 of file new_fadc.cpp.
References allPacketsReceived(), board, fadc_packet::buffer_number, fadc_packet::content_length, enabled, forgetPackets(), i, fadc_board::last_packet, max_boards, fadc_board::packets, printf(), receivePackets(), sprintf(), fadc_board::start_packet, fadc_board::stop_packet, and SUCCESS.
void receivePackets | ( | ) |
Definition at line 96 of file new_fadc.cpp.
References fadc_packet::admin_message, board, fadc_board::buffer_full, fadc_packet::buffer_number, fadc_packet::content_length, enabled, fadc_board::first_packet, fadc_board::first_packet_time, frame_examined, FRAME_SIZE, i, fadc_board::last_packet, fadc_board::last_packet_time, NUM_FRAMES, fadc_packet::packet_serial, packet_space, fadc_board::packets, fadc_packet::src_addr, fadc_board::start_packet, fadc_board::start_packet_seen, fadc_board::stop_packet, and fadc_board::stop_packet_seen.
Referenced by new_fadc_poll_live(), and new_fadc_read().
void setReg | ( | char * | if_name, |
int | board, | ||
int | fadc, | ||
int | reg, | ||
unsigned long long | value, | ||
bool | acquire | ||
) |
Definition at line 236 of file new_fadc.cpp.
References board, packet_socket, printf(), and value.
Referenced by setupRegs().
void setupRegs | ( | ) |
Definition at line 296 of file new_fadc.cpp.
References board, crate_number, enabled, fadc_board::enabled, i, fadc_board::interface, max_boards, odb_find_key(), odb_get_bool(), odb_get_int(), printf(), setReg(), and sprintf().
Referenced by new_fadc_bor(), and new_fadc_pre_bor().
struct fadc_board board[max_boards] |
Definition at line 94 of file new_fadc.cpp.
Referenced by allPacketsReceived(), forgetPackets(), new_fadc_read(), receivePackets(), setReg(), and setupRegs().
bool frame_examined[NUM_FRAMES] |
Definition at line 40 of file new_fadc.cpp.
Referenced by forgetPackets(), and receivePackets().
const int FRAME_SIZE = 2048 |
Definition at line 36 of file new_fadc.cpp.
Referenced by forgetPackets(), new_fadc_pre_bor(), and receivePackets().
const int max_boards = 256 |
Definition at line 78 of file new_fadc.cpp.
Referenced by allPacketsReceived(), forgetPackets(), new_fadc_read(), and setupRegs().
struct readout_module new_fadc_module |
Definition at line 42 of file new_fadc.cpp.
const int NUM_FRAMES = 4096 |
Definition at line 37 of file new_fadc.cpp.
Referenced by forgetPackets(), new_fadc_pre_bor(), and receivePackets().
int packet_socket |
Definition at line 57 of file new_fadc.cpp.
Referenced by new_fadc_bor(), new_fadc_eor(), new_fadc_pre_bor(), receivePackets(), and setReg().
unsigned char* packet_space = 0 |
Definition at line 39 of file new_fadc.cpp.
Referenced by forgetPackets(), new_fadc_eor(), new_fadc_pre_bor(), and receivePackets().
const int TP_BLOCK_SIZE = 8192 |
Definition at line 34 of file new_fadc.cpp.
Referenced by new_fadc_eor(), and new_fadc_pre_bor().
const int TP_NUM_BLOCKS = 1024 |
Definition at line 35 of file new_fadc.cpp.
Referenced by new_fadc_eor(), and new_fadc_pre_bor().
|
static |
Definition at line 434 of file new_fadc.cpp.