N1568.c File Reference

N1568 NIM board implementation. More...

#include <string.h>
#include <memory.h>
#include <stdlib.h>
#include "N1568.h"

Go to the source code of this file.

Functions

BOOL N1568_open (N1568_data *p_data, const char *com_str)
 N1568 boards data initialization.
BOOL N1568_close (N1568_data *p_data)
 N1568 boards closing and resource free.
const char * N1568_get_last_answer (N1568_data *p_data)
 Get the answer to the last successfull sent command.
DLL_API BOOL N1568_send_cmd (N1568_data *p_data, N1568_COMMANDS cmd, UINT8 value, N1568_channel_status *channel_status)
 Sends the command to the current channel and gets the channel status.
BOOL N1568_set_module (N1568_data *p_data, UINT8 value)
 Set the current module.
BOOL N1568_set_channel (N1568_data *p_data, UINT8 value, N1568_channel_status *channel_status)
 Set the current channel id.
BOOL N1568_set_input_polarity (N1568_data *p_data, BOOL negative_polarity, N1568_channel_status *channel_status)
 Set the input polarity for the current channel.
BOOL N1568_set_shape (N1568_data *p_data, UINT8 value, N1568_channel_status *channel_status)
 Set the shaping time for the current channel.
BOOL N1568_set_pole_zero_adj (N1568_data *p_data, UINT8 value, N1568_channel_status *channel_status)
 Set the pole zero adjust value for the current channel.
BOOL N1568_set_fine_gain (N1568_data *p_data, UINT8 value, N1568_channel_status *channel_status)
 Set the fine gain value for the current channel.
BOOL N1568_set_coarse_gain (N1568_data *p_data, UINT8 value, N1568_channel_status *channel_status)
 Set the coarse gain value for the current channel.
BOOL N1568_set_discr_thr (N1568_data *p_data, UINT8 value, N1568_channel_status *channel_status)
 Set the discriminator threshold value for the current channel.
BOOL N1568_set_gain_of_timing (N1568_data *p_data, UINT8 value, N1568_channel_status *channel_status)
 Set the gain of the timing section value for the current channel.
BOOL N1568_set_stretcher (N1568_data *p_data, BOOL enable, N1568_channel_status *channel_status)
 Enable/Disable the stretcher for the current channel.
BOOL N1568_set_cfd_out_width (N1568_data *p_data, UINT8 value, N1568_channel_status *channel_status)
 Set the CFD30% Out Width value for the current channel.
BOOL N1568_export (N1568_data *p_data)
 This command allows to copy settings from Ch0 to all other channels.
const char * N1568_SW_rev (void)
 Returns the SDK software release.


Detailed Description

N1568 NIM board implementation.

Author:
NDA
Version:
1.0
Date:
09/2008
Provides methods, properties and defines to handle N1568 NIM boards

Definition in file N1568.c.


Function Documentation

BOOL N1568_close ( N1568_data p_data  ) 

N1568 boards closing and resource free.

Provides specific handling for N1568 boards closing.

Parameters:
p_data Pointer to board data
Returns:
TRUE: board successfully closed
Note:
Must be called when done with any other board specific API.

Definition at line 155 of file N1568.c.

References board_close(), FALSE, N1568_data::m_common_data, N1568_data::m_p_asw_buff, N1568_data::m_p_tmp_asw_buff, and TRUE.

BOOL N1568_export ( N1568_data p_data  ) 

This command allows to copy settings from Ch0 to all other channels.

Parameters:
p_data Pointer to board data
Returns:
TRUE: operation successfully completed

Definition at line 344 of file N1568.c.

References FALSE, N1568_data::m_asw_buff_len, N1568_data::m_common_data, N1568_data::m_p_asw_buff, N1568_CMD_EXP, receive_buffer(), send_cmd(), and TRUE.

const char * N1568_get_last_answer ( N1568_data p_data  ) 

Get the answer to the last successfull sent command.

Parameters:
p_data Pointer to board data
Returns:
The answer buffer

Definition at line 183 of file N1568.c.

References N1568_data::m_asw_buff_len, N1568_data::m_p_asw_buff, and N1568_data::m_p_tmp_asw_buff.

BOOL N1568_open ( N1568_data p_data,
const char *  com_str 
)

N1568 boards data initialization.

Provides specific handling for N1568 boards opening.

Parameters:
p_data Pointer to board data
com_str The serial communication device string to open e.g COM1.. COM# for Windows or /dev/ttyS0.. /dev/ttyS# or /dev/ttyUSB0.. /dev/ttyUSB# for Linux
Returns:
TRUE: board successfully opened
Note:
Must be called before any other board specific API.

Definition at line 113 of file N1568.c.

References board_open(), FALSE, N1568_data::m_asw_buff_len, N1568_data::m_common_data, N1568_data::m_p_asw_buff, N1568_data::m_p_tmp_asw_buff, and TRUE.

BOOL N1568_send_cmd ( N1568_data p_data,
N1568_COMMANDS  cmd,
UINT8  value,
N1568_channel_status channel_status 
)

Sends the command to the current channel and gets the channel status.

Parameters:
p_data Pointer to board data
cmd The command id
value The command value
channel_status The channels status after the command execution. This parameter may be NULL (no channel status returned)
Returns:
TRUE: operation successfully completed

Definition at line 203 of file N1568.c.

References FALSE, N1568_data::m_asw_buff_len, N1568_data::m_common_data, N1568_data::m_p_asw_buff, receive_buffer(), send_cmd(), and TRUE.

Referenced by N1568_set_cfd_out_width(), N1568_set_channel(), N1568_set_coarse_gain(), N1568_set_discr_thr(), N1568_set_fine_gain(), N1568_set_gain_of_timing(), N1568_set_input_polarity(), N1568_set_pole_zero_adj(), N1568_set_shape(), and N1568_set_stretcher().

BOOL N1568_set_cfd_out_width ( N1568_data p_data,
UINT8  value,
N1568_channel_status channel_status 
)

Set the CFD30% Out Width value for the current channel.

Parameters:
p_data Pointer to board data
value The desired CFD30% Out Width value
channel_status The channels status after the command execution. This parameter may be NULL (no channel status returned)
Returns:
TRUE: operation successfully completed

Definition at line 336 of file N1568.c.

References N1568_CMD_CFW, and N1568_send_cmd().

BOOL N1568_set_channel ( N1568_data p_data,
UINT8  value,
N1568_channel_status channel_status 
)

Set the current channel id.

Any other command will direct to this channel

Parameters:
p_data Pointer to board data
value The channel id: valid values are [0..15]
channel_status The channels status after the command execution. This parameter may be NULL (no channel status returned)
Returns:
TRUE: operation successfully completed

Definition at line 264 of file N1568.c.

References N1568_CMD_CH, and N1568_send_cmd().

BOOL N1568_set_coarse_gain ( N1568_data p_data,
UINT8  value,
N1568_channel_status channel_status 
)

Set the coarse gain value for the current channel.

Parameters:
p_data Pointer to board data
value The desired coarse gain value
channel_status The channels status after the command execution. This parameter may be NULL (no channel status returned)
Returns:
TRUE: operation successfully completed

Definition at line 304 of file N1568.c.

References N1568_CMD_CG, and N1568_send_cmd().

BOOL N1568_set_discr_thr ( N1568_data p_data,
UINT8  value,
N1568_channel_status channel_status 
)

Set the discriminator threshold value for the current channel.

Parameters:
p_data Pointer to board data
value The desired discriminator threshold value
channel_status The channels status after the command execution. This parameter may be NULL (no channel status returned)
Returns:
TRUE: operation successfully completed

Definition at line 312 of file N1568.c.

References N1568_CMD_CF_TH, and N1568_send_cmd().

BOOL N1568_set_fine_gain ( N1568_data p_data,
UINT8  value,
N1568_channel_status channel_status 
)

Set the fine gain value for the current channel.

Parameters:
p_data Pointer to board data
value The desired fine gain value
channel_status The channels status after the command execution. This parameter may be NULL (no channel status returned)
Returns:
TRUE: operation successfully completed

Definition at line 296 of file N1568.c.

References N1568_CMD_FG, and N1568_send_cmd().

BOOL N1568_set_gain_of_timing ( N1568_data p_data,
UINT8  value,
N1568_channel_status channel_status 
)

Set the gain of the timing section value for the current channel.

Parameters:
p_data Pointer to board data
value The desired gain of the timing section value
channel_status The channels status after the command execution. This parameter may be NULL (no channel status returned)
Returns:
TRUE: operation successfully completed

Definition at line 320 of file N1568.c.

References N1568_CMD_CGT, and N1568_send_cmd().

BOOL N1568_set_input_polarity ( N1568_data p_data,
BOOL  negative_polarity,
N1568_channel_status channel_status 
)

Set the input polarity for the current channel.

Parameters:
p_data Pointer to board data
negative_polarity The desired input polarity: Set to TRUE for negative input polarity
channel_status The channels status after the command execution. This parameter may be NULL (no channel status returned)
Returns:
TRUE: operation successfully completed

Definition at line 272 of file N1568.c.

References N1568_CMD_IN, and N1568_send_cmd().

BOOL N1568_set_module ( N1568_data p_data,
UINT8  value 
)

Set the current module.

Any other command will direct to this module

Parameters:
p_data Pointer to board data
value The module id: valid values are [0..16]. 16 is the broadcast module.
Returns:
TRUE: operation successfully completed

Definition at line 241 of file N1568.c.

References FALSE, N1568_data::m_asw_buff_len, N1568_data::m_common_data, N1568_data::m_p_asw_buff, N1568_CMD_MOD, receive_buffer(), send_cmd(), and TRUE.

BOOL N1568_set_pole_zero_adj ( N1568_data p_data,
UINT8  value,
N1568_channel_status channel_status 
)

Set the pole zero adjust value for the current channel.

Parameters:
p_data Pointer to board data
value The desired pole zero adjust value
channel_status The channels status after the command execution. This parameter may be NULL (no channel status returned)
Returns:
TRUE: operation successfully completed

Definition at line 288 of file N1568.c.

References N1568_CMD_PZ, and N1568_send_cmd().

BOOL N1568_set_shape ( N1568_data p_data,
UINT8  value,
N1568_channel_status channel_status 
)

Set the shaping time for the current channel.

Parameters:
p_data Pointer to board data
value The desired shaping time
channel_status The channels status after the command execution. This parameter may be NULL (no channel status returned)
Returns:
TRUE: operation successfully completed

Definition at line 280 of file N1568.c.

References N1568_CMD_SH, and N1568_send_cmd().

BOOL N1568_set_stretcher ( N1568_data p_data,
BOOL  enable,
N1568_channel_status channel_status 
)

Enable/Disable the stretcher for the current channel.

Parameters:
p_data Pointer to board data
enable Set to TRUE to enable the stretcher
channel_status The channels status after the command execution. This parameter may be NULL (no channel status returned)
Returns:
TRUE: operation successfully completed

Definition at line 328 of file N1568.c.

References N1568_CMD_STR, and N1568_send_cmd().

const char * N1568_SW_rev ( void   ) 

Returns the SDK software release.

Returns:
const char*: The SDK revision string

Definition at line 378 of file N1568.c.


Generated on Mon Oct 6 09:30:09 2008 for CAEN N1568 SDK by  doxygen 1.5.6