![]() IS_SHIFTED_BIT_MASK ( m, s ) ¶Ĭheck if bits are set continuously from the specified bit. IS_POWER_OF_TWO ( x ) ¶Ĭheck if a x is a power of two. BIT64_MASK ( n ) ¶Ħ4-bit bit mask with bits 0 through n-1 (inclusive) set, or 0 if n is 0. Set - if 0, clears bit in var any other value sets bitīit mask with bits 0 through n-1 (inclusive) set, or 0 if n is 0. The argument var is a variable whose value is written to as a side effect. Set or clear a bit depending on a boolean value. BIT64 ( _n ) ¶Ħ4-bit unsigned integer with bit position _n set. Unsigned integer with bit position n set (signed in assembly language). Timeout - Timeout to wait for in microseconds, e.g.: 1000 (1ms)ĭelay_stmt - Delay statement to perform each poll iteration e.g.: NULL, k_yield(), k_msleep(1) or k_busy_wait(1)Įxpr - As a boolean return, if false then it has timed out. Parameters :Įxpr - Truth expression upon which to poll, e.g.: XYZREG & XYZREG_EN Spin on an expression with a timeout and optional delay between iterationsĬommonly needed when waiting on hardware to complete an asynchronous request to read/write/initialize/reset, but useful for any expression. Wait for an expression to return true with a timeout. Parameters :Ģ^ceil(log2(x)) or 0 if 2^ceil(log2(x)) would saturate 64-bits KB ( x ) ¶ In C, passing a pointer as array causes a compile error. This macro can be seen as a slightly stricter version of PART_OF_ARRAY in that it also ensures that ptr is aligned to an array-element boundary of array. The results may not be particularly meaningful in this case. In C++, due to language limitations, this will accept as array any type that implements operator. This macro is available only from C, not C++. Zero if array has an array type, a compile error otherwise. ZERO_OR_COMPILE_ERROR ( cond ) ¶Ġ if cond is true-ish causes a compile error otherwise. The result should be combined with other fields using a logical OR. Prepare a bitfield element using value with mask representing its field position and width. FIELD_GET ( mask, value ) ¶Įxtract a bitfield element from value corresponding to the field mask mask. LSB_GET ( value ) ¶Įxtract the Least Significant Bit from value. GENMASK64 ( h, l ) ¶Ĭreate a contiguous 64-bit bitmask starting at bit position l and ending at position h. GENMASK ( h, l ) ¶Ĭreate a contiguous bitmask starting at bit position l and ending at position h. INT_TO_POINTER ( x ) ¶Ĭast x, a signed integer, to a void*. POINTER_TO_INT ( x ) ¶Ĭast x, a pointer, to a signed integer. ![]() UINT_TO_POINTER ( x ) ¶Ĭast x, an unsigned integer, to a void*. Cast x, a pointer, to an unsigned integer. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |