CROSS Technical Documentation User Manual and Technical Doc.
INFN Milano Bicocca
Loading...
Searching...
No Matches
Gpio.c
Go to the documentation of this file.
1#include "tutti_gli_header.h"
2
3
4/*****DOCUMENTAZIONE DOXYGEN*******/
5/// \file
6/// \file PIN_LPC17xx.c
7/// \file GPIO_LPC17xx.c
8/// \file PIN_LPC17xx.h
9/*!
10
11\page GPIO
12\brief <span style="color:red;"> <b> GPIO used pins </b> </span>
13*\tableofcontents
14
15 \b SUMMARY:
16*\arg \ref General
17*\arg \ref Pin_definitions_mainboard
18*\arg \ref Pin_definitions_postmainboard
19
20*\section General General
21<hr width="75%" size="10" align="left">
22\n Microcontroller pins are used for both the mainboard and postmainboard. For mainboard they are few, while several are used for postmainboard.
23Details are given below for both boards.
24
25*\section Pin_definitions_mainboard Microcontroller pins used for mainboard
26<hr width="75%" size="10" align="left">
27\n The only \b GPIO pins used for the frontend board are used to reset the \ref I2C_mux. The pins, one per board,
28are connected to \b P0.6 and \b P0.9 pins of the &micro;-controller.
29\n One configuration function manges both pins at the same time. The
30function that provide this is Configure_Reset_I2C_mux(), and its use is very simple:
31
32<span style="color:orange;"> <I>
33\code {.c}
34Configure_Reset_I2C_mux();
35\endcode
36</I> </span>
37
38\n The port pin definitions for the I2C mux on front-end board are:
39
40<span style="color:orange;"> <I>
41\code {.c}
42porta_pin_def Reset_I2C_mux_up={porta_0,pin_Rset_i2c_mux_sup}; //!< location of the reset pin of the I2C_mux of frontend board su or giu
43porta_pin_def Reset_I2C_mux_down={porta_0,pin_Rset_i2c_mux_down}; //!< location of the reset pin of the I2C_mux of frontend board su or giu
44\endcode
45</I> </span>
46and:
47<span style="color:orange;"> <I>
48\code {.c}
49// PORTA 0
50#define porta_0 0
51#define pin_Rset_i2c_mux_down 5
52#define pin_Rset_i2c_mux_sup 9
53\endcode
54</I> </span>
55
56The complete function:
57
58\snippet Gpio.c fun_Configure_Reset_I2C_mux
59
60\n During the operation of the I2C_mux the reset pin is set / reset in I2C_mux_select_ch(). The way the reset
61pins are managed is:
62
63<span style="color:orange;"> <I>
64\code {.c}
65// Reset pin of the I2C_mux of board su
66 I2C_mux = &Driver_I2C0;
67 GPIO_PinWrite(pin_Rset_i2c_mux_down.porta_num, pin_Rset_i2c_mux_down.pin_num, 0); //Let's reset the mux
68 Aspetta_tanti_ms(2);
69 GPIO_PinWrite(pin_Rset_i2c_mux_down.porta_num, pin_Rset_i2c_mux_down.pin_num, 1);
70\endcode
71</I> </span>
72
73<span style="color:orange;"> <I>
74\code {.c}
75// Reset pin of the I2C_mux of board giu
76 I2C_mux = &Driver_I2C1;
77 GPIO_PinWrite(Reset_I2C_mux_up.porta_num, Reset_I2C_mux_up.pin_num, 0); //Let's reset the mux
78 Aspetta_tanti_ms(2);
79 GPIO_PinWrite(Reset_I2C_mux_up.porta_num, Reset_I2C_mux_up.pin_num, 1);
80\endcode
81</I> </span>
82
83
84*\section Pin_definitions_postmainboard Microcontroller pins used for postmainboard
85<hr width="75%" size="10" align="left">
86
87\n Several pins, set as input or output, are used. Here the summaries from the various ports:
88
89*\snippet Gpio.h def_Port_0_pins
90\n
91*\snippet Gpio.h def_Port_1_pins
92\n
93*\snippet Gpio.h def_Port_2_pins
94
95
96\n
97 The codes for managing the trimmer are:
98 - \ref Gpio.c
99 - \ref Gpio.h
100*/
101
102
103/******************************************************************************
104Variabili di gianlu
105*******************************************************************************/
106
107//porta 0
108const porta_pin_def Reset_I2C_mux_up={porta_0,pin_Rset_i2c_mux_sup}; //!< location of the reset pin of the I2C_mux of frontend board su or giu
109const porta_pin_def Reset_I2C_mux_down={porta_0,pin_Rset_i2c_mux_down}; //!< location of the reset pin of the I2C_mux of frontend board su or giu
110
111porta_pin_def rele_driver_ch0={porta_0,Chip_Sel_rele_0};
112
113const porta_pin_def ADC_ResIn_A_buffer_down={porta_0,ResIn_buffer_A_down}; //!< Refernce to fgnd of theADC input buffer, if 1 there is a 10kOhm connected to GND
114const porta_pin_def ADC_ResIn_B_buffer_down={porta_0,ResIn_buffer_B_down}; //!< Refernce to fgnd of theADC input buffer, if 1 there is a 10kOhm connected to GND
115const porta_pin_def ADC_ResIn_A_buffer_up={porta_0,ResIn_buffer_A_up}; //!< Refernce to fgnd of theADC input buffer, if 1 there is a 10kOhm connected to GND
116const porta_pin_def ADC_ResIn_B_buffer_up={porta_0,ResIn_buffer_B_up}; //!< Refernce to fgnd of theADC input buffer, if 1 there is a 10kOhm connected to GND
117
118const porta_pin_def CAN_indirizzo_hw[]={ /*! hw Can address */
119 porta_0, B0,
120 porta_0, B1,
121 porta_0, B2,
122 porta_0, B3,
123 porta_0, B4,
124 porta_0, B5,
125 porta_0, B6,
126 porta_0, B7
127};
128const porta_pin_def PGA_DAC_pin_select_ch0={0,PGA_Chip_Sel_DAC_ch0};
129const porta_pin_def PGA_DAC_pin_select_ch1={0,PGA_Chip_Sel_DAC_ch1};
130
131//porta 1
132const porta_pin_def Mux_select_word_0={porta_1,MUX_select_in_0}; //!< selettore 0 del pin di ingresso dell'analog mux
133const porta_pin_def Mux_select_word_1={porta_1,MUX_select_in_1}; //!< selettore 1 del pin di ingresso dell'analog mux
134const porta_pin_def Mux_select_word_2={porta_1,MUX_select_in_2}; //!< selettore 2 del pin di ingresso dell'analog mux
135
136const porta_pin_def Mux_enable_postmainboard_1={porta_1,MUX_Chip_sel_1}; //!< location of the chip select pin of analog mux 1 of postmainboard, 0=off
137const porta_pin_def Mux_enable_postmainboard_2={porta_1,MUX_Chip_sel_2}; //!< location of the chip select pin of analog mux 2 of postmainboard, 0=off
138const porta_pin_def Mux_enable_postmainboard_3={porta_1,MUX_Chip_sel_3}; //!< location of the chip select pin of analog mux 3 of postmainboard, 0=off
139const porta_pin_def Mux_enable_postmainboard_4={porta_1,MUX_Chip_sel_4}; //!< location of the chip select pin of analog mux 4 of postmainboard, 0=off
140const porta_pin_def Mux_enable_postmainboard_5={porta_1,MUX_Chip_sel_5}; //!< location of the chip select pin of analog mux 5 of postmainboard, 0=off
141const porta_pin_def Mux_enable_postmainboard_6={porta_1,MUX_Chip_sel_6}; //!< location of the chip select pin of analog mux 6 of postmainboard, 0=off
142const porta_pin_def Mux_enable_postmainboard_7={porta_1,MUX_Chip_sel_7}; //!< location of the chip select pin of analog mux 7 of postmainboard, 0=off
143const porta_pin_def Mux_enable_postmainboard_8={porta_1,MUX_Chip_sel_8}; //!< location of the chip select pin of analog mux 8 of postmainboard, 0=off
144
145const porta_pin_def ADC_ready_up={porta_1,ADC_ready_up_}; //!< Configuration ADC pin
146const porta_pin_def ADC_Chip_Sel_up={porta_1,ADC_Chip_Sel_up_}; //!< Configuration ADC pin
147const porta_pin_def ADC_reset_up={porta_1,ADC_reset_up_}; //!< Configuration ADC pin
148const porta_pin_def ADC_ready_down={porta_1,ADC_ready_down_}; //!< Configuration ADC pin
149const porta_pin_def ADC_Chip_Sel_down={porta_1,ADC_Chip_Sel_down_}; //!< Configuration ADC pin
150const porta_pin_def ADC_reset_down={porta_1,ADC_reset_down_}; //!< Configuration ADC pin
151
152const porta_pin_def PGA_pre_gain_1_ch0={porta_1,PGA_rele_ch0_2};
153const porta_pin_def PGA_pre_gain_10_ch0={porta_1,PGA_rele_ch0_1};
154const porta_pin_def PGA_pre_gain_1_ch1={porta_1,PGA_rele_ch1_2};
155const porta_pin_def PGA_pre_gain_10_ch1={porta_1,PGA_rele_ch1_1};
156
157//porta 2
158const porta_pin_def Reset_I2C_mux_postfrontend_up={porta_2,pin_Reset_I2C_mux_A}; //!< location of the reset pin of the I2C_mux of post-frontend board su or giu
159const porta_pin_def Reset_I2C_mux_postfrontend_down={porta_2,pin_Reset_I2C_mux_B}; //!< location of the reset pin of the I2C_mux of post-frontend board su or giu
161const porta_pin_def LED_Red ={porta_2,pin_LED_Red}; //!< Green LED
162
163//uint8_t ADC_node_map[52];
164
165/*! \brief Mapping to mux's on postmainboard. Its syntax: bits 0 to 3 are common to all the MUXs and select one
166of the input analog lines; bits 4 to 5 are the address for the chips select for the 2 groups of 4 MUXs.
167The selection of the MUX gropu is trhough the board_up_down.
168
169*\snippet{lineno} Gpio.c vect_ADC_node_map
170*/
171//! <!-- [vect_ADC_node_map] -->
172const uint8_t ADC_node_map[]=
173{
174/*PGA diff or PGA pos indici da 0 a 5 */
175Mux_analog_postmainboard_lines_2_PGA_Output_pos_1, Mux_analog_postmainboard_lines_2_PGA_Output_pos_2,
176Mux_analog_postmainboard_lines_2_PGA_Output_pos_3,Mux_analog_postmainboard_lines_2_PGA_Output_pos_4,
177Mux_analog_postmainboard_lines_2_PGA_Output_pos_5,Mux_analog_postmainboard_lines_2_PGA_Output_pos_6,
178/*PGA neg indici da 6 a 11 */
179Mux_analog_postmainboard_lines_3_PGA_Output_neg_1,Mux_analog_postmainboard_lines_3_PGA_Output_neg_2,
180Mux_analog_postmainboard_lines_3_PGA_Output_neg_3,Mux_analog_postmainboard_lines_3_PGA_Output_neg_4,
181Mux_analog_postmainboard_lines_3_PGA_Output_neg_5,Mux_analog_postmainboard_lines_3_PGA_Output_neg_6,
182/*PRE diff o pos indici da 12 a 17 */
183Mux_analog_postmainboard_lines_1_PRE_pos_1,Mux_analog_postmainboard_lines_1_PRE_pos_2,
184Mux_analog_postmainboard_lines_1_PRE_pos_3,Mux_analog_postmainboard_lines_1_PRE_pos_4,
185Mux_analog_postmainboard_lines_1_PRE_pos_5,Mux_analog_postmainboard_lines_1_PRE_pos_6,
186/*PRE neg indici da 18 a 23 */
187Mux_analog_postmainboard_lines_0_PRE_neg_1,Mux_analog_postmainboard_lines_0_PRE_neg_2,
188Mux_analog_postmainboard_lines_0_PRE_neg_3,Mux_analog_postmainboard_lines_0_PRE_neg_4,
189Mux_analog_postmainboard_lines_0_PRE_neg_5,Mux_analog_postmainboard_lines_0_PRE_neg_6,
190/*Vcc indice 24*/
191Mux_analog_postmainboard_lines_2_Vcc_meas,
192/*Vee indice 25*/
193Mux_analog_postmainboard_lines_3_Vee_meas,
194/*Vdig indice 26*/
195Mux_analog_postmainboard_lines_3_Vdig_5V_meas,
196/*Vreg_n indice 27*/
197Mux_analog_postmainboard_lines_1_SenseVreg_n,
198/*Vreg_p indice 28*/
199Mux_analog_postmainboard_lines_1_SenseVreg_p,
200/*GND sense indice 29*/
201Mux_analog_postmainboard_lines_2_SenseGA,
202/*Analog mux wire 1 indice 30*/
203Mux_analog_postmainboard_lines_0_Analog_Mux_1_out,
204/*Analog mux wire 2 indice 31*/
205Mux_analog_postmainboard_lines_0_Analog_Mux_2_out,
206/*Analog mux connessi al wire 1 indici 32 a 39*/
207Mux_analog_postmainboard_lines_0_Analog_Mux_1_out,Mux_analog_postmainboard_lines_0_Analog_Mux_1_out,
208Mux_analog_postmainboard_lines_0_Analog_Mux_1_out,Mux_analog_postmainboard_lines_0_Analog_Mux_1_out,
209Mux_analog_postmainboard_lines_0_Analog_Mux_1_out,Mux_analog_postmainboard_lines_0_Analog_Mux_1_out,
210Mux_analog_postmainboard_lines_0_Analog_Mux_1_out,Mux_analog_postmainboard_lines_0_Analog_Mux_1_out,
211/*Analog mux connessi al wire 2 indici 40 a 45 (da 46 a 47 buco)*/
212Mux_analog_postmainboard_lines_0_Analog_Mux_2_out,Mux_analog_postmainboard_lines_0_Analog_Mux_2_out,
213Mux_analog_postmainboard_lines_0_Analog_Mux_2_out,Mux_analog_postmainboard_lines_0_Analog_Mux_2_out,
214Mux_analog_postmainboard_lines_0_Analog_Mux_2_out,Mux_analog_postmainboard_lines_0_Analog_Mux_2_out,
215Mux_analog_postmainboard_lines_0_Analog_Mux_2_out,Mux_analog_postmainboard_lines_0_Analog_Mux_2_out,
216/*Analog mux none indice 48*/
217Mux_analog_postmainboard_lines_0_Analog_Mux_2_out,
218/*Analog mux 10 Kohm indice 49*/
219Mux_analog_postmainboard_lines_0_Analog_Mux_2_out,
220/*Dummy per selezionare ADC0 indice 50*/
221Mux_analog_postmainboard_lines_0_Analog_Mux_2_out,
222/*Dummy per selezionare ADC0 indice 51*/
223Mux_analog_postmainboard_lines_2_PGA_Output_pos_3};
224//! <!-- [vect_ADC_node_map] -->
225
226/******************************************************************************
227FINE Variabili di gianlu
228*******************************************************************************/
229
230
231//***********INIZIO CROSS********************************
232/******************************************************************************
233 Configure_Reset_I2C_mux
234*******************************************************************************/
235
236
237 /*! \brief Set the reset pins of te I2C mux, reset the I2C mux and put them into operation.
238
239 *\return No input parameters
240
241 *\snippet Gpio.c fun_Configure_Reset_I2C_mux
242 */
243 //! <!-- [fun_Configure_Reset_I2C_mux] -->
245 // Viene configurato il pin del Chip Selector dell'I2C Mux A
246 status= PIN_Configure(Reset_I2C_mux_down.porta_num, Reset_I2C_mux_down.pin_num, PIN_FUNC_0, PIN_PINMODE_PULLUP, PIN_PINMODE_NORMAL);
247 GPIO_SetDir(Reset_I2C_mux_down.porta_num, Reset_I2C_mux_down.pin_num, GPIO_DIR_OUTPUT);
248
249 // Viene configurato il pin del Chip Selector dell'I2C Mux B
250 status= PIN_Configure(Reset_I2C_mux_up.porta_num, Reset_I2C_mux_up.pin_num, PIN_FUNC_0, PIN_PINMODE_PULLUP, PIN_PINMODE_NORMAL);
251 GPIO_SetDir(Reset_I2C_mux_up.porta_num, Reset_I2C_mux_up.pin_num, GPIO_DIR_OUTPUT);
252
253 // Viene configurato il pin del Chip Selector dell'I2C Mux up della postmainboard
254 status= PIN_Configure(Reset_I2C_mux_postfrontend_up.porta_num, Reset_I2C_mux_postfrontend_up.pin_num, PIN_FUNC_0, PIN_PINMODE_PULLUP, PIN_PINMODE_NORMAL);
255 GPIO_SetDir(Reset_I2C_mux_postfrontend_up.porta_num, Reset_I2C_mux_postfrontend_up.pin_num, GPIO_DIR_OUTPUT);
256
257 // Viene configurato il pin del Chip Selector dell'I2C Mux down della postmainboard
258 status= PIN_Configure(Reset_I2C_mux_postfrontend_down.porta_num, Reset_I2C_mux_postfrontend_down.pin_num, PIN_FUNC_0, PIN_PINMODE_PULLUP, PIN_PINMODE_NORMAL);
259 GPIO_SetDir(Reset_I2C_mux_postfrontend_down.porta_num, Reset_I2C_mux_postfrontend_down.pin_num, GPIO_DIR_OUTPUT);
260
261 GPIO_PinWrite(Reset_I2C_mux_down.porta_num, Reset_I2C_mux_down.pin_num, 0); //!< now reset the I2C mux able
262 GPIO_PinWrite(Reset_I2C_mux_up.porta_num, Reset_I2C_mux_up.pin_num, 0); //!< now reset the I2C mux able
263 GPIO_PinWrite(Reset_I2C_mux_postfrontend_up.porta_num, Reset_I2C_mux_postfrontend_up.pin_num, 0); //!< now reset the I2C mux able
264 GPIO_PinWrite(Reset_I2C_mux_postfrontend_down.porta_num, Reset_I2C_mux_postfrontend_down.pin_num, 0); //!< now reset the I2C mux able
265 Aspetta_tanti_ms(1); //Wait for stability
266 GPIO_PinWrite(Reset_I2C_mux_down.porta_num, Reset_I2C_mux_down.pin_num, 1); //!< now put the I2C mux into operation state
267 GPIO_PinWrite(Reset_I2C_mux_up.porta_num, Reset_I2C_mux_up.pin_num, 1); //!< now put the I2C mux into operation state
268 GPIO_PinWrite(Reset_I2C_mux_postfrontend_up.porta_num, Reset_I2C_mux_postfrontend_up.pin_num, 1); //!< now reset the I2C mux able
269 GPIO_PinWrite(Reset_I2C_mux_postfrontend_down.porta_num, Reset_I2C_mux_postfrontend_down.pin_num, 1); //!< now reset the I2C mux able
270}
271 //! <!-- [fun_Configure_Reset_I2C_mux] -->
272
273
274//const porta_pin_def LED_Green ={porta_2,pin_LED_Green}; //!< Green LED
275//const porta_pin_def LED_Red ={porta_2,pin_LED_Red}; //!< Green LED
276
277 /*! \brief Red and Green LED pin configuration and reset.
278
279 *\return No input parameters
280
281 *\snippet Gpio.c fun_LED_pin_configuration
282 */
283 //! <!-- [fun_LED_pin_configuration] -->
285
286 // Viene configurato il led Verde
287 status= PIN_Configure(LED_Green.porta_num, LED_Green.pin_num, PIN_FUNC_0, PIN_PINMODE_PULLUP, PIN_PINMODE_NORMAL);
288 GPIO_SetDir(LED_Green.porta_num, LED_Green.pin_num, GPIO_DIR_OUTPUT);
289
290 // Viene configurato il led Rosso
291 status= PIN_Configure(LED_Red.porta_num, LED_Red.pin_num, PIN_FUNC_0, PIN_PINMODE_PULLUP, PIN_PINMODE_NORMAL);
292 GPIO_SetDir(LED_Red.porta_num, LED_Red.pin_num, GPIO_DIR_OUTPUT);
293
294 GPIO_PinWrite(LED_Green.porta_num, LED_Green.pin_num, 0); //!< now the green LED is switched OFF at startup
295 GPIO_PinWrite(LED_Red.porta_num, LED_Red.pin_num, 0); //!< now the red LED is switched OFF at startup
296
297}
298 //! <!-- [fun_LED_pin_configuration] -->
299
300
301/*! \brief Set the reset pins of te analog mux's. Take care: reset=0 means output off
302
303 *\return No input parameters
304
305 *\snippet Gpio.c fun_Configure_Reset_selection_port_analog_mux_ResIn_ADC_buffer
306 */
307 //! <!-- [fun_Configure_Reset_selection_port_analog_mux_ResIn_ADC_buffer] -->
309 uint8_t ii;
310
311 // Vengono configurati i pin dei Chip Selector degli anolog Mux da 1 a 8 ed impostati a 0, off condition
312 //sono in sequenza
313 for (ii=0;ii<8;ii++){
314 status= PIN_Configure(Mux_enable_postmainboard_1.porta_num, Mux_enable_postmainboard_1.pin_num +ii, PIN_FUNC_0, PIN_PINMODE_PULLUP, PIN_PINMODE_NORMAL);
315 GPIO_SetDir(Mux_enable_postmainboard_1.porta_num, Mux_enable_postmainboard_1.pin_num + ii, GPIO_DIR_OUTPUT);
316 GPIO_PinWrite(Mux_enable_postmainboard_1.porta_num, Mux_enable_postmainboard_1.pin_num + ii, 0);
317 }
318 //setting of the parallel configuration pins of the analog mux
319 for (ii=0;ii<2;ii++){
320 status= PIN_Configure(Mux_select_word_0.porta_num, Mux_select_word_0.pin_num +ii, PIN_FUNC_0, PIN_PINMODE_PULLUP, PIN_PINMODE_NORMAL);
321 GPIO_SetDir(Mux_select_word_0.porta_num, Mux_select_word_0.pin_num + ii, GPIO_DIR_OUTPUT);
322 GPIO_PinWrite(Mux_select_word_0.porta_num, Mux_select_word_0.pin_num + ii, 0);
323 }
324 //Non sono in sequenza i pin in questo caso
325 status= PIN_Configure(Mux_select_word_2.porta_num, Mux_select_word_2.pin_num , PIN_FUNC_0, PIN_PINMODE_PULLUP, PIN_PINMODE_NORMAL);
326 GPIO_SetDir(Mux_select_word_2.porta_num, Mux_select_word_2.pin_num , GPIO_DIR_OUTPUT);
327 GPIO_PinWrite(Mux_select_word_2.porta_num, Mux_select_word_2.pin_num , 0);
328
329
330 //ResIn of ADC buffer input
331 status= PIN_Configure(ADC_ResIn_A_buffer_down.porta_num, ADC_ResIn_A_buffer_down.pin_num , PIN_FUNC_0, PIN_PINMODE_PULLUP, PIN_PINMODE_NORMAL);
332 GPIO_SetDir(ADC_ResIn_A_buffer_down.porta_num, ADC_ResIn_A_buffer_down.pin_num , GPIO_DIR_OUTPUT);
333 GPIO_PinWrite(ADC_ResIn_A_buffer_down.porta_num, ADC_ResIn_A_buffer_down.pin_num , 1);
334
335 //ResIn of ADC buffer input
336 status= PIN_Configure(ADC_ResIn_B_buffer_down.porta_num, ADC_ResIn_B_buffer_down.pin_num , PIN_FUNC_0, PIN_PINMODE_PULLUP, PIN_PINMODE_NORMAL);
337 GPIO_SetDir(ADC_ResIn_B_buffer_down.porta_num, ADC_ResIn_B_buffer_down.pin_num , GPIO_DIR_OUTPUT);
338 GPIO_PinWrite(ADC_ResIn_B_buffer_down.porta_num, ADC_ResIn_B_buffer_down.pin_num , 1);
339
340 //ResIn of ADC buffer input
341 status= PIN_Configure(ADC_ResIn_A_buffer_up.porta_num, ADC_ResIn_A_buffer_up.pin_num , PIN_FUNC_0, PIN_PINMODE_PULLUP, PIN_PINMODE_NORMAL);
342 GPIO_SetDir(ADC_ResIn_A_buffer_up.porta_num, ADC_ResIn_A_buffer_up.pin_num , GPIO_DIR_OUTPUT);
343 GPIO_PinWrite(ADC_ResIn_A_buffer_up.porta_num, ADC_ResIn_A_buffer_up.pin_num , 1);
344
345 //ResIn of ADC buffer input
346 status= PIN_Configure(ADC_ResIn_B_buffer_up.porta_num, ADC_ResIn_B_buffer_up.pin_num , PIN_FUNC_0, PIN_PINMODE_PULLUP, PIN_PINMODE_NORMAL);
347 GPIO_SetDir(ADC_ResIn_B_buffer_up.porta_num, ADC_ResIn_B_buffer_up.pin_num , GPIO_DIR_OUTPUT);
348 GPIO_PinWrite(ADC_ResIn_B_buffer_up.porta_num, ADC_ResIn_B_buffer_up.pin_num , 1);
349
350
351}
352 //! <!-- [fun_Configure_Reset_selection_port_analog_mux_ResIn_ADC_buffer] -->
353
354
355/*! \brief ADc pins are initialized here
356
357 *\return No input parameters
358
359 *\snippet Gpio.c fun_ADC_pin_configurations
360 */
361 //! <!-- [fun_ADC_pin_configurations] -->
363 // Viene configurato il pin dell'ADC_READY
364 status= PIN_Configure(ADC_ready_down.porta_num, ADC_ready_down.pin_num, PIN_FUNC_0,PIN_PINMODE_PULLUP, PIN_PINMODE_NORMAL);
365 GPIO_SetDir(ADC_ready_down.porta_num, ADC_ready_down.pin_num, GPIO_DIR_INPUT);
366 status= PIN_Configure(ADC_ready_up.porta_num, ADC_ready_up.pin_num, PIN_FUNC_0,PIN_PINMODE_PULLUP, PIN_PINMODE_NORMAL);
367 GPIO_SetDir(ADC_ready_up.porta_num, ADC_ready_up.pin_num, GPIO_DIR_INPUT);
368
369 //ADC reset
370 status= PIN_Configure(ADC_reset_down.porta_num, ADC_reset_down.pin_num , PIN_FUNC_0, PIN_PINMODE_PULLUP, PIN_PINMODE_NORMAL);
371 GPIO_SetDir(ADC_reset_down.porta_num, ADC_reset_down.pin_num , GPIO_DIR_OUTPUT);
372 GPIO_PinWrite(ADC_reset_down.porta_num, ADC_reset_down.pin_num , 0);
373 status= PIN_Configure(ADC_reset_up.porta_num, ADC_reset_up.pin_num , PIN_FUNC_0, PIN_PINMODE_PULLUP, PIN_PINMODE_NORMAL);
374 GPIO_SetDir(ADC_reset_up.porta_num, ADC_reset_up.pin_num , GPIO_DIR_OUTPUT);
375 GPIO_PinWrite(ADC_reset_up.porta_num, ADC_reset_up.pin_num , 0);
377 GPIO_PinWrite(ADC_reset_down.porta_num, ADC_reset_down.pin_num , 1);
378 GPIO_PinWrite(ADC_reset_up.porta_num, ADC_reset_up.pin_num , 1);
379
380 //ADC chip select
381 status= PIN_Configure(ADC_Chip_Sel_down.porta_num, ADC_Chip_Sel_down.pin_num , PIN_FUNC_0, PIN_PINMODE_PULLUP, PIN_PINMODE_NORMAL);
382 GPIO_SetDir(ADC_Chip_Sel_down.porta_num, ADC_Chip_Sel_down.pin_num , GPIO_DIR_OUTPUT);
383 GPIO_PinWrite(ADC_Chip_Sel_down.porta_num, ADC_Chip_Sel_down.pin_num , 1);
384 status= PIN_Configure(ADC_Chip_Sel_up.porta_num, ADC_Chip_Sel_up.pin_num , PIN_FUNC_0, PIN_PINMODE_PULLUP, PIN_PINMODE_NORMAL);
385 GPIO_SetDir(ADC_Chip_Sel_up.porta_num, ADC_Chip_Sel_up.pin_num , GPIO_DIR_OUTPUT);
386 GPIO_PinWrite(ADC_Chip_Sel_up.porta_num, ADC_Chip_Sel_up.pin_num , 1);
387
388// //ADC input buffer resistor
389// status= PIN_Configure(ADC_ResIn_B_buffer_down.porta_num, ADC_ResIn_B_buffer_down.pin_num , PIN_FUNC_0, PIN_PINMODE_PULLUP, PIN_PINMODE_NORMAL);
390// GPIO_SetDir(ADC_ResIn_B_buffer_down.porta_num, ADC_Chip_Sel_down.pin_num , GPIO_DIR_OUTPUT);
391// GPIO_PinWrite(ADC_ResIn_B_buffer_down.porta_num, ADC_ResIn_B_buffer_down.pin_num , 1);
392// status= PIN_Configure(ADC_ResIn_B_buffer_up.porta_num, ADC_ResIn_B_buffer_up.pin_num , PIN_FUNC_0, PIN_PINMODE_PULLUP, PIN_PINMODE_NORMAL);
393// GPIO_SetDir(ADC_ResIn_B_buffer_up.porta_num, ADC_ResIn_B_buffer_up.pin_num , GPIO_DIR_OUTPUT);
394// GPIO_PinWrite(ADC_ResIn_B_buffer_up.porta_num, ADC_ResIn_B_buffer_up.pin_num , 1);
395//
396// status= PIN_Configure(ADC_ResIn_A_buffer_down.porta_num, ADC_ResIn_A_buffer_down.pin_num , PIN_FUNC_0, PIN_PINMODE_PULLUP, PIN_PINMODE_NORMAL);
397// GPIO_SetDir(ADC_ResIn_A_buffer_down.porta_num, ADC_ResIn_A_buffer_down.pin_num , GPIO_DIR_OUTPUT);
398// GPIO_PinWrite(ADC_ResIn_A_buffer_down.porta_num, ADC_ResIn_A_buffer_down.pin_num , 1);
399// status= PIN_Configure(ADC_ResIn_A_buffer_up.porta_num, ADC_ResIn_A_buffer_up.pin_num , PIN_FUNC_0, PIN_PINMODE_PULLUP, PIN_PINMODE_NORMAL);
400// GPIO_SetDir(ADC_ResIn_A_buffer_up.porta_num, ADC_ResIn_A_buffer_up.pin_num , GPIO_DIR_OUTPUT);
401// GPIO_PinWrite(ADC_ResIn_A_buffer_up.porta_num, ADC_ResIn_A_buffer_up.pin_num , 1);
402
403}
404//! <!-- [fun_ADC_pin_configurations] -->
405
406
407/*! \brief Switches for the selection of the hw CAN bus address.
408Pin are set as input with internal pull-up.
409
410 *\return No input parameters
411
412 *\snippet Gpio.c fun_Configure_Bit_Address_for_CAN
413 */
414 //! <!-- [fun_Configure_Bit_Address_for_CAN] -->
416{
417 uint8_t iii;
418// B0, ... B7 addresses
419 for (iii=0; iii<8;iii++){
420 status= PIN_Configure(CAN_indirizzo_hw[iii].porta_num, CAN_indirizzo_hw[iii].pin_num, PIN_FUNC_0,PIN_PINMODE_PULLUP, PIN_PINMODE_NORMAL);
421 GPIO_SetDir(CAN_indirizzo_hw[iii].porta_num, CAN_indirizzo_hw[iii].pin_num, GPIO_DIR_INPUT);
422 }
423
424}
425 //! <!-- [fun_Configure_Bit_Address_for_CAN] -->
426
427
428
429
430/*! \brief ADC map for reading nodes on postmainboard
431
432 *\return No input parameters
433
434 *\snippet Gpio.c fun_ADC_noding_map
435 */
436 //! <!-- [fun_ADC_noding_map] -->
437//void ADC_noding_map(void){
438// uint8_t ii;
439// //I mux si xontano da 0, ed anche i canali
440// //Per board up quelli sotto sono i numeri da considerare perch\'e i mux vanno da 0 a 3.
441// //Per board down i mux vanno da 4 a 7, quindi va sommato b100000, ovvero 0x20, ovvero d32.
442// for(ii=0;ii<6;ii++){//Nodi pga
443// ADC_node_map[ii]=19 -1 +ii ; //pga positive, terzo mux, il 2, dal pin 3, il -1 perch\'e si contano da zero le linee
444// ADC_node_map[ii+6]=27-1 + ii; //pga negative, quarto mux, il 3, dal pin 3
445// }
446// for(ii=0;ii<6;ii++){//Nodi out pre
447// ADC_node_map[ii +12]=9-1 +ii ; //out pre positive, secondo mux, l'1, dal pin 9
448// ADC_node_map[ii+18]=3-1+ii ; //out pre negative, primo mux, lo 0, dal pin 3
449// }
450// ADC_node_map[24]=18-1; //Vcc
451// ADC_node_map[25]=25-1; //Vee
452// ADC_node_map[26]=26-1; //Vdig
453// ADC_node_map[27]=16-1; //Vreg_n
454// ADC_node_map[28]=15-1; //Vreg_p
455// ADC_node_map[29]=17-1; //GND sense
456//
457// //Dai nodi 32 in su bisogna selezionare questi sulla mainboard
458// ADC_node_map[30]=2-1; //Analog mux wire 1, nodi dal 32 al 39
459// ADC_node_map[31]=1-1; //Analog mux wire 2, nodi dal 40 al 49
460//
461// for(ii=32;ii<32+8;ii++){//Mux
462// ADC_node_map[ii]=1; //Analog mux wire 1, nodi dal 32 al 39
463// ADC_node_map[ii+8]=0; //Analog mux wire 2, nodi dal 40 al 49
464// }
465// ADC_node_map[48]=0; //Analog mux wire 2, none
466// ADC_node_map[49]=0; //Analog mux wire 2, 10 Kohm to gnd
467//
468// ADC_node_map[50]=0; //This is only to select ADC ch0
469// ADC_node_map[51]=20; //This is only to select ADC ch1
470//
471//}
472 //! <!-- [fun_ADC_noding_map] -->
473
474//*****************************fine cross**************************************
475
476/******************************************************************************
477 Configure_Chip_Sel
478*******************************************************************************/
479//void Configure_Chip_Sel(void)
480//{
481///* Vengono configurati i pin del Chip Selector per i multiplexer
482// Porta 1, PIN_FUNC_0 = Modalit\'a GPIO*/
483//// status= PIN_Configure(1, Chip_Sel_Multiplexer_4 ,PIN_FUNC_0,PIN_PINMODE_PULLUP, PIN_PINMODE_NORMAL);
484//// status= PIN_Configure(1, Chip_Sel_Multiplexer_3 ,PIN_FUNC_0,PIN_PINMODE_PULLUP, PIN_PINMODE_NORMAL);
485// status= PIN_Configure(1, Chip_Sel_Multiplexer_2 ,PIN_FUNC_0,PIN_PINMODE_PULLUP, PIN_PINMODE_NORMAL);
486// status= PIN_Configure(1, Chip_Sel_Multiplexer_1 ,PIN_FUNC_0,PIN_PINMODE_PULLUP, PIN_PINMODE_NORMAL);
487//
488//// Vengono configurati i pin del Chip Selector come OUTPUT
489//// GPIO_SetDir(1, Chip_Sel_Multiplexer_4, GPIO_DIR_OUTPUT);
490//// GPIO_SetDir(1, Chip_Sel_Multiplexer_3, GPIO_DIR_OUTPUT);
491// GPIO_SetDir(1, Chip_Sel_Multiplexer_2, GPIO_DIR_OUTPUT);
492// GPIO_SetDir(1, Chip_Sel_Multiplexer_1, GPIO_DIR_OUTPUT);
493//}
494
495
496/******************************************************************************
497 Configure_Sel_Par_Interruttori
498*******************************************************************************/
499//void Configure_Sel_Par_Interruttori(void)
500//{
501///* Vengono configurati i pin del Sel Par Interruttori per i multiplexer
502// Porta 1, PIN_FUNC_0 = Modalit\'a GPIO*/
503// status= PIN_Configure(1, Sel_Par_Interruttori_3, PIN_FUNC_0,PIN_PINMODE_PULLUP, PIN_PINMODE_NORMAL);
504// status= PIN_Configure(1, Sel_Par_Interruttori_2, PIN_FUNC_0,PIN_PINMODE_PULLUP, PIN_PINMODE_NORMAL);
505// status= PIN_Configure(1, Sel_Par_Interruttori_1, PIN_FUNC_0,PIN_PINMODE_PULLUP, PIN_PINMODE_NORMAL);
506//
507//// Vengono configurati i pin del Sel Par Interruttori come OUTPUT
508// GPIO_SetDir(1, Sel_Par_Interruttori_3, GPIO_DIR_OUTPUT);
509// GPIO_SetDir(1, Sel_Par_Interruttori_2, GPIO_DIR_OUTPUT);
510// GPIO_SetDir(1, Sel_Par_Interruttori_1, GPIO_DIR_OUTPUT);
511//}
512
513
514/******************************************************************************
515 Configure_Adc_Ready
516*******************************************************************************/
517//void Configure_Adc_Ready(void)
518//{
519// // Viene configurato il pin dell'ADC_READY
520// status= PIN_Configure(1, Adc_ready, PIN_FUNC_0,PIN_PINMODE_PULLUP, PIN_PINMODE_NORMAL);
521// GPIO_SetDir(1, Adc_ready, GPIO_DIR_INPUT);
522//}
523
524
525/******************************************************************************
526 Configure_Chip_Sel_ADC
527*******************************************************************************/
528//void Configure_Chip_Sel_ADC(void)
529//{
530// // Viene configurato il pin del Chip Selector dell'ADC
531// status= PIN_Configure(0, Chip_Sel_Adc, PIN_FUNC_0, PIN_PINMODE_PULLUP, PIN_PINMODE_NORMAL);
532// GPIO_SetDir(0, Chip_Sel_Adc, GPIO_DIR_OUTPUT);
533//}
534
535
536/******************************************************************************
537 Configure_Chip_Sel_rele_ch0
538*******************************************************************************/
539//void Configure_Chip_Sel_rele_ch0(void)
540//{
541// // Viene configurato il pin del Chip Selector dei rele del canale 0
542// status= PIN_Configure(0, Chip_Sel_rele_0, PIN_FUNC_0, PIN_PINMODE_PULLUP, PIN_PINMODE_NORMAL);
543// GPIO_SetDir(0, Chip_Sel_rele_0 , GPIO_DIR_OUTPUT);
544//}
545
546
547/******************************************************************************
548 Configure_Chip_Sel_rele_ch1
549*******************************************************************************/
550//void Configure_Chip_Sel_rele_ch1(void)
551//{
552// // Viene configurato il pin del Chip Selector dei rele del canale 1
553// status= PIN_Configure(0, Chip_Sel_rele_1, PIN_FUNC_0, PIN_PINMODE_PULLUP, PIN_PINMODE_NORMAL);
554// GPIO_SetDir(0, Chip_Sel_rele_1, GPIO_DIR_OUTPUT);
555//}
556
557
558/******************************************************************************
559 Configure_Reset_ch0
560*******************************************************************************/
561//void Configure_Reset_ch0(void)
562//{
563// // Viene configurato il pin del Reset dei rele del canale 0
564// status= PIN_Configure(1, Reset_ch0, PIN_FUNC_0, PIN_PINMODE_PULLUP, PIN_PINMODE_NORMAL);
565// GPIO_SetDir(1, Reset_ch0, GPIO_DIR_OUTPUT);
566//}
567
568
569/******************************************************************************
570 Configure_Set_ch0
571*******************************************************************************/
572//void Configure_Set_ch0(void)
573//{
574// // Viene configurato il pin del Set dei rele del canale 0
575// status= PIN_Configure(1, Set_ch0, PIN_FUNC_0, PIN_PINMODE_PULLUP, PIN_PINMODE_NORMAL);
576// GPIO_SetDir(1, Set_ch0, GPIO_DIR_OUTPUT);
577//}
578
579
580/******************************************************************************
581 Configure_Reset_ch1
582*******************************************************************************/
583//void Configure_Reset_ch1(void)
584//{
585// // Viene configurato il pin del Reset dei rele del canale 1
586// status= PIN_Configure(1, Reset_ch1, PIN_FUNC_0, PIN_PINMODE_PULLUP, PIN_PINMODE_NORMAL);
587// GPIO_SetDir(1, Reset_ch1, GPIO_DIR_OUTPUT);
588//}
589
590
591/******************************************************************************
592 Configure_Set_ch1
593*******************************************************************************/
594//void Configure_Set_ch1(void)
595//{
596// // Viene configurato il pin del Set dei rele del canale 1
597// status= PIN_Configure(1, Set_ch1, PIN_FUNC_0, PIN_PINMODE_PULLUP, PIN_PINMODE_NORMAL);
598// GPIO_SetDir(1, Set_ch1, GPIO_DIR_OUTPUT);
599//}
600
601
602/******************************************************************************
603 Configure_PGA_Chip_Sel_DAC_ch0
604*******************************************************************************/
605//void Configure_PGA_Chip_Sel_DAC_ch0(void)
606//{
607// // Viene configurato il pin del Chip Selector del DAC del canale 0
608// status= PIN_Configure(0, PGA_Chip_Sel_DAC_ch0, PIN_FUNC_0, PIN_PINMODE_PULLUP, PIN_PINMODE_NORMAL);
609// GPIO_SetDir(0, PGA_Chip_Sel_DAC_ch0, GPIO_DIR_OUTPUT);
610//}
611
612
613/******************************************************************************
614 Configure_PGA_Chip_Sel_DAC_ch1
615*******************************************************************************/
616//void Configure_PGA_Chip_Sel_DAC_ch1(void)
617//{
618// // Viene configurato il pin del Chip Selector del DAC del canale 1
619// status= PIN_Configure(0, PGA_Chip_Sel_DAC_ch1, PIN_FUNC_0, PIN_PINMODE_PULLUP, PIN_PINMODE_NORMAL);
620// GPIO_SetDir(0, PGA_Chip_Sel_DAC_ch1, GPIO_DIR_OUTPUT);
621//}
622
623
624/******************************************************************************
625 Configure_PGA_rele_ch0_1
626*******************************************************************************/
627//void Configure_PGA_rele_ch0_1(void)
628//{
629// // Viene configurato il pin del PGA_rele_1 del canale 0
630// status= PIN_Configure(1, PGA_rele_ch0_1, PIN_FUNC_0, PIN_PINMODE_PULLUP, PIN_PINMODE_NORMAL);
631// GPIO_SetDir(1, PGA_rele_ch0_1, GPIO_DIR_OUTPUT);
632//}
633
634
635/******************************************************************************
636 Configure_PGA_rele_ch0_2
637*******************************************************************************/
638//void Configure_PGA_rele_ch0_2(void)
639//{
640// // Viene configurato il pin del PGA_rele_2 del canale 0
641// status= PIN_Configure(1, PGA_rele_ch0_2, PIN_FUNC_0, PIN_PINMODE_PULLUP, PIN_PINMODE_NORMAL);
642// GPIO_SetDir(1, PGA_rele_ch0_2, GPIO_DIR_OUTPUT);
643//}
644
645
646/******************************************************************************
647 Configure_PGA_rele_ch1_1
648*******************************************************************************/
649//void Configure_PGA_rele_ch1_1(void)
650//{
651// // Viene configurato il pin del PGA_rele_1 del canale 1
652// status= PIN_Configure(1, PGA_rele_ch1_1, PIN_FUNC_0, PIN_PINMODE_PULLUP, PIN_PINMODE_NORMAL);
653// GPIO_SetDir(1, PGA_rele_ch1_1, GPIO_DIR_OUTPUT);
654//}
655
656
657/******************************************************************************
658 Configure_PGA_rele_ch1_2
659*******************************************************************************/
660//void Configure_PGA_rele_ch1_2(void)
661//{
662// // Viene configurato il pin del PGA_rele_2 del canale 1
663// status= PIN_Configure(1, PGA_rele_ch1_2, PIN_FUNC_0, PIN_PINMODE_PULLUP, PIN_PINMODE_NORMAL);
664// GPIO_SetDir(1, PGA_rele_ch1_2, GPIO_DIR_OUTPUT);
665//}
666
667
668/******************************************************************************
669 Configure_Led_verde
670*******************************************************************************/
672{
673 // Viene configurato il pin del Led Verde
674 status= PIN_Configure(Porta_Led_verde, Led_verde, PIN_FUNC_0, PIN_PINMODE_PULLUP, PIN_PINMODE_NORMAL);
675 GPIO_SetDir(Porta_Led_verde, Led_verde, GPIO_DIR_OUTPUT);
676}
677
678
679/******************************************************************************
680 Configure_Led_rosso
681*******************************************************************************/
682//void Configure_Led_rosso (void)
683//{
684// // Viene configurato il pin del Led Rosso
685// status= PIN_Configure(Porta_Led_rosso, Led_rosso, PIN_FUNC_0, PIN_PINMODE_PULLUP, PIN_PINMODE_NORMAL);
686// GPIO_SetDir(Porta_Led_rosso, Led_rosso, GPIO_DIR_OUTPUT);
687//}
688
689
690/******************************************************************************
691 Configure_Pin_Alimentazione
692*******************************************************************************/
693//void Configure_Pin_Alimentazione (void)
694//{
695// status = PIN_Configure(2, DIG_5, PIN_FUNC_0, PIN_PINMODE_PULLUP, PIN_PINMODE_NORMAL);
696// GPIO_SetDir(2, DIG_5, GPIO_DIR_OUTPUT);
697// status = PIN_Configure(2, DIG_3_3, PIN_FUNC_0, PIN_PINMODE_PULLUP, PIN_PINMODE_NORMAL);
698// GPIO_SetDir(2, DIG_3_3, GPIO_DIR_OUTPUT);
699//
700// //Vengono accese Vref pos e Vref neg
701// status= PIN_Configure(1, Shut_Vrefp_Vrefn, PIN_FUNC_0, PIN_PINMODE_PULLUP, PIN_PINMODE_NORMAL);
702// GPIO_SetDir(1, Shut_Vrefp_Vrefn, GPIO_DIR_INPUT);
703//
704// //Vengono accese Vcc e Vee
705// status= PIN_Configure(1, Shut_Vcc_Vee, PIN_FUNC_0, PIN_PINMODE_PULLUP, PIN_PINMODE_NORMAL);
706// GPIO_SetDir(1, Shut_Vcc_Vee, GPIO_DIR_INPUT);
707//}
708
709
const porta_pin_def ADC_reset_down
Configuration ADC pin.
Definition: Gpio.c:150
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 ADC_ready_down
Configuration ADC pin.
Definition: Gpio.c:148
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 Reset_I2C_mux_down
location of the reset pin of the I2C_mux of frontend board su or giu
Definition: Gpio.c:109
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 LED_Red
Green LED.
Definition: Gpio.c:161
void LED_pin_configuration(void)
Red and Green LED pin configuration and reset.
Definition: Gpio.c:284
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
void ADC_pin_configurations(void)
ADc pins are initialized here.
Definition: Gpio.c:362
const porta_pin_def Mux_select_word_1
selettore 1 del pin di ingresso dell'analog mux
Definition: Gpio.c:133
const porta_pin_def ADC_Chip_Sel_up
Configuration ADC pin.
Definition: Gpio.c:146
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 Reset_I2C_mux_up
location of the reset pin of the I2C_mux of frontend board su or giu
Definition: Gpio.c:108
const porta_pin_def ADC_ready_up
Configuration ADC pin.
Definition: Gpio.c:145
const porta_pin_def Mux_select_word_0
selettore 0 del pin di ingresso dell'analog mux
Definition: Gpio.c:132
void Configure_Reset_selection_port_analog_mux_ResIn_ADC_buffer(void)
Set the reset pins of te analog mux's. Take care: reset=0 means output off.
Definition: Gpio.c:308
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 LED_Green
Green LED.
Definition: Gpio.c:160
void Configure_Reset_I2C_mux(void)
Set the reset pins of te I2C mux, reset the I2C mux and put them into operation.
Definition: Gpio.c:244
const porta_pin_def Reset_I2C_mux_postfrontend_up
location of the reset pin of the I2C_mux of post-frontend board su or giu
Definition: Gpio.c:158
void Configure_Bit_Address_for_CAN(void)
Switches for the selection of the hw CAN bus address. Pin are set as input with internal pull-up.
Definition: Gpio.c:415
void Configure_Led_verde(void)
ADC map for reading nodes on postmainboard.
Definition: Gpio.c:671
const porta_pin_def ADC_ResIn_A_buffer_down
Refernce to fgnd of theADC input buffer, if 1 there is a 10kOhm connected to GND.
Definition: Gpio.c:113
const porta_pin_def CAN_indirizzo_hw[]
hw Can address
Definition: Gpio.c:118
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 ADC_ResIn_A_buffer_up
Refernce to fgnd of theADC input buffer, if 1 there is a 10kOhm connected to GND.
Definition: Gpio.c:115
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 ADC_Chip_Sel_down
Configuration ADC pin.
Definition: Gpio.c:149
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
const porta_pin_def ADC_ResIn_B_buffer_down
Refernce to fgnd of theADC input buffer, if 1 there is a 10kOhm connected to GND.
Definition: Gpio.c:114
const porta_pin_def Reset_I2C_mux_postfrontend_down
location of the reset pin of the I2C_mux of post-frontend board su or giu
Definition: Gpio.c:159
const porta_pin_def ADC_ResIn_B_buffer_up
Refernce to fgnd of theADC input buffer, if 1 there is a 10kOhm connected to GND.
Definition: Gpio.c:116
const porta_pin_def ADC_reset_up
Configuration ADC pin.
Definition: Gpio.c:147
#define pin_LED_Green
Definition: Gpio.h:165
#define porta_0
Port 0 pin usage.
Definition: Gpio.h:78
#define porta_1
Port 1 pin usage.
Definition: Gpio.h:114
#define pin_Reset_I2C_mux_B
Definition: Gpio.h:164
#define pin_Reset_I2C_mux_A
Definition: Gpio.h:163
#define pin_LED_Red
Definition: Gpio.h:166
#define porta_2
Port 2 pin usage.
Definition: Gpio.h:162
void Aspetta_tanti_ms(int millisecondi)
The timing function.
Definition: Timer.c:52
Definition: Gpio.h:13