AM243x MCU+ SDK  10.00.00

Introduction

This module has APIs for USB device driver porting layer. See this page, USB, for using USB using tinyUSB APIs

Sub Modules

 cadence USB device driver module Id
 

Files

file  usb_init.h
 This file contains USB initialization APIs.
 

Data Structures

struct  usb_init_param_t
 USB intialization parameter block. More...
 

Functions

void usb_init (usb_init_param_t *usbInitParamPtr)
 USB Initialization function. More...
 
void cusbd_dsr (void) __attribute__((weak))
 
void DbgPrint (uint32_t module_id, uint32_t log_lvl, const char *str,...)
 Printf function hook for cadence usb device driver. More...
 
void CUSBD_DbgMsgInit (void)
 Initialize CUSBD Debug module with default parameters. More...
 
void DbgMsgSetLvl (uint32_t log_lvl)
 Sets debug verbosity level. More...
 
void DbgMsgEnableModule (uint32_t module_id)
 enable logs for given module More...
 
void DbgMsgDisableModule (uint32_t module_id)
 disable logs for given module More...
 

Macros

#define DEFAULT_CDN_DBG_MODULE   (0)
 
#define DEFAULT_CDN_LOG_LVL   (0)
 

USB Instance Number (usb_init_param_s.instanceNum)

#define USB_INSTANCE_0   (0x00U)
 USB Instance 0. More...
 

USB Clock Out Selection Value (usb_init_param_s.clkSrcSel)

#define USB_CLK_SEL_HFOSC0_CLKOUT   (0x00U)
 Use HFOSC0 CLKOUT. More...
 
#define USB_CLK_SEL_HFOSC1_CLKOUT   (0x01U)
 Use HFOSC1 CLKOUT. More...
 
#define USB_MAIN_PLL3_HSDIV4_CLKOUT   (0x02U)
 Use MAIN_PLL3_HSDIV4_CLKOUT. More...
 
#define USB_MAIN_PLL2_HSDIV4_CLKOUT   (0x03U)
 Use MAIN_PLL2_HSDIV4_CLKOUT. More...
 

USB PLL Reference Clock Frequency Selection Value (usb_init_param_s.pllRefSel)

#define USB_PLL_REF_CLK_9P6MHZ   (0x00)
 Use 9.6Mhz. More...
 
#define USB_PLL_REF_CLK_10MHZ   (0x01)
 Use 10Mhz. More...
 
#define USB_PLL_REF_CLK_12MHZ   (0x02)
 Use 12Mhz. More...
 
#define USB_PLL_REF_CLK_19P2MHZ   (0x03)
 Use 19.2Mhz. More...
 
#define USB_PLL_REF_CLK_20MHZ   (0x04)
 Use 20Mhz. More...
 
#define USB_PLL_REF_CLK_24MHZ   (0x05)
 Use 24Mhz. More...
 
#define USB_PLL_REF_CLK_25MHZ   (0x06)
 Use 25Mhz. More...
 
#define USB_PLL_REF_CLK_26MHZ   (0x07)
 Use 26Mhz. More...
 
#define USB_PLL_REF_CLK_38P4MHZ   (0x08)
 Use 38.4Mhz. More...
 
#define USB_PLL_REF_CLK_40MHZ   (0x09)
 Use 40Mhz. More...
 
#define USB_PLL_REF_CLK_48MHZ   (0x0A)
 Use 48Mhz. More...
 
#define USB_PLL_REF_CLK_50MHZ   (0x0B)
 Use 50Mhz. More...
 
#define USB_PLL_REF_CLK_52MHZ   (0x0C)
 Use 52Mhz. More...
 

USB Mode Value (usb_init_param_s.usb2Enable)

#define USB_MODE_3P0   (0x0)
 USB 3.0 mode. More...
 
#define USB_MODE_2P0   (0x1)
 USB 2.0 mode. More...
 

USB Pipe Receive Invert Polarity Value (usb_init_param_s.invertPolarity)

#define USB_PIPE_RX_INVERT_POLARITY_DISABLED   (0x0)
 USB Pipe Receive Invert Polarity Disabled. More...
 
#define USB_PIPE_RX_INVERT_POLARITY_ENABLED   (0x1)
 USB 2.0 only enable (USB 3.0 disabled) More...
 

USB VBUS External Divider Value (usb_init_param_s.vbusSel)

#define USB_VBUS_EXT_DIV3_INACTIVE   (0x0)
 VBUS External Divider Inactive. More...
 
#define USB_VBUS_EXT_DIV3_ACTIVE   (0x1)
 VBUS External Divider active. More...
 

USB Host Mode Value (usb_init_param_s.isHostMode)

#define USB_HOST_MODE_DISABLED   (0x0)
 USB Host Mode Disabled. More...
 
#define USB_HOST_MODE_ENABLED   (0x1)
 USB Host Mode Enabled. More...
 

Macro Definition Documentation

◆ USB_INSTANCE_0

#define USB_INSTANCE_0   (0x00U)

USB Instance 0.

◆ USB_CLK_SEL_HFOSC0_CLKOUT

#define USB_CLK_SEL_HFOSC0_CLKOUT   (0x00U)

Use HFOSC0 CLKOUT.

◆ USB_CLK_SEL_HFOSC1_CLKOUT

#define USB_CLK_SEL_HFOSC1_CLKOUT   (0x01U)

Use HFOSC1 CLKOUT.

◆ USB_MAIN_PLL3_HSDIV4_CLKOUT

#define USB_MAIN_PLL3_HSDIV4_CLKOUT   (0x02U)

Use MAIN_PLL3_HSDIV4_CLKOUT.

◆ USB_MAIN_PLL2_HSDIV4_CLKOUT

#define USB_MAIN_PLL2_HSDIV4_CLKOUT   (0x03U)

Use MAIN_PLL2_HSDIV4_CLKOUT.

◆ USB_PLL_REF_CLK_9P6MHZ

#define USB_PLL_REF_CLK_9P6MHZ   (0x00)

Use 9.6Mhz.

◆ USB_PLL_REF_CLK_10MHZ

#define USB_PLL_REF_CLK_10MHZ   (0x01)

Use 10Mhz.

◆ USB_PLL_REF_CLK_12MHZ

#define USB_PLL_REF_CLK_12MHZ   (0x02)

Use 12Mhz.

◆ USB_PLL_REF_CLK_19P2MHZ

#define USB_PLL_REF_CLK_19P2MHZ   (0x03)

Use 19.2Mhz.

◆ USB_PLL_REF_CLK_20MHZ

#define USB_PLL_REF_CLK_20MHZ   (0x04)

Use 20Mhz.

◆ USB_PLL_REF_CLK_24MHZ

#define USB_PLL_REF_CLK_24MHZ   (0x05)

Use 24Mhz.

◆ USB_PLL_REF_CLK_25MHZ

#define USB_PLL_REF_CLK_25MHZ   (0x06)

Use 25Mhz.

◆ USB_PLL_REF_CLK_26MHZ

#define USB_PLL_REF_CLK_26MHZ   (0x07)

Use 26Mhz.

◆ USB_PLL_REF_CLK_38P4MHZ

#define USB_PLL_REF_CLK_38P4MHZ   (0x08)

Use 38.4Mhz.

◆ USB_PLL_REF_CLK_40MHZ

#define USB_PLL_REF_CLK_40MHZ   (0x09)

Use 40Mhz.

◆ USB_PLL_REF_CLK_48MHZ

#define USB_PLL_REF_CLK_48MHZ   (0x0A)

Use 48Mhz.

◆ USB_PLL_REF_CLK_50MHZ

#define USB_PLL_REF_CLK_50MHZ   (0x0B)

Use 50Mhz.

◆ USB_PLL_REF_CLK_52MHZ

#define USB_PLL_REF_CLK_52MHZ   (0x0C)

Use 52Mhz.

◆ USB_MODE_3P0

#define USB_MODE_3P0   (0x0)

USB 3.0 mode.

◆ USB_MODE_2P0

#define USB_MODE_2P0   (0x1)

USB 2.0 mode.

◆ USB_PIPE_RX_INVERT_POLARITY_DISABLED

#define USB_PIPE_RX_INVERT_POLARITY_DISABLED   (0x0)

USB Pipe Receive Invert Polarity Disabled.

◆ USB_PIPE_RX_INVERT_POLARITY_ENABLED

#define USB_PIPE_RX_INVERT_POLARITY_ENABLED   (0x1)

USB 2.0 only enable (USB 3.0 disabled)

◆ USB_VBUS_EXT_DIV3_INACTIVE

#define USB_VBUS_EXT_DIV3_INACTIVE   (0x0)

VBUS External Divider Inactive.

◆ USB_VBUS_EXT_DIV3_ACTIVE

#define USB_VBUS_EXT_DIV3_ACTIVE   (0x1)

VBUS External Divider active.

◆ USB_HOST_MODE_DISABLED

#define USB_HOST_MODE_DISABLED   (0x0)

USB Host Mode Disabled.

◆ USB_HOST_MODE_ENABLED

#define USB_HOST_MODE_ENABLED   (0x1)

USB Host Mode Enabled.

◆ DEFAULT_CDN_DBG_MODULE

#define DEFAULT_CDN_DBG_MODULE   (0)

◆ DEFAULT_CDN_LOG_LVL

#define DEFAULT_CDN_LOG_LVL   (0)

Function Documentation

◆ usb_init()

void usb_init ( usb_init_param_t usbInitParamPtr)

USB Initialization function.

Set up the USB instance using the USB intialization parameter block:

  • USB clock source selection,
  • PHY ref clock frequency selection,
  • USB 2.0 enable (disable USB 3.0),
  • Invert polarity,
  • VBUS_SEL for external divider and
  • USB host/device mode.

◆ cusbd_dsr()

void cusbd_dsr ( void  )

◆ DbgPrint()

void DbgPrint ( uint32_t  module_id,
uint32_t  log_lvl,
const char *  str,
  ... 
)
inline

Printf function hook for cadence usb device driver.

◆ CUSBD_DbgMsgInit()

void CUSBD_DbgMsgInit ( void  )

Initialize CUSBD Debug module with default parameters.

◆ DbgMsgSetLvl()

void DbgMsgSetLvl ( uint32_t  log_lvl)

Sets debug verbosity level.

valid arguments

  1. DBG_CRIT - critical
  2. DBG_WARN - warning
  3. DBG_FYI - fyi
  4. DBG_HIVERB - highly verbose

◆ DbgMsgEnableModule()

void DbgMsgEnableModule ( uint32_t  module_id)

enable logs for given module

Parameters
module_idmodule id of CUSBD module who's logs will be enabled

◆ DbgMsgDisableModule()

void DbgMsgDisableModule ( uint32_t  module_id)

disable logs for given module

Parameters
module_idmodule id of CUSBD module who's logs will be disbaled