3#include "tutti_gli_header.h"
199int32_t
volatile ADC_misura_fatta;
202int32_t
volatile ADC_external_measurement=0;
203uint8_t
volatile ADC_external_measured_node=0;
252 #define indice_attenuatore_BIAS sizeof(ADC_coefficiente ) / sizeof(ADC_coefficiente[1])-1
264 if( up_down) up_down=1;
272 GPIO_PinWrite(ref_locale->porta_num, ref_locale->pin_num, 0);
274 uint8_t valore_da_trasmettere[]={ ADC_mode_reg, ADC_power_down_com};
276 SPIdrv->Send ( &valore_da_trasmettere ,2);
277 uint8_t troppa_attesa=0;
278 while( (SPIdrv->GetStatus().busy) && (troppa_attesa <250) ){
283 GPIO_PinWrite(ref_locale->porta_num, ref_locale->pin_num, 1);
308 GPIO_PinWrite(ref_locale->porta_num, ref_locale->pin_num, 0);
310 uint8_t valore_da_trasmettere[]={ ADC_mode_reg_ch0, ADC_ZeroScaleCalibration_com};
311 SPIdrv->Send ( &valore_da_trasmettere ,2);
318 uint8_t troppa_attesa=0;
319 while( (SPIdrv->GetStatus().busy) && (troppa_attesa <250) ){
326 while (( GPIO_PinRead(ref_locale_ADCready->porta_num,ref_locale_ADCready->pin_num) == 1 ) )
333 GPIO_PinWrite(ref_locale->porta_num, ref_locale->pin_num, 1);
351 const porta_pin_def *ref_locale,*ref_locale_ResBuffer,*ref_locale_ResBuffer_;
353if ( ADC_ON_1_OFF_0_NOP_GT1 <= 2){
361 if(ADC_ON_1_OFF_0_NOP_GT1==1){
364 GPIO_PinWrite(ref_locale_ResBuffer->porta_num, ref_locale_ResBuffer->pin_num, 0);
365 GPIO_PinWrite(ref_locale_ResBuffer_->porta_num, ref_locale_ResBuffer_->pin_num, 0);
366 }
else if (ADC_ON_1_OFF_0_NOP_GT1==0){
369 GPIO_PinWrite(ref_locale_ResBuffer->porta_num, ref_locale_ResBuffer->pin_num, 1);
370 GPIO_PinWrite(ref_locale_ResBuffer_->porta_num, ref_locale_ResBuffer_->pin_num, 1);
371 }
else if (ADC_ON_1_OFF_0_NOP_GT1==2){
374 GPIO_PinWrite(ref_locale_ResBuffer->porta_num, ref_locale_ResBuffer->pin_num, 0);
375 GPIO_PinWrite(ref_locale_ResBuffer_->porta_num, ref_locale_ResBuffer_->pin_num, 0);
396 GPIO_PinWrite(ref_locale->porta_num, ref_locale->pin_num, 0);
398 uint8_t valore_da_trasmettere[]={ ADC_mode_reg_ch0, ADC_idle_com};
399 SPIdrv->Send ( &valore_da_trasmettere ,2);
401 while( (SPIdrv->GetStatus().busy) && (limite<10) ) {
407 valore_da_trasmettere[0]= ADC_mode_reg_ch1; valore_da_trasmettere[1]= ADC_idle_com;
408 SPIdrv->Send ( &valore_da_trasmettere ,2);
410 while( (SPIdrv->GetStatus().busy) &&(limite<10) ) {
419 GPIO_PinWrite(ref_locale->porta_num, ref_locale->pin_num, 1);
433long int ADC_lettura_24bit(
char line_to_read_to_select_ADCch0_ADCch1 , uint8_t up_down, uint8_t cosa_fare){
442 ARM_SPI_STATUS errorone;
443 unsigned int risultato_= 0xffffffff;
445 if (up_down>1) up_down=1;
448 long int risultato=0;
449 if (
ADC_node_map[line_to_read_to_select_ADCch0_ADCch1] < 16) ADC_0_o_1=0;
450 if ( (
ADC_node_map[line_to_read_to_select_ADCch0_ADCch1] >=16) ) ADC_0_o_1=1;
452 uint8_t ii=0,scelta_ADC=ADC_mode_reg_ch0, valore_da_trasmettere[4]={0,0,0,0};
453 uint8_t indirizzo_registro_lettura=read_from_CH0 ;
454 uint8_t valore_da_ricevere[4];
455 const porta_pin_def *ref_locale, *ref_locale_ADCready, *ref_locale_ResBuffer, *ref_locale_ResBuffer_;
479 scelta_ADC=ADC_mode_reg_ch1;
480 indirizzo_registro_lettura=read_from_CH1;
485 GPIO_PinWrite(ref_locale->porta_num, ref_locale->pin_num, 0);
492 valore_da_trasmettere[0]= scelta_ADC; valore_da_trasmettere[1]= ADC_mode_reg_set_single_24bit;
494 SPIdrv->Send ( &valore_da_trasmettere ,2);
502 errorone=SPIdrv->GetStatus();
503 status = SPIdrv->Control(ARM_SPI_ABORT_TRANSFER,0);
506 GPIO_PinWrite(ref_locale->porta_num, ref_locale->pin_num, 1);
511 if ( registro38 != 0x70){
514 while (( GPIO_PinRead(ref_locale_ADCready->porta_num,ref_locale_ADCready->pin_num) == 1 ) && (limite<10)){
520 GPIO_PinWrite(ref_locale->porta_num, ref_locale->pin_num, 0);
522 uint8_t dati_da_trasmettere[]={indirizzo_registro_lettura,0,0,0};
523 SPIdrv->Transfer (&dati_da_trasmettere, &valore_da_ricevere ,4);
525 while( (SPIdrv->GetStatus().busy) && (limite<10) ){
530 errorone=SPIdrv->GetStatus();
531 status = SPIdrv->Control(ARM_SPI_ABORT_TRANSFER,0);
535 GPIO_PinWrite(ref_locale->porta_num, ref_locale->pin_num, 1);
537 risultato_ =(valore_da_ricevere[1]<<16) + (valore_da_ricevere[2]<<8 )+( valore_da_ricevere[3] );
539 GPIO_PinWrite(ref_locale->porta_num, ref_locale->pin_num, 1);
547 risultato = ( (
long long int) ( (
int)(risultato_ << 1) - (1 << 24) ) * 78125 ) >> 17 ;
569 long int risultato_intermedio= lettura_ADC;
573 risultato_intermedio = risultato_intermedio + ((risultato_intermedio - lettura_offset)*
ADC_coefficiente[line_to_read].numeratore) /
ADC_coefficiente[line_to_read].denominatore ;
575 risultato_intermedio = (risultato_intermedio *
ADC_coefficiente[indice_attenuatore_BIAS].numeratore ) /
ADC_coefficiente[indice_attenuatore_BIAS].denominatore ;
577 return risultato_intermedio;
595 long int risultato=0;
596 uint8_t byte_da_trasmettere_ricevere=2;
597 if(up_down>1)up_down=1;
598 if( (registro_ch0>=5) && (registro_ch0<=0x18) ) byte_da_trasmettere_ricevere=4;
600 uint8_t ii=0,scelta_ADC=ADC_mode_reg_ch0, valore_da_ricevere[4]={0,0,0,0}, registro_lettura=read_from_CH0 ;
610 if (registro_ch0 ==0x38){
611 registro_lettura= registro_ch0 +0x40;
613 registro_lettura= registro_ch0 + ADC_0_o_1*2 +0x40;
617GPIO_PinWrite(ref_locale->porta_num, ref_locale->pin_num, 0);
620 uint8_t istruzione[]={registro_lettura,0,0,0};
621 SPIdrv->Transfer (&istruzione, &valore_da_ricevere ,byte_da_trasmettere_ricevere);
624 uint8_t troppa_attesa=0;
625 while( (SPIdrv->GetStatus().busy) && (troppa_attesa <250) ){
631GPIO_PinWrite(ref_locale->porta_num, ref_locale->pin_num, 1);
632 if( byte_da_trasmettere_ricevere ==4){
633 risultato = (valore_da_ricevere[1]<<16) + (valore_da_ricevere[2]<<8) + (valore_da_ricevere[3]);
635 risultato = (valore_da_ricevere[1]);
657 uint8_t byte_da_trasmettere_ricevere=2;
658 if(up_down>1)up_down=1;
659 if( (indirizzo_registro_ch0>=5) && (indirizzo_registro_ch0<=0x18) ) byte_da_trasmettere_ricevere=4;
661 uint8_t ii=0,scelta_ADC=indirizzo_registro_ch0, *valore_da_trasmettere, registro_scrittura=value_to_write ;
671 if (indirizzo_registro_ch0 ==0x38){
672 registro_scrittura= indirizzo_registro_ch0 ;
674 registro_scrittura= indirizzo_registro_ch0 + ADC_0_o_1*2 ;
677 valore_da_trasmettere= (uint8_t *) &value_to_write ;
679 GPIO_PinWrite(ref_locale->porta_num, ref_locale->pin_num, 0);
682 uint8_t istruzione[]={registro_scrittura,valore_da_trasmettere[0],valore_da_trasmettere[1],valore_da_trasmettere[2]};
683 SPIdrv->Send ( &istruzione ,byte_da_trasmettere_ricevere);
686 uint8_t troppa_attesa=0;
687 while( (SPIdrv->GetStatus().busy) && (troppa_attesa <250) ){
693 GPIO_PinWrite(ref_locale->porta_num, ref_locale->pin_num, 1);
710int32_t
ADC_lettura(uint8_t scheda_su_scheda_giu_, uint8_t node_to_read, uint8_t cosa_fare){
713 if(scheda_su_scheda_giu_>1)scheda_su_scheda_giu_=1;
724 ADC_misura_fatta =
ADC_lettura_24bit( node_to_read, scheda_su_scheda_giu_, cosa_fare);
748 return ADC_misura_fatta;
762 uint8_t offset,nodo_da_leggere =
tx_data[6], iii;
763 uint8_t ADC_interno_esterno=
tx_data[5] & 1;
764 uint8_t ADC_diff_1_single_0=
tx_data[5] >>1 & 1;
765 int32_t ADC_misura_fatta_neg=0, ADC_misura_fatta_pos=0,ADC_misura;
767 scheda_su_scheda_giu = (nodo_da_leggere >>7) & 1;
768 nodo_da_leggere = nodo_da_leggere & 0x7F ;
816 if (ADC_diff_1_single_0==0){
826 if(ADC_interno_esterno){
827 *(int32_t *)
tx_data = ADC_misura_fatta_pos;
830 *(int16_t *)&
tx_data[0] = (ADC_misura_fatta_pos / 1000) & 0xffff;
831 *(int16_t *)&
tx_data[2] = (ADC_misura_fatta_neg / 1000) & 0xffff;
833 *(int32_t *)
tx_data = ADC_misura_fatta_pos - ADC_misura_fatta_neg;
853 int32_t ADC_misura_fatta_pos=0, ADC_misura_fatta_neg=0,risul_vof=0;
856 ADC_misura_fatta_pos=
ADC_lettura(scheda_su_scheda_giu, nodo_da_leggere, 2);
864 if(differenziale_1_single_0){
870 ADC_misura_fatta_neg =
ADC_lettura(scheda_su_scheda_giu, nodo_da_leggere + offset, 2);
878 ADC_misura_fatta_neg=0;
880 return ADC_misura_fatta_pos = ADC_misura_fatta_pos - ADC_misura_fatta_neg;
902 int32_t ADC_misura_fatta_prov, ADC_misura_fatta_prov_vet[200], maggiore, minore,scarto=0,sigmetta=0;
908 scheda_su_scheda_giu=scheda_su_scheda_giu_;
910 if( preamplifier_externalADC_1_onboardADC_0){
918 ADC_misura_fatta_prov=0;
923 ADC_misura_fatta_prov +=ADC_misura_fatta_prov_vet[iii];
928 if( ADC_misura_fatta_prov_vet[iii] >= ADC_misura_fatta_prov){
929 sigmetta += ADC_misura_fatta_prov_vet[iii] - ADC_misura_fatta_prov;
931 sigmetta += ADC_misura_fatta_prov - ADC_misura_fatta_prov_vet[iii] ;
937 maggiore= ADC_misura_fatta_prov + 4 * sigmetta;
938 minore= ADC_misura_fatta_prov - 4 * sigmetta;
940 if( (ADC_misura_fatta_prov_vet[iii] > maggiore) || (ADC_misura_fatta_prov_vet[iii] < minore)){
943 scarto +=ADC_misura_fatta_prov_vet[iii];
949 ADC_misura_fatta = ADC_misura_fatta_prov;
954 return ADC_misura_fatta;
974 while (!((LPC_SPI->SPSR & 0x80) == 0x80)){}
984unsigned char coeffcienti_misura_ADC_nodi[72];
992void calibrazione_Resistenze_sterne_ADC(
void){
994 long int voltage_10k,voltage_for_Rmul;
1000 Radc_internal =( R_ref_10k * ( ADC_reference_voltage - voltage_10k) ) / 8 / voltage_10k;
1008 coeffcienti_misura_ADC[indice_Vbias].coefficiente_Vmeas = Coefficiente_Vmeas_Vbias;
1009 coeffcienti_misura_ADC[indice_Vbias].coefficiente_Vref = Coefficiente_Vref_Vbias;
1012 coeffcienti_misura_ADC[indice_PoerSupply].coefficiente_Vmeas = Coefficiente_Vmeas_PowerSupply;
1013 coeffcienti_misura_ADC[indice_PoerSupply].coefficiente_Vref = Coefficiente_Vref_PowerSupply;
1014 coeffcienti_misura_ADC[indice_PoerSupply].partizione_per_1000 = 1024;
1016 coeffcienti_misura_ADC[indice_default].coefficiente_Vmeas = Coefficiente_Vmeas_deafult;
1017 coeffcienti_misura_ADC[indice_default].coefficiente_Vref = Coefficiente_Vref_default;
1018 coeffcienti_misura_ADC[indice_default].partizione_per_1000 = 1024;
1020 coeffcienti_misura_ADC[indice_100_ohm].coefficiente_Vmeas = Coefficiente_Vmeas_100_ohm;
1021 coeffcienti_misura_ADC[indice_100_ohm].coefficiente_Vref = Coefficiente_Vref_100_ohm;
1022 coeffcienti_misura_ADC[indice_100_ohm].partizione_per_1000 = 1024;
1024 coeffcienti_misura_ADC[indice_10_Kohm].coefficiente_Vmeas = Coefficiente_Vmeas_10k_ohm;
1025 coeffcienti_misura_ADC[indice_10_Kohm].coefficiente_Vref = Coefficiente_Vref_10k_ohm;
1026 coeffcienti_misura_ADC[indice_10_Kohm].partizione_per_1000 = 1024;
1028 coeffcienti_misura_ADC[indice_Vbias_extern].coefficiente_Vmeas = Coefficiente_Vmeas_Vbias_extern;
1029 coeffcienti_misura_ADC[indice_Vbias_extern].coefficiente_Vref = Coefficiente_Vref_Vbias_extern;
1035coeffcienti_misura_ADC_nodi[ADC_Vdig5V_micro_passed]=indice_PoerSupply;
1036coeffcienti_misura_ADC_nodi[ADC_Vcc]=indice_PoerSupply;
1037coeffcienti_misura_ADC_nodi[ADC_Vee]=indice_PoerSupply;
1038coeffcienti_misura_ADC_nodi[ADC_JFET_c_ch1_S2]=indice_default;
1039coeffcienti_misura_ADC_nodi[ADC_PRE_term_ch1]=indice_default;
1040coeffcienti_misura_ADC_nodi[ADC_ADC_PGA_pos_in_ch1]=indice_default;
1041coeffcienti_misura_ADC_nodi[ADC_ADC_PGA_neg_in_ch1]=indice_default;
1044coeffcienti_misura_ADC_nodi[ADC_Misura_bias_10_att_ch1_n]=indice_Vbias;
1045coeffcienti_misura_ADC_nodi[ADC_Misura_bias_20_att_ch1_p]=indice_Vbias_extern;
1046coeffcienti_misura_ADC_nodi[ADC_Misura_bias_20_att_ch1_n]=indice_Vbias_extern;
1047coeffcienti_misura_ADC_nodi[ADC_CommonMode_ch1]=indice_default;
1048coeffcienti_misura_ADC_nodi[ADC_CommonMode_ch2]=indice_default;
1049coeffcienti_misura_ADC_nodi[ADC_ADC_PGA_pos_out_ch1]=indice_default;
1050coeffcienti_misura_ADC_nodi[ADC_ADC_PGA_neg_out_ch1]=indice_default;
1053coeffcienti_misura_ADC_nodi[ADC_Vcc_in]=indice_PoerSupply;
1054coeffcienti_misura_ADC_nodi[ADC_Vee_in]=indice_PoerSupply;
1055coeffcienti_misura_ADC_nodi[ADC_Vref_pos_in]=indice_PoerSupply;
1056coeffcienti_misura_ADC_nodi[ADC_Vref_neg_in]=indice_PoerSupply;
1057coeffcienti_misura_ADC_nodi[ADC_PRE_term_ch2]=indice_default;
1058coeffcienti_misura_ADC_nodi[ADC_ADC_PGA_pos_in_ch0]=indice_100_ohm;
1059coeffcienti_misura_ADC_nodi[ADC_ADC_PGA_neg_in_ch0]=indice_100_ohm;
1062coeffcienti_misura_ADC_nodi[ADC_Misura_bias_10_att_ch0_n]=indice_Vbias;
1063coeffcienti_misura_ADC_nodi[ADC_Misura_bias_20_att_ch0_p]=indice_Vbias;
1064coeffcienti_misura_ADC_nodi[ADC_Misura_bias_20_att_ch0_n]=indice_Vbias;
1065coeffcienti_misura_ADC_nodi[ADC_JFET_c_ch0_S1]=indice_PoerSupply;
1066coeffcienti_misura_ADC_nodi[ADC_JFET_c_ch0_S2]=indice_default;
1067coeffcienti_misura_ADC_nodi[ADC_ADC_PGA_pos_out_ch0]=indice_100_ohm;
1068coeffcienti_misura_ADC_nodi[ADC_ADC_PGA_neg_out_ch0]=indice_100_ohm;
1071int correzione_misura_ADC(
char quali_coefficienti,
int misura){
1073 long long int primo_termine;
1074 long long int secondo_termine;
1075 signed char segno=1;
1077 primo_termine= (
long long int)misura * (coeffcienti_misura_ADC[quali_coefficienti].coefficiente_Vmeas >> 10) - (coeffcienti_misura_ADC[quali_coefficienti].coefficiente_Vref>>10) * (
long long int)ADC_reference_voltage ;
1078 if (primo_termine <0){
1080 primo_termine=primo_termine*segno;
1082 secondo_termine = primo_termine / (
long long int)(RADC_tot>>10) ;
1084 secondo_termine = (secondo_termine * coeffcienti_misura_ADC[quali_coefficienti].partizione_per_1000) >> 10 ;
1085 secondo_termine=secondo_termine*segno;
1086return secondo_termine;
1099 char ii,passi_da_fare=64;
1101 long long int risultato=0,temporaneo=0;
1104 if (Numeratore < 0) {
1106 Numeratore=-Numeratore;
1108 if (denominatore<0){
1110 denominatore=-denominatore;
1112 if(Numeratore < 0x100000000){
1116 for( ii=1; ii <= passi_da_fare; ii++) {
1117 temporaneo=(temporaneo <<1);
1118 risultato= (risultato << 1);
1119 if ( (Numeratore >> (passi_da_fare-1) ) & 1 ) {
1120 temporaneo=temporaneo+1;
1122 if ( temporaneo >= denominatore) {
1123 temporaneo=temporaneo-denominatore;
1126 Numeratore=(Numeratore << 1);
1129 if ( aa==1) risultato=-risultato;
int32_t ADC_misura_differenziale_con_media_generico(uint8_t scheda_su_scheda_giu_, uint8_t preamplifier_externalADC_1_onboardADC_0, uint8_t nodo_da_misurare, uint8_t differenziale_1_single_0)
This function sets the original gain when a few LSb have to be determined. The umber of bits is bit_t...
void ADC_sleep_ON_OFF(uint8_t up_down, uint8_t ADC_ON_1_OFF_0_NOP_GT1)
ADC is set to sleep or awake.
void SPItx(unsigned char dato)
This is a blocking function that transmits one byte over the SPI.
int ADC_compensazione_al_nodo(uint8_t line_to_read, int32_t lettura_ADC, int32_t lettura_offset)
This function allows to read a whatver regsiter of the ADC.
void ADC_Sleep_fun(uint8_t up_down)
ADC is sent to sleep mode.
long long int divisione_di_gianlu(long long int Numeratore, long long int denominatore)
The division operator on 32 or 64 bit, positive/negative integers.
long int ADC_lettura_24bit(char line_to_read_to_select_ADCch0_ADCch1, uint8_t up_down, uint8_t cosa_fare)
ADC Wakeup and 24 bits reading.
void instr_ADC_LETTURA_function(void)
All the posible nodes voltages can be read with this instruction. Either the internal or an external ...
uint32_t ADC_lettura_registro(char ADC_0_o_1, uint8_t up_down, uint8_t registro_ch0)
This function allows to read a whatver regsiter of the ADC.
volatile uint16_t ADC_medie_per_misura
the number of ADC readings to average, the maximum is 400
static int32_t ADC_misura_differenziale_single_ended(uint8_t scheda_su_scheda_giu, uint8_t nodo_da_leggere, uint8_t differenziale_1_single_0)
This function performs a differential or single ended measurement on nodes.
int32_t ADC_lettura(uint8_t scheda_su_scheda_giu_, uint8_t node_to_read, uint8_t cosa_fare)
This function allows to read the voltage of any of the selectable nodes.
void ADC_Wakeup(uint8_t up_down)
ADC Wakeup and 24 bits reading.
unsigned char medie_ADC
The number of averages done is 1 << medie_ADC, or 2^medie_ADC.
const struct ADC_coefficiente_type ADC_coefficiente[]
Node normalizing coeficinets used in ADC_lettura_24bit()
volatile uint8_t ADC_sleep_off
if 0 ADC in sleep when not working, ADC>1 ADC never sleep
volatile bool ADC_non_leggi_lo_offset_se_true
if not necessary, the ADC input offset from buffer is not read
void ADC_selfcal_zero_scale(uint8_t up_down)
ADC self-calibration. ADC needs to be pre-selected.
void ADC_scrittura_registro(char ADC_0_o_1, uint8_t up_down, uint8_t indirizzo_registro_ch0, int32_t value_to_write)
This function allows to read a whatver regsiter of the ADC.
unsigned int Radc_internal
unsigned int Rmultiplexer
This is the multiplexer resistor and the series resistor connected in series to it.
#define ADC_denominatore_PowerSupply
#define ADC_numeratore_Res_fisse
#define ADC_numeratore_PreOut
#define ADC_numeratore_Bias
#define ADC_denominatore_Bias
#define ADC_denominatore_Bias_p
#define ADC_denominatore_Res_fisse
#define ADC_numeratore_PGA
#define ADC_numeratore_PowerSupply
#define ADC_denominatore_Vreg
#define ADC_denominatore_PGA
#define ADC_numeratore_Bias_p
#define ADC_numeratore_Vreg
#define ADC_denominatore_PreOut
uint8_t tx_data[8]
Transmission data vector.
#define bias_reading_attenuation
Trimmer coarse step in microV/step at the reading attenuation node.
#define bias_reading_attenuation_extern
< Attenuation for bias reading
#define spi_clock_for_relais
[ref_spi_clock_for_relais]
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.
@ ADC_RDY_pin_fault
ADC ready not received.
@ error_address_reg_ADC0
Error register for ADC0.
@ error_address_SPI
Error register for SPI.
@ SPI_error_EVENT_DATA_LOST
This is ARM_SPI_EVENT_DATA_LOST.
const porta_pin_def ADC_ready_down
Configuration ADC pin.
const porta_pin_def ADC_Chip_Sel_up
Configuration ADC pin.
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 ...
const porta_pin_def ADC_ready_up
Configuration ADC pin.
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.
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.
const porta_pin_def ADC_Chip_Sel_down
Configuration ADC pin.
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.
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.
#define I2C_mux_Scheda_giu
Selection of the I2C1 for lower board (purtroppo \'e contorto)
#define I2C_mux_Scheda_su
Selection of the I2C0 for the upper board (purtroppo \'e contorto)
#define ADC_Misura_bias_10_att_ch0_p
mux 4
#define ADC_GND_con_10k
instr_NO_operation has the value of zero and the follwoing instructions are increased by one at each ...
@ node_voltage_PreOut_ch_5
Node voltage selection of PreOut 12+5 board down.
#define ADC_Vdig5V_micro_in
mux 3
#define ADC_Misura_bias_10_att_ch1_p
mux 2
void Analog_mux_line_to_select_deselect(uint8_t scheda_su_scheda_giu, uint8_t line_to_select, uint8_t select_1_deselect_0)
Selection of the line to mesure with the analog MUX of the mainboard, driven by the I2C->parallel mux...
void Analog_mux_line_to_select_deselect_for_postmainboard(uint8_t scheda_su_scheda_giu, uint8_t line_to_select, uint8_t select_1_deselect_0)
Selection of the line to measure with the analog MUX's of the postmainboard, directely driven by the ...
@ node_voltage_Analog_Mux_0_offset
Starting Offset for this set of nodes, 32.
@ node_voltage_Analog_Mux_meas_bias_pos_ch0
@ node_voltage_Analog_Mux_meas_input_bias_neg
int32_t preamplifier_ADC_external_measured_node_function(uint8_t scheda_su_scheda_giu, uint8_t indice)
This function provide node reading from an external ADC.
uint32_t evento_SPI
This is the variable which resembles the flags from the communication.
#define SPI_control_for_relay_driver
[ref_SPI_control_for_relay_driver]
void Aspetta_tanti_ms(int millisecondi)
The timing function.
volatile int8_t vettore_istruzioni[8]
This is a copy of the received 8 bytes from the CAN.