2020-03-29 01:46:11 +01:00
|
|
|
#include "clock.hpp"
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
|
|
|
|
#include "flash/flash.hpp"
|
2020-03-29 04:18:26 +02:00
|
|
|
#include "io/io.hpp"
|
2020-03-29 01:46:11 +01:00
|
|
|
#include "uart/uart.hpp"
|
|
|
|
|
2020-03-29 04:18:26 +02:00
|
|
|
#define ADC_INT_VECTOR
|
|
|
|
#include "adc/adc.hpp"
|
|
|
|
|
2020-03-29 01:46:11 +01:00
|
|
|
#define UART0_INT_VECTORS
|
|
|
|
#include "uart/hardware0.hpp"
|
|
|
|
|
2020-03-29 01:29:59 +01:00
|
|
|
int main()
|
|
|
|
{
|
2020-03-29 01:46:11 +01:00
|
|
|
uart::Uart0<> serial;
|
|
|
|
serial.init();
|
|
|
|
|
|
|
|
serial << F("Thermistor reader\r\n");
|
|
|
|
|
2020-03-29 04:18:26 +02:00
|
|
|
using adc_conf = adc::Config<adc::SingleMode>;
|
|
|
|
|
|
|
|
adc::Adc<adc_conf, io::P, io::P::C0> adcPin;
|
|
|
|
adcPin.init();
|
|
|
|
|
|
|
|
while (true) {
|
|
|
|
auto adcSample = adcPin.read();
|
|
|
|
serial << F("Read ADC: ") << adcSample << F("\r\n");
|
|
|
|
|
|
|
|
_delay_ms(1000);
|
|
|
|
}
|
|
|
|
|
2020-03-29 01:46:11 +01:00
|
|
|
serial.flushTx();
|
|
|
|
|
2020-03-29 01:29:59 +01:00
|
|
|
return 0;
|
|
|
|
}
|