MG32F10x Standard Peripherals Firmware Library

结构体 | 宏定义 | 枚举 | 函数 | 变量
usbd_core.h 文件参考
`#include <stdint.h>`
`#include <stdbool.h>`
`#include "usb_def.h"`
`#include "usbd_hw.h"`

浏览源代码.

## 结构体
struct | UsbdCoreInfo_t

## 宏定义
#define | USB_DEVICE_STATE_UNCONNECTED 0
#define | USB_DEVICE_STATE_ATTACHED 1
#define | USB_DEVICE_STATE_POWERED 2
#define | USB_DEVICE_STATE_SUSPENDED 3
#define | USB_DEVICE_STATE_ADDRESSED 4
#define | USB_DEVICE_STATE_CONFIGURED 5

## 枚举
enum | UsbdControlStage { USBD_CONTROL_STAGE_STALL, USBD_CONTROL_STAGE_IN_DATA, USBD_CONTROL_STAGE_OUT_DATA, USBD_CONTROL_STAGE_STATUS }

## 函数
void | USBD_Init (void)
| Initializes the USB device library. 更多...
void | USBD_DeInit (void)
| Deinitializes the USB device library. 更多...
void | USBD_Connect (void)
| Connects the device to the USB host. 更多...
void | USBD_Disconnect (void)
| Disconnects the device from the USB host. 更多...
void | USBD_Core_Reset (void)
| Handle reset event. 更多...
void | USBD_Core_Suspend (void)
| Handle suspend event. 更多...
void | USBD_Core_Resume (void)
| Handle resume event. 更多...
UsbdControlStage | USBD_EndPoint0_Setup_StdReq (void)
| Handle Standard Device Requests. 更多...
void | Handle_USBD_INT (uint8_t IntrUSB, uint8_t IntrIn, uint8_t IntrOut)
| Handle USBD Interrupts. 更多...

## 变量
volatile UsbdCoreInfo_t | UsbdCoreInfo
const uint8_t | UsbdMaxPacketSize0

## 详细描述

作者
  megawin Application Team

注意

Copyright (c) 2020 - 2023 megawin Technology (Shenzhen) Corp., Ltd All rights reserved.

THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME. AS A RESULT, MEGAWIN TECHNOLOGY SHALL NOT BE HELD LIABLE FOR ANY DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.

## 函数说明

## ◆ Handle_USBD_INT()

void Handle_USBD_INT | ( | uint8_t | IntrUSB,
|  | uint8_t | IntrIn,
|  | uint8_t | IntrOut
| ) |  |

Handle USBD Interrupts.

返回
  None

## ◆ USBD_Connect()

void USBD_Connect | ( | void |  | ) |

Connects the device to the USB host.

返回
  None

## ◆ USBD_Core_Reset()

void USBD_Core_Reset | ( | void |  | ) |

Handle reset event.

返回
  None

## ◆ USBD_Core_Resume()

void USBD_Core_Resume | ( | void |  | ) |

Handle resume event.

返回
  None

## ◆ USBD_Core_Suspend()

void USBD_Core_Suspend | ( | void |  | ) |

Handle suspend event.

返回
  None

## ◆ USBD_DeInit()

void USBD_DeInit | ( | void |  | ) |

Deinitializes the USB device library.

返回
  None

## ◆ USBD_Disconnect()

void USBD_Disconnect | ( | void |  | ) |

Disconnects the device from the USB host.

返回
  None

## ◆ USBD_EndPoint0_Setup_StdReq()

UsbdControlStage USBD_EndPoint0_Setup_StdReq | ( | void |  | ) |

Handle Standard Device Requests.

返回
  The next control stage.

## ◆ USBD_Init()

void USBD_Init | ( | void |  | ) |

Initializes the USB device library.

返回
  None