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

📄 smsc911x_platform.h

📁 由smsc公司改进的lwip2.1.1基于嵌入式系统的TCP/ip协议栈
💻 H
字号:
/*****************************************************************************
 *
 * Copyright (C) 2008  SMSC
 *
 * All rights reserved.
 *
 *****************************************************************************
 * File: smsc911x_platform.h
 */

#ifndef SMSC911X_PLATFORM_H
#define SMSC911X_PLATFORM_H

/*****************************************************************************
* The following functions and defines are declared according to the 
*   platform independent interface defined in 
*
* Network_Stack\Source\interfaces\smsc911x.h
* 
* Please see that file for full documentation on the expected behavior 
*   of these functions and defines.
*****************************************************************************/

/*****************************************************************************
* CONSTANT: SMSC911X_INTERFACE_COUNT
*****************************************************************************/
#define SMSC911X_INTERFACE_COUNT	(0)
             
/*****************************************************************************
* FUNCTION/MACRO: SMSC911X_PLATFORM_READ_REGISTER
*****************************************************************************/
#define SMSC911X_PLATFORM_READ_REGISTER(ioaddress,reg)		\
	(*((volatile u32_t *)((ioaddress)+(reg))))

/*****************************************************************************
* FUNCTION/MACRO: SMSC911X_PLATFORM_WRITE_REGISTER
*****************************************************************************/
#define SMSC911X_PLATFORM_WRITE_REGISTER(ioaddress,reg,value)	\
	(*((volatile u32_t *)((ioaddress)+(reg))))=(value)
           
/*****************************************************************************
* FUNCTION/MACRO: Smsc911xPlatform_DisplayResources
*****************************************************************************/
#if SMSC_TRACE_ENABLED
void Smsc911xPlatform_DisplayResources(int debugMode, int interfaceIndex);
#else 
#define Smsc911xPlatform_DisplayResources(debugMode,interfaceIndex)
#endif

/*****************************************************************************
* FUNCTION/MACRO: Smsc911xPlatform_Initialize
*****************************************************************************/
int Smsc911xPlatform_Initialize(int interfaceIndex);
                   
/*****************************************************************************
* FUNCTION TYPE: SMSC911X_ISR
*****************************************************************************/
typedef int (*SMSC911X_ISR)(void * argument);

/*****************************************************************************
* FUNCTION: Smsc911xPlatform_InstallIsr
*****************************************************************************/
int Smsc911xPlatform_InstallIsr(int interfaceIndex,SMSC911X_ISR isr,void * isrArgument);
 
/*****************************************************************************
* FUNCTION: Smsc911xPlatform_GetIOAddress
*****************************************************************************/
mem_ptr_t Smsc911xPlatform_GetIOAddress(int interfaceIndex);

/*****************************************************************************
* FUNCTION: Smsc911xPlatform_GetMacAddress
*****************************************************************************/
void Smsc911xPlatform_GetMacAddress(int interfaceIndex, unsigned char macAddress[6]);

/*****************************************************************************
* FUNCTION: Smsc911xPlatform_InvalidateCache
*    Because we are using PIO cache functions are not necessary. This function
*    can be defined to nothing.
*****************************************************************************/
#define Smsc911xPlatform_InvalidateCache(interfaceIndex,bufferPtr,wordCount)	\
	do {} while(0)

/*****************************************************************************
* FUNCTION: Smsc911xPlatform_FlushCache
*    Because we are using PIO cache functions are not necessary. This function
*    can be defined to nothing.
*****************************************************************************/
#define Smsc911xPlatform_FlushCache(interfaceIndex,bufferPtr,wordCount)	\
	do {} while(0)

/*****************************************************************************
* FUNCTION: Smsc911xPlatform_BeginWriting
*   Because we are using PIO the entire write operation will be done in this
*   function.
*****************************************************************************/
void Smsc911xPlatform_BeginWriting(
	int interfaceIndex, u8_t * buffer, u16_t byteCount,u16_t tag);

/*****************************************************************************
* FUNCTION: Smsc911xPlatform_IsWritingDone
*   Because we are using PIO the write operation is completed on the Begin call
*   so this function can be defined to always return 1.
*****************************************************************************/
#define Smsc911xPlatform_IsWritingDone(interfaceIndex) (1)

/*****************************************************************************
* FUNCTION: Smsc911xPlatform_BeginReading
*   Because we are using PIO the entire read operation will be done in this
*   function.
*****************************************************************************/
void Smsc911xPlatform_BeginReading(
	int interfaceIndex, u8_t * buffer, u16_t byteCount);

/*****************************************************************************
* FUNCTION: Smsc911xPlatform_IsReadingDone
*   Because we are using PIO the read operation is completed on the Begin call
*   so this function can be defined to always return 1.
*****************************************************************************/
#define Smsc911xPlatform_IsReadingDone(interfaceIndex) (1)

/***************************************************************************** 
* NOTE: The following functions are no longer used directly by the
*   driver, but they may be used internally by the platform layer. They were
*   designed for PIO only, the new interface supports DMA and/or PIO. Therefor
*   if the platform layer wishes to support PIO then the new interface may 
*   be implemented as a wrapper around the these PIO functions.
* 
* void Smsc911xPlatform_TxWriteFifo(
*    mem_ptr_t ioAddress, u32_t * buf, u16_t wordCount);
*
* void Smsc911xPlatform_RxReadFifo(
*    mem_ptr_t ioAddress, u32_t * buf, u16_t wordCount);
*
*****************************************************************************/

#endif

⌨️ 快捷键说明

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