/* ** Enable all the peripherals in use */ static void PeripheralsSetUp(void) { DMTimer2ModuleClkConfig(); DMTimer3ModuleClkConfig(); DMTimer4ModuleClkConfig(); RTCModuleClkConfig(); CPSWPinMuxSetup(); CPSWClkEnable(); EDMAModuleClkConfig(); GPIO1ModuleClkConfig(); GPIO1Pin23PinMuxSetup(); HSMMCSDPinMuxSetup(); HSMMCSDModuleClkConfig(); }
/* ** Enable all the peripherals in use */ static void PeripheralsSetUp(void) { enableModuleClock(CLK_UART0); enableModuleClock(CLK_I2C0); /* Timer6 is used for Standby wakeup */ enableModuleClock(CLK_TIMER6); GPIO0ModuleClkConfig(); DMTimer2ModuleClkConfig(); DMTimer3ModuleClkConfig(); DMTimer4ModuleClkConfig(); RTCModuleClkConfig(); CPSWPinMuxSetup(); CPSWClkEnable(); EDMAModuleClkConfig(); GPIO1ModuleClkConfig(); GPIO1Pin23PinMuxSetup(); HSMMCSDPinMuxSetup(); HSMMCSDModuleClkConfig(); I2CPinMuxSetup(0); }
/* ** The main function */ int main(void) { unsigned int ipAddr; LWIP_IF lwipIfPort1, lwipIfPort2; MMUConfigAndEnable(); #ifdef LWIP_CACHE_ENABLED CacheEnable(CACHE_ALL); #endif CPSWPinMuxSetup(); CPSWClkEnable(); /* Initialize console for communication with the Host Machine */ ConsoleUtilsInit(); /* Select the console type based on compile time check */ ConsoleUtilsSetType(CONSOLE_UART); /* Chip configuration RGMII selection */ EVMPortMIIModeSelect(); /* Get the MAC address */ EVMMACAddrGet(0, lwipIfPort1.macArray); EVMMACAddrGet(1, lwipIfPort2.macArray); AintcCPSWIntrSetUp(); //DelayTimerSetup(); ConsoleUtilsPrintf("\n\rStarterWare Ethernet Echo Application. \n\r\n\r" ); ConsoleUtilsPrintf("Acquiring IP Address for Port 1... \n\r" ); #if STATIC_IP_ADDRESS_PORT1 lwipIfPort1.instNum = 0; lwipIfPort1.slvPortNum = 1; lwipIfPort1.ipAddr = STATIC_IP_ADDRESS_PORT1; lwipIfPort1.netMask = 0; lwipIfPort1.gwAddr = 0; lwipIfPort1.ipMode = IPADDR_USE_STATIC; ipAddr = lwIPInit(&lwipIfPort1); #else lwipIfPort1.instNum = 0; lwipIfPort1.slvPortNum = 1; lwipIfPort1.ipAddr = 0; lwipIfPort1.netMask = 0; lwipIfPort1.gwAddr = 0; lwipIfPort1.ipMode = IPADDR_USE_DHCP; ipAddr = lwIPInit(&lwipIfPort1); #endif if(ipAddr) { ConsoleUtilsPrintf("\n\r\n\rPort 1 IP Address Assigned: "); IpAddrDisplay(ipAddr); } else { ConsoleUtilsPrintf("\n\r\n\rPort 1 IP Address Acquisition Failed."); } /* Initialize the sample httpd server. */ echo_init(); /* Loop forever. All the work is done in interrupt handlers. */ while(1) { ; /* Perform nothing */ } }
/** * @brief Initializes low level device. * */ static inline void cpswInit(void) { CPSWPinMuxSetup(); CPSWClkEnable(); }