STM8S/A Standard Peripherals Drivers: stm8s_adc2.h File Reference

STM8S/A

stm8s_adc2.h File Reference

This file contains all the prototypes/macros for the ADC2 peripheral. More...

#include "stm8s.h"

Go to the source code of this file.

Defines

#define IS_ADC2_ALIGN_OK(ALIGN)
 Macro used by the assert function to check the different alignment modes.
#define IS_ADC2_CHANNEL_OK(CHANNEL)
 Macro used by the assert function to check the different channels values.
#define IS_ADC2_CONVERSIONMODE_OK(MODE)
 Macro used by the assert function to check the different conversion modes.
#define IS_ADC2_EXTTRIG_OK(EXTRIG)
 Macro used by the assert function to check the different external trigger values.
#define IS_ADC2_PRESSEL_OK(PRESCALER)
 Macro used by the assert function to check the different prescaler's values.
#define IS_ADC2_SCHMITTTRIG_OK(SCHMITTTRIG)
 Macro used by the assert function to check the different schmitt trigger values.

Enumerations

enum  ADC2_Align_TypeDef { ADC2_ALIGN_LEFT = (uint8_t)0x00, ADC2_ALIGN_RIGHT = (uint8_t)0x08 }
 ADC2 data alignment. More...
enum  ADC2_Channel_TypeDef {
  ADC2_CHANNEL_0 = (uint8_t)0x00, ADC2_CHANNEL_1 = (uint8_t)0x01, ADC2_CHANNEL_2 = (uint8_t)0x02, ADC2_CHANNEL_3 = (uint8_t)0x03,
  ADC2_CHANNEL_4 = (uint8_t)0x04, ADC2_CHANNEL_5 = (uint8_t)0x05, ADC2_CHANNEL_6 = (uint8_t)0x06, ADC2_CHANNEL_7 = (uint8_t)0x07,
  ADC2_CHANNEL_8 = (uint8_t)0x08, ADC2_CHANNEL_9 = (uint8_t)0x09, ADC2_CHANNEL_10 = (uint8_t)0x0A, ADC2_CHANNEL_11 = (uint8_t)0x0B,
  ADC2_CHANNEL_12 = (uint8_t)0x0C, ADC2_CHANNEL_13 = (uint8_t)0x0D, ADC2_CHANNEL_14 = (uint8_t)0x0E, ADC2_CHANNEL_15 = (uint8_t)0x0F
}
 ADC2 analog channel selection. More...
enum  ADC2_ConvMode_TypeDef { ADC2_CONVERSIONMODE_SINGLE = (uint8_t)0x00, ADC2_CONVERSIONMODE_CONTINUOUS = (uint8_t)0x01 }
 ADC2 conversion mode selection. More...
enum  ADC2_ExtTrig_TypeDef { ADC2_EXTTRIG_TIM = (uint8_t)0x00, ADC2_EXTTRIG_GPIO = (uint8_t)0x01 }
 ADC2 External conversion trigger event selection. More...
enum  ADC2_PresSel_TypeDef {
  ADC2_PRESSEL_FCPU_D2 = (uint8_t)0x00, ADC2_PRESSEL_FCPU_D3 = (uint8_t)0x10, ADC2_PRESSEL_FCPU_D4 = (uint8_t)0x20, ADC2_PRESSEL_FCPU_D6 = (uint8_t)0x30,
  ADC2_PRESSEL_FCPU_D8 = (uint8_t)0x40, ADC2_PRESSEL_FCPU_D10 = (uint8_t)0x50, ADC2_PRESSEL_FCPU_D12 = (uint8_t)0x60, ADC2_PRESSEL_FCPU_D18 = (uint8_t)0x70
}
 ADC2 clock prescaler selection. More...
enum  ADC2_SchmittTrigg_TypeDef {
  ADC2_SCHMITTTRIG_CHANNEL0 = (uint8_t)0x00, ADC2_SCHMITTTRIG_CHANNEL1 = (uint8_t)0x01, ADC2_SCHMITTTRIG_CHANNEL2 = (uint8_t)0x02, ADC2_SCHMITTTRIG_CHANNEL3 = (uint8_t)0x03,
  ADC2_SCHMITTTRIG_CHANNEL4 = (uint8_t)0x04, ADC2_SCHMITTTRIG_CHANNEL5 = (uint8_t)0x05, ADC2_SCHMITTTRIG_CHANNEL6 = (uint8_t)0x06, ADC2_SCHMITTTRIG_CHANNEL7 = (uint8_t)0x07,
  ADC2_SCHMITTTRIG_CHANNEL8 = (uint8_t)0x08, ADC2_SCHMITTTRIG_CHANNEL9 = (uint8_t)0x09, ADC2_SCHMITTTRIG_CHANNEL10 = (uint8_t)0x0A, ADC2_SCHMITTTRIG_CHANNEL11 = (uint8_t)0x0B,
  ADC2_SCHMITTTRIG_CHANNEL12 = (uint8_t)0x0C, ADC2_SCHMITTTRIG_CHANNEL13 = (uint8_t)0x0D, ADC2_SCHMITTTRIG_CHANNEL14 = (uint8_t)0x0E, ADC2_SCHMITTTRIG_CHANNEL15 = (uint8_t)0x0F,
  ADC2_SCHMITTTRIG_ALL = (uint8_t)0x1F
}
 ADC2 schmitt Trigger. More...

Functions

void ADC2_ClearFlag (void)
 Clear the ADC2 EOC Flag.
void ADC2_ClearITPendingBit (void)
 Clear the ADC2 End of Conversion pending bit.
void ADC2_Cmd (FunctionalState NewState)
 Enables or Disables the ADC2 peripheral.
void ADC2_ConversionConfig (ADC2_ConvMode_TypeDef ADC2_ConversionMode, ADC2_Channel_TypeDef ADC2_Channel, ADC2_Align_TypeDef ADC2_Align)
 Configure the ADC2 conversion on selected channel.
void ADC2_DeInit (void)
 Deinitializes the ADC2 peripheral registers to their default reset values.
void ADC2_ExternalTriggerConfig (ADC2_ExtTrig_TypeDef ADC2_ExtTrigger, FunctionalState NewState)
 Configure the ADC2 conversion on external trigger event.
uint16_t ADC2_GetConversionValue (void)
 Get one sample of measured signal.
FlagStatus ADC2_GetFlagStatus (void)
 Checks the ADC2 EOC flag status.
ITStatus ADC2_GetITStatus (void)
 Returns the EOC pending bit status.
void ADC2_Init (ADC2_ConvMode_TypeDef ADC2_ConversionMode, ADC2_Channel_TypeDef ADC2_Channel, ADC2_PresSel_TypeDef ADC2_PrescalerSelection, ADC2_ExtTrig_TypeDef ADC2_ExtTrigger, FunctionalState ADC2_ExtTriggerState, ADC2_Align_TypeDef ADC2_Align, ADC2_SchmittTrigg_TypeDef ADC2_SchmittTriggerChannel, FunctionalState ADC2_SchmittTriggerState)
 Initializes the ADC2 peripheral according to the specified parameters.
void ADC2_ITConfig (FunctionalState NewState)
 Enables or disables the ADC2 interrupt.
void ADC2_PrescalerConfig (ADC2_PresSel_TypeDef ADC2_Prescaler)
 Configure the ADC2 prescaler division factor.
void ADC2_SchmittTriggerConfig (ADC2_SchmittTrigg_TypeDef ADC2_SchmittTriggerChannel, FunctionalState NewState)
 Enables or disables the ADC2 Schmitt Trigger on a selected channel.
void ADC2_StartConversion (void)
 Start ADC2 conversion.

Detailed Description

This file contains all the prototypes/macros for the ADC2 peripheral.

Author:
MCD Application Team
Version:
V2.3.0
Date:
16-June-2017
Attention:

© COPYRIGHT 2014 STMicroelectronics

Licensed under MCD-ST Liberty SW License Agreement V2, (the "License"); You may not use this file except in compliance with the License. You may obtain a copy of the License at:

http://www.st.com/software_license_agreement_liberty_v2

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Definition in file stm8s_adc2.h.

STM8 Standard Peripherals Library: Footer

 

 

 

      For complete documentation on STM8 8-bit Microcontrollers platform visit www.st.com