cancel
Showing results for 
Search instead for 
Did you mean: 

CAN peripheral - bitbanding access

ran2399
Associate
Posted on January 02, 2010 at 14:40

CAN peripheral - bitbanding access

2 REPLIES 2
ran2399
Associate
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 II
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.