gafsos
Full Member level 3
- Joined
- Feb 1, 2006
- Messages
- 189
- Helped
- 25
- Reputation
- 50
- Reaction score
- 11
- Trophy points
- 1,298
- Location
- North Africa
- Activity points
- 2,450
Hello
I'm working on STM32 example that shows how to use CortexM3 Bit-Band access, This is a part of the code, But it is not understandable, can you please help me it is very urgent,
thank you
#define RAM_BASE 0x20000000
#define RAM_BB_BASE 0x22000000
/* Private macro -------------------------------------------------------------*/
#define Var_ResetBit_BB(VarAddr, BitNumber) \
(*(__IO uint32_t *) (RAM_BB_BASE | ((VarAddr - RAM_BASE) << 5) | ((BitNumber) << 2)) = 0)
#define Var_SetBit_BB(VarAddr, BitNumber) \
(*(__IO uint32_t *) (RAM_BB_BASE | ((VarAddr - RAM_BASE) << 5) | ((BitNumber) << 2)) = 1)
#define Var_GetBit_BB(VarAddr, BitNumber) \
(*(__IO uint32_t *) (RAM_BB_BASE | ((VarAddr - RAM_BASE) << 5) | ((BitNumber) << 2)))
I'm working on STM32 example that shows how to use CortexM3 Bit-Band access, This is a part of the code, But it is not understandable, can you please help me it is very urgent,
thank you
#define RAM_BASE 0x20000000
#define RAM_BB_BASE 0x22000000
/* Private macro -------------------------------------------------------------*/
#define Var_ResetBit_BB(VarAddr, BitNumber) \
(*(__IO uint32_t *) (RAM_BB_BASE | ((VarAddr - RAM_BASE) << 5) | ((BitNumber) << 2)) = 0)
#define Var_SetBit_BB(VarAddr, BitNumber) \
(*(__IO uint32_t *) (RAM_BB_BASE | ((VarAddr - RAM_BASE) << 5) | ((BitNumber) << 2)) = 1)
#define Var_GetBit_BB(VarAddr, BitNumber) \
(*(__IO uint32_t *) (RAM_BB_BASE | ((VarAddr - RAM_BASE) << 5) | ((BitNumber) << 2)))