bits.h 336 B

1234567891011121314
  1. #ifndef _ARM_BITS_H
  2. #define _ARM_BITS_H
  3. /* The classic macro */
  4. #define BV(x) (1<<(x))
  5. /* CM3 bit-band access macro - no error checks! */
  6. #define BITBAND(addr,bit) \
  7. (*((volatile unsigned long *)( \
  8. ((unsigned long)&(addr) & 0x01ffffff)*32 + \
  9. (bit)*4 + 0x02000000 + ((unsigned long)&(addr) & 0xfe000000) \
  10. )))
  11. #endif