Hi Pratibha,
Every ADC command is configured by 4-byte configuration (ADCCMD_0 ~ ADCCMD_3).
Since these commands are loaded into ADC automatically by DMA, they must be aligned to 4-byte boundary.
The definitions in adc_lba.h file just offers user-friendly way how to configure these commands.
For example:
#define INTFLG_SEL(x) ((unsigned long)((x)&0x0F)<<24) //Conversion Interrupt Flag Select 1..15, 0 means conversion without interrupt flag
It just take lowest 4 bits from x value and move it 24 times to left into ADCCMD_0_ INTFLG_SEL[3:0] position.
The INTFLG_SEL[3:0] configure selected interrupt flag by simple binary combination value.
So, if we use INTFLG_SEL(5), the ADCCMD_0_INTFLG_SEL[3:0] will be configured as 0b0101 and ADC will set appropriate interrupt flag (in this case CON_IF[15:1]= 0x0010) when this command finish.
The ADCCONIF_CON_IF[15:1] display which flag was set. A single flag bit in CON_IF[15:1] refers to single INTFLG_SEL[3:0] bit combination.
The INTFLG_SEL(0) configuration will not set any of CON_IF[15:1] flags when command finish. When ADC command is configured as End Of Sequence/End Of List/End Of List and wait... command the ADCCONIF_EOL_IF flag may signalize end of the measurement sequence.
I hope it helps you.
Have a great day,
Radek
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------