Edge AI Add-on API 2.2.0
Loading...
Searching...
No Matches
nrf_edgeai_platform.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2026 Nordic Semiconductor ASA
3 *
4 * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5 */
6#ifndef _NRF_EDGEAI_PLATFORM_H_
7#define _NRF_EDGEAI_PLATFORM_H_
8
9#include "nrf_edgeai_debug.h"
10
11#define __NRF_EDGEAI_STATIC_INLINE static inline
12
13#if defined(__GNUC__)
14#define __NRF_EDGEAI_WEAK __attribute__((weak))
15#define __NRF_EDGEAI_ALIGN(x) __attribute__((aligned(x)))
16#define __NRF_EDGEAI_ALIGNED __attribute__((aligned))
17#define __NRF_EDGEAI_PACKED __attribute__((__packed__))
18#define __NRF_EDGEAI_STATIC_FORCEINLINE __attribute__((always_inline)) static inline
19#elif defined(__ICCARM__)
20#define __NRF_EDGEAI_WEAK __weak
21#define __NRF_EDGEAI_PACKED __packed
22#define __NRF_EDGEAI_ALIGNED __attribute__((aligned))
23#define __NRF_EDGEAI_ALIGN(x) __attribute__((aligned(x)))
24#define __NRF_EDGEAI_STATIC_FORCEINLINE _Pragma("inline=forced") __NRF_EDGEAI_STATIC_INLINE
25#elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) /* ARM Compiler V6 */
26#define __NRF_EDGEAI_WEAK __attribute__((weak))
27#define __NRF_EDGEAI_ALIGN(x) __attribute__((aligned(x)))
28#define __NRF_EDGEAI_ALIGNED __attribute__((aligned))
29#define __NRF_EDGEAI_PACKED __attribute__((packed))
30#define __NRF_EDGEAI_STATIC_FORCEINLINE __NRF_EDGEAI_STATIC_INLINE
31#else
32#define __NRF_EDGEAI_WEAK __attribute__((weak))
33#define __NRF_EDGEAI_ALIGN(x) __attribute__((aligned(x)))
34#define __NRF_EDGEAI_ALIGNED __attribute__((aligned))
35#define __NRF_EDGEAI_PACKED __attribute__((__packed__))
36#define __NRF_EDGEAI_STATIC_FORCEINLINE __NRF_EDGEAI_STATIC_INLINE
37#endif
38
39#define NRF_EDGEAI_UNUSED(x) ((void)(x))
40#define NRF_EDGEAI_VOID_VALUE
41
42#ifndef __UNUSED_ARG
43#define __UNUSED_ARG NRF_EDGEAI_UNUSED
44#endif // __UNUSED_ARG
45
46#ifndef __VOID_VALUE
47#define __VOID_VALUE NRF_EDGEAI_VOID_VALUE
48#endif // __VOID_VALUE
49
50#endif /* _NRF_EDGEAI_PLATFORM_H_ */