Updated all platforms.

git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1480 35acf78f-673a-0410-8e92-d51de3d6d3f4
This commit is contained in:
gdisirio 2009-12-29 13:15:29 +00:00
parent 26790f9fb0
commit dc403a00e8
17 changed files with 175 additions and 88 deletions

View File

@ -62,8 +62,8 @@
/* Derived constants and error checks. */
/*===========================================================================*/
#if !CH_USE_SEMAPHORES
#error "CAN driver requires CH_USE_SEMAPHORES"
#if !CH_USE_SEMAPHORES || !CH_USE_EVENTS
#error "the ADC driver requires CH_USE_SEMAPHORES and CH_USE_EVENTS"
#endif
/*===========================================================================*/

View File

@ -30,7 +30,7 @@
#if CH_HAL_USE_ADC || defined(__DOXYGEN__)
/*===========================================================================*/
/* Low Level Driver exported variables. */
/* Driver exported variables. */
/*===========================================================================*/
/** @brief ADC1 driver identifier.*/
@ -39,15 +39,15 @@ ADCDriver ADCD1;
#endif
/*===========================================================================*/
/* Low Level Driver local variables. */
/* Driver local variables. */
/*===========================================================================*/
/*===========================================================================*/
/* Low Level Driver local functions. */
/* Driver local functions. */
/*===========================================================================*/
/*===========================================================================*/
/* Low Level Driver interrupt handlers. */
/* Driver interrupt handlers. */
/*===========================================================================*/
#if USE_STM32_ADC1 || defined(__DOXYGEN__)
@ -103,7 +103,7 @@ CH_IRQ_HANDLER(Vector6C) {
#endif
/*===========================================================================*/
/* Low Level Driver exported functions. */
/* Driver exported functions. */
/*===========================================================================*/
/**

View File

@ -55,27 +55,6 @@
#define ADC_CHANNEL_SENSOR 16 /**< @brief Internal temperature sensor.*/
#define ADC_CHANNEL_VREFINT 17 /**< @brief Internal reference. */
#define ADC_SQR1_NUM_CH(n) (((n) - 1) << 20)
#define ADC_SQR3_SQ0_N(n) ((n) << 0)
#define ADC_SQR3_SQ1_N(n) ((n) << 5)
#define ADC_SQR3_SQ2_N(n) ((n) << 10)
#define ADC_SQR3_SQ3_N(n) ((n) << 15)
#define ADC_SQR3_SQ4_N(n) ((n) << 20)
#define ADC_SQR3_SQ5_N(n) ((n) << 25)
#define ADC_SQR2_SQ6_N(n) ((n) << 0)
#define ADC_SQR2_SQ7_N(n) ((n) << 5)
#define ADC_SQR2_SQ8_N(n) ((n) << 10)
#define ADC_SQR2_SQ9_N(n) ((n) << 15)
#define ADC_SQR2_SQ10_N(n) ((n) << 20)
#define ADC_SQR2_SQ11_N(n) ((n) << 25)
#define ADC_SQR1_SQ13_N(n) ((n) << 0)
#define ADC_SQR1_SQ14_N(n) ((n) << 5)
#define ADC_SQR1_SQ15_N(n) ((n) << 10)
#define ADC_SQR1_SQ16_N(n) ((n) << 15)
/*===========================================================================*/
/* Driver pre-compile time settings. */
/*===========================================================================*/
@ -117,10 +96,6 @@
/* Derived constants and error checks. */
/*===========================================================================*/
#if !CH_USE_SEMAPHORES
#error "the ADC driver requires CH_USE_SEMAPHORES"
#endif
/*===========================================================================*/
/* Driver data structures and types. */
/*===========================================================================*/
@ -253,6 +228,31 @@ typedef struct {
uint32_t ad_dmaprio;
} ADCDriver;
/*===========================================================================*/
/* Driver macros. */
/*===========================================================================*/
#define ADC_SQR1_NUM_CH(n) (((n) - 1) << 20)
#define ADC_SQR3_SQ0_N(n) ((n) << 0)
#define ADC_SQR3_SQ1_N(n) ((n) << 5)
#define ADC_SQR3_SQ2_N(n) ((n) << 10)
#define ADC_SQR3_SQ3_N(n) ((n) << 15)
#define ADC_SQR3_SQ4_N(n) ((n) << 20)
#define ADC_SQR3_SQ5_N(n) ((n) << 25)
#define ADC_SQR2_SQ6_N(n) ((n) << 0)
#define ADC_SQR2_SQ7_N(n) ((n) << 5)
#define ADC_SQR2_SQ8_N(n) ((n) << 10)
#define ADC_SQR2_SQ9_N(n) ((n) << 15)
#define ADC_SQR2_SQ10_N(n) ((n) << 20)
#define ADC_SQR2_SQ11_N(n) ((n) << 25)
#define ADC_SQR1_SQ13_N(n) ((n) << 0)
#define ADC_SQR1_SQ14_N(n) ((n) << 5)
#define ADC_SQR1_SQ15_N(n) ((n) << 10)
#define ADC_SQR1_SQ16_N(n) ((n) << 15)
/*===========================================================================*/
/* External declarations. */
/*===========================================================================*/

View File

@ -30,7 +30,7 @@
#if CH_HAL_USE_CAN || defined(__DOXYGEN__)
/*===========================================================================*/
/* Low Level Driver exported variables. */
/* Driver exported variables. */
/*===========================================================================*/
/** @brief ADC1 driver identifier.*/
@ -39,15 +39,15 @@ CANDriver CAND1;
#endif
/*===========================================================================*/
/* Low Level Driver local variables. */
/* Driver local variables. */
/*===========================================================================*/
/*===========================================================================*/
/* Low Level Driver local functions. */
/* Driver local functions. */
/*===========================================================================*/
/*===========================================================================*/
/* Low Level Driver interrupt handlers. */
/* Driver interrupt handlers. */
/*===========================================================================*/
/*
@ -145,7 +145,7 @@ CH_IRQ_HANDLER(Vector98) {
}
/*===========================================================================*/
/* Low Level Driver exported functions. */
/* Driver exported functions. */
/*===========================================================================*/
/**

View File

@ -29,6 +29,10 @@
#if CH_HAL_USE_CAN || defined(__DOXYGEN__)
/*===========================================================================*/
/* Driver constants. */
/*===========================================================================*/
/*
* The following macros from the ST header file are replaced with better
* equivalents.
@ -38,10 +42,6 @@
#undef CAN_BTR_TS2
#undef CAN_BTR_SJW
/*===========================================================================*/
/* Driver constants. */
/*===========================================================================*/
/**
* @brief This switch defines whether the driver implementation supports
* a low power switch mode with automatic an wakeup feature.
@ -49,7 +49,7 @@
#define CAN_SUPPORTS_SLEEP TRUE
/**
* @brief Manimum number of CAN filters.
* @brief Minimum number of CAN filters.
*/
#if defined(STM32F10X_CL) || defined(__DOXYGEN__)
#define CAN_MAX_FILTERS 28
@ -106,10 +106,6 @@
/* Derived constants and error checks. */
/*===========================================================================*/
#if !CH_USE_SEMAPHORES || !CH_USE_EVENTS
#error "the ADC driver requires CH_USE_SEMAPHORES and CH_USE_EVENTS"
#endif
/*===========================================================================*/
/* Driver data structures and types. */
/*===========================================================================*/
@ -297,6 +293,10 @@ typedef struct {
CAN_TypeDef *cd_can;
} CANDriver;
/*===========================================================================*/
/* Driver macros. */
/*===========================================================================*/
/*===========================================================================*/
/* External declarations. */
/*===========================================================================*/

View File

@ -30,11 +30,11 @@
#define AIRCR_VECTKEY 0x05FA0000
/*===========================================================================*/
/* Low Level Driver exported variables. */
/* Driver exported variables. */
/*===========================================================================*/
/*===========================================================================*/
/* Low Level Driver local variables. */
/* Driver local variables. */
/*===========================================================================*/
/**
@ -57,15 +57,15 @@ const STM32GPIOConfig pal_default_config =
};
/*===========================================================================*/
/* Low Level Driver local functions. */
/* Driver local functions. */
/*===========================================================================*/
/*===========================================================================*/
/* Low Level Driver interrupt handlers. */
/* Driver interrupt handlers. */
/*===========================================================================*/
/*===========================================================================*/
/* Low Level Driver exported functions. */
/* Driver exported functions. */
/*===========================================================================*/
/**

View File

@ -96,6 +96,10 @@
/* Driver data structures and types. */
/*===========================================================================*/
/*===========================================================================*/
/* Driver macros. */
/*===========================================================================*/
/*===========================================================================*/
/* External declarations. */
/*===========================================================================*/

View File

@ -55,6 +55,26 @@
RCC_APB2ENR_IOPEEN | RCC_APB2ENR_AFIOEN)
#endif
/*===========================================================================*/
/* Driver exported variables. */
/*===========================================================================*/
/*===========================================================================*/
/* Driver local variables. */
/*===========================================================================*/
/*===========================================================================*/
/* Driver local functions. */
/*===========================================================================*/
/*===========================================================================*/
/* Driver interrupt handlers. */
/*===========================================================================*/
/*===========================================================================*/
/* Driver exported functions. */
/*===========================================================================*/
/**
* @brief STM32 I/O ports configuration.
* @details Ports A-D(E, F, G) clocks enabled, AFIO clock enabled.

View File

@ -30,7 +30,7 @@
#if CH_HAL_USE_PWM || defined(__DOXYGEN__)
/*===========================================================================*/
/* Low Level Driver exported variables. */
/* Driver exported variables. */
/*===========================================================================*/
/**
@ -66,11 +66,11 @@ PWMDriver PWMD4;
#endif
/*===========================================================================*/
/* Low Level Driver local variables. */
/* Driver local variables. */
/*===========================================================================*/
/*===========================================================================*/
/* Low Level Driver local functions. */
/* Driver local functions. */
/*===========================================================================*/
/**
@ -78,7 +78,7 @@ PWMDriver PWMD4;
*
* @param[in] pwmp pointer to a @p PWMDriver object
*/
void stop_channels(PWMDriver *pwmp) {
static void stop_channels(PWMDriver *pwmp) {
pwmp->pd_enabled_channels = 0; /* All channels disabled. */
pwmp->pd_tim->CCER = 0; /* Outputs disabled. */
@ -115,7 +115,7 @@ static void serve_interrupt(PWMDriver *pwmp) {
}
/*===========================================================================*/
/* Low Level Driver interrupt handlers. */
/* Driver interrupt handlers. */
/*===========================================================================*/
#if USE_STM32_PWM1
@ -204,7 +204,7 @@ CH_IRQ_HANDLER(VectorB8) {
#endif /* USE_STM32_PWM4 */
/*===========================================================================*/
/* Low Level Driver exported functions. */
/* Driver exported functions. */
/*===========================================================================*/
/**

View File

@ -204,6 +204,10 @@ typedef struct {
TIM_TypeDef *pd_tim;
} PWMDriver;
/*===========================================================================*/
/* Driver macros. */
/*===========================================================================*/
/*===========================================================================*/
/* External declarations. */
/*===========================================================================*/

View File

@ -30,26 +30,26 @@
#if CH_HAL_USE_SERIAL || defined(__DOXYGEN__)
/*===========================================================================*/
/* Low Level Driver exported variables. */
/* Driver exported variables. */
/*===========================================================================*/
#if USE_STM32_USART1 || defined(__DOXYGEN__)
/** @brief USART1 serial driver identifier.*/
#if USE_STM32_USART1 || defined(__DOXYGEN__)
SerialDriver SD1;
#endif
#if USE_STM32_USART2 || defined(__DOXYGEN__)
/** @brief USART2 serial driver identifier.*/
#if USE_STM32_USART2 || defined(__DOXYGEN__)
SerialDriver SD2;
#endif
#if USE_STM32_USART3 || defined(__DOXYGEN__)
/** @brief USART3 serial driver identifier.*/
#if USE_STM32_USART3 || defined(__DOXYGEN__)
SerialDriver SD3;
#endif
/*===========================================================================*/
/* Low Level Driver local variables. */
/* Driver local variables. */
/*===========================================================================*/
/** @brief Driver default configuration.*/
@ -62,7 +62,7 @@ static const SerialDriverConfig default_config =
};
/*===========================================================================*/
/* Low Level Driver local functions. */
/* Driver local functions. */
/*===========================================================================*/
/**
@ -173,7 +173,7 @@ static void notify3(void) {
#endif
/*===========================================================================*/
/* Low Level Driver interrupt handlers. */
/* Driver interrupt handlers. */
/*===========================================================================*/
#if USE_STM32_USART1 || defined(__DOXYGEN__)
@ -210,7 +210,7 @@ CH_IRQ_HANDLER(VectorDC) {
#endif
/*===========================================================================*/
/* Low Level Driver exported functions. */
/* Driver exported functions. */
/*===========================================================================*/
/**

View File

@ -29,6 +29,10 @@
#if CH_HAL_USE_SERIAL || defined(__DOXYGEN__)
/*===========================================================================*/
/* Driver constants. */
/*===========================================================================*/
/*===========================================================================*/
/* Driver pre-compile time settings. */
/*===========================================================================*/
@ -95,17 +99,9 @@
#endif
/*===========================================================================*/
/* Driver macros. */
/* Derived constants and error checks. */
/*===========================================================================*/
/*
* Extra USARTs definitions here (missing from the ST header file).
*/
#define USART_CR2_STOP1_BITS (0 << 12) /**< @brief CR2 1 stop bit value.*/
#define USART_CR2_STOP0P5_BITS (1 << 12) /**< @brief CR2 0.5 stop bit value.*/
#define USART_CR2_STOP2_BITS (2 << 12) /**< @brief CR2 2 stop bit value.*/
#define USART_CR2_STOP1P5_BITS (3 << 12) /**< @brief CR2 1.5 stop bit value.*/
/*===========================================================================*/
/* Driver data structures and types. */
/*===========================================================================*/
@ -165,6 +161,18 @@ typedef struct {
uint16_t cr3;
} SerialDriverConfig;
/*===========================================================================*/
/* Driver macros. */
/*===========================================================================*/
/*
* Extra USARTs definitions here (missing from the ST header file).
*/
#define USART_CR2_STOP1_BITS (0 << 12) /**< @brief CR2 1 stop bit value.*/
#define USART_CR2_STOP0P5_BITS (1 << 12) /**< @brief CR2 0.5 stop bit value.*/
#define USART_CR2_STOP2_BITS (2 << 12) /**< @brief CR2 2 stop bit value.*/
#define USART_CR2_STOP1P5_BITS (3 << 12) /**< @brief CR2 1.5 stop bit value.*/
/*===========================================================================*/
/* External declarations. */
/*===========================================================================*/

View File

@ -30,28 +30,28 @@
#if CH_HAL_USE_SPI || defined(__DOXYGEN__)
/*===========================================================================*/
/* Low Level Driver exported variables. */
/* Driver exported variables. */
/*===========================================================================*/
#if USE_STM32_SPI1 || defined(__DOXYGEN__)
/** @brief SPI1 driver identifier.*/
#if USE_STM32_SPI1 || defined(__DOXYGEN__)
SPIDriver SPID1;
#endif
#if USE_STM32_SPI2 || defined(__DOXYGEN__)
/** @brief SPI2 driver identifier.*/
#if USE_STM32_SPI2 || defined(__DOXYGEN__)
SPIDriver SPID2;
#endif
/*===========================================================================*/
/* Low Level Driver local variables. */
/* Driver local variables. */
/*===========================================================================*/
static uint16_t dummyrx;
static uint16_t dummytx;
/*===========================================================================*/
/* Low Level Driver local functions. */
/* Driver local functions. */
/*===========================================================================*/
static void spi_stop(SPIDriver *spip) {
@ -103,7 +103,7 @@ static void spi_start_wait(SPIDriver *spip, size_t n,
}
/*===========================================================================*/
/* Low Level Driver interrupt handlers. */
/* Driver interrupt handlers. */
/*===========================================================================*/
#if USE_STM32_SPI1 || defined(__DOXYGEN__)
@ -173,7 +173,7 @@ CH_IRQ_HANDLER(Vector7C) {
#endif
/*===========================================================================*/
/* Low Level Driver exported functions. */
/* Driver exported functions. */
/*===========================================================================*/
/**

View File

@ -180,6 +180,10 @@ typedef struct {
uint32_t spd_dmaprio;
} SPIDriver;
/*===========================================================================*/
/* Driver macros. */
/*===========================================================================*/
/*===========================================================================*/
/* External declarations. */
/*===========================================================================*/

View File

@ -27,11 +27,31 @@
#include "ch.h"
#include "hal.h"
/*===========================================================================*/
/* Driver exported variables. */
/*===========================================================================*/
/*===========================================================================*/
/* Driver local variables. */
/*===========================================================================*/
static cnt_t dmacnt1;
#if defined(STM32F10X_HD) || defined (STM32F10X_CL)
static cnt_t dmacnt2;
#endif
/*===========================================================================*/
/* Driver local functions. */
/*===========================================================================*/
/*===========================================================================*/
/* Driver interrupt handlers. */
/*===========================================================================*/
/*===========================================================================*/
/* Driver exported functions. */
/*===========================================================================*/
/**
* @brief STM32 DMA helper initialization.
*/

View File

@ -27,6 +27,10 @@
#ifndef _STM32_DMA_H_
#define _STM32_DMA_H_
/*===========================================================================*/
/* Driver constants. */
/*===========================================================================*/
/** @brief DMA1 identifier.*/
#define DMA1_ID 0
@ -35,6 +39,26 @@
#define DMA2_ID 1
#endif
/*===========================================================================*/
/* Driver pre-compile time settings. */
/*===========================================================================*/
/*===========================================================================*/
/* Derived constants and error checks. */
/*===========================================================================*/
/*===========================================================================*/
/* Driver data structures and types. */
/*===========================================================================*/
/*===========================================================================*/
/* Driver macros. */
/*===========================================================================*/
/*===========================================================================*/
/* External declarations. */
/*===========================================================================*/
#ifdef __cplusplus
extern "C" {
#endif

View File

@ -3,8 +3,11 @@
*****************************************************************************
*** 1.3.7 ***
- FIX: Fixed duplicated definition of SPI_USE_MUTUAL_EXCLUSION (bug 2922495).
- FIX: Fixed coverage tool hanging during execution (bug 2921120).
- FIX: Fixed Linux simulator startup message (bug 2921012).
- FIX: Fixed section separators comments into the HAL-related files. Now all
the files should use the same style.
*** 1.3.6 ***
- FIX: Fixed missing STM32 PWM low level driver error in platform.mk by