WB32F10x Standard Peripherals Firmware Library

Functions
usbd_hw.h File Reference
`#include "wb32f10x.h"`

Go to the source code of this file.

## Functions
void | USBD_HW_ReadEP (uint8_t ep_addr, uint8_t *pbuf, uint16_t size)
| Read data from the specified endpoint. More...
void | USBD_HW_WriteEP (uint8_t ep_addr, const uint8_t *pdata, uint16_t len)
| Write data to the specified endpoint. More...
void | USBD_HW_Transmit (uint8_t ep_addr, const uint8_t *pdata, uint16_t len)
| Transmits data over an IN endpoint. More...
uint16_t | USBD_HW_GetRxDataCount (uint8_t ep_addr)
| Get the last received packet size of an OUT endpoint. More...
void | USBD_HW_ReadyToReceive (uint8_t ep_addr)
| Ready to receive from an OUT endpoint. More...
void | USBD_HW_SetStallEP (uint8_t ep_addr)
| Set Stall condition of a non-control endpoint. More...
void | USBD_HW_ClrStallEP (uint8_t ep_addr)
| Clear Stall condition of a non-control endpoint. More...
uint8_t | USBD_HW_IsStalled (uint8_t ep_addr)
| Get stall status of non-control endpoint. More...

## Detailed Description

Author
  Westberry Application Team

Attention

Copyright (c) 2020 - 2023 Westberry Technology (ChangZhou) 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, WESTBERRY 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

## ◆ USBD_HW_ClrStallEP()

void USBD_HW_ClrStallEP | ( | uint8_t | ep_addr | ) |

Clear Stall condition of a non-control endpoint.

Parameters

  ep_addr | endpoint address.

Returns
  None

## ◆ USBD_HW_GetRxDataCount()

uint16_t USBD_HW_GetRxDataCount | ( | uint8_t | ep_addr | ) |

Get the last received packet size of an OUT endpoint.

Parameters

  ep_addr | endpoint address (eg. 0x01).

Returns
  The last received packet size of an OUT endpoint.

## ◆ USBD_HW_IsStalled()

uint8_t USBD_HW_IsStalled | ( | uint8_t | ep_addr | ) |

Get stall status of non-control endpoint.

Parameters

  ep_addr | endpoint address.

Returns
  stall status (1: stall, 0: not stall).

## ◆ USBD_HW_ReadEP()

void USBD_HW_ReadEP | ( | uint8_t | ep_addr,
|  | uint8_t * | pbuf,
|  | uint16_t | size
| ) |  |

Read data from the specified endpoint.

Parameters

  ep_addr | specifies which endpoint read from. This value must be less than or equal to 3.
  pbuf | pointer to data buffer.
  size | length of data to be read.

Returns
  None

## ◆ USBD_HW_ReadyToReceive()

void USBD_HW_ReadyToReceive | ( | uint8_t | ep_addr | ) |

Ready to receive from an OUT endpoint.

Parameters

  ep_addr | endpoint address (eg. 0x01).

Returns
  None

## ◆ USBD_HW_SetStallEP()

void USBD_HW_SetStallEP | ( | uint8_t | ep_addr | ) |

Set Stall condition of a non-control endpoint.

Parameters

  ep_addr | endpoint address.

Returns
  None

## ◆ USBD_HW_Transmit()

void USBD_HW_Transmit | ( | uint8_t | ep_addr,
|  | const uint8_t * | pdata,
|  | uint16_t | len
| ) |  |

Transmits data over an IN endpoint.

Parameters

  ep_addr | endpoint address (eg. 0x81).
  pdata | pointer to the buffer containing the data to be transmitted.
  len | length of data to be transmitted.

Returns
  None

## ◆ USBD_HW_WriteEP()

void USBD_HW_WriteEP | ( | uint8_t | ep_addr,
|  | const uint8_t * | pdata,
|  | uint16_t | len
| ) |  |

Write data to the specified endpoint.

Parameters

  ep_addr | specifies which endpoint to write. This value must be less than or equal to 3.
  pdata | pointer to the buffer containing the data to be written.
  len | length of data to be written.

Returns
  None