1 /*
2  * Copyright (c) 2024 Nordic Semiconductor ASA
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 
7 #ifndef NRFS_DIAG_H
8 #define NRFS_DIAG_H
9 
10 #include <internal/services/nrfs_generic.h>
11 
12 #ifdef __cplusplus
13 extern "C" {
14 #endif
15 
16 /** @brief System Diagnostics register access type. */
17 typedef enum __NRFS_PACKED {
18 	DIAG_REG_READ = 0, /** Register read */
19 	DIAG_REG_WRITE,	   /** Register write */
20 	DIAG_REG_INVALID,  /** Register access invalid */
21 } diag_reg_access_type_t;
22 
23 /** @brief System Diagnostics register access. */
24 typedef struct __NRFS_PACKED {
25 	diag_reg_access_type_t access_type; /** Register access type. */
26 	uint32_t addr;			    /** Register address. */
27 	uint32_t val;			    /** Register value. */
28 } diag_reg_access_t;
29 
30 /** @brief System Diagnostics service notification data structure. */
31 typedef struct __NRFS_PACKED {
32 	diag_reg_access_type_t access_type; /** Register access type. */
33 	uint32_t addr;			    /** Register address. */
34 	uint32_t val;			    /** Register value. */
35 } nrfs_diag_rsp_data_t;
36 
37 /** @brief System Diagnostics register request structure. */
38 typedef struct __NRFS_PACKED {
39 	nrfs_hdr_t hdr;	       /**< Header of the message. */
40 	nrfs_ctx_t ctx;	       /**< Context of the message. */
41 	diag_reg_access_t reg; /**< Register access. */
42 } nrfs_diag_reg_req_t;
43 
44 /** @brief System Diagnostics service notification structure. */
45 typedef struct __NRFS_PACKED {
46 	nrfs_hdr_t hdr;		   /**< Header of the message. */
47 	nrfs_ctx_t ctx;		   /**< Context of the message. */
48 	nrfs_diag_rsp_data_t data; /**< Data of the notification. */
49 } nrfs_diag_rsp_t;
50 
51 #ifdef __cplusplus
52 }
53 #endif
54 
55 #endif /* NRFS_DIAG_H */
56