cvt_board_commons.c File Reference

VME Board common features implementation. More...

#include <memory.h>
#include <string.h>
#include "cvt_board_commons.h"

Go to the source code of this file.

Functions

BOOL cvt_board_open (cvt_board_data *p_data, UINT16 base_address, long vme_handle, const cvt_reg_table *p_reg_table)
 Basic board open.
BOOL cvt_board_close (cvt_board_data *p_data)
 Basic board close.
BOOL cvt_write (cvt_board_data *p_data, UINT16 address, const void *p_value, CVAddressModifier am, CVDataWidth data_size)
 Writes a register onto VME board.
BOOL cvt_read (cvt_board_data *p_data, UINT16 address, void *p_value, CVAddressModifier am, CVDataWidth data_size)
 Reads a register from VME board.
BOOL cvt_set_bitmask (cvt_board_data *p_data, UINT16 address, void *p_value, CVAddressModifier am, CVDataWidth data_size)
 Sets bitmask onto VME board register.
BOOL cvt_clear_bitmask (cvt_board_data *p_data, UINT16 address, void *p_value, CVAddressModifier am, CVDataWidth data_size)
 Clears bitmask onto VME board register.
BOOL cvt_FIFO_BLT_read (cvt_board_data *p_data, UINT16 address, void *p_buffer, UINT32 buffer_size, UINT32 *p_read_bytes, CVAddressModifier am, CVDataWidth data_size)
 Performs a FIFO BLT read from VME board.
BOOL cvt_write_reg (cvt_board_data *p_data, UINT16 reg_index, const void *p_value)
 Writes a register onto VME board.
BOOL cvt_read_reg (cvt_board_data *p_data, UINT16 reg_index, void *p_value)
 Reads a register from VME board.
BOOL cvt_set_bitmask_reg (cvt_board_data *p_data, UINT16 reg_index, void *p_value)
 Sets bitmask onto VME board register.
BOOL cvt_clear_bitmask_reg (cvt_board_data *p_data, UINT16 reg_index, void *p_value)
 Clears bitmask onto VME board register.
BOOL cvt_FIFO_BLT_read_reg (cvt_board_data *p_data, UINT16 reg_index, void *p_buffer, UINT32 buffer_size, UINT32 *p_read_bytes)
 Performs a FIFO BLT read from VME board.
BOOL cvt_set_MCST_CBLT (UINT8 address, cvt_board_data **board_array, UINT16 board_array_len)
 Setups MCST/CBLT parameters for a group of boards.
const char * cvt_SW_rev (void)
 Returns library software release.


Detailed Description

VME Board common features implementation.

Author:
NDA
Version:
1.0
Date:
03/2006
VME boards common APIs: These APIs provide features common to every VME board.

Definition in file cvt_board_commons.c.


Function Documentation

BOOL cvt_board_close cvt_board_data p_data  ) 
 

Basic board close.

Provides basic handling for board closing, common to all the boards.

Parameters:
p_data Pointer to board data
Returns:
TRUE: board successfully closed
Note:
This API if typically called by derived boards during close procedure.

Definition at line 60 of file cvt_board_commons.c.

References TRUE.

Referenced by cvt_V1190_close(), cvt_V1495_close(), cvt_V1724_close(), cvt_V792_close(), and cvt_V812_close().

BOOL cvt_board_open cvt_board_data p_data,
UINT16  base_address,
long  vme_handle,
const cvt_reg_table p_reg_table
 

Basic board open.

Provides basic handling for board opening, common to all the boards.

Parameters:
p_data Pointer to board data
base_address The board base address (MSW)
vme_handle The VME handle
p_reg_table The board specific register table pointer
Returns:
TRUE: board successfully opened
Note:
This API if typically called by derived boards during open procedure.

Definition at line 46 of file cvt_board_commons.c.

References cvt_board_data::m_base_address, cvt_board_data::m_p_reg_table, cvt_board_data::m_vme_handle, and TRUE.

Referenced by cvt_V1190_open(), cvt_V1495_open(), cvt_V1724_open(), cvt_V792_open(), and cvt_V812_open().

BOOL cvt_clear_bitmask cvt_board_data p_data,
UINT16  address,
void *  p_value,
CVAddressModifier  am,
CVDataWidth  data_size
 

Clears bitmask onto VME board register.

Reads the actual register value, ANDs it with the complementary bitmask and write back to the register.

Parameters:
p_data Pointer to board data
address The register's board relative address
p_value The pointer to the mask to clear
am The address modifier
data_size The data size
Returns:
TRUE write procedure ok

Definition at line 152 of file cvt_board_commons.c.

References cvt_read(), cvt_write(), FALSE, and TRUE.

Referenced by cvt_clear_bitmask_reg(), cvt_V1190_clear_bitmask_control(), and cvt_V792_clear_bitmask_control_1().

BOOL cvt_clear_bitmask_reg cvt_board_data p_data,
UINT16  reg_index,
void *  p_value
 

Clears bitmask onto VME board register.

Reads the actual register value, ANDs it with the complementary bitmask and write back to the register. Register address, address modifier and data size will setted according to the specific board register table

Parameters:
p_data Pointer to board data
reg_index The register's board index : it must be a valid CVT_VXXXX_REG_INDEX
p_value The pointer to the mask to clear
Returns:
TRUE write procedure ok

Definition at line 242 of file cvt_board_commons.c.

References cvt_clear_bitmask(), cvt_reg_table::m_address, cvt_reg_table::m_am, cvt_reg_table::m_data_size, and cvt_board_data::m_p_reg_table.

Referenced by cvt_V1190_set_readout_mode(), cvt_V1190_set_trigger_matching_acquisition_mode(), cvt_V1724_set_readout_mode(), cvt_V792_set_channel_enable(), cvt_V792_set_readout_mode(), and cvt_V792_set_thresholds().

BOOL cvt_FIFO_BLT_read cvt_board_data p_data,
UINT16  address,
void *  p_buffer,
UINT32  buffer_size,
UINT32 p_read_bytes,
CVAddressModifier  am,
CVDataWidth  data_size
 

Performs a FIFO BLT read from VME board.

Reads a buffer of value at relative address, with specific address modifier and data size in FIFO BLT mode

Parameters:
p_data Pointer to board data
address The register's board relative address
p_buffer The pointer to target buffer
buffer_size The target buffer size (bytes)
p_read_bytes The number of bytes really read
am The address modifier
data_size The data size
Returns:
TRUE read procedure ok

Definition at line 198 of file cvt_board_commons.c.

References FALSE, cvt_board_data::m_base_address, cvt_board_data::m_vme_handle, TRACE, and TRUE.

Referenced by cvt_FIFO_BLT_read_reg(), cvt_V1190_read_MEB(), and cvt_V792_read_MEB().

BOOL cvt_FIFO_BLT_read_reg cvt_board_data p_data,
UINT16  reg_index,
void *  p_buffer,
UINT32  buffer_size,
UINT32 p_read_bytes
 

Performs a FIFO BLT read from VME board.

Reads a buffer of register values specified by register index. Register address, address modifier and data size will setted according to the specific board register table

Parameters:
p_data Pointer to board data
reg_index The register's board index : it must be a valid CVT_VXXXX_REG_INDEX
p_buffer The pointer to target buffer
buffer_size The target buffer size (bytes)
p_read_bytes The number of bytes really read
Returns:
TRUE read procedure ok

Definition at line 250 of file cvt_board_commons.c.

References cvt_FIFO_BLT_read(), cvt_reg_table::m_address, cvt_reg_table::m_am, cvt_reg_table::m_data_size, and cvt_board_data::m_p_reg_table.

Referenced by cvt_V1724_read_buffer().

BOOL cvt_read cvt_board_data p_data,
UINT16  address,
void *  p_value,
CVAddressModifier  am,
CVDataWidth  data_size
 

Reads a register from VME board.

Reads a value at relative address, with specific address modifier and data size

Parameters:
p_data Pointer to board data
address The register's board relative address
p_value The pointer to the value read
am The address modifier
data_size The data size
Returns:
TRUE read procedure ok

Definition at line 90 of file cvt_board_commons.c.

References FALSE, cvt_board_data::m_base_address, cvt_board_data::m_vme_handle, TRACE, and TRUE.

Referenced by cvt_clear_bitmask(), cvt_read_reg(), and cvt_set_bitmask().

BOOL cvt_read_reg cvt_board_data p_data,
UINT16  reg_index,
void *  p_value
 

Reads a register from VME board.

Reads a value a register specified by register index. Register address, address modifier and data size will setted according to the specific board register table

Parameters:
p_data Pointer to board data
reg_index The register's board index : it must be a valid CVT_VXXXX_REG_INDEX
p_value The pointer to the value read
Returns:
TRUE read procedure ok

Definition at line 226 of file cvt_board_commons.c.

References cvt_read(), cvt_reg_table::m_address, cvt_reg_table::m_am, cvt_reg_table::m_data_size, and cvt_board_data::m_p_reg_table.

Referenced by cvt_V1190_get_event_counter(), cvt_V1190_get_event_stored(), cvt_V1190_get_status(), cvt_V1190_get_system_info(), cvt_V1724_get_channel_status(), cvt_V1724_get_system_info(), cvt_V1724_read_buffer(), cvt_V792_get_ader_high(), cvt_V792_get_ader_low(), cvt_V792_get_control_1(), cvt_V792_get_event_counter(), cvt_V792_get_event_trigger(), cvt_V792_get_geo_address(), cvt_V792_get_interrupt_level(), cvt_V792_get_interrupt_vector(), cvt_V792_get_MCST_CBLT_address(), cvt_V792_get_MCST_CBLT_control(), cvt_V792_get_status(), cvt_V792_get_status_1(), cvt_V792_get_status_2(), cvt_V792_get_system_info(), cvt_V812_get_fixed_code(), cvt_V812_get_manufacturer_number(), cvt_V812_get_module_type(), cvt_V812_get_serial_number(), cvt_V812_get_version(), and vme_board_1190_write_2_micro().

BOOL cvt_set_bitmask cvt_board_data p_data,
UINT16  address,
void *  p_value,
CVAddressModifier  am,
CVDataWidth  data_size
 

Sets bitmask onto VME board register.

Reads the actual register value, ORs it with the bitmask and write back to the register.

Parameters:
p_data Pointer to board data
address The register's board relative address
p_value The pointer to the mask to set
am The address modifier
data_size The data size
Returns:
TRUE write procedure ok

Definition at line 106 of file cvt_board_commons.c.

References cvt_read(), cvt_write(), FALSE, and TRUE.

Referenced by cvt_set_bitmask_reg(), cvt_V1190_set_bitmask_control(), and cvt_V792_set_bitmask_control_1().

BOOL cvt_set_bitmask_reg cvt_board_data p_data,
UINT16  reg_index,
void *  p_value
 

Sets bitmask onto VME board register.

Reads the actual register value, ORs it with the bitmask and write back to the register. Register address, address modifier and data size will setted according to the specific board register table

Parameters:
reg_index The register's board index : it must be a valid CVT_VXXXX_REG_INDEX
p_data Pointer to board data
p_value The pointer to the mask to set
Returns:
TRUE write procedure ok

Definition at line 234 of file cvt_board_commons.c.

References cvt_set_bitmask(), cvt_reg_table::m_address, cvt_reg_table::m_am, cvt_reg_table::m_data_size, and cvt_board_data::m_p_reg_table.

Referenced by cvt_V1190_set_readout_mode(), cvt_V1190_set_trigger_matching_acquisition_mode(), cvt_V1724_set_dither_enable(), cvt_V1724_set_readout_mode(), cvt_V792_set_readout_mode(), and cvt_V792_set_thresholds().

BOOL cvt_set_MCST_CBLT UINT8  address,
cvt_board_data **  board_array,
UINT16  board_array_len
 

Setups MCST/CBLT parameters for a group of boards.

Setups the relevant parameters for MCST/CBLT usage for a collection of boards.

Parameters:
address The MCST/CBLT address common to each board of the group
board_array The collection of boards to setup. The first board in the chain is board_array[0], and the last one is board_array[ board_array_len-1]
board_array_len The number of boards into board_array buffer.
Returns:
TRUE: Procedure successfully executed

Definition at line 264 of file cvt_board_commons.c.

References FALSE, MCST_CBLT_board_pos_first, MCST_CBLT_board_pos_last, MCST_CBLT_board_pos_mid, TRACE1, and TRUE.

const char * cvt_SW_rev void   ) 
 

Returns library software release.

Returns:
const char*: The library revision string

Definition at line 292 of file cvt_board_commons.c.

BOOL cvt_write cvt_board_data p_data,
UINT16  address,
const void *  p_value,
CVAddressModifier  am,
CVDataWidth  data_size
 

Writes a register onto VME board.

Writes a value at relative address, with specific address modifier and data size

Parameters:
p_data Pointer to board data
address The register's board relative address
p_value The pointer to the value to write
am The address modifier
data_size The data size
Returns:
TRUE write procedure ok

Definition at line 74 of file cvt_board_commons.c.

References FALSE, cvt_board_data::m_base_address, cvt_board_data::m_vme_handle, TRACE, and TRUE.

Referenced by cvt_clear_bitmask(), cvt_set_bitmask(), cvt_V1724_read_buffer(), and cvt_write_reg().

BOOL cvt_write_reg cvt_board_data p_data,
UINT16  reg_index,
const void *  p_value
 

Writes a register onto VME board.

Writes a value to a register specified by register index. Register address, address modifier and data size will setted according to the specific board register table

Parameters:
p_data Pointer to board data
reg_index The register's board index : it must be a valid CVT_VXXXX_REG_INDEX
p_value The pointer to the value to write
Returns:
TRUE write procedure ok

Definition at line 218 of file cvt_board_commons.c.

References cvt_write(), cvt_reg_table::m_address, cvt_reg_table::m_am, cvt_reg_table::m_data_size, and cvt_board_data::m_p_reg_table.

Referenced by cvt_V1190_data_clear(), cvt_V1190_module_reset(), cvt_V1190_set_almost_full(), cvt_V1190_set_interrupt(), cvt_V1190_set_MCST_CBLT(), cvt_V1190_set_readout_mode(), cvt_V1495_set_control(), cvt_V1495_set_port_A_enable(), cvt_V1495_set_port_B_enable(), cvt_V1495_set_port_D_enable(), cvt_V1724_data_clear(), cvt_V1724_set_acquisition_mode(), cvt_V1724_set_channel_trigger(), cvt_V1724_set_interrupt(), cvt_V1724_set_MCST_CBLT(), cvt_V1724_set_readout_mode(), cvt_V1724_set_trigger_mode(), cvt_V1724_software_reset(), cvt_V1724_software_trigger(), cvt_V792_data_clear(), cvt_V792_set_acquisition_mode(), cvt_V792_set_ader_high(), cvt_V792_set_ader_low(), cvt_V792_set_bit_clear_1(), cvt_V792_set_bit_clear_2(), cvt_V792_set_bit_set_1(), cvt_V792_set_bit_set_2(), cvt_V792_set_control_1(), cvt_V792_set_crate_number(), cvt_V792_set_event_counter(), cvt_V792_set_event_trigger(), cvt_V792_set_fast_clear_window(), cvt_V792_set_geo_address(), cvt_V792_set_interrupt(), cvt_V792_set_interrupt_level(), cvt_V792_set_interrupt_vector(), cvt_V792_set_MCST_CBLT(), cvt_V792_set_MCST_CBLT_address(), cvt_V792_set_MCST_CBLT_control(), cvt_V792_set_MEB(), cvt_V792_set_overflow_suppression(), cvt_V792_set_pedestal(), cvt_V792_set_sliding_scale(), cvt_V792_set_threshold(), cvt_V792_set_zero_suppression(), cvt_V792_single_shot_reset(), cvt_V792_software_reset(), cvt_V812_set_dead_time(), cvt_V812_set_majority_threshold(), cvt_V812_set_output_width(), cvt_V812_set_pattern_inhibit(), cvt_V812_set_test_pulse(), cvt_V812_set_threshold(), and vme_board_1190_write_2_micro().


Generated on Wed Oct 18 12:36:55 2006 for CAEVMEToolLib by  doxygen 1.4.6-NO