diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2011-09-19 12:04:02 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2011-09-19 12:04:02 +0000 |
commit | 22d8fa4450d5563d3ff1134a9f007b73c977ff9a (patch) | |
tree | ecc16f5994f589f72663f2a135d4ba1cad6b18a8 | |
parent | c1a1893307e154fa295f2fbf1d873e0471c0fd81 (diff) | |
download | ChibiOS-22d8fa4450d5563d3ff1134a9f007b73c977ff9a.tar.gz ChibiOS-22d8fa4450d5563d3ff1134a9f007b73c977ff9a.tar.bz2 ChibiOS-22d8fa4450d5563d3ff1134a9f007b73c977ff9a.zip |
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@3348 35acf78f-673a-0410-8e92-d51de3d6d3f4
-rw-r--r-- | os/hal/platforms/STM32/GPIOv2/pal_lld.h | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/os/hal/platforms/STM32/GPIOv2/pal_lld.h b/os/hal/platforms/STM32/GPIOv2/pal_lld.h index a73f80c7a..6c799c14c 100644 --- a/os/hal/platforms/STM32/GPIOv2/pal_lld.h +++ b/os/hal/platforms/STM32/GPIOv2/pal_lld.h @@ -135,7 +135,13 @@ typedef struct { volatile uint32_t PUPDR;
volatile uint32_t IDR;
volatile uint32_t ODR;
- volatile uint32_t BSRR;
+ volatile union {
+ uint32_t W;
+ struct {
+ uint16_t set;
+ uint16_t clear;
+ } H;
+ } BSRR;
volatile uint32_t LCKR;
volatile uint32_t AFRL;
volatile uint32_t AFRH;
@@ -369,7 +375,7 @@ typedef GPIO_TypeDef * ioportid_t; *
* @notapi
*/
-#define pal_lld_setport(port, bits) ((port)->BSRR = (uint32_t)(bits))
+#define pal_lld_setport(port, bits) ((port)->BSRR.H.set = (uint16_t)(bits))
/**
* @brief Clears a bits mask on a I/O port.
@@ -386,7 +392,7 @@ typedef GPIO_TypeDef * ioportid_t; *
* @notapi
*/
-#define pal_lld_clearport(port, bits) ((port)->BSRR = (uint32_t)(bits) << 16)
+#define pal_lld_clearport(port, bits) ((port)->BSRR.H.clear = (uint16_t)(bits))
/**
* @brief Writes a group of bits.
@@ -407,8 +413,8 @@ typedef GPIO_TypeDef * ioportid_t; * @notapi
*/
#define pal_lld_writegroup(port, mask, offset, bits) \
- ((port)->BSRR = ((~(bits) & (mask)) << (16 + (offset))) | \
- (((bits) & (mask)) << (offset)))
+ ((port)->BSRR.W = ((~(bits) & (mask)) << (16 + (offset))) | \
+ (((bits) & (mask)) << (offset)))
/**
* @brief Pads group mode setup.
|