#include <memory.h>
#include <string.h>
#include "cvt_V1190.h"
Go to the source code of this file.
Defines | |
#define | V1190_DATA_TYPE_MSK 0xf8000000 |
Data type bit masks. | |
#define | V1190_GLOBAL_HEADER 0x40000000 |
Global header data type. | |
#define | V1190_GLOBAL_TRAILER 0x80000000 |
Global trailer data type. | |
#define | V1190_TDC_HEADER 0x08000000 |
TDC header data type. | |
#define | V1190_TDC_MEASURE 0x00000000 |
TDC measure data type. | |
#define | V1190_TDC_ERROR 0x20000000 |
TDC error data type. | |
#define | V1190_TDC_TRAILER 0x18000000 |
TDC trailer data type. | |
#define | V1190_GLOBAL_TRIGGER_TIME 0x88000000 |
Global trigger tag time data type. | |
#define | V1190_FILLER 0xc0000000 |
Filler data type. | |
#define | IS_GLOBAL_HEADER(data) ((data& V1190_DATA_TYPE_MSK)== V1190_GLOBAL_HEADER) |
Checks if data type is global header. | |
#define | IS_GLOBAL_TRAILER(data) ((data& V1190_DATA_TYPE_MSK)== V1190_GLOBAL_TRAILER) |
Checks if data type is global trailer. | |
#define | IS_TDC_HEADER(data) ((data& V1190_DATA_TYPE_MSK)== V1190_TDC_HEADER) |
Checks if data type is TDC header. | |
#define | IS_TDC_MEASURE(data) ((data& V1190_DATA_TYPE_MSK)== V1190_TDC_MEASURE) |
Checks if data type is TDC measure. | |
#define | IS_TDC_ERROR(data) ((data& V1190_DATA_TYPE_MSK)== V1190_TDC_ERROR) |
Checks if data type is TDC error. | |
#define | IS_TDC_TRAILER(data) ((data& V1190_DATA_TYPE_MSK)== V1190_TDC_TRAILER) |
Checks if data type is TDC trailer. | |
#define | IS_GLOBAL_TRIGGER_TIME(data) ((data& V1190_DATA_TYPE_MSK)== V1190_GLOBAL_TRIGGER_TIME) |
Checks if data type is global trigger time. | |
#define | IS_FILLER(data) ((data& V1190_DATA_TYPE_MSK)== V1190_FILLER) |
Checks if data type is filler. | |
#define | GET_EVENT_COUNT(data) ((UINT32)((((UINT32)data)>>5)& 0x003fffff)) |
Gets the event counter of this event. | |
Functions | |
BOOL | cvt_V1190_open (cvt_V1190_data *p_data, UINT16 base_address, long vme_handle, CVT_V1190_TYPES type) |
V1494 VME boards data initialization. | |
BOOL | cvt_V1190_close (cvt_V1190_data *p_data) |
V1190 VME boards closing and resource free. | |
BOOL | vme_board_1190_write_2_micro (cvt_V1190_data *p_data, UINT16 ope_code, const UINT16 *p_params, int num_params) |
Writes an opcode to V1190 micro register. | |
BOOL | cvt_V1190_set_bitmask_control (cvt_V1190_data *p_data, CVT_V1190_CONTROL_MSK value) |
Set a bitmask to control register. | |
BOOL | cvt_V1190_clear_bitmask_control (cvt_V1190_data *p_data, CVT_V1190_CONTROL_MSK value) |
Clear a bitmask to control 1 register. | |
BOOL | cvt_V1190_set_windows_width (cvt_V1190_data *p_data, UINT16 value) |
Set the window width. | |
BOOL | cvt_V1190_set_windows_offset (cvt_V1190_data *p_data, UINT16 value) |
Set the window offset. | |
BOOL | cvt_V1190_get_enable_pattern (cvt_V1190_data *p_data, UINT16 *p_enable_msk) |
Get the channel enable pattern. | |
BOOL | cvt_V1190_set_trigger_match (cvt_V1190_data *p_data) |
Set the trigger matching mode. | |
BOOL | cvt_V1190_set_head_trail_enable (cvt_V1190_data *p_data) |
Enable TDC Header and Trailer in readout. | |
BOOL | cvt_V1190_set_head_trail_disable (cvt_V1190_data *p_data) |
Disable TDC Header and Trailer in readout. | |
BOOL | cvt_V1190_read_MEB (cvt_V1190_data *p_data, void *p_buff, UINT32 *p_buff_size) |
Reads data from the Multiple event buffer and stores to user buffer. | |
BOOL | cvt_V1190_set_continuous_acquisition_mode (cvt_V1190_data *p_data, CVT_V1190_EDGE_DETECTION_ENUM edge_detection, CVT_V1190_PAIR_RES_WIDTH_ENUM res_width, const UINT16 *p_enable_msk) |
Enable and setups the continuous acquisition mode. | |
BOOL | cvt_V1190_set_trigger_matching_acquisition_mode (cvt_V1190_data *p_data, UINT16 window_width, UINT16 window_offset, UINT16 extra_search_margin, UINT16 reject_margin, CVT_V1190_EDGE_DETECTION_ENUM edge_detection, CVT_V1190_PAIR_RES_WIDTH_ENUM res_width, const UINT16 *p_enable_msk, BOOL header_trailer_enable, BOOL empty_event_enable, BOOL trigger_time_tag_enable) |
Enable and setups the trigger matching mode. | |
BOOL | cvt_V1190_set_interrupt (cvt_V1190_data *p_data, UINT8 level, UINT8 vector) |
Setups interrupt parameters. | |
BOOL | cvt_V1190_set_readout_mode (cvt_V1190_data *p_data, BOOL bus_error_enable, BOOL align64_enable, UINT8 blt_event_number) |
Setups data readout mode parameters. | |
BOOL | cvt_V1190_get_status (cvt_V1190_data *p_data, BOOL *p_is_data_ready, BOOL *p_is_term_on, BOOL *p_is_buffer_full, BOOL *p_is_buffer_almost_full, CVT_V1190_STATUS_RES *p_resolution, UINT8 *p_error_bitmask) |
Gets information about board status. | |
BOOL | cvt_V1190_get_event_counter (cvt_V1190_data *p_data, UINT32 *p_counter) |
Gets the event counter value. | |
BOOL | cvt_V1190_get_event_stored (cvt_V1190_data *p_data, UINT16 *p_counter) |
Gets the event stored value. | |
BOOL | cvt_V1190_get_system_info (cvt_V1190_data *p_data, UINT16 *p_firmware_rev, UINT16 *p_tdc_id_buff, UINT16 *p_micro_firmware_rev, UINT16 *p_serial_number) |
Gets board's system information. | |
BOOL | cvt_V1190_data_clear (cvt_V1190_data *p_data) |
Performs the data clear. | |
BOOL | cvt_V1190_module_reset (cvt_V1190_data *p_data) |
Performs the module reset. | |
BOOL | cvt_V1190_set_channel_enable (cvt_V1190_data *p_data, const UINT16 *p_enable_msk) |
Set the channel enable mask. | |
BOOL | cvt_V1190_set_almost_full (cvt_V1190_data *p_data, UINT16 almost_full_value) |
Sets the almost full level register. | |
BOOL | cvt_V1190_peek_event (cvt_V1190_data *p_data, UINT32 *out_buff, long *p_out_buff_size, UINT32 *p_event_count) |
Tries to peek (i.e. copy but not removing) an event from queue and save data to output buffer. | |
BOOL | cvt_V1190_inqueue (cvt_V1190_data *p_data, const UINT32 *in_buff, UINT32 in_buff_size) |
Tries to put in_buff_size data word to queue. | |
BOOL | cvt_V1190_dequeue (cvt_V1190_data *p_data, UINT32 *out_buff, UINT32 out_buff_size) |
Tries to get out_buff_size data word from the queue. | |
long | cvt_V1190_get_queue_free (cvt_V1190_data *p_data) |
Gets the number of free queue space (words). | |
long | cvt_V1190_get_queue_length (cvt_V1190_data *p_data) |
Gets the queue length. | |
BOOL | cvt_V1190_set_MCST_CBLT (cvt_V1190_data *p_data, UINT8 address, MCST_CBLT_board_pos pos) |
Setups MCST/CBLT parameters this board. |
Definition in file cvt_V1190.c.
|
Clear a bitmask to control 1 register. Clears the bits of the bitmask into the register. The inverted bitmask is ANDed to the actual regiter content
Definition at line 275 of file cvt_V1190.c. References cvt_clear_bitmask(), CVT_V1190_CONTROL_ADD, CVT_V1190_CONTROL_AM, CVT_V1190_CONTROL_DATA_SIZE, FALSE, cvt_V1190_data::m_common_data, TRACE, and TRUE. |
|
V1190 VME boards closing and resource free. Provides specific handling for V1190 boards closing.
Definition at line 157 of file cvt_V1190.c. References cvt_board_close(), FALSE, cvt_V1190_data::m_common_data, cvt_V1190_data::m_queue, and TRUE. |
|
Performs the data clear. Writes a dummy value to the software clear register.
Definition at line 848 of file cvt_V1190.c. References CVT_V1190_SW_CLEAR_INDEX, cvt_write_reg(), FALSE, cvt_V1190_data::m_common_data, TRACE, and TRUE. |
|
Tries to get out_buff_size data word from the queue. Checks for queue available data words and gets data beginning from m_queue_ini. m_queue_ini will be update: if out_buff!= NULL the data will be stored into it.
Definition at line 1061 of file cvt_V1190.c. References cvt_V1190_get_queue_length(), CVT_V1190_QUEUE_SIZE_DWORD, FALSE, cvt_V1190_data::m_queue, cvt_V1190_data::m_queue_ini, and TRUE. Referenced by cvt_V1190_peek_event(). |
|
Get the channel enable pattern. < The board is V1190A < The board is V1190B Definition at line 324 of file cvt_V1190.c. References CVT_V1190_NUM_TDC_A, CVT_V1190_NUM_TDC_B, CVT_V1190_TYPE_A, CVT_V1190_TYPE_B, CVT_V1190_WRITE_EN_PATTERN_OPCODE, FALSE, cvt_V1190_data::m_type, TRACE, TRACE1, and TRUE. |
|
Gets the event counter value. Gets the event counter actual value.
Definition at line 747 of file cvt_V1190.c. References cvt_read_reg(), CVT_V1190_EVENT_COUNTER_INDEX, FALSE, cvt_V1190_data::m_common_data, TRACE, and TRUE. |
|
Gets the event stored value. Gets the event stored actual value.
Definition at line 765 of file cvt_V1190.c. References cvt_read_reg(), CVT_V1190_EVENT_STORED_INDEX, FALSE, cvt_V1190_data::m_common_data, TRACE, and TRUE. |
|
Gets the number of free queue space (words).
Definition at line 1095 of file cvt_V1190.c. References CVT_V1190_QUEUE_SIZE_DWORD, cvt_V1190_data::m_queue_end, and cvt_V1190_data::m_queue_ini. Referenced by cvt_V1190_inqueue(). |
|
Gets the queue length.
Definition at line 1103 of file cvt_V1190.c. References CVT_V1190_QUEUE_SIZE_DWORD, cvt_V1190_data::m_queue_end, and cvt_V1190_data::m_queue_ini. Referenced by cvt_V1190_dequeue(). |
|
Gets information about board status.
Definition at line 723 of file cvt_V1190.c. References cvt_read_reg(), CVT_V1190_GET_STATUS_ERROR, CVT_V1190_GET_STATUS_RES, CVT_V1190_STATUS_INDEX, CVT_V1190_STS_ALMOST_FULL_MSK, CVT_V1190_STS_DREADY_MSK, CVT_V1190_STS_FULL_MSK, CVT_V1190_STS_TERM_ON_MSK, FALSE, cvt_V1190_data::m_common_data, TRACE, and TRUE. |
|
Gets board's system information. < The board is V1190A < The board is V1190B Definition at line 784 of file cvt_V1190.c. References cvt_read_reg(), CVT_V1190_FW_REV_INDEX, CVT_V1190_NUM_TDC_A, CVT_V1190_NUM_TDC_B, CVT_V1190_READ_TDC_ID_OPCODE, CVT_V1190_TYPE_A, CVT_V1190_TYPE_B, FALSE, cvt_V1190_data::m_common_data, cvt_V1190_data::m_type, TRACE, TRACE1, and vme_board_1190_write_2_micro(). |
|
Tries to put in_buff_size data word to queue. Checks for the queue available free words and stores data beginning from m_queue_end. m_queue_end will be update
Definition at line 1033 of file cvt_V1190.c. References cvt_V1190_get_queue_free(), CVT_V1190_QUEUE_SIZE_DWORD, FALSE, cvt_V1190_data::m_queue, cvt_V1190_data::m_queue_end, and TRUE. |
|
Performs the module reset. Writes a dummy value to the module reset register.
Definition at line 863 of file cvt_V1190.c. References CVT_V1190_MOD_RESET_INDEX, cvt_write_reg(), FALSE, cvt_V1190_data::m_common_data, TRACE, and TRUE. |
|
V1494 VME boards data initialization. < The board is V1190A < The board is V1190B Definition at line 121 of file cvt_V1190.c. References cvt_board_open(), CVT_V1190_QUEUE_SIZE_DWORD, cvt_V1190_set_MCST_CBLT(), CVT_V1190_TYPE_A, CVT_V1190_TYPE_B, FALSE, cvt_V1190_data::m_common_data, cvt_V1190_data::m_queue, cvt_V1190_data::m_type, cvt_board_data::set_MCST_CBLT, TRACE, TRACE1, and TRUE. |
|
Tries to peek (i.e. copy but not removing) an event from queue and save data to output buffer. Scans the queue beginning from m_queue_ini, searching for an event block: spurious data will be skipped. If first available event count matches requested event_count, data will be saved to output stream. If first available event count is minor than requested event_count event will be skipped and procedure repeated. If first available event count is major than requested event_count no data will be saved on out_stream (in_stream pointer not affected).
Definition at line 924 of file cvt_V1190.c. References CVT_BOARD_EVENT_COUNT_MSK, cvt_V1190_dequeue(), CVT_V1190_QUEUE_SIZE_DWORD, FALSE, GET_EVENT_COUNT, IS_GLOBAL_HEADER, IS_GLOBAL_TRAILER, cvt_V1190_data::m_queue, cvt_V1190_data::m_queue_end, cvt_V1190_data::m_queue_ini, TRACE1, and TRUE. |
|
Reads data from the Multiple event buffer and stores to user buffer. Call cvt_FIFO_BLT_read for Multiple event buffer and stores data into user buffer. If the returned data is just a V1190 filler, this is discarded.
Definition at line 393 of file cvt_V1190.c. References cvt_FIFO_BLT_read(), CVT_V1190_OUT_BUFFER_ADD, CVT_V1190_OUT_BUFFER_AM, CVT_V1190_OUT_BUFFER_DATA_SIZE, FALSE, IS_FILLER, cvt_V1190_data::m_common_data, and TRUE. |
|
Sets the almost full level register. Writes the specified value into the almost full level register. This Register allows the User to set the Almost Full Level of the Output Buffer. When the Output Buffer contains a number of words at least equal to the Almost Full Level, then an Interrupt Request (IRQ) is generated (if enabled) and the related bit in the Status Register is set.
Definition at line 906 of file cvt_V1190.c. References CVT_V1190_ALMOST_FULL_LVL_INDEX, cvt_write_reg(), FALSE, cvt_V1190_data::m_common_data, TRACE, and TRUE. |
|
Set a bitmask to control register. Sets the bits of the bitmask into the register. The bitmask is ORed to the actual regiter content
Definition at line 260 of file cvt_V1190.c. References cvt_set_bitmask(), CVT_V1190_CONTROL_ADD, CVT_V1190_CONTROL_AM, CVT_V1190_CONTROL_DATA_SIZE, FALSE, cvt_V1190_data::m_common_data, TRACE, and TRUE. |
|
Set the channel enable mask. < The board is V1190A < The board is V1190B Definition at line 877 of file cvt_V1190.c. References CVT_V1190_NUM_TDC_A, CVT_V1190_NUM_TDC_B, CVT_V1190_TYPE_A, CVT_V1190_TYPE_B, CVT_V1190_WRITE_EN_PATTERN_OPCODE, FALSE, cvt_V1190_data::m_type, TRACE, TRACE1, TRUE, and vme_board_1190_write_2_micro(). Referenced by cvt_V1190_set_continuous_acquisition_mode(), and cvt_V1190_set_trigger_matching_acquisition_mode(). |
|
Enable and setups the continuous acquisition mode. < Pair mode. < Trailing only. < Leading only. < Trailing and Leading. < 100 ps. < 200 ps. < 400 ps. < 800 ps. < 1.6 ns. < 3.12 ns. < 6.25 ns. < 12.5 ns. < 25 ns. < 50 ns. < 100 ns. < 200 ns. < 400 ns. < 800 ns. Definition at line 411 of file cvt_V1190.c. References CVT_V1190_CONT_STORE_OPCODE, CVT_V1190_ED_LEADING_ONLY, CVT_V1190_ED_PAIR_MODE, CVT_V1190_ED_TRAILING_AND_LEADING, CVT_V1190_ED_TRAILING_ONLY, CVT_V1190_PRW_100NS, CVT_V1190_PRW_100PS, CVT_V1190_PRW_12_5NS, CVT_V1190_PRW_1_6NS, CVT_V1190_PRW_200NS, CVT_V1190_PRW_200PS, CVT_V1190_PRW_25NS, CVT_V1190_PRW_3_12NS, CVT_V1190_PRW_400NS, CVT_V1190_PRW_400PS, CVT_V1190_PRW_50NS, CVT_V1190_PRW_6_25NS, CVT_V1190_PRW_800NS, CVT_V1190_PRW_800PS, cvt_V1190_set_channel_enable(), CVT_V1190_SET_DETECTION_OPCODE, CVT_V1190_SET_PAIR_RES_OPCODE, CVT_V1190_SET_PAIR_RES_WITH, FALSE, TRACE, TRACE1, TRUE, and vme_board_1190_write_2_micro(). |
|
Disable TDC Header and Trailer in readout. Writes through micro register opcode to disable TDC Header and Trailer in readout.
Definition at line 380 of file cvt_V1190.c. References CVT_V1190_DIS_HEAD_TRAILER_OPCODE, FALSE, TRACE, TRUE, and vme_board_1190_write_2_micro(). |
|
Enable TDC Header and Trailer in readout. Writes through micro register opcode to enable TDC Header and Trailer in readout.
Definition at line 367 of file cvt_V1190.c. References CVT_V1190_EN_HEAD_TRAILER_OPCODE, FALSE, TRACE, TRUE, and vme_board_1190_write_2_micro(). |
|
Setups interrupt parameters. Setups the relevant parameters for interrupt usage.
Definition at line 640 of file cvt_V1190.c. References CVT_V1190_INT_LEVEL_INDEX, CVT_V1190_INT_VECTOR_INDEX, cvt_write_reg(), FALSE, cvt_V1190_data::m_common_data, TRACE, and TRUE. |
|
Setups MCST/CBLT parameters this board. Setups the relevant parameters for MCST/CBLT usage.
Definition at line 1111 of file cvt_V1190.c. References CVT_V1190_MCCTRL_FIRST_BOARD_MSK, CVT_V1190_MCCTRL_LAST_BOARD_MSK, CVT_V1190_MCCTRL_MID_BOARD_MSK, CVT_V1190_MCST_CBLT_ADDRESS_INDEX, CVT_V1190_MCST_CBLT_CTRL_INDEX, cvt_write_reg(), FALSE, cvt_V1190_data::m_common_data, MCST_CBLT_board_pos_first, MCST_CBLT_board_pos_last, MCST_CBLT_board_pos_mid, TRACE, TRACE1, and TRUE. Referenced by cvt_V1190_open(). |
|
Setups data readout mode parameters. Setups the relevant parameters for data readout.
Definition at line 671 of file cvt_V1190.c. References cvt_clear_bitmask_reg(), cvt_set_bitmask_reg(), CVT_V1190_BLT_EVENT_NUM_INDEX, CVT_V1190_CONTROL_INDEX, CVT_V1190_CTRL_ALIGN64_MSK, CVT_V1190_CTRL_BERR_ENABLE_MSK, cvt_write_reg(), FALSE, cvt_V1190_data::m_common_data, TRACE, and TRUE. |
|
Set the trigger matching mode. Writes dummy value through micro register opcode to set the trigger matching mode.
Definition at line 354 of file cvt_V1190.c. References CVT_V1190_TRG_MATCH_OPCODE, FALSE, TRACE, TRUE, and vme_board_1190_write_2_micro(). |
|
|
Set the window offset. Writes the specified value through micro register opcode.
Definition at line 310 of file cvt_V1190.c. References CVT_V1190_SET_WIN_OFFSET_OPCODE, FALSE, TRACE, TRUE, and vme_board_1190_write_2_micro(). |
|
Set the window width. Writes the specified value through micro register opcode.
Definition at line 296 of file cvt_V1190.c. References CVT_V1190_SET_WIN_WIDTH_OPCODE, FALSE, TRACE, TRUE, and vme_board_1190_write_2_micro(). |
|
Writes an opcode to V1190 micro register. Writes an opcode to V1190 micro register and the specified number of parameters. Handles all the necessary handshake with micro to get the job done.
Definition at line 184 of file cvt_V1190.c. References cvt_read_reg(), CVT_V1190_MICRO_HND_INDEX, CVT_V1190_MICRO_HND_WRITEOK_MSK, CVT_V1190_MICRO_INDEX, cvt_write_reg(), FALSE, cvt_V1190_data::m_common_data, and TRUE. Referenced by cvt_V1190_get_system_info(), cvt_V1190_set_channel_enable(), cvt_V1190_set_continuous_acquisition_mode(), cvt_V1190_set_head_trail_disable(), cvt_V1190_set_head_trail_enable(), cvt_V1190_set_trigger_match(), cvt_V1190_set_trigger_matching_acquisition_mode(), cvt_V1190_set_windows_offset(), and cvt_V1190_set_windows_width(). |