From 6150f3b4a34df80ac65cee5d1818982199b5a027 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Mon, 23 Nov 2009 21:18:54 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1320 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/io/adc.c | 2 +- os/io/adc.h | 2 +- os/io/platforms/STM32/adc_lld.c | 2 +- os/io/platforms/STM32/adc_lld.h | 38 +++++++++++++++++++------------------- os/io/platforms/STM32/spi_lld.c | 8 ++++---- os/io/templates/adc_lld.h | 18 +++++++++--------- 6 files changed, 35 insertions(+), 35 deletions(-) (limited to 'os') diff --git a/os/io/adc.c b/os/io/adc.c index 2fc64f561..af4508ab7 100644 --- a/os/io/adc.c +++ b/os/io/adc.c @@ -121,7 +121,7 @@ void adcStop(ADCDriver *adcp) { * with no gaps. */ bool_t adcStartConversion(ADCDriver *adcp, - ADCConversionGroup *grpp, + const ADCConversionGroup *grpp, adcsample_t *samples, size_t depth, adccallback_t callback) { diff --git a/os/io/adc.h b/os/io/adc.h index 9c505f66d..08e83caa2 100644 --- a/os/io/adc.h +++ b/os/io/adc.h @@ -51,7 +51,7 @@ extern "C" { void adcStart(ADCDriver *adcp, const ADCConfig *config); void adcStop(ADCDriver *adcp); bool_t adcStartConversion(ADCDriver *adcp, - ADCConversionGroup *grpp, + const ADCConversionGroup *grpp, adcsample_t *samples, size_t depth, adccallback_t callback); diff --git a/os/io/platforms/STM32/adc_lld.c b/os/io/platforms/STM32/adc_lld.c index 9cc123e36..7e362e50b 100644 --- a/os/io/platforms/STM32/adc_lld.c +++ b/os/io/platforms/STM32/adc_lld.c @@ -190,7 +190,7 @@ void adc_lld_stop(ADCDriver *adcp) { */ void adc_lld_start_conversion(ADCDriver *adcp) { uint32_t ccr, n; - ADCConversionGroup *grpp = adcp->ad_grpp; + const ADCConversionGroup *grpp = adcp->ad_grpp; /* DMA setup.*/ adcp->ad_dma->CMAR = (uint32_t)adcp->ad_samples; diff --git a/os/io/platforms/STM32/adc_lld.h b/os/io/platforms/STM32/adc_lld.h index 2c60f81e8..bbb4faef0 100644 --- a/os/io/platforms/STM32/adc_lld.h +++ b/os/io/platforms/STM32/adc_lld.h @@ -144,45 +144,45 @@ typedef struct { /** * @brief Enables the circular buffer mode for the group. */ - bool_t acg_circular; + bool_t acg_circular; /** * @brief Number of the analog channels belonging to the conversion group. */ - adc_channels_num_t acg_num_channels; + adc_channels_num_t acg_num_channels; /* End of the mandatory fields.*/ /** * @brief ADC CR1 register initialization data. * @note All the required bits must be defined into this field except * @p ADC_CR1_SCAN that is enforced inside the driver. */ - uint32_t acg_cr1; + uint32_t acg_cr1; /** * @brief ADC CR2 register initialization data. * @note All the required bits must be defined into this field except * @p ADC_CR2_DMA and @p ADC_CR2_ADON that are enforced inside the * driver. */ - uint32_t acg_cr2; + uint32_t acg_cr2; /** * @brief ADC SMPR1 register initialization data. */ - uint32_t acg_smpr1; + uint32_t acg_smpr1; /** * @brief ADC SMPR2 register initialization data. */ - uint32_t acg_smpr2; + uint32_t acg_smpr2; /** * @brief ADC SQR1 register initialization data. */ - uint32_t acg_sqr1; + uint32_t acg_sqr1; /** * @brief ADC SQR2 register initialization data. */ - uint32_t acg_sqr2; + uint32_t acg_sqr2; /** * @brief ADC SQR3 register initialization data. */ - uint32_t acg_sqr3; + uint32_t acg_sqr3; } ADCConversionGroup; /** @@ -206,44 +206,44 @@ typedef struct { /** * @brief Driver state. */ - adcstate_t ad_state; + adcstate_t ad_state; /** * @brief Current configuration data. */ - const ADCConfig *ad_config; + const ADCConfig *ad_config; /** * @brief Synchronization semaphore. */ - Semaphore ad_sem; + Semaphore ad_sem; /** * @brief Current callback function or @p NULL. */ - adccallback_t ad_callback; + adccallback_t ad_callback; /** * @brief Current samples buffer pointer or @p NULL. */ - adcsample_t *ad_samples; + adcsample_t *ad_samples; /** * @brief Current samples buffer depth or @p 0. */ - size_t ad_depth; + size_t ad_depth; /** * @brief Current conversion group pointer or @p NULL. */ - ADCConversionGroup *ad_grpp; + const ADCConversionGroup *ad_grpp; /* End of the mandatory fields.*/ /** * @brief Pointer to the ADCx registers block. */ - ADC_TypeDef *ad_adc; + ADC_TypeDef *ad_adc; /** * @brief Pointer to the DMA channel registers block. */ - DMA_Channel_TypeDef *ad_dma; + DMA_Channel_TypeDef *ad_dma; /** * @brief DMA priority bit mask. */ - uint32_t ad_dmaprio; + uint32_t ad_dmaprio; } ADCDriver; /*===========================================================================*/ diff --git a/os/io/platforms/STM32/spi_lld.c b/os/io/platforms/STM32/spi_lld.c index 769b797e8..e91fe44a0 100644 --- a/os/io/platforms/STM32/spi_lld.c +++ b/os/io/platforms/STM32/spi_lld.c @@ -29,15 +29,15 @@ #include #include +/*===========================================================================*/ +/* Low Level Driver exported variables. */ +/*===========================================================================*/ + #if USE_STM32_SPI1 || defined(__DOXYGEN__) /** @brief SPI1 driver identifier.*/ SPIDriver SPID1; #endif -/*===========================================================================*/ -/* Low Level Driver exported variables. */ -/*===========================================================================*/ - #if USE_STM32_SPI2 || defined(__DOXYGEN__) /** @brief SPI2 driver identifier.*/ SPIDriver SPID2; diff --git a/os/io/templates/adc_lld.h b/os/io/templates/adc_lld.h index affa7b0f3..b229a5f2d 100644 --- a/os/io/templates/adc_lld.h +++ b/os/io/templates/adc_lld.h @@ -65,11 +65,11 @@ typedef struct { /** * @brief Enables the circular buffer mode for the group. */ - bool_t acg_circular; + bool_t acg_circular; /** * @brief Number of the analog channels belonging to the conversion group. */ - adc_channels_num_t acg_num_channels; + adc_channels_num_t acg_num_channels; /* End of the mandatory fields.*/ } ADCConversionGroup; @@ -88,31 +88,31 @@ typedef struct { /** * @brief Driver state. */ - adcstate_t ad_state; + adcstate_t ad_state; /** * @brief Current configuration data. */ - const ADCConfig *ad_config; + const ADCConfig *ad_config; /** * @brief Synchronization semaphore. */ - Semaphore ad_sem; + Semaphore ad_sem; /** * @brief Current callback function or @p NULL. */ - adccallback_t ad_callback; + adccallback_t ad_callback; /** * @brief Current samples buffer pointer or @p NULL. */ - adcsample_t *ad_samples; + adcsample_t *ad_samples; /** * @brief Current samples buffer depth or @p 0. */ - size_t ad_depth; + size_t ad_depth; /** * @brief Current conversion group pointer or @p NULL. */ - ADCConversionGroup *ad_grpp; + const ADCConversionGroup *ad_grpp; /* End of the mandatory fields.*/ } ADCDriver; -- cgit v1.2.3