===============================================================================================
                                        ADC maximum sampling rate example 
===============================================================================================
Copyright(C) Redpine Signals 2016
All rights reserved by Redpine Signals.

This program should be used on your own responsibility.
Redpine Signals assumes no responsibility for any losses
incurred by customers or third parties arising from the use of this file. 

===============================================================================================

===============================================================================================                                                       
Function description:
===============================================================================================
Inherent sampling rate limit for single ADC channel is 2.5Msps but ADC can be work till 5Msps 
sampling rate,So for 5msps sampling rate need to enable two ADC channel with same sampling rate 
and same channel configuration
Enable "MAX_SAMPLING_RATE"(in rsi_adc.h) macro or define in (Options for Target --> C/C++ -->Define)  
Enable "MULTICHANNEL_ENABLE"(in rsi_adc.h) macro or define in (Options for Target --> C/C++ -->Define)  

following configuration used in example for channel0 and channel1: 
1.Sampling rate  : 2.5Msps (Each channel 2.5Msps ,Effective sampling rate 5Msps) 
2.Input type     : Single ended.
3.Positive input to ADC : ULP_GPIO4
4.Negative input to ADC : ULP_GPIO5,For single ended data acquisition this parameter not used.
5.Reference Voltage     : 2.8V (On LDO)(To change reference voltage modify 'vref_value' variable #line29)
6.Number of sample collection for each interrupt : 1024
===============================================================================================
Environment
===============================================================================================
Test Board:
---------------------
Smart EVK Rev1.2

Assistance software:
---------------------
None
===============================================================================================
MACRO usage
===============================================================================================
1.'MAX_SAMPLING_RATE'(#line35 in rsi_adc.h file)
Enable this macro to collect the ADC samples at 5Msps sampling rate.

2.'CORE_CLOCK_180MHZ'
Enable this macro as one to switch M4 clock to 180Mhz.

3.'NUMBER_OF_CHA_EN' 
Make this macro as two to enable two ADC channel.

4.'CHANNEL_SAMPLE_LENGTH'
Sample to collect of each iteration.
maximum samples can be collect 1024.

5.'PS2_STATE_ADC_DATA_AQU_ENABLE'
Make this macro as one if code is running in PS2 state.
Make this MACRO as zero for PS4 state and flash based execution.
===============================================================================================
Usage Procedure:
===============================================================================================
Give the input to ULP_GPIO_4 for single ended mode.
Give the positive input on ULP_GPIO_4 and negative input on ULP_GPIO_5 in differential mode.  
===============================================================================================
Pass criteria:
=====================================================================================================
Enable the ENOB macro so after 10 interrupt iteration M4 will stop execution and read samples from
'adc_output_result[]' buffer and calculate SNR on output data. 
=====================================================================================================
Note  
=====================================================================================================
2.Disable gain and offset calculation on ADC samples comments '#define GAIN_OFFSET_CAL_EN'(#line39 in rsi_adc.h file).
3.Comments '#define PS2_STATE_ADC_DATA_AQU_ENABLE'(#line38 in rsi_adc.h file).
=====================================================================================================