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

This module implements the functionality required by the octopus board (large). More...

#include "util/macro.h"
#include "cfg_board.h"
#include "kernel/err.h"
#include "errorcode.h"
#include <stdbool.h>
#include <stdint.h>

Go to the source code of this file.

Macros

#define OCTO_BRD_SMALL   0
 Octo small.
 
#define OCTO_BRD_LARGE   1
 Octo large.
 

Functions

void octoResetBoard (int brd)
 
bool octoInitChan (int brd, int ch, uint8_t highVolt, uint8_t threshold)
 Initializes a channel on the octopus board. More...
 
bool octoDeinitChan (int brd, int ch)
 De-Initializes a channel on the octopus board. More...
 
bool octoReadFault (int brd, uint32_t *fault)
 Reads the fault register of the CLPD. More...
 
bool octoReadEnabled (int brd, uint32_t *enabled)
 
bool octoPMTID (int brd, int ch, uint32_t *id, bool *pmtIdFault)
 Reads a PMT ID. More...
 
bool octoPiezo (bool on)
 Turns the Piezo on or off. More...
 
bool octoHighVoltage (int brd, int ch, bool hvOn)
 Turns the high-voltage on or off. More...
 
bool octoChainTest (int brd, int ch)
 Executes a chain-test. More...
 

Detailed Description

This module implements the functionality required by the octopus board (large).

From this interface you can control the CPLD on the octopus board and the PROMiS module.

Definition in file octopus.h.

Function Documentation

bool octoChainTest ( int  brd,
int  ch 
)

Executes a chain-test.

Note that the Threshold and High-voltage levels will be reset.

Note
I have no idea what a chain-test does (VvB).
Parameters
brdThe board
chThe channel
Return values
trueSuccess
falseFailure, consult err module for error.

Definition at line 238 of file octopus.c.

bool octoDeinitChan ( int  brd,
int  ch 
)

De-Initializes a channel on the octopus board.

Parameters
brdThe board
chThe channel
Return values
trueSuccess
falseFailure, consult err module for error.

Definition at line 130 of file octopus.c.

bool octoHighVoltage ( int  brd,
int  ch,
bool  hvOn 
)

Turns the high-voltage on or off.

Note
High-voltage will cause the PMT-basis to generate high voltage. Use with caution!
Parameters
brdThe board
chThe channel
ontrue - turn it on, false - turn it off.
Return values
trueSuccess
falseFailure, consult err module for error.

Definition at line 221 of file octopus.c.

bool octoInitChan ( int  brd,
int  ch,
uint8_t  highVolt,
uint8_t  threshold 
)

Initializes a channel on the octopus board.

Parameters
brdThe board
chThe channel
highVoltHigh voltage level as byte
thresholdThreshold level as byte
Return values
trueSuccess
falseFailure, consult err module for error.

Definition at line 140 of file octopus.c.

bool octoPiezo ( bool  on)

Turns the Piezo on or off.

Parameters
ontrue - turn it on, false - turn it off.
Return values
trueRead Success
falseFailure, consult err module for error.

Definition at line 197 of file octopus.c.

bool octoPMTID ( int  brd,
int  ch,
uint32_t *  id,
bool *  pmtIdFault 
)

Reads a PMT ID.

Parameters
brdThe board
faultThe fault register.
idPointer to a variable to fill with the ID.
Return values
trueRead Success
falseFailure, consult err module for error.

Definition at line 168 of file octopus.c.

bool octoReadFault ( int  brd,
uint32_t *  fault 
)

Reads the fault register of the CLPD.

The bit position corresponds to a PMT channel.

Parameters
brdThe board
faultPointer to variable to fill with fault bits.
Return values
trueRead Success
falseFailure, consult err module for error.

Definition at line 210 of file octopus.c.

void octoResetBoard ( int  brd)
Parameters
Resetsan octopus board. Also resets all PMTs on that board (en Piezo if connected).
brdThe Board, either OCTO_BRD_LARGE or OCTO_BRD_SMALL.

Definition at line 100 of file octopus.c.