amplifier_drv.c

Go to the documentation of this file.
00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 //_____  I N C L U D E S ___________________________________________________
00015 #include "config.h"
00016 #include "amplifier_drv.h"
00017 
00018 //_____ M A C R O S ________________________________________________________
00019 
00020 
00021 //_____ P R I V A T E    D E C L A R A T I O N _____________________________
00022 
00023 
00024 //_____ D E F I N I T I O N ________________________________________________
00025 
00026 
00027 //_____ D E C L A R A T I O N ______________________________________________
00028 
00029 #ifdef USE_AMP0 
00030 
00031 
00032 
00033 
00034 
00035 void init_amp0(void)
00036 {
00037     Enable_amp0();
00038 
00039 #   if (AMP0_INPUT_SHUNT == 1)
00040        Enable_amp0_input_shunt();
00041 #   elif (AMP0_INPUT_SHUNT == 0)
00042        Disable_amp0_input_shunt();
00043 #   else
00044 #      error (AMP0_INPUT_SHUNT should be 0 or 1... See config.h file)
00045 #   endif
00046 
00047 #   if (AMP0_GAIN == 40)
00048        Set_amp0_gain40();
00049 #   elif (AMP0_GAIN == 20)
00050        Set_amp0_gain20();
00051 #   elif (AMP0_GAIN == 10)
00052        Set_amp0_gain10();
00053 #   elif (AMP0_GAIN ==  5)
00054        Set_amp0_gain05();
00055 #   else
00056 #      error (AMP0_GAIN should be 5, 10, 20 or 40... See config.h file)
00057 #   endif
00058 
00059 #   if (AMP0_CLOCK == 0)
00060        Amp0_internal_clock();
00061 #   elif (AMP0_CLOCK == 1)
00062        Amp0_psc0_clock();
00063 #   elif (AMP0_CLOCK == 2)
00064        Amp0_psc1_clock();
00065 #   elif (AMP0_CLOCK == 3)
00066        Amp0_psc2_clock();
00067 #   else
00068 #      error (AMP0_CLOCK should be 0, 1, 2 or 3... See config.h file)
00069 #   endif
00070 }
00071 #endif //USE_AMP0
00072 
00073 #ifdef USE_AMP1 
00074 
00075 
00076 
00077 
00078 
00079 void init_amp1(void)
00080 {
00081     Enable_amp1();
00082 
00083 #   if (AMP1_INPUT_SHUNT == 1)
00084        Enable_amp1_input_shunt();
00085 #   elif (AMP1_INPUT_SHUNT == 0)
00086        Disable_amp1_input_shunt();
00087 #   else
00088 #      error (AMP1_INPUT_SHUNT should be 0 or 1... See config.h file)
00089 #   endif
00090 
00091 #   if (AMP1_GAIN == 40)
00092        Set_amp1_gain40();
00093 #   elif (AMP1_GAIN == 20)
00094        Set_amp1_gain20();
00095 #   elif (AMP1_GAIN == 10)
00096        Set_amp1_gain10();
00097 #   elif (AMP1_GAIN ==  5)
00098        Set_amp1_gain05();
00099 #   else
00100 #      error (AMP1_GAIN should be 5, 10, 20 or 40... See config.h file)
00101 #   endif
00102 
00103 #   if (AMP1_CLOCK == 0)
00104        Amp1_internal_clock();
00105 #   elif (AMP1_CLOCK == 1)
00106        Amp1_psc0_clock();
00107 #   elif (AMP1_CLOCK == 2)
00108        Amp1_psc1_clock();
00109 #   elif (AMP1_CLOCK == 3)
00110        Amp1_psc2_clock();
00111 #   else
00112 #      error (AMP1_CLOCK should be 0, 1, 2 or 3... See config.h file)
00113 #   endif
00114 }
00115 #endif // USE_AMP1

Generated on Wed Jul 12 16:55:10 2006 for Atmel BLDC Sensorless on ATAVRMC100 by  doxygen 1.4.7