esp32s2_bare_board/managed_components/cherry-embedded__cherryusb/common/usb_otg.h
impressionyang b0e0ddebf4 feat: 修改u8g2移植配置中的I2C速率至400KHz
feat: 添加线程资源打印功能
fix🐛: 修复USB未启用其他线程卡死问题,是USB写入循环阻塞所致
feat: 升级cherryUSB,使用官方方式集成至ESP32
2025-03-22 16:56:52 +08:00

41 lines
790 B
C

/*
* Copyright (c) 2025, sakumisu
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef USB_OTG_H
#define USB_OTG_H
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief usb otg controller hardware or gpio id simulator init.
*
* @return On success will return 0, and others indicate fail.
*/
int usb_otg_init(uint8_t busid);
/**
* @brief usb otg controller hardware or gpio id simulator deinit.
*
* @return On success will return 0, and others indicate fail.
*/
int usb_otg_deinit(uint8_t busid);
/**
* @brief get current role mode.
*
* @return return USBOTG_MODE_HOST or USBOTG_MODE_DEVICE.
*/
uint8_t usbotg_get_current_mode(uint8_t busid);
/* called by user */
void USBOTG_IRQHandler(uint8_t busid);
#ifdef __cplusplus
}
#endif
#endif /* USB_OTG_H */