em_opamp.h

Go to the documentation of this file.
00001 /**************************************************************************/
00034 #ifndef __SILICON_LABS_EM_OPAMP_H_
00035 #define __SILICON_LABS_EM_OPAMP_H_
00036 
00037 #include "em_device.h"
00038 #if defined(OPAMP_PRESENT) && (OPAMP_COUNT == 1)
00039 
00040 #ifdef __cplusplus
00041 extern "C" {
00042 #endif
00043 
00044 #include <stdint.h>
00045 #include <stdbool.h>
00046 #include "em_dac.h"
00047 
00048 /***************************************************************************/
00053 /***************************************************************************/
00061 #define DAC_OPA_VALID(opa)    ((opa) <= OPA2)
00062 
00065 /*******************************************************************************
00066  ********************************   ENUMS   ************************************
00067  ******************************************************************************/
00068 
00070 typedef enum
00071 {
00072   OPA0 = 0,                   
00073   OPA1 = 1,                   
00074   OPA2 = 2                    
00075 } OPAMP_TypeDef;
00076 
00078 typedef enum
00079 {
00080   opaNegSelDisable   = DAC_OPA0MUX_NEGSEL_DISABLE,    
00081   opaNegSelUnityGain = DAC_OPA0MUX_NEGSEL_UG,         
00082   opaNegSelResTap    = DAC_OPA0MUX_NEGSEL_OPATAP,     
00083   opaNegSelNegPad    = DAC_OPA0MUX_NEGSEL_NEGPAD      
00084 } OPAMP_NegSel_TypeDef;
00085 
00087 typedef enum
00088 {
00089   opaPosSelDisable    = DAC_OPA0MUX_POSSEL_DISABLE,   
00090   opaPosSelDac        = DAC_OPA0MUX_POSSEL_DAC,       
00091   opaPosSelPosPad     = DAC_OPA0MUX_POSSEL_POSPAD,    
00092   opaPosSelOpaIn      = DAC_OPA0MUX_POSSEL_OPA0INP,   
00093   opaPosSelResTapOpa0 = DAC_OPA0MUX_POSSEL_OPATAP     
00094 } OPAMP_PosSel_TypeDef;
00095 
00097 typedef enum
00098 {
00099   opaOutModeDisable = DAC_OPA0MUX_OUTMODE_DISABLE,    
00100   opaOutModeMain    = DAC_OPA0MUX_OUTMODE_MAIN,       
00101   opaOutModeAlt     = DAC_OPA0MUX_OUTMODE_ALT,        
00102   opaOutModeAll     = DAC_OPA0MUX_OUTMODE_ALL         
00103 } OPAMP_OutMode_TypeDef;
00104 
00106 typedef enum
00107 {
00108   opaResSelDefault    = DAC_OPA0MUX_RESSEL_DEFAULT,  
00109   opaResSelR2eq0_33R1 = DAC_OPA0MUX_RESSEL_RES0,     
00110   opaResSelR2eqR1     = DAC_OPA0MUX_RESSEL_RES1,     
00111   opaResSelR1eq1_67R1 = DAC_OPA0MUX_RESSEL_RES2,     
00112   opaResSelR2eq2R1    = DAC_OPA0MUX_RESSEL_RES3,     
00113   opaResSelR2eq3R1    = DAC_OPA0MUX_RESSEL_RES4,     
00114   opaResSelR2eq4_33R1 = DAC_OPA0MUX_RESSEL_RES5,     
00115   opaResSelR2eq7R1    = DAC_OPA0MUX_RESSEL_RES6,     
00116   opaResSelR2eq15R1   = DAC_OPA0MUX_RESSEL_RES7      
00117 } OPAMP_ResSel_TypeDef;
00118 
00120 typedef enum
00121 {
00122   opaResInMuxDisable = DAC_OPA0MUX_RESINMUX_DISABLE,   
00123   opaResInMuxOpaIn   = DAC_OPA0MUX_RESINMUX_OPA0INP,   
00124   opaResInMuxNegPad  = DAC_OPA0MUX_RESINMUX_NEGPAD,    
00125   opaResInMuxPosPad  = DAC_OPA0MUX_RESINMUX_POSPAD,    
00126   opaResInMuxVss     = DAC_OPA0MUX_RESINMUX_VSS        
00127 } OPAMP_ResInMux_TypeDef;
00128 
00129 /*******************************************************************************
00130  *******************************   STRUCTS   ***********************************
00131  ******************************************************************************/
00132 
00134 typedef struct
00135 {
00136   OPAMP_NegSel_TypeDef   negSel;              
00137   OPAMP_PosSel_TypeDef   posSel;              
00138   OPAMP_OutMode_TypeDef  outMode;             
00139   OPAMP_ResSel_TypeDef   resSel;              
00140   OPAMP_ResInMux_TypeDef resInMux;            
00141   uint32_t               outPen;              
00168   uint32_t               bias;                
00169   bool                   halfBias;            
00170   bool                   lpfPosPadDisable;    
00171   bool                   lpfNegPadDisable;    
00172   bool                   nextOut;             
00173   bool                   npEn;                
00174   bool                   ppEn;                
00175   bool                   shortInputs;         
00176   bool                   hcmDisable;          
00177   bool                   defaultOffset;       
00178   uint32_t               offset;              
00179 } OPAMP_Init_TypeDef;
00180 
00182 #define OPA_INIT_UNITY_GAIN                                                       \
00183   {                                                                               \
00184     opaNegSelUnityGain,             /* Unity gain.                             */ \
00185     opaPosSelPosPad,                /* Pos input from pad.                     */ \
00186     opaOutModeMain,                 /* Main output enabled.                    */ \
00187     opaResSelDefault,               /* Resistor ladder is not used.            */ \
00188     opaResInMuxDisable,             /* Resistor ladder disabled.               */ \
00189     0,                              /* No alternate outputs enabled.           */ \
00190     _DAC_BIASPROG_BIASPROG_DEFAULT, /* Default bias setting.             */       \
00191     _DAC_BIASPROG_HALFBIAS_DEFAULT, /* Default half-bias setting.        */       \
00192     false,                          /* No low pass filter on pos pad.          */ \
00193     false,                          /* No low pass filter on neg pad.          */ \
00194     false,                          /* No nextout output enabled.              */ \
00195     false,                          /* Neg pad disabled.                       */ \
00196     true,                           /* Pos pad enabled, used as signal input.  */ \
00197     false,                          /* No shorting of inputs.                  */ \
00198     false,                          /* Rail-to-rail input enabled.             */ \
00199     true,                           /* Use factory calibrated opamp offset.    */ \
00200     0                               /* Opamp offset value (not used).          */ \
00201   }
00202 
00204 #define OPA_INIT_UNITY_GAIN_OPA2                                                  \
00205   {                                                                               \
00206     opaNegSelUnityGain,             /* Unity gain.                             */ \
00207     opaPosSelPosPad,                /* Pos input from pad.                     */ \
00208     opaOutModeMain,                 /* Main output enabled.                    */ \
00209     opaResSelDefault,               /* Resistor ladder is not used.            */ \
00210     opaResInMuxDisable,             /* Resistor ladder disabled.               */ \
00211     DAC_OPA0MUX_OUTPEN_OUT0,        /* Alternate output 0 enabled.             */ \
00212     _DAC_BIASPROG_BIASPROG_DEFAULT, /* Default bias setting.             */       \
00213     _DAC_BIASPROG_HALFBIAS_DEFAULT, /* Default half-bias setting.        */       \
00214     false,                          /* No low pass filter on pos pad.          */ \
00215     false,                          /* No low pass filter on neg pad.          */ \
00216     false,                          /* No nextout output enabled.              */ \
00217     false,                          /* Neg pad disabled.                       */ \
00218     true,                           /* Pos pad enabled, used as signal input.  */ \
00219     false,                          /* No shorting of inputs.                  */ \
00220     false,                          /* Rail-to-rail input enabled.             */ \
00221     true,                           /* Use factory calibrated opamp offset.    */ \
00222     0                               /* Opamp offset value (not used).          */ \
00223   }
00224 
00226 #define OPA_INIT_NON_INVERTING                                                    \
00227   {                                                                               \
00228     opaNegSelResTap,                /* Neg input from resistor ladder tap.     */ \
00229     opaPosSelPosPad,                /* Pos input from pad.                     */ \
00230     opaOutModeMain,                 /* Main output enabled.                    */ \
00231     opaResSelR2eq0_33R1,            /* R2 = 1/3 R1                             */ \
00232     opaResInMuxNegPad,              /* Resistor ladder input from neg pad.     */ \
00233     0,                              /* No alternate outputs enabled.           */ \
00234     _DAC_BIASPROG_BIASPROG_DEFAULT, /* Default bias setting.             */       \
00235     _DAC_BIASPROG_HALFBIAS_DEFAULT, /* Default half-bias setting.        */       \
00236     false,                          /* No low pass filter on pos pad.          */ \
00237     false,                          /* No low pass filter on neg pad.          */ \
00238     false,                          /* No nextout output enabled.              */ \
00239     true,                           /* Neg pad enabled, used as signal ground. */ \
00240     true,                           /* Pos pad enabled, used as signal input.  */ \
00241     false,                          /* No shorting of inputs.                  */ \
00242     false,                          /* Rail-to-rail input enabled.             */ \
00243     true,                           /* Use factory calibrated opamp offset.    */ \
00244     0                               /* Opamp offset value (not used).          */ \
00245   }
00246 
00248 #define OPA_INIT_NON_INVERTING_OPA2                                               \
00249   {                                                                               \
00250     opaNegSelResTap,                /* Neg input from resistor ladder tap.     */ \
00251     opaPosSelPosPad,                /* Pos input from pad.                     */ \
00252     opaOutModeMain,                 /* Main output enabled.                    */ \
00253     opaResSelR2eq0_33R1,            /* R2 = 1/3 R1                             */ \
00254     opaResInMuxNegPad,              /* Resistor ladder input from neg pad.     */ \
00255     DAC_OPA0MUX_OUTPEN_OUT0,        /* Alternate output 0 enabled.             */ \
00256     _DAC_BIASPROG_BIASPROG_DEFAULT, /* Default bias setting.             */       \
00257     _DAC_BIASPROG_HALFBIAS_DEFAULT, /* Default half-bias setting.        */       \
00258     false,                          /* No low pass filter on pos pad.          */ \
00259     false,                          /* No low pass filter on neg pad.          */ \
00260     false,                          /* No nextout output enabled.              */ \
00261     true,                           /* Neg pad enabled, used as signal ground. */ \
00262     true,                           /* Pos pad enabled, used as signal input.  */ \
00263     false,                          /* No shorting of inputs.                  */ \
00264     false,                          /* Rail-to-rail input enabled.             */ \
00265     true,                           /* Use factory calibrated opamp offset.    */ \
00266     0                               /* Opamp offset value (not used).          */ \
00267   }
00268 
00270 #define OPA_INIT_INVERTING                                                        \
00271   {                                                                               \
00272     opaNegSelResTap,                /* Neg input from resistor ladder tap.     */ \
00273     opaPosSelPosPad,                /* Pos input from pad.                     */ \
00274     opaOutModeMain,                 /* Main output enabled.                    */ \
00275     opaResSelR2eqR1,                /* R2 = R1                                 */ \
00276     opaResInMuxNegPad,              /* Resistor ladder input from neg pad.     */ \
00277     0,                              /* No alternate outputs enabled.           */ \
00278     _DAC_BIASPROG_BIASPROG_DEFAULT, /* Default bias setting.             */       \
00279     _DAC_BIASPROG_HALFBIAS_DEFAULT, /* Default half-bias setting.        */       \
00280     false,                          /* No low pass filter on pos pad.          */ \
00281     false,                          /* No low pass filter on neg pad.          */ \
00282     false,                          /* No nextout output enabled.              */ \
00283     true,                           /* Neg pad enabled, used as signal input.  */ \
00284     true,                           /* Pos pad enabled, used as signal ground. */ \
00285     false,                          /* No shorting of inputs.                  */ \
00286     false,                          /* Rail-to-rail input enabled.             */ \
00287     true,                           /* Use factory calibrated opamp offset.    */ \
00288     0                               /* Opamp offset value (not used).          */ \
00289   }
00290 
00292 #define OPA_INIT_INVERTING_OPA2                                                   \
00293   {                                                                               \
00294     opaNegSelResTap,                /* Neg input from resistor ladder tap.     */ \
00295     opaPosSelPosPad,                /* Pos input from pad.                     */ \
00296     opaOutModeMain,                 /* Main output enabled.                    */ \
00297     opaResSelR2eqR1,                /* R2 = R1                                 */ \
00298     opaResInMuxNegPad,              /* Resistor ladder input from neg pad.     */ \
00299     DAC_OPA0MUX_OUTPEN_OUT0,        /* Alternate output 0 enabled.             */ \
00300     _DAC_BIASPROG_BIASPROG_DEFAULT, /* Default bias setting.             */       \
00301     _DAC_BIASPROG_HALFBIAS_DEFAULT, /* Default half-bias setting.        */       \
00302     false,                          /* No low pass filter on pos pad.          */ \
00303     false,                          /* No low pass filter on neg pad.          */ \
00304     false,                          /* No nextout output enabled.              */ \
00305     true,                           /* Neg pad enabled, used as signal input.  */ \
00306     true,                           /* Pos pad enabled, used as signal ground. */ \
00307     false,                          /* No shorting of inputs.                  */ \
00308     false,                          /* Rail-to-rail input enabled.             */ \
00309     true,                           /* Use factory calibrated opamp offset.    */ \
00310     0                               /* Opamp offset value (not used).          */ \
00311   }
00312 
00314 #define OPA_INIT_CASCADED_NON_INVERTING_OPA0                                      \
00315   {                                                                               \
00316     opaNegSelResTap,                /* Neg input from resistor ladder tap.     */ \
00317     opaPosSelPosPad,                /* Pos input from pad.                     */ \
00318     opaOutModeAll,                  /* Both main and alternate outputs.        */ \
00319     opaResSelR2eq0_33R1,            /* R2 = 1/3 R1                             */ \
00320     opaResInMuxNegPad,              /* Resistor ladder input from neg pad.     */ \
00321     0,                              /* No alternate outputs enabled.           */ \
00322     _DAC_BIASPROG_BIASPROG_DEFAULT, /* Default bias setting.             */       \
00323     _DAC_BIASPROG_HALFBIAS_DEFAULT, /* Default half-bias setting.        */       \
00324     false,                          /* No low pass filter on pos pad.          */ \
00325     false,                          /* No low pass filter on neg pad.          */ \
00326     true,                           /* Pass output to next stage (OPA1).       */ \
00327     true,                           /* Neg pad enabled, used as signal ground. */ \
00328     true,                           /* Pos pad enabled, used as signal input.  */ \
00329     false,                          /* No shorting of inputs.                  */ \
00330     false,                          /* Rail-to-rail input enabled.             */ \
00331     true,                           /* Use factory calibrated opamp offset.    */ \
00332     0                               /* Opamp offset value (not used).          */ \
00333   }
00334 
00336 #define OPA_INIT_CASCADED_NON_INVERTING_OPA1                                      \
00337   {                                                                               \
00338     opaNegSelResTap,                /* Neg input from resistor ladder tap.     */ \
00339     opaPosSelOpaIn,                 /* Pos input from OPA0 output.             */ \
00340     opaOutModeAll,                  /* Both main and alternate outputs.        */ \
00341     opaResSelR2eq0_33R1,            /* R2 = 1/3 R1                             */ \
00342     opaResInMuxNegPad,              /* Resistor ladder input from neg pad.     */ \
00343     0,                              /* No alternate outputs enabled.           */ \
00344     _DAC_BIASPROG_BIASPROG_DEFAULT, /* Default bias setting.             */       \
00345     _DAC_BIASPROG_HALFBIAS_DEFAULT, /* Default half-bias setting.        */       \
00346     false,                          /* No low pass filter on pos pad.          */ \
00347     false,                          /* No low pass filter on neg pad.          */ \
00348     true,                           /* Pass output to next stage (OPA2).       */ \
00349     true,                           /* Neg pad enabled, used as signal ground. */ \
00350     false,                          /* Pos pad disabled.                       */ \
00351     false,                          /* No shorting of inputs.                  */ \
00352     false,                          /* Rail-to-rail input enabled.             */ \
00353     true,                           /* Use factory calibrated opamp offset.    */ \
00354     0                               /* Opamp offset value (not used).          */ \
00355   }
00356 
00358 #define OPA_INIT_CASCADED_NON_INVERTING_OPA2                                      \
00359   {                                                                               \
00360     opaNegSelResTap,                /* Neg input from resistor ladder tap.     */ \
00361     opaPosSelOpaIn,                 /* Pos input from OPA1 output.             */ \
00362     opaOutModeMain,                 /* Main output enabled.                    */ \
00363     opaResSelR2eq0_33R1,            /* R2 = 1/3 R1                             */ \
00364     opaResInMuxNegPad,              /* Resistor ladder input from neg pad.     */ \
00365     DAC_OPA0MUX_OUTPEN_OUT0,        /* Alternate output 0 enabled.             */ \
00366     _DAC_BIASPROG_BIASPROG_DEFAULT, /* Default bias setting.             */       \
00367     _DAC_BIASPROG_HALFBIAS_DEFAULT, /* Default half-bias setting.        */       \
00368     false,                          /* No low pass filter on pos pad.          */ \
00369     false,                          /* No low pass filter on neg pad.          */ \
00370     false,                          /* No nextout output enabled.              */ \
00371     true,                           /* Neg pad enabled, used as signal ground. */ \
00372     false,                          /* Pos pad disabled.                       */ \
00373     false,                          /* No shorting of inputs.                  */ \
00374     false,                          /* Rail-to-rail input enabled.             */ \
00375     true,                           /* Use factory calibrated opamp offset.    */ \
00376     0                               /* Opamp offset value (not used).          */ \
00377   }
00378 
00380 #define OPA_INIT_CASCADED_INVERTING_OPA0                                          \
00381   {                                                                               \
00382     opaNegSelResTap,                /* Neg input from resistor ladder tap.     */ \
00383     opaPosSelPosPad,                /* Pos input from pad.                     */ \
00384     opaOutModeAll,                  /* Both main and alternate outputs.        */ \
00385     opaResSelR2eqR1,                /* R2 = R1                                 */ \
00386     opaResInMuxNegPad,              /* Resistor ladder input from neg pad.     */ \
00387     0,                              /* No alternate outputs enabled.           */ \
00388     _DAC_BIASPROG_BIASPROG_DEFAULT, /* Default bias setting.             */       \
00389     _DAC_BIASPROG_HALFBIAS_DEFAULT, /* Default half-bias setting.        */       \
00390     false,                          /* No low pass filter on pos pad.          */ \
00391     false,                          /* No low pass filter on neg pad.          */ \
00392     true,                           /* Pass output to next stage (OPA1).       */ \
00393     true,                           /* Neg pad enabled, used as signal input.  */ \
00394     true,                           /* Pos pad enabled, used as signal ground. */ \
00395     false,                          /* No shorting of inputs.                  */ \
00396     false,                          /* Rail-to-rail input enabled.             */ \
00397     true,                           /* Use factory calibrated opamp offset.    */ \
00398     0                               /* Opamp offset value (not used).          */ \
00399   }
00400 
00402 #define OPA_INIT_CASCADED_INVERTING_OPA1                                          \
00403   {                                                                               \
00404     opaNegSelResTap,                /* Neg input from resistor ladder tap.     */ \
00405     opaPosSelPosPad,                /* Pos input from pad.                     */ \
00406     opaOutModeAll,                  /* Both main and alternate outputs.        */ \
00407     opaResSelR2eqR1,                /* R2 = R1                                 */ \
00408     opaResInMuxOpaIn,               /* Resistor ladder input from OPA0.        */ \
00409     0,                              /* No alternate outputs enabled.           */ \
00410     _DAC_BIASPROG_BIASPROG_DEFAULT, /* Default bias setting.             */       \
00411     _DAC_BIASPROG_HALFBIAS_DEFAULT, /* Default half-bias setting.        */       \
00412     false,                          /* No low pass filter on pos pad.          */ \
00413     false,                          /* No low pass filter on neg pad.          */ \
00414     true,                           /* Pass output to next stage (OPA2).       */ \
00415     false,                          /* Neg pad disabled.                       */ \
00416     true,                           /* Pos pad enabled, used as signal ground. */ \
00417     false,                          /* No shorting of inputs.                  */ \
00418     false,                          /* Rail-to-rail input enabled.             */ \
00419     true,                           /* Use factory calibrated opamp offset.    */ \
00420     0                               /* Opamp offset value (not used).          */ \
00421   }
00422 
00424 #define OPA_INIT_CASCADED_INVERTING_OPA2                                          \
00425   {                                                                               \
00426     opaNegSelResTap,                /* Neg input from resistor ladder tap.     */ \
00427     opaPosSelPosPad,                /* Pos input from pad.                     */ \
00428     opaOutModeMain,                 /* Main output enabled.                    */ \
00429     opaResSelR2eqR1,                /* R2 = R1                                 */ \
00430     opaResInMuxOpaIn,               /* Resistor ladder input from OPA1.        */ \
00431     DAC_OPA0MUX_OUTPEN_OUT0,        /* Alternate output 0 enabled.             */ \
00432     _DAC_BIASPROG_BIASPROG_DEFAULT, /* Default bias setting.             */       \
00433     _DAC_BIASPROG_HALFBIAS_DEFAULT, /* Default half-bias setting.        */       \
00434     false,                          /* No low pass filter on pos pad.          */ \
00435     false,                          /* No low pass filter on neg pad.          */ \
00436     false,                          /* No nextout output enabled.              */ \
00437     false,                          /* Neg pad disabled.                       */ \
00438     true,                           /* Pos pad enabled, used as signal ground. */ \
00439     false,                          /* No shorting of inputs.                  */ \
00440     false,                          /* Rail-to-rail input enabled.             */ \
00441     true,                           /* Use factory calibrated opamp offset.    */ \
00442     0                               /* Opamp offset value (not used).          */ \
00443   }
00444 
00446 #define OPA_INIT_DIFF_DRIVER_OPA0                                                 \
00447   {                                                                               \
00448     opaNegSelUnityGain,             /* Unity gain.                             */ \
00449     opaPosSelPosPad,                /* Pos input from pad.                     */ \
00450     opaOutModeAll,                  /* Both main and alternate outputs.        */ \
00451     opaResSelDefault,               /* Resistor ladder is not used.            */ \
00452     opaResInMuxDisable,             /* Resistor ladder disabled.               */ \
00453     0,                              /* No alternate outputs enabled.           */ \
00454     _DAC_BIASPROG_BIASPROG_DEFAULT, /* Default bias setting.             */       \
00455     _DAC_BIASPROG_HALFBIAS_DEFAULT, /* Default half-bias setting.        */       \
00456     false,                          /* No low pass filter on pos pad.          */ \
00457     false,                          /* No low pass filter on neg pad.          */ \
00458     true,                           /* Pass output to next stage (OPA1).       */ \
00459     false,                          /* Neg pad disabled.                       */ \
00460     true,                           /* Pos pad enabled, used as signal input.  */ \
00461     false,                          /* No shorting of inputs.                  */ \
00462     false,                          /* Rail-to-rail input enabled.             */ \
00463     true,                           /* Use factory calibrated opamp offset.    */ \
00464     0                               /* Opamp offset value (not used).          */ \
00465   }
00466 
00468 #define OPA_INIT_DIFF_DRIVER_OPA1                                                 \
00469   {                                                                               \
00470     opaNegSelResTap,                /* Neg input from resistor ladder tap.     */ \
00471     opaPosSelPosPad,                /* Pos input from pad.                     */ \
00472     opaOutModeMain,                 /* Main output enabled.                    */ \
00473     opaResSelR2eqR1,                /* R2 = R1                                 */ \
00474     opaResInMuxOpaIn,               /* Resistor ladder input from OPA0.        */ \
00475     0,                              /* No alternate outputs enabled.           */ \
00476     _DAC_BIASPROG_BIASPROG_DEFAULT, /* Default bias setting.             */       \
00477     _DAC_BIASPROG_HALFBIAS_DEFAULT, /* Default half-bias setting.        */       \
00478     false,                          /* No low pass filter on pos pad.          */ \
00479     false,                          /* No low pass filter on neg pad.          */ \
00480     false,                          /* No nextout output enabled.              */ \
00481     false,                          /* Neg pad disabled.                       */ \
00482     true,                           /* Pos pad enabled, used as signal ground. */ \
00483     false,                          /* No shorting of inputs.                  */ \
00484     false,                          /* Rail-to-rail input enabled.             */ \
00485     true,                           /* Use factory calibrated opamp offset.    */ \
00486     0                               /* Opamp offset value (not used).          */ \
00487   }
00488 
00490 #define OPA_INIT_DIFF_RECEIVER_OPA0                                               \
00491   {                                                                               \
00492     opaNegSelUnityGain,             /* Unity gain.                             */ \
00493     opaPosSelPosPad,                /* Pos input from pad.                     */ \
00494     opaOutModeAll,                  /* Both main and alternate outputs.        */ \
00495     opaResSelR2eqR1,                /* R2 = R1                                 */ \
00496     opaResInMuxNegPad,              /* Resistor ladder input from neg pad.     */ \
00497     0,                              /* No alternate outputs enabled.           */ \
00498     _DAC_BIASPROG_BIASPROG_DEFAULT, /* Default bias setting.             */       \
00499     _DAC_BIASPROG_HALFBIAS_DEFAULT, /* Default half-bias setting.        */       \
00500     false,                          /* No low pass filter on pos pad.          */ \
00501     false,                          /* No low pass filter on neg pad.          */ \
00502     true,                           /* Pass output to next stage (OPA2).       */ \
00503     true,                           /* Neg pad enabled, used as signal ground. */ \
00504     true,                           /* Pos pad enabled, used as signal input.  */ \
00505     false,                          /* No shorting of inputs.                  */ \
00506     false,                          /* Rail-to-rail input enabled.             */ \
00507     true,                           /* Use factory calibrated opamp offset.    */ \
00508     0                               /* Opamp offset value (not used).          */ \
00509   }
00510 
00512 #define OPA_INIT_DIFF_RECEIVER_OPA1                                               \
00513   {                                                                               \
00514     opaNegSelUnityGain,             /* Unity gain.                             */ \
00515     opaPosSelPosPad,                /* Pos input from pad.                     */ \
00516     opaOutModeAll,                  /* Both main and alternate outputs.        */ \
00517     opaResSelDefault,               /* Resistor ladder is not used.            */ \
00518     opaResInMuxDisable,             /* Disable resistor ladder.                */ \
00519     0,                              /* No alternate outputs enabled.           */ \
00520     _DAC_BIASPROG_BIASPROG_DEFAULT, /* Default bias setting.             */       \
00521     _DAC_BIASPROG_HALFBIAS_DEFAULT, /* Default half-bias setting.        */       \
00522     false,                          /* No low pass filter on pos pad.          */ \
00523     false,                          /* No low pass filter on neg pad.          */ \
00524     true,                           /* Pass output to next stage (OPA2).       */ \
00525     false,                          /* Neg pad disabled.                       */ \
00526     true,                           /* Pos pad enabled, used as signal input.  */ \
00527     false,                          /* No shorting of inputs.                  */ \
00528     false,                          /* Rail-to-rail input enabled.             */ \
00529     true,                           /* Use factory calibrated opamp offset.    */ \
00530     0                               /* Opamp offset value (not used).          */ \
00531   }
00532 
00534 #define OPA_INIT_DIFF_RECEIVER_OPA2                                               \
00535   {                                                                               \
00536     opaNegSelResTap,                /* Input from resistor ladder tap.         */ \
00537     opaPosSelResTapOpa0,            /* Input from OPA0 resistor ladder tap.    */ \
00538     opaOutModeMain,                 /* Main output enabled.                    */ \
00539     opaResSelR2eqR1,                /* R2 = R1                                 */ \
00540     opaResInMuxOpaIn,               /* Resistor ladder input from OPA1.        */ \
00541     DAC_OPA0MUX_OUTPEN_OUT0,        /* Enable alternate output 0.              */ \
00542     _DAC_BIASPROG_BIASPROG_DEFAULT, /* Default bias setting.             */       \
00543     _DAC_BIASPROG_HALFBIAS_DEFAULT, /* Default half-bias setting.        */       \
00544     false,                          /* No low pass filter on pos pad.          */ \
00545     false,                          /* No low pass filter on neg pad.          */ \
00546     false,                          /* No nextout output enabled.              */ \
00547     false,                          /* Neg pad disabled.                       */ \
00548     false,                          /* Pos pad disabled.                       */ \
00549     false,                          /* No shorting of inputs.                  */ \
00550     false,                          /* Rail-to-rail input enabled.             */ \
00551     true,                           /* Use factory calibrated opamp offset.    */ \
00552     0                               /* Opamp offset value (not used).          */ \
00553   }
00554 
00555 /*******************************************************************************
00556  *****************************   PROTOTYPES   **********************************
00557  ******************************************************************************/
00558 
00559 void      OPAMP_Disable(DAC_TypeDef *dac, OPAMP_TypeDef opa);
00560 void      OPAMP_Enable(DAC_TypeDef *dac, OPAMP_TypeDef opa, const OPAMP_Init_TypeDef *init);
00561 
00565 #ifdef __cplusplus
00566 }
00567 #endif
00568 
00569 #endif /* defined( OPAMP_PRESENT ) && ( OPAMP_COUNT == 1 ) */
00570 #endif /* __SILICON_LABS_EM_OPAMP_H_ */