File tree Expand file tree Collapse file tree 2 files changed +29
-0
lines changed Expand file tree Collapse file tree 2 files changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -42,6 +42,12 @@ config UDC_BUF_FORCE_NOCACHE
4242 Place the buffer pools in the nocache memory region if the driver
4343 cannot handle buffers in cached memory.
4444
45+ config UDC_ENABLE_SOF
46+ bool "SOF interrupt processing"
47+ help
48+ Enabled SoF interrupts can cause a very high CPU load on high-speed
49+ controllers because the interrupt rate would be 125 µs.
50+
4551config UDC_WORKQUEUE
4652 bool "Use a dedicate work queue for UDC drivers"
4753 help
Original file line number Diff line number Diff line change @@ -156,6 +156,29 @@ int udc_submit_event(const struct device *dev,
156156int udc_submit_ep_event (const struct device * dev ,
157157 struct net_buf * const buf ,
158158 const int err );
159+
160+ /**
161+ * @brief Helper function to send UDC SOF event to a higher level.
162+ *
163+ * Type of this event is hardcoded to UDC_EVT_SOF.
164+ *
165+ * @param[in] dev Pointer to device struct of the driver instance
166+ */
167+ #if defined(CONFIG_UDC_ENABLE_SOF )
168+ static inline void udc_submit_sof_event (const struct device * dev )
169+ {
170+ struct udc_data * data = dev -> data ;
171+ struct udc_event drv_evt = {
172+ .type = UDC_EVT_SOF ,
173+ .dev = dev ,
174+ };
175+
176+ (void )data -> event_cb (dev , & drv_evt );
177+ }
178+ #else
179+ #define udc_submit_sof_event (dev ) ARG_UNUSED(dev)
180+ #endif
181+
159182/**
160183 * @brief Helper function to enable endpoint.
161184 *
You can’t perform that action at this time.
0 commit comments