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#
Set debug level based on whether DEBUG or DEBUG_STRIPPED are defined.
Disable static assertions on compilers that don't support them.
Macros#
Friendly convenience macro pointing to the C Stdlib functions.
Generic Types Documentation#
TRUE#
#define TRUEValue:
1
An alias for one, used for clarity.
210
of file /mnt/raid/workspaces/ws.S2kiimDMR/overlay/gsdk/platform/base/hal/micro/generic/compiler/platform-common.h
FALSE#
#define FALSEValue:
0
An alias for zero, used for clarity.
215
of file /mnt/raid/workspaces/ws.S2kiimDMR/overlay/gsdk/platform/base/hal/micro/generic/compiler/platform-common.h
NULL#
#define NULLValue:
((void *)0)
The null pointer.
222
of file /mnt/raid/workspaces/ws.S2kiimDMR/overlay/gsdk/platform/base/hal/micro/generic/compiler/platform-common.h
Bit Manipulation Macros Documentation#
BIT#
#define BITValue:
(x)
Useful to reference a single bit of a byte.
235
of file /mnt/raid/workspaces/ws.S2kiimDMR/overlay/gsdk/platform/base/hal/micro/generic/compiler/platform-common.h
BIT32#
#define BIT32Value:
(x)
Useful to reference a single bit of an uint32_t type.
240
of file /mnt/raid/workspaces/ws.S2kiimDMR/overlay/gsdk/platform/base/hal/micro/generic/compiler/platform-common.h
SETBIT#
#define SETBITValue:
(reg, bit)
Sets bit
in the reg
register or byte.
Note
Assuming
reg
is an IO register, some platforms (such as the AVR) can implement this in a single atomic operation.
247
of file /mnt/raid/workspaces/ws.S2kiimDMR/overlay/gsdk/platform/base/hal/micro/generic/compiler/platform-common.h
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.
254
of file /mnt/raid/workspaces/ws.S2kiimDMR/overlay/gsdk/platform/base/hal/micro/generic/compiler/platform-common.h
CLEARBIT#
#define CLEARBITValue:
(reg, bit)
Clears a bit in the reg
register or byte.
Note
Assuming
reg
is an IO register, some platforms (such as the AVR) can implement this in a single atomic operation.
261
of file /mnt/raid/workspaces/ws.S2kiimDMR/overlay/gsdk/platform/base/hal/micro/generic/compiler/platform-common.h
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.
268
of file /mnt/raid/workspaces/ws.S2kiimDMR/overlay/gsdk/platform/base/hal/micro/generic/compiler/platform-common.h
READBIT#
#define READBITValue:
(reg, bit)
Returns the value of bit
within the register or byte reg
.
273
of file /mnt/raid/workspaces/ws.S2kiimDMR/overlay/gsdk/platform/base/hal/micro/generic/compiler/platform-common.h
READBITS#
#define READBITSValue:
(reg, bits)
Returns the value of the bitmask bits
within the register or byte reg
.
279
of file /mnt/raid/workspaces/ws.S2kiimDMR/overlay/gsdk/platform/base/hal/micro/generic/compiler/platform-common.h
Byte Manipulation Macros Documentation#
LOW_BYTE#
#define LOW_BYTEValue:
(n)
Returns the low byte of the 16-bit value n
as an uint8_t
.
293
of file /mnt/raid/workspaces/ws.S2kiimDMR/overlay/gsdk/platform/base/hal/micro/generic/compiler/platform-common.h
HIGH_BYTE#
#define HIGH_BYTEValue:
(n)
Returns the high byte of the 16-bit value n
as an uint8_t
.
298
of file /mnt/raid/workspaces/ws.S2kiimDMR/overlay/gsdk/platform/base/hal/micro/generic/compiler/platform-common.h
HIGH_LOW_TO_INT#
#define HIGH_LOW_TO_INTValue:
Returns the value built from the two uint8_t
values high
and low
.
304
of file /mnt/raid/workspaces/ws.S2kiimDMR/overlay/gsdk/platform/base/hal/micro/generic/compiler/platform-common.h
INT8U_TO_INT32U#
#define INT8U_TO_INT32UValue:
Returns the value built from the four uint8_t
as an uint32_t
.
312
of file /mnt/raid/workspaces/ws.S2kiimDMR/overlay/gsdk/platform/base/hal/micro/generic/compiler/platform-common.h
BYTE_0#
#define BYTE_0Value:
(n)
Returns the low byte of the 32-bit value n
as an uint8_t
.
322
of file /mnt/raid/workspaces/ws.S2kiimDMR/overlay/gsdk/platform/base/hal/micro/generic/compiler/platform-common.h
BYTE_1#
#define BYTE_1Value:
(n)
Returns the second byte of the 32-bit value n
as an uint8_t
.
327
of file /mnt/raid/workspaces/ws.S2kiimDMR/overlay/gsdk/platform/base/hal/micro/generic/compiler/platform-common.h
BYTE_2#
#define BYTE_2Value:
(n)
Returns the third byte of the 32-bit value n
as an uint8_t
.
332
of file /mnt/raid/workspaces/ws.S2kiimDMR/overlay/gsdk/platform/base/hal/micro/generic/compiler/platform-common.h
BYTE_3#
#define BYTE_3Value:
(n)
Returns the high byte of the 32-bit value n
as an uint8_t
.
337
of file /mnt/raid/workspaces/ws.S2kiimDMR/overlay/gsdk/platform/base/hal/micro/generic/compiler/platform-common.h
BYTE_4#
#define BYTE_4Value:
(n)
Returns the fifth byte of the 64-bit value n
as an uint8_t
.
342
of file /mnt/raid/workspaces/ws.S2kiimDMR/overlay/gsdk/platform/base/hal/micro/generic/compiler/platform-common.h
BYTE_5#
#define BYTE_5Value:
(n)
Returns the sixth byte of the 64-bit value n
as an uint8_t
.
347
of file /mnt/raid/workspaces/ws.S2kiimDMR/overlay/gsdk/platform/base/hal/micro/generic/compiler/platform-common.h
BYTE_6#
#define BYTE_6Value:
(n)
Returns the seventh byte of the 64-bit value n
as an uint8_t
.
352
of file /mnt/raid/workspaces/ws.S2kiimDMR/overlay/gsdk/platform/base/hal/micro/generic/compiler/platform-common.h
BYTE_7#
#define BYTE_7Value:
(n)
Returns the high byte of the 64-bit value n
as an uint8_t
.
357
of file /mnt/raid/workspaces/ws.S2kiimDMR/overlay/gsdk/platform/base/hal/micro/generic/compiler/platform-common.h
COUNTOF#
#define COUNTOFValue:
(a)
Returns the number of entries in an array.
362
of file /mnt/raid/workspaces/ws.S2kiimDMR/overlay/gsdk/platform/base/hal/micro/generic/compiler/platform-common.h
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.
377
of file /mnt/raid/workspaces/ws.S2kiimDMR/overlay/gsdk/platform/base/hal/micro/generic/compiler/platform-common.h
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.
384
of file /mnt/raid/workspaces/ws.S2kiimDMR/overlay/gsdk/platform/base/hal/micro/generic/compiler/platform-common.h
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.
391
of file /mnt/raid/workspaces/ws.S2kiimDMR/overlay/gsdk/platform/base/hal/micro/generic/compiler/platform-common.h
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.
398
of file /mnt/raid/workspaces/ws.S2kiimDMR/overlay/gsdk/platform/base/hal/micro/generic/compiler/platform-common.h
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.
399
of file /mnt/raid/workspaces/ws.S2kiimDMR/overlay/gsdk/platform/base/hal/micro/generic/compiler/platform-common.h
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.
400
of file /mnt/raid/workspaces/ws.S2kiimDMR/overlay/gsdk/platform/base/hal/micro/generic/compiler/platform-common.h
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.
407
of file /mnt/raid/workspaces/ws.S2kiimDMR/overlay/gsdk/platform/base/hal/micro/generic/compiler/platform-common.h
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.
408
of file /mnt/raid/workspaces/ws.S2kiimDMR/overlay/gsdk/platform/base/hal/micro/generic/compiler/platform-common.h
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.
409
of file /mnt/raid/workspaces/ws.S2kiimDMR/overlay/gsdk/platform/base/hal/micro/generic/compiler/platform-common.h
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.
416
of file /mnt/raid/workspaces/ws.S2kiimDMR/overlay/gsdk/platform/base/hal/micro/generic/compiler/platform-common.h
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.
417
of file /mnt/raid/workspaces/ws.S2kiimDMR/overlay/gsdk/platform/base/hal/micro/generic/compiler/platform-common.h
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.
418
of file /mnt/raid/workspaces/ws.S2kiimDMR/overlay/gsdk/platform/base/hal/micro/generic/compiler/platform-common.h
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.
436
of file /mnt/raid/workspaces/ws.S2kiimDMR/overlay/gsdk/platform/base/hal/micro/generic/compiler/platform-common.h
DEBUG_LEVEL#
#define DEBUG_LEVELValue:
BASIC_DEBUG
Set debug level based on whether DEBUG or DEBUG_STRIPPED are defined.
458
of file /mnt/raid/workspaces/ws.S2kiimDMR/overlay/gsdk/platform/base/hal/micro/generic/compiler/platform-common.h
STATIC_ASSERT#
#define STATIC_ASSERT
Disable static assertions on compilers that don't support them.
466
of file /mnt/raid/workspaces/ws.S2kiimDMR/overlay/gsdk/platform/base/hal/micro/generic/compiler/platform-common.h
Macro Definition Documentation#
MEMSET#
#define MEMSETValue:
(d, v, l)
Friendly convenience macro pointing to the C Stdlib functions.
188
of file /mnt/raid/workspaces/ws.S2kiimDMR/overlay/gsdk/platform/base/hal/micro/generic/compiler/platform-common.h
MEMCOPY#
#define MEMCOPYValue:
(d, s, l)
189
of file /mnt/raid/workspaces/ws.S2kiimDMR/overlay/gsdk/platform/base/hal/micro/generic/compiler/platform-common.h
MEMMOVE#
#define MEMMOVEValue:
(d, s, l)
190
of file /mnt/raid/workspaces/ws.S2kiimDMR/overlay/gsdk/platform/base/hal/micro/generic/compiler/platform-common.h
MEMPGMCOPY#
#define MEMPGMCOPYValue:
(d, s, l)
191
of file /mnt/raid/workspaces/ws.S2kiimDMR/overlay/gsdk/platform/base/hal/micro/generic/compiler/platform-common.h
MEMCOMPARE#
#define MEMCOMPAREValue:
(s0, s1, l)
192
of file /mnt/raid/workspaces/ws.S2kiimDMR/overlay/gsdk/platform/base/hal/micro/generic/compiler/platform-common.h
MEMPGMCOMPARE#
#define MEMPGMCOMPAREValue:
(s0, s1, l)
193
of file /mnt/raid/workspaces/ws.S2kiimDMR/overlay/gsdk/platform/base/hal/micro/generic/compiler/platform-common.h