Contiki 3.x
|
See platform_common for detailed documentation. More...
Go to the source code of this file.
Macros | |
Generic Types | |
#define | TRUE 1 |
An alias for one, used for clarity. | |
#define | FALSE 0 |
An alias for zero, used for clarity. | |
#define | NULL ((void *)0) |
The null pointer. | |
Bit Manipulation Macros | |
#define | BIT(x) (1U << (x)) |
Useful to reference a single bit of a byte. | |
#define | BIT32(x) (((uint32_t) 1) << (x)) |
Useful to reference a single bit of an uint32_t type. | |
#define | SETBIT(reg, bit) reg |= BIT(bit) |
Sets bit in the reg register or byte. More... | |
#define | SETBITS(reg, bits) reg |= (bits) |
Sets the bits in the reg register or the byte as specified in the bitmask bits . More... | |
#define | CLEARBIT(reg, bit) reg &= ~(BIT(bit)) |
Clears a bit in the reg register or byte. More... | |
#define | CLEARBITS(reg, bits) reg &= ~(bits) |
Clears the bits in the reg register or byte as specified in the bitmask bits . More... | |
#define | READBIT(reg, bit) (reg & (BIT(bit))) |
Returns the value of bit within the register or byte reg . | |
#define | READBITS(reg, bits) (reg & (bits)) |
Returns the value of the bitmask bits within the register or byte reg . | |
Byte Manipulation Macros | |
#define | LOW_BYTE(n) ((uint8_t)((n) & 0xFF)) |
Returns the low byte of the 16-bit value n as an uint8_t . | |
#define | HIGH_BYTE(n) ((uint8_t)(LOW_BYTE((n) >> 8))) |
Returns the high byte of the 16-bit value n as an uint8_t . | |
#define | HIGH_LOW_TO_INT(high, low) |
Returns the value built from the two uint8_t values high and low . | |
#define | BYTE_0(n) ((uint8_t)((n) & 0xFF)) |
Returns the low byte of the 32-bit value n as an uint8_t . | |
#define | BYTE_1(n) ((uint8_t)(BYTE_0((n) >> 8))) |
Returns the second byte of the 32-bit value n as an uint8_t . | |
#define | BYTE_2(n) ((uint8_t)(BYTE_0((n) >> 16))) |
Returns the third byte of the 32-bit value n as an uint8_t . | |
#define | BYTE_3(n) ((uint8_t)(BYTE_0((n) >> 24))) |
Returns the high byte of the 32-bit value n as an uint8_t . | |
Time Manipulation Macros | |
#define | elapsedTimeInt8u(oldTime, newTime) ((uint8_t) ((uint8_t)(newTime) - (uint8_t)(oldTime))) |
Returns the elapsed time between two 8 bit values. More... | |
#define | elapsedTimeInt16u(oldTime, newTime) ((uint16_t) ((uint16_t)(newTime) - (uint16_t)(oldTime))) |
Returns the elapsed time between two 16 bit values. More... | |
#define | elapsedTimeInt32u(oldTime, newTime) ((uint32_t) ((uint32_t)(newTime) - (uint32_t)(oldTime))) |
Returns the elapsed time between two 32 bit values. More... | |
#define | MAX_INT8U_VALUE 0xFF |
Returns TRUE if t1 is greater than t2. More... | |
#define | timeGTorEqualInt8u(t1, t2) (elapsedTimeInt8u(t2, t1) <= ((MAX_INT8U_VALUE + 1) / 2)) |
#define | MAX_INT16U_VALUE 0xFFFF |
Returns TRUE if t1 is greater than t2. More... | |
#define | timeGTorEqualInt16u(t1, t2) (elapsedTimeInt16u(t2, t1) <= ((MAX_INT16U_VALUE + 1) / 2)) |
#define | MAX_INT32U_VALUE 0xFFFFFFFF |
Returns TRUE if t1 is greater than t2. More... | |
#define | timeGTorEqualInt32u(t1, t2) (elapsedTimeInt32u(t2, t1) <= ((MAX_INT32U_VALUE + 1) / 2)) |
See platform_common for detailed documentation.
Definition in file platform-common.h.