Initialization

Microchip TCP/IP Stack

Microchip TCP/IP Stack Help
Initialization

You should start by initializing your hardware. This includes PPS pins, oscillators, LEDs, LCDs, any SPI or PMP modules you're using to control your hardware MAC/PHY chip, etc. 

Next, call the hardware initialization functions for the library. TickInit() should be called first; it will initialize the tick timer that manages your stack timing. Then call any additional initialization functions that require hardware initialization. For example, the MPFSInit() function will need to initialize an SPI port to communicate to a memory storage device to store web pages, so it should be called now. 

Once your hardware is initialized, you can begin configuring your stack. Most of the stack-related application variables are stored in the AppConfig structure. At this point, you should initialize the AppConfig structure with your default values, or provide another means of initializing the AppConfig structure. 

Finally, you can initialize the stack by calling the StackInit() function. This function will automatically call the initialization functions for other firmware protocols if they have been enabled in TCPIPConfig.h (i.e. TCPInit() for the TCP protocol, HTTPInit() for HTTP2,...). After StackInit() has been called, you can call other application-specific firmware initialization functions.

Microchip TCP/IP Stack 5.42.08 - June 15, 2013
Copyright © 2012 Microchip Technology, Inc.  All rights reserved.