MG32F10x Standard Peripherals Firmware Library
Data Structures | Macros | Enumerations | Functions | Variables
usbd_core.h File Reference
#include <stdint.h>
#include <stdbool.h>
#include "usb_def.h"
#include "usbd_hw.h"

Go to the source code of this file.

Data Structures

struct  UsbdCoreInfo_t
 

Macros

#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
 

Enumerations

enum  UsbdControlStage { USBD_CONTROL_STAGE_STALL, USBD_CONTROL_STAGE_IN_DATA, USBD_CONTROL_STAGE_OUT_DATA, USBD_CONTROL_STAGE_STATUS }
 

Functions

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

Variables

volatile UsbdCoreInfo_t UsbdCoreInfo
 
const uint8_t UsbdMaxPacketSize0
 

Detailed Description

Author
megawin Application Team
Attention

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.

Function Documentation

◆ Handle_USBD_INT()

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

Handle USBD Interrupts.

Returns
None

◆ USBD_Connect()

void USBD_Connect ( void  )

Connects the device to the USB host.

Returns
None

◆ USBD_Core_Reset()

void USBD_Core_Reset ( void  )

Handle reset event.

Returns
None

◆ USBD_Core_Resume()

void USBD_Core_Resume ( void  )

Handle resume event.

Returns
None

◆ USBD_Core_Suspend()

void USBD_Core_Suspend ( void  )

Handle suspend event.

Returns
None

◆ USBD_DeInit()

void USBD_DeInit ( void  )

Deinitializes the USB device library.

Returns
None

◆ USBD_Disconnect()

void USBD_Disconnect ( void  )

Disconnects the device from the USB host.

Returns
None

◆ USBD_EndPoint0_Setup_StdReq()

UsbdControlStage USBD_EndPoint0_Setup_StdReq ( void  )

Handle Standard Device Requests.

Returns
The next control stage.

◆ USBD_Init()

void USBD_Init ( void  )

Initializes the USB device library.

Returns
None