File tree Expand file tree Collapse file tree 4 files changed +69
-0
lines changed Expand file tree Collapse file tree 4 files changed +69
-0
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,8 @@ extern "C" {
16
16
enum {
17
17
NRFS_USB_REQ_ENABLE = NRFS_REQUEST_ID_DEF (NRFS_SERVICE_ID_USB , 0x01 ),
18
18
NRFS_USB_REQ_DISABLE = NRFS_REQUEST_ID_DEF (NRFS_SERVICE_ID_USB , 0x02 ),
19
+ NRFS_USB_REQ_DPLUS_PULLUP_ENABLE = NRFS_REQUEST_ID_DEF (NRFS_SERVICE_ID_USB , 0x03 ),
20
+ NRFS_USB_REQ_DPLUS_PULLUP_DISABLE = NRFS_REQUEST_ID_DEF (NRFS_SERVICE_ID_USB , 0x04 ),
19
21
};
20
22
21
23
#ifdef __cplusplus
Original file line number Diff line number Diff line change @@ -32,6 +32,19 @@ typedef struct __NRFS_PACKED {
32
32
nrfs_ctx_t ctx ; /**< Context of the message. */
33
33
} nrfs_usb_disable_req_t ;
34
34
35
+ /** @brief USB D+ pull-up enable request structure. */
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_ld_dplus_pullup_enable_req_t ;
40
+
41
+ /** @brief USB D+ pull-up disable request structure. */
42
+ typedef struct __NRFS_PACKED {
43
+ nrfs_hdr_t hdr ; /**< Header of the message. */
44
+ nrfs_ctx_t ctx ; /**< Context of the message. */
45
+ } nrfs_usb_ld_dplus_pullup_disable_req_t ;
46
+
47
+
35
48
/** @brief USB VBUS detector service notification structure for enable request. */
36
49
typedef struct __NRFS_PACKED {
37
50
nrfs_hdr_t hdr ; /**< Header of the message. */
Original file line number Diff line number Diff line change @@ -69,6 +69,29 @@ nrfs_err_t nrfs_usb_enable_request(void * p_context);
69
69
*/
70
70
nrfs_err_t nrfs_usb_disable_request (void * p_context );
71
71
72
+ /**
73
+ * @brief Function for requesting to enable dplus pullup within the USB Service.
74
+ *
75
+ * @param[in] p_context Opaque user data that will be passed to registered callback.
76
+ *
77
+ * @retval NRFS_SUCCESS Request sent successfully.
78
+ * @retval NRFS_ERR_INVALID_STATE Service is uninitialized.
79
+ * @retval NRFS_ERR_IPC Backend returned error during request sending.
80
+ */
81
+ nrfs_err_t nrfs_usb_dplus_pullup_enable (void * p_context );
82
+
83
+ /**
84
+ * @brief Function for requesting to disable dplus pullup within the USB Service.
85
+ *
86
+ * @param[in] p_context Opaque user data that will be passed to registered callback.
87
+ *
88
+ * @retval NRFS_SUCCESS Request sent successfully.
89
+ * @retval NRFS_ERR_INVALID_STATE Service is uninitialized.
90
+ * @retval NRFS_ERR_IPC Backend returned error during request sending.
91
+ */
92
+ nrfs_err_t nrfs_usb_dplus_pullup_disable (void * p_context );
93
+
94
+
72
95
#ifdef __cplusplus
73
96
}
74
97
#endif
Original file line number Diff line number Diff line change @@ -86,3 +86,34 @@ nrfs_err_t nrfs_usb_disable_request(void *p_context)
86
86
87
87
return nrfs_backend_send (& req , sizeof (req ));
88
88
}
89
+
90
+ nrfs_err_t nrfs_usb_dplus_pullup_enable (void * p_context )
91
+ {
92
+ if (!m_cb .is_initialized ) {
93
+ return NRFS_ERR_INVALID_STATE ;
94
+ }
95
+
96
+ nrfs_usb_ld_dplus_pullup_enable_req_t req ;
97
+
98
+ NRFS_SERVICE_HDR_FILL (& req , NRFS_USB_REQ_DPLUS_PULLUP_ENABLE );
99
+ NRFS_HDR_NO_RSP_SET (& req .hdr );
100
+ req .ctx .ctx = (uint32_t )p_context ;
101
+
102
+ return nrfs_backend_send (& req , sizeof (req ));
103
+ }
104
+
105
+ nrfs_err_t nrfs_usb_dplus_pullup_disable (void * p_context )
106
+ {
107
+ if (!m_cb .is_initialized ) {
108
+ return NRFS_ERR_INVALID_STATE ;
109
+ }
110
+
111
+ nrfs_usb_ld_dplus_pullup_disable_req_t req ;
112
+
113
+ NRFS_SERVICE_HDR_FILL (& req , NRFS_USB_REQ_DPLUS_PULLUP_DISABLE );
114
+ NRFS_HDR_NO_RSP_SET (& req .hdr );
115
+ req .ctx .ctx = (uint32_t )p_context ;
116
+
117
+ return nrfs_backend_send (& req , sizeof (req ));
118
+ }
119
+
You can’t perform that action at this time.
0 commit comments