CROSS Technical Documentation User Manual and Technical Doc.
INFN Milano Bicocca
Loading...
Searching...
No Matches

◆ Analog_mux_line_to_select_deselect()

void Analog_mux_line_to_select_deselect ( uint8_t  scheda_su_scheda_giu,
uint8_t  line_to_select,
uint8_t  select_1_deselect_0 
)

Selection of the line to mesure with the analog MUX of the mainboard, driven by the I2C->parallel mux.

Parameters
[in]scheda_su_scheda_giuThe board to consider
[in]line_to_selectthe line to be measured
[in]select_1_deselect_0Select or deselect the output, send the same pattern in both cases in line_to_select
Returns
No Parameters
135void Analog_mux_line_to_select_deselect ( uint8_t scheda_su_scheda_giu, uint8_t line_to_select, uint8_t select_1_deselect_0 ){
136 uint8_t select_PCA;
137 uint8_t seleziona_lo_analog_mux, de_seleziona_lo_analog_mux,the_3_selction_lines,pattern_uscita_solo_linee;
138// if (line_to_select < node_voltage_Analog_Mux_1_offset ){
139// //Seleziono il primo mux
140// line_to_select= (line_to_select - node_voltage_Analog_Mux_0_offset );
141// }else{
142// //seleziono il secondo mux
143// line_to_select= line_to_select - node_voltage_Analog_Mux_1_offset ;
144// }
145 line_to_select= (line_to_select - node_voltage_Analog_Mux_0_offset ); //line_to_select ha il quarto bit a 0
146 //se la linea \'e nel primo mux, altrimenti il 4 bit \'e 1
147
148 //Selezionare il chip I2C parallelo dal bit3 di line_to_select
149 the_3_selction_lines= line_to_select & Analog_Mux_maschera_quali_linee ;//le prime 3 linee indicano quale delle
150 //8 uscite va selezionata
151 the_3_selction_lines = the_3_selction_lines << posizione_del_pattern_delle_linee ;//nel chip I2C-->parallel
152 //le 3 linee stanno alla "posizione_del_pattern_delle_linee"
153 pattern_uscita_solo_linee = the_3_selction_lines | I2C_to_Parallel_maschera_linee_ucita;
154
155 if (line_to_select & Analog_Mux_maschera_quale_chip){//test sul mux da usare
156 //Selezionimao il secondo mux
157 select_PCA = I2C_to_Parallel_name_2;
158 seleziona_lo_analog_mux = 0x8f | the_3_selction_lines ;//chip select of second mux is MSb of PCA2 (enabled if 1)
159 de_seleziona_lo_analog_mux =I2C_to_Parallel_2_ini_set;
160 }else{
161 //Selezionimao il primo mux
162 select_PCA = I2C_to_Parallel_name_3;
163 seleziona_lo_analog_mux = 0xff; //chip select of first mux is bit 2 of PCA3 (enabled if 1)
164 de_seleziona_lo_analog_mux = I2C_to_Parallel_3_ini_set;
165 }
166
167 if (select_1_deselect_0){ //definire se selezionare l'uscita o deselezionare l'uscita
168 //First we write the line to select, line 5 to 7 of PCA2
170 pattern_uscita_solo_linee );
171// I2C_to_Parallel_2_ini_set & the_3_selction_lines );
172 //And now enable the analog mux, either mux 1 or mux 2 chip select
173 I2C_to_Parallel_set_PCA9554_outputs_values( scheda_su_scheda_giu, select_PCA, seleziona_lo_analog_mux );
174 //Selezionare la linea di uscita
175 } else{
176 //de-Selezioniamo la linea di uscita e gli analog mux
177 I2C_to_Parallel_set_PCA9554_outputs_values( scheda_su_scheda_giu, select_PCA, de_seleziona_lo_analog_mux );
178 }
179}
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...
#define I2C_to_Parallel_maschera_linee_ucita
#define I2C_to_Parallel_name_3
the third PCA
#define I2C_to_Parallel_2_ini_set
#define I2C_to_Parallel_name_2
the second PCA
#define I2C_to_Parallel_3_ini_set
void Analog_mux_line_to_select_deselect(uint8_t scheda_su_scheda_giu, uint8_t line_to_select, uint8_t select_1_deselect_0)
Selection of the line to mesure with the analog MUX of the mainboard, driven by the I2C->parallel mux...
@ node_voltage_Analog_Mux_0_offset
Starting Offset for this set of nodes, 32.

Definition at line 135 of file Multiplexer_strutture_funzioni_definizioni.c.