MG32F10x Standard Peripherals Firmware Library
Macros | Functions
mg32f10x_anctl.h File Reference

This file contains all the functions prototypes for the ANCTL firmware library. More...

#include "mg32f10x.h"

Go to the source code of this file.

Macros

#define ANCTL_HSE_OFF   ((uint32_t)0x00000000)
 
#define ANCTL_HSE_ON   ((uint32_t)0x00000201)
 
#define ANCTL_HSE_Bypass   ((uint32_t)0x00000002)
 
#define ANCTL_PLLMul_12   ((uint32_t)0x000000C0)
 
#define ANCTL_PLLMul_16   ((uint32_t)0x00000080)
 
#define ANCTL_PLLMul_20   ((uint32_t)0x00000040)
 
#define ANCTL_PLLMul_24   ((uint32_t)0x00000000)
 
#define ANCTL_FLAG_MHSIRDY   ((uint16_t)0x3001)
 
#define ANCTL_FLAG_FHSIRDY   ((uint16_t)0x3C01)
 
#define ANCTL_FLAG_LSIRDY   ((uint16_t)0x4801)
 
#define ANCTL_FLAG_HSERDY   ((uint16_t)0x5801)
 
#define ANCTL_FLAG_PLLRDY   ((uint16_t)0x7C03)
 
#define ANCTL_PVDLevel_0   ANCTL_PVDCR_PLS_LEV0
 
#define ANCTL_PVDLevel_1   ANCTL_PVDCR_PLS_LEV1
 
#define ANCTL_PVDLevel_2   ANCTL_PVDCR_PLS_LEV2
 
#define ANCTL_PVDLevel_3   ANCTL_PVDCR_PLS_LEV3
 
#define ANCTL_PVDLevel_4   ANCTL_PVDCR_PLS_LEV4
 
#define ANCTL_PVDLevel_5   ANCTL_PVDCR_PLS_LEV5
 
#define ANCTL_PVDLevel_6   ANCTL_PVDCR_PLS_LEV6
 
#define ANCTL_PVDLevel_7   ANCTL_PVDCR_PLS_LEV7
 
#define ANCTL_USBPHY_DPPU   ((uint32_t)0x00000002)
 
#define ANCTL_USBPHY_HIGHRES   ((uint32_t)0x00000004)
 
#define ANCTL_USBPHY_DMST   ((uint32_t)0x00000008)
 
#define ANCTL_USBPHY_DPST   ((uint32_t)0x00000010)
 
#define CMPA_PSEL_PA8   0x00
 
#define CMPA_PSEL_PB4   0x01
 
#define CMPA_PSEL_PB5   0x02
 
#define CMPA_PSEL_PA13   0x03
 
#define CMPA_NSEL_PA9   0x00
 
#define CMPA_NSEL_PB6   0x01
 
#define CMPA_NSEL_PB7   0x02
 
#define CMPA_NSEL_PA14   0x03
 
#define CMPB_PSEL_PD2   0x00
 
#define CMPB_PSEL_PC10   0x01
 
#define CMPB_PSEL_PC11   0x02
 
#define CMPB_PSEL_PA15   0x03
 
#define CMPB_NSEL_PC12   0x00
 
#define CMPB_NSEL_PB8   0x01
 
#define CMPB_NSEL_PB9   0x02
 
#define CMPB_NSEL_PB3   0x03
 
#define ANCTL_IT_MHSI   ((uint8_t)0x01)
 
#define ANCTL_IT_FHSI   ((uint8_t)0x02)
 
#define ANCTL_IT_LSI   ((uint8_t)0x04)
 
#define ANCTL_IT_HSE   ((uint8_t)0x08)
 
#define ANCTL_IT_LSE   ((uint8_t)0x10)
 
#define ANCTL_IT_PLL   ((uint8_t)0x20)
 
#define ANCTL_IT_DCSS   ((uint8_t)0x80)
 

Functions

void ANCTL_MHSICmd (FunctionalState NewState)
 Enables or disables the Internal 8MHz oscillator (MHSI). More...
 
void ANCTL_FHSICmd (FunctionalState NewState)
 Enables or disables the Internal 48MHz oscillator (FHSI). More...
 
void ANCTL_LSICmd (FunctionalState NewState)
 Enables or disables the Internal Low Speed oscillator (LSI). More...
 
void ANCTL_HSEConfig (uint32_t ANCTL_HSE)
 Configures the External High Speed oscillator (HSE). More...
 
ErrorStatus ANCTL_WaitForHSEStartUp (void)
 Waits for HSE start-up. More...
 
void ANCTL_PLLConfig (uint32_t ANCTL_PLLMul)
 Configures the PLL multiplication factor. More...
 
void ANCTL_PLLCmd (FunctionalState NewState)
 Enables or disables the PLL. More...
 
FlagStatus ANCTL_GetFlagStatus (uint16_t ANCTL_FLAG)
 Checks whether the specified ANCTL flag is set or not. More...
 
void ANCTL_PVDLevelConfig (uint32_t ANCTL_PVDLevel)
 Configures the voltage threshold detected by the Power Voltage Detector(PVD). More...
 
void ANCTL_PVDCmd (FunctionalState NewState)
 Enables or disables the Power Voltage Detector (PVD). More...
 
void ANCTL_SARADCCmd (FunctionalState NewState)
 Enables or disables the SAR ADC. More...
 
void ANCTL_USBPHYDeInit (void)
 Deinitializes the USB PHY register to default reset values. More...
 
void ANCTL_USBPHYConfig (uint32_t ANCTL_USBPHY, FunctionalState NewState)
 Configures the USB PHY function. More...
 
void ANCTL_USBPHYCmd (FunctionalState NewState)
 Enables or disables the USB PHY. More...
 
void ANCTL_PORCmd (FunctionalState NewState)
 Enables or disables the Power-on Reset function. More...
 
void ANCTL_CMPAConfig (uint32_t CMPA_PSEL, uint32_t CMPA_NSEL)
 Configures the Comparator A. More...
 
void ANCTL_CMPACmd (FunctionalState NewState)
 Enables or disables the Comparator A. More...
 
uint32_t ANCTL_CMPAGetOutputLevel (void)
 Returns the Comparator A output level. More...
 
void ANCTL_CMPBConfig (uint32_t CMPB_PSEL, uint32_t CMPB_NSEL)
 Configures the Comparator B. More...
 
void ANCTL_CMPBCmd (FunctionalState NewState)
 Enables or disables the Comparator B. More...
 
uint32_t ANCTL_CMPBGetOutputLevel (void)
 Returns the Comparator B output level. More...
 
void ANCTL_ITConfig (uint8_t ANCTL_IT, FunctionalState NewState)
 Enables or disables the specified ANCTL interrupts. More...
 
ITStatus ANCTL_GetITStatus (uint8_t ANCTL_IT)
 Checks whether the specified ANCTL interrupt has occurred or not. More...
 
void ANCTL_ClearITPendingBit (uint8_t ANCTL_IT)
 Clears the ANCTL's interrupt pending bits. More...
 
void ANCTL_ClockSecuritySystemCmd (FunctionalState NewState)
 Enables or disables the Clock Security System. More...
 

Detailed Description

This file contains all the functions prototypes for the ANCTL firmware library.

Author
megawin Application Team
Version
V0.1.10
Date
05-January-2023