Skip to main content
ran2399
Associate
January 2, 2009
Question

CAN peripheral - bitbanding access

  • January 2, 2009
  • 2 replies
  • 826 views
Posted on January 02, 2010 at 14:40

CAN peripheral - bitbanding access

    This topic has been closed for replies.

    2 replies

    ran2399
    ran2399Author
    Associate
    May 17, 2011
    Posted on May 17, 2011 at 13:36

    Hi,

    I write a CAN driver for the STM32 (bxCAN).

    I would prefer bitband access to most bit variables

    However, I did not find any bitband definition of these bits, but only the ''old fashion'' read-modify-write kind - example:

    #define FMR_FINIT ((uint32_t)0x00000001) /* Filter init mode */

    Any idea if there exists any bitband access definition?

    Thanks, and a Happy New Year!

    Ran

    picguy
    Associate III
    May 17, 2011
    Posted on May 17, 2011 at 13:36

    See section 4.2 (Bit-banding) in

    http://infocenter.arm.com/help/topic/com.arm.doc.ddi0337g/DDI0337G_cortex_m3_r2p0_trm.pdf

    . Save it on your computer for easy access.

    All bits in the 20000000-200FFFFF range have bit band alias address. Ditto 40000000-400FFFFF. (This is an ARM Coretx-M3 feature, not something unique ST put into their STM32 product line.) The latter range includes ST’s various CAN control register addresses.

    The above has been provided to get you started. You need to do your own bit definition structs, macros, equates or whatever your software requires.