⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bl_transreceiver.c

📁 freescale atk source code
💻 C
字号:
/*==================================================================================================    Module Name:  bl_transreceiver.c    General Description: This file contains the Transreceiver initalisation.==================================================================================================== Copyright 2008 Freescale Semiconductor, Inc. All Rights Reserved. This file contains copyrighted material. Use of this file isrestricted by the provisions of a Freescale Software License Agreement, which has either been electronically accepted by you or has been expressly executed between the parties.Revision History:====================================================================================================                                        INCLUDE FILES==================================================================================================*/#include "su_basictypes.h"#include "bl_transreceiver.h"#include "usb_tl_al_extern.h"#include "usb_ipl_al_extern.h"#include "usb_hwinterface_layer.h"/*==================================================================================================                                     GLOBAL VARIABLES==================================================================================================*/static UINT32 __attribute__((aligned(0x1000)))  usb_buffer[0x800];/*==================================================================================================                                     LOCAL CONSTANTS==================================================================================================*//*=================================================================================================                                 GLOBAL FUNCTION PROTOTYPES==================================================================================================*/void usb_otg_interface_init(void);void usb_utmi_interface_enable(void);/*==================================================================================================                                      LOCAL VARIABLES==================================================================================================*//*==================================================================================================                                        LOCAL MACROS==================================================================================================*//*==================================================================================================                                     GLOBAL FUNCTIONS==================================================================================================*//*==================================================================================================FUNCTION: usb_initDESCRIPTION: Initialize the usb interface and usb OTGARGUMENTS PASSED:   NoneRETURN VALUE:   NonePRE-CONDITIONS:   USB path is being followed.POST-CONDITIONS:   NoneIMPORTANT NOTES:==================================================================================================*/ void usb_init(void){    /* initialise the interface ( SERIAL 3Wire/ ULPI / UTMI) */    usb_otg_interface_init();}/*==================================================================================================FUNCTION: usb_otg_interface_initDESCRIPTION: Initialize the transreceiver .ARGUMENTS PASSED:   None   RETURN VALUE:   None  PRE-CONDITIONS:   NonePOST-CONDITIONS:   NoneIMPORTANT NOTES:==================================================================================================*/void usb_otg_interface_init(void){    usb_plat_config_data_t config_data_ptr;    UINT32 usb_src;    /* Read the USB Source E-fuse . b01- External ULPI PHY, b10-Ext Serial PHY (ATLAS), b10-Ext Serial PHY (isp1301), b00-Internal UTMI PHY */      /* IP Layer Initialisation */	//config_data_ptr.buffer_address = 0x88000000;//0xbb000000;//(UINT32)usb_buffer;	config_data_ptr.buffer_address = (UINT32)usb_buffer;	config_data_ptr.buffer_size  = BUFFER_SIZE;	ipl_init(&config_data_ptr);		/* Enable the UTMI interface */	usb_utmi_interface_enable();    *(VP_U32)USB_OTG_SUBSCFG &= ~0x7; /* Set the AHBBRST to 3b'000   */  }/*==================================================================================================FUNCTION: usb_utmi_interface_enableDESCRIPTION: Initialize and enable the utmi interface of communication.ARGUMENTS PASSED:   NoneRETURN VALUE:   NonePRE-CONDITIONS:   NonePOST-CONDITIONS:   NoneIMPORTANT NOTES:==================================================================================================*/void usb_utmi_interface_enable(void){    UINT32 temp;    /* set it to be utmi interface */    temp  = *(VP_U32)USB_OTG_PORTSC1;    temp &= ~USB_OTG_TRANS_MASK;    temp |= USB_OTG_TRANS_UTMI;    temp |= USB_OTG_TRANS_WIDTH;    *(VP_U32)USB_OTG_PORTSC1 = temp;    }

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -