2009-01-02 05:40 AM
CAN peripheral - bitbanding access
2011-05-17 04:36 AM
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! Ran2011-05-17 04:36 AM
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.