Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
Main Page
Related Pages
Modules
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Enumerations
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
z
Enumerator
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
:
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerations
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerator
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Properties
Related Functions
:
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
r
s
t
v
w
x
z
Files
File List
File Members
All
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
_
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Variables
$
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Enumerations
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
v
x
z
Enumerator
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Macros
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
GitLab
LXR
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Modules
Pages
Trigger
TrigT1
TrigT1RPChardware
src
crc8.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
TrigT1RPChardware/crc8.h
"
6
7
#include <fstream>
// ifstream, ofstream, fstream
8
#include <iostream>
9
10
using namespace
std;
11
12
crc8::crc8
() {
13
// cout<<"Inizio della sessione crc8\n";
14
m_crci = 0x00;
// crc iniziale,default="00000000"
15
m_pol = 0x838000;
// polinomio divisore="1000000111"
16
m_ma = 0x800000;
// maschera
17
}
18
19
crc8::~crc8
() {
20
// cout<<"Fine della sessione crc8\n";
21
}
22
23
int
crc8::current
() {
24
return
m_crci;
25
// return pol;
26
// return ma;
27
}
28
29
int
crc8::calc
(
int
dato) {
30
int
i
;
31
int
masc;
32
int
poli;
33
34
m_crci = m_crci << 16;
// shifta il crc iniziale per metterlo davanti al dato
35
dato = dato ^ m_crci;
// mette,tramite xor,il crc davanti al dato
36
masc = m_ma;
// carico la maschera
37
poli = m_pol;
// carico il polinomio divisore
38
39
for
(
i
= 0;
i
< 16;
i
++) {
40
if
(dato & masc)
// tramite AND,individua se il MSB e' 1 e divide
41
dato = dato ^ poli;
// divisione tra dato e polinomio
42
masc = masc >> 1;
// shift per bit successivo
43
poli = poli >> 1;
// shift per bit successivo
44
}
45
m_crci = dato;
// caricamento del crc ottenuto
46
return
0;
47
}
crc8.h
lumiFormat.i
int i
Definition:
lumiFormat.py:85
crc8::calc
int calc(int dato)
Definition:
crc8.cxx:29
crc8::crc8
crc8()
Definition:
crc8.cxx:12
crc8::current
int current()
Definition:
crc8.cxx:23
crc8::~crc8
~crc8()
Definition:
crc8.cxx:19
Generated on Sun Mar 30 2025 21:08:59 for ATLAS Offline Software by
1.8.18