Skip to main content
greg_t
Associate III
April 25, 2011
Question

SRAM Bit banding

Posted on April 25, 2011 at 11:07

SRAM Bit banding

    This topic has been closed for replies.

    1 reply

    Tesla DeLorean
    Guru
    May 17, 2011
    Posted on May 17, 2011 at 14:32

    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)))

    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..