| M480 BSP V3.05.001 The Board Support Package for M480 Series

Macros
HSOTG Exported Functions
Standard Driver » HSOTG Driver

## Macros
#define | HSOTG_ENABLE()
| This macro is used to enable HSOTG function. More...
#define | HSOTG_DISABLE()
| This macro is used to disable HSOTG function. More...
#define | HSOTG_ENABLE_PHY()
| This macro is used to enable USB PHY. More...
#define | HSOTG_DISABLE_PHY()
| This macro is used to disable USB PHY. More...
#define | HSOTG_ENABLE_ID_DETECT()
| This macro is used to enable ID detection function. More...
#define | HSOTG_DISABLE_ID_DETECT()
| This macro is used to disable ID detection function. More...
#define | HSOTG_ENABLE_WAKEUP()
| This macro is used to enable HSOTG wake-up function. More...
#define | HSOTG_DISABLE_WAKEUP()
| This macro is used to disable HSOTG wake-up function. More...
#define | HSOTG_SET_VBUS_EN_POL(u32Pol)
| This macro is used to set the polarity of USB_VBUS_EN pin. More...
#define | HSOTG_SET_VBUS_STS_POL(u32Pol)
| This macro is used to set the polarity of USB_VBUS_ST pin. More...
#define | HSOTG_ENABLE_INT(u32Mask)
| This macro is used to enable HSOTG related interrupts. More...
#define | HSOTG_DISABLE_INT(u32Mask)
| This macro is used to disable HSOTG related interrupts. More...
#define | HSOTG_GET_INT_FLAG(u32Mask)
| This macro is used to get HSOTG related interrupt flags. More...
#define | HSOTG_CLR_INT_FLAG(u32Mask)
| This macro is used to clear HSOTG related interrupt flags. More...
#define | HSOTG_GET_STATUS(u32Mask)
| This macro is used to get HSOTG related status. More...

## Detailed Description

## Macro Definition Documentation

## ◆ HSOTG_CLR_INT_FLAG

#define HSOTG_CLR_INT_FLAG | ( |  | u32Mask | ) |

This macro is used to clear HSOTG related interrupt flags.

Parameters

  [in] | u32Mask | The combination of interrupt source. Each bit corresponds to a interrupt source. Valid values are listed below. HSOTG_INTSTS_ROLECHGIF_Msk HSOTG_INTSTS_VBEIF_Msk HSOTG_INTSTS_SRPFIF_Msk HSOTG_INTSTS_HNPFIF_Msk HSOTG_INTSTS_GOIDLEIF_Msk HSOTG_INTSTS_IDCHGIF_Msk HSOTG_INTSTS_PDEVIF_Msk HSOTG_INTSTS_HOSTIF_Msk HSOTG_INTSTS_BVLDCHGIF_Msk HSOTG_INTSTS_AVLDCHGIF_Msk HSOTG_INTSTS_VBCHGIF_Msk HSOTG_INTSTS_SECHGIF_Msk HSOTG_INTSTS_SRPDETIF_Msk

Returns
  None

This macro will clear HSOTG related interrupt flags specified by u32Mask parameter.

Definition at line 235 of file hsotg.h.

## ◆ HSOTG_DISABLE

#define HSOTG_DISABLE | ( |  | ) |

This macro is used to disable HSOTG function.

Parameters

  None |

Returns
  None

This macro will clear OTGEN bit of HSOTG_CTL register to disable HSOTG function.

Definition at line 70 of file hsotg.h.

## ◆ HSOTG_DISABLE_ID_DETECT

#define HSOTG_DISABLE_ID_DETECT | ( |  | ) |

This macro is used to disable ID detection function.

Parameters

  None |

Returns
  None

This macro will clear IDDETEN bit of HSOTG_PHYCTL register to disable ID detection function.

Definition at line 107 of file hsotg.h.

## ◆ HSOTG_DISABLE_INT

#define HSOTG_DISABLE_INT | ( |  | u32Mask | ) |

This macro is used to disable HSOTG related interrupts.

Parameters

  [in] | u32Mask | The combination of interrupt source. Each bit corresponds to a interrupt source. Valid values are listed below. HSOTG_INTEN_ROLECHGIEN_Msk HSOTG_INTEN_VBEIEN_Msk HSOTG_INTEN_SRPFIEN_Msk HSOTG_INTEN_HNPFIEN_Msk HSOTG_INTEN_GOIDLEIEN_Msk HSOTG_INTEN_IDCHGIEN_Msk HSOTG_INTEN_PDEVIEN_Msk HSOTG_INTEN_HOSTIEN_Msk HSOTG_INTEN_BVLDCHGIEN_Msk HSOTG_INTEN_AVLDCHGIEN_Msk HSOTG_INTEN_VBCHGIEN_Msk HSOTG_INTEN_SECHGIEN_Msk HSOTG_INTEN_SRPDETIEN_Msk

Returns
  None

This macro will disable HSOTG related interrupts specified by u32Mask parameter.

Definition at line 191 of file hsotg.h.

## ◆ HSOTG_DISABLE_PHY

#define HSOTG_DISABLE_PHY | ( |  | ) |

This macro is used to disable USB PHY.

Parameters

  None |

Returns
  None

This macro will clear OTGPHYEN bit of HSOTG_PHYCTL register to disable USB PHY.

Definition at line 89 of file hsotg.h.

## ◆ HSOTG_DISABLE_WAKEUP

#define HSOTG_DISABLE_WAKEUP | ( |  | ) |

This macro is used to disable HSOTG wake-up function.

Parameters

  None |

Returns
  None

This macro will clear WKEN bit of HSOTG_CTL register to disable HSOTG wake-up function.

Definition at line 125 of file hsotg.h.

## ◆ HSOTG_ENABLE

#define HSOTG_ENABLE | ( |  | ) |

This macro is used to enable HSOTG function.

Parameters

  None |

Returns
  None

This macro will set OTGEN bit of HSOTG_CTL register to enable HSOTG function.

Definition at line 61 of file hsotg.h.

## ◆ HSOTG_ENABLE_ID_DETECT

#define HSOTG_ENABLE_ID_DETECT | ( |  | ) |

This macro is used to enable ID detection function.

Parameters

  None |

Returns
  None

This macro will set IDDETEN bit of HSOTG_PHYCTL register to enable ID detection function.

Definition at line 98 of file hsotg.h.

## ◆ HSOTG_ENABLE_INT

#define HSOTG_ENABLE_INT | ( |  | u32Mask | ) |

This macro is used to enable HSOTG related interrupts.

Parameters

  [in] | u32Mask | The combination of interrupt source. Each bit corresponds to a interrupt source. Valid values are listed below. HSOTG_INTEN_ROLECHGIEN_Msk HSOTG_INTEN_VBEIEN_Msk HSOTG_INTEN_SRPFIEN_Msk HSOTG_INTEN_HNPFIEN_Msk HSOTG_INTEN_GOIDLEIEN_Msk HSOTG_INTEN_IDCHGIEN_Msk HSOTG_INTEN_PDEVIEN_Msk HSOTG_INTEN_HOSTIEN_Msk HSOTG_INTEN_BVLDCHGIEN_Msk HSOTG_INTEN_AVLDCHGIEN_Msk HSOTG_INTEN_VBCHGIEN_Msk HSOTG_INTEN_SECHGIEN_Msk HSOTG_INTEN_SRPDETIEN_Msk

Returns
  None

This macro will enable HSOTG related interrupts specified by u32Mask parameter.

Definition at line 169 of file hsotg.h.

## ◆ HSOTG_ENABLE_PHY

#define HSOTG_ENABLE_PHY | ( |  | ) |

This macro is used to enable USB PHY.

Parameters

  None |

Returns
  None

When the USB role is selected as HSOTG device, use this macro to enable USB PHY. This macro will set OTGPHYEN bit of HSOTG_PHYCTL register to enable USB PHY.

Definition at line 80 of file hsotg.h.

## ◆ HSOTG_ENABLE_WAKEUP

#define HSOTG_ENABLE_WAKEUP | ( |  | ) |

This macro is used to enable HSOTG wake-up function.

Parameters

  None |

Returns
  None

This macro will set WKEN bit of HSOTG_CTL register to enable HSOTG wake-up function.

Definition at line 116 of file hsotg.h.

## ◆ HSOTG_GET_INT_FLAG

#define HSOTG_GET_INT_FLAG | ( |  | u32Mask | ) |

This macro is used to get HSOTG related interrupt flags.

Parameters

  [in] | u32Mask | The combination of interrupt source. Each bit corresponds to a interrupt source. Valid values are listed below. HSOTG_INTSTS_ROLECHGIF_Msk HSOTG_INTSTS_VBEIF_Msk HSOTG_INTSTS_SRPFIF_Msk HSOTG_INTSTS_HNPFIF_Msk HSOTG_INTSTS_GOIDLEIF_Msk HSOTG_INTSTS_IDCHGIF_Msk HSOTG_INTSTS_PDEVIF_Msk HSOTG_INTSTS_HOSTIF_Msk HSOTG_INTSTS_BVLDCHGIF_Msk HSOTG_INTSTS_AVLDCHGIF_Msk HSOTG_INTSTS_VBCHGIF_Msk HSOTG_INTSTS_SECHGIF_Msk HSOTG_INTSTS_SRPDETIF_Msk

Returns
  Interrupt flags of selected sources.

This macro will return HSOTG related interrupt flags specified by u32Mask parameter.

Definition at line 213 of file hsotg.h.

## ◆ HSOTG_GET_STATUS

#define HSOTG_GET_STATUS | ( |  | u32Mask | ) |

This macro is used to get HSOTG related status.

Parameters

  [in] | u32Mask | The combination of user specified source. Valid values are listed below. HSOTG_STATUS_OVERCUR_Msk HSOTG_STATUS_IDSTS_Msk HSOTG_STATUS_SESSEND_Msk HSOTG_STATUS_BVLD_Msk HSOTG_STATUS_AVLD_Msk HSOTG_STATUS_VBUSVLD_Msk

Returns
  The user specified status.

This macro will return HSOTG related status specified by u32Mask parameter.

Definition at line 250 of file hsotg.h.

## ◆ HSOTG_SET_VBUS_EN_POL

#define HSOTG_SET_VBUS_EN_POL | ( |  | u32Pol | ) |

This macro is used to set the polarity of USB_VBUS_EN pin.

Parameters

  [in] | u32Pol | The polarity selection. Valid values are listed below. HSOTG_VBUS_EN_ACTIVE_HIGH HSOTG_VBUS_EN_ACTIVE_LOW

Returns
  None

This macro is used to set the polarity of external USB VBUS power switch enable signal.

Definition at line 136 of file hsotg.h.

## ◆ HSOTG_SET_VBUS_STS_POL

#define HSOTG_SET_VBUS_STS_POL | ( |  | u32Pol | ) |

This macro is used to set the polarity of USB_VBUS_ST pin.

Parameters

  [in] | u32Pol | The polarity selection. Valid values are listed below. HSOTG_VBUS_ST_VALID_HIGH HSOTG_VBUS_ST_VALID_LOW

Returns
  None

This macro is used to set the polarity of external USB VBUS power switch status signal.

Definition at line 147 of file hsotg.h.