Initial commit: TXW82x FPV v2.7.0.7-42229 SDK + project sources
This commit is contained in:
1818
sdk/driver/adc/hgadc_v1.c
Normal file
1818
sdk/driver/adc/hgadc_v1.c
Normal file
File diff suppressed because it is too large
Load Diff
45
sdk/driver/adc/hgadc_v1_hw.h
Normal file
45
sdk/driver/adc/hgadc_v1_hw.h
Normal file
@@ -0,0 +1,45 @@
|
||||
#ifndef _HGADC_V1_HW_H
|
||||
#define _HGADC_V1_HW_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define LL_ADKEY_SOTF_KICK(hw) (hw->ADC_CON_KICK |= BIT(0))
|
||||
|
||||
#define LL_ADKEY_GET_IRQ_EN_SAMPLE_DONE(hw) (hw->ADKEY_CON & BIT(20))
|
||||
|
||||
#define LL_ADKEY_GET_DONE_PENDING(hw) (hw->ADKEY_STA & BIT(0))
|
||||
|
||||
#define LL_ADKEY_CLEAR_DONE_PENDING(hw) (hw->ADKEY_STA = BIT(0))
|
||||
|
||||
#define LL_ADKEY_GET_DATA(hw) (hw->ADKEY_DATA & 0xFFF)
|
||||
|
||||
|
||||
/** @brief ADC register structure
|
||||
* @{
|
||||
*/
|
||||
struct hgadc_v1_hw {
|
||||
__IO uint32 ADC_ANA_CTRL0;
|
||||
__IO uint32 ADC_ANA_CTRL1;
|
||||
__IO uint32 ADC_CON_EN;
|
||||
__IO uint32 ADC_CON_FUN;
|
||||
__IO uint32 ADC_CON_SMP;
|
||||
__IO uint32 ADC_CON_SEL0;
|
||||
__IO uint32 ADC_CON_SEL1;
|
||||
__IO uint32 ADC_CON_KICK;
|
||||
__IO uint32 ADC_CON_CMP;
|
||||
__IO uint32 ADC_CON_STA;
|
||||
__IO uint32 ADC_DMA_STADR;
|
||||
__IO uint32 ADC_DMA_CNT;
|
||||
__IO uint32 ADC_CON_EXTEND0;
|
||||
__IO uint32 ADC_CON_EXTEND1;
|
||||
};
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _HGADC_V0_HW_H */
|
||||
Reference in New Issue
Block a user