CROSS Technical Documentation User Manual and Technical Doc.
INFN Milano Bicocca
Loading...
Searching...
No Matches
I2C_to_parallel.h
Go to the documentation of this file.
1
2#include <stdint.h>
3/// \file
4#define channel_number 6
5
6#define I2C_to_Parallel_1_ini_set 0xFF /*!< '' */
7#define I2C_to_Parallel_2_ini_set 0x7F /*!< '' */
8#define I2C_to_Parallel_3_ini_set 0xFD /*!< '' */
9#define I2C_to_Parallel_maschera_linee_ucita 0xF /*!< '' */
10
11
12extern const uint8_t I2C_to_Parallel_ini_set[4];
13
14
15#define I2C_to_Parallel_address_1 0x21 ///< address of the first I2C to parallel
16#define I2C_to_Parallel_address_2 0x22 ///< address of the second I2C to parallel
17#define I2C_to_Parallel_address_3 0x23 ///< address of the third I2C to parallel
18
19#define I2C_to_Parallel_name_1 1 ///< the first PCA
20#define I2C_to_Parallel_name_2 2 ///< the second PCA
21#define I2C_to_Parallel_name_3 3 ///< the third PCA
22
23#define I2C_to_Parallel_Command_read_output 0 ///< Read output pin, either if they are inputs or outpus
24#define I2C_to_Parallel_Command_data_to_write 1 ///< Data are written in the bits set as output
25#define I2C_to_Parallel_Command_polarity_inversion 2 ///< Polarity inversion of the read bit, set all 0 in our case
26#define I2C_to_Parallel_Command_configuration_register 3 ///< Configuration register, set to 0 for ouput of the corresponding bit
27
28//extern struct chip_select_type;
29
30//! \brief This is the struct definition for the selection of the chip select of the relays drivers
31 //! <!-- [struct_chip_select_type] -->
33uint8_t I2C_to_parallel_chip_num; //!< This is the I2C to parallel chip to which the driver is connectted, they are 3
34uint8_t I2C_to_parallel_chip__pin_num; //!< This is the outputo pin to enable
35} ;
36//! <!-- [struct_chip_select_type] -->
37
38
39#define chip_select_all_off 0xFF
40extern const struct chip_select_type detector_chip_select_bias[channel_number];
41extern const struct chip_select_type detector_reset_all_relays_driver;
42
43extern const struct chip_select_type PGA_DAC_chip_select[channel_number] ;
44
45//The I2C_address to use is the third defined as: //#define I2C_mux_abilita_3
46
47//Chip select definition
48
49//#define CS_bit_bias_ch_0 ~(1<<0 )
50//#define CS_byte_bias_ch_0 I2C_to_Parallel_name_1
51
52
53void I2C_to_Parallel_ini_PCA9554( uint8_t scheda_su_scheda_giu, uint8_t select_PCA );
54void I2C_to_Parallel_set_PCA9554_outputs_values( uint8_t scheda_su_scheda_giu, uint8_t select_PCA, uint8_t value );
55
56
57
58
59
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]
...
void I2C_to_Parallel_ini_PCA9554(uint8_t scheda_su_scheda_giu, uint8_t select_PCA)
The I2C_to_Parallel_ini_PCA9554 inits the I2C_to_Parallel_ini_PCA9554 chips by setting all the output...
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.
This is the struct definition for the selection of the chip select of the relays drivers.