#ifndef _aplmt_networking_uip_eth0api_h_ #define _aplmt_networking_uip_eth0api_h_ /*---------------------------------------------------------------------------- ** SUMMARY: APLMT Ethernet Hardware Driver for uIP Network Stack (UIPETH0) ** ** DESCRIPTION: ** This file defines the interface for the hardware/platform specific ** ethernet driver for uIP framework (UIPINET). All of these methods ** run in the context of the network thread and are called by the UIPINET ** framework, a.k.a. a polled driver model. However, if the hardware ** supports the generation of an interrupt when incoming packets are ** received, then the interrupt service routine that handles the ** 'RX' interrupt should call AplmtUIP_isr_inetSignal(). ** ** ** CONFIGURATION ** ------------- ** COMPILE: none ** ** APPLICATION: none ** ** PLATFORM: See your platform documentation. ** ** ** NOTES: ** 1. Unless explicitly stated otherwise, NONE of the following methods may be ** called from interrupt service routines. ** 2. Unless explicitly stated otherwise, NONE of the following methods may be ** called before the platform's kernel is running. ** 3. Unless explicitly stated otherwise, all of the following methods assume ** that interrupts are enabled at the time of the call. ----------------------------------------------------------------------------*/ #include "apl/types/types.h" /* For: basic types */ #include "platform/eth0api.h" /* For: platform specific support */ #ifdef __cplusplus extern "C" { #endif /*-------------- PUBLIC/PUBLISHED API --------------------------------------*/ /** This method initializes the low-level hardware network device driver. This method must be called before any of the following methods are called. */ void AplmtUIP_devEth0Initialize(void); /** This method is used read/receive a packet from the network. The incoming data is copied into UIP's global buffer: uip_buf[]. The method also sets UIP's global variable: uip_len, to the length of the incoming packet. If a packet was read then the method returns non-zero (true), else 0 (false) is returned. NOTES: o The device driver is required to store Link Level Headers, TCP/IP headers, and the packet data in the uip_buf. */ AplBool AplmtUIP_devEth0ReadPacket(void); /** This method is used to send/transmit a packet on the network. The data and its length is stored in UIP's global variables. The following code snippet demostrates how uIP organizes/stores the outbound data. hwsend( &uip_buf[0], UIP_LLH_LEN); // Link Level header hwsend( &uip_buf[UIP_LLH_LEN], 40); // TCP/IP Header hwsend( uip_appdata, uip_len - 40 - UIP_LLH_LEN); // Data */ void AplmtUIP_devEth0TransmitPacket(void); #ifdef __cplusplus } #endif /*--------------------------------------------------------------------------*/ #endif /* end _aplmt_networking_uip_eth0api_h_ */