CROSS Technical Documentation User Manual and Technical Doc.
INFN Milano Bicocca
Loading...
Searching...
No Matches
I2C_mux.h
Go to the documentation of this file.
1
2/// \file
3#include <stdint.h>
4#include "Driver_I2C.h"
5
6//I2C_mux 7 bits addres TCA9546APWR
7#define I2C_mux_address_mainboard (uint8_t) 0x71 ///< I2C 7 bits address of the mainboard I2C_mux
8#define I2C_mux_address_postmainboard_up (uint8_t) 0x72 ///< I2C 7 bits address of the postmainboard down I2C_mux
9#define I2C_mux_address_postmainboard_down (uint8_t) 0x74 ///< I2C 7 bits address of the postmainboard up I2C_mux
10#define I2C_postmainboard 0
11#define I2C_mainboard 1
12
13
14//IL valore va definito meglio
15#define I2C_mux_Scheda_su 1 ///< Selection of the I2C0 for the upper board (purtroppo \'e contorto)
16#define I2C_mux_Scheda_giu 0 ///< Selection of the I2C1 for lower board (purtroppo \'e contorto)
17
18extern uint8_t scheda_su_scheda_giu_provvisorio;
19extern volatile uint8_t scheda_su_scheda_giu;
20
21extern volatile uint8_t I2C_corretto; //! I2c transmission/reception was good
22extern volatile uint8_t I2C_errore; //! i2C transmission/reception was bad
23
24#define I2C_mux_disabilita_tutto 0 ///< Disable the 4 I2C channelles
25#define I2C_mux_abilita_0 (uint8_t) 1 ///< Enable channel 0
26#define I2C_mux_abilita_1 I2C_mux_abilita_0 * (uint8_t) 2 ///< Enable channel 1
27#define I2C_mux_abilita_2 I2C_mux_abilita_1 *(uint8_t) 2 ///< Enable channel 2
28#define I2C_mux_abilita_3 I2C_mux_abilita_2 * (uint8_t) 2 ///< Enable channel 3
29
30extern ARM_DRIVER_I2C * I2C_mux;
31
32void I2C_mux_select_ch( uint8_t scheda_su_scheda_giu, uint8_t mainboard_postmainboard , uint8_t canale_da_abilitare);
33
34
35
36
37
void I2C_mux_select_ch(uint8_t scheda_su_scheda_giu, uint8_t mainboard_postmainboard, uint8_t canale_da_abilitare)
The I2C mux.
Definition: I2C_mux.c:100
volatile uint8_t I2C_errore
I2c transmission/reception was good.