diff --git a/prosjekt.X/nbproject/configurations.xml b/prosjekt.X/nbproject/configurations.xml index 7e835d5..5dd5854 100644 --- a/prosjekt.X/nbproject/configurations.xml +++ b/prosjekt.X/nbproject/configurations.xml @@ -1,3 +1,192 @@ +<<<<<<< Updated upstream + + + + + themistor-temp.h + uart.h + voltage.h + fan_speeeed.h + + + Makefile + + + + + main.c + thermistor-temp.c + uart.c + voltage.c + fan_speeeed.c + + + + . + + Makefile + + + + localhost + AVR128DB48 + + + nEdbgTool + XC8 + 2.46 + 3 + + + + + + + + + + + + + + + false + false + + + + + + + false + false + + false + + false + false + false + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +======= @@ -185,3 +374,4 @@ +>>>>>>> Stashed changes diff --git a/prosjekt.X/voltage.c b/prosjekt.X/voltage.c index 2983dfb..8c43dfd 100644 --- a/prosjekt.X/voltage.c +++ b/prosjekt.X/voltage.c @@ -1,11 +1,6 @@ #include "voltage.h" #include "uart.h" -void sensor_init(void) { - /* Disable digital input buffer */ - -} - void ADC0_init(void) { /* Initializing ADC0 pin*/ PORTD.PIN6CTRL &= ~PORT_ISC_gm; @@ -28,13 +23,31 @@ uint16_t ADC0_read(void) { ; } // Clear the interrupt flag by writing 1: - ADC0.INTFLAGS = ADC_RESRDY_bm; + ADC0.INTFLAGS = ADC_RESRDY_bm; return ADC0.RES; } -uint16_t voltage_values(void) { - /* Gets values */ - uint16_t adcVal = ADC0_read(); - VREF.ADC0REF = VREF_REFSEL_VDD_gc; +uint16_t diode_voltage_read() { + /* Gets value for the diode */ + uint8_t adcVal = ADC0_read(); + return adcVal; +} + +uint16_t internal_voltage_read() { + /* Gets value for the internal voltage reffreance*/ + + VREF.ADC0REF = VREF_REFSEL_VDD_gc; +} + +uint16_t diode_voltage_read(){ + /* Gets value for the diode */ + uint8_t adcVal = ADC0_read(); + return adcVal; +} +uint16_t internal_voltage_read() { + /* Gets value for the internal voltage reffreance*/ + + VREF.ADC0REF = VREF_REFSEL_VDD_gc; + return VREF_REFSEL_VDD_gc; } \ No newline at end of file diff --git a/prosjekt.X/voltage.h b/prosjekt.X/voltage.h index 221b741..c006796 100644 --- a/prosjekt.X/voltage.h +++ b/prosjekt.X/voltage.h @@ -44,16 +44,17 @@ #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ -// Initializing of the sensor pins -void sensor_init(void); -// Initializing of the ADC0 pins -void ADC0_init(void); -// -//void ADC0_start(void); -//Start ADC conversion -uint16_t ADC0_read(void); -// Gets the value from sensor and internal voltage -uint16_t voltage_values(void); + + // Initializing of the ADC0 pins + + void ADC0_init(void); + // + //void ADC0_start(void); + //Start ADC conversion + uint16_t ADC0_read(void); + // Gets the value from sensor and internal voltage + uint16_t internal_voltage_read(); + uint16_t diode_voltage_read(); #ifdef __cplusplus } #endif /* __cplusplus */