├── .gitignore ├── CoOS ├── Document │ ├── CooCox CoOS's TERMS AND CONDITIONS.pdf │ ├── CooCox_CoOS_User_Guide.pdf │ └── readme.txt ├── OsConfig.h ├── kernel │ ├── CoOS.h │ ├── OsCore.h │ ├── OsError.h │ ├── OsEvent.h │ ├── OsFlag.h │ ├── OsKernelHeap.h │ ├── OsMM.h │ ├── OsMutex.h │ ├── OsQueue.h │ ├── OsServiceReq.h │ ├── OsTask.h │ ├── OsTime.h │ ├── OsTimer.h │ ├── coocox.h │ ├── core.c │ ├── event.c │ ├── flag.c │ ├── hook.c │ ├── kernelHeap.c │ ├── mbox.c │ ├── mm.c │ ├── mutex.c │ ├── queue.c │ ├── sem.c │ ├── serviceReq.c │ ├── task.c │ ├── time.c │ ├── timer.c │ ├── utility.c │ └── utility.h └── portable │ ├── GCC │ └── port.c │ ├── IAR │ ├── portForM0.asm │ ├── portForM3.asm │ └── portForM4.asm │ ├── Keil │ └── port.c │ ├── OsArch.h │ └── arch.c ├── Components ├── gui │ └── readme.txt ├── net │ ├── lwip-1.3.1 │ │ ├── CHANGELOG │ │ ├── COPYING │ │ ├── FILES │ │ ├── README │ │ ├── doc │ │ │ ├── FILES │ │ │ ├── contrib.txt │ │ │ ├── rawapi.txt │ │ │ ├── savannah.txt │ │ │ ├── snmp_agent.txt │ │ │ └── sys_arch.txt │ │ ├── port │ │ │ └── CoOS │ │ │ │ ├── arch │ │ │ │ ├── cc.h │ │ │ │ ├── cpu.h │ │ │ │ ├── init.h │ │ │ │ ├── lib.h │ │ │ │ ├── perf.h │ │ │ │ ├── sys_arch.c │ │ │ │ └── sys_arch.h │ │ │ │ └── ethernetif │ │ │ │ └── LPC17xx │ │ │ │ ├── EMAC.c │ │ │ │ ├── EMAC.h │ │ │ │ ├── LPC17xx_reg.h │ │ │ │ ├── ethernetif.c │ │ │ │ └── ethernetif.h │ │ └── src │ │ │ ├── .hgignore │ │ │ ├── FILES │ │ │ ├── api │ │ │ ├── api_lib.c │ │ │ ├── api_msg.c │ │ │ ├── err.c │ │ │ ├── netbuf.c │ │ │ ├── netdb.c │ │ │ ├── netifapi.c │ │ │ ├── sockets.c │ │ │ └── tcpip.c │ │ │ ├── core │ │ │ ├── #tcp_out.c# │ │ │ ├── dhcp.c │ │ │ ├── dns.c │ │ │ ├── init.c │ │ │ ├── ipv4 │ │ │ │ ├── autoip.c │ │ │ │ ├── icmp.c │ │ │ │ ├── igmp.c │ │ │ │ ├── inet.c │ │ │ │ ├── inet_chksum.c │ │ │ │ ├── ip.c │ │ │ │ ├── ip_addr.c │ │ │ │ └── ip_frag.c │ │ │ ├── mem.c │ │ │ ├── memp.c │ │ │ ├── netif.c │ │ │ ├── pbuf.c │ │ │ ├── raw.c │ │ │ ├── snmp │ │ │ │ ├── asn1_dec.c │ │ │ │ ├── asn1_enc.c │ │ │ │ ├── mib2.c │ │ │ │ ├── mib_structs.c │ │ │ │ ├── msg_in.c │ │ │ │ └── msg_out.c │ │ │ ├── stats.c │ │ │ ├── sys.c │ │ │ ├── tcp.c │ │ │ ├── tcp_in.c │ │ │ ├── tcp_out.c │ │ │ └── udp.c │ │ │ ├── include │ │ │ ├── ipv4 │ │ │ │ └── lwip │ │ │ │ │ ├── autoip.h │ │ │ │ │ ├── icmp.h │ │ │ │ │ ├── igmp.h │ │ │ │ │ ├── inet.h │ │ │ │ │ ├── inet_chksum.h │ │ │ │ │ ├── ip.h │ │ │ │ │ ├── ip_addr.h │ │ │ │ │ └── ip_frag.h │ │ │ ├── ipv6 │ │ │ │ └── lwip │ │ │ │ │ ├── icmp.h │ │ │ │ │ ├── inet.h │ │ │ │ │ ├── ip.h │ │ │ │ │ └── ip_addr.h │ │ │ ├── lwip │ │ │ │ ├── api.h │ │ │ │ ├── api_msg.h │ │ │ │ ├── arch.h │ │ │ │ ├── debug.h │ │ │ │ ├── def.h │ │ │ │ ├── dhcp.h │ │ │ │ ├── dns.h │ │ │ │ ├── err.h │ │ │ │ ├── init.h │ │ │ │ ├── lwipopts.h │ │ │ │ ├── mem.h │ │ │ │ ├── memp.h │ │ │ │ ├── memp_std.h │ │ │ │ ├── netbuf.h │ │ │ │ ├── netdb.h │ │ │ │ ├── netif.h │ │ │ │ ├── netifapi.h │ │ │ │ ├── opt.h │ │ │ │ ├── pbuf.h │ │ │ │ ├── raw.h │ │ │ │ ├── sio.h │ │ │ │ ├── snmp.h │ │ │ │ ├── snmp_asn1.h │ │ │ │ ├── snmp_msg.h │ │ │ │ ├── snmp_structs.h │ │ │ │ ├── sockets.h │ │ │ │ ├── stats.h │ │ │ │ ├── sys.h │ │ │ │ ├── tcp.h │ │ │ │ ├── tcpip.h │ │ │ │ └── udp.h │ │ │ └── netif │ │ │ │ ├── etharp.h │ │ │ │ ├── fifo.h │ │ │ │ ├── loopif.h │ │ │ │ ├── ppp_oe.h │ │ │ │ ├── sio.h │ │ │ │ └── slipif.h │ │ │ └── netif │ │ │ ├── FILES │ │ │ ├── etharp.c │ │ │ ├── loopif.c │ │ │ ├── ppp │ │ │ ├── chap.c │ │ │ ├── md5.c │ │ │ ├── md5.h │ │ │ ├── ppp.h │ │ │ ├── pppdebug.h │ │ │ └── randm.h │ │ │ └── slipif.c │ ├── lwip-1.4.1 │ │ ├── CHANGELOG │ │ ├── COPYING │ │ ├── FILES │ │ ├── README │ │ ├── UPGRADING │ │ ├── doc │ │ │ ├── FILES │ │ │ ├── contrib.txt │ │ │ ├── rawapi.txt │ │ │ ├── savannah.txt │ │ │ ├── snmp_agent.txt │ │ │ └── sys_arch.txt │ │ ├── src │ │ │ ├── FILES │ │ │ ├── api │ │ │ │ ├── api_lib.c │ │ │ │ ├── api_msg.c │ │ │ │ ├── err.c │ │ │ │ ├── netbuf.c │ │ │ │ ├── netdb.c │ │ │ │ ├── netifapi.c │ │ │ │ ├── sockets.c │ │ │ │ └── tcpip.c │ │ │ ├── core │ │ │ │ ├── def.c │ │ │ │ ├── dhcp.c │ │ │ │ ├── dns.c │ │ │ │ ├── init.c │ │ │ │ ├── ipv4 │ │ │ │ │ ├── autoip.c │ │ │ │ │ ├── icmp.c │ │ │ │ │ ├── igmp.c │ │ │ │ │ ├── inet.c │ │ │ │ │ ├── inet_chksum.c │ │ │ │ │ ├── ip.c │ │ │ │ │ ├── ip_addr.c │ │ │ │ │ └── ip_frag.c │ │ │ │ ├── ipv6 │ │ │ │ │ ├── README │ │ │ │ │ ├── icmp6.c │ │ │ │ │ ├── inet6.c │ │ │ │ │ ├── ip6.c │ │ │ │ │ └── ip6_addr.c │ │ │ │ ├── mem.c │ │ │ │ ├── memp.c │ │ │ │ ├── netif.c │ │ │ │ ├── pbuf.c │ │ │ │ ├── raw.c │ │ │ │ ├── snmp │ │ │ │ │ ├── asn1_dec.c │ │ │ │ │ ├── asn1_enc.c │ │ │ │ │ ├── mib2.c │ │ │ │ │ ├── mib_structs.c │ │ │ │ │ ├── msg_in.c │ │ │ │ │ └── msg_out.c │ │ │ │ ├── stats.c │ │ │ │ ├── sys.c │ │ │ │ ├── tcp.c │ │ │ │ ├── tcp_in.c │ │ │ │ ├── tcp_out.c │ │ │ │ ├── timers.c │ │ │ │ └── udp.c │ │ │ ├── include │ │ │ │ ├── ipv4 │ │ │ │ │ └── lwip │ │ │ │ │ │ ├── autoip.h │ │ │ │ │ │ ├── icmp.h │ │ │ │ │ │ ├── igmp.h │ │ │ │ │ │ ├── inet.h │ │ │ │ │ │ ├── inet_chksum.h │ │ │ │ │ │ ├── ip.h │ │ │ │ │ │ ├── ip_addr.h │ │ │ │ │ │ └── ip_frag.h │ │ │ │ ├── ipv6 │ │ │ │ │ └── lwip │ │ │ │ │ │ ├── icmp.h │ │ │ │ │ │ ├── inet.h │ │ │ │ │ │ ├── ip.h │ │ │ │ │ │ └── ip_addr.h │ │ │ │ ├── lwip │ │ │ │ │ ├── api.h │ │ │ │ │ ├── api_msg.h │ │ │ │ │ ├── arch.h │ │ │ │ │ ├── debug.h │ │ │ │ │ ├── def.h │ │ │ │ │ ├── dhcp.h │ │ │ │ │ ├── dns.h │ │ │ │ │ ├── err.h │ │ │ │ │ ├── init.h │ │ │ │ │ ├── mem.h │ │ │ │ │ ├── memp.h │ │ │ │ │ ├── memp_std.h │ │ │ │ │ ├── netbuf.h │ │ │ │ │ ├── netdb.h │ │ │ │ │ ├── netif.h │ │ │ │ │ ├── netifapi.h │ │ │ │ │ ├── opt.h │ │ │ │ │ ├── pbuf.h │ │ │ │ │ ├── raw.h │ │ │ │ │ ├── sio.h │ │ │ │ │ ├── snmp.h │ │ │ │ │ ├── snmp_asn1.h │ │ │ │ │ ├── snmp_msg.h │ │ │ │ │ ├── snmp_structs.h │ │ │ │ │ ├── sockets.h │ │ │ │ │ ├── stats.h │ │ │ │ │ ├── sys.h │ │ │ │ │ ├── tcp.h │ │ │ │ │ ├── tcp_impl.h │ │ │ │ │ ├── tcpip.h │ │ │ │ │ ├── timers.h │ │ │ │ │ └── udp.h │ │ │ │ ├── netif │ │ │ │ │ ├── etharp.h │ │ │ │ │ ├── ppp_oe.h │ │ │ │ │ └── slipif.h │ │ │ │ └── posix │ │ │ │ │ ├── netdb.h │ │ │ │ │ └── sys │ │ │ │ │ └── socket.h │ │ │ └── netif │ │ │ │ ├── FILES │ │ │ │ ├── etharp.c │ │ │ │ ├── ethernetif.c │ │ │ │ ├── ppp │ │ │ │ ├── auth.c │ │ │ │ ├── auth.h │ │ │ │ ├── chap.c │ │ │ │ ├── chap.h │ │ │ │ ├── chpms.c │ │ │ │ ├── chpms.h │ │ │ │ ├── fsm.c │ │ │ │ ├── fsm.h │ │ │ │ ├── ipcp.c │ │ │ │ ├── ipcp.h │ │ │ │ ├── lcp.c │ │ │ │ ├── lcp.h │ │ │ │ ├── magic.c │ │ │ │ ├── magic.h │ │ │ │ ├── md5.c │ │ │ │ ├── md5.h │ │ │ │ ├── pap.c │ │ │ │ ├── pap.h │ │ │ │ ├── ppp.c │ │ │ │ ├── ppp.h │ │ │ │ ├── ppp_impl.h │ │ │ │ ├── ppp_oe.c │ │ │ │ ├── pppdebug.h │ │ │ │ ├── randm.c │ │ │ │ ├── randm.h │ │ │ │ ├── vj.c │ │ │ │ └── vj.h │ │ │ │ └── slipif.c │ │ └── test │ │ │ └── unit │ │ │ ├── core │ │ │ ├── test_mem.c │ │ │ └── test_mem.h │ │ │ ├── etharp │ │ │ ├── test_etharp.c │ │ │ └── test_etharp.h │ │ │ ├── lwip_check.h │ │ │ ├── lwip_unittests.c │ │ │ ├── lwipopts.h │ │ │ ├── tcp │ │ │ ├── tcp_helper.c │ │ │ ├── tcp_helper.h │ │ │ ├── test_tcp.c │ │ │ ├── test_tcp.h │ │ │ ├── test_tcp_oos.c │ │ │ └── test_tcp_oos.h │ │ │ └── udp │ │ │ ├── test_udp.c │ │ │ └── test_udp.h │ └── readme.txt └── usb │ └── readme.txt ├── Document ├── coding-standard.txt └── contribution-howto.txt ├── Example ├── Atmel │ └── AT91SAM3Ux │ │ └── readme.txt ├── Energy │ ├── EFM32G2xx │ │ └── readme.txt │ └── EFM32G8xx │ │ └── readme.txt ├── Freescale │ └── Kinetis │ │ ├── BSPLIB │ │ └── src │ │ │ └── enet │ │ │ ├── enet.h │ │ │ ├── mii.c │ │ │ └── mii.h │ │ ├── K60D_blink │ │ ├── AppConfig.h │ │ ├── GCC │ │ │ ├── arm-gcc-link.ld │ │ │ └── blink_twrk60n512.coproj │ │ ├── IAR │ │ │ ├── 512KB_Pflash.icf │ │ │ ├── blink_twrk60n512.ewd │ │ │ ├── blink_twrk60n512.ewp │ │ │ ├── isr.h │ │ │ ├── low_init.c │ │ │ ├── vectors.c │ │ │ └── vectors.h │ │ ├── OsConfig.h │ │ └── main.c │ │ ├── K60D_lwIP │ │ ├── AppConfig.h │ │ ├── GCC │ │ │ ├── arm-gcc-link.ld │ │ │ └── lwip_twrk60n512.coproj │ │ ├── IAR │ │ │ ├── 512KB_Pflash.icf │ │ │ ├── isr.h │ │ │ ├── low_init.c │ │ │ ├── lwip_twrk60n512.ewd │ │ │ ├── lwip_twrk60n512.ewp │ │ │ ├── vectors.c │ │ │ └── vectors.h │ │ ├── OsConfig.h │ │ ├── httpserver-netconn.c │ │ └── main.c │ │ ├── K70F_blink │ │ ├── AppConfig.h │ │ ├── GCC │ │ │ ├── arm-gcc-link.ld │ │ │ └── blink_twrk70f120.coproj │ │ ├── IAR │ │ │ ├── 128KB_Ram.icf │ │ │ ├── 1MB_Pflash.icf │ │ │ ├── blink_twrk70f120.ewd │ │ │ ├── blink_twrk70f120.ewp │ │ │ ├── isr.h │ │ │ ├── low_init.c │ │ │ ├── vectors.c │ │ │ └── vectors.h │ │ ├── OsConfig.h │ │ └── main.c │ │ ├── K70F_fpu │ │ ├── AppConfig.h │ │ ├── GCC │ │ │ ├── arm-gcc-link.ld │ │ │ └── fpu_twrk70f120.coproj │ │ ├── IAR │ │ │ ├── 128KB_Ram.icf │ │ │ ├── 1MB_Pflash.icf │ │ │ ├── fpu_twrk70f120.ewd │ │ │ ├── fpu_twrk70f120.ewp │ │ │ ├── isr.h │ │ │ ├── low_init.c │ │ │ ├── vectors.c │ │ │ └── vectors.h │ │ ├── OsConfig.h │ │ └── main.c │ │ ├── K70F_lwIP │ │ ├── AppConfig.h │ │ ├── GCC │ │ │ ├── arm-gcc-link.ld │ │ │ └── lwip_twrk70f120.coproj │ │ ├── IAR │ │ │ ├── 128KB_Ram.icf │ │ │ ├── 1MB_Pflash.icf │ │ │ ├── isr.h │ │ │ ├── low_init.c │ │ │ ├── lwip_twrk70f120.ewd │ │ │ ├── lwip_twrk70f120.ewp │ │ │ ├── vectors.c │ │ │ └── vectors.h │ │ ├── OsConfig.h │ │ ├── httpserver-netconn.c │ │ └── main.c │ │ ├── cmsis │ │ ├── MK60D.h │ │ ├── MK60DZ10.h │ │ ├── MK60F.h │ │ ├── MK60F12.h │ │ ├── MK60F15.h │ │ ├── MK60N512VMD100.h │ │ ├── MK70F.h │ │ ├── MK70F12.h │ │ ├── MK70F15.h │ │ ├── include │ │ │ ├── arm_common_tables.h │ │ │ ├── arm_const_structs.h │ │ │ ├── arm_math.h │ │ │ ├── core_cm0.h │ │ │ ├── core_cm0plus.h │ │ │ ├── core_cm3.h │ │ │ ├── core_cm4.h │ │ │ ├── core_cm4_simd.h │ │ │ ├── core_cmFunc.h │ │ │ ├── core_cmInstr.h │ │ │ ├── core_sc000.h │ │ │ └── core_sc300.h │ │ ├── startup_MK60D.c │ │ ├── startup_MK70F.c │ │ ├── system_MK60D.c │ │ ├── system_MK60D.h │ │ ├── system_MK60F.c │ │ ├── system_MK70F.c │ │ └── system_MK70F.h │ │ ├── lwip_port │ │ ├── arch │ │ │ ├── cc.h │ │ │ ├── perf.h │ │ │ ├── sys_arch.c │ │ │ └── sys_arch.h │ │ ├── ethernetif.c │ │ ├── ethernetif.h │ │ └── lwipopts.h │ │ ├── twrk60n512.eww │ │ └── twrk70f120.eww ├── Holteck │ ├── HT32F125x │ │ └── readme.txt │ ├── HT32F175x │ │ └── readme.txt │ └── HT32F275x │ │ └── readme.txt ├── NXP │ ├── LPC11C1x │ │ └── readme.txt │ ├── LPC11xx │ │ └── readme.txt │ ├── LPC13xx │ │ └── readme.txt │ └── LPC17xx │ │ └── readme.txt ├── Nuvoton │ ├── NUC122 │ │ └── readme.txt │ ├── NUC1xx │ │ └── readme.txt │ ├── NUCM051 │ │ └── readme.txt │ └── NUCMini51 │ │ └── readme.txt ├── ST │ └── STM32F1xx │ │ ├── BSPLIB │ │ ├── inc │ │ │ ├── cortexm3_macro.h │ │ │ ├── stm32f10x_adc.h │ │ │ ├── stm32f10x_bkp.h │ │ │ ├── stm32f10x_can.h │ │ │ ├── stm32f10x_conf.h │ │ │ ├── stm32f10x_crc.h │ │ │ ├── stm32f10x_dac.h │ │ │ ├── stm32f10x_dbgmcu.h │ │ │ ├── stm32f10x_dma.h │ │ │ ├── stm32f10x_exti.h │ │ │ ├── stm32f10x_flash.h │ │ │ ├── stm32f10x_fsmc.h │ │ │ ├── stm32f10x_gpio.h │ │ │ ├── stm32f10x_i2c.h │ │ │ ├── stm32f10x_it.h │ │ │ ├── stm32f10x_iwdg.h │ │ │ ├── stm32f10x_lib.h │ │ │ ├── stm32f10x_map.h │ │ │ ├── stm32f10x_nvic.h │ │ │ ├── stm32f10x_pwr.h │ │ │ ├── stm32f10x_rcc.h │ │ │ ├── stm32f10x_rtc.h │ │ │ ├── stm32f10x_sdio.h │ │ │ ├── stm32f10x_spi.h │ │ │ ├── stm32f10x_systick.h │ │ │ ├── stm32f10x_tim.h │ │ │ ├── stm32f10x_tim1.h │ │ │ ├── stm32f10x_type.h │ │ │ ├── stm32f10x_usart.h │ │ │ └── stm32f10x_wwdg.h │ │ └── src │ │ │ ├── startup │ │ │ ├── GCC │ │ │ │ └── startup_stm32f10x_md.c │ │ │ ├── IAR │ │ │ │ └── cortexm3_macro.s │ │ │ └── MDK │ │ │ │ ├── cortexm3_macro.s │ │ │ │ └── startup_stm32f10x_ld.s │ │ │ ├── stm32f10x_adc.c │ │ │ ├── stm32f10x_exti.c │ │ │ ├── stm32f10x_gpio.c │ │ │ ├── stm32f10x_it.c │ │ │ ├── stm32f10x_lib.c │ │ │ ├── stm32f10x_nvic.c │ │ │ ├── stm32f10x_rcc.c │ │ │ ├── stm32f10x_rtc.c │ │ │ ├── stm32f10x_systick.c │ │ │ ├── stm32f10x_usart.c │ │ │ └── stm32f10x_vector.c │ │ ├── STM32F103RB_CoOS │ │ ├── IAR │ │ │ ├── APP │ │ │ │ ├── AppConfig.c │ │ │ │ ├── AppConfig.h │ │ │ │ ├── LED_4bit.c │ │ │ │ ├── OsConfig.h │ │ │ │ └── main.c │ │ │ ├── Project │ │ │ │ ├── CoOsDemo.ewd │ │ │ │ ├── CoOsDemo.ewp │ │ │ │ ├── CoOsDemo.eww │ │ │ │ ├── CoOsDemo.icf │ │ │ │ └── readme.txt │ │ │ └── readme.txt │ │ └── MDK │ │ │ ├── App │ │ │ ├── AppConfig.c │ │ │ ├── AppConfig.h │ │ │ ├── LCD_4bit.c │ │ │ ├── OsConfig.h │ │ │ └── main.c │ │ │ ├── Project │ │ │ ├── CoOsDemo.uvproj │ │ │ └── readme.txt │ │ │ └── readme.txt │ │ ├── gen_coide_project.bat │ │ ├── readme.txt │ │ └── resource │ │ └── CoOS_Example │ │ ├── .cproject │ │ ├── .project │ │ ├── .xml │ │ ├── build.xml │ │ ├── coide_gen.cob │ │ ├── debug.config │ │ ├── link.ld │ │ ├── memory.ld │ │ ├── port.c │ │ ├── startup_stm32f10x_md.c │ │ ├── stdio │ │ └── printf.c │ │ └── syscalls │ │ └── syscalls.c └── TI │ ├── LM3S8000 │ └── readme.txt │ └── LM3S9000 │ └── readme.txt ├── LICENSE ├── README.md ├── Test └── suite1 │ └── src │ ├── flagTest.c │ ├── kHeapTest.c │ ├── mboxTest.c │ ├── mmTset.c │ ├── mutexTest.c │ ├── queueTest.c │ ├── readme.txt │ ├── semTest.c │ ├── taskTest.c │ ├── test.c │ ├── test.h │ ├── timeTest.c │ └── timerTest.c ├── Tools └── iar2coide │ └── iar2coide.exe ├── clean.bat └── setup.iss /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | *.out 3 | *.o 4 | *.d 5 | *.lst 6 | *.map 7 | *.dep 8 | *.uvgui.* 9 | *.uvopt 10 | -------------------------------------------------------------------------------- /CoOS/Document/CooCox CoOS's TERMS AND CONDITIONS.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coocox/CoOS/fa559450993a716fa5c4d99213f9f4d38ba6525d/CoOS/Document/CooCox CoOS's TERMS AND CONDITIONS.pdf -------------------------------------------------------------------------------- /CoOS/Document/CooCox_CoOS_User_Guide.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coocox/CoOS/fa559450993a716fa5c4d99213f9f4d38ba6525d/CoOS/Document/CooCox_CoOS_User_Guide.pdf -------------------------------------------------------------------------------- /CoOS/Document/readme.txt: -------------------------------------------------------------------------------- 1 | CooCox CoOS's source code package includes the following files: 2 | 3 | kernel: CooCox CoOS's source code, you can use it without any modification. 4 | 5 | portable: CooCox CoOS's port for Cortex M. It includes the source code for Cortex M architecture with three edition: MDK, IAR, GCC. You can choose a suitable one for your application. 6 | 7 | OsConfig: Configuration files for CooCox CoOS. You can tailor CooCox CoOS for your application with it. 8 | 9 | CooCox CoOS's TERMS AND CONDITIONS.pdf: The terms you should obey when using CooCox CoOS's source code. 10 | 11 | To develop application based on CooCox CoOS, you should include all the source code files in the kernel folder, and choose an edition in portable folder for the compiler that you are using. You also should amend config.h for tailoring CooCox CoOS, otherwise CooCox CoOS may be too big for your needs. 12 | For detailed information,visit www.coocox.org 13 | -------------------------------------------------------------------------------- /CoOS/kernel/OsCore.h: -------------------------------------------------------------------------------- 1 | /** 2 | ******************************************************************************* 3 | * @file OsCore.h 4 | * @version V1.1.6 5 | * @date 2014.05.23 6 | * @brief Header file related to kernel 7 | ******************************************************************************* 8 | * @copy 9 | * 10 | * Redistribution and use in source and binary forms, with or without 11 | * modification, are permitted provided that the following conditions 12 | * are met: 13 | * 14 | * * Redistributions of source code must retain the above copyright 15 | * notice, this list of conditions and the following disclaimer. 16 | * * Redistributions in binary form must reproduce the above copyright 17 | * notice, this list of conditions and the following disclaimer in the 18 | * documentation and/or other materials provided with the distribution. 19 | * * Neither the name of the nor the names of its 20 | * contributors may be used to endorse or promote products derived 21 | * from this software without specific prior written permission. 22 | * 23 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 24 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 25 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 26 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 27 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 28 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 29 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 30 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 31 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 32 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 33 | * THE POSSIBILITY OF SUCH DAMAGE. 34 | * 35 | *

© COPYRIGHT 2014 CooCox

36 | ******************************************************************************* 37 | */ 38 | 39 | 40 | #ifndef _CORE_H 41 | #define _CORE_H 42 | 43 | #include 44 | 45 | 46 | #define OsSchedLock() OSSchedLock++; /*!< Lock schedule */ 47 | extern void OsSchedUnlock(void); 48 | 49 | #endif 50 | 51 | -------------------------------------------------------------------------------- /CoOS/kernel/OsKernelHeap.h: -------------------------------------------------------------------------------- 1 | /** 2 | ******************************************************************************* 3 | * @file OsKernelHeap.h 4 | * @version V1.1.6 5 | * @date 2014.05.23 6 | * @brief Header file related to memory management 7 | * @details This file including some defines and function declare related to 8 | * kernel heap management. 9 | ******************************************************************************* 10 | * @copy 11 | * 12 | * Redistribution and use in source and binary forms, with or without 13 | * modification, are permitted provided that the following conditions 14 | * are met: 15 | * 16 | * * Redistributions of source code must retain the above copyright 17 | * notice, this list of conditions and the following disclaimer. 18 | * * Redistributions in binary form must reproduce the above copyright 19 | * notice, this list of conditions and the following disclaimer in the 20 | * documentation and/or other materials provided with the distribution. 21 | * * Neither the name of the nor the names of its 22 | * contributors may be used to endorse or promote products derived 23 | * from this software without specific prior written permission. 24 | * 25 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 26 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 27 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 28 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 29 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 30 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 31 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 32 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 33 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 34 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 35 | * THE POSSIBILITY OF SUCH DAMAGE. 36 | * 37 | *

© COPYRIGHT 2014 CooCox

38 | ******************************************************************************* 39 | */ 40 | 41 | 42 | #ifndef _KERNELHEAP_H 43 | #define _KERNELHEAP_H 44 | 45 | 46 | typedef struct KennelHeap 47 | { 48 | U32 startAddr; 49 | U32 endAddr; 50 | }KHeap,*P_KHeap; 51 | 52 | 53 | typedef struct UsedMemBlk 54 | { 55 | void* nextMB; 56 | void* preMB; 57 | }UMB,*P_UMB; 58 | 59 | 60 | typedef struct FreeMemBlk 61 | { 62 | struct FreeMemBlk* nextFMB; 63 | struct UsedMemBlk* nextUMB; 64 | struct UsedMemBlk* preUMB; 65 | }FMB,*P_FMB; 66 | 67 | /*---------------------------- Function Declare ------------------------------*/ 68 | extern void CoCreateKheap(void); 69 | 70 | #endif /* _KERNELHEAP_H */ 71 | 72 | -------------------------------------------------------------------------------- /CoOS/kernel/OsMM.h: -------------------------------------------------------------------------------- 1 | /** 2 | ******************************************************************************* 3 | * @file OsMm.h 4 | * @version V1.1.6 5 | * @date 2014.05.23 6 | * @brief Header file related to memory management 7 | * @details This file including some defines and function declare related to 8 | * memory management. 9 | ******************************************************************************* 10 | * @copy 11 | * 12 | * Redistribution and use in source and binary forms, with or without 13 | * modification, are permitted provided that the following conditions 14 | * are met: 15 | * 16 | * * Redistributions of source code must retain the above copyright 17 | * notice, this list of conditions and the following disclaimer. 18 | * * Redistributions in binary form must reproduce the above copyright 19 | * notice, this list of conditions and the following disclaimer in the 20 | * documentation and/or other materials provided with the distribution. 21 | * * Neither the name of the nor the names of its 22 | * contributors may be used to endorse or promote products derived 23 | * from this software without specific prior written permission. 24 | * 25 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 26 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 27 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 28 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 29 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 30 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 31 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 32 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 33 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 34 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 35 | * THE POSSIBILITY OF SUCH DAMAGE. 36 | * 37 | *

© COPYRIGHT 2014 CooCox

38 | ******************************************************************************* 39 | */ 40 | 41 | 42 | #ifndef _MM_H 43 | #define _MM_H 44 | 45 | 46 | typedef struct Memory 47 | { 48 | U8* memAddr; 49 | U8* freeBlock; 50 | U32 blockSize; 51 | U32 blockNum; 52 | }MM,*P_MM; 53 | 54 | 55 | typedef struct MemoryBlock 56 | { 57 | struct MemoryBlock* nextBlock; 58 | }MemBlk,*P_MemBlk; 59 | 60 | 61 | extern U32 MemoryIDVessel; 62 | 63 | #endif /* _MM_H */ 64 | 65 | -------------------------------------------------------------------------------- /CoOS/kernel/OsQueue.h: -------------------------------------------------------------------------------- 1 | /** 2 | ******************************************************************************* 3 | * @file OsQueue.h 4 | * @version V1.1.6 5 | * @date 2014.05.23 6 | * @brief Queue management header file 7 | * @details This file including some defines and declares about queue management. 8 | ******************************************************************************* 9 | * @copy 10 | * 11 | * Redistribution and use in source and binary forms, with or without 12 | * modification, are permitted provided that the following conditions 13 | * are met: 14 | * 15 | * * Redistributions of source code must retain the above copyright 16 | * notice, this list of conditions and the following disclaimer. 17 | * * Redistributions in binary form must reproduce the above copyright 18 | * notice, this list of conditions and the following disclaimer in the 19 | * documentation and/or other materials provided with the distribution. 20 | * * Neither the name of the nor the names of its 21 | * contributors may be used to endorse or promote products derived 22 | * from this software without specific prior written permission. 23 | * 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 25 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 26 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 27 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 28 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 29 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 30 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 31 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 32 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 33 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 34 | * THE POSSIBILITY OF SUCH DAMAGE. 35 | * 36 | *

© COPYRIGHT 2014 CooCox

37 | ******************************************************************************* 38 | */ 39 | 40 | 41 | #ifndef _QUEUE_H 42 | #define _QUEUE_H 43 | 44 | 45 | /** 46 | * @struct Queue queue.h 47 | * @brief Queue struct 48 | * @details This struct use to manage queue. 49 | * 50 | */ 51 | typedef struct Queue 52 | { 53 | void **qStart; /*!< */ 54 | U8 id; /*!< */ 55 | U16 head; /*!< The header of queue */ 56 | U16 tail; /*!< The end of queue */ 57 | U16 qMaxSize; /*!< The max size of queue */ 58 | U16 qSize; /*!< Current size of queue */ 59 | }QCB,*P_QCB; 60 | 61 | 62 | #endif 63 | -------------------------------------------------------------------------------- /CoOS/kernel/OsServiceReq.h: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | ******************************************************************************* 4 | * @file OsServiceReq.h 5 | * @version V1.1.6 6 | * @date 2014.05.23 7 | * @brief Header file related to service request 8 | * @details This file including some defines and function declare related to 9 | * service request. 10 | ******************************************************************************* 11 | * @copy 12 | * 13 | * Redistribution and use in source and binary forms, with or without 14 | * modification, are permitted provided that the following conditions 15 | * are met: 16 | * 17 | * * Redistributions of source code must retain the above copyright 18 | * notice, this list of conditions and the following disclaimer. 19 | * * Redistributions in binary form must reproduce the above copyright 20 | * notice, this list of conditions and the following disclaimer in the 21 | * documentation and/or other materials provided with the distribution. 22 | * * Neither the name of the nor the names of its 23 | * contributors may be used to endorse or promote products derived 24 | * from this software without specific prior written permission. 25 | * 26 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 27 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 28 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 29 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 30 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 31 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 32 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 33 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 34 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 35 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 36 | * THE POSSIBILITY OF SUCH DAMAGE. 37 | * 38 | *

© COPYRIGHT 2014 CooCox

39 | ******************************************************************************* 40 | */ 41 | 42 | 43 | #ifndef _SERVICEREQ_H 44 | #define _SERVICEREQ_H 45 | 46 | #if CFG_MAX_SERVICE_REQUEST > 0 47 | #define SEM_REQ (U8)0x1 48 | #define MBOX_REQ (U8)0x2 49 | #define FLAG_REQ (U8)0x3 50 | #define QUEUE_REQ (U8)0x4 51 | 52 | 53 | typedef struct ServiceReqCell 54 | { 55 | U8 type; 56 | U8 id; 57 | void* arg; 58 | }SQC,*P_SQC; 59 | 60 | typedef struct ServiceReqQueue 61 | { 62 | U8 cnt; 63 | U8 head; 64 | SQC cell[CFG_MAX_SERVICE_REQUEST]; 65 | }SRQ,*P_SRQ; 66 | 67 | 68 | extern SRQ ServiceReq; 69 | extern BOOL InsertInSRQ(U8 type,U8 id,void* arg); 70 | #endif 71 | 72 | extern void RespondSRQ(void); 73 | extern BOOL TimeReq; 74 | extern BOOL TimerReq; 75 | extern BOOL IsrReq; 76 | #endif 77 | -------------------------------------------------------------------------------- /CoOS/kernel/OsTime.h: -------------------------------------------------------------------------------- 1 | /** 2 | ******************************************************************************* 3 | * @file OsTime.c 4 | * @version V1.1.6 5 | * @date 2014.05.23 6 | * @brief Header file related to time management 7 | * @details Thie file including some data declare related to time managment. 8 | ******************************************************************************* 9 | * @copy 10 | * 11 | * Redistribution and use in source and binary forms, with or without 12 | * modification, are permitted provided that the following conditions 13 | * are met: 14 | * 15 | * * Redistributions of source code must retain the above copyright 16 | * notice, this list of conditions and the following disclaimer. 17 | * * Redistributions in binary form must reproduce the above copyright 18 | * notice, this list of conditions and the following disclaimer in the 19 | * documentation and/or other materials provided with the distribution. 20 | * * Neither the name of the nor the names of its 21 | * contributors may be used to endorse or promote products derived 22 | * from this software without specific prior written permission. 23 | * 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 25 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 26 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 27 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 28 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 29 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 30 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 31 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 32 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 33 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 34 | * THE POSSIBILITY OF SUCH DAMAGE. 35 | * 36 | *

© COPYRIGHT 2014 CooCox

37 | ******************************************************************************* 38 | */ 39 | 40 | #ifndef _TIME_H 41 | #define _TIME_H 42 | 43 | /*---------------------------- Variable declare ------------------------------*/ 44 | extern P_OSTCB DlyList; /*!< A pointer to ther delay list. */ 45 | 46 | /*---------------------------- Function declare ------------------------------*/ 47 | extern void TimeDispose(void); /*!< Time dispose function. */ 48 | extern void isr_TimeDispose(void); 49 | extern void RemoveDelayList(P_OSTCB ptcb); 50 | extern void InsertDelayList(P_OSTCB ptcb,U32 ticks); 51 | #endif 52 | -------------------------------------------------------------------------------- /CoOS/kernel/coocox.h: -------------------------------------------------------------------------------- 1 | /** 2 | ******************************************************************************* 3 | * @file coocox.h 4 | * @version V1.1.6 5 | * @date 2014.05.23 6 | * @brief Gather for all header file of CooCox CoOS. 7 | ******************************************************************************* 8 | * @copy 9 | * 10 | * Redistribution and use in source and binary forms, with or without 11 | * modification, are permitted provided that the following conditions 12 | * are met: 13 | * 14 | * * Redistributions of source code must retain the above copyright 15 | * notice, this list of conditions and the following disclaimer. 16 | * * Redistributions in binary form must reproduce the above copyright 17 | * notice, this list of conditions and the following disclaimer in the 18 | * documentation and/or other materials provided with the distribution. 19 | * * Neither the name of the nor the names of its 20 | * contributors may be used to endorse or promote products derived 21 | * from this software without specific prior written permission. 22 | * 23 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 24 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 25 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 26 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 27 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 28 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 29 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 30 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 31 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 32 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 33 | * THE POSSIBILITY OF SUCH DAMAGE. 34 | * 35 | *

© COPYRIGHT 2014 CooCox

36 | ******************************************************************************* 37 | */ 38 | 39 | 40 | #ifndef _COOCOX_H 41 | #define _COOCOX_H 42 | 43 | #define OS_VERSION (U16)0x0116 /*!< OS version.(format: Vx.xx), 44 | e.g. value 0x0114 is version V1.14*/ 45 | /*---------------------------- Include ---------------------------------------*/ 46 | #include "CoOS.h" 47 | #include "OsArch.h" 48 | #include "OsCore.h" 49 | #include "OsTask.h" 50 | #include "OsServiceReq.h" 51 | #include "OsError.h" 52 | #include "OsTime.h" 53 | 54 | 55 | #if CFG_TMR_EN > 0 56 | #include "OsTimer.h" 57 | #endif 58 | 59 | #if CFG_KHEAP_EN > 0 60 | #include "OsKernelHeap.h" 61 | #endif 62 | 63 | #if CFG_MM_EN >0 64 | #include "OsMM.h" 65 | #endif 66 | 67 | #if CFG_EVENT_EN > 0 68 | #include "OsEvent.h" 69 | #endif 70 | 71 | #if CFG_MUTEX_EN > 0 72 | #include "OsMutex.h" 73 | #endif 74 | 75 | #if CFG_QUEUE_EN > 0 76 | #include "OsQueue.h" 77 | #endif 78 | 79 | #if CFG_FLAG_EN > 0 80 | #include "OsFlag.h" 81 | #endif 82 | 83 | #endif /* _COOCOX_H */ 84 | -------------------------------------------------------------------------------- /CoOS/kernel/utility.h: -------------------------------------------------------------------------------- 1 | /** 2 | ******************************************************************************* 3 | * @file utility.h 4 | * @version V1.1.6 5 | * @date 2014.05.23 6 | * @brief Utility function header file 7 | * @details This file including some defines and declares related to utility 8 | * function. 9 | ******************************************************************************* 10 | * @copy 11 | * 12 | * Redistribution and use in source and binary forms, with or without 13 | * modification, are permitted provided that the following conditions 14 | * are met: 15 | * 16 | * * Redistributions of source code must retain the above copyright 17 | * notice, this list of conditions and the following disclaimer. 18 | * * Redistributions in binary form must reproduce the above copyright 19 | * notice, this list of conditions and the following disclaimer in the 20 | * documentation and/or other materials provided with the distribution. 21 | * * Neither the name of the nor the names of its 22 | * contributors may be used to endorse or promote products derived 23 | * from this software without specific prior written permission. 24 | * 25 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 26 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 27 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 28 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 29 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 30 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 31 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 32 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 33 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 34 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 35 | * THE POSSIBILITY OF SUCH DAMAGE. 36 | * 37 | *

© COPYRIGHT 2014 CooCox

38 | ******************************************************************************* 39 | */ 40 | 41 | 42 | #ifndef _UTILITY_H 43 | #define _UTILITY_H 44 | 45 | 46 | /** 47 | * @struct Time struct utility.h 48 | * @brief Time struct 49 | * @details This struct use to manage time 50 | */ 51 | typedef struct SysTime 52 | { 53 | U8 sec; /*!< Second */ 54 | U8 min; /*!< Minute */ 55 | U8 hour; /*!< Hour */ 56 | U8 date; /*!< Date */ 57 | U8 month; /*!< Month */ 58 | U16 year; /*!< Year */ 59 | }TIME; 60 | 61 | #endif 62 | 63 | -------------------------------------------------------------------------------- /Components/gui/readme.txt: -------------------------------------------------------------------------------- 1 | Add a gui here -------------------------------------------------------------------------------- /Components/net/lwip-1.3.1/CHANGELOG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coocox/CoOS/fa559450993a716fa5c4d99213f9f4d38ba6525d/Components/net/lwip-1.3.1/CHANGELOG -------------------------------------------------------------------------------- /Components/net/lwip-1.3.1/COPYING: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001, 2002 Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, 6 | * are permitted provided that the following conditions are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 3. The name of the author may not be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 19 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 21 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 24 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 25 | * OF SUCH DAMAGE. 26 | * 27 | * This file is part of the lwIP TCP/IP stack. 28 | * 29 | * Author: Adam Dunkels 30 | * 31 | */ 32 | 33 | 34 | -------------------------------------------------------------------------------- /Components/net/lwip-1.3.1/FILES: -------------------------------------------------------------------------------- 1 | src/ - The source code for the lwIP TCP/IP stack. 2 | doc/ - The documentation for lwIP. 3 | 4 | See also the FILES file in each subdirectory. 5 | -------------------------------------------------------------------------------- /Components/net/lwip-1.3.1/doc/FILES: -------------------------------------------------------------------------------- 1 | savannah.txt - How to obtain the current development source code. 2 | contrib.txt - How to contribute to lwIP as a developer. 3 | rawapi.txt - The documentation for the core API of lwIP. 4 | Also provides an overview about the other APIs and multithreading. 5 | snmp_agent.txt - The documentation for the lwIP SNMP agent. 6 | sys_arch.txt - The documentation for a system abstraction layer of lwIP. 7 | -------------------------------------------------------------------------------- /Components/net/lwip-1.3.1/port/CoOS/arch/cpu.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001-2003 Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, 6 | * are permitted provided that the following conditions are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 3. The name of the author may not be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 19 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 21 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 24 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 25 | * OF SUCH DAMAGE. 26 | * 27 | * This file is part of the lwIP TCP/IP stack. 28 | * 29 | * Author: Adam Dunkels 30 | * 31 | */ 32 | #ifndef __CPU_H__ 33 | #define __CPU_H__ 34 | 35 | #define BYTE_ORDER LITTLE_ENDIAN 36 | 37 | #endif /* __CPU_H__ */ 38 | -------------------------------------------------------------------------------- /Components/net/lwip-1.3.1/port/CoOS/arch/init.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001-2003 Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, 6 | * are permitted provided that the following conditions are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 3. The name of the author may not be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 19 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 21 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 24 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 25 | * OF SUCH DAMAGE. 26 | * 27 | * This file is part of the lwIP TCP/IP stack. 28 | * 29 | * Author: Adam Dunkels 30 | * 31 | */ 32 | #ifndef __ARCH_INIT_H__ 33 | #define __ARCH_INIT_H__ 34 | 35 | #define TCPIP_INIT_DONE(arg) tcpip_init_done(arg) 36 | 37 | void tcpip_init_done(void *); 38 | int wait_for_tcpip_init(void); 39 | 40 | #endif /* __ARCH_INIT_H__ */ 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /Components/net/lwip-1.3.1/port/CoOS/arch/lib.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001-2003 Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, 6 | * are permitted provided that the following conditions are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 3. The name of the author may not be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 19 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 21 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 24 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 25 | * OF SUCH DAMAGE. 26 | * 27 | * This file is part of the lwIP TCP/IP stack. 28 | * 29 | * Author: Adam Dunkels 30 | * 31 | */ 32 | #ifndef __LIB_H__ 33 | #define __LIB_H__ 34 | 35 | #include 36 | 37 | 38 | #endif /* __LIB_H__ */ 39 | -------------------------------------------------------------------------------- /Components/net/lwip-1.3.1/port/CoOS/arch/perf.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001-2003 Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, 6 | * are permitted provided that the following conditions are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 3. The name of the author may not be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 19 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 21 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 24 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 25 | * OF SUCH DAMAGE. 26 | * 27 | * This file is part of the lwIP TCP/IP stack. 28 | * 29 | * Author: Adam Dunkels 30 | * 31 | */ 32 | #ifndef __PERF_H__ 33 | #define __PERF_H__ 34 | 35 | #define PERF_START /* null definition */ 36 | #define PERF_STOP(x) /* null definition */ 37 | 38 | #endif /* __PERF_H__ */ 39 | -------------------------------------------------------------------------------- /Components/net/lwip-1.3.1/port/CoOS/arch/sys_arch.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001-2003 Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, 6 | * are permitted provided that the following conditions are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 3. The name of the author may not be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 19 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 21 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 24 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 25 | * OF SUCH DAMAGE. 26 | * 27 | * This file is part of the lwIP TCP/IP stack. 28 | * 29 | * Author: Adam Dunkels 30 | * 31 | */ 32 | #ifndef __SYS_RTXC_H__ 33 | #define __SYS_RTXC_H__ 34 | 35 | #include "COOS.h" 36 | #include "ostask.h" 37 | #include "osqueue.h" 38 | 39 | #define SYS_MBOX_NULL (OS_EventID)-1 40 | #define SYS_SEM_NULL (OS_EventID)-1 41 | 42 | typedef OS_EventID sys_sem_t; 43 | typedef OS_EventID sys_mbox_t; 44 | typedef OS_TID sys_thread_t; 45 | typedef u32_t sys_prot_t; 46 | 47 | #define LWIP_TASK_MAX 3 48 | 49 | #define LWIP_START_PRIO 3 50 | 51 | #define LWIP_MAX_QUEUE 10 52 | #define LWIP_SIZE_QUEUE 10 53 | 54 | #define OS_SEM_MAX_STATE 0xFFFF 55 | 56 | #endif /* __SYS_RTXC_H__ */ 57 | 58 | -------------------------------------------------------------------------------- /Components/net/lwip-1.3.1/port/CoOS/ethernetif/LPC17xx/ethernetif.h: -------------------------------------------------------------------------------- 1 | #ifndef ETHERNETIF_H_ 2 | #define ETHERNETIF_H_ 3 | 4 | #include "lwip/debug.h" 5 | #include "lwip/opt.h" 6 | #include "lwip/def.h" 7 | #include "lwip/ip.h" 8 | #include "lwip/mem.h" 9 | #include "lwip/pbuf.h" 10 | #include "lwip/sys.h" 11 | #include "netif/etharp.h" 12 | 13 | err_t 14 | ethernetif_init(struct netif *netif); 15 | 16 | void 17 | ethernetif_input(struct netif *netif); 18 | 19 | #endif 20 | -------------------------------------------------------------------------------- /Components/net/lwip-1.3.1/src/.hgignore: -------------------------------------------------------------------------------- 1 | syntax: glob 2 | 3 | *.pyc 4 | *.orig 5 | *.rej 6 | *~ 7 | TAGS 8 | Module.symvers 9 | *.ncb 10 | *.suo 11 | *.bak 12 | *.orig 13 | *.rej 14 | 15 | syntax: regexp 16 | \.\#.+ 17 | [\\/]CVS$ 18 | ^CVS$ 19 | ^build$ 20 | ^install$ 21 | ^logs.build_tree$ 22 | [\\/]bin$ 23 | ^bin$ 24 | [\\/]obj$ 25 | ^obj$ 26 | \.cvsignore 27 | -------------------------------------------------------------------------------- /Components/net/lwip-1.3.1/src/FILES: -------------------------------------------------------------------------------- 1 | api/ - The code for the high-level wrapper API. Not needed if 2 | you use the lowel-level call-back/raw API. 3 | 4 | core/ - The core of the TPC/IP stack; protocol implementations, 5 | memory and buffer management, and the low-level raw API. 6 | 7 | include/ - lwIP include files. 8 | 9 | netif/ - Generic network interface device drivers are kept here, 10 | as well as the ARP module. 11 | 12 | For more information on the various subdirectories, check the FILES 13 | file in each directory. 14 | -------------------------------------------------------------------------------- /Components/net/lwip-1.3.1/src/api/err.c: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * Error Management module 4 | * 5 | */ 6 | 7 | /* 8 | * Copyright (c) 2001-2004 Swedish Institute of Computer Science. 9 | * All rights reserved. 10 | * 11 | * Redistribution and use in source and binary forms, with or without modification, 12 | * are permitted provided that the following conditions are met: 13 | * 14 | * 1. Redistributions of source code must retain the above copyright notice, 15 | * this list of conditions and the following disclaimer. 16 | * 2. Redistributions in binary form must reproduce the above copyright notice, 17 | * this list of conditions and the following disclaimer in the documentation 18 | * and/or other materials provided with the distribution. 19 | * 3. The name of the author may not be used to endorse or promote products 20 | * derived from this software without specific prior written permission. 21 | * 22 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 23 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 24 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 25 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 26 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 27 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 29 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 30 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 31 | * OF SUCH DAMAGE. 32 | * 33 | * This file is part of the lwIP TCP/IP stack. 34 | * 35 | * Author: Adam Dunkels 36 | * 37 | */ 38 | 39 | #include "lwip/err.h" 40 | 41 | #ifdef LWIP_DEBUG 42 | 43 | static const char *err_strerr[] = { 44 | "Ok.", /* ERR_OK 0 */ 45 | "Out of memory error.", /* ERR_MEM -1 */ 46 | "Buffer error.", /* ERR_BUF -2 */ 47 | "Timeout.", /* ERR_TIMEOUT -3 */ 48 | "Routing problem.", /* ERR_RTE -4 */ 49 | "Connection aborted.", /* ERR_ABRT -5 */ 50 | "Connection reset.", /* ERR_RST -6 */ 51 | "Connection closed.", /* ERR_CLSD -7 */ 52 | "Not connected.", /* ERR_CONN -8 */ 53 | "Illegal value.", /* ERR_VAL -9 */ 54 | "Illegal argument.", /* ERR_ARG -10 */ 55 | "Address in use.", /* ERR_USE -11 */ 56 | "Low-level netif error.", /* ERR_IF -12 */ 57 | "Already connected.", /* ERR_ISCONN -13 */ 58 | "Operation in progress." /* ERR_INPROGRESS -14 */ 59 | }; 60 | 61 | /** 62 | * Convert an lwip internal error to a string representation. 63 | * 64 | * @param err an lwip internal err_t 65 | * @return a string representation for err 66 | */ 67 | const char * 68 | lwip_strerr(err_t err) 69 | { 70 | return err_strerr[-err]; 71 | 72 | } 73 | 74 | #endif /* LWIP_DEBUG */ 75 | -------------------------------------------------------------------------------- /Components/net/lwip-1.3.1/src/include/ipv4/lwip/inet_chksum.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001-2004 Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, 6 | * are permitted provided that the following conditions are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 3. The name of the author may not be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 19 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 21 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 24 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 25 | * OF SUCH DAMAGE. 26 | * 27 | * This file is part of the lwIP TCP/IP stack. 28 | * 29 | * Author: Adam Dunkels 30 | * 31 | */ 32 | #ifndef __LWIP_INET_CHKSUM_H__ 33 | #define __LWIP_INET_CHKSUM_H__ 34 | 35 | #include "lwip/opt.h" 36 | 37 | #include "lwip/pbuf.h" 38 | #include "lwip/ip_addr.h" 39 | 40 | #ifdef __cplusplus 41 | extern "C" { 42 | #endif 43 | 44 | u16_t inet_chksum(void *dataptr, u16_t len); 45 | u16_t inet_chksum_pbuf(struct pbuf *p); 46 | u16_t inet_chksum_pseudo(struct pbuf *p, 47 | struct ip_addr *src, struct ip_addr *dest, 48 | u8_t proto, u16_t proto_len); 49 | #if LWIP_UDPLITE 50 | u16_t inet_chksum_pseudo_partial(struct pbuf *p, 51 | struct ip_addr *src, struct ip_addr *dest, 52 | u8_t proto, u16_t proto_len, u16_t chksum_len); 53 | #endif 54 | 55 | #ifdef __cplusplus 56 | } 57 | #endif 58 | 59 | #endif /* __LWIP_INET_H__ */ 60 | 61 | -------------------------------------------------------------------------------- /Components/net/lwip-1.3.1/src/include/ipv4/lwip/ip_frag.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001-2004 Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, 6 | * are permitted provided that the following conditions are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 3. The name of the author may not be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 19 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 21 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 24 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 25 | * OF SUCH DAMAGE. 26 | * 27 | * This file is part of the lwIP TCP/IP stack. 28 | * 29 | * Author: Jani Monoses 30 | * 31 | */ 32 | 33 | #ifndef __LWIP_IP_FRAG_H__ 34 | #define __LWIP_IP_FRAG_H__ 35 | 36 | #include "lwip/opt.h" 37 | #include "lwip/err.h" 38 | #include "lwip/pbuf.h" 39 | #include "lwip/netif.h" 40 | #include "lwip/ip_addr.h" 41 | #include "lwip/ip.h" 42 | 43 | #ifdef __cplusplus 44 | extern "C" { 45 | #endif 46 | 47 | #if IP_REASSEMBLY 48 | /* The IP reassembly timer interval in milliseconds. */ 49 | #define IP_TMR_INTERVAL 1000 50 | 51 | /* IP reassembly helper struct. 52 | * This is exported because memp needs to know the size. 53 | */ 54 | struct ip_reassdata { 55 | struct ip_reassdata *next; 56 | struct pbuf *p; 57 | struct ip_hdr iphdr; 58 | u16_t datagram_len; 59 | u8_t flags; 60 | u8_t timer; 61 | }; 62 | 63 | void ip_reass_init(void); 64 | void ip_reass_tmr(void); 65 | struct pbuf * ip_reass(struct pbuf *p); 66 | #endif /* IP_REASSEMBLY */ 67 | 68 | #if IP_FRAG 69 | err_t ip_frag(struct pbuf *p, struct netif *netif, struct ip_addr *dest); 70 | #endif /* IP_FRAG */ 71 | 72 | #ifdef __cplusplus 73 | } 74 | #endif 75 | 76 | #endif /* __LWIP_IP_FRAG_H__ */ 77 | -------------------------------------------------------------------------------- /Components/net/lwip-1.3.1/src/include/ipv6/lwip/inet.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001-2004 Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, 6 | * are permitted provided that the following conditions are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 3. The name of the author may not be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 19 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 21 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 24 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 25 | * OF SUCH DAMAGE. 26 | * 27 | * This file is part of the lwIP TCP/IP stack. 28 | * 29 | * Author: Adam Dunkels 30 | * 31 | */ 32 | #ifndef __LWIP_INET_H__ 33 | #define __LWIP_INET_H__ 34 | 35 | #include "lwip/opt.h" 36 | #include "lwip/pbuf.h" 37 | #include "lwip/ip_addr.h" 38 | 39 | #ifdef __cplusplus 40 | extern "C" { 41 | #endif 42 | 43 | u16_t inet_chksum(void *data, u16_t len); 44 | u16_t inet_chksum_pbuf(struct pbuf *p); 45 | u16_t inet_chksum_pseudo(struct pbuf *p, 46 | struct ip_addr *src, struct ip_addr *dest, 47 | u8_t proto, u32_t proto_len); 48 | 49 | u32_t inet_addr(const char *cp); 50 | s8_t inet_aton(const char *cp, struct in_addr *addr); 51 | 52 | #ifndef _MACHINE_ENDIAN_H_ 53 | #ifndef _NETINET_IN_H 54 | #ifndef _LINUX_BYTEORDER_GENERIC_H 55 | u16_t htons(u16_t n); 56 | u16_t ntohs(u16_t n); 57 | u32_t htonl(u32_t n); 58 | u32_t ntohl(u32_t n); 59 | #endif /* _LINUX_BYTEORDER_GENERIC_H */ 60 | #endif /* _NETINET_IN_H */ 61 | #endif /* _MACHINE_ENDIAN_H_ */ 62 | 63 | #ifdef __cplusplus 64 | } 65 | #endif 66 | 67 | #endif /* __LWIP_INET_H__ */ 68 | 69 | -------------------------------------------------------------------------------- /Components/net/lwip-1.3.1/src/include/lwip/def.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001-2004 Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, 6 | * are permitted provided that the following conditions are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 3. The name of the author may not be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 19 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 21 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 24 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 25 | * OF SUCH DAMAGE. 26 | * 27 | * This file is part of the lwIP TCP/IP stack. 28 | * 29 | * Author: Adam Dunkels 30 | * 31 | */ 32 | #ifndef __LWIP_DEF_H__ 33 | #define __LWIP_DEF_H__ 34 | 35 | /* this might define NULL already */ 36 | #include "lwip/arch.h" 37 | 38 | #define LWIP_MAX(x , y) (((x) > (y)) ? (x) : (y)) 39 | #define LWIP_MIN(x , y) (((x) < (y)) ? (x) : (y)) 40 | 41 | #ifndef NULL 42 | #define NULL ((void *)0) 43 | #endif 44 | 45 | 46 | #endif /* __LWIP_DEF_H__ */ 47 | 48 | -------------------------------------------------------------------------------- /Components/net/lwip-1.3.1/src/include/lwip/sio.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001-2004 Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, 6 | * are permitted provided that the following conditions are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 3. The name of the author may not be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 19 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 21 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 24 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 25 | * OF SUCH DAMAGE. 26 | * 27 | * This file is part of the lwIP TCP/IP stack. 28 | */ 29 | 30 | /* 31 | * This is the interface to the platform specific serial IO module 32 | * It needs to be implemented by those platforms which need SLIP or PPP 33 | */ 34 | 35 | #ifndef __SIO_H__ 36 | #define __SIO_H__ 37 | 38 | #include "lwip/arch.h" 39 | 40 | #ifdef __cplusplus 41 | extern "C" { 42 | #endif 43 | 44 | /* If you want to define sio_fd_t elsewhere or differently, 45 | define this in your cc.h file. */ 46 | #ifndef __sio_fd_t_defined 47 | typedef void * sio_fd_t; 48 | #endif 49 | 50 | /* The following functions can be defined to something else in your cc.h file 51 | or be implemented in your custom sio.c file. */ 52 | 53 | #ifndef sio_open 54 | sio_fd_t sio_open(u8_t); 55 | #endif 56 | 57 | #ifndef sio_send 58 | void sio_send(u8_t, sio_fd_t); 59 | #endif 60 | 61 | #ifndef sio_recv 62 | u8_t sio_recv(sio_fd_t); 63 | #endif 64 | 65 | #ifndef sio_read 66 | u32_t sio_read(sio_fd_t, u8_t *, u32_t); 67 | #endif 68 | 69 | #ifndef sio_write 70 | u32_t sio_write(sio_fd_t, u8_t *, u32_t); 71 | #endif 72 | 73 | #ifndef sio_read_abort 74 | void sio_read_abort(sio_fd_t); 75 | #endif 76 | 77 | #ifdef __cplusplus 78 | } 79 | #endif 80 | 81 | #endif /* __SIO_H__ */ 82 | -------------------------------------------------------------------------------- /Components/net/lwip-1.3.1/src/include/netif/fifo.h: -------------------------------------------------------------------------------- 1 | #ifndef FIFO_H 2 | #define FIFO_H 3 | 4 | #include "lwip/sys.h" 5 | 6 | /** How many bytes in fifo */ 7 | #define FIFOSIZE 2048 8 | 9 | /** fifo data structure, this one is passed to all fifo functions */ 10 | typedef struct fifo_t { 11 | u8_t data[FIFOSIZE+10]; /* data segment, +10 is a hack probably not needed.. FIXME! */ 12 | int dataslot; /* index to next char to be read */ 13 | int emptyslot; /* index to next empty slot */ 14 | int len; /* len probably not needed, may be calculated from dataslot and emptyslot in conjunction with FIFOSIZE */ 15 | 16 | sys_sem_t sem; /* semaphore protecting simultaneous data manipulation */ 17 | sys_sem_t getSem; /* sepaphore used to signal new data if getWaiting is set */ 18 | u8_t getWaiting; /* flag used to indicate that fifoget is waiting for data. fifoput is suposed to clear */ 19 | /* this flag prior to signaling the getSem semaphore */ 20 | } fifo_t; 21 | 22 | 23 | /** 24 | * Get a character from fifo 25 | * Blocking call. 26 | * @param pointer to fifo data structure 27 | * @return character read from fifo 28 | */ 29 | u8_t fifoGet(fifo_t * fifo); 30 | 31 | /** 32 | * Get a character from fifo 33 | * Non blocking call. 34 | * @param pointer to fifo data structure 35 | * @return character read from fifo, or < zero if non was available 36 | */ 37 | s16_t fifoGetNonBlock(fifo_t * fifo); 38 | 39 | /** 40 | * fifoput is called by the signalhandler when new data has arrived (or some other event is indicated) 41 | * fifoput reads directly from the serialport and is thus highly dependent on unix arch at this moment 42 | * @param fifo pointer to fifo data structure 43 | * @param fd unix file descriptor 44 | */ 45 | void fifoPut(fifo_t * fifo, int fd); 46 | 47 | /** 48 | * fifoinit initiate fifo 49 | * @param fifo pointer to fifo data structure, allocated by the user 50 | */ 51 | void fifoInit(fifo_t * fifo); 52 | 53 | #endif 54 | 55 | -------------------------------------------------------------------------------- /Components/net/lwip-1.3.1/src/include/netif/loopif.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001-2004 Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, 6 | * are permitted provided that the following conditions are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 3. The name of the author may not be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 19 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 21 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 24 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 25 | * OF SUCH DAMAGE. 26 | * 27 | * This file is part of the lwIP TCP/IP stack. 28 | * 29 | * Author: Adam Dunkels 30 | * 31 | */ 32 | #ifndef __NETIF_LOOPIF_H__ 33 | #define __NETIF_LOOPIF_H__ 34 | 35 | #include "lwip/opt.h" 36 | #include "lwip/netif.h" 37 | #include "lwip/err.h" 38 | 39 | #ifdef __cplusplus 40 | extern "C" { 41 | #endif 42 | 43 | #if !LWIP_NETIF_LOOPBACK_MULTITHREADING 44 | #define loopif_poll netif_poll 45 | #endif /* !LWIP_NETIF_LOOPBACK_MULTITHREADING */ 46 | 47 | err_t loopif_init(struct netif *netif); 48 | 49 | #ifdef __cplusplus 50 | } 51 | #endif 52 | 53 | #endif /* __NETIF_LOOPIF_H__ */ 54 | -------------------------------------------------------------------------------- /Components/net/lwip-1.3.1/src/include/netif/sio.h: -------------------------------------------------------------------------------- 1 | #ifndef SIO_H 2 | #define SIO_H 3 | 4 | #include "lwip/sys.h" 5 | #include "lwip/netif.h" 6 | #include "netif/fifo.h" 7 | /*#include "netif/pppif.h"*/ 8 | /* BAUDRATE is defined in sio.c as it is implementation specific */ 9 | 10 | #define B9600 9600 11 | #define B19200 19200 12 | #define B38400 38400 13 | #define B57600 57600 14 | #define B115200 115200 15 | 16 | 17 | typedef struct sio_status_t { 18 | int fd; 19 | fifo_t myfifo; 20 | } sio_status_t; 21 | 22 | 23 | /** Baudrates */ 24 | typedef enum sioBaudrates { 25 | SIO_BAUD_9600, 26 | SIO_BAUD_19200, 27 | SIO_BAUD_38400, 28 | SIO_BAUD_57600, 29 | SIO_BAUD_115200 30 | } sioBaudrates; 31 | 32 | /** 33 | * Read a char from incoming data stream, this call blocks until data has arrived 34 | * @param siostat siostatus struct, contains sio instance data, given by sio_open 35 | * @return char read from input stream 36 | */ 37 | u8_t sio_recv( sio_status_t * siostat ); 38 | 39 | /** 40 | * Poll for a new character from incoming data stream 41 | * @param siostat siostatus struct, contains sio instance data, given by sio_open 42 | * @return char read from input stream, or < 0 if no char was available 43 | */ 44 | s16_t sio_poll(sio_status_t * siostat); 45 | 46 | /** 47 | * Parse incoming characters until a string str is recieved, blocking call 48 | * @param str zero terminated string to expect 49 | * @param siostat siostatus struct, contains sio instance data, given by sio_open 50 | */ 51 | void sio_expect_string(u8_t *str, sio_status_t * siostat); 52 | 53 | /** 54 | * Write a char to output data stream 55 | * @param c char to write to output stream 56 | * @param siostat siostatus struct, contains sio instance data, given by sio_open 57 | */ 58 | void sio_send( u8_t c, sio_status_t * siostat ); 59 | 60 | /** 61 | * Write a char to output data stream 62 | * @param str pointer to a zero terminated string 63 | * @param siostat siostatus struct, contains sio instance data, given by sio_open 64 | */ 65 | void sio_send_string(u8_t *str, sio_status_t * siostat); 66 | 67 | /** 68 | * Flush outbuffer (send everything in buffer now), useful if some layer below is 69 | * holding on to data, waitng to fill a buffer 70 | * @param siostat siostatus struct, contains sio instance data, given by sio_open 71 | */ 72 | void sio_flush( sio_status_t * siostat ); 73 | 74 | /** 75 | * Open serial port entry point from serial protocol (slipif, pppif) 76 | * @param devnum the device number to use, i.e. ttySx, comx:, etc. there x = devnum 77 | * @return siostatus struct, contains sio instance data, use when calling sio functions 78 | */ 79 | sio_status_t * sio_open( int devnum ); 80 | 81 | /** 82 | * Change baudrate of port, may close and reopen port 83 | * @param baud new baudrate 84 | * @param siostat siostatus struct, contains sio instance data, given by sio_open 85 | */ 86 | void sio_change_baud( sioBaudrates baud, sio_status_t * siostat ); 87 | 88 | #endif 89 | 90 | -------------------------------------------------------------------------------- /Components/net/lwip-1.3.1/src/include/netif/slipif.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001, Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 3. Neither the name of the Institute nor the names of its contributors 14 | * may be used to endorse or promote products derived from this software 15 | * without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND 18 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE 21 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 | * SUCH DAMAGE. 28 | * 29 | * This file is part of the lwIP TCP/IP stack. 30 | * 31 | * Author: Adam Dunkels 32 | * 33 | */ 34 | #ifndef __NETIF_SLIPIF_H__ 35 | #define __NETIF_SLIPIF_H__ 36 | 37 | #include "lwip/netif.h" 38 | 39 | #ifdef __cplusplus 40 | extern "C" { 41 | #endif 42 | 43 | err_t slipif_init(struct netif * netif); 44 | 45 | #ifdef __cplusplus 46 | } 47 | #endif 48 | 49 | #endif 50 | 51 | -------------------------------------------------------------------------------- /Components/net/lwip-1.3.1/src/netif/FILES: -------------------------------------------------------------------------------- 1 | This directory contains generic network interface device drivers that 2 | do not contain any hardware or architecture specific code. The files 3 | are: 4 | 5 | etharp.c 6 | Implements the ARP (Address Resolution Protocol) over 7 | Ethernet. The code in this file should be used together with 8 | Ethernet device drivers. Note that this module has been 9 | largely made Ethernet independent so you should be able to 10 | adapt this for other link layers (such as Firewire). 11 | 12 | ethernetif.c 13 | An example of how an Ethernet device driver could look. This 14 | file can be used as a "skeleton" for developing new Ethernet 15 | network device drivers. It uses the etharp.c ARP code. 16 | 17 | loopif.c 18 | A "loopback" network interface driver. It requires configuration 19 | through the define LWIP_LOOPIF_MULTITHREADING (see opt.h). 20 | 21 | slipif.c 22 | A generic implementation of the SLIP (Serial Line IP) 23 | protocol. It requires a sio (serial I/O) module to work. 24 | 25 | ppp/ Point-to-Point Protocol stack 26 | -------------------------------------------------------------------------------- /Components/net/lwip-1.3.1/src/netif/loopif.c: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * Loop Interface 4 | * 5 | */ 6 | 7 | /* 8 | * Copyright (c) 2001-2004 Swedish Institute of Computer Science. 9 | * All rights reserved. 10 | * 11 | * Redistribution and use in source and binary forms, with or without modification, 12 | * are permitted provided that the following conditions are met: 13 | * 14 | * 1. Redistributions of source code must retain the above copyright notice, 15 | * this list of conditions and the following disclaimer. 16 | * 2. Redistributions in binary form must reproduce the above copyright notice, 17 | * this list of conditions and the following disclaimer in the documentation 18 | * and/or other materials provided with the distribution. 19 | * 3. The name of the author may not be used to endorse or promote products 20 | * derived from this software without specific prior written permission. 21 | * 22 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 23 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 24 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 25 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 26 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 27 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 29 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 30 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 31 | * OF SUCH DAMAGE. 32 | * 33 | * This file is part of the lwIP TCP/IP stack. 34 | * 35 | * Author: Adam Dunkels 36 | * 37 | */ 38 | #include "lwip/opt.h" 39 | 40 | #if LWIP_HAVE_LOOPIF 41 | 42 | #include "netif/loopif.h" 43 | #include "lwip/snmp.h" 44 | 45 | /** 46 | * Initialize a lwip network interface structure for a loopback interface 47 | * 48 | * @param netif the lwip network interface structure for this loopif 49 | * @return ERR_OK if the loopif is initialized 50 | * ERR_MEM if private data couldn't be allocated 51 | */ 52 | err_t 53 | loopif_init(struct netif *netif) 54 | { 55 | /* initialize the snmp variables and counters inside the struct netif 56 | * ifSpeed: no assumption can be made! 57 | */ 58 | NETIF_INIT_SNMP(netif, snmp_ifType_softwareLoopback, 0); 59 | 60 | netif->name[0] = 'l'; 61 | netif->name[1] = 'o'; 62 | netif->output = netif_loop_output; 63 | return ERR_OK; 64 | } 65 | 66 | #endif /* LWIP_HAVE_LOOPIF */ 67 | -------------------------------------------------------------------------------- /Components/net/lwip-1.3.1/src/netif/ppp/md5.h: -------------------------------------------------------------------------------- 1 | /* 2 | *********************************************************************** 3 | ** md5.h -- header file for implementation of MD5 ** 4 | ** RSA Data Security, Inc. MD5 Message-Digest Algorithm ** 5 | ** Created: 2/17/90 RLR ** 6 | ** Revised: 12/27/90 SRD,AJ,BSK,JT Reference C version ** 7 | ** Revised (for MD5): RLR 4/27/91 ** 8 | ** -- G modified to have y&~z instead of y&z ** 9 | ** -- FF, GG, HH modified to add in last register done ** 10 | ** -- Access pattern: round 2 works mod 5, round 3 works mod 3 ** 11 | ** -- distinct additive constant for each step ** 12 | ** -- round 4 added, working mod 7 ** 13 | *********************************************************************** 14 | */ 15 | 16 | /* 17 | *********************************************************************** 18 | ** Copyright (C) 1990, RSA Data Security, Inc. All rights reserved. ** 19 | ** ** 20 | ** License to copy and use this software is granted provided that ** 21 | ** it is identified as the "RSA Data Security, Inc. MD5 Message- ** 22 | ** Digest Algorithm" in all material mentioning or referencing this ** 23 | ** software or this function. ** 24 | ** ** 25 | ** License is also granted to make and use derivative works ** 26 | ** provided that such works are identified as "derived from the RSA ** 27 | ** Data Security, Inc. MD5 Message-Digest Algorithm" in all ** 28 | ** material mentioning or referencing the derived work. ** 29 | ** ** 30 | ** RSA Data Security, Inc. makes no representations concerning ** 31 | ** either the merchantability of this software or the suitability ** 32 | ** of this software for any particular purpose. It is provided "as ** 33 | ** is" without express or implied warranty of any kind. ** 34 | ** ** 35 | ** These notices must be retained in any copies of any part of this ** 36 | ** documentation and/or software. ** 37 | *********************************************************************** 38 | */ 39 | 40 | #ifndef MD5_H 41 | #define MD5_H 42 | 43 | /* Data structure for MD5 (Message-Digest) computation */ 44 | typedef struct { 45 | u32_t i[2]; /* number of _bits_ handled mod 2^64 */ 46 | u32_t buf[4]; /* scratch buffer */ 47 | unsigned char in[64]; /* input buffer */ 48 | unsigned char digest[16]; /* actual digest after MD5Final call */ 49 | } MD5_CTX; 50 | 51 | void MD5Init ( MD5_CTX *mdContext); 52 | void MD5Update( MD5_CTX *mdContext, unsigned char *inBuf, unsigned int inLen); 53 | void MD5Final ( unsigned char hash[], MD5_CTX *mdContext); 54 | 55 | #endif /* MD5_H */ 56 | -------------------------------------------------------------------------------- /Components/net/lwip-1.3.1/src/netif/ppp/pppdebug.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * pppdebug.h - System debugging utilities. 3 | * 4 | * Copyright (c) 2003 by Marc Boucher, Services Informatiques (MBSI) inc. 5 | * portions Copyright (c) 1998 Global Election Systems Inc. 6 | * portions Copyright (c) 2001 by Cognizant Pty Ltd. 7 | * 8 | * The authors hereby grant permission to use, copy, modify, distribute, 9 | * and license this software and its documentation for any purpose, provided 10 | * that existing copyright notices are retained in all copies and that this 11 | * notice and the following disclaimer are included verbatim in any 12 | * distributions. No written agreement, license, or royalty fee is required 13 | * for any of the authorized uses. 14 | * 15 | * THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS *AS IS* AND ANY EXPRESS OR 16 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 17 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 18 | * IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 19 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 20 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | * 26 | ****************************************************************************** 27 | * REVISION HISTORY (please don't use tabs!) 28 | * 29 | * 03-01-01 Marc Boucher 30 | * Ported to lwIP. 31 | * 98-07-29 Guy Lancaster , Global Election Systems Inc. 32 | * Original. 33 | * 34 | ***************************************************************************** 35 | */ 36 | #ifndef PPPDEBUG_H 37 | #define PPPDEBUG_H 38 | 39 | /************************ 40 | *** PUBLIC DATA TYPES *** 41 | ************************/ 42 | /* Trace levels. */ 43 | typedef enum { 44 | LOG_CRITICAL = 0, 45 | LOG_ERR = 1, 46 | LOG_NOTICE = 2, 47 | LOG_WARNING = 3, 48 | LOG_INFO = 5, 49 | LOG_DETAIL = 6, 50 | LOG_DEBUG = 7 51 | } LogCodes; 52 | 53 | 54 | /*********************** 55 | *** PUBLIC FUNCTIONS *** 56 | ***********************/ 57 | /* 58 | * ppp_trace - a form of printf to send tracing information to stderr 59 | */ 60 | void ppp_trace(int level, const char *format,...); 61 | 62 | #define TRACELCP PPP_DEBUG 63 | 64 | #if PPP_DEBUG 65 | 66 | #define AUTHDEBUG(a) ppp_trace a 67 | #define IPCPDEBUG(a) ppp_trace a 68 | #define UPAPDEBUG(a) ppp_trace a 69 | #define LCPDEBUG(a) ppp_trace a 70 | #define FSMDEBUG(a) ppp_trace a 71 | #define CHAPDEBUG(a) ppp_trace a 72 | #define PPPDEBUG(a) ppp_trace a 73 | 74 | #else /* PPP_DEBUG */ 75 | 76 | #define AUTHDEBUG(a) 77 | #define IPCPDEBUG(a) 78 | #define UPAPDEBUG(a) 79 | #define LCPDEBUG(a) 80 | #define FSMDEBUG(a) 81 | #define CHAPDEBUG(a) 82 | #define PPPDEBUG(a) 83 | 84 | #endif /* PPP_DEBUG */ 85 | 86 | #endif /* PPPDEBUG_H */ 87 | -------------------------------------------------------------------------------- /Components/net/lwip-1.4.1/CHANGELOG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coocox/CoOS/fa559450993a716fa5c4d99213f9f4d38ba6525d/Components/net/lwip-1.4.1/CHANGELOG -------------------------------------------------------------------------------- /Components/net/lwip-1.4.1/COPYING: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001, 2002 Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, 6 | * are permitted provided that the following conditions are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 3. The name of the author may not be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 19 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 21 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 24 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 25 | * OF SUCH DAMAGE. 26 | * 27 | * This file is part of the lwIP TCP/IP stack. 28 | * 29 | * Author: Adam Dunkels 30 | * 31 | */ 32 | 33 | 34 | -------------------------------------------------------------------------------- /Components/net/lwip-1.4.1/FILES: -------------------------------------------------------------------------------- 1 | src/ - The source code for the lwIP TCP/IP stack. 2 | doc/ - The documentation for lwIP. 3 | 4 | See also the FILES file in each subdirectory. 5 | -------------------------------------------------------------------------------- /Components/net/lwip-1.4.1/doc/FILES: -------------------------------------------------------------------------------- 1 | savannah.txt - How to obtain the current development source code. 2 | contrib.txt - How to contribute to lwIP as a developer. 3 | rawapi.txt - The documentation for the core API of lwIP. 4 | Also provides an overview about the other APIs and multithreading. 5 | snmp_agent.txt - The documentation for the lwIP SNMP agent. 6 | sys_arch.txt - The documentation for a system abstraction layer of lwIP. 7 | -------------------------------------------------------------------------------- /Components/net/lwip-1.4.1/src/FILES: -------------------------------------------------------------------------------- 1 | api/ - The code for the high-level wrapper API. Not needed if 2 | you use the lowel-level call-back/raw API. 3 | 4 | core/ - The core of the TPC/IP stack; protocol implementations, 5 | memory and buffer management, and the low-level raw API. 6 | 7 | include/ - lwIP include files. 8 | 9 | netif/ - Generic network interface device drivers are kept here, 10 | as well as the ARP module. 11 | 12 | For more information on the various subdirectories, check the FILES 13 | file in each directory. 14 | -------------------------------------------------------------------------------- /Components/net/lwip-1.4.1/src/core/ipv4/inet.c: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * Functions common to all TCP/IPv4 modules, such as the byte order functions. 4 | * 5 | */ 6 | 7 | /* 8 | * Copyright (c) 2001-2004 Swedish Institute of Computer Science. 9 | * All rights reserved. 10 | * 11 | * Redistribution and use in source and binary forms, with or without modification, 12 | * are permitted provided that the following conditions are met: 13 | * 14 | * 1. Redistributions of source code must retain the above copyright notice, 15 | * this list of conditions and the following disclaimer. 16 | * 2. Redistributions in binary form must reproduce the above copyright notice, 17 | * this list of conditions and the following disclaimer in the documentation 18 | * and/or other materials provided with the distribution. 19 | * 3. The name of the author may not be used to endorse or promote products 20 | * derived from this software without specific prior written permission. 21 | * 22 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 23 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 24 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 25 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 26 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 27 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 29 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 30 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 31 | * OF SUCH DAMAGE. 32 | * 33 | * This file is part of the lwIP TCP/IP stack. 34 | * 35 | * Author: Adam Dunkels 36 | * 37 | */ 38 | 39 | #include "lwip/opt.h" 40 | 41 | #include "lwip/inet.h" 42 | 43 | -------------------------------------------------------------------------------- /Components/net/lwip-1.4.1/src/core/ipv6/README: -------------------------------------------------------------------------------- 1 | IPv6 support in lwIP is very experimental. 2 | -------------------------------------------------------------------------------- /Components/net/lwip-1.4.1/src/core/ipv6/ip6_addr.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001-2004 Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, 6 | * are permitted provided that the following conditions are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 3. The name of the author may not be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 19 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 21 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 24 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 25 | * OF SUCH DAMAGE. 26 | * 27 | * This file is part of the lwIP TCP/IP stack. 28 | * 29 | * Author: Adam Dunkels 30 | * 31 | */ 32 | 33 | #include "lwip/opt.h" 34 | #include "lwip/ip_addr.h" 35 | #include "lwip/inet.h" 36 | 37 | u8_t 38 | ip_addr_netcmp(struct ip_addr *addr1, struct ip_addr *addr2, 39 | struct ip_addr *mask) 40 | { 41 | return((addr1->addr[0] & mask->addr[0]) == (addr2->addr[0] & mask->addr[0]) && 42 | (addr1->addr[1] & mask->addr[1]) == (addr2->addr[1] & mask->addr[1]) && 43 | (addr1->addr[2] & mask->addr[2]) == (addr2->addr[2] & mask->addr[2]) && 44 | (addr1->addr[3] & mask->addr[3]) == (addr2->addr[3] & mask->addr[3])); 45 | 46 | } 47 | 48 | u8_t 49 | ip_addr_cmp(struct ip_addr *addr1, struct ip_addr *addr2) 50 | { 51 | return(addr1->addr[0] == addr2->addr[0] && 52 | addr1->addr[1] == addr2->addr[1] && 53 | addr1->addr[2] == addr2->addr[2] && 54 | addr1->addr[3] == addr2->addr[3]); 55 | } 56 | 57 | void 58 | ip_addr_set(struct ip_addr *dest, struct ip_addr *src) 59 | { 60 | SMEMCPY(dest, src, sizeof(struct ip_addr)); 61 | /* dest->addr[0] = src->addr[0]; 62 | dest->addr[1] = src->addr[1]; 63 | dest->addr[2] = src->addr[2]; 64 | dest->addr[3] = src->addr[3];*/ 65 | } 66 | 67 | u8_t 68 | ip_addr_isany(struct ip_addr *addr) 69 | { 70 | if (addr == NULL) return 1; 71 | return((addr->addr[0] | addr->addr[1] | addr->addr[2] | addr->addr[3]) == 0); 72 | } 73 | -------------------------------------------------------------------------------- /Components/net/lwip-1.4.1/src/core/sys.c: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * lwIP Operating System abstraction 4 | * 5 | */ 6 | 7 | /* 8 | * Copyright (c) 2001-2004 Swedish Institute of Computer Science. 9 | * All rights reserved. 10 | * 11 | * Redistribution and use in source and binary forms, with or without modification, 12 | * are permitted provided that the following conditions are met: 13 | * 14 | * 1. Redistributions of source code must retain the above copyright notice, 15 | * this list of conditions and the following disclaimer. 16 | * 2. Redistributions in binary form must reproduce the above copyright notice, 17 | * this list of conditions and the following disclaimer in the documentation 18 | * and/or other materials provided with the distribution. 19 | * 3. The name of the author may not be used to endorse or promote products 20 | * derived from this software without specific prior written permission. 21 | * 22 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 23 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 24 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 25 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 26 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 27 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 29 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 30 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 31 | * OF SUCH DAMAGE. 32 | * 33 | * This file is part of the lwIP TCP/IP stack. 34 | * 35 | * Author: Adam Dunkels 36 | * 37 | */ 38 | 39 | #include "lwip/opt.h" 40 | 41 | #include "lwip/sys.h" 42 | 43 | /* Most of the functions defined in sys.h must be implemented in the 44 | * architecture-dependent file sys_arch.c */ 45 | 46 | #if !NO_SYS 47 | 48 | #ifndef sys_msleep 49 | /** 50 | * Sleep for some ms. Timeouts are NOT processed while sleeping. 51 | * 52 | * @param ms number of milliseconds to sleep 53 | */ 54 | void 55 | sys_msleep(u32_t ms) 56 | { 57 | if (ms > 0) { 58 | sys_sem_t delaysem; 59 | err_t err = sys_sem_new(&delaysem, 0); 60 | if (err == ERR_OK) { 61 | sys_arch_sem_wait(&delaysem, ms); 62 | sys_sem_free(&delaysem); 63 | } 64 | } 65 | } 66 | #endif /* sys_msleep */ 67 | 68 | #endif /* !NO_SYS */ 69 | -------------------------------------------------------------------------------- /Components/net/lwip-1.4.1/src/include/ipv6/lwip/inet.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001-2004 Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, 6 | * are permitted provided that the following conditions are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 3. The name of the author may not be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 19 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 21 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 24 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 25 | * OF SUCH DAMAGE. 26 | * 27 | * This file is part of the lwIP TCP/IP stack. 28 | * 29 | * Author: Adam Dunkels 30 | * 31 | */ 32 | #ifndef __LWIP_INET_H__ 33 | #define __LWIP_INET_H__ 34 | 35 | #include "lwip/opt.h" 36 | #include "lwip/pbuf.h" 37 | #include "lwip/ip_addr.h" 38 | 39 | #ifdef __cplusplus 40 | extern "C" { 41 | #endif 42 | 43 | u16_t inet_chksum(void *data, u16_t len); 44 | u16_t inet_chksum_pbuf(struct pbuf *p); 45 | u16_t inet_chksum_pseudo(struct pbuf *p, 46 | struct ip_addr *src, struct ip_addr *dest, 47 | u8_t proto, u32_t proto_len); 48 | 49 | u32_t inet_addr(const char *cp); 50 | s8_t inet_aton(const char *cp, struct in_addr *addr); 51 | 52 | #ifndef _MACHINE_ENDIAN_H_ 53 | #ifndef _NETINET_IN_H 54 | #ifndef _LINUX_BYTEORDER_GENERIC_H 55 | u16_t htons(u16_t n); 56 | u16_t ntohs(u16_t n); 57 | u32_t htonl(u32_t n); 58 | u32_t ntohl(u32_t n); 59 | #endif /* _LINUX_BYTEORDER_GENERIC_H */ 60 | #endif /* _NETINET_IN_H */ 61 | #endif /* _MACHINE_ENDIAN_H_ */ 62 | 63 | #ifdef __cplusplus 64 | } 65 | #endif 66 | 67 | #endif /* __LWIP_INET_H__ */ 68 | 69 | -------------------------------------------------------------------------------- /Components/net/lwip-1.4.1/src/include/posix/netdb.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * This file is a posix wrapper for lwip/netdb.h. 4 | */ 5 | 6 | /* 7 | * Redistribution and use in source and binary forms, with or without modification, 8 | * are permitted provided that the following conditions are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright notice, 11 | * this list of conditions and the following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright notice, 13 | * this list of conditions and the following disclaimer in the documentation 14 | * and/or other materials provided with the distribution. 15 | * 3. The name of the author may not be used to endorse or promote products 16 | * derived from this software without specific prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 19 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 20 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 21 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 22 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 23 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 25 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 26 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 27 | * OF SUCH DAMAGE. 28 | * 29 | * This file is part of the lwIP TCP/IP stack. 30 | * 31 | */ 32 | 33 | #include "lwip/netdb.h" 34 | -------------------------------------------------------------------------------- /Components/net/lwip-1.4.1/src/include/posix/sys/socket.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * This file is a posix wrapper for lwip/sockets.h. 4 | */ 5 | 6 | /* 7 | * Redistribution and use in source and binary forms, with or without modification, 8 | * are permitted provided that the following conditions are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright notice, 11 | * this list of conditions and the following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright notice, 13 | * this list of conditions and the following disclaimer in the documentation 14 | * and/or other materials provided with the distribution. 15 | * 3. The name of the author may not be used to endorse or promote products 16 | * derived from this software without specific prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 19 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 20 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 21 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 22 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 23 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 25 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 26 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 27 | * OF SUCH DAMAGE. 28 | * 29 | * This file is part of the lwIP TCP/IP stack. 30 | * 31 | */ 32 | 33 | #include "lwip/sockets.h" 34 | -------------------------------------------------------------------------------- /Components/net/lwip-1.4.1/src/netif/FILES: -------------------------------------------------------------------------------- 1 | This directory contains generic network interface device drivers that 2 | do not contain any hardware or architecture specific code. The files 3 | are: 4 | 5 | etharp.c 6 | Implements the ARP (Address Resolution Protocol) over 7 | Ethernet. The code in this file should be used together with 8 | Ethernet device drivers. Note that this module has been 9 | largely made Ethernet independent so you should be able to 10 | adapt this for other link layers (such as Firewire). 11 | 12 | ethernetif.c 13 | An example of how an Ethernet device driver could look. This 14 | file can be used as a "skeleton" for developing new Ethernet 15 | network device drivers. It uses the etharp.c ARP code. 16 | 17 | loopif.c 18 | A "loopback" network interface driver. It requires configuration 19 | through the define LWIP_LOOPIF_MULTITHREADING (see opt.h). 20 | 21 | slipif.c 22 | A generic implementation of the SLIP (Serial Line IP) 23 | protocol. It requires a sio (serial I/O) module to work. 24 | 25 | ppp/ Point-to-Point Protocol stack 26 | The PPP stack has been ported from ucip (http://ucip.sourceforge.net). 27 | It matches quite well to pppd 2.3.1 (http://ppp.samba.org), although 28 | compared to that, it has some modifications for embedded systems and 29 | the source code has been reordered a bit. -------------------------------------------------------------------------------- /Components/net/lwip-1.4.1/src/netif/ppp/chpms.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * chpms.h - Network Microsoft Challenge Handshake Protocol header file. 3 | * 4 | * Copyright (c) 2003 by Marc Boucher, Services Informatiques (MBSI) inc. 5 | * portions Copyright (c) 1998 Global Election Systems Inc. 6 | * 7 | * The authors hereby grant permission to use, copy, modify, distribute, 8 | * and license this software and its documentation for any purpose, provided 9 | * that existing copyright notices are retained in all copies and that this 10 | * notice and the following disclaimer are included verbatim in any 11 | * distributions. No written agreement, license, or royalty fee is required 12 | * for any of the authorized uses. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS *AS IS* AND ANY EXPRESS OR 15 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 16 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 17 | * IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 18 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 19 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 20 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 21 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 23 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | * 25 | ****************************************************************************** 26 | * REVISION HISTORY 27 | * 28 | * 03-01-01 Marc Boucher 29 | * Ported to lwIP. 30 | * 98-01-30 Guy Lancaster , Global Election Systems Inc. 31 | * Original built from BSD network code. 32 | ******************************************************************************/ 33 | /* 34 | * chap.h - Challenge Handshake Authentication Protocol definitions. 35 | * 36 | * Copyright (c) 1995 Eric Rosenquist, Strata Software Limited. 37 | * http://www.strataware.com/ 38 | * 39 | * All rights reserved. 40 | * 41 | * Redistribution and use in source and binary forms are permitted 42 | * provided that the above copyright notice and this paragraph are 43 | * duplicated in all such forms and that any documentation, 44 | * advertising materials, and other materials related to such 45 | * distribution and use acknowledge that the software was developed 46 | * by Eric Rosenquist. The name of the author may not be used to 47 | * endorse or promote products derived from this software without 48 | * specific prior written permission. 49 | * 50 | * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR 51 | * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED 52 | * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. 53 | * 54 | * $Id: chpms.h,v 1.5 2007/12/19 20:47:23 fbernon Exp $ 55 | */ 56 | 57 | #ifndef CHPMS_H 58 | #define CHPMS_H 59 | 60 | #define MAX_NT_PASSWORD 256 /* Maximum number of (Unicode) chars in an NT password */ 61 | 62 | void ChapMS (chap_state *, char *, int, char *, int); 63 | 64 | #endif /* CHPMS_H */ 65 | -------------------------------------------------------------------------------- /Components/net/lwip-1.4.1/src/netif/ppp/magic.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * magic.h - Network Random Number Generator header file. 3 | * 4 | * Copyright (c) 2003 by Marc Boucher, Services Informatiques (MBSI) inc. 5 | * portions Copyright (c) 1997 Global Election Systems Inc. 6 | * 7 | * The authors hereby grant permission to use, copy, modify, distribute, 8 | * and license this software and its documentation for any purpose, provided 9 | * that existing copyright notices are retained in all copies and that this 10 | * notice and the following disclaimer are included verbatim in any 11 | * distributions. No written agreement, license, or royalty fee is required 12 | * for any of the authorized uses. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS *AS IS* AND ANY EXPRESS OR 15 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 16 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 17 | * IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 18 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 19 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 20 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 21 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 23 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | * 25 | ****************************************************************************** 26 | * REVISION HISTORY 27 | * 28 | * 03-01-01 Marc Boucher 29 | * Ported to lwIP. 30 | * 97-12-04 Guy Lancaster , Global Election Systems Inc. 31 | * Original derived from BSD codes. 32 | *****************************************************************************/ 33 | /* 34 | * magic.h - PPP Magic Number definitions. 35 | * 36 | * Copyright (c) 1989 Carnegie Mellon University. 37 | * All rights reserved. 38 | * 39 | * Redistribution and use in source and binary forms are permitted 40 | * provided that the above copyright notice and this paragraph are 41 | * duplicated in all such forms and that any documentation, 42 | * advertising materials, and other materials related to such 43 | * distribution and use acknowledge that the software was developed 44 | * by Carnegie Mellon University. The name of the 45 | * University may not be used to endorse or promote products derived 46 | * from this software without specific prior written permission. 47 | * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR 48 | * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED 49 | * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. 50 | * 51 | * $Id: magic.h,v 1.3 2010/01/18 20:49:43 goldsimon Exp $ 52 | */ 53 | 54 | #ifndef MAGIC_H 55 | #define MAGIC_H 56 | 57 | /* Initialize the magic number generator */ 58 | void magicInit(void); 59 | 60 | /* Returns the next magic number */ 61 | u32_t magic(void); 62 | 63 | #endif /* MAGIC_H */ 64 | -------------------------------------------------------------------------------- /Components/net/lwip-1.4.1/src/netif/ppp/md5.h: -------------------------------------------------------------------------------- 1 | /* 2 | *********************************************************************** 3 | ** md5.h -- header file for implementation of MD5 ** 4 | ** RSA Data Security, Inc. MD5 Message-Digest Algorithm ** 5 | ** Created: 2/17/90 RLR ** 6 | ** Revised: 12/27/90 SRD,AJ,BSK,JT Reference C version ** 7 | ** Revised (for MD5): RLR 4/27/91 ** 8 | ** -- G modified to have y&~z instead of y&z ** 9 | ** -- FF, GG, HH modified to add in last register done ** 10 | ** -- Access pattern: round 2 works mod 5, round 3 works mod 3 ** 11 | ** -- distinct additive constant for each step ** 12 | ** -- round 4 added, working mod 7 ** 13 | *********************************************************************** 14 | */ 15 | 16 | /* 17 | *********************************************************************** 18 | ** Copyright (C) 1990, RSA Data Security, Inc. All rights reserved. ** 19 | ** ** 20 | ** License to copy and use this software is granted provided that ** 21 | ** it is identified as the "RSA Data Security, Inc. MD5 Message- ** 22 | ** Digest Algorithm" in all material mentioning or referencing this ** 23 | ** software or this function. ** 24 | ** ** 25 | ** License is also granted to make and use derivative works ** 26 | ** provided that such works are identified as "derived from the RSA ** 27 | ** Data Security, Inc. MD5 Message-Digest Algorithm" in all ** 28 | ** material mentioning or referencing the derived work. ** 29 | ** ** 30 | ** RSA Data Security, Inc. makes no representations concerning ** 31 | ** either the merchantability of this software or the suitability ** 32 | ** of this software for any particular purpose. It is provided "as ** 33 | ** is" without express or implied warranty of any kind. ** 34 | ** ** 35 | ** These notices must be retained in any copies of any part of this ** 36 | ** documentation and/or software. ** 37 | *********************************************************************** 38 | */ 39 | 40 | #ifndef MD5_H 41 | #define MD5_H 42 | 43 | /* Data structure for MD5 (Message-Digest) computation */ 44 | typedef struct { 45 | u32_t i[2]; /* number of _bits_ handled mod 2^64 */ 46 | u32_t buf[4]; /* scratch buffer */ 47 | unsigned char in[64]; /* input buffer */ 48 | unsigned char digest[16]; /* actual digest after MD5Final call */ 49 | } MD5_CTX; 50 | 51 | void MD5Init ( MD5_CTX *mdContext); 52 | void MD5Update( MD5_CTX *mdContext, unsigned char *inBuf, unsigned int inLen); 53 | void MD5Final ( unsigned char hash[], MD5_CTX *mdContext); 54 | 55 | #endif /* MD5_H */ 56 | -------------------------------------------------------------------------------- /Components/net/lwip-1.4.1/src/netif/ppp/pppdebug.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * pppdebug.h - System debugging utilities. 3 | * 4 | * Copyright (c) 2003 by Marc Boucher, Services Informatiques (MBSI) inc. 5 | * portions Copyright (c) 1998 Global Election Systems Inc. 6 | * portions Copyright (c) 2001 by Cognizant Pty Ltd. 7 | * 8 | * The authors hereby grant permission to use, copy, modify, distribute, 9 | * and license this software and its documentation for any purpose, provided 10 | * that existing copyright notices are retained in all copies and that this 11 | * notice and the following disclaimer are included verbatim in any 12 | * distributions. No written agreement, license, or royalty fee is required 13 | * for any of the authorized uses. 14 | * 15 | * THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS *AS IS* AND ANY EXPRESS OR 16 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 17 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 18 | * IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 19 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 20 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | * 26 | ****************************************************************************** 27 | * REVISION HISTORY (please don't use tabs!) 28 | * 29 | * 03-01-01 Marc Boucher 30 | * Ported to lwIP. 31 | * 98-07-29 Guy Lancaster , Global Election Systems Inc. 32 | * Original. 33 | * 34 | ***************************************************************************** 35 | */ 36 | #ifndef PPPDEBUG_H 37 | #define PPPDEBUG_H 38 | 39 | /* Trace levels. */ 40 | #define LOG_CRITICAL (PPP_DEBUG | LWIP_DBG_LEVEL_SEVERE) 41 | #define LOG_ERR (PPP_DEBUG | LWIP_DBG_LEVEL_SEVERE) 42 | #define LOG_NOTICE (PPP_DEBUG | LWIP_DBG_LEVEL_WARNING) 43 | #define LOG_WARNING (PPP_DEBUG | LWIP_DBG_LEVEL_WARNING) 44 | #define LOG_INFO (PPP_DEBUG) 45 | #define LOG_DETAIL (PPP_DEBUG) 46 | #define LOG_DEBUG (PPP_DEBUG) 47 | 48 | 49 | #define TRACELCP PPP_DEBUG 50 | 51 | #if PPP_DEBUG 52 | 53 | #define AUTHDEBUG(a, b) LWIP_DEBUGF(a, b) 54 | #define IPCPDEBUG(a, b) LWIP_DEBUGF(a, b) 55 | #define UPAPDEBUG(a, b) LWIP_DEBUGF(a, b) 56 | #define LCPDEBUG(a, b) LWIP_DEBUGF(a, b) 57 | #define FSMDEBUG(a, b) LWIP_DEBUGF(a, b) 58 | #define CHAPDEBUG(a, b) LWIP_DEBUGF(a, b) 59 | #define PPPDEBUG(a, b) LWIP_DEBUGF(a, b) 60 | 61 | #else /* PPP_DEBUG */ 62 | 63 | #define AUTHDEBUG(a, b) 64 | #define IPCPDEBUG(a, b) 65 | #define UPAPDEBUG(a, b) 66 | #define LCPDEBUG(a, b) 67 | #define FSMDEBUG(a, b) 68 | #define CHAPDEBUG(a, b) 69 | #define PPPDEBUG(a, b) 70 | 71 | #endif /* PPP_DEBUG */ 72 | 73 | #endif /* PPPDEBUG_H */ 74 | -------------------------------------------------------------------------------- /Components/net/lwip-1.4.1/test/unit/core/test_mem.c: -------------------------------------------------------------------------------- 1 | #include "test_mem.h" 2 | 3 | #include "lwip/mem.h" 4 | #include "lwip/stats.h" 5 | 6 | #if !LWIP_STATS || !MEM_STATS 7 | #error "This tests needs MEM-statistics enabled" 8 | #endif 9 | #if LWIP_DNS 10 | #error "This test needs DNS turned off (as it mallocs on init)" 11 | #endif 12 | 13 | /* Setups/teardown functions */ 14 | 15 | static void 16 | mem_setup(void) 17 | { 18 | } 19 | 20 | static void 21 | mem_teardown(void) 22 | { 23 | } 24 | 25 | 26 | /* Test functions */ 27 | 28 | /** Call mem_malloc, mem_free and mem_trim and check stats */ 29 | START_TEST(test_mem_one) 30 | { 31 | #define SIZE1 16 32 | #define SIZE1_2 12 33 | #define SIZE2 16 34 | void *p1, *p2; 35 | mem_size_t s1, s2; 36 | LWIP_UNUSED_ARG(_i); 37 | 38 | #if LWIP_DNS 39 | fail("This test needs DNS turned off (as it mallocs on init)"); 40 | #endif 41 | 42 | fail_unless(lwip_stats.mem.used == 0); 43 | 44 | p1 = mem_malloc(SIZE1); 45 | fail_unless(p1 != NULL); 46 | fail_unless(lwip_stats.mem.used >= SIZE1); 47 | s1 = lwip_stats.mem.used; 48 | 49 | p2 = mem_malloc(SIZE2); 50 | fail_unless(p2 != NULL); 51 | fail_unless(lwip_stats.mem.used >= SIZE2 + s1); 52 | s2 = lwip_stats.mem.used; 53 | 54 | mem_trim(p1, SIZE1_2); 55 | 56 | mem_free(p2); 57 | fail_unless(lwip_stats.mem.used <= s2 - SIZE2); 58 | 59 | mem_free(p1); 60 | fail_unless(lwip_stats.mem.used == 0); 61 | } 62 | END_TEST 63 | 64 | 65 | /** Create the suite including all tests for this module */ 66 | Suite * 67 | mem_suite(void) 68 | { 69 | TFun tests[] = { 70 | test_mem_one 71 | }; 72 | return create_suite("MEM", tests, sizeof(tests)/sizeof(TFun), mem_setup, mem_teardown); 73 | } 74 | -------------------------------------------------------------------------------- /Components/net/lwip-1.4.1/test/unit/core/test_mem.h: -------------------------------------------------------------------------------- 1 | #ifndef __TEST_MEM_H__ 2 | #define __TEST_MEM_H__ 3 | 4 | #include "../lwip_check.h" 5 | 6 | Suite *mem_suite(void); 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /Components/net/lwip-1.4.1/test/unit/etharp/test_etharp.h: -------------------------------------------------------------------------------- 1 | #ifndef __TEST_ETHARP_H__ 2 | #define __TEST_ETHARP_H__ 3 | 4 | #include "../lwip_check.h" 5 | 6 | Suite* etharp_suite(void); 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /Components/net/lwip-1.4.1/test/unit/lwip_check.h: -------------------------------------------------------------------------------- 1 | #ifndef __LWIP_CHECK_H__ 2 | #define __LWIP_CHECK_H__ 3 | 4 | /* Common header file for lwIP unit tests using the check framework */ 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | #define FAIL_RET() do { fail(); return; } while(0) 11 | #define EXPECT(x) fail_unless(x) 12 | #define EXPECT_RET(x) do { fail_unless(x); if(!(x)) { return; }} while(0) 13 | #define EXPECT_RETX(x, y) do { fail_unless(x); if(!(x)) { return y; }} while(0) 14 | #define EXPECT_RETNULL(x) EXPECT_RETX(x, NULL) 15 | 16 | /** typedef for a function returning a test suite */ 17 | typedef Suite* (suite_getter_fn)(void); 18 | 19 | /** Create a test suite */ 20 | static Suite* create_suite(const char* name, TFun *tests, size_t num_tests, SFun setup, SFun teardown) 21 | { 22 | size_t i; 23 | Suite *s = suite_create(name); 24 | 25 | for(i = 0; i < num_tests; i++) { 26 | /* Core test case */ 27 | TCase *tc_core = tcase_create("Core"); 28 | if ((setup != NULL) || (teardown != NULL)) { 29 | tcase_add_checked_fixture(tc_core, setup, teardown); 30 | } 31 | tcase_add_test(tc_core, tests[i]); 32 | suite_add_tcase(s, tc_core); 33 | } 34 | return s; 35 | } 36 | 37 | #endif /* __LWIP_CHECK_H__ */ 38 | -------------------------------------------------------------------------------- /Components/net/lwip-1.4.1/test/unit/lwip_unittests.c: -------------------------------------------------------------------------------- 1 | #include "lwip_check.h" 2 | 3 | #include "udp/test_udp.h" 4 | #include "tcp/test_tcp.h" 5 | #include "tcp/test_tcp_oos.h" 6 | #include "core/test_mem.h" 7 | #include "etharp/test_etharp.h" 8 | 9 | #include "lwip/init.h" 10 | 11 | 12 | int main() 13 | { 14 | int number_failed; 15 | SRunner *sr; 16 | size_t i; 17 | suite_getter_fn* suites[] = { 18 | udp_suite, 19 | tcp_suite, 20 | tcp_oos_suite, 21 | mem_suite, 22 | etharp_suite 23 | }; 24 | size_t num = sizeof(suites)/sizeof(void*); 25 | LWIP_ASSERT("No suites defined", num > 0); 26 | 27 | lwip_init(); 28 | 29 | sr = srunner_create((suites[0])()); 30 | for(i = 1; i < num; i++) { 31 | srunner_add_suite(sr, ((suite_getter_fn*)suites[i])()); 32 | } 33 | 34 | #ifdef LWIP_UNITTESTS_NOFORK 35 | srunner_set_fork_status(sr, CK_NOFORK); 36 | #endif 37 | #ifdef LWIP_UNITTESTS_FORK 38 | srunner_set_fork_status(sr, CK_FORK); 39 | #endif 40 | 41 | srunner_run_all(sr, CK_NORMAL); 42 | number_failed = srunner_ntests_failed(sr); 43 | srunner_free(sr); 44 | return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; 45 | } 46 | -------------------------------------------------------------------------------- /Components/net/lwip-1.4.1/test/unit/lwipopts.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001-2003 Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, 6 | * are permitted provided that the following conditions are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 3. The name of the author may not be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 19 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 21 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 24 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 25 | * OF SUCH DAMAGE. 26 | * 27 | * This file is part of the lwIP TCP/IP stack. 28 | * 29 | * Author: Simon Goldschmidt 30 | * 31 | */ 32 | #ifndef __LWIPOPTS_H__ 33 | #define __LWIPOPTS_H__ 34 | 35 | /* Prevent having to link sys_arch.c (we don't test the API layers in unit tests) */ 36 | #define NO_SYS 1 37 | #define LWIP_NETCONN 0 38 | #define LWIP_SOCKET 0 39 | 40 | /* Minimal changes to opt.h required for tcp unit tests: */ 41 | #define MEM_SIZE 16000 42 | #define TCP_SND_QUEUELEN 40 43 | #define MEMP_NUM_TCP_SEG TCP_SND_QUEUELEN 44 | #define TCP_SND_BUF (12 * TCP_MSS) 45 | #define TCP_WND (10 * TCP_MSS) 46 | 47 | /* Minimal changes to opt.h required for etharp unit tests: */ 48 | #define ETHARP_SUPPORT_STATIC_ENTRIES 1 49 | 50 | #endif /* __LWIPOPTS_H__ */ 51 | -------------------------------------------------------------------------------- /Components/net/lwip-1.4.1/test/unit/tcp/tcp_helper.h: -------------------------------------------------------------------------------- 1 | #ifndef __TCP_HELPER_H__ 2 | #define __TCP_HELPER_H__ 3 | 4 | #include "../lwip_check.h" 5 | #include "lwip/arch.h" 6 | #include "lwip/tcp.h" 7 | #include "lwip/netif.h" 8 | 9 | /* counters used for test_tcp_counters_* callback functions */ 10 | struct test_tcp_counters { 11 | u32_t recv_calls; 12 | u32_t recved_bytes; 13 | u32_t recv_calls_after_close; 14 | u32_t recved_bytes_after_close; 15 | u32_t close_calls; 16 | u32_t err_calls; 17 | err_t last_err; 18 | char* expected_data; 19 | u32_t expected_data_len; 20 | }; 21 | 22 | struct test_tcp_txcounters { 23 | u32_t num_tx_calls; 24 | u32_t num_tx_bytes; 25 | u8_t copy_tx_packets; 26 | struct pbuf *tx_packets; 27 | }; 28 | 29 | /* Helper functions */ 30 | void tcp_remove_all(void); 31 | 32 | struct pbuf* tcp_create_segment(ip_addr_t* src_ip, ip_addr_t* dst_ip, 33 | u16_t src_port, u16_t dst_port, void* data, size_t data_len, 34 | u32_t seqno, u32_t ackno, u8_t headerflags); 35 | struct pbuf* tcp_create_rx_segment(struct tcp_pcb* pcb, void* data, size_t data_len, 36 | u32_t seqno_offset, u32_t ackno_offset, u8_t headerflags); 37 | struct pbuf* tcp_create_rx_segment_wnd(struct tcp_pcb* pcb, void* data, size_t data_len, 38 | u32_t seqno_offset, u32_t ackno_offset, u8_t headerflags, u16_t wnd); 39 | void tcp_set_state(struct tcp_pcb* pcb, enum tcp_state state, ip_addr_t* local_ip, 40 | ip_addr_t* remote_ip, u16_t local_port, u16_t remote_port); 41 | void test_tcp_counters_err(void* arg, err_t err); 42 | err_t test_tcp_counters_recv(void* arg, struct tcp_pcb* pcb, struct pbuf* p, err_t err); 43 | 44 | struct tcp_pcb* test_tcp_new_counters_pcb(struct test_tcp_counters* counters); 45 | 46 | void test_tcp_input(struct pbuf *p, struct netif *inp); 47 | 48 | void test_tcp_init_netif(struct netif *netif, struct test_tcp_txcounters *txcounters, 49 | ip_addr_t *ip_addr, ip_addr_t *netmask); 50 | 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /Components/net/lwip-1.4.1/test/unit/tcp/test_tcp.h: -------------------------------------------------------------------------------- 1 | #ifndef __TEST_TCP_H__ 2 | #define __TEST_TCP_H__ 3 | 4 | #include "../lwip_check.h" 5 | 6 | Suite *tcp_suite(void); 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /Components/net/lwip-1.4.1/test/unit/tcp/test_tcp_oos.h: -------------------------------------------------------------------------------- 1 | #ifndef __TEST_TCP_OOS_H__ 2 | #define __TEST_TCP_OOS_H__ 3 | 4 | #include "../lwip_check.h" 5 | 6 | Suite *tcp_oos_suite(void); 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /Components/net/lwip-1.4.1/test/unit/udp/test_udp.c: -------------------------------------------------------------------------------- 1 | #include "test_udp.h" 2 | 3 | #include "lwip/udp.h" 4 | #include "lwip/stats.h" 5 | 6 | #if !LWIP_STATS || !UDP_STATS || !MEMP_STATS 7 | #error "This tests needs UDP- and MEMP-statistics enabled" 8 | #endif 9 | 10 | /* Helper functions */ 11 | static void 12 | udp_remove_all(void) 13 | { 14 | struct udp_pcb *pcb = udp_pcbs; 15 | struct udp_pcb *pcb2; 16 | 17 | while(pcb != NULL) { 18 | pcb2 = pcb; 19 | pcb = pcb->next; 20 | udp_remove(pcb2); 21 | } 22 | fail_unless(lwip_stats.memp[MEMP_UDP_PCB].used == 0); 23 | } 24 | 25 | /* Setups/teardown functions */ 26 | 27 | static void 28 | udp_setup(void) 29 | { 30 | udp_remove_all(); 31 | } 32 | 33 | static void 34 | udp_teardown(void) 35 | { 36 | udp_remove_all(); 37 | } 38 | 39 | 40 | /* Test functions */ 41 | 42 | START_TEST(test_udp_new_remove) 43 | { 44 | struct udp_pcb* pcb; 45 | LWIP_UNUSED_ARG(_i); 46 | 47 | fail_unless(lwip_stats.memp[MEMP_UDP_PCB].used == 0); 48 | 49 | pcb = udp_new(); 50 | fail_unless(pcb != NULL); 51 | if (pcb != NULL) { 52 | fail_unless(lwip_stats.memp[MEMP_UDP_PCB].used == 1); 53 | udp_remove(pcb); 54 | fail_unless(lwip_stats.memp[MEMP_UDP_PCB].used == 0); 55 | } 56 | } 57 | END_TEST 58 | 59 | 60 | /** Create the suite including all tests for this module */ 61 | Suite * 62 | udp_suite(void) 63 | { 64 | TFun tests[] = { 65 | test_udp_new_remove, 66 | }; 67 | return create_suite("UDP", tests, sizeof(tests)/sizeof(TFun), udp_setup, udp_teardown); 68 | } 69 | -------------------------------------------------------------------------------- /Components/net/lwip-1.4.1/test/unit/udp/test_udp.h: -------------------------------------------------------------------------------- 1 | #ifndef __TEST_UDP_H__ 2 | #define __TEST_UDP_H__ 3 | 4 | #include "../lwip_check.h" 5 | 6 | Suite* udp_suite(void); 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /Components/net/readme.txt: -------------------------------------------------------------------------------- 1 | A LWIP example here -------------------------------------------------------------------------------- /Components/usb/readme.txt: -------------------------------------------------------------------------------- 1 | Add a usb stack here -------------------------------------------------------------------------------- /Document/contribution-howto.txt: -------------------------------------------------------------------------------- 1 | 2 | This file shows how to contribute to the CoOS project. 3 | 4 | The contributer can: 5 | 6 | 1. Add a CoOS example to a series chips. 7 | 2. Develop middlewares such as gui tcp-ip based on CoOS 8 | 3. Improve CoOS and correction bugs 9 | 4. Port CoOS to a new ARM series 10 | 11 | 1. Add a CoOS example to a series chips 12 | ------------------------------------------------------------------------------- 13 | 14 | 1.1. Example Directory Organizition 15 | ------------------------------------------------------------------------------- 16 | 17 | The root directory of the Example is 18 | /CoOS\Example\$manufacturer$\$series$, such as /CoOS\Example\ST\STM32F1xx. 19 | 20 | 21 | /BSPLIB/ 22 | Source code of all the peripherals library, include *.h, *.c. 23 | 24 | src/ 25 | stm32f10x_adc.c 26 | stm32f10x_exti.c 27 | ... 28 | 29 | inc/ 30 | stm32f10x_adc.h 31 | stm32f10x_bkp.h 32 | ... 33 | 34 | /$Example name$/ (/STM32F103RB_CoOS/ for example) 35 | IAR, MDK, CoIDE project of the example(STM32F103RB_CoOS). 36 | 37 | IAR/ 38 | IAR projects of the example. 39 | 40 | APP/ 41 | App code of this example project. 42 | 43 | AppConfig.c 44 | AppConfig.h 45 | OsConfig.h 46 | main.c 47 | ... 48 | 49 | Project/ 50 | IAR EWARM project files. 51 | 52 | CoOsDemo.eww 53 | CoOsDemo.ewp 54 | CoOsDemo.ewd 55 | ... 56 | 57 | readme.txt 58 | 59 | ... 60 | 61 | MDK/ 62 | MDK projects of the example. 63 | 64 | APP/ 65 | App code of this example project. 66 | 67 | AppConfig.c 68 | AppConfig.h 69 | main.c 70 | ... 71 | 72 | Project/ 73 | Keil MDK project files. 74 | 75 | CoOsDemo.uvproj 76 | ... 77 | 78 | readme.txt 79 | 80 | ... 81 | 82 | 83 | 84 | 1.2 Steps to add a CoOS example to a new mcu platform 85 | ------------------------------------------------------------------------------- 86 | 87 | - Download a example. 88 | - Wirte the peripheral config in the AppConfig.h and AppConfig.c. 89 | - Wirte your own applications in the main.c. 90 | - Use the IAR or MDK compile and test your code. 91 | - Commit to your fork repository, and send pull request on the github. 92 | 93 | 94 | 2. Develop middlewares such as gui tcp-ip based on CoOS 95 | ------------------------------------------------------------------------------- 96 | 97 | Add in future. 98 | 99 | 3. Improve CoOS and correction bugs 100 | ------------------------------------------------------------------------------- 101 | Directly modify the file under the CoOS directory and write a change log 102 | when you push. 103 | 104 | 4. Port CoOS to a new ARM series 105 | ------------------------------------------------------------------------------- 106 | You just re-implement files in the CoOS\portable directory. 107 | 108 | 109 | 110 | 111 | -------------------------------------------------------------------------------- /Example/Atmel/AT91SAM3Ux/readme.txt: -------------------------------------------------------------------------------- 1 | Add a example here! -------------------------------------------------------------------------------- /Example/Energy/EFM32G2xx/readme.txt: -------------------------------------------------------------------------------- 1 | Add a example here! -------------------------------------------------------------------------------- /Example/Energy/EFM32G8xx/readme.txt: -------------------------------------------------------------------------------- 1 | Add a example here! -------------------------------------------------------------------------------- /Example/Freescale/Kinetis/BSPLIB/src/enet/enet.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file enet.c 3 | * @date 1 Aug 2013 4 | * @brief Basic enet structures 5 | * 6 | * @author Jozef Maslik (maslo@binarylemon.com) 7 | * 8 | */ 9 | 10 | #ifndef _ENET_H_ 11 | #define _ENET_H_ 12 | 13 | //#define ENHANCED_BD 14 | #define ENET_LITTLE_ENDIAN 15 | 16 | /** tx buffer descriptor bits 17 | */ 18 | #define ENET_TX_BD_R 0x0080 19 | #define ENET_TX_BD_TO1 0x0040 20 | #define ENET_TX_BD_W 0x0020 21 | #define ENET_TX_BD_TO2 0x0010 22 | #define ENET_TX_BD_L 0x0008 23 | #define ENET_TX_BD_TC 0x0004 24 | #define ENET_TX_BD_ABC 0x0002 25 | 26 | /** rx buffer descriptor bits 27 | */ 28 | #define ENET_RX_BD_E 0x0080 29 | #define ENET_RX_BD_R01 0x0040 30 | #define ENET_RX_BD_W 0x0020 31 | #define ENET_RX_BD_R02 0x0010 32 | #define ENET_RX_BD_L 0x0008 33 | #define ENET_RX_BD_M 0x0001 34 | #define ENET_RX_BD_BC 0x8000 35 | #define ENET_RX_BD_MC 0x4000 36 | #define ENET_RX_BD_LG 0x2000 37 | #define ENET_RX_BD_NO 0x1000 38 | #define ENET_RX_BD_CR 0x0400 39 | #define ENET_RX_BD_OV 0x0200 40 | #define ENET_RX_BD_TR 0x0100 41 | 42 | /** Buffer descriptor 43 | */ 44 | typedef struct _enet_bd_t { 45 | uint16_t status; ///< control and status 46 | uint16_t length; ///< transfer length 47 | uint8_t *data; ///< buffer address 48 | #ifdef ENHANCED_BD 49 | uint32_t ebd_status; 50 | uint8_t hdr_len; ///< header length 51 | uint8_t prot; ///< protocol type 52 | uint16_t checksum; ///< payload checksum 53 | uint16_t bdu; 54 | uint16_t resvd0; 55 | uint32_t timestamp; 56 | uint16_t resvd1; 57 | uint16_t resvd2; 58 | uint16_t resvd3; 59 | uint16_t resvd4; 60 | #endif /* ENHANCED_BD */ 61 | } enet_bd_t; 62 | 63 | #endif /* _ENET_H_ */ 64 | -------------------------------------------------------------------------------- /Example/Freescale/Kinetis/BSPLIB/src/enet/mii.c: -------------------------------------------------------------------------------- 1 | /** 2 | * @file mii.c 3 | * @date 1 Aug 2013 4 | * @brief MII interface for PHY 5 | * 6 | * @author Jozef Maslik (maslo@binarylemon.com) 7 | * 8 | */ 9 | 10 | #include "mii.h" 11 | 12 | #include 13 | 14 | #include 15 | 16 | 17 | /** Check if phy communication interface is enabled. 18 | */ 19 | static int mii_enabled(void) { 20 | return 0 != (ENET_MSCR & ENET_MSCR_MII_SPEED_MASK); 21 | } 22 | 23 | /** Read, write function to phy. 24 | */ 25 | static int mii_rw(uint8_t phy, uint8_t reg, int op, uint16_t wdata, uint16_t *rdata) { 26 | int tm; 27 | 28 | if (mii_enabled()) { 29 | /* clear the MII interrupt bit */ 30 | ENET_EIR = ENET_EIR_MII_MASK; 31 | 32 | // start mii operation 33 | ENET_MMFR = ENET_MMFR_ST(1) 34 | | ENET_MMFR_OP(op) 35 | | ENET_MMFR_PA(phy) 36 | | ENET_MMFR_RA(reg) 37 | | ENET_MMFR_TA(2) 38 | | ENET_MMFR_DATA(wdata); 39 | 40 | // wait until operation complete 41 | for (tm = MII_TIMEOUT; 0 < tm && 0 == (ENET_EIR & ENET_EIR_MII_MASK); tm--) { 42 | // delay 43 | } 44 | 45 | if (0 < tm && rdata) { 46 | *rdata = (ENET_MMFR & ENET_MMFR_DATA_MASK); 47 | } 48 | 49 | /* clear the MII interrupt bit */ 50 | ENET_EIR = ENET_EIR_MII_MASK; 51 | } 52 | return (0 < tm); 53 | } 54 | 55 | int mii_read(uint8_t phy, uint8_t reg, uint16_t *data) { 56 | return mii_rw(phy, reg, 2, 0, data); 57 | } 58 | 59 | int mii_write(uint8_t phy, uint8_t reg, uint16_t data) { 60 | return mii_rw(phy, reg, 1, data, NULL); 61 | } 62 | 63 | /** Initialize MII interface. 64 | */ 65 | 66 | /********************************************************************/ 67 | /* 68 | * \brief Initialize the MII interface controller 69 | * \param System Clock Frequency (in MHz) 70 | * \warning The system clock in this case is the clock that drives 71 | * the FEC logic. This may be different from the speed at which 72 | * the CPU is operating. 73 | * 74 | * Initialize the MII clock (EMDC) frequency. The desired MII clock is 2.5MHz: 75 | * 76 | * MII Speed Setting = System_Clock / (2.5MHz * 2) 77 | * (plus 1 to round up) 78 | */ 79 | void mii_init(uint32_t clk) { 80 | ENET_MSCR = ENET_MSCR_MII_SPEED((2 * clk / 5) + 1); 81 | } -------------------------------------------------------------------------------- /Example/Freescale/Kinetis/BSPLIB/src/enet/mii.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file mii.h 3 | * @date 1 Aug 2013 4 | * @brief MII interface for PHY 5 | * 6 | * @author Jozef Maslik (maslo@binarylemon.com) 7 | * 8 | */ 9 | 10 | #ifndef _MII_H_ 11 | #define _MII_H_ 12 | 13 | #include 14 | 15 | #define MII_TIMEOUT 0xffff 16 | 17 | /** standard MII registers 18 | */ 19 | #define MII_BMCR 0x00 // basic mode configuration 20 | #define MII_BMSR 0x01 // basic mode status 21 | #define MII_PHYID1 0x02 // PHY ID 1 22 | #define MII_PHYID2 0x03 // PHY ID 2 23 | #define MII_ADVERTISE 0x04 // autonegotation advertisement 24 | #define MII_LPA 0x05 // link partner ability 25 | #define MII_EXPANSION 0x06 // autonegotation expansion 26 | 27 | /** basic mode configuration register 28 | */ 29 | #define MII_BMCR_CTST 0x0080 // collision test 30 | #define MII_BMCR_FULLDPLX 0x0100 // full duplex 31 | #define MII_BMCR_ANRESTART 0x0200 // autonegotiation restart 32 | #define MII_BMCR_ISOLATE 0x0400 // isolate data paths from MII 33 | #define MII_BMCR_PDOWN 0x0800 // enable low power state 34 | #define MII_BMCR_ANENABLE 0x1000 // enable auto negotiation 35 | #define MII_BMCR_SPEED100 0x2000 // select 100Mbps 36 | #define MII_BMCR_LOOPBACK 0x4000 // TXD loopback bits 37 | #define MII_BMCR_RESET 0x8000 // reset to default state 38 | 39 | /** basic mode status register 40 | */ 41 | #define MII_BMSR_ERCAP 0x0001 // ext-reg capability 42 | #define MII_BMSR_JCD 0x0002 // jabber detected 43 | #define MII_BMSR_LSTATUS 0x0004 // link status 44 | #define MII_BMSR_ANEGCAPABLE 0x0008 // able to do autonegotiation 45 | #define MII_BMSR_RFAULT 0x0010 // remote fault detected 46 | #define MII_BMSR_ANEGCOMPLETE 0x0020 // autonegotiation complete 47 | #define MII_BMSR_ESTATEN 0x0100 // extended status in R15 48 | #define MII_BMSR_100HALF2 0x0200 // can do 100BASE-T2 HDX 49 | #define MII_BMSR_100FULL2 0x0400 // can do 100BASE-T2 FDX 50 | #define MII_BMSR_10HALF 0x0800 // can do 10Mps, half-duplex 51 | #define MII_BMSR_10FULL 0x1000 // can do 10Mbps, full-duplex 52 | #define MII_BMSR_100HALF 0x2000 // can do 100Mbps, half-duplex 53 | #define MII_BMSR_100FULL 0x4000 // can do 100Mbps, full-duplex 54 | #define MII_BMSR_100BASE4 0x8000 // can do 100Mbps, 4k packets 55 | 56 | 57 | /** Read data from PHY. 58 | */ 59 | int mii_read(uint8_t phy, uint8_t reg, uint16_t *data); 60 | 61 | /** Write data to PHY. 62 | */ 63 | int mii_write(uint8_t phy, uint8_t reg, uint16_t data); 64 | 65 | /** Initialize MII interface. 66 | */ 67 | void mii_init(uint32_t clk); 68 | 69 | #endif /* _MII_H_ */ -------------------------------------------------------------------------------- /Example/Freescale/Kinetis/K60D_blink/AppConfig.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _APP_CONFIG_H 3 | #define _APP_CONFIG_H 4 | 5 | #include 6 | 7 | #endif 8 | -------------------------------------------------------------------------------- /Example/Freescale/Kinetis/K60D_blink/GCC/arm-gcc-link.ld: -------------------------------------------------------------------------------- 1 | OUTPUT_FORMAT ("elf32-littlearm", "elf32-bigarm", "elf32-littlearm") 2 | /* Internal Memory Map*/ 3 | MEMORY 4 | { 5 | rom (rx) : ORIGIN = 0x00000000, LENGTH = 0x00080000 6 | ram (rwx) : ORIGIN = 0x1fff0000, LENGTH = 0x00010000 7 | } 8 | 9 | _eram = 0x1fff0000 + 0x00010000; 10 | /* Section Definitions */ 11 | SECTIONS 12 | { 13 | .text : 14 | { 15 | KEEP(*(.isr_vector .isr_vector.*)) 16 | *(.text .text.* .gnu.linkonce.t.*) 17 | *(.glue_7t) *(.glue_7) 18 | *(.rodata .rodata* .gnu.linkonce.r.*) 19 | } > rom 20 | 21 | .ARM.extab : 22 | { 23 | *(.ARM.extab* .gnu.linkonce.armextab.*) 24 | } > rom 25 | 26 | __exidx_start = .; 27 | .ARM.exidx : 28 | { 29 | *(.ARM.exidx* .gnu.linkonce.armexidx.*) 30 | } > rom 31 | __exidx_end = .; 32 | 33 | . = ALIGN(4); 34 | _etext = .; 35 | _sidata = .; 36 | 37 | .data : AT (_etext) 38 | { 39 | _sdata = .; 40 | *(.data .data.*) 41 | . = ALIGN(4); 42 | _edata = . ; 43 | } > ram 44 | 45 | /* .bss section which is used for uninitialized data */ 46 | .bss (NOLOAD) : 47 | { 48 | _sbss = . ; 49 | *(.bss .bss.*) 50 | *(COMMON) 51 | . = ALIGN(4); 52 | _ebss = . ; 53 | } > ram 54 | 55 | /* stack section */ 56 | .co_stack (NOLOAD): 57 | { 58 | . = ALIGN(8); 59 | *(.co_stack .co_stack.*) 60 | } > ram 61 | 62 | . = ALIGN(4); 63 | _end = . ; 64 | } -------------------------------------------------------------------------------- /Example/Freescale/Kinetis/K60D_blink/IAR/512KB_Pflash.icf: -------------------------------------------------------------------------------- 1 | /*###ICF### Section handled by ICF editor, don't touch! ****/ 2 | /*-Editor annotation file-*/ 3 | /* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */ 4 | /*-Specials-*/ 5 | define symbol __ICFEDIT_intvec_start__ = 0x00000000; 6 | /*-Memory Regions-*/ 7 | define symbol __ICFEDIT_region_ROM_start__ = 0x00000000; 8 | define symbol __ICFEDIT_region_ROM_end__ = 0x0007ffff; 9 | define symbol __ICFEDIT_region_RAM_start__ = 0x1fff0410; 10 | define symbol __ICFEDIT_region_RAM_end__ = 0x1fffffff; 11 | /*-Sizes-*/ 12 | define symbol __ICFEDIT_size_cstack__ = 0x1000; 13 | define symbol __ICFEDIT_size_heap__ = 0x200; 14 | /**** End of ICF editor section. ###ICF###*/ 15 | 16 | define symbol __region_RAM2_start__ = 0x20000000; 17 | define symbol __region_RAM2_end__ = 0x2000ffff; 18 | 19 | define exported symbol __VECTOR_TABLE = 0x00000000; 20 | define exported symbol __VECTOR_RAM = 0x1fff0000; 21 | 22 | define exported symbol __BOOT_STACK_ADDRESS = __region_RAM2_end__ - 7; //0x2000FFF8; 23 | 24 | define symbol __code_start__ = 0x00000410; 25 | 26 | define memory mem with size = 4G; 27 | define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFEDIT_region_ROM_end__]; 28 | define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__] | mem:[from __region_RAM2_start__ to __region_RAM2_end__]; 29 | 30 | define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { }; 31 | define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { }; 32 | 33 | initialize by copy { readwrite }; 34 | do not initialize { section .noinit }; 35 | 36 | place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec }; 37 | place at address mem:__code_start__ { readonly section .noinit }; 38 | 39 | place in ROM_region { readonly }; 40 | 41 | place in RAM_region { readwrite, block CSTACK, block HEAP }; 42 | -------------------------------------------------------------------------------- /Example/Freescale/Kinetis/K60D_blink/IAR/isr.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * File: isr.h 3 | * Purpose: Define interrupt service routines referenced by the vector table. 4 | * Note: Only "vectors.c" should include this header file. 5 | ******************************************************************************/ 6 | 7 | #ifndef _ISR_H 8 | #define _ISR_H 9 | 10 | void PendSV_Handler(void); 11 | void SysTick_Handler(void); 12 | void ethernetif_isr(void); 13 | 14 | #undef VECTOR_014 15 | #define VECTOR_014 PendSV_Handler 16 | 17 | #undef VECTOR_015 18 | #define VECTOR_015 SysTick_Handler 19 | 20 | #endif //_ISR_H 21 | -------------------------------------------------------------------------------- /Example/Freescale/Kinetis/K60D_blink/IAR/low_init.c: -------------------------------------------------------------------------------- 1 | /** 2 | * @file low_init.c 3 | * @date 25 Jul 2013 4 | * @brief This file provides low level initialization for uC 5 | * 6 | * @author Jozef Maslik (maslo@binarylemon.com) 7 | * 8 | */ 9 | 10 | #include 11 | #include 12 | 13 | /** Disable watchdog. 14 | */ 15 | static void wdt_disable(void) { 16 | // unlock watchdog 17 | WDOG_UNLOCK = 0xc520; 18 | WDOG_UNLOCK = 0xd928; 19 | 20 | // disable watchdog 21 | WDOG_STCTRLH &= ~(WDOG_STCTRLH_WDOGEN_MASK); 22 | } 23 | 24 | 25 | 26 | /** Clock to peripherals enable. 27 | */ 28 | static void clock_enable(void) { 29 | // GPIO clock enable 30 | SIM_SCGC5 |= (SIM_SCGC5_PORTA_MASK | SIM_SCGC5_PORTB_MASK | SIM_SCGC5_PORTC_MASK | SIM_SCGC5_PORTD_MASK | SIM_SCGC5_PORTE_MASK); 31 | 32 | // ENET clock enable 33 | SIM_SCGC2 |= SIM_SCGC2_ENET_MASK; 34 | 35 | SIM_SCGC1 = 0xFFFFFFFF; 36 | SIM_SCGC2 = 0xFFFFFFFF; 37 | SIM_SCGC3 = 0xFFFFFFFF; 38 | SIM_SCGC4 = 0xFFFFFFFF; 39 | SIM_SCGC5 = 0xFFFFFFFF; 40 | SIM_SCGC6 = 0xFFFFFFFF; 41 | SIM_SCGC7 = 0xFFFFFFFF; 42 | } 43 | 44 | void trace_clk_init(void) { 45 | // trace clock to the core clock frequency 46 | SIM_SOPT2 |= SIM_SOPT2_TRACECLKSEL_MASK; 47 | 48 | // enable the TRACE_CLKOUT pin function on PTA6 (alt7 function) 49 | PORTA_PCR6 = ( PORT_PCR_MUX(0x7)); 50 | } 51 | 52 | /** Low level init function. 53 | */ 54 | int __low_level_init(void) { 55 | wdt_disable(); 56 | clock_enable(); 57 | SystemInit(); 58 | // trace_clk_init(); 59 | 60 | return 1; 61 | } 62 | -------------------------------------------------------------------------------- /Example/Freescale/Kinetis/K60D_blink/main.c: -------------------------------------------------------------------------------- 1 | /** 2 | * @file main.c 3 | * @date 25 Jul 2013 4 | * @brief Very simple demo which blink with LED on TWR-K60N512 board 5 | * 6 | * @author Jozef Maslik (maslo@binarylemon.com) 7 | * 8 | */ 9 | 10 | #include 11 | 12 | #include 13 | 14 | #define TASK_LED_STACK_SIZE 128 15 | #define TASK_LED_PRI 3 16 | 17 | OS_STK task_led_stack[TASK_LED_STACK_SIZE]; 18 | 19 | static void task_led(void *pdata) { 20 | (void)pdata; 21 | 22 | PORTA_PCR11 = PORT_PCR_MUX(1); // set PORTA.11 as GPIO 23 | GPIOA_PDDR = (1 << 11); // PORTA.11 output 24 | 25 | for (;;) { 26 | GPIOA_PTOR = (1 << 11); // toggle LED1 27 | CoTickDelay (100); 28 | } 29 | } 30 | 31 | int main() { 32 | CoInitOS(); 33 | 34 | CoCreateTask(task_led, (void *)0, TASK_LED_PRI, &task_led_stack[TASK_LED_STACK_SIZE - 1], TASK_LED_STACK_SIZE); 35 | 36 | CoStartOS(); 37 | } 38 | -------------------------------------------------------------------------------- /Example/Freescale/Kinetis/K60D_lwIP/AppConfig.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file AppConfig.h 3 | * @date 25 Jul 2013 4 | * @brief Application specific configuration. 5 | * 6 | */ 7 | 8 | #ifndef _APP_CONFIG_H_ 9 | #define _APP_CONFIG_H_ 10 | 11 | #include 12 | 13 | #endif // _APP_CONFIG_H_ 14 | -------------------------------------------------------------------------------- /Example/Freescale/Kinetis/K60D_lwIP/GCC/arm-gcc-link.ld: -------------------------------------------------------------------------------- 1 | OUTPUT_FORMAT ("elf32-littlearm", "elf32-bigarm", "elf32-littlearm") 2 | /* Internal Memory Map*/ 3 | MEMORY 4 | { 5 | rom (rx) : ORIGIN = 0x00000000, LENGTH = 0x00080000 6 | ram (rwx) : ORIGIN = 0x1fff0000, LENGTH = 0x00010000 7 | } 8 | 9 | _eram = 0x1fff0000 + 0x00010000; 10 | /* Section Definitions */ 11 | SECTIONS 12 | { 13 | .text : 14 | { 15 | KEEP(*(.isr_vector .isr_vector.*)) 16 | *(.text .text.* .gnu.linkonce.t.*) 17 | *(.glue_7t) *(.glue_7) 18 | *(.rodata .rodata* .gnu.linkonce.r.*) 19 | } > rom 20 | 21 | .ARM.extab : 22 | { 23 | *(.ARM.extab* .gnu.linkonce.armextab.*) 24 | } > rom 25 | 26 | __exidx_start = .; 27 | .ARM.exidx : 28 | { 29 | *(.ARM.exidx* .gnu.linkonce.armexidx.*) 30 | } > rom 31 | __exidx_end = .; 32 | 33 | . = ALIGN(4); 34 | _etext = .; 35 | _sidata = .; 36 | 37 | .data : AT (_etext) 38 | { 39 | _sdata = .; 40 | *(.data .data.*) 41 | . = ALIGN(4); 42 | _edata = . ; 43 | } > ram 44 | 45 | /* .bss section which is used for uninitialized data */ 46 | .bss (NOLOAD) : 47 | { 48 | _sbss = . ; 49 | *(.bss .bss.*) 50 | *(COMMON) 51 | . = ALIGN(4); 52 | _ebss = . ; 53 | } > ram 54 | 55 | /* stack section */ 56 | .co_stack (NOLOAD): 57 | { 58 | . = ALIGN(8); 59 | *(.co_stack .co_stack.*) 60 | } > ram 61 | 62 | . = ALIGN(4); 63 | _end = . ; 64 | } -------------------------------------------------------------------------------- /Example/Freescale/Kinetis/K60D_lwIP/IAR/512KB_Pflash.icf: -------------------------------------------------------------------------------- 1 | /*###ICF### Section handled by ICF editor, don't touch! ****/ 2 | /*-Editor annotation file-*/ 3 | /* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */ 4 | /*-Specials-*/ 5 | define symbol __ICFEDIT_intvec_start__ = 0x00000000; 6 | /*-Memory Regions-*/ 7 | define symbol __ICFEDIT_region_ROM_start__ = 0x00000000; 8 | define symbol __ICFEDIT_region_ROM_end__ = 0x0007ffff; 9 | define symbol __ICFEDIT_region_RAM_start__ = 0x1fff0410; 10 | define symbol __ICFEDIT_region_RAM_end__ = 0x1fffffff; 11 | /*-Sizes-*/ 12 | define symbol __ICFEDIT_size_cstack__ = 0x1000; 13 | define symbol __ICFEDIT_size_heap__ = 0x200; 14 | /**** End of ICF editor section. ###ICF###*/ 15 | 16 | define symbol __region_RAM2_start__ = 0x20000000; 17 | define symbol __region_RAM2_end__ = 0x2000ffff; 18 | 19 | define exported symbol __VECTOR_TABLE = 0x00000000; 20 | define exported symbol __VECTOR_RAM = 0x1fff0000; 21 | 22 | define exported symbol __BOOT_STACK_ADDRESS = __region_RAM2_end__ - 7; //0x2000FFF8; 23 | 24 | define symbol __code_start__ = 0x00000410; 25 | 26 | define memory mem with size = 4G; 27 | define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFEDIT_region_ROM_end__]; 28 | define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__] | mem:[from __region_RAM2_start__ to __region_RAM2_end__]; 29 | 30 | define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { }; 31 | define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { }; 32 | 33 | initialize by copy { readwrite }; 34 | do not initialize { section .noinit }; 35 | 36 | place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec }; 37 | place at address mem:__code_start__ { readonly section .noinit }; 38 | 39 | place in ROM_region { readonly }; 40 | 41 | place in RAM_region { readwrite, block CSTACK, block HEAP }; 42 | -------------------------------------------------------------------------------- /Example/Freescale/Kinetis/K60D_lwIP/IAR/isr.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file AppConfig.h 3 | * @date 25 Jul 2013 4 | * @brief Define interrupt service routines referenced by the vector table. 5 | * 6 | * @note 7 | * Only "vectors.c" should include this header file. 8 | * 9 | */ 10 | 11 | #ifndef __ISR_H 12 | #define __ISR_H 13 | 14 | void PendSV_Handler(void); 15 | void SysTick_Handler(void); 16 | void ENET_Transmit_IRQHandler(void); 17 | void ENET_Receive_IRQHandler(void); 18 | void ENET_Error_IRQHandler(void); 19 | 20 | #undef VECTOR_014 21 | #define VECTOR_014 PendSV_Handler 22 | 23 | #undef VECTOR_015 24 | #define VECTOR_015 SysTick_Handler 25 | 26 | #undef VECTOR_092 27 | #define VECTOR_092 ENET_Transmit_IRQHandler 28 | 29 | #undef VECTOR_093 30 | #define VECTOR_093 ENET_Receive_IRQHandler 31 | 32 | #undef VECTOR_094 33 | #define VECTOR_094 ENET_Error_IRQHandler 34 | 35 | #endif //__ISR_H 36 | -------------------------------------------------------------------------------- /Example/Freescale/Kinetis/K60D_lwIP/IAR/low_init.c: -------------------------------------------------------------------------------- 1 | /** 2 | * @file low_init.c 3 | * @date 25 Jul 2013 4 | * @brief This file provides low level initialization for K60N512 5 | * 6 | */ 7 | 8 | #include "MK60D.h" 9 | 10 | /** Disable watchdog. 11 | */ 12 | static void wdt_disable(void) { 13 | // unlock watchdog 14 | WDOG_UNLOCK = 0xc520; 15 | WDOG_UNLOCK = 0xd928; 16 | 17 | // disable watchdog 18 | WDOG_STCTRLH &= ~(WDOG_STCTRLH_WDOGEN_MASK); 19 | } 20 | 21 | 22 | 23 | /** Clock to peripherals enable. 24 | */ 25 | static void clock_enable(void) { 26 | // GPIO clock enable 27 | SIM_SCGC5 |= (SIM_SCGC5_PORTA_MASK | SIM_SCGC5_PORTB_MASK | SIM_SCGC5_PORTC_MASK | SIM_SCGC5_PORTD_MASK | SIM_SCGC5_PORTE_MASK); 28 | 29 | // ENET clock enable 30 | SIM_SCGC2 |= SIM_SCGC2_ENET_MASK; 31 | 32 | SIM_SCGC1 = 0xFFFFFFFF; 33 | SIM_SCGC2 = 0xFFFFFFFF; 34 | SIM_SCGC3 = 0xFFFFFFFF; 35 | SIM_SCGC4 = 0xFFFFFFFF; 36 | SIM_SCGC5 = 0xFFFFFFFF; 37 | SIM_SCGC6 = 0xFFFFFFFF; 38 | SIM_SCGC7 = 0xFFFFFFFF; 39 | } 40 | 41 | void trace_clk_init(void) { 42 | // trace clock to the core clock frequency 43 | SIM_SOPT2 |= SIM_SOPT2_TRACECLKSEL_MASK; 44 | 45 | // enable the TRACE_CLKOUT pin function on PTA6 (alt7 function) 46 | PORTA_PCR6 = ( PORT_PCR_MUX(0x7)); 47 | } 48 | 49 | /** Low level init function. 50 | */ 51 | int __low_level_init(void) { 52 | wdt_disable(); 53 | clock_enable(); 54 | SystemInit(); 55 | // pll_init(); 56 | // trace_clk_init(); 57 | 58 | return 1; 59 | } 60 | -------------------------------------------------------------------------------- /Example/Freescale/Kinetis/K60D_lwIP/httpserver-netconn.c: -------------------------------------------------------------------------------- 1 | #include "lwip/def.h" 2 | #include "lwip/api.h" 3 | 4 | #if LWIP_NETCONN 5 | 6 | #define TASK_HTTP_STACK_SIZE 800 7 | #define TASK_HTTP_PRIO 5 8 | 9 | const static char http_html_hdr[] = "HTTP/1.1 200 OK\r\nContent-type: text/html\r\n\r\n"; 10 | const static char http_index_html[] = "Congrats!

This is Coocox OS LwIP demo !

More information at www.coocox.org"; 11 | 12 | /** HTTP server process function. 13 | */ 14 | static void http_process(struct netconn *conn) { 15 | struct netbuf *inbuf; 16 | char *buf; 17 | u16_t len; 18 | 19 | /* Read the data from the port, blocking if nothing yet there. 20 | We assume the request (the part we care about) is in one netbuf */ 21 | if (ERR_OK == netconn_recv(conn, &inbuf)) { 22 | netbuf_data(inbuf, (void **)&buf, &len); 23 | 24 | /* Is this an HTTP GET command? (only check the first 5 chars, since 25 | there are other formats for GET, and we're keeping it very simple )*/ 26 | if (5 <= len && buf[0] == 'G' && buf[1] == 'E' && buf[2] == 'T' && buf[3] == ' ' && buf[4] == '/') { 27 | /* Send the HTML header 28 | * subtract 1 from the size, since we dont send the \0 in the string 29 | * NETCONN_NOCOPY: our data is const static, so no need to copy it 30 | */ 31 | netconn_write(conn, http_html_hdr, sizeof(http_html_hdr) - 1, NETCONN_NOCOPY); 32 | 33 | /* Send our HTML page */ 34 | netconn_write(conn, http_index_html, sizeof(http_index_html) - 1, NETCONN_NOCOPY); 35 | } 36 | } 37 | 38 | /* Close the connection (server closes in HTTP) */ 39 | netconn_close(conn); 40 | 41 | /* Delete the buffer (netconn_recv gives us ownership, 42 | so we have to make sure to deallocate the buffer) */ 43 | netbuf_delete(inbuf); 44 | } 45 | 46 | /** HTTP server task. 47 | */ 48 | static void http_server(void *pdata) { 49 | struct netconn *conn, *newconn; 50 | 51 | /* Create a new TCP connection handle */ 52 | conn = netconn_new(NETCONN_TCP); 53 | LWIP_ERROR("http_server: invalid conn", (conn != NULL), return;); 54 | 55 | /* Bind to port 80 (HTTP) with default IP address */ 56 | netconn_bind(conn, NULL, 80); 57 | 58 | /* Put the connection into LISTEN state */ 59 | netconn_listen(conn); 60 | 61 | while (1) { 62 | netconn_accept(conn, &newconn); 63 | http_process(newconn); 64 | netconn_delete(newconn); 65 | } 66 | } 67 | 68 | /** Initialize and start HTTP server. 69 | */ 70 | int http_init(void) { 71 | sys_thread_t err; 72 | 73 | err = sys_thread_new(NULL, 74 | http_server, 75 | NULL, 76 | TASK_HTTP_STACK_SIZE, 77 | TASK_HTTP_PRIO); 78 | 79 | if (E_CREATE_FAIL == err) { 80 | return -1; 81 | } 82 | 83 | return 0; 84 | } 85 | 86 | #endif /* LWIP_NETCONN*/ 87 | -------------------------------------------------------------------------------- /Example/Freescale/Kinetis/K60D_lwIP/main.c: -------------------------------------------------------------------------------- 1 | /** 2 | * @file main.c 3 | * @date 31 Jul 2013 4 | * @brief lwIP demonstration - simple web server on TWR-K60N512 board 5 | * 6 | */ 7 | 8 | #include "coos.h" 9 | 10 | #include "lwip/def.h" 11 | #include "lwip/mem.h" 12 | #include "lwip/tcpip.h" 13 | #include "lwip/api.h" 14 | 15 | 16 | struct netif *macnet_netif; 17 | struct netif *loop_netif; 18 | 19 | int http_init(void); 20 | 21 | static void lwip_init(void) { 22 | struct ip_addr ipaddr, netmask, gw; 23 | extern err_t ethernetif_init( struct netif *netif ); 24 | 25 | tcpip_init(NULL, NULL); 26 | 27 | macnet_netif = mem_malloc(sizeof(struct netif)); 28 | 29 | IP4_ADDR(&gw, 192,168,1,1); 30 | IP4_ADDR(&ipaddr, 192,168,1,100); 31 | IP4_ADDR(&netmask, 255,255,255,0); 32 | 33 | netif_set_default(netif_add(macnet_netif, &ipaddr, &netmask, &gw, NULL, ethernetif_init, tcpip_input)); 34 | netif_set_up(macnet_netif); 35 | } 36 | 37 | int main(void) { 38 | CoInitOS(); 39 | lwip_init(); 40 | http_init(); 41 | CoStartOS(); 42 | 43 | while(1); 44 | } 45 | 46 | -------------------------------------------------------------------------------- /Example/Freescale/Kinetis/K70F_blink/AppConfig.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _APP_CONFIG_H 3 | #define _APP_CONFIG_H 4 | 5 | #include 6 | 7 | #endif 8 | -------------------------------------------------------------------------------- /Example/Freescale/Kinetis/K70F_blink/GCC/arm-gcc-link.ld: -------------------------------------------------------------------------------- 1 | OUTPUT_FORMAT ("elf32-littlearm", "elf32-bigarm", "elf32-littlearm") 2 | /* Internal Memory Map*/ 3 | MEMORY 4 | { 5 | rom (rx) : ORIGIN = 0x00000000, LENGTH = 0x00100000 6 | ram (rwx) : ORIGIN = 0x1fff0000, LENGTH = 0x00010000 7 | } 8 | 9 | _eram = 0x10000000 + 0x00000800; 10 | /* Section Definitions */ 11 | SECTIONS 12 | { 13 | .text : 14 | { 15 | KEEP(*(.isr_vector .isr_vector.*)) 16 | *(.text .text.* .gnu.linkonce.t.*) 17 | *(.glue_7t) *(.glue_7) 18 | *(.rodata .rodata* .gnu.linkonce.r.*) 19 | } > rom 20 | 21 | .ARM.extab : 22 | { 23 | *(.ARM.extab* .gnu.linkonce.armextab.*) 24 | } > rom 25 | 26 | __exidx_start = .; 27 | .ARM.exidx : 28 | { 29 | *(.ARM.exidx* .gnu.linkonce.armexidx.*) 30 | } > rom 31 | __exidx_end = .; 32 | 33 | . = ALIGN(4); 34 | _etext = .; 35 | _sidata = .; 36 | 37 | .data : AT (_etext) 38 | { 39 | _sdata = .; 40 | *(.data .data.*) 41 | . = ALIGN(4); 42 | _edata = . ; 43 | } > ram 44 | 45 | /* .bss section which is used for uninitialized data */ 46 | .bss (NOLOAD) : 47 | { 48 | _sbss = . ; 49 | *(.bss .bss.*) 50 | *(COMMON) 51 | . = ALIGN(4); 52 | _ebss = . ; 53 | } > ram 54 | 55 | /* stack section */ 56 | .co_stack (NOLOAD): 57 | { 58 | . = ALIGN(8); 59 | *(.co_stack .co_stack.*) 60 | } > ram 61 | 62 | . = ALIGN(4); 63 | _end = . ; 64 | } -------------------------------------------------------------------------------- /Example/Freescale/Kinetis/K70F_blink/IAR/128KB_Ram.icf: -------------------------------------------------------------------------------- 1 | /*###ICF### Section handled by ICF editor, don't touch! ****/ 2 | /*-Editor annotation file-*/ 3 | /* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */ 4 | /*-Specials-*/ 5 | define symbol __ICFEDIT_intvec_start__ = 0x1fff0000; 6 | /*-Memory Regions-*/ 7 | define symbol __ICFEDIT_region_ROM_start__ = 0x0; 8 | define symbol __ICFEDIT_region_ROM_end__ = 0x0; 9 | define symbol __ICFEDIT_region_RAM_start__ = 0x1fff0000; 10 | define symbol __ICFEDIT_region_RAM_end__ = 0x20000000; 11 | /*-Sizes-*/ 12 | define symbol __ICFEDIT_size_cstack__ = 0x400; 13 | define symbol __ICFEDIT_size_heap__ = 0x800;//b06862 14 | /**** End of ICF editor section. ###ICF###*/ 15 | 16 | define symbol __region_RAM2_start__ = 0x20000000; 17 | define symbol __region_RAM2_end__ = 0x20010000; 18 | 19 | define exported symbol __VECTOR_TABLE = 0x1fff0000; 20 | define exported symbol __VECTOR_RAM = 0x1fff0000; 21 | 22 | define exported symbol __BOOT_STACK_ADDRESS = __region_RAM2_end__ - 8; //0x2000FFF8; 23 | 24 | define symbol __code_start__ = 0x1fff0410; 25 | 26 | define memory mem with size = 4G; 27 | define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFEDIT_region_ROM_end__]; 28 | define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__] | mem:[from __region_RAM2_start__ to __region_RAM2_end__]; 29 | 30 | define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { }; 31 | define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { }; 32 | 33 | initialize manually { readwrite }; 34 | initialize manually { section .data}; 35 | initialize manually { section .textrw }; 36 | do not initialize { section .noinit }; 37 | 38 | define block CodeRelocate { section .textrw_init }; 39 | define block CodeRelocateRam { section .textrw }; 40 | 41 | 42 | place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec }; 43 | place at address mem:__code_start__ { readonly section .noinit }; 44 | 45 | place in RAM_region { readonly, block CodeRelocate }; 46 | 47 | place in RAM_region { readwrite, block CodeRelocateRam, 48 | block CSTACK, block HEAP }; -------------------------------------------------------------------------------- /Example/Freescale/Kinetis/K70F_blink/IAR/1MB_Pflash.icf: -------------------------------------------------------------------------------- 1 | /*###ICF### Section handled by ICF editor, don't touch! ****/ 2 | /*-Editor annotation file-*/ 3 | /* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */ 4 | /*-Specials-*/ 5 | define symbol __ICFEDIT_intvec_start__ = 0x00000000; 6 | /*-Memory Regions-*/ 7 | define symbol __ICFEDIT_region_ROM_start__ = 0x00000000; 8 | define symbol __ICFEDIT_region_ROM_end__ = 0x00100000; 9 | define symbol __ICFEDIT_region_RAM_start__ = 0x1FFF0410; 10 | define symbol __ICFEDIT_region_RAM_end__ = 0x20000000; 11 | /*-Sizes-*/ 12 | define symbol __ICFEDIT_size_cstack__ = 0x1000; 13 | define symbol __ICFEDIT_size_heap__ = 0x800; 14 | /**** End of ICF editor section. ###ICF###*/ 15 | 16 | define symbol __region_RAM2_start__ = 0x20000000; 17 | define symbol __region_RAM2_end__ = 0x20010000; 18 | 19 | define exported symbol __VECTOR_TABLE = 0x00000000; 20 | define exported symbol __VECTOR_RAM = 0x1fff0000; 21 | 22 | define exported symbol __BOOT_STACK_ADDRESS = __region_RAM2_end__ - 8; //0x2000FFF8; 23 | 24 | define symbol __code_start__ = 0x00000410; 25 | 26 | define memory mem with size = 4G; 27 | define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFEDIT_region_ROM_end__]; 28 | define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__] | mem:[from __region_RAM2_start__ to __region_RAM2_end__]; 29 | 30 | define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { }; 31 | define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { }; 32 | 33 | initialize manually { readwrite }; 34 | initialize manually { section .data}; 35 | initialize manually { section .textrw }; 36 | do not initialize { section .noinit }; 37 | 38 | define block CodeRelocate { section .textrw_init }; 39 | define block CodeRelocateRam { section .textrw }; 40 | 41 | place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec }; 42 | place at address mem:__code_start__ { readonly section .noinit }; 43 | 44 | place in ROM_region { readonly, block CodeRelocate}; 45 | 46 | place in RAM_region { readwrite, block CodeRelocateRam, 47 | block CSTACK, block HEAP }; 48 | -------------------------------------------------------------------------------- /Example/Freescale/Kinetis/K70F_blink/IAR/isr.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file AppConfig.h 3 | * @date 18. Aug 2013 4 | * @brief Define interrupt service routines referenced by the vector table. 5 | * 6 | * @note 7 | * Only "vectors.c" should include this header file. 8 | * 9 | */ 10 | 11 | #ifndef __ISR_H 12 | #define __ISR_H 13 | 14 | void PendSV_Handler(void); 15 | void SysTick_Handler(void); 16 | void ethernetif_isr(void); 17 | 18 | #undef VECTOR_014 19 | #define VECTOR_014 PendSV_Handler 20 | 21 | #undef VECTOR_015 22 | #define VECTOR_015 SysTick_Handler 23 | 24 | #endif //__ISR_H 25 | -------------------------------------------------------------------------------- /Example/Freescale/Kinetis/K70F_blink/IAR/low_init.c: -------------------------------------------------------------------------------- 1 | /** 2 | * @file low_init.c 3 | * @date 18. Aug 2013 4 | * @brief This file provides low level initialization for K60N512 5 | * 6 | */ 7 | 8 | #include 9 | 10 | /** Disable watchdog. 11 | */ 12 | static void wdt_disable(void) { 13 | // unlock watchdog 14 | WDOG_UNLOCK = 0xc520; 15 | WDOG_UNLOCK = 0xd928; 16 | 17 | // disable watchdog 18 | WDOG_STCTRLH &= ~(WDOG_STCTRLH_WDOGEN_MASK); 19 | } 20 | 21 | /** Clock to peripherals enable. 22 | */ 23 | static void clock_enable(void) { 24 | // GPIO clock enable 25 | SIM_SCGC5 |= (SIM_SCGC5_PORTA_MASK | SIM_SCGC5_PORTB_MASK | SIM_SCGC5_PORTC_MASK | SIM_SCGC5_PORTD_MASK | SIM_SCGC5_PORTE_MASK | SIM_SCGC5_PORTF_MASK); 26 | 27 | // ENET clock enable 28 | SIM_SCGC2 |= SIM_SCGC2_ENET1_MASK; 29 | 30 | SIM_SCGC1 = 0xFFFFFFFF; 31 | SIM_SCGC2 = 0xFFFFFFFF; 32 | SIM_SCGC3 = 0xFFFFFFFF; 33 | SIM_SCGC4 = 0xFFFFFFFF; 34 | SIM_SCGC5 = 0xFFFFFFFF; 35 | SIM_SCGC6 = 0xFFFFFFFF; 36 | SIM_SCGC7 = 0xFFFFFFFF; 37 | } 38 | 39 | void trace_clk_init(void) { 40 | // trace clock to the core clock frequency 41 | SIM_SOPT2 |= SIM_SOPT2_TRACECLKSEL_MASK; 42 | 43 | // enable the TRACE_CLKOUT pin function on PTA6 (alt7 function) 44 | PORTA_PCR6 = PORT_PCR_MUX(0x7); 45 | } 46 | 47 | /** Low level init function. 48 | */ 49 | int __low_level_init(void) { 50 | wdt_disable(); 51 | clock_enable(); 52 | SystemInit(); 53 | // trace_clk_init(); 54 | 55 | return 1; 56 | } 57 | -------------------------------------------------------------------------------- /Example/Freescale/Kinetis/K70F_blink/main.c: -------------------------------------------------------------------------------- 1 | /** 2 | * @file main.c 3 | * @date 25 Jul 2013 4 | * @brief Very simple demo which blink with LED on TWR-K60N512 board 5 | * 6 | * @author Jozef Maslik (maslo@binarylemon.com) 7 | * 8 | */ 9 | 10 | #include 11 | #include 12 | 13 | #define TASK_LED_STACK_SIZE 128 14 | #define TASK_LED_PRI 3 15 | 16 | OS_STK task_led_stack[TASK_LED_STACK_SIZE]; 17 | 18 | static void task_led(void *pdata) { 19 | (void)pdata; 20 | 21 | PORTA_PCR10 = PORT_PCR_MUX(1); // set PORTA.11 as GPIO 22 | GPIOA_PDDR = (1 << 10); // PORTA.11 output 23 | 24 | for (;;) { 25 | GPIOA_PTOR = (1 << 10); // toggle LED1 26 | CoTickDelay (100); 27 | } 28 | } 29 | 30 | int main() { 31 | CoInitOS(); 32 | 33 | CoCreateTask(task_led, (void *)0, TASK_LED_PRI, &task_led_stack[TASK_LED_STACK_SIZE - 1], TASK_LED_STACK_SIZE); 34 | 35 | CoStartOS(); 36 | 37 | return 0; 38 | } 39 | -------------------------------------------------------------------------------- /Example/Freescale/Kinetis/K70F_fpu/AppConfig.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _APP_CONFIG_H 3 | #define _APP_CONFIG_H 4 | 5 | #include 6 | 7 | #endif 8 | -------------------------------------------------------------------------------- /Example/Freescale/Kinetis/K70F_fpu/GCC/arm-gcc-link.ld: -------------------------------------------------------------------------------- 1 | OUTPUT_FORMAT ("elf32-littlearm", "elf32-bigarm", "elf32-littlearm") 2 | /* Internal Memory Map*/ 3 | MEMORY 4 | { 5 | rom (rx) : ORIGIN = 0x00000000, LENGTH = 0x00100000 6 | ram (rwx) : ORIGIN = 0x1fff0000, LENGTH = 0x00010000 7 | } 8 | 9 | _eram = 0x10000000 + 0x00000800; 10 | /* Section Definitions */ 11 | SECTIONS 12 | { 13 | .text : 14 | { 15 | KEEP(*(.isr_vector .isr_vector.*)) 16 | *(.text .text.* .gnu.linkonce.t.*) 17 | *(.glue_7t) *(.glue_7) 18 | *(.rodata .rodata* .gnu.linkonce.r.*) 19 | } > rom 20 | 21 | .ARM.extab : 22 | { 23 | *(.ARM.extab* .gnu.linkonce.armextab.*) 24 | } > rom 25 | 26 | __exidx_start = .; 27 | .ARM.exidx : 28 | { 29 | *(.ARM.exidx* .gnu.linkonce.armexidx.*) 30 | } > rom 31 | __exidx_end = .; 32 | 33 | . = ALIGN(4); 34 | _etext = .; 35 | _sidata = .; 36 | 37 | .data : AT (_etext) 38 | { 39 | _sdata = .; 40 | *(.data .data.*) 41 | . = ALIGN(4); 42 | _edata = . ; 43 | } > ram 44 | 45 | /* .bss section which is used for uninitialized data */ 46 | .bss (NOLOAD) : 47 | { 48 | _sbss = . ; 49 | *(.bss .bss.*) 50 | *(COMMON) 51 | . = ALIGN(4); 52 | _ebss = . ; 53 | } > ram 54 | 55 | /* stack section */ 56 | .co_stack (NOLOAD): 57 | { 58 | . = ALIGN(8); 59 | *(.co_stack .co_stack.*) 60 | } > ram 61 | 62 | . = ALIGN(4); 63 | _end = . ; 64 | } 65 | -------------------------------------------------------------------------------- /Example/Freescale/Kinetis/K70F_fpu/IAR/128KB_Ram.icf: -------------------------------------------------------------------------------- 1 | /*###ICF### Section handled by ICF editor, don't touch! ****/ 2 | /*-Editor annotation file-*/ 3 | /* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */ 4 | /*-Specials-*/ 5 | define symbol __ICFEDIT_intvec_start__ = 0x1fff0000; 6 | /*-Memory Regions-*/ 7 | define symbol __ICFEDIT_region_ROM_start__ = 0x0; 8 | define symbol __ICFEDIT_region_ROM_end__ = 0x0; 9 | define symbol __ICFEDIT_region_RAM_start__ = 0x1fff0000; 10 | define symbol __ICFEDIT_region_RAM_end__ = 0x20000000; 11 | /*-Sizes-*/ 12 | define symbol __ICFEDIT_size_cstack__ = 0x400; 13 | define symbol __ICFEDIT_size_heap__ = 0x800;//b06862 14 | /**** End of ICF editor section. ###ICF###*/ 15 | 16 | define symbol __region_RAM2_start__ = 0x20000000; 17 | define symbol __region_RAM2_end__ = 0x20010000; 18 | 19 | define exported symbol __VECTOR_TABLE = 0x1fff0000; 20 | define exported symbol __VECTOR_RAM = 0x1fff0000; 21 | 22 | define exported symbol __BOOT_STACK_ADDRESS = __region_RAM2_end__ - 8; //0x2000FFF8; 23 | 24 | define symbol __code_start__ = 0x1fff0410; 25 | 26 | define memory mem with size = 4G; 27 | define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFEDIT_region_ROM_end__]; 28 | define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__] | mem:[from __region_RAM2_start__ to __region_RAM2_end__]; 29 | 30 | define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { }; 31 | define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { }; 32 | 33 | initialize manually { readwrite }; 34 | initialize manually { section .data}; 35 | initialize manually { section .textrw }; 36 | do not initialize { section .noinit }; 37 | 38 | define block CodeRelocate { section .textrw_init }; 39 | define block CodeRelocateRam { section .textrw }; 40 | 41 | 42 | place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec }; 43 | place at address mem:__code_start__ { readonly section .noinit }; 44 | 45 | place in RAM_region { readonly, block CodeRelocate }; 46 | 47 | place in RAM_region { readwrite, block CodeRelocateRam, 48 | block CSTACK, block HEAP }; -------------------------------------------------------------------------------- /Example/Freescale/Kinetis/K70F_fpu/IAR/1MB_Pflash.icf: -------------------------------------------------------------------------------- 1 | /*###ICF### Section handled by ICF editor, don't touch! ****/ 2 | /*-Editor annotation file-*/ 3 | /* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */ 4 | /*-Specials-*/ 5 | define symbol __ICFEDIT_intvec_start__ = 0x00000000; 6 | /*-Memory Regions-*/ 7 | define symbol __ICFEDIT_region_ROM_start__ = 0x00000000; 8 | define symbol __ICFEDIT_region_ROM_end__ = 0x00100000; 9 | define symbol __ICFEDIT_region_RAM_start__ = 0x1FFF0410; 10 | define symbol __ICFEDIT_region_RAM_end__ = 0x20000000; 11 | /*-Sizes-*/ 12 | define symbol __ICFEDIT_size_cstack__ = 0x1000; 13 | define symbol __ICFEDIT_size_heap__ = 0x800; 14 | /**** End of ICF editor section. ###ICF###*/ 15 | 16 | define symbol __region_RAM2_start__ = 0x20000000; 17 | define symbol __region_RAM2_end__ = 0x20010000; 18 | 19 | define exported symbol __VECTOR_TABLE = 0x00000000; 20 | define exported symbol __VECTOR_RAM = 0x1fff0000; 21 | 22 | define exported symbol __BOOT_STACK_ADDRESS = __region_RAM2_end__ - 8; //0x2000FFF8; 23 | 24 | define symbol __code_start__ = 0x00000410; 25 | 26 | define memory mem with size = 4G; 27 | define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFEDIT_region_ROM_end__]; 28 | define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__] | mem:[from __region_RAM2_start__ to __region_RAM2_end__]; 29 | 30 | define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { }; 31 | define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { }; 32 | 33 | initialize manually { readwrite }; 34 | initialize manually { section .data}; 35 | initialize manually { section .textrw }; 36 | do not initialize { section .noinit }; 37 | 38 | define block CodeRelocate { section .textrw_init }; 39 | define block CodeRelocateRam { section .textrw }; 40 | 41 | place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec }; 42 | place at address mem:__code_start__ { readonly section .noinit }; 43 | 44 | place in ROM_region { readonly, block CodeRelocate}; 45 | 46 | place in RAM_region { readwrite, block CodeRelocateRam, 47 | block CSTACK, block HEAP }; 48 | -------------------------------------------------------------------------------- /Example/Freescale/Kinetis/K70F_fpu/IAR/isr.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file AppConfig.h 3 | * @date 18. Aug 2013 4 | * @brief Define interrupt service routines referenced by the vector table. 5 | * 6 | * @note 7 | * Only "vectors.c" should include this header file. 8 | * 9 | */ 10 | 11 | #ifndef __ISR_H 12 | #define __ISR_H 13 | 14 | void PendSV_Handler(void); 15 | void SysTick_Handler(void); 16 | void PIT0_IRQHandler(void); 17 | 18 | #undef VECTOR_014 19 | #define VECTOR_014 PendSV_Handler 20 | 21 | #undef VECTOR_015 22 | #define VECTOR_015 SysTick_Handler 23 | 24 | #undef VECTOR_084 25 | #define VECTOR_084 PIT0_IRQHandler 26 | 27 | 28 | #endif //__ISR_H 29 | -------------------------------------------------------------------------------- /Example/Freescale/Kinetis/K70F_fpu/IAR/low_init.c: -------------------------------------------------------------------------------- 1 | /** 2 | * @file low_init.c 3 | * @date 18. Aug 2013 4 | * @brief This file provides low level initialization for K60N512 5 | * 6 | */ 7 | 8 | #include 9 | 10 | /** Disable watchdog. 11 | */ 12 | static void wdt_disable(void) { 13 | // unlock watchdog 14 | WDOG_UNLOCK = 0xc520; 15 | WDOG_UNLOCK = 0xd928; 16 | 17 | // disable watchdog 18 | WDOG_STCTRLH &= ~(WDOG_STCTRLH_WDOGEN_MASK); 19 | } 20 | 21 | /** Clock to peripherals enable. 22 | */ 23 | static void clock_enable(void) { 24 | // GPIO clock enable 25 | SIM_SCGC5 |= (SIM_SCGC5_PORTA_MASK | SIM_SCGC5_PORTB_MASK | SIM_SCGC5_PORTC_MASK | SIM_SCGC5_PORTD_MASK | SIM_SCGC5_PORTE_MASK | SIM_SCGC5_PORTF_MASK); 26 | 27 | // ENET clock enable 28 | SIM_SCGC2 |= SIM_SCGC2_ENET1_MASK; 29 | 30 | SIM_SCGC1 = 0xFFFFFFFF; 31 | SIM_SCGC2 = 0xFFFFFFFF; 32 | SIM_SCGC3 = 0xFFFFFFFF; 33 | SIM_SCGC4 = 0xFFFFFFFF; 34 | SIM_SCGC5 = 0xFFFFFFFF; 35 | SIM_SCGC6 = 0xFFFFFFFF; 36 | SIM_SCGC7 = 0xFFFFFFFF; 37 | } 38 | 39 | void trace_clk_init(void) { 40 | // trace clock to the core clock frequency 41 | SIM_SOPT2 |= SIM_SOPT2_TRACECLKSEL_MASK; 42 | 43 | // enable the TRACE_CLKOUT pin function on PTA6 (alt7 function) 44 | PORTA_PCR6 = PORT_PCR_MUX(0x7); 45 | } 46 | 47 | /** Low level init function. 48 | */ 49 | int __low_level_init(void) { 50 | wdt_disable(); 51 | clock_enable(); 52 | SystemInit(); 53 | // trace_clk_init(); 54 | 55 | return 1; 56 | } 57 | -------------------------------------------------------------------------------- /Example/Freescale/Kinetis/K70F_lwIP/AppConfig.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file AppConfig.h 3 | * @date 18. Aug 2013 4 | * @brief Application specific configuration. 5 | * 6 | */ 7 | 8 | #ifndef _APP_CONFIG_H 9 | #define _APP_CONFIG_H 10 | 11 | #include 12 | 13 | #endif // _APP_CONFIG_H 14 | -------------------------------------------------------------------------------- /Example/Freescale/Kinetis/K70F_lwIP/GCC/arm-gcc-link.ld: -------------------------------------------------------------------------------- 1 | OUTPUT_FORMAT ("elf32-littlearm", "elf32-bigarm", "elf32-littlearm") 2 | /* Internal Memory Map*/ 3 | MEMORY 4 | { 5 | rom (rx) : ORIGIN = 0x00000000, LENGTH = 0x00100000 6 | ram (rwx) : ORIGIN = 0x1fff0000, LENGTH = 0x00010000 7 | } 8 | 9 | _eram = 0x10000000 + 0x00000800; 10 | /* Section Definitions */ 11 | SECTIONS 12 | { 13 | .text : 14 | { 15 | KEEP(*(.isr_vector .isr_vector.*)) 16 | *(.text .text.* .gnu.linkonce.t.*) 17 | *(.glue_7t) *(.glue_7) 18 | *(.rodata .rodata* .gnu.linkonce.r.*) 19 | } > rom 20 | 21 | .ARM.extab : 22 | { 23 | *(.ARM.extab* .gnu.linkonce.armextab.*) 24 | } > rom 25 | 26 | __exidx_start = .; 27 | .ARM.exidx : 28 | { 29 | *(.ARM.exidx* .gnu.linkonce.armexidx.*) 30 | } > rom 31 | __exidx_end = .; 32 | 33 | . = ALIGN(4); 34 | _etext = .; 35 | _sidata = .; 36 | 37 | .data : AT (_etext) 38 | { 39 | _sdata = .; 40 | *(.data .data.*) 41 | . = ALIGN(4); 42 | _edata = . ; 43 | } > ram 44 | 45 | /* .bss section which is used for uninitialized data */ 46 | .bss (NOLOAD) : 47 | { 48 | _sbss = . ; 49 | *(.bss .bss.*) 50 | *(COMMON) 51 | . = ALIGN(4); 52 | _ebss = . ; 53 | } > ram 54 | 55 | /* stack section */ 56 | .co_stack (NOLOAD): 57 | { 58 | . = ALIGN(8); 59 | *(.co_stack .co_stack.*) 60 | } > ram 61 | 62 | . = ALIGN(4); 63 | _end = . ; 64 | } -------------------------------------------------------------------------------- /Example/Freescale/Kinetis/K70F_lwIP/IAR/128KB_Ram.icf: -------------------------------------------------------------------------------- 1 | /*###ICF### Section handled by ICF editor, don't touch! ****/ 2 | /*-Editor annotation file-*/ 3 | /* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */ 4 | /*-Specials-*/ 5 | define symbol __ICFEDIT_intvec_start__ = 0x1fff0000; 6 | /*-Memory Regions-*/ 7 | define symbol __ICFEDIT_region_ROM_start__ = 0x0; 8 | define symbol __ICFEDIT_region_ROM_end__ = 0x0; 9 | define symbol __ICFEDIT_region_RAM_start__ = 0x1fff0000; 10 | define symbol __ICFEDIT_region_RAM_end__ = 0x20000000; 11 | /*-Sizes-*/ 12 | define symbol __ICFEDIT_size_cstack__ = 0x400; 13 | define symbol __ICFEDIT_size_heap__ = 0x800;//b06862 14 | /**** End of ICF editor section. ###ICF###*/ 15 | 16 | define symbol __region_RAM2_start__ = 0x20000000; 17 | define symbol __region_RAM2_end__ = 0x20010000; 18 | 19 | define exported symbol __VECTOR_TABLE = 0x1fff0000; 20 | define exported symbol __VECTOR_RAM = 0x1fff0000; 21 | 22 | define exported symbol __BOOT_STACK_ADDRESS = __region_RAM2_end__ - 8; //0x2000FFF8; 23 | 24 | define symbol __code_start__ = 0x1fff0410; 25 | 26 | define memory mem with size = 4G; 27 | define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFEDIT_region_ROM_end__]; 28 | define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__] | mem:[from __region_RAM2_start__ to __region_RAM2_end__]; 29 | 30 | define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { }; 31 | define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { }; 32 | 33 | initialize manually { readwrite }; 34 | initialize manually { section .data}; 35 | initialize manually { section .textrw }; 36 | do not initialize { section .noinit }; 37 | 38 | define block CodeRelocate { section .textrw_init }; 39 | define block CodeRelocateRam { section .textrw }; 40 | 41 | 42 | place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec }; 43 | place at address mem:__code_start__ { readonly section .noinit }; 44 | 45 | place in RAM_region { readonly, block CodeRelocate }; 46 | 47 | place in RAM_region { readwrite, block CodeRelocateRam, 48 | block CSTACK, block HEAP }; -------------------------------------------------------------------------------- /Example/Freescale/Kinetis/K70F_lwIP/IAR/1MB_Pflash.icf: -------------------------------------------------------------------------------- 1 | /*###ICF### Section handled by ICF editor, don't touch! ****/ 2 | /*-Editor annotation file-*/ 3 | /* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */ 4 | /*-Specials-*/ 5 | define symbol __ICFEDIT_intvec_start__ = 0x00000000; 6 | /*-Memory Regions-*/ 7 | define symbol __ICFEDIT_region_ROM_start__ = 0x00000000; 8 | define symbol __ICFEDIT_region_ROM_end__ = 0x00100000; 9 | define symbol __ICFEDIT_region_RAM_start__ = 0x1FFF0410; 10 | define symbol __ICFEDIT_region_RAM_end__ = 0x20000000; 11 | /*-Sizes-*/ 12 | define symbol __ICFEDIT_size_cstack__ = 0x1000; 13 | define symbol __ICFEDIT_size_heap__ = 0x800; 14 | /**** End of ICF editor section. ###ICF###*/ 15 | 16 | define symbol __region_RAM2_start__ = 0x20000000; 17 | define symbol __region_RAM2_end__ = 0x20010000; 18 | 19 | define exported symbol __VECTOR_TABLE = 0x00000000; 20 | define exported symbol __VECTOR_RAM = 0x1fff0000; 21 | 22 | define exported symbol __BOOT_STACK_ADDRESS = __region_RAM2_end__ - 8; //0x2000FFF8; 23 | 24 | define symbol __code_start__ = 0x00000410; 25 | 26 | define memory mem with size = 4G; 27 | define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFEDIT_region_ROM_end__]; 28 | define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__] | mem:[from __region_RAM2_start__ to __region_RAM2_end__]; 29 | 30 | define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { }; 31 | define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { }; 32 | 33 | initialize manually { readwrite }; 34 | initialize manually { section .data}; 35 | initialize manually { section .textrw }; 36 | do not initialize { section .noinit }; 37 | 38 | define block CodeRelocate { section .textrw_init }; 39 | define block CodeRelocateRam { section .textrw }; 40 | 41 | place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec }; 42 | place at address mem:__code_start__ { readonly section .noinit }; 43 | 44 | place in ROM_region { readonly, block CodeRelocate}; 45 | 46 | place in RAM_region { readwrite, block CodeRelocateRam, 47 | block CSTACK, block HEAP }; 48 | -------------------------------------------------------------------------------- /Example/Freescale/Kinetis/K70F_lwIP/IAR/isr.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file AppConfig.h 3 | * @date 18. Aug 2013 4 | * @brief Define interrupt service routines referenced by the vector table. 5 | * 6 | * @note 7 | * Only "vectors.c" should include this header file. 8 | * 9 | */ 10 | 11 | #ifndef __ISR_H 12 | #define __ISR_H 13 | 14 | void PendSV_Handler(void); 15 | void SysTick_Handler(void); 16 | void ENET_Transmit_IRQHandler(void); 17 | void ENET_Receive_IRQHandler(void); 18 | void ENET_Error_IRQHandler(void); 19 | 20 | #undef VECTOR_014 21 | #define VECTOR_014 PendSV_Handler 22 | 23 | #undef VECTOR_015 24 | #define VECTOR_015 SysTick_Handler 25 | 26 | #undef VECTOR_092 27 | #define VECTOR_092 ENET_Transmit_IRQHandler 28 | 29 | #undef VECTOR_093 30 | #define VECTOR_093 ENET_Receive_IRQHandler 31 | 32 | #undef VECTOR_094 33 | #define VECTOR_094 ENET_Error_IRQHandler 34 | 35 | #endif //__ISR_H 36 | -------------------------------------------------------------------------------- /Example/Freescale/Kinetis/K70F_lwIP/IAR/low_init.c: -------------------------------------------------------------------------------- 1 | /** 2 | * @file low_init.c 3 | * @date 18. Aug 2013 4 | * @brief This file provides low level initialization for K60N512 5 | * 6 | */ 7 | 8 | #include 9 | 10 | /** Disable watchdog. 11 | */ 12 | static void wdt_disable(void) { 13 | // unlock watchdog 14 | WDOG_UNLOCK = 0xc520; 15 | WDOG_UNLOCK = 0xd928; 16 | 17 | // disable watchdog 18 | WDOG_STCTRLH &= ~(WDOG_STCTRLH_WDOGEN_MASK); 19 | } 20 | 21 | /** Clock to peripherals enable. 22 | */ 23 | static void clock_enable(void) { 24 | // GPIO clock enable 25 | SIM_SCGC5 |= (SIM_SCGC5_PORTA_MASK | SIM_SCGC5_PORTB_MASK | SIM_SCGC5_PORTC_MASK | SIM_SCGC5_PORTD_MASK | SIM_SCGC5_PORTE_MASK | SIM_SCGC5_PORTF_MASK); 26 | 27 | // ENET clock enable 28 | SIM_SCGC2 |= SIM_SCGC2_ENET1_MASK; 29 | 30 | SIM_SCGC1 = 0xFFFFFFFF; 31 | SIM_SCGC2 = 0xFFFFFFFF; 32 | SIM_SCGC3 = 0xFFFFFFFF; 33 | SIM_SCGC4 = 0xFFFFFFFF; 34 | SIM_SCGC5 = 0xFFFFFFFF; 35 | SIM_SCGC6 = 0xFFFFFFFF; 36 | SIM_SCGC7 = 0xFFFFFFFF; 37 | } 38 | 39 | void trace_clk_init(void) { 40 | // trace clock to the core clock frequency 41 | SIM_SOPT2 |= SIM_SOPT2_TRACECLKSEL_MASK; 42 | 43 | // enable the TRACE_CLKOUT pin function on PTA6 (alt7 function) 44 | PORTA_PCR6 = PORT_PCR_MUX(0x7); 45 | } 46 | 47 | /** Low level init function. 48 | */ 49 | int __low_level_init(void) { 50 | wdt_disable(); 51 | clock_enable(); 52 | SystemInit(); 53 | // trace_clk_init(); 54 | 55 | return 1; 56 | } 57 | -------------------------------------------------------------------------------- /Example/Freescale/Kinetis/K70F_lwIP/httpserver-netconn.c: -------------------------------------------------------------------------------- 1 | #include "lwip/def.h" 2 | #include "lwip/api.h" 3 | 4 | #if LWIP_NETCONN 5 | 6 | #define TASK_HTTP_STACK_SIZE 800 7 | #define TASK_HTTP_PRIO 5 8 | 9 | const static char http_html_hdr[] = "HTTP/1.1 200 OK\r\nContent-type: text/html\r\n\r\n"; 10 | const static char http_index_html[] = "Congrats!

This is Coocox OS LwIP demo !

More information at www.coocox.org"; 11 | 12 | /** HTTP server process function. 13 | */ 14 | static void http_process(struct netconn *conn) { 15 | struct netbuf *inbuf; 16 | char *buf; 17 | u16_t len; 18 | 19 | /* Read the data from the port, blocking if nothing yet there. 20 | We assume the request (the part we care about) is in one netbuf */ 21 | if (ERR_OK == netconn_recv(conn, &inbuf)) { 22 | netbuf_data(inbuf, (void **)&buf, &len); 23 | 24 | /* Is this an HTTP GET command? (only check the first 5 chars, since 25 | there are other formats for GET, and we're keeping it very simple )*/ 26 | if (5 <= len && buf[0] == 'G' && buf[1] == 'E' && buf[2] == 'T' && buf[3] == ' ' && buf[4] == '/') { 27 | /* Send the HTML header 28 | * subtract 1 from the size, since we dont send the \0 in the string 29 | * NETCONN_NOCOPY: our data is const static, so no need to copy it 30 | */ 31 | netconn_write(conn, http_html_hdr, sizeof(http_html_hdr) - 1, NETCONN_NOCOPY); 32 | 33 | /* Send our HTML page */ 34 | netconn_write(conn, http_index_html, sizeof(http_index_html) - 1, NETCONN_NOCOPY); 35 | } 36 | } 37 | 38 | /* Close the connection (server closes in HTTP) */ 39 | netconn_close(conn); 40 | 41 | /* Delete the buffer (netconn_recv gives us ownership, 42 | so we have to make sure to deallocate the buffer) */ 43 | netbuf_delete(inbuf); 44 | } 45 | 46 | /** HTTP server task. 47 | */ 48 | static void http_server(void *pdata) { 49 | struct netconn *conn, *newconn; 50 | 51 | /* Create a new TCP connection handle */ 52 | conn = netconn_new(NETCONN_TCP); 53 | LWIP_ERROR("http_server: invalid conn", (conn != NULL), return;); 54 | 55 | /* Bind to port 80 (HTTP) with default IP address */ 56 | netconn_bind(conn, NULL, 80); 57 | 58 | /* Put the connection into LISTEN state */ 59 | netconn_listen(conn); 60 | 61 | while (1) { 62 | netconn_accept(conn, &newconn); 63 | http_process(newconn); 64 | netconn_delete(newconn); 65 | } 66 | } 67 | 68 | /** Initialize and start HTTP server. 69 | */ 70 | int http_init(void) { 71 | sys_thread_t err; 72 | 73 | err = sys_thread_new(NULL, 74 | http_server, 75 | NULL, 76 | TASK_HTTP_STACK_SIZE, 77 | TASK_HTTP_PRIO); 78 | 79 | if (E_CREATE_FAIL == err) { 80 | return -1; 81 | } 82 | 83 | return 0; 84 | } 85 | 86 | #endif /* LWIP_NETCONN*/ 87 | -------------------------------------------------------------------------------- /Example/Freescale/Kinetis/K70F_lwIP/main.c: -------------------------------------------------------------------------------- 1 | /** 2 | * @file main.c 3 | * @date 18. Aug 2013 4 | * @brief lwIP demonstration - simple web server on TWR-K60N512 board 5 | * 6 | */ 7 | 8 | #include "coos.h" 9 | 10 | #include "lwip/def.h" 11 | #include "lwip/mem.h" 12 | #include "lwip/tcpip.h" 13 | #include "lwip/api.h" 14 | 15 | 16 | struct netif *macnet_netif; 17 | struct netif *loop_netif; 18 | 19 | int http_init(void); 20 | 21 | static void lwip_init(void) { 22 | struct ip_addr ipaddr, netmask, gw; 23 | extern err_t ethernetif_init( struct netif *netif ); 24 | 25 | tcpip_init(NULL, NULL); 26 | 27 | macnet_netif = mem_malloc(sizeof(struct netif)); 28 | 29 | IP4_ADDR(&gw, 192,168,1,1); 30 | IP4_ADDR(&ipaddr, 192,168,1,100); 31 | IP4_ADDR(&netmask, 255,255,255,0); 32 | 33 | netif_set_default(netif_add(macnet_netif, &ipaddr, &netmask, &gw, NULL, ethernetif_init, tcpip_input)); 34 | netif_set_up(macnet_netif); 35 | } 36 | 37 | int main(void) { 38 | CoInitOS(); 39 | lwip_init(); 40 | http_init(); 41 | CoStartOS(); 42 | 43 | while(1); 44 | } 45 | 46 | -------------------------------------------------------------------------------- /Example/Freescale/Kinetis/cmsis/system_MK60D.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************//** 2 | * @file system_MK60D.h 3 | * @brief CMSIS Cortex-M4 Device Peripheral Access Layer Header File for 4 | * Device MK60Dxxx 5 | * @version V3.01 6 | * @date 06. March 2012 7 | * 8 | * @note 9 | * 10 | * @par 11 | * ARM Limited (ARM) is supplying this software for use with Cortex-M 12 | * processor based microcontrollers. This file can be freely distributed 13 | * within development tools that are supporting such ARM based processors. 14 | * 15 | * @par 16 | * THIS SOFTWARE IS PROVIDED "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED 17 | * OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. 19 | * ARM SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR 20 | * CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER. 21 | * 22 | ******************************************************************************/ 23 | 24 | 25 | #ifndef SYSTEM_MK60D_H 26 | #define SYSTEM_MK60D_H 27 | 28 | #ifdef __cplusplus 29 | extern "C" { 30 | #endif 31 | 32 | #include 33 | 34 | extern uint32_t SystemCoreClock; /*!< System Clock Frequency (Core Clock) */ 35 | 36 | 37 | /** 38 | * Initialize the system 39 | * 40 | * @param none 41 | * @return none 42 | * 43 | * @brief Setup the microcontroller system. 44 | * Initialize the System and update the SystemCoreClock variable. 45 | */ 46 | extern void SystemInit (void); 47 | 48 | /** 49 | * Update SystemCoreClock variable 50 | * 51 | * @param none 52 | * @return none 53 | * 54 | * @brief Updates the SystemCoreClock with current core Clock 55 | * retrieved from cpu registers. 56 | */ 57 | extern void SystemCoreClockUpdate (void); 58 | 59 | #ifdef __cplusplus 60 | } 61 | #endif 62 | 63 | #endif /* SYSTEM_MK60D_H */ 64 | -------------------------------------------------------------------------------- /Example/Freescale/Kinetis/cmsis/system_MK70F.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************//** 2 | * @file system_MK70F.h 3 | * @brief CMSIS Cortex-M4 Device Peripheral Access Layer Header File for 4 | * Device MK70Fxxx 5 | * @version 6 | * @date 18. Aug 2013 7 | * 8 | * @note 9 | * 10 | * @par 11 | * ARM Limited (ARM) is supplying this software for use with Cortex-M 12 | * processor based microcontrollers. This file can be freely distributed 13 | * within development tools that are supporting such ARM based processors. 14 | * 15 | * @par 16 | * THIS SOFTWARE IS PROVIDED "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED 17 | * OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. 19 | * ARM SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR 20 | * CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER. 21 | * 22 | ******************************************************************************/ 23 | 24 | 25 | #ifndef SYSTEM_MK70F_H 26 | #define SYSTEM_MK70F_H 27 | 28 | #ifdef __cplusplus 29 | extern "C" { 30 | #endif 31 | 32 | #include 33 | 34 | extern uint32_t SystemCoreClock; /*!< System Clock Frequency (Core Clock) */ 35 | 36 | 37 | /** 38 | * Initialize the system 39 | * 40 | * @param none 41 | * @return none 42 | * 43 | * @brief Setup the microcontroller system. 44 | * Initialize the System and update the SystemCoreClock variable. 45 | */ 46 | extern void SystemInit (void); 47 | 48 | /** 49 | * Update SystemCoreClock variable 50 | * 51 | * @param none 52 | * @return none 53 | * 54 | * @brief Updates the SystemCoreClock with current core Clock 55 | * retrieved from cpu registers. 56 | */ 57 | extern void SystemCoreClockUpdate (void); 58 | 59 | #ifdef __cplusplus 60 | } 61 | #endif 62 | 63 | #endif /* SYSTEM_MK70F_H */ 64 | -------------------------------------------------------------------------------- /Example/Freescale/Kinetis/lwip_port/arch/perf.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001-2003 Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, 6 | * are permitted provided that the following conditions are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 3. The name of the author may not be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 19 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 21 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 24 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 25 | * OF SUCH DAMAGE. 26 | * 27 | * This file is part of the lwIP TCP/IP stack. 28 | * 29 | * Author: Adam Dunkels 30 | * 31 | */ 32 | #ifndef __PERF_H__ 33 | #define __PERF_H__ 34 | 35 | #define PERF_START /* null definition */ 36 | #define PERF_STOP(x) /* null definition */ 37 | 38 | #endif /* __PERF_H__ */ 39 | -------------------------------------------------------------------------------- /Example/Freescale/Kinetis/lwip_port/arch/sys_arch.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001-2003 Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, 6 | * are permitted provided that the following conditions are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 3. The name of the author may not be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 19 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 21 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 24 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 25 | * OF SUCH DAMAGE. 26 | * 27 | * This file is part of the lwIP TCP/IP stack. 28 | * 29 | * Author: Adam Dunkels 30 | * 31 | */ 32 | #ifndef __SYS_RTXC_H__ 33 | #define __SYS_RTXC_H__ 34 | 35 | #include "COOS.h" 36 | #include "ostask.h" 37 | #include "osqueue.h" 38 | 39 | #define SYS_MBOX_NULL (OS_EventID) - 1 40 | #define SYS_SEM_NULL (OS_EventID) - 1 41 | 42 | typedef OS_EventID sys_sem_t; 43 | typedef OS_EventID sys_mbox_t; 44 | typedef OS_TID sys_thread_t; 45 | typedef u32_t sys_prot_t; 46 | 47 | #define LWIP_TASK_MAX 3 48 | #define LWIP_START_PRIO 3 49 | 50 | #define LWIP_MAX_QUEUE 10 51 | #define LWIP_SIZE_QUEUE 10 52 | 53 | #define OS_SEM_MAX_STATE 0xFFFF 54 | 55 | #endif /* __SYS_RTXC_H__ */ 56 | 57 | -------------------------------------------------------------------------------- /Example/Freescale/Kinetis/lwip_port/ethernetif.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file ethernetif.h 3 | * @brief Ethernet interface 4 | * 5 | */ 6 | 7 | #ifndef _ETHERNETIF_H_ 8 | #define _ETHERNETIF_H_ 9 | 10 | 11 | #endif /* _ETHERNETIF_H_ */ 12 | -------------------------------------------------------------------------------- /Example/Freescale/Kinetis/twrk60n512.eww: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | $WS_DIR$\K60D_blink\IAR\blink_twrk60n512.ewp 6 | 7 | 8 | $WS_DIR$\K60D_lwIP\IAR\lwip_twrk60n512.ewp 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /Example/Freescale/Kinetis/twrk70f120.eww: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | $WS_DIR$\K70F_blink\IAR\blink_twrk70f120.ewp 6 | 7 | 8 | $WS_DIR$\K70F_fpu\IAR\fpu_twrk70f120.ewp 9 | 10 | 11 | $WS_DIR$\K70F_lwIP\IAR\lwip_twrk70f120.ewp 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /Example/Holteck/HT32F125x/readme.txt: -------------------------------------------------------------------------------- 1 | Add a example here! -------------------------------------------------------------------------------- /Example/Holteck/HT32F175x/readme.txt: -------------------------------------------------------------------------------- 1 | Add a example here! -------------------------------------------------------------------------------- /Example/Holteck/HT32F275x/readme.txt: -------------------------------------------------------------------------------- 1 | Add a example here! -------------------------------------------------------------------------------- /Example/NXP/LPC11C1x/readme.txt: -------------------------------------------------------------------------------- 1 | Add a example here! -------------------------------------------------------------------------------- /Example/NXP/LPC11xx/readme.txt: -------------------------------------------------------------------------------- 1 | Add a example here! -------------------------------------------------------------------------------- /Example/NXP/LPC13xx/readme.txt: -------------------------------------------------------------------------------- 1 | Add a example here! -------------------------------------------------------------------------------- /Example/NXP/LPC17xx/readme.txt: -------------------------------------------------------------------------------- 1 | Add a example here! -------------------------------------------------------------------------------- /Example/Nuvoton/NUC122/readme.txt: -------------------------------------------------------------------------------- 1 | Add a example here! -------------------------------------------------------------------------------- /Example/Nuvoton/NUC1xx/readme.txt: -------------------------------------------------------------------------------- 1 | Add a example here! -------------------------------------------------------------------------------- /Example/Nuvoton/NUCM051/readme.txt: -------------------------------------------------------------------------------- 1 | Add a example here! -------------------------------------------------------------------------------- /Example/Nuvoton/NUCMini51/readme.txt: -------------------------------------------------------------------------------- 1 | Add a example here! -------------------------------------------------------------------------------- /Example/ST/STM32F1xx/BSPLIB/inc/cortexm3_macro.h: -------------------------------------------------------------------------------- 1 | /******************** (C) COPYRIGHT 2007 STMicroelectronics ******************** 2 | * File Name : cortexm3_macro.h 3 | * Author : MCD Application Team 4 | * Date First Issued : 09/29/2006 5 | * Description : Header file for cortexm3_macro.s. 6 | ******************************************************************************** 7 | * History: 8 | * 05/21/2007: V0.3 9 | * 04/02/2007: V0.2 10 | * 02/05/2007: V0.1 11 | * 09/29/2006: V0.01 12 | ******************************************************************************** 13 | * THE PRESENT SOFTWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS 14 | * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME. 15 | * AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT, 16 | * INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE 17 | * CONTENT OF SUCH SOFTWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING 18 | * INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. 19 | *******************************************************************************/ 20 | 21 | /* Define to prevent recursive inclusion -------------------------------------*/ 22 | #ifndef __CORTEXM3_MACRO_H 23 | #define __CORTEXM3_MACRO_H 24 | 25 | /* Includes ------------------------------------------------------------------*/ 26 | #include "stm32f10x_type.h" 27 | 28 | /* Exported types ------------------------------------------------------------*/ 29 | /* Exported constants --------------------------------------------------------*/ 30 | /* Exported macro ------------------------------------------------------------*/ 31 | /* Exported functions ------------------------------------------------------- */ 32 | void __WFI(void); 33 | void __WFE(void); 34 | void __SEV(void); 35 | void __ISB(void); 36 | void __DSB(void); 37 | void __DMB(void); 38 | void __SVC(void); 39 | u32 __MRS_CONTROL(void); 40 | void __MSR_CONTROL(u32 Control); 41 | u32 __MRS_PSP(void); 42 | void __MSR_PSP(u32 TopOfProcessStack); 43 | u32 __MRS_MSP(void); 44 | void __MSR_MSP(u32 TopOfMainStack); 45 | void __SETPRIMASK(void); 46 | void __RESETPRIMASK(void); 47 | void __SETFAULTMASK(void); 48 | void __RESETFAULTMASK(void); 49 | void __BASEPRICONFIG(u32 NewPriority); 50 | u32 __GetBASEPRI(void); 51 | u16 __REV_HalfWord(u16 Data); 52 | u32 __REV_Word(u32 Data); 53 | 54 | #endif /* __CORTEXM3_MACRO_H */ 55 | 56 | /******************* (C) COPYRIGHT 2007 STMicroelectronics *****END OF FILE****/ 57 | -------------------------------------------------------------------------------- /Example/ST/STM32F1xx/BSPLIB/inc/stm32f10x_crc.h: -------------------------------------------------------------------------------- 1 | /******************** (C) COPYRIGHT 2008 STMicroelectronics ******************** 2 | * File Name : stm32f10x_crc.h 3 | * Author : MCD Application Team 4 | * Version : V2.0.1 5 | * Date : 06/13/2008 6 | * Description : This file contains all the functions prototypes for the 7 | * CRC firmware library. 8 | ******************************************************************************** 9 | * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS 10 | * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME. 11 | * AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT, 12 | * INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE 13 | * CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING 14 | * INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. 15 | *******************************************************************************/ 16 | 17 | /* Define to prevent recursive inclusion -------------------------------------*/ 18 | #ifndef __STM32F10x_CRC_H 19 | #define __STM32F10x_CRC_H 20 | 21 | /* Includes ------------------------------------------------------------------*/ 22 | #include "stm32f10x_map.h" 23 | 24 | /* Exported types ------------------------------------------------------------*/ 25 | /* Exported constants --------------------------------------------------------*/ 26 | /* Exported macro ------------------------------------------------------------*/ 27 | /* Exported functions ------------------------------------------------------- */ 28 | void CRC_ResetDR(void); 29 | u32 CRC_CalcCRC(u32 Data); 30 | u32 CRC_CalcBlockCRC(u32 pBuffer[], u32 BufferLength); 31 | u32 CRC_GetCRC(void); 32 | void CRC_SetIDRegister(u8 IDValue); 33 | u8 CRC_GetIDRegister(void); 34 | 35 | #endif /* __STM32F10x_CRC_H */ 36 | 37 | /******************* (C) COPYRIGHT 2008 STMicroelectronics *****END OF FILE****/ 38 | -------------------------------------------------------------------------------- /Example/ST/STM32F1xx/BSPLIB/inc/stm32f10x_dbgmcu.h: -------------------------------------------------------------------------------- 1 | /******************** (C) COPYRIGHT 2008 STMicroelectronics ******************** 2 | * File Name : stm32f10x_dbgmcu.h 3 | * Author : MCD Application Team 4 | * Version : V2.0.1 5 | * Date : 06/13/2008 6 | * Description : This file contains all the functions prototypes for the 7 | * DBGMCU firmware library. 8 | ******************************************************************************** 9 | * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS 10 | * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME. 11 | * AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT, 12 | * INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE 13 | * CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING 14 | * INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. 15 | *******************************************************************************/ 16 | 17 | /* Define to prevent recursive inclusion -------------------------------------*/ 18 | #ifndef __STM32F10x_DBGMCU_H 19 | #define __STM32F10x_DBGMCU_H 20 | 21 | /* Includes ------------------------------------------------------------------*/ 22 | #include "stm32f10x_map.h" 23 | 24 | /* Exported types ------------------------------------------------------------*/ 25 | /* Exported constants --------------------------------------------------------*/ 26 | #define DBGMCU_SLEEP ((u32)0x00000001) 27 | #define DBGMCU_STOP ((u32)0x00000002) 28 | #define DBGMCU_STANDBY ((u32)0x00000004) 29 | #define DBGMCU_IWDG_STOP ((u32)0x00000100) 30 | #define DBGMCU_WWDG_STOP ((u32)0x00000200) 31 | #define DBGMCU_TIM1_STOP ((u32)0x00000400) 32 | #define DBGMCU_TIM2_STOP ((u32)0x00000800) 33 | #define DBGMCU_TIM3_STOP ((u32)0x00001000) 34 | #define DBGMCU_TIM4_STOP ((u32)0x00002000) 35 | #define DBGMCU_CAN_STOP ((u32)0x00004000) 36 | #define DBGMCU_I2C1_SMBUS_TIMEOUT ((u32)0x00008000) 37 | #define DBGMCU_I2C2_SMBUS_TIMEOUT ((u32)0x00010000) 38 | #define DBGMCU_TIM5_STOP ((u32)0x00020000) 39 | #define DBGMCU_TIM6_STOP ((u32)0x00040000) 40 | #define DBGMCU_TIM7_STOP ((u32)0x00080000) 41 | #define DBGMCU_TIM8_STOP ((u32)0x00100000) 42 | 43 | #define IS_DBGMCU_PERIPH(PERIPH) ((((PERIPH) & 0xFFE000F8) == 0x00) && ((PERIPH) != 0x00)) 44 | 45 | /* Exported macro ------------------------------------------------------------*/ 46 | /* Exported functions ------------------------------------------------------- */ 47 | u32 DBGMCU_GetREVID(void); 48 | u32 DBGMCU_GetDEVID(void); 49 | void DBGMCU_Config(u32 DBGMCU_Periph, FunctionalState NewState); 50 | 51 | #endif /* __STM32F10x_DBGMCU_H */ 52 | 53 | /******************* (C) COPYRIGHT 2008 STMicroelectronics *****END OF FILE****/ 54 | 55 | 56 | -------------------------------------------------------------------------------- /Example/ST/STM32F1xx/BSPLIB/inc/stm32f10x_wwdg.h: -------------------------------------------------------------------------------- 1 | /******************** (C) COPYRIGHT 2007 STMicroelectronics ******************** 2 | * File Name : stm32f10x_wwdg.h 3 | * Author : MCD Application Team 4 | * Date First Issued : 09/29/2006 5 | * Description : This file contains all the functions prototypes for the 6 | * WWDG firmware library. 7 | ******************************************************************************** 8 | * History: 9 | * 05/21/2007: V0.3 10 | * 04/02/2007: V0.2 11 | * 02/05/2007: V0.1 12 | * 09/29/2006: V0.01 13 | ******************************************************************************** 14 | * THE PRESENT SOFTWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS 15 | * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME. 16 | * AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT, 17 | * INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE 18 | * CONTENT OF SUCH SOFTWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING 19 | * INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. 20 | *******************************************************************************/ 21 | 22 | /* Define to prevent recursive inclusion -------------------------------------*/ 23 | #ifndef __STM32F10x_WWDG_H 24 | #define __STM32F10x_WWDG_H 25 | 26 | /* Includes ------------------------------------------------------------------*/ 27 | #include "stm32f10x_map.h" 28 | 29 | /* Exported types ------------------------------------------------------------*/ 30 | /* Exported constants --------------------------------------------------------*/ 31 | /* WWDG Prescaler */ 32 | #define WWDG_Prescaler_1 ((u32)0x00000000) 33 | #define WWDG_Prescaler_2 ((u32)0x00000080) 34 | #define WWDG_Prescaler_4 ((u32)0x00000100) 35 | #define WWDG_Prescaler_8 ((u32)0x00000180) 36 | 37 | #define IS_WWDG_PRESCALER(PRESCALER) ((PRESCALER == WWDG_Prescaler_1) || \ 38 | (PRESCALER == WWDG_Prescaler_2) || \ 39 | (PRESCALER == WWDG_Prescaler_4) || \ 40 | (PRESCALER == WWDG_Prescaler_8)) 41 | 42 | #define IS_WWDG_WINDOW_VALUE(VALUE) (VALUE <= 0x7F) 43 | 44 | #define IS_WWDG_COUNTER(COUNTER) ((COUNTER >= 0x40) && (COUNTER <= 0x7F)) 45 | 46 | /* Exported macro ------------------------------------------------------------*/ 47 | /* Exported functions ------------------------------------------------------- */ 48 | void WWDG_DeInit(void); 49 | void WWDG_SetPrescaler(u32 WWDG_Prescaler); 50 | void WWDG_SetWindowValue(u8 WindowValue); 51 | void WWDG_EnableIT(void); 52 | void WWDG_SetCounter(u8 Counter); 53 | void WWDG_Enable(u8 Counter); 54 | FlagStatus WWDG_GetFlagStatus(void); 55 | void WWDG_ClearFlag(void); 56 | 57 | #endif /* __STM32F10x_WWDG_H */ 58 | 59 | /******************* (C) COPYRIGHT 2007 STMicroelectronics *****END OF FILE****/ 60 | -------------------------------------------------------------------------------- /Example/ST/STM32F1xx/BSPLIB/src/stm32f10x_adc.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coocox/CoOS/fa559450993a716fa5c4d99213f9f4d38ba6525d/Example/ST/STM32F1xx/BSPLIB/src/stm32f10x_adc.c -------------------------------------------------------------------------------- /Example/ST/STM32F1xx/BSPLIB/src/stm32f10x_exti.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coocox/CoOS/fa559450993a716fa5c4d99213f9f4d38ba6525d/Example/ST/STM32F1xx/BSPLIB/src/stm32f10x_exti.c -------------------------------------------------------------------------------- /Example/ST/STM32F1xx/BSPLIB/src/stm32f10x_nvic.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coocox/CoOS/fa559450993a716fa5c4d99213f9f4d38ba6525d/Example/ST/STM32F1xx/BSPLIB/src/stm32f10x_nvic.c -------------------------------------------------------------------------------- /Example/ST/STM32F1xx/BSPLIB/src/stm32f10x_rcc.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coocox/CoOS/fa559450993a716fa5c4d99213f9f4d38ba6525d/Example/ST/STM32F1xx/BSPLIB/src/stm32f10x_rcc.c -------------------------------------------------------------------------------- /Example/ST/STM32F1xx/BSPLIB/src/stm32f10x_rtc.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coocox/CoOS/fa559450993a716fa5c4d99213f9f4d38ba6525d/Example/ST/STM32F1xx/BSPLIB/src/stm32f10x_rtc.c -------------------------------------------------------------------------------- /Example/ST/STM32F1xx/BSPLIB/src/stm32f10x_usart.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coocox/CoOS/fa559450993a716fa5c4d99213f9f4d38ba6525d/Example/ST/STM32F1xx/BSPLIB/src/stm32f10x_usart.c -------------------------------------------------------------------------------- /Example/ST/STM32F1xx/STM32F103RB_CoOS/IAR/APP/AppConfig.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _APP_CONFIG_H 3 | #define _APP_CONFIG_H 4 | 5 | #include "stm32f10x_lib.h" 6 | 7 | 8 | //#define OS_EVT U16 9 | 10 | void RCC_Configuration (void); 11 | void GPIO_Configuration (void); 12 | void UART_Configuration (void); 13 | void LCD_Configuration (void); 14 | void ADC_Configuration (void); 15 | void RTC_Configuration (void); 16 | void EXIT_Configuration (void); 17 | void NVIC_Configuration (void); 18 | void SysTick_Configuration (void); 19 | 20 | void DisableRTCInterrupt(void); 21 | void EnableRTCInterrupt (void); 22 | 23 | void uart_printf (char *ptr); 24 | void uart_print_hex (unsigned int dat,char ct); 25 | 26 | 27 | extern void lcd_init (void); 28 | extern void lcd_clear (void); 29 | extern void lcd_putchar (char c); 30 | extern void set_cursor (int column, int line); 31 | extern void lcd_print (char *string); 32 | extern void lcd_bargraph (int value, int size); 33 | extern void lcd_bargraphXY (int pos_x, int pos_y, int value); 34 | 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /Example/ST/STM32F1xx/STM32F103RB_CoOS/IAR/Project/CoOsDemo.eww: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | $WS_DIR$\CoOsDemo.ewp 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Example/ST/STM32F1xx/STM32F103RB_CoOS/IAR/Project/CoOsDemo.icf: -------------------------------------------------------------------------------- 1 | /*###ICF### Section handled by ICF editor, don't touch! ****/ 2 | /*-Editor annotation file-*/ 3 | /* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */ 4 | /*-Specials-*/ 5 | define symbol __ICFEDIT_intvec_start__ = 0x08000000; 6 | /*-Memory Regions-*/ 7 | define symbol __ICFEDIT_region_ROM_start__ = 0x08000000; 8 | define symbol __ICFEDIT_region_ROM_end__ = 0x0801FFFF; 9 | define symbol __ICFEDIT_region_RAM_start__ = 0x20000000; 10 | define symbol __ICFEDIT_region_RAM_end__ = 0x20004FFF; 11 | /*-Sizes-*/ 12 | define symbol __ICFEDIT_size_cstack__ = 0x400; 13 | define symbol __ICFEDIT_size_heap__ = 0x200; 14 | /**** End of ICF editor section. ###ICF###*/ 15 | 16 | 17 | define memory mem with size = 4G; 18 | define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFEDIT_region_ROM_end__]; 19 | define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__]; 20 | 21 | define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { }; 22 | define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { }; 23 | 24 | initialize by copy { readwrite }; 25 | do not initialize { section .noinit }; 26 | 27 | place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec }; 28 | 29 | place in ROM_region { readonly }; 30 | place in RAM_region { readwrite, 31 | block CSTACK, block HEAP }; -------------------------------------------------------------------------------- /Example/ST/STM32F1xx/STM32F103RB_CoOS/IAR/Project/readme.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coocox/CoOS/fa559450993a716fa5c4d99213f9f4d38ba6525d/Example/ST/STM32F1xx/STM32F103RB_CoOS/IAR/Project/readme.txt -------------------------------------------------------------------------------- /Example/ST/STM32F1xx/STM32F103RB_CoOS/IAR/readme.txt: -------------------------------------------------------------------------------- 1 | 2 | App: Application source code 3 | CoOS: Coocox CoOS source code 4 | lib: Library source code 5 | Project: Makefile project -------------------------------------------------------------------------------- /Example/ST/STM32F1xx/STM32F103RB_CoOS/MDK/App/AppConfig.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | #ifndef _APP_CONFIG_H 4 | #define _APP_CONFIG_H 5 | 6 | #include "stm32f10x_lib.h" 7 | 8 | 9 | //#define OS_EVT U16 10 | 11 | void RCC_Configuration (void); 12 | void GPIO_Configuration (void); 13 | void UART_Configuration (void); 14 | void LCD_Configuration (void); 15 | void ADC_Configuration (void); 16 | void RTC_Configuration (void); 17 | void EXIT_Configuration (void); 18 | void NVIC_Configuration (void); 19 | void SysTick_Configuration (void); 20 | 21 | void DisableRTCInterrupt(void); 22 | void EnableRTCInterrupt (void); 23 | 24 | void uart_printf (char *ptr); 25 | void uart_print_hex (unsigned int dat,char ct); 26 | 27 | 28 | extern void lcd_init (void); 29 | extern void lcd_clear (void); 30 | extern void lcd_putchar (char c); 31 | extern void set_cursor (int column, int line); 32 | extern void lcd_print (char *string); 33 | extern void lcd_bargraph (int value, int size); 34 | extern void lcd_bargraphXY (int pos_x, int pos_y, int value); 35 | 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /Example/ST/STM32F1xx/STM32F103RB_CoOS/MDK/Project/readme.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coocox/CoOS/fa559450993a716fa5c4d99213f9f4d38ba6525d/Example/ST/STM32F1xx/STM32F103RB_CoOS/MDK/Project/readme.txt -------------------------------------------------------------------------------- /Example/ST/STM32F1xx/STM32F103RB_CoOS/MDK/readme.txt: -------------------------------------------------------------------------------- 1 | 2 | App: Application source code 3 | CoOS: Coocox CoOS source code 4 | lib: Library source code 5 | Project: Makefile project -------------------------------------------------------------------------------- /Example/ST/STM32F1xx/gen_coide_project.bat: -------------------------------------------------------------------------------- 1 | echo off 2 | 3 | set v_repo_root_self=..\..\.. 4 | if defined v_repo_root set v_repo_root_self=%v_repo_root% 5 | 6 | set v_gen_root=%v_repo_root_self%\Example\ST\STM32F1xx 7 | set v_coos_example=%v_repo_root_self%\Example\ST\STM32F1xx 8 | ::echo %v_repo_root_self% 9 | set v_iar2coide=%v_repo_root_self%\Tools\iar2coide\iar2coide.exe 10 | ::echo %v_iar2coide% 11 | 12 | echo -------------------------------------------- 13 | echo generate coide project in publish\example 14 | echo -------------------------------------------- 15 | echo clean project/coide/rvmdk/ewarm 16 | @for /r %v_gen_root% %%a in (.) do ( 17 | @if exist "%%a\coide_gen" rd /s /q "%%a\coide_gen" 18 | @if exist "%%a\Debug_Flash" rd /s /q "%%a\Debug_Flash" 19 | @if exist "%%a\Debug_Ram" rd /s /q "%%a\Debug_Ram" 20 | @if exist "%%a\ewarm\settings" rd /s /q "%%a\ewarm\settings" 21 | @if exist "%%a\Debug" rd /s /q "%%a\Debug" 22 | @if exist "%%a\Release" rd /s /q "%%a\Release" 23 | @if exist "%%a\*.dep" del /q "%%a\*.dep" 24 | @if exist "%%a\obj" rd /s /q "%%a\obj" 25 | @if exist "%%a\lst" rd /s /q "%%a\lst" 26 | @if exist "%%a\*.uvgui.*" del /q "%%a\*.uvgui.*" 27 | @if exist "%%a\*.uvopt" del /q "%%a\*.uvopt" 28 | @if exist "%%a\*.bak" del /q "%%a\*.bak" 29 | @if exist "%%a\*.o" del /q "%%a\*.o" 30 | @if exist "%%a\*.d" del /q "%%a\*.d" 31 | ) 32 | echo completed 33 | 34 | echo update \BSPLIB\src\startup\GCC to \resource\CoOS_Example 35 | copy %v_coos_example%\BSPLIB\src\startup\GCC\startup_stm32f10x_md.c %v_coos_example%\resource\CoOS_Example >>nul 36 | echo completed 37 | 38 | echo gen coide project 39 | %v_iar2coide% -w "%v_gen_root%" -t %v_coos_example%\resource\CoOS_Example >>nul 40 | echo completed 41 | 42 | echo -------------------------------------------- 43 | 44 | if not defined v_repo_root pause 45 | -------------------------------------------------------------------------------- /Example/ST/STM32F1xx/readme.txt: -------------------------------------------------------------------------------- 1 | BSPLIB : STM32F1xx lib 2 | STM32F103RB_CoOS : a example 3 | resource : file use for CoIDE 4 | gen_coide_project.bat : use to gen coide project -------------------------------------------------------------------------------- /Example/ST/STM32F1xx/resource/CoOS_Example/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | CoOS_Example 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.cdt.managedbuilder.core.genmakebuilder 10 | clean,full,incremental, 11 | 12 | 13 | ?name? 14 | 15 | 16 | 17 | org.eclipse.cdt.make.core.append_environment 18 | true 19 | 20 | 21 | org.eclipse.cdt.make.core.buildArguments 22 | 23 | 24 | 25 | org.eclipse.cdt.make.core.buildCommand 26 | make 27 | 28 | 29 | org.eclipse.cdt.make.core.contents 30 | org.eclipse.cdt.make.core.activeConfigSettings 31 | 32 | 33 | org.eclipse.cdt.make.core.enableAutoBuild 34 | false 35 | 36 | 37 | org.eclipse.cdt.make.core.enableCleanBuild 38 | true 39 | 40 | 41 | org.eclipse.cdt.make.core.enableFullBuild 42 | true 43 | 44 | 45 | org.eclipse.cdt.make.core.stopOnError 46 | true 47 | 48 | 49 | org.eclipse.cdt.make.core.useDefaultBuildCmd 50 | false 51 | 52 | 53 | 54 | 55 | org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder 56 | 57 | 58 | 59 | 60 | 61 | org.eclipse.cdt.core.cnature 62 | org.eclipse.cdt.managedbuilder.core.managedBuildNature 63 | org.eclipse.cdt.managedbuilder.core.ScannerConfigNature 64 | 65 | 66 | -------------------------------------------------------------------------------- /Example/ST/STM32F1xx/resource/CoOS_Example/.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Example/ST/STM32F1xx/resource/CoOS_Example/coide_gen.cob: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Example/ST/STM32F1xx/resource/CoOS_Example/debug.config: -------------------------------------------------------------------------------- 1 | # 2 | #Thu Apr 19 10:13:34 CST 2012 3 | org.coocox.codebugger.gdbjtag.core.debugMode=JTAG 4 | org.coocox.codebugger.gdbjtag.core.adapter=Colink 5 | org.coocox.codebugger.gdbjtag.core.jflashtool= 6 | org.coocox.codebugger.gdbjtag.corerunToMain=true 7 | org.coocox.codebugger.gdbjtag.core.resetMode=SYSRESETREQ 8 | org.coocox.codebugger.gdbjtag.coredebugInRam=false 9 | org.coocox.codebugger.gdbjtag.core.jlinkResetMode=Type 0\: Normal 10 | org.coocox.codebugger.gdbjtag.core.clockDiv=300K 11 | org.coocox.codebugger.gdbjtag.core.jlinkgdbserver= 12 | org.coocox.codebugger.gdbjtag.core.verify=true 13 | org.coocox.codebugger.gdbjtag.core.downloadFuction=Erase Effected 14 | org.coocox.codebugger.gdbjtag.core.autoDownload=true 15 | org.coocox.codebugger.gdbjtag.core.targetEndianess=0 16 | org.coocox.codebugger.gdbjtag.core.userDefineGDBScript= 17 | org.coocox.codebugger.gdbjtag.core.ifSemihost=false 18 | org.coocox.codebugger.gdbjtag.core.jflashscript= 19 | org.coocox.codebugger.gdbjtag.core.defaultAlgorithm=D\:/CooCox/CoIDE/flash/STM32F10x_MD_128.elf 20 | org.coocox.codebugger.gdbjtag.core.ifCacheRom=true 21 | -------------------------------------------------------------------------------- /Example/ST/STM32F1xx/resource/CoOS_Example/link.ld: -------------------------------------------------------------------------------- 1 | OUTPUT_FORMAT ("elf32-littlearm", "elf32-bigarm", "elf32-littlearm") 2 | SEARCH_DIR(.) 3 | INCLUDE "memory.ld" 4 | 5 | /* Section Definitions */ 6 | SECTIONS 7 | { 8 | .text : 9 | { 10 | KEEP(*(.isr_vector .isr_vector.*)) 11 | *(.text .text.* .gnu.linkonce.t.*) 12 | *(.glue_7t) *(.glue_7) 13 | *(.rodata .rodata* .gnu.linkonce.r.*) 14 | } > rom 15 | 16 | .ARM.extab : 17 | { 18 | *(.ARM.extab* .gnu.linkonce.armextab.*) 19 | } > rom 20 | 21 | __exidx_start = .; 22 | .ARM.exidx : 23 | { 24 | *(.ARM.exidx* .gnu.linkonce.armexidx.*) 25 | } > rom 26 | __exidx_end = .; 27 | 28 | . = ALIGN(4); 29 | _etext = .; 30 | _sidata = .; 31 | 32 | .data : AT (_etext) 33 | { 34 | _sdata = .; 35 | *(.data .data.*) 36 | . = ALIGN(4); 37 | _edata = . ; 38 | } > ram 39 | 40 | /* .bss section which is used for uninitialized data */ 41 | .bss (NOLOAD) : 42 | { 43 | _sbss = . ; 44 | *(.bss .bss.*) 45 | *(COMMON) 46 | . = ALIGN(4); 47 | _ebss = . ; 48 | } > ram 49 | 50 | /* stack section */ 51 | .co_stack (NOLOAD): 52 | { 53 | . = ALIGN(8); 54 | *(.co_stack .co_stack.*) 55 | } > ram 56 | 57 | . = ALIGN(4); 58 | 59 | _end = . ; 60 | } -------------------------------------------------------------------------------- /Example/ST/STM32F1xx/resource/CoOS_Example/memory.ld: -------------------------------------------------------------------------------- 1 | /** 2 | ******************************************************************* 3 | * Chip: STM32F103RB 4 | * NOTE: This file is generated by CoIDE and Included by link.ld 5 | * It is used to describe which memory regions may be used 6 | * by the linker. 7 | ******************************************************************* 8 | * Internal memory map 9 | * Region Start Size 10 | * flash0 0x08000000 0x00020000 11 | * sram0 0x20000000 0x00005000 12 | ******************************************************************* 13 | */ 14 | 15 | MEMORY 16 | { 17 | rom (rx) : ORIGIN = 0x08000000, LENGTH = 0x00020000 18 | ram (rwx) : ORIGIN = 0x20000000, LENGTH = 0x00005000 19 | } 20 | 21 | _eram = 0x20000000 + 0x00005000; -------------------------------------------------------------------------------- /Example/ST/STM32F1xx/resource/CoOS_Example/syscalls/syscalls.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************//***** 2 | * @file stdio.c 3 | * @brief Implementation of newlib syscall 4 | ********************************************************************************/ 5 | 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | #undef errno 12 | extern int errno; 13 | extern int _end; 14 | 15 | caddr_t _sbrk ( int incr ) 16 | { 17 | static unsigned char *heap = NULL; 18 | unsigned char *prev_heap; 19 | 20 | if (heap == NULL) { 21 | heap = (unsigned char *)&_end; 22 | } 23 | prev_heap = heap; 24 | 25 | heap += incr; 26 | 27 | return (caddr_t) prev_heap; 28 | } 29 | 30 | int link(char *old, char *new) { 31 | return -1; 32 | } 33 | 34 | int _close(int file) 35 | { 36 | return -1; 37 | } 38 | 39 | int _fstat(int file, struct stat *st) 40 | { 41 | st->st_mode = S_IFCHR; 42 | return 0; 43 | } 44 | 45 | int _isatty(int file) 46 | { 47 | return 1; 48 | } 49 | 50 | int _lseek(int file, int ptr, int dir) 51 | { 52 | return 0; 53 | } 54 | 55 | int _read(int file, char *ptr, int len) 56 | { 57 | return 0; 58 | } 59 | 60 | int _write(int file, char *ptr, int len) 61 | { 62 | return len; 63 | } 64 | 65 | void abort(void) 66 | { 67 | /* Abort called */ 68 | while(1); 69 | } 70 | 71 | /* --------------------------------- End Of File ------------------------------ */ 72 | -------------------------------------------------------------------------------- /Example/TI/LM3S8000/readme.txt: -------------------------------------------------------------------------------- 1 | Add a example here! -------------------------------------------------------------------------------- /Example/TI/LM3S9000/readme.txt: -------------------------------------------------------------------------------- 1 | Add a example here! -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright Notice 2 | Any and all data, files, source code, html content and documentation included 3 | in the CoOS component distribution or available on this site are the exclusive 4 | property of CooCox. 5 | 6 | License Details 7 | CoOS component is free and open-source; it is licensed under the Berkeley 8 | Software Distribution (BSD) and can be used in commercial applications under 9 | this license. 10 | 11 | Copyright (c) 2011, CooCox 12 | All rights reserved. 13 | 14 | Redistribution and use in source and binary forms, with or without 15 | modification, are permitted provided that the following conditions are met: 16 | 17 | * Redistributions of source code must retain the above copyright notice, 18 | this list of conditions and the following disclaimer. 19 | * Redistributions in binary form must reproduce the above copyright 20 | notice, this list of conditions and the following disclaimer in the 21 | documentation and/or other materials provided with the distribution. 22 | * Neither the name of the nor the names of its contributors 23 | may be used to endorse or promote products derived from this software without 24 | specific prior written permission. 25 | 26 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 27 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 28 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 29 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 30 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 31 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 32 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 33 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 34 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 35 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 36 | POSSIBILITY OF SUCH DAMAGE. 37 | -------------------------------------------------------------------------------- /Test/suite1/src/readme.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coocox/CoOS/fa559450993a716fa5c4d99213f9f4d38ba6525d/Test/suite1/src/readme.txt -------------------------------------------------------------------------------- /Tools/iar2coide/iar2coide.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coocox/CoOS/fa559450993a716fa5c4d99213f9f4d38ba6525d/Tools/iar2coide/iar2coide.exe -------------------------------------------------------------------------------- /clean.bat: -------------------------------------------------------------------------------- 1 | settings@echo off 2 | 3 | echo ----------------------------------- 4 | echo clean project/coide_gen/rvmdk/ewarm 5 | @for /r . %%a in (.) do ( 6 | @if exist "%%a\coide_gen" rd /s /q "%%a\coide_gen" 7 | @if exist "%%a\Debug_Flash" rd /s /q "%%a\Debug_Flash" 8 | @if exist "%%a\Debug_Ram" rd /s /q "%%a\Debug_Ram" 9 | @if exist "%%a\Output" rd /s /q "%%a\Output" 10 | @if exist "%%a\Flash" rd /s /q "%%a\Flash" 11 | @if exist "%%a\Debug" rd /s /q "%%a\Debug" 12 | @if exist "%%a\settings" rd /s /q "%%a\settings" 13 | @if exist "%%a\ewarm\settings" rd /s /q "%%a\ewarm\settings" 14 | @if exist "%%a\Release" rd /s /q "%%a\Release" 15 | @if exist "%%a\*.dep" del /q "%%a\*.dep" 16 | @if exist "%%a\obj" rd /s /q "%%a\obj" 17 | @if exist "%%a\lst" rd /s /q "%%a\lst" 18 | @if exist "%%a\*.uvgui.*" del /q "%%a\*.uvgui.*" 19 | @if exist "%%a\*.bak" del /q "%%a\*.bak" 20 | @if exist "%%a\*.o" del /q "%%a\*.o" 21 | @if exist "%%a\*.d" del /q "%%a\*.d" 22 | ) 23 | @echo completed 24 | echo ----------------------------------- 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /setup.iss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coocox/CoOS/fa559450993a716fa5c4d99213f9f4d38ba6525d/setup.iss --------------------------------------------------------------------------------