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

◆ Analog_mux_line_to_select_deselect_for_postmainboard()

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

Selection of the line to measure with the analog MUX's of the postmainboard, directely driven by the microprocessor port.

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
194void Analog_mux_line_to_select_deselect_for_postmainboard ( uint8_t scheda_su_scheda_giu, uint8_t line_to_select, uint8_t select_1_deselect_0 ){
195 #define offset_per_board_down 32
196 uint8_t offset_per_mux=0,actual_line_to_select,analog_node,analog_mux;
199
200// uint8_t seleziona_lo_analog_mux, de_seleziona_lo_analog_mux,the_3_selction_lines,pattern_uscita_solo_linee;
201 //Sono invertiti gli indici dei 2 gruppi da 4 perch\'e il down va da 4 a 8.
202
203 if (scheda_su_scheda_giu==0) offset_per_mux = offset_per_board_down; //servono i mux da 4 a 7
204
205 actual_line_to_select= ADC_node_map[line_to_select] + offset_per_mux; //La linea analogica che considera una delle 8 nel mux,
206 //i primi 3 bit, ed il mux, i successivi 3 bit.
207
208 analog_node = actual_line_to_select & 7; //la linea analogica da selezionare nel mux
209 analog_mux= (actual_line_to_select >> 3) & 7; //il mux da selezionare
210
211 if(select_1_deselect_0){//Abilitiamo l'uscita
212 //scriviamo il numero della linea da selezionare
213 GPIO_PinWrite(Mux_select_word_0.porta_num, Mux_select_word_0.pin_num, ((analog_node>>0) & 1));
214 GPIO_PinWrite(Mux_select_word_1.porta_num, Mux_select_word_1.pin_num, ((analog_node>>1) & 1));
215 GPIO_PinWrite(Mux_select_word_2.porta_num, Mux_select_word_2.pin_num, ((analog_node>>2) & 1));
216
217 //ed ora abilitiamo il mux
218 GPIO_PinWrite(mux_in_gioco[analog_mux].porta_num, mux_in_gioco[analog_mux].pin_num, 1);
219 }else{//Disabilitiamo il mux
220 GPIO_PinWrite(mux_in_gioco[analog_mux].porta_num, mux_in_gioco[analog_mux].pin_num, 0);
221 }
222
223}
const porta_pin_def Mux_enable_postmainboard_1
location of the chip select pin of analog mux 1 of postmainboard, 0=off
Definition: Gpio.c:136
const porta_pin_def Mux_select_word_2
selettore 2 del pin di ingresso dell'analog mux
Definition: Gpio.c:134
const porta_pin_def Mux_enable_postmainboard_7
location of the chip select pin of analog mux 7 of postmainboard, 0=off
Definition: Gpio.c:142
const porta_pin_def Mux_enable_postmainboard_3
location of the chip select pin of analog mux 3 of postmainboard, 0=off
Definition: Gpio.c:138
const porta_pin_def Mux_enable_postmainboard_8
location of the chip select pin of analog mux 8 of postmainboard, 0=off
Definition: Gpio.c:143
const porta_pin_def Mux_select_word_1
selettore 1 del pin di ingresso dell'analog mux
Definition: Gpio.c:133
const uint8_t ADC_node_map[]
Mapping to mux's on postmainboard. Its syntax: bits 0 to 3 are common to all the MUXs and select one ...
Definition: Gpio.c:172
const porta_pin_def Mux_select_word_0
selettore 0 del pin di ingresso dell'analog mux
Definition: Gpio.c:132
const porta_pin_def Mux_enable_postmainboard_5
location of the chip select pin of analog mux 5 of postmainboard, 0=off
Definition: Gpio.c:140
const porta_pin_def Mux_enable_postmainboard_6
location of the chip select pin of analog mux 6 of postmainboard, 0=off
Definition: Gpio.c:141
const porta_pin_def Mux_enable_postmainboard_4
location of the chip select pin of analog mux 4 of postmainboard, 0=off
Definition: Gpio.c:139
const porta_pin_def Mux_enable_postmainboard_2
location of the chip select pin of analog mux 2 of postmainboard, 0=off
Definition: Gpio.c:137
void Analog_mux_line_to_select_deselect_for_postmainboard(uint8_t scheda_su_scheda_giu, uint8_t line_to_select, uint8_t select_1_deselect_0)
Selection of the line to measure with the analog MUX's of the postmainboard, directely driven by the ...
Definition: Gpio.h:13

Definition at line 194 of file Multiplexer_strutture_funzioni_definizioni.c.