git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@3348 35acf78f-673a-0410-8e92-d51de3d6d3f4
parent
c1a1893307
commit
22d8fa4450
|
@ -135,7 +135,13 @@ typedef struct {
|
||||||
volatile uint32_t PUPDR;
|
volatile uint32_t PUPDR;
|
||||||
volatile uint32_t IDR;
|
volatile uint32_t IDR;
|
||||||
volatile uint32_t ODR;
|
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 LCKR;
|
||||||
volatile uint32_t AFRL;
|
volatile uint32_t AFRL;
|
||||||
volatile uint32_t AFRH;
|
volatile uint32_t AFRH;
|
||||||
|
@ -369,7 +375,7 @@ typedef GPIO_TypeDef * ioportid_t;
|
||||||
*
|
*
|
||||||
* @notapi
|
* @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.
|
* @brief Clears a bits mask on a I/O port.
|
||||||
|
@ -386,7 +392,7 @@ typedef GPIO_TypeDef * ioportid_t;
|
||||||
*
|
*
|
||||||
* @notapi
|
* @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.
|
* @brief Writes a group of bits.
|
||||||
|
@ -407,7 +413,7 @@ typedef GPIO_TypeDef * ioportid_t;
|
||||||
* @notapi
|
* @notapi
|
||||||
*/
|
*/
|
||||||
#define pal_lld_writegroup(port, mask, offset, bits) \
|
#define pal_lld_writegroup(port, mask, offset, bits) \
|
||||||
((port)->BSRR = ((~(bits) & (mask)) << (16 + (offset))) | \
|
((port)->BSRR.W = ((~(bits) & (mask)) << (16 + (offset))) | \
|
||||||
(((bits) & (mask)) << (offset)))
|
(((bits) & (mask)) << (offset)))
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue