OS  v7.3.3
Documentation
General purpose macros

General purpose Function-like Macros. More...

Collaboration diagram for General purpose macros:

Macros

#define qFLM_BitsSet(dst, xBits)
 Uses the bitwise OR operator to set bits into dst. More...
 
#define qFLM_BitsClear(dst, xBits)
 Uses the bitwise AND operator to clear bits into dst. More...
 
#define qFLM_BitSet(dst, xBit, xType)
 Uses the bitwise OR operator to set a single bit into dst. More...
 
#define qFLM_BitClear(dst, xBit, xType)
 Uses the bitwise AND operator to clear a single bit into dst. More...
 
#define qFLM_BitRead(dst, xBit)
 Uses the bitwise AND operator to read the value of a single bit from dst. More...
 
#define qFLM_BitToggle(dst, xBit)
 Uses the bitwise XOR operator to toggle the value of a single bit from dst. More...
 
#define qFLM_BitWrite(dst, xBit, xVal)
 Write the bVal in a single bit of the dst variable. More...
 
#define qFLM_BitMakeByte(b7, b6, b5, b4, b3, b2, b1, b0)
 Build a byte value from independent bits. More...
 
#define qFLM_ByteHighNibble(dst)
 Read the high-nibble from dst. More...
 
#define qFLM_ByteLowNibble(dst)
 Read the low-nibble from dst. More...
 
#define qFLM_ByteMergeNibbles(H, L)
 Merges two nibbles to form one byte. More...
 
#define qFLM_WordHighByte(dst)
 Read the high-byte from dst assuming it as a Word. More...
 
#define qFLM_WordLowByte(dst)
 Read the low-byte from dst assuming it as a Word. More...
 
#define qFLM_WordMergeBytes(H, L)
 Merges two bytes to form one Word. More...
 
#define qFLM_DWordHighWord(dst)
 Read the high-word from dst assuming it as a DWord. More...
 
#define qFLM_DWordLowWord(dst)
 Read the low-word from dst assuming it as a DWord. More...
 
#define qFLM_DWordMergeWords(H, L)
 Merges two words to form one DWord. More...
 
#define qFLM_Clip(X, Min, Max)
 Ensures that X is between the limits set by Min and Max. More...
 
#define qFLM_ClipUpper(X, Max)
 Ensures that X is bellow the limits set by Max. More...
 
#define qFLM_ClipLower(X, Min)
 Ensures that X is above the value set by Min. More...
 
#define qFLM_IsBetween(X, Low, High)
 Check if the value of X is within the limits defined by Low and High. More...
 
#define qFLM_Min(a, b)
 Calculates the minimum of a and b. More...
 
#define qFLM_Max(a, b)
 Calculates the maximum of a and b. More...
 
#define qFLM_ArraySize(x)
 Returns the number of elements in an array x. More...
 

Detailed Description

General purpose Function-like Macros.

Macro Definition Documentation

◆ qFLM_ArraySize

#define qFLM_ArraySize (   x)

Returns the number of elements in an array x.

Parameters
[in]xThe input array
Returns
The number of elements in x.

◆ qFLM_BitClear

#define qFLM_BitClear (   dst,
  xBit,
  xType 
)

Uses the bitwise AND operator to clear a single bit into dst.

Parameters
[in]dstThe variable where the operation will be applied
[in]xBitThe bit-index
[in]xTypeData-type
Returns
none.

◆ qFLM_BitMakeByte

#define qFLM_BitMakeByte (   b7,
  b6,
  b5,
  b4,
  b3,
  b2,
  b1,
  b0 
)

Build a byte value from independent bits.

Parameters
[in]b7...b0
Returns
The value of the byte formed

◆ qFLM_BitRead

#define qFLM_BitRead (   dst,
  xBit 
)

Uses the bitwise AND operator to read the value of a single bit from dst.

Parameters
[in]dstThe variable where the operation will be applied
[in]xBitThe bit-index
Returns
The value of the requested bit.

◆ qFLM_BitsClear

#define qFLM_BitsClear (   dst,
  xBits 
)

Uses the bitwise AND operator to clear bits into dst.

Parameters
[in]dstThe variable where the operation will be applied
[in]xBitsIndicates which bits are to be cleared
Returns
none.

◆ qFLM_BitSet

#define qFLM_BitSet (   dst,
  xBit,
  xType 
)

Uses the bitwise OR operator to set a single bit into dst.

Parameters
[in]dstThe variable where the operation will be applied
[in]xBitThe bit-index
[in]xTypeData-type
Returns
none.

◆ qFLM_BitsSet

#define qFLM_BitsSet (   dst,
  xBits 
)

Uses the bitwise OR operator to set bits into dst.

Parameters
[in]dstThe variable where the operation will be applied
[in]xBitsIndicates which bits are to be set
Returns
none.

◆ qFLM_BitToggle

#define qFLM_BitToggle (   dst,
  xBit 
)

Uses the bitwise XOR operator to toggle the value of a single bit from dst.

Parameters
[in]dstThe variable where the operation will be applied
[in]xBitThe bit-index
Returns
none.

◆ qFLM_BitWrite

#define qFLM_BitWrite (   dst,
  xBit,
  xVal 
)

Write the bVal in a single bit of the dst variable.

Parameters
[in]dstThe variable where the operation will be applied
[in]xBitThe bit-index
[in]xValThe boolean value to write
Returns
none.

◆ qFLM_ByteHighNibble

#define qFLM_ByteHighNibble (   dst)

Read the high-nibble from dst.

Parameters
[in]dstThe variable where the operation will be applied
Returns
The value of the high nibble

◆ qFLM_ByteLowNibble

#define qFLM_ByteLowNibble (   dst)

Read the low-nibble from dst.

Parameters
[in]dstThe variable where the operation will be applied
Returns
The value of the low nibble

◆ qFLM_ByteMergeNibbles

#define qFLM_ByteMergeNibbles (   H,
 
)

Merges two nibbles to form one byte.

Parameters
[in]HThe high nibble
[in]LThe low nibble
Returns
The value of the resulting byte

◆ qFLM_Clip

#define qFLM_Clip (   X,
  Min,
  Max 
)

Ensures that X is between the limits set by Min and Max.

Note
If Min is greater than Max the result is undefined.
Parameters
[in]XThe value to clamp
[in]MinThe minimum value allowed.
[in]MaxThe maximum value allowed.
Returns
The value of X clamped to the range between Min and Max.

◆ qFLM_ClipLower

#define qFLM_ClipLower (   X,
  Min 
)

Ensures that X is above the value set by Min.

Parameters
[in]XThe value to clamp
[in]MinThe minimum value allowed.
Returns
The value of X clamped to the value of Min.

◆ qFLM_ClipUpper

#define qFLM_ClipUpper (   X,
  Max 
)

Ensures that X is bellow the limits set by Max.

Parameters
[in]XThe value to clamp
[in]MaxThe maximum value allowed.
Returns
The value of X clamped to the value of Max.

◆ qFLM_DWordHighWord

#define qFLM_DWordHighWord (   dst)

Read the high-word from dst assuming it as a DWord.

Parameters
[in]dstThe variable where the operation will be applied
Returns
The value of the high word

◆ qFLM_DWordLowWord

#define qFLM_DWordLowWord (   dst)

Read the low-word from dst assuming it as a DWord.

Parameters
[in]dstThe variable where the operation will be applied
Returns
The value of the low word

◆ qFLM_DWordMergeWords

#define qFLM_DWordMergeWords (   H,
 
)

Merges two words to form one DWord.

Parameters
[in]HThe high word
[in]LThe low word
Returns
The value of the resulting DWord

◆ qFLM_IsBetween

#define qFLM_IsBetween (   X,
  Low,
  High 
)

Check if the value of X is within the limits defined by Low and High.

Parameters
[in]XThe value to check
[in]LowThe minimum value allowed.
[in]HighThe maximum value allowed.
Returns
True if the X is between the defined range. Otherwise returns false.

◆ qFLM_Max

#define qFLM_Max (   a,
 
)

Calculates the maximum of a and b.

Parameters
[in]aA numeric value
[in]bA numeric value
Returns
The maximum of a and b.

◆ qFLM_Min

#define qFLM_Min (   a,
 
)

Calculates the minimum of a and b.

Parameters
[in]aA numeric value
[in]bA numeric value
Returns
The minimum of a and b.

◆ qFLM_WordHighByte

#define qFLM_WordHighByte (   dst)

Read the high-byte from dst assuming it as a Word.

Parameters
[in]dstThe variable where the operation will be applied
Returns
The value of the high byte

◆ qFLM_WordLowByte

#define qFLM_WordLowByte (   dst)

Read the low-byte from dst assuming it as a Word.

Parameters
[in]dstThe variable where the operation will be applied
Returns
The value of the low byte

◆ qFLM_WordMergeBytes

#define qFLM_WordMergeBytes (   H,
 
)

Merges two bytes to form one Word.

Parameters
[in]HThe high byte
[in]LThe low byte
Returns
The value of the resulting word