MG32L003 Standard Peripherals Firmware Library
Macros | Functions
mg32l003_adc.c File Reference

This file provides all the ADC firmware functions. More...

#include "mg32l003_adc.h"
#include "mg32l003_rcc.h"

Macros

#define CR0_CONFIG_CLEAR_Msk   (ADC_CR0_SAM_Msk | ADC_CR0_SEL_Msk | ADC_CR0_CLKSEL_Msk)
 
#define CR1_CONFIG_CLEAR_Msk   (ADC_CR1_RACC_EN_Msk | ADC_CR1_TRIGS0_Msk | ADC_CR1_TRIGS1_Msk)
 
#define CR2_CONFIG_CLEAR_Msk   (ADC_CR2_CIRCLE_MODE_Msk | ADC_CR2_ADCCNT_Msk | ADC_CR2_CHEN_Msk)
 

Functions

void ADC_DeInit (void)
 Deinitializes the ADC peripheral registers to their default reset values. More...
 
void ADC_Init (ADC_InitTypeDef *ADC_InitStruct)
 Initializes the ADC peripheral according to the specified parameters in the ADC_InitStruct. More...
 
void ADC_StructInit (ADC_InitTypeDef *ADC_InitStruct)
 Fills each ADC_InitStruct member with its default value. More...
 
void ADC_Cmd (FunctionalState NewState)
 Enables or disables the ADC peripheral. More...
 
void ADC_ITConfig (uint32_t ADC_IT, FunctionalState NewState)
 Enables or disables the specified ADC interrupts. More...
 
void ADC_SoftwareStartConvCmd (FunctionalState NewState)
 Enables or disables the selected ADC software start conversion. More...
 
FlagStatus ADC_GetSoftwareStartConvStatus (void)
 Gets the selected ADC Software start conversion Status. More...
 
uint16_t ADC_GetConversionValue (uint32_t Channel)
 Returns the last ADC conversion result data for regular channel. More...
 
uint32_t ADC_GetAccValue (void)
 Gets ADC accumulation conversion result. More...
 
ITStatus ADC_GetITStatus (uint16_t ADC_IT)
 Checks whether the specified ADC interrupt is set or not. More...
 
FlagStatus ADC_GetFlagStatus (uint16_t ADC_FLAG)
 Checks whether the specified ADC flag is set or not. More...
 
void ADC_ClearITPendingBit (uint16_t ADC_IT)
 Clears the ADC pending interrupt bits. More...
 
void ADC_ClearFlag (uint16_t ADC_FLAG)
 Clears the ADC pending interrupt flags. More...
 
FlagStatus ADC_GetRawFlagStatus (uint16_t ADC_FLAG)
 Checks whether the specified ADC flag is set or not. More...
 
void ADC_ThresholdsConfig (uint16_t LowThreshold, uint16_t HighThreshold)
 Configures the high and low thresholds of the analog watchdog. More...
 
void ADC_ThresholdsCompareCmd (uint16_t Threshold_Config, FunctionalState NewState)
 Enables or disables the thresholds to compare with the function of analog watchdog. More...
 

Detailed Description

This file provides all the ADC firmware functions.

Author
megawin Application Team
Version
V0.0.5
Date
13-August-2024