1 /*
2  * Copyright (c) 2024 Nordic Semiconductor ASA
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 
7 #ifndef NRFS_INTERNAL_USB_H
8 #define NRFS_INTERNAL_USB_H
9 
10 #include <internal/services/nrfs_generic.h>
11 
12 #ifdef __cplusplus
13 extern "C" {
14 #endif
15 
16 /** @brief USB VBUS detector service notification data structure for enable request. */
17 typedef struct __NRFS_PACKED {
18 	bool pll_ok;	    /** True, when USBHSPLL PLL is locked. */
19 	bool vreg_ok;	    /** True, when VREGUSB 0V8 and 3V3 voltages are settled. */
20 	bool vbus_detected; /** True, when VBUS is detected. */
21 } nrfs_usb_rsp_data_t;
22 
23 /** @brief USB VBUS detector service enable request structure. */
24 typedef struct __NRFS_PACKED {
25 	nrfs_hdr_t hdr; /**< Header of the message. */
26 	nrfs_ctx_t ctx; /**< Context of the message. */
27 } nrfs_usb_enable_req_t;
28 
29 /** @brief USB VBUS detector service disable request structure. */
30 typedef struct __NRFS_PACKED {
31 	nrfs_hdr_t hdr; /**< Header of the message. */
32 	nrfs_ctx_t ctx; /**< Context of the message. */
33 } nrfs_usb_disable_req_t;
34 
35 /** @brief USB VBUS detector service notification structure for enable request. */
36 typedef struct __NRFS_PACKED {
37 	nrfs_hdr_t hdr;		  /**< Header of the message. */
38 	nrfs_ctx_t ctx;		  /**< Context of the message. */
39 	nrfs_usb_rsp_data_t data; /**< Data of the notification. */
40 } nrfs_usb_rsp_t;
41 
42 #ifdef __cplusplus
43 }
44 #endif
45 
46 #endif /* NRFS_INTERNAL_USB_H */
47