Common PLATFORM_HEADER Configuration#
Compiler and Platform specific definitions and typedefs common to all platforms.
platform-common.h provides PLATFORM_HEADER defaults and common definitions. This head should never be included directly, it should only be included by the specific PLATFORM_HEADER used by your platform.
See platform-common.h for source code.
Generic Types#
An alias for one, used for clarity.
An alias for zero, used for clarity.
The null pointer.
Bit Manipulation Macros#
Useful to reference a single bit of a byte.
Useful to reference a single bit of an uint32_t type.
Sets bit in the reg register or byte.
Sets the bits in the reg register or the byte as specified in the bitmask bits.
Clears a bit in the reg register or byte.
Clears the bits in the reg register or byte as specified in the bitmask bits.
Returns the value of bit within the register or byte reg.
Returns the value of the bitmask bits within the register or byte reg.
Byte Manipulation Macros#
Returns the low byte of the 16-bit value n as an uint8_t.
Returns the high byte of the 16-bit value n as an uint8_t.
Returns the value built from the two uint8_t values high and low.
Returns the value built from the four uint8_t as an uint32_t.
Returns the low byte of the 32-bit value n as an uint8_t.
Returns the second byte of the 32-bit value n as an uint8_t.
Returns the third byte of the 32-bit value n as an uint8_t.
Returns the high byte of the 32-bit value n as an uint8_t.
Returns the fifth byte of the 64-bit value n as an uint8_t.
Returns the sixth byte of the 64-bit value n as an uint8_t.
Returns the seventh byte of the 64-bit value n as an uint8_t.
Returns the high byte of the 64-bit value n as an uint8_t.
Returns the number of entries in an array.
Time Manipulation Macros#
Returns the elapsed time between two 8 bit values. Result may not be valid if the time samples differ by more than 127.
Returns the elapsed time between two 16 bit values. Result may not be valid if the time samples differ by more than 32767.
Returns the elapsed time between two 32 bit values. Result may not be valid if the time samples differ by more than 2147483647.
Returns true if t1 is greater than t2. Can only account for 1 wrap around of the variable before it is wrong.
Returns the elapsed time between two 8 bit values. Result may not be valid if the time samples differ by more than 127.
Returns the elapsed time between two 8 bit values. Result may not be valid if the time samples differ by more than 127.
Returns true if t1 is greater than t2. Can only account for 1 wrap around of the variable before it is wrong.
Returns the elapsed time between two 8 bit values. Result may not be valid if the time samples differ by more than 127.
Returns the elapsed time between two 8 bit values. Result may not be valid if the time samples differ by more than 127.
Returns true if t1 is greater than t2. Can only account for 1 wrap around of the variable before it is wrong.
Returns the elapsed time between two 8 bit values. Result may not be valid if the time samples differ by more than 127.
Returns the elapsed time between two 8 bit values. Result may not be valid if the time samples differ by more than 127.
Miscellaneous Macros#
Description:\n Useful macro for avoiding compiler warnings related to unused
function arguments or unused variables.
Set debug level based on whether DEBUG or DEBUG_STRIPPED are defined.
Disable static assertions on compilers that don't support them.
Generic Types Documentation#
Bit Manipulation Macros Documentation#
SETBIT#
#define SETBITValue:
(reg, bit)
Sets bit in the reg register or byte.
Note
Assuming
regis an IO register, some platforms (such as the AVR) can implement this in a single atomic operation.
SETBITS#
#define SETBITSValue:
(reg, bits)
Sets the bits in the reg register or the byte as specified in the bitmask bits.
Note
This is never a single atomic operation.
CLEARBIT#
#define CLEARBITValue:
(reg, bit)
Clears a bit in the reg register or byte.
Note
Assuming
regis an IO register, some platforms (such as the AVR) can implement this in a single atomic operation.
CLEARBITS#
#define CLEARBITSValue:
(reg, bits)
Clears the bits in the reg register or byte as specified in the bitmask bits.
Note
This is never a single atomic operation.
READBITS#
#define READBITSValue:
(reg, bits)
Returns the value of the bitmask bits within the register or byte reg.
Byte Manipulation Macros Documentation#
HIGH_LOW_TO_INT#
#define HIGH_LOW_TO_INTValue:
Returns the value built from the two uint8_t values high and low.
INT8U_TO_INT32U#
#define INT8U_TO_INT32UValue:
Returns the value built from the four uint8_t as an uint32_t.
Time Manipulation Macros Documentation#
elapsedTimeInt8u#
#define elapsedTimeInt8uValue:
(oldTime, newTime)
Returns the elapsed time between two 8 bit values. Result may not be valid if the time samples differ by more than 127.
elapsedTimeInt16u#
#define elapsedTimeInt16uValue:
(oldTime, newTime)
Returns the elapsed time between two 16 bit values. Result may not be valid if the time samples differ by more than 32767.
elapsedTimeInt32u#
#define elapsedTimeInt32uValue:
(oldTime, newTime)
Returns the elapsed time between two 32 bit values. Result may not be valid if the time samples differ by more than 2147483647.
MAX_INT8U_VALUE#
#define MAX_INT8U_VALUEValue:
(0xFF)
Returns true if t1 is greater than t2. Can only account for 1 wrap around of the variable before it is wrong.
HALF_MAX_INT8U_VALUE#
#define HALF_MAX_INT8U_VALUEValue:
(0x80)
Returns the elapsed time between two 8 bit values. Result may not be valid if the time samples differ by more than 127.
timeGTorEqualInt8u#
#define timeGTorEqualInt8uValue:
(t1, t2)
Returns the elapsed time between two 8 bit values. Result may not be valid if the time samples differ by more than 127.
MAX_INT16U_VALUE#
#define MAX_INT16U_VALUEValue:
(0xFFFF)
Returns true if t1 is greater than t2. Can only account for 1 wrap around of the variable before it is wrong.
HALF_MAX_INT16U_VALUE#
#define HALF_MAX_INT16U_VALUEValue:
(0x8000)
Returns the elapsed time between two 8 bit values. Result may not be valid if the time samples differ by more than 127.
timeGTorEqualInt16u#
#define timeGTorEqualInt16uValue:
(t1, t2)
Returns the elapsed time between two 8 bit values. Result may not be valid if the time samples differ by more than 127.
MAX_INT32U_VALUE#
#define MAX_INT32U_VALUEValue:
(0xFFFFFFFFUL)
Returns true if t1 is greater than t2. Can only account for 1 wrap around of the variable before it is wrong.
HALF_MAX_INT32U_VALUE#
#define HALF_MAX_INT32U_VALUEValue:
(0x80000000UL)
Returns the elapsed time between two 8 bit values. Result may not be valid if the time samples differ by more than 127.
timeGTorEqualInt32u#
#define timeGTorEqualInt32uValue:
(t1, t2)
Returns the elapsed time between two 8 bit values. Result may not be valid if the time samples differ by more than 127.
Miscellaneous Macros Documentation#
UNUSED_VAR#
#define UNUSED_VARValue:
(x)
Description:\n Useful macro for avoiding compiler warnings related to unused
function arguments or unused variables.
DEBUG_LEVEL#
#define DEBUG_LEVELValue:
BASIC_DEBUG
Set debug level based on whether DEBUG or DEBUG_STRIPPED are defined.