CROSS Technical Documentation User Manual and Technical Doc.
INFN Milano Bicocca
Loading...
Searching...
No Matches
Adc.c File Reference
#include "tutti_gli_header.h"

Go to the source code of this file.

Macros

#define indice_attenuatore_BIAS   sizeof(ADC_coefficiente ) / sizeof(ADC_coefficiente[1])-1
 

Functions

void ADC_Sleep_fun (uint8_t up_down)
 ADC is sent to sleep mode.
 
void ADC_selfcal_zero_scale (uint8_t up_down)
 ADC self-calibration. ADC needs to be pre-selected.
 
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 ADC_Wakeup (uint8_t up_down)
 ADC Wakeup and 24 bits reading.
 
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.
 
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.
 
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.
 
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.
 
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 instr_ADC_LETTURA_function (void)
 All the posible nodes voltages can be read with this instruction. Either the internal or an external ADC can be used. The external ADC option will become obsolote at the time of installation.
 
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_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_to_go.
 
void SPItx (unsigned char dato)
 This is a blocking function that transmits one byte over the SPI.
 
void calibrazione_Resistenze_sterne_ADC (void)
 
int correzione_misura_ADC (char quali_coefficienti, int misura)
 
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.
 

Variables

int32_t volatile ADC_misura_fatta
 
volatile bool ADC_non_leggi_lo_offset_se_true =false
 if not necessary, the ADC input offset from buffer is not read
 
int32_t volatile ADC_external_measurement =0
 
uint8_t volatile ADC_external_measured_node =0
 
volatile uint8_t ADC_sleep_off =10
 if 0 ADC in sleep when not working, ADC>1 ADC never sleep
 
volatile uint16_t ADC_medie_per_misura =10
 the number of ADC readings to average, the maximum is 400
 
const struct ADC_coefficiente_type ADC_coefficiente []
 Node normalizing coeficinets used in ADC_lettura_24bit()
 
unsigned int Radc_internal =15e6
 
unsigned int Rmultiplexer =200e3
 This is the multiplexer resistor and the series resistor connected in series to it.
 
struct coeffcienti_misura_ADC_type coeffcienti_misura_ADC [5+1]
 
unsigned char coeffcienti_misura_ADC_nodi [72]
 
unsigned char medie_ADC = 2
 The number of averages done is 1 << medie_ADC, or 2^medie_ADC.