MG32F10x Standard Peripherals Firmware Library

模块 | 函数
ANCTL
MG32F10x_StdPeriph_Driver

ANCTL driver modules 更多...

## 模块
| ANCTL_Exported_Constants
| ANCTL_Private_Defines
| ANCTL_Private_Functions

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

## 详细描述

ANCTL driver modules

## 函数说明

## ◆ ANCTL_ClearITPendingBit()

void ANCTL_ClearITPendingBit | ( | uint8_t | ANCTL_IT | ) |

Clears the ANCTL's interrupt pending bits.

参数

  ANCTL_IT | specifies 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

注解
  The ANCTL register write-protection function should be disabled before using this function.

返回
  None

## ◆ ANCTL_ClockSecuritySystemCmd()

void ANCTL_ClockSecuritySystemCmd | ( | FunctionalState | NewState | ) |

Enables or disables the Clock Security System.

参数

  NewState | new state of the Clock Security System. This parameter can be: ENABLE or DISABLE.

注解
  The ANCTL register write-protection function should be disabled before using this function.

返回
  None

## ◆ ANCTL_CMPACmd()

void ANCTL_CMPACmd | ( | FunctionalState | NewState | ) |

Enables or disables the Comparator A.

参数

  NewState | new state of the Comparator A. This parameter can be: ENABLE or DISABLE.

注解
  The ANCTL register write-protection function should be disabled before using this function.

返回
  None

## ◆ ANCTL_CMPAConfig()

void ANCTL_CMPAConfig | ( | uint32_t | CMPA_PSEL,
|  | uint32_t | CMPA_NSEL
| ) |  |

Configures the Comparator A.

参数

  CMPA_PSEL | specifies the comparator positive input.
  CMPA_NSEL | specifies the comparator negative input.

注解
  The ANCTL register write-protection function should be disabled before using this function.

返回
  None

## ◆ ANCTL_CMPAGetOutputLevel()

uint32_t ANCTL_CMPAGetOutputLevel | ( | void |  | ) |

Returns the Comparator A output level.

参数

  None |

返回
  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.

参数

  NewState | new state of the Comparator B. This parameter can be: ENABLE or DISABLE.

注解
  The ANCTL register write-protection function should be disabled before using this function.

返回
  None

## ◆ ANCTL_CMPBConfig()

void ANCTL_CMPBConfig | ( | uint32_t | CMPB_PSEL,
|  | uint32_t | CMPB_NSEL
| ) |  |

Configures the Comparator B.

参数

  CMPB_PSEL | specifies the comparator positive input.
  CMPB_NSEL | specifies the comparator negative input.

注解
  The ANCTL register write-protection function should be disabled before using this function.

返回
  None

## ◆ ANCTL_CMPBGetOutputLevel()

uint32_t ANCTL_CMPBGetOutputLevel | ( | void |  | ) |

Returns the Comparator B output level.

参数

  None |

返回
  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).

参数

  NewState | new state of the FHSI. This parameter can be: ENABLE or DISABLE.

注解
  The ANCTL register write-protection function should be disabled before using this function.

返回
  None

## ◆ ANCTL_GetFlagStatus()

FlagStatus ANCTL_GetFlagStatus | ( | uint16_t | ANCTL_FLAG | ) |

Checks whether the specified ANCTL flag is set or not.

参数

  ANCTL_FLAG | specifies 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

返回
  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.

参数

  ANCTL_IT | specifies 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

返回
  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).

参数

  ANCTL_HSE | specifies 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

注解
  The ANCTL register write-protection function should be disabled before using this function.

返回
  None

## ◆ ANCTL_ITConfig()

void ANCTL_ITConfig | ( | uint8_t | ANCTL_IT,
|  | FunctionalState | NewState
| ) |  |

Enables or disables the specified ANCTL interrupts.

参数

  ANCTL_IT | specifies 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
  NewState | new state of the specified ANCTL interrupts. This parameter can be: ENABLE or DISABLE.

注解
  The ANCTL register write-protection function should be disabled before using this function.

返回
  None

## ◆ ANCTL_LSICmd()

void ANCTL_LSICmd | ( | FunctionalState | NewState | ) |

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

参数

  NewState | new state of the LSI. This parameter can be: ENABLE or DISABLE.

注解
  The ANCTL register write-protection function should be disabled before using this function.

返回
  None

## ◆ ANCTL_MHSICmd()

void ANCTL_MHSICmd | ( | FunctionalState | NewState | ) |

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

参数

  NewState | new state of the MHSI. This parameter can be: ENABLE or DISABLE.

注解
  The ANCTL register write-protection function should be disabled before using this function.

返回
  None

## ◆ ANCTL_PLLCmd()

void ANCTL_PLLCmd | ( | FunctionalState | NewState | ) |

Enables or disables the PLL.

参数

  NewState | new state of the PLL. This parameter can be: ENABLE or DISABLE.

注解
  The ANCTL register write-protection function should be disabled before using this function.

返回
  None

## ◆ ANCTL_PLLConfig()

void ANCTL_PLLConfig | ( | uint32_t | ANCTL_PLLMul | ) |

Configures the PLL multiplication factor.

参数

  ANCTL_PLLMul | specifies 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

注解
  The ANCTL register write-protection function should be disabled before using this function.

返回
  None

## ◆ ANCTL_PORCmd()

void ANCTL_PORCmd | ( | FunctionalState | NewState | ) |

Enables or disables the Power-on Reset function.

参数

  NewState | new state of the Power-on Reset function. This parameter can be: ENABLE or DISABLE.

注解
  The ANCTL register write-protection function should be disabled before using this function.

返回
  None

## ◆ ANCTL_PVDCmd()

void ANCTL_PVDCmd | ( | FunctionalState | NewState | ) |

Enables or disables the Power Voltage Detector (PVD).

参数

  NewState | new state of the PVD. This parameter can be: ENABLE or DISABLE.

注解
  The ANCTL register write-protection function should be disabled before using this function.

返回
  None

## ◆ ANCTL_PVDLevelConfig()

void ANCTL_PVDLevelConfig | ( | uint32_t | ANCTL_PVDLevel | ) |

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

参数

  ANCTL_PVDLevel | specifies 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

注解
  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.

返回
  None

## ◆ ANCTL_SARADCCmd()

void ANCTL_SARADCCmd | ( | FunctionalState | NewState | ) |

Enables or disables the SAR ADC.

参数

  NewState | new state of the SAR ADC. This parameter can be: ENABLE or DISABLE.

注解
  The ANCTL register write-protection function should be disabled before using this function.

返回
  None

## ◆ ANCTL_USBPHYCmd()

void ANCTL_USBPHYCmd | ( | FunctionalState | NewState | ) |

Enables or disables the USB PHY.

参数

  NewState | new state of the USB PHY. This parameter can be: ENABLE or DISABLE.

注解
  The ANCTL register write-protection function should be disabled before using this function.

返回
  None

## ◆ ANCTL_USBPHYConfig()

void ANCTL_USBPHYConfig | ( | uint32_t | ANCTL_USBPHY,
|  | FunctionalState | NewState
| ) |  |

Configures the USB PHY function.

参数

  ANCTL_USBPHY | specifies 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
  NewState | new state of the USB PHY function. This parameter can be: ENABLE or DISABLE.

注解
  The ANCTL register write-protection function should be disabled before using this function.

返回
  None

## ◆ ANCTL_USBPHYDeInit()

void ANCTL_USBPHYDeInit | ( | void |  | ) |

Deinitializes the USB PHY register to default reset values.

注解
  The ANCTL register write-protection function should be disabled before using this function.

返回
  None

## ◆ ANCTL_WaitForHSEStartUp()

ErrorStatus ANCTL_WaitForHSEStartUp | ( | void |  | ) |

Waits for HSE start-up.

参数

  None |

返回
  An ErrorStatus enumuration value:
  - SUCCESS: HSE oscillator is stable and ready to use
  - ERROR: HSE oscillator not yet ready