CROSS Technical Documentation User Manual and Technical Doc.
INFN Milano Bicocca
Loading...
Searching...
No Matches
Detector_Relays_managing.h
Go to the documentation of this file.
1
2
3#include "stdint.h"
4
5/*! \file
6
7
8*/
9
10/*******************************************************************
11Variabili gianlu
12********************************************************************/
13//Inizio CROSS
14
15//! [ref_spi_clock_for_relais]
16#define spi_clock_for_relais (uint32_t) 400000 /*!< Clock frequency for relais driver */
17//! [ref_spi_clock_for_relais]
18
19#define wait_time_for_rele_setting 10 /*!< '' */
20
21/*!
22\snippet Detector_Relays_managing.h def_detector_Relay_flags_setting
23*/
24//! <!-- [def_detector_Relay_flags_setting] -->
25//Relay settings
26#define Detector_bias_invertito 1 << 0 /*!< '' */
27#define Detector_bias_diretto 1 << 1 /*!< '' */
28#define Detector_large_RLOAD 1 << 2 /*!< '' */
29#define Detector_small_RLOAD 1 << 3 /*!< '' */
30#define Detector_prea_to_GND 1 << 4 /*!< '' */
31#define Detector_prea_to_det 1 << 5 /*!< '' */
32#define Detector_external_bias 1 << 6 /*!< '' */
33#define Detector_internal_bias 1 << 7 /*!< '' */
34//! <!-- [def_detector_Relay_flags_setting] -->
35
36//Opzioni per memorizzazione/richiami stati
37#define detector_offset_from_half_scale (1<<1) /*!< '' */
38#define detector_bit_per_storing_startup (1<<3) /*!< '' */
39#define detector_bit_per_storing_user_state (1<<5) /*!< '' */
40#define detector_bit_recall_startup (1<<4) /*!< '' */
41#define detector_bit_recall_user_defined (1<<6) /*!< '' */
42#define detector_bit_store_state_in_user_as_it_is (1<<7) /*!< '' */
43
44void Relays_driver_set_reset_channel(uint8_t scheda_su_giu, uint8_t numero_canale , uint8_t valore_da_trasmettere);
45
46//Fine CROSS
47//Rele for PGA pre gain for ch1 is in Rele_strutture_funzioni_definizioni
48/*******************************************************************
49FINE Variabili gianlu
50********************************************************************/
51
52/*******************************************************************
53Funzioni gianlu
54********************************************************************/
55
56void Funzione_per_attivare(uint8_t numero_canale, uint8_t valore_da_trasmettere);
57/*******************************************************************
58FINE Funzioni gianlu
59********************************************************************/
60
61/*****************************************************************************
62 *****************************************************************************
63 RELE S1
64 *****************************************************************************
65 *****************************************************************************/
66 typedef struct rele_s1 {
67 void (*Attiva_OUT1_ch0) (void); ///< Puntatore a \ref Attiva_OUT1_ch0
68 void (*Attiva_OUT2_ch0) (void); ///< Puntatore a \ref Attiva_OUT2_ch0
69} const struttura_rele_s1;
70
71 /****************************************************************************
72 Funzioni del RELE S1
73 *****************************************************************************/
74void Attiva_OUT_1_ch0 (void);
75
76void Attiva_OUT_2_ch0 (void);
77
78
79// La struttura rele_s1 viene controllata con relee_s1
80// La struttura multi_1 viene controllata con multipl_1
81extern struttura_rele_s1 Rele_s1;
82
83 extern struttura_rele_s1 *RELE_S1; // Viene creato un puntatore a relee_s1
84
85
86
87/*****************************************************************************
88 *****************************************************************************
89 RELE S2
90 *****************************************************************************
91 *****************************************************************************/
92typedef struct rele_s2 {
93 void (*Attiva_OUT3_ch0) (void); ///< Puntatore a \ref Attiva_OUT3_ch0
94 void (*Attiva_OUT4_ch0) (void); ///< Puntatore a \ref Attiva_OUT4_ch0
95} const struttura_rele_s2;
96
97 /****************************************************************************
98 Funzioni del RELE S2
99 *****************************************************************************/
100void Attiva_OUT_3_ch0 (void);
101
102void Attiva_OUT_4_ch0 (void);
103
104
105// La struttura rele_s2 viene controllata con relee_s2
106extern struttura_rele_s2 Rele_s2;
107
108 extern struttura_rele_s2 *RELE_S2; // Viene creato un puntatore a relee_s2
109
110
111
112/*****************************************************************************
113 *****************************************************************************
114 RELE S3
115 *****************************************************************************
116 *****************************************************************************/
117 typedef struct rele_s3 {
118 void (*Attiva_OUT5_ch0) (void); ///< Puntatore a \ref Attiva_OUT5_ch0
119 void (*Attiva_OUT6_ch0) (void); ///< Puntatore a \ref Attiva_OUT6_ch0
120} const struttura_rele_s3;
121
122 /****************************************************************************
123 Funzioni del RELE S3
124 *****************************************************************************/
125void Attiva_OUT_5_ch0 (void);
126
127void Attiva_OUT_6_ch0 (void);
128
129
130// La struttura rele_s3 viene controllata con relee_s3
131extern struttura_rele_s3 Rele_s3;
132
133 extern struttura_rele_s3 *RELE_S3; // Viene creato un puntatore a relee_s3
134
135
136
137/*****************************************************************************
138 *****************************************************************************
139 RELE K4
140 *****************************************************************************
141 *****************************************************************************/
142 typedef struct rele_k4 {
143 void (*Attiva_OUT7_ch0) (void); ///< Puntatore a \ref Attiva_OUT7_ch0
144 void (*Attiva_OUT8_ch0) (void); ///< Puntatore a \ref Attiva_OUT8_ch0
145} const struttura_rele_k4;
146
147 /****************************************************************************
148 Funzioni del RELE K4
149 *****************************************************************************/
150void Attiva_OUT_7_ch0 (void);
151
152void Attiva_OUT_8_ch0 (void);
153
154
155// La struttura rele_k4 viene controllata con relee_k4
156extern struttura_rele_k4 Rele_k4;
157
158 extern struttura_rele_k4 *RELE_K4; // Viene creato un puntatore a relee_k4
159
160
161
162
163
164/*****************************************************************************
165 *****************************************************************************
166 RELE S4
167 *****************************************************************************
168 *****************************************************************************/
169 typedef struct rele_s4 {
170 void (*Attiva_OUT1_ch1) (void); ///< Puntatore a \ref Attiva_OUT1_ch1
171 void (*Attiva_OUT2_ch1) (void); ///< Puntatore a \ref Attiva_OUT2_ch1
172} const struttura_rele_s4;
173
174 /****************************************************************************
175 Funzioni del RELE S4
176 *****************************************************************************/
177void Attiva_OUT_1_ch1 (void);
178void Attiva_OUT_2_ch1 (void);
179
180
181// La struttura rele_s4 viene controllata con relee_s4
182extern struttura_rele_s4 Rele_s4;
183
184 extern struttura_rele_s4 *RELE_S4; // Viene creato un puntatore a relee_s4
185
186
187
188/*****************************************************************************
189 *****************************************************************************
190 RELE S5
191 *****************************************************************************
192 *****************************************************************************/
193 typedef struct rele_s5 {
194 void (*Attiva_OUT3_ch1) (void); ///< Puntatore a \ref Attiva_OUT3_ch1
195 void (*Attiva_OUT4_ch1) (void); ///< Puntatore a \ref Attiva_OUT4_ch1
196} const struttura_rele_s5;
197
198 /****************************************************************************
199 Funzioni del RELE S5
200 *****************************************************************************/
201void Attiva_OUT_3_ch1 (void);
202
203void Attiva_OUT_4_ch1 (void);
204
205
206// La struttura rele_s5 viene controllata con relee_s5
207extern struttura_rele_s5 Rele_s5;
208
209 extern struttura_rele_s5 *RELE_S5; // Viene creato un puntatore a relee_s5
210
211
212
213/*****************************************************************************
214 *****************************************************************************
215 RELE S6
216 *****************************************************************************
217 *****************************************************************************/
218 typedef struct rele_s6 {
219 void (*Attiva_OUT5_ch1) (void); ///< Puntatore a \ref Attiva_OUT5_ch1
220 void (*Attiva_OUT6_ch1) (void); ///< Puntatore a \ref Attiva_OUT6_ch1
221} const struttura_rele_s6;
222
223 /****************************************************************************
224 Funzioni del RELE S6
225 *****************************************************************************/
226void Attiva_OUT_5_ch1 (void);
227
228void Attiva_OUT_6_ch1 (void);
229
230
231// La struttura rele_s6 viene controllata con relee_s6
232extern struttura_rele_s6 Rele_s6;
233
234 extern struttura_rele_s6 *RELE_S6; // Viene creato un puntatore a relee_s6
235
236
237
238/*****************************************************************************
239 *****************************************************************************
240 RELE K5
241 *****************************************************************************
242 *****************************************************************************/
243 typedef struct rele_k5 {
244 void (*Attiva_OUT7_ch1) (void); ///< Puntatore a \ref Attiva_OUT7_ch1
245 void (*Attiva_OUT8_ch1) (void); ///< Puntatore a \ref Attiva_OUT8_ch1
246} const struttura_rele_k5;
247
248 /****************************************************************************
249 Funzioni del RELE K5
250 *****************************************************************************/
251void Attiva_OUT_7_ch1 (void);
252
253void Attiva_OUT_8_ch1 (void);
254
255
256// La struttura rele_k5 viene controllata con relee_k5
257
258extern struttura_rele_k5 Rele_k5;
259
260 extern struttura_rele_k5 *RELE_K5; // Viene creato un puntatore a relee_k5
261
262
263
264
265
266/*****************************************************************************
267 *****************************************************************************
268 FUNZIONI UTILI
269 *****************************************************************************
270 *****************************************************************************/
271void ATTIVA_CANALE_0_PER_I_RELE (void);
272
273void ATTIVA_CANALE_1_PER_I_RELE (void);
274
275void RELE_ATTIVA(int canale, int OUTN);
276
277
278
279
280
281
282
void Relays_driver_set_reset_channel(uint8_t scheda_su_giu, uint8_t numero_canale, uint8_t valore_da_trasmettere)
Setting the state of the detector realis: pre connected to detector or intrnal resistor,...
void(* Attiva_OUT8_ch0)(void)
Puntatore a Attiva_OUT8_ch0.
void(* Attiva_OUT7_ch0)(void)
Puntatore a Attiva_OUT7_ch0.
void(* Attiva_OUT8_ch1)(void)
Puntatore a Attiva_OUT8_ch1.
void(* Attiva_OUT7_ch1)(void)
Puntatore a Attiva_OUT7_ch1.
void(* Attiva_OUT1_ch0)(void)
Puntatore a Attiva_OUT1_ch0.
void(* Attiva_OUT2_ch0)(void)
Puntatore a Attiva_OUT2_ch0.
void(* Attiva_OUT4_ch0)(void)
Puntatore a Attiva_OUT4_ch0.
void(* Attiva_OUT3_ch0)(void)
Puntatore a Attiva_OUT3_ch0.
void(* Attiva_OUT5_ch0)(void)
Puntatore a Attiva_OUT5_ch0.
void(* Attiva_OUT6_ch0)(void)
Puntatore a Attiva_OUT6_ch0.
void(* Attiva_OUT2_ch1)(void)
Puntatore a Attiva_OUT2_ch1.
void(* Attiva_OUT1_ch1)(void)
Puntatore a Attiva_OUT1_ch1.
void(* Attiva_OUT3_ch1)(void)
Puntatore a Attiva_OUT3_ch1.
void(* Attiva_OUT4_ch1)(void)
Puntatore a Attiva_OUT4_ch1.
void(* Attiva_OUT5_ch1)(void)
Puntatore a Attiva_OUT5_ch1.
void(* Attiva_OUT6_ch1)(void)
Puntatore a Attiva_OUT6_ch1.