mirror of
https://github.com/apache/nuttx.git
synced 2026-05-26 10:46:28 +08:00
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:
committed by
Alan Carvalho de Assis
parent
4673fccece
commit
99a8c00807
@@ -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
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user