#ifndef _FC7240_ADC_NU_Tztufn20_REGS_H_ #define _FC7240_ADC_NU_Tztufn20_REGS_H_ #ifdef __cplusplus extern "C" { #endif /* ---------------------------------------------------------------------------- -- ADC Peripheral Access Layer ---------------------------------------------------------------------------- */ /*! * @addtogroup ADC_Peripheral_Access_Layer ADC Peripheral Access Layer * @{ */ /** ADC - Size of Registers Arrays */ /** ADC - Register Layout Typedef */ #define ADC_SGCSR_COUNT 4 #define ADC_SC_COUNT 32 #define ADC_RESULT_COUNT 32 #define ADC_SAMPLE_TIME_OPTION_CNT 4U #define ADC_SEQUENCE_GROUP_CNT 4U typedef struct { __IO uint32_t INT_STATUS ; /* Interrupt Status Register, offset: 0x0 */ __IO uint32_t INT_ENABLE ; /* Interrupt Enable Register, offset: 0x4 */ __IO uint32_t CONTROL ; /* Control Register, offset: 0x8 */ __IO uint32_t CFG1 ; /* Configuration1 Register, offset: 0xC */ __IO uint32_t CFG2 ; /* Configuration2 Register, offset: 0x10 */ __IO uint32_t SMPR ; /* Sampling Rate Register, offset: 0x14 */ __IO uint32_t CMP_CTRL ; /* Compare Control Register, offset: 0x18 */ __IO uint32_t CMP_TR ; /* Compare Threshold Register, offset: 0x1C */ uint8_t RESERVED_0[8]; __IO uint32_t SGCSR[ADC_SGCSR_COUNT] ; /* Sequence Group Control and Status Register, offset: 0x28 */ uint8_t RESERVED_1[12]; __IO uint32_t CAL ; /* Calibration Register, offset: 0x44 */ uint8_t RESERVED_2[4]; __IO uint32_t FIFO_DATA ; /* FIFO Data Register, offset: 0x4C */ __IO uint32_t SC[ADC_SC_COUNT] ; /* Sequence Configuration Register, offset: 0x50 */ __IO uint32_t RESULT[ADC_RESULT_COUNT] ; /* Result Register, offset: 0xd0 */ } ADC_Type, *ADC_MemMapPtr; /** Number of instances of the ADC module. */ #define ADC_INSTANCE_COUNT (2u) /* ADC - Peripheral instance base addresses */ /** Peripheral ADC0 base address */ #define ADC0_BASE (0x4003b000u) /** Peripheral ADC0 base pointer */ #define ADC0 ((ADC_Type *)ADC0_BASE) /** Peripheral ADC1 base address */ #define ADC1_BASE (0x4003c000u) /** Peripheral ADC1 base pointer */ #define ADC1 ((ADC_Type *)ADC1_BASE) /** Array initializer of ADC peripheral base addresses */ #define ADC_BASE_ADDRS {ADC0_BASE, ADC1_BASE} /** Array initializer of ADC peripheral base pointers */ #define ADC_BASE_PTRS {ADC0, ADC1} // need fill by yourself ///** Number of interrupt vector arrays for the ADC module. */ //#define ADC_IRQS_ARR_COUNT (1u) ///** Number of interrupt channels for the ADC module. */ //#define ADC_IRQS_CH_COUNT (1u) ///** Interrupt vectors for the ADC peripheral type */ //#define ADC_IRQS {ADC0_IRQn, ADC1_IRQn} /* ---------------------------------------------------------------------------- -- ADC Register Masks ---------------------------------------------------------------------------- */ /*! * @addtogroup ADC_Register_Masks ADC Register Masks * @{ */ /* INT_STATUS Bit Fields */ #define ADC_INT_STATUS_TRGERR_MASK 0xF000000u #define ADC_INT_STATUS_TRGERR_SHIFT 24u #define ADC_INT_STATUS_TRGERR_WIDTH 4u #define ADC_INT_STATUS_TRGERR(x) (((uint32_t)(((uint32_t)(x))<