00001
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047 #ifndef _ACIFA_H_
00048 #define _ACIFA_H_
00049
00050 #include <avr32/io.h>
00051 #include "compiler.h"
00052
00055 #define AVR32_ACIFA_AC0A_INSELP_AC0AP0 0
00056 #define AVR32_ACIFA_AC0A_INSELP_AC0AP1 1
00057 #define AVR32_ACIFA_AC0A_INSELP_DAC0_INT 2
00058
00061 #define AVR32_ACIFA_AC0A_INSELN_AC0AN0 0
00062 #define AVR32_ACIFA_AC0A_INSELN_AC0AN1 1
00063 #define AVR32_ACIFA_AC0A_INSELN_AC0BP0 2
00064 #define AVR32_ACIFA_AC0A_INSELN_AC0BP1 3
00065 #define AVR32_ACIFA_AC0A_INSELN_VDDANA_SCALED 4
00066 #define AVR32_ACIFA_AC0A_INSELN_DAC1_INT 5
00067
00070 #define AVR32_ACIFA_AC0B_INSELP_AC0AN0 0
00071 #define AVR32_ACIFA_AC0B_INSELP_AC0AN1 1
00072 #define AVR32_ACIFA_AC0B_INSELP_AC0BP0 2
00073 #define AVR32_ACIFA_AC0B_INSELP_AC0BP1 3
00074 #define AVR32_ACIFA_AC0B_INSELP_DAC0_INT 4
00075 #define AVR32_ACIFA_AC0B_INSELP_VDDANA_SCALED 5
00076
00079 #define AVR32_ACIFA_AC0B_INSELN_AC0BN0 0
00080 #define AVR32_ACIFA_AC0B_INSELN_AC0BN1 1
00081 #define AVR32_ACIFA_AC0B_INSELN_DAC1_INT 2
00082
00085 #define AVR32_ACIFA_AC1A_INSELP_AC1AP0 0
00086 #define AVR32_ACIFA_AC1A_INSELP_AC1AP1 1
00087 #define AVR32_ACIFA_AC1A_INSELP_DAC0_INT 2
00088
00091 #define AVR32_ACIFA_AC1A_INSELN_AC1AN0 0
00092 #define AVR32_ACIFA_AC0A_INSELN_AC1AN1 1
00093 #define AVR32_ACIFA_AC0A_INSELN_AC1BP0 2
00094 #define AVR32_ACIFA_AC0A_INSELN_AC1BP1 3
00095 #define AVR32_ACIFA_AC0A_INSELN_VDDANA_SCALED 4
00096 #define AVR32_ACIFA_AC0A_INSELN_DAC1_INT 5
00097
00100 #define AVR32_ACIFA_AC1B_INSELP_AC1AN0 0
00101 #define AVR32_ACIFA_AC0B_INSELP_AC1AN1 1
00102 #define AVR32_ACIFA_AC0B_INSELP_AC1BP0 2
00103 #define AVR32_ACIFA_AC0B_INSELP_AC1BP1 3
00104 #define AVR32_ACIFA_AC0B_INSELP_DAC0_INT 4
00105 #define AVR32_ACIFA_AC0B_INSELP_VDDANA_SCALED 5
00106
00109 #define AVR32_ACIFA_AC1B_INSELN_AC1BN0 0
00110 #define AVR32_ACIFA_AC0B_INSELN_AC1BN1 1
00111 #define AVR32_ACIFA_AC0B_INSELN_DAC1_INT 2
00112
00115
00116 #define ACIFA_COMP_SELA 1
00117 #define ACIFA_COMP_SELB 2
00119
00120
00123
00124 #define ACIFA_VCCSCALE_SELA 1
00125 #define ACIFA_VCCSCALE_SELB 2
00127
00128
00136 extern void acifa_configure(volatile avr32_acifa_t * acifa,
00137 U8 comp_sel,
00138 U8 input_p,
00139 U8 input_n,
00140 U32 pb_hz);
00141
00150 void acifa_configure_window( volatile avr32_acifa_t * acifa,
00151 U8 input_p,
00152 U8 input_n,
00153 U8 common_input,
00154 U32 pb_hz);
00155
00160 extern void acifa_start(volatile avr32_acifa_t * acifa,
00161 U8 comp_sel);
00162
00163
00167 extern void acifa_start_window(volatile avr32_acifa_t * acifa);
00168
00173 extern void acifa_enable_output(volatile avr32_acifa_t * acifa,
00174 U8 comp_sel);
00175
00181 extern void acifa_configure_hysteresis(volatile avr32_acifa_t * acifa,
00182 U8 comp_sel,
00183 U8 level);
00184
00190 extern void acifa_configure_vccscale(volatile avr32_acifa_t * acifa,
00191 U8 vccscale_sel,
00192 U8 scale);
00193
00198 extern int acifa_is_aca_inp_higher(volatile avr32_acifa_t *acifa);
00199
00204 extern int acifa_is_acb_inp_higher(volatile avr32_acifa_t *acifa);
00205
00210 extern int acifa_is_ci_inside_window(volatile avr32_acifa_t *acifa);
00211
00212 #endif // _ACIFA_H_