CROSS Technical Documentation User Manual and Technical Doc.
INFN Milano Bicocca
Loading...
Searching...
No Matches
Detector_Relays_managing.c
Go to the documentation of this file.
1
2
3
4#include "tutti_gli_header.h"
5
6//DOCUMENTAZIONE DOXYGEN
7/// \file
8
9/*! \page Detector_Relays_managing_page Detector_Relays_managing
10\brief <span style="color:red;"> <b> Relais operation </b> </span>
11*\tableofcontents
12
13 \b SUMMARY:
14*\arg \ref user_use_of_relais
15
16
17*\section user_use_of_relais User use of relais
18<hr width="75%" size="10" align="left">
19\n Connections of the detectors to the front-end need to be very accurate. For that we use 2 different kind of
20bi-stable relais as switches. Their difference is mainly in shape. The relay that allows to select between internal or
21external power supplies to the detector bias system is small, with a pin pitch of 100 mils, figure \ref Figure_rele_internal_external_bias and
22 <a href="./File_pdf/TQ2-L2-5V.pdf" target=_blank><b>TQ2-L2-5V datasheet</b></a>. The relais which are directely
23connected to the detector need a very large impedance and are larger, with a pin pitch of 200 mils, figure
24\ref Figure_rele_to_detector and <a href="./File_pdf/DS2-L2-5V.pdf" target=_blank><b>DS2-L2-5V datasheet</b></a>.
25
26*\anchor Figure_rele_internal_external_bias
27*\image html TQ2-L2-5V.jpg "Figure_Relay_internal_external_bias 1: This is the bi-stable relay for selecting internal or external bias." width=10%
28*\image latex TQ2-L2-5V.jpg "Figure_Relay_internal_external_bias 1: This is the bi-stable relay for selecting internal or external bias." width=10%
29
30*\anchor Figure_rele_to_detector
31*\image html DS2-L2-5V.jpg "Figure_Relay_to_detector 2: This are the bi-stable relais for detector operation: load resistor selection, preamplifier connection to dummy resistors or to detector and detector bias inversion." width=10%
32*\image latex DS2-L2-5V.jpg "Figure_Relay_to_detector 2: This are the bi-stable relais for detector operation: load resistor selection, preamplifier connection to dummy resistors or to detector and detector bias inversion." width=10%
33
34\n Being bi-stable relais they need 2 signals for their setting/resetting and the <a href="./File_pdf/MAX4820.pdf" target=_blank><b>MAX4820</b></a>
35is the 8 signals driver we use for it. Its schematic diagram is in figure \ref Figure_Max4820_schemme.
36It communicates with SPI and for this we use the function Relays_driver_set_reset_channel() with input parameters <i> uint8_t scheda_su_giu, uint8_t numero_canale , uint8_t valore_da_trasmettere </i>
37where \b scheda_su_giu is the selected board, \b numero_canale is the channel for which we need to apply the new setting
38and \b valore_da_trasmettere is the action to apply. The possible settings are as it follows, where for setting the
39bit it needs either to use the definition or setting a "1" in the position defined by the bullet (for instance
40to set the large Load resistor we can use #Detector_large_RLOAD or 1<<2):
41\n
42<center>
43\anchor Table_relais_settings \b Table \b Detector \b Relais \b Settings
44Data | Bit | Setting |
45:---------------------------------| :------:| :---------------------------|
46| Detecor bias polarity | 1 << 0 | #Detector_bias_invertito |
47| ^ | 1 << 1 | #Detector_bias_diretto |
48| Load Resistor setting | 1 << 2 | #Detector_large_RLOAD |
49| ^ | 1 << 3 | #Detector_small_RLOAD |
50| Preamplifier to dummy resistors | 1 << 4 | #Detector_prea_to_GND |
51| Preamplifier to detector | 1 << 5 | #Detector_prea_to_det |
52| Detector bias source (*) | 1 << 6 | #Detector_external_bias |
53| ^ | 1 << 7 | #Detector_internal_bias |
54</center>
55
56\attention <b> (*):</b> for safety reason these 2 switches, #Detector_external_bias and
57#Detector_internal_bias, are set if and only if the positive
58external applied detector biasing voltage is within <b> 1 V </b> and <b> 6 V </b> and the negative external detector applied
59biasing voltage is within <b> -6 V </b> and <b> -1 V </b>. The absolute limits of &plusmn;1 V and &plusmn;6 V are subjected to change
60and are defined at #Detector_min_voltage_for_switch and #Detector_max_voltage_for_switch.
61
62\n Note that the state of the settings is stored in the vector:
63*\snippet Detector_Bias.c vec_detector_Relay_state
64\n that maintains the same flag positions as in \ref Table_relais_settings, or:
65\snippet Detector_Relays_managing.h def_detector_Relay_flags_setting
66\note Because of the relaies can change state at power ON there is not assurance that
67the state is effective if a power cut or a reset happened.
68
69\n Here an example for connecting all the channels to the internal dummy resistors:
70<span style="color:orange;"> <I>
71\code {.c}
72 uint8_t canale_;
73 for( canale_=0; canale_ <6; canale_ ++ ){
74 Relays_driver_set_reset_channel(scheda_su_scheda_giu_provvisorio, canale_ , Detector_prea_to_GND );
75 }
76\endcode
77</I> </span>
78
79*\anchor Figure_Max4820_schemme
80*\image html Max48220.png "Figure_max4820 3: Schematic diagram of the driver MAX4820." width=40%
81*\image latex Max48220.png "Figure_max4820 3: Schematic diagram of the driver MAX4820." width=40%
82
83\n The codes for Relais setting are:
84- \ref Detector_Relays_managing.c
85- \ref Detector_Relays_managing.h
86
87*/
88
89/*!
90
91
92*/
93
94
95//Inizio CROSS
96 /****************************************************************************
97 Funzioni di Gianlu
98 *****************************************************************************/
99 /*! \brief Setting the state of the detector realis: pre connected to detector or intrnal resistor,
100 polarity of the detector bias, load resistro choiche and internal or external detector bias.
101
102 *\param[in] scheda_su_giu the board to be managed of the 2 available
103 *\param[in] numero_canale the channel for which we need to manage the relay
104 *\param[in] valore_da_trasmettere the relay to be managed
105 *\return No Parameters
106
107 *\snippetlineno Detector_Relays_managing.c fun_Relays_driver_set_reset_channel
108 */
109 //! <!-- [fun_Relays_driver_set_reset_channel] -->
110 void Relays_driver_set_reset_channel(uint8_t scheda_su_giu, uint8_t numero_canale , uint8_t valore_da_trasmettere){
111
112 SPIdrv->Control(SPI_control_for_relay_driver, spi_clock_for_relais); // SPI fits Relay driver specs at 8 bits and speed
113 //Detector Relays Drivers reset and un-reset all together with the reset pin
114 I2C_to_Parallel_set_PCA9554_outputs_values( scheda_su_giu, detector_reset_all_relays_driver.I2C_to_parallel_chip_num, detector_reset_all_relays_driver.I2C_to_parallel_chip__pin_num);
115 Aspetta_tanti_ms(10);
116 I2C_to_Parallel_set_PCA9554_outputs_values( scheda_su_giu, detector_reset_all_relays_driver.I2C_to_parallel_chip_num, \
117 I2C_to_Parallel_ini_set[detector_reset_all_relays_driver.I2C_to_parallel_chip_num] );
119
120 //Chip_select: now select the chip to speak with
121 I2C_to_Parallel_set_PCA9554_outputs_values( scheda_su_giu, detector_chip_select_bias[numero_canale].I2C_to_parallel_chip_num, \
122 detector_chip_select_bias[numero_canale].I2C_to_parallel_chip__pin_num);
124// SPItx(valore_da_trasmettere);
125 SPIdrv->Send ( &valore_da_trasmettere ,1); //send the 16 bits
126// while( SPIdrv->GetStatus().busy ){} //wait end of transmission
127// Aspetta_tanti_ms(1);
128
129 uint8_t troppa_attesa=0;
130 while( (SPIdrv->GetStatus().busy) && (troppa_attesa <250) ){
132 troppa_attesa++;
133 } //wait end of transmission ;
134 if((troppa_attesa>=250) || (Error_bad_operation)) ERROR_codifica_errore(scheda_su_giu, error_address_SPI, SPI_error_EVENT_DATA_LOST,1);
135
136 I2C_to_Parallel_set_PCA9554_outputs_values( scheda_su_giu, detector_chip_select_bias[numero_canale].I2C_to_parallel_chip_num,\
137 I2C_to_Parallel_ini_set[detector_chip_select_bias[numero_canale].I2C_to_parallel_chip_num]); //Set the driver OFF: it is important to switch off the chip because ony in this moment the outputs are
138 // enabled
139 Aspetta_tanti_ms(wait_time_for_rele_setting); //Wait the time the relay takes action, 5 ms at least.
140
141 I2C_to_Parallel_set_PCA9554_outputs_values( scheda_su_giu, detector_chip_select_bias[numero_canale].I2C_to_parallel_chip_num, \
142 detector_chip_select_bias[numero_canale].I2C_to_parallel_chip__pin_num);//Select the cip again
144// SPItx(0);
145 uint8_t zero=0;
146 SPIdrv->Send ( &zero ,1); // Set high all the ouputs
148 I2C_to_Parallel_set_PCA9554_outputs_values( scheda_su_giu, detector_chip_select_bias[numero_canale].I2C_to_parallel_chip_num,\
149 I2C_to_Parallel_ini_set[detector_chip_select_bias[numero_canale].I2C_to_parallel_chip_num]); //Disable the chip and set high the ouputs
151
152//Qui consideriamo la varibaile di stato per il detector relay
153 uint8_t canalone=scheda_su_giu *6 + numero_canale;
154 if (valore_da_trasmettere & Detector_prea_to_det){
156 detector_Relay_state[canalone] &= ~(uint8_t)(Detector_prea_to_GND);
157 }else if (valore_da_trasmettere & Detector_prea_to_GND){
159 detector_Relay_state[canalone] &= ~(uint8_t)(Detector_prea_to_det);
160 }
161 if (valore_da_trasmettere & Detector_large_RLOAD){
163 detector_Relay_state[canalone] &= ~(uint8_t)(Detector_small_RLOAD);
164 }else if (valore_da_trasmettere & Detector_small_RLOAD){
166 detector_Relay_state[canalone] &= ~(uint8_t)(Detector_large_RLOAD);
167 }
168 if (valore_da_trasmettere & Detector_external_bias){
170 detector_Relay_state[canalone] &= ~(uint8_t)(Detector_internal_bias);
171 }else if(valore_da_trasmettere & Detector_internal_bias){
173 detector_Relay_state[canalone] &= ~(uint8_t)(Detector_external_bias);
174 }
175 if (valore_da_trasmettere & Detector_bias_invertito){
177 detector_Relay_state[canalone] &= ~(uint8_t)(Detector_bias_diretto);
178 }else if(valore_da_trasmettere & Detector_bias_diretto){
180 detector_Relay_state[canalone] &= ~(uint8_t)(Detector_bias_invertito);
181 }
182
183 }
184 //! <!-- [fun_Relays_driver_set_reset_channel] -->
185
186 //Fine CROSS
187
188
189//Commento tutto da qui
190
191 void Funzione_per_attivare(uint8_t numero_canale /*0=ch0,1=ch1*/, uint8_t valore_da_trasmettere/*rele to set*/)
192{
193// uint8_t chip_sel;
194 porta_pin_def chip_da_usare;
195// GPIO_PinWrite(rele_driver_ch1.porta_num, rele_driver_ch1.pin_num ,1); // Set off both the drivers to start
196 GPIO_PinWrite(rele_driver_ch0.porta_num, rele_driver_ch0.pin_num,1);
197 if(numero_canale ==0) //select the driver
198 {
199// chip_sel = Chip_Sel_rele_0;
200 chip_da_usare=rele_driver_ch0;
201 }
202 else
203 {
204// chip_sel = Chip_Sel_rele_1;
205// chip_da_usare=rele_driver_ch1;
206 }
207 GPIO_PinWrite(chip_da_usare.porta_num, chip_da_usare.pin_num, 0); //Set the driver ON
208 SPItx(valore_da_trasmettere);
210 GPIO_PinWrite(chip_da_usare.porta_num, chip_da_usare.pin_num, 1); //Set the driver OFF: the set is applied
211 Aspetta_tanti_ms(wait_time_for_rele_setting); // Bisogna aspettare almeno 5 ms prima di inviare un'altra istruzione
212
213 GPIO_PinWrite(chip_da_usare.porta_num, chip_da_usare.pin_num, 0); //Set the driver ON
214 SPItx(0); // Viene inviato un 0, in questo modo viene azzerato tutto
216 GPIO_PinWrite(chip_da_usare.porta_num, chip_da_usare.pin_num, 1); //Set the driver OFF: the set is applied
218}
219
220 /****************************************************************************
221 FINE Funzioni di Gianlu
222 *****************************************************************************/
223
224/*****************************************************************************
225 *****************************************************************************
226 RELE S1
227 *****************************************************************************
228 *****************************************************************************/
229// typedef struct rele_s1 {
230// void (*Attiva_OUT1_ch0) (void); ///< Puntatore a \ref Attiva_OUT1_ch0
231// void (*Attiva_OUT2_ch0) (void); ///< Puntatore a \ref Attiva_OUT2_ch0
232//} const struttura_rele_s1;
233
234 /****************************************************************************
235 Funzioni del RELE S1
236 *****************************************************************************/
237void Attiva_OUT_1_ch0 (void)
238{
239 Funzione_per_attivare(0,1);
240}
241
242void Attiva_OUT_2_ch0 (void)
243{
244 Funzione_per_attivare(0,2);
245}
246
247// La struttura rele_s1 viene controllata con relee_s1
248// La struttura multi_1 viene controllata con multipl_1
249struttura_rele_s1 Rele_s1= {
250 Attiva_OUT_1_ch0,
251 Attiva_OUT_2_ch0,
252};
253
254 struttura_rele_s1 *RELE_S1= &Rele_s1; // Viene creato un puntatore a relee_s1
255
256
257
258/*****************************************************************************
259 *****************************************************************************
260 RELE S2
261 *****************************************************************************
262 *****************************************************************************/
263//typedef struct rele_s2 {
264// void (*Attiva_OUT3_ch0) (void); ///< Puntatore a \ref Attiva_OUT3_ch0
265// void (*Attiva_OUT4_ch0) (void); ///< Puntatore a \ref Attiva_OUT4_ch0
266//} const struttura_rele_s2;
267
268 /****************************************************************************
269 Funzioni del RELE S2
270 *****************************************************************************/
271void Attiva_OUT_3_ch0 (void)
272{
273 Funzione_per_attivare(0,4);
274}
275
276void Attiva_OUT_4_ch0 (void)
277{
278 Funzione_per_attivare(0,8);
279}
280
281
282// La struttura rele_s2 viene controllata con relee_s2
283struttura_rele_s2 Rele_s2= {
284 Attiva_OUT_3_ch0,
285 Attiva_OUT_4_ch0,
286};
287
288 struttura_rele_s2 *RELE_S2= &Rele_s2; // Viene creato un puntatore a relee_s2
289
290
291
292/*****************************************************************************
293 *****************************************************************************
294 RELE S3
295 *****************************************************************************
296 *****************************************************************************/
297// typedef struct rele_s3 {
298// void (*Attiva_OUT5_ch0) (void); ///< Puntatore a \ref Attiva_OUT5_ch0
299// void (*Attiva_OUT6_ch0) (void); ///< Puntatore a \ref Attiva_OUT6_ch0
300//} const struttura_rele_s3;
301
302 /****************************************************************************
303 Funzioni del RELE S3
304 *****************************************************************************/
305void Attiva_OUT_5_ch0 (void)
306{
307 Funzione_per_attivare(0,16);
308}
309
310void Attiva_OUT_6_ch0 (void)
311{
312 Funzione_per_attivare(0,32);
313}
314
315
316// La struttura rele_s3 viene controllata con relee_s3
317struttura_rele_s3 Rele_s3= {
318 Attiva_OUT_5_ch0,
319 Attiva_OUT_6_ch0,
320};
321
322 struttura_rele_s3 *RELE_S3= &Rele_s3; // Viene creato un puntatore a relee_s3
323
324
325
326/*****************************************************************************
327 *****************************************************************************
328 RELE K4
329 *****************************************************************************
330 *****************************************************************************/
331// typedef struct rele_k4 {
332// void (*Attiva_OUT7_ch0) (void); ///< Puntatore a \ref Attiva_OUT7_ch0
333// void (*Attiva_OUT8_ch0) (void); ///< Puntatore a \ref Attiva_OUT8_ch0
334//} const struttura_rele_k4;
335
336 /****************************************************************************
337 Funzioni del RELE K4
338 *****************************************************************************/
339void Attiva_OUT_7_ch0 (void)
340{
341 Funzione_per_attivare(0,64);
342}
343
344void Attiva_OUT_8_ch0 (void)
345{
346 Funzione_per_attivare(0,128);
347}
348
349
350// La struttura rele_k4 viene controllata con relee_k4
351struttura_rele_k4 Rele_k4= {
352 Attiva_OUT_7_ch0,
353 Attiva_OUT_8_ch0,
354};
355
356 struttura_rele_k4 *RELE_K4= &Rele_k4; // Viene creato un puntatore a relee_k4
357
358
359
360
361
362/*****************************************************************************
363 *****************************************************************************
364 RELE S4
365 *****************************************************************************
366 *****************************************************************************/
367// typedef struct rele_s4 {
368// void (*Attiva_OUT1_ch1) (void); ///< Puntatore a \ref Attiva_OUT1_ch1
369// void (*Attiva_OUT2_ch1) (void); ///< Puntatore a \ref Attiva_OUT2_ch1
370//} const struttura_rele_s4;
371
372 /****************************************************************************
373 Funzioni del RELE S4
374 *****************************************************************************/
375void Attiva_OUT_1_ch1 (void)
376{
377 Funzione_per_attivare(1,1);
378}
379void Attiva_OUT_2_ch1 (void)
380{
381 Funzione_per_attivare(1,2);
382}
383
384
385// La struttura rele_s4 viene controllata con relee_s4
386struttura_rele_s4 Rele_s4= {
387 Attiva_OUT_1_ch1,
388 Attiva_OUT_2_ch1,
389};
390
391 struttura_rele_s4 *RELE_S4= &Rele_s4; // Viene creato un puntatore a relee_s4
392
393
394
395/*****************************************************************************
396 *****************************************************************************
397 RELE S5
398 *****************************************************************************
399 *****************************************************************************/
400// typedef struct rele_s5 {
401// void (*Attiva_OUT3_ch1) (void); ///< Puntatore a \ref Attiva_OUT3_ch1
402// void (*Attiva_OUT4_ch1) (void); ///< Puntatore a \ref Attiva_OUT4_ch1
403//} const struttura_rele_s5;
404
405 /****************************************************************************
406 Funzioni del RELE S5
407 *****************************************************************************/
408void Attiva_OUT_3_ch1 (void)
409{
410 Funzione_per_attivare(1,4);
411}
412
413void Attiva_OUT_4_ch1 (void)
414{
415 Funzione_per_attivare(1,8);
416}
417
418
419// La struttura rele_s5 viene controllata con relee_s5
420struttura_rele_s5 Rele_s5= {
421 Attiva_OUT_3_ch1,
422 Attiva_OUT_4_ch1,
423};
424
425 struttura_rele_s5 *RELE_S5= &Rele_s5; // Viene creato un puntatore a relee_s5
426
427
428
429/*****************************************************************************
430 *****************************************************************************
431 RELE S6
432 *****************************************************************************
433 *****************************************************************************/
434// typedef struct rele_s6 {
435// void (*Attiva_OUT5_ch1) (void); ///< Puntatore a \ref Attiva_OUT5_ch1
436// void (*Attiva_OUT6_ch1) (void); ///< Puntatore a \ref Attiva_OUT6_ch1
437//} const struttura_rele_s6;
438
439 /****************************************************************************
440 Funzioni del RELE S6
441 *****************************************************************************/
442void Attiva_OUT_5_ch1 (void)
443{
444 Funzione_per_attivare(1,16);
445}
446
447void Attiva_OUT_6_ch1 (void)
448{
449 Funzione_per_attivare(1,32);
450}
451
452
453// La struttura rele_s6 viene controllata con relee_s6
454struttura_rele_s6 Rele_s6= {
455 Attiva_OUT_5_ch1,
456 Attiva_OUT_6_ch1,
457};
458
459 struttura_rele_s6 *RELE_S6= &Rele_s6; // Viene creato un puntatore a relee_s6
460
461
462
463/*****************************************************************************
464 *****************************************************************************
465 RELE K5
466 *****************************************************************************
467 *****************************************************************************/
468// typedef struct rele_k5 {
469// void (*Attiva_OUT7_ch1) (void); ///< Puntatore a \ref Attiva_OUT7_ch1
470// void (*Attiva_OUT8_ch1) (void); ///< Puntatore a \ref Attiva_OUT8_ch1
471//} const struttura_rele_k5;
472
473 /****************************************************************************
474 Funzioni del RELE K5
475 *****************************************************************************/
476void Attiva_OUT_7_ch1 (void)
477{
478 Funzione_per_attivare(1,64);
479}
480
481void Attiva_OUT_8_ch1 (void)
482{
483 Funzione_per_attivare(1,128);
484}
485
486
487// La struttura rele_k5 viene controllata con relee_k5
488
489struttura_rele_k5 Rele_k5= {
490 Attiva_OUT_7_ch1,
491 Attiva_OUT_8_ch1,
492};
493
494 struttura_rele_k5 *RELE_K5= &Rele_k5; // Viene creato un puntatore a relee_k5
495
496
497
498
499
500/*****************************************************************************
501 *****************************************************************************
502 FUNZIONI UTILI
503 *****************************************************************************
504 *****************************************************************************/
505//void ATTIVA_CANALE_0_PER_I_RELE (void)
506//{
507// GPIO_PinWrite(0, Chip_Sel_rele_1 ,1); // Viene prima alzato quello del canale 1, in modo da non averne 2 abbassati
508// GPIO_PinWrite(0, Chip_Sel_rele_0 ,0);
509//}
510
511//void ATTIVA_CANALE_1_PER_I_RELE (void)
512//{
513// GPIO_PinWrite(0, Chip_Sel_rele_0 ,1); // Viene prima alzato quello del canale 0, in modo da non averne 2 abbassati
514// GPIO_PinWrite(0, Chip_Sel_rele_1 ,0);
515//}
516
517void RELE_ATTIVA(int canale, int OUTN)
518{
519 //Canale 0
520 if(canale == 0)
521 {
522 switch (OUTN)
523 {
524 case 1:
525 RELE_S1->Attiva_OUT1_ch0();
526 case 2:
527 RELE_S1->Attiva_OUT2_ch0();
528 case 3:
529 RELE_S2->Attiva_OUT3_ch0();
530 case 4:
531 RELE_S2->Attiva_OUT4_ch0();
532 case 5:
533 RELE_S3->Attiva_OUT5_ch0();
534 case 6:
535 RELE_S3->Attiva_OUT6_ch0();
536 case 7:
537 RELE_K4->Attiva_OUT7_ch0();
538 case 8:
539 RELE_K4->Attiva_OUT8_ch0();
540 }
541 }
542
543
544// Canale 1
545 if(canale == 1)
546 {
547 switch (OUTN)
548 {
549 case 1:
550 RELE_S4->Attiva_OUT1_ch1();
551 case 2:
552 RELE_S4->Attiva_OUT2_ch1();
553 case 3:
554 RELE_S5->Attiva_OUT3_ch1();
555 case 4:
556 RELE_S5->Attiva_OUT4_ch1();
557 case 5:
558 RELE_S6->Attiva_OUT5_ch1();
559 case 6:
560 RELE_S6->Attiva_OUT6_ch1();
561 case 7:
562 RELE_K5->Attiva_OUT7_ch1();
563 case 8:
564 RELE_K5->Attiva_OUT8_ch1();
565 }
566 }
567}
568
void SPItx(unsigned char dato)
This is a blocking function that transmits one byte over the SPI.
Definition: Adc.c:971
uint8_t detector_Relay_state[12]
The state of the Detector realis is considerede. Note that this is the wanted working condition....
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,...
#define Detector_small_RLOAD
#define Detector_prea_to_det
#define wait_time_for_rele_setting
[ref_spi_clock_for_relais]
#define Detector_bias_invertito
#define Detector_external_bias
#define Detector_internal_bias
#define Detector_prea_to_GND
#define Detector_bias_diretto
#define spi_clock_for_relais
[ref_spi_clock_for_relais]
#define Detector_large_RLOAD
volatile uint32_t Error_bad_operation
exploited to mark the errors
void ERROR_codifica_errore(uint8_t scheda_su_scheda_giu, unsigned char error_addres, unsigned char code_to_shift, uint8_t reset_count_se_0)
If an error is found its flag is codified here.
@ error_address_SPI
Error register for SPI.
@ SPI_error_EVENT_DATA_LOST
This is ARM_SPI_EVENT_DATA_LOST.
void I2C_to_Parallel_set_PCA9554_outputs_values(uint8_t scheda_su_scheda_giu, uint8_t select_PCA, uint8_t value)
The function I2C_to_Parallel_set_PCA9554_outputs_values allow to set the output pin of the I2C to par...
const struct chip_select_type detector_chip_select_bias[6]
This is the vector of constant values which allows to enable the relays drivers of each channels,...
const uint8_t I2C_to_Parallel_ini_set[4]
...
#define SPI_control_for_relay_driver
[ref_SPI_control_for_relay_driver]
Definition: Spi.h:10
void Aspetta_tanti_ms(int millisecondi)
The timing function.
Definition: Timer.c:52
uint8_t I2C_to_parallel_chip_num
This is the I2C to parallel chip to which the driver is connectted, they are 3.
uint8_t I2C_to_parallel_chip__pin_num
This is the outputo pin to enable.
Definition: Gpio.h:13
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.