sdccutils.h File Reference

useful macros for sdcc in combination with the chipcon cc1010 by Patrik Spieß More...

Go to the source code of this file.

Defines

#define BIN(x)
 because sdcc can't handle binary constats, they must be handled by this macro.
#define bit_test(x, y)   ( x & (1<<y) )
 returns a positive value if bit y is set in byte x, 0 otherwise
#define bit_clear(x, y)   ( x&= ~(1<<y) )
 clears bit y in byte x (sets it to 0)
#define bit_set(x, y)   ( x|= (1<<y) )
 sets bit y in byte x (sets it to 1)
#define bit_zeros(x)
 returns the number of 0-bits in the byte
#define bit_ones(x)
 returns the number of 1-bits in the byte
#define boolean   bool
 defines boolean as an alias for bool


Detailed Description

useful macros for sdcc in combination with the chipcon cc1010 by Patrik Spieß

Definition in file sdccutils.h.


Define Documentation

#define BIN  ) 
 

Value:

( ((0x##x##L & 0x00000001L) ? 0x01 : 0) \ | ((0x##x##L & 0x00000010L) ? 0x02 : 0) \ | ((0x##x##L & 0x00000100L) ? 0x04 : 0) \ | ((0x##x##L & 0x00001000L) ? 0x08 : 0) \ | ((0x##x##L & 0x00010000L) ? 0x10 : 0) \ | ((0x##x##L & 0x00100000L) ? 0x20 : 0) \ | ((0x##x##L & 0x01000000L) ? 0x40 : 0) \ | ((0x##x##L & 0x10000000L) ? 0x80 : 0))
because sdcc can't handle binary constats, they must be handled by this macro.

example: byte y= BIN(11000101); Definition at line 14 of file sdccutils.h.

Referenced by RFArbitration(), RFArbitrationBit(), RFArbitrationBitDebug(), and RFSendPacket().


Generated on Fri Aug 27 10:04:04 2004 for Cheap Sensor Network by doxygen 1.3.8