swc_utils.h
SPARK Wireless Core Utilities.
- Copyright
Copyright (C) 2026 SPARK Microsystems International Inc. All rights reserved.
- License
This source code is proprietary and subject to the SPARK Microsystems Software EULA found in this package in file EULA.txt.
- Author
SPARK FW Team.
Defines
-
SWC_ARRAY_SIZE(a) (sizeof(a) / sizeof(*(a)))
Get the number of elements in an array of any types.
-
SWC_CONCAT_8B_TO_16B(MSB, LSB) ((MSB) << 8 | (LSB))
Concatenate two 8-bit values into a single 16-bit value.
-
SWC_EXTRACT_BYTE(value, byte_position) (((value) >> (8 * (byte_position))) & 0x00ff)
Extract the nth (0 = 1st, 1 = 2nd,..) byte from an int value. byte_postion is byte position to be extracted. value is the int value where an specific byte will be extracted.
-
SWC_BIT(n) (1 << (n))
Single bit mask.
-
SWC_BIT_AUTO_REPLY_TIMESLOT SWC_BIT(7)
Bit mask to identify Auto reply timeslot (auto reply timeslot).
-
SWC_MAIN_TIMESLOT(x) ((x) & 0x7F)
User MACRO to identify primary timeslot.
-
SWC_AUTO_TIMESLOT(x) ((x) | SWC_BIT_AUTO_REPLY_TIMESLOT)
User MACRO to identify data in auto-reply timeslot (auto reply timeslot).