4#include "tutti_gli_header.h"
125 SPIdrv->Send ( &valore_da_trasmettere ,1);
129 uint8_t troppa_attesa=0;
130 while( (SPIdrv->GetStatus().busy) && (troppa_attesa <250) ){
146 SPIdrv->Send ( &zero ,1);
153 uint8_t canalone=scheda_su_giu *6 + numero_canale;
191 void Funzione_per_attivare(uint8_t numero_canale , uint8_t valore_da_trasmettere)
196 GPIO_PinWrite(rele_driver_ch0.porta_num, rele_driver_ch0.pin_num,1);
197 if(numero_canale ==0)
200 chip_da_usare=rele_driver_ch0;
207 GPIO_PinWrite(chip_da_usare.porta_num, chip_da_usare.pin_num, 0);
208 SPItx(valore_da_trasmettere);
210 GPIO_PinWrite(chip_da_usare.porta_num, chip_da_usare.pin_num, 1);
213 GPIO_PinWrite(chip_da_usare.porta_num, chip_da_usare.pin_num, 0);
216 GPIO_PinWrite(chip_da_usare.porta_num, chip_da_usare.pin_num, 1);
237void Attiva_OUT_1_ch0 (
void)
239 Funzione_per_attivare(0,1);
242void Attiva_OUT_2_ch0 (
void)
244 Funzione_per_attivare(0,2);
271void Attiva_OUT_3_ch0 (
void)
273 Funzione_per_attivare(0,4);
276void Attiva_OUT_4_ch0 (
void)
278 Funzione_per_attivare(0,8);
305void Attiva_OUT_5_ch0 (
void)
307 Funzione_per_attivare(0,16);
310void Attiva_OUT_6_ch0 (
void)
312 Funzione_per_attivare(0,32);
339void Attiva_OUT_7_ch0 (
void)
341 Funzione_per_attivare(0,64);
344void Attiva_OUT_8_ch0 (
void)
346 Funzione_per_attivare(0,128);
375void Attiva_OUT_1_ch1 (
void)
377 Funzione_per_attivare(1,1);
379void Attiva_OUT_2_ch1 (
void)
381 Funzione_per_attivare(1,2);
408void Attiva_OUT_3_ch1 (
void)
410 Funzione_per_attivare(1,4);
413void Attiva_OUT_4_ch1 (
void)
415 Funzione_per_attivare(1,8);
442void Attiva_OUT_5_ch1 (
void)
444 Funzione_per_attivare(1,16);
447void Attiva_OUT_6_ch1 (
void)
449 Funzione_per_attivare(1,32);
476void Attiva_OUT_7_ch1 (
void)
478 Funzione_per_attivare(1,64);
481void Attiva_OUT_8_ch1 (
void)
483 Funzione_per_attivare(1,128);
517void RELE_ATTIVA(
int canale,
int OUTN)
void SPItx(unsigned char dato)
This is a blocking function that transmits one byte over the SPI.
uint8_t detector_Relay_state[12]
The state of the Detector realis is considerede. Note that this is the wanted working condition....
void Relays_driver_set_reset_channel(uint8_t scheda_su_giu, uint8_t numero_canale, uint8_t valore_da_trasmettere)
Setting the state of the detector realis: pre connected to detector or intrnal resistor,...
#define Detector_small_RLOAD
#define Detector_prea_to_det
#define wait_time_for_rele_setting
[ref_spi_clock_for_relais]
#define Detector_bias_invertito
#define Detector_external_bias
#define Detector_internal_bias
#define Detector_prea_to_GND
#define Detector_bias_diretto
#define spi_clock_for_relais
[ref_spi_clock_for_relais]
#define Detector_large_RLOAD
volatile uint32_t Error_bad_operation
exploited to mark the errors
void ERROR_codifica_errore(uint8_t scheda_su_scheda_giu, unsigned char error_addres, unsigned char code_to_shift, uint8_t reset_count_se_0)
If an error is found its flag is codified here.
@ error_address_SPI
Error register for SPI.
@ SPI_error_EVENT_DATA_LOST
This is ARM_SPI_EVENT_DATA_LOST.
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]
...
#define SPI_control_for_relay_driver
[ref_SPI_control_for_relay_driver]
void Aspetta_tanti_ms(int millisecondi)
The timing function.
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.
void(* Attiva_OUT8_ch0)(void)
Puntatore a Attiva_OUT8_ch0.
void(* Attiva_OUT7_ch0)(void)
Puntatore a Attiva_OUT7_ch0.
void(* Attiva_OUT8_ch1)(void)
Puntatore a Attiva_OUT8_ch1.
void(* Attiva_OUT7_ch1)(void)
Puntatore a Attiva_OUT7_ch1.
void(* Attiva_OUT1_ch0)(void)
Puntatore a Attiva_OUT1_ch0.
void(* Attiva_OUT2_ch0)(void)
Puntatore a Attiva_OUT2_ch0.
void(* Attiva_OUT4_ch0)(void)
Puntatore a Attiva_OUT4_ch0.
void(* Attiva_OUT3_ch0)(void)
Puntatore a Attiva_OUT3_ch0.
void(* Attiva_OUT5_ch0)(void)
Puntatore a Attiva_OUT5_ch0.
void(* Attiva_OUT6_ch0)(void)
Puntatore a Attiva_OUT6_ch0.
void(* Attiva_OUT2_ch1)(void)
Puntatore a Attiva_OUT2_ch1.
void(* Attiva_OUT1_ch1)(void)
Puntatore a Attiva_OUT1_ch1.
void(* Attiva_OUT3_ch1)(void)
Puntatore a Attiva_OUT3_ch1.
void(* Attiva_OUT4_ch1)(void)
Puntatore a Attiva_OUT4_ch1.
void(* Attiva_OUT5_ch1)(void)
Puntatore a Attiva_OUT5_ch1.
void(* Attiva_OUT6_ch1)(void)
Puntatore a Attiva_OUT6_ch1.