Made comments on the code
This commit is contained in:
parent
efe623936a
commit
25050d4500
@ -1,12 +1,14 @@
|
||||
#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;
|
||||
PORTD.PIN6CTRL |= PORT_ISC_INPUT_DISABLE_gc;
|
||||
PORTD.PIN6CTRL |= PORT_ISC_INPUT_DISABLE_gc; /* Disable */
|
||||
PORTD.PIN6CTRL &= PORT_PULLUPEN_bm;
|
||||
|
||||
ADC0.CTRLC = ADC_PRESC_DIV4_gc;
|
||||
@ -30,6 +32,7 @@ uint16_t ADC0_read(void) {
|
||||
}
|
||||
|
||||
uint8_t voltage_values(void) {
|
||||
/* Gets values */
|
||||
uint8_t adcVal = ADC0_read();
|
||||
VREF.ADC0REF = VREF_REFSEL_VDD_gc;
|
||||
return adcVal;
|
||||
|
||||
@ -44,11 +44,16 @@
|
||||
#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);
|
||||
uint8_t ADC0_read(void);
|
||||
void voltage_values(void);
|
||||
//
|
||||
//void ADC0_start(void);
|
||||
//Start ADC conversion
|
||||
uint16_t ADC0_read(void);
|
||||
// Gets the value from sensor and internal voltage
|
||||
uint8_t voltage_values(void);
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
||||
Loading…
Reference in New Issue
Block a user