├── README.md ├── boards.txt ├── boot_sequence.png ├── bootimg.png ├── bootloaders ├── .vs │ └── CustomOptiboot328pb │ │ └── v14 │ │ └── .atsuo ├── CustomOptiboot328pb.atsln ├── CustomOptiboot328pb │ ├── .vs │ │ └── CustomOptiboot328pb │ │ │ └── v14 │ │ │ ├── .atsuo │ │ │ └── _atsuo.doc │ ├── CustomOptiboot328pb.componentinfo.xml │ ├── CustomOptiboot328pb.cproj │ ├── Debug │ │ ├── CustomOptiboot328pb.eep │ │ ├── CustomOptiboot328pb.hex │ │ ├── CustomOptiboot328pb.lss │ │ ├── CustomOptiboot328pb.map │ │ ├── CustomOptiboot328pb.srec │ │ ├── Makefile │ │ └── makedep.mk │ ├── boot.h │ ├── main.c │ ├── pin_defs.h │ └── stk500.h └── eboot │ ├── LICENSE │ ├── Makefile │ ├── eboot.c │ ├── eboot.elf │ ├── eboot.ld │ ├── eboot_command.c │ ├── eboot_command.h │ ├── flash.c │ ├── flash.h │ └── rom.ld ├── cores └── atmega328pb │ ├── 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 ├── extras ├── crtatmega328pb.o └── libatmega328pb.a ├── 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 ├── jolly_esp │ ├── WiFiManager.bin │ └── WiFiManager_spiffs.bin └── 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 ├── libraries ├── EEPROM │ ├── README.md │ ├── examples │ │ ├── eeprom_clear │ │ │ └── eeprom_clear.ino │ │ ├── eeprom_crc │ │ │ └── eeprom_crc.ino │ │ ├── eeprom_get │ │ │ └── eeprom_get.ino │ │ ├── eeprom_iteration │ │ │ └── eeprom_iteration.ino │ │ ├── eeprom_put │ │ │ └── eeprom_put.ino │ │ ├── eeprom_read │ │ │ └── eeprom_read.ino │ │ ├── eeprom_update │ │ │ └── eeprom_update.ino │ │ └── eeprom_write │ │ │ └── eeprom_write.ino │ ├── keywords.txt │ ├── library.properties │ └── src │ │ └── EEPROM.h ├── HID │ ├── keywords.txt │ ├── library.properties │ └── src │ │ ├── HID.cpp │ │ └── HID.h ├── SPI │ ├── examples │ │ ├── BarometricPressureSensor │ │ │ └── BarometricPressureSensor.ino │ │ └── DigitalPotControl │ │ │ └── DigitalPotControl.ino │ ├── keywords.txt │ ├── library.properties │ └── src │ │ ├── SPI.cpp │ │ └── SPI.h ├── SoftwareSerial │ ├── examples │ │ ├── SoftwareSerialExample │ │ │ └── SoftwareSerialExample.ino │ │ └── TwoPortReceive │ │ │ └── TwoPortReceive.ino │ ├── keywords.txt │ ├── library.properties │ └── src │ │ ├── SoftwareSerial.cpp │ │ └── SoftwareSerial.h ├── WiFi │ ├── examples │ │ ├── CheckFirmwareVersion │ │ │ └── CheckFirmwareVersion.ino │ │ ├── ConnectNoEncryption │ │ │ └── ConnectNoEncryption.ino │ │ ├── ConnectToASavedNetwork │ │ │ └── ConnectToASavedNetwork.ino │ │ ├── ConnectToAnEncryptedNetwork │ │ │ └── ConnectToAnEncryptedNetwork.ino │ │ ├── ScanNetworks │ │ │ └── ScanNetworks.ino │ │ ├── WiFiChatServer │ │ │ └── WiFiChatServer.ino │ │ ├── WiFiRestServer │ │ │ └── WiFiRestServer.ino │ │ ├── WiFiUdpSendReceiveString │ │ │ └── WiFiUdpSendReceiveString.ino │ │ ├── WiFiWebClient │ │ │ └── WiFiWebClient.ino │ │ └── WiFiWebServer │ │ │ └── WiFiWebServer.ino │ ├── keywords.txt │ ├── library.properties │ └── src │ │ ├── WiFi.cpp │ │ ├── WiFi.h │ │ ├── WiFiClient.cpp │ │ ├── WiFiClient.h │ │ ├── WiFiServer.cpp │ │ ├── WiFiServer.h │ │ ├── WiFiUdp.cpp │ │ ├── WiFiUdp.h │ │ └── utility │ │ ├── definitions.h │ │ ├── packager.cpp │ │ ├── packager.h │ │ └── spi │ │ ├── spi_drv.cpp │ │ └── spi_drv.h └── Wire │ ├── examples │ ├── SFRRanger_reader │ │ └── SFRRanger_reader.ino │ ├── digital_potentiometer │ │ └── digital_potentiometer.ino │ ├── master_reader │ │ └── master_reader.ino │ ├── master_writer │ │ └── master_writer.ino │ ├── slave_receiver │ │ └── slave_receiver.ino │ └── slave_sender │ │ └── slave_sender.ino │ ├── keywords.txt │ ├── library.properties │ └── src │ ├── Wire.cpp │ ├── Wire.h │ └── utility │ ├── twi.c │ └── twi.h ├── platform.txt ├── programmers.txt └── variants └── mega328pb ├── iom328pb.h └── pins_arduino.h /README.md: -------------------------------------------------------------------------------- 1 | # Arduino core for the Jolly's AVR ATMEGA328PB 2 | 3 | ### Contents 4 | - [Documentation](#documentation) 5 | - [Issue/Bug report](#issuebug-report) 6 | 7 | ### Documentation 8 | 9 | **Getting Started** 10 | 11 | Jolly is a new electronic module for makers and Arduino UNO lovers. 12 | The module has integrated Wi-Fi, to infinitely extend the potential of your projects into the new world of IoT. 13 | You only need to remove the ATMEGA328P microcontroller, replace it with the Jolly module and you will have an IoT board with Wi-Fi. 14 | To date, all the existing projects are mutually compatible. 15 | 16 | **Installing (Windows, Linux and macOS)** 17 | 18 | Make sure your Arduino IDE version is 1.8.13 or higher. 19 | 20 | To install the Jolly AVR platform in the Arduino IDE it is necessary to follow the following steps: 21 | - select the Preferences tab in the file menu 22 | - add the following two links to the **Additional Boards Manager URLs** 23 | https://tech-jollydev.github.io/package_jolly_index.json 24 | https://espressif.github.io/arduino-esp32/package_esp32_index.json 25 | - select the board menu in the tools menu and finally select the boards manager option 26 | - by typing **jolly** in the search bar the **Jolly AVR Boards** platform should appear 27 | - now the platform can be installed 28 | 29 | **Reload the ESP8285 default firmware** 30 | 31 | A pre-compiled version of the default ESP8285 firmware is available under the path /firmwares/jolly_esp/ 32 | The firmware is composed by two files: WiFiManager.bin and WiFiManager_spiff.bin 33 | In case the firmware needs to be updated for any reason, there is a specific semi-automatic procedure to follow: 34 | - in Arduino IDE select the tools menu 35 | - choose ESP8285 for the bootloader option as shown in the picture below![](/bootimg.png) 36 | - press the boot button located on the Jolly module. While holding it pressed, press the reset button on the Arduino UNO for 1 second, then release it. Keep holding the boot button for 1 second longer, then release it ![](/boot_sequence.png) Now the Jolly is entered in the boot mode for the ESP8285 37 | - finally click on **burn bootloader** option and the procedure will start automatically 38 | 39 | **Hint**: to keep track of the update process, enable both the **compilation** and **upload** radio button in the **show verbose output during:** option located in the file menu Preferences tab of the Arduino IDE 40 | 41 | Additionally, it is possible to fully customize the code running on ESP8285 by using a dedicated platform available [here](https://github.com/tech-jollydev/jolly-arduino-esp8285-platform). 42 | 43 | ### Issue/Bug report 44 | You can use **Issues** section of this repository to report an error. Before reporting an issue, make sure you've searched for similar one that was already created. 45 | Finally, and only for severe issues, write an e-mail to tech@jolly-dev.com 46 | -------------------------------------------------------------------------------- /boards.txt: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022 jolly-dev. All right reserved. 2 | # 3 | # This library is free software; you can redistribute it and/or 4 | # modify it under the terms of the GNU Lesser General Public 5 | # License as published by the Free Software Foundation; either 6 | # version 2.1 of the License, or (at your option) any later version. 7 | # 8 | # This library is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 11 | # See the GNU Lesser General Public License for more details. 12 | # 13 | # You should have received a copy of the GNU Lesser General Public 14 | # License along with this library; if not, write to the Free Software 15 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 16 | 17 | # See: http://code.google.com/p/arduino/wiki/Platforms 18 | 19 | menu.cpu=Bootloader 20 | 21 | jolly.name=Jolly 22 | jolly.build.board=jolly 23 | 24 | #--------------------------------------------------------------------------------------# 25 | # ATMEGA 328PB 26 | #--------------------------------------------------------------------------------------# 27 | 28 | jolly.build.mcu=atmega328pb 29 | jolly.build.f_cpu=16000000L 30 | jolly.build.core=atmega328pb 31 | jolly.build.variant=mega328pb 32 | #jolly.build.extra_flags=-include {runtime.platform.path}/variants/mega328pb/iom328pb.h 33 | jolly.build.extra_flags= 34 | 35 | jolly.upload.tool=arduino:avrdude 36 | jolly.upload.protocol=arduino 37 | jolly.upload.mcu=atmega328pb 38 | jolly.upload.maximum_size=32256 39 | jolly.upload.maximum_data_size=2048 40 | jolly.upload.speed=115200 41 | 42 | jolly.menu.cpu.avr=AVR 328p 43 | jolly.menu.cpu.avr.bootloader.tool=arduino:avrdude 44 | jolly.menu.cpu.avr.bootloader.low_fuses=0xFF 45 | jolly.menu.cpu.avr.bootloader.high_fuses=0xDC 46 | jolly.menu.cpu.avr.bootloader.extended_fuses=0xFD 47 | jolly.menu.cpu.avr.bootloader.unlock_bits=0x3F 48 | jolly.menu.cpu.avr.bootloader.lock_bits=0x0F 49 | jolly.menu.cpu.avr.bootloader.file=CustomOptiboot328pb/Debug/CustomOptiboot328pb.hex 50 | 51 | 52 | jolly.menu.cpu.esp=ESP8285 53 | jolly.menu.cpu.esp.bootloader.tool=esptool_py 54 | jolly.menu.cpu.esp.bootloader.file=CustomOptiboot328pb/Debug/CustomOptiboot328pb.hex 55 | jolly.menu.cpu.esp.bootloader.file_esp=0x00000 "{runtime.platform.path}/firmwares/jolly_esp/WiFiManager.bin" 0xCB000 "{runtime.platform.path}/firmwares/jolly_esp/WiFiManager_spiffs.bin" 56 | 57 | jolly.build.preproc.includes.flags=-w -x c++ -M -MG -MP 58 | jolly.build.preproc.macros.flags=-w -x c++ -E -CC 59 | 60 | jolly.build.recipe.size.regex=(?:\.text|\.data|\.bootloader)\s+([0-9]+).* 61 | jolly.build.recipe.size.regex.data=^(?:\.data|\.bss|\.noinit)\s+([0-9]+).* 62 | 63 | -------------------------------------------------------------------------------- /boot_sequence.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tech-jollydev/jolly-arduino-platform/42cf5362700ce58b6dfc64523f0b5a86193117e2/boot_sequence.png -------------------------------------------------------------------------------- /bootimg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tech-jollydev/jolly-arduino-platform/42cf5362700ce58b6dfc64523f0b5a86193117e2/bootimg.png -------------------------------------------------------------------------------- /bootloaders/.vs/CustomOptiboot328pb/v14/.atsuo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tech-jollydev/jolly-arduino-platform/42cf5362700ce58b6dfc64523f0b5a86193117e2/bootloaders/.vs/CustomOptiboot328pb/v14/.atsuo -------------------------------------------------------------------------------- /bootloaders/CustomOptiboot328pb.atsln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Atmel Studio Solution File, Format Version 11.00 4 | VisualStudioVersion = 14.0.23107.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "CustomOptiboot328pb", "CustomOptiboot328pb\CustomOptiboot328pb.cproj", "{DCE6C7E3-EE26-4D79-826B-08594B9AD897}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|AVR = Debug|AVR 11 | Release|AVR = Release|AVR 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|AVR.ActiveCfg = Debug|AVR 15 | {DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|AVR.Build.0 = Debug|AVR 16 | {DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|AVR.ActiveCfg = Release|AVR 17 | {DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|AVR.Build.0 = Release|AVR 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /bootloaders/CustomOptiboot328pb/.vs/CustomOptiboot328pb/v14/.atsuo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tech-jollydev/jolly-arduino-platform/42cf5362700ce58b6dfc64523f0b5a86193117e2/bootloaders/CustomOptiboot328pb/.vs/CustomOptiboot328pb/v14/.atsuo -------------------------------------------------------------------------------- /bootloaders/CustomOptiboot328pb/.vs/CustomOptiboot328pb/v14/_atsuo.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tech-jollydev/jolly-arduino-platform/42cf5362700ce58b6dfc64523f0b5a86193117e2/bootloaders/CustomOptiboot328pb/.vs/CustomOptiboot328pb/v14/_atsuo.doc -------------------------------------------------------------------------------- /bootloaders/CustomOptiboot328pb/Debug/CustomOptiboot328pb.eep: -------------------------------------------------------------------------------- 1 | :0400000300007C007D 2 | :00000001FF 3 | -------------------------------------------------------------------------------- /bootloaders/CustomOptiboot328pb/Debug/CustomOptiboot328pb.hex: -------------------------------------------------------------------------------- 1 | :107C00000C945A3E0C94383F0C94383F0C94383FF7 2 | :107C10000C94383F0C94383F0C94383F0C94383F08 3 | :107C20000C94383F0C94383F0C94383F0C94383FF8 4 | :107C30000C94383F0C94383F0C94383F0C94383FE8 5 | :107C40000C94383F0C94383F0C94383F0C94383FD8 6 | :107C50000C94383F0C94383F0C94383F0C94383FC8 7 | :107C60000C94383F0C94383F0C94383F0C94383FB8 8 | :107C70000C94383F0C94383F0C94383F0C94383FA8 9 | :107C80000C94383F0C94383F0C94383F0C94383F98 10 | :107C90000C94383F0C94383F0C94383F0C94383F88 11 | :107CA0000C94383F0C94383F0C94383F0C94383F78 12 | :107CB0000C94383F11241FBECFEFD8E0DEBFCDBFFC 13 | :107CC00011E0A0E0B1E0ECEFFFE702C005900D92FB 14 | :107CD000A230B107D9F721E0A2E0B1E001C01D92C6 15 | :107CE000A330B207E1F701C077C10E94793E0C943E 16 | :107CF000FC3F0E946B3F112484B7882369F0982FC2 17 | :107D00009A70923049F081FF02C097EF94BF282EFD 18 | :107D100080E00E94653F73C182E08093C00088E1EB 19 | :107D20008093C10086E08093C20080E190E0909350 20 | :107D3000C5008093C4008EE00E94653F93E0E92E69 21 | :107D4000DD24D39425E0C22E31E1B32E0E94593FA9 22 | :107D5000813489F40E94593F182F0E94D83F12386D 23 | :107D600011F481E005C0113811F488E001C083E00E 24 | :107D70000E94523F79C0823411F484E103C08534FB 25 | :107D800021F485E00E94E33F6FC0853549F40E94ED 26 | :107D9000593FC82F0E94593FD82FCC0FDD1F62C01A 27 | :107DA000863529F484E00E94E33F80E0E1CF843609 28 | :107DB00009F032C00E94593F0E94593FF82E0E949C 29 | :107DC000593FA82E00E011E00E94593FF80181932D 30 | :107DD0008F01FE12F9CF0E94D83FF5E4AF1201C027 31 | :107DE000FFCFFE01E7BEE89507B600FCFDCFA0E09F 32 | :107DF000B1E0FE018D919D910C01D7BEE895112453 33 | :107E00003296FA12F7CFFE01C7BEE89507B600FC1E 34 | :107E1000FDCFB7BEE89528C0843799F40E94593F3A 35 | :107E20000E94593FF82E0E94593F0E94D83F8E0170 36 | :107E3000F80185918F010E94523FFA94F110F8CF1A 37 | :107E400013C0853751F40E94D83F8EE10E94523F03 38 | :107E500085E90E94523F86E18BCF813519F488E095 39 | :107E60000E94653F0E94D83F80E10E94523F6ECF42 40 | :107E70000C94003E29E535EE3A95F1F72A95E1F7A5 41 | :107E8000089529E03EEE40EB4A95F1F73A95E1F787 42 | :107E90002A95D1F7089526E031ED3A95F1F72A9524 43 | :107EA000E1F708959091C00095FFFCCF8093C60044 44 | :107EB00008958091C00087FFFCCF8091C00084FDB1 45 | :107EC00001C0A8958091C6000895E0E6F0E098E131 46 | :107ED000908380830895CF93DF93639966C0619BFD 47 | :107EE00064C0699A719880E00E94653F6B9A7398AC 48 | :107EF0000E94413F0E943A3F699851984899FECFAD 49 | :107F000081E080930201C8EED3E0489B47C0809196 50 | :107F10000201882309F446C080910001909101017B 51 | :107F2000009731F0019790930101809300013AC0CE 52 | :107F3000D0930101C0930001809100019091010153 53 | :107F40009C01215031093093010120930001892BBC 54 | :107F500019F00E943A3FF0CF6B980E944B3F699A0C 55 | :107F600071980E94413F519A599A6998D0930101A2 56 | :107F7000C093000180910001909101019C0121506A 57 | :107F800031093093010120930001892B19F00E94DF 58 | :107F90004B3FF0CF8CE00E94653F04C0D0930101BD 59 | :107FA000C09300010E943A3FB0CFDF91CF91089576 60 | :107FB0000E94593F803221F088E00E94653FFFCF48 61 | :107FC00084E10C94523FCF93C82F0E94593FC15077 62 | :107FD000E1F7CF910C94D83FFC010A0167BFE89507 63 | :107FE000112407B600FCFDCF667029F0452B19F46B 64 | :0C7FF00081E187BFE8950895F894FFCF69 65 | :027FFC00E80398 66 | :0400000300007C007D 67 | :00000001FF 68 | -------------------------------------------------------------------------------- /bootloaders/CustomOptiboot328pb/Debug/CustomOptiboot328pb.srec: -------------------------------------------------------------------------------- 1 | S01B0000437573746F6D4F707469626F6F7433323870622E73726563CF 2 | S1137C000C945A3E0C94383F0C94383F0C94383FF3 3 | S1137C100C94383F0C94383F0C94383F0C94383F04 4 | S1137C200C94383F0C94383F0C94383F0C94383FF4 5 | S1137C300C94383F0C94383F0C94383F0C94383FE4 6 | S1137C400C94383F0C94383F0C94383F0C94383FD4 7 | S1137C500C94383F0C94383F0C94383F0C94383FC4 8 | S1137C600C94383F0C94383F0C94383F0C94383FB4 9 | S1137C700C94383F0C94383F0C94383F0C94383FA4 10 | S1137C800C94383F0C94383F0C94383F0C94383F94 11 | S1137C900C94383F0C94383F0C94383F0C94383F84 12 | S1137CA00C94383F0C94383F0C94383F0C94383F74 13 | S1137CB00C94383F11241FBECFEFD8E0DEBFCDBFF8 14 | S1137CC011E0A0E0B1E0ECEFFFE702C005900D92F7 15 | S1137CD0A230B107D9F721E0A2E0B1E001C01D92C2 16 | S1137CE0A330B207E1F701C077C10E94793E0C943A 17 | S1137CF0FC3F0E946B3F112484B7882369F0982FBE 18 | S1137D009A70923049F081FF02C097EF94BF282EF9 19 | S1137D1080E00E94653F73C182E08093C00088E1E7 20 | S1137D208093C10086E08093C20080E190E090934C 21 | S1137D30C5008093C4008EE00E94653F93E0E92E65 22 | S1137D40DD24D39425E0C22E31E1B32E0E94593FA5 23 | S1137D50813489F40E94593F182F0E94D83F123869 24 | S1137D6011F481E005C0113811F488E001C083E00A 25 | S1137D700E94523F79C0823411F484E103C08534F7 26 | S1137D8021F485E00E94E33F6FC0853549F40E94E9 27 | S1137D90593FC82F0E94593FD82FCC0FDD1F62C016 28 | S1137DA0863529F484E00E94E33F80E0E1CF843605 29 | S1137DB009F032C00E94593F0E94593FF82E0E9498 30 | S1137DC0593FA82E00E011E00E94593FF801819329 31 | S1137DD08F01FE12F9CF0E94D83FF5E4AF1201C023 32 | S1137DE0FFCFFE01E7BEE89507B600FCFDCFA0E09B 33 | S1137DF0B1E0FE018D919D910C01D7BEE89511244F 34 | S1137E003296FA12F7CFFE01C7BEE89507B600FC1A 35 | S1137E10FDCFB7BEE89528C0843799F40E94593F36 36 | S1137E200E94593FF82E0E94593F0E94D83F8E016C 37 | S1137E30F80185918F010E94523FFA94F110F8CF16 38 | S1137E4013C0853751F40E94D83F8EE10E94523FFF 39 | S1137E5085E90E94523F86E18BCF813519F488E091 40 | S1137E600E94653F0E94D83F80E10E94523F6ECF3E 41 | S1137E700C94003E29E535EE3A95F1F72A95E1F7A1 42 | S1137E80089529E03EEE40EB4A95F1F73A95E1F783 43 | S1137E902A95D1F7089526E031ED3A95F1F72A9520 44 | S1137EA0E1F708959091C00095FFFCCF8093C60040 45 | S1137EB008958091C00087FFFCCF8091C00084FDAD 46 | S1137EC001C0A8958091C6000895E0E6F0E098E12D 47 | S1137ED0908380830895CF93DF93639966C0619BF9 48 | S1137EE064C0699A719880E00E94653F6B9A7398A8 49 | S1137EF00E94413F0E943A3F699851984899FECFA9 50 | S1137F0081E080930201C8EED3E0489B47C0809192 51 | S1137F100201882309F446C0809100019091010177 52 | S1137F20009731F0019790930101809300013AC0CA 53 | S1137F30D0930101C093000180910001909101014F 54 | S1137F409C01215031093093010120930001892BB8 55 | S1137F5019F00E943A3FF0CF6B980E944B3F699A08 56 | S1137F6071980E94413F519A599A6998D09301019E 57 | S1137F70C093000180910001909101019C01215066 58 | S1137F8031093093010120930001892B19F00E94DB 59 | S1137F904B3FF0CF8CE00E94653F04C0D0930101B9 60 | S1137FA0C09300010E943A3FB0CFDF91CF91089572 61 | S1137FB00E94593F803221F088E00E94653FFFCF44 62 | S1137FC084E10C94523FCF93C82F0E94593FC15073 63 | S1137FD0E1F7CF910C94D83FFC010A0167BFE89503 64 | S1137FE0112407B600FCFDCF667029F0452B19F467 65 | S10F7FF081E187BFE8950895F894FFCF65 66 | S1057FFCE80394 67 | S9037C0080 68 | -------------------------------------------------------------------------------- /bootloaders/CustomOptiboot328pb/Debug/makedep.mk: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # Automatically-generated file. Do not edit or delete the file 3 | ################################################################################ 4 | 5 | main.c 6 | 7 | -------------------------------------------------------------------------------- /bootloaders/CustomOptiboot328pb/pin_defs.h: -------------------------------------------------------------------------------- 1 | #if defined(__AVR_ATmega328PB__) 2 | #define LED_DDR DDRB 3 | #define LED_PORT PORTB 4 | #define LED_PIN PINB 5 | #define LED PINB5 6 | 7 | #define ESP_DDR DDRE 8 | #define ESP_PORT PORTE 9 | #define ESP_PIN PINE 10 | #define ESP_ONOFF PINE1 11 | #define ESP_BOOT_PIN PINE3 12 | 13 | // Ports for soft UART 14 | #ifdef SOFT_UART 15 | # define UART_PORT PORTD 16 | # define UART_PIN PIND 17 | # define UART_DDR DDRD 18 | # define UART_TX_BIT 1 19 | # define UART_RX_BIT 0 20 | #endif 21 | 22 | #endif -------------------------------------------------------------------------------- /bootloaders/CustomOptiboot328pb/stk500.h: -------------------------------------------------------------------------------- 1 | /* STK500 constants list, from AVRDUDE */ 2 | /* STK500 constants list, from AVRDUDE 3 | * 4 | * Trivial set of constants derived from Atmel App Note AVR061 5 | * Not copyrighted. Released to the public domain. 6 | */ 7 | 8 | #define STK_OK 0x10 9 | #define STK_FAILED 0x11 // Not used 10 | #define STK_UNKNOWN 0x12 // Not used 11 | #define STK_NODEVICE 0x13 // Not used 12 | #define STK_INSYNC 0x14 // ' ' 13 | #define STK_NOSYNC 0x15 // Not used 14 | #define ADC_CHANNEL_ERROR 0x16 // Not used 15 | #define ADC_MEASURE_OK 0x17 // Not used 16 | #define PWM_CHANNEL_ERROR 0x18 // Not used 17 | #define PWM_ADJUST_OK 0x19 // Not used 18 | #define CRC_EOP 0x20 // 'SPACE' 19 | #define STK_GET_SYNC 0x30 // '0' 20 | #define STK_GET_SIGN_ON 0x31 // '1' 21 | #define STK_SET_PARAMETER 0x40 // '@' 22 | #define STK_GET_PARAMETER 0x41 // 'A' 23 | #define STK_SET_DEVICE 0x42 // 'B' 24 | #define STK_SET_DEVICE_EXT 0x45 // 'E' 25 | #define STK_ENTER_PROGMODE 0x50 // 'P' 26 | #define STK_LEAVE_PROGMODE 0x51 // 'Q' 27 | #define STK_CHIP_ERASE 0x52 // 'R' 28 | #define STK_CHECK_AUTOINC 0x53 // 'S' 29 | #define STK_LOAD_ADDRESS 0x55 // 'U' 30 | #define STK_UNIVERSAL 0x56 // 'V' 31 | #define STK_PROG_FLASH 0x60 // '`' 32 | #define STK_PROG_DATA 0x61 // 'a' 33 | #define STK_PROG_FUSE 0x62 // 'b' 34 | #define STK_PROG_LOCK 0x63 // 'c' 35 | #define STK_PROG_PAGE 0x64 // 'd' 36 | #define STK_PROG_FUSE_EXT 0x65 // 'e' 37 | #define STK_READ_FLASH 0x70 // 'p' 38 | #define STK_READ_DATA 0x71 // 'q' 39 | #define STK_READ_FUSE 0x72 // 'r' 40 | #define STK_READ_LOCK 0x73 // 's' 41 | #define STK_READ_PAGE 0x74 // 't' 42 | #define STK_READ_SIGN 0x75 // 'u' 43 | #define STK_READ_OSCCAL 0x76 // 'v' 44 | #define STK_READ_FUSE_EXT 0x77 // 'w' 45 | #define STK_READ_OSCCAL_EXT 0x78 // 'x' 46 | #define STK_SW_MAJOR 0x81 // ' ' 47 | #define STK_SW_MINOR 0x82 // ' ' 48 | 49 | /* AVR raw commands sent via STK_UNIVERSAL */ 50 | #define AVR_OP_LOAD_EXT_ADDR 0x4d 51 | 52 | 53 | #define ESP_RST 0xc0 // 'y' 54 | #define ESP_REL 0x7A // 'z' 55 | -------------------------------------------------------------------------------- /bootloaders/eboot/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015 Ivan Grokhotkov 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without modification, 5 | 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 | 2. Redistributions in binary form must reproduce the above copyright notice, 10 | this list of conditions and the following disclaimer in the documentation 11 | and/or other materials provided with the distribution. 12 | 3. The name of the authors may not be used to endorse or promote products 13 | derived from this software without specific prior written permission. 14 | 15 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 16 | WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 17 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 18 | SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 19 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 20 | OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 21 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 22 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 23 | IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 24 | OF SUCH DAMAGE. 25 | 26 | Authors: Ivan Grokhotkov 27 | -------------------------------------------------------------------------------- /bootloaders/eboot/Makefile: -------------------------------------------------------------------------------- 1 | XTENSA_TOOLCHAIN ?= ../../tools/xtensa-lx106-elf/bin/ 2 | ESPTOOL ?= ../../tools/esptool/esptool 3 | 4 | BIN_DIR := ./ 5 | TARGET_DIR := ./ 6 | 7 | TARGET_OBJ_FILES := \ 8 | eboot.o \ 9 | eboot_command.o \ 10 | 11 | 12 | TARGET_OBJ_PATHS := $(addprefix $(TARGET_DIR)/,$(TARGET_OBJ_FILES)) 13 | 14 | CC := $(XTENSA_TOOLCHAIN)xtensa-lx106-elf-gcc 15 | CXX := $(XTENSA_TOOLCHAIN)xtensa-lx106-elf-g++ 16 | AR := $(XTENSA_TOOLCHAIN)xtensa-lx106-elf-ar 17 | LD := $(XTENSA_TOOLCHAIN)xtensa-lx106-elf-gcc 18 | OBJDUMP := $(XTENSA_TOOLCHAIN)xtensa-lx106-elf-objdump 19 | 20 | INC += -I../../tools/sdk/include 21 | CFLAGS += -std=gnu99 22 | 23 | CFLAGS += -O0 -g -Wpointer-arith -Wno-implicit-function-declaration -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mno-text-section-literals 24 | 25 | CFLAGS += $(INC) 26 | 27 | LDFLAGS += -nostdlib -Wl,--no-check-sections -umain 28 | 29 | LD_SCRIPT := -Teboot.ld 30 | 31 | APP_OUT:= eboot.elf 32 | APP_AR := eboot.a 33 | APP_FW := eboot.bin 34 | 35 | all: $(APP_FW) 36 | 37 | $(APP_AR): $(TARGET_OBJ_PATHS) 38 | $(AR) cru $@ $^ 39 | 40 | 41 | $(APP_OUT): $(APP_AR) 42 | $(LD) $(LD_SCRIPT) $(LDFLAGS) -Wl,--start-group -Wl,--whole-archive $(APP_AR) -Wl,--end-group -o $@ 43 | 44 | $(APP_FW): $(APP_OUT) 45 | $(ESPTOOL) -vvv -eo $(APP_OUT) -bo $@ -bs .text -bs .data -bs .rodata -bc -ec || true 46 | 47 | 48 | clean: 49 | rm -f *.o 50 | rm -f $(APP_AR) 51 | rm -f $(APP_OUT) 52 | 53 | 54 | .PHONY: all clean default 55 | -------------------------------------------------------------------------------- /bootloaders/eboot/eboot.elf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tech-jollydev/jolly-arduino-platform/42cf5362700ce58b6dfc64523f0b5a86193117e2/bootloaders/eboot/eboot.elf -------------------------------------------------------------------------------- /bootloaders/eboot/eboot_command.c: -------------------------------------------------------------------------------- 1 | #include "eboot_command.h" 2 | 3 | uint32_t crc_update(uint32_t crc, const uint8_t *data, size_t length) 4 | { 5 | uint32_t i; 6 | bool bit; 7 | uint8_t c; 8 | 9 | while (length--) { 10 | c = *data++; 11 | for (i = 0x80; i > 0; i >>= 1) { 12 | bit = crc & 0x80000000; 13 | if (c & i) { 14 | bit = !bit; 15 | } 16 | crc <<= 1; 17 | if (bit) { 18 | crc ^= 0x04c11db7; 19 | } 20 | } 21 | } 22 | return crc; 23 | } 24 | 25 | uint32_t eboot_command_calculate_crc32(const struct eboot_command* cmd) 26 | { 27 | return crc_update(0xffffffff, (const uint8_t*) cmd, 28 | offsetof(struct eboot_command, crc32)); 29 | } 30 | 31 | int eboot_command_read(struct eboot_command* cmd) 32 | { 33 | const uint32_t dw_count = sizeof(struct eboot_command) / sizeof(uint32_t); 34 | uint32_t* dst = (uint32_t *) cmd; 35 | for (uint32_t i = 0; i < dw_count; ++i) { 36 | dst[i] = RTC_MEM[i]; 37 | } 38 | 39 | uint32_t crc32 = eboot_command_calculate_crc32(cmd); 40 | if (cmd->magic & EBOOT_MAGIC_MASK != EBOOT_MAGIC || 41 | cmd->crc32 != crc32) { 42 | return 1; 43 | } 44 | 45 | return 0; 46 | } 47 | 48 | void eboot_command_write(struct eboot_command* cmd) 49 | { 50 | cmd->magic = EBOOT_MAGIC; 51 | cmd->crc32 = eboot_command_calculate_crc32(cmd); 52 | 53 | const uint32_t dw_count = sizeof(struct eboot_command) / sizeof(uint32_t); 54 | const uint32_t* src = (const uint32_t *) cmd; 55 | for (uint32_t i = 0; i < dw_count; ++i) { 56 | RTC_MEM[i] = src[i]; 57 | } 58 | } 59 | 60 | void eboot_command_clear() 61 | { 62 | RTC_MEM[offsetof(struct eboot_command, magic) / sizeof(uint32_t)] = 0; 63 | RTC_MEM[offsetof(struct eboot_command, crc32) / sizeof(uint32_t)] = 0; 64 | } 65 | 66 | -------------------------------------------------------------------------------- /bootloaders/eboot/eboot_command.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2015 Ivan Grokhotkov. All rights reserved. 2 | * This file is part of eboot bootloader. 3 | * 4 | * Redistribution and use is permitted according to the conditions of the 5 | * 3-clause BSD license to be found in the LICENSE file. 6 | */ 7 | 8 | #ifndef EBOOT_COMMAND_H 9 | #define EBOOT_COMMAND_H 10 | 11 | #include 12 | #include 13 | #include 14 | 15 | #define RTC_MEM ((volatile uint32_t*)0x60001200) 16 | 17 | enum action_t { 18 | ACTION_COPY_RAW = 0x00000001, 19 | ACTION_LOAD_APP = 0xffffffff 20 | }; 21 | 22 | #define EBOOT_MAGIC 0xeb001000 23 | #define EBOOT_MAGIC_MASK 0xfffff000 24 | 25 | struct eboot_command { 26 | uint32_t magic; 27 | enum action_t action; 28 | uint32_t args[29]; 29 | uint32_t crc32; 30 | }; 31 | 32 | 33 | int eboot_command_read(struct eboot_command* cmd); 34 | void eboot_command_write(struct eboot_command* cmd); 35 | void eboot_command_clear(); 36 | 37 | #endif //EBOOT_COMMAND_H 38 | -------------------------------------------------------------------------------- /bootloaders/eboot/flash.c: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2015 Ivan Grokhotkov. All rights reserved. 2 | * This file is part of eboot bootloader. 3 | * 4 | * Redistribution and use is permitted according to the conditions of the 5 | * 3-clause BSD license to be found in the LICENSE file. 6 | */ 7 | 8 | #include 9 | #include 10 | #include 11 | #include "flash.h" 12 | 13 | 14 | int SPIEraseAreaEx(const uint32_t start, const uint32_t size) 15 | { 16 | if (start & (FLASH_SECTOR_SIZE - 1) != 0) { 17 | return 1; 18 | } 19 | 20 | const uint32_t sectors_per_block = FLASH_BLOCK_SIZE / FLASH_SECTOR_SIZE; 21 | uint32_t current_sector = start / FLASH_SECTOR_SIZE; 22 | uint32_t sector_count = (size + FLASH_SECTOR_SIZE - 1) / FLASH_SECTOR_SIZE; 23 | const uint32_t end = current_sector + sector_count; 24 | 25 | for (; current_sector < end && (current_sector & (sectors_per_block-1)); 26 | ++current_sector, --sector_count) { 27 | if (SPIEraseSector(current_sector)) { 28 | return 2; 29 | } 30 | } 31 | 32 | for (;current_sector + sectors_per_block <= end; 33 | current_sector += sectors_per_block, 34 | sector_count -= sectors_per_block) { 35 | if (SPIEraseBlock(current_sector / sectors_per_block)) { 36 | return 3; 37 | } 38 | } 39 | 40 | for (; current_sector < end; 41 | ++current_sector, --sector_count) { 42 | if (SPIEraseSector(current_sector)) { 43 | return 4; 44 | } 45 | } 46 | 47 | return 0; 48 | } 49 | 50 | -------------------------------------------------------------------------------- /bootloaders/eboot/flash.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2015 Ivan Grokhotkov. All rights reserved. 2 | * This file is part of eboot bootloader. 3 | * 4 | * Redistribution and use is permitted according to the conditions of the 5 | * 3-clause BSD license to be found in the LICENSE file. 6 | */ 7 | 8 | #ifndef FLASH_H 9 | #define FLASH_H 10 | 11 | 12 | /* The geometry defines are placed in the sdk. The .h was factored out for reuse by eboot here. 13 | * Beware: this means that eboot has an external dependency. 14 | * The following .h is placed in tools/sdk/includes 15 | */ 16 | #include 17 | 18 | int SPIEraseBlock(uint32_t block); 19 | int SPIEraseSector(uint32_t sector); 20 | int SPIRead(uint32_t addr, void *dest, size_t size); 21 | int SPIWrite(uint32_t addr, void *src, size_t size); 22 | int SPIEraseAreaEx(const uint32_t start, const uint32_t size); 23 | 24 | 25 | typedef struct { 26 | unsigned char magic; 27 | unsigned char num_segments; 28 | 29 | /* SPI Flash Interface (0 = QIO, 1 = QOUT, 2 = DIO, 0x3 = DOUT) */ 30 | unsigned char flash_mode; 31 | 32 | /* High four bits: 0 = 512K, 1 = 256K, 2 = 1M, 3 = 2M, 4 = 4M, 8 = 8M, 9 = 16M 33 | Low four bits: 0 = 40MHz, 1= 26MHz, 2 = 20MHz, 0xf = 80MHz */ 34 | unsigned char flash_size_freq; 35 | 36 | uint32_t entry; 37 | } image_header_t; 38 | 39 | 40 | typedef struct { 41 | uint32_t address; 42 | uint32_t size; 43 | } section_header_t; 44 | 45 | 46 | 47 | #endif //FLASH_H 48 | -------------------------------------------------------------------------------- /cores/atmega328pb/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 | -------------------------------------------------------------------------------- /cores/atmega328pb/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 | -------------------------------------------------------------------------------- /cores/atmega328pb/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 | -------------------------------------------------------------------------------- /cores/atmega328pb/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 | -------------------------------------------------------------------------------- /cores/atmega328pb/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 | -------------------------------------------------------------------------------- /cores/atmega328pb/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 | -------------------------------------------------------------------------------- /cores/atmega328pb/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 | -------------------------------------------------------------------------------- /cores/atmega328pb/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 | -------------------------------------------------------------------------------- /cores/atmega328pb/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 | -------------------------------------------------------------------------------- /cores/atmega328pb/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 -------------------------------------------------------------------------------- /cores/atmega328pb/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 | -------------------------------------------------------------------------------- /cores/atmega328pb/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 | -------------------------------------------------------------------------------- /cores/atmega328pb/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 | -------------------------------------------------------------------------------- /cores/atmega328pb/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 | #ifdef JOLLY 26 | bool execFlag = true; 27 | #endif 28 | 29 | // Weak empty variant initialization function. 30 | // May be redefined by variant files. 31 | void initVariant() __attribute__((weak)); 32 | void initVariant() { 33 | #ifdef JOLLY 34 | pinMode(PIN_ESP_ON_OFF, INPUT); 35 | #endif 36 | } 37 | 38 | void setupUSB() __attribute__((weak)); 39 | void setupUSB() { } 40 | 41 | int main(void) 42 | { 43 | init(); 44 | initVariant(); 45 | 46 | #if defined(USBCON) 47 | USBDevice.attach(); 48 | #endif 49 | 50 | setup(); 51 | 52 | for (;;) { 53 | loop(); 54 | if (serialEventRun) serialEventRun(); 55 | } 56 | 57 | return 0; 58 | } 59 | 60 | -------------------------------------------------------------------------------- /cores/atmega328pb/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 | -------------------------------------------------------------------------------- /cores/atmega328pb/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 | -------------------------------------------------------------------------------- /cores/atmega328pb/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 | -------------------------------------------------------------------------------- /cores/atmega328pb/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 | -------------------------------------------------------------------------------- /extras/crtatmega328pb.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tech-jollydev/jolly-arduino-platform/42cf5362700ce58b6dfc64523f0b5a86193117e2/extras/crtatmega328pb.o -------------------------------------------------------------------------------- /extras/libatmega328pb.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tech-jollydev/jolly-arduino-platform/42cf5362700ce58b6dfc64523f0b5a86193117e2/extras/libatmega328pb.a -------------------------------------------------------------------------------- /firmwares/arduinoISP/readme.txt: -------------------------------------------------------------------------------- 1 | 2 | You can download the ArduinoISP firmware source files from: 3 | 4 | https://github.com/arduino/ArduinoISP 5 | 6 | -------------------------------------------------------------------------------- /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. -------------------------------------------------------------------------------- /firmwares/atmegaxxu2/arduino-usbdfu/makefile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tech-jollydev/jolly-arduino-platform/42cf5362700ce58b6dfc64523f0b5a86193117e2/firmwares/atmegaxxu2/arduino-usbdfu/makefile -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /firmwares/atmegaxxu2/arduino-usbserial/makefile: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tech-jollydev/jolly-arduino-platform/42cf5362700ce58b6dfc64523f0b5a86193117e2/firmwares/atmegaxxu2/arduino-usbserial/makefile -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /firmwares/jolly_esp/WiFiManager.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tech-jollydev/jolly-arduino-platform/42cf5362700ce58b6dfc64523f0b5a86193117e2/firmwares/jolly_esp/WiFiManager.bin -------------------------------------------------------------------------------- /firmwares/jolly_esp/WiFiManager_spiffs.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tech-jollydev/jolly-arduino-platform/42cf5362700ce58b6dfc64523f0b5a86193117e2/firmwares/jolly_esp/WiFiManager_spiffs.bin -------------------------------------------------------------------------------- /firmwares/wifishield/binary/wifiHD.elf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tech-jollydev/jolly-arduino-platform/42cf5362700ce58b6dfc64523f0b5a86193117e2/firmwares/wifishield/binary/wifiHD.elf -------------------------------------------------------------------------------- /firmwares/wifishield/binary/wifiHD_2_1.elf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tech-jollydev/jolly-arduino-platform/42cf5362700ce58b6dfc64523f0b5a86193117e2/firmwares/wifishield/binary/wifiHD_2_1.elf -------------------------------------------------------------------------------- /firmwares/wifishield/binary/wifi_dnld.elf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tech-jollydev/jolly-arduino-platform/42cf5362700ce58b6dfc64523f0b5a86193117e2/firmwares/wifishield/binary/wifi_dnld.elf -------------------------------------------------------------------------------- /firmwares/wifishield/binary/wifi_dnld_2_1.elf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tech-jollydev/jolly-arduino-platform/42cf5362700ce58b6dfc64523f0b5a86193117e2/firmwares/wifishield/binary/wifi_dnld_2_1.elf -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /firmwares/wifishield/wifiHD/Release/wifiHD.elf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tech-jollydev/jolly-arduino-platform/42cf5362700ce58b6dfc64523f0b5a86193117e2/firmwares/wifishield/wifiHD/Release/wifiHD.elf -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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/tech-jollydev/jolly-arduino-platform/42cf5362700ce58b6dfc64523f0b5a86193117e2/firmwares/wifishield/wifiHD/src/SOFTWARE_FRAMEWORK/COMPONENTS/WIFI/HD/v2.7.0/UCR1/GCC/lib_ucr1_hd_sdio_v2.7.0.a -------------------------------------------------------------------------------- /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/tech-jollydev/jolly-arduino-platform/42cf5362700ce58b6dfc64523f0b5a86193117e2/firmwares/wifishield/wifiHD/src/SOFTWARE_FRAMEWORK/COMPONENTS/WIFI/HD/v2.7.0/UCR1/GCC/lib_ucr1_hd_spi_v2.7.0.a -------------------------------------------------------------------------------- /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/tech-jollydev/jolly-arduino-platform/42cf5362700ce58b6dfc64523f0b5a86193117e2/firmwares/wifishield/wifiHD/src/SOFTWARE_FRAMEWORK/COMPONENTS/WIFI/HD/v2.7.0/UCR1/GCC/lib_ucr1_hd_wl_sta_intwpa_v2.7.0.a -------------------------------------------------------------------------------- /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/tech-jollydev/jolly-arduino-platform/42cf5362700ce58b6dfc64523f0b5a86193117e2/firmwares/wifishield/wifiHD/src/SOFTWARE_FRAMEWORK/COMPONENTS/WIFI/HD/v2.7.0/UCR2/GCC/lib_ucr2_hd_sdio_v2.7.0.a -------------------------------------------------------------------------------- /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/tech-jollydev/jolly-arduino-platform/42cf5362700ce58b6dfc64523f0b5a86193117e2/firmwares/wifishield/wifiHD/src/SOFTWARE_FRAMEWORK/COMPONENTS/WIFI/HD/v2.7.0/UCR2/GCC/lib_ucr2_hd_spi_v2.7.0.a -------------------------------------------------------------------------------- /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/tech-jollydev/jolly-arduino-platform/42cf5362700ce58b6dfc64523f0b5a86193117e2/firmwares/wifishield/wifiHD/src/SOFTWARE_FRAMEWORK/COMPONENTS/WIFI/HD/v2.7.0/UCR2/GCC/lib_ucr2_hd_wl_sta_intwpa_v2.7.0.a -------------------------------------------------------------------------------- /firmwares/wifishield/wifiHD/src/SOFTWARE_FRAMEWORK/COMPONENTS/WIFI/HD/v2.7.0/revision.txt: -------------------------------------------------------------------------------- 1 | Revision: 2491 2 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /firmwares/wifishield/wifiHD/src/SOFTWARE_FRAMEWORK/UTILS/LIBS/NEWLIB_ADDONS/libnewlib_addons-at32ucr2-speed_opt.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tech-jollydev/jolly-arduino-platform/42cf5362700ce58b6dfc64523f0b5a86193117e2/firmwares/wifishield/wifiHD/src/SOFTWARE_FRAMEWORK/UTILS/LIBS/NEWLIB_ADDONS/libnewlib_addons-at32ucr2-speed_opt.a -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /firmwares/wifishield/wifi_dnld/Release/wifi_dnld.elf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tech-jollydev/jolly-arduino-platform/42cf5362700ce58b6dfc64523f0b5a86193117e2/firmwares/wifishield/wifi_dnld/Release/wifi_dnld.elf -------------------------------------------------------------------------------- /firmwares/wifishield/wifi_dnld/src/Doc/SPB104 product brief.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tech-jollydev/jolly-arduino-platform/42cf5362700ce58b6dfc64523f0b5a86193117e2/firmwares/wifishield/wifi_dnld/src/Doc/SPB104 product brief.pdf -------------------------------------------------------------------------------- /firmwares/wifishield/wifi_dnld/src/Doc/gettingstarted.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tech-jollydev/jolly-arduino-platform/42cf5362700ce58b6dfc64523f0b5a86193117e2/firmwares/wifishield/wifi_dnld/src/Doc/gettingstarted.pdf -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /firmwares/wifishield/wifi_dnld/src/SOFTWARE_FRAMEWORK/UTILS/LIBS/NEWLIB_ADDONS/libnewlib_addons-at32ucr2-speed_opt.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tech-jollydev/jolly-arduino-platform/42cf5362700ce58b6dfc64523f0b5a86193117e2/firmwares/wifishield/wifi_dnld/src/SOFTWARE_FRAMEWORK/UTILS/LIBS/NEWLIB_ADDONS/libnewlib_addons-at32ucr2-speed_opt.a -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /libraries/EEPROM/examples/eeprom_clear/eeprom_clear.ino: -------------------------------------------------------------------------------- 1 | /* 2 | * EEPROM Clear 3 | * 4 | * Sets all of the bytes of the EEPROM to 0. 5 | * Please see eeprom_iteration for a more in depth 6 | * look at how to traverse the EEPROM. 7 | * 8 | * This example code is in the public domain. 9 | */ 10 | 11 | #include 12 | 13 | void setup() { 14 | // initialize the LED pin as an output. 15 | pinMode(13, OUTPUT); 16 | 17 | /*** 18 | Iterate through each byte of the EEPROM storage. 19 | 20 | Larger AVR processors have larger EEPROM sizes, E.g: 21 | - Arduno Duemilanove: 512b EEPROM storage. 22 | - Arduino Uno: 1kb EEPROM storage. 23 | - Arduino Mega: 4kb EEPROM storage. 24 | 25 | Rather than hard-coding the length, you should use the pre-provided length function. 26 | This will make your code portable to all AVR processors. 27 | ***/ 28 | 29 | for (int i = 0 ; i < EEPROM.length() ; i++) { 30 | EEPROM.write(i, 0); 31 | } 32 | 33 | // turn the LED on when we're done 34 | digitalWrite(13, HIGH); 35 | } 36 | 37 | void loop() { 38 | /** Empty loop. **/ 39 | } 40 | -------------------------------------------------------------------------------- /libraries/EEPROM/examples/eeprom_crc/eeprom_crc.ino: -------------------------------------------------------------------------------- 1 | /*** 2 | Written by Christopher Andrews. 3 | CRC algorithm generated by pycrc, MIT licence ( https://github.com/tpircher/pycrc ). 4 | 5 | A CRC is a simple way of checking whether data has changed or become corrupted. 6 | This example calculates a CRC value directly on the EEPROM values. 7 | The purpose of this example is to highlight how the EEPROM object can be used just like an array. 8 | ***/ 9 | 10 | #include 11 | #include 12 | 13 | void setup() { 14 | 15 | //Start serial 16 | Serial.begin(9600); 17 | while (!Serial) { 18 | ; // wait for serial port to connect. Needed for native USB port only 19 | } 20 | 21 | //Print length of data to run CRC on. 22 | Serial.print("EEPROM length: "); 23 | Serial.println(EEPROM.length()); 24 | 25 | //Print the result of calling eeprom_crc() 26 | Serial.print("CRC32 of EEPROM data: 0x"); 27 | Serial.println(eeprom_crc(), HEX); 28 | Serial.print("\n\nDone!"); 29 | } 30 | 31 | void loop() { 32 | /* Empty loop */ 33 | } 34 | 35 | unsigned long eeprom_crc(void) { 36 | 37 | const unsigned long crc_table[16] = { 38 | 0x00000000, 0x1db71064, 0x3b6e20c8, 0x26d930ac, 39 | 0x76dc4190, 0x6b6b51f4, 0x4db26158, 0x5005713c, 40 | 0xedb88320, 0xf00f9344, 0xd6d6a3e8, 0xcb61b38c, 41 | 0x9b64c2b0, 0x86d3d2d4, 0xa00ae278, 0xbdbdf21c 42 | }; 43 | 44 | unsigned long crc = ~0L; 45 | 46 | for (int index = 0 ; index < EEPROM.length() ; ++index) { 47 | crc = crc_table[(crc ^ EEPROM[index]) & 0x0f] ^ (crc >> 4); 48 | crc = crc_table[(crc ^ (EEPROM[index] >> 4)) & 0x0f] ^ (crc >> 4); 49 | crc = ~crc; 50 | } 51 | return crc; 52 | } 53 | -------------------------------------------------------------------------------- /libraries/EEPROM/examples/eeprom_get/eeprom_get.ino: -------------------------------------------------------------------------------- 1 | /*** 2 | eeprom_get example. 3 | 4 | This shows how to use the EEPROM.get() method. 5 | 6 | To pre-set the EEPROM data, run the example sketch eeprom_put. 7 | This sketch will run without it, however, the values shown 8 | will be shown from what ever is already on the EEPROM. 9 | 10 | This may cause the serial object to print out a large string 11 | of garbage if there is no null character inside one of the strings 12 | loaded. 13 | 14 | Written by Christopher Andrews 2015 15 | Released under MIT licence. 16 | ***/ 17 | 18 | #include 19 | 20 | void setup() { 21 | 22 | float f = 0.00f; //Variable to store data read from EEPROM. 23 | int eeAddress = 0; //EEPROM address to start reading from 24 | 25 | Serial.begin(9600); 26 | while (!Serial) { 27 | ; // wait for serial port to connect. Needed for native USB port only 28 | } 29 | Serial.print("Read float from EEPROM: "); 30 | 31 | //Get the float data from the EEPROM at position 'eeAddress' 32 | EEPROM.get(eeAddress, f); 33 | Serial.println(f, 3); //This may print 'ovf, nan' if the data inside the EEPROM is not a valid float. 34 | 35 | /*** 36 | As get also returns a reference to 'f', you can use it inline. 37 | E.g: Serial.print( EEPROM.get( eeAddress, f ) ); 38 | ***/ 39 | 40 | /*** 41 | Get can be used with custom structures too. 42 | I have separated this into an extra function. 43 | ***/ 44 | 45 | secondTest(); //Run the next test. 46 | } 47 | 48 | struct MyObject { 49 | float field1; 50 | byte field2; 51 | char name[10]; 52 | }; 53 | 54 | void secondTest() { 55 | int eeAddress = sizeof(float); //Move address to the next byte after float 'f'. 56 | 57 | MyObject customVar; //Variable to store custom object read from EEPROM. 58 | EEPROM.get(eeAddress, customVar); 59 | 60 | Serial.println("Read custom object from EEPROM: "); 61 | Serial.println(customVar.field1); 62 | Serial.println(customVar.field2); 63 | Serial.println(customVar.name); 64 | } 65 | 66 | void loop() { 67 | /* Empty loop */ 68 | } 69 | -------------------------------------------------------------------------------- /libraries/EEPROM/examples/eeprom_iteration/eeprom_iteration.ino: -------------------------------------------------------------------------------- 1 | /*** 2 | eeprom_iteration example. 3 | 4 | A set of example snippets highlighting the 5 | simplest methods for traversing the EEPROM. 6 | 7 | Running this sketch is not necessary, this is 8 | simply highlighting certain programming methods. 9 | 10 | Written by Christopher Andrews 2015 11 | Released under MIT licence. 12 | ***/ 13 | 14 | #include 15 | 16 | void setup() { 17 | 18 | /*** 19 | Iterate the EEPROM using a for loop. 20 | ***/ 21 | 22 | for (int index = 0 ; index < EEPROM.length() ; index++) { 23 | 24 | //Add one to each cell in the EEPROM 25 | EEPROM[ index ] += 1; 26 | } 27 | 28 | /*** 29 | Iterate the EEPROM using a while loop. 30 | ***/ 31 | 32 | int index = 0; 33 | 34 | while (index < EEPROM.length()) { 35 | 36 | //Add one to each cell in the EEPROM 37 | EEPROM[ index ] += 1; 38 | index++; 39 | } 40 | 41 | /*** 42 | Iterate the EEPROM using a do-while loop. 43 | ***/ 44 | 45 | int idx = 0; //Used 'idx' to avoid name conflict with 'index' above. 46 | 47 | do { 48 | 49 | //Add one to each cell in the EEPROM 50 | EEPROM[ idx ] += 1; 51 | idx++; 52 | } while (idx < EEPROM.length()); 53 | 54 | 55 | } //End of setup function. 56 | 57 | void loop() {} -------------------------------------------------------------------------------- /libraries/EEPROM/examples/eeprom_put/eeprom_put.ino: -------------------------------------------------------------------------------- 1 | /*** 2 | eeprom_put example. 3 | 4 | This shows how to use the EEPROM.put() method. 5 | Also, this sketch will pre-set the EEPROM data for the 6 | example sketch eeprom_get. 7 | 8 | Note, unlike the single byte version EEPROM.write(), 9 | the put method will use update semantics. As in a byte 10 | will only be written to the EEPROM if the data is actually 11 | different. 12 | 13 | Written by Christopher Andrews 2015 14 | Released under MIT licence. 15 | ***/ 16 | 17 | #include 18 | 19 | struct MyObject { 20 | float field1; 21 | byte field2; 22 | char name[10]; 23 | }; 24 | 25 | void setup() { 26 | 27 | Serial.begin(9600); 28 | while (!Serial) { 29 | ; // wait for serial port to connect. Needed for native USB port only 30 | } 31 | 32 | float f = 123.456f; //Variable to store in EEPROM. 33 | int eeAddress = 0; //Location we want the data to be put. 34 | 35 | 36 | //One simple call, with the address first and the object second. 37 | EEPROM.put(eeAddress, f); 38 | 39 | Serial.println("Written float data type!"); 40 | 41 | /** Put is designed for use with custom structures also. **/ 42 | 43 | //Data to store. 44 | MyObject customVar = { 45 | 3.14f, 46 | 65, 47 | "Working!" 48 | }; 49 | 50 | eeAddress += sizeof(float); //Move address to the next byte after float 'f'. 51 | 52 | EEPROM.put(eeAddress, customVar); 53 | Serial.print("Written custom data type! \n\nView the example sketch eeprom_get to see how you can retrieve the values!"); 54 | } 55 | 56 | void loop() { 57 | /* Empty loop */ 58 | } 59 | -------------------------------------------------------------------------------- /libraries/EEPROM/examples/eeprom_read/eeprom_read.ino: -------------------------------------------------------------------------------- 1 | /* 2 | * EEPROM Read 3 | * 4 | * Reads the value of each byte of the EEPROM and prints it 5 | * to the computer. 6 | * This example code is in the public domain. 7 | */ 8 | 9 | #include 10 | 11 | // start reading from the first byte (address 0) of the EEPROM 12 | int address = 0; 13 | byte value; 14 | 15 | void setup() { 16 | // initialize serial and wait for port to open: 17 | Serial.begin(9600); 18 | while (!Serial) { 19 | ; // wait for serial port to connect. Needed for native USB port only 20 | } 21 | } 22 | 23 | void loop() { 24 | // read a byte from the current address of the EEPROM 25 | value = EEPROM.read(address); 26 | 27 | Serial.print(address); 28 | Serial.print("\t"); 29 | Serial.print(value, DEC); 30 | Serial.println(); 31 | 32 | /*** 33 | Advance to the next address, when at the end restart at the beginning. 34 | 35 | Larger AVR processors have larger EEPROM sizes, E.g: 36 | - Arduno Duemilanove: 512b EEPROM storage. 37 | - Arduino Uno: 1kb EEPROM storage. 38 | - Arduino Mega: 4kb EEPROM storage. 39 | 40 | Rather than hard-coding the length, you should use the pre-provided length function. 41 | This will make your code portable to all AVR processors. 42 | ***/ 43 | address = address + 1; 44 | if (address == EEPROM.length()) { 45 | address = 0; 46 | } 47 | 48 | /*** 49 | As the EEPROM sizes are powers of two, wrapping (preventing overflow) of an 50 | EEPROM address is also doable by a bitwise and of the length - 1. 51 | 52 | ++address &= EEPROM.length() - 1; 53 | ***/ 54 | 55 | delay(500); 56 | } 57 | -------------------------------------------------------------------------------- /libraries/EEPROM/examples/eeprom_update/eeprom_update.ino: -------------------------------------------------------------------------------- 1 | /*** 2 | EEPROM Update method 3 | 4 | Stores values read from analog input 0 into the EEPROM. 5 | These values will stay in the EEPROM when the board is 6 | turned off and may be retrieved later by another sketch. 7 | 8 | If a value has not changed in the EEPROM, it is not overwritten 9 | which would reduce the life span of the EEPROM unnecessarily. 10 | 11 | Released using MIT licence. 12 | ***/ 13 | 14 | #include 15 | 16 | /** the current address in the EEPROM (i.e. which byte we're going to write to next) **/ 17 | int address = 0; 18 | 19 | void setup() { 20 | /** EMpty setup **/ 21 | } 22 | 23 | void loop() { 24 | /*** 25 | need to divide by 4 because analog inputs range from 26 | 0 to 1023 and each byte of the EEPROM can only hold a 27 | value from 0 to 255. 28 | ***/ 29 | int val = analogRead(0) / 4; 30 | 31 | /*** 32 | Update the particular EEPROM cell. 33 | these values will remain there when the board is 34 | turned off. 35 | ***/ 36 | EEPROM.update(address, val); 37 | 38 | /*** 39 | The function EEPROM.update(address, val) is equivalent to the following: 40 | 41 | if( EEPROM.read(address) != val ){ 42 | EEPROM.write(address, val); 43 | } 44 | ***/ 45 | 46 | 47 | /*** 48 | Advance to the next address, when at the end restart at the beginning. 49 | 50 | Larger AVR processors have larger EEPROM sizes, E.g: 51 | - Arduno Duemilanove: 512b EEPROM storage. 52 | - Arduino Uno: 1kb EEPROM storage. 53 | - Arduino Mega: 4kb EEPROM storage. 54 | 55 | Rather than hard-coding the length, you should use the pre-provided length function. 56 | This will make your code portable to all AVR processors. 57 | ***/ 58 | address = address + 1; 59 | if (address == EEPROM.length()) { 60 | address = 0; 61 | } 62 | 63 | /*** 64 | As the EEPROM sizes are powers of two, wrapping (preventing overflow) of an 65 | EEPROM address is also doable by a bitwise and of the length - 1. 66 | 67 | ++address &= EEPROM.length() - 1; 68 | ***/ 69 | 70 | delay(100); 71 | } 72 | -------------------------------------------------------------------------------- /libraries/EEPROM/examples/eeprom_write/eeprom_write.ino: -------------------------------------------------------------------------------- 1 | /* 2 | * EEPROM Write 3 | * 4 | * Stores values read from analog input 0 into the EEPROM. 5 | * These values will stay in the EEPROM when the board is 6 | * turned off and may be retrieved later by another sketch. 7 | */ 8 | 9 | #include 10 | 11 | /** the current address in the EEPROM (i.e. which byte we're going to write to next) **/ 12 | int addr = 0; 13 | 14 | void setup() { 15 | /** Empty setup. **/ 16 | } 17 | 18 | void loop() { 19 | /*** 20 | Need to divide by 4 because analog inputs range from 21 | 0 to 1023 and each byte of the EEPROM can only hold a 22 | value from 0 to 255. 23 | ***/ 24 | 25 | int val = analogRead(0) / 4; 26 | 27 | /*** 28 | Write the value to the appropriate byte of the EEPROM. 29 | these values will remain there when the board is 30 | turned off. 31 | ***/ 32 | 33 | EEPROM.write(addr, val); 34 | 35 | /*** 36 | Advance to the next address, when at the end restart at the beginning. 37 | 38 | Larger AVR processors have larger EEPROM sizes, E.g: 39 | - Arduno Duemilanove: 512b EEPROM storage. 40 | - Arduino Uno: 1kb EEPROM storage. 41 | - Arduino Mega: 4kb EEPROM storage. 42 | 43 | Rather than hard-coding the length, you should use the pre-provided length function. 44 | This will make your code portable to all AVR processors. 45 | ***/ 46 | addr = addr + 1; 47 | if (addr == EEPROM.length()) { 48 | addr = 0; 49 | } 50 | 51 | /*** 52 | As the EEPROM sizes are powers of two, wrapping (preventing overflow) of an 53 | EEPROM address is also doable by a bitwise and of the length - 1. 54 | 55 | ++addr &= EEPROM.length() - 1; 56 | ***/ 57 | 58 | 59 | delay(100); 60 | } 61 | -------------------------------------------------------------------------------- /libraries/EEPROM/keywords.txt: -------------------------------------------------------------------------------- 1 | ####################################### 2 | # Syntax Coloring Map For EEPROM 3 | ####################################### 4 | 5 | ####################################### 6 | # Datatypes (KEYWORD1) 7 | ####################################### 8 | 9 | EEPROM KEYWORD1 10 | EERef KEYWORD1 11 | EEPtr KEYWORD2 12 | 13 | ####################################### 14 | # Methods and Functions (KEYWORD2) 15 | ####################################### 16 | 17 | update KEYWORD2 18 | 19 | ####################################### 20 | # Constants (LITERAL1) 21 | ####################################### 22 | 23 | -------------------------------------------------------------------------------- /libraries/EEPROM/library.properties: -------------------------------------------------------------------------------- 1 | name=EEPROM 2 | version=2.0 3 | author=Arduino, Christopher Andrews 4 | maintainer=Arduino 5 | sentence=Enables reading and writing to the permanent board storage. 6 | paragraph=This library allows to read and write data in a memory type, the EEPROM, that keeps its content also when the board is powered off. The amount of EEPROM available depends on the microcontroller type. 7 | category=Data Storage 8 | url=http://www.arduino.cc/en/Reference/EEPROM 9 | architectures=avr 10 | 11 | -------------------------------------------------------------------------------- /libraries/HID/keywords.txt: -------------------------------------------------------------------------------- 1 | ####################################### 2 | # Syntax Coloring Map HID 3 | ####################################### 4 | 5 | ####################################### 6 | # Datatypes (KEYWORD1) 7 | ####################################### 8 | 9 | HID KEYWORD1 10 | 11 | ####################################### 12 | # Methods and Functions (KEYWORD2) 13 | ####################################### 14 | begin KEYWORD2 15 | SendReport KEYWORD2 16 | AppendDescriptor KEYWORD2 17 | 18 | ####################################### 19 | # Constants (LITERAL1) 20 | ####################################### 21 | HID_TX LITERAL1 -------------------------------------------------------------------------------- /libraries/HID/library.properties: -------------------------------------------------------------------------------- 1 | name=HID 2 | version=1.0 3 | author=Arduino 4 | maintainer=Arduino 5 | sentence=Module for PluggableUSB infrastructure. Exposes an API for devices like Keyboards, Mice and Gamepads. 6 | paragraph= 7 | category=Communication 8 | url=http://www.arduino.cc/en/Reference/HID 9 | architectures=avr 10 | -------------------------------------------------------------------------------- /libraries/SPI/examples/DigitalPotControl/DigitalPotControl.ino: -------------------------------------------------------------------------------- 1 | /* 2 | Digital Pot Control 3 | 4 | This example controls an Analog Devices AD5206 digital potentiometer. 5 | The AD5206 has 6 potentiometer channels. Each channel's pins are labeled 6 | A - connect this to voltage 7 | W - this is the pot's wiper, which changes when you set it 8 | B - connect this to ground. 9 | 10 | The AD5206 is SPI-compatible,and to command it, you send two bytes, 11 | one with the channel number (0 - 5) and one with the resistance value for the 12 | channel (0 - 255). 13 | 14 | The circuit: 15 | * All A pins of AD5206 connected to +5V 16 | * All B pins of AD5206 connected to ground 17 | * An LED and a 220-ohm resisor in series connected from each W pin to ground 18 | * CS - to digital pin 10 (SS pin) 19 | * SDI - to digital pin 11 (MOSI pin) 20 | * CLK - to digital pin 13 (SCK pin) 21 | 22 | created 10 Aug 2010 23 | by Tom Igoe 24 | 25 | Thanks to Heather Dewey-Hagborg for the original tutorial, 2005 26 | 27 | */ 28 | 29 | 30 | // inslude the SPI library: 31 | #include 32 | 33 | 34 | // set pin 10 as the slave select for the digital pot: 35 | const int slaveSelectPin = 10; 36 | 37 | void setup() { 38 | // set the slaveSelectPin as an output: 39 | pinMode(slaveSelectPin, OUTPUT); 40 | // initialize SPI: 41 | SPI.begin(); 42 | } 43 | 44 | void loop() { 45 | // go through the six channels of the digital pot: 46 | for (int channel = 0; channel < 6; channel++) { 47 | // change the resistance on this channel from min to max: 48 | for (int level = 0; level < 255; level++) { 49 | digitalPotWrite(channel, level); 50 | delay(10); 51 | } 52 | // wait a second at the top: 53 | delay(100); 54 | // change the resistance on this channel from max to min: 55 | for (int level = 0; level < 255; level++) { 56 | digitalPotWrite(channel, 255 - level); 57 | delay(10); 58 | } 59 | } 60 | 61 | } 62 | 63 | void digitalPotWrite(int address, int value) { 64 | // take the SS pin low to select the chip: 65 | digitalWrite(slaveSelectPin, LOW); 66 | // send in the address and value via SPI: 67 | SPI.transfer(address); 68 | SPI.transfer(value); 69 | // take the SS pin high to de-select the chip: 70 | digitalWrite(slaveSelectPin, HIGH); 71 | } 72 | -------------------------------------------------------------------------------- /libraries/SPI/keywords.txt: -------------------------------------------------------------------------------- 1 | ####################################### 2 | # Syntax Coloring Map SPI 3 | ####################################### 4 | 5 | ####################################### 6 | # Datatypes (KEYWORD1) 7 | ####################################### 8 | 9 | SPI KEYWORD1 10 | 11 | ####################################### 12 | # Methods and Functions (KEYWORD2) 13 | ####################################### 14 | begin KEYWORD2 15 | end KEYWORD2 16 | transfer KEYWORD2 17 | setBitOrder KEYWORD2 18 | setDataMode KEYWORD2 19 | setClockDivider KEYWORD2 20 | 21 | 22 | ####################################### 23 | # Constants (LITERAL1) 24 | ####################################### 25 | SPI_CLOCK_DIV4 LITERAL1 26 | SPI_CLOCK_DIV16 LITERAL1 27 | SPI_CLOCK_DIV64 LITERAL1 28 | SPI_CLOCK_DIV128 LITERAL1 29 | SPI_CLOCK_DIV2 LITERAL1 30 | SPI_CLOCK_DIV8 LITERAL1 31 | SPI_CLOCK_DIV32 LITERAL1 32 | SPI_CLOCK_DIV64 LITERAL1 33 | SPI_MODE0 LITERAL1 34 | SPI_MODE1 LITERAL1 35 | SPI_MODE2 LITERAL1 36 | SPI_MODE3 LITERAL1 -------------------------------------------------------------------------------- /libraries/SPI/library.properties: -------------------------------------------------------------------------------- 1 | name=SPI 2 | version=1.0 3 | author=Arduino 4 | maintainer=Arduino 5 | sentence=Enables the communication with devices that use the Serial Peripheral Interface (SPI) Bus. 6 | paragraph=SPI is a synchronous serial data protocol used by microcontrollers for communicating with one or more peripheral devices quickly over short distances. It uses three lines common to all devices (MISO, MOSI and SCK) and one specific for each device. 7 | category=Communication 8 | url=http://www.arduino.cc/en/Reference/SPI 9 | architectures=avr 10 | 11 | -------------------------------------------------------------------------------- /libraries/SoftwareSerial/examples/SoftwareSerialExample/SoftwareSerialExample.ino: -------------------------------------------------------------------------------- 1 | /* 2 | Software serial multple serial test 3 | 4 | Receives from the hardware serial, sends to software serial. 5 | Receives from software serial, sends to hardware serial. 6 | 7 | The circuit: 8 | * RX is digital pin 10 (connect to TX of other device) 9 | * TX is digital pin 11 (connect to RX of other device) 10 | 11 | Note: 12 | Not all pins on the Mega and Mega 2560 support change interrupts, 13 | so only the following can be used for RX: 14 | 10, 11, 12, 13, 50, 51, 52, 53, 62, 63, 64, 65, 66, 67, 68, 69 15 | 16 | Not all pins on the Leonardo and Micro support change interrupts, 17 | so only the following can be used for RX: 18 | 8, 9, 10, 11, 14 (MISO), 15 (SCK), 16 (MOSI). 19 | 20 | created back in the mists of time 21 | modified 25 May 2012 22 | by Tom Igoe 23 | based on Mikal Hart's example 24 | 25 | This example code is in the public domain. 26 | 27 | */ 28 | #include 29 | 30 | SoftwareSerial mySerial(10, 11); // RX, TX 31 | 32 | void setup() { 33 | // Open serial communications and wait for port to open: 34 | Serial.begin(57600); 35 | while (!Serial) { 36 | ; // wait for serial port to connect. Needed for native USB port only 37 | } 38 | 39 | 40 | Serial.println("Goodnight moon!"); 41 | 42 | // set the data rate for the SoftwareSerial port 43 | mySerial.begin(4800); 44 | mySerial.println("Hello, world?"); 45 | } 46 | 47 | void loop() { // run over and over 48 | if (mySerial.available()) { 49 | Serial.write(mySerial.read()); 50 | } 51 | if (Serial.available()) { 52 | mySerial.write(Serial.read()); 53 | } 54 | } 55 | 56 | -------------------------------------------------------------------------------- /libraries/SoftwareSerial/examples/TwoPortReceive/TwoPortReceive.ino: -------------------------------------------------------------------------------- 1 | /* 2 | Software serial multple serial test 3 | 4 | Receives from the two software serial ports, 5 | sends to the hardware serial port. 6 | 7 | In order to listen on a software port, you call port.listen(). 8 | When using two software serial ports, you have to switch ports 9 | by listen()ing on each one in turn. Pick a logical time to switch 10 | ports, like the end of an expected transmission, or when the 11 | buffer is empty. This example switches ports when there is nothing 12 | more to read from a port 13 | 14 | The circuit: 15 | Two devices which communicate serially are needed. 16 | * First serial device's TX attached to digital pin 10(RX), RX to pin 11(TX) 17 | * Second serial device's TX attached to digital pin 8(RX), RX to pin 9(TX) 18 | 19 | Note: 20 | Not all pins on the Mega and Mega 2560 support change interrupts, 21 | so only the following can be used for RX: 22 | 10, 11, 12, 13, 50, 51, 52, 53, 62, 63, 64, 65, 66, 67, 68, 69 23 | 24 | Not all pins on the Leonardo support change interrupts, 25 | so only the following can be used for RX: 26 | 8, 9, 10, 11, 14 (MISO), 15 (SCK), 16 (MOSI). 27 | 28 | created 18 Apr. 2011 29 | modified 19 March 2016 30 | by Tom Igoe 31 | based on Mikal Hart's twoPortRXExample 32 | 33 | This example code is in the public domain. 34 | 35 | */ 36 | 37 | #include 38 | // software serial #1: RX = digital pin 10, TX = digital pin 11 39 | SoftwareSerial portOne(10, 11); 40 | 41 | // software serial #2: RX = digital pin 8, TX = digital pin 9 42 | // on the Mega, use other pins instead, since 8 and 9 don't work on the Mega 43 | SoftwareSerial portTwo(8, 9); 44 | 45 | void setup() { 46 | // Open serial communications and wait for port to open: 47 | Serial.begin(9600); 48 | while (!Serial) { 49 | ; // wait for serial port to connect. Needed for native USB port only 50 | } 51 | 52 | 53 | // Start each software serial port 54 | portOne.begin(9600); 55 | portTwo.begin(9600); 56 | } 57 | 58 | void loop() { 59 | // By default, the last intialized port is listening. 60 | // when you want to listen on a port, explicitly select it: 61 | portOne.listen(); 62 | Serial.println("Data from port one:"); 63 | // while there is data coming in, read it 64 | // and send to the hardware serial port: 65 | while (portOne.available() > 0) { 66 | char inByte = portOne.read(); 67 | Serial.write(inByte); 68 | } 69 | 70 | // blank line to separate data from the two ports: 71 | Serial.println(); 72 | 73 | // Now listen on the second port 74 | portTwo.listen(); 75 | // while there is data coming in, read it 76 | // and send to the hardware serial port: 77 | Serial.println("Data from port two:"); 78 | while (portTwo.available() > 0) { 79 | char inByte = portTwo.read(); 80 | Serial.write(inByte); 81 | } 82 | 83 | // blank line to separate data from the two ports: 84 | Serial.println(); 85 | } 86 | 87 | 88 | 89 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /libraries/SoftwareSerial/keywords.txt: -------------------------------------------------------------------------------- 1 | ####################################### 2 | # Syntax Coloring Map for SoftwareSerial 3 | # (formerly NewSoftSerial) 4 | ####################################### 5 | 6 | ####################################### 7 | # Datatypes (KEYWORD1) 8 | ####################################### 9 | 10 | SoftwareSerial KEYWORD1 11 | 12 | ####################################### 13 | # Methods and Functions (KEYWORD2) 14 | ####################################### 15 | 16 | begin KEYWORD2 17 | end KEYWORD2 18 | read KEYWORD2 19 | write KEYWORD2 20 | available KEYWORD2 21 | isListening KEYWORD2 22 | overflow KEYWORD2 23 | flush KEYWORD2 24 | listen KEYWORD2 25 | peek KEYWORD2 26 | 27 | ####################################### 28 | # Constants (LITERAL1) 29 | ####################################### 30 | 31 | -------------------------------------------------------------------------------- /libraries/SoftwareSerial/library.properties: -------------------------------------------------------------------------------- 1 | name=SoftwareSerial 2 | version=1.0 3 | author=Arduino 4 | maintainer=Arduino 5 | sentence=Enables serial communication on any digital pin. 6 | paragraph=The SoftwareSerial library has been developed to allow serial communication on any digital pin of the board, using software to replicate the functionality of the hardware UART. It is possible to have multiple software serial ports with speeds up to 115200 bps. 7 | category=Communication 8 | url=http://www.arduino.cc/en/Reference/SoftwareSerial 9 | architectures=avr 10 | 11 | -------------------------------------------------------------------------------- /libraries/WiFi/examples/CheckFirmwareVersion/CheckFirmwareVersion.ino: -------------------------------------------------------------------------------- 1 | /* CheckFirmwareVersion.ino 2 | * 3 | * This example is useful to know which version of the firmware is currently 4 | * running on your board and to recognize if an update is required or not to 5 | * ensure a seamless functionality. 6 | * 7 | * To see the behaviour of this sketch you have to upload it on your board 8 | * and open a serial monitor to read the output informations supplied. 9 | */ 10 | 11 | #include 12 | 13 | void setup() { 14 | 15 | Serial.begin(115200); 16 | Serial.println("Checking WiFi linkage"); 17 | 18 | /* 19 | begin ESP8266 chip: these functions perform the chip reset and 20 | initialization to ensure that the communication between ESP8266 21 | and the main mcu starts in a known fashion. 22 | */ 23 | WiFi.reset(); 24 | WiFi.init(AP_STA_MODE); 25 | 26 | Serial.println("esp WiFi firmware check."); 27 | Serial.println(); 28 | } 29 | 30 | void loop() { 31 | firmwareCheck(); 32 | } 33 | 34 | void firmwareCheck(void) 35 | { 36 | if (WiFi.status() == WL_NO_WIFI_MODULE_COMM){ 37 | /* 38 | notify the user if the previous sequence of operations to establish 39 | the communication between the ESP and the main mcu fail. 40 | */ 41 | Serial.println("Communication with WiFi module not established."); 42 | } 43 | else { 44 | /* 45 | otherwise we have a correct communication between the two chips 46 | and we can print out the firmware version 47 | */ 48 | String fv = WiFi.firmwareVersion(); 49 | Serial.print("Firmware version installed: "); 50 | Serial.println(fv); 51 | 52 | // Print required firmware version 53 | Serial.print("Firmware version required : "); 54 | Serial.println(WIFI_FIRMWARE_REQUIRED); 55 | 56 | // Check if the required version is installed 57 | Serial.println(); 58 | if (WiFi.checkFirmwareVersion(WIFI_FIRMWARE_REQUIRED)) { 59 | Serial.println("Check result: PASSED"); 60 | } 61 | else { 62 | Serial.println("Check result: NOT PASSED"); 63 | Serial.println(" - The firmware version installed do not match the"); 64 | Serial.println(" version required by the library, you may experience"); 65 | Serial.println(" issues or failures."); 66 | } 67 | } 68 | 69 | delay(1000); 70 | } 71 | -------------------------------------------------------------------------------- /libraries/WiFi/keywords.txt: -------------------------------------------------------------------------------- 1 | ####################################### 2 | # Syntax Coloring Map For WiFi library 3 | ####################################### 4 | 5 | ####################################### 6 | # Library (KEYWORD3) 7 | ####################################### 8 | 9 | WiFi KEYWORD3 10 | WiFiUdp KEYWORD3 11 | 12 | ####################################### 13 | # Datatypes (KEYWORD1) 14 | ####################################### 15 | 16 | Client KEYWORD1 17 | Server KEYWORD1 18 | 19 | ####################################### 20 | # Methods and Functions (KEYWORD2) 21 | ####################################### 22 | 23 | firmwareVersion KEYWORD2 24 | status KEYWORD2 25 | connect KEYWORD2 26 | write KEYWORD2 27 | available KEYWORD2 28 | config KEYWORD2 29 | setDNS KEYWORD2 30 | read KEYWORD2 31 | flush KEYWORD2 32 | stop KEYWORD2 33 | connected KEYWORD2 34 | begin KEYWORD2 35 | disconnect KEYWORD2 36 | macAddress KEYWORD2 37 | localIP KEYWORD2 38 | subnetMask KEYWORD2 39 | gatewayIP KEYWORD2 40 | SSID KEYWORD2 41 | BSSID KEYWORD2 42 | RSSI KEYWORD2 43 | encryptionType KEYWORD2 44 | getResult KEYWORD2 45 | getSocket KEYWORD2 46 | WiFiClient KEYWORD2 47 | WiFiServer KEYWORD2 48 | WiFiUDP KEYWORD2 49 | beginPacket KEYWORD2 50 | endPacket KEYWORD2 51 | parsePacket KEYWORD2 52 | remoteIP KEYWORD2 53 | remotePort KEYWORD2 54 | reset KEYWORD2 55 | init KEYWORD2 56 | disableWebPanel KEYWORD2 57 | 58 | ####################################### 59 | # Constants (LITERAL1) 60 | ####################################### 61 | 62 | -------------------------------------------------------------------------------- /libraries/WiFi/library.properties: -------------------------------------------------------------------------------- 1 | name=WiFi 2 | version=1.0.0 3 | author=jolly-dev 4 | maintainer= 5 | sentence=Enables network connection (local and Internet) using Jolly module. 6 | paragraph=With this library you can instantiate Servers, Clients and send/receive UDP packets through WiFi. 7 | category=Communication 8 | url= 9 | architectures=avr 10 | includes=WiFi.h 11 | -------------------------------------------------------------------------------- /libraries/WiFi/src/WiFiClient.h: -------------------------------------------------------------------------------- 1 | /* 2 | This library is free software; you can redistribute it and/or 3 | modify it under the terms of the GNU Lesser General Public 4 | License as published by the Free Software Foundation; either 5 | version 2.1 of the License, or (at your option) any later version. 6 | 7 | This library is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 10 | Lesser General Public License for more details. 11 | 12 | You should have received a copy of the GNU Lesser General Public 13 | License along with this library; if not, write to the Free Software 14 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 15 | */ 16 | 17 | #ifndef WIFI_CLIENT_H 18 | #define WIFI_CLIENT_H 19 | #include "Arduino.h" 20 | #include "Print.h" 21 | #include "Client.h" 22 | #include "IPAddress.h" 23 | 24 | class WiFiClient : public Client { 25 | 26 | public: 27 | WiFiClient(); 28 | WiFiClient(uint8_t sock); 29 | 30 | uint8_t status(); 31 | virtual int connect(IPAddress ip, uint16_t port); 32 | virtual int connect(const char *host, uint16_t port); 33 | virtual size_t write(uint8_t); 34 | virtual size_t write(const uint8_t *buf, size_t size); 35 | virtual int available(); 36 | virtual int read(); 37 | virtual int read(uint8_t *buf, size_t size); 38 | virtual int peek(); 39 | virtual void flush(); 40 | virtual void stop(); 41 | virtual uint8_t connected(); 42 | virtual operator bool(); 43 | 44 | friend class WiFiServer; 45 | 46 | using Print::write; 47 | 48 | private: 49 | uint8_t _sock; 50 | uint8_t getFirstSocket(); 51 | }; 52 | 53 | #endif // WIFI_CLIENT_H 54 | -------------------------------------------------------------------------------- /libraries/WiFi/src/WiFiServer.h: -------------------------------------------------------------------------------- 1 | /* 2 | This library is free software; you can redistribute it and/or 3 | modify it under the terms of the GNU Lesser General Public 4 | License as published by the Free Software Foundation; either 5 | version 2.1 of the License, or (at your option) any later version. 6 | 7 | This library is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 10 | Lesser General Public License for more details. 11 | 12 | You should have received a copy of the GNU Lesser General Public 13 | License along with this library; if not, write to the Free Software 14 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 15 | */ 16 | 17 | #ifndef wifiserver_h 18 | #define wifiserver_h 19 | 20 | #include "utility/definitions.h" 21 | 22 | #include "Server.h" 23 | 24 | class WiFiClient; 25 | 26 | class WiFiServer : public Server { 27 | private: 28 | uint16_t _port; 29 | public: 30 | WiFiServer(uint16_t); 31 | WiFiClient available(uint8_t* status = NULL); 32 | void begin(); 33 | virtual size_t write(uint8_t); 34 | virtual size_t write(const uint8_t *buf, size_t size); 35 | uint8_t status(); 36 | 37 | using Print::write; 38 | }; 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /libraries/Wire/examples/SFRRanger_reader/SFRRanger_reader.ino: -------------------------------------------------------------------------------- 1 | // I2C SRF10 or SRF08 Devantech Ultrasonic Ranger Finder 2 | // by Nicholas Zambetti 3 | // and James Tichenor 4 | 5 | // Demonstrates use of the Wire library reading data from the 6 | // Devantech Utrasonic Rangers SFR08 and SFR10 7 | 8 | // Created 29 April 2006 9 | 10 | // This example code is in the public domain. 11 | 12 | 13 | #include 14 | 15 | void setup() { 16 | Wire.begin(); // join i2c bus (address optional for master) 17 | Serial.begin(9600); // start serial communication at 9600bps 18 | } 19 | 20 | int reading = 0; 21 | 22 | void loop() { 23 | // step 1: instruct sensor to read echoes 24 | Wire.beginTransmission(112); // transmit to device #112 (0x70) 25 | // the address specified in the datasheet is 224 (0xE0) 26 | // but i2c adressing uses the high 7 bits so it's 112 27 | Wire.write(byte(0x00)); // sets register pointer to the command register (0x00) 28 | Wire.write(byte(0x50)); // command sensor to measure in "inches" (0x50) 29 | // use 0x51 for centimeters 30 | // use 0x52 for ping microseconds 31 | Wire.endTransmission(); // stop transmitting 32 | 33 | // step 2: wait for readings to happen 34 | delay(70); // datasheet suggests at least 65 milliseconds 35 | 36 | // step 3: instruct sensor to return a particular echo reading 37 | Wire.beginTransmission(112); // transmit to device #112 38 | Wire.write(byte(0x02)); // sets register pointer to echo #1 register (0x02) 39 | Wire.endTransmission(); // stop transmitting 40 | 41 | // step 4: request reading from sensor 42 | Wire.requestFrom(112, 2); // request 2 bytes from slave device #112 43 | 44 | // step 5: receive reading from sensor 45 | if (2 <= Wire.available()) { // if two bytes were received 46 | reading = Wire.read(); // receive high byte (overwrites previous reading) 47 | reading = reading << 8; // shift high byte to be high 8 bits 48 | reading |= Wire.read(); // receive low byte as lower 8 bits 49 | Serial.println(reading); // print the reading 50 | } 51 | 52 | delay(250); // wait a bit since people have to read the output :) 53 | } 54 | 55 | 56 | /* 57 | 58 | // The following code changes the address of a Devantech Ultrasonic Range Finder (SRF10 or SRF08) 59 | // usage: changeAddress(0x70, 0xE6); 60 | 61 | void changeAddress(byte oldAddress, byte newAddress) 62 | { 63 | Wire.beginTransmission(oldAddress); 64 | Wire.write(byte(0x00)); 65 | Wire.write(byte(0xA0)); 66 | Wire.endTransmission(); 67 | 68 | Wire.beginTransmission(oldAddress); 69 | Wire.write(byte(0x00)); 70 | Wire.write(byte(0xAA)); 71 | Wire.endTransmission(); 72 | 73 | Wire.beginTransmission(oldAddress); 74 | Wire.write(byte(0x00)); 75 | Wire.write(byte(0xA5)); 76 | Wire.endTransmission(); 77 | 78 | Wire.beginTransmission(oldAddress); 79 | Wire.write(byte(0x00)); 80 | Wire.write(newAddress); 81 | Wire.endTransmission(); 82 | } 83 | 84 | */ 85 | -------------------------------------------------------------------------------- /libraries/Wire/examples/digital_potentiometer/digital_potentiometer.ino: -------------------------------------------------------------------------------- 1 | // I2C Digital Potentiometer 2 | // by Nicholas Zambetti 3 | // and Shawn Bonkowski 4 | 5 | // Demonstrates use of the Wire library 6 | // Controls AD5171 digital potentiometer via I2C/TWI 7 | 8 | // Created 31 March 2006 9 | 10 | // This example code is in the public domain. 11 | 12 | // This example code is in the public domain. 13 | 14 | 15 | #include 16 | 17 | void setup() { 18 | Wire.begin(); // join i2c bus (address optional for master) 19 | } 20 | 21 | byte val = 0; 22 | 23 | void loop() { 24 | Wire.beginTransmission(44); // transmit to device #44 (0x2c) 25 | // device address is specified in datasheet 26 | Wire.write(byte(0x00)); // sends instruction byte 27 | Wire.write(val); // sends potentiometer value byte 28 | Wire.endTransmission(); // stop transmitting 29 | 30 | val++; // increment value 31 | if (val == 64) { // if reached 64th position (max) 32 | val = 0; // start over from lowest value 33 | } 34 | delay(500); 35 | } 36 | 37 | -------------------------------------------------------------------------------- /libraries/Wire/examples/master_reader/master_reader.ino: -------------------------------------------------------------------------------- 1 | // Wire Master Reader 2 | // by Nicholas Zambetti 3 | 4 | // Demonstrates use of the Wire library 5 | // Reads data from an I2C/TWI slave device 6 | // Refer to the "Wire Slave Sender" example for use with this 7 | 8 | // Created 29 March 2006 9 | 10 | // This example code is in the public domain. 11 | 12 | 13 | #include 14 | 15 | void setup() { 16 | Wire.begin(); // join i2c bus (address optional for master) 17 | Serial.begin(9600); // start serial for output 18 | } 19 | 20 | void loop() { 21 | Wire.requestFrom(8, 6); // request 6 bytes from slave device #8 22 | 23 | while (Wire.available()) { // slave may send less than requested 24 | char c = Wire.read(); // receive a byte as character 25 | Serial.print(c); // print the character 26 | } 27 | 28 | delay(500); 29 | } 30 | -------------------------------------------------------------------------------- /libraries/Wire/examples/master_writer/master_writer.ino: -------------------------------------------------------------------------------- 1 | // Wire Master Writer 2 | // by Nicholas Zambetti 3 | 4 | // Demonstrates use of the Wire library 5 | // Writes data to an I2C/TWI slave device 6 | // Refer to the "Wire Slave Receiver" example for use with this 7 | 8 | // Created 29 March 2006 9 | 10 | // This example code is in the public domain. 11 | 12 | 13 | #include 14 | 15 | void setup() { 16 | Wire.begin(); // join i2c bus (address optional for master) 17 | } 18 | 19 | byte x = 0; 20 | 21 | void loop() { 22 | Wire.beginTransmission(8); // transmit to device #8 23 | Wire.write("x is "); // sends five bytes 24 | Wire.write(x); // sends one byte 25 | Wire.endTransmission(); // stop transmitting 26 | 27 | x++; 28 | delay(500); 29 | } 30 | -------------------------------------------------------------------------------- /libraries/Wire/examples/slave_receiver/slave_receiver.ino: -------------------------------------------------------------------------------- 1 | // Wire Slave Receiver 2 | // by Nicholas Zambetti 3 | 4 | // Demonstrates use of the Wire library 5 | // Receives data as an I2C/TWI slave device 6 | // Refer to the "Wire Master Writer" example for use with this 7 | 8 | // Created 29 March 2006 9 | 10 | // This example code is in the public domain. 11 | 12 | 13 | #include 14 | 15 | void setup() { 16 | Wire.begin(8); // join i2c bus with address #8 17 | Wire.onReceive(receiveEvent); // register event 18 | Serial.begin(9600); // start serial for output 19 | } 20 | 21 | void loop() { 22 | delay(100); 23 | } 24 | 25 | // function that executes whenever data is received from master 26 | // this function is registered as an event, see setup() 27 | void receiveEvent(int howMany) { 28 | while (1 < Wire.available()) { // loop through all but the last 29 | char c = Wire.read(); // receive byte as a character 30 | Serial.print(c); // print the character 31 | } 32 | int x = Wire.read(); // receive byte as an integer 33 | Serial.println(x); // print the integer 34 | } 35 | -------------------------------------------------------------------------------- /libraries/Wire/examples/slave_sender/slave_sender.ino: -------------------------------------------------------------------------------- 1 | // Wire Slave Sender 2 | // by Nicholas Zambetti 3 | 4 | // Demonstrates use of the Wire library 5 | // Sends data as an I2C/TWI slave device 6 | // Refer to the "Wire Master Reader" example for use with this 7 | 8 | // Created 29 March 2006 9 | 10 | // This example code is in the public domain. 11 | 12 | 13 | #include 14 | 15 | void setup() { 16 | Wire.begin(8); // join i2c bus with address #8 17 | Wire.onRequest(requestEvent); // register event 18 | } 19 | 20 | void loop() { 21 | delay(100); 22 | } 23 | 24 | // function that executes whenever data is requested by master 25 | // this function is registered as an event, see setup() 26 | void requestEvent() { 27 | Wire.write("hello "); // respond with message of 6 bytes 28 | // as expected by master 29 | } 30 | -------------------------------------------------------------------------------- /libraries/Wire/keywords.txt: -------------------------------------------------------------------------------- 1 | ####################################### 2 | # Syntax Coloring Map For Wire 3 | ####################################### 4 | 5 | ####################################### 6 | # Datatypes (KEYWORD1) 7 | ####################################### 8 | 9 | ####################################### 10 | # Methods and Functions (KEYWORD2) 11 | ####################################### 12 | 13 | begin KEYWORD2 14 | setClock KEYWORD2 15 | beginTransmission KEYWORD2 16 | endTransmission KEYWORD2 17 | requestFrom KEYWORD2 18 | onReceive KEYWORD2 19 | onRequest KEYWORD2 20 | 21 | ####################################### 22 | # Instances (KEYWORD2) 23 | ####################################### 24 | 25 | Wire KEYWORD2 26 | 27 | ####################################### 28 | # Constants (LITERAL1) 29 | ####################################### 30 | 31 | -------------------------------------------------------------------------------- /libraries/Wire/library.properties: -------------------------------------------------------------------------------- 1 | name=Wire 2 | version=1.0 3 | author=Arduino 4 | maintainer=Arduino 5 | sentence=This library allows you to communicate with I2C and Two Wire Interface devices. 6 | paragraph=It allows the communication with I2C devices like temperature sensors, realtime clocks and many others using SDA (Data Line) and SCL (Clock Line). 7 | category=Communication 8 | url=http://www.arduino.cc/en/Reference/Wire 9 | architectures=avr 10 | 11 | -------------------------------------------------------------------------------- /libraries/Wire/src/Wire.h: -------------------------------------------------------------------------------- 1 | /* 2 | TwoWire.h - TWI/I2C library for Arduino & 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 2012 by Todd Krein (todd@krein.org) to implement repeated starts 20 | */ 21 | 22 | #ifndef TwoWire_h 23 | #define TwoWire_h 24 | 25 | #include 26 | #include "Stream.h" 27 | 28 | #define BUFFER_LENGTH 32 29 | 30 | // WIRE_HAS_END means Wire has end() 31 | #define WIRE_HAS_END 1 32 | 33 | class TwoWire : public Stream 34 | { 35 | private: 36 | static uint8_t rxBuffer[]; 37 | static uint8_t rxBufferIndex; 38 | static uint8_t rxBufferLength; 39 | 40 | static uint8_t txAddress; 41 | static uint8_t txBuffer[]; 42 | static uint8_t txBufferIndex; 43 | static uint8_t txBufferLength; 44 | 45 | static uint8_t transmitting; 46 | static void (*user_onRequest)(void); 47 | static void (*user_onReceive)(int); 48 | static void onRequestService(void); 49 | static void onReceiveService(uint8_t*, int); 50 | public: 51 | TwoWire(); 52 | void begin(); 53 | void begin(uint8_t); 54 | void begin(int); 55 | void end(); 56 | void setClock(uint32_t); 57 | void beginTransmission(uint8_t); 58 | void beginTransmission(int); 59 | uint8_t endTransmission(void); 60 | uint8_t endTransmission(uint8_t); 61 | uint8_t requestFrom(uint8_t, uint8_t); 62 | uint8_t requestFrom(uint8_t, uint8_t, uint8_t); 63 | uint8_t requestFrom(uint8_t, uint8_t, uint32_t, uint8_t, uint8_t); 64 | uint8_t requestFrom(int, int); 65 | uint8_t requestFrom(int, int, int); 66 | virtual size_t write(uint8_t); 67 | virtual size_t write(const uint8_t *, size_t); 68 | virtual int available(void); 69 | virtual int read(void); 70 | virtual int peek(void); 71 | virtual void flush(void); 72 | void onReceive( void (*)(int) ); 73 | void onRequest( void (*)(void) ); 74 | 75 | inline size_t write(unsigned long n) { return write((uint8_t)n); } 76 | inline size_t write(long n) { return write((uint8_t)n); } 77 | inline size_t write(unsigned int n) { return write((uint8_t)n); } 78 | inline size_t write(int n) { return write((uint8_t)n); } 79 | using Print::write; 80 | }; 81 | 82 | extern TwoWire Wire; 83 | 84 | #endif 85 | 86 | -------------------------------------------------------------------------------- /libraries/Wire/src/utility/twi.h: -------------------------------------------------------------------------------- 1 | /* 2 | twi.h - TWI/I2C library for Wiring & Arduino 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 | 20 | #ifndef twi_h 21 | #define twi_h 22 | 23 | #include 24 | 25 | //#define ATMEGA8 26 | 27 | #ifndef TWBR 28 | #define TWBR TWBR0 //_SFR_MEM8(0xB8) 29 | #define TWSR TWSR0 //_SFR_MEM8(0xB9) 30 | #define TWAR TWAR0 //_SFR_MEM8(0xBA) 31 | #define TWDR TWDR0 //_SFR_MEM8(0xBB) 32 | #define TWCR TWCR0 //_SFR_MEM8(0xBC) 33 | #define TWAMR TWAMR0 //_SFR_MEM8(0xBD) 34 | #define TWI_vect_num TWI0_vect_num //24 35 | #define TWI_vect TWI0_vect //_VECTOR(24) 36 | #endif 37 | 38 | #ifndef TWI_FREQ 39 | #define TWI_FREQ 100000L 40 | #endif 41 | 42 | #ifndef TWI_BUFFER_LENGTH 43 | #define TWI_BUFFER_LENGTH 32 44 | #endif 45 | 46 | #define TWI_READY 0 47 | #define TWI_MRX 1 48 | #define TWI_MTX 2 49 | #define TWI_SRX 3 50 | #define TWI_STX 4 51 | 52 | void twi_init(void); 53 | void twi_disable(void); 54 | void twi_setAddress(uint8_t); 55 | void twi_setFrequency(uint32_t); 56 | uint8_t twi_readFrom(uint8_t, uint8_t*, uint8_t, uint8_t); 57 | uint8_t twi_writeTo(uint8_t, uint8_t*, uint8_t, uint8_t, uint8_t); 58 | uint8_t twi_transmit(const uint8_t*, uint8_t); 59 | void twi_attachSlaveRxEvent( void (*)(uint8_t*, int) ); 60 | void twi_attachSlaveTxEvent( void (*)(void) ); 61 | void twi_reply(uint8_t); 62 | void twi_stop(void); 63 | void twi_releaseBus(void); 64 | 65 | #endif 66 | 67 | --------------------------------------------------------------------------------