KM3NeT CLB  2.0
KM3NeT CLB v2 Embedded Software
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
tdc.h File Reference

TDC Driver. More...

#include <stdint.h>
#include <stdbool.h>

Go to the source code of this file.

Macros

#define TDC_CH_ALL_MASK   0x7FFFFFFF
 All channels.
 

Functions

void tdcReset ()
 Resets the TDC to defaults.
 
void tdcSetChannels (uint32_t channels, uint32_t mask)
 Set the enable/disable channels. More...
 
void tdcSetMinTot (uint32_t m_tot)
 Sets the HR veto rate per time-slice. More...
 
void tdcSetHRVeto (uint32_t thrs)
 Sets the Minimun ToT width allowed. More...
 
uint32_t tdcHRVeto ()
 Returns the HR-veto rate per time-slice. More...
 
uint32_t tdcChannels ()
 Returns which TDC channels are enabled/disabled. More...
 
static void tdcChEnable (int ch, bool enable)
 Enables or disables a single channel. More...
 
static bool tdcChEnabled (int ch)
 Returns whether or not a specific TDC channel is enabled or not. More...
 
static void tdcEnableAll ()
 Enables all channels.
 
static void tdcDisableAll ()
 Disables all channels.
 
uint32_t tdcHrvEnabled ()
 Returns on which channels the high-rate veto is applied. More...
 
void tdcSetHrvEnabled (uint32_t channels)
 Sets on which channels the high-rate veto must be applied. More...
 
uint32_t tdcMultiHitEnabled ()
 
void tdcSetMultiHitEnabled (uint32_t channels)
 Sets on which channels the mutli-hit veto must be enabled. More...
 
void tdcDbgSetBlastFull (uint32_t channels)
 Blast full FIFOs bitmask for debugging.
 
uint32_t tdcDbgBlastFull ()
 Return Blast full FIFOs bitmask for debugging.
 

Detailed Description

TDC Driver.

Definition in file tdc.h.

Function Documentation

uint32_t tdcChannels ( )

Returns which TDC channels are enabled/disabled.

Returns
A bitmask containing, per bit position, whether or not the channel is enalbed.

Definition at line 49 of file tdc.c.

static void tdcChEnable ( int  ch,
bool  enable 
)
inlinestatic

Enables or disables a single channel.

Parameters
enabletrue - enable this channel, false - disable this channel.
chChannel to enable.

Definition at line 76 of file tdc.h.

static bool tdcChEnabled ( int  ch)
inlinestatic

Returns whether or not a specific TDC channel is enabled or not.

Parameters
chThe channel to check
Return values
trueThe channel is enabled
falseThe channel is not enabled.

Definition at line 89 of file tdc.h.

uint32_t tdcHrvEnabled ( )

Returns on which channels the high-rate veto is applied.

Returns
A bitmask containing, per bit position, whether or not the HRV is enabled

Definition at line 55 of file tdc.c.

uint32_t tdcHRVeto ( )

Returns the HR-veto rate per time-slice.

Returns
The HR-veto rate.

Definition at line 38 of file tdc.c.

void tdcSetChannels ( uint32_t  channels,
uint32_t  mask 
)

Set the enable/disable channels.

Parameters
channels

Definition at line 44 of file tdc.c.

void tdcSetHrvEnabled ( uint32_t  channels)

Sets on which channels the high-rate veto must be applied.

Parameters
channelsA bitmask containing, per bit position, whether or not the HRV is enalbed.

Definition at line 60 of file tdc.c.

void tdcSetHRVeto ( uint32_t  thrs)

Sets the Minimun ToT width allowed.

Parameters
m_totToTs lower will be discarded

Definition at line 33 of file tdc.c.

void tdcSetMinTot ( uint32_t  m_tot)

Sets the HR veto rate per time-slice.

Parameters
thrsThreshold, beyond which the TDCs will stop producing data for this frame.

Definition at line 29 of file tdc.c.

void tdcSetMultiHitEnabled ( uint32_t  channels)

Sets on which channels the mutli-hit veto must be enabled.

Parameters
channelsA bitmask containing, per bit position, whether or not the multi-hit is enabled

Definition at line 70 of file tdc.c.