00001
00019
00020
00021
00022
00023 #include "dac_config.h"
00024
00025 #ifdef _USE_DAC_LIB_
00026 #include "dac_drv.h"
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00040 void init_dac(void){
00041
00042 Dac_enable();
00043
00044 # if (DAC_INPUT_RIGHT_ADJUST == 1)
00045 Dac_right_adjust_input();
00046 # elif (DAC_INPUT_RIGHT_ADJUST == 0)
00047 Dac_left_adjust_input();
00048 # else
00049 # error (ADC_RIGHT_ADJUST_RESULT should be 0 or 1... See config.h file)
00050 # endif
00051
00052 # if (DAC_OUTPUT_DRIVER == 1)
00053 Dac_enable_output();
00054 # elif (DAC_OUTPUT_DRIVER == 0)
00055 Dac_disable_output();
00056 # else
00057 # error (DAC_OUTPUT_DRIVER should be 0 or 1... See config.h file)
00058 # endif
00059 }
00060
00061 #endif // USE_DAC