1 /*
2  * Copyright (c) 2024 Nordic Semiconductor ASA
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 
7 #ifndef NRFS_COMMON_H
8 #define NRFS_COMMON_H
9 
10 #include <stdint.h>
11 #include <stddef.h>
12 #include <stdbool.h>
13 
14 #define __NRFS_PACKED __attribute__((__packed__))
15 
16 /**
17  * @brief Macro for getting the number of elements in an array.
18  *
19  * @param[in] array Name of the array.
20  *
21  * @return Array element count.
22  */
23 #define NRFS_ARRAY_SIZE(array) (sizeof(array) / sizeof((array)[0]))
24 
25 /** @brief Return codes. */
26 typedef enum __NRFS_PACKED {
27 	NRFS_SUCCESS,		/**< Success. */
28 	NRFS_ERR_INVALID_STATE, /**< Invalid state. */
29 	NRFS_ERR_IPC,		/**< IPC error. */
30 } nrfs_err_t;
31 
32 #endif /* NRFS_COMMON_H */
33