aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2013-08-12 15:42:54 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2013-08-12 15:42:54 +0000
commit67e80419b7acb17801c0cff68632a99450dc393a (patch)
tree213594a1c8b1f8ebfc4eb5967652218d4e92090d /os/hal
parent3fb6b81233fb90c2b6330b872f34fc67eadd78d7 (diff)
downloadChibiOS-67e80419b7acb17801c0cff68632a99450dc393a.tar.gz
ChibiOS-67e80419b7acb17801c0cff68632a99450dc393a.tar.bz2
ChibiOS-67e80419b7acb17801c0cff68632a99450dc393a.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/kernel_3_dev@6140 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal')
-rw-r--r--os/hal/include/hal.h1
-rw-r--r--os/hal/platforms/STM32/GPIOv2/pal_lld.c2
-rw-r--r--os/hal/platforms/STM32/GPIOv2/pal_lld.h20
-rw-r--r--os/hal/platforms/STM32/TIMv1/stm32_tim.h4
-rw-r--r--os/hal/platforms/STM32/stm32.h34
-rw-r--r--os/hal/platforms/STM32F30x/stm32f30x.h6
6 files changed, 49 insertions, 18 deletions
diff --git a/os/hal/include/hal.h b/os/hal/include/hal.h
index bafdb5419..f1f815e7a 100644
--- a/os/hal/include/hal.h
+++ b/os/hal/include/hal.h
@@ -35,7 +35,6 @@
#include "hal_lld.h"
-
/* Abstract interfaces.*/
#include "hal_streams.h"
#include "hal_channels.h"
diff --git a/os/hal/platforms/STM32/GPIOv2/pal_lld.c b/os/hal/platforms/STM32/GPIOv2/pal_lld.c
index cc5e7f06e..017b340a0 100644
--- a/os/hal/platforms/STM32/GPIOv2/pal_lld.c
+++ b/os/hal/platforms/STM32/GPIOv2/pal_lld.c
@@ -73,7 +73,7 @@
/* Driver local functions. */
/*===========================================================================*/
-static void initgpio(GPIO_TypeDef *gpiop, const stm32_gpio_setup_t *config) {
+static void initgpio(stm32_gpio_t *gpiop, const stm32_gpio_setup_t *config) {
gpiop->OTYPER = config->otyper;
gpiop->OSPEEDR = config->ospeedr;
diff --git a/os/hal/platforms/STM32/GPIOv2/pal_lld.h b/os/hal/platforms/STM32/GPIOv2/pal_lld.h
index 82b04c7f4..5349507df 100644
--- a/os/hal/platforms/STM32/GPIOv2/pal_lld.h
+++ b/os/hal/platforms/STM32/GPIOv2/pal_lld.h
@@ -130,6 +130,21 @@
PAL_STM32_OTYPE_OPENDRAIN)
/** @} */
+/**
+ * @name GPIO ports definitions
+ * @{
+ */
+#define GPIOA ((stm32_gpio_t *)GPIOA_BASE)
+#define GPIOB ((stm32_gpio_t *)GPIOB_BASE)
+#define GPIOC ((stm32_gpio_t *)GPIOC_BASE)
+#define GPIOD ((stm32_gpio_t *)GPIOD_BASE)
+#define GPIOE ((stm32_gpio_t *)GPIOE_BASE)
+#define GPIOF ((stm32_gpio_t *)GPIOF_BASE)
+#define GPIOG ((stm32_gpio_t *)GPIOG_BASE)
+#define GPIOH ((stm32_gpio_t *)GPIOH_BASE)
+#define GPIOI ((stm32_gpio_t *)GPIOI_BASE)
+/** @} */
+
/*===========================================================================*/
/* I/O Ports Types and constants. */
/*===========================================================================*/
@@ -155,7 +170,8 @@ typedef struct {
volatile uint32_t LCKR;
volatile uint32_t AFRL;
volatile uint32_t AFRH;
-} GPIO_TypeDef;
+ volatile uint32_t BRR;
+} stm32_gpio_t;
/**
* @brief GPIO port setup info.
@@ -242,7 +258,7 @@ typedef uint32_t iomode_t;
* any assumption about it, use the provided macros when populating
* variables of this type.
*/
-typedef GPIO_TypeDef * ioportid_t;
+typedef stm32_gpio_t * ioportid_t;
/*===========================================================================*/
/* I/O Ports Identifiers. */
diff --git a/os/hal/platforms/STM32/TIMv1/stm32_tim.h b/os/hal/platforms/STM32/TIMv1/stm32_tim.h
index 1db882ebc..9c33d7b25 100644
--- a/os/hal/platforms/STM32/TIMv1/stm32_tim.h
+++ b/os/hal/platforms/STM32/TIMv1/stm32_tim.h
@@ -15,11 +15,11 @@
*/
/**
- * @file stm32_timh
+ * @file stm32_tim.h
* @brief STM32 TIM registers layout header.
* @note This file requires definitions from the ST STM32 header file.
*
- * @addtogroup STM32_TIM
+ * @addtogroup STM32_TIMv1
* @{
*/
diff --git a/os/hal/platforms/STM32/stm32.h b/os/hal/platforms/STM32/stm32.h
index 67dcd6eb2..eb8ea8140 100644
--- a/os/hal/platforms/STM32/stm32.h
+++ b/os/hal/platforms/STM32/stm32.h
@@ -42,16 +42,19 @@
#ifndef _STM32_H_
#define _STM32_H_
-#if defined(STM32F0XX)
-#include "stm32f0xx.h"
-#elif defined(STM32F10X_LD_VL) || defined(STM32F10X_MD_VL) || \
- defined(STM32F10X_HD_VL) || defined(STM32F10X_LD) || \
- defined(STM32F10X_MD) || defined(STM32F10X_HD) || \
- defined(STM32F10X_XL) || defined(STM32F10X_CL) || \
- defined(__DOXYGEN__)
+#if defined(STM32F10X_LD_VL) || defined(STM32F10X_MD_VL) || \
+ defined(STM32F10X_HD_VL) || defined(STM32F10X_LD) || \
+ defined(STM32F10X_MD) || defined(STM32F10X_HD) || \
+ defined(STM32F10X_XL) || defined(STM32F10X_CL) || \
+ defined(__DOXYGEN__)
#include "stm32f10x.h"
+#else /* !STM32F1XX_XX */
+
+#if defined(STM32F0XX)
+#include "stm32f0xx.h"
+
#elif defined(STM32F2XX)
#include "stm32f2xx.h"
@@ -71,6 +74,23 @@
#error "STM32 device not specified"
#endif
+/* Discarded definitions from the ST headers, the PAL driver uses its own
+ definitions in order to have an unified handling for all devices.
+ Unfortunately the ST headers have no uniform definitions for the same
+ objects across the various sub-families.*/
+#undef GPIOA
+#undef GPIOB
+#undef GPIOC
+#undef GPIOD
+#undef GPIOE
+#undef GPIOF
+#undef GPIOG
+#undef GPIOH
+#undef GPIOI
+
+#endif /* !STM32F1XX_XX */
+
+
/*===========================================================================*/
/* Driver constants. */
/*===========================================================================*/
diff --git a/os/hal/platforms/STM32F30x/stm32f30x.h b/os/hal/platforms/STM32F30x/stm32f30x.h
index 99c6178ee..51496cdfb 100644
--- a/os/hal/platforms/STM32F30x/stm32f30x.h
+++ b/os/hal/platforms/STM32F30x/stm32f30x.h
@@ -247,8 +247,7 @@ typedef enum IRQn
*/
#include "core_cm4.h" /* Cortex-M4 processor and core peripherals */
-/* CHIBIOS FIX */
-/*#include "system_stm32f30x.h"*/ /* STM32F30x System Header */
+#include "system_stm32f30x.h" /* STM32F30x System Header */
#include <stdint.h>
/** @addtogroup Exported_types
@@ -554,8 +553,6 @@ typedef struct
/**
* @brief General Purpose I/O
*/
-/* CHIBIOS FIX */
-#if 0
typedef struct
{
__IO uint32_t MODER; /*!< GPIO port mode register, Address offset: 0x00 */
@@ -573,7 +570,6 @@ typedef struct
__IO uint16_t BRR; /*!< GPIO bit reset register, Address offset: 0x28 */
uint16_t RESERVED3; /*!< Reserved, 0x2A */
}GPIO_TypeDef;
-#endif
/**
* @brief Operational Amplifier (OPAMP)