Trident IoT Z-Wave SDK
 
Loading...
Searching...
No Matches
ZW_typedefs.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Silicon Laboratories Inc. <https://www.silabs.com/>
2//
3// SPDX-License-Identifier: BSD-3-Clause
4
9#ifndef _ZW_TYPEDEFS_H_
10#define _ZW_TYPEDEFS_H_
11
12#include <stdint.h>
13#include <stdbool.h>
14#include <stddef.h>
15
23#ifndef ZW_WEAK
24#define ZW_WEAK __attribute__((weak))
25#endif
26
27#ifndef EOF
28#define EOF (-1)
29#endif
30
31#ifndef NULL
32#define NULL ((void*)0)
33#endif
34
39#ifdef EFR32ZG
40#define NO_RETURN __attribute__((noreturn))
41#else
42#define NO_RETURN
43#endif
44
46#define VOID_CALLBACKFUNC(completedFunc) void (*completedFunc)
47
49#define IS_NULL(x) (NULL == x)
50#define NON_NULL(x) (NULL != x)
51
52/* Gecko chips are little endian:
53 * https://www.silabs.com/community/mcu/32-bit/knowledge-base.entry.html/2017/11/08/endianness_of_silabs-xSJt
54 *
55 * This macro swaps endianness of a uint32_t
56 */
57#define UIP_HTONL(x) ( ((x >> 24) & 0x000000FF) | ((x >> 8) & 0x0000FF00) | ((x << 8 ) & 0x00FF0000) | ((x << 24) & 0xFF000000) )
58
61
62#endif /* _ZW_TYPEDEFS_H_ */