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

STM8S/A Standard Peripherals Library

stm8s_adc1.h File Reference

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

#include "stm8s.h"

Go to the source code of this file.

Defines

#define IS_ADC1_ALIGN_OK(ALIGN)
 Macro used by the assert function to check the different alignment modes.
#define IS_ADC1_BUFFER_OK(BUFFER)   ((BUFFER) <= (uint8_t)0x09)
 Macro used by the assert function to check the possible buffer values.
#define IS_ADC1_CHANNEL_OK(CHANNEL)
 Macro used by the assert function to check the different channels values.
#define IS_ADC1_CONVERSIONMODE_OK(MODE)
 Macro used by the assert function to check the different conversion modes.
#define IS_ADC1_EXTTRIG_OK(EXTRIG)
 Macro used by the assert function to check the different external trigger values.
#define IS_ADC1_FLAG_OK(FLAG)
 Macro used by the assert function to check the ADC1 Flag.
#define IS_ADC1_IT_OK(IT)
 Macro used by the assert function to check the Interrupt source.
#define IS_ADC1_ITPENDINGBIT_OK(ITPENDINGBIT)
 Macro used by the assert function to check the ADC1 pending bits.
#define IS_ADC1_PRESSEL_OK(PRESCALER)
 Macro used by the assert function to check the different prescaler's values.
#define IS_ADC1_SCHMITTTRIG_OK(SCHMITTTRIG)
 Macro used by the assert function to check the different schmitt trigger values.

Enumerations

enum  ADC1_Align_TypeDef { ADC1_ALIGN_LEFT = (uint8_t)0x00, ADC1_ALIGN_RIGHT = (uint8_t)0x08 }
 ADC1 data alignment. More...
enum  ADC1_Channel_TypeDef {
  ADC1_CHANNEL_0 = (uint8_t)0x00, ADC1_CHANNEL_1 = (uint8_t)0x01, ADC1_CHANNEL_2 = (uint8_t)0x02, ADC1_CHANNEL_3 = (uint8_t)0x03,
  ADC1_CHANNEL_4 = (uint8_t)0x04, ADC1_CHANNEL_5 = (uint8_t)0x05, ADC1_CHANNEL_6 = (uint8_t)0x06, ADC1_CHANNEL_7 = (uint8_t)0x07,
  ADC1_CHANNEL_8 = (uint8_t)0x08, ADC1_CHANNEL_9 = (uint8_t)0x09, ADC1_CHANNEL_12 = (uint8_t)0x0C
}
 ADC1 analog channel selection. More...
enum  ADC1_ConvMode_TypeDef { ADC1_CONVERSIONMODE_SINGLE = (uint8_t)0x00, ADC1_CONVERSIONMODE_CONTINUOUS = (uint8_t)0x01 }
 ADC1 conversion mode selection. More...
enum  ADC1_ExtTrig_TypeDef { ADC1_EXTTRIG_TIM = (uint8_t)0x00, ADC1_EXTTRIG_GPIO = (uint8_t)0x10 }
 ADC1 External conversion trigger event selection. More...
enum  ADC1_Flag_TypeDef {
  ADC1_FLAG_OVR = (uint8_t)0x41, ADC1_FLAG_AWD = (uint8_t)0x40, ADC1_FLAG_AWS0 = (uint8_t)0x10, ADC1_FLAG_AWS1 = (uint8_t)0x11,
  ADC1_FLAG_AWS2 = (uint8_t)0x12, ADC1_FLAG_AWS3 = (uint8_t)0x13, ADC1_FLAG_AWS4 = (uint8_t)0x14, ADC1_FLAG_AWS5 = (uint8_t)0x15,
  ADC1_FLAG_AWS6 = (uint8_t)0x16, ADC1_FLAG_AWS7 = (uint8_t)0x17, ADC1_FLAG_AWS8 = (uint8_t)0x18, ADC1_FLAG_AWS9 = (uint8_t)0x19,
  ADC1_FLAG_AWS12 = (uint8_t)0x1C, ADC1_FLAG_EOC = (uint8_t)0x80
}
 ADC1 Flags. More...
enum  ADC1_IT_TypeDef {
  ADC1_IT_AWDIE = (uint16_t)0x010, ADC1_IT_EOCIE = (uint16_t)0x020, ADC1_IT_AWD = (uint16_t)0x140, ADC1_IT_AWS0 = (uint16_t)0x110,
  ADC1_IT_AWS1 = (uint16_t)0x111, ADC1_IT_AWS2 = (uint16_t)0x112, ADC1_IT_AWS3 = (uint16_t)0x113, ADC1_IT_AWS4 = (uint16_t)0x114,
  ADC1_IT_AWS5 = (uint16_t)0x115, ADC1_IT_AWS6 = (uint16_t)0x116, ADC1_IT_AWS7 = (uint16_t)0x117, ADC1_IT_AWS8 = (uint16_t)0x118,
  ADC1_IT_AWS9 = (uint16_t)0x119, ADC1_IT_AWS12 = (uint16_t)0x11C, ADC1_IT_EOC = (uint16_t)0x080
}
 ADC1 Interrupt source. More...
enum  ADC1_PresSel_TypeDef {
  ADC1_PRESSEL_FCPU_D2 = (uint8_t)0x00, ADC1_PRESSEL_FCPU_D3 = (uint8_t)0x10, ADC1_PRESSEL_FCPU_D4 = (uint8_t)0x20, ADC1_PRESSEL_FCPU_D6 = (uint8_t)0x30,
  ADC1_PRESSEL_FCPU_D8 = (uint8_t)0x40, ADC1_PRESSEL_FCPU_D10 = (uint8_t)0x50, ADC1_PRESSEL_FCPU_D12 = (uint8_t)0x60, ADC1_PRESSEL_FCPU_D18 = (uint8_t)0x70
}
 ADC1 clock prescaler selection. More...
enum  ADC1_SchmittTrigg_TypeDef {
  ADC1_SCHMITTTRIG_CHANNEL0 = (uint8_t)0x00, ADC1_SCHMITTTRIG_CHANNEL1 = (uint8_t)0x01, ADC1_SCHMITTTRIG_CHANNEL2 = (uint8_t)0x02, ADC1_SCHMITTTRIG_CHANNEL3 = (uint8_t)0x03,
  ADC1_SCHMITTTRIG_CHANNEL4 = (uint8_t)0x04, ADC1_SCHMITTTRIG_CHANNEL5 = (uint8_t)0x05, ADC1_SCHMITTTRIG_CHANNEL6 = (uint8_t)0x06, ADC1_SCHMITTTRIG_CHANNEL7 = (uint8_t)0x07,
  ADC1_SCHMITTTRIG_CHANNEL8 = (uint8_t)0x08, ADC1_SCHMITTTRIG_CHANNEL9 = (uint8_t)0x09, ADC1_SCHMITTTRIG_CHANNEL12 = (uint8_t)0x0C, ADC1_SCHMITTTRIG_ALL = (uint8_t)0xFF
}
 ADC1 schmitt Trigger. More...

Functions

void ADC1_AWDChannelConfig (ADC1_Channel_TypeDef Channel, FunctionalState NewState)
 Enables or disables the analog watchdog for the given channel.
void ADC1_ClearFlag (ADC1_Flag_TypeDef Flag)
 Clear the specified ADC1 Flag.
void ADC1_ClearITPendingBit (ADC1_IT_TypeDef ITPendingBit)
 Clear the ADC1 End of Conversion pending bit.
void ADC1_Cmd (FunctionalState NewState)
 Enables or Disables the ADC1 peripheral.
void ADC1_ConversionConfig (ADC1_ConvMode_TypeDef ADC1_ConversionMode, ADC1_Channel_TypeDef ADC1_Channel, ADC1_Align_TypeDef ADC1_Align)
 Configure the ADC1 conversion on selected channel.
void ADC1_DataBufferCmd (FunctionalState NewState)
 Enables or Disables the ADC1 data store into the Data Buffer registers rather than in the Data Register.
void ADC1_DeInit (void)
 Deinitializes the ADC1 peripheral registers to their default reset values.
void ADC1_ExternalTriggerConfig (ADC1_ExtTrig_TypeDef ADC1_ExtTrigger, FunctionalState NewState)
 Configure the ADC1 conversion on external trigger event.
FlagStatus ADC1_GetAWDChannelStatus (ADC1_Channel_TypeDef Channel)
 Checks the specified analog watchdog channel status.
uint16_t ADC1_GetBufferValue (uint8_t Buffer)
 Get one sample of measured signal.
uint16_t ADC1_GetConversionValue (void)
 Get one sample of measured signal.
FlagStatus ADC1_GetFlagStatus (ADC1_Flag_TypeDef Flag)
 Checks the specified ADC1 flag status.
ITStatus ADC1_GetITStatus (ADC1_IT_TypeDef ITPendingBit)
 Returns the specified pending bit status.
void ADC1_Init (ADC1_ConvMode_TypeDef ADC1_ConversionMode, ADC1_Channel_TypeDef ADC1_Channel, ADC1_PresSel_TypeDef ADC1_PrescalerSelection, ADC1_ExtTrig_TypeDef ADC1_ExtTrigger, FunctionalState ADC1_ExtTriggerState, ADC1_Align_TypeDef ADC1_Align, ADC1_SchmittTrigg_TypeDef ADC1_SchmittTriggerChannel, FunctionalState ADC1_SchmittTriggerState)
 Initializes the ADC1 peripheral according to the specified parameters.
void ADC1_ITConfig (ADC1_IT_TypeDef ADC1_IT, FunctionalState NewState)
 Enables or disables the ADC1 interrupt.
void ADC1_PrescalerConfig (ADC1_PresSel_TypeDef ADC1_Prescaler)
 Configure the ADC1 prescaler division factor.
void ADC1_ScanModeCmd (FunctionalState NewState)
 Enables or Disables the ADC1 scan mode.
void ADC1_SchmittTriggerConfig (ADC1_SchmittTrigg_TypeDef ADC1_SchmittTriggerChannel, FunctionalState NewState)
 Enables or disables the ADC1 Schmitt Trigger on a selected channel.
void ADC1_SetHighThreshold (uint16_t Threshold)
 Sets the high threshold of the analog watchdog.
void ADC1_SetLowThreshold (uint16_t Threshold)
 Sets the low threshold of the analog watchdog.
void ADC1_StartConversion (void)
 Start ADC1 conversion.

Detailed Description

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

Author:
MCD Application Team
Version:
V2.2.0
Date:
30-September-2014
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_adc1.h.

STM8 Standard Peripherals Library: Footer

 

 

 

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