You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
497 B
27 lines
497 B
2 years ago
|
#pragma once
|
||
|
|
||
|
//
|
||
|
// Utilities for build-in A/D converter
|
||
|
//
|
||
|
|
||
|
#include <avr/io.h>
|
||
|
#include <stdint.h>
|
||
|
|
||
|
/** Initialize the ADC */
|
||
|
void adc_init();
|
||
|
|
||
|
/** Disable AD (for power saving?) */
|
||
|
void adc_disable();
|
||
|
|
||
|
/** Sample analog pin with 8-bit precision */
|
||
|
uint8_t adc_read_byte(uint8_t channel);
|
||
|
|
||
|
/** Sample analog pin with 10-bit precision */
|
||
|
uint16_t adc_read_word(uint8_t channel);
|
||
|
|
||
|
void adc_async_start_measure_word(uint8_t channel);
|
||
|
|
||
|
bool adc_async_ready();
|
||
|
|
||
|
uint16_t adc_async_get_result_word();
|