11 #ifndef __MG32F10x_ANCTL_H 12 #define __MG32F10x_ANCTL_H 39 #define ANCTL_HSE_OFF ((uint32_t)0x00000000) 40 #define ANCTL_HSE_ON ((uint32_t)0x00000201) 41 #define ANCTL_HSE_Bypass ((uint32_t)0x00000002) 50 #define ANCTL_PLLMul_12 ((uint32_t)0x000000C0) 51 #define ANCTL_PLLMul_16 ((uint32_t)0x00000080) 52 #define ANCTL_PLLMul_20 ((uint32_t)0x00000040) 53 #define ANCTL_PLLMul_24 ((uint32_t)0x00000000) 62 #define ANCTL_FLAG_MHSIRDY ((uint16_t)0x3001) 63 #define ANCTL_FLAG_FHSIRDY ((uint16_t)0x3C01) 64 #define ANCTL_FLAG_LSIRDY ((uint16_t)0x4801) 65 #define ANCTL_FLAG_HSERDY ((uint16_t)0x5801) 66 #define ANCTL_FLAG_PLLRDY ((uint16_t)0x7C03) 75 #define ANCTL_PVDLevel_0 ANCTL_PVDCR_PLS_LEV0 76 #define ANCTL_PVDLevel_1 ANCTL_PVDCR_PLS_LEV1 77 #define ANCTL_PVDLevel_2 ANCTL_PVDCR_PLS_LEV2 78 #define ANCTL_PVDLevel_3 ANCTL_PVDCR_PLS_LEV3 79 #define ANCTL_PVDLevel_4 ANCTL_PVDCR_PLS_LEV4 80 #define ANCTL_PVDLevel_5 ANCTL_PVDCR_PLS_LEV5 81 #define ANCTL_PVDLevel_6 ANCTL_PVDCR_PLS_LEV6 82 #define ANCTL_PVDLevel_7 ANCTL_PVDCR_PLS_LEV7 91 #define ANCTL_USBPHY_DPPU ((uint32_t)0x00000002) 92 #define ANCTL_USBPHY_HIGHRES ((uint32_t)0x00000004) 93 #define ANCTL_USBPHY_DMST ((uint32_t)0x00000008) 94 #define ANCTL_USBPHY_DPST ((uint32_t)0x00000010) 103 #define CMPA_PSEL_PA8 0x00 104 #define CMPA_PSEL_PB4 0x01 105 #define CMPA_PSEL_PB5 0x02 106 #define CMPA_PSEL_PA13 0x03 108 #define CMPA_NSEL_PA9 0x00 109 #define CMPA_NSEL_PB6 0x01 110 #define CMPA_NSEL_PB7 0x02 111 #define CMPA_NSEL_PA14 0x03 120 #define CMPB_PSEL_PD2 0x00 121 #define CMPB_PSEL_PC10 0x01 122 #define CMPB_PSEL_PC11 0x02 123 #define CMPB_PSEL_PA15 0x03 125 #define CMPB_NSEL_PC12 0x00 126 #define CMPB_NSEL_PB8 0x01 127 #define CMPB_NSEL_PB9 0x02 128 #define CMPB_NSEL_PB3 0x03 137 #define ANCTL_IT_MHSI ((uint8_t)0x01) 138 #define ANCTL_IT_FHSI ((uint8_t)0x02) 139 #define ANCTL_IT_LSI ((uint8_t)0x04) 140 #define ANCTL_IT_HSE ((uint8_t)0x08) 141 #define ANCTL_IT_LSE ((uint8_t)0x10) 142 #define ANCTL_IT_PLL ((uint8_t)0x20) 143 #define ANCTL_IT_DCSS ((uint8_t)0x80) FlagStatus ANCTL_GetFlagStatus(uint16_t ANCTL_FLAG)
Checks whether the specified ANCTL flag is set or not.
Definition: mg32f10x_anctl.c:169
ErrorStatus ANCTL_WaitForHSEStartUp(void)
Waits for HSE start-up.
Definition: mg32f10x_anctl.c:106
void ANCTL_ClearITPendingBit(uint8_t ANCTL_IT)
Clears the ANCTL's interrupt pending bits.
Definition: mg32f10x_anctl.c:442
void ANCTL_CMPBCmd(FunctionalState NewState)
Enables or disables the Comparator B.
Definition: mg32f10x_anctl.c:358
void ANCTL_PLLConfig(uint32_t ANCTL_PLLMul)
Configures the PLL multiplication factor.
Definition: mg32f10x_anctl.c:141
void ANCTL_ITConfig(uint8_t ANCTL_IT, FunctionalState NewState)
Enables or disables the specified ANCTL interrupts.
Definition: mg32f10x_anctl.c:390
void ANCTL_CMPACmd(FunctionalState NewState)
Enables or disables the Comparator A.
Definition: mg32f10x_anctl.c:320
void ANCTL_SARADCCmd(FunctionalState NewState)
Enables or disables the SAR ADC.
Definition: mg32f10x_anctl.c:232
void ANCTL_CMPBConfig(uint32_t CMPB_PSEL, uint32_t CMPB_NSEL)
Configures the Comparator B.
Definition: mg32f10x_anctl.c:344
ITStatus ANCTL_GetITStatus(uint8_t ANCTL_IT)
Checks whether the specified ANCTL interrupt has occurred or not.
Definition: mg32f10x_anctl.c:413
uint32_t ANCTL_CMPAGetOutputLevel(void)
Returns the Comparator A output level.
Definition: mg32f10x_anctl.c:332
void ANCTL_CMPAConfig(uint32_t CMPA_PSEL, uint32_t CMPA_NSEL)
Configures the Comparator A.
Definition: mg32f10x_anctl.c:306
void ANCTL_PLLCmd(FunctionalState NewState)
Enables or disables the PLL.
Definition: mg32f10x_anctl.c:153
void ANCTL_USBPHYDeInit(void)
Deinitializes the USB PHY register to default reset values.
Definition: mg32f10x_anctl.c:242
void ANCTL_PVDCmd(FunctionalState NewState)
Enables or disables the Power Voltage Detector (PVD).
Definition: mg32f10x_anctl.c:220
void ANCTL_PORCmd(FunctionalState NewState)
Enables or disables the Power-on Reset function.
Definition: mg32f10x_anctl.c:289
void ANCTL_USBPHYConfig(uint32_t ANCTL_USBPHY, FunctionalState NewState)
Configures the USB PHY function.
Definition: mg32f10x_anctl.c:260
void ANCTL_FHSICmd(FunctionalState NewState)
Enables or disables the Internal 48MHz oscillator (FHSI).
Definition: mg32f10x_anctl.c:66
void ANCTL_MHSICmd(FunctionalState NewState)
Enables or disables the Internal 8MHz oscillator (MHSI).
Definition: mg32f10x_anctl.c:54
void ANCTL_PVDLevelConfig(uint32_t ANCTL_PVDLevel)
Configures the voltage threshold detected by the Power Voltage Detector(PVD).
Definition: mg32f10x_anctl.c:208
uint32_t ANCTL_CMPBGetOutputLevel(void)
Returns the Comparator B output level.
Definition: mg32f10x_anctl.c:370
void ANCTL_ClockSecuritySystemCmd(FunctionalState NewState)
Enables or disables the Clock Security System.
Definition: mg32f10x_anctl.c:454
void ANCTL_HSEConfig(uint32_t ANCTL_HSE)
Configures the External High Speed oscillator (HSE).
Definition: mg32f10x_anctl.c:93
void ANCTL_USBPHYCmd(FunctionalState NewState)
Enables or disables the USB PHY.
Definition: mg32f10x_anctl.c:277
void ANCTL_LSICmd(FunctionalState NewState)
Enables or disables the Internal Low Speed oscillator (LSI).
Definition: mg32f10x_anctl.c:78