Compiler and Platform specific definitions and typedefs common to all platforms. More...

Macros

#define MEMSET(d, v, l)
 Friendly convenience macro pointing to the C Stdlib functions. More...
 
#define MEMCOPY(d, s, l)
 
#define MEMMOVE(d, s, l)
 
#define MEMPGMCOPY(d, s, l)
 
#define MEMCOMPARE(s0, s1, l)
 
#define MEMPGMCOMPARE(s0, s1, l)
 

Generic Types

#define TRUE
 An alias for one, used for clarity. More...
 
#define FALSE
 An alias for zero, used for clarity. More...
 
#define NULL
 The null pointer. More...
 

Bit Manipulation Macros

#define BIT(x)
 Useful to reference a single bit of a byte. More...
 
#define BIT32(x)
 Useful to reference a single bit of an uint32_t type. More...
 
#define SETBIT(reg, bit)
 Sets bit in the reg register or byte. More...
 
#define SETBITS(reg, bits)
 Sets the bits in the reg register or the byte as specified in the bitmask bits. More...
 
#define CLEARBIT(reg, bit)
 Clears a bit in the reg register or byte. More...
 
#define CLEARBITS(reg, bits)
 Clears the bits in the reg register or byte as specified in the bitmask bits. More...
 
#define READBIT(reg, bit)
 Returns the value of bit within the register or byte reg. More...
 
#define READBITS(reg, bits)
 Returns the value of the bitmask bits within the register or byte reg. More...
 

Byte Manipulation Macros

#define LOW_BYTE(n)
 Returns the low byte of the 16-bit value n as an uint8_t. More...
 
#define HIGH_BYTE(n)
 Returns the high byte of the 16-bit value n as an uint8_t. More...
 
#define HIGH_LOW_TO_INT(high, low)
 Returns the value built from the two uint8_t values high and low. More...
 
#define INT8U_TO_INT32U(byte3, byte2, byte1, byte0)
 Returns the value built from the four uint8_t as an uint32_t. More...
 
#define BYTE_0(n)
 Returns the low byte of the 32-bit value n as an uint8_t. More...
 
#define BYTE_1(n)
 Returns the second byte of the 32-bit value n as an uint8_t. More...
 
#define BYTE_2(n)
 Returns the third byte of the 32-bit value n as an uint8_t. More...
 
#define BYTE_3(n)
 Returns the high byte of the 32-bit value n as an uint8_t. More...
 
#define BYTE_4(n)
 Returns the fifth byte of the 64-bit value n as an uint8_t. More...
 
#define BYTE_5(n)
 Returns the sixth byte of the 64-bit value n as an uint8_t. More...
 
#define BYTE_6(n)
 Returns the seventh byte of the 64-bit value n as an uint8_t. More...
 
#define BYTE_7(n)
 Returns the high byte of the 64-bit value n as an uint8_t. More...
 
#define COUNTOF(a)
 Returns the number of entries in an array. More...
 

Time Manipulation Macros

#define elapsedTimeInt8u(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. More...
 
#define elapsedTimeInt16u(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. More...
 
#define elapsedTimeInt32u(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. More...
 
#define MAX_INT8U_VALUE
 Returns true if t1 is greater than t2. Can only account for 1 wrap around of the variable before it is wrong. More...
 
#define HALF_MAX_INT8U_VALUE
 Returns the elapsed time between two 8 bit values. Result may not be valid if the time samples differ by more than 127. More...
 
#define timeGTorEqualInt8u(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. More...
 
#define MAX_INT16U_VALUE
 Returns true if t1 is greater than t2. Can only account for 1 wrap around of the variable before it is wrong. More...
 
#define HALF_MAX_INT16U_VALUE
 Returns the elapsed time between two 8 bit values. Result may not be valid if the time samples differ by more than 127. More...
 
#define timeGTorEqualInt16u(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. More...
 
#define MAX_INT32U_VALUE
 Returns true if t1 is greater than t2. Can only account for 1 wrap around of the variable before it is wrong. More...
 
#define HALF_MAX_INT32U_VALUE
 Returns the elapsed time between two 8 bit values. Result may not be valid if the time samples differ by more than 127. More...
 
#define timeGTorEqualInt32u(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. More...
 

Miscellaneous Macros

#define UNUSED_VAR(x)
 
#define DEBUG_LEVEL
 Set debug level based on whether DEBUG or DEBUG_STRIPPED are defined. More...
 
#define STATIC_ASSERT(__condition, __errorstr)
 Disable static assertions on compilers that don't support them. More...
 

Detailed Description

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.

Macro Definition Documentation

#define BIT (   x)

Useful to reference a single bit of a byte.

Definition at line 234 of file platform-common.h.

#define BIT32 (   x)

Useful to reference a single bit of an uint32_t type.

Definition at line 239 of file platform-common.h.

#define BYTE_0 (   n)

Returns the low byte of the 32-bit value n as an uint8_t.

Definition at line 321 of file platform-common.h.

#define BYTE_1 (   n)

Returns the second byte of the 32-bit value n as an uint8_t.

Definition at line 326 of file platform-common.h.

#define BYTE_2 (   n)

Returns the third byte of the 32-bit value n as an uint8_t.

Definition at line 331 of file platform-common.h.

#define BYTE_3 (   n)

Returns the high byte of the 32-bit value n as an uint8_t.

Definition at line 336 of file platform-common.h.

#define BYTE_4 (   n)

Returns the fifth byte of the 64-bit value n as an uint8_t.

Definition at line 341 of file platform-common.h.

#define BYTE_5 (   n)

Returns the sixth byte of the 64-bit value n as an uint8_t.

Definition at line 346 of file platform-common.h.

#define BYTE_6 (   n)

Returns the seventh byte of the 64-bit value n as an uint8_t.

Definition at line 351 of file platform-common.h.

#define BYTE_7 (   n)

Returns the high byte of the 64-bit value n as an uint8_t.

Definition at line 356 of file platform-common.h.

#define CLEARBIT (   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.

Definition at line 260 of file platform-common.h.

#define CLEARBITS (   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.

Definition at line 267 of file platform-common.h.

#define COUNTOF (   a)

Returns the number of entries in an array.

Definition at line 361 of file platform-common.h.

#define DEBUG_LEVEL

Set debug level based on whether DEBUG or DEBUG_STRIPPED are defined.

Definition at line 457 of file platform-common.h.

#define elapsedTimeInt16u (   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.

Definition at line 383 of file platform-common.h.

#define elapsedTimeInt32u (   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.

Definition at line 390 of file platform-common.h.

#define elapsedTimeInt8u (   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.

Definition at line 376 of file platform-common.h.

#define FALSE

An alias for zero, used for clarity.

Definition at line 214 of file platform-common.h.

#define HALF_MAX_INT16U_VALUE

Returns the elapsed time between two 8 bit values. Result may not be valid if the time samples differ by more than 127.

Definition at line 407 of file platform-common.h.

#define HALF_MAX_INT32U_VALUE

Returns the elapsed time between two 8 bit values. Result may not be valid if the time samples differ by more than 127.

Definition at line 416 of file platform-common.h.

#define HALF_MAX_INT8U_VALUE

Returns the elapsed time between two 8 bit values. Result may not be valid if the time samples differ by more than 127.

Definition at line 398 of file platform-common.h.

#define HIGH_BYTE (   n)

Returns the high byte of the 16-bit value n as an uint8_t.

Definition at line 297 of file platform-common.h.

#define HIGH_LOW_TO_INT (   high,
  low 
)

Returns the value built from the two uint8_t values high and low.

Definition at line 303 of file platform-common.h.

#define INT8U_TO_INT32U (   byte3,
  byte2,
  byte1,
  byte0 
)

Returns the value built from the four uint8_t as an uint32_t.

Definition at line 311 of file platform-common.h.

#define LOW_BYTE (   n)

Returns the low byte of the 16-bit value n as an uint8_t.

Definition at line 292 of file platform-common.h.

#define MAX_INT16U_VALUE

Returns true if t1 is greater than t2. Can only account for 1 wrap around of the variable before it is wrong.

Definition at line 406 of file platform-common.h.

#define MAX_INT32U_VALUE

Returns true if t1 is greater than t2. Can only account for 1 wrap around of the variable before it is wrong.

Definition at line 415 of file platform-common.h.

#define MAX_INT8U_VALUE

Returns true if t1 is greater than t2. Can only account for 1 wrap around of the variable before it is wrong.

Definition at line 397 of file platform-common.h.

#define MEMCOMPARE (   s0,
  s1,
 
)

Definition at line 191 of file platform-common.h.

#define MEMCOPY (   d,
  s,
 
)

Definition at line 188 of file platform-common.h.

#define MEMMOVE (   d,
  s,
 
)

Definition at line 189 of file platform-common.h.

#define MEMPGMCOMPARE (   s0,
  s1,
 
)

Definition at line 192 of file platform-common.h.

#define MEMPGMCOPY (   d,
  s,
 
)

Definition at line 190 of file platform-common.h.

#define MEMSET (   d,
  v,
 
)

Friendly convenience macro pointing to the C Stdlib functions.

Definition at line 187 of file platform-common.h.

#define NULL

The null pointer.

Definition at line 221 of file platform-common.h.

#define READBIT (   reg,
  bit 
)

Returns the value of bit within the register or byte reg.

Definition at line 272 of file platform-common.h.

#define READBITS (   reg,
  bits 
)

Returns the value of the bitmask bits within the register or byte reg.

Definition at line 278 of file platform-common.h.

#define SETBIT (   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.

Definition at line 246 of file platform-common.h.

#define SETBITS (   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.

Definition at line 253 of file platform-common.h.

#define STATIC_ASSERT (   __condition,
  __errorstr 
)

Disable static assertions on compilers that don't support them.

Definition at line 465 of file platform-common.h.

#define timeGTorEqualInt16u (   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.

Definition at line 408 of file platform-common.h.

#define timeGTorEqualInt32u (   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.

Definition at line 417 of file platform-common.h.

#define timeGTorEqualInt8u (   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.

Definition at line 399 of file platform-common.h.

#define TRUE

An alias for one, used for clarity.

Definition at line 209 of file platform-common.h.

#define UNUSED_VAR (   x)
Description:
Useful macro for avoiding compiler warnings related to unused function arguments or unused variables.

Definition at line 435 of file platform-common.h.