MG32F10x Standard Peripherals Firmware Library
Functions
ANCTL_Private_Functions

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

Function Documentation

◆ ANCTL_ClearITPendingBit()

void ANCTL_ClearITPendingBit ( uint8_t  ANCTL_IT)

Clears the ANCTL's interrupt pending bits.

Parameters
ANCTL_ITspecifies the interrupt pending bit to clear. This parameter can be any combination of the following values:
  • ANCTL_IT_MHSI: MHSI ready interrupt
  • ANCTL_IT_FHSI: FHSI ready interrupt
  • ANCTL_IT_LSI: LSI ready interrupt
  • ANCTL_IT_HSE: HSE ready interrupt
  • ANCTL_IT_LSE: LSE ready interrupt
  • ANCTL_IT_PLL: PLL ready interrupt
  • ANCTL_IT_DCSS: Clock Security System interrupt
Note
The ANCTL register write-protection function should be disabled before using this function.
Returns
None

◆ ANCTL_ClockSecuritySystemCmd()

void ANCTL_ClockSecuritySystemCmd ( FunctionalState  NewState)

Enables or disables the Clock Security System.

Parameters
NewStatenew state of the Clock Security System. This parameter can be: ENABLE or DISABLE.
Note
The ANCTL register write-protection function should be disabled before using this function.
Returns
None

◆ ANCTL_CMPACmd()

void ANCTL_CMPACmd ( FunctionalState  NewState)

Enables or disables the Comparator A.

Parameters
NewStatenew state of the Comparator A. This parameter can be: ENABLE or DISABLE.
Note
The ANCTL register write-protection function should be disabled before using this function.
Returns
None

◆ ANCTL_CMPAConfig()

void ANCTL_CMPAConfig ( uint32_t  CMPA_PSEL,
uint32_t  CMPA_NSEL 
)

Configures the Comparator A.

Parameters
CMPA_PSELspecifies the comparator positive input.
CMPA_NSELspecifies the comparator negative input.
Note
The ANCTL register write-protection function should be disabled before using this function.
Returns
None

◆ ANCTL_CMPAGetOutputLevel()

uint32_t ANCTL_CMPAGetOutputLevel ( void  )

Returns the Comparator A output level.

Parameters
None
Returns
Comparator A output level.
  • 0: Comparator positive input voltage < negative input voltage
  • 1: Comparator positive input voltage > negative input voltage

◆ ANCTL_CMPBCmd()

void ANCTL_CMPBCmd ( FunctionalState  NewState)

Enables or disables the Comparator B.

Parameters
NewStatenew state of the Comparator B. This parameter can be: ENABLE or DISABLE.
Note
The ANCTL register write-protection function should be disabled before using this function.
Returns
None

◆ ANCTL_CMPBConfig()

void ANCTL_CMPBConfig ( uint32_t  CMPB_PSEL,
uint32_t  CMPB_NSEL 
)

Configures the Comparator B.

Parameters
CMPB_PSELspecifies the comparator positive input.
CMPB_NSELspecifies the comparator negative input.
Note
The ANCTL register write-protection function should be disabled before using this function.
Returns
None

◆ ANCTL_CMPBGetOutputLevel()

uint32_t ANCTL_CMPBGetOutputLevel ( void  )

Returns the Comparator B output level.

Parameters
None
Returns
Comparator B output level.
  • 0: Comparator positive input voltage < negative input voltage
  • 1: Comparator positive input voltage > negative input voltage

◆ ANCTL_FHSICmd()

void ANCTL_FHSICmd ( FunctionalState  NewState)

Enables or disables the Internal 48MHz oscillator (FHSI).

Parameters
NewStatenew state of the FHSI. This parameter can be: ENABLE or DISABLE.
Note
The ANCTL register write-protection function should be disabled before using this function.
Returns
None

◆ ANCTL_GetFlagStatus()

FlagStatus ANCTL_GetFlagStatus ( uint16_t  ANCTL_FLAG)

Checks whether the specified ANCTL flag is set or not.

Parameters
ANCTL_FLAGspecifies the flag to check. This parameter can be one of the following values:
  • ANCTL_FLAG_MHSIRDY: MHSI oscillator clock ready
  • ANCTL_FLAG_FHSIRDY: FHSI oscillator clock ready
  • ANCTL_FLAG_LSIRDY: LSI oscillator clock ready
  • ANCTL_FLAG_HSERDY: HSE oscillator clock ready
  • ANCTL_FLAG_PLLRDY: PLL clock ready
Returns
The new state of ANCTL_FLAG (SET or RESET).

◆ ANCTL_GetITStatus()

ITStatus ANCTL_GetITStatus ( uint8_t  ANCTL_IT)

Checks whether the specified ANCTL interrupt has occurred or not.

Parameters
ANCTL_ITspecifies the ANCTL interrupt source to check. This parameter can be one of the following values:
  • ANCTL_IT_MHSI: MHSI ready interrupt
  • ANCTL_IT_FHSI: FHSI ready interrupt
  • ANCTL_IT_LSI: LSI ready interrupt
  • ANCTL_IT_HSE: HSE ready interrupt
  • ANCTL_IT_LSE: LSE ready interrupt
  • ANCTL_IT_PLL: PLL ready interrupt
  • ANCTL_IT_DCSS: Clock Security System interrupt
Returns
The new state of ANCTL_IT (SET or RESET).

◆ ANCTL_HSEConfig()

void ANCTL_HSEConfig ( uint32_t  ANCTL_HSE)

Configures the External High Speed oscillator (HSE).

Parameters
ANCTL_HSEspecifies the new state of the HSE. This parameter can be one of the following values:
  • ANCTL_HSE_OFF: HSE oscillator OFF
  • ANCTL_HSE_ON: HSE oscillator ON
  • ANCTL_HSE_Bypass: HSE oscillator bypassed with external clock
Note
The ANCTL register write-protection function should be disabled before using this function.
Returns
None

◆ ANCTL_ITConfig()

void ANCTL_ITConfig ( uint8_t  ANCTL_IT,
FunctionalState  NewState 
)

Enables or disables the specified ANCTL interrupts.

Parameters
ANCTL_ITspecifies the ANCTL interrupt sources to be enabled or disabled. This parameter can be any combination of the following values:
  • ANCTL_IT_MHSI: MHSI ready interrupt
  • ANCTL_IT_FHSI: FHSI ready interrupt
  • ANCTL_IT_LSI: LSI ready interrupt
  • ANCTL_IT_HSE: HSE ready interrupt
  • ANCTL_IT_LSE: LSE ready interrupt
  • ANCTL_IT_PLL: PLL ready interrupt
NewStatenew state of the specified ANCTL interrupts. This parameter can be: ENABLE or DISABLE.
Note
The ANCTL register write-protection function should be disabled before using this function.
Returns
None

◆ ANCTL_LSICmd()

void ANCTL_LSICmd ( FunctionalState  NewState)

Enables or disables the Internal Low Speed oscillator (LSI).

Parameters
NewStatenew state of the LSI. This parameter can be: ENABLE or DISABLE.
Note
The ANCTL register write-protection function should be disabled before using this function.
Returns
None

◆ ANCTL_MHSICmd()

void ANCTL_MHSICmd ( FunctionalState  NewState)

Enables or disables the Internal 8MHz oscillator (MHSI).

Parameters
NewStatenew state of the MHSI. This parameter can be: ENABLE or DISABLE.
Note
The ANCTL register write-protection function should be disabled before using this function.
Returns
None

◆ ANCTL_PLLCmd()

void ANCTL_PLLCmd ( FunctionalState  NewState)

Enables or disables the PLL.

Parameters
NewStatenew state of the PLL. This parameter can be: ENABLE or DISABLE.
Note
The ANCTL register write-protection function should be disabled before using this function.
Returns
None

◆ ANCTL_PLLConfig()

void ANCTL_PLLConfig ( uint32_t  ANCTL_PLLMul)

Configures the PLL multiplication factor.

Parameters
ANCTL_PLLMulspecifies the PLL multiplication factor. This parameter can be one of the following values:
  • ANCTL_PLLMul_12
  • ANCTL_PLLMul_16
  • ANCTL_PLLMul_20
  • ANCTL_PLLMul_24
Note
The ANCTL register write-protection function should be disabled before using this function.
Returns
None

◆ ANCTL_PORCmd()

void ANCTL_PORCmd ( FunctionalState  NewState)

Enables or disables the Power-on Reset function.

Parameters
NewStatenew state of the Power-on Reset function. This parameter can be: ENABLE or DISABLE.
Note
The ANCTL register write-protection function should be disabled before using this function.
Returns
None

◆ ANCTL_PVDCmd()

void ANCTL_PVDCmd ( FunctionalState  NewState)

Enables or disables the Power Voltage Detector (PVD).

Parameters
NewStatenew state of the PVD. This parameter can be: ENABLE or DISABLE.
Note
The ANCTL register write-protection function should be disabled before using this function.
Returns
None

◆ ANCTL_PVDLevelConfig()

void ANCTL_PVDLevelConfig ( uint32_t  ANCTL_PVDLevel)

Configures the voltage threshold detected by the Power Voltage Detector(PVD).

Parameters
ANCTL_PVDLevelspecifies the PVD detection level. This parameter can be one of the following values:
  • ANCTL_PVDLevel_0
  • ANCTL_PVDLevel_1
  • ANCTL_PVDLevel_2
  • ANCTL_PVDLevel_3
  • ANCTL_PVDLevel_4
  • ANCTL_PVDLevel_5
  • ANCTL_PVDLevel_6
  • ANCTL_PVDLevel_7
Note
Refer to the electrical characteristics of your device datasheet for more details about the voltage threshold corresponding to each detection level.
The ANCTL register write-protection function should be disabled before using this function.
Returns
None

◆ ANCTL_SARADCCmd()

void ANCTL_SARADCCmd ( FunctionalState  NewState)

Enables or disables the SAR ADC.

Parameters
NewStatenew state of the SAR ADC. This parameter can be: ENABLE or DISABLE.
Note
The ANCTL register write-protection function should be disabled before using this function.
Returns
None

◆ ANCTL_USBPHYCmd()

void ANCTL_USBPHYCmd ( FunctionalState  NewState)

Enables or disables the USB PHY.

Parameters
NewStatenew state of the USB PHY. This parameter can be: ENABLE or DISABLE.
Note
The ANCTL register write-protection function should be disabled before using this function.
Returns
None

◆ ANCTL_USBPHYConfig()

void ANCTL_USBPHYConfig ( uint32_t  ANCTL_USBPHY,
FunctionalState  NewState 
)

Configures the USB PHY function.

Parameters
ANCTL_USBPHYspecifies the USB PHY configuration. This parameter can be any combination of the following values:
  • ANCTL_USBPHY_DPPU: D+ pull-up resistor
  • ANCTL_USBPHY_HIGHRES: USB PHY input high resistance
  • ANCTL_USBPHY_DMST: USB PHY D- input schmitt channel
  • ANCTL_USBPHY_DPST: USB PHY D+ input schmitt channel
NewStatenew state of the USB PHY function. This parameter can be: ENABLE or DISABLE.
Note
The ANCTL register write-protection function should be disabled before using this function.
Returns
None

◆ ANCTL_USBPHYDeInit()

void ANCTL_USBPHYDeInit ( void  )

Deinitializes the USB PHY register to default reset values.

Note
The ANCTL register write-protection function should be disabled before using this function.
Returns
None

◆ ANCTL_WaitForHSEStartUp()

ErrorStatus ANCTL_WaitForHSEStartUp ( void  )

Waits for HSE start-up.

Parameters
None
Returns
An ErrorStatus enumuration value:
  • SUCCESS: HSE oscillator is stable and ready to use
  • ERROR: HSE oscillator not yet ready