2011-04-25 02:07 AM
SRAM Bit banding
2011-05-17 05:32 AM
The bits are lined up a word at a time at 0x22000000
0x22000000 byte 0, bit 0 0x22000004 byte 0, bit 1 .. 0x22000020 byte 1, bit 0 0x22000024 byte 1, bit 1 #define RAM_BASE 0x20000000 #define RAM_BB_BASE 0x22000000 /* Private macro -------------------------------------------------------------*/ #define Var_ResetBit_BB(VarAddr, BitNumber) \ (*(vu32 *) (RAM_BB_BASE | ((VarAddr - RAM_BASE) << 5) | ((BitNumber) << 2)) = 0) #define Var_SetBit_BB(VarAddr, BitNumber) \ (*(vu32 *) (RAM_BB_BASE | ((VarAddr - RAM_BASE) << 5) | ((BitNumber) << 2)) = 1) #define Var_GetBit_BB(VarAddr, BitNumber) \ (*(vu32 *) (RAM_BB_BASE | ((VarAddr - RAM_BASE) << 5) | ((BitNumber) << 2)))