├── README.md ├── __Previews ├── PCB.PcbDocPreview ├── PCB1.PcbDocPreview ├── PCB1.pcbPreview ├── Sheet1.SchDocPreview ├── Template_Pcb.PcbDocPreview └── Template_Sch.SchDocPreview ├── driver ├── dpinst-amd64.exe ├── dpinst-x86.exe └── driver.inf ├── hardware ├── PCB.PcbDoc └── Sch.PDF ├── img1.jpg ├── img2.jpg └── software ├── boards.txt ├── bootloaders └── roboard │ └── roboard-pro.hex ├── cores └── arduino │ ├── Arduino.h │ ├── CDC.cpp │ ├── Client.h │ ├── HardwareSerial.cpp │ ├── HardwareSerial.h │ ├── HardwareSerial0.cpp │ ├── HardwareSerial1.cpp │ ├── HardwareSerial2.cpp │ ├── HardwareSerial3.cpp │ ├── HardwareSerial_private.h │ ├── IPAddress.cpp │ ├── IPAddress.h │ ├── PluggableUSB.cpp │ ├── PluggableUSB.h │ ├── Print.cpp │ ├── Print.h │ ├── Printable.h │ ├── Server.h │ ├── Stream.cpp │ ├── Stream.h │ ├── Tone.cpp │ ├── USBAPI.h │ ├── USBCore.cpp │ ├── USBCore.h │ ├── USBDesc.h │ ├── Udp.h │ ├── WCharacter.h │ ├── WInterrupts.c │ ├── WMath.cpp │ ├── WString.cpp │ ├── WString.h │ ├── abi.cpp │ ├── binary.h │ ├── hooks.c │ ├── main.cpp │ ├── new.cpp │ ├── new.h │ ├── wiring.c │ ├── wiring_analog.c │ ├── wiring_digital.c │ ├── wiring_private.h │ ├── wiring_pulse.S │ ├── wiring_pulse.c │ └── wiring_shift.c ├── firmwares ├── arduinoISP │ └── readme.txt ├── atmegaxxu2 │ ├── Arduino-COMBINED-dfu-usbserial-atmega16u2-Mega2560-Rev3.hex │ ├── Arduino-COMBINED-dfu-usbserial-atmega16u2-MegaADK-Rev3.hex │ ├── Arduino-COMBINED-dfu-usbserial-atmega16u2-Uno-Rev3.hex │ ├── Genuino-COMBINED-dfu-usbserial-atmega16u2-Mega2560-R3.hex │ ├── Genuino-COMBINED-dfu-usbserial-atmega16u2-Uno-R3.hex │ ├── MEGA-dfu_and_usbserial_combined.hex │ ├── README.txt │ ├── UNO-dfu_and_usbserial_combined.hex │ ├── arduino-usbdfu │ │ ├── Arduino-usbdfu.c │ │ ├── Arduino-usbdfu.h │ │ ├── Board │ │ │ └── LEDs.h │ │ ├── Descriptors.c │ │ ├── Descriptors.h │ │ ├── makefile │ │ └── readme.txt │ └── arduino-usbserial │ │ ├── Arduino-usbserial-atmega16u2-Mega2560-Rev3.hex │ │ ├── Arduino-usbserial-atmega16u2-MegaADK-Rev3.hex │ │ ├── Arduino-usbserial-atmega16u2-Uno-Rev3.hex │ │ ├── Arduino-usbserial-mega.hex │ │ ├── Arduino-usbserial-uno.hex │ │ ├── Arduino-usbserial.c │ │ ├── Arduino-usbserial.h │ │ ├── Board │ │ └── LEDs.h │ │ ├── Descriptors.c │ │ ├── Descriptors.h │ │ ├── Genuino-usbserial-atmega16u2-Mega2560-R3.hex │ │ ├── Genuino-usbserial-atmega16u2-Uno-R3.hex │ │ ├── Lib │ │ └── LightweightRingBuff.h │ │ ├── makefile │ │ └── readme.txt └── wifishield │ ├── binary │ ├── wifiHD.elf │ ├── wifiHD.hex │ ├── wifiHD_2_1.elf │ ├── wifi_dnld.elf │ ├── wifi_dnld.hex │ └── wifi_dnld_2_1.elf │ ├── scripts │ ├── ArduinoWifiShield_upgrade.sh │ └── ArduinoWifiShield_upgrade_mac.sh │ ├── wifiHD │ ├── .cproject │ ├── .project │ ├── Release │ │ ├── wifiHD.elf │ │ └── wifiHD.hex │ ├── src │ │ ├── CONFIG │ │ │ ├── conf_access.h │ │ │ ├── conf_at45dbx.h │ │ │ ├── conf_ebi.h │ │ │ └── conf_sd_mmc_spi.h │ │ ├── SOFTWARE_FRAMEWORK │ │ │ ├── ASM │ │ │ │ └── trampoline.x │ │ │ ├── BOARDS │ │ │ │ ├── ARDUINO │ │ │ │ │ ├── arduino.h │ │ │ │ │ ├── led.c │ │ │ │ │ └── led.h │ │ │ │ ├── EVK1105 │ │ │ │ │ ├── evk1105.h │ │ │ │ │ ├── led.c │ │ │ │ │ └── led.h │ │ │ │ ├── board.h │ │ │ │ └── board.h.my │ │ │ ├── COMPONENTS │ │ │ │ ├── MEMORY │ │ │ │ │ └── DATA_FLASH │ │ │ │ │ │ └── AT45DBX │ │ │ │ │ │ ├── at45dbx.c │ │ │ │ │ │ ├── at45dbx.h │ │ │ │ │ │ ├── at45dbx_mem.c │ │ │ │ │ │ └── at45dbx_mem.h │ │ │ │ └── WIFI │ │ │ │ │ └── HD │ │ │ │ │ ├── v2.7.0 │ │ │ │ │ ├── UCR1 │ │ │ │ │ │ └── GCC │ │ │ │ │ │ │ ├── lib_ucr1_hd_sdio_v2.7.0.a │ │ │ │ │ │ │ ├── lib_ucr1_hd_spi_v2.7.0.a │ │ │ │ │ │ │ └── lib_ucr1_hd_wl_sta_intwpa_v2.7.0.a │ │ │ │ │ ├── UCR2 │ │ │ │ │ │ └── GCC │ │ │ │ │ │ │ ├── lib_ucr2_hd_sdio_v2.7.0.a │ │ │ │ │ │ │ ├── lib_ucr2_hd_spi_v2.7.0.a │ │ │ │ │ │ │ └── lib_ucr2_hd_wl_sta_intwpa_v2.7.0.a │ │ │ │ │ └── revision.txt │ │ │ │ │ ├── wl_api.h │ │ │ │ │ ├── wl_fw.h │ │ │ │ │ ├── wl_os.h │ │ │ │ │ ├── wl_sdio.h │ │ │ │ │ ├── wl_spi.h │ │ │ │ │ └── wlap_api.h │ │ │ ├── DRIVERS │ │ │ │ ├── CPU │ │ │ │ │ └── CYCLE_COUNTER │ │ │ │ │ │ └── cycle_counter.h │ │ │ │ ├── EBI │ │ │ │ │ └── SMC │ │ │ │ │ │ ├── smc.c │ │ │ │ │ │ └── smc.h │ │ │ │ ├── EIC │ │ │ │ │ ├── eic.c │ │ │ │ │ └── eic.h │ │ │ │ ├── FLASHC │ │ │ │ │ ├── flashc.c │ │ │ │ │ └── flashc.h │ │ │ │ ├── GPIO │ │ │ │ │ ├── gpio.c │ │ │ │ │ └── gpio.h │ │ │ │ ├── INTC │ │ │ │ │ ├── exception.x │ │ │ │ │ ├── intc.c │ │ │ │ │ └── intc.h │ │ │ │ ├── PDCA │ │ │ │ │ ├── pdca.c │ │ │ │ │ └── pdca.h │ │ │ │ ├── PM │ │ │ │ │ ├── pm.c │ │ │ │ │ ├── pm.h │ │ │ │ │ ├── pm_conf_clocks.c │ │ │ │ │ ├── power_clocks_lib.c │ │ │ │ │ └── power_clocks_lib.h │ │ │ │ ├── RTC │ │ │ │ │ ├── rtc.c │ │ │ │ │ └── rtc.h │ │ │ │ ├── SPI │ │ │ │ │ ├── spi.c │ │ │ │ │ └── spi.h │ │ │ │ ├── TC │ │ │ │ │ ├── tc.c │ │ │ │ │ └── tc.h │ │ │ │ └── USART │ │ │ │ │ ├── usart.c │ │ │ │ │ └── usart.h │ │ │ ├── SERVICES │ │ │ │ ├── DELAY │ │ │ │ │ ├── delay.c │ │ │ │ │ └── delay.h │ │ │ │ ├── LWIP │ │ │ │ │ ├── lwip-1.3.2 │ │ │ │ │ │ └── src │ │ │ │ │ │ │ ├── core │ │ │ │ │ │ │ ├── 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 │ │ │ │ │ │ │ ├── stats.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 │ │ │ │ │ │ │ ├── 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 │ │ │ │ │ │ │ │ ├── tcpip.h │ │ │ │ │ │ │ │ └── udp.h │ │ │ │ │ │ │ └── netif │ │ │ │ │ │ │ │ ├── etharp.h │ │ │ │ │ │ │ │ ├── loopif.h │ │ │ │ │ │ │ │ ├── ppp_oe.h │ │ │ │ │ │ │ │ └── slipif.h │ │ │ │ │ │ │ └── netif │ │ │ │ │ │ │ ├── etharp.c │ │ │ │ │ │ │ └── loopif.c │ │ │ │ │ └── lwip-port-1.3.2 │ │ │ │ │ │ └── HD │ │ │ │ │ │ ├── if │ │ │ │ │ │ ├── include │ │ │ │ │ │ │ ├── arch │ │ │ │ │ │ │ │ ├── cc.h │ │ │ │ │ │ │ │ └── perf.h │ │ │ │ │ │ │ ├── lwipopts.h │ │ │ │ │ │ │ └── netif │ │ │ │ │ │ │ │ └── wlif.h │ │ │ │ │ │ └── netif │ │ │ │ │ │ │ └── wlif.c │ │ │ │ │ │ └── readme.txt │ │ │ │ └── MEMORY │ │ │ │ │ └── CTRL_ACCESS │ │ │ │ │ ├── ctrl_access.c │ │ │ │ │ └── ctrl_access.h │ │ │ └── UTILS │ │ │ │ ├── DEBUG │ │ │ │ ├── debug.c │ │ │ │ ├── debug.h │ │ │ │ ├── print_funcs.c │ │ │ │ └── print_funcs.h │ │ │ │ ├── LIBS │ │ │ │ └── NEWLIB_ADDONS │ │ │ │ │ ├── INCLUDE │ │ │ │ │ ├── nlao_cpu.h │ │ │ │ │ ├── nlao_exceptions.h │ │ │ │ │ ├── nlao_interrupts.h │ │ │ │ │ ├── nlao_io.h │ │ │ │ │ └── nlao_usart.h │ │ │ │ │ └── libnewlib_addons-at32ucr2-speed_opt.a │ │ │ │ ├── LINKER_SCRIPTS │ │ │ │ └── AT32UC3A │ │ │ │ │ ├── 1256 │ │ │ │ │ └── GCC │ │ │ │ │ │ └── link_uc3a1256.lds │ │ │ │ │ └── 0512 │ │ │ │ │ └── GCC │ │ │ │ │ └── link_uc3a0512.lds │ │ │ │ ├── PREPROCESSOR │ │ │ │ ├── mrepeat.h │ │ │ │ ├── preprocessor.h │ │ │ │ ├── stringz.h │ │ │ │ └── tpaste.h │ │ │ │ ├── STARTUP_FILES │ │ │ │ └── GCC │ │ │ │ │ └── crt0.x │ │ │ │ ├── compiler.h │ │ │ │ ├── conf_isp.h │ │ │ │ └── parts.h │ │ ├── ard_spi.c │ │ ├── ard_spi.h │ │ ├── ard_tcp.c │ │ ├── ard_tcp.h │ │ ├── ard_utils.c │ │ ├── ard_utils.h │ │ ├── avr32_spi.c │ │ ├── board_init.c │ │ ├── board_init.h │ │ ├── cmd_wl.c │ │ ├── cmd_wl.h │ │ ├── console.c │ │ ├── console.h │ │ ├── debug.h │ │ ├── fw_download.h │ │ ├── fw_download_extflash.c │ │ ├── license.txt │ │ ├── lwip_setup.c │ │ ├── lwip_setup.h │ │ ├── lwipopts.h │ │ ├── main.c │ │ ├── nvram.c │ │ ├── nvram.h │ │ ├── owl_os.c │ │ ├── ping.c │ │ ├── ping.h │ │ ├── printf-stdarg.c │ │ ├── printf-stdarg.h │ │ ├── timer.c │ │ ├── timer.h │ │ ├── top_defs.h │ │ ├── trace.h │ │ ├── util.c │ │ ├── util.h │ │ ├── wifi_spi.h │ │ ├── wl_cm.c │ │ ├── wl_cm.h │ │ └── wl_definitions.h │ └── wifiHD.cproj │ ├── wifi_dnld │ ├── .cproject │ ├── .project │ ├── Release │ │ └── wifi_dnld.elf │ ├── src │ │ ├── CONFIG │ │ │ ├── conf_access.h │ │ │ └── conf_at45dbx.h │ │ ├── Doc │ │ │ ├── SPB104 product brief.pdf │ │ │ └── gettingstarted.pdf │ │ ├── SOFTWARE_FRAMEWORK │ │ │ ├── ASM │ │ │ │ └── trampoline.x │ │ │ ├── BOARDS │ │ │ │ ├── ARDUINO │ │ │ │ │ ├── arduino.h │ │ │ │ │ ├── led.c │ │ │ │ │ └── led.h │ │ │ │ ├── EVK1105 │ │ │ │ │ ├── evk1105.h │ │ │ │ │ ├── led.c │ │ │ │ │ └── led.h │ │ │ │ ├── board.h │ │ │ │ └── board.h.ori │ │ │ ├── COMPONENTS │ │ │ │ └── MEMORY │ │ │ │ │ └── DATA_FLASH │ │ │ │ │ └── AT45DBX │ │ │ │ │ ├── at45dbx.c │ │ │ │ │ ├── at45dbx.h │ │ │ │ │ ├── at45dbx_mem.c │ │ │ │ │ └── at45dbx_mem.h │ │ │ ├── DRIVERS │ │ │ │ ├── FLASHC │ │ │ │ │ ├── flashc.c │ │ │ │ │ └── flashc.h │ │ │ │ ├── GPIO │ │ │ │ │ ├── gpio.c │ │ │ │ │ └── gpio.h │ │ │ │ ├── INTC │ │ │ │ │ ├── exception.x │ │ │ │ │ ├── intc.c │ │ │ │ │ └── intc.h │ │ │ │ ├── PM │ │ │ │ │ ├── pm.c │ │ │ │ │ ├── pm.h │ │ │ │ │ ├── pm_conf_clocks.c │ │ │ │ │ ├── power_clocks_lib.c │ │ │ │ │ └── power_clocks_lib.h │ │ │ │ ├── SPI │ │ │ │ │ ├── spi.c │ │ │ │ │ └── spi.h │ │ │ │ └── USART │ │ │ │ │ ├── usart.c │ │ │ │ │ └── usart.h │ │ │ ├── SERVICES │ │ │ │ └── MEMORY │ │ │ │ │ └── CTRL_ACCESS │ │ │ │ │ ├── ctrl_access.c │ │ │ │ │ └── ctrl_access.h │ │ │ └── UTILS │ │ │ │ ├── DEBUG │ │ │ │ ├── debug.c │ │ │ │ ├── debug.h │ │ │ │ ├── print_funcs.c │ │ │ │ └── print_funcs.h │ │ │ │ ├── LIBS │ │ │ │ └── NEWLIB_ADDONS │ │ │ │ │ ├── INCLUDE │ │ │ │ │ ├── nlao_cpu.h │ │ │ │ │ ├── nlao_exceptions.h │ │ │ │ │ ├── nlao_interrupts.h │ │ │ │ │ ├── nlao_io.h │ │ │ │ │ └── nlao_usart.h │ │ │ │ │ └── libnewlib_addons-at32ucr2-speed_opt.a │ │ │ │ ├── LINKER_SCRIPTS │ │ │ │ └── AT32UC3A │ │ │ │ │ ├── 1256 │ │ │ │ │ └── GCC │ │ │ │ │ │ └── link_uc3a1256.lds │ │ │ │ │ └── 0512 │ │ │ │ │ └── GCC │ │ │ │ │ └── link_uc3a0512.lds │ │ │ │ ├── PREPROCESSOR │ │ │ │ ├── mrepeat.h │ │ │ │ ├── preprocessor.h │ │ │ │ ├── stringz.h │ │ │ │ └── tpaste.h │ │ │ │ ├── STARTUP_FILES │ │ │ │ └── GCC │ │ │ │ │ └── crt0.x │ │ │ │ ├── compiler.h │ │ │ │ ├── conf_isp.h │ │ │ │ └── parts.h │ │ ├── clocks.c │ │ ├── clocks.h │ │ ├── flash_fw.c │ │ ├── license.txt │ │ ├── nor_flash.c │ │ ├── nor_flash.h │ │ ├── printf-stdarg.c │ │ ├── printf-stdarg.h │ │ ├── startup.c │ │ ├── startup.h │ │ └── wl_fw.h │ └── wifi_dnld.cproj │ └── wifishield.atsln ├── platform.txt ├── programmers.txt └── variants └── roboard └── pins_arduino.h /README.md: -------------------------------------------------------------------------------- 1 | # Roboard-Pro 2 | > 无敌增强版Arduino开发板 3 | 4 | 5 | 6 | # 对比原生的Arduino UNO 具备如下特性: 7 | 8 | * 管脚和库100%兼容Arduino UNO 9 | 10 | * 在UNO的基础上增加了两路电机驱动(L298P,最大4A电流输出,可开窗上锡进一步过载),自锁式电机线接口 11 | 12 | * 在UNO的基础上增加了一个IMU(MPU6050) 13 | 14 | * 在UNO的基础上增加了一块蓝牙模块(HC-05) 15 | 16 | * 所有外设都是用跳线焊盘连接,可以自行选择断开或连接 17 | 18 | * 使用Mega32U4芯片,自带两个串口,下载串口和蓝牙串口不冲突 19 | 20 | * 修改了Bootloader解决Leonardo复位慢的问题 21 | 22 | * 配套无线APP(可控Ctrl、颜艺Boy、迹 等,通过蓝牙连接) 23 | 24 | * 更多细节优化 25 | 26 | ​ 27 | 28 | # 使用方法 29 | 30 | * PCB文件可以直接打样,元器件选型原理图里都有标出 31 | * 将software文件夹内的文件全部复制到Arduino IDE的 \hardware\arduino\avr 文件夹内,可以覆盖,不会删除原有的功能 32 | * 重启IDE,选择板卡 - Roboard,即可正常使用 33 | 34 | 35 | 36 | # 管脚分配(待补充) 37 | 38 | 39 | 40 | > 个人主页:www.pengzhihui.xyz 41 | 42 | -------------------------------------------------------------------------------- /driver/dpinst-amd64.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/peng-zhihui/Roboard-Pro/920538e04199dee27125e3e974f43b122835794e/driver/dpinst-amd64.exe -------------------------------------------------------------------------------- /driver/dpinst-x86.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/peng-zhihui/Roboard-Pro/920538e04199dee27125e3e974f43b122835794e/driver/dpinst-x86.exe -------------------------------------------------------------------------------- /hardware/PCB.PcbDoc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/peng-zhihui/Roboard-Pro/920538e04199dee27125e3e974f43b122835794e/hardware/PCB.PcbDoc -------------------------------------------------------------------------------- /hardware/Sch.PDF: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/peng-zhihui/Roboard-Pro/920538e04199dee27125e3e974f43b122835794e/hardware/Sch.PDF -------------------------------------------------------------------------------- /img1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/peng-zhihui/Roboard-Pro/920538e04199dee27125e3e974f43b122835794e/img1.jpg -------------------------------------------------------------------------------- /img2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/peng-zhihui/Roboard-Pro/920538e04199dee27125e3e974f43b122835794e/img2.jpg -------------------------------------------------------------------------------- /software/cores/arduino/Client.h: -------------------------------------------------------------------------------- 1 | /* 2 | Client.h - Base class that provides Client 3 | Copyright (c) 2011 Adrian McEwen. All right reserved. 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | */ 19 | 20 | #ifndef client_h 21 | #define client_h 22 | #include "Print.h" 23 | #include "Stream.h" 24 | #include "IPAddress.h" 25 | 26 | class Client : public Stream { 27 | 28 | public: 29 | virtual int connect(IPAddress ip, uint16_t port) =0; 30 | virtual int connect(const char *host, uint16_t port) =0; 31 | virtual size_t write(uint8_t) =0; 32 | virtual size_t write(const uint8_t *buf, size_t size) =0; 33 | virtual int available() = 0; 34 | virtual int read() = 0; 35 | virtual int read(uint8_t *buf, size_t size) = 0; 36 | virtual int peek() = 0; 37 | virtual void flush() = 0; 38 | virtual void stop() = 0; 39 | virtual uint8_t connected() = 0; 40 | virtual operator bool() = 0; 41 | protected: 42 | uint8_t* rawIPAddress(IPAddress& addr) { return addr.raw_address(); }; 43 | }; 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /software/cores/arduino/HardwareSerial0.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | HardwareSerial0.cpp - Hardware serial library for Wiring 3 | Copyright (c) 2006 Nicholas Zambetti. All right reserved. 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | 19 | Modified 23 November 2006 by David A. Mellis 20 | Modified 28 September 2010 by Mark Sproul 21 | Modified 14 August 2012 by Alarus 22 | Modified 3 December 2013 by Matthijs Kooijman 23 | */ 24 | 25 | #include "Arduino.h" 26 | #include "HardwareSerial.h" 27 | #include "HardwareSerial_private.h" 28 | 29 | // Each HardwareSerial is defined in its own file, sine the linker pulls 30 | // in the entire file when any element inside is used. --gc-sections can 31 | // additionally cause unused symbols to be dropped, but ISRs have the 32 | // "used" attribute so are never dropped and they keep the 33 | // HardwareSerial instance in as well. Putting each instance in its own 34 | // file prevents the linker from pulling in any unused instances in the 35 | // first place. 36 | 37 | #if defined(HAVE_HWSERIAL0) 38 | 39 | #if defined(USART_RX_vect) 40 | ISR(USART_RX_vect) 41 | #elif defined(USART0_RX_vect) 42 | ISR(USART0_RX_vect) 43 | #elif defined(USART_RXC_vect) 44 | ISR(USART_RXC_vect) // ATmega8 45 | #else 46 | #error "Don't know what the Data Received vector is called for Serial" 47 | #endif 48 | { 49 | Serial._rx_complete_irq(); 50 | } 51 | 52 | #if defined(UART0_UDRE_vect) 53 | ISR(UART0_UDRE_vect) 54 | #elif defined(UART_UDRE_vect) 55 | ISR(UART_UDRE_vect) 56 | #elif defined(USART0_UDRE_vect) 57 | ISR(USART0_UDRE_vect) 58 | #elif defined(USART_UDRE_vect) 59 | ISR(USART_UDRE_vect) 60 | #else 61 | #error "Don't know what the Data Register Empty vector is called for Serial" 62 | #endif 63 | { 64 | Serial._tx_udr_empty_irq(); 65 | } 66 | 67 | #if defined(UBRRH) && defined(UBRRL) 68 | HardwareSerial Serial(&UBRRH, &UBRRL, &UCSRA, &UCSRB, &UCSRC, &UDR); 69 | #else 70 | HardwareSerial Serial(&UBRR0H, &UBRR0L, &UCSR0A, &UCSR0B, &UCSR0C, &UDR0); 71 | #endif 72 | 73 | // Function that can be weakly referenced by serialEventRun to prevent 74 | // pulling in this file if it's not otherwise used. 75 | bool Serial0_available() { 76 | return Serial.available(); 77 | } 78 | 79 | #endif // HAVE_HWSERIAL0 80 | -------------------------------------------------------------------------------- /software/cores/arduino/HardwareSerial1.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | HardwareSerial1.cpp - Hardware serial library for Wiring 3 | Copyright (c) 2006 Nicholas Zambetti. All right reserved. 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | 19 | Modified 23 November 2006 by David A. Mellis 20 | Modified 28 September 2010 by Mark Sproul 21 | Modified 14 August 2012 by Alarus 22 | Modified 3 December 2013 by Matthijs Kooijman 23 | */ 24 | 25 | #include "Arduino.h" 26 | #include "HardwareSerial.h" 27 | #include "HardwareSerial_private.h" 28 | 29 | // Each HardwareSerial is defined in its own file, sine the linker pulls 30 | // in the entire file when any element inside is used. --gc-sections can 31 | // additionally cause unused symbols to be dropped, but ISRs have the 32 | // "used" attribute so are never dropped and they keep the 33 | // HardwareSerial instance in as well. Putting each instance in its own 34 | // file prevents the linker from pulling in any unused instances in the 35 | // first place. 36 | 37 | #if defined(HAVE_HWSERIAL1) 38 | 39 | #if defined(UART1_RX_vect) 40 | ISR(UART1_RX_vect) 41 | #elif defined(USART1_RX_vect) 42 | ISR(USART1_RX_vect) 43 | #else 44 | #error "Don't know what the Data Register Empty vector is called for Serial1" 45 | #endif 46 | { 47 | Serial1._rx_complete_irq(); 48 | } 49 | 50 | #if defined(UART1_UDRE_vect) 51 | ISR(UART1_UDRE_vect) 52 | #elif defined(USART1_UDRE_vect) 53 | ISR(USART1_UDRE_vect) 54 | #else 55 | #error "Don't know what the Data Register Empty vector is called for Serial1" 56 | #endif 57 | { 58 | Serial1._tx_udr_empty_irq(); 59 | } 60 | 61 | HardwareSerial Serial1(&UBRR1H, &UBRR1L, &UCSR1A, &UCSR1B, &UCSR1C, &UDR1); 62 | 63 | // Function that can be weakly referenced by serialEventRun to prevent 64 | // pulling in this file if it's not otherwise used. 65 | bool Serial1_available() { 66 | return Serial1.available(); 67 | } 68 | 69 | #endif // HAVE_HWSERIAL1 70 | -------------------------------------------------------------------------------- /software/cores/arduino/HardwareSerial2.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | HardwareSerial2.cpp - Hardware serial library for Wiring 3 | Copyright (c) 2006 Nicholas Zambetti. All right reserved. 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | 19 | Modified 23 November 2006 by David A. Mellis 20 | Modified 28 September 2010 by Mark Sproul 21 | Modified 14 August 2012 by Alarus 22 | Modified 3 December 2013 by Matthijs Kooijman 23 | */ 24 | 25 | #include "Arduino.h" 26 | #include "HardwareSerial.h" 27 | #include "HardwareSerial_private.h" 28 | 29 | // Each HardwareSerial is defined in its own file, sine the linker pulls 30 | // in the entire file when any element inside is used. --gc-sections can 31 | // additionally cause unused symbols to be dropped, but ISRs have the 32 | // "used" attribute so are never dropped and they keep the 33 | // HardwareSerial instance in as well. Putting each instance in its own 34 | // file prevents the linker from pulling in any unused instances in the 35 | // first place. 36 | 37 | #if defined(HAVE_HWSERIAL2) 38 | 39 | ISR(USART2_RX_vect) 40 | { 41 | Serial2._rx_complete_irq(); 42 | } 43 | 44 | ISR(USART2_UDRE_vect) 45 | { 46 | Serial2._tx_udr_empty_irq(); 47 | } 48 | 49 | HardwareSerial Serial2(&UBRR2H, &UBRR2L, &UCSR2A, &UCSR2B, &UCSR2C, &UDR2); 50 | 51 | // Function that can be weakly referenced by serialEventRun to prevent 52 | // pulling in this file if it's not otherwise used. 53 | bool Serial2_available() { 54 | return Serial2.available(); 55 | } 56 | 57 | #endif // HAVE_HWSERIAL2 58 | -------------------------------------------------------------------------------- /software/cores/arduino/HardwareSerial3.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | HardwareSerial3.cpp - Hardware serial library for Wiring 3 | Copyright (c) 2006 Nicholas Zambetti. All right reserved. 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | 19 | Modified 23 November 2006 by David A. Mellis 20 | Modified 28 September 2010 by Mark Sproul 21 | Modified 14 August 2012 by Alarus 22 | Modified 3 December 2013 by Matthijs Kooijman 23 | */ 24 | 25 | #include "Arduino.h" 26 | #include "HardwareSerial.h" 27 | #include "HardwareSerial_private.h" 28 | 29 | // Each HardwareSerial is defined in its own file, sine the linker pulls 30 | // in the entire file when any element inside is used. --gc-sections can 31 | // additionally cause unused symbols to be dropped, but ISRs have the 32 | // "used" attribute so are never dropped and they keep the 33 | // HardwareSerial instance in as well. Putting each instance in its own 34 | // file prevents the linker from pulling in any unused instances in the 35 | // first place. 36 | 37 | #if defined(HAVE_HWSERIAL3) 38 | 39 | ISR(USART3_RX_vect) 40 | { 41 | Serial3._rx_complete_irq(); 42 | } 43 | 44 | ISR(USART3_UDRE_vect) 45 | { 46 | Serial3._tx_udr_empty_irq(); 47 | } 48 | 49 | HardwareSerial Serial3(&UBRR3H, &UBRR3L, &UCSR3A, &UCSR3B, &UCSR3C, &UDR3); 50 | 51 | // Function that can be weakly referenced by serialEventRun to prevent 52 | // pulling in this file if it's not otherwise used. 53 | bool Serial3_available() { 54 | return Serial3.available(); 55 | } 56 | 57 | #endif // HAVE_HWSERIAL3 58 | -------------------------------------------------------------------------------- /software/cores/arduino/IPAddress.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | IPAddress.cpp - Base class that provides IPAddress 3 | Copyright (c) 2011 Adrian McEwen. All right reserved. 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | */ 19 | 20 | #include 21 | #include 22 | 23 | IPAddress::IPAddress() 24 | { 25 | _address.dword = 0; 26 | } 27 | 28 | IPAddress::IPAddress(uint8_t first_octet, uint8_t second_octet, uint8_t third_octet, uint8_t fourth_octet) 29 | { 30 | _address.bytes[0] = first_octet; 31 | _address.bytes[1] = second_octet; 32 | _address.bytes[2] = third_octet; 33 | _address.bytes[3] = fourth_octet; 34 | } 35 | 36 | IPAddress::IPAddress(uint32_t address) 37 | { 38 | _address.dword = address; 39 | } 40 | 41 | IPAddress::IPAddress(const uint8_t *address) 42 | { 43 | memcpy(_address.bytes, address, sizeof(_address.bytes)); 44 | } 45 | 46 | bool IPAddress::fromString(const char *address) 47 | { 48 | uint16_t acc = 0; // Accumulator 49 | uint8_t dots = 0; 50 | 51 | while (*address) 52 | { 53 | char c = *address++; 54 | if (c >= '0' && c <= '9') 55 | { 56 | acc = acc * 10 + (c - '0'); 57 | if (acc > 255) { 58 | // Value out of [0..255] range 59 | return false; 60 | } 61 | } 62 | else if (c == '.') 63 | { 64 | if (dots == 3) { 65 | // Too much dots (there must be 3 dots) 66 | return false; 67 | } 68 | _address.bytes[dots++] = acc; 69 | acc = 0; 70 | } 71 | else 72 | { 73 | // Invalid char 74 | return false; 75 | } 76 | } 77 | 78 | if (dots != 3) { 79 | // Too few dots (there must be 3 dots) 80 | return false; 81 | } 82 | _address.bytes[3] = acc; 83 | return true; 84 | } 85 | 86 | IPAddress& IPAddress::operator=(const uint8_t *address) 87 | { 88 | memcpy(_address.bytes, address, sizeof(_address.bytes)); 89 | return *this; 90 | } 91 | 92 | IPAddress& IPAddress::operator=(uint32_t address) 93 | { 94 | _address.dword = address; 95 | return *this; 96 | } 97 | 98 | bool IPAddress::operator==(const uint8_t* addr) const 99 | { 100 | return memcmp(addr, _address.bytes, sizeof(_address.bytes)) == 0; 101 | } 102 | 103 | size_t IPAddress::printTo(Print& p) const 104 | { 105 | size_t n = 0; 106 | for (int i =0; i < 3; i++) 107 | { 108 | n += p.print(_address.bytes[i], DEC); 109 | n += p.print('.'); 110 | } 111 | n += p.print(_address.bytes[3], DEC); 112 | return n; 113 | } 114 | 115 | -------------------------------------------------------------------------------- /software/cores/arduino/IPAddress.h: -------------------------------------------------------------------------------- 1 | /* 2 | IPAddress.h - Base class that provides IPAddress 3 | Copyright (c) 2011 Adrian McEwen. All right reserved. 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | */ 19 | 20 | #ifndef IPAddress_h 21 | #define IPAddress_h 22 | 23 | #include 24 | #include "Printable.h" 25 | #include "WString.h" 26 | 27 | // A class to make it easier to handle and pass around IP addresses 28 | 29 | class IPAddress : public Printable { 30 | private: 31 | union { 32 | uint8_t bytes[4]; // IPv4 address 33 | uint32_t dword; 34 | } _address; 35 | 36 | // Access the raw byte array containing the address. Because this returns a pointer 37 | // to the internal structure rather than a copy of the address this function should only 38 | // be used when you know that the usage of the returned uint8_t* will be transient and not 39 | // stored. 40 | uint8_t* raw_address() { return _address.bytes; }; 41 | 42 | public: 43 | // Constructors 44 | IPAddress(); 45 | IPAddress(uint8_t first_octet, uint8_t second_octet, uint8_t third_octet, uint8_t fourth_octet); 46 | IPAddress(uint32_t address); 47 | IPAddress(const uint8_t *address); 48 | 49 | bool fromString(const char *address); 50 | bool fromString(const String &address) { return fromString(address.c_str()); } 51 | 52 | // Overloaded cast operator to allow IPAddress objects to be used where a pointer 53 | // to a four-byte uint8_t array is expected 54 | operator uint32_t() const { return _address.dword; }; 55 | bool operator==(const IPAddress& addr) const { return _address.dword == addr._address.dword; }; 56 | bool operator==(const uint8_t* addr) const; 57 | 58 | // Overloaded index operator to allow getting and setting individual octets of the address 59 | uint8_t operator[](int index) const { return _address.bytes[index]; }; 60 | uint8_t& operator[](int index) { return _address.bytes[index]; }; 61 | 62 | // Overloaded copy operators to allow initialisation of IPAddress objects from other types 63 | IPAddress& operator=(const uint8_t *address); 64 | IPAddress& operator=(uint32_t address); 65 | 66 | virtual size_t printTo(Print& p) const; 67 | 68 | friend class EthernetClass; 69 | friend class UDP; 70 | friend class Client; 71 | friend class Server; 72 | friend class DhcpClass; 73 | friend class DNSClient; 74 | }; 75 | 76 | const IPAddress INADDR_NONE(0,0,0,0); 77 | 78 | #endif 79 | -------------------------------------------------------------------------------- /software/cores/arduino/PluggableUSB.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | PluggableUSB.cpp 3 | Copyright (c) 2015 Arduino LLC 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | */ 19 | 20 | #include "USBAPI.h" 21 | #include "PluggableUSB.h" 22 | 23 | #if defined(USBCON) 24 | #ifdef PLUGGABLE_USB_ENABLED 25 | 26 | extern uint8_t _initEndpoints[]; 27 | 28 | int PluggableUSB_::getInterface(uint8_t* interfaceCount) 29 | { 30 | int sent = 0; 31 | PluggableUSBModule* node; 32 | for (node = rootNode; node; node = node->next) { 33 | int res = node->getInterface(interfaceCount); 34 | if (res < 0) 35 | return -1; 36 | sent += res; 37 | } 38 | return sent; 39 | } 40 | 41 | int PluggableUSB_::getDescriptor(USBSetup& setup) 42 | { 43 | PluggableUSBModule* node; 44 | for (node = rootNode; node; node = node->next) { 45 | int ret = node->getDescriptor(setup); 46 | // ret!=0 -> request has been processed 47 | if (ret) 48 | return ret; 49 | } 50 | return 0; 51 | } 52 | 53 | void PluggableUSB_::getShortName(char *iSerialNum) 54 | { 55 | PluggableUSBModule* node; 56 | for (node = rootNode; node; node = node->next) { 57 | iSerialNum += node->getShortName(iSerialNum); 58 | } 59 | *iSerialNum = 0; 60 | } 61 | 62 | bool PluggableUSB_::setup(USBSetup& setup) 63 | { 64 | PluggableUSBModule* node; 65 | for (node = rootNode; node; node = node->next) { 66 | if (node->setup(setup)) { 67 | return true; 68 | } 69 | } 70 | return false; 71 | } 72 | 73 | bool PluggableUSB_::plug(PluggableUSBModule *node) 74 | { 75 | if ((lastEp + node->numEndpoints) > USB_ENDPOINTS) { 76 | return false; 77 | } 78 | 79 | if (!rootNode) { 80 | rootNode = node; 81 | } else { 82 | PluggableUSBModule *current = rootNode; 83 | while (current->next) { 84 | current = current->next; 85 | } 86 | current->next = node; 87 | } 88 | 89 | node->pluggedInterface = lastIf; 90 | node->pluggedEndpoint = lastEp; 91 | lastIf += node->numInterfaces; 92 | for (uint8_t i = 0; i < node->numEndpoints; i++) { 93 | _initEndpoints[lastEp] = node->endpointType[i]; 94 | lastEp++; 95 | } 96 | return true; 97 | // restart USB layer??? 98 | } 99 | 100 | PluggableUSB_& PluggableUSB() 101 | { 102 | static PluggableUSB_ obj; 103 | return obj; 104 | } 105 | 106 | PluggableUSB_::PluggableUSB_() : lastIf(CDC_ACM_INTERFACE + CDC_INTERFACE_COUNT), 107 | lastEp(CDC_FIRST_ENDPOINT + CDC_ENPOINT_COUNT), 108 | rootNode(NULL) 109 | { 110 | // Empty 111 | } 112 | 113 | #endif 114 | 115 | #endif /* if defined(USBCON) */ 116 | -------------------------------------------------------------------------------- /software/cores/arduino/PluggableUSB.h: -------------------------------------------------------------------------------- 1 | /* 2 | PluggableUSB.h 3 | Copyright (c) 2015 Arduino LLC 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | */ 19 | 20 | #ifndef PUSB_h 21 | #define PUSB_h 22 | 23 | #include "USBAPI.h" 24 | #include 25 | 26 | #if defined(USBCON) 27 | 28 | class PluggableUSBModule { 29 | public: 30 | PluggableUSBModule(uint8_t numEps, uint8_t numIfs, uint8_t *epType) : 31 | numEndpoints(numEps), numInterfaces(numIfs), endpointType(epType) 32 | { } 33 | 34 | protected: 35 | virtual bool setup(USBSetup& setup) = 0; 36 | virtual int getInterface(uint8_t* interfaceCount) = 0; 37 | virtual int getDescriptor(USBSetup& setup) = 0; 38 | virtual uint8_t getShortName(char *name) { name[0] = 'A'+pluggedInterface; return 1; } 39 | 40 | uint8_t pluggedInterface; 41 | uint8_t pluggedEndpoint; 42 | 43 | const uint8_t numEndpoints; 44 | const uint8_t numInterfaces; 45 | const uint8_t *endpointType; 46 | 47 | PluggableUSBModule *next = NULL; 48 | 49 | friend class PluggableUSB_; 50 | }; 51 | 52 | class PluggableUSB_ { 53 | public: 54 | PluggableUSB_(); 55 | bool plug(PluggableUSBModule *node); 56 | int getInterface(uint8_t* interfaceCount); 57 | int getDescriptor(USBSetup& setup); 58 | bool setup(USBSetup& setup); 59 | void getShortName(char *iSerialNum); 60 | 61 | private: 62 | uint8_t lastIf; 63 | uint8_t lastEp; 64 | PluggableUSBModule* rootNode; 65 | }; 66 | 67 | // Replacement for global singleton. 68 | // This function prevents static-initialization-order-fiasco 69 | // https://isocpp.org/wiki/faq/ctors#static-init-order-on-first-use 70 | PluggableUSB_& PluggableUSB(); 71 | 72 | #endif 73 | 74 | #endif 75 | -------------------------------------------------------------------------------- /software/cores/arduino/Print.h: -------------------------------------------------------------------------------- 1 | /* 2 | Print.h - Base class that provides print() and println() 3 | Copyright (c) 2008 David A. Mellis. All right reserved. 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | */ 19 | 20 | #ifndef Print_h 21 | #define Print_h 22 | 23 | #include 24 | #include // for size_t 25 | 26 | #include "WString.h" 27 | #include "Printable.h" 28 | 29 | #define DEC 10 30 | #define HEX 16 31 | #define OCT 8 32 | #define BIN 2 33 | 34 | class Print 35 | { 36 | private: 37 | int write_error; 38 | size_t printNumber(unsigned long, uint8_t); 39 | size_t printFloat(double, uint8_t); 40 | protected: 41 | void setWriteError(int err = 1) { write_error = err; } 42 | public: 43 | Print() : write_error(0) {} 44 | 45 | int getWriteError() { return write_error; } 46 | void clearWriteError() { setWriteError(0); } 47 | 48 | virtual size_t write(uint8_t) = 0; 49 | size_t write(const char *str) { 50 | if (str == NULL) return 0; 51 | return write((const uint8_t *)str, strlen(str)); 52 | } 53 | virtual size_t write(const uint8_t *buffer, size_t size); 54 | size_t write(const char *buffer, size_t size) { 55 | return write((const uint8_t *)buffer, size); 56 | } 57 | 58 | size_t print(const __FlashStringHelper *); 59 | size_t print(const String &); 60 | size_t print(const char[]); 61 | size_t print(char); 62 | size_t print(unsigned char, int = DEC); 63 | size_t print(int, int = DEC); 64 | size_t print(unsigned int, int = DEC); 65 | size_t print(long, int = DEC); 66 | size_t print(unsigned long, int = DEC); 67 | size_t print(double, int = 2); 68 | size_t print(const Printable&); 69 | 70 | size_t println(const __FlashStringHelper *); 71 | size_t println(const String &s); 72 | size_t println(const char[]); 73 | size_t println(char); 74 | size_t println(unsigned char, int = DEC); 75 | size_t println(int, int = DEC); 76 | size_t println(unsigned int, int = DEC); 77 | size_t println(long, int = DEC); 78 | size_t println(unsigned long, int = DEC); 79 | size_t println(double, int = 2); 80 | size_t println(const Printable&); 81 | size_t println(void); 82 | }; 83 | 84 | #endif 85 | -------------------------------------------------------------------------------- /software/cores/arduino/Printable.h: -------------------------------------------------------------------------------- 1 | /* 2 | Printable.h - Interface class that allows printing of complex types 3 | Copyright (c) 2011 Adrian McEwen. All right reserved. 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | */ 19 | 20 | #ifndef Printable_h 21 | #define Printable_h 22 | 23 | #include 24 | 25 | class Print; 26 | 27 | /** The Printable class provides a way for new classes to allow themselves to be printed. 28 | By deriving from Printable and implementing the printTo method, it will then be possible 29 | for users to print out instances of this class by passing them into the usual 30 | Print::print and Print::println methods. 31 | */ 32 | 33 | class Printable 34 | { 35 | public: 36 | virtual size_t printTo(Print& p) const = 0; 37 | }; 38 | 39 | #endif 40 | 41 | -------------------------------------------------------------------------------- /software/cores/arduino/Server.h: -------------------------------------------------------------------------------- 1 | /* 2 | Server.h - Base class that provides Server 3 | Copyright (c) 2011 Adrian McEwen. All right reserved. 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | */ 19 | 20 | #ifndef server_h 21 | #define server_h 22 | 23 | #include "Print.h" 24 | 25 | class Server : public Print { 26 | public: 27 | virtual void begin() =0; 28 | }; 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /software/cores/arduino/USBDesc.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2011, Peter Barrett 3 | Copyright (c) 2015, Arduino LLC 4 | 5 | Permission to use, copy, modify, and/or distribute this software for 6 | any purpose with or without fee is hereby granted, provided that the 7 | above copyright notice and this permission notice appear in all copies. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL 10 | WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED 11 | WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR 12 | BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES 13 | OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, 14 | WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, 15 | ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS 16 | SOFTWARE. 17 | */ 18 | 19 | #define PLUGGABLE_USB_ENABLED 20 | 21 | #if defined(EPRST6) 22 | #define USB_ENDPOINTS 7 // AtMegaxxU4 23 | #else 24 | #define USB_ENDPOINTS 5 // AtMegaxxU2 25 | #endif 26 | 27 | #define ISERIAL_MAX_LEN 20 28 | 29 | #define CDC_INTERFACE_COUNT 2 30 | #define CDC_ENPOINT_COUNT 3 31 | 32 | #define CDC_ACM_INTERFACE 0 // CDC ACM 33 | #define CDC_DATA_INTERFACE 1 // CDC Data 34 | #define CDC_FIRST_ENDPOINT 1 35 | #define CDC_ENDPOINT_ACM (CDC_FIRST_ENDPOINT) // CDC First 36 | #define CDC_ENDPOINT_OUT (CDC_FIRST_ENDPOINT+1) 37 | #define CDC_ENDPOINT_IN (CDC_FIRST_ENDPOINT+2) 38 | 39 | #define INTERFACE_COUNT (MSC_INTERFACE + MSC_INTERFACE_COUNT) 40 | 41 | #define CDC_RX CDC_ENDPOINT_OUT 42 | #define CDC_TX CDC_ENDPOINT_IN 43 | 44 | #define IMANUFACTURER 1 45 | #define IPRODUCT 2 46 | #define ISERIAL 3 -------------------------------------------------------------------------------- /software/cores/arduino/WMath.cpp: -------------------------------------------------------------------------------- 1 | /* -*- mode: jde; c-basic-offset: 2; indent-tabs-mode: nil -*- */ 2 | 3 | /* 4 | Part of the Wiring project - http://wiring.org.co 5 | Copyright (c) 2004-06 Hernando Barragan 6 | Modified 13 August 2006, David A. Mellis for Arduino - http://www.arduino.cc/ 7 | 8 | This library is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU Lesser General Public 10 | License as published by the Free Software Foundation; either 11 | version 2.1 of the License, or (at your option) any later version. 12 | 13 | This library is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General 19 | Public License along with this library; if not, write to the 20 | Free Software Foundation, Inc., 59 Temple Place, Suite 330, 21 | Boston, MA 02111-1307 USA 22 | */ 23 | 24 | extern "C" { 25 | #include "stdlib.h" 26 | } 27 | 28 | void randomSeed(unsigned long seed) 29 | { 30 | if (seed != 0) { 31 | srandom(seed); 32 | } 33 | } 34 | 35 | long random(long howbig) 36 | { 37 | if (howbig == 0) { 38 | return 0; 39 | } 40 | return random() % howbig; 41 | } 42 | 43 | long random(long howsmall, long howbig) 44 | { 45 | if (howsmall >= howbig) { 46 | return howsmall; 47 | } 48 | long diff = howbig - howsmall; 49 | return random(diff) + howsmall; 50 | } 51 | 52 | long map(long x, long in_min, long in_max, long out_min, long out_max) 53 | { 54 | return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min; 55 | } 56 | 57 | unsigned int makeWord(unsigned int w) { return w; } 58 | unsigned int makeWord(unsigned char h, unsigned char l) { return (h << 8) | l; } 59 | -------------------------------------------------------------------------------- /software/cores/arduino/abi.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014 Arduino. All right reserved. 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | See the GNU Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | #include 20 | 21 | extern "C" void __cxa_pure_virtual(void) __attribute__ ((__noreturn__)); 22 | extern "C" void __cxa_deleted_virtual(void) __attribute__ ((__noreturn__)); 23 | 24 | void __cxa_pure_virtual(void) { 25 | // We might want to write some diagnostics to uart in this case 26 | //std::terminate(); 27 | abort(); 28 | } 29 | 30 | void __cxa_deleted_virtual(void) { 31 | // We might want to write some diagnostics to uart in this case 32 | //std::terminate(); 33 | abort(); 34 | } 35 | 36 | -------------------------------------------------------------------------------- /software/cores/arduino/hooks.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2012 Arduino. All right reserved. 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | See the GNU Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | /** 20 | * Empty yield() hook. 21 | * 22 | * This function is intended to be used by library writers to build 23 | * libraries or sketches that supports cooperative threads. 24 | * 25 | * Its defined as a weak symbol and it can be redefined to implement a 26 | * real cooperative scheduler. 27 | */ 28 | static void __empty() { 29 | // Empty 30 | } 31 | void yield(void) __attribute__ ((weak, alias("__empty"))); 32 | -------------------------------------------------------------------------------- /software/cores/arduino/main.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | main.cpp - Main loop for Arduino sketches 3 | Copyright (c) 2005-2013 Arduino Team. All right reserved. 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | */ 19 | 20 | #include 21 | 22 | // Declared weak in Arduino.h to allow user redefinitions. 23 | int atexit(void (* /*func*/ )()) { return 0; } 24 | 25 | // Weak empty variant initialization function. 26 | // May be redefined by variant files. 27 | void initVariant() __attribute__((weak)); 28 | void initVariant() { } 29 | 30 | void setupUSB() __attribute__((weak)); 31 | void setupUSB() { } 32 | 33 | int main(void) 34 | { 35 | init(); 36 | 37 | initVariant(); 38 | 39 | #if defined(USBCON) 40 | USBDevice.attach(); 41 | #endif 42 | 43 | setup(); 44 | 45 | for (;;) { 46 | loop(); 47 | if (serialEventRun) serialEventRun(); 48 | } 49 | 50 | return 0; 51 | } 52 | 53 | -------------------------------------------------------------------------------- /software/cores/arduino/new.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014 Arduino. All right reserved. 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | See the GNU Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | #include 20 | 21 | void *operator new(size_t size) { 22 | return malloc(size); 23 | } 24 | 25 | void *operator new[](size_t size) { 26 | return malloc(size); 27 | } 28 | 29 | void operator delete(void * ptr) { 30 | free(ptr); 31 | } 32 | 33 | void operator delete[](void * ptr) { 34 | free(ptr); 35 | } 36 | 37 | -------------------------------------------------------------------------------- /software/cores/arduino/new.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014 Arduino. All right reserved. 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | See the GNU Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | #ifndef NEW_H 20 | #define NEW_H 21 | 22 | #include 23 | 24 | void * operator new(size_t size); 25 | void * operator new[](size_t size); 26 | void operator delete(void * ptr); 27 | void operator delete[](void * ptr); 28 | 29 | #endif 30 | 31 | -------------------------------------------------------------------------------- /software/cores/arduino/wiring_private.h: -------------------------------------------------------------------------------- 1 | /* 2 | wiring_private.h - Internal header file. 3 | Part of Arduino - http://www.arduino.cc/ 4 | 5 | Copyright (c) 2005-2006 David A. Mellis 6 | 7 | This library is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU Lesser General Public 9 | License as published by the Free Software Foundation; either 10 | version 2.1 of the License, or (at your option) any later version. 11 | 12 | This library is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | Lesser General Public License for more details. 16 | 17 | You should have received a copy of the GNU Lesser General 18 | Public License along with this library; if not, write to the 19 | Free Software Foundation, Inc., 59 Temple Place, Suite 330, 20 | Boston, MA 02111-1307 USA 21 | */ 22 | 23 | #ifndef WiringPrivate_h 24 | #define WiringPrivate_h 25 | 26 | #include 27 | #include 28 | #include 29 | #include 30 | 31 | #include "Arduino.h" 32 | 33 | #ifdef __cplusplus 34 | extern "C"{ 35 | #endif 36 | 37 | #ifndef cbi 38 | #define cbi(sfr, bit) (_SFR_BYTE(sfr) &= ~_BV(bit)) 39 | #endif 40 | #ifndef sbi 41 | #define sbi(sfr, bit) (_SFR_BYTE(sfr) |= _BV(bit)) 42 | #endif 43 | 44 | uint32_t countPulseASM(volatile uint8_t *port, uint8_t bit, uint8_t stateMask, unsigned long maxloops); 45 | 46 | #define EXTERNAL_INT_0 0 47 | #define EXTERNAL_INT_1 1 48 | #define EXTERNAL_INT_2 2 49 | #define EXTERNAL_INT_3 3 50 | #define EXTERNAL_INT_4 4 51 | #define EXTERNAL_INT_5 5 52 | #define EXTERNAL_INT_6 6 53 | #define EXTERNAL_INT_7 7 54 | 55 | #if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__) || defined(__AVR_ATmega128RFA1__) || defined(__AVR_ATmega256RFR2__) || \ 56 | defined(__AVR_AT90USB82__) || defined(__AVR_AT90USB162__) || defined(__AVR_ATmega32U2__) || defined(__AVR_ATmega16U2__) || defined(__AVR_ATmega8U2__) 57 | #define EXTERNAL_NUM_INTERRUPTS 8 58 | #elif defined(__AVR_ATmega1284__) || defined(__AVR_ATmega1284P__) || defined(__AVR_ATmega644__) || defined(__AVR_ATmega644A__) || defined(__AVR_ATmega644P__) || defined(__AVR_ATmega644PA__) 59 | #define EXTERNAL_NUM_INTERRUPTS 3 60 | #elif defined(__AVR_ATmega32U4__) 61 | #define EXTERNAL_NUM_INTERRUPTS 5 62 | #else 63 | #define EXTERNAL_NUM_INTERRUPTS 2 64 | #endif 65 | 66 | typedef void (*voidFuncPtr)(void); 67 | 68 | #ifdef __cplusplus 69 | } // extern "C" 70 | #endif 71 | 72 | #endif 73 | -------------------------------------------------------------------------------- /software/cores/arduino/wiring_pulse.c: -------------------------------------------------------------------------------- 1 | /* 2 | wiring_pulse.c - pulseIn() function 3 | Part of Arduino - http://www.arduino.cc/ 4 | 5 | Copyright (c) 2005-2006 David A. Mellis 6 | 7 | This library is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU Lesser General Public 9 | License as published by the Free Software Foundation; either 10 | version 2.1 of the License, or (at your option) any later version. 11 | 12 | This library is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | Lesser General Public License for more details. 16 | 17 | You should have received a copy of the GNU Lesser General 18 | Public License along with this library; if not, write to the 19 | Free Software Foundation, Inc., 59 Temple Place, Suite 330, 20 | Boston, MA 02111-1307 USA 21 | */ 22 | 23 | #include "wiring_private.h" 24 | #include "pins_arduino.h" 25 | 26 | /* Measures the length (in microseconds) of a pulse on the pin; state is HIGH 27 | * or LOW, the type of pulse to measure. Works on pulses from 2-3 microseconds 28 | * to 3 minutes in length, but must be called at least a few dozen microseconds 29 | * before the start of the pulse. 30 | * 31 | * This function performs better with short pulses in noInterrupt() context 32 | */ 33 | unsigned long pulseIn(uint8_t pin, uint8_t state, unsigned long timeout) 34 | { 35 | // cache the port and bit of the pin in order to speed up the 36 | // pulse width measuring loop and achieve finer resolution. calling 37 | // digitalRead() instead yields much coarser resolution. 38 | uint8_t bit = digitalPinToBitMask(pin); 39 | uint8_t port = digitalPinToPort(pin); 40 | uint8_t stateMask = (state ? bit : 0); 41 | 42 | // convert the timeout from microseconds to a number of times through 43 | // the initial loop; it takes approximately 16 clock cycles per iteration 44 | unsigned long maxloops = microsecondsToClockCycles(timeout)/16; 45 | 46 | unsigned long width = countPulseASM(portInputRegister(port), bit, stateMask, maxloops); 47 | 48 | // prevent clockCyclesToMicroseconds to return bogus values if countPulseASM timed out 49 | if (width) 50 | return clockCyclesToMicroseconds(width * 16 + 16); 51 | else 52 | return 0; 53 | } 54 | 55 | /* Measures the length (in microseconds) of a pulse on the pin; state is HIGH 56 | * or LOW, the type of pulse to measure. Works on pulses from 2-3 microseconds 57 | * to 3 minutes in length, but must be called at least a few dozen microseconds 58 | * before the start of the pulse. 59 | * 60 | * ATTENTION: 61 | * this function relies on micros() so cannot be used in noInterrupt() context 62 | */ 63 | unsigned long pulseInLong(uint8_t pin, uint8_t state, unsigned long timeout) 64 | { 65 | // cache the port and bit of the pin in order to speed up the 66 | // pulse width measuring loop and achieve finer resolution. calling 67 | // digitalRead() instead yields much coarser resolution. 68 | uint8_t bit = digitalPinToBitMask(pin); 69 | uint8_t port = digitalPinToPort(pin); 70 | uint8_t stateMask = (state ? bit : 0); 71 | 72 | unsigned long startMicros = micros(); 73 | 74 | // wait for any previous pulse to end 75 | while ((*portInputRegister(port) & bit) == stateMask) { 76 | if (micros() - startMicros > timeout) 77 | return 0; 78 | } 79 | 80 | // wait for the pulse to start 81 | while ((*portInputRegister(port) & bit) != stateMask) { 82 | if (micros() - startMicros > timeout) 83 | return 0; 84 | } 85 | 86 | unsigned long start = micros(); 87 | // wait for the pulse to stop 88 | while ((*portInputRegister(port) & bit) == stateMask) { 89 | if (micros() - startMicros > timeout) 90 | return 0; 91 | } 92 | return micros() - start; 93 | } 94 | -------------------------------------------------------------------------------- /software/cores/arduino/wiring_shift.c: -------------------------------------------------------------------------------- 1 | /* 2 | wiring_shift.c - shiftOut() function 3 | Part of Arduino - http://www.arduino.cc/ 4 | 5 | Copyright (c) 2005-2006 David A. Mellis 6 | 7 | This library is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU Lesser General Public 9 | License as published by the Free Software Foundation; either 10 | version 2.1 of the License, or (at your option) any later version. 11 | 12 | This library is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | Lesser General Public License for more details. 16 | 17 | You should have received a copy of the GNU Lesser General 18 | Public License along with this library; if not, write to the 19 | Free Software Foundation, Inc., 59 Temple Place, Suite 330, 20 | Boston, MA 02111-1307 USA 21 | */ 22 | 23 | #include "wiring_private.h" 24 | 25 | uint8_t shiftIn(uint8_t dataPin, uint8_t clockPin, uint8_t bitOrder) { 26 | uint8_t value = 0; 27 | uint8_t i; 28 | 29 | for (i = 0; i < 8; ++i) { 30 | digitalWrite(clockPin, HIGH); 31 | if (bitOrder == LSBFIRST) 32 | value |= digitalRead(dataPin) << i; 33 | else 34 | value |= digitalRead(dataPin) << (7 - i); 35 | digitalWrite(clockPin, LOW); 36 | } 37 | return value; 38 | } 39 | 40 | void shiftOut(uint8_t dataPin, uint8_t clockPin, uint8_t bitOrder, uint8_t val) 41 | { 42 | uint8_t i; 43 | 44 | for (i = 0; i < 8; i++) { 45 | if (bitOrder == LSBFIRST) 46 | digitalWrite(dataPin, !!(val & (1 << i))); 47 | else 48 | digitalWrite(dataPin, !!(val & (1 << (7 - i)))); 49 | 50 | digitalWrite(clockPin, HIGH); 51 | digitalWrite(clockPin, LOW); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /software/firmwares/arduinoISP/readme.txt: -------------------------------------------------------------------------------- 1 | 2 | You can download the ArduinoISP firmware source files from: 3 | 4 | https://github.com/arduino/ArduinoISP 5 | 6 | -------------------------------------------------------------------------------- /software/firmwares/atmegaxxu2/README.txt: -------------------------------------------------------------------------------- 1 | Arduino Uno and Mega 2560 Firmwares for the ATmega8U2 2 | 3 | This directory contains the firmwares used on the ATmega8U2 on the Arduino 4 | Uno and Arduino Mega 2560. The arduino-usbdfu directory contains the DFU 5 | bootloader on the 8U2; the arduino-usbserial directory contains the actual 6 | usb to serial firmware. Both should be compiled against LUFA 100807. The 7 | two .hex files in this directory combine the dfu and serial firmwares into 8 | a single file to burn onto the 8U2. 9 | 10 | To burn (Uno): 11 | avrdude -p at90usb82 -F -P usb -c avrispmkii -U flash:w:UNO-dfu_and_usbserial_combined.hex -U lfuse:w:0xFF:m -U hfuse:w:0xD9:m -U efuse:w:0xF4:m -U lock:w:0x0F:m 12 | 13 | To burn (Mega 2560): 14 | avrdude -p at90usb82 -F -P usb -c avrispmkii -U flash:w:MEGA-dfu_and_usbserial_combined.hex -U lfuse:w:0xFF:m -U hfuse:w:0xD9:m -U efuse:w:0xF4:m -U lock:w:0x0F:m 15 | 16 | 17 | Note on USB Vendor IDs (VID) and Product IDs (PID): The arduino-usbdfu 18 | project uses Atmel's VID and MCU-specific PIDs to maintain compatibility 19 | with their FLIP software. The source code to the arduino-usbserial 20 | project includes Atmel's VID and a PID donated by them to LUFA. This 21 | PID is used in LUFA's USBtoSerial project, which forms the basis for 22 | arduino-usbserial. According to the LUFA documentation, this VID/PID 23 | combination is: 24 | 25 | "For use in testing of LUFA powered devices during development only, 26 | by non-commercial entities. All devices must accept collisions on this 27 | VID/PID range (from other in-development LUFA devices) to be resolved 28 | by using a unique release number in the Device Descriptor. No devices 29 | using this VID/PID combination may be released to the general public." 30 | 31 | The production version of the arduino-usbserial firmware uses the 32 | Arduino VID. This is only for use with official Arduino hardware and 33 | should not be used on other products. -------------------------------------------------------------------------------- /software/firmwares/atmegaxxu2/arduino-usbdfu/Board/LEDs.h: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2010. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.fourwalledcubicle.com 7 | */ 8 | 9 | /* 10 | Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaim all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | /* 32 | Board LEDs driver for the Benito board, from www.dorkbotpdx.org. 33 | */ 34 | 35 | #ifndef __LEDS_ARDUINOUNO_H__ 36 | #define __LEDS_ARDUINOUNO_H__ 37 | 38 | /* Includes: */ 39 | #include 40 | 41 | /* Enable C linkage for C++ Compilers: */ 42 | #if defined(__cplusplus) 43 | extern "C" { 44 | #endif 45 | 46 | /* Preprocessor Checks: */ 47 | #if !defined(INCLUDE_FROM_LEDS_H) 48 | #error Do not include this file directly. Include LUFA/Drivers/Board/LEDS.h instead. 49 | #endif 50 | 51 | /* Public Interface - May be used in end-application: */ 52 | /* Macros: */ 53 | /** LED mask for the first LED on the board. */ 54 | #define LEDS_LED1 (1 << 5) 55 | 56 | /** LED mask for the second LED on the board. */ 57 | #define LEDS_LED2 (1 << 4) 58 | 59 | /** LED mask for all the LEDs on the board. */ 60 | #define LEDS_ALL_LEDS (LEDS_LED1 | LEDS_LED2) 61 | 62 | /** LED mask for the none of the board LEDs */ 63 | #define LEDS_NO_LEDS 0 64 | 65 | /* Inline Functions: */ 66 | #if !defined(__DOXYGEN__) 67 | static inline void LEDs_Init(void) 68 | { 69 | DDRD |= LEDS_ALL_LEDS; 70 | PORTD |= LEDS_ALL_LEDS; 71 | } 72 | 73 | static inline void LEDs_TurnOnLEDs(const uint8_t LEDMask) 74 | { 75 | PORTD &= ~LEDMask; 76 | } 77 | 78 | static inline void LEDs_TurnOffLEDs(const uint8_t LEDMask) 79 | { 80 | PORTD |= LEDMask; 81 | } 82 | 83 | static inline void LEDs_SetAllLEDs(const uint8_t LEDMask) 84 | { 85 | PORTD = ((PORTD | LEDS_ALL_LEDS) & ~LEDMask); 86 | } 87 | 88 | static inline void LEDs_ChangeLEDs(const uint8_t LEDMask, const uint8_t ActiveMask) 89 | { 90 | PORTD = ((PORTD | ActiveMask) & ~LEDMask); 91 | } 92 | 93 | static inline void LEDs_ToggleLEDs(const uint8_t LEDMask) 94 | { 95 | PORTD ^= LEDMask; 96 | } 97 | 98 | static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT; 99 | static inline uint8_t LEDs_GetLEDs(void) 100 | { 101 | return (PORTD & LEDS_ALL_LEDS); 102 | } 103 | #endif 104 | 105 | /* Disable C linkage for C++ Compilers: */ 106 | #if defined(__cplusplus) 107 | } 108 | #endif 109 | 110 | #endif 111 | -------------------------------------------------------------------------------- /software/firmwares/atmegaxxu2/arduino-usbdfu/makefile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/peng-zhihui/Roboard-Pro/920538e04199dee27125e3e974f43b122835794e/software/firmwares/atmegaxxu2/arduino-usbdfu/makefile -------------------------------------------------------------------------------- /software/firmwares/atmegaxxu2/arduino-usbdfu/readme.txt: -------------------------------------------------------------------------------- 1 | To setup the project and program an ATMEG8U2 with the Arduino USB DFU bootloader: 2 | 1. unpack the source into LUFA's Bootloader directory 3 | 2. set ARDUINO_MODEL_PID in the makefile as appropriate 4 | 3. do "make clean; make; make program" 5 | 6 | Check that the board enumerates as either "Arduino Uno DFU" or "Arduino Mega 2560 DFU". Test by uploading the Arduino-usbserial application firmware (see instructions in Arduino-usbserial directory) 7 | 8 | -------------------------------------------------------------------------------- /software/firmwares/atmegaxxu2/arduino-usbserial/Arduino-usbserial.h: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2010. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.fourwalledcubicle.com 7 | */ 8 | 9 | /* 10 | Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaim all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | /** \file 32 | * 33 | * Header file for Arduino-usbserial.c. 34 | */ 35 | 36 | #ifndef _ARDUINO_USBSERIAL_H_ 37 | #define _ARDUINO_USBSERIAL_H_ 38 | 39 | /* Includes: */ 40 | #include 41 | #include 42 | #include 43 | #include 44 | 45 | #include "Descriptors.h" 46 | 47 | #include "Lib/LightweightRingBuff.h" 48 | 49 | #include 50 | #include 51 | #include 52 | #include 53 | #include 54 | 55 | /* Macros: */ 56 | /** LED mask for the library LED driver, to indicate TX activity. */ 57 | #define LEDMASK_TX LEDS_LED1 58 | 59 | /** LED mask for the library LED driver, to indicate RX activity. */ 60 | #define LEDMASK_RX LEDS_LED2 61 | 62 | /** LED mask for the library LED driver, to indicate that an error has occurred in the USB interface. */ 63 | #define LEDMASK_ERROR (LEDS_LED1 | LEDS_LED2) 64 | 65 | /** LED mask for the library LED driver, to indicate that the USB interface is busy. */ 66 | #define LEDMASK_BUSY (LEDS_LED1 | LEDS_LED2) 67 | 68 | /* Function Prototypes: */ 69 | void SetupHardware(void); 70 | 71 | void EVENT_USB_Device_Connect(void); 72 | void EVENT_USB_Device_Disconnect(void); 73 | void EVENT_USB_Device_ConfigurationChanged(void); 74 | void EVENT_USB_Device_UnhandledControlRequest(void); 75 | 76 | void EVENT_CDC_Device_LineEncodingChanged(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo); 77 | void EVENT_CDC_Device_ControLineStateChanged(USB_ClassInfo_CDC_Device_t* const CDCInterfaceInfo); 78 | 79 | #endif /* _ARDUINO_USBSERIAL_H_ */ 80 | -------------------------------------------------------------------------------- /software/firmwares/atmegaxxu2/arduino-usbserial/Board/LEDs.h: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2010. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.fourwalledcubicle.com 7 | */ 8 | 9 | /* 10 | Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaim all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | /* 32 | Board LEDs driver for the Benito board, from www.dorkbotpdx.org. 33 | */ 34 | 35 | #ifndef __LEDS_ARDUINOUNO_H__ 36 | #define __LEDS_ARDUINOUNO_H__ 37 | 38 | /* Includes: */ 39 | #include 40 | 41 | /* Enable C linkage for C++ Compilers: */ 42 | #if defined(__cplusplus) 43 | extern "C" { 44 | #endif 45 | 46 | /* Preprocessor Checks: */ 47 | #if !defined(INCLUDE_FROM_LEDS_H) 48 | #error Do not include this file directly. Include LUFA/Drivers/Board/LEDS.h instead. 49 | #endif 50 | 51 | /* Public Interface - May be used in end-application: */ 52 | /* Macros: */ 53 | /** LED mask for the first LED on the board. */ 54 | #define LEDS_LED1 (1 << 5) 55 | 56 | /** LED mask for the second LED on the board. */ 57 | #define LEDS_LED2 (1 << 4) 58 | 59 | /** LED mask for all the LEDs on the board. */ 60 | #define LEDS_ALL_LEDS (LEDS_LED1 | LEDS_LED2) 61 | 62 | /** LED mask for the none of the board LEDs */ 63 | #define LEDS_NO_LEDS 0 64 | 65 | /* Inline Functions: */ 66 | #if !defined(__DOXYGEN__) 67 | static inline void LEDs_Init(void) 68 | { 69 | DDRD |= LEDS_ALL_LEDS; 70 | PORTD |= LEDS_ALL_LEDS; 71 | } 72 | 73 | static inline void LEDs_TurnOnLEDs(const uint8_t LEDMask) 74 | { 75 | PORTD &= ~LEDMask; 76 | } 77 | 78 | static inline void LEDs_TurnOffLEDs(const uint8_t LEDMask) 79 | { 80 | PORTD |= LEDMask; 81 | } 82 | 83 | static inline void LEDs_SetAllLEDs(const uint8_t LEDMask) 84 | { 85 | PORTD = ((PORTD | LEDS_ALL_LEDS) & ~LEDMask); 86 | } 87 | 88 | static inline void LEDs_ChangeLEDs(const uint8_t LEDMask, const uint8_t ActiveMask) 89 | { 90 | PORTD = ((PORTD | ActiveMask) & ~LEDMask); 91 | } 92 | 93 | static inline void LEDs_ToggleLEDs(const uint8_t LEDMask) 94 | { 95 | PORTD ^= LEDMask; 96 | } 97 | 98 | static inline uint8_t LEDs_GetLEDs(void) ATTR_WARN_UNUSED_RESULT; 99 | static inline uint8_t LEDs_GetLEDs(void) 100 | { 101 | return (PORTD & LEDS_ALL_LEDS); 102 | } 103 | #endif 104 | 105 | /* Disable C linkage for C++ Compilers: */ 106 | #if defined(__cplusplus) 107 | } 108 | #endif 109 | 110 | #endif 111 | -------------------------------------------------------------------------------- /software/firmwares/atmegaxxu2/arduino-usbserial/Descriptors.h: -------------------------------------------------------------------------------- 1 | /* 2 | LUFA Library 3 | Copyright (C) Dean Camera, 2010. 4 | 5 | dean [at] fourwalledcubicle [dot] com 6 | www.fourwalledcubicle.com 7 | */ 8 | 9 | /* 10 | Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com) 11 | 12 | Permission to use, copy, modify, distribute, and sell this 13 | software and its documentation for any purpose is hereby granted 14 | without fee, provided that the above copyright notice appear in 15 | all copies and that both that the copyright notice and this 16 | permission notice and warranty disclaimer appear in supporting 17 | documentation, and that the name of the author not be used in 18 | advertising or publicity pertaining to distribution of the 19 | software without specific, written prior permission. 20 | 21 | The author disclaim all warranties with regard to this 22 | software, including all implied warranties of merchantability 23 | and fitness. In no event shall the author be liable for any 24 | special, indirect or consequential damages or any damages 25 | whatsoever resulting from loss of use, data or profits, whether 26 | in an action of contract, negligence or other tortious action, 27 | arising out of or in connection with the use or performance of 28 | this software. 29 | */ 30 | 31 | /** \file 32 | * 33 | * Header file for Descriptors.c. 34 | */ 35 | 36 | #ifndef _DESCRIPTORS_H_ 37 | #define _DESCRIPTORS_H_ 38 | 39 | /* Includes: */ 40 | #include 41 | 42 | #include 43 | #include 44 | 45 | /* Product-specific definitions: */ 46 | #define ARDUINO_UNO_PID 0x0001 47 | #define ARDUINO_MEGA2560_PID 0x0010 48 | 49 | /* Macros: */ 50 | /** Endpoint number of the CDC device-to-host notification IN endpoint. */ 51 | #define CDC_NOTIFICATION_EPNUM 2 52 | 53 | /** Endpoint number of the CDC device-to-host data IN endpoint. */ 54 | #define CDC_TX_EPNUM 3 55 | 56 | /** Endpoint number of the CDC host-to-device data OUT endpoint. */ 57 | #define CDC_RX_EPNUM 4 58 | 59 | /** Size in bytes of the CDC device-to-host notification IN endpoint. */ 60 | #define CDC_NOTIFICATION_EPSIZE 8 61 | 62 | /** Size in bytes of the CDC data IN and OUT endpoints. */ 63 | #define CDC_TXRX_EPSIZE 64 64 | 65 | /* Type Defines: */ 66 | /** Type define for the device configuration descriptor structure. This must be defined in the 67 | * application code, as the configuration descriptor contains several sub-descriptors which 68 | * vary between devices, and which describe the device's usage to the host. 69 | */ 70 | typedef struct 71 | { 72 | USB_Descriptor_Configuration_Header_t Config; 73 | USB_Descriptor_Interface_t CDC_CCI_Interface; 74 | CDC_FUNCTIONAL_DESCRIPTOR(2) CDC_Functional_IntHeader; 75 | CDC_FUNCTIONAL_DESCRIPTOR(1) CDC_Functional_AbstractControlManagement; 76 | CDC_FUNCTIONAL_DESCRIPTOR(2) CDC_Functional_Union; 77 | USB_Descriptor_Endpoint_t CDC_NotificationEndpoint; 78 | USB_Descriptor_Interface_t CDC_DCI_Interface; 79 | USB_Descriptor_Endpoint_t CDC_DataOutEndpoint; 80 | USB_Descriptor_Endpoint_t CDC_DataInEndpoint; 81 | } USB_Descriptor_Configuration_t; 82 | 83 | /* Function Prototypes: */ 84 | uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue, 85 | const uint8_t wIndex, 86 | void** const DescriptorAddress) ATTR_WARN_UNUSED_RESULT ATTR_NON_NULL_PTR_ARG(3); 87 | 88 | #endif 89 | -------------------------------------------------------------------------------- /software/firmwares/atmegaxxu2/arduino-usbserial/makefile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/peng-zhihui/Roboard-Pro/920538e04199dee27125e3e974f43b122835794e/software/firmwares/atmegaxxu2/arduino-usbserial/makefile -------------------------------------------------------------------------------- /software/firmwares/atmegaxxu2/arduino-usbserial/readme.txt: -------------------------------------------------------------------------------- 1 | To setup the project and upload the Arduino usbserial application firmware to an ATMEGA8U2 using the Arduino USB DFU bootloader: 2 | 1. unpack the source into LUFA's Projects directory 3 | 2. set ARDUINO_MODEL_PID in the makefile as appropriate 4 | 3. do "make clean; make" 5 | 4. put the 8U2 into USB DFU mode: 6 | 4.a. assert and hold the 8U2's RESET line 7 | 4.b. assert and hold the 8U2's HWB line 8 | 4.c. release the 8U2's RESET line 9 | 4.d. release the 8U2's HWB line 10 | 5. confirm that the board enumerates as either "Arduino Uno DFU" or "Arduino Mega 2560 DFU" 11 | 6. do "make dfu" (OS X or Linux - dfu-programmer must be installed first) or "make flip" (Windows - Flip must be installed first) 12 | 13 | Check that the board enumerates as either "Arduino Uno" or "Arduino Mega 2560". Test by uploading a new Arduino sketch from the Arduino IDE. 14 | -------------------------------------------------------------------------------- /software/firmwares/wifishield/binary/wifiHD.elf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/peng-zhihui/Roboard-Pro/920538e04199dee27125e3e974f43b122835794e/software/firmwares/wifishield/binary/wifiHD.elf -------------------------------------------------------------------------------- /software/firmwares/wifishield/binary/wifiHD_2_1.elf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/peng-zhihui/Roboard-Pro/920538e04199dee27125e3e974f43b122835794e/software/firmwares/wifishield/binary/wifiHD_2_1.elf -------------------------------------------------------------------------------- /software/firmwares/wifishield/binary/wifi_dnld.elf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/peng-zhihui/Roboard-Pro/920538e04199dee27125e3e974f43b122835794e/software/firmwares/wifishield/binary/wifi_dnld.elf -------------------------------------------------------------------------------- /software/firmwares/wifishield/binary/wifi_dnld_2_1.elf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/peng-zhihui/Roboard-Pro/920538e04199dee27125e3e974f43b122835794e/software/firmwares/wifishield/binary/wifi_dnld_2_1.elf -------------------------------------------------------------------------------- /software/firmwares/wifishield/scripts/ArduinoWifiShield_upgrade_mac.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | WIFI_FW_PATH="/hardware/arduino/avr/firmwares/wifishield/binary" 4 | AVR_TOOLS_PATH="/hardware/tools/avr/bin" 5 | 6 | progname=$0 7 | 8 | usage () { 9 | cat <&2 83 | usage 84 | exit 1 85 | ;; 86 | :) 87 | echo "Option -$OPTARG requires an argument." >&2 88 | exit 1 89 | ;; 90 | esac 91 | done 92 | else 93 | echo "You are not root!\n" 94 | fi 95 | 96 | shift $(($OPTIND - 1)) 97 | -------------------------------------------------------------------------------- /software/firmwares/wifishield/wifiHD/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | wifiHD 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.buildLocation 30 | ${workspace_loc:/wifiHD/Debug} 31 | 32 | 33 | org.eclipse.cdt.make.core.contents 34 | org.eclipse.cdt.make.core.activeConfigSettings 35 | 36 | 37 | org.eclipse.cdt.make.core.enableAutoBuild 38 | false 39 | 40 | 41 | org.eclipse.cdt.make.core.enableCleanBuild 42 | true 43 | 44 | 45 | org.eclipse.cdt.make.core.enableFullBuild 46 | true 47 | 48 | 49 | org.eclipse.cdt.make.core.stopOnError 50 | true 51 | 52 | 53 | org.eclipse.cdt.make.core.useDefaultBuildCmd 54 | true 55 | 56 | 57 | 58 | 59 | org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder 60 | 61 | 62 | 63 | 64 | 65 | com.atmel.avr32.core.nature 66 | org.eclipse.cdt.core.cnature 67 | org.eclipse.cdt.managedbuilder.core.managedBuildNature 68 | org.eclipse.cdt.managedbuilder.core.ScannerConfigNature 69 | 70 | 71 | 72 | UC3 Software Framework 73 | 2 74 | framework:/com.atmel.avr32.sf.uc3 75 | 76 | 77 | 78 | -------------------------------------------------------------------------------- /software/firmwares/wifishield/wifiHD/Release/wifiHD.elf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/peng-zhihui/Roboard-Pro/920538e04199dee27125e3e974f43b122835794e/software/firmwares/wifishield/wifiHD/Release/wifiHD.elf -------------------------------------------------------------------------------- /software/firmwares/wifishield/wifiHD/src/CONFIG/conf_at45dbx.h: -------------------------------------------------------------------------------- 1 | /* This header file is part of the ATMEL AVR-UC3-SoftwareFramework-1.7.0 Release */ 2 | 3 | /*This file is prepared for Doxygen automatic documentation generation.*/ 4 | /*! \file ********************************************************************* 5 | * 6 | * \brief AT45DBX configuration file. 7 | * 8 | * This file contains the possible external configuration of the AT45DBX. 9 | * 10 | * - Compiler: IAR EWAVR32 and GNU GCC for AVR32 11 | * - Supported devices: All AVR32 devices with an SPI module can be used. 12 | * - AppNote: 13 | * 14 | * \author Atmel Corporation: http://www.atmel.com \n 15 | * Support and FAQ: http://support.atmel.no/ 16 | * 17 | ******************************************************************************/ 18 | 19 | /* Copyright (c) 2009 Atmel Corporation. All rights reserved. 20 | * 21 | * Redistribution and use in source and binary forms, with or without 22 | * modification, are permitted provided that the following conditions are met: 23 | * 24 | * 1. Redistributions of source code must retain the above copyright notice, this 25 | * list of conditions and the following disclaimer. 26 | * 27 | * 2. Redistributions in binary form must reproduce the above copyright notice, 28 | * this list of conditions and the following disclaimer in the documentation 29 | * and/or other materials provided with the distribution. 30 | * 31 | * 3. The name of Atmel may not be used to endorse or promote products derived 32 | * from this software without specific prior written permission. 33 | * 34 | * 4. This software may only be redistributed and used in connection with an Atmel 35 | * AVR product. 36 | * 37 | * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED 38 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 39 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE 40 | * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR 41 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 42 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 43 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 44 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 45 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 46 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE 47 | * 48 | */ 49 | 50 | #ifndef _CONF_AT45DBX_H_ 51 | #define _CONF_AT45DBX_H_ 52 | 53 | 54 | #include "conf_access.h" 55 | 56 | #if AT45DBX_MEM == DISABLE 57 | #error conf_at45dbx.h is #included although AT45DBX_MEM is disabled 58 | #endif 59 | 60 | 61 | #include "at45dbx.h" 62 | 63 | 64 | //_____ D E F I N I T I O N S ______________________________________________ 65 | 66 | //! Size of AT45DBX data flash memories to manage. 67 | #define AT45DBX_MEM_SIZE AT45DBX_1MB 68 | 69 | //! Number of AT45DBX components to manage. 70 | #define AT45DBX_MEM_CNT 1 71 | 72 | //! First chip select used by AT45DBX components on the SPI module instance. 73 | //! AT45DBX_SPI_NPCS0_PIN always corresponds to this first NPCS, whatever it is. 74 | #define AT45DBX_SPI_FIRST_NPCS AT45DBX_SPI_NPCS 75 | 76 | //! SPI master speed in Hz. 77 | #define AT45DBX_SPI_MASTER_SPEED 12000000 78 | 79 | //! Number of bits in each SPI transfer. 80 | #define AT45DBX_SPI_BITS 8 81 | 82 | 83 | #endif // _CONF_AT45DBX_H_ 84 | -------------------------------------------------------------------------------- /software/firmwares/wifishield/wifiHD/src/CONFIG/conf_sd_mmc_spi.h: -------------------------------------------------------------------------------- 1 | /* This header file is part of the ATMEL AVR-UC3-SoftwareFramework-1.7.0 Release */ 2 | 3 | /*This file is prepared for Doxygen automatic documentation generation.*/ 4 | /*! \file ********************************************************************* 5 | * 6 | * \brief SD/MMC configuration file. 7 | * 8 | * This file contains the possible external configuration of the SD/MMC. 9 | * 10 | * - Compiler: IAR EWAVR32 and GNU GCC for AVR32 11 | * - Supported devices: All AVR32 devices with an SPI module can be used. 12 | * - AppNote: 13 | * 14 | * \author Atmel Corporation: http://www.atmel.com \n 15 | * Support and FAQ: http://support.atmel.no/ 16 | * 17 | ******************************************************************************/ 18 | 19 | /* Copyright (c) 2009 Atmel Corporation. All rights reserved. 20 | * 21 | * Redistribution and use in source and binary forms, with or without 22 | * modification, are permitted provided that the following conditions are met: 23 | * 24 | * 1. Redistributions of source code must retain the above copyright notice, this 25 | * list of conditions and the following disclaimer. 26 | * 27 | * 2. Redistributions in binary form must reproduce the above copyright notice, 28 | * this list of conditions and the following disclaimer in the documentation 29 | * and/or other materials provided with the distribution. 30 | * 31 | * 3. The name of Atmel may not be used to endorse or promote products derived 32 | * from this software without specific prior written permission. 33 | * 34 | * 4. This software may only be redistributed and used in connection with an Atmel 35 | * AVR product. 36 | * 37 | * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED 38 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 39 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE 40 | * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR 41 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 42 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 43 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 44 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 45 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 46 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE 47 | * 48 | */ 49 | 50 | #ifndef _CONF_SD_MMC_SPI_H_ 51 | #define _CONF_SD_MMC_SPI_H_ 52 | 53 | 54 | #include "conf_access.h" 55 | 56 | #if SD_MMC_SPI_MEM == DISABLE 57 | #error conf_sd_mmc_spi.h is #included although SD_MMC_SPI_MEM is disabled 58 | #endif 59 | 60 | 61 | #include "sd_mmc_spi.h" 62 | 63 | 64 | //_____ D E F I N I T I O N S ______________________________________________ 65 | 66 | //! SPI master speed in Hz. 67 | #define SD_MMC_SPI_MASTER_SPEED 12000000 68 | 69 | //! Number of bits in each SPI transfer. 70 | #define SD_MMC_SPI_BITS 8 71 | 72 | 73 | #endif // _CONF_SD_MMC_SPI_H_ 74 | -------------------------------------------------------------------------------- /software/firmwares/wifishield/wifiHD/src/SOFTWARE_FRAMEWORK/ASM/trampoline.x: -------------------------------------------------------------------------------- 1 | /* This file is part of the ATMEL AVR32-SoftwareFramework-AT32UC3A-1.4.0 Release */ 2 | 3 | /*This file is prepared for Doxygen automatic documentation generation.*/ 4 | /*! \file ********************************************************************* 5 | * 6 | * \brief AVR32 UC3 ISP trampoline. 7 | * 8 | * In order to be able to program a project with both BatchISP and JTAGICE mkII 9 | * without having to take the general-purpose fuses into consideration, add this 10 | * file to the project and change the program entry point to _trampoline. 11 | * 12 | * The pre-programmed ISP will be erased if JTAGICE mkII is used. 13 | * 14 | * - Compiler: GNU GCC for AVR32 15 | * - Supported devices: All AVR32UC devices can be used. 16 | * 17 | * \author Atmel Corporation: http://www.atmel.com \n 18 | * Support and FAQ: http://support.atmel.no/ 19 | * 20 | ******************************************************************************/ 21 | 22 | /* Copyright (C) 2006-2008, Atmel Corporation All rights reserved. 23 | * 24 | * Redistribution and use in source and binary forms, with or without 25 | * modification, are permitted provided that the following conditions are met: 26 | * 27 | * 1. Redistributions of source code must retain the above copyright notice, 28 | * this list of conditions and the following disclaimer. 29 | * 30 | * 2. Redistributions in binary form must reproduce the above copyright notice, 31 | * this list of conditions and the following disclaimer in the documentation 32 | * and/or other materials provided with the distribution. 33 | * 34 | * 3. The name of ATMEL may not be used to endorse or promote products derived 35 | * from this software without specific prior written permission. 36 | * 37 | * THIS SOFTWARE IS PROVIDED BY ATMEL ``AS IS'' AND ANY EXPRESS OR IMPLIED 38 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 39 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE EXPRESSLY AND 40 | * SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, 41 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 42 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 43 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 44 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 45 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 46 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 47 | */ 48 | 49 | 50 | #include "conf_isp.h" 51 | 52 | 53 | //! @{ 54 | //! \verbatim 55 | 56 | 57 | // This must be linked @ 0x80000000 if it is to be run upon reset. 58 | .section .reset, "ax", @progbits 59 | 60 | 61 | .global _trampoline 62 | .type _trampoline, @function 63 | _trampoline: 64 | // Jump to program start. 65 | rjmp program_start 66 | 67 | .org PROGRAM_START_OFFSET 68 | program_start: 69 | // Jump to the C runtime startup routine. 70 | lda.w pc, _stext 71 | 72 | 73 | //! \endverbatim 74 | //! @} 75 | -------------------------------------------------------------------------------- /software/firmwares/wifishield/wifiHD/src/SOFTWARE_FRAMEWORK/COMPONENTS/WIFI/HD/v2.7.0/UCR1/GCC/lib_ucr1_hd_sdio_v2.7.0.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/peng-zhihui/Roboard-Pro/920538e04199dee27125e3e974f43b122835794e/software/firmwares/wifishield/wifiHD/src/SOFTWARE_FRAMEWORK/COMPONENTS/WIFI/HD/v2.7.0/UCR1/GCC/lib_ucr1_hd_sdio_v2.7.0.a -------------------------------------------------------------------------------- /software/firmwares/wifishield/wifiHD/src/SOFTWARE_FRAMEWORK/COMPONENTS/WIFI/HD/v2.7.0/UCR1/GCC/lib_ucr1_hd_spi_v2.7.0.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/peng-zhihui/Roboard-Pro/920538e04199dee27125e3e974f43b122835794e/software/firmwares/wifishield/wifiHD/src/SOFTWARE_FRAMEWORK/COMPONENTS/WIFI/HD/v2.7.0/UCR1/GCC/lib_ucr1_hd_spi_v2.7.0.a -------------------------------------------------------------------------------- /software/firmwares/wifishield/wifiHD/src/SOFTWARE_FRAMEWORK/COMPONENTS/WIFI/HD/v2.7.0/UCR1/GCC/lib_ucr1_hd_wl_sta_intwpa_v2.7.0.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/peng-zhihui/Roboard-Pro/920538e04199dee27125e3e974f43b122835794e/software/firmwares/wifishield/wifiHD/src/SOFTWARE_FRAMEWORK/COMPONENTS/WIFI/HD/v2.7.0/UCR1/GCC/lib_ucr1_hd_wl_sta_intwpa_v2.7.0.a -------------------------------------------------------------------------------- /software/firmwares/wifishield/wifiHD/src/SOFTWARE_FRAMEWORK/COMPONENTS/WIFI/HD/v2.7.0/UCR2/GCC/lib_ucr2_hd_sdio_v2.7.0.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/peng-zhihui/Roboard-Pro/920538e04199dee27125e3e974f43b122835794e/software/firmwares/wifishield/wifiHD/src/SOFTWARE_FRAMEWORK/COMPONENTS/WIFI/HD/v2.7.0/UCR2/GCC/lib_ucr2_hd_sdio_v2.7.0.a -------------------------------------------------------------------------------- /software/firmwares/wifishield/wifiHD/src/SOFTWARE_FRAMEWORK/COMPONENTS/WIFI/HD/v2.7.0/UCR2/GCC/lib_ucr2_hd_spi_v2.7.0.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/peng-zhihui/Roboard-Pro/920538e04199dee27125e3e974f43b122835794e/software/firmwares/wifishield/wifiHD/src/SOFTWARE_FRAMEWORK/COMPONENTS/WIFI/HD/v2.7.0/UCR2/GCC/lib_ucr2_hd_spi_v2.7.0.a -------------------------------------------------------------------------------- /software/firmwares/wifishield/wifiHD/src/SOFTWARE_FRAMEWORK/COMPONENTS/WIFI/HD/v2.7.0/UCR2/GCC/lib_ucr2_hd_wl_sta_intwpa_v2.7.0.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/peng-zhihui/Roboard-Pro/920538e04199dee27125e3e974f43b122835794e/software/firmwares/wifishield/wifiHD/src/SOFTWARE_FRAMEWORK/COMPONENTS/WIFI/HD/v2.7.0/UCR2/GCC/lib_ucr2_hd_wl_sta_intwpa_v2.7.0.a -------------------------------------------------------------------------------- /software/firmwares/wifishield/wifiHD/src/SOFTWARE_FRAMEWORK/COMPONENTS/WIFI/HD/v2.7.0/revision.txt: -------------------------------------------------------------------------------- 1 | Revision: 2491 2 | -------------------------------------------------------------------------------- /software/firmwares/wifishield/wifiHD/src/SOFTWARE_FRAMEWORK/COMPONENTS/WIFI/HD/wl_os.h: -------------------------------------------------------------------------------- 1 | #ifndef WL_OS_H 2 | #define WL_OS_H 3 | 4 | #include 5 | #include 6 | 7 | void *owl_os_alloc(size_t size); 8 | void *owl_os_realloc(void *ptr, size_t size); 9 | void owl_os_free(void *p); 10 | void *owl_os_memcpy(void *dst, const void *src, size_t n); 11 | void *owl_os_memset(void *s, int c, size_t n); 12 | void *owl_os_memmove(void *dst, const void *src, size_t n); 13 | size_t owl_os_strlen(char *s); 14 | char *owl_os_strncpy(char *dst, const char *src, size_t n); 15 | int owl_os_strncmp(const char *s1, const char *s2, size_t n); 16 | int owl_os_strcmp(const char *s1, const char *s2); 17 | char *owl_os_strcpy(char *dst, const char *src); 18 | char *owl_os_strdup(const char *s); 19 | char *owl_os_strndup(const char *s, size_t n); 20 | int owl_os_memcmp(const void *s1, const void *s2, size_t n); 21 | long int owl_os_strtol(const char *nptr, char **endptr, int base); 22 | char *owl_os_strchr(const char *s, int c); 23 | char *owl_os_strrchr(const char *s, int c); 24 | int owl_os_strcasecmp(const char *s1, const char *s2); 25 | char *owl_os_strstr(const char *haystack, const char *needle); 26 | 27 | int owl_os_snprintf(char *str, size_t size, const char *format, ...) 28 | __attribute__((format(printf, 3, 4))); 29 | 30 | int owl_os_vprintf(const char *format, va_list arg); /* debug only */ 31 | int owl_os_printf(const char *format, ...) /* debug only */ 32 | __attribute__((format(printf, 1, 2))); 33 | 34 | #endif /* WL_OS_H */ 35 | 36 | -------------------------------------------------------------------------------- /software/firmwares/wifishield/wifiHD/src/SOFTWARE_FRAMEWORK/DRIVERS/EBI/SMC/smc.h: -------------------------------------------------------------------------------- 1 | /* This header file is part of the ATMEL AVR-UC3-SoftwareFramework-1.7.0 Release */ 2 | 3 | /*This file is prepared for Doxygen automatic documentation generation.*/ 4 | /*! \file ********************************************************************* 5 | * 6 | * \brief SMC on EBI driver for AVR32 UC3. 7 | * 8 | * - Compiler: IAR EWAVR32 and GNU GCC for AVR32 9 | * - Supported devices: All AVR32 devices with a SMC module can be used. 10 | * - AppNote: 11 | * 12 | * \author Atmel Corporation: http://www.atmel.com \n 13 | * Support and FAQ: http://support.atmel.no/ 14 | * 15 | ******************************************************************************/ 16 | 17 | /* Copyright (c) 2009 Atmel Corporation. All rights reserved. 18 | * 19 | * Redistribution and use in source and binary forms, with or without 20 | * modification, are permitted provided that the following conditions are met: 21 | * 22 | * 1. Redistributions of source code must retain the above copyright notice, this 23 | * list of conditions and the following disclaimer. 24 | * 25 | * 2. Redistributions in binary form must reproduce the above copyright notice, 26 | * this list of conditions and the following disclaimer in the documentation 27 | * and/or other materials provided with the distribution. 28 | * 29 | * 3. The name of Atmel may not be used to endorse or promote products derived 30 | * from this software without specific prior written permission. 31 | * 32 | * 4. This software may only be redistributed and used in connection with an Atmel 33 | * AVR product. 34 | * 35 | * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED 36 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 37 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE 38 | * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR 39 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 40 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 41 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 42 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 43 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 44 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE 45 | * 46 | */ 47 | 48 | #ifndef _SMC_H_ 49 | #define _SMC_H_ 50 | 51 | #include 52 | 53 | #include "compiler.h" 54 | #include "conf_ebi.h" 55 | 56 | /*! \brief Initializes the AVR32 SMC module and the connected SRAM(s). 57 | * \param hsb_hz HSB frequency in Hz (the HSB frequency is applied to the SMC). 58 | * \note Each access to the SMC address space validates the mode of the SMC 59 | * and generates an operation corresponding to this mode. 60 | */ 61 | extern void smc_init(unsigned long hsb_hz); 62 | 63 | /*! \brief Return the size of the peripheral connected . 64 | * \param cs The chip select value 65 | */ 66 | extern unsigned char smc_get_cs_size(unsigned char cs); 67 | 68 | #endif // _SMC_H_ 69 | -------------------------------------------------------------------------------- /software/firmwares/wifishield/wifiHD/src/SOFTWARE_FRAMEWORK/SERVICES/DELAY/delay.c: -------------------------------------------------------------------------------- 1 | /* This source file is part of the ATMEL AVR-UC3-SoftwareFramework-1.7.0 Release */ 2 | 3 | /*This file is prepared for Doxygen automatic documentation generation.*/ 4 | /*! \file ****************************************************************** 5 | * 6 | * \brief Management of the delays. 7 | * 8 | * This file manages the "delays", with or without an OS. 9 | * 10 | * - Compiler: IAR EWAVR32 and GNU GCC for AVR32 11 | * - Supported devices: All AVR32 devices. 12 | * - AppNote: 13 | * 14 | * \author Atmel Corporation: http://www.atmel.com \n 15 | * Support and FAQ: http://support.atmel.no/ 16 | * 17 | ***************************************************************************/ 18 | 19 | /* Copyright (c) 2009 Atmel Corporation. All rights reserved. 20 | * 21 | * Redistribution and use in source and binary forms, with or without 22 | * modification, are permitted provided that the following conditions are met: 23 | * 24 | * 1. Redistributions of source code must retain the above copyright notice, this 25 | * list of conditions and the following disclaimer. 26 | * 27 | * 2. Redistributions in binary form must reproduce the above copyright notice, 28 | * this list of conditions and the following disclaimer in the documentation 29 | * and/or other materials provided with the distribution. 30 | * 31 | * 3. The name of Atmel may not be used to endorse or promote products derived 32 | * from this software without specific prior written permission. 33 | * 34 | * 4. This software may only be redistributed and used in connection with an Atmel 35 | * AVR product. 36 | * 37 | * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED 38 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 39 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE 40 | * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR 41 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 42 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 43 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 44 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 45 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 46 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE 47 | * 48 | */ 49 | 50 | //_____ I N C L U D E S ___________________________________________________ 51 | 52 | #include "delay.h" 53 | 54 | 55 | //_____ M A C R O S ________________________________________________________ 56 | 57 | 58 | //_____ D E F I N I T I O N S ______________________________________________ 59 | 60 | //! CPU frequency 61 | #ifndef FREERTOS_USED 62 | static unsigned long s_fcpu_hz; 63 | #endif 64 | #if (defined NUTOS_USED) 65 | extern void NutSleep(unsigned long ms); 66 | #endif 67 | 68 | //_____ D E C L A R A T I O N S ____________________________________________ 69 | 70 | void delay_init(unsigned long fcpu_hz) 71 | { 72 | #ifndef FREERTOS_USED 73 | s_fcpu_hz = fcpu_hz; 74 | #endif 75 | } 76 | 77 | 78 | void delay_ms(unsigned long delay) 79 | { 80 | #if (defined FREERTOS_USED) 81 | vTaskDelay( (portTickType)TASK_DELAY_MS(delay) ); 82 | #elif (defined NUTOS_USED) 83 | NutSleep(delay); 84 | #else 85 | cpu_delay_ms(delay, s_fcpu_hz); 86 | #endif 87 | } 88 | -------------------------------------------------------------------------------- /software/firmwares/wifishield/wifiHD/src/SOFTWARE_FRAMEWORK/SERVICES/DELAY/delay.h: -------------------------------------------------------------------------------- 1 | /* This header file is part of the ATMEL AVR-UC3-SoftwareFramework-1.7.0 Release */ 2 | 3 | /*This file is prepared for Doxygen automatic documentation generation.*/ 4 | /*! \file ********************************************************************* 5 | * 6 | * \brief AT32UC3 delay management header file. 7 | * 8 | * This file contains definitions and services to handle "delays". 9 | * 10 | * - Compiler: IAR EWAVR32 and GNU GCC for AVR32 11 | * - Supported devices: All AVR32 AT32UC3 devices can be used. 12 | * - AppNote: 13 | * 14 | * \author Atmel Corporation: http://www.atmel.com \n 15 | * Support and FAQ: http://support.atmel.no/ 16 | * 17 | ******************************************************************************/ 18 | 19 | /* Copyright (c) 2009 Atmel Corporation. All rights reserved. 20 | * 21 | * Redistribution and use in source and binary forms, with or without 22 | * modification, are permitted provided that the following conditions are met: 23 | * 24 | * 1. Redistributions of source code must retain the above copyright notice, this 25 | * list of conditions and the following disclaimer. 26 | * 27 | * 2. Redistributions in binary form must reproduce the above copyright notice, 28 | * this list of conditions and the following disclaimer in the documentation 29 | * and/or other materials provided with the distribution. 30 | * 31 | * 3. The name of Atmel may not be used to endorse or promote products derived 32 | * from this software without specific prior written permission. 33 | * 34 | * 4. This software may only be redistributed and used in connection with an Atmel 35 | * AVR product. 36 | * 37 | * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED 38 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 39 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE 40 | * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR 41 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 42 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 43 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 44 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 45 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 46 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE 47 | * 48 | */ 49 | 50 | #ifndef _DELAY_H_ 51 | #define _DELAY_H_ 52 | 53 | #include "compiler.h" 54 | #ifdef FREERTOS_USED 55 | # include "FreeRTOS.h" 56 | # include "task.h" 57 | #else 58 | # include "cycle_counter.h" 59 | #endif 60 | 61 | 62 | /*! 63 | * \brief Initialize the delay driver. 64 | * 65 | * \param fcpu_hz: CPU frequency in Hz. 66 | */ 67 | extern void delay_init(unsigned long fcpu_hz); 68 | 69 | 70 | /*! 71 | * \brief Waits during at least the specified delay (in millisecond) before returning. 72 | * 73 | * Note that in the case of FreeRTOS, the function will delay the current task for a given number of ms. 74 | * 75 | * \param delay: Number of millisecond to wait. 76 | */ 77 | extern void delay_ms(unsigned long delay); 78 | 79 | 80 | #endif // _DELAY_H_ 81 | -------------------------------------------------------------------------------- /software/firmwares/wifishield/wifiHD/src/SOFTWARE_FRAMEWORK/SERVICES/LWIP/lwip-1.3.2/src/core/ipv4/ip_addr.c: -------------------------------------------------------------------------------- 1 | /* This source file is part of the ATMEL AVR-UC3-SoftwareFramework-1.7.0 Release */ 2 | 3 | /** 4 | * @file 5 | * This is the IPv4 address tools implementation. 6 | * 7 | */ 8 | 9 | /* 10 | * Copyright (c) 2001-2004 Swedish Institute of Computer Science. 11 | * All rights reserved. 12 | * 13 | * Redistribution and use in source and binary forms, with or without modification, 14 | * are permitted provided that the following conditions are met: 15 | * 16 | * 1. Redistributions of source code must retain the above copyright notice, 17 | * this list of conditions and the following disclaimer. 18 | * 2. Redistributions in binary form must reproduce the above copyright notice, 19 | * this list of conditions and the following disclaimer in the documentation 20 | * and/or other materials provided with the distribution. 21 | * 3. The name of the author may not be used to endorse or promote products 22 | * derived from this software without specific prior written permission. 23 | * 24 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 25 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 26 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 27 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 28 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 29 | * OF 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) ARISING 32 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 33 | * OF SUCH DAMAGE. 34 | * 35 | * This file is part of the lwIP TCP/IP stack. 36 | * 37 | * Author: Adam Dunkels 38 | * 39 | */ 40 | 41 | #include "lwip/opt.h" 42 | #include "lwip/ip_addr.h" 43 | #include "lwip/inet.h" 44 | #include "lwip/netif.h" 45 | 46 | #define IP_ADDR_ANY_VALUE 0x00000000UL 47 | #define IP_ADDR_BROADCAST_VALUE 0xffffffffUL 48 | 49 | /* used by IP_ADDR_ANY and IP_ADDR_BROADCAST in ip_addr.h */ 50 | const struct ip_addr ip_addr_any = { IP_ADDR_ANY_VALUE }; 51 | const struct ip_addr ip_addr_broadcast = { IP_ADDR_BROADCAST_VALUE }; 52 | 53 | /** 54 | * Determine if an address is a broadcast address on a network interface 55 | * 56 | * @param addr address to be checked 57 | * @param netif the network interface against which the address is checked 58 | * @return returns non-zero if the address is a broadcast address 59 | */ 60 | u8_t ip_addr_isbroadcast(struct ip_addr *addr, struct netif *netif) 61 | { 62 | u32_t addr2test; 63 | 64 | addr2test = addr->addr; 65 | /* all ones (broadcast) or all zeroes (old skool broadcast) */ 66 | if ((~addr2test == IP_ADDR_ANY_VALUE) || 67 | (addr2test == IP_ADDR_ANY_VALUE)) 68 | return 1; 69 | /* no broadcast support on this network interface? */ 70 | else if ((netif->flags & NETIF_FLAG_BROADCAST) == 0) 71 | /* the given address cannot be a broadcast address 72 | * nor can we check against any broadcast addresses */ 73 | return 0; 74 | /* address matches network interface address exactly? => no broadcast */ 75 | else if (addr2test == netif->ip_addr.addr) 76 | return 0; 77 | /* on the same (sub) network... */ 78 | else if (ip_addr_netcmp(addr, &(netif->ip_addr), &(netif->netmask)) 79 | /* ...and host identifier bits are all ones? =>... */ 80 | && ((addr2test & ~netif->netmask.addr) == 81 | (IP_ADDR_BROADCAST_VALUE & ~netif->netmask.addr))) 82 | /* => network broadcast address */ 83 | return 1; 84 | else 85 | return 0; 86 | } 87 | -------------------------------------------------------------------------------- /software/firmwares/wifishield/wifiHD/src/SOFTWARE_FRAMEWORK/SERVICES/LWIP/lwip-1.3.2/src/include/ipv4/lwip/inet_chksum.h: -------------------------------------------------------------------------------- 1 | /* This header file is part of the ATMEL AVR-UC3-SoftwareFramework-1.7.0 Release */ 2 | 3 | /* 4 | * Copyright (c) 2001-2004 Swedish Institute of Computer Science. 5 | * All rights reserved. 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 | * Author: Adam Dunkels 32 | * 33 | */ 34 | #ifndef __LWIP_INET_CHKSUM_H__ 35 | #define __LWIP_INET_CHKSUM_H__ 36 | 37 | #include "lwip/opt.h" 38 | 39 | #include "lwip/pbuf.h" 40 | #include "lwip/ip_addr.h" 41 | 42 | #ifdef __cplusplus 43 | extern "C" { 44 | #endif 45 | 46 | u16_t inet_chksum(void *dataptr, u16_t len); 47 | u16_t inet_chksum_pbuf(struct pbuf *p); 48 | u16_t inet_chksum_pseudo(struct pbuf *p, 49 | struct ip_addr *src, struct ip_addr *dest, 50 | u8_t proto, u16_t proto_len); 51 | #if LWIP_UDPLITE 52 | u16_t inet_chksum_pseudo_partial(struct pbuf *p, 53 | struct ip_addr *src, struct ip_addr *dest, 54 | u8_t proto, u16_t proto_len, u16_t chksum_len); 55 | #endif 56 | 57 | #ifdef __cplusplus 58 | } 59 | #endif 60 | 61 | #endif /* __LWIP_INET_H__ */ 62 | 63 | -------------------------------------------------------------------------------- /software/firmwares/wifishield/wifiHD/src/SOFTWARE_FRAMEWORK/SERVICES/LWIP/lwip-1.3.2/src/include/ipv4/lwip/ip_frag.h: -------------------------------------------------------------------------------- 1 | /* This header file is part of the ATMEL AVR-UC3-SoftwareFramework-1.7.0 Release */ 2 | 3 | /* 4 | * Copyright (c) 2001-2004 Swedish Institute of Computer Science. 5 | * All rights reserved. 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 | * Author: Jani Monoses 32 | * 33 | */ 34 | 35 | #ifndef __LWIP_IP_FRAG_H__ 36 | #define __LWIP_IP_FRAG_H__ 37 | 38 | #include "lwip/opt.h" 39 | #include "lwip/err.h" 40 | #include "lwip/pbuf.h" 41 | #include "lwip/netif.h" 42 | #include "lwip/ip_addr.h" 43 | #include "lwip/ip.h" 44 | 45 | #ifdef __cplusplus 46 | extern "C" { 47 | #endif 48 | 49 | #if IP_REASSEMBLY 50 | /* The IP reassembly timer interval in milliseconds. */ 51 | #define IP_TMR_INTERVAL 1000 52 | 53 | /* IP reassembly helper struct. 54 | * This is exported because memp needs to know the size. 55 | */ 56 | struct ip_reassdata { 57 | struct ip_reassdata *next; 58 | struct pbuf *p; 59 | struct ip_hdr iphdr; 60 | u16_t datagram_len; 61 | u8_t flags; 62 | u8_t timer; 63 | }; 64 | 65 | void ip_reass_init(void); 66 | void ip_reass_tmr(void); 67 | struct pbuf * ip_reass(struct pbuf *p); 68 | #endif /* IP_REASSEMBLY */ 69 | 70 | #if IP_FRAG 71 | err_t ip_frag(struct pbuf *p, struct netif *netif, struct ip_addr *dest); 72 | #endif /* IP_FRAG */ 73 | 74 | #ifdef __cplusplus 75 | } 76 | #endif 77 | 78 | #endif /* __LWIP_IP_FRAG_H__ */ 79 | -------------------------------------------------------------------------------- /software/firmwares/wifishield/wifiHD/src/SOFTWARE_FRAMEWORK/SERVICES/LWIP/lwip-1.3.2/src/include/lwip/def.h: -------------------------------------------------------------------------------- 1 | /* This header file is part of the ATMEL AVR-UC3-SoftwareFramework-1.7.0 Release */ 2 | 3 | /* 4 | * Copyright (c) 2001-2004 Swedish Institute of Computer Science. 5 | * All rights reserved. 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 | * Author: Adam Dunkels 32 | * 33 | */ 34 | #ifndef __LWIP_DEF_H__ 35 | #define __LWIP_DEF_H__ 36 | 37 | /* this might define NULL already */ 38 | #include "lwip/arch.h" 39 | 40 | #define LWIP_MAX(x , y) (((x) > (y)) ? (x) : (y)) 41 | #define LWIP_MIN(x , y) (((x) < (y)) ? (x) : (y)) 42 | 43 | #ifndef NULL 44 | #define NULL ((void *)0) 45 | #endif 46 | 47 | 48 | #endif /* __LWIP_DEF_H__ */ 49 | 50 | -------------------------------------------------------------------------------- /software/firmwares/wifishield/wifiHD/src/SOFTWARE_FRAMEWORK/SERVICES/LWIP/lwip-1.3.2/src/include/lwip/err.h: -------------------------------------------------------------------------------- 1 | /* This header file is part of the ATMEL AVR-UC3-SoftwareFramework-1.7.0 Release */ 2 | 3 | /* 4 | * Copyright (c) 2001-2004 Swedish Institute of Computer Science. 5 | * All rights reserved. 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 | * Author: Adam Dunkels 32 | * 33 | */ 34 | #ifndef __LWIP_ERR_H__ 35 | #define __LWIP_ERR_H__ 36 | 37 | #include "lwip/opt.h" 38 | #include "lwip/arch.h" 39 | 40 | #ifdef __cplusplus 41 | extern "C" { 42 | #endif 43 | 44 | /** Define LWIP_ERR_T in cc.h if you want to use 45 | * a different type for your platform (must be signed). */ 46 | #ifdef LWIP_ERR_T 47 | typedef LWIP_ERR_T err_t; 48 | #else /* LWIP_ERR_T */ 49 | typedef s8_t err_t; 50 | #endif /* LWIP_ERR_T*/ 51 | 52 | /* Definitions for error constants. */ 53 | 54 | #define ERR_OK 0 /* No error, everything OK. */ 55 | #define ERR_MEM -1 /* Out of memory error. */ 56 | #define ERR_BUF -2 /* Buffer error. */ 57 | #define ERR_TIMEOUT -3 /* Timeout. */ 58 | #define ERR_RTE -4 /* Routing problem. */ 59 | 60 | #define ERR_IS_FATAL(e) ((e) < ERR_RTE) 61 | 62 | #define ERR_ABRT -5 /* Connection aborted. */ 63 | #define ERR_RST -6 /* Connection reset. */ 64 | #define ERR_CLSD -7 /* Connection closed. */ 65 | #define ERR_CONN -8 /* Not connected. */ 66 | 67 | #define ERR_VAL -9 /* Illegal value. */ 68 | 69 | #define ERR_ARG -10 /* Illegal argument. */ 70 | 71 | #define ERR_USE -11 /* Address in use. */ 72 | 73 | #define ERR_IF -12 /* Low-level netif error */ 74 | #define ERR_ISCONN -13 /* Already connected. */ 75 | 76 | #define ERR_INPROGRESS -14 /* Operation in progress */ 77 | 78 | 79 | #ifdef LWIP_DEBUG 80 | extern const char *lwip_strerr(err_t err); 81 | #else 82 | #define lwip_strerr(x) "" 83 | #endif /* LWIP_DEBUG */ 84 | 85 | #ifdef __cplusplus 86 | } 87 | #endif 88 | 89 | #endif /* __LWIP_ERR_H__ */ 90 | -------------------------------------------------------------------------------- /software/firmwares/wifishield/wifiHD/src/SOFTWARE_FRAMEWORK/SERVICES/LWIP/lwip-1.3.2/src/include/lwip/init.h: -------------------------------------------------------------------------------- 1 | /* This header file is part of the ATMEL AVR-UC3-SoftwareFramework-1.7.0 Release */ 2 | 3 | /* 4 | * Copyright (c) 2001-2004 Swedish Institute of Computer Science. 5 | * All rights reserved. 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 | * Author: Adam Dunkels 32 | * 33 | */ 34 | #ifndef __LWIP_INIT_H__ 35 | #define __LWIP_INIT_H__ 36 | 37 | #include "lwip/opt.h" 38 | 39 | #ifdef __cplusplus 40 | extern "C" { 41 | #endif 42 | 43 | /** X.x.x: Major version of the stack */ 44 | #define LWIP_VERSION_MAJOR 1U 45 | /** x.X.x: Minor version of the stack */ 46 | #define LWIP_VERSION_MINOR 3U 47 | /** x.x.X: Revision of the stack */ 48 | #define LWIP_VERSION_REVISION 2U 49 | /** For release candidates, this is set to 1..254 50 | * For official releases, this is set to 255 (LWIP_RC_RELEASE) 51 | * For development versions (CVS), this is set to 0 (LWIP_RC_DEVELOPMENT) */ 52 | #define LWIP_VERSION_RC 255U 53 | 54 | /** LWIP_VERSION_RC is set to LWIP_RC_RELEASE for official releases */ 55 | #define LWIP_RC_RELEASE 255U 56 | /** LWIP_VERSION_RC is set to LWIP_RC_DEVELOPMENT for CVS versions */ 57 | #define LWIP_RC_DEVELOPMENT 0U 58 | 59 | #define LWIP_VERSION_IS_RELEASE (LWIP_VERSION_RC == LWIP_RC_RELEASE) 60 | #define LWIP_VERSION_IS_DEVELOPMENT (LWIP_VERSION_RC == LWIP_RC_DEVELOPMENT) 61 | #define LWIP_VERSION_IS_RC ((LWIP_VERSION_RC != LWIP_RC_RELEASE) && (LWIP_VERSION_RC != LWIP_RC_DEVELOPMENT)) 62 | 63 | /** Provides the version of the stack */ 64 | #define LWIP_VERSION (LWIP_VERSION_MAJOR << 24 | LWIP_VERSION_MINOR << 16 | \ 65 | LWIP_VERSION_REVISION << 8 | LWIP_VERSION_RC) 66 | 67 | /* Modules initialization */ 68 | void lwip_init(void); 69 | 70 | #ifdef __cplusplus 71 | } 72 | #endif 73 | 74 | #endif /* __LWIP_INIT_H__ */ 75 | -------------------------------------------------------------------------------- /software/firmwares/wifishield/wifiHD/src/SOFTWARE_FRAMEWORK/SERVICES/LWIP/lwip-1.3.2/src/include/lwip/netbuf.h: -------------------------------------------------------------------------------- 1 | /* This header file is part of the ATMEL AVR-UC3-SoftwareFramework-1.7.0 Release */ 2 | 3 | /* 4 | * Copyright (c) 2001-2004 Swedish Institute of Computer Science. 5 | * All rights reserved. 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 | * Author: Adam Dunkels 32 | * 33 | */ 34 | #ifndef __LWIP_NETBUF_H__ 35 | #define __LWIP_NETBUF_H__ 36 | 37 | #include "lwip/opt.h" 38 | #include "lwip/pbuf.h" 39 | #include "lwip/ip_addr.h" 40 | 41 | #ifdef __cplusplus 42 | extern "C" { 43 | #endif 44 | 45 | struct netbuf { 46 | struct pbuf *p, *ptr; 47 | struct ip_addr *addr; 48 | u16_t port; 49 | #if LWIP_NETBUF_RECVINFO 50 | struct ip_addr *toaddr; 51 | u16_t toport; 52 | #endif /* LWIP_NETBUF_RECVINFO */ 53 | }; 54 | 55 | /* Network buffer functions: */ 56 | struct netbuf * netbuf_new (void); 57 | void netbuf_delete (struct netbuf *buf); 58 | void * netbuf_alloc (struct netbuf *buf, u16_t size); 59 | void netbuf_free (struct netbuf *buf); 60 | err_t netbuf_ref (struct netbuf *buf, 61 | const void *dataptr, u16_t size); 62 | void netbuf_chain (struct netbuf *head, 63 | struct netbuf *tail); 64 | 65 | u16_t netbuf_len (struct netbuf *buf); 66 | err_t netbuf_data (struct netbuf *buf, 67 | void **dataptr, u16_t *len); 68 | s8_t netbuf_next (struct netbuf *buf); 69 | void netbuf_first (struct netbuf *buf); 70 | 71 | 72 | #define netbuf_copy_partial(buf, dataptr, len, offset) \ 73 | pbuf_copy_partial((buf)->p, (dataptr), (len), (offset)) 74 | #define netbuf_copy(buf,dataptr,len) netbuf_copy_partial(buf, dataptr, len, 0) 75 | #define netbuf_take(buf, dataptr, len) pbuf_take((buf)->p, dataptr, len) 76 | #define netbuf_len(buf) ((buf)->p->tot_len) 77 | #define netbuf_fromaddr(buf) ((buf)->addr) 78 | #define netbuf_fromport(buf) ((buf)->port) 79 | #if LWIP_NETBUF_RECVINFO 80 | #define netbuf_destaddr(buf) ((buf)->toaddr) 81 | #define netbuf_destport(buf) ((buf)->toport) 82 | #endif /* LWIP_NETBUF_RECVINFO */ 83 | 84 | #ifdef __cplusplus 85 | } 86 | #endif 87 | 88 | #endif /* __LWIP_NETBUF_H__ */ 89 | -------------------------------------------------------------------------------- /software/firmwares/wifishield/wifiHD/src/SOFTWARE_FRAMEWORK/SERVICES/LWIP/lwip-1.3.2/src/include/netif/loopif.h: -------------------------------------------------------------------------------- 1 | /* This header file is part of the ATMEL AVR-UC3-SoftwareFramework-1.7.0 Release */ 2 | 3 | /* 4 | * Copyright (c) 2001-2004 Swedish Institute of Computer Science. 5 | * All rights reserved. 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 | * Author: Adam Dunkels 32 | * 33 | */ 34 | #ifndef __NETIF_LOOPIF_H__ 35 | #define __NETIF_LOOPIF_H__ 36 | 37 | #include "lwip/opt.h" 38 | #include "lwip/netif.h" 39 | #include "lwip/err.h" 40 | 41 | #ifdef __cplusplus 42 | extern "C" { 43 | #endif 44 | 45 | #if !LWIP_NETIF_LOOPBACK_MULTITHREADING 46 | #define loopif_poll netif_poll 47 | #endif /* !LWIP_NETIF_LOOPBACK_MULTITHREADING */ 48 | 49 | err_t loopif_init(struct netif *netif); 50 | 51 | #ifdef __cplusplus 52 | } 53 | #endif 54 | 55 | #endif /* __NETIF_LOOPIF_H__ */ 56 | -------------------------------------------------------------------------------- /software/firmwares/wifishield/wifiHD/src/SOFTWARE_FRAMEWORK/SERVICES/LWIP/lwip-1.3.2/src/include/netif/slipif.h: -------------------------------------------------------------------------------- 1 | /* This header file is part of the ATMEL AVR-UC3-SoftwareFramework-1.7.0 Release */ 2 | 3 | /* 4 | * Copyright (c) 2001, Swedish Institute of Computer Science. 5 | * All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without 8 | * modification, are permitted provided that the following conditions 9 | * are met: 10 | * 1. Redistributions of source code must retain the above copyright 11 | * notice, this list of conditions and the following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 3. Neither the name of the Institute nor the names of its contributors 16 | * may be used to endorse or promote products derived from this software 17 | * without specific prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND 20 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 21 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 22 | * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE 23 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 25 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 26 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 27 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 28 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 29 | * SUCH DAMAGE. 30 | * 31 | * This file is part of the lwIP TCP/IP stack. 32 | * 33 | * Author: Adam Dunkels 34 | * 35 | */ 36 | #ifndef __NETIF_SLIPIF_H__ 37 | #define __NETIF_SLIPIF_H__ 38 | 39 | #include "lwip/netif.h" 40 | 41 | #ifdef __cplusplus 42 | extern "C" { 43 | #endif 44 | 45 | err_t slipif_init(struct netif * netif); 46 | void slipif_poll(struct netif *netif); 47 | 48 | #ifdef __cplusplus 49 | } 50 | #endif 51 | 52 | #endif 53 | 54 | -------------------------------------------------------------------------------- /software/firmwares/wifishield/wifiHD/src/SOFTWARE_FRAMEWORK/SERVICES/LWIP/lwip-1.3.2/src/netif/loopif.c: -------------------------------------------------------------------------------- 1 | /* This source file is part of the ATMEL AVR-UC3-SoftwareFramework-1.7.0 Release */ 2 | 3 | /** 4 | * @file 5 | * Loop Interface 6 | * 7 | */ 8 | 9 | /* 10 | * Copyright (c) 2001-2004 Swedish Institute of Computer Science. 11 | * All rights reserved. 12 | * 13 | * Redistribution and use in source and binary forms, with or without modification, 14 | * are permitted provided that the following conditions are met: 15 | * 16 | * 1. Redistributions of source code must retain the above copyright notice, 17 | * this list of conditions and the following disclaimer. 18 | * 2. Redistributions in binary form must reproduce the above copyright notice, 19 | * this list of conditions and the following disclaimer in the documentation 20 | * and/or other materials provided with the distribution. 21 | * 3. The name of the author may not be used to endorse or promote products 22 | * derived from this software without specific prior written permission. 23 | * 24 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 25 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 26 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 27 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 28 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 29 | * OF 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) ARISING 32 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 33 | * OF SUCH DAMAGE. 34 | * 35 | * This file is part of the lwIP TCP/IP stack. 36 | * 37 | * Author: Adam Dunkels 38 | * 39 | */ 40 | #include "lwip/opt.h" 41 | 42 | #if LWIP_HAVE_LOOPIF 43 | 44 | #include "netif/loopif.h" 45 | #include "lwip/snmp.h" 46 | 47 | /** 48 | * Initialize a lwip network interface structure for a loopback interface 49 | * 50 | * @param netif the lwip network interface structure for this loopif 51 | * @return ERR_OK if the loopif is initialized 52 | * ERR_MEM if private data couldn't be allocated 53 | */ 54 | err_t 55 | loopif_init(struct netif *netif) 56 | { 57 | /* initialize the snmp variables and counters inside the struct netif 58 | * ifSpeed: no assumption can be made! 59 | */ 60 | NETIF_INIT_SNMP(netif, snmp_ifType_softwareLoopback, 0); 61 | 62 | netif->name[0] = 'l'; 63 | netif->name[1] = 'o'; 64 | netif->output = netif_loop_output; 65 | return ERR_OK; 66 | } 67 | 68 | #endif /* LWIP_HAVE_LOOPIF */ 69 | -------------------------------------------------------------------------------- /software/firmwares/wifishield/wifiHD/src/SOFTWARE_FRAMEWORK/SERVICES/LWIP/lwip-port-1.3.2/HD/if/include/arch/cc.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_CC_H__ 33 | #define __ARCH_CC_H__ 34 | 35 | /* Define platform endianness */ 36 | #ifndef BYTE_ORDER 37 | #define BYTE_ORDER BIG_ENDIAN 38 | #endif /* BYTE_ORDER */ 39 | 40 | /* Define generic types used in lwIP */ 41 | typedef unsigned char u8_t; 42 | typedef signed char s8_t; 43 | typedef unsigned short u16_t; 44 | typedef signed short s16_t; 45 | typedef unsigned long u32_t; 46 | typedef signed long s32_t; 47 | 48 | typedef u32_t mem_ptr_t; 49 | 50 | /* Define (sn)printf formatters for these lwIP types */ 51 | #define U16_F "u" 52 | #define S16_F "d" 53 | #define X16_F "x" 54 | #define U32_F "u" 55 | #define S32_F "d" 56 | #define X32_F "x" 57 | 58 | /* Compiler hints for packing structures */ 59 | #define PACK_STRUCT_FIELD(x) x 60 | #define PACK_STRUCT_STRUCT __attribute__((packed)) 61 | #define PACK_STRUCT_BEGIN 62 | #define PACK_STRUCT_END 63 | 64 | /* Plaform specific diagnostic output */ 65 | #ifdef CONFIG_OWL 66 | # include 67 | # define LWIP_PLATFORM_DIAG(x) owl_printf x 68 | # define LWIP_PLATFORM_ASSERT(x) owl_assert(x) 69 | #else 70 | # include 71 | # define LWIP_PLATFORM_DIAG(x) do { printk x; } while(0) 72 | # define LWIP_PLATFORM_ASSERT(x) do { \ 73 | printk("Assertion \"%s\" failed at line " \ 74 | "%d in %s\n", \ 75 | x, __LINE__, __FILE__); while(1); \ 76 | } while(0) 77 | #endif 78 | 79 | #endif /* __ARCH_CC_H__ */ 80 | -------------------------------------------------------------------------------- /software/firmwares/wifishield/wifiHD/src/SOFTWARE_FRAMEWORK/SERVICES/LWIP/lwip-port-1.3.2/HD/if/include/arch/perf.h: -------------------------------------------------------------------------------- 1 | #ifndef __PERF_H__ 2 | #define __PERF_H__ 3 | 4 | #define PERF_START /* null definition */ 5 | #define PERF_STOP(x) /* null definition */ 6 | 7 | #endif 8 | -------------------------------------------------------------------------------- /software/firmwares/wifishield/wifiHD/src/SOFTWARE_FRAMEWORK/SERVICES/LWIP/lwip-port-1.3.2/HD/if/include/netif/wlif.h: -------------------------------------------------------------------------------- 1 | #ifndef __NETIF_NRWLANIF_H__ 2 | #define __NETIF_NRWLANIF_H__ 3 | 4 | #include "lwip/netif.h" 5 | #include "lwip/err.h" 6 | 7 | err_t wlif_init(struct netif *netif); 8 | void wlif_poll(struct netif *netif); 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /software/firmwares/wifishield/wifiHD/src/SOFTWARE_FRAMEWORK/SERVICES/LWIP/lwip-port-1.3.2/HD/readme.txt: -------------------------------------------------------------------------------- 1 | This directory is specific to the WIFI H&D SPB104 components (\COMPONENTS\WIFI\HD_SPB104). 2 | -------------------------------------------------------------------------------- /software/firmwares/wifishield/wifiHD/src/SOFTWARE_FRAMEWORK/UTILS/LIBS/NEWLIB_ADDONS/INCLUDE/nlao_cpu.h: -------------------------------------------------------------------------------- 1 | /* This header file is part of the ATMEL AVR-UC3-SoftwareFramework-1.7.0 Release */ 2 | 3 | /*This file is prepared for Doxygen automatic documentation generation.*/ 4 | /*! \file ********************************************************************* 5 | * 6 | * \brief NEWLIB_ADDONS CPU include file for AVR32. 7 | * 8 | * - Compiler: GNU GCC for AVR32 9 | * - Supported devices: All AVR32 devices can be used. 10 | * - AppNote: 11 | * 12 | * \author Atmel Corporation: http://www.atmel.com \n 13 | * Support and FAQ: http://support.atmel.no/ 14 | * 15 | ******************************************************************************/ 16 | 17 | /* Copyright (c) 2009 Atmel Corporation. All rights reserved. 18 | * 19 | * Redistribution and use in source and binary forms, with or without 20 | * modification, are permitted provided that the following conditions are met: 21 | * 22 | * 1. Redistributions of source code must retain the above copyright notice, this 23 | * list of conditions and the following disclaimer. 24 | * 25 | * 2. Redistributions in binary form must reproduce the above copyright notice, 26 | * this list of conditions and the following disclaimer in the documentation 27 | * and/or other materials provided with the distribution. 28 | * 29 | * 3. The name of Atmel may not be used to endorse or promote products derived 30 | * from this software without specific prior written permission. 31 | * 32 | * 4. This software may only be redistributed and used in connection with an Atmel 33 | * AVR product. 34 | * 35 | * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED 36 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 37 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE 38 | * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR 39 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 40 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 41 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 42 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 43 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 44 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE 45 | * 46 | */ 47 | 48 | #ifndef __AVR32_NEWLIB_ADDONS_CPU_H__ 49 | #define __AVR32_NEWLIB_ADDONS_CPU_H__ 50 | 51 | #include <_ansi.h> 52 | 53 | _BEGIN_STD_C 54 | 55 | #define CPU_HZ get_cpu_hz() 56 | 57 | void udelay(unsigned long usec); 58 | void set_cpu_hz(unsigned int clk_hz); 59 | unsigned int get_cpu_hz(); 60 | 61 | _END_STD_C 62 | 63 | #endif 64 | -------------------------------------------------------------------------------- /software/firmwares/wifishield/wifiHD/src/SOFTWARE_FRAMEWORK/UTILS/LIBS/NEWLIB_ADDONS/INCLUDE/nlao_interrupts.h: -------------------------------------------------------------------------------- 1 | /* This header file is part of the ATMEL AVR-UC3-SoftwareFramework-1.7.0 Release */ 2 | 3 | /*This file is prepared for Doxygen automatic documentation generation.*/ 4 | /*! \file ********************************************************************* 5 | * 6 | * \brief NEWLIB_ADDONS interrupts include file for AVR32. 7 | * 8 | * - Compiler: GNU GCC for AVR32 9 | * - Supported devices: All AVR32 devices can be used. 10 | * - AppNote: 11 | * 12 | * \author Atmel Corporation: http://www.atmel.com \n 13 | * Support and FAQ: http://support.atmel.no/ 14 | * 15 | ******************************************************************************/ 16 | 17 | /* Copyright (c) 2009 Atmel Corporation. All rights reserved. 18 | * 19 | * Redistribution and use in source and binary forms, with or without 20 | * modification, are permitted provided that the following conditions are met: 21 | * 22 | * 1. Redistributions of source code must retain the above copyright notice, this 23 | * list of conditions and the following disclaimer. 24 | * 25 | * 2. Redistributions in binary form must reproduce the above copyright notice, 26 | * this list of conditions and the following disclaimer in the documentation 27 | * and/or other materials provided with the distribution. 28 | * 29 | * 3. The name of Atmel may not be used to endorse or promote products derived 30 | * from this software without specific prior written permission. 31 | * 32 | * 4. This software may only be redistributed and used in connection with an Atmel 33 | * AVR product. 34 | * 35 | * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED 36 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 37 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE 38 | * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR 39 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 40 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 41 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 42 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 43 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 44 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE 45 | * 46 | */ 47 | 48 | #ifndef __AVR32_NEWLIB_ADDONS_INTERRUPTS_H__ 49 | #define __AVR32_NEWLIB_ADDONS_INTERRUPTS_H__ 50 | 51 | #include <_ansi.h> 52 | 53 | _BEGIN_STD_C 54 | 55 | #define INT_GRPS 64 56 | #define INT_LINES 32 57 | #define INTPR_BASE (__intc_base__ + 0x0000) 58 | #define INTREQ_BASE (__intc_base__ + 64*4) 59 | #define INTCAUSE_BASE (__intc_base__ + 2*64*4) 60 | 61 | //Register offsets 62 | #define INTLEVEL 30 63 | #define AUTOVECTOR 0 64 | #define AUTOVECTOR_BITS 14 65 | 66 | //Priorities 67 | #define INT0 0 68 | #define INT1 1 69 | #define INT2 2 70 | #define INT3 3 71 | 72 | 73 | typedef void (*__newlib_int_handler)(int /* int_grp*/, void */*user_handle*/); 74 | 75 | __newlib_int_handler register_interrupt(__newlib_int_handler handler, int int_grp, int line, int priority, 76 | .../* void *user_handle*/); 77 | void init_interrupts(); 78 | void set_interrupts_base(void *base); 79 | 80 | _END_STD_C 81 | 82 | #endif 83 | -------------------------------------------------------------------------------- /software/firmwares/wifishield/wifiHD/src/SOFTWARE_FRAMEWORK/UTILS/LIBS/NEWLIB_ADDONS/libnewlib_addons-at32ucr2-speed_opt.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/peng-zhihui/Roboard-Pro/920538e04199dee27125e3e974f43b122835794e/software/firmwares/wifishield/wifiHD/src/SOFTWARE_FRAMEWORK/UTILS/LIBS/NEWLIB_ADDONS/libnewlib_addons-at32ucr2-speed_opt.a -------------------------------------------------------------------------------- /software/firmwares/wifishield/wifiHD/src/SOFTWARE_FRAMEWORK/UTILS/PREPROCESSOR/preprocessor.h: -------------------------------------------------------------------------------- 1 | /* This header file is part of the ATMEL AVR-UC3-SoftwareFramework-1.7.0 Release */ 2 | 3 | /*This file is prepared for Doxygen automatic documentation generation.*/ 4 | /*! \file ********************************************************************* 5 | * 6 | * \brief Preprocessor utils. 7 | * 8 | * - Compiler: IAR EWAVR32 and GNU GCC for AVR32 9 | * - Supported devices: All AVR32 devices can be used. 10 | * 11 | * \author Atmel Corporation: http://www.atmel.com \n 12 | * Support and FAQ: http://support.atmel.no/ 13 | * 14 | ******************************************************************************/ 15 | 16 | /* Copyright (c) 2009 Atmel Corporation. All rights reserved. 17 | * 18 | * Redistribution and use in source and binary forms, with or without 19 | * modification, are permitted provided that the following conditions are met: 20 | * 21 | * 1. Redistributions of source code must retain the above copyright notice, this 22 | * list of conditions and the following disclaimer. 23 | * 24 | * 2. Redistributions in binary form must reproduce the above copyright notice, 25 | * this list of conditions and the following disclaimer in the documentation 26 | * and/or other materials provided with the distribution. 27 | * 28 | * 3. The name of Atmel may not be used to endorse or promote products derived 29 | * from this software without specific prior written permission. 30 | * 31 | * 4. This software may only be redistributed and used in connection with an Atmel 32 | * AVR product. 33 | * 34 | * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED 35 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 36 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE 37 | * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR 38 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 39 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 40 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 41 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 42 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 43 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE 44 | * 45 | */ 46 | 47 | #ifndef _PREPROCESSOR_H_ 48 | #define _PREPROCESSOR_H_ 49 | 50 | #include "tpaste.h" 51 | #include "stringz.h" 52 | #include "mrepeat.h" 53 | 54 | 55 | #endif // _PREPROCESSOR_H_ 56 | -------------------------------------------------------------------------------- /software/firmwares/wifishield/wifiHD/src/SOFTWARE_FRAMEWORK/UTILS/PREPROCESSOR/stringz.h: -------------------------------------------------------------------------------- 1 | /* This header file is part of the ATMEL AVR-UC3-SoftwareFramework-1.7.0 Release */ 2 | 3 | /*This file is prepared for Doxygen automatic documentation generation.*/ 4 | /*! \file ********************************************************************* 5 | * 6 | * \brief Preprocessor stringizing utils. 7 | * 8 | * - Compiler: IAR EWAVR32 and GNU GCC for AVR32 9 | * - Supported devices: All AVR32 devices can be used. 10 | * 11 | * \author Atmel Corporation: http://www.atmel.com \n 12 | * Support and FAQ: http://support.atmel.no/ 13 | * 14 | ******************************************************************************/ 15 | 16 | /* Copyright (c) 2009 Atmel Corporation. All rights reserved. 17 | * 18 | * Redistribution and use in source and binary forms, with or without 19 | * modification, are permitted provided that the following conditions are met: 20 | * 21 | * 1. Redistributions of source code must retain the above copyright notice, this 22 | * list of conditions and the following disclaimer. 23 | * 24 | * 2. Redistributions in binary form must reproduce the above copyright notice, 25 | * this list of conditions and the following disclaimer in the documentation 26 | * and/or other materials provided with the distribution. 27 | * 28 | * 3. The name of Atmel may not be used to endorse or promote products derived 29 | * from this software without specific prior written permission. 30 | * 31 | * 4. This software may only be redistributed and used in connection with an Atmel 32 | * AVR product. 33 | * 34 | * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED 35 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 36 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE 37 | * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR 38 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 39 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 40 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 41 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 42 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 43 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE 44 | * 45 | */ 46 | 47 | #ifndef _STRINGZ_H_ 48 | #define _STRINGZ_H_ 49 | 50 | 51 | /*! \brief Stringize. 52 | * 53 | * Stringize a preprocessing token, this token being allowed to be \#defined. 54 | * 55 | * May be used only within macros with the token passed as an argument if the token is \#defined. 56 | * 57 | * For example, writing STRINGZ(PIN) within a macro \#defined by PIN_NAME(PIN) 58 | * and invoked as PIN_NAME(PIN0) with PIN0 \#defined as A0 is equivalent to 59 | * writing "A0". 60 | */ 61 | #define STRINGZ(x) #x 62 | 63 | /*! \brief Absolute stringize. 64 | * 65 | * Stringize a preprocessing token, this token being allowed to be \#defined. 66 | * 67 | * No restriction of use if the token is \#defined. 68 | * 69 | * For example, writing ASTRINGZ(PIN0) anywhere with PIN0 \#defined as A0 is 70 | * equivalent to writing "A0". 71 | */ 72 | #define ASTRINGZ(x) STRINGZ(x) 73 | 74 | 75 | #endif // _STRINGZ_H_ 76 | -------------------------------------------------------------------------------- /software/firmwares/wifishield/wifiHD/src/ard_spi.h: -------------------------------------------------------------------------------- 1 | /* 2 | * ard_spi.h 3 | * 4 | * Created on: May 27, 2010 5 | * Author: mlf by Metodo2 srl 6 | */ 7 | 8 | #ifndef ARD_SPI_H_ 9 | #define ARD_SPI_H_ 10 | 11 | #include "lwip/netif.h" 12 | #include "console.h" 13 | #include "wl_definitions.h" 14 | 15 | 16 | typedef enum { 17 | SPI_CMD_IDLE, 18 | SPI_CMD_INPUT, 19 | SPI_CMD_DONE, 20 | SPI_CMD_INPROGRESS, 21 | SPI_CMD_REPLING, 22 | SPI_CMD_FAIL, 23 | } cmd_spi_state_t; 24 | 25 | typedef enum { 26 | REPLY_ERR_GET, 27 | REPLY_ERR_SET, 28 | REPLY_ERR_CMD, 29 | REPLY_ERR_MSG, 30 | REPLY_NO_ERR, 31 | } reply_err_t; 32 | 33 | 34 | typedef enum { 35 | CMD_GET_FLAG = 0x01, 36 | CMD_SET_FLAG = 0x02, 37 | CMD_IMM_SET_FLAG = 0x04, 38 | }cmd_flags; 39 | 40 | typedef enum eProtMode {TCP_MODE, UDP_MODE}tProtMode; 41 | 42 | #define TIMEOUT_SPI 200 43 | #define SPI_ALIGN_ERROR 0xF0 44 | #define SPI_OVERRIDE_ERROR 0xF1 45 | #define SPI_TIMEOUT_ERROR 0xF2 46 | #define DUMMY_DATA 0xFF 47 | 48 | typedef int (*cmd_spi_cb_t)(int numParam, char* buf, void* ctx); 49 | typedef cmd_spi_state_t (*cmd_spi_rcb_t)(char* recv, char* reply, void* ctx, uint16_t* _count); 50 | 51 | typedef struct eRemoteClient{ 52 | uint32_t ipaddr; 53 | uint16_t port; 54 | }tRemoteClient; 55 | 56 | void set_result_cmd(int err) ; 57 | 58 | void set_result(wl_status_t _status); 59 | 60 | int initSpi(void* ctx); 61 | 62 | void initExtInt(); 63 | 64 | void spi_poll(struct netif* netif); 65 | 66 | int spi_slaveReceive(volatile avr32_spi_t *spi); 67 | 68 | void showTTCPstatus(); 69 | 70 | int getSock(void * _ttcp); 71 | 72 | void* getTTCP(uint8_t sock, uint8_t mode); 73 | 74 | void setMapSockMode(uint8_t sock, void* _ttcp, uint8_t _tcp_mode); 75 | 76 | void clearMapSockTcp(uint8_t sock, uint8_t mode); 77 | 78 | int start_server_tcp(uint16_t port, uint8_t sock, uint8_t protMode); 79 | 80 | int start_client_tcp(uint32_t _addr, uint16_t port, uint8_t sock, uint8_t protMode); 81 | 82 | void setRemoteClient(uint16_t sock, uint32_t _ipaddr, uint16_t _port); 83 | 84 | tRemoteClient* getRemoteClient(uint16_t sock); 85 | 86 | void getRemoteData(uint8_t sock, uint8_t mode, tRemoteClient* remoteData); 87 | 88 | #endif /* ARD_SPI_H_ */ 89 | -------------------------------------------------------------------------------- /software/firmwares/wifishield/wifiHD/src/cmd_wl.h: -------------------------------------------------------------------------------- 1 | /* This header file is part of the ATMEL AVR-UC3-SoftwareFramework-1.7.0 Release */ 2 | 3 | /*! \page License 4 | * Copyright (C) 2009, H&D Wireless AB All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions are met: 8 | * 9 | * 1. Redistributions of source code must retain the above copyright notice, 10 | * this list of conditions and the following disclaimer. 11 | * 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 | * 16 | * 3. The name of H&D Wireless AB may not be used to endorse or promote products derived 17 | * from this software without specific prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY H&D WIRELESS AB ``AS IS'' AND ANY EXPRESS OR IMPLIED 20 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 21 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE EXPRESSLY AND 22 | * SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, 23 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 24 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 25 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 26 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 28 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | #ifndef CMD_CM_H 31 | #define CMD_CM_H 32 | 33 | #include 34 | #include "netif/wlif.h" 35 | 36 | /*! A pointer to a struct of type "struct net_cfg" should be passed as 37 | * the ctx pointer in the callbacks below. The struct must have a 38 | * single instance per netif. 39 | */ 40 | #define _DNS_CMD_ 41 | 42 | cmd_state_t cmd_scan(int argc, char* argv[], void* ctx); 43 | cmd_state_t cmd_connect(int argc, char* argv[], void* ctx); 44 | cmd_state_t cmd_set_ip(int argc, char* argv[], void* ctx); 45 | cmd_state_t cmd_setkey(int argc, char* argv[], void* ctx); 46 | cmd_state_t cmd_status(int argc, char* argv[], void* ctx); 47 | cmd_state_t cmd_power(int argc, char* argv[], void* ctx); 48 | cmd_state_t cmd_psconf(int argc, char* argv[], void* ctx); 49 | cmd_state_t cmd_setpass(int argc, char* argv[], void* ctx); 50 | cmd_state_t cmd_delpass(int argc, char* argv[], void* ctx); 51 | cmd_state_t cmd_debug(int argc, char* argv[], void* ctx); 52 | cmd_state_t cmd_debug_toggle(int argc, char* argv[], void* ctx); 53 | cmd_state_t cmd_statSpi(int argc, char* argv[], void* ctx); 54 | cmd_state_t cmd_resetStatSpi(int argc, char* argv[], void* ctx); 55 | cmd_state_t cmd_gethostbyname(int argc, char* argv[], void* ctx); 56 | cmd_state_t cmd_setDnsServer(int argc, char* argv[], void* ctx); 57 | cmd_state_t cmd_startSrv(int argc, char* argv[], void* ctx); 58 | cmd_state_t cmd_startCli(int argc, char* argv[], void* ctx); 59 | cmd_state_t cmd_dumpBuf(int argc, char* argv[], void* ctx); 60 | cmd_state_t cmd_sendUdpData(int argc, char* argv[], void* ctx); 61 | #ifdef WFE_6_12 62 | cmd_state_t cmd_ibss(int argc, char* argv[], void* ctx); 63 | #endif 64 | 65 | 66 | #endif 67 | -------------------------------------------------------------------------------- /software/firmwares/wifishield/wifiHD/src/console.h: -------------------------------------------------------------------------------- 1 | /*! \page License 2 | * Copyright (C) 2009, H&D Wireless AB All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * 1. Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * 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 | * 14 | * 3. The name of H&D Wireless AB may not be used to endorse or promote products derived 15 | * from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY H&D WIRELESS AB ``AS IS'' AND ANY EXPRESS OR IMPLIED 18 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 19 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE EXPRESSLY AND 20 | * SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, 21 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 22 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 23 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 24 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | #ifndef CONSOLE_H 29 | #define CONSOLE_H 30 | 31 | 32 | typedef enum { 33 | CMD_DONE, 34 | CMD_INPROGRESS 35 | } cmd_state_t; 36 | 37 | typedef cmd_state_t (*cmd_cb_t)(int argc, char* argv[], void* ctx); 38 | 39 | void console_init(void); 40 | void console_init_silent(void); 41 | char* console_gets(void); 42 | int console_add_cmd(const char* str, cmd_cb_t cb, void* ctx); 43 | int console_schedule_cmd(char *cmd, int interactive); 44 | void console_poll(void); 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /software/firmwares/wifishield/wifiHD/src/fw_download.h: -------------------------------------------------------------------------------- 1 | /* This header file is part of the ATMEL AVR-UC3-SoftwareFramework-1.7.0 Release */ 2 | 3 | /*! \page License 4 | * Copyright (C) 2009, H&D Wireless AB All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions are met: 8 | * 9 | * 1. Redistributions of source code must retain the above copyright notice, 10 | * this list of conditions and the following disclaimer. 11 | * 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 | * 16 | * 3. The name of H&D Wireless AB may not be used to endorse or promote products derived 17 | * from this software without specific prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY H&D WIRELESS AB ``AS IS'' AND ANY EXPRESS OR IMPLIED 20 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 21 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE EXPRESSLY AND 22 | * SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, 23 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 24 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 25 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 26 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 28 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | #ifndef FW_DOWNLOAD_H 31 | #define FW_DOWNLOAD_H 32 | 33 | #include 34 | #include 35 | 36 | int fw_download_init(void); 37 | size_t fw_read_cb(void *ctx, const uint8_t** buf, size_t offset, size_t len); 38 | #endif 39 | -------------------------------------------------------------------------------- /software/firmwares/wifishield/wifiHD/src/fw_download_extflash.c: -------------------------------------------------------------------------------- 1 | /*! \page License 2 | * Copyright (C) 2009, H&D Wireless AB All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * 1. Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * 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 | * 14 | * 3. The name of H&D Wireless AB may not be used to endorse or promote products derived 15 | * from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY H&D WIRELESS AB ``AS IS'' AND ANY EXPRESS OR IMPLIED 18 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 19 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE EXPRESSLY AND 20 | * SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, 21 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 22 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 23 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 24 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | 34 | int fw_download_init(void) 35 | { 36 | nvram_init(); 37 | return 0; 38 | } 39 | 40 | #define BUF_SIZE 512 41 | 42 | 43 | size_t fw_read_cb(void* ctx, 44 | const uint8_t** buf, 45 | size_t offset, 46 | size_t len) 47 | { 48 | static uint8_t* fw_buf = NULL; 49 | size_t rlen; 50 | /* when firmware download is completed, this function will be 51 | * invoked one additional time with buf set to NULL. we can 52 | * free the firmware buffer at this time since it's no longer 53 | * needed. 54 | */ 55 | if (NULL == buf) { 56 | if (fw_buf) { 57 | free(fw_buf); 58 | fw_buf = NULL; 59 | } 60 | return 0; 61 | } 62 | 63 | /* first call? then initialize flash and allocate a buffer to hold 64 | * firmware data. 65 | */ 66 | if (fw_buf == NULL) { 67 | fw_buf = malloc(BUF_SIZE); 68 | 69 | if (fw_buf == NULL) { 70 | printk("could not allocate firmware buffer\n"); 71 | return 0; 72 | } 73 | } 74 | /* read at most a full buffer */ 75 | rlen = len > BUF_SIZE ? BUF_SIZE : len; 76 | 77 | /* read data and update output parameters */ 78 | nvram_read(offset, fw_buf, rlen); 79 | *buf = fw_buf; 80 | 81 | return rlen; 82 | } 83 | -------------------------------------------------------------------------------- /software/firmwares/wifishield/wifiHD/src/license.txt: -------------------------------------------------------------------------------- 1 | Copyright (C) 2009, H&D Wireless AB All rights reserved. 2 | 3 | The license to use this software in whole and in part and to 4 | redistribute it in any form follows with the WiFi HW module from H&D 5 | Wireless and is granted under the following restrictions: 6 | 7 | 1. Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | 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 | 14 | 3. The name of H&D Wireless AB may not be used to endorse or promote 15 | products derived from this software without specific prior written 16 | permission. 17 | 18 | 4. The software may only be used together with hardware from H&D 19 | Wireless all other use is prohibited. 20 | 21 | 5. The license to use and redistribute the software is granted 22 | together with the purchase of a hardware platform on a one to one 23 | basis 24 | 25 | 6. The binary code may not be reversed engineered or by other means 26 | copied to circumvent this license. 27 | 28 | THIS SOFTWARE IS PROVIDED BY H&D WIRELESS AB ``AS IS'' AND ANY 29 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 30 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 31 | PURPOSE ARE EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT 32 | SHALL HD WIRELESS AB BE LIABLE FOR ANY DIRECT, INDIRECT, 33 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 34 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 35 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 36 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 37 | STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 38 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 39 | OF THE POSSIBILITY OF SUCH DAMAGE. 40 | 41 | For more information regarding this software license Contact H&D 42 | Wireless AB (support@hd-wireless.se). 43 | -------------------------------------------------------------------------------- /software/firmwares/wifishield/wifiHD/src/lwip_setup.h: -------------------------------------------------------------------------------- 1 | #ifndef _LWIP_SETUP_H 2 | #define _LWIP_SETUP_H 3 | 4 | #define INIT_IP_CONFIG 0xff 5 | #define STATIC_IP_CONFIG 0 6 | #define DYNAMIC_IP_CONFIG 1 7 | 8 | struct net_cfg { 9 | struct netif *netif; /* lwip network interface */ 10 | uint8_t dhcp_enabled; 11 | uint8_t dhcp_running; 12 | }; 13 | 14 | struct ctx_server { 15 | struct net_cfg net_cfg; 16 | uint8_t wl_init_complete; 17 | }; 18 | 19 | /*! Start the IP stack. 20 | * If cfg->netif must have been allocated and lwip_init() 21 | * must have been called before this function is called 22 | * (since the IP stack may have to be polled before this 23 | * function can be called). 24 | */ 25 | int start_ip_stack(struct net_cfg *cfg, 26 | struct ip_addr ipaddr, 27 | struct ip_addr netmask, 28 | struct ip_addr gw); 29 | 30 | #endif /* _LWIP_SETUP_H */ 31 | -------------------------------------------------------------------------------- /software/firmwares/wifishield/wifiHD/src/nvram.h: -------------------------------------------------------------------------------- 1 | #ifndef NVRAM_H 2 | #define NVRAM_H 3 | 4 | #include 5 | 6 | int nvram_init(void); 7 | int nvram_read(uint32_t addr, void *data, uint32_t len); 8 | int nvram_write(uint32_t addr, const void *data, uint32_t len); 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /software/firmwares/wifishield/wifiHD/src/owl_os.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | #include 7 | 8 | void *owl_os_alloc(size_t size) 9 | { 10 | return malloc(size); 11 | } 12 | 13 | void *owl_os_realloc(void *ptr, size_t size) 14 | { 15 | return realloc(ptr, size); 16 | } 17 | 18 | void owl_os_free(void *p) 19 | { 20 | free(p); 21 | } 22 | 23 | void *owl_os_memcpy(void *dst, const void *src, size_t n) 24 | { 25 | return memcpy(dst, src, n); 26 | } 27 | 28 | void *owl_os_memset(void *s, int c, size_t n) 29 | { 30 | return memset(s, c, n); 31 | } 32 | 33 | void *owl_os_memmove(void *dst, const void *src, size_t n) 34 | { 35 | return memmove(dst, src, n); 36 | } 37 | 38 | size_t owl_os_strlen(char *s) 39 | { 40 | return strlen(s); 41 | } 42 | 43 | char *owl_os_strncpy(char *dst, const char *src, size_t n) 44 | { 45 | return strncpy(dst, src, n); 46 | } 47 | 48 | int owl_os_strncmp(const char *s1, const char *s2, size_t n) 49 | { 50 | return strncmp(s1, s2, n); 51 | } 52 | 53 | int owl_os_strcmp(const char *s1, const char *s2) 54 | { 55 | return strcmp(s1, s2); 56 | } 57 | 58 | char *owl_os_strcpy(char *dst, const char *src) 59 | { 60 | return strcpy(dst, src); 61 | } 62 | 63 | char *owl_os_strdup(const char *s) 64 | { 65 | return strdup(s); 66 | } 67 | 68 | char *owl_os_strndup(const char *s, size_t n) 69 | { 70 | return strndup(s, n); 71 | } 72 | 73 | int owl_os_memcmp(const void *s1, const void *s2, size_t n) 74 | { 75 | return memcmp(s1, s2, n); 76 | } 77 | 78 | long int owl_os_strtol(const char *nptr, char **endptr, int base) 79 | { 80 | return strtol(nptr, endptr, base); 81 | } 82 | 83 | char *owl_os_strchr(const char *s, int c) 84 | { 85 | return strchr(s, c); 86 | } 87 | 88 | char *owl_os_strrchr(const char *s, int c) 89 | { 90 | return strrchr(s, c); 91 | } 92 | 93 | int owl_os_strcasecmp(const char *s1, const char *s2) 94 | { 95 | return strcasecmp(s1, s2); 96 | } 97 | 98 | char *owl_os_strstr(const char *haystack, const char *needle) 99 | { 100 | return strstr(haystack, needle); 101 | } 102 | 103 | int owl_os_snprintf(char *str, size_t size, const char *format, ...) 104 | { 105 | int ret; 106 | va_list ap; 107 | va_start(ap, format); 108 | ret = vsniprintf(str, size, format, ap); 109 | va_end(ap); 110 | return ret; 111 | } 112 | 113 | /* for debugging only, never called if wl_api was built without debug */ 114 | #ifdef CONFIG_OWL 115 | #include "owl_env.h" 116 | int owl_os_printf(const char *fmt, ...) 117 | { 118 | char *str = NULL; 119 | va_list args; 120 | int len; 121 | char *iter; 122 | 123 | va_start(args, fmt); 124 | 125 | if ((str = malloc(160)) == NULL) 126 | return -1; 127 | 128 | if ((len = vsniprintf(str, 160, fmt, args)) < 0) { 129 | free(str); 130 | return -1; 131 | } 132 | 133 | iter = str; 134 | while (*iter) 135 | owl_putc(*iter++); 136 | 137 | free(str); 138 | return len; 139 | } 140 | #endif 141 | -------------------------------------------------------------------------------- /software/firmwares/wifishield/wifiHD/src/ping.h: -------------------------------------------------------------------------------- 1 | /* This header file is part of the ATMEL AVR-UC3-SoftwareFramework-1.7.0 Release */ 2 | 3 | /* 4 | * Copyright (c) 2001-2003 Swedish Institute of Computer Science. 5 | * All rights reserved. 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 derived from a part of the lwIP TCP/IP stack. 30 | * 31 | */ 32 | #ifndef PING_H 33 | #define PING_H 34 | 35 | #include "console.h" 36 | 37 | typedef void (*ping_complete_cb_t)(uint32_t tx_pkt_cnt, uint32_t rx_pkt_cnt, void *ctx); 38 | 39 | void ping_set_callback(ping_complete_cb_t cb, void *ctx); 40 | 41 | void ping_stop(uint32_t *tx_cnt, uint32_t *rx_cnt); 42 | 43 | cmd_state_t cmd_ping(int argc, char* argv[], void* ctx); 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /software/firmwares/wifishield/wifiHD/src/printf-stdarg.h: -------------------------------------------------------------------------------- 1 | /*! \page License 2 | * Copyright (C) 2009, H&D Wireless AB All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * 1. Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * 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 | * 14 | * 3. The name of H&D Wireless AB may not be used to endorse or promote products derived 15 | * from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY H&D WIRELESS AB ``AS IS'' AND ANY EXPRESS OR IMPLIED 18 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 19 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE EXPRESSLY AND 20 | * SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, 21 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 22 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 23 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 24 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | #ifndef PRINTF_STDARG_H 29 | #define PRINTF_STDARG_H 30 | #include 31 | 32 | int printk(const char *format, ...); 33 | int printk_va(char **out, const char *format, va_list args ); 34 | #endif 35 | -------------------------------------------------------------------------------- /software/firmwares/wifishield/wifiHD/src/timer.h: -------------------------------------------------------------------------------- 1 | /*! \page License 2 | * Copyright (C) 2009, H&D Wireless AB All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * 1. Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * 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 | * 14 | * 3. The name of H&D Wireless AB may not be used to endorse or promote products derived 15 | * from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY H&D WIRELESS AB ``AS IS'' AND ANY EXPRESS OR IMPLIED 18 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 19 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE EXPRESSLY AND 20 | * SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, 21 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 22 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 23 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 24 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | #ifndef TIMER_H 29 | #define TIMER_H 30 | #include 31 | 32 | enum { 33 | TIMEOUT_ONESHOT, 34 | TIMEOUT_PERIODIC 35 | }; 36 | 37 | #define INVALID_TIMER_ID 0xFFFFFFFF 38 | 39 | /* Handle timer overflows. Return 1 if the interval has passed. */ 40 | int timer_interval_passed(uint32_t old, uint32_t new, uint32_t diff); 41 | 42 | void timer_tick(); 43 | void timer_init(void (*tick_isr) (void* ctx), void* ctx); 44 | void timer_poll(void); 45 | void timer_delay(uint32_t ms); 46 | uint32_t timer_sched_timeout_cb(uint32_t ms, uint8_t type, void (*cb)(void *ctx), void* ctx); 47 | uint32_t timer_mod(uint32_t id, uint32_t ms, uint8_t type, void (*cb)(void *ctx), void* ctx); 48 | void timer_cancel_timeout(uint32_t id); 49 | uint32_t timer_get_ms(void); 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /software/firmwares/wifishield/wifiHD/src/trace.h: -------------------------------------------------------------------------------- 1 | /* This header file is part of the ATMEL AVR-UC3-SoftwareFramework-1.7.0 Release */ 2 | 3 | /*! \page License 4 | * Copyright (C) 2009, H&D Wireless AB All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions are met: 8 | * 9 | * 1. Redistributions of source code must retain the above copyright notice, 10 | * this list of conditions and the following disclaimer. 11 | * 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 | * 16 | * 3. The name of H&D Wireless AB may not be used to endorse or promote products derived 17 | * from this software without specific prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY H&D WIRELESS AB ``AS IS'' AND ANY EXPRESS OR IMPLIED 20 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 21 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE EXPRESSLY AND 22 | * SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, 23 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 24 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 25 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 26 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 28 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | #ifndef TRACE_H 31 | #define TRACE_H 32 | 33 | #include 34 | #include "printf-stdarg.h" 35 | 36 | #define ASSERT(cond, str) do { \ 37 | if (!(cond)) { \ 38 | printk("%s\n", str); \ 39 | Assert(0); \ 40 | } \ 41 | } while(0) 42 | 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /software/firmwares/wifishield/wifiHD/src/util.h: -------------------------------------------------------------------------------- 1 | /*! \page License 2 | * Copyright (C) 2009, H&D Wireless AB All rights reserved. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are met: 6 | * 7 | * 1. Redistributions of source code must retain the above copyright notice, 8 | * this list of conditions and the following disclaimer. 9 | * 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 | * 14 | * 3. The name of H&D Wireless AB may not be used to endorse or promote products derived 15 | * from this software without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY H&D WIRELESS AB ``AS IS'' AND ANY EXPRESS OR IMPLIED 18 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 19 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE EXPRESSLY AND 20 | * SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, 21 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 22 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 23 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 24 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | #ifndef _UTIL_H 29 | #define _UTIL_H 30 | #include 31 | #include 32 | #include 33 | #include "lwip/ip.h" 34 | #include 35 | 36 | const char* ip2str(struct ip_addr addr); 37 | 38 | struct ip_addr str2ip(const char* str); 39 | 40 | uint8_t ascii_to_key(char *outp, const char *inp); 41 | 42 | void print_network(struct wl_network_t* wl_network); 43 | 44 | void print_network_list(void); 45 | 46 | int join_argv(char *dst, size_t dst_len, int argc, char* argv[]); 47 | 48 | void printbuf(const char *prefix, const void *data, size_t len); 49 | 50 | const char* ssid2str(struct wl_ssid_t *ssid); 51 | 52 | const char* mac2str(uint8_t mac[6]); 53 | 54 | char* enc_type2str(enum wl_enc_type enc_type); 55 | 56 | int equal_ssid(const struct wl_ssid_t* ssid1, 57 | const struct wl_ssid_t* ssid2); 58 | 59 | int equal_bssid(const struct wl_mac_addr_t* bssid1, 60 | const struct wl_mac_addr_t* bssid2); 61 | 62 | #define NET_SET_SSID(net, xssid, ssid_len) do { \ 63 | DE_MEMCPY((net)->ssid.ssid, (xssid), (ssid_len)); \ 64 | (net)->ssid.len = (ssid_len); \ 65 | } while (0) 66 | 67 | #define NET_SET_BSSID(net, xbssid) do { \ 68 | DE_MEMCPY(&(net)->bssid, &(xbssid), sizeof (xbssid)); \ 69 | } while (0) 70 | 71 | #endif /* _UTIL_H */ 72 | -------------------------------------------------------------------------------- /software/firmwares/wifishield/wifiHD/src/wl_cm.h: -------------------------------------------------------------------------------- 1 | /* This header file is part of the ATMEL AVR-UC3-SoftwareFramework-1.7.0 Release */ 2 | 3 | /*! \page License 4 | * Copyright (C) 2009, H&D Wireless AB All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions are met: 8 | * 9 | * 1. Redistributions of source code must retain the above copyright notice, 10 | * this list of conditions and the following disclaimer. 11 | * 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 | * 16 | * 3. The name of H&D Wireless AB may not be used to endorse or promote products derived 17 | * from this software without specific prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY H&D WIRELESS AB ``AS IS'' AND ANY EXPRESS OR IMPLIED 20 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 21 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE EXPRESSLY AND 22 | * SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, 23 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 24 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 25 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 26 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 28 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | #ifndef WL_CM_H 31 | #define WL_CM_H 32 | 33 | #include 34 | #include 35 | #include 36 | 37 | typedef void (cm_scan_cb_t)(void* ctx); 38 | typedef void (cm_conn_cb_t)(struct wl_network_t *net, void* ctx); 39 | typedef void (cm_disconn_cb_t)(void* ctx); 40 | 41 | wl_err_t wl_cm_set_network(struct wl_ssid_t *ssid, struct wl_mac_addr_t *bssid); 42 | 43 | wl_err_t wl_cm_init(cm_scan_cb_t scan_cb, 44 | cm_conn_cb_t conn_cb, 45 | cm_disconn_cb_t disconn_cb, 46 | void* ctx); 47 | 48 | wl_err_t wl_cm_start(void); 49 | wl_err_t wl_cm_stop(void); 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /software/firmwares/wifishield/wifiHD/src/wl_definitions.h: -------------------------------------------------------------------------------- 1 | /* 2 | * wl_definitions.h 3 | * 4 | * Created on: Mar 6, 2011 5 | * Author: mlf by Metodo2 srl 6 | */ 7 | 8 | #ifndef WL_DEFINITIONS_H_ 9 | #define WL_DEFINITIONS_H_ 10 | 11 | // Maximum size of a SSID 12 | #define WL_SSID_MAX_LENGTH 32 13 | // Length of passphrase. Valid lengths are 8-63. 14 | #define WL_WPA_KEY_MAX_LENGTH 63 15 | // Length of key in bytes. Valid values are 5 and 13. 16 | #define WL_WEP_KEY_MAX_LENGTH 13 17 | // Size of a MAC-address or BSSID 18 | #define WL_MAC_ADDR_LENGTH 6 19 | // Size of a MAC-address or BSSID 20 | #define WL_IPV4_LENGTH 4 21 | // Maximum size of a SSID list 22 | #define WL_NETWORKS_LIST_MAXNUM 10 23 | // Maxmium number of socket 24 | #define MAX_SOCK_NUM 4 25 | //Maximum number of attempts to establish wifi connection 26 | #define WL_MAX_ATTEMPT_CONNECTION 10 27 | 28 | typedef enum { 29 | WL_IDLE_STATUS, 30 | WL_NO_SSID_AVAIL, 31 | WL_SCAN_COMPLETED, 32 | WL_CONNECTED, 33 | WL_CONNECT_FAILED, 34 | WL_CONNECTION_LOST, 35 | WL_DISCONNECTED 36 | } wl_status_t; 37 | 38 | 39 | #endif /* WL_DEFINITIONS_H_ */ 40 | -------------------------------------------------------------------------------- /software/firmwares/wifishield/wifi_dnld/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | wifi_dnld 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.buildLocation 30 | ${workspace_loc:/wifi_dnld/Debug} 31 | 32 | 33 | org.eclipse.cdt.make.core.contents 34 | org.eclipse.cdt.make.core.activeConfigSettings 35 | 36 | 37 | org.eclipse.cdt.make.core.enableAutoBuild 38 | false 39 | 40 | 41 | org.eclipse.cdt.make.core.enableCleanBuild 42 | true 43 | 44 | 45 | org.eclipse.cdt.make.core.enableFullBuild 46 | true 47 | 48 | 49 | org.eclipse.cdt.make.core.stopOnError 50 | true 51 | 52 | 53 | org.eclipse.cdt.make.core.useDefaultBuildCmd 54 | true 55 | 56 | 57 | 58 | 59 | org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder 60 | 61 | 62 | 63 | 64 | 65 | com.atmel.avr32.core.nature 66 | org.eclipse.cdt.core.cnature 67 | org.eclipse.cdt.managedbuilder.core.managedBuildNature 68 | org.eclipse.cdt.managedbuilder.core.ScannerConfigNature 69 | 70 | 71 | -------------------------------------------------------------------------------- /software/firmwares/wifishield/wifi_dnld/Release/wifi_dnld.elf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/peng-zhihui/Roboard-Pro/920538e04199dee27125e3e974f43b122835794e/software/firmwares/wifishield/wifi_dnld/Release/wifi_dnld.elf -------------------------------------------------------------------------------- /software/firmwares/wifishield/wifi_dnld/src/CONFIG/conf_at45dbx.h: -------------------------------------------------------------------------------- 1 | /* This header file is part of the ATMEL AVR-UC3-SoftwareFramework-1.7.0 Release */ 2 | 3 | /*This file is prepared for Doxygen automatic documentation generation.*/ 4 | /*! \file ********************************************************************* 5 | * 6 | * \brief AT45DBX configuration file. 7 | * 8 | * This file contains the possible external configuration of the AT45DBX. 9 | * 10 | * - Compiler: IAR EWAVR32 and GNU GCC for AVR32 11 | * - Supported devices: All AVR32 devices with an SPI module can be used. 12 | * - AppNote: 13 | * 14 | * \author Atmel Corporation: http://www.atmel.com \n 15 | * Support and FAQ: http://support.atmel.no/ 16 | * 17 | ******************************************************************************/ 18 | 19 | /* Copyright (c) 2009 Atmel Corporation. All rights reserved. 20 | * 21 | * Redistribution and use in source and binary forms, with or without 22 | * modification, are permitted provided that the following conditions are met: 23 | * 24 | * 1. Redistributions of source code must retain the above copyright notice, this 25 | * list of conditions and the following disclaimer. 26 | * 27 | * 2. Redistributions in binary form must reproduce the above copyright notice, 28 | * this list of conditions and the following disclaimer in the documentation 29 | * and/or other materials provided with the distribution. 30 | * 31 | * 3. The name of Atmel may not be used to endorse or promote products derived 32 | * from this software without specific prior written permission. 33 | * 34 | * 4. This software may only be redistributed and used in connection with an Atmel 35 | * AVR product. 36 | * 37 | * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED 38 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 39 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE 40 | * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR 41 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 42 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 43 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 44 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 45 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 46 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE 47 | * 48 | */ 49 | 50 | #ifndef _CONF_AT45DBX_H_ 51 | #define _CONF_AT45DBX_H_ 52 | 53 | 54 | #include "conf_access.h" 55 | 56 | #if AT45DBX_MEM == DISABLE 57 | #error conf_at45dbx.h is #included although AT45DBX_MEM is disabled 58 | #endif 59 | 60 | 61 | #include "at45dbx.h" 62 | 63 | 64 | //_____ D E F I N I T I O N S ______________________________________________ 65 | 66 | //! Size of AT45DBX data flash memories to manage. 67 | #define AT45DBX_MEM_SIZE AT45DBX_1MB 68 | 69 | //! Number of AT45DBX components to manage. 70 | #define AT45DBX_MEM_CNT 1 71 | 72 | //! First chip select used by AT45DBX components on the SPI module instance. 73 | //! AT45DBX_SPI_NPCS0_PIN always corresponds to this first NPCS, whatever it is. 74 | #define AT45DBX_SPI_FIRST_NPCS AT45DBX_SPI_NPCS 75 | 76 | //! SPI master speed in Hz. 77 | #define AT45DBX_SPI_MASTER_SPEED 12000000 78 | 79 | //! Number of bits in each SPI transfer. 80 | #define AT45DBX_SPI_BITS 8 81 | 82 | 83 | #endif // _CONF_AT45DBX_H_ 84 | -------------------------------------------------------------------------------- /software/firmwares/wifishield/wifi_dnld/src/Doc/SPB104 product brief.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/peng-zhihui/Roboard-Pro/920538e04199dee27125e3e974f43b122835794e/software/firmwares/wifishield/wifi_dnld/src/Doc/SPB104 product brief.pdf -------------------------------------------------------------------------------- /software/firmwares/wifishield/wifi_dnld/src/Doc/gettingstarted.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/peng-zhihui/Roboard-Pro/920538e04199dee27125e3e974f43b122835794e/software/firmwares/wifishield/wifi_dnld/src/Doc/gettingstarted.pdf -------------------------------------------------------------------------------- /software/firmwares/wifishield/wifi_dnld/src/SOFTWARE_FRAMEWORK/ASM/trampoline.x: -------------------------------------------------------------------------------- 1 | /* This file is part of the ATMEL AVR32-SoftwareFramework-AT32UC3A-1.4.0 Release */ 2 | 3 | /*This file is prepared for Doxygen automatic documentation generation.*/ 4 | /*! \file ********************************************************************* 5 | * 6 | * \brief AVR32 UC3 ISP trampoline. 7 | * 8 | * In order to be able to program a project with both BatchISP and JTAGICE mkII 9 | * without having to take the general-purpose fuses into consideration, add this 10 | * file to the project and change the program entry point to _trampoline. 11 | * 12 | * The pre-programmed ISP will be erased if JTAGICE mkII is used. 13 | * 14 | * - Compiler: GNU GCC for AVR32 15 | * - Supported devices: All AVR32UC devices can be used. 16 | * 17 | * \author Atmel Corporation: http://www.atmel.com \n 18 | * Support and FAQ: http://support.atmel.no/ 19 | * 20 | ******************************************************************************/ 21 | 22 | /* Copyright (C) 2006-2008, Atmel Corporation All rights reserved. 23 | * 24 | * Redistribution and use in source and binary forms, with or without 25 | * modification, are permitted provided that the following conditions are met: 26 | * 27 | * 1. Redistributions of source code must retain the above copyright notice, 28 | * this list of conditions and the following disclaimer. 29 | * 30 | * 2. Redistributions in binary form must reproduce the above copyright notice, 31 | * this list of conditions and the following disclaimer in the documentation 32 | * and/or other materials provided with the distribution. 33 | * 34 | * 3. The name of ATMEL may not be used to endorse or promote products derived 35 | * from this software without specific prior written permission. 36 | * 37 | * THIS SOFTWARE IS PROVIDED BY ATMEL ``AS IS'' AND ANY EXPRESS OR IMPLIED 38 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 39 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE EXPRESSLY AND 40 | * SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, 41 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 42 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 43 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 44 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 45 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 46 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 47 | */ 48 | 49 | 50 | #include "conf_isp.h" 51 | 52 | 53 | //! @{ 54 | //! \verbatim 55 | 56 | 57 | // This must be linked @ 0x80000000 if it is to be run upon reset. 58 | .section .reset, "ax", @progbits 59 | 60 | 61 | .global _trampoline 62 | .type _trampoline, @function 63 | _trampoline: 64 | // Jump to program start. 65 | rjmp program_start 66 | 67 | .org PROGRAM_START_OFFSET 68 | program_start: 69 | // Jump to the C runtime startup routine. 70 | lda.w pc, _stext 71 | 72 | 73 | //! \endverbatim 74 | //! @} 75 | -------------------------------------------------------------------------------- /software/firmwares/wifishield/wifi_dnld/src/SOFTWARE_FRAMEWORK/UTILS/LIBS/NEWLIB_ADDONS/INCLUDE/nlao_cpu.h: -------------------------------------------------------------------------------- 1 | /* This header file is part of the ATMEL AVR-UC3-SoftwareFramework-1.7.0 Release */ 2 | 3 | /*This file is prepared for Doxygen automatic documentation generation.*/ 4 | /*! \file ********************************************************************* 5 | * 6 | * \brief NEWLIB_ADDONS CPU include file for AVR32. 7 | * 8 | * - Compiler: GNU GCC for AVR32 9 | * - Supported devices: All AVR32 devices can be used. 10 | * - AppNote: 11 | * 12 | * \author Atmel Corporation: http://www.atmel.com \n 13 | * Support and FAQ: http://support.atmel.no/ 14 | * 15 | ******************************************************************************/ 16 | 17 | /* Copyright (c) 2009 Atmel Corporation. All rights reserved. 18 | * 19 | * Redistribution and use in source and binary forms, with or without 20 | * modification, are permitted provided that the following conditions are met: 21 | * 22 | * 1. Redistributions of source code must retain the above copyright notice, this 23 | * list of conditions and the following disclaimer. 24 | * 25 | * 2. Redistributions in binary form must reproduce the above copyright notice, 26 | * this list of conditions and the following disclaimer in the documentation 27 | * and/or other materials provided with the distribution. 28 | * 29 | * 3. The name of Atmel may not be used to endorse or promote products derived 30 | * from this software without specific prior written permission. 31 | * 32 | * 4. This software may only be redistributed and used in connection with an Atmel 33 | * AVR product. 34 | * 35 | * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED 36 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 37 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE 38 | * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR 39 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 40 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 41 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 42 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 43 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 44 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE 45 | * 46 | */ 47 | 48 | #ifndef __AVR32_NEWLIB_ADDONS_CPU_H__ 49 | #define __AVR32_NEWLIB_ADDONS_CPU_H__ 50 | 51 | #include <_ansi.h> 52 | 53 | _BEGIN_STD_C 54 | 55 | #define CPU_HZ get_cpu_hz() 56 | 57 | void udelay(unsigned long usec); 58 | void set_cpu_hz(unsigned int clk_hz); 59 | unsigned int get_cpu_hz(); 60 | 61 | _END_STD_C 62 | 63 | #endif 64 | -------------------------------------------------------------------------------- /software/firmwares/wifishield/wifi_dnld/src/SOFTWARE_FRAMEWORK/UTILS/LIBS/NEWLIB_ADDONS/INCLUDE/nlao_interrupts.h: -------------------------------------------------------------------------------- 1 | /* This header file is part of the ATMEL AVR-UC3-SoftwareFramework-1.7.0 Release */ 2 | 3 | /*This file is prepared for Doxygen automatic documentation generation.*/ 4 | /*! \file ********************************************************************* 5 | * 6 | * \brief NEWLIB_ADDONS interrupts include file for AVR32. 7 | * 8 | * - Compiler: GNU GCC for AVR32 9 | * - Supported devices: All AVR32 devices can be used. 10 | * - AppNote: 11 | * 12 | * \author Atmel Corporation: http://www.atmel.com \n 13 | * Support and FAQ: http://support.atmel.no/ 14 | * 15 | ******************************************************************************/ 16 | 17 | /* Copyright (c) 2009 Atmel Corporation. All rights reserved. 18 | * 19 | * Redistribution and use in source and binary forms, with or without 20 | * modification, are permitted provided that the following conditions are met: 21 | * 22 | * 1. Redistributions of source code must retain the above copyright notice, this 23 | * list of conditions and the following disclaimer. 24 | * 25 | * 2. Redistributions in binary form must reproduce the above copyright notice, 26 | * this list of conditions and the following disclaimer in the documentation 27 | * and/or other materials provided with the distribution. 28 | * 29 | * 3. The name of Atmel may not be used to endorse or promote products derived 30 | * from this software without specific prior written permission. 31 | * 32 | * 4. This software may only be redistributed and used in connection with an Atmel 33 | * AVR product. 34 | * 35 | * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED 36 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 37 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE 38 | * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR 39 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 40 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 41 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 42 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 43 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 44 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE 45 | * 46 | */ 47 | 48 | #ifndef __AVR32_NEWLIB_ADDONS_INTERRUPTS_H__ 49 | #define __AVR32_NEWLIB_ADDONS_INTERRUPTS_H__ 50 | 51 | #include <_ansi.h> 52 | 53 | _BEGIN_STD_C 54 | 55 | #define INT_GRPS 64 56 | #define INT_LINES 32 57 | #define INTPR_BASE (__intc_base__ + 0x0000) 58 | #define INTREQ_BASE (__intc_base__ + 64*4) 59 | #define INTCAUSE_BASE (__intc_base__ + 2*64*4) 60 | 61 | //Register offsets 62 | #define INTLEVEL 30 63 | #define AUTOVECTOR 0 64 | #define AUTOVECTOR_BITS 14 65 | 66 | //Priorities 67 | #define INT0 0 68 | #define INT1 1 69 | #define INT2 2 70 | #define INT3 3 71 | 72 | 73 | typedef void (*__newlib_int_handler)(int /* int_grp*/, void */*user_handle*/); 74 | 75 | __newlib_int_handler register_interrupt(__newlib_int_handler handler, int int_grp, int line, int priority, 76 | .../* void *user_handle*/); 77 | void init_interrupts(); 78 | void set_interrupts_base(void *base); 79 | 80 | _END_STD_C 81 | 82 | #endif 83 | -------------------------------------------------------------------------------- /software/firmwares/wifishield/wifi_dnld/src/SOFTWARE_FRAMEWORK/UTILS/LIBS/NEWLIB_ADDONS/libnewlib_addons-at32ucr2-speed_opt.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/peng-zhihui/Roboard-Pro/920538e04199dee27125e3e974f43b122835794e/software/firmwares/wifishield/wifi_dnld/src/SOFTWARE_FRAMEWORK/UTILS/LIBS/NEWLIB_ADDONS/libnewlib_addons-at32ucr2-speed_opt.a -------------------------------------------------------------------------------- /software/firmwares/wifishield/wifi_dnld/src/SOFTWARE_FRAMEWORK/UTILS/PREPROCESSOR/preprocessor.h: -------------------------------------------------------------------------------- 1 | /* This header file is part of the ATMEL AVR-UC3-SoftwareFramework-1.7.0 Release */ 2 | 3 | /*This file is prepared for Doxygen automatic documentation generation.*/ 4 | /*! \file ********************************************************************* 5 | * 6 | * \brief Preprocessor utils. 7 | * 8 | * - Compiler: IAR EWAVR32 and GNU GCC for AVR32 9 | * - Supported devices: All AVR32 devices can be used. 10 | * 11 | * \author Atmel Corporation: http://www.atmel.com \n 12 | * Support and FAQ: http://support.atmel.no/ 13 | * 14 | ******************************************************************************/ 15 | 16 | /* Copyright (c) 2009 Atmel Corporation. All rights reserved. 17 | * 18 | * Redistribution and use in source and binary forms, with or without 19 | * modification, are permitted provided that the following conditions are met: 20 | * 21 | * 1. Redistributions of source code must retain the above copyright notice, this 22 | * list of conditions and the following disclaimer. 23 | * 24 | * 2. Redistributions in binary form must reproduce the above copyright notice, 25 | * this list of conditions and the following disclaimer in the documentation 26 | * and/or other materials provided with the distribution. 27 | * 28 | * 3. The name of Atmel may not be used to endorse or promote products derived 29 | * from this software without specific prior written permission. 30 | * 31 | * 4. This software may only be redistributed and used in connection with an Atmel 32 | * AVR product. 33 | * 34 | * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED 35 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 36 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE 37 | * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR 38 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 39 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 40 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 41 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 42 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 43 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE 44 | * 45 | */ 46 | 47 | #ifndef _PREPROCESSOR_H_ 48 | #define _PREPROCESSOR_H_ 49 | 50 | #include "tpaste.h" 51 | #include "stringz.h" 52 | #include "mrepeat.h" 53 | 54 | 55 | #endif // _PREPROCESSOR_H_ 56 | -------------------------------------------------------------------------------- /software/firmwares/wifishield/wifi_dnld/src/SOFTWARE_FRAMEWORK/UTILS/PREPROCESSOR/stringz.h: -------------------------------------------------------------------------------- 1 | /* This header file is part of the ATMEL AVR-UC3-SoftwareFramework-1.7.0 Release */ 2 | 3 | /*This file is prepared for Doxygen automatic documentation generation.*/ 4 | /*! \file ********************************************************************* 5 | * 6 | * \brief Preprocessor stringizing utils. 7 | * 8 | * - Compiler: IAR EWAVR32 and GNU GCC for AVR32 9 | * - Supported devices: All AVR32 devices can be used. 10 | * 11 | * \author Atmel Corporation: http://www.atmel.com \n 12 | * Support and FAQ: http://support.atmel.no/ 13 | * 14 | ******************************************************************************/ 15 | 16 | /* Copyright (c) 2009 Atmel Corporation. All rights reserved. 17 | * 18 | * Redistribution and use in source and binary forms, with or without 19 | * modification, are permitted provided that the following conditions are met: 20 | * 21 | * 1. Redistributions of source code must retain the above copyright notice, this 22 | * list of conditions and the following disclaimer. 23 | * 24 | * 2. Redistributions in binary form must reproduce the above copyright notice, 25 | * this list of conditions and the following disclaimer in the documentation 26 | * and/or other materials provided with the distribution. 27 | * 28 | * 3. The name of Atmel may not be used to endorse or promote products derived 29 | * from this software without specific prior written permission. 30 | * 31 | * 4. This software may only be redistributed and used in connection with an Atmel 32 | * AVR product. 33 | * 34 | * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED 35 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 36 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE 37 | * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR 38 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 39 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 40 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 41 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 42 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 43 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE 44 | * 45 | */ 46 | 47 | #ifndef _STRINGZ_H_ 48 | #define _STRINGZ_H_ 49 | 50 | 51 | /*! \brief Stringize. 52 | * 53 | * Stringize a preprocessing token, this token being allowed to be \#defined. 54 | * 55 | * May be used only within macros with the token passed as an argument if the token is \#defined. 56 | * 57 | * For example, writing STRINGZ(PIN) within a macro \#defined by PIN_NAME(PIN) 58 | * and invoked as PIN_NAME(PIN0) with PIN0 \#defined as A0 is equivalent to 59 | * writing "A0". 60 | */ 61 | #define STRINGZ(x) #x 62 | 63 | /*! \brief Absolute stringize. 64 | * 65 | * Stringize a preprocessing token, this token being allowed to be \#defined. 66 | * 67 | * No restriction of use if the token is \#defined. 68 | * 69 | * For example, writing ASTRINGZ(PIN0) anywhere with PIN0 \#defined as A0 is 70 | * equivalent to writing "A0". 71 | */ 72 | #define ASTRINGZ(x) STRINGZ(x) 73 | 74 | 75 | #endif // _STRINGZ_H_ 76 | -------------------------------------------------------------------------------- /software/firmwares/wifishield/wifi_dnld/src/clocks.h: -------------------------------------------------------------------------------- 1 | /* This header file is part of the ATMEL AVR-UC3-SoftwareFramework-1.7.0 Release */ 2 | 3 | /*! \page License 4 | * Copyright (C) 2009, H&D Wireless AB All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions are met: 8 | * 9 | * 1. Redistributions of source code must retain the above copyright notice, 10 | * this list of conditions and the following disclaimer. 11 | * 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 | * 16 | * 3. The name of H&D Wireless AB may not be used to endorse or promote products derived 17 | * from this software without specific prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY H&D WIRELESS AB ``AS IS'' AND ANY EXPRESS OR IMPLIED 20 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 21 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE EXPRESSLY AND 22 | * SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, 23 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 24 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 25 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 26 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 28 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | 31 | #ifndef CLOCKS_H 32 | #define CLOCKS_H 33 | 34 | #include "board.h" 35 | 36 | 37 | #if BOARD == EVK1100 38 | # define USE_PLL 39 | # define OSC 0 40 | # define PLL_MUL 10 41 | #elif BOARD == EVK1101 42 | # define USE_PLL 43 | # define OSC 0 44 | # define PLL_MUL 9 45 | #elif BOARD == EVK1104 46 | # define USE_PLL 47 | # define OSC 0 48 | # define PLL_MUL 9 /* for some reason we cant use 66 MHz */ 49 | #elif BOARD == EVK1105 50 | # define USE_PLL 51 | # define OSC 1 52 | # define PLL_MUL 10 53 | #elif BOARD == ARDUINO 54 | # define USE_PLL 55 | # define OSC 0 56 | # define PLL_MUL 8 57 | #endif 58 | 59 | #if OSC == 0 60 | # define FOSC FOSC0 /* 12 MHz */ 61 | #else 62 | # define FOSC FOSC1 /* 11.2896 MHz */ 63 | #endif 64 | 65 | #ifdef USE_PLL 66 | # define FMCK_HZ ((FOSC * (PLL_MUL + 1)) / 2) 67 | #else 68 | # define FMCK_HZ FOSC 69 | #endif 70 | 71 | #define FCPU_HZ FMCK_HZ 72 | #define FHSB_HZ FCPU_HZ 73 | #define FPBB_HZ FMCK_HZ 74 | #define FPBA_HZ FMCK_HZ 75 | 76 | void init_sys_clocks(void); 77 | 78 | #endif 79 | -------------------------------------------------------------------------------- /software/firmwares/wifishield/wifi_dnld/src/license.txt: -------------------------------------------------------------------------------- 1 | Copyright (C) 2009, H&D Wireless AB All rights reserved. 2 | 3 | The license to use this software in whole and in part and to 4 | redistribute it in any form follows with the WiFi HW module from H&D 5 | Wireless and is granted under the following restrictions: 6 | 7 | 1. Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | 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 | 14 | 3. The name of H&D Wireless AB may not be used to endorse or promote 15 | products derived from this software without specific prior written 16 | permission. 17 | 18 | 4. The software may only be used together with hardware from H&D 19 | Wireless all other use is prohibited. 20 | 21 | 5. The license to use and redistribute the software is granted 22 | together with the purchase of a hardware platform on a one to one 23 | basis 24 | 25 | 6. The binary code may not be reversed engineered or by other means 26 | copied to circumvent this license. 27 | 28 | THIS SOFTWARE IS PROVIDED BY H&D WIRELESS AB ``AS IS'' AND ANY 29 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 30 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 31 | PURPOSE ARE EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT 32 | SHALL HD WIRELESS AB BE LIABLE FOR ANY DIRECT, INDIRECT, 33 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 34 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 35 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 36 | HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 37 | STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 38 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED 39 | OF THE POSSIBILITY OF SUCH DAMAGE. 40 | 41 | For more information regarding this software license Contact H&D 42 | Wireless AB (support@hd-wireless.se). 43 | -------------------------------------------------------------------------------- /software/firmwares/wifishield/wifi_dnld/src/nor_flash.h: -------------------------------------------------------------------------------- 1 | /* This header file is part of the ATMEL AVR-UC3-SoftwareFramework-1.7.0 Release */ 2 | 3 | /*! \page License 4 | * Copyright (C) 2009, H&D Wireless AB All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions are met: 8 | * 9 | * 1. Redistributions of source code must retain the above copyright notice, 10 | * this list of conditions and the following disclaimer. 11 | * 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 | * 16 | * 3. The name of H&D Wireless AB may not be used to endorse or promote products derived 17 | * from this software without specific prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY H&D WIRELESS AB ``AS IS'' AND ANY EXPRESS OR IMPLIED 20 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 21 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE EXPRESSLY AND 22 | * SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, 23 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 24 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 25 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 26 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 28 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | #ifndef NOR_FLASH_H 31 | #define NOR_FLASH_H 32 | 33 | #include "at45dbx.h" 34 | 35 | #define SECTOR_SIZE AT45DBX_SECTOR_SIZE 36 | 37 | void flash_init(void); 38 | void flash_write(U32 addr, const U8* buf, U32 len); 39 | void flash_read(U32 addr, U8* buf, U32 len); 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /software/firmwares/wifishield/wifi_dnld/src/printf-stdarg.h: -------------------------------------------------------------------------------- 1 | /* This header file is part of the ATMEL AVR-UC3-SoftwareFramework-1.7.0 Release */ 2 | 3 | /*! \page License 4 | * Copyright (C) 2009, H&D Wireless AB All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions are met: 8 | * 9 | * 1. Redistributions of source code must retain the above copyright notice, 10 | * this list of conditions and the following disclaimer. 11 | * 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 | * 16 | * 3. The name of H&D Wireless AB may not be used to endorse or promote products derived 17 | * from this software without specific prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY H&D WIRELESS AB ``AS IS'' AND ANY EXPRESS OR IMPLIED 20 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 21 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE EXPRESSLY AND 22 | * SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, 23 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 24 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 25 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 26 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 28 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | #ifndef PRINTF_STDARG_H 31 | #define PRINTF_STDARG_H 32 | #include 33 | 34 | int printk(const char *format, ...); 35 | int printk_va(char **out, const char *format, va_list args ); 36 | #endif 37 | -------------------------------------------------------------------------------- /software/firmwares/wifishield/wifi_dnld/src/startup.c: -------------------------------------------------------------------------------- 1 | /* This source file is part of the ATMEL AVR-UC3-SoftwareFramework-1.7.0 Release */ 2 | 3 | /*! \page License 4 | * Copyright (C) 2009, H&D Wireless AB All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions are met: 8 | * 9 | * 1. Redistributions of source code must retain the above copyright notice, 10 | * this list of conditions and the following disclaimer. 11 | * 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 | * 16 | * 3. The name of H&D Wireless AB may not be used to endorse or promote products derived 17 | * from this software without specific prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY H&D WIRELESS AB ``AS IS'' AND ANY EXPRESS OR IMPLIED 20 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 21 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE EXPRESSLY AND 22 | * SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, 23 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 24 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 25 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 26 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 28 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | #include "startup.h" 31 | #include "pm.h" 32 | #include "intc.h" 33 | #include "board.h" 34 | #include "print_funcs.h" 35 | #include "clocks.h" 36 | 37 | 38 | static void init_exceptions(void) 39 | { 40 | extern void _evba; 41 | Set_system_register(AVR32_EVBA, (int)&_evba); 42 | Enable_global_exception(); 43 | } 44 | 45 | static void init_hmatrix(void) 46 | { 47 | union { 48 | unsigned long scfg; 49 | avr32_hmatrix_scfg_t SCFG; 50 | } u_avr32_hmatrix_scfg = { 51 | AVR32_HMATRIX.scfg[AVR32_HMATRIX_SLAVE_FLASH] 52 | }; 53 | u_avr32_hmatrix_scfg.SCFG.defmstr_type = 54 | AVR32_HMATRIX_DEFMSTR_TYPE_LAST_DEFAULT; 55 | AVR32_HMATRIX.scfg[AVR32_HMATRIX_SLAVE_FLASH] = 56 | u_avr32_hmatrix_scfg.scfg; 57 | } 58 | 59 | static void init_interrupts(void) 60 | { 61 | INTC_init_interrupts(); 62 | 63 | //initExtInt(); 64 | 65 | Enable_global_interrupt(); 66 | } 67 | 68 | void startup_init(void) 69 | { 70 | init_exceptions(); 71 | init_hmatrix(); 72 | init_sys_clocks(); 73 | init_interrupts(); 74 | init_dbg_rs232(FPBA_HZ); 75 | } 76 | -------------------------------------------------------------------------------- /software/firmwares/wifishield/wifi_dnld/src/startup.h: -------------------------------------------------------------------------------- 1 | /* This header file is part of the ATMEL AVR-UC3-SoftwareFramework-1.7.0 Release */ 2 | 3 | /*! \page License 4 | * Copyright (C) 2009, H&D Wireless AB All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions are met: 8 | * 9 | * 1. Redistributions of source code must retain the above copyright notice, 10 | * this list of conditions and the following disclaimer. 11 | * 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 | * 16 | * 3. The name of H&D Wireless AB may not be used to endorse or promote products derived 17 | * from this software without specific prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY H&D WIRELESS AB ``AS IS'' AND ANY EXPRESS OR IMPLIED 20 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 21 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE EXPRESSLY AND 22 | * SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, 23 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 24 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 25 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 26 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 28 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | #ifndef STARTUP_H 31 | #define STARTUP_H 32 | 33 | void startup_init(void); 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /software/firmwares/wifishield/wifishield.atsln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 11.00 3 | # Atmel Studio Solution File, Format Version 11.00 4 | Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "wifi_dnld", "wifi_dnld\wifi_dnld.cproj", "{EB9606BC-DE32-4EDD-9CDA-AE3BF36977A2}" 5 | EndProject 6 | Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "wifiHD", "wifiHD\wifiHD.cproj", "{417E15DB-488A-4B56-8D4E-FBE832B2B649}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug_512|AVR = Debug_512|AVR 11 | Debug|AVR = Debug|AVR 12 | Release_512|AVR = Release_512|AVR 13 | Release|AVR = Release|AVR 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {EB9606BC-DE32-4EDD-9CDA-AE3BF36977A2}.Debug_512|AVR.ActiveCfg = Debug|AVR 17 | {EB9606BC-DE32-4EDD-9CDA-AE3BF36977A2}.Debug_512|AVR.Build.0 = Debug|AVR 18 | {EB9606BC-DE32-4EDD-9CDA-AE3BF36977A2}.Debug|AVR.ActiveCfg = Debug|AVR 19 | {EB9606BC-DE32-4EDD-9CDA-AE3BF36977A2}.Debug|AVR.Build.0 = Debug|AVR 20 | {EB9606BC-DE32-4EDD-9CDA-AE3BF36977A2}.Release_512|AVR.ActiveCfg = Release|AVR 21 | {EB9606BC-DE32-4EDD-9CDA-AE3BF36977A2}.Release_512|AVR.Build.0 = Release|AVR 22 | {EB9606BC-DE32-4EDD-9CDA-AE3BF36977A2}.Release|AVR.ActiveCfg = Release|AVR 23 | {EB9606BC-DE32-4EDD-9CDA-AE3BF36977A2}.Release|AVR.Build.0 = Release|AVR 24 | {417E15DB-488A-4B56-8D4E-FBE832B2B649}.Debug_512|AVR.ActiveCfg = Debug_512|AVR 25 | {417E15DB-488A-4B56-8D4E-FBE832B2B649}.Debug_512|AVR.Build.0 = Debug_512|AVR 26 | {417E15DB-488A-4B56-8D4E-FBE832B2B649}.Debug|AVR.ActiveCfg = Debug|AVR 27 | {417E15DB-488A-4B56-8D4E-FBE832B2B649}.Debug|AVR.Build.0 = Debug|AVR 28 | {417E15DB-488A-4B56-8D4E-FBE832B2B649}.Release_512|AVR.ActiveCfg = Release_512|AVR 29 | {417E15DB-488A-4B56-8D4E-FBE832B2B649}.Release_512|AVR.Build.0 = Release_512|AVR 30 | {417E15DB-488A-4B56-8D4E-FBE832B2B649}.Release|AVR.ActiveCfg = Release|AVR 31 | {417E15DB-488A-4B56-8D4E-FBE832B2B649}.Release|AVR.Build.0 = Release|AVR 32 | EndGlobalSection 33 | GlobalSection(SolutionProperties) = preSolution 34 | HideSolutionNode = FALSE 35 | EndGlobalSection 36 | EndGlobal 37 | -------------------------------------------------------------------------------- /software/programmers.txt: -------------------------------------------------------------------------------- 1 | avrisp.name=AVR ISP 2 | avrisp.communication=serial 3 | avrisp.protocol=stk500v1 4 | avrisp.program.protocol=stk500v1 5 | avrisp.program.tool=avrdude 6 | avrisp.program.extra_params=-P{serial.port} 7 | 8 | avrispmkii.name=AVRISP mkII 9 | avrispmkii.communication=usb 10 | avrispmkii.protocol=stk500v2 11 | avrispmkii.program.protocol=stk500v2 12 | avrispmkii.program.tool=avrdude 13 | avrispmkii.program.extra_params=-Pusb 14 | 15 | usbtinyisp.name=USBtinyISP 16 | usbtinyisp.protocol=usbtiny 17 | usbtinyisp.program.tool=avrdude 18 | usbtinyisp.program.extra_params= 19 | 20 | arduinoisp.name=ArduinoISP 21 | arduinoisp.protocol=arduinoisp 22 | arduinoisp.program.tool=avrdude 23 | arduinoisp.program.extra_params= 24 | 25 | arduinoisporg.name=ArduinoISP.org 26 | arduinoisporg.protocol=arduinoisporg 27 | arduinoisporg.program.tool=avrdude 28 | arduinoisporg.program.extra_params= 29 | 30 | usbasp.name=USBasp 31 | usbasp.communication=usb 32 | usbasp.protocol=usbasp 33 | usbasp.program.protocol=usbasp 34 | usbasp.program.tool=avrdude 35 | usbasp.program.extra_params=-Pusb 36 | 37 | parallel.name=Parallel Programmer 38 | parallel.protocol=dapa 39 | parallel.force=true 40 | # parallel.delay=200 41 | parallel.program.tool=avrdude 42 | parallel.program.extra_params=-F 43 | 44 | arduinoasisp.name=Arduino as ISP 45 | arduinoasisp.communication=serial 46 | arduinoasisp.protocol=stk500v1 47 | arduinoasisp.speed=19200 48 | arduinoasisp.program.protocol=stk500v1 49 | arduinoasisp.program.speed=19200 50 | arduinoasisp.program.tool=avrdude 51 | arduinoasisp.program.extra_params=-P{serial.port} -b{program.speed} 52 | 53 | usbGemma.name=Arduino Gemma 54 | usbGemma.protocol=arduinogemma 55 | usbGemma.program.tool=avrdude 56 | usbGemma.program.extra_params= 57 | usbGemma.config.path={runtime.platform.path}/bootloaders/gemma/avrdude.conf 58 | 59 | # STK500 firmware version v1 and v2 use different serial protocols. 60 | # Using the 'stk500' protocol tells avrdude to try and autodetect the 61 | # firmware version. If this leads to problems, we might need to add 62 | # stk500v1 and stk500v2 entries to allow explicitely selecting the 63 | # firmware version. 64 | stk500.name=Atmel STK500 development board 65 | stk500.communication=serial 66 | stk500.protocol=stk500 67 | stk500.program.protocol=stk500 68 | stk500.program.tool=avrdude 69 | stk500.program.extra_params=-P{serial.port} 70 | 71 | ## Notes about Dangerous Prototypes Bus Pirate as ISP 72 | ## Bus Pirate V3 need Firmware v5.10 or later 73 | ## Bus Pirate V4 need Firmware v6.3-r2151 or later 74 | ## Could happen that BP does not have enough current to power an Arduino board 75 | ## through the ICSP connector. In this case disconnect the +Vcc from ICSP connector 76 | ## and power Arduino board in the normal way. 77 | buspirate.name=BusPirate as ISP 78 | buspirate.communication=serial 79 | buspirate.protocol=buspirate 80 | buspirate.program.protocol=buspirate 81 | buspirate.program.tool=avrdude 82 | buspirate.program.extra_params=-P{serial.port} 83 | 84 | --------------------------------------------------------------------------------