STM8L15x Standard Peripherals Drivers
|
stm8l15x_adc.h File Reference
This file contains all the functions prototypes for the ADC firmware library. More...
#include "stm8l15x.h"
Go to the source code of this file.
Defines | |
#define | IS_ADC_ANALOGWATCHDOG_SELECTION(CHANNEL) (((CHANNEL) <= 0x1D)) |
#define | IS_ADC_CLEAR_FLAG(FLAG) ((((FLAG) & (uint8_t)0xF8) == 0x00) && ((FLAG) != 0x00)) |
#define | IS_ADC_CONVERSION_MODE(MODE) |
#define | IS_ADC_EXT_EVENT_SELECTION(SELECTION) |
#define | IS_ADC_EXT_TRG_SENSITIVITY(SENSITIVITY) |
#define | IS_ADC_GET_FLAG(FLAG) |
#define | IS_ADC_GET_IT(IT) |
#define | IS_ADC_GROUP(GROUP) |
#define | IS_ADC_IT(IT) ((((IT) & (uint8_t)0x67) == 0x00) && ((IT) != 0x00)) |
#define | IS_ADC_PRESCALER(PRESCALER) |
#define | IS_ADC_RESOLUTION(RESOLUTION) |
#define | IS_ADC_SAMPLING_TIME_CYCLES(TIME) |
#define | IS_ADC_THRESHOLD(THRESHOLD) ((THRESHOLD) <= 0xFFF) |
Enumerations | |
enum | ADC_AnalogWatchdogSelection_TypeDef { ADC_AnalogWatchdogSelection_Channel0 = ((uint8_t)0x00), ADC_AnalogWatchdogSelection_Channel1 = ((uint8_t)0x01), ADC_AnalogWatchdogSelection_Channel2 = ((uint8_t)0x02), ADC_AnalogWatchdogSelection_Channel3 = ((uint8_t)0x03), ADC_AnalogWatchdogSelection_Channel4 = ((uint8_t)0x04), ADC_AnalogWatchdogSelection_Channel5 = ((uint8_t)0x05), ADC_AnalogWatchdogSelection_Channel6 = ((uint8_t)0x06), ADC_AnalogWatchdogSelection_Channel7 = ((uint8_t)0x07), ADC_AnalogWatchdogSelection_Channel8 = ((uint8_t)0x08), ADC_AnalogWatchdogSelection_Channel9 = ((uint8_t)0x09), ADC_AnalogWatchdogSelection_Channel10 = ((uint8_t)0x0A), ADC_AnalogWatchdogSelection_Channel11 = ((uint8_t)0x0B), ADC_AnalogWatchdogSelection_Channel12 = ((uint8_t)0x0C), ADC_AnalogWatchdogSelection_Channel13 = ((uint8_t)0x0D), ADC_AnalogWatchdogSelection_Channel14 = ((uint8_t)0x0E), ADC_AnalogWatchdogSelection_Channel15 = ((uint8_t)0x0F), ADC_AnalogWatchdogSelection_Channel16 = ((uint8_t)0x10), ADC_AnalogWatchdogSelection_Channel17 = ((uint8_t)0x11), ADC_AnalogWatchdogSelection_Channel18 = ((uint8_t)0x12), ADC_AnalogWatchdogSelection_Channel19 = ((uint8_t)0x13), ADC_AnalogWatchdogSelection_Channel20 = ((uint8_t)0x14), ADC_AnalogWatchdogSelection_Channel21 = ((uint8_t)0x15), ADC_AnalogWatchdogSelection_Channel22 = ((uint8_t)0x16), ADC_AnalogWatchdogSelection_Channel23 = ((uint8_t)0x17), ADC_AnalogWatchdogSelection_Channel24 = ((uint8_t)0x18), ADC_AnalogWatchdogSelection_Channel25 = ((uint8_t)0x19), ADC_AnalogWatchdogSelection_Channel26 = ((uint8_t)0x1A), ADC_AnalogWatchdogSelection_Channel27 = ((uint8_t)0x1B), ADC_AnalogWatchdogSelection_Vrefint = ((uint8_t)0x1C), ADC_AnalogWatchdogSelection_TempSensor = ((uint8_t)0x1D) } |
enum | ADC_Channel_TypeDef { ADC_Channel_0 = ((uint16_t)0x0301), ADC_Channel_1 = ((uint16_t)0x0302), ADC_Channel_2 = ((uint16_t)0x0304), ADC_Channel_3 = ((uint16_t)0x0308), ADC_Channel_4 = ((uint16_t)0x0310), ADC_Channel_5 = ((uint16_t)0x0320), ADC_Channel_6 = ((uint16_t)0x0340), ADC_Channel_7 = ((uint16_t)0x0380), ADC_Channel_8 = ((uint16_t)0x0201), ADC_Channel_9 = ((uint16_t)0x0202), ADC_Channel_10 = ((uint16_t)0x0204), ADC_Channel_11 = ((uint16_t)0x0208), ADC_Channel_12 = ((uint16_t)0x0210), ADC_Channel_13 = ((uint16_t)0x0220), ADC_Channel_14 = ((uint16_t)0x0240), ADC_Channel_15 = ((uint16_t)0x0280), ADC_Channel_16 = ((uint16_t)0x0101), ADC_Channel_17 = ((uint16_t)0x0102), ADC_Channel_18 = ((uint16_t)0x0104), ADC_Channel_19 = ((uint16_t)0x0108), ADC_Channel_20 = ((uint16_t)0x0110), ADC_Channel_21 = ((uint16_t)0x0120), ADC_Channel_22 = ((uint16_t)0x0140), ADC_Channel_23 = ((uint16_t)0x0180), ADC_Channel_24 = ((uint16_t)0x0001), ADC_Channel_25 = ((uint16_t)0x0002), ADC_Channel_26 = ((uint16_t)0x0004), ADC_Channel_27 = ((uint16_t)0x0008), ADC_Channel_Vrefint = ((uint16_t)0x0010), ADC_Channel_TempSensor = ((uint16_t)0x0020), ADC_Channel_00To07 = ((uint16_t)0x03FF), ADC_Channel_08To15 = ((uint16_t)0x02FF), ADC_Channel_16To23 = ((uint16_t)0x01FF), ADC_Channel_24To27 = ((uint16_t)0x00FF) } |
enum | ADC_ConversionMode_TypeDef { ADC_ConversionMode_Single = ((uint8_t)0x00), ADC_ConversionMode_Continuous = ((uint8_t)0x04) } |
enum | ADC_ExtEventSelection_TypeDef { ADC_ExtEventSelection_None = ((uint8_t)0x00), ADC_ExtEventSelection_Trigger1 = ((uint8_t)0x08), ADC_ExtEventSelection_Trigger2 = ((uint8_t)0x10), ADC_ExtEventSelection_Trigger3 = ((uint8_t)0x18) } |
enum | ADC_ExtTRGSensitivity_TypeDef { ADC_ExtTRGSensitivity_Rising = ((uint8_t)0x20), ADC_ExtTRGSensitivity_Falling = ((uint8_t)0x40), ADC_ExtTRGSensitivity_All = ((uint8_t)0x60) } |
enum | ADC_FLAG_TypeDef { ADC_FLAG_EOC = ((uint8_t)0x01), ADC_FLAG_AWD = ((uint8_t)0x02), ADC_FLAG_OVER = ((uint8_t)0x04) } |
enum | ADC_Group_TypeDef { ADC_Group_SlowChannels = ((uint8_t)0x00), ADC_Group_FastChannels = ((uint8_t)0x01) } |
enum | ADC_IT_TypeDef { ADC_IT_EOC = ((uint8_t)0x08), ADC_IT_AWD = ((uint8_t)0x10), ADC_IT_OVER = ((uint8_t)0x80) } |
enum | ADC_Prescaler_TypeDef { ADC_Prescaler_1 = ((uint8_t)0x00), ADC_Prescaler_2 = ((uint8_t)0x80) } |
enum | ADC_Resolution_TypeDef { ADC_Resolution_12Bit = ((uint8_t)0x00), ADC_Resolution_10Bit = ((uint8_t)0x20), ADC_Resolution_8Bit = ((uint8_t)0x40), ADC_Resolution_6Bit = ((uint8_t)0x60) } |
enum | ADC_SamplingTime_TypeDef { ADC_SamplingTime_4Cycles = ((uint8_t)0x00), ADC_SamplingTime_9Cycles = ((uint8_t)0x01), ADC_SamplingTime_16Cycles = ((uint8_t)0x02), ADC_SamplingTime_24Cycles = ((uint8_t)0x03), ADC_SamplingTime_48Cycles = ((uint8_t)0x04), ADC_SamplingTime_96Cycles = ((uint8_t)0x05), ADC_SamplingTime_192Cycles = ((uint8_t)0x06), ADC_SamplingTime_384Cycles = ((uint8_t)0x07) } |
Functions | |
void | ADC_AnalogWatchdogChannelSelect (ADC_TypeDef *ADCx, ADC_AnalogWatchdogSelection_TypeDef ADC_AnalogWatchdogSelection) |
Configures the channel to be checked by the Analog watchdog. | |
void | ADC_AnalogWatchdogConfig (ADC_TypeDef *ADCx, ADC_AnalogWatchdogSelection_TypeDef ADC_AnalogWatchdogSelection, uint16_t HighThreshold, uint16_t LowThreshold) |
Configures the Analog watchdog. | |
void | ADC_AnalogWatchdogThresholdsConfig (ADC_TypeDef *ADCx, uint16_t HighThreshold, uint16_t LowThreshold) |
Configures the high and low thresholds of the Analog watchdog. | |
void | ADC_ChannelCmd (ADC_TypeDef *ADCx, ADC_Channel_TypeDef ADC_Channels, FunctionalState NewState) |
Enables or disables the selected ADC channel(s). | |
void | ADC_ClearFlag (ADC_TypeDef *ADCx, ADC_FLAG_TypeDef ADC_FLAG) |
Clears the ADC's pending flags. | |
void | ADC_ClearITPendingBit (ADC_TypeDef *ADCx, ADC_IT_TypeDef ADC_IT) |
Clears the ADC�s interrupt pending bits. | |
void | ADC_Cmd (ADC_TypeDef *ADCx, FunctionalState NewState) |
Enables or disables the selected ADC peripheral. | |
void | ADC_DeInit (ADC_TypeDef *ADCx) |
Deinitializes the ADC peripheral registers to their default reset values. | |
void | ADC_DMACmd (ADC_TypeDef *ADCx, FunctionalState NewState) |
Enables or disables the specified ADC DMA request. | |
void | ADC_ExternalTrigConfig (ADC_TypeDef *ADCx, ADC_ExtEventSelection_TypeDef ADC_ExtEventSelection, ADC_ExtTRGSensitivity_TypeDef ADC_ExtTRGSensitivity) |
Configures the ADC conversion through external trigger. | |
uint16_t | ADC_GetConversionValue (ADC_TypeDef *ADCx) |
Returns the last ADC converted data. | |
FlagStatus | ADC_GetFlagStatus (ADC_TypeDef *ADCx, ADC_FLAG_TypeDef ADC_FLAG) |
Checks whether the specified ADC flag is set or not. | |
ITStatus | ADC_GetITStatus (ADC_TypeDef *ADCx, ADC_IT_TypeDef ADC_IT) |
Checks whether the specified ADC interrupt has occurred or not. | |
void | ADC_Init (ADC_TypeDef *ADCx, ADC_ConversionMode_TypeDef ADC_ConversionMode, ADC_Resolution_TypeDef ADC_Resolution, ADC_Prescaler_TypeDef ADC_Prescaler) |
Initializes the specified ADC peripheral according to the specified parameters. | |
void | ADC_ITConfig (ADC_TypeDef *ADCx, ADC_IT_TypeDef ADC_IT, FunctionalState NewState) |
Enables or disables the specified ADC interrupts. | |
void | ADC_SamplingTimeConfig (ADC_TypeDef *ADCx, ADC_Group_TypeDef ADC_GroupChannels, ADC_SamplingTime_TypeDef ADC_SamplingTime) |
Configures the sampling time for the selected ADC channel group. | |
void | ADC_SchmittTriggerConfig (ADC_TypeDef *ADCx, ADC_Channel_TypeDef ADC_Channels, FunctionalState NewState) |
Configures the status of the Schmitt Trigger for the selected ADC channel(s). | |
void | ADC_SoftwareStartConv (ADC_TypeDef *ADCx) |
Starts ADC conversion, by software trigger. | |
void | ADC_TempSensorCmd (FunctionalState NewState) |
Enables or disables the Temperature sensor internal reference. | |
void | ADC_VrefintCmd (FunctionalState NewState) |
Enables or disables the Internal Voltage reference. |
Detailed Description
This file contains all the functions prototypes for the ADC firmware library.
- Attention:
THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
© COPYRIGHT 2011 STMicroelectronics
Definition in file stm8l15x_adc.h.