📄 sps.h
字号:
/* Auto generation time stamp: 8/6/2008 12:43:58 PM*/
/*
* Copyright (c) 2001-2004 Swedish Institute of Computer Science.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
* SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
* OF SUCH DAMAGE.
*
* This file is part of the lwIP TCP/IP stack.
*
* Author: Adam Dunkels <adam@sics.se>
*
*/
/*
Modifications of this software Copyright(C) 2008, Standard Microsystems Corporation
All Rights Reserved.
The modifications to this program code are proprietary to SMSC and may not be copied,
distributed, or used without a license to do so. Such license may have
Limited or Restricted Rights. Please refer to the license for further
clarification.
*/
#ifndef SPS_H
#define SPS_H
#define Udp_UnBind K0t
#define Udp_SetReceiverCallBack X6H
#define Udp_SetFlags imT
#define Udp_SendTo LUI
#define Udp_Send fDx
#define UDP_RECEIVE_FUNCTION B3Y
#define Udp_GetRemotePort c8W
#define Udp_GetRemoteAddress LEt
#define Udp_GetFlags asX
#define Udp_FreeControlBlock vA2
#define Udp_Disconnect O5k
#define Udp_CreateControlBlock TNk
#define UDP_CONTROL_BLOCK d_n
#define Udp_Connect Pl_
#define Udp_Bind q1K
#define Udp_AllocatePacket bcN
#define Tcp_SetSentCallBack mA4
#define Tcp_SetReceiveCallBack M2W
#define Tcp_SetErrorCallBack M8T
#define Tcp_SetCallBackArgument hxd
#define Tcp_SetAcceptCallBack efq
#define TCP_SENT_CALLBACK r8c
#define Tcp_SendQueuedData GUM
#define TCP_RECEIVE_CALLBACK hXS
#define Tcp_QueueData JDT
#define Tcp_NewControlBlock MII
#define Tcp_Listen cU3
#define Tcp_GetRemotePort dSB
#define Tcp_GetRemoteAddress J8b
#define Tcp_GetMaximumSegmentSize ASu
#define Tcp_GetCallBackArgument cS7
#define Tcp_GetAvailableSendSpace YlO
#define Tcp_FreeControlBlock pMQ
#define TCP_ERROR_CALLBACK RMw
#define TCP_CONTROL_BLOCK VX2
#define TCP_CONNECTED_CALLBACK C4h
#define Tcp_Connect lOX
#define Tcp_Close a0A
#define Tcp_Bind pM2
#define Tcp_AllocateDataBuffers Vgv
#define Tcp_AllocateControlBlock Mn0
#define Tcp_AcknowledgeReceivedData ouX
#define TCP_ACCEPT_CALLBACK Gke
#define TaskManager_ScheduleByTimer uQj
#define TaskManager_ScheduleByInterruptActivation qV7
#define TaskManager_ScheduleAsSoonAsPossible aD9
#define TaskManager_InterruptActivation d3H
#define TaskManager_CancelTask EzK
#define Task_SetParameter ShI
#define Task_SetAlwaysOnInterruptActivationList bkB
#define Task_IsIdle rEp
#define TASK_FUNCTION cc2
#define Task_Free ulq
#define Task_Allocate cdc
#define TASK YpA
#define Sps_StopRunning RNE
#define Sps_StartDhcp AcV
#define Sps_SetIpv4Addresses Ska
#define Sps_Run pZm
#define Sps_Initialize r_9
#define Sps_GetIpv4Addresses KWQ
#define Sps_EnableInterface H6c
#define Sps_DisableInterface uyP
#define Sps_DhcpStop Yzj
#define Sps_DhcpRenew xqi
#define Sps_DhcpRelease cP0
#define Sps_DhcpInform OWs
#define PIPV4_ADDRESS rMB
#define PacketBuffer_SetTotalLength Nbo
#define PacketBuffer_SetThisLength n82
#define PacketBuffer_SetNextPointer vpv
#define PacketBuffer_SetNext Oxg
#define PacketBuffer_MoveStartPoint bMs
#define PacketBuffer_IncreaseReference mLu
#define PacketBuffer_GetTotalLength cDc
#define PacketBuffer_GetThisLength nxz
#define PacketBuffer_GetTailBuffer ABv
#define PacketBuffer_GetStartPoint I2W
#define PacketBuffer_GetSetNext jeF
#define PacketBuffer_GetNextPointer HmP
#define PacketBuffer_GetNext rU0
#define PacketBuffer_DecreaseReference Ue6
#define PacketBuffer_CopyToExternalBuffer Yhx
#define PacketBuffer_CopyFromExternalBuffer Zeg
#define PACKET_QUEUE Ryq
#define PACKET_BUFFER nhG
#define NETWORK_INTERFACE NRw
#define IPV4_ADDRESS_TO_STRING he6
#define IPV4_ADDRESS_IS_BROADCAST MUn
#define IPV4_ADDRESS_BROADCAST ZKx
#define IPV4_ADDRESS_ANY n0J
#define IPV4_ADDRESS y8Y
#define Icmpv4_SendEchoRequest Xrf
#define ICMPV4_ECHO_REPLY_CALLBACK onV
#define Icmpv4_AllocatePacket I8f
#define err_t DWA
/* Debug bits */
#define DEBUG_TRACE_BIT (0x10)
#define DEBUG_NOTICE_BIT (0x20)
#define DEBUG_WARNING_BIT (0x40)
#define DEBUG_WARNING_LEVEL (DEBUG_WARNING_BIT)
#define DEBUG_NOTICE_LEVEL ((DEBUG_WARNING_BIT)|(DEBUG_NOTICE_BIT))
#define DEBUG_TRACE_LEVEL ((DEBUG_WARNING_BIT)|(DEBUG_NOTICE_BIT)|(DEBUG_TRACE_BIT))
#define BIG_ENDIAN (0x1234)
#define LITTLE_ENDIAN (0x4321)
/*****************************************************************************
* INCLUDE FILE: smsc_environment.h
* DESCRIPTION:
* This file is where the platform specific features are declared.
* There are requirements that this file must conform to in order to make
* the system work. Those requirements are described below in this comment
* block.
******************************************************************************
* TYPES:
* The following types must be defined in smsc_environment.h
* u8_t, this is an unsigned 8 bit integer
* s8_t, this is a signed 8 bit integer
* u16_t, this is an unsigned 16 bit integer
* s16_t, this is a signed 16 bit integer
* u32_t, this is an unsigned 32 bit integer
* s32_t, this is a signed 32 bit integer
* mem_ptr_t, is an unsigned integer whos bit width is the same as a pointer (void *)
******************************************************************************
* FORMAT_STRINGS:
* The following format strings are used to ensure that print messages are
* also platform independent.
* U16_F, is a format string that specifies a 16 bit unsigned integer
* S16_F, is a format string that specifies a 16 bit signed integer
* X16_F, is a format string that specifies a 16 bit integer in hexadecimal form
* U32_F, is a format string that specifies a 32 bit unsigned integer
* S32_F, is a format string that specifies a 32 bit signed integer
* X32_F, is a format string that specifies a 32 bit integer in hexadecimal form
* example definition:
* #define U16_F "hu"
* how it may be used in code:
* SMSC_TRACE(1,("counter = %"U16_F,counter));
******************************************************************************
* MACRO: ENDIAN_SETTING
* DESCRIPTION:
* This macro that must be defined to BIG_ENDIAN if the platform
* is big endian. Or else this macro must be defined to LITTLE_ENDIAN if
* the platform is little endian. No other settings are valid.
* example:
* #define ENDIAN_SETTING LITTLE_ENDIAN
******************************************************************************
* MACRO: SMSC_PLATFORM_MESSAGE(message)
* DESCRIPTION:
* This is a macro that prints a message to a diagnostic output console.
* the parameter "message" takes the form of standard printf parameters.
* How it may be used in code:
* SMSC_PLATFORM_MESSAGE(("I am %d years old",myAge));
******************************************************************************
* MACRO: SMSC_PLATFORM_HALT_MESSAGE(message)
* DESCRIPTION:
* This macro behaves the same as SMSC_PLATFORM_MESSAGE except that after
* printing the message the system halts and does not continue program
* execution. This macro should never return.
******************************************************************************
* TYPE: smsc_clock_t
* DESCRIPTION:
* This type is used for storing time values that can be used in
* smsc_time_now, smsc_time_plus, smsc_time_minus, smsc_time_after,
* smsc_tick_to_sec, smsc_sec_to_tick,
* smsc_tick_to_msec, smsc_msec_to_tick,
* smsc_tick_to_usec, smsc_usec_to_tick
******************************************************************************
* FUNCTION: smsc_time_now()
* RETURN VALUE:
* returns an smsc_clock_t that represents the present time.
******************************************************************************
* FUNCTION: smsc_time_plus(smsc_clock_t t1, smsc_clock_t t2)
* DESCRIPTION:
* Adds two time values and returns the result. The caller ensures that one
* of the times is a time offset or a relative time value. It is not legal
* to add two absolute time values since the origin is not defined by
* this specification. So this function can be used to add an absolute time
* to a relative time, or it can be used to add a relative time to a
* relative time.
* PARAMETERS:
* smsc_clock_t t1, represents one of the time values to add.
* smsc_clock_t t2, represents one of the time values to add.
* RETURN
* returns a smsc_clock_t that represents the sum of the two time values.
******************************************************************************
* FUNCTION: smsc_time_minus(smsc_clock_t t1, smsc_clock_t t2)
* DESCRIPTION:
* Subtracts one time value from another time value. This is usually used
* to figure a relative time value from two absolute time values.
* PARAMETERS:
* smsc_clock_t t1, represents t1 of (t1-t2)
* smsc_clock_t t2, represents t2 of (t1-t2)
* RETURN VALUE:
* returns a smsc_clock_t that represents (t1-t2). Or in other words it
* returns a relative time whose origin is t2.
******************************************************************************
* FUNCTION: smsc_time_after(smsc_clock_t t1, smsc_clock_t t2)
* DESCRIPTION:
* Determine the relative time order between two time values. The two time
* values can be assumed to be based around the same origin.
* PARAMETERS:
* smsc_clock_t t1, represents a time value
* smsc_clock_t t2, represents a time value
* RETURN VALUE:
* returns 1 if t1 is after t2.
* returns 0 if t1 is before or equal to t2.
******************************************************************************
* The following functions/macros are used to translate the units of
* smsc_clock_t into or from the units of seconds, milliseconds, and microseconds
*
* smsc_tick_to_sec, translates a smsc_clock_t into the number of seconds.
* smsc_sec_to_tick, translates a number of seconds into a smsc_clock_t
* smsc_tick_to_msec, translates a smsc_clock_t into the number of milliseconds.
* smsc_msec_to_tick, translates a number of milliseconds into a smsc_clock_t
* smsc_tick_to_usec, translates a smsc_clock_t into the number of microseconds.
* smsc_usec_to_tick, translates a number of microseconds into a smsc_clock_t
*
* how it is used in code:
* msecs=smsc_tick_to_msec(ticks);
* ticks=smsc_msec_to_tick(msecs);
******************************************************************************
* The following delay macros are used to wait a specified time period.
* It is not required that they release the CPU to other threads. They may
* just spin until the specified time has expired. However they may be
* implemented to release the CPU to other threads if that seems useful.
*
* smsc_mdelay, waits a specified number of milliseconds
* smsc_udelay, waits a specified number of microseconds
*
* how it is used in code:
* smsc_mdelay(milliSeconds);
* smsc_udelay(microSeconds);
******************************************************************************
* The following functions are used for interrupt synchronization function
*
* smsc_disable_interrupts requires that all interrupts are disabled
* smsc_enable interrupts requires that all interrupts are enabled
*
* how it is used in code:
* smsc_disable_interrupts();
* smsc_enable_interrupts();
******************************************************************************
* FUNCTION: smsc_initialize
* DESCRIPTION:
* This is the first function to be called in the entire SMSC Network Stack.
* It is required to handle any platform specific initialization that is
* necessary to make sure all the other functions work properly.
* RETURN VALUE:
* none. If there are initialization errors, then it is assumed that
* nothing will function properly, so it is recommended that errors are
* handled by printing a message and halting the system.
******************************************************************************
* FUNCTION: SMSC_IPCHECKSUM(void * dataptr, int len)
* DESCRIPTION:
* This function handles data checksuming according to the IP specification.
* PARAMETERS:
* void * dataptr, this is a pointer to the buffer that should be checksummed
* int len, this is the length of the buffer that should be checksummed
* RETURN VALUE:
* Returns the IP check sum as a u16_t
******************************************************************************
* All the previous types, macros, and functions described in this comment
* block must be implemented in smsc_environment.h which is included below.
*****************************************************************************/
#include "smsc_environment.h"
/*
SMSC_THREADING_ENABLED:
set to 1 to enable multithreaded support functions.
set to 0 to disable multithreaded support functions.
The core network stack is designed to run in a single threaded
environment. This provides about a 20% performance boost on
some embedded platforms. It would be advantagous if all
applications were written to run in this single threaded
environment (see task_manager.h for how to create tasks that
run in the single threaded environment). This eliminates the
need for context switches and synchronization primatives.
However some may not have the time to port their applications to
this single theaded environment. For this reason the socket API is
provided but the developer should be aware that the socket API requires
a multithreaded environment, which is expected to have lower
throughput speeds.
*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -