aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/platforms/STM32F1xx
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2011-09-21 17:10:15 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2011-09-21 17:10:15 +0000
commitae42ff1857ee56d67feca50d379c5f4b66d7fe69 (patch)
treeceeb4e3289274bcf92fd4f891c0b3fb1a3894a35 /os/hal/platforms/STM32F1xx
parent95713cae20050dd58b41f52edead1b05c1c982a2 (diff)
downloadChibiOS-ae42ff1857ee56d67feca50d379c5f4b66d7fe69.tar.gz
ChibiOS-ae42ff1857ee56d67feca50d379c5f4b66d7fe69.tar.bz2
ChibiOS-ae42ff1857ee56d67feca50d379c5f4b66d7fe69.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@3377 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/platforms/STM32F1xx')
-rw-r--r--os/hal/platforms/STM32F1xx/adc_lld.h27
1 files changed, 26 insertions, 1 deletions
diff --git a/os/hal/platforms/STM32F1xx/adc_lld.h b/os/hal/platforms/STM32F1xx/adc_lld.h
index 7180c2b83..1d1052f50 100644
--- a/os/hal/platforms/STM32F1xx/adc_lld.h
+++ b/os/hal/platforms/STM32F1xx/adc_lld.h
@@ -35,9 +35,18 @@
/* Driver constants. */
/*===========================================================================*/
+/**
+ * @name Triggers selection
+ * @{
+ */
#define ADC_CR2_EXTSEL_SRC(n) ((n) << 17) /**< @brief Trigger source. */
#define ADC_CR2_EXTSEL_SWSTART (7 << 17) /**< @brief Software trigger. */
+/** @} */
+/**
+ * @name Available analog channels
+ * @{
+ */
#define ADC_CHANNEL_IN0 0 /**< @brief External analog input 0. */
#define ADC_CHANNEL_IN1 1 /**< @brief External analog input 1. */
#define ADC_CHANNEL_IN2 2 /**< @brief External analog input 2. */
@@ -56,7 +65,12 @@
#define ADC_CHANNEL_IN15 15 /**< @brief External analog input 15. */
#define ADC_CHANNEL_SENSOR 16 /**< @brief Internal temperature sensor.*/
#define ADC_CHANNEL_VREFINT 17 /**< @brief Internal reference. */
+/** @} */
+/**
+ * @name Sampling rates
+ * @{
+ */
#define ADC_SAMPLE_1P5 0 /**< @brief 1.5 cycles sampling time. */
#define ADC_SAMPLE_7P5 1 /**< @brief 7.5 cycles sampling time. */
#define ADC_SAMPLE_13P5 2 /**< @brief 13.5 cycles sampling time. */
@@ -65,6 +79,7 @@
#define ADC_SAMPLE_55P5 5 /**< @brief 55.5 cycles sampling time. */
#define ADC_SAMPLE_71P5 6 /**< @brief 71.5 cycles sampling time. */
#define ADC_SAMPLE_239P5 7 /**< @brief 239.5 cycles sampling time. */
+/** @} */
/*===========================================================================*/
/* Driver pre-compile time settings. */
@@ -206,7 +221,7 @@ typedef struct {
uint32_t sqr2;
/**
* @brief ADC SQR3 register initialization data.
- * @details Conversion group sequence 0...6.
+ * @details Conversion group sequence 1...6.
*/
uint32_t sqr3;
} ADCConversionGroup;
@@ -282,6 +297,10 @@ struct ADCDriver {
/*===========================================================================*/
/**
+ * @name Sequences building helper macros
+ * @{
+ */
+/**
* @brief Number of channels in a conversion sequence.
*/
#define ADC_SQR1_NUM_CH(n) (((n) - 1) << 20)
@@ -304,7 +323,12 @@ struct ADCDriver {
#define ADC_SQR1_SQ14_N(n) ((n) << 5) /**< @brief 14th channel in seq.*/
#define ADC_SQR1_SQ15_N(n) ((n) << 10) /**< @brief 15th channel in seq.*/
#define ADC_SQR1_SQ16_N(n) ((n) << 15) /**< @brief 16th channel in seq.*/
+/** @} */
+/**
+ * @name Sampling rate settings helper macros
+ * @{
+ */
#define ADC_SMPR2_SMP_AN0(n) ((n) << 0) /**< @brief AN0 sampling time. */
#define ADC_SMPR2_SMP_AN1(n) ((n) << 3) /**< @brief AN1 sampling time. */
#define ADC_SMPR2_SMP_AN2(n) ((n) << 6) /**< @brief AN2 sampling time. */
@@ -326,6 +350,7 @@ struct ADCDriver {
sampling time. */
#define ADC_SMPR1_SMP_VREF(n) ((n) << 21) /**< @brief Voltage Reference
sampling time. */
+/** @} */
/*===========================================================================*/
/* External declarations. */