PAN1080 Peripheral API
Macros | Functions
pan_adc.h File Reference

Panchip series adc driver header file. More...

Go to the source code of this file.

Macros

#define ADC_INPUTRANGE_HIGH   (1UL)
 
#define ADC_INPUTRANGE_LOW   (0UL)
 
#define ADC_CH8_EXT   (0UL)
 
#define ADC_CH8_BGP   (ADC_CHEN_CH8SEL_Msk)
 
#define ADC_CMP0_LESS_THAN   (0UL << ADC_CMP0_CMPCOND_Pos)
 
#define ADC_CMP1_LESS_THAN   (0UL << ADC_CMP1_CMPCOND_Pos)
 
#define ADC_CMP0_GREATER_OR_EQUAL_TO   (1ul << ADC_CMP0_CMPCOND_Pos)
 
#define ADC_CMP1_GREATER_OR_EQUAL_TO   (1ul << ADC_CMP1_CMPCOND_Pos)
 
#define ADC_TRIGGER_BY_EXT_PIN   (0UL << ADC_CTL_HWTRGSEL_Pos)
 
#define ADC_TRIGGER_BY_PWM   (ADC_CTL_HWTRGSEL_Msk)
 
#define ADC_FALLING_EDGE_TRIGGER   (0UL << ADC_CTL_HWTRGCOND_Pos)
 
#define ADC_RISING_EDGE_TRIGGER   (ADC_CTL_HWTRGCOND_Msk)
 
#define ADC_ADIF_INT   (ADC_STATUS_ADIF_Msk)
 
#define ADC_CMP0_INT   (ADC_STATUS_ADCMPIF0_Msk)
 
#define ADC_CMP1_INT   (ADC_STATUS_ADCMPIF1_Msk)
 
#define ADC_FIFO_FULL_INT   (ADC_STATUS_INTFLG_FULL_Msk)
 
#define ADC_FIFO_EMPTY_INT   (ADC_STATUS_INTFLG_EMPTY_Msk)
 
#define ADC_FIFO_OVER_INT   (ADC_STATUS_INTFLG_OVER_Msk)
 
#define ADC_FIFO_HALF_INT   (ADC_STATUS_INTFLG_HALF_Msk)
 
#define ADC_SAMPLE_CLOCK_0   (0UL)
 
#define ADC_SAMPLE_CLOCK_1   (1UL)
 
#define ADC_SAMPLE_CLOCK_2   (2UL)
 
#define ADC_SAMPLE_CLOCK_4   (3UL)
 
#define ADC_SAMPLE_CLOCK_8   (4UL)
 
#define ADC_SAMPLE_CLOCK_16   (5UL)
 
#define ADC_SAMPLE_CLOCK_32   (6UL)
 
#define ADC_SAMPLE_CLOCK_64   (7UL)
 
#define ADC_SAMPLE_CLOCK_128   (8UL)
 
#define ADC_SAMPLE_CLOCK_256   (9UL)
 
#define ADC_SAMPLE_CLOCK_512   (10UL)
 
#define ADC_SAMPLE_CLOCK_1024   (11UL)
 
#define ADC_SEQMODE_TYPE_23SHUNT   (0UL)
 
#define ADC_SEQMODE_TYPE_1SHUNT   (1UL)
 
#define ADC_SEQMODE_MODESELECT_CH01   (0UL)
 
#define ADC_SEQMODE_MODESELECT_CH12   (1UL)
 
#define ADC_SEQMODE_MODESELECT_CH02   (2UL)
 
#define ADC_SEQMODE_MODESELECT_ONE   (3UL)
 
#define ADC_SEQMODE_PWM0_RISING   (0UL)
 
#define ADC_SEQMODE_PWM0_CENTER   (1UL)
 
#define ADC_SEQMODE_PWM0_FALLING   (2UL)
 
#define ADC_SEQMODE_PWM0_PERIOD   (3UL)
 
#define ADC_SEQMODE_PWM2_RISING   (4UL)
 
#define ADC_SEQMODE_PWM2_CENTER   (5UL)
 
#define ADC_SEQMODE_PWM2_FALLING   (6UL)
 
#define ADC_SEQMODE_PWM2_PERIOD   (7UL)
 
#define ADC_SEQMODE_PWM4_RISING   (8UL)
 
#define ADC_SEQMODE_PWM4_CENTER   (9UL)
 
#define ADC_SEQMODE_PWM4_FALLING   (10UL)
 
#define ADC_SEQMODE_PWM4_PERIOD   (11UL)
 
#define ADC_SEQMODE_PWM6_RISING   (12UL)
 
#define ADC_SEQMODE_PWM6_CENTER   (13UL)
 
#define ADC_SEQMODE_PWM6_FALLING   (14UL)
 
#define ADC_SEQMODE_PWM6_PERIOD   (15UL)
 
#define ADC_COMPARATOR_0   (0)
 
#define ADC_COMPARATOR_1   (1)
 
#define ADC_FIFO_TRIG_LEVEL_HALF   (0)
 
#define ADC_FIFO_TRIG_LEVEL_FULL   (1)
 

Functions

__STATIC_INLINE uint32_t ADC_GetConversionData (ADC_T *ADCx)
 Get the latest ADC conversion data. More...
 
__STATIC_INLINE bool ADC_StatusFlag (ADC_T *ADCx, uint32_t IntMask)
 Get raw status flag. More...
 
__STATIC_INLINE void ADC_ClearStatusFlag (ADC_T *ADCx, uint32_t IntMask)
 Clear specified interrupt flag. More...
 
__STATIC_INLINE void ADC_IntMask (ADC_T *ADCx, uint32_t IntMask, FunctionalState NewState)
 Set interrupt mask,if masked,interrupt will not be happened. More...
 
__STATIC_INLINE bool ADC_IsIntOccured (ADC_T *ADCx, uint32_t IntMask)
 adjust the user-specified interrupt occured or not More...
 
__STATIC_INLINE void ADC_ClearIntFlag (ADC_T *ADCx, uint32_t IntMask)
 This macro clear the selected interrupt status bits. More...
 
__STATIC_INLINE bool ADC_IsBusy (ADC_T *ADCx)
 Get the busy state of ADC. More...
 
__STATIC_INLINE bool ADC_IsDataOverrun (ADC_T *ADCx)
 Check if the ADC conversion data is over written or not. More...
 
__STATIC_INLINE bool ADC_IsDataValid (ADC_T *ADCx)
 Check if the ADC conversion data is valid or not. More...
 
__STATIC_INLINE void ADC_PowerDown (ADC_T *ADCx)
 Power down ADC module. More...
 
__STATIC_INLINE void ADC_PowerOn (ADC_T *ADCx)
 Power on ADC module. More...
 
__STATIC_INLINE void ADC_SequentialModeDisable (ADC_T *ADCx)
 ADC sequential mode Disabled. More...
 
__STATIC_INLINE void ADC_Trigger2Select (ADC_T *ADCx, FunctionalState NewState)
 TRG1CTL select for 1-shunt sequential mode. More...
 
__STATIC_INLINE void ADC_DisableCompare0 (ADC_T *ADCx)
 Disable comparator 0. More...
 
__STATIC_INLINE void ADC_DisableCompare1 (ADC_T *ADCx)
 Disable comparator 1. More...
 
__STATIC_INLINE void ADC_StartConvert (ADC_T *ADCx)
 Start the A/D conversion. More...
 
__STATIC_INLINE void ADC_StopConvert (ADC_T *ADCx)
 Stop the A/D conversion. More...
 
__STATIC_INLINE void ADC_TestModeEnable (ADC_T *ADCx)
 Enable the A/D test mode. More...
 
__STATIC_INLINE void ADC_TestModeDisable (ADC_T *ADCx)
 Disable the A/D test mode. More...
 
__STATIC_INLINE void ADC_DmaModeEnable (ADC_T *ADCx, FunctionalState NewState)
 Enable the A/D dma mode. More...
 
__STATIC_INLINE void ADC_SetClockDivider (ADC_T *ADCx, uint32_t Divider)
 Set the A/D clock division. More...
 
__STATIC_INLINE void ADC_Open (ADC_T *ADCx, uint32_t ChMask)
 This API configures ADC module to be ready for convert the input from selected channel. More...
 
__STATIC_INLINE void ADC_SelInputRange (ADC_T *ADCx, uint32_t EnableHigh)
 Select ADC range of input sample signal. More...
 
__STATIC_INLINE void ADC_TriggerDelay (ADC_T *ADCx, uint32_t Data)
 Delay ADC start conversion time after PWM trigger. More...
 
__STATIC_INLINE void ADC_SetExtraSampleTime (ADC_T *ADCx, uint32_t SampleTime)
 Set ADC sample time for designated channel. More...
 
__STATIC_INLINE bool ADC_IsOneChConvertEnd (ADC_T *ADCx)
 adjust pwm sequence convert end or not in adc one channel More...
 
__STATIC_INLINE void ADC_ClearByHw (ADC_T *ADCx, FunctionalState NewState)
 clear pwm sequence end flag More...
 
__STATIC_INLINE void ADC_LeftShiftEn (ADC_T *ADCx, FunctionalState NewState)
 enable left shift function,if enable,adc data {adc_output[11:0],4'b0 } More...
 
__STATIC_INLINE uint32_t ADC_GetLeftShiftData (ADC_T *ADCx)
 get left shift data More...
 
__STATIC_INLINE void ADC_SubtractBiasEn (ADC_T *ADCx, FunctionalState NewState)
 enable subtract bias function More...
 
__STATIC_INLINE void ADC_SetBiasData (ADC_T *ADCx, uint32_t BiasData)
 set bias data More...
 
__STATIC_INLINE uint32_t ADC_GetLeftBiasData (ADC_T *ADCx)
 get adc data after bias & left shift More...
 
__STATIC_INLINE void ADC_SetFifoTrigLevel (ADC_T *ADCx, uint8_t Level)
 set adc fifo trig level More...
 
__STATIC_INLINE uint32_t ADC_GetFifoPopData (ADC_T *ADCx)
 get fifo pop data More...
 
__STATIC_INLINE void ADC_SeqModeOneChEn (ADC_T *ADCx, FunctionalState NewState)
 pwm sequential enable in adc one channel mode More...
 
__STATIC_INLINE void ADC_SeqModeChSelect (ADC_T *ADCx, uint8_t Ch)
 adc channel select in pwm sequential More...
 
void ADC_Disable (ADC_T *ADCx)
 Disable ADC Power. More...
 
void ADC_Close (void)
 Close ADC peripheral. More...
 
void ADC_EnableHWTrigger (ADC_T *ADCx, uint32_t Source, uint32_t Param)
 Configure the hardware trigger condition and enable hardware trigger. More...
 
void ADC_DisableHWTrigger (ADC_T *ADCx)
 Disable hardware trigger ADC function. More...
 
void ADC_EnableInt (ADC_T *ADCx, uint32_t Mask)
 Enable the interrupt(s) selected by u32Mask parameter. More...
 
void ADC_DisableInt (ADC_T *ADCx, uint32_t Mask)
 Disable the interrupt(s) selected by u32Mask parameter. More...
 
void ADC_SeqModeEnable (ADC_T *ADCx, uint32_t SeqTYPE, uint32_t ModeSel)
 ADC PWM Sequential Mode Control. More...
 
void ADC_SeqModeTriggerSrc (ADC_T *ADCx, uint32_t SeqModeTriSrc)
 ADC PWM Sequential Mode PWM Trigger Source and type. More...
 
void ADC_CompareEnable (ADC_T *ADCx, uint32_t ChNum, uint32_t CmpCondition, uint32_t CmpData, uint32_t MatchCnt, uint32_t CmpSelect)
 Configure the comparator 0 and enable it. More...
 
void ADC_SeqOneChModeConfig (ADC_T *ADCx, uint32_t Trig, uint8_t Level, uint8_t DmaEn, uint8_t HwClrEN, uint8_t AdcCh)
 set ADC PWM one channel Sequential Mode configuration. More...
 

Detailed Description

Panchip series adc driver header file.

Version
V1.00
Revision
3
Date
21/11/12 18:33