]> git.sur5r.net Git - freertos/commitdiff
Update the Red Suite LPC1768 project and source to use the latest version of the...
authorrichardbarry <richardbarry@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Thu, 25 Nov 2010 13:21:39 +0000 (13:21 +0000)
committerrichardbarry <richardbarry@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Thu, 25 Nov 2010 13:21:39 +0000 (13:21 +0000)
git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@1167 1d2547de-c912-0410-9cb9-b8ca96c0e9e2

Demo/CORTEX_LPC1768_GCC_RedSuite/.cproject
Demo/CORTEX_LPC1768_GCC_RedSuite/src/FreeRTOSConfig.h
Demo/CORTEX_LPC1768_GCC_RedSuite/src/LPCUSB/usbhw_lpc.c
Demo/CORTEX_LPC1768_GCC_RedSuite/src/ParTest.c
Demo/CORTEX_LPC1768_GCC_RedSuite/src/cr_startup_lpc17.c
Demo/CORTEX_LPC1768_GCC_RedSuite/src/main.c
Demo/CORTEX_LPC1768_GCC_RedSuite/src/webserver/emac.c
Demo/CORTEX_LPC1768_GCC_RedSuite/src/webserver/uIP_Task.c

index 8da0d6d2280947ed58a5f5b72bcdee076ed8cc39..8b14ac94df6948396e24126102504e198ddee19d 100644 (file)
@@ -30,6 +30,7 @@
 <listOptionValue builtIn="false" value="PACK_STRUCT_END=__attribute\(\(packed\)\)"/>\r
 <listOptionValue builtIn="false" value="ALIGN_STRUCT_END=__attribute\(\(aligned\(4\)\)\)"/>\r
 <listOptionValue builtIn="false" value="__CODE_RED"/>\r
+<listOptionValue builtIn="false" value="__REDLIB__"/>\r
 </option>\r
 <option id="gnu.c.compiler.option.misc.other.644577272" name="Other flags" superClass="gnu.c.compiler.option.misc.other" value="-c -fmessage-length=0 -fno-builtin -ffunction-sections -Wextra" valueType="string"/>\r
 <option id="gnu.c.compiler.option.preprocessor.nostdinc.242908842" name="Do not search system directories (-nostdinc)" superClass="gnu.c.compiler.option.preprocessor.nostdinc"/>\r
 <tool id="com.crt.advproject.gas.exe.debug.152194393" name="MCU Assembler" superClass="com.crt.advproject.gas.exe.debug">\r
 <option id="com.crt.advproject.gas.arch.856827611" name="Architecture" superClass="com.crt.advproject.gas.arch" value="com.crt.advproject.gas.target.cm3" valueType="enumerated"/>\r
 <option id="com.crt.advproject.gas.thumb.1906562556" name="Thumb mode" superClass="com.crt.advproject.gas.thumb" value="true" valueType="boolean"/>\r
-<option id="gnu.both.asm.option.flags.crt.638939077" name="Assembler flags" superClass="gnu.both.asm.option.flags.crt" value="-c -x assembler-with-cpp -DDEBUG -D__CODE_RED" valueType="string"/>\r
+<option id="gnu.both.asm.option.flags.crt.638939077" name="Assembler flags" superClass="gnu.both.asm.option.flags.crt" value="-c -x assembler-with-cpp -DDEBUG -D__CODE_RED -D__REDLIB__ " valueType="string"/>\r
 <inputType id="com.crt.advproject.assembler.input.1954791986" name="Additional Assembly Source Files" superClass="com.crt.advproject.assembler.input"/>\r
 </tool>\r
 <tool id="com.crt.advproject.link.cpp.exe.debug.696640668" name="MCU C++ Linker" superClass="com.crt.advproject.link.cpp.exe.debug"/>\r
 <tool id="com.crt.advproject.link.exe.debug.1514106711" name="MCU Linker" superClass="com.crt.advproject.link.exe.debug">\r
 <option id="com.crt.advproject.link.arch.420484637" name="Architecture" superClass="com.crt.advproject.link.arch" value="com.crt.advproject.link.target.cm3" valueType="enumerated"/>\r
 <option id="com.crt.advproject.link.thumb.1827721661" name="Thumb mode" superClass="com.crt.advproject.link.thumb" value="true" valueType="boolean"/>\r
-<option id="com.crt.advproject.link.script.285435470" name="Linker script" superClass="com.crt.advproject.link.script" value="&quot;${workspace_loc:/RTOSDemo_RDB1768/src/rtosdemo_rdb1768_Debug.ld}&quot;" valueType="string"/>\r
-<option id="com.crt.advproject.link.manage.913993351" name="Manage linker script" superClass="com.crt.advproject.link.manage" value="false" valueType="boolean"/>\r
+<option id="com.crt.advproject.link.script.285435470" name="Linker script" superClass="com.crt.advproject.link.script" value="RTOSDemo_RDB1768.ld" valueType="string"/>\r
+<option id="com.crt.advproject.link.manage.913993351" name="Manage linker script" superClass="com.crt.advproject.link.manage" value="true" valueType="boolean"/>\r
 <option id="gnu.c.link.option.nostdlibs.1027293252" name="No startup or default libs (-nostdlib)" superClass="gnu.c.link.option.nostdlibs" value="true" valueType="boolean"/>\r
 <option id="gnu.c.link.option.other.762506621" name="Other options (-Xlinker [option])" superClass="gnu.c.link.option.other" valueType="stringList">\r
 <listOptionValue builtIn="false" value="--gc-sections"/>\r
 <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>\r
 <storageModule moduleId="org.eclipse.cdt.core.language.mapping"/>\r
 <storageModule moduleId="org.eclipse.cdt.make.core.buildtargets"/>\r
+<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>\r
 </cconfiguration>\r
 <cconfiguration id="com.crt.advproject.config.exe.release.429003282">\r
 <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.crt.advproject.config.exe.release.429003282" moduleId="org.eclipse.cdt.core.settings" name="Release">\r
 <option id="gnu.c.compiler.option.preprocessor.def.symbols.1242089509" name="Defined symbols (-D)" superClass="gnu.c.compiler.option.preprocessor.def.symbols" valueType="definedSymbols">\r
 <listOptionValue builtIn="false" value="NDEBUG"/>\r
 <listOptionValue builtIn="false" value="__CODE_RED"/>\r
+<listOptionValue builtIn="false" value="__REDLIB__"/>\r
 </option>\r
 <option id="gnu.c.compiler.option.misc.other.1084357971" name="Other flags" superClass="gnu.c.compiler.option.misc.other" value="-c -fmessage-length=0 -fno-builtin -ffunction-sections" valueType="string"/>\r
 <inputType id="com.crt.advproject.compiler.input.1760064385" superClass="com.crt.advproject.compiler.input"/>\r
 <tool id="com.crt.advproject.gas.exe.release.340210131" name="MCU Assembler" superClass="com.crt.advproject.gas.exe.release">\r
 <option id="com.crt.advproject.gas.arch.1089759047" name="Architecture" superClass="com.crt.advproject.gas.arch" value="com.crt.advproject.gas.target.cm3" valueType="enumerated"/>\r
 <option id="com.crt.advproject.gas.thumb.147071109" name="Thumb mode" superClass="com.crt.advproject.gas.thumb" value="true" valueType="boolean"/>\r
-<option id="gnu.both.asm.option.flags.crt.2019607838" name="Assembler flags" superClass="gnu.both.asm.option.flags.crt" value="-c -x assembler-with-cpp -DNDEBUG -D__CODE_RED" valueType="string"/>\r
+<option id="gnu.both.asm.option.flags.crt.2019607838" name="Assembler flags" superClass="gnu.both.asm.option.flags.crt" value="-c -x assembler-with-cpp -DNDEBUG -D__CODE_RED -D__REDLIB__ " valueType="string"/>\r
 <inputType id="com.crt.advproject.assembler.input.1748919550" name="Additional Assembly Source Files" superClass="com.crt.advproject.assembler.input"/>\r
 </tool>\r
 <tool id="com.crt.advproject.link.cpp.exe.release.116216997" name="MCU C++ Linker" superClass="com.crt.advproject.link.cpp.exe.release"/>\r
 <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>\r
 <storageModule moduleId="org.eclipse.cdt.core.language.mapping"/>\r
 <storageModule moduleId="org.eclipse.cdt.make.core.buildtargets"/>\r
+<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>\r
 </cconfiguration>\r
 </storageModule>\r
 <storageModule moduleId="cdtBuildSystem" version="4.0.0">\r
 <projectStorage>&lt;?xml version="1.0" encoding="UTF-8"?&gt;&#13;\r
 &lt;TargetConfig&gt;&#13;\r
 &lt;Properties property_0="" property_1="" property_2="" property_3="NXP" property_4="LPC1768" property_count="5" version="1"/&gt;&#13;\r
-&lt;infoList vendor="NXP"&gt;&lt;info chip="LPC1768" match_id="0x00013f37,0x26013F37" name="LPC1768" package="lpc17_lqfp100.xml"&gt;&lt;chip&gt;&lt;name&gt;LPC1768&lt;/name&gt;&#13;\r
+&lt;infoList vendor="NXP"&gt;&#13;\r
+&lt;info chip="LPC1768" match_id="0x00013f37,0x26013F37" name="LPC1768" package="lpc17_lqfp100.xml"&gt;&#13;\r
+&lt;chip&gt;&#13;\r
+&lt;name&gt;LPC1768&lt;/name&gt;&#13;\r
 &lt;family&gt;LPC17xx&lt;/family&gt;&#13;\r
 &lt;vendor&gt;NXP (formerly Philips)&lt;/vendor&gt;&#13;\r
 &lt;reset board="None" core="Real" sys="Real"/&gt;&#13;\r
 &lt;memoryInstance derived_from="RAM" id="RamAHB32" location="0x2007c000" size="0x8000"/&gt;&#13;\r
 &lt;prog_flash blocksz="0x1000" location="0" maxprgbuff="0x1000" progwithcode="TRUE" size="0x10000"/&gt;&#13;\r
 &lt;prog_flash blocksz="0x8000" location="0x10000" maxprgbuff="0x1000" progwithcode="TRUE" size="0x70000"/&gt;&#13;\r
-&lt;peripheralInstance derived_from="LPC17_NVIC" determined="infoFile" id="NVIC" location="0xE000E000"/&gt;&#13;\r
+&lt;peripheralInstance derived_from="SVD_NVIC" determined="infoFile" id="NVIC" location="0xE000E000"/&gt;&#13;\r
 &lt;peripheralInstance derived_from="TIMER" determined="infoFile" enable="SYSCTL.PCONP.PCTIM0&amp;amp;0x1" id="TIMER0" location="0x40004000"/&gt;&#13;\r
 &lt;peripheralInstance derived_from="TIMER" determined="infoFile" enable="SYSCTL.PCONP.PCTIM1&amp;amp;0x1" id="TIMER1" location="0x40008000"/&gt;&#13;\r
 &lt;peripheralInstance derived_from="TIMER" determined="infoFile" enable="SYSCTL.PCONP.PCTIM2&amp;amp;0x1" id="TIMER2" location="0x40090000"/&gt;&#13;\r
 &lt;peripheralInstance derived_from="LPC17_I2S" determined="infoFile" enable="SYSCTL.PCONP&amp;amp;0x08000000" id="I2S" location="0x400A8000"/&gt;&#13;\r
 &lt;peripheralInstance derived_from="LPC17_SYSCTL" determined="infoFile" id="SYSCTL" location="0x400FC000"/&gt;&#13;\r
 &lt;peripheralInstance derived_from="LPC17_DAC" determined="infoFile" enable="PCB.PINSEL1.P0_26&amp;amp;0x2=2" id="DAC" location="0x4008C000"/&gt;&#13;\r
-&lt;peripheralInstance derived_from="LPC1xxx_UART" determined="infoFile" enable="SYSCTL.PCONP.PCUART0&amp;amp;0x1" id="UART0" location="0x4000C000"/&gt;&#13;\r
-&lt;peripheralInstance derived_from="LPC1xxx_UART_MODEM" determined="infoFile" enable="SYSCTL.PCONP.PCUART1&amp;amp;0x1" id="UART1" location="0x40010000"/&gt;&#13;\r
-&lt;peripheralInstance derived_from="LPC1xxx_UART" determined="infoFile" enable="SYSCTL.PCONP.PCUART2&amp;amp;0x1" id="UART2" location="0x40098000"/&gt;&#13;\r
-&lt;peripheralInstance derived_from="LPC1xxx_UART" determined="infoFile" enable="SYSCTL.PCONP.PCAURT3&amp;amp;0x1" id="UART3" location="0x4009C000"/&gt;&#13;\r
+&lt;peripheralInstance derived_from="LPC17xx_UART" determined="infoFile" enable="SYSCTL.PCONP.PCUART0&amp;amp;0x1" id="UART0" location="0x4000C000"/&gt;&#13;\r
+&lt;peripheralInstance derived_from="LPC17xx_UART_MODEM" determined="infoFile" enable="SYSCTL.PCONP.PCUART1&amp;amp;0x1" id="UART1" location="0x40010000"/&gt;&#13;\r
+&lt;peripheralInstance derived_from="LPC17xx_UART" determined="infoFile" enable="SYSCTL.PCONP.PCUART2&amp;amp;0x1" id="UART2" location="0x40098000"/&gt;&#13;\r
+&lt;peripheralInstance derived_from="LPC17xx_UART" determined="infoFile" enable="SYSCTL.PCONP.PCUART3&amp;amp;0x1" id="UART3" location="0x4009C000"/&gt;&#13;\r
 &lt;peripheralInstance derived_from="SPI" determined="infoFile" enable="SYSCTL.PCONP.PCSPI&amp;amp;0x1" id="SPI" location="0x40020000"/&gt;&#13;\r
 &lt;peripheralInstance derived_from="LPC17_SSP" determined="infoFile" enable="SYSCTL.PCONP.PCSSP0&amp;amp;0x1" id="SSP0" location="0x40088000"/&gt;&#13;\r
 &lt;peripheralInstance derived_from="LPC17_SSP" determined="infoFile" enable="SYSCTL.PCONP.PCSSP1&amp;amp;0x1" id="SSP1" location="0x40030000"/&gt;&#13;\r
 &lt;peripheralInstance derived_from="LPC17_RTC" determined="infoFile" enable="SYSCTL.PCONP.PCRTC&amp;amp;0x1" id="RTC" location="0x40024000"/&gt;&#13;\r
 &lt;peripheralInstance derived_from="MPU" determined="infoFile" id="MPU" location="0xE000ED90"/&gt;&#13;\r
 &lt;peripheralInstance derived_from="LPC1x_WDT" determined="infoFile" id="WDT" location="0x40000000"/&gt;&#13;\r
+&lt;peripheralInstance derived_from="LPC17_FLASHCFG" determined="infoFile" id="FLASHACCEL" location="0x400FC000"/&gt;&#13;\r
+&lt;peripheralInstance derived_from="GPIO_INT" determined="infoFile" id="GPIOINTMAP" location="0x40028080"/&gt;&#13;\r
+&lt;memoryInstance derived_from="RAM" id="CANAccFilterRAM" location="0x40038000" size="0x800"/&gt;&#13;\r
+&lt;peripheralInstance derived_from="LPC17_CANAFR" determined="infoFile" enable="SYSCTL.PCONP.PCCAN1&amp;amp;0x1|SYSCTL.PCONP.PCCAN2&amp;amp;0x1" id="CANAFR" location="0x4003C000"/&gt;&#13;\r
+&lt;peripheralInstance derived_from="LPC17_CANCEN" determined="infoFile" enable="SYSCTL.PCONP.PCCAN1&amp;amp;0x1|SYSCTL.PCONP.PCCAN2&amp;amp;0x1" id="CANCEN" location="0x40040000"/&gt;&#13;\r
+&lt;peripheralInstance derived_from="LPC17_CANWAKESLEEP" determined="infoFile" id="CANWAKESLEEP" location="0x400FC110"/&gt;&#13;\r
+&lt;peripheralInstance derived_from="LPC17_CANCON" determined="infoFile" enable="SYSCTL.PCONP.PCCAN1&amp;amp;0x1" id="CANCON1" location="0x40044000"/&gt;&#13;\r
+&lt;peripheralInstance derived_from="LPC17_CANCON" determined="infoFile" enable="SYSCTL.PCONP.PCCAN2&amp;amp;0x1" id="CANCON2" location="0x40048000"/&gt;&#13;\r
 &lt;/chip&gt;&#13;\r
-&lt;processor&gt;&lt;name gcc_name="cortex-m3"&gt;Cortex-M3&lt;/name&gt;&#13;\r
+&lt;processor&gt;&#13;\r
+&lt;name gcc_name="cortex-m3"&gt;Cortex-M3&lt;/name&gt;&#13;\r
 &lt;family&gt;Cortex-M&lt;/family&gt;&#13;\r
 &lt;/processor&gt;&#13;\r
 &lt;link href="nxp_lpcxxxx_peripheral.xme" show="embed" type="simple"/&gt;&#13;\r
index 1bd15138b9b6dae0f720c87a1c767b9133e184ec..64884dc19eb40492c78a97063880a2e6e27a78fa 100644 (file)
@@ -153,7 +153,7 @@ numeric value the higher the interrupt priority). */
  *-----------------------------------------------------------*/\r
 extern void vConfigureTimerForRunTimeStats( void );\r
 #define portCONFIGURE_TIMER_FOR_RUN_TIME_STATS() vConfigureTimerForRunTimeStats()\r
-#define portGET_RUN_TIME_COUNTER_VALUE() TIM0->TC\r
+#define portGET_RUN_TIME_COUNTER_VALUE() LPC_TIM0->TC\r
 \r
 \r
 #endif /* FREERTOS_CONFIG_H */\r
index db79c36a06c7da7e8bdcaaf3004adb59af0831d0..70f8f86531b93ae6251d70cb13c15df89874afeb 100644 (file)
@@ -62,9 +62,9 @@ static TFnFrameHandler        *_pfnFrameHandler = NULL;
 static void Wait4DevInt(unsigned long dwIntr)\r
 {\r
        // wait for specific interrupt\r
-       while ((USB->USBDevIntSt & dwIntr) != dwIntr);\r
+       while ((LPC_USB->USBDevIntSt & dwIntr) != dwIntr);\r
        // clear the interrupt bits\r
-       USB->USBDevIntClr = dwIntr;\r
+       LPC_USB->USBDevIntClr = dwIntr;\r
 }\r
 \r
 \r
@@ -76,9 +76,9 @@ static void Wait4DevInt(unsigned long dwIntr)
 static void USBHwCmd(unsigned char bCmd)\r
 {\r
        // clear CDFULL/CCEMTY\r
-       USB->USBDevIntClr = CDFULL | CCEMTY;\r
+       LPC_USB->USBDevIntClr = CDFULL | CCEMTY;\r
        // write command code\r
-       USB->USBCmdCode = 0x00000500 | (bCmd << 16);\r
+       LPC_USB->USBCmdCode = 0x00000500 | (bCmd << 16);\r
        Wait4DevInt(CCEMTY);\r
 }\r
 \r
@@ -95,7 +95,7 @@ static void USBHwCmdWrite(unsigned char bCmd, unsigned short bData)
        USBHwCmd(bCmd);\r
 \r
        // write command data\r
-       USB->USBCmdCode = 0x00000100 | (bData << 16);\r
+       LPC_USB->USBCmdCode = 0x00000100 | (bData << 16);\r
        Wait4DevInt(CCEMTY);\r
 }\r
 \r
@@ -113,9 +113,9 @@ static unsigned char USBHwCmdRead(unsigned char bCmd)
        USBHwCmd(bCmd);\r
        \r
        // get data\r
-       USB->USBCmdCode = 0x00000200 | (bCmd << 16);\r
+       LPC_USB->USBCmdCode = 0x00000200 | (bCmd << 16);\r
        Wait4DevInt(CDFULL);\r
-       return USB->USBCmdData;\r
+       return LPC_USB->USBCmdData;\r
 }\r
 \r
 \r
@@ -132,9 +132,9 @@ static unsigned char USBHwCmdRead(unsigned char bCmd)
  */\r
 static void USBHwEPRealize(int idx, unsigned short wMaxPSize)\r
 {\r
-       USB->USBReEP |= (1 << idx);\r
-       USB->USBEpInd = idx;\r
-       USB->USBMaxPSize = wMaxPSize;\r
+       LPC_USB->USBReEP |= (1 << idx);\r
+       LPC_USB->USBEpInd = idx;\r
+       LPC_USB->USBMaxPSize = wMaxPSize;\r
        Wait4DevInt(EP_RLZED);\r
 }\r
 \r
@@ -189,8 +189,8 @@ void USBHwRegisterEPIntHandler(unsigned char bEP, TFnEPIntHandler *pfnHandler)
        _apfnEPIntHandlers[idx / 2] = pfnHandler;\r
        \r
        /* enable EP interrupt */\r
-       USB->USBEpIntEn |= (1 << idx);\r
-       USB->USBDevIntEn |= EP_SLOW;\r
+       LPC_USB->USBEpIntEn |= (1 << idx);\r
+       LPC_USB->USBDevIntEn |= EP_SLOW;\r
        \r
        DBG("Registered handler for EP 0x%x\n", bEP);\r
 }\r
@@ -206,7 +206,7 @@ void USBHwRegisterDevIntHandler(TFnDevIntHandler *pfnHandler)
        _pfnDevIntHandler = pfnHandler;\r
        \r
        // enable device interrupt\r
-       USB->USBDevIntEn |= DEV_STAT;\r
+       LPC_USB->USBDevIntEn |= DEV_STAT;\r
 \r
        DBG("Registered handler for device status\n");\r
 }\r
@@ -222,7 +222,7 @@ void USBHwRegisterFrameHandler(TFnFrameHandler *pfnHandler)
        _pfnFrameHandler = pfnHandler;\r
        \r
        // enable device interrupt\r
-       USB->USBDevIntEn |= FRAME;\r
+       LPC_USB->USBDevIntEn |= FRAME;\r
 \r
        DBG("Registered handler for frame\n");\r
 }\r
@@ -313,14 +313,14 @@ int USBHwEPWrite(unsigned char bEP, unsigned char *pbBuf, int iLen)
        idx = EP2IDX(bEP);\r
        \r
        // set write enable for specific endpoint\r
-       USB->USBCtrl = WR_EN | ((bEP & 0xF) << 2);\r
+       LPC_USB->USBCtrl = WR_EN | ((bEP & 0xF) << 2);\r
        \r
        // set packet length\r
-       USB->USBTxPLen = iLen;\r
+       LPC_USB->USBTxPLen = iLen;\r
        \r
        // write data\r
-       while (USB->USBCtrl & WR_EN) {\r
-               USB->USBTxData = (pbBuf[3] << 24) | (pbBuf[2] << 16) | (pbBuf[1] << 8) | pbBuf[0];\r
+       while (LPC_USB->USBCtrl & WR_EN) {\r
+               LPC_USB->USBTxData = (pbBuf[3] << 24) | (pbBuf[2] << 16) | (pbBuf[1] << 8) | pbBuf[0];\r
                pbBuf += 4;\r
        }\r
 \r
@@ -350,11 +350,11 @@ int USBHwEPRead(unsigned char bEP, unsigned char *pbBuf, int iMaxLen)
        idx = EP2IDX(bEP);\r
        \r
        // set read enable bit for specific endpoint\r
-       USB->USBCtrl = RD_EN | ((bEP & 0xF) << 2);\r
+       LPC_USB->USBCtrl = RD_EN | ((bEP & 0xF) << 2);\r
        \r
        // wait for PKT_RDY\r
        do {\r
-               dwLen = USB->USBRxPLen;\r
+               dwLen = LPC_USB->USBRxPLen;\r
        } while ((dwLen & PKT_RDY) == 0);\r
        \r
        // packet valid?\r
@@ -369,7 +369,7 @@ int USBHwEPRead(unsigned char bEP, unsigned char *pbBuf, int iMaxLen)
        dwData = 0;\r
        for (i = 0; i < dwLen; i++) {\r
                if ((i % 4) == 0) {\r
-                       dwData = USB->USBRxData;\r
+                       dwData = LPC_USB->USBRxData;\r
                }\r
                if ((pbBuf != NULL) && (i < iMaxLen)) {\r
                        pbBuf[i] = dwData & 0xFF;\r
@@ -378,7 +378,7 @@ int USBHwEPRead(unsigned char bEP, unsigned char *pbBuf, int iMaxLen)
        }\r
 \r
        // make sure RD_EN is clear\r
-       USB->USBCtrl = 0;\r
+       LPC_USB->USBCtrl = 0;\r
 \r
        // select endpoint and clear buffer\r
        USBHwCmd(CMD_EP_SELECT | idx);\r
@@ -419,12 +419,12 @@ void USBHwISR(void)
        unsigned short  wFrame;\r
 \r
        // handle device interrupts\r
-       dwStatus = USB->USBDevIntSt;\r
+       dwStatus = LPC_USB->USBDevIntSt;\r
        \r
        // frame interrupt\r
        if (dwStatus & FRAME) {\r
                // clear int\r
-               USB->USBDevIntClr = FRAME;\r
+               LPC_USB->USBDevIntClr = FRAME;\r
                // call handler\r
                if (_pfnFrameHandler != NULL) {\r
                        wFrame = USBHwCmdRead(CMD_DEV_READ_CUR_FRAME_NR);\r
@@ -438,7 +438,7 @@ void USBHwISR(void)
                        This prevents corrupted device status reads, see\r
                        LPC2148 User manual revision 2, 25 july 2006.\r
                */\r
-               USB->USBDevIntClr = DEV_STAT;\r
+               LPC_USB->USBDevIntClr = DEV_STAT;\r
                bDevStat = USBHwCmdRead(CMD_DEV_STATUS);\r
                if (bDevStat & (CON_CH | SUS_CH | RST)) {\r
                        // convert device status into something HW independent\r
@@ -455,15 +455,15 @@ void USBHwISR(void)
        // endpoint interrupt\r
        if (dwStatus & EP_SLOW) {\r
                // clear EP_SLOW\r
-               USB->USBDevIntClr = EP_SLOW;\r
+               LPC_USB->USBDevIntClr = EP_SLOW;\r
                // check all endpoints\r
                for (i = 0; i < 32; i++) {\r
                        dwIntBit = (1 << i);\r
-                       if (USB->USBEpIntSt & dwIntBit) {\r
+                       if (LPC_USB->USBEpIntSt & dwIntBit) {\r
                                // clear int (and retrieve status)\r
-                               USB->USBEpIntClr = dwIntBit;\r
+                               LPC_USB->USBEpIntClr = dwIntBit;\r
                                Wait4DevInt(CDFULL);\r
-                               bEPStat = USB->USBCmdData;\r
+                               bEPStat = LPC_USB->USBCmdData;\r
                                // convert EP pipe stat into something HW independent\r
                                bStat = ((bEPStat & EPSTAT_FE) ? EP_STATUS_DATA : 0) |\r
                                                ((bEPStat & EPSTAT_ST) ? EP_STATUS_STALLED : 0) |\r
@@ -490,33 +490,33 @@ void USBHwISR(void)
 BOOL USBHwInit(void)\r
 {\r
        // P2.9 -> USB_CONNECT\r
-       PINCON->PINSEL4 &= ~0x000C0000;\r
-       PINCON->PINSEL4 |= 0x00040000;\r
+       LPC_PINCON->PINSEL4 &= ~0x000C0000;\r
+       LPC_PINCON->PINSEL4 |= 0x00040000;\r
 \r
        // P1.18 -> USB_UP_LED\r
        // P1.30 -> VBUS\r
-       PINCON->PINSEL3 &= ~0x30000030;\r
-       PINCON->PINSEL3 |= 0x20000010;\r
+       LPC_PINCON->PINSEL3 &= ~0x30000030;\r
+       LPC_PINCON->PINSEL3 |= 0x20000010;\r
 \r
        // P0.29 -> USB_D+\r
        // P0.30 -> USB_D-\r
-       PINCON->PINSEL1 &= ~0x3C000000;\r
-       PINCON->PINSEL1 |= 0x14000000;  \r
+       LPC_PINCON->PINSEL1 &= ~0x3C000000;\r
+       LPC_PINCON->PINSEL1 |= 0x14000000;\r
 \r
        // enable PUSB\r
-       SC->PCONP |= (1 << 31);\r
+       LPC_SC->PCONP |= (1 << 31);\r
 \r
-       USB->OTGClkCtrl = 0x12;                   /* Dev clock, AHB clock enable  */\r
-       while ((USB->OTGClkSt & 0x12) != 0x12);\r
+       LPC_USB->OTGClkCtrl = 0x12;                       /* Dev clock, AHB clock enable  */\r
+       while ((LPC_USB->OTGClkSt & 0x12) != 0x12);\r
        \r
        // disable/clear all interrupts for now\r
-       USB->USBDevIntEn = 0;\r
-       USB->USBDevIntClr = 0xFFFFFFFF;\r
-       USB->USBDevIntPri = 0;\r
+       LPC_USB->USBDevIntEn = 0;\r
+       LPC_USB->USBDevIntClr = 0xFFFFFFFF;\r
+       LPC_USB->USBDevIntPri = 0;\r
 \r
-       USB->USBEpIntEn = 0;\r
-       USB->USBEpIntClr = 0xFFFFFFFF;\r
-       USB->USBEpIntPri = 0;\r
+       LPC_USB->USBEpIntEn = 0;\r
+       LPC_USB->USBEpIntClr = 0xFFFFFFFF;\r
+       LPC_USB->USBEpIntPri = 0;\r
 \r
        // by default, only ACKs generate interrupts\r
        USBHwNakIntEnable(0);\r
index d5130dfbd0c9343b9f82332f9acd5dd0dad96f2a..2087d2a00b28bd73eca333cba1ee76905ca54f58 100644 (file)
@@ -74,10 +74,10 @@ static unsigned long ulLEDs[] = { LED_3, LED_2, LED_5, LED_4 };
 void vParTestInitialise( void )\r
 {\r
        /* LEDs on port 1. */\r
-       GPIO1->FIODIR  = partstFIO1_BITS;\r
+       LPC_GPIO1->FIODIR  = partstFIO1_BITS;\r
        \r
        /* Start will all LEDs off. */\r
-       GPIO1->FIOCLR = partstFIO1_BITS;\r
+       LPC_GPIO1->FIOCLR = partstFIO1_BITS;\r
 }\r
 /*-----------------------------------------------------------*/\r
 \r
@@ -88,11 +88,11 @@ void vParTestSetLED( unsigned portBASE_TYPE uxLED, signed portBASE_TYPE xValue )
                /* Set of clear the output. */\r
                if( xValue )\r
                {\r
-                       GPIO1->FIOCLR = ulLEDs[ uxLED ];\r
+                       LPC_GPIO1->FIOCLR = ulLEDs[ uxLED ];\r
                }\r
                else\r
                {\r
-                       GPIO1->FIOSET = ulLEDs[ uxLED ];\r
+                       LPC_GPIO1->FIOSET = ulLEDs[ uxLED ];\r
                }\r
        }\r
 }\r
@@ -102,13 +102,13 @@ void vParTestToggleLED( unsigned portBASE_TYPE uxLED )
 {\r
        if( uxLED < partstNUM_LEDS )\r
        {\r
-               if( GPIO1->FIOPIN & ulLEDs[ uxLED ] )\r
+               if( LPC_GPIO1->FIOPIN & ulLEDs[ uxLED ] )\r
                {\r
-                       GPIO1->FIOCLR = ulLEDs[ uxLED ];\r
+                       LPC_GPIO1->FIOCLR = ulLEDs[ uxLED ];\r
                }\r
                else\r
                {\r
-                       GPIO1->FIOSET = ulLEDs[ uxLED ];\r
+                       LPC_GPIO1->FIOSET = ulLEDs[ uxLED ];\r
                }\r
        }\r
 }\r
@@ -118,7 +118,7 @@ unsigned portBASE_TYPE uxParTextGetLED( unsigned portBASE_TYPE uxLED )
 {\r
        if( uxLED < partstNUM_LEDS )\r
        {\r
-               return ( GPIO1->FIOPIN & ulLEDs[ uxLED ] );\r
+               return ( LPC_GPIO1->FIOPIN & ulLEDs[ uxLED ] );\r
        }\r
        else\r
        {\r
index 92a2af74372d374e49b4524e78c7879a314d0ed4..170fdecf7722ceaed615b82f175848b20be524d4 100644 (file)
@@ -229,7 +229,7 @@ extern unsigned long _ebss;
 // library.\r
 //\r
 //*****************************************************************************\r
-void Reset_Handler(void)\r
+void\r
 ResetISR(void) {\r
     unsigned long *pulSrc, *pulDest;\r
 \r
index 13d06d832b6798c0834e8aba00d3e8f33a3f59a1..ab74ecff5ebef2becd560c162f06a0aee6582b8b 100644 (file)
@@ -125,6 +125,10 @@ handling library calls. */
 without an error being reported. */\r
 #define mainPASS_STATUS_MESSAGE                                "All tasks are executing without error."\r
 \r
+/* Bit definitions. */\r
+#define PCONP_PCGPIO    0x00008000\r
+#define PLLFEED_FEED1   0x000000AA\r
+#define PLLFEED_FEED2   0x00000055\r
 /*-----------------------------------------------------------*/\r
 \r
 /*\r
@@ -257,94 +261,94 @@ char *pcGetTaskStatusMessage( void )
 void prvSetupHardware( void )\r
 {\r
        /* Disable peripherals power. */\r
-       SC->PCONP = 0;\r
+       LPC_SC->PCONP = 0;\r
 \r
        /* Enable GPIO power. */\r
-       SC->PCONP = PCONP_PCGPIO;\r
+       LPC_SC->PCONP = PCONP_PCGPIO;\r
 \r
        /* Disable TPIU. */\r
-       PINCON->PINSEL10 = 0;\r
+       LPC_PINCON->PINSEL10 = 0;\r
 \r
-       if ( SC->PLL0STAT & ( 1 << 25 ) )\r
+       if ( LPC_SC->PLL0STAT & ( 1 << 25 ) )\r
        {\r
                /* Enable PLL, disconnected. */\r
-               SC->PLL0CON = 1;                        \r
-               SC->PLL0FEED = PLLFEED_FEED1;\r
-               SC->PLL0FEED = PLLFEED_FEED2;\r
+               LPC_SC->PLL0CON = 1;\r
+               LPC_SC->PLL0FEED = PLLFEED_FEED1;\r
+               LPC_SC->PLL0FEED = PLLFEED_FEED2;\r
        }\r
        \r
        /* Disable PLL, disconnected. */\r
-       SC->PLL0CON = 0;                                \r
-       SC->PLL0FEED = PLLFEED_FEED1;\r
-       SC->PLL0FEED = PLLFEED_FEED2;\r
+       LPC_SC->PLL0CON = 0;\r
+       LPC_SC->PLL0FEED = PLLFEED_FEED1;\r
+       LPC_SC->PLL0FEED = PLLFEED_FEED2;\r
            \r
        /* Enable main OSC. */\r
-       SC->SCS |= 0x20;                        \r
-       while( !( SC->SCS & 0x40 ) );\r
+       LPC_SC->SCS |= 0x20;\r
+       while( !( LPC_SC->SCS & 0x40 ) );\r
        \r
        /* select main OSC, 12MHz, as the PLL clock source. */\r
-       SC->CLKSRCSEL = 0x1;            \r
+       LPC_SC->CLKSRCSEL = 0x1;\r
        \r
-       SC->PLL0CFG = 0x20031;\r
-       SC->PLL0FEED = PLLFEED_FEED1;\r
-       SC->PLL0FEED = PLLFEED_FEED2;\r
+       LPC_SC->PLL0CFG = 0x20031;\r
+       LPC_SC->PLL0FEED = PLLFEED_FEED1;\r
+       LPC_SC->PLL0FEED = PLLFEED_FEED2;\r
              \r
        /* Enable PLL, disconnected. */\r
-       SC->PLL0CON = 1;                                \r
-       SC->PLL0FEED = PLLFEED_FEED1;\r
-       SC->PLL0FEED = PLLFEED_FEED2;\r
+       LPC_SC->PLL0CON = 1;\r
+       LPC_SC->PLL0FEED = PLLFEED_FEED1;\r
+       LPC_SC->PLL0FEED = PLLFEED_FEED2;\r
        \r
        /* Set clock divider. */\r
-       SC->CCLKCFG = 0x03;\r
+       LPC_SC->CCLKCFG = 0x03;\r
        \r
        /* Configure flash accelerator. */\r
-       SC->FLASHCFG = 0x403a;\r
+       LPC_SC->FLASHCFG = 0x403a;\r
        \r
        /* Check lock bit status. */\r
-       while( ( ( SC->PLL0STAT & ( 1 << 26 ) ) == 0 ) );       \r
+       while( ( ( LPC_SC->PLL0STAT & ( 1 << 26 ) ) == 0 ) );\r
            \r
        /* Enable and connect. */\r
-       SC->PLL0CON = 3;                                \r
-       SC->PLL0FEED = PLLFEED_FEED1;\r
-       SC->PLL0FEED = PLLFEED_FEED2;\r
-       while( ( ( SC->PLL0STAT & ( 1 << 25 ) ) == 0 ) );       \r
+       LPC_SC->PLL0CON = 3;\r
+       LPC_SC->PLL0FEED = PLLFEED_FEED1;\r
+       LPC_SC->PLL0FEED = PLLFEED_FEED2;\r
+       while( ( ( LPC_SC->PLL0STAT & ( 1 << 25 ) ) == 0 ) );\r
 \r
        \r
        \r
        \r
        /* Configure the clock for the USB. */\r
          \r
-       if( SC->PLL1STAT & ( 1 << 9 ) )\r
+       if( LPC_SC->PLL1STAT & ( 1 << 9 ) )\r
        {\r
                /* Enable PLL, disconnected. */\r
-               SC->PLL1CON = 1;                        \r
-               SC->PLL1FEED = PLLFEED_FEED1;\r
-               SC->PLL1FEED = PLLFEED_FEED2;\r
+               LPC_SC->PLL1CON = 1;\r
+               LPC_SC->PLL1FEED = PLLFEED_FEED1;\r
+               LPC_SC->PLL1FEED = PLLFEED_FEED2;\r
        }\r
        \r
        /* Disable PLL, disconnected. */\r
-       SC->PLL1CON = 0;                                \r
-       SC->PLL1FEED = PLLFEED_FEED1;\r
-       SC->PLL1FEED = PLLFEED_FEED2;\r
+       LPC_SC->PLL1CON = 0;\r
+       LPC_SC->PLL1FEED = PLLFEED_FEED1;\r
+       LPC_SC->PLL1FEED = PLLFEED_FEED2;\r
        \r
-       SC->PLL1CFG = 0x23;\r
-       SC->PLL1FEED = PLLFEED_FEED1;\r
-       SC->PLL1FEED = PLLFEED_FEED2;\r
+       LPC_SC->PLL1CFG = 0x23;\r
+       LPC_SC->PLL1FEED = PLLFEED_FEED1;\r
+       LPC_SC->PLL1FEED = PLLFEED_FEED2;\r
              \r
        /* Enable PLL, disconnected. */\r
-       SC->PLL1CON = 1;                                \r
-       SC->PLL1FEED = PLLFEED_FEED1;\r
-       SC->PLL1FEED = PLLFEED_FEED2;\r
-       while( ( ( SC->PLL1STAT & ( 1 << 10 ) ) == 0 ) );\r
+       LPC_SC->PLL1CON = 1;\r
+       LPC_SC->PLL1FEED = PLLFEED_FEED1;\r
+       LPC_SC->PLL1FEED = PLLFEED_FEED2;\r
+       while( ( ( LPC_SC->PLL1STAT & ( 1 << 10 ) ) == 0 ) );\r
        \r
        /* Enable and connect. */\r
-       SC->PLL1CON = 3;                                \r
-       SC->PLL1FEED = PLLFEED_FEED1;\r
-       SC->PLL1FEED = PLLFEED_FEED2;\r
-       while( ( ( SC->PLL1STAT & ( 1 << 9 ) ) == 0 ) );\r
+       LPC_SC->PLL1CON = 3;\r
+       LPC_SC->PLL1FEED = PLLFEED_FEED1;\r
+       LPC_SC->PLL1FEED = PLLFEED_FEED2;\r
+       while( ( ( LPC_SC->PLL1STAT & ( 1 << 9 ) ) == 0 ) );\r
 \r
        /*  Setup the peripheral bus to be the same as the PLL output (64 MHz). */\r
-       SC->PCLKSEL0 = 0x05555555;\r
+       LPC_SC->PCLKSEL0 = 0x05555555;\r
 \r
        /* Configure the LEDs. */\r
        vParTestInitialise();\r
@@ -373,21 +377,21 @@ const unsigned long TCR_COUNT_RESET = 2, CTCR_CTM_TIMER = 0x00, TCR_COUNT_ENABLE
        to 1). */\r
 \r
        /* Power up and feed the timer. */\r
-       SC->PCONP |= 0x02UL;\r
-       SC->PCLKSEL0 = (SC->PCLKSEL0 & (~(0x3<<2))) | (0x01 << 2);\r
+       LPC_SC->PCONP |= 0x02UL;\r
+       LPC_SC->PCLKSEL0 = (LPC_SC->PCLKSEL0 & (~(0x3<<2))) | (0x01 << 2);\r
 \r
        /* Reset Timer 0 */\r
-       TIM0->TCR = TCR_COUNT_RESET;\r
+       LPC_TIM0->TCR = TCR_COUNT_RESET;\r
 \r
        /* Just count up. */\r
-       TIM0->CTCR = CTCR_CTM_TIMER;\r
+       LPC_TIM0->CTCR = CTCR_CTM_TIMER;\r
 \r
        /* Prescale to a frequency that is good enough to get a decent resolution,\r
        but not too fast so as to overflow all the time. */\r
-       TIM0->PR =  ( configCPU_CLOCK_HZ / 10000UL ) - 1UL;\r
+       LPC_TIM0->PR =  ( configCPU_CLOCK_HZ / 10000UL ) - 1UL;\r
 \r
        /* Start the counter. */\r
-       TIM0->TCR = TCR_COUNT_ENABLE;\r
+       LPC_TIM0->TCR = TCR_COUNT_ENABLE;\r
 }\r
 /*-----------------------------------------------------------*/\r
 \r
index ee651dd4c1abecb0c6d626fbd6f6a63cf1429a54..628e030139fff2ac0b943aa4a7388787c4ebaadb 100644 (file)
@@ -83,6 +83,7 @@
 descriptor is then used to re-send in order to speed up the uIP Tx process. */\r
 #define emacTX_DESC_INDEX                      ( 0 )\r
 \r
+#define PCONP_PCENET    0x40000000\r
 /*-----------------------------------------------------------*/\r
 \r
 /*\r
@@ -162,15 +163,15 @@ unsigned long ulID1, ulID2;
        if( ( (ulID1 << 16UL ) | ( ulID2 & 0xFFF0UL ) ) == DP83848C_ID )\r
        {\r
                /* Set the Ethernet MAC Address registers */\r
-               EMAC->SA0 = ( configMAC_ADDR0 << 8 ) | configMAC_ADDR1;\r
-               EMAC->SA1 = ( configMAC_ADDR2 << 8 ) | configMAC_ADDR3;\r
-               EMAC->SA2 = ( configMAC_ADDR4 << 8 ) | configMAC_ADDR5;\r
+               LPC_EMAC->SA0 = ( configMAC_ADDR0 << 8 ) | configMAC_ADDR1;\r
+               LPC_EMAC->SA1 = ( configMAC_ADDR2 << 8 ) | configMAC_ADDR3;\r
+               LPC_EMAC->SA2 = ( configMAC_ADDR4 << 8 ) | configMAC_ADDR5;\r
 \r
                /* Initialize Tx and Rx DMA Descriptors */\r
                prvInitDescriptors();\r
 \r
                /* Receive broadcast and perfect match packets */\r
-               EMAC->RxFilterCtrl = RFC_UCAST_EN | RFC_BCAST_EN | RFC_PERFECT_EN;\r
+               LPC_EMAC->RxFilterCtrl = RFC_UCAST_EN | RFC_BCAST_EN | RFC_PERFECT_EN;\r
 \r
                /* Setup the PHY. */\r
                prvConfigurePHY();\r
@@ -192,11 +193,11 @@ unsigned long ulID1, ulID2;
                uip_buf = prvGetNextBuffer();\r
 \r
                /* Reset all interrupts */\r
-               EMAC->IntClear = ( INT_RX_OVERRUN | INT_RX_ERR | INT_RX_FIN | INT_RX_DONE | INT_TX_UNDERRUN | INT_TX_ERR | INT_TX_FIN | INT_TX_DONE | INT_SOFT_INT | INT_WAKEUP );\r
+               LPC_EMAC->IntClear = ( INT_RX_OVERRUN | INT_RX_ERR | INT_RX_FIN | INT_RX_DONE | INT_TX_UNDERRUN | INT_TX_ERR | INT_TX_FIN | INT_TX_DONE | INT_SOFT_INT | INT_WAKEUP );\r
 \r
                /* Enable receive and transmit mode of MAC Ethernet core */\r
-               EMAC->Command |= ( CR_RX_EN | CR_TX_EN );\r
-               EMAC->MAC1 |= MAC1_REC_EN;\r
+               LPC_EMAC->Command |= ( CR_RX_EN | CR_TX_EN );\r
+               LPC_EMAC->MAC1 |= MAC1_REC_EN;\r
        }\r
 \r
        return lReturn;\r
@@ -260,12 +261,12 @@ long x, lNextBuffer = 0;
        }\r
 \r
        /* Set EMAC Receive Descriptor Registers. */\r
-       EMAC->RxDescriptor = RX_DESC_BASE;\r
-       EMAC->RxStatus = RX_STAT_BASE;\r
-       EMAC->RxDescriptorNumber = NUM_RX_FRAG - 1;\r
+       LPC_EMAC->RxDescriptor = RX_DESC_BASE;\r
+       LPC_EMAC->RxStatus = RX_STAT_BASE;\r
+       LPC_EMAC->RxDescriptorNumber = NUM_RX_FRAG - 1;\r
 \r
        /* Rx Descriptors Point to 0 */\r
-       EMAC->RxConsumeIndex = 0;\r
+       LPC_EMAC->RxConsumeIndex = 0;\r
 \r
        /* A buffer is not allocated to the Tx descriptors until they are actually\r
        used. */\r
@@ -277,12 +278,12 @@ long x, lNextBuffer = 0;
        }\r
 \r
        /* Set EMAC Transmit Descriptor Registers. */\r
-       EMAC->TxDescriptor = TX_DESC_BASE;\r
-       EMAC->TxStatus = TX_STAT_BASE;\r
-       EMAC->TxDescriptorNumber = NUM_TX_FRAG - 1;\r
+       LPC_EMAC->TxDescriptor = TX_DESC_BASE;\r
+       LPC_EMAC->TxStatus = TX_STAT_BASE;\r
+       LPC_EMAC->TxDescriptorNumber = NUM_TX_FRAG - 1;\r
 \r
        /* Tx Descriptors Point to 0 */\r
-       EMAC->TxProduceIndex = 0;\r
+       LPC_EMAC->TxProduceIndex = 0;\r
 }\r
 /*-----------------------------------------------------------*/\r
 \r
@@ -292,34 +293,34 @@ unsigned short us;
 long x, lDummy;\r
 \r
        /* Enable P1 Ethernet Pins. */\r
-       PINCON->PINSEL2 = emacPINSEL2_VALUE;\r
-       PINCON->PINSEL3 = ( PINCON->PINSEL3 & ~0x0000000F ) | 0x00000005;\r
+       LPC_PINCON->PINSEL2 = emacPINSEL2_VALUE;\r
+       LPC_PINCON->PINSEL3 = ( LPC_PINCON->PINSEL3 & ~0x0000000F ) | 0x00000005;\r
 \r
        /* Power Up the EMAC controller. */\r
-       SC->PCONP |= PCONP_PCENET;\r
+       LPC_SC->PCONP |= PCONP_PCENET;\r
        vTaskDelay( emacSHORT_DELAY );\r
 \r
        /* Reset all EMAC internal modules. */\r
-       EMAC->MAC1 = MAC1_RES_TX | MAC1_RES_MCS_TX | MAC1_RES_RX | MAC1_RES_MCS_RX | MAC1_SIM_RES | MAC1_SOFT_RES;\r
-       EMAC->Command = CR_REG_RES | CR_TX_RES | CR_RX_RES | CR_PASS_RUNT_FRM;\r
+       LPC_EMAC->MAC1 = MAC1_RES_TX | MAC1_RES_MCS_TX | MAC1_RES_RX | MAC1_RES_MCS_RX | MAC1_SIM_RES | MAC1_SOFT_RES;\r
+       LPC_EMAC->Command = CR_REG_RES | CR_TX_RES | CR_RX_RES | CR_PASS_RUNT_FRM;\r
 \r
        /* A short delay after reset. */\r
        vTaskDelay( emacSHORT_DELAY );\r
 \r
        /* Initialize MAC control registers. */\r
-       EMAC->MAC1 = MAC1_PASS_ALL;\r
-       EMAC->MAC2 = MAC2_CRC_EN | MAC2_PAD_EN;\r
-       EMAC->MAXF = ETH_MAX_FLEN;\r
-       EMAC->CLRT = CLRT_DEF;\r
-       EMAC->IPGR = IPGR_DEF;\r
+       LPC_EMAC->MAC1 = MAC1_PASS_ALL;\r
+       LPC_EMAC->MAC2 = MAC2_CRC_EN | MAC2_PAD_EN;\r
+       LPC_EMAC->MAXF = ETH_MAX_FLEN;\r
+       LPC_EMAC->CLRT = CLRT_DEF;\r
+       LPC_EMAC->IPGR = IPGR_DEF;\r
 \r
        /* Enable Reduced MII interface. */\r
-       EMAC->Command = CR_RMII | CR_PASS_RUNT_FRM;\r
+       LPC_EMAC->Command = CR_RMII | CR_PASS_RUNT_FRM;\r
 \r
        /* Reset Reduced MII Logic. */\r
-       EMAC->SUPP = SUPP_RES_RMII;\r
+       LPC_EMAC->SUPP = SUPP_RES_RMII;\r
        vTaskDelay( emacSHORT_DELAY );\r
-       EMAC->SUPP = 0;\r
+       LPC_EMAC->SUPP = 0;\r
 \r
        /* Put the PHY in reset mode */\r
        prvWritePHY( PHY_REG_BMCR, MCFG_RES_MII );\r
@@ -389,26 +390,26 @@ unsigned short usLinkStatus;
                if( usLinkStatus & emacFULL_DUPLEX_ENABLED )\r
                {\r
                        /* Full duplex is enabled. */\r
-                       EMAC->MAC2 |= MAC2_FULL_DUP;\r
-                       EMAC->Command |= CR_FULL_DUP;\r
-                       EMAC->IPGT = IPGT_FULL_DUP;\r
+                       LPC_EMAC->MAC2 |= MAC2_FULL_DUP;\r
+                       LPC_EMAC->Command |= CR_FULL_DUP;\r
+                       LPC_EMAC->IPGT = IPGT_FULL_DUP;\r
                }\r
                else\r
                {\r
                        /* Half duplex mode. */\r
-                       EMAC->IPGT = IPGT_HALF_DUP;\r
+                       LPC_EMAC->IPGT = IPGT_HALF_DUP;\r
                }\r
 \r
                /* Configure 100MBit/10MBit mode. */\r
                if( usLinkStatus & emac10BASE_T_MODE )\r
                {\r
                        /* 10MBit mode. */\r
-                       EMAC->SUPP = 0;\r
+                       LPC_EMAC->SUPP = 0;\r
                }\r
                else\r
                {\r
                        /* 100MBit mode. */\r
-                       EMAC->SUPP = SUPP_SPEED;\r
+                       LPC_EMAC->SUPP = SUPP_SPEED;\r
                }\r
        }\r
 \r
@@ -437,21 +438,21 @@ unsigned long ulGetEMACRxData( void )
 unsigned long ulLen = 0;\r
 long lIndex;\r
 \r
-       if( EMAC->RxProduceIndex != EMAC->RxConsumeIndex )\r
+       if( LPC_EMAC->RxProduceIndex != LPC_EMAC->RxConsumeIndex )\r
        {\r
                /* Mark the current buffer as free as uip_buf is going to be set to\r
                the buffer that contains the received data. */\r
                prvReturnBuffer( uip_buf );\r
 \r
-               ulLen = ( RX_STAT_INFO( EMAC->RxConsumeIndex ) & RINFO_SIZE ) - 3;\r
-               uip_buf = ( unsigned char * ) RX_DESC_PACKET( EMAC->RxConsumeIndex );\r
+               ulLen = ( RX_STAT_INFO( LPC_EMAC->RxConsumeIndex ) & RINFO_SIZE ) - 3;\r
+               uip_buf = ( unsigned char * ) RX_DESC_PACKET( LPC_EMAC->RxConsumeIndex );\r
 \r
                /* Allocate a new buffer to the descriptor. */\r
-        RX_DESC_PACKET( EMAC->RxConsumeIndex ) = ( unsigned long ) prvGetNextBuffer();\r
+        RX_DESC_PACKET( LPC_EMAC->RxConsumeIndex ) = ( unsigned long ) prvGetNextBuffer();\r
 \r
                /* Move the consume index onto the next position, ensuring it wraps to\r
                the beginning at the appropriate place. */\r
-               lIndex = EMAC->RxConsumeIndex;\r
+               lIndex = LPC_EMAC->RxConsumeIndex;\r
 \r
                lIndex++;\r
                if( lIndex >= NUM_RX_FRAG )\r
@@ -459,7 +460,7 @@ long lIndex;
                        lIndex = 0;\r
                }\r
 \r
-               EMAC->RxConsumeIndex = lIndex;\r
+               LPC_EMAC->RxConsumeIndex = lIndex;\r
        }\r
 \r
        return ulLen;\r
@@ -494,7 +495,7 @@ unsigned long ulAttempts = 0UL;
        usSendLen = usTxDataLen;\r
        TX_DESC_PACKET( emacTX_DESC_INDEX ) = ( unsigned long ) uip_buf;\r
        TX_DESC_CTRL( emacTX_DESC_INDEX ) = ( usTxDataLen | TCTRL_LAST | TCTRL_INT );\r
-       EMAC->TxProduceIndex = ( emacTX_DESC_INDEX + 1 );\r
+       LPC_EMAC->TxProduceIndex = ( emacTX_DESC_INDEX + 1 );\r
 \r
        /* uip_buf is being sent by the Tx descriptor.  Allocate a new buffer. */\r
        uip_buf = prvGetNextBuffer();\r
@@ -506,13 +507,13 @@ static long prvWritePHY( long lPhyReg, long lValue )
 const long lMaxTime = 10;\r
 long x;\r
 \r
-       EMAC->MADR = DP83848C_DEF_ADR | lPhyReg;\r
-       EMAC->MWTD = lValue;\r
+       LPC_EMAC->MADR = DP83848C_DEF_ADR | lPhyReg;\r
+       LPC_EMAC->MWTD = lValue;\r
 \r
        x = 0;\r
        for( x = 0; x < lMaxTime; x++ )\r
        {\r
-               if( ( EMAC->MIND & MIND_BUSY ) == 0 )\r
+               if( ( LPC_EMAC->MIND & MIND_BUSY ) == 0 )\r
                {\r
                        /* Operation has finished. */\r
                        break;\r
@@ -537,13 +538,13 @@ static unsigned short prvReadPHY( unsigned char ucPhyReg, long *plStatus )
 long x;\r
 const long lMaxTime = 10;\r
 \r
-       EMAC->MADR = DP83848C_DEF_ADR | ucPhyReg;\r
-       EMAC->MCMD = MCMD_READ;\r
+       LPC_EMAC->MADR = DP83848C_DEF_ADR | ucPhyReg;\r
+       LPC_EMAC->MCMD = MCMD_READ;\r
 \r
        for( x = 0; x < lMaxTime; x++ )\r
        {\r
                /* Operation has finished. */\r
-               if( ( EMAC->MIND & MIND_BUSY ) == 0 )\r
+               if( ( LPC_EMAC->MIND & MIND_BUSY ) == 0 )\r
                {\r
                        break;\r
                }\r
@@ -551,14 +552,14 @@ const long lMaxTime = 10;
                vTaskDelay( emacSHORT_DELAY );\r
        }\r
 \r
-       EMAC->MCMD = 0;\r
+       LPC_EMAC->MCMD = 0;\r
 \r
        if( x >= lMaxTime )\r
        {\r
                *plStatus = pdFAIL;\r
        }\r
 \r
-       return( EMAC->MRDD );\r
+       return( LPC_EMAC->MRDD );\r
 }\r
 /*-----------------------------------------------------------*/\r
 \r
@@ -567,10 +568,10 @@ void vEMAC_ISR( void )
 unsigned long ulStatus;\r
 long lHigherPriorityTaskWoken = pdFALSE;\r
 \r
-       ulStatus = EMAC->IntStatus;\r
+       ulStatus = LPC_EMAC->IntStatus;\r
 \r
        /* Clear the interrupt. */\r
-       EMAC->IntClear = ulStatus;\r
+       LPC_EMAC->IntClear = ulStatus;\r
 \r
        if( ulStatus & INT_RX_DONE )\r
        {\r
@@ -586,7 +587,7 @@ long lHigherPriorityTaskWoken = pdFALSE;
                        only two descriptors the index is set back to 0. */\r
                        TX_DESC_PACKET( ( emacTX_DESC_INDEX + 1 ) ) = TX_DESC_PACKET( emacTX_DESC_INDEX );\r
                        TX_DESC_CTRL( ( emacTX_DESC_INDEX + 1 ) ) = ( usSendLen | TCTRL_LAST | TCTRL_INT );\r
-                       EMAC->TxProduceIndex = ( emacTX_DESC_INDEX );\r
+                       LPC_EMAC->TxProduceIndex = ( emacTX_DESC_INDEX );\r
 \r
                        /* This is the second Tx so set usSendLen to 0 to indicate that the\r
                        Tx descriptors will be free again. */\r
index 87b27e6ed357c0661845b76dab2ef21e87ceafef..f957bf99132a9152643a9086ec33612236281aa4 100644 (file)
@@ -144,7 +144,7 @@ extern void ( vEMAC_ISR_Wrapper )( void );
 \r
        portENTER_CRITICAL();\r
        {\r
-               EMAC->IntEnable = ( INT_RX_DONE | INT_TX_DONE );\r
+               LPC_EMAC->IntEnable = ( INT_RX_DONE | INT_TX_DONE );\r
 \r
                /* Set the interrupt priority to the max permissible to cause some\r
                interrupt nesting. */\r