Microchip® Advanced Software Framework

dac_example1.c File Reference

AVR XMEGA Digital to Analog Converter Driver Example 1.

Copyright (c) 2010-2018 Microchip Technology Inc. and its subsidiaries.

#include <conf_example.h>
#include <asf.h>

Macros

#define NR_OF_SAMPLES   32
 Number of samples in sample buffer. More...
 
#define RATE_OF_CONVERSION   22050
 Rate at which DA conversions should be done. More...
 

Functions

int main (void)
 

Variables

static const uint16_t sine [NR_OF_SAMPLES]
 Sample buffer with one period of a sine wave. More...
 

#define NR_OF_SAMPLES   32

Number of samples in sample buffer.

Referenced by main().

#define RATE_OF_CONVERSION   22050

Rate at which DA conversions should be done.

Referenced by main().

const uint16_t sine[NR_OF_SAMPLES]
static
Initial value:
= {
32768, 35325, 37784, 40050, 42036, 43666, 44877, 45623,
45875, 45623, 44877, 43666, 42036, 40050, 37784, 35325,
32768, 30211, 27752, 25486, 23500, 21870, 20659, 19913,
19661, 19913, 20659, 21870, 23500, 25486, 27752, 30211,
}

Sample buffer with one period of a sine wave.

Referenced by main().