├── LICENSE ├── boards.txt ├── bootloaders └── atmega │ ├── ATmegaBOOT_168.c │ ├── ATmegaBOOT_168_panstamp.hex │ └── Makefile ├── cores └── panstamp │ ├── Arduino.h │ ├── COPYING │ ├── Client.h │ ├── HardwareSerial.cpp │ ├── HardwareSerial.h │ ├── HardwareSerial0.cpp │ ├── HardwareSerial1.cpp │ ├── HardwareSerial2.cpp │ ├── HardwareSerial3.cpp │ ├── HardwareSerial_private.h │ ├── IPAddress.cpp │ ├── IPAddress.h │ ├── Print.cpp │ ├── Print.h │ ├── Printable.h │ ├── Server.h │ ├── Stream.cpp │ ├── Stream.h │ ├── TODO.txt │ ├── Udp.h │ ├── WCharacter.h │ ├── WInterrupts.cpp │ ├── WMath.cpp │ ├── WString.cpp │ ├── WString.h │ ├── avrrtc.cpp │ ├── avrrtc.h │ ├── binary.h │ ├── calibration.cpp │ ├── calibration.h │ ├── cc1101.cpp │ ├── cc1101.h │ ├── ccpacket.h │ ├── datatypes.h │ ├── hooks.c │ ├── keywords.txt │ ├── main.cpp │ ├── new.cpp │ ├── new.h │ ├── panstamp.cpp │ ├── panstamp.h │ ├── simplespi.cpp │ ├── simplespi.h │ ├── storage.cpp │ ├── storage.h │ ├── wiring.cpp │ ├── wiring_analog.cpp │ ├── wiring_digital.cpp │ ├── wiring_private.h │ ├── wiring_pulse.cpp │ └── wiring_shift.cpp ├── firmwares ├── 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 │ ├── 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 │ │ ├── Lib │ │ └── LightweightRingBuff.h │ │ ├── makefile │ │ └── readme.txt └── wifishield │ ├── binary │ ├── wifiHD.elf │ ├── wifiHD.hex │ ├── wifiHD_2_1.elf │ ├── wifi_dnld.elf │ ├── wifi_dnld.hex │ └── wifi_dnld_2_1.elf │ ├── scripts │ ├── ArduinoWifiShield_upgrade.sh │ └── ArduinoWifiShield_upgrade_mac.sh │ ├── wifiHD │ ├── .cproject │ ├── .project │ ├── Release │ │ ├── wifiHD.elf │ │ └── wifiHD.hex │ ├── src │ │ ├── CONFIG │ │ │ ├── conf_access.h │ │ │ ├── conf_at45dbx.h │ │ │ ├── conf_ebi.h │ │ │ └── conf_sd_mmc_spi.h │ │ ├── SOFTWARE_FRAMEWORK │ │ │ ├── ASM │ │ │ │ └── trampoline.x │ │ │ ├── BOARDS │ │ │ │ ├── ARDUINO │ │ │ │ │ ├── arduino.h │ │ │ │ │ ├── led.c │ │ │ │ │ └── led.h │ │ │ │ ├── EVK1105 │ │ │ │ │ ├── evk1105.h │ │ │ │ │ ├── led.c │ │ │ │ │ └── led.h │ │ │ │ ├── board.h │ │ │ │ └── board.h.my │ │ │ ├── COMPONENTS │ │ │ │ ├── MEMORY │ │ │ │ │ └── DATA_FLASH │ │ │ │ │ │ └── AT45DBX │ │ │ │ │ │ ├── at45dbx.c │ │ │ │ │ │ ├── at45dbx.h │ │ │ │ │ │ ├── at45dbx_mem.c │ │ │ │ │ │ └── at45dbx_mem.h │ │ │ │ └── WIFI │ │ │ │ │ └── HD │ │ │ │ │ ├── v2.7.0 │ │ │ │ │ ├── UCR1 │ │ │ │ │ │ └── GCC │ │ │ │ │ │ │ ├── lib_ucr1_hd_sdio_v2.7.0.a │ │ │ │ │ │ │ ├── lib_ucr1_hd_spi_v2.7.0.a │ │ │ │ │ │ │ └── lib_ucr1_hd_wl_sta_intwpa_v2.7.0.a │ │ │ │ │ ├── UCR2 │ │ │ │ │ │ └── GCC │ │ │ │ │ │ │ ├── lib_ucr2_hd_sdio_v2.7.0.a │ │ │ │ │ │ │ ├── lib_ucr2_hd_spi_v2.7.0.a │ │ │ │ │ │ │ └── lib_ucr2_hd_wl_sta_intwpa_v2.7.0.a │ │ │ │ │ └── revision.txt │ │ │ │ │ ├── wl_api.h │ │ │ │ │ ├── wl_fw.h │ │ │ │ │ ├── wl_os.h │ │ │ │ │ ├── wl_sdio.h │ │ │ │ │ ├── wl_spi.h │ │ │ │ │ └── wlap_api.h │ │ │ ├── DRIVERS │ │ │ │ ├── CPU │ │ │ │ │ └── CYCLE_COUNTER │ │ │ │ │ │ └── cycle_counter.h │ │ │ │ ├── EBI │ │ │ │ │ └── SMC │ │ │ │ │ │ ├── smc.c │ │ │ │ │ │ └── smc.h │ │ │ │ ├── EIC │ │ │ │ │ ├── eic.c │ │ │ │ │ └── eic.h │ │ │ │ ├── FLASHC │ │ │ │ │ ├── flashc.c │ │ │ │ │ └── flashc.h │ │ │ │ ├── GPIO │ │ │ │ │ ├── gpio.c │ │ │ │ │ └── gpio.h │ │ │ │ ├── INTC │ │ │ │ │ ├── exception.x │ │ │ │ │ ├── intc.c │ │ │ │ │ └── intc.h │ │ │ │ ├── PDCA │ │ │ │ │ ├── pdca.c │ │ │ │ │ └── pdca.h │ │ │ │ ├── PM │ │ │ │ │ ├── pm.c │ │ │ │ │ ├── pm.h │ │ │ │ │ ├── pm_conf_clocks.c │ │ │ │ │ ├── power_clocks_lib.c │ │ │ │ │ └── power_clocks_lib.h │ │ │ │ ├── RTC │ │ │ │ │ ├── rtc.c │ │ │ │ │ └── rtc.h │ │ │ │ ├── SPI │ │ │ │ │ ├── spi.c │ │ │ │ │ └── spi.h │ │ │ │ ├── TC │ │ │ │ │ ├── tc.c │ │ │ │ │ └── tc.h │ │ │ │ └── USART │ │ │ │ │ ├── usart.c │ │ │ │ │ └── usart.h │ │ │ ├── SERVICES │ │ │ │ ├── DELAY │ │ │ │ │ ├── delay.c │ │ │ │ │ └── delay.h │ │ │ │ ├── LWIP │ │ │ │ │ ├── lwip-1.3.2 │ │ │ │ │ │ └── src │ │ │ │ │ │ │ ├── core │ │ │ │ │ │ │ ├── dhcp.c │ │ │ │ │ │ │ ├── dns.c │ │ │ │ │ │ │ ├── init.c │ │ │ │ │ │ │ ├── ipv4 │ │ │ │ │ │ │ │ ├── autoip.c │ │ │ │ │ │ │ │ ├── icmp.c │ │ │ │ │ │ │ │ ├── igmp.c │ │ │ │ │ │ │ │ ├── inet.c │ │ │ │ │ │ │ │ ├── inet_chksum.c │ │ │ │ │ │ │ │ ├── ip.c │ │ │ │ │ │ │ │ ├── ip_addr.c │ │ │ │ │ │ │ │ └── ip_frag.c │ │ │ │ │ │ │ ├── mem.c │ │ │ │ │ │ │ ├── memp.c │ │ │ │ │ │ │ ├── netif.c │ │ │ │ │ │ │ ├── pbuf.c │ │ │ │ │ │ │ ├── raw.c │ │ │ │ │ │ │ ├── stats.c │ │ │ │ │ │ │ ├── tcp.c │ │ │ │ │ │ │ ├── tcp_in.c │ │ │ │ │ │ │ ├── tcp_out.c │ │ │ │ │ │ │ └── udp.c │ │ │ │ │ │ │ ├── include │ │ │ │ │ │ │ ├── ipv4 │ │ │ │ │ │ │ │ └── lwip │ │ │ │ │ │ │ │ │ ├── autoip.h │ │ │ │ │ │ │ │ │ ├── icmp.h │ │ │ │ │ │ │ │ │ ├── igmp.h │ │ │ │ │ │ │ │ │ ├── inet.h │ │ │ │ │ │ │ │ │ ├── inet_chksum.h │ │ │ │ │ │ │ │ │ ├── ip.h │ │ │ │ │ │ │ │ │ ├── ip_addr.h │ │ │ │ │ │ │ │ │ └── ip_frag.h │ │ │ │ │ │ │ ├── lwip │ │ │ │ │ │ │ │ ├── api.h │ │ │ │ │ │ │ │ ├── api_msg.h │ │ │ │ │ │ │ │ ├── arch.h │ │ │ │ │ │ │ │ ├── debug.h │ │ │ │ │ │ │ │ ├── def.h │ │ │ │ │ │ │ │ ├── dhcp.h │ │ │ │ │ │ │ │ ├── dns.h │ │ │ │ │ │ │ │ ├── err.h │ │ │ │ │ │ │ │ ├── init.h │ │ │ │ │ │ │ │ ├── mem.h │ │ │ │ │ │ │ │ ├── memp.h │ │ │ │ │ │ │ │ ├── memp_std.h │ │ │ │ │ │ │ │ ├── netbuf.h │ │ │ │ │ │ │ │ ├── netdb.h │ │ │ │ │ │ │ │ ├── netif.h │ │ │ │ │ │ │ │ ├── netifapi.h │ │ │ │ │ │ │ │ ├── opt.h │ │ │ │ │ │ │ │ ├── pbuf.h │ │ │ │ │ │ │ │ ├── raw.h │ │ │ │ │ │ │ │ ├── sio.h │ │ │ │ │ │ │ │ ├── snmp.h │ │ │ │ │ │ │ │ ├── snmp_asn1.h │ │ │ │ │ │ │ │ ├── snmp_msg.h │ │ │ │ │ │ │ │ ├── snmp_structs.h │ │ │ │ │ │ │ │ ├── sockets.h │ │ │ │ │ │ │ │ ├── stats.h │ │ │ │ │ │ │ │ ├── sys.h │ │ │ │ │ │ │ │ ├── tcp.h │ │ │ │ │ │ │ │ ├── tcpip.h │ │ │ │ │ │ │ │ └── udp.h │ │ │ │ │ │ │ └── netif │ │ │ │ │ │ │ │ ├── etharp.h │ │ │ │ │ │ │ │ ├── loopif.h │ │ │ │ │ │ │ │ ├── ppp_oe.h │ │ │ │ │ │ │ │ └── slipif.h │ │ │ │ │ │ │ └── netif │ │ │ │ │ │ │ ├── etharp.c │ │ │ │ │ │ │ └── loopif.c │ │ │ │ │ └── lwip-port-1.3.2 │ │ │ │ │ │ └── HD │ │ │ │ │ │ ├── if │ │ │ │ │ │ ├── include │ │ │ │ │ │ │ ├── arch │ │ │ │ │ │ │ │ ├── cc.h │ │ │ │ │ │ │ │ └── perf.h │ │ │ │ │ │ │ ├── lwipopts.h │ │ │ │ │ │ │ └── netif │ │ │ │ │ │ │ │ └── wlif.h │ │ │ │ │ │ └── netif │ │ │ │ │ │ │ └── wlif.c │ │ │ │ │ │ └── readme.txt │ │ │ │ └── MEMORY │ │ │ │ │ └── CTRL_ACCESS │ │ │ │ │ ├── ctrl_access.c │ │ │ │ │ └── ctrl_access.h │ │ │ └── UTILS │ │ │ │ ├── DEBUG │ │ │ │ ├── debug.c │ │ │ │ ├── debug.h │ │ │ │ ├── print_funcs.c │ │ │ │ └── print_funcs.h │ │ │ │ ├── LIBS │ │ │ │ └── NEWLIB_ADDONS │ │ │ │ │ ├── INCLUDE │ │ │ │ │ ├── nlao_cpu.h │ │ │ │ │ ├── nlao_exceptions.h │ │ │ │ │ ├── nlao_interrupts.h │ │ │ │ │ ├── nlao_io.h │ │ │ │ │ └── nlao_usart.h │ │ │ │ │ └── libnewlib_addons-at32ucr2-speed_opt.a │ │ │ │ ├── LINKER_SCRIPTS │ │ │ │ └── AT32UC3A │ │ │ │ │ ├── 1256 │ │ │ │ │ └── GCC │ │ │ │ │ │ └── link_uc3a1256.lds │ │ │ │ │ └── 0512 │ │ │ │ │ └── GCC │ │ │ │ │ └── link_uc3a0512.lds │ │ │ │ ├── PREPROCESSOR │ │ │ │ ├── mrepeat.h │ │ │ │ ├── preprocessor.h │ │ │ │ ├── stringz.h │ │ │ │ └── tpaste.h │ │ │ │ ├── STARTUP_FILES │ │ │ │ └── GCC │ │ │ │ │ └── crt0.x │ │ │ │ ├── compiler.h │ │ │ │ ├── conf_isp.h │ │ │ │ └── parts.h │ │ ├── ard_spi.c │ │ ├── ard_spi.h │ │ ├── ard_tcp.c │ │ ├── ard_tcp.h │ │ ├── ard_utils.c │ │ ├── ard_utils.h │ │ ├── avr32_spi.c │ │ ├── board_init.c │ │ ├── board_init.h │ │ ├── cmd_wl.c │ │ ├── cmd_wl.h │ │ ├── console.c │ │ ├── console.h │ │ ├── debug.h │ │ ├── fw_download.h │ │ ├── fw_download_extflash.c │ │ ├── license.txt │ │ ├── lwip_setup.c │ │ ├── lwip_setup.h │ │ ├── lwipopts.h │ │ ├── main.c │ │ ├── nvram.c │ │ ├── nvram.h │ │ ├── owl_os.c │ │ ├── ping.c │ │ ├── ping.h │ │ ├── printf-stdarg.c │ │ ├── printf-stdarg.h │ │ ├── timer.c │ │ ├── timer.h │ │ ├── top_defs.h │ │ ├── trace.h │ │ ├── util.c │ │ ├── util.h │ │ ├── wifi_spi.h │ │ ├── wl_cm.c │ │ ├── wl_cm.h │ │ └── wl_definitions.h │ └── wifiHD.cproj │ ├── wifi_dnld │ ├── .cproject │ ├── .project │ ├── Release │ │ └── wifi_dnld.elf │ ├── src │ │ ├── CONFIG │ │ │ ├── conf_access.h │ │ │ └── conf_at45dbx.h │ │ ├── Doc │ │ │ ├── SPB104 product brief.pdf │ │ │ └── gettingstarted.pdf │ │ ├── SOFTWARE_FRAMEWORK │ │ │ ├── ASM │ │ │ │ └── trampoline.x │ │ │ ├── BOARDS │ │ │ │ ├── ARDUINO │ │ │ │ │ ├── arduino.h │ │ │ │ │ ├── led.c │ │ │ │ │ └── led.h │ │ │ │ ├── EVK1105 │ │ │ │ │ ├── evk1105.h │ │ │ │ │ ├── led.c │ │ │ │ │ └── led.h │ │ │ │ ├── board.h │ │ │ │ └── board.h.ori │ │ │ ├── COMPONENTS │ │ │ │ └── MEMORY │ │ │ │ │ └── DATA_FLASH │ │ │ │ │ └── AT45DBX │ │ │ │ │ ├── at45dbx.c │ │ │ │ │ ├── at45dbx.h │ │ │ │ │ ├── at45dbx_mem.c │ │ │ │ │ └── at45dbx_mem.h │ │ │ ├── DRIVERS │ │ │ │ ├── FLASHC │ │ │ │ │ ├── flashc.c │ │ │ │ │ └── flashc.h │ │ │ │ ├── GPIO │ │ │ │ │ ├── gpio.c │ │ │ │ │ └── gpio.h │ │ │ │ ├── INTC │ │ │ │ │ ├── exception.x │ │ │ │ │ ├── intc.c │ │ │ │ │ └── intc.h │ │ │ │ ├── PM │ │ │ │ │ ├── pm.c │ │ │ │ │ ├── pm.h │ │ │ │ │ ├── pm_conf_clocks.c │ │ │ │ │ ├── power_clocks_lib.c │ │ │ │ │ └── power_clocks_lib.h │ │ │ │ ├── SPI │ │ │ │ │ ├── spi.c │ │ │ │ │ └── spi.h │ │ │ │ └── USART │ │ │ │ │ ├── usart.c │ │ │ │ │ └── usart.h │ │ │ ├── SERVICES │ │ │ │ └── MEMORY │ │ │ │ │ └── CTRL_ACCESS │ │ │ │ │ ├── ctrl_access.c │ │ │ │ │ └── ctrl_access.h │ │ │ └── UTILS │ │ │ │ ├── DEBUG │ │ │ │ ├── debug.c │ │ │ │ ├── debug.h │ │ │ │ ├── print_funcs.c │ │ │ │ └── print_funcs.h │ │ │ │ ├── LIBS │ │ │ │ └── NEWLIB_ADDONS │ │ │ │ │ ├── INCLUDE │ │ │ │ │ ├── nlao_cpu.h │ │ │ │ │ ├── nlao_exceptions.h │ │ │ │ │ ├── nlao_interrupts.h │ │ │ │ │ ├── nlao_io.h │ │ │ │ │ └── nlao_usart.h │ │ │ │ │ └── libnewlib_addons-at32ucr2-speed_opt.a │ │ │ │ ├── LINKER_SCRIPTS │ │ │ │ └── AT32UC3A │ │ │ │ │ ├── 1256 │ │ │ │ │ └── GCC │ │ │ │ │ │ └── link_uc3a1256.lds │ │ │ │ │ └── 0512 │ │ │ │ │ └── GCC │ │ │ │ │ └── link_uc3a0512.lds │ │ │ │ ├── PREPROCESSOR │ │ │ │ ├── mrepeat.h │ │ │ │ ├── preprocessor.h │ │ │ │ ├── stringz.h │ │ │ │ └── tpaste.h │ │ │ │ ├── STARTUP_FILES │ │ │ │ └── GCC │ │ │ │ │ └── crt0.x │ │ │ │ ├── compiler.h │ │ │ │ ├── conf_isp.h │ │ │ │ └── parts.h │ │ ├── clocks.c │ │ ├── clocks.h │ │ ├── flash_fw.c │ │ ├── license.txt │ │ ├── nor_flash.c │ │ ├── nor_flash.h │ │ ├── printf-stdarg.c │ │ ├── printf-stdarg.h │ │ ├── startup.c │ │ ├── startup.h │ │ └── wl_fw.h │ └── wifi_dnld.cproj │ └── wifishield.atsln ├── libraries ├── EEPROM │ ├── EEPROM.cpp │ ├── EEPROM.h │ ├── examples │ │ ├── eeprom_clear │ │ │ └── eeprom_clear.ino │ │ ├── eeprom_read │ │ │ └── eeprom_read.ino │ │ └── eeprom_write │ │ │ └── eeprom_write.ino │ ├── keywords.txt │ └── library.properties ├── SPI │ ├── SPI.cpp │ ├── SPI.h │ ├── examples │ │ ├── BarometricPressureSensor │ │ │ └── BarometricPressureSensor.ino │ │ └── DigitalPotControl │ │ │ └── DigitalPotControl.ino │ ├── keywords.txt │ └── library.properties ├── SoftwareSerial │ ├── SoftwareSerial.cpp │ ├── SoftwareSerial.h │ ├── examples │ │ ├── SoftwareSerialExample │ │ │ └── SoftwareSerialExample.ino │ │ └── TwoPortReceive │ │ │ └── TwoPortReceive.ino │ ├── keywords.txt │ └── library.properties ├── TimerOne │ ├── TimerOne.cpp │ └── TimerOne.h ├── Wire │ ├── Wire.cpp │ ├── Wire.h │ ├── 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 │ └── utility │ │ ├── twi.cpp │ │ └── twi.h └── sram │ ├── sram.cpp │ └── sram.h ├── platform.txt ├── programmers.txt └── variants ├── panstamp └── pins_arduino.h └── panstamp_avr_2.0 └── pins_arduino.h /boards.txt: -------------------------------------------------------------------------------- 1 | # See: http://code.google.com/p/arduino/wiki/Platforms 2 | 3 | menu.cpu=Processor 4 | 5 | ############################################################## 6 | avr2.name=panStamp AVR 2 w/ atmega328p 7 | 8 | avr2.upload.tool=avrdude 9 | avr2.upload.protocol=arduino 10 | avr2.upload.maximum_data_size=2048 11 | avr2.upload.maximum_size=32256 12 | avr2.upload.speed=57600 13 | 14 | avr2.build.core=panstamp 15 | avr2.build.mcu=atmega328p 16 | avr2.build.f_cpu=8000000L 17 | avr2.build.variant=panstamp_avr_2.0 18 | avr2.build.board=PANSTAMP_AVR 19 | 20 | ############################################################## 21 | avr1.name=panStamp AVR 1 w/ atmega328p 22 | 23 | avr1.upload.tool=avrdude 24 | avr1.upload.protocol=arduino 25 | avr1.upload.maximum_data_size=2048 26 | avr1.upload.maximum_size=32256 27 | avr1.upload.speed=57600 28 | 29 | avr1.build.core=panstamp 30 | avr1.build.mcu=atmega328p 31 | avr1.build.f_cpu=8000000L 32 | avr1.build.variant=panstamp 33 | avr1.build.board=PANSTAMP_AVR 34 | 35 | ############################################################## 36 | 37 | -------------------------------------------------------------------------------- /cores/panstamp/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/panstamp/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 the first UART" 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 the first UART" 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/panstamp/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(USART_RX_vect) 40 | ISR(USART_RX_vect) 41 | #elif defined(USART1_RX_vect) 42 | ISR(USART1_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 the first UART" 47 | #endif 48 | { 49 | Serial1._rx_complete_irq(); 50 | } 51 | 52 | #if defined(UART1_UDRE_vect) 53 | ISR(UART1_UDRE_vect) 54 | #elif defined(UART_UDRE_vect) 55 | ISR(UART_UDRE_vect) 56 | #elif defined(USART1_UDRE_vect) 57 | ISR(USART1_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 the first UART" 62 | #endif 63 | { 64 | Serial1._tx_udr_empty_irq(); 65 | } 66 | 67 | #if defined(UBRRH) && defined(UBRRL) 68 | HardwareSerial Serial1(&UBRRH, &UBRRL, &UCSRA, &UCSRB, &UCSRC, &UDR); 69 | #else 70 | HardwareSerial Serial1(&UBRR1H, &UBRR1L, &UCSR1A, &UCSR1B, &UCSR1C, &UDR1); 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 Serial1_available() { 76 | return Serial1.available(); 77 | } 78 | 79 | #endif // HAVE_HWSERIAL1 80 | -------------------------------------------------------------------------------- /cores/panstamp/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 | #if defined(USART_RX_vect) 40 | ISR(USART_RX_vect) 41 | #elif defined(USART2_RX_vect) 42 | ISR(USART2_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 the first UART" 47 | #endif 48 | { 49 | Serial2._rx_complete_irq(); 50 | } 51 | 52 | #if defined(UART2_UDRE_vect) 53 | ISR(UART2_UDRE_vect) 54 | #elif defined(UART_UDRE_vect) 55 | ISR(UART_UDRE_vect) 56 | #elif defined(USART2_UDRE_vect) 57 | ISR(USART2_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 the first UART" 62 | #endif 63 | { 64 | Serial2._tx_udr_empty_irq(); 65 | } 66 | 67 | #if defined(UBRRH) && defined(UBRRL) 68 | HardwareSerial Serial2(&UBRRH, &UBRRL, &UCSRA, &UCSRB, &UCSRC, &UDR); 69 | #else 70 | HardwareSerial Serial2(&UBRR2H, &UBRR2L, &UCSR2A, &UCSR2B, &UCSR2C, &UDR2); 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 Serial2_available() { 76 | return Serial2.available(); 77 | } 78 | 79 | #endif // HAVE_HWSERIAL2 80 | -------------------------------------------------------------------------------- /cores/panstamp/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 | #if defined(USART_RX_vect) 40 | ISR(USART_RX_vect) 41 | #elif defined(USART3_RX_vect) 42 | ISR(USART3_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 the first UART" 47 | #endif 48 | { 49 | Serial3._rx_complete_irq(); 50 | } 51 | 52 | #if defined(UART3_UDRE_vect) 53 | ISR(UART3_UDRE_vect) 54 | #elif defined(UART_UDRE_vect) 55 | ISR(UART_UDRE_vect) 56 | #elif defined(USART3_UDRE_vect) 57 | ISR(USART3_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 the first UART" 62 | #endif 63 | { 64 | Serial3._tx_udr_empty_irq(); 65 | } 66 | 67 | #if defined(UBRRH) && defined(UBRRL) 68 | HardwareSerial Serial3(&UBRRH, &UBRRL, &UCSRA, &UCSRB, &UCSRC, &UDR); 69 | #else 70 | HardwareSerial Serial3(&UBRR3H, &UBRR3L, &UCSR3A, &UCSR3B, &UCSR3C, &UDR3); 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 Serial3_available() { 76 | return Serial3.available(); 77 | } 78 | 79 | #endif // HAVE_HWSERIAL3 80 | -------------------------------------------------------------------------------- /cores/panstamp/IPAddress.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | IPAddress.cpp - Base class that provides IPAddress 3 | Copyright (c) 2011 Adrian McEwen. All right reserved. 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | */ 19 | 20 | #include 21 | #include 22 | #include 23 | 24 | IPAddress::IPAddress() 25 | { 26 | _address.dword = 0; 27 | } 28 | 29 | IPAddress::IPAddress(uint8_t first_octet, uint8_t second_octet, uint8_t third_octet, uint8_t fourth_octet) 30 | { 31 | _address.bytes[0] = first_octet; 32 | _address.bytes[1] = second_octet; 33 | _address.bytes[2] = third_octet; 34 | _address.bytes[3] = fourth_octet; 35 | } 36 | 37 | IPAddress::IPAddress(uint32_t address) 38 | { 39 | _address.dword = address; 40 | } 41 | 42 | IPAddress::IPAddress(const uint8_t *address) 43 | { 44 | memcpy(_address.bytes, address, sizeof(_address.bytes)); 45 | } 46 | 47 | IPAddress& IPAddress::operator=(const uint8_t *address) 48 | { 49 | memcpy(_address.bytes, address, sizeof(_address.bytes)); 50 | return *this; 51 | } 52 | 53 | IPAddress& IPAddress::operator=(uint32_t address) 54 | { 55 | _address.dword = address; 56 | return *this; 57 | } 58 | 59 | bool IPAddress::operator==(const uint8_t* addr) const 60 | { 61 | return memcmp(addr, _address.bytes, sizeof(_address.bytes)) == 0; 62 | } 63 | 64 | size_t IPAddress::printTo(Print& p) const 65 | { 66 | size_t n = 0; 67 | for (int i =0; i < 3; i++) 68 | { 69 | n += p.print(_address.bytes[i], DEC); 70 | n += p.print('.'); 71 | } 72 | n += p.print(_address.bytes[3], DEC); 73 | return n; 74 | } 75 | 76 | -------------------------------------------------------------------------------- /cores/panstamp/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 25 | 26 | // A class to make it easier to handle and pass around IP addresses 27 | 28 | class IPAddress : public Printable { 29 | private: 30 | union { 31 | uint8_t bytes[4]; // IPv4 address 32 | uint32_t dword; 33 | } _address; 34 | 35 | // Access the raw byte array containing the address. Because this returns a pointer 36 | // to the internal structure rather than a copy of the address this function should only 37 | // be used when you know that the usage of the returned uint8_t* will be transient and not 38 | // stored. 39 | uint8_t* raw_address() { return _address.bytes; }; 40 | 41 | public: 42 | // Constructors 43 | IPAddress(); 44 | IPAddress(uint8_t first_octet, uint8_t second_octet, uint8_t third_octet, uint8_t fourth_octet); 45 | IPAddress(uint32_t address); 46 | IPAddress(const uint8_t *address); 47 | 48 | // Overloaded cast operator to allow IPAddress objects to be used where a pointer 49 | // to a four-byte uint8_t array is expected 50 | operator uint32_t() const { return _address.dword; }; 51 | bool operator==(const IPAddress& addr) const { return _address.dword == addr._address.dword; }; 52 | bool operator==(const uint8_t* addr) const; 53 | 54 | // Overloaded index operator to allow getting and setting individual octets of the address 55 | uint8_t operator[](int index) const { return _address.bytes[index]; }; 56 | uint8_t& operator[](int index) { return _address.bytes[index]; }; 57 | 58 | // Overloaded copy operators to allow initialisation of IPAddress objects from other types 59 | IPAddress& operator=(const uint8_t *address); 60 | IPAddress& operator=(uint32_t address); 61 | 62 | virtual size_t printTo(Print& p) const; 63 | 64 | friend class EthernetClass; 65 | friend class UDP; 66 | friend class Client; 67 | friend class Server; 68 | friend class DhcpClass; 69 | friend class DNSClient; 70 | }; 71 | 72 | const IPAddress INADDR_NONE(0,0,0,0); 73 | 74 | 75 | #endif 76 | -------------------------------------------------------------------------------- /cores/panstamp/Print.h: -------------------------------------------------------------------------------- 1 | /* 2 | Print.h - Base class that provides print() and println() 3 | Copyright (c) 2008 David A. Mellis. All right reserved. 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | */ 19 | 20 | #ifndef Print_h 21 | #define Print_h 22 | 23 | #include 24 | #include // for size_t 25 | 26 | #include "WString.h" 27 | #include "Printable.h" 28 | 29 | #define DEC 10 30 | #define HEX 16 31 | #define OCT 8 32 | #define BIN 2 33 | 34 | class Print 35 | { 36 | private: 37 | int write_error; 38 | size_t printNumber(unsigned long, uint8_t); 39 | size_t printFloat(double, uint8_t); 40 | protected: 41 | void setWriteError(int err = 1) { write_error = err; } 42 | public: 43 | Print() : write_error(0) {} 44 | 45 | int getWriteError() { return write_error; } 46 | void clearWriteError() { setWriteError(0); } 47 | 48 | virtual size_t write(uint8_t) = 0; 49 | size_t write(const char *str) { 50 | if (str == NULL) return 0; 51 | return write((const uint8_t *)str, strlen(str)); 52 | } 53 | virtual size_t write(const uint8_t *buffer, size_t size); 54 | size_t write(const char *buffer, size_t size) { 55 | return write((const uint8_t *)buffer, size); 56 | } 57 | 58 | size_t print(const __FlashStringHelper *); 59 | size_t print(const String &); 60 | size_t print(const char[]); 61 | size_t print(char); 62 | size_t print(unsigned char, int = DEC); 63 | size_t print(int, int = DEC); 64 | size_t print(unsigned int, int = DEC); 65 | size_t print(long, int = DEC); 66 | size_t print(unsigned long, int = DEC); 67 | size_t print(double, int = 2); 68 | size_t print(const Printable&); 69 | 70 | size_t println(const __FlashStringHelper *); 71 | size_t println(const String &s); 72 | size_t println(const char[]); 73 | size_t println(char); 74 | size_t println(unsigned char, int = DEC); 75 | size_t println(int, int = DEC); 76 | size_t println(unsigned int, int = DEC); 77 | size_t println(long, int = DEC); 78 | size_t println(unsigned long, int = DEC); 79 | size_t println(double, int = 2); 80 | size_t println(const Printable&); 81 | size_t println(void); 82 | }; 83 | 84 | #endif 85 | -------------------------------------------------------------------------------- /cores/panstamp/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 | #include 25 | 26 | class Print; 27 | 28 | /** The Printable class provides a way for new classes to allow themselves to be printed. 29 | By deriving from Printable and implementing the printTo method, it will then be possible 30 | for users to print out instances of this class by passing them into the usual 31 | Print::print and Print::println methods. 32 | */ 33 | 34 | class Printable 35 | { 36 | public: 37 | virtual size_t printTo(Print& p) const = 0; 38 | }; 39 | 40 | #endif 41 | 42 | -------------------------------------------------------------------------------- /cores/panstamp/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 | class Server : public Print { 24 | public: 25 | virtual void begin() =0; 26 | }; 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /cores/panstamp/TODO.txt: -------------------------------------------------------------------------------- 1 | - Add absolute date/time functions in CC430RTC class 2 | - Hardware encryption 3 | - MAC address 4 | - Wireless firmware upload 5 | - MMA8652 library 6 | - SPI class 7 | -------------------------------------------------------------------------------- /cores/panstamp/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 | $Id$ 24 | */ 25 | 26 | extern "C" { 27 | #include "stdlib.h" 28 | } 29 | 30 | void randomSeed(unsigned int seed) 31 | { 32 | if (seed != 0) { 33 | srandom(seed); 34 | } 35 | } 36 | 37 | long random(long howbig) 38 | { 39 | if (howbig == 0) { 40 | return 0; 41 | } 42 | return random() % howbig; 43 | } 44 | 45 | long random(long howsmall, long howbig) 46 | { 47 | if (howsmall >= howbig) { 48 | return howsmall; 49 | } 50 | long diff = howbig - howsmall; 51 | return random(diff) + howsmall; 52 | } 53 | 54 | long map(long x, long in_min, long in_max, long out_min, long out_max) 55 | { 56 | return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min; 57 | } 58 | 59 | unsigned int makeWord(unsigned int w) { return w; } 60 | unsigned int makeWord(unsigned char h, unsigned char l) { return (h << 8) | l; } -------------------------------------------------------------------------------- /cores/panstamp/calibration.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2011 panStamp 3 | * 4 | * This file is part of the panStamp project. 5 | * 6 | * panStamp is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation; either version 3 of the License, or 9 | * any later version. 10 | * 11 | * panStamp is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with panStamp; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 19 | * USA 20 | * 21 | * Author: Daniel Berenguer 22 | * Creation date: 11/13/2012 23 | */ 24 | 25 | #ifndef _CALIBRATION_H 26 | #define _CALIBRATION_H 27 | 28 | /** 29 | * Calibration thresholds 30 | */ 31 | #define TARGETCOUNT_MIN 62450 // Calibration target MIN 32 | #define TARGETCOUNT_MAX 62550 // Calibration target MAX 33 | 34 | /** 35 | * rcOscCalibrate 36 | * 37 | * Calibrate internal RC oscillator 38 | * 39 | * Return: 40 | * true : calibration successfully done 41 | * false : unable to complete calibration 42 | */ 43 | bool rcOscCalibrate(void); 44 | 45 | #endif 46 | 47 | -------------------------------------------------------------------------------- /cores/panstamp/ccpacket.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2011 panStamp 3 | * 4 | * This file is part of the panStamp project. 5 | * 6 | * panStamp is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation; either version 3 of the License, or 9 | * any later version. 10 | * 11 | * panStamp is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with panStamp; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 19 | * USA 20 | * 21 | * Author: Daniel Berenguer 22 | * Creation date: 06/03/2013 23 | */ 24 | 25 | #ifndef _CCPACKET_H 26 | #define _CCPACKET_H 27 | 28 | /** 29 | * Buffer and data lengths 30 | */ 31 | #define CCPACKET_BUFFER_LEN 64 32 | #define CCPACKET_DATA_LEN CCPACKET_BUFFER_LEN - 3 33 | 34 | /** 35 | * Class: CCPACKET 36 | * 37 | * Description: 38 | * CC1101 data packet class 39 | */ 40 | struct CCPACKET 41 | { 42 | public: 43 | /** 44 | * Data length 45 | */ 46 | unsigned char length; 47 | 48 | /** 49 | * Data buffer 50 | */ 51 | unsigned char data[CCPACKET_DATA_LEN]; 52 | 53 | /** 54 | * CRC OK flag 55 | */ 56 | bool crc_ok; 57 | 58 | /** 59 | * Received Strength Signal Indication 60 | */ 61 | unsigned char rssi; 62 | 63 | /** 64 | * Link Quality Index 65 | */ 66 | unsigned char lqi; 67 | }; 68 | 69 | #endif 70 | 71 | -------------------------------------------------------------------------------- /cores/panstamp/datatypes.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2011 panStamp 3 | * 4 | * This file is part of the panStamp project. 5 | * 6 | * panStamp is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation; either version 3 of the License, or 9 | * any later version. 10 | * 11 | * panStamp is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with panStamp; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 19 | * USA 20 | * 21 | * Author: Daniel Berenguer 22 | * Creation date: 06/27/2013 23 | */ 24 | 25 | #ifndef _DATATYPES_H 26 | #define _DATATYPES_H 27 | 28 | #include "config.h" 29 | 30 | #ifdef SWAP_EXTENDED_ADDRESS 31 | #define SWADDR unsigned int 32 | #else 33 | #define SWADDR unsigned char 34 | #endif 35 | 36 | /** 37 | * SWDTYPE : Type of data contained in SWAP register 38 | */ 39 | typedef enum SWDTYPE// : unsigned char 40 | { 41 | SWDTYPE_INTEGER = 0, // Register containing a single 1-to-4 byte integer 42 | SWDTYPE_OTHER // Other type of register contents 43 | } SWDTYPE; 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /cores/panstamp/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/panstamp/keywords.txt: -------------------------------------------------------------------------------- 1 | ####################################### 2 | # Syntax Coloring Map panStamp 3 | ####################################### 4 | 5 | ####################################### 6 | # Datatypes (KEYWORD1) 7 | ####################################### 8 | CC1101 KEYWORD1 9 | CCPACKET KEYWORD1 10 | CARRIER_FREQ KEYWORD1 11 | SWPACKET KEYWORD1 12 | ENDPOINT KEYWORD1 13 | PANSTAMP KEYWORD1 14 | 15 | ####################################### 16 | # Methods and Functions (KEYWORD2) 17 | ####################################### 18 | init KEYWORD2 19 | reset KEYWORD2 20 | wakeUp KEYWORD2 21 | goToSleep KEYWORD2 22 | enterSystemState KEYWORD2 23 | setSyncWord KEYWORD2 24 | setDevAddress KEYWORD2 25 | setCarrierFreq KEYWORD2 26 | setChannel KEYWORD2 27 | setSecurity KEYWORD2 28 | setTxInterval KEYWORD2 29 | setSwapStatusCallBack KEYWORD2 30 | setRxState KEYWORD2 31 | setPowerDownState KEYWORD2 32 | sendData KEYWORD2 33 | receiveData KEYWORD2 34 | disableAddressCheck KEYWORD2 35 | sleepFor KEYWORD2 36 | getData KEYWORD2 37 | setData KEYWORD2 38 | sendSwapStatus KEYWORD2 39 | getRegister KEYWORD2 40 | rcOscCalibrate KEYWORD2 41 | 42 | ####################################### 43 | # Atributes (KEYWORD2) 44 | ####################################### 45 | carrierFreq KEYWORD2 46 | channel KEYWORD2 47 | syncWord KEYWORD2 48 | devAddress KEYWORD2 49 | 50 | ####################################### 51 | # Constants (LITERAL1) 52 | ####################################### 53 | CFREQ_868 LITERAL1 54 | CFREQ_915 LITERAL1 55 | 56 | -------------------------------------------------------------------------------- /cores/panstamp/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 | int main(void) 23 | { 24 | init(); 25 | 26 | setup(); 27 | 28 | for (;;) { 29 | loop(); 30 | //if (serialEventRun) serialEventRun(); 31 | } 32 | 33 | return 0; 34 | } 35 | 36 | -------------------------------------------------------------------------------- /cores/panstamp/new.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | void * operator new(size_t size) 4 | { 5 | return malloc(size); 6 | } 7 | 8 | void * operator new[](size_t size) 9 | { 10 | return malloc(size); 11 | } 12 | 13 | void operator delete(void * ptr) 14 | { 15 | free(ptr); 16 | } 17 | 18 | void operator delete[](void * ptr) 19 | { 20 | free(ptr); 21 | } 22 | 23 | int __cxa_guard_acquire(__guard *g) {return !*(char *)(g);}; 24 | void __cxa_guard_release (__guard *g) {*(char *)g = 1;}; 25 | void __cxa_guard_abort (__guard *) {}; 26 | 27 | void __cxa_pure_virtual(void) {}; 28 | 29 | -------------------------------------------------------------------------------- /cores/panstamp/new.h: -------------------------------------------------------------------------------- 1 | /* Header to define new/delete operators as they aren't provided by avr-gcc by default 2 | Taken from http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&t=59453 3 | */ 4 | 5 | #ifndef NEW_H 6 | #define NEW_H 7 | 8 | #include 9 | 10 | void * operator new(size_t size); 11 | void * operator new[](size_t size); 12 | void operator delete(void * ptr); 13 | void operator delete[](void * ptr); 14 | 15 | __extension__ typedef int __guard __attribute__((mode (__DI__))); 16 | 17 | extern "C" int __cxa_guard_acquire(__guard *); 18 | extern "C" void __cxa_guard_release (__guard *); 19 | extern "C" void __cxa_guard_abort (__guard *); 20 | 21 | extern "C" void __cxa_pure_virtual(void); 22 | 23 | #endif 24 | 25 | -------------------------------------------------------------------------------- /cores/panstamp/simplespi.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2011 panStamp 3 | * 4 | * This file is part of the panStamp project. 5 | * 6 | * panStamp is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation; either version 3 of the License, or 9 | * any later version. 10 | * 11 | * panStamp is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with panStamp; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 19 | * USA 20 | * 21 | * Author: Daniel Berenguer 22 | * Creation date: 03/03/2011 23 | */ 24 | 25 | #include "simplespi.h" 26 | #include 27 | 28 | /** 29 | * init 30 | * 31 | * SPI initialization 32 | */ 33 | void SIMPLESPI::init() 34 | { 35 | digitalWrite(SPI_SS, HIGH); 36 | 37 | // Configure SPI pins 38 | pinMode(SPI_SS, OUTPUT); 39 | pinMode(SPI_MOSI, OUTPUT); 40 | pinMode(SPI_MISO, INPUT); 41 | pinMode(SPI_SCK, OUTPUT); 42 | 43 | digitalWrite(SPI_SCK, HIGH); 44 | digitalWrite(SPI_MOSI, LOW); 45 | 46 | // SPI speed = clk/4 47 | SPCR = _BV(SPE) | _BV(MSTR); 48 | } 49 | 50 | /** 51 | * send 52 | * 53 | * Send byte via SPI 54 | * 55 | * 'value' Value to be sent 56 | * 57 | * Return: 58 | * Response received from SPI slave 59 | */ 60 | byte SIMPLESPI::send(byte value) 61 | { 62 | SPDR = value; // Transfer byte via SPI 63 | wait_Spi(); // Wait until SPI operation is terminated 64 | 65 | return SPDR; 66 | } 67 | 68 | -------------------------------------------------------------------------------- /cores/panstamp/simplespi.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2011 panStamp 3 | * 4 | * This file is part of the panStamp project. 5 | * 6 | * panStamp is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation; either version 3 of the License, or 9 | * any later version. 10 | * 11 | * panStamp is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with panStamp; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 19 | * USA 20 | * 21 | * Author: Daniel Berenguer 22 | * Creation date: 03/03/2011 23 | */ 24 | 25 | #ifndef _SIMPLESPI_H 26 | #define _SIMPLESPI_H 27 | 28 | #include 29 | 30 | /** 31 | * SPI pins 32 | */ 33 | 34 | #if defined(__AVR_ATmega2560__) || defined(__AVR_ATmega1280__) 35 | 36 | #define SPI_SS 53 // PB0 = SPI_SS 37 | #define SPI_MOSI 51 // PB2 = MOSI 38 | #define SPI_MISO 50 // PB3 = MISO 39 | #define SPI_SCK 52 // PB1 = SCK 40 | #define GDO0 2 // PD4 = INT4 41 | 42 | #define PORT_SPI_MISO PINB 43 | #define BIT_SPI_MISO 3 44 | 45 | #define PORT_SPI_SS PORTB 46 | #define BIT_SPI_SS 0 47 | 48 | #define PORT_GDO0 PINE 49 | #define BIT_GDO0 4 50 | 51 | #else 52 | 53 | #define SPI_SS CC1101_SPI_SS // PB2 = SPI_SS 54 | #define SPI_MOSI MOSI // PB3 = MOSI 55 | #define SPI_MISO MISO // PB4 = MISO 56 | #define SPI_SCK SCK // PB5 = SCK 57 | #define GDO0 CC1101_GDO0 // PD2 = INT0 58 | 59 | #define PORT_SPI_MISO PINB 60 | #define BIT_SPI_MISO 4 61 | 62 | #define PORT_SPI_SS PORTB 63 | #define BIT_SPI_SS 2 64 | 65 | #define PORT_GDO0 PIND 66 | #define BIT_GDO0 2 67 | 68 | #endif 69 | 70 | /** 71 | * Macros 72 | */ 73 | // Wait until SPI operation is terminated 74 | #define wait_Spi() while(!(SPSR & _BV(SPIF))) 75 | 76 | /** 77 | * Class: SIMPLESPI 78 | * 79 | * Description: 80 | * Basic SPI class 81 | */ 82 | class SIMPLESPI 83 | { 84 | public: 85 | /** 86 | * init 87 | * 88 | * SPI initialization 89 | */ 90 | void init(); 91 | 92 | /** 93 | * send 94 | * 95 | * Send byte via SPI 96 | * 97 | * 'value' Value to be sent 98 | * 99 | * Return: 100 | * Response received from SPI slave 101 | */ 102 | uint8_t send(uint8_t value); 103 | }; 104 | #endif 105 | -------------------------------------------------------------------------------- /cores/panstamp/storage.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2014 panStamp 3 | * 4 | * This file is part of the panStamp project. 5 | * 6 | * panStamp is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation; either version 3 of the License, or 9 | * any later version. 10 | * 11 | * panStamp is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with panStamp; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 19 | * USA 20 | * 21 | * Author: Daniel Berenguer 22 | * Creation date: 07/23/2014 23 | */ 24 | 25 | #include 26 | #include "Arduino.h" 27 | #include "storage.h" 28 | 29 | /** 30 | * read 31 | * 32 | * Read buffer from info memory 33 | * 34 | * @param buffer pointer to the buffer where to write the result 35 | * @param section storage media or bank (0 for internal EEPROM) 36 | * @param position position in section 37 | * @pararm length Length to be read 38 | * 39 | * @return amount of bytes read 40 | */ 41 | uint8_t STORAGE::read(uint8_t *buffer, uint8_t section, uint8_t position, uint8_t length) 42 | { 43 | uint16_t i = 0; 44 | 45 | if (section == 0) 46 | { 47 | cli(); 48 | for (i=0 ; i 3 | * 4 | * This file is part of the panStamp project. 5 | * 6 | * panStamp is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU Lesser General Public License as published by 8 | * the Free Software Foundation; either version 3 of the License, or 9 | * any later version. 10 | * 11 | * panStamp is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU Lesser General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU Lesser General Public License 17 | * along with panStamp; if not, write to the Free Software 18 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 19 | * USA 20 | * 21 | * Author: Daniel Berenguer 22 | * Creation date: 07/23/2014 23 | */ 24 | 25 | #ifndef STORAGE_h 26 | #define STORAGE_h 27 | 28 | #include "Arduino.h" 29 | 30 | #define DEFAULT_NVOLAT_SECTION 0 31 | 32 | class STORAGE 33 | { 34 | public: 35 | /** 36 | * read 37 | * 38 | * Read buffer from info memory 39 | * 40 | * @param buffer pointer to the buffer where to write the result 41 | * @param section storage media or bank (1 for internal EEPROM) 42 | * @param position position in section 43 | * @pararm length Length to be read 44 | * 45 | * @return amount of bytes read 46 | */ 47 | uint8_t read(uint8_t *buffer, uint8_t section, uint8_t position, uint8_t length); 48 | 49 | /** 50 | * write 51 | * 52 | * Write buffer in info memory 53 | * 54 | * @param buffer array to be written 55 | * @param section storage media or bank (1 for internal EEPROM) 56 | * @param position position in section 57 | * @pararm length Length to be written 58 | * 59 | * @return amount of bytes copied 60 | */ 61 | uint8_t write(uint8_t *buffer, uint8_t section, uint8_t position, uint8_t length); 62 | }; 63 | 64 | #endif 65 | 66 | -------------------------------------------------------------------------------- /cores/panstamp/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 | $Id: wiring.h 239 2007-01-12 17:58:39Z mellis $ 23 | */ 24 | 25 | #ifndef WiringPrivate_h 26 | #define WiringPrivate_h 27 | 28 | #include 29 | #include 30 | #include 31 | #include 32 | 33 | #include "Arduino.h" 34 | 35 | #ifdef __cplusplus 36 | extern "C"{ 37 | #endif 38 | 39 | #ifndef cbi 40 | #define cbi(sfr, bit) (_SFR_BYTE(sfr) &= ~_BV(bit)) 41 | #endif 42 | #ifndef sbi 43 | #define sbi(sfr, bit) (_SFR_BYTE(sfr) |= _BV(bit)) 44 | #endif 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__) 56 | #define EXTERNAL_NUM_INTERRUPTS 8 57 | #elif defined(__AVR_ATmega1284__) || defined(__AVR_ATmega1284P__) || defined(__AVR_ATmega644__) || defined(__AVR_ATmega644A__) || defined(__AVR_ATmega644P__) || defined(__AVR_ATmega644PA__) 58 | #define EXTERNAL_NUM_INTERRUPTS 3 59 | #elif defined(__AVR_ATmega32U4__) 60 | #define EXTERNAL_NUM_INTERRUPTS 5 61 | #else 62 | #define EXTERNAL_NUM_INTERRUPTS 2 63 | #endif 64 | 65 | typedef void (*voidFuncPtr)(void); 66 | 67 | #ifdef __cplusplus 68 | } // extern "C" 69 | #endif 70 | 71 | #endif 72 | -------------------------------------------------------------------------------- /cores/panstamp/wiring_pulse.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | wiring_pulse.c - pulseIn() function 3 | Part of Arduino - http://www.arduino.cc/ 4 | 5 | Copyright (c) 2005-2006 David A. Mellis 6 | 7 | This library is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU Lesser General Public 9 | License as published by the Free Software Foundation; either 10 | version 2.1 of the License, or (at your option) any later version. 11 | 12 | This library is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | Lesser General Public License for more details. 16 | 17 | You should have received a copy of the GNU Lesser General 18 | Public License along with this library; if not, write to the 19 | Free Software Foundation, Inc., 59 Temple Place, Suite 330, 20 | Boston, MA 02111-1307 USA 21 | 22 | $Id: wiring.c 248 2007-02-03 15:36:30Z mellis $ 23 | */ 24 | 25 | #include "wiring_private.h" 26 | #include "pins_arduino.h" 27 | 28 | /* Measures the length (in microseconds) of a pulse on the pin; state is HIGH 29 | * or LOW, the type of pulse to measure. Works on pulses from 2-3 microseconds 30 | * to 3 minutes in length, but must be called at least a few dozen microseconds 31 | * before the start of the pulse. */ 32 | unsigned long pulseIn(uint8_t pin, uint8_t state, unsigned long timeout) 33 | { 34 | // cache the port and bit of the pin in order to speed up the 35 | // pulse width measuring loop and achieve finer resolution. calling 36 | // digitalRead() instead yields much coarser resolution. 37 | uint8_t bit = digitalPinToBitMask(pin); 38 | uint8_t port = digitalPinToPort(pin); 39 | uint8_t stateMask = (state ? bit : 0); 40 | unsigned long width = 0; // keep initialization out of time critical area 41 | 42 | // convert the timeout from microseconds to a number of times through 43 | // the initial loop; it takes 16 clock cycles per iteration. 44 | unsigned long numloops = 0; 45 | unsigned long maxloops = microsecondsToClockCycles(timeout) / 16; 46 | 47 | // wait for any previous pulse to end 48 | while ((*portInputRegister(port) & bit) == stateMask) 49 | if (numloops++ == maxloops) 50 | return 0; 51 | 52 | // wait for the pulse to start 53 | while ((*portInputRegister(port) & bit) != stateMask) 54 | if (numloops++ == maxloops) 55 | return 0; 56 | 57 | // wait for the pulse to stop 58 | while ((*portInputRegister(port) & bit) == stateMask) { 59 | if (numloops++ == maxloops) 60 | return 0; 61 | width++; 62 | } 63 | 64 | // convert the reading to microseconds. The loop has been determined 65 | // to be 20 clock cycles long and have about 16 clocks between the edge 66 | // and the start of the loop. There will be some error introduced by 67 | // the interrupt handlers. 68 | return clockCyclesToMicroseconds(width * 21 + 16); 69 | } 70 | -------------------------------------------------------------------------------- /cores/panstamp/wiring_shift.cpp: -------------------------------------------------------------------------------- 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 | $Id: wiring.c 248 2007-02-03 15:36:30Z mellis $ 23 | */ 24 | 25 | #include "wiring_private.h" 26 | 27 | uint8_t shiftIn(uint8_t dataPin, uint8_t clockPin, uint8_t bitOrder) { 28 | uint8_t value = 0; 29 | uint8_t i; 30 | 31 | for (i = 0; i < 8; ++i) { 32 | digitalWrite(clockPin, HIGH); 33 | if (bitOrder == LSBFIRST) 34 | value |= digitalRead(dataPin) << i; 35 | else 36 | value |= digitalRead(dataPin) << (7 - i); 37 | digitalWrite(clockPin, LOW); 38 | } 39 | return value; 40 | } 41 | 42 | void shiftOut(uint8_t dataPin, uint8_t clockPin, uint8_t bitOrder, uint8_t val) 43 | { 44 | uint8_t i; 45 | 46 | for (i = 0; i < 8; i++) { 47 | if (bitOrder == LSBFIRST) 48 | digitalWrite(dataPin, !!(val & (1 << i))); 49 | else 50 | digitalWrite(dataPin, !!(val & (1 << (7 - i)))); 51 | 52 | digitalWrite(clockPin, HIGH); 53 | digitalWrite(clockPin, LOW); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /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/panStamp/arduino_avr/1160c70488d4962abb3901a800e577938d7e6ec0/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/panStamp/arduino_avr/1160c70488d4962abb3901a800e577938d7e6ec0/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/wifishield/binary/wifiHD.elf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panStamp/arduino_avr/1160c70488d4962abb3901a800e577938d7e6ec0/firmwares/wifishield/binary/wifiHD.elf -------------------------------------------------------------------------------- /firmwares/wifishield/binary/wifiHD_2_1.elf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panStamp/arduino_avr/1160c70488d4962abb3901a800e577938d7e6ec0/firmwares/wifishield/binary/wifiHD_2_1.elf -------------------------------------------------------------------------------- /firmwares/wifishield/binary/wifi_dnld.elf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panStamp/arduino_avr/1160c70488d4962abb3901a800e577938d7e6ec0/firmwares/wifishield/binary/wifi_dnld.elf -------------------------------------------------------------------------------- /firmwares/wifishield/binary/wifi_dnld_2_1.elf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panStamp/arduino_avr/1160c70488d4962abb3901a800e577938d7e6ec0/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/firmwares/wifi-shield" 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/panStamp/arduino_avr/1160c70488d4962abb3901a800e577938d7e6ec0/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/panStamp/arduino_avr/1160c70488d4962abb3901a800e577938d7e6ec0/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/panStamp/arduino_avr/1160c70488d4962abb3901a800e577938d7e6ec0/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/panStamp/arduino_avr/1160c70488d4962abb3901a800e577938d7e6ec0/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/panStamp/arduino_avr/1160c70488d4962abb3901a800e577938d7e6ec0/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/panStamp/arduino_avr/1160c70488d4962abb3901a800e577938d7e6ec0/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/panStamp/arduino_avr/1160c70488d4962abb3901a800e577938d7e6ec0/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/DELAY/delay.c: -------------------------------------------------------------------------------- 1 | /* This source file is part of the ATMEL AVR-UC3-SoftwareFramework-1.7.0 Release */ 2 | 3 | /*This file is prepared for Doxygen automatic documentation generation.*/ 4 | /*! \file ****************************************************************** 5 | * 6 | * \brief Management of the delays. 7 | * 8 | * This file manages the "delays", with or without an OS. 9 | * 10 | * - Compiler: IAR EWAVR32 and GNU GCC for AVR32 11 | * - Supported devices: All AVR32 devices. 12 | * - AppNote: 13 | * 14 | * \author Atmel Corporation: http://www.atmel.com \n 15 | * Support and FAQ: http://support.atmel.no/ 16 | * 17 | ***************************************************************************/ 18 | 19 | /* Copyright (c) 2009 Atmel Corporation. All rights reserved. 20 | * 21 | * Redistribution and use in source and binary forms, with or without 22 | * modification, are permitted provided that the following conditions are met: 23 | * 24 | * 1. Redistributions of source code must retain the above copyright notice, this 25 | * list of conditions and the following disclaimer. 26 | * 27 | * 2. Redistributions in binary form must reproduce the above copyright notice, 28 | * this list of conditions and the following disclaimer in the documentation 29 | * and/or other materials provided with the distribution. 30 | * 31 | * 3. The name of Atmel may not be used to endorse or promote products derived 32 | * from this software without specific prior written permission. 33 | * 34 | * 4. This software may only be redistributed and used in connection with an Atmel 35 | * AVR product. 36 | * 37 | * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED 38 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 39 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE 40 | * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR 41 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 42 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 43 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 44 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 45 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 46 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE 47 | * 48 | */ 49 | 50 | //_____ I N C L U D E S ___________________________________________________ 51 | 52 | #include "delay.h" 53 | 54 | 55 | //_____ M A C R O S ________________________________________________________ 56 | 57 | 58 | //_____ D E F I N I T I O N S ______________________________________________ 59 | 60 | //! CPU frequency 61 | #ifndef FREERTOS_USED 62 | static unsigned long s_fcpu_hz; 63 | #endif 64 | #if (defined NUTOS_USED) 65 | extern void NutSleep(unsigned long ms); 66 | #endif 67 | 68 | //_____ D E C L A R A T I O N S ____________________________________________ 69 | 70 | void delay_init(unsigned long fcpu_hz) 71 | { 72 | #ifndef FREERTOS_USED 73 | s_fcpu_hz = fcpu_hz; 74 | #endif 75 | } 76 | 77 | 78 | void delay_ms(unsigned long delay) 79 | { 80 | #if (defined FREERTOS_USED) 81 | vTaskDelay( (portTickType)TASK_DELAY_MS(delay) ); 82 | #elif (defined NUTOS_USED) 83 | NutSleep(delay); 84 | #else 85 | cpu_delay_ms(delay, s_fcpu_hz); 86 | #endif 87 | } 88 | -------------------------------------------------------------------------------- /firmwares/wifishield/wifiHD/src/SOFTWARE_FRAMEWORK/SERVICES/DELAY/delay.h: -------------------------------------------------------------------------------- 1 | /* This header file is part of the ATMEL AVR-UC3-SoftwareFramework-1.7.0 Release */ 2 | 3 | /*This file is prepared for Doxygen automatic documentation generation.*/ 4 | /*! \file ********************************************************************* 5 | * 6 | * \brief AT32UC3 delay management header file. 7 | * 8 | * This file contains definitions and services to handle "delays". 9 | * 10 | * - Compiler: IAR EWAVR32 and GNU GCC for AVR32 11 | * - Supported devices: All AVR32 AT32UC3 devices can be used. 12 | * - AppNote: 13 | * 14 | * \author Atmel Corporation: http://www.atmel.com \n 15 | * Support and FAQ: http://support.atmel.no/ 16 | * 17 | ******************************************************************************/ 18 | 19 | /* Copyright (c) 2009 Atmel Corporation. All rights reserved. 20 | * 21 | * Redistribution and use in source and binary forms, with or without 22 | * modification, are permitted provided that the following conditions are met: 23 | * 24 | * 1. Redistributions of source code must retain the above copyright notice, this 25 | * list of conditions and the following disclaimer. 26 | * 27 | * 2. Redistributions in binary form must reproduce the above copyright notice, 28 | * this list of conditions and the following disclaimer in the documentation 29 | * and/or other materials provided with the distribution. 30 | * 31 | * 3. The name of Atmel may not be used to endorse or promote products derived 32 | * from this software without specific prior written permission. 33 | * 34 | * 4. This software may only be redistributed and used in connection with an Atmel 35 | * AVR product. 36 | * 37 | * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED 38 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 39 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE 40 | * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR 41 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 42 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 43 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 44 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 45 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 46 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE 47 | * 48 | */ 49 | 50 | #ifndef _DELAY_H_ 51 | #define _DELAY_H_ 52 | 53 | #include "compiler.h" 54 | #ifdef FREERTOS_USED 55 | # include "FreeRTOS.h" 56 | # include "task.h" 57 | #else 58 | # include "cycle_counter.h" 59 | #endif 60 | 61 | 62 | /*! 63 | * \brief Initialize the delay driver. 64 | * 65 | * \param fcpu_hz: CPU frequency in Hz. 66 | */ 67 | extern void delay_init(unsigned long fcpu_hz); 68 | 69 | 70 | /*! 71 | * \brief Waits during at least the specified delay (in millisecond) before returning. 72 | * 73 | * Note that in the case of FreeRTOS, the function will delay the current task for a given number of ms. 74 | * 75 | * \param delay: Number of millisecond to wait. 76 | */ 77 | extern void delay_ms(unsigned long delay); 78 | 79 | 80 | #endif // _DELAY_H_ 81 | -------------------------------------------------------------------------------- /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/lwip/init.h: -------------------------------------------------------------------------------- 1 | /* This header file is part of the ATMEL AVR-UC3-SoftwareFramework-1.7.0 Release */ 2 | 3 | /* 4 | * Copyright (c) 2001-2004 Swedish Institute of Computer Science. 5 | * All rights reserved. 6 | * 7 | * Redistribution and use in source and binary forms, with or without modification, 8 | * are permitted provided that the following conditions are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright notice, 11 | * this list of conditions and the following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright notice, 13 | * this list of conditions and the following disclaimer in the documentation 14 | * and/or other materials provided with the distribution. 15 | * 3. The name of the author may not be used to endorse or promote products 16 | * derived from this software without specific prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 19 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 20 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 21 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 22 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 23 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 25 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 26 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 27 | * OF SUCH DAMAGE. 28 | * 29 | * This file is part of the lwIP TCP/IP stack. 30 | * 31 | * Author: Adam Dunkels 32 | * 33 | */ 34 | #ifndef __LWIP_INIT_H__ 35 | #define __LWIP_INIT_H__ 36 | 37 | #include "lwip/opt.h" 38 | 39 | #ifdef __cplusplus 40 | extern "C" { 41 | #endif 42 | 43 | /** X.x.x: Major version of the stack */ 44 | #define LWIP_VERSION_MAJOR 1U 45 | /** x.X.x: Minor version of the stack */ 46 | #define LWIP_VERSION_MINOR 3U 47 | /** x.x.X: Revision of the stack */ 48 | #define LWIP_VERSION_REVISION 2U 49 | /** For release candidates, this is set to 1..254 50 | * For official releases, this is set to 255 (LWIP_RC_RELEASE) 51 | * For development versions (CVS), this is set to 0 (LWIP_RC_DEVELOPMENT) */ 52 | #define LWIP_VERSION_RC 255U 53 | 54 | /** LWIP_VERSION_RC is set to LWIP_RC_RELEASE for official releases */ 55 | #define LWIP_RC_RELEASE 255U 56 | /** LWIP_VERSION_RC is set to LWIP_RC_DEVELOPMENT for CVS versions */ 57 | #define LWIP_RC_DEVELOPMENT 0U 58 | 59 | #define LWIP_VERSION_IS_RELEASE (LWIP_VERSION_RC == LWIP_RC_RELEASE) 60 | #define LWIP_VERSION_IS_DEVELOPMENT (LWIP_VERSION_RC == LWIP_RC_DEVELOPMENT) 61 | #define LWIP_VERSION_IS_RC ((LWIP_VERSION_RC != LWIP_RC_RELEASE) && (LWIP_VERSION_RC != LWIP_RC_DEVELOPMENT)) 62 | 63 | /** Provides the version of the stack */ 64 | #define LWIP_VERSION (LWIP_VERSION_MAJOR << 24 | LWIP_VERSION_MINOR << 16 | \ 65 | LWIP_VERSION_REVISION << 8 | LWIP_VERSION_RC) 66 | 67 | /* Modules initialization */ 68 | void lwip_init(void); 69 | 70 | #ifdef __cplusplus 71 | } 72 | #endif 73 | 74 | #endif /* __LWIP_INIT_H__ */ 75 | -------------------------------------------------------------------------------- /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/cc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001-2003 Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, 6 | * are permitted provided that the following conditions are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 3. The name of the author may not be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 19 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 21 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 24 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 25 | * OF SUCH DAMAGE. 26 | * 27 | * This file is part of the lwIP TCP/IP stack. 28 | * 29 | * Author: Adam Dunkels 30 | * 31 | */ 32 | #ifndef __ARCH_CC_H__ 33 | #define __ARCH_CC_H__ 34 | 35 | /* Define platform endianness */ 36 | #ifndef BYTE_ORDER 37 | #define BYTE_ORDER BIG_ENDIAN 38 | #endif /* BYTE_ORDER */ 39 | 40 | /* Define generic types used in lwIP */ 41 | typedef unsigned char u8_t; 42 | typedef signed char s8_t; 43 | typedef unsigned short u16_t; 44 | typedef signed short s16_t; 45 | typedef unsigned long u32_t; 46 | typedef signed long s32_t; 47 | 48 | typedef u32_t mem_ptr_t; 49 | 50 | /* Define (sn)printf formatters for these lwIP types */ 51 | #define U16_F "u" 52 | #define S16_F "d" 53 | #define X16_F "x" 54 | #define U32_F "u" 55 | #define S32_F "d" 56 | #define X32_F "x" 57 | 58 | /* Compiler hints for packing structures */ 59 | #define PACK_STRUCT_FIELD(x) x 60 | #define PACK_STRUCT_STRUCT __attribute__((packed)) 61 | #define PACK_STRUCT_BEGIN 62 | #define PACK_STRUCT_END 63 | 64 | /* Plaform specific diagnostic output */ 65 | #ifdef CONFIG_OWL 66 | # include 67 | # define LWIP_PLATFORM_DIAG(x) owl_printf x 68 | # define LWIP_PLATFORM_ASSERT(x) owl_assert(x) 69 | #else 70 | # include 71 | # define LWIP_PLATFORM_DIAG(x) do { printk x; } while(0) 72 | # define LWIP_PLATFORM_ASSERT(x) do { \ 73 | printk("Assertion \"%s\" failed at line " \ 74 | "%d in %s\n", \ 75 | x, __LINE__, __FILE__); while(1); \ 76 | } while(0) 77 | #endif 78 | 79 | #endif /* __ARCH_CC_H__ */ 80 | -------------------------------------------------------------------------------- /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/panStamp/arduino_avr/1160c70488d4962abb3901a800e577938d7e6ec0/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/SOFTWARE_FRAMEWORK/UTILS/PREPROCESSOR/stringz.h: -------------------------------------------------------------------------------- 1 | /* This header file is part of the ATMEL AVR-UC3-SoftwareFramework-1.7.0 Release */ 2 | 3 | /*This file is prepared for Doxygen automatic documentation generation.*/ 4 | /*! \file ********************************************************************* 5 | * 6 | * \brief Preprocessor stringizing utils. 7 | * 8 | * - Compiler: IAR EWAVR32 and GNU GCC for AVR32 9 | * - Supported devices: All AVR32 devices can be used. 10 | * 11 | * \author Atmel Corporation: http://www.atmel.com \n 12 | * Support and FAQ: http://support.atmel.no/ 13 | * 14 | ******************************************************************************/ 15 | 16 | /* Copyright (c) 2009 Atmel Corporation. All rights reserved. 17 | * 18 | * Redistribution and use in source and binary forms, with or without 19 | * modification, are permitted provided that the following conditions are met: 20 | * 21 | * 1. Redistributions of source code must retain the above copyright notice, this 22 | * list of conditions and the following disclaimer. 23 | * 24 | * 2. Redistributions in binary form must reproduce the above copyright notice, 25 | * this list of conditions and the following disclaimer in the documentation 26 | * and/or other materials provided with the distribution. 27 | * 28 | * 3. The name of Atmel may not be used to endorse or promote products derived 29 | * from this software without specific prior written permission. 30 | * 31 | * 4. This software may only be redistributed and used in connection with an Atmel 32 | * AVR product. 33 | * 34 | * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED 35 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 36 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE 37 | * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR 38 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 39 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 40 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 41 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 42 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 43 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE 44 | * 45 | */ 46 | 47 | #ifndef _STRINGZ_H_ 48 | #define _STRINGZ_H_ 49 | 50 | 51 | /*! \brief Stringize. 52 | * 53 | * Stringize a preprocessing token, this token being allowed to be \#defined. 54 | * 55 | * May be used only within macros with the token passed as an argument if the token is \#defined. 56 | * 57 | * For example, writing STRINGZ(PIN) within a macro \#defined by PIN_NAME(PIN) 58 | * and invoked as PIN_NAME(PIN0) with PIN0 \#defined as A0 is equivalent to 59 | * writing "A0". 60 | */ 61 | #define STRINGZ(x) #x 62 | 63 | /*! \brief Absolute stringize. 64 | * 65 | * Stringize a preprocessing token, this token being allowed to be \#defined. 66 | * 67 | * No restriction of use if the token is \#defined. 68 | * 69 | * For example, writing ASTRINGZ(PIN0) anywhere with PIN0 \#defined as A0 is 70 | * equivalent to writing "A0". 71 | */ 72 | #define ASTRINGZ(x) STRINGZ(x) 73 | 74 | 75 | #endif // _STRINGZ_H_ 76 | -------------------------------------------------------------------------------- /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/cmd_wl.h: -------------------------------------------------------------------------------- 1 | /* This header file is part of the ATMEL AVR-UC3-SoftwareFramework-1.7.0 Release */ 2 | 3 | /*! \page License 4 | * Copyright (C) 2009, H&D Wireless AB All rights reserved. 5 | * 6 | * Redistribution and use in source and binary forms, with or without 7 | * modification, are permitted provided that the following conditions are met: 8 | * 9 | * 1. Redistributions of source code must retain the above copyright notice, 10 | * this list of conditions and the following disclaimer. 11 | * 12 | * 2. Redistributions in binary form must reproduce the above copyright notice, 13 | * this list of conditions and the following disclaimer in the documentation 14 | * and/or other materials provided with the distribution. 15 | * 16 | * 3. The name of H&D Wireless AB may not be used to endorse or promote products derived 17 | * from this software without specific prior written permission. 18 | * 19 | * THIS SOFTWARE IS PROVIDED BY H&D WIRELESS AB ``AS IS'' AND ANY EXPRESS OR IMPLIED 20 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 21 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE EXPRESSLY AND 22 | * SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, 23 | * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 24 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 25 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 26 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 28 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | */ 30 | #ifndef CMD_CM_H 31 | #define CMD_CM_H 32 | 33 | #include 34 | #include "netif/wlif.h" 35 | 36 | /*! A pointer to a struct of type "struct net_cfg" should be passed as 37 | * the ctx pointer in the callbacks below. The struct must have a 38 | * single instance per netif. 39 | */ 40 | #define _DNS_CMD_ 41 | 42 | cmd_state_t cmd_scan(int argc, char* argv[], void* ctx); 43 | cmd_state_t cmd_connect(int argc, char* argv[], void* ctx); 44 | cmd_state_t cmd_set_ip(int argc, char* argv[], void* ctx); 45 | cmd_state_t cmd_setkey(int argc, char* argv[], void* ctx); 46 | cmd_state_t cmd_status(int argc, char* argv[], void* ctx); 47 | cmd_state_t cmd_power(int argc, char* argv[], void* ctx); 48 | cmd_state_t cmd_psconf(int argc, char* argv[], void* ctx); 49 | cmd_state_t cmd_setpass(int argc, char* argv[], void* ctx); 50 | cmd_state_t cmd_delpass(int argc, char* argv[], void* ctx); 51 | cmd_state_t cmd_debug(int argc, char* argv[], void* ctx); 52 | cmd_state_t cmd_debug_toggle(int argc, char* argv[], void* ctx); 53 | cmd_state_t cmd_statSpi(int argc, char* argv[], void* ctx); 54 | cmd_state_t cmd_resetStatSpi(int argc, char* argv[], void* ctx); 55 | cmd_state_t cmd_gethostbyname(int argc, char* argv[], void* ctx); 56 | cmd_state_t cmd_setDnsServer(int argc, char* argv[], void* ctx); 57 | cmd_state_t cmd_startSrv(int argc, char* argv[], void* ctx); 58 | cmd_state_t cmd_startCli(int argc, char* argv[], void* ctx); 59 | cmd_state_t cmd_dumpBuf(int argc, char* argv[], void* ctx); 60 | cmd_state_t cmd_sendUdpData(int argc, char* argv[], void* ctx); 61 | #ifdef WFE_6_12 62 | cmd_state_t cmd_ibss(int argc, char* argv[], void* ctx); 63 | #endif 64 | 65 | 66 | #endif 67 | -------------------------------------------------------------------------------- /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/panStamp/arduino_avr/1160c70488d4962abb3901a800e577938d7e6ec0/firmwares/wifishield/wifi_dnld/Release/wifi_dnld.elf -------------------------------------------------------------------------------- /firmwares/wifishield/wifi_dnld/src/Doc/SPB104 product brief.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panStamp/arduino_avr/1160c70488d4962abb3901a800e577938d7e6ec0/firmwares/wifishield/wifi_dnld/src/Doc/SPB104 product brief.pdf -------------------------------------------------------------------------------- /firmwares/wifishield/wifi_dnld/src/Doc/gettingstarted.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/panStamp/arduino_avr/1160c70488d4962abb3901a800e577938d7e6ec0/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/panStamp/arduino_avr/1160c70488d4962abb3901a800e577938d7e6ec0/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/SOFTWARE_FRAMEWORK/UTILS/PREPROCESSOR/stringz.h: -------------------------------------------------------------------------------- 1 | /* This header file is part of the ATMEL AVR-UC3-SoftwareFramework-1.7.0 Release */ 2 | 3 | /*This file is prepared for Doxygen automatic documentation generation.*/ 4 | /*! \file ********************************************************************* 5 | * 6 | * \brief Preprocessor stringizing utils. 7 | * 8 | * - Compiler: IAR EWAVR32 and GNU GCC for AVR32 9 | * - Supported devices: All AVR32 devices can be used. 10 | * 11 | * \author Atmel Corporation: http://www.atmel.com \n 12 | * Support and FAQ: http://support.atmel.no/ 13 | * 14 | ******************************************************************************/ 15 | 16 | /* Copyright (c) 2009 Atmel Corporation. All rights reserved. 17 | * 18 | * Redistribution and use in source and binary forms, with or without 19 | * modification, are permitted provided that the following conditions are met: 20 | * 21 | * 1. Redistributions of source code must retain the above copyright notice, this 22 | * list of conditions and the following disclaimer. 23 | * 24 | * 2. Redistributions in binary form must reproduce the above copyright notice, 25 | * this list of conditions and the following disclaimer in the documentation 26 | * and/or other materials provided with the distribution. 27 | * 28 | * 3. The name of Atmel may not be used to endorse or promote products derived 29 | * from this software without specific prior written permission. 30 | * 31 | * 4. This software may only be redistributed and used in connection with an Atmel 32 | * AVR product. 33 | * 34 | * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED 35 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 36 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE 37 | * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR 38 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 39 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 40 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 41 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 42 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 43 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE 44 | * 45 | */ 46 | 47 | #ifndef _STRINGZ_H_ 48 | #define _STRINGZ_H_ 49 | 50 | 51 | /*! \brief Stringize. 52 | * 53 | * Stringize a preprocessing token, this token being allowed to be \#defined. 54 | * 55 | * May be used only within macros with the token passed as an argument if the token is \#defined. 56 | * 57 | * For example, writing STRINGZ(PIN) within a macro \#defined by PIN_NAME(PIN) 58 | * and invoked as PIN_NAME(PIN0) with PIN0 \#defined as A0 is equivalent to 59 | * writing "A0". 60 | */ 61 | #define STRINGZ(x) #x 62 | 63 | /*! \brief Absolute stringize. 64 | * 65 | * Stringize a preprocessing token, this token being allowed to be \#defined. 66 | * 67 | * No restriction of use if the token is \#defined. 68 | * 69 | * For example, writing ASTRINGZ(PIN0) anywhere with PIN0 \#defined as A0 is 70 | * equivalent to writing "A0". 71 | */ 72 | #define ASTRINGZ(x) STRINGZ(x) 73 | 74 | 75 | #endif // _STRINGZ_H_ 76 | -------------------------------------------------------------------------------- /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/EEPROM.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | EEPROM.cpp - EEPROM library 3 | Copyright (c) 2006 David A. Mellis. All right reserved. 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | */ 19 | 20 | /****************************************************************************** 21 | * Includes 22 | ******************************************************************************/ 23 | 24 | #include 25 | #include "Arduino.h" 26 | #include "EEPROM.h" 27 | 28 | /****************************************************************************** 29 | * Definitions 30 | ******************************************************************************/ 31 | 32 | /****************************************************************************** 33 | * Constructors 34 | ******************************************************************************/ 35 | 36 | /****************************************************************************** 37 | * User API 38 | ******************************************************************************/ 39 | 40 | uint8_t EEPROMClass::read(int address) 41 | { 42 | return eeprom_read_byte((unsigned char *) address); 43 | } 44 | 45 | void EEPROMClass::write(int address, uint8_t value) 46 | { 47 | eeprom_write_byte((unsigned char *) address, value); 48 | } 49 | 50 | EEPROMClass EEPROM; 51 | -------------------------------------------------------------------------------- /libraries/EEPROM/EEPROM.h: -------------------------------------------------------------------------------- 1 | /* 2 | EEPROM.h - EEPROM library 3 | Copyright (c) 2006 David A. Mellis. All right reserved. 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | */ 19 | 20 | #ifndef EEPROM_h 21 | #define EEPROM_h 22 | 23 | #include 24 | 25 | class EEPROMClass 26 | { 27 | public: 28 | uint8_t read(int); 29 | void write(int, uint8_t); 30 | }; 31 | 32 | extern EEPROMClass EEPROM; 33 | 34 | #endif 35 | 36 | -------------------------------------------------------------------------------- /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 | * This example code is in the public domain. 6 | 7 | */ 8 | 9 | #include 10 | 11 | void setup() 12 | { 13 | // write a 0 to all 512 bytes of the EEPROM 14 | for (int i = 0; i < 512; i++) 15 | EEPROM.write(i, 0); 16 | 17 | // turn the LED on when we're done 18 | digitalWrite(13, HIGH); 19 | } 20 | 21 | void loop() 22 | { 23 | } 24 | -------------------------------------------------------------------------------- /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 | { 17 | // initialize serial and wait for port to open: 18 | Serial.begin(9600); 19 | while (!Serial) { 20 | ; // wait for serial port to connect. Needed for Leonardo only 21 | } 22 | } 23 | 24 | void loop() 25 | { 26 | // read a byte from the current address of the EEPROM 27 | value = EEPROM.read(address); 28 | 29 | Serial.print(address); 30 | Serial.print("\t"); 31 | Serial.print(value, DEC); 32 | Serial.println(); 33 | 34 | // advance to the next address of the EEPROM 35 | address = address + 1; 36 | 37 | // there are only 512 bytes of EEPROM, from 0 to 511, so if we're 38 | // on address 512, wrap around to address 0 39 | if (address == 512) 40 | address = 0; 41 | 42 | delay(500); 43 | } 44 | -------------------------------------------------------------------------------- /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 12 | // we're going to write to next) 13 | int addr = 0; 14 | 15 | void setup() 16 | { 17 | } 18 | 19 | void loop() 20 | { 21 | // need to divide by 4 because analog inputs range from 22 | // 0 to 1023 and each byte of the EEPROM can only hold a 23 | // value from 0 to 255. 24 | int val = analogRead(0) / 4; 25 | 26 | // write the value to the appropriate byte of the EEPROM. 27 | // these values will remain there when the board is 28 | // turned off. 29 | EEPROM.write(addr, val); 30 | 31 | // advance to the next address. there are 512 bytes in 32 | // the EEPROM, so go back to 0 when we hit 512. 33 | addr = addr + 1; 34 | if (addr == 512) 35 | addr = 0; 36 | 37 | delay(100); 38 | } 39 | -------------------------------------------------------------------------------- /libraries/EEPROM/keywords.txt: -------------------------------------------------------------------------------- 1 | ####################################### 2 | # Syntax Coloring Map For Ultrasound 3 | ####################################### 4 | 5 | ####################################### 6 | # Datatypes (KEYWORD1) 7 | ####################################### 8 | 9 | EEPROM KEYWORD1 10 | 11 | ####################################### 12 | # Methods and Functions (KEYWORD2) 13 | ####################################### 14 | 15 | ####################################### 16 | # Constants (LITERAL1) 17 | ####################################### 18 | 19 | -------------------------------------------------------------------------------- /libraries/EEPROM/library.properties: -------------------------------------------------------------------------------- 1 | name=EEPROM 2 | version=1.0 3 | author=Arduino 4 | maintainer=Arduino 5 | sentence=Enables reading and writing to the permanent board storage. For all Arduino boards BUT Arduino DUE. 6 | paragraph= 7 | url=http://arduino.cc/en/Reference/EEPROM 8 | architectures=avr 9 | -------------------------------------------------------------------------------- /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. For all Arduino boards, BUT Arduino DUE. 6 | paragraph= 7 | url=http://arduino.cc/en/Reference/SPI 8 | architectures=avr 9 | -------------------------------------------------------------------------------- /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 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 | { 34 | // Open serial communications and wait for port to open: 35 | Serial.begin(57600); 36 | while (!Serial) { 37 | ; // wait for serial port to connect. Needed for Leonardo only 38 | } 39 | 40 | 41 | Serial.println("Goodnight moon!"); 42 | 43 | // set the data rate for the SoftwareSerial port 44 | mySerial.begin(4800); 45 | mySerial.println("Hello, world?"); 46 | } 47 | 48 | void loop() // run over and over 49 | { 50 | if (mySerial.available()) 51 | Serial.write(mySerial.read()); 52 | if (Serial.available()) 53 | mySerial.write(Serial.read()); 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 2, RX to pin 3 17 | * Second serial device's TX attached to digital pin 4, RX to pin 5 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 25 May 2012 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: TX = digital pin 10, RX = digital pin 11 39 | SoftwareSerial portOne(10, 11); 40 | 41 | // software serial #2: TX = digital pin 8, RX = 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 | { 47 | // Open serial communications and wait for port to open: 48 | Serial.begin(9600); 49 | while (!Serial) { 50 | ; // wait for serial port to connect. Needed for Leonardo only 51 | } 52 | 53 | 54 | // Start each software serial port 55 | portOne.begin(9600); 56 | portTwo.begin(9600); 57 | } 58 | 59 | void loop() 60 | { 61 | // By default, the last intialized port is listening. 62 | // when you want to listen on a port, explicitly select it: 63 | portOne.listen(); 64 | Serial.println("Data from port one:"); 65 | // while there is data coming in, read it 66 | // and send to the hardware serial port: 67 | while (portOne.available() > 0) { 68 | char inByte = portOne.read(); 69 | Serial.write(inByte); 70 | } 71 | 72 | // blank line to separate data from the two ports: 73 | Serial.println(); 74 | 75 | // Now listen on the second port 76 | portTwo.listen(); 77 | // while there is data coming in, read it 78 | // and send to the hardware serial port: 79 | Serial.println("Data from port two:"); 80 | while (portTwo.available() > 0) { 81 | char inByte = portTwo.read(); 82 | Serial.write(inByte); 83 | } 84 | 85 | // blank line to separate data from the two ports: 86 | Serial.println(); 87 | } 88 | 89 | 90 | 91 | 92 | 93 | 94 | -------------------------------------------------------------------------------- /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 digital pins. For all Arduino boards, BUT Arduino DUE. 6 | paragraph= 7 | url=http://arduino.cc/en/Reference/SoftwareSerial 8 | architectures=avr 9 | -------------------------------------------------------------------------------- /libraries/TimerOne/TimerOne.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Interrupt and PWM utilities for 16 bit Timer1 on ATmega168/328 3 | * Original code by Jesse Tane for http://labs.ideo.com August 2008 4 | * Modified March 2009 by Jérôme Despatis and Jesse Tane for ATmega328 support 5 | * Modified June 2009 by Michael Polli and Jesse Tane to fix a bug in setPeriod() which caused the timer to stop 6 | * Modified June 2011 by Lex Talionis to add a function to read the timer 7 | * Modified Oct 2011 by Andrew Richards to avoid certain problems: 8 | * - Add (long) assignments and casts to TimerOne::read() to ensure calculations involving tmp, ICR1 and TCNT1 aren't truncated 9 | * - Ensure 16 bit registers accesses are atomic - run with interrupts disabled when accessing 10 | * - Remove global enable of interrupts (sei())- could be running within an interrupt routine) 11 | * - Disable interrupts whilst TCTN1 == 0. Datasheet vague on this, but experiment shows that overflow interrupt 12 | * flag gets set whilst TCNT1 == 0, resulting in a phantom interrupt. Could just set to 1, but gets inaccurate 13 | * at very short durations 14 | * - startBottom() added to start counter at 0 and handle all interrupt enabling. 15 | * - start() amended to enable interrupts 16 | * - restart() amended to point at startBottom() 17 | * Modiied 7:26 PM Sunday, October 09, 2011 by Lex Talionis 18 | * - renamed start() to resume() to reflect it's actual role 19 | * - renamed startBottom() to start(). This breaks some old code that expects start to continue counting where it left off 20 | * 21 | * This program is free software: you can redistribute it and/or modify 22 | * it under the terms of the GNU General Public License as published by 23 | * the Free Software Foundation, either version 3 of the License, or 24 | * (at your option) any later version. 25 | * 26 | * This program is distributed in the hope that it will be useful, 27 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 28 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 29 | * GNU General Public License for more details. 30 | * 31 | * You should have received a copy of the GNU General Public License 32 | * along with this program. If not, see . 33 | * 34 | * See Google Code project http://code.google.com/p/arduino-timerone/ for latest 35 | */ 36 | #ifndef TIMERONE_h 37 | #define TIMERONE_h 38 | 39 | #include 40 | #include 41 | 42 | #define RESOLUTION 65536 // Timer1 is 16 bit 43 | 44 | class TimerOne 45 | { 46 | public: 47 | 48 | // properties 49 | unsigned int pwmPeriod; 50 | unsigned char clockSelectBits; 51 | char oldSREG; // To hold Status Register while ints disabled 52 | 53 | // methods 54 | void initialize(long microseconds=1000000); 55 | void start(); 56 | void stop(); 57 | void restart(); 58 | void resume(); 59 | unsigned long read(); 60 | void pwm(char pin, int duty, long microseconds=-1); 61 | void disablePwm(char pin); 62 | void attachInterrupt(void (*isr)(), long microseconds=-1); 63 | void detachInterrupt(); 64 | void setPeriod(long microseconds); 65 | void setPwmDuty(char pin, int duty); 66 | void (*isrCallback)(); 67 | }; 68 | 69 | extern TimerOne Timer1; 70 | #endif -------------------------------------------------------------------------------- /libraries/Wire/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 | class TwoWire : public Stream 31 | { 32 | private: 33 | static uint8_t rxBuffer[]; 34 | static uint8_t rxBufferIndex; 35 | static uint8_t rxBufferLength; 36 | 37 | static uint8_t txAddress; 38 | static uint8_t txBuffer[]; 39 | static uint8_t txBufferIndex; 40 | static uint8_t txBufferLength; 41 | 42 | static uint8_t transmitting; 43 | static void (*user_onRequest)(void); 44 | static void (*user_onReceive)(int); 45 | static void onRequestService(void); 46 | static void onReceiveService(uint8_t*, int); 47 | public: 48 | TwoWire(); 49 | void begin(); 50 | void begin(uint8_t); 51 | void begin(int); 52 | void setClock(uint32_t); 53 | void beginTransmission(uint8_t); 54 | void beginTransmission(int); 55 | uint8_t endTransmission(void); 56 | uint8_t endTransmission(uint8_t); 57 | uint8_t requestFrom(uint8_t, uint8_t); 58 | uint8_t requestFrom(uint8_t, uint8_t, uint8_t); 59 | uint8_t requestFrom(int, int); 60 | uint8_t requestFrom(int, int, int); 61 | virtual size_t write(uint8_t); 62 | virtual size_t write(const uint8_t *, size_t); 63 | virtual int available(void); 64 | virtual int read(void); 65 | virtual int peek(void); 66 | virtual void flush(void); 67 | void onReceive( void (*)(int) ); 68 | void onRequest( void (*)(void) ); 69 | 70 | inline size_t write(unsigned long n) { return write((uint8_t)n); } 71 | inline size_t write(long n) { return write((uint8_t)n); } 72 | inline size_t write(unsigned int n) { return write((uint8_t)n); } 73 | inline size_t write(int n) { return write((uint8_t)n); } 74 | using Print::write; 75 | }; 76 | 77 | extern TwoWire Wire; 78 | 79 | #endif 80 | 81 | -------------------------------------------------------------------------------- /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 | { 17 | Wire.begin(); // join i2c bus (address optional for master) 18 | Serial.begin(9600); // start serial communication at 9600bps 19 | } 20 | 21 | int reading = 0; 22 | 23 | void loop() 24 | { 25 | // step 1: instruct sensor to read echoes 26 | Wire.beginTransmission(112); // transmit to device #112 (0x70) 27 | // the address specified in the datasheet is 224 (0xE0) 28 | // but i2c adressing uses the high 7 bits so it's 112 29 | Wire.write(byte(0x00)); // sets register pointer to the command register (0x00) 30 | Wire.write(byte(0x50)); // command sensor to measure in "inches" (0x50) 31 | // use 0x51 for centimeters 32 | // use 0x52 for ping microseconds 33 | Wire.endTransmission(); // stop transmitting 34 | 35 | // step 2: wait for readings to happen 36 | delay(70); // datasheet suggests at least 65 milliseconds 37 | 38 | // step 3: instruct sensor to return a particular echo reading 39 | Wire.beginTransmission(112); // transmit to device #112 40 | Wire.write(byte(0x02)); // sets register pointer to echo #1 register (0x02) 41 | Wire.endTransmission(); // stop transmitting 42 | 43 | // step 4: request reading from sensor 44 | Wire.requestFrom(112, 2); // request 2 bytes from slave device #112 45 | 46 | // step 5: receive reading from sensor 47 | if (2 <= Wire.available()) // if two bytes were received 48 | { 49 | reading = Wire.read(); // receive high byte (overwrites previous reading) 50 | reading = reading << 8; // shift high byte to be high 8 bits 51 | reading |= Wire.read(); // receive low byte as lower 8 bits 52 | Serial.println(reading); // print the reading 53 | } 54 | 55 | delay(250); // wait a bit since people have to read the output :) 56 | } 57 | 58 | 59 | /* 60 | 61 | // The following code changes the address of a Devantech Ultrasonic Range Finder (SRF10 or SRF08) 62 | // usage: changeAddress(0x70, 0xE6); 63 | 64 | void changeAddress(byte oldAddress, byte newAddress) 65 | { 66 | Wire.beginTransmission(oldAddress); 67 | Wire.write(byte(0x00)); 68 | Wire.write(byte(0xA0)); 69 | Wire.endTransmission(); 70 | 71 | Wire.beginTransmission(oldAddress); 72 | Wire.write(byte(0x00)); 73 | Wire.write(byte(0xAA)); 74 | Wire.endTransmission(); 75 | 76 | Wire.beginTransmission(oldAddress); 77 | Wire.write(byte(0x00)); 78 | Wire.write(byte(0xA5)); 79 | Wire.endTransmission(); 80 | 81 | Wire.beginTransmission(oldAddress); 82 | Wire.write(byte(0x00)); 83 | Wire.write(newAddress); 84 | Wire.endTransmission(); 85 | } 86 | 87 | */ 88 | -------------------------------------------------------------------------------- /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 | { 19 | Wire.begin(); // join i2c bus (address optional for master) 20 | } 21 | 22 | byte val = 0; 23 | 24 | void loop() 25 | { 26 | Wire.beginTransmission(44); // transmit to device #44 (0x2c) 27 | // device address is specified in datasheet 28 | Wire.write(byte(0x00)); // sends instruction byte 29 | Wire.write(val); // sends potentiometer value byte 30 | Wire.endTransmission(); // stop transmitting 31 | 32 | val++; // increment value 33 | if (val == 64) // if reached 64th position (max) 34 | { 35 | val = 0; // start over from lowest value 36 | } 37 | delay(500); 38 | } 39 | 40 | -------------------------------------------------------------------------------- /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 | { 17 | Wire.begin(); // join i2c bus (address optional for master) 18 | Serial.begin(9600); // start serial for output 19 | } 20 | 21 | void loop() 22 | { 23 | Wire.requestFrom(2, 6); // request 6 bytes from slave device #2 24 | 25 | while (Wire.available()) // slave may send less than requested 26 | { 27 | char c = Wire.read(); // receive a byte as character 28 | Serial.print(c); // print the character 29 | } 30 | 31 | delay(500); 32 | } 33 | -------------------------------------------------------------------------------- /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 | { 17 | Wire.begin(); // join i2c bus (address optional for master) 18 | } 19 | 20 | byte x = 0; 21 | 22 | void loop() 23 | { 24 | Wire.beginTransmission(4); // transmit to device #4 25 | Wire.write("x is "); // sends five bytes 26 | Wire.write(x); // sends one byte 27 | Wire.endTransmission(); // stop transmitting 28 | 29 | x++; 30 | delay(500); 31 | } 32 | -------------------------------------------------------------------------------- /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 | { 17 | Wire.begin(4); // join i2c bus with address #4 18 | Wire.onReceive(receiveEvent); // register event 19 | Serial.begin(9600); // start serial for output 20 | } 21 | 22 | void loop() 23 | { 24 | delay(100); 25 | } 26 | 27 | // function that executes whenever data is received from master 28 | // this function is registered as an event, see setup() 29 | void receiveEvent(int howMany) 30 | { 31 | while (1 < Wire.available()) // loop through all but the last 32 | { 33 | char c = Wire.read(); // receive byte as a character 34 | Serial.print(c); // print the character 35 | } 36 | int x = Wire.read(); // receive byte as an integer 37 | Serial.println(x); // print the integer 38 | } 39 | -------------------------------------------------------------------------------- /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 | { 17 | Wire.begin(2); // join i2c bus with address #2 18 | Wire.onRequest(requestEvent); // register event 19 | } 20 | 21 | void loop() 22 | { 23 | delay(100); 24 | } 25 | 26 | // function that executes whenever data is requested by master 27 | // this function is registered as an event, see setup() 28 | void requestEvent() 29 | { 30 | Wire.write("hello "); // respond with message of 6 bytes 31 | // as expected by master 32 | } 33 | -------------------------------------------------------------------------------- /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 | send KEYWORD2 19 | receive KEYWORD2 20 | onReceive KEYWORD2 21 | onRequest KEYWORD2 22 | 23 | ####################################### 24 | # Instances (KEYWORD2) 25 | ####################################### 26 | 27 | Wire KEYWORD2 28 | 29 | ####################################### 30 | # Constants (LITERAL1) 31 | ####################################### 32 | 33 | -------------------------------------------------------------------------------- /libraries/Wire/library.properties: -------------------------------------------------------------------------------- 1 | name=Wire 2 | version=1.0 3 | author=Arduino 4 | maintainer=Arduino 5 | sentence=Allows the communication between devices or sensors connected via Two Wire Interface Bus. For all Arduino boards, BUT Arduino DUE. 6 | paragraph= 7 | url=http://arduino.cc/en/Reference/Wire 8 | architectures=avr 9 | -------------------------------------------------------------------------------- /libraries/Wire/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 TWI_FREQ 28 | #define TWI_FREQ 100000L 29 | #endif 30 | 31 | #ifndef TWI_BUFFER_LENGTH 32 | #define TWI_BUFFER_LENGTH 32 33 | #endif 34 | 35 | #define TWI_READY 0 36 | #define TWI_MRX 1 37 | #define TWI_MTX 2 38 | #define TWI_SRX 3 39 | #define TWI_STX 4 40 | 41 | void twi_init(void); 42 | void twi_setAddress(uint8_t); 43 | uint8_t twi_readFrom(uint8_t, uint8_t*, uint8_t, uint8_t); 44 | uint8_t twi_writeTo(uint8_t, uint8_t*, uint8_t, uint8_t, uint8_t); 45 | uint8_t twi_transmit(const uint8_t*, uint8_t); 46 | void twi_attachSlaveRxEvent( void (*)(uint8_t*, int) ); 47 | void twi_attachSlaveTxEvent( void (*)(void) ); 48 | void twi_reply(uint8_t); 49 | void twi_stop(void); 50 | void twi_releaseBus(void); 51 | 52 | #endif 53 | 54 | -------------------------------------------------------------------------------- /programmers.txt: -------------------------------------------------------------------------------- 1 | avrisp.name=AVR ISP 2 | avrisp.communication=serial 3 | avrisp.protocol=stk500v1 4 | avrisp.program.protocol=stk500v1 5 | avrisp.program.tool=avrdude 6 | avrisp.program.extra_params=-P{serial.port} 7 | 8 | avrispmkii.name=AVRISP mkII 9 | avrispmkii.communication=usb 10 | avrispmkii.protocol=stk500v2 11 | avrispmkii.program.protocol=stk500v2 12 | avrispmkii.program.tool=avrdude 13 | avrispmkii.program.extra_params=-Pusb 14 | 15 | usbtinyisp.name=USBtinyISP 16 | usbtinyisp.protocol=usbtiny 17 | usbtinyisp.program.tool=avrdude 18 | usbtinyisp.program.extra_params= 19 | 20 | usbasp.name=USBasp 21 | usbasp.communication=usb 22 | usbasp.protocol=usbasp 23 | usbasp.program.protocol=usbasp 24 | usbasp.program.tool=avrdude 25 | usbasp.program.extra_params=-Pusb 26 | 27 | parallel.name=Parallel Programmer 28 | parallel.protocol=dapa 29 | parallel.force=true 30 | # parallel.delay=200 31 | parallel.program.tool=avrdude 32 | parallel.program.extra_params=-F 33 | 34 | arduinoisp.name=Arduino as ISP 35 | arduinoisp.communication=serial 36 | arduinoisp.protocol=stk500v1 37 | arduinoisp.speed=19200 38 | arduinoisp.program.protocol=stk500v1 39 | arduinoisp.program.speed=19200 40 | arduinoisp.program.tool=avrdude 41 | arduinoisp.program.extra_params=-P{serial.port} -b{program.speed} 42 | --------------------------------------------------------------------------------