usbdev: Add callback for CONFIG_USBDEV_SOFINTERRUPT

Previously CONFIG_USBDEV_SOFINTERRUPT existed in many platform
drivers but did nothing. This commit adds a callback function
usbdev_sof_irq() that can be used to take action on this interrupt.
This commit is contained in:
Petteri Aimonen
2023-12-08 13:57:18 +02:00
committed by Alan Carvalho de Assis
parent 4673fccece
commit 99a8c00807
2 changed files with 21 additions and 0 deletions
+8
View File
@@ -50,6 +50,14 @@ config USBDEV_MAXPOWER
the device is bus powered (USBDEV_BUSPOWERED). It is, however, used
unconditionally in several USB device drivers.
config USBDEV_SOFINTERRUPT
bool "Enable USB device SOF interrupts"
default n
---help---
Enable USB start-of-frame interrupts.
Can be used for synchronizing to host clock rate.
Board logic must provide usbdev_sof_irq() function.
config USBDEV_DMA
bool "Enable DMA methods"
default n
+13
View File
@@ -480,6 +480,19 @@ FAR void *usbdev_dma_alloc(size_t size);
void usbdev_dma_free(FAR void *memory);
#endif
/****************************************************************************
* Name: up_usbdev_sof_irq
*
* Description:
* If CONFIG_USBDEV_SOFINTERRUPT is enabled, board logic must provide
* this function. It gets called in interrupt mode by USB device code
* every time start-of-frame USB packet is received from host.
*
****************************************************************************/
#ifdef CONFIG_USBDEV_SOFINTERRUPT
void usbdev_sof_irq(FAR struct usbdev_s *dev, uint16_t frameno);
#endif
#undef EXTERN
#if defined(__cplusplus)
}