CROSS Technical Documentation User Manual and Technical Doc.
INFN Milano Bicocca
Loading...
Searching...
No Matches
Gpio.h
Go to the documentation of this file.
1// DOCUMENTAZIONE DOXYGEN
2/// \file
3
4
5// Viene inizializzato un parametro
6#include <stdint.h>
7
8extern int32_t status;
9
10/******************************************************************************
11Variabili di gianlu
12*******************************************************************************/
13typedef struct porta_pin{
14 unsigned char porta_num;
15 unsigned char pin_num;
17
18//extern uint8_t ADC_node_map[];
19const extern uint8_t ADC_node_map[]; //!< Mapping to mux's on postmainboard
20
23
24const extern porta_pin_def Reset_I2C_mux_up; //!< location of the reset pin of the I2C_mux of frontend board su or giu
25const extern porta_pin_def Reset_I2C_mux_down; //!< location of the reset pin of the I2C_mux of frontend board su or giu
26
27const extern porta_pin_def Mux_enable_postmainboard_1; //!< location of the chip select pin of analog mux 1 of postmainboard, 0=off
28const extern porta_pin_def Mux_enable_postmainboard_2; //!< location of the chip select pin of analog mux 2 of postmainboard, 0=off
29const extern porta_pin_def Mux_enable_postmainboard_3; //!< location of the chip select pin of analog mux 3 of postmainboard, 0=off
30const extern porta_pin_def Mux_enable_postmainboard_4; //!< location of the chip select pin of analog mux 4 of postmainboard, 0=off
31const extern porta_pin_def Mux_enable_postmainboard_5; //!< location of the chip select pin of analog mux 5 of postmainboard, 0=off
32const extern porta_pin_def Mux_enable_postmainboard_6; //!< location of the chip select pin of analog mux 6 of postmainboard, 0=off
33const extern porta_pin_def Mux_enable_postmainboard_7; //!< location of the chip select pin of analog mux 7 of postmainboard, 0=off
34const extern porta_pin_def Mux_enable_postmainboard_8; //!< location of the chip select pin of analog mux 8 of postmainboard, 0=off
35
36const extern porta_pin_def Mux_select_word_0; //!< selettore 0 del pin di ingresso dell'analog mux
37const extern porta_pin_def Mux_select_word_1; //!< selettore 1 del pin di ingresso dell'analog mux
38const extern porta_pin_def Mux_select_word_2; //!< selettore 2 del pin di ingresso dell'analog mux
39
40const extern porta_pin_def ADC_ResIn_A_buffer_down; //!< Refernce to fgnd of theADC input buffer, if 1 there is a 10kOhm connected to GND
41const extern porta_pin_def ADC_ResIn_B_buffer_down; //!< Refernce to fgnd of theADC input buffer, if 1 there is a 10kOhm connected to GND
42const extern porta_pin_def ADC_ResIn_A_buffer_up; //!< Refernce to fgnd of theADC input buffer, if 1 there is a 10kOhm connected to GND
43const extern porta_pin_def ADC_ResIn_B_buffer_up; //!< Refernce to fgnd of theADC input buffer, if 1 there is a 10kOhm connected to GND
44
45const extern porta_pin_def ADC_ready_up; //!< Configuration ADC pin
46const extern porta_pin_def ADC_Chip_Sel_up; //!< Configuration ADC pin
47const extern porta_pin_def ADC_reset_up; //!< Configuration ADC pin
48const extern porta_pin_def ADC_ready_down; //!< Configuration ADC pin
49const extern porta_pin_def ADC_Chip_Sel_down; //!< Configuration ADC pin
50const extern porta_pin_def ADC_reset_down; //!< Configuration ADC pin
51
52const extern porta_pin_def CAN_indirizzo_hw[]; //!< hw Can address
53
54const extern porta_pin_def LED_Green ; //!< Green LED
55const extern porta_pin_def LED_Red ; //!< Green LED
56
57
58//Queste righe da qui andranno commentate:
59extern porta_pin_def rele_driver_ch0;
60//extern porta_pin_def rele_driver_ch1;
61extern porta_pin_def PGA_DAC_select_ch0;
62extern porta_pin_def PGA_DAC_select_ch1;
63extern porta_pin_def ADC_select;
64const extern porta_pin_def PGA_pre_gain_1_ch0;
65const extern porta_pin_def PGA_pre_gain_10_ch0;
66const extern porta_pin_def PGA_pre_gain_1_ch1;
67const extern porta_pin_def PGA_pre_gain_10_ch1;
68const extern porta_pin_def PGA_DAC_pin_select_ch0;
69const extern porta_pin_def PGA_DAC_pin_select_ch1;
70//fino a qui
71
72/*! \brief Port 0 pin usage
73
74 *\snippet Gpio.h def_Port_0_pins
75 */
76//! <!-- [def_Port_0_pins] -->
77// PORTA 0
78#define porta_0 0
79//Reset pin dei mux I2C sulla postmainboard
80#define pin_Rset_i2c_mux_down 6
81#define pin_Rset_i2c_mux_sup 9
82//Ref to ground of the inputs of the aADC buffers
83#define ResIn_buffer_A_down 7
84#define ResIn_buffer_B_down 8
85#define ResIn_buffer_A_up 10
86#define ResIn_buffer_B_up 11
87#define B0 0 //<! Can Address pin0
88#define B1 1 //<! Can Address pin1
89#define B2 23 //<! Can Address pin2
90#define B3 24 //<! Can Address pin3
91#define B4 25 //<! Can Address pin4
92#define B5 26 //<! Can Address pin5
93#define B6 29 //<! Can Address pin6
94#define B7 30 //<! Can Address pin7
95//! <!-- [def_Port_0_pins] -->
96
97#define Chip_Sel_rele_0 4
98#define Chip_Sel_rele_1 5
99#define PGA_Chip_Sel_DAC_ch0 6
100#define PGA_Chip_Sel_DAC_ch1 7
101
102
103#define Chip_Sel_Adc 0
104#define Adc_ready 0
105//#define Led_rosso 23
106//#define Porta_Led_rosso 0
107
108/*! \brief Port 1 pin usage
109
110 *\snippet Gpio.h def_Port_1_pins
111 */
112//! <!-- [def_Port_1_pins] -->
113// PORTA 1
114#define porta_1 1
115//Selettori del segnale di ingresso dei mux analogici
116#define MUX_select_in_0 0
117#define MUX_select_in_1 1
118#define MUX_select_in_2 4
119//Chip select per i Mux analogici sulla postmainboard
120#define MUX_Chip_sel_1 20
121#define MUX_Chip_sel_2 21
122#define MUX_Chip_sel_3 22
123#define MUX_Chip_sel_4 23
124#define MUX_Chip_sel_5 24
125#define MUX_Chip_sel_6 25
126#define MUX_Chip_sel_7 26
127#define MUX_Chip_sel_8 27
128//setting reading pins for ADCs
129#define ADC_ready_up_ 8
130#define ADC_Chip_Sel_up_ 10
131#define ADC_reset_up_ 9
132#define ADC_ready_down_ 14
133#define ADC_Chip_Sel_down_ 16
134#define ADC_reset_down_ 15
135//! <!-- [def_Port_1_pins] -->
136
137//#define Reset_ch0 0
138//#define Set_ch0 1
139//#define Reset_ch1 4
140//#define Set_ch1 8
141#define PGA_rele_ch0_1 9
142#define PGA_rele_ch0_2 10
143#define PGA_rele_ch1_1 14
144#define PGA_rele_ch1_2 15
145
146////#define Chip_Sel_Multiplexer_4 20
147////#define Chip_Sel_Multiplexer_3 21
148//#define Chip_Sel_Multiplexer_2 22
149//#define Chip_Sel_Multiplexer_1 23
150#define Sel_Par_Interruttori_3 24
151#define Sel_Par_Interruttori_2 25
152#define Sel_Par_Interruttori_1 26
153//#define Shut_Vcc_Vee 28
154//#define Shut_Vrefp_Vrefn 29
155
156/*! \brief Port 2 pin usage
157
158 *\snippet Gpio.h def_Port_2_pins
159 */
160//! <!-- [def_Port_2_pins] -->
161// PORTA 2
162#define porta_2 2
163#define pin_Reset_I2C_mux_A 0 /*!<Pin of the port of the rest pin of the I2C_mux su or giu */
164#define pin_Reset_I2C_mux_B 1 /*!<Pin of the port of the rest pin of the I2C_mux su or giu */
165#define pin_LED_Green 13 /*!<Green LED */
166#define pin_LED_Red 9 /*!<Red LED */
167//! <!-- [def_Port_2_pins] -->
168
169
170
171#define Led_verde 5
172
173//#define DIG_5 9
174//#define DIG_3_3 13
175#define Porta_Led_verde 2
176
177/******************************************************************************
178FINE Variabili di gianlu
179*******************************************************************************/
180
181
182
183//GPIO.h
184//void Configure_Chip_Sel(void);
185//void Configure_Sel_Par_Interruttori(void);
186//void Configure_Adc_Ready(void);
187//void Configure_Chip_Sel_ADC(void);
188//void Configure_Chip_Sel_rele_ch0(void);
189//void Configure_Chip_Sel_rele_ch1(void);
190//void Configure_Reset_ch0(void);
191//void Configure_Set_ch0(void);
192//void Configure_Reset_ch1(void);
193//void Configure_Set_ch1(void);
194//void Configure_PGA_Chip_Sel_DAC_ch0(void);
195//void Configure_PGA_Chip_Sel_DAC_ch1(void);
196//void Configure_PGA_rele_ch0_1(void);
197//void Configure_PGA_rele_ch0_2(void);
198//void Configure_PGA_rele_ch1_1(void);
199//void Configure_PGA_rele_ch1_2(void);
200//void Configure_Led_verde (void);
201//void Configure_Led_rosso (void);
202//void Configure_Pin_Alimentazione (void);
204void Configure_Reset_I2C_mux(void);
206void ADC_pin_configurations(void);
207void LED_pin_configuration(void);
208//void ADC_noding_map(void);
209
210
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.
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
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
Definition: Gpio.h:13