usb_serial_jtag: Add blocking driver to support vfs.

This commit is contained in:
Cao Sen Miao
2021-04-23 15:46:02 +08:00
parent 4a87be3ecd
commit 3aa9ac2469
16 changed files with 543 additions and 24 deletions

View File

@@ -37,7 +37,7 @@ typedef enum {
USB_SERIAL_JTAG_INTR_TOKEN_REC_IN_EP1 = (1 << 8),
USB_SERIAL_JTAG_INTR_BUS_RESET = (1 << 9),
USB_SERIAL_JTAG_INTR_EP1_ZERO_PAYLOAD = (1 << 10),
} usb_serial_jtag_intr_t;
} usb_serial_jtag_ll_intr_t;
/**
* @brief Enable the USB_SERIAL_JTAG interrupt based on the given mask.
@@ -51,6 +51,18 @@ static inline void usb_serial_jtag_ll_ena_intr_mask(uint32_t mask)
USB_SERIAL_JTAG.int_ena.val |= mask;
}
/**
* @brief Clear the USB_SERIAL_JTAG interrupt based on the given mask.
*
* @param mask The bitmap of the interrupts bits need to be cleared.
*
* @return None
*/
static inline void usb_serial_jtag_ll_clr_intr_sts_mask(uint32_t mask)
{
USB_SERIAL_JTAG.int_clr.val = mask;
}
/**
* @brief Disable the USB_SERIAL_JTAG interrupt based on the given mask.
*
@@ -156,6 +168,9 @@ static inline int usb_serial_jtag_ll_txfifo_writable(void)
* @brief Flushes the TX buffer, that is, make it available for the
* host to pick up.
*
* @note When fifo is full (with 64 byte), HW will flush the buffer automatically.
* It won't be executed if there is nothing in the fifo.
*
* @return na
*/
static inline void usb_serial_jtag_ll_txfifo_flush(void)