Fixed header, comments and Muxpos

This commit is contained in:
Elp03 2024-04-09 16:13:04 +02:00
parent 7f3c1fa7c1
commit ca28e23b70
2 changed files with 9 additions and 3 deletions

View File

@ -35,14 +35,14 @@ uint16_t ADC0_read(void) {
uint16_t thermistor_voltage_read() { uint16_t thermistor_voltage_read() {
/* Gets value for the diode */ /* Gets value for the diode */
ADC0.MUXPOS = 0x03; ADC0.MUXPOS = 0x03; // Read PD3
uint16_t adc_val = ADC0_read(); uint16_t adc_val = ADC0_read();
return adc_val; return adc_val;
} }
// Gets the value over thermistor
uint16_t external_voltage_read(){ uint16_t external_voltage_read(){
ADC0.MUXPOS = 0x02; ADC0.MUXPOS = 0x06; // Read PD6
uint16_t adc_val = ADC0_read(); uint16_t adc_val = ADC0_read();
return adc_val; return adc_val;

View File

@ -54,7 +54,13 @@ extern "C" {
uint16_t ADC0_read(void); uint16_t ADC0_read(void);
// Gets the value from sensor and internal voltage // Gets the value from sensor and internal voltage
uint16_t internal_voltage_read(); uint16_t internal_voltage_read();
// Gets the value over thermistor
uint16_t thermistor_voltage_read(); uint16_t thermistor_voltage_read();
// Gets internal voltage
uint16_t external_voltage_read();
// Converts value to voltage
uint16_t convert_to_voltage(uint16_t adc_val);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif /* __cplusplus */ #endif /* __cplusplus */