Hello,
I am working with a XMEGA A1 XPlained board, which has a XMEGA128A1 device. I have been successfully using ASF (which has helped a lot to get stuff working). But when I try to setup ADC by
1) ASF Wizard, apply ADC (driver)
2) Write main.c & other files
3) Build =>
Message previous declaration of 'ADC_CH_MUXNEGH_t' was here C:\Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\XMEGAA_DFP\1.1.68\include\avr\iox128a1.h 1312
Message previous declaration of 'ADC_CH_MUXNEGL_t' was here C:\Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\XMEGAA_DFP\1.1.68\include\avr\iox128a1.h 1321
Error conflicting types for 'ADC_CH_MUXNEGL_t' C:\Users\tapio\Projects\Electronics\LoadCell\AStudio\XLOADCELL3\XLOADCELL3\src\ASF\xmega\drivers\adc\adc.h 98
Error conflicting types for 'ADC_CH_MUXNEGH_t' C:\Users\tapio\Projects\Electronics\LoadCell\AStudio\XLOADCELL3\XLOADCELL3\src\ASF\xmega\drivers\adc\adc.h 109
Why are the ASF files conflicting with XMEGAA_DFP(?) files? I have been trying to understand but to no avail so far.
The conflicting parts in these files read:
adc.h
#if (!XMEGA_E) /* Negative input multiplexer selection without gain */ typedef enum ADC_CH_MUXNEG_MODE10_enum { ADC_CH_MUXNEG_MODE10_PIN0_gc = (0x00<<0), /* Input pin 0 */ ADC_CH_MUXNEG_MODE10_PIN1_gc = (0x01<<0), /* Input pin 1 */ ADC_CH_MUXNEG_MODE10_PIN2_gc = (0x02<<0), /* Input pin 2 */ ADC_CH_MUXNEG_MODE10_PIN3_gc = (0x03<<0), /* Input pin 3 */ ADC_CH_MUXNEG_MODE10_GND_gc = (0x05<<0), /* PAD ground */ ADC_CH_MUXNEG_MODE10_INTGND_gc = (0x07<<0), /* Internal ground */ } ADC_CH_MUXNEGL_t; /* Negative input multiplexer selection with gain */ typedef enum ADC_CH_MUXNEG_MODE11_enum { ADC_CH_MUXNEG_MODE11_PIN4_gc = (0x00<<0), /* Input pin 4 */ ADC_CH_MUXNEG_MODE11_PIN5_gc = (0x01<<0), /* Input pin 5 */ ADC_CH_MUXNEG_MODE11_PIN6_gc = (0x02<<0), /* Input pin 6 */ ADC_CH_MUXNEG_MODE11_PIN7_gc = (0x03<<0), /* Input pin 7 */ ADC_CH_MUXNEG_MODE11_INTGND_gc = (0x04<<0), /* Internal ground */ ADC_CH_MUXNEG_MODE11_GND_gc = (0x07<<0), /* PAD ground */ } ADC_CH_MUXNEGH_t; #endif
iox128a1.h
/* Negative input multiplexer selection when gain on 4 MSB pins */ typedef enum ADC_CH_MUXNEGH_enum { ADC_CH_MUXNEGH_PIN4_gc = (0x00<<0), /* Input pin 4 */ ADC_CH_MUXNEGH_PIN5_gc = (0x01<<0), /* Input pin 5 */ ADC_CH_MUXNEGH_PIN6_gc = (0x02<<0), /* Input pin 6 */ ADC_CH_MUXNEGH_PIN7_gc = (0x03<<0), /* Input pin 7 */ } ADC_CH_MUXNEGH_t; /* Negative input multiplexer selection when gain on 4 LSB pins */ typedef enum ADC_CH_MUXNEGL_enum { ADC_CH_MUXNEGL_PIN0_gc = (0x00<<0), /* Input pin 0 */ ADC_CH_MUXNEGL_PIN1_gc = (0x01<<0), /* Input pin 1 */ ADC_CH_MUXNEGL_PIN2_gc = (0x02<<0), /* Input pin 2 */ ADC_CH_MUXNEGL_PIN3_gc = (0x03<<0), /* Input pin 3 */ } ADC_CH_MUXNEGL_t;
I have also included full files as attachments. The adc.h file has unusual structure, it has some code with comments like
/* Fix header error in ADC_CH_t structure about missing SCAN register */
/* Fix header error */
and the conflicting part is included with this "add-on" part. Then there are normal-start-of-configuration-file comments. Which of course makes me think if the fix indeed is the problem?
I would be very interested to understand what is going on here and the reason for conflict.