Nut/OS  4.10.3
API Reference
adc.c File Reference

AVR adc driver. More...

#include <string.h>
#include <avr/sleep.h>
#include <sys/heap.h>
#include <sys/atom.h>
#include <sys/nutconfig.h>
#include <dev/irqreg.h>
#include <dev/adc.h>
Include dependency graph for adc.c:

Go to the source code of this file.

Defines

#define ADC_INITIAL_CHANNEL   ADC0
#define ADC_INITIAL_REF   AVCC
#define ADC_INITIAL_MODE   SINGLE_CONVERSION
#define ADC_INITIAL_PRESCALE   ADC_PRESCALE_DIV64
#define ADC_BUF_SIZE   16
#define AVR_SLEEP_CTRL_REG   MCUCR
#define _adc_buf_head   ADC_BUF_SIZE
#define _adc_buf_tail   (ADC_BUF_SIZE+1)

Functions

int ADCBufRead (uint16_t *buf, uint16_t *read)
int ADCBufWrite (uint16_t *buf, uint16_t *write)
void ADCBufInit (uint16_t *buf)
void ADCInit (void)
void ADCSetRef (adc_ref_t reference)
void ADCSetMode (adc_mode_t mode)
uint8_t ADCSetPrescale (uint8_t prescalar)
void ADCSetChannel (adc_channel_t adc_channel)
void ADCBufferFlush (void)
void ADCStartConversion (void)
void ADCStartLowNoiseConversion (void)
void ADCStopConversion (void)
uint8_t ADCRead (uint16_t *value)
adc_mode_t ADCGetMode (void)

Variables

uint8_t adc_sleep_mode = SLEEP_MODE_ADC
adc_mode_t current_mode = ADC_OFF
uint16_tADC_buffer = NULL

Detailed Description

AVR adc driver.

Definition in file adc.c.