Xmega Application Note


dac_driver.h

Go to the documentation of this file.
00001 /* This file has been prepared for Doxygen automatic documentation generation.*/
00059 #ifndef DAC_DRIVER_H
00060 #define DAC_DRIVER_H
00061 
00062 #include "avr_compiler.h"
00063 
00065 typedef enum DAC_CH_enum {
00066         CH0 = 0x00,
00067         CH1 = 0x01,
00068 } DAC_CH_t;
00069 
00070 
00072 typedef enum DAC_TRIG_enum {
00073         DAC_TRIG_0_0 = 0x00,                                
00074         DAC_TRIG_0_1 = DAC_CH0TRIG_bm,                      
00075         DAC_TRIG_1_0 = DAC_CH1TRIG_bm,                      
00076         DAC_TRIG_1_1 = ( DAC_CH1TRIG_bm | DAC_CH0TRIG_bm ), 
00077 } DAC_TRIG_t;
00078 
00079 
00080 /* Definition of macros. */
00081 
00086 #define DAC_Disable( _dac )                ( (_dac)->CTRLA &= ~DAC_ENABLE_bm )
00087 
00088 
00097 #define DAC_InternalOutput_Enable( _dac )  ( (_dac)->CTRLA |= DAC_IDOEN_bm )
00098 
00099 
00105 #define DAC_InternalOutput_Disable( _dac ) ( (_dac)->CTRLA &= ~DAC_IDOEN_bm )
00106 
00107 
00108 /* Prototyping of functions. Documentation is found in source file. */
00109 
00110 void DAC_SingleChannel_Enable( volatile DAC_t * dac,
00111                                DAC_REFSEL_t convRef,
00112                                bool leftAdjust );
00113 void DAC_DualChannel_Enable( volatile DAC_t * dac,
00114                              DAC_REFSEL_t convRef,
00115                              bool leftAdjust,
00116                              DAC_CONINTVAL_t sampleInterval,
00117                              DAC_REFRESH_t refreshInterval );
00118 void DAC_Channel_Write( volatile DAC_t * dac, uint16_t data, DAC_CH_t channel );
00119 bool DAC_Channel_DataEmpty( volatile DAC_t * dac, DAC_CH_t channel );
00120 void DAC_EventAction_Set( volatile DAC_t * dac,
00121                           DAC_TRIG_t trigChannel,
00122                           uint8_t eventLine );
00123 
00124 #endif
00125 
@DOC_TITLE@
Generated on Wed May 14 16:11:05 2008 for AVR1301 Using the XMEGA DAC by doxygen 1.5.5