├── .gitignore ├── firmware ├── protos │ ├── iperf_proto.h │ ├── uart3_proto.h │ ├── std_io_proto.h │ ├── ethernetif_proto.h │ ├── config_proto.h │ ├── netconf_proto.h │ ├── telnet_proto.h │ ├── stm_timers_proto.h │ ├── fpga_proto.h │ ├── Playtune_proto.h │ ├── syscalls_newlib_proto.h │ ├── crc_proto.h │ ├── flash_sst_proto.h │ └── main_proto.h ├── test_iperf.sh ├── stm32f4x7_eth.c ├── stm32f4x7_eth.h ├── third_party │ └── lwip-1.4.0 │ │ ├── src │ │ ├── core │ │ │ ├── ipv6 │ │ │ │ ├── README │ │ │ │ └── ip6_addr.c │ │ │ ├── ipv4 │ │ │ │ └── inet.c │ │ │ ├── sys.c │ │ │ └── def.c │ │ ├── netif │ │ │ ├── FILES │ │ │ └── ppp │ │ │ │ ├── pppdebug.h │ │ │ │ ├── magic.h │ │ │ │ ├── md5.h │ │ │ │ ├── chpms.h │ │ │ │ ├── magic.c │ │ │ │ └── randm.h │ │ ├── include │ │ │ ├── netif │ │ │ │ └── slipif.h │ │ │ ├── ipv6 │ │ │ │ └── lwip │ │ │ │ │ ├── inet.h │ │ │ │ │ └── icmp.h │ │ │ ├── lwip │ │ │ │ ├── init.h │ │ │ │ ├── err.h │ │ │ │ ├── timers.h │ │ │ │ └── raw.h │ │ │ └── ipv4 │ │ │ │ └── lwip │ │ │ │ ├── ip_frag.h │ │ │ │ └── inet_chksum.h │ │ └── api │ │ │ └── err.c │ │ ├── port │ │ └── STM32F4x7 │ │ │ └── arch │ │ │ ├── bpstruct.h │ │ │ ├── epstruct.h │ │ │ ├── lib.h │ │ │ ├── cpu.h │ │ │ ├── perf.h │ │ │ ├── init.h │ │ │ ├── sys_arch.h │ │ │ └── cc.h │ │ └── README ├── fpga │ └── src │ │ ├── fpga_top.bin │ │ ├── bram_delay.v │ │ ├── Makefile │ │ ├── pll.v │ │ ├── pinout.pcf │ │ └── spi_master.v ├── compress_fpga_image.class ├── build_image │ └── main_image_0x8000000.bin ├── update_style.sh ├── audio_synth_test │ └── dsp_ice_audio_synth_test.mp3 ├── build_fpga_image.sh ├── STM32F4xx_DSP_StdPeriph_Lib_V1.8.0 │ ├── MCD-ST Liberty SW License Agreement V2.pdf │ └── Libraries │ │ ├── CMSIS │ │ ├── CMSIS_END_USER_LICENCE_AGREEMENT.pdf │ │ ├── Device │ │ │ └── ST │ │ │ │ └── STM32F4xx │ │ │ │ ├── Include │ │ │ │ ├── stm32f4xx.h │ │ │ │ └── system_stm32f4xx.h │ │ │ │ └── Source │ │ │ │ └── Templates │ │ │ │ └── system_stm32f4xx.c │ │ └── DSP_Lib │ │ │ ├── license.txt │ │ │ └── Source │ │ │ ├── ControllerFunctions │ │ │ ├── arm_pid_reset_q15.c │ │ │ ├── arm_pid_reset_q31.c │ │ │ ├── arm_pid_reset_f32.c │ │ │ └── arm_pid_init_f32.c │ │ │ ├── MatrixFunctions │ │ │ ├── arm_mat_init_q15.c │ │ │ ├── arm_mat_init_q31.c │ │ │ └── arm_mat_init_f32.c │ │ │ ├── FilteringFunctions │ │ │ ├── arm_fir_lattice_init_q31.c │ │ │ ├── arm_fir_lattice_init_q15.c │ │ │ ├── arm_fir_lattice_init_f32.c │ │ │ ├── arm_iir_lattice_init_q15.c │ │ │ ├── arm_iir_lattice_init_q31.c │ │ │ └── arm_iir_lattice_init_f32.c │ │ │ └── FastMathFunctions │ │ │ ├── arm_sin_q31.c │ │ │ └── arm_sin_q15.c │ │ └── STM32F4xx_StdPeriph_Driver │ │ ├── src │ │ └── stm32f4xx_qspi.c │ │ └── inc │ │ ├── stm32f4xx_crc.h │ │ └── stm32f4xx_flash_ramfunc.h ├── Playtune.h ├── crc.h ├── telnet.h ├── uart3.h ├── iperf.h ├── flash_sst.h ├── stm_timers.h ├── syscalls_newlib.h ├── fpga.h ├── std_io.h ├── main.h ├── netconf.h ├── ethernetif.h ├── main.ld ├── stm32f4xx_it.h ├── COMPILING ├── system_stm32f4xx.h ├── std_io.c ├── global.h ├── stm32f4x7_eth_bsp.h ├── delay.c ├── config.h └── netconf.c ├── BOM └── dsp_ice_rev1_BOM.xls ├── images ├── dsp_ice_pcb_rev1.jpg └── dsp_ice_pcb_cad_render.gif ├── pdf └── dsp_ice_rev1_schematic.pdf ├── hw_modules └── ltc1420_adc │ ├── ltc1420_adc_bom.xls │ ├── ltc1420_hw_module.jpg │ ├── fft_plot_500khz_100mVpp.gif │ ├── ltc1420_capture_3.5vpp_no_filter_325khz_freqdomain.gif │ └── ltc1420_capture_3.5vpp_no_filter_500khz_timedomain.gif ├── LICENSE └── gerber └── dsp_ice_rev1.GPB /.gitignore: -------------------------------------------------------------------------------- 1 | gnu_arm_toolchain 2 | *.o 3 | *.d 4 | gcc 5 | -------------------------------------------------------------------------------- /firmware/protos/iperf_proto.h: -------------------------------------------------------------------------------- 1 | void tcp_iperf_init PROTO ((void)); 2 | -------------------------------------------------------------------------------- /firmware/test_iperf.sh: -------------------------------------------------------------------------------- 1 | iperf3 -t10 -R -c 192.168.1.240 2 | iperf3 -t10 -c 192.168.1.240 3 | -------------------------------------------------------------------------------- /BOM/dsp_ice_rev1_BOM.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tvelliott/dsp_ice/HEAD/BOM/dsp_ice_rev1_BOM.xls -------------------------------------------------------------------------------- /firmware/stm32f4x7_eth.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tvelliott/dsp_ice/HEAD/firmware/stm32f4x7_eth.c -------------------------------------------------------------------------------- /firmware/stm32f4x7_eth.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tvelliott/dsp_ice/HEAD/firmware/stm32f4x7_eth.h -------------------------------------------------------------------------------- /firmware/third_party/lwip-1.4.0/src/core/ipv6/README: -------------------------------------------------------------------------------- 1 | IPv6 support in lwIP is very experimental. 2 | -------------------------------------------------------------------------------- /images/dsp_ice_pcb_rev1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tvelliott/dsp_ice/HEAD/images/dsp_ice_pcb_rev1.jpg -------------------------------------------------------------------------------- /firmware/fpga/src/fpga_top.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tvelliott/dsp_ice/HEAD/firmware/fpga/src/fpga_top.bin -------------------------------------------------------------------------------- /pdf/dsp_ice_rev1_schematic.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tvelliott/dsp_ice/HEAD/pdf/dsp_ice_rev1_schematic.pdf -------------------------------------------------------------------------------- /firmware/compress_fpga_image.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tvelliott/dsp_ice/HEAD/firmware/compress_fpga_image.class -------------------------------------------------------------------------------- /images/dsp_ice_pcb_cad_render.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tvelliott/dsp_ice/HEAD/images/dsp_ice_pcb_cad_render.gif -------------------------------------------------------------------------------- /hw_modules/ltc1420_adc/ltc1420_adc_bom.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tvelliott/dsp_ice/HEAD/hw_modules/ltc1420_adc/ltc1420_adc_bom.xls -------------------------------------------------------------------------------- /firmware/build_image/main_image_0x8000000.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tvelliott/dsp_ice/HEAD/firmware/build_image/main_image_0x8000000.bin -------------------------------------------------------------------------------- /hw_modules/ltc1420_adc/ltc1420_hw_module.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tvelliott/dsp_ice/HEAD/hw_modules/ltc1420_adc/ltc1420_hw_module.jpg -------------------------------------------------------------------------------- /hw_modules/ltc1420_adc/fft_plot_500khz_100mVpp.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tvelliott/dsp_ice/HEAD/hw_modules/ltc1420_adc/fft_plot_500khz_100mVpp.gif -------------------------------------------------------------------------------- /firmware/update_style.sh: -------------------------------------------------------------------------------- 1 | astyle -n --indent=spaces=2 --convert-tabs --style=linux *.c 2 | astyle -n --indent=spaces=2 --convert-tabs --style=linux *.h 3 | -------------------------------------------------------------------------------- /firmware/audio_synth_test/dsp_ice_audio_synth_test.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tvelliott/dsp_ice/HEAD/firmware/audio_synth_test/dsp_ice_audio_synth_test.mp3 -------------------------------------------------------------------------------- /firmware/build_fpga_image.sh: -------------------------------------------------------------------------------- 1 | cd fpga/src/ 2 | touch *.v 3 | make -f Makefile 4 | cd ../../ 5 | java compress_fpga_image fpga/src/fpga_top.bin >fpga_image.h 6 | touch fpga.c 7 | -------------------------------------------------------------------------------- /firmware/protos/uart3_proto.h: -------------------------------------------------------------------------------- 1 | void uart3_init (int32_t br ); 2 | void uart3_putc (uint16_t c ); 3 | void USART3_IRQHandler PROTO ((void)); 4 | void puts_u3 (uint8_t *buffer , int len ); 5 | -------------------------------------------------------------------------------- /hw_modules/ltc1420_adc/ltc1420_capture_3.5vpp_no_filter_325khz_freqdomain.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tvelliott/dsp_ice/HEAD/hw_modules/ltc1420_adc/ltc1420_capture_3.5vpp_no_filter_325khz_freqdomain.gif -------------------------------------------------------------------------------- /hw_modules/ltc1420_adc/ltc1420_capture_3.5vpp_no_filter_500khz_timedomain.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tvelliott/dsp_ice/HEAD/hw_modules/ltc1420_adc/ltc1420_capture_3.5vpp_no_filter_500khz_timedomain.gif -------------------------------------------------------------------------------- /firmware/STM32F4xx_DSP_StdPeriph_Lib_V1.8.0/MCD-ST Liberty SW License Agreement V2.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tvelliott/dsp_ice/HEAD/firmware/STM32F4xx_DSP_StdPeriph_Lib_V1.8.0/MCD-ST Liberty SW License Agreement V2.pdf -------------------------------------------------------------------------------- /firmware/protos/std_io_proto.h: -------------------------------------------------------------------------------- 1 | extern uint8_t net_buffer[]; 2 | int32_t tn_scanf (uint8_t *outbuffer , const char * format , ... ); 3 | int get_print_buffer_left PROTO ((void)); 4 | int printf (const char * format , ... ); 5 | -------------------------------------------------------------------------------- /firmware/STM32F4xx_DSP_StdPeriph_Lib_V1.8.0/Libraries/CMSIS/CMSIS_END_USER_LICENCE_AGREEMENT.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tvelliott/dsp_ice/HEAD/firmware/STM32F4xx_DSP_StdPeriph_Lib_V1.8.0/Libraries/CMSIS/CMSIS_END_USER_LICENCE_AGREEMENT.pdf -------------------------------------------------------------------------------- /firmware/STM32F4xx_DSP_StdPeriph_Lib_V1.8.0/Libraries/CMSIS/Device/ST/STM32F4xx/Include/stm32f4xx.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tvelliott/dsp_ice/HEAD/firmware/STM32F4xx_DSP_StdPeriph_Lib_V1.8.0/Libraries/CMSIS/Device/ST/STM32F4xx/Include/stm32f4xx.h -------------------------------------------------------------------------------- /firmware/protos/ethernetif_proto.h: -------------------------------------------------------------------------------- 1 | void eth_raw_output (uint8_t *frame , int len ); 2 | err_t ethernetif_input (struct netif *netif , uint8_t *buffer , int16_t len ); 3 | err_t ethernetif_init (struct netif *netif ); 4 | uint32_t sys_now (void); 5 | -------------------------------------------------------------------------------- /firmware/STM32F4xx_DSP_StdPeriph_Lib_V1.8.0/Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_qspi.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tvelliott/dsp_ice/HEAD/firmware/STM32F4xx_DSP_StdPeriph_Lib_V1.8.0/Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_qspi.c -------------------------------------------------------------------------------- /firmware/STM32F4xx_DSP_StdPeriph_Lib_V1.8.0/Libraries/CMSIS/Device/ST/STM32F4xx/Source/Templates/system_stm32f4xx.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tvelliott/dsp_ice/HEAD/firmware/STM32F4xx_DSP_StdPeriph_Lib_V1.8.0/Libraries/CMSIS/Device/ST/STM32F4xx/Source/Templates/system_stm32f4xx.c -------------------------------------------------------------------------------- /firmware/fpga/src/bram_delay.v: -------------------------------------------------------------------------------- 1 | module bram_delay(input clk, wen, input [12:0] addr, input [15:0] wdata, output reg [15:0] rdata); 2 | reg [15:0] mem [0:8191]; 3 | always @(posedge clk) begin 4 | if (wen) mem[addr] <= wdata; 5 | rdata <= mem[addr]; 6 | end 7 | endmodule 8 | 9 | -------------------------------------------------------------------------------- /firmware/protos/config_proto.h: -------------------------------------------------------------------------------- 1 | extern sys_config config; 2 | void config_changed PROTO ((void)); 3 | uint32_t GetSector (uint32_t Address ); 4 | void read_config PROTO ((void)); 5 | void write_config (sys_config *configtmp ); 6 | void factory_defaults (void); 7 | void reset_config_to_defaults (void); 8 | -------------------------------------------------------------------------------- /firmware/protos/netconf_proto.h: -------------------------------------------------------------------------------- 1 | extern struct netif netif_e0; 2 | extern uint32_t TCPTimer; 3 | extern uint32_t ARPTimer; 4 | extern uint32_t IPaddress; 5 | void lwip_init (void); 6 | void lwip_packet_in_eth (uint8_t *buffer , int16_t len ); 7 | void LwIP_Periodic_Handle (volatile uint32_t localtime ); 8 | -------------------------------------------------------------------------------- /firmware/protos/telnet_proto.h: -------------------------------------------------------------------------------- 1 | extern int8_t do_testflash1; 2 | extern int8_t do_testflash2; 3 | extern int8_t do_testadc; 4 | void telnet_write (struct tcp_pcb *tn_write_pcb , uint8_t *buffer , int len ); 5 | void close_telnet (void); 6 | void print_prompt PROTO ((void)); 7 | void print_help PROTO ((void)); 8 | void telnet_init (void); 9 | -------------------------------------------------------------------------------- /firmware/protos/stm_timers_proto.h: -------------------------------------------------------------------------------- 1 | void init_stm_timers (void); 2 | uint32_t get_timer4 PROTO ((void)); 3 | uint32_t clear_timer4 PROTO ((void)); 4 | uint32_t get_timer2 PROTO ((void)); 5 | uint32_t clear_timer2 PROTO ((void)); 6 | uint32_t set_timer2 (uint32_t val ); 7 | uint32_t get_timer3 PROTO ((void)); 8 | uint32_t clear_timer3 PROTO ((void)); 9 | uint32_t set_timer3 (uint32_t val ); 10 | void TIM3_IRQHandler PROTO ((void)); 11 | -------------------------------------------------------------------------------- /firmware/fpga/src/Makefile: -------------------------------------------------------------------------------- 1 | PROJ = fpga_top 2 | PIN_DEF = pinout.pcf 3 | DEVICE = hx8k 4 | 5 | all: $(PROJ).rpt $(PROJ).bin 6 | 7 | %.blif: %.v 8 | yosys -q -p 'synth_ice40 -top top -blif $@' $< 9 | 10 | %.asc: $(PIN_DEF) %.blif 11 | arachne-pnr -m 900 -d $(subst hx,,$(subst lp,,$(DEVICE))) -o $@ -p $^ -P ct256 12 | 13 | %.bin: %.asc 14 | icepack $< $@ 15 | 16 | %.rpt: %.asc 17 | icetime -d $(DEVICE) -mtr $@ $< 18 | 19 | clean: 20 | rm -f $(PROJ).blif $(PROJ).asc $(PROJ).bin 21 | 22 | .PHONY: all prog clean 23 | -------------------------------------------------------------------------------- /firmware/protos/fpga_proto.h: -------------------------------------------------------------------------------- 1 | extern volatile int ne4_count; 2 | extern volatile int8_t do_sample_mode; 3 | extern volatile int8_t fsmc_init; 4 | extern int fpga_bytes_out; 5 | void fpga_init PROTO ((void)); 6 | void fpga_init_interrupt (void); 7 | uint8_t fpga_rle_decode (const uint8_t *image , int len ); 8 | void init_fsmc PROTO ((void)); 9 | void test_mem PROTO ((void)); 10 | void EXTI15_10_IRQHandler PROTO ((void)); 11 | uint8_t fpga_spi_write_reg (uint8_t val , uint8_t port , int8_t term_cs ); 12 | uint8_t fpga_spi_read_reg (uint8_t val , uint8_t port , int8_t term_cs ); 13 | -------------------------------------------------------------------------------- /firmware/protos/Playtune_proto.h: -------------------------------------------------------------------------------- 1 | extern int8_t do_debug_midi; 2 | extern file_hdr_t file_header; 3 | extern const uint16_t tune_frequencies[]; 4 | extern int tune_playing; 5 | extern int volume_present; 6 | extern const int8_t * score_start; 7 | extern const int8_t * score_cursor; 8 | extern int _tune_num_chans; 9 | void tune_playnote (int8_t chan , int8_t note ); 10 | void set_midi_channel_mask (uint8_t chan_mask ); 11 | void tune_stopnote (int8_t chan ); 12 | void change_instrument (int chan , int instrument ); 13 | void tune_playscore (const int8_t *score ); 14 | void tune_stepscore (void); 15 | void tune_stopscore (void); 16 | void tune_stopchans (void); 17 | extern const uint8_t score1[]; 18 | -------------------------------------------------------------------------------- /firmware/protos/syscalls_newlib_proto.h: -------------------------------------------------------------------------------- 1 | caddr_t _sbrk (int32_t incr ); 2 | int _close (int file ); 3 | extern char * __env[]; 4 | extern char * * environ; 5 | int _execve (char *name , char **argv , char **env ); 6 | int _fork PROTO ((void)); 7 | int _fstat (int file , struct stat *st ); 8 | int _getpid PROTO ((void)); 9 | int _isatty (int file ); 10 | int _kill (int pid , int sig ); 11 | int _link (char *old , char *new ); 12 | void _exit (int status ); 13 | int _lseek (int file , int ptr , int dir ); 14 | int _open (const char *name , int flags , int mode ); 15 | int _read (int file , char *ptr , int len ); 16 | int _unlink (char *name ); 17 | int _wait (int *status ); 18 | int _write (int file , char *ptr , int len ); 19 | void abort PROTO ((void)); 20 | -------------------------------------------------------------------------------- /firmware/protos/crc_proto.h: -------------------------------------------------------------------------------- 1 | extern volatile int8_t do_crc; 2 | extern uint32_t crc32_val; 3 | extern uint32_t flash_crc32_val; 4 | unsigned short CRCCCITT (uint8_t *data , int16_t length , uint16_t seed , uint16_t final ); 5 | uint32_t crc32_range (uint8_t *ucBuffer , int32_t ulCount ); 6 | uint32_t flash_crc32_range (uint8_t *ucBuffer , int32_t ulCount ); 7 | void crc_test (void); 8 | int8_t check_crc16 (uint8_t *buffer ); 9 | int8_t update_crc16 (uint8_t *buffer ); 10 | void clear_crc PROTO ((void)); 11 | void clear_crc2 PROTO ((void)); 12 | uint16_t get_crc PROTO ((void)); 13 | uint8_t get_crc_h PROTO ((void)); 14 | uint8_t get_crc_l PROTO ((void)); 15 | uint16_t do_crc16 (uint8_t data ); 16 | void update_struct_crc (uint8_t *sp , int16_t size ); 17 | uint8_t check_struct_crc (uint8_t *sp , int16_t size ); 18 | -------------------------------------------------------------------------------- /firmware/fpga/src/pll.v: -------------------------------------------------------------------------------- 1 | /** 2 | * PLL configuration 3 | * 4 | * This Verilog module was generated automatically 5 | * using the icepll tool from the IceStorm project. 6 | * Use at your own risk. 7 | * 8 | * Given input frequency: 40.000 MHz 9 | * Requested output frequency: 84.000 MHz 10 | * Achieved output frequency: 83.333 MHz 11 | */ 12 | 13 | module pll( 14 | input clock_in, 15 | output clock_out, 16 | output locked 17 | ); 18 | 19 | SB_PLL40_CORE #( 20 | .FEEDBACK_PATH("SIMPLE"), 21 | .DIVR(4'b0010), // DIVR = 2 22 | .DIVF(7'b0110001), // DIVF = 49 23 | .DIVQ(3'b011), // DIVQ = 3 24 | .FILTER_RANGE(3'b001) // FILTER_RANGE = 1 25 | ) uut ( 26 | .LOCK(locked), 27 | .RESETB(1'b1), 28 | .BYPASS(1'b0), 29 | .REFERENCECLK(clock_in), 30 | .PLLOUTCORE(clock_out) 31 | ); 32 | 33 | endmodule 34 | -------------------------------------------------------------------------------- /firmware/protos/flash_sst_proto.h: -------------------------------------------------------------------------------- 1 | extern uint8_t manf_id[]; 2 | extern volatile int flash0_busy_flg; 3 | extern volatile int flash1_busy_flg; 4 | void init_flash_sst PROTO ((void)); 5 | void wait_for_flash (int id ); 6 | uint8_t * flash_get_manf_id (int id ); 7 | void flash_unprotect_all (int id ); 8 | void flash_read (uint32_t address , uint8_t *buffer , int16_t len , int id ); 9 | void test_flash (int id ); 10 | void flash_write_blocking (uint32_t address , uint8_t *buffer , int32_t len , int id ); 11 | void flash_write_byte (uint32_t address , uint8_t val , int id ); 12 | void flash_erase_4k (uint32_t erase_addr , int id ); 13 | void flash_erase_32k (uint32_t erase_addr , int id ); 14 | void flash_erase_64k (uint32_t erase_addr , int id ); 15 | void flash_erase_all (int id ); 16 | uint8_t flash_isbusy (int id ); 17 | uint8_t flash_isprotected (int id ); 18 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 tvelliott 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /firmware/protos/main_proto.h: -------------------------------------------------------------------------------- 1 | extern float32_t Input[]; 2 | extern float32_t Output[]; 3 | extern arm_cfft_radix2_instance_f32 fftS; 4 | extern RCC_ClocksTypeDef RCC_Clocks; 5 | extern volatile uint32_t prev_ms_timer; 6 | extern volatile int midi_off_time; 7 | extern volatile uint32_t local_time_ms; 8 | extern volatile uint32_t ms_timer; 9 | extern volatile int8_t all_initialized; 10 | extern int do_test_mem; 11 | extern int mem_test_cont; 12 | extern int8_t do_play_midi; 13 | extern volatile uint32_t tick_count; 14 | extern volatile uint32_t LocalTime; 15 | extern volatile int uptime_seconds; 16 | extern volatile int prev_uptime_seconds; 17 | extern volatile int fw_reset_time; 18 | extern volatile int uptime_mod; 19 | extern volatile int do_reset_flag; 20 | extern volatile int8_t do_eth_init_tick; 21 | extern volatile int do_print_prompt; 22 | extern volatile int lwip_initialized; 23 | extern volatile int check_firmware_update; 24 | int should_do_tcp_poll PROTO ((void)); 25 | void do_system_reset PROTO ((void)); 26 | void save_config PROTO ((void)); 27 | void fft_shift (float32_t *data , int len ); 28 | void test_adc PROTO ((void)); 29 | void check_ms_timer PROTO ((void)); 30 | void do_main_tasks (int ltick ); 31 | void handle_ethernet (int ltick ); 32 | void handle_systick (void); 33 | void assert_param (int pass ); 34 | -------------------------------------------------------------------------------- /firmware/Playtune.h: -------------------------------------------------------------------------------- 1 | /************************************************************************** 2 | * 3 | * Playtune: An Arduino Tune Generator 4 | * 5 | * Plays a polyphonic musical score 6 | * For documentation, see the Playtune.cpp source code file 7 | * 8 | * (C) Copyright 2011,2016 Len Shustek 9 | * 10 | **************************************************************************/ 11 | /* 12 | * Change log 13 | * 19 January 2011, L.Shustek, V1.0: Initial release. 14 | * 10 June 2013, L. Shustek, V1.3 15 | * - change for compatibility with Arduino IDE version 1.0.5 16 | * 6 April 2015, L. Shustek, V1.4 17 | * - change for compatibility with Arduino IDE version 1.6.x 18 | * 28 May 2016, T. Wasiluk 19 | * - added support for ATmega32U4 20 | * 10 July 2016, Nick Shvelidze 21 | * - Fixed include file names for Arduino 1.6 on Linux. 22 | */ 23 | 24 | #ifndef Playtune_h 25 | #define Playtune_h 26 | 27 | typedef struct __attribute__((packed)) 28 | { 29 | int8_t id1; // 'P' 30 | int8_t id2; // 't' 31 | uint8_t hdr_length; // length of whole file header 32 | uint8_t f1; // flag byte 1 33 | uint8_t f2; // flag byte 2 34 | uint8_t num_tgens; // how many tone generators are used by this score 35 | } 36 | file_hdr_t; 37 | 38 | 39 | #define PROTO(x) x 40 | #include "protos/Playtune_proto.h" 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /firmware/crc.h: -------------------------------------------------------------------------------- 1 | 2 | //MIT License 3 | // 4 | //Copyright (c) 2017 tvelliott 5 | // 6 | //Permission is hereby granted, free of charge, to any person obtaining a copy 7 | //of this software and associated documentation files (the "Software"), to deal 8 | //in the Software without restriction, including without limitation the rights 9 | //to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | //copies of the Software, and to permit persons to whom the Software is 11 | //furnished to do so, subject to the following conditions: 12 | // 13 | //The above copyright notice and this permission notice shall be included in all 14 | //copies or substantial portions of the Software. 15 | // 16 | //THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | //IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | //FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | //AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | //LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | //OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | //SOFTWARE. 23 | 24 | #ifndef __CRC_H__ 25 | #define __CRC_H__ 26 | 27 | #include 28 | 29 | #define PROTO(x) x 30 | #include "protos/crc_proto.h" 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /firmware/telnet.h: -------------------------------------------------------------------------------- 1 | 2 | //MIT License 3 | // 4 | //Copyright (c) 2017 tvelliott 5 | // 6 | //Permission is hereby granted, free of charge, to any person obtaining a copy 7 | //of this software and associated documentation files (the "Software"), to deal 8 | //in the Software without restriction, including without limitation the rights 9 | //to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | //copies of the Software, and to permit persons to whom the Software is 11 | //furnished to do so, subject to the following conditions: 12 | // 13 | //The above copyright notice and this permission notice shall be included in all 14 | //copies or substantial portions of the Software. 15 | // 16 | //THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | //IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | //FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | //AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | //LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | //OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | //SOFTWARE. 23 | 24 | #ifndef __TELNET_H__ 25 | #define __TELNET_H__ 26 | 27 | #include "lwip/tcp.h" 28 | 29 | #define PROTO(x) x 30 | #include "protos/telnet_proto.h" 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /firmware/uart3.h: -------------------------------------------------------------------------------- 1 | 2 | //MIT License 3 | // 4 | //Copyright (c) 2017 tvelliott 5 | // 6 | //Permission is hereby granted, free of charge, to any person obtaining a copy 7 | //of this software and associated documentation files (the "Software"), to deal 8 | //in the Software without restriction, including without limitation the rights 9 | //to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | //copies of the Software, and to permit persons to whom the Software is 11 | //furnished to do so, subject to the following conditions: 12 | // 13 | //The above copyright notice and this permission notice shall be included in all 14 | //copies or substantial portions of the Software. 15 | // 16 | //THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | //IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | //FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | //AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | //LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | //OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | //SOFTWARE. 23 | 24 | 25 | #ifndef __UART_3_H 26 | #define __UART_3_H 27 | 28 | #include "stm32f4xx.h" 29 | 30 | #define PROTO(x) x 31 | #include "protos/uart3_proto.h" 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /firmware/iperf.h: -------------------------------------------------------------------------------- 1 | 2 | //MIT License 3 | // 4 | //Copyright (c) 2017 tvelliott 5 | // 6 | //Permission is hereby granted, free of charge, to any person obtaining a copy 7 | //of this software and associated documentation files (the "Software"), to deal 8 | //in the Software without restriction, including without limitation the rights 9 | //to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | //copies of the Software, and to permit persons to whom the Software is 11 | //furnished to do so, subject to the following conditions: 12 | // 13 | //The above copyright notice and this permission notice shall be included in all 14 | //copies or substantial portions of the Software. 15 | // 16 | //THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | //IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | //FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | //AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | //LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | //OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | //SOFTWARE. 23 | 24 | #ifndef __tcp_iperf_H__ 25 | #define __tcp_iperf_H__ 26 | 27 | 28 | #define PROTO(x) x 29 | #include "protos/iperf_proto.h" 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /firmware/flash_sst.h: -------------------------------------------------------------------------------- 1 | 2 | //MIT License 3 | // 4 | //Copyright (c) 2017 tvelliott 5 | // 6 | //Permission is hereby granted, free of charge, to any person obtaining a copy 7 | //of this software and associated documentation files (the "Software"), to deal 8 | //in the Software without restriction, including without limitation the rights 9 | //to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | //copies of the Software, and to permit persons to whom the Software is 11 | //furnished to do so, subject to the following conditions: 12 | // 13 | //The above copyright notice and this permission notice shall be included in all 14 | //copies or substantial portions of the Software. 15 | // 16 | //THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | //IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | //FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | //AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | //LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | //OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | //SOFTWARE. 23 | 24 | #ifndef __FLASH_SST_H__ 25 | #define __FLASH_SST_H__ 26 | 27 | #include 28 | 29 | #define PROTO(x) x 30 | #include "protos/flash_sst_proto.h" 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /firmware/stm_timers.h: -------------------------------------------------------------------------------- 1 | 2 | //MIT License 3 | // 4 | //Copyright (c) 2017 tvelliott 5 | // 6 | //Permission is hereby granted, free of charge, to any person obtaining a copy 7 | //of this software and associated documentation files (the "Software"), to deal 8 | //in the Software without restriction, including without limitation the rights 9 | //to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | //copies of the Software, and to permit persons to whom the Software is 11 | //furnished to do so, subject to the following conditions: 12 | // 13 | //The above copyright notice and this permission notice shall be included in all 14 | //copies or substantial portions of the Software. 15 | // 16 | //THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | //IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | //FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | //AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | //LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | //OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | //SOFTWARE. 23 | 24 | #ifndef __STMTIMERS_H__ 25 | #define __STMTIMERS_H__ 26 | 27 | #include 28 | 29 | #define PROTO(x) x 30 | #include "protos/stm_timers_proto.h" 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /firmware/syscalls_newlib.h: -------------------------------------------------------------------------------- 1 | 2 | //MIT License 3 | // 4 | //Copyright (c) 2017 tvelliott 5 | // 6 | //Permission is hereby granted, free of charge, to any person obtaining a copy 7 | //of this software and associated documentation files (the "Software"), to deal 8 | //in the Software without restriction, including without limitation the rights 9 | //to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | //copies of the Software, and to permit persons to whom the Software is 11 | //furnished to do so, subject to the following conditions: 12 | // 13 | //The above copyright notice and this permission notice shall be included in all 14 | //copies or substantial portions of the Software. 15 | // 16 | //THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | //IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | //FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | //AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | //LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | //OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | //SOFTWARE. 23 | 24 | #ifndef __SYSCALLS_NEWLIB_H__ 25 | #define __SYSCALLS_NEWLIB_H__ 26 | 27 | #include 28 | 29 | #define PROTO(x) x 30 | #include "protos/syscalls_newlib_proto.h" 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /firmware/fpga.h: -------------------------------------------------------------------------------- 1 | //MIT License 2 | // 3 | //Copyright (c) 2017 tvelliott 4 | // 5 | //Permission is hereby granted, free of charge, to any person obtaining a copy 6 | //of this software and associated documentation files (the "Software"), to deal 7 | //in the Software without restriction, including without limitation the rights 8 | //to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | //copies of the Software, and to permit persons to whom the Software is 10 | //furnished to do so, subject to the following conditions: 11 | // 12 | //The above copyright notice and this permission notice shall be included in all 13 | //copies or substantial portions of the Software. 14 | // 15 | //THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | //IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | //FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | //AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | //LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | //OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | //SOFTWARE. 22 | 23 | #ifndef __FPGA_H__ 24 | #define __FPGA_H__ 25 | 26 | #define BTR_REG_RW_FAST 0x01110000; 27 | #define BTR_BRAM_RW_FAST 0x06660000; 28 | 29 | #define PROTO(x) x 30 | #include "protos/fpga_proto.h" 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /firmware/std_io.h: -------------------------------------------------------------------------------- 1 | 2 | //MIT License 3 | // 4 | //Copyright (c) 2017 tvelliott 5 | // 6 | //Permission is hereby granted, free of charge, to any person obtaining a copy 7 | //of this software and associated documentation files (the "Software"), to deal 8 | //in the Software without restriction, including without limitation the rights 9 | //to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | //copies of the Software, and to permit persons to whom the Software is 11 | //furnished to do so, subject to the following conditions: 12 | // 13 | //The above copyright notice and this permission notice shall be included in all 14 | //copies or substantial portions of the Software. 15 | // 16 | //THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | //IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | //FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | //AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | //LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | //OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | //SOFTWARE. 23 | 24 | #ifndef STD_IO__H 25 | #define STD_IO__H 26 | 27 | #include 28 | #include 29 | 30 | #define MAX_PRINTF_BUFFER (1514*8) 31 | #define MAX_NET_BUFFER (1514*8) 32 | 33 | #define PROTO(x) x 34 | #include "protos/std_io_proto.h" 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /firmware/third_party/lwip-1.4.0/src/netif/FILES: -------------------------------------------------------------------------------- 1 | This directory contains generic network interface device drivers that 2 | do not contain any hardware or architecture specific code. The files 3 | are: 4 | 5 | etharp.c 6 | Implements the ARP (Address Resolution Protocol) over 7 | Ethernet. The code in this file should be used together with 8 | Ethernet device drivers. Note that this module has been 9 | largely made Ethernet independent so you should be able to 10 | adapt this for other link layers (such as Firewire). 11 | 12 | ethernetif.c 13 | An example of how an Ethernet device driver could look. This 14 | file can be used as a "skeleton" for developing new Ethernet 15 | network device drivers. It uses the etharp.c ARP code. 16 | 17 | loopif.c 18 | A "loopback" network interface driver. It requires configuration 19 | through the define LWIP_LOOPIF_MULTITHREADING (see opt.h). 20 | 21 | slipif.c 22 | A generic implementation of the SLIP (Serial Line IP) 23 | protocol. It requires a sio (serial I/O) module to work. 24 | 25 | ppp/ Point-to-Point Protocol stack 26 | The PPP stack has been ported from ucip (http://ucip.sourceforge.net). 27 | It matches quite well to pppd 2.3.1 (http://ppp.samba.org), although 28 | compared to that, it has some modifications for embedded systems and 29 | the source code has been reordered a bit. -------------------------------------------------------------------------------- /firmware/main.h: -------------------------------------------------------------------------------- 1 | 2 | //MIT License 3 | // 4 | //Copyright (c) 2017 tvelliott 5 | // 6 | //Permission is hereby granted, free of charge, to any person obtaining a copy 7 | //of this software and associated documentation files (the "Software"), to deal 8 | //in the Software without restriction, including without limitation the rights 9 | //to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | //copies of the Software, and to permit persons to whom the Software is 11 | //furnished to do so, subject to the following conditions: 12 | // 13 | //The above copyright notice and this permission notice shall be included in all 14 | //copies or substantial portions of the Software. 15 | // 16 | //THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | //IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | //FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | //AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | //LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | //OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | //SOFTWARE. 23 | 24 | #ifndef __MAIN_H 25 | #define __MAIN_H 26 | 27 | #include "arm_math.h" 28 | #include "arm_const_structs.h" 29 | 30 | #include 31 | #include "global.h" 32 | 33 | #define PROTO(x) x 34 | #include "protos/main_proto.h" 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /firmware/netconf.h: -------------------------------------------------------------------------------- 1 | 2 | //MIT License 3 | // 4 | //Copyright (c) 2017 tvelliott 5 | // 6 | //Permission is hereby granted, free of charge, to any person obtaining a copy 7 | //of this software and associated documentation files (the "Software"), to deal 8 | //in the Software without restriction, including without limitation the rights 9 | //to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | //copies of the Software, and to permit persons to whom the Software is 11 | //furnished to do so, subject to the following conditions: 12 | // 13 | //The above copyright notice and this permission notice shall be included in all 14 | //copies or substantial portions of the Software. 15 | // 16 | //THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | //IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | //FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | //AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | //LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | //OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | //SOFTWARE. 23 | 24 | /* Define to prevent recursive inclusion -------------------------------------*/ 25 | #ifndef __NETCONF_H 26 | #define __NETCONF_H 27 | 28 | #include 29 | #include "lwip/err.h" 30 | #include "lwip/netif.h" 31 | 32 | #define PROTO(x) x 33 | #include "protos/netconf_proto.h" 34 | 35 | #endif /* __NETCONF_H */ 36 | -------------------------------------------------------------------------------- /firmware/ethernetif.h: -------------------------------------------------------------------------------- 1 | 2 | //MIT License 3 | // 4 | //Copyright (c) 2017 tvelliott 5 | // 6 | //Permission is hereby granted, free of charge, to any person obtaining a copy 7 | //of this software and associated documentation files (the "Software"), to deal 8 | //in the Software without restriction, including without limitation the rights 9 | //to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | //copies of the Software, and to permit persons to whom the Software is 11 | //furnished to do so, subject to the following conditions: 12 | // 13 | //The above copyright notice and this permission notice shall be included in all 14 | //copies or substantial portions of the Software. 15 | // 16 | //THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | //IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | //FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | //AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | //LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | //OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | //SOFTWARE. 23 | 24 | #ifndef __ETHERNETIF_H__ 25 | #define __ETHERNETIF_H__ 26 | 27 | 28 | #include 29 | #include "lwip/err.h" 30 | #include "lwip/netif.h" 31 | 32 | err_t ethernetif_init(struct netif *netif); 33 | err_t ethernetif_input(struct netif *netif, uint8_t *buffer, int16_t len); 34 | 35 | #define PROTO(x) x 36 | #include "protos/ethernetif_proto.h" 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /firmware/STM32F4xx_DSP_StdPeriph_Lib_V1.8.0/Libraries/CMSIS/DSP_Lib/license.txt: -------------------------------------------------------------------------------- 1 | All files contained in the folders "CMSIS\DSP-Lib\Source" and "CMSIS\DSP-Lib\Examples" 2 | are guided by the following license: 3 | 4 | Copyright (C) 2009-2015 ARM Limited. 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 are met: 9 | - Redistributions of source code must retain the above copyright 10 | notice, this list of conditions and the following disclaimer. 11 | - Redistributions in binary form must reproduce the above copyright 12 | notice, this list of conditions and the following disclaimer in the 13 | documentation and/or other materials provided with the distribution. 14 | - Neither the name of ARM nor the names of its contributors may be used 15 | to endorse or promote products derived from this software without 16 | specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 | ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE 22 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | POSSIBILITY OF SUCH DAMAGE. 29 | -------------------------------------------------------------------------------- /firmware/main.ld: -------------------------------------------------------------------------------- 1 | MEMORY 2 | { 3 | FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 512K 4 | SRAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K 5 | AHBB0 (xrw) : ORIGIN = 0x10000000, LENGTH = 32K 6 | AHBB1 (xrw) : ORIGIN = 0x10008000, LENGTH = 32K 7 | } 8 | 9 | SECTIONS 10 | { 11 | __STACKSIZE__ = 16384; 12 | __HEAPSIZE__ = 32768; 13 | 14 | .text : 15 | { 16 | _text = .; 17 | KEEP(*(.isr_vector)) 18 | *(.text*) 19 | *(.rodata*) 20 | /* _etext = .; */ 21 | } > FLASH 22 | 23 | ARM.extab : 24 | { 25 | *(.ARM.extab* .gnu.linkonce.armextab.*) 26 | } > FLASH 27 | 28 | __exidx_start = .; 29 | .ARM.exidx : 30 | { 31 | *(.ARM.exidx* .gnu.linkonce.armexidx.*) 32 | } > FLASH 33 | __exidx_end = .; 34 | 35 | _etext = .; 36 | _sidata = _etext; 37 | 38 | .data : 39 | { 40 | _data = .; 41 | *(.data*) 42 | *(COMMON) 43 | _edata = .; 44 | } > SRAM AT > FLASH 45 | 46 | .bss (NOLOAD) : 47 | { 48 | _bss = .; 49 | *(.bss*) 50 | _ebss = .; 51 | } > SRAM 52 | 53 | .heap (NOLOAD) : 54 | { 55 | _heap = .; 56 | _end = .; 57 | end = .; 58 | *(.heap*) 59 | . = ALIGN(MAX(_heap + __HEAPSIZE__ , .), 4); 60 | } > AHBB0 61 | _eheap = _heap + SIZEOF(.heap); 62 | 63 | .stack (NOLOAD) : 64 | { 65 | _stack = .; 66 | *(.stack*) 67 | . = ALIGN(MAX(_stack + __STACKSIZE__ , .), 4); 68 | } > AHBB1 69 | _estack = _stack + SIZEOF(.stack); 70 | 71 | /* remove the debugging information from the standard libraries */ 72 | DISCARD : 73 | { 74 | libc.a ( * ) 75 | libm.a ( * ) 76 | libgcc.a ( * ) 77 | } 78 | 79 | 80 | } 81 | -------------------------------------------------------------------------------- /firmware/third_party/lwip-1.4.0/port/STM32F4x7/arch/bpstruct.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 | 33 | #if defined(__IAR_SYSTEMS_ICC__) 34 | #pragma pack(1) 35 | #endif 36 | 37 | -------------------------------------------------------------------------------- /firmware/third_party/lwip-1.4.0/port/STM32F4x7/arch/epstruct.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 | 33 | #if defined(__IAR_SYSTEMS_ICC__) 34 | #pragma pack() 35 | #endif 36 | 37 | -------------------------------------------------------------------------------- /firmware/third_party/lwip-1.4.0/port/STM32F4x7/arch/lib.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001-2003 Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, 6 | * are permitted provided that the following conditions are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 3. The name of the author may not be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 19 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 21 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 24 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 25 | * OF SUCH DAMAGE. 26 | * 27 | * This file is part of the lwIP TCP/IP stack. 28 | * 29 | * Author: Adam Dunkels 30 | * 31 | */ 32 | #ifndef __LIB_H__ 33 | #define __LIB_H__ 34 | 35 | #include 36 | 37 | 38 | #endif /* __LIB_H__ */ 39 | -------------------------------------------------------------------------------- /firmware/third_party/lwip-1.4.0/port/STM32F4x7/arch/cpu.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001-2003 Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, 6 | * are permitted provided that the following conditions are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 3. The name of the author may not be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 19 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 21 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 24 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 25 | * OF SUCH DAMAGE. 26 | * 27 | * This file is part of the lwIP TCP/IP stack. 28 | * 29 | * Author: Adam Dunkels 30 | * 31 | */ 32 | #ifndef __CPU_H__ 33 | #define __CPU_H__ 34 | 35 | #define BYTE_ORDER LITTLE_ENDIAN 36 | 37 | #endif /* __CPU_H__ */ 38 | -------------------------------------------------------------------------------- /firmware/third_party/lwip-1.4.0/src/core/ipv4/inet.c: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * Functions common to all TCP/IPv4 modules, such as the byte order functions. 4 | * 5 | */ 6 | 7 | /* 8 | * Copyright (c) 2001-2004 Swedish Institute of Computer Science. 9 | * All rights reserved. 10 | * 11 | * Redistribution and use in source and binary forms, with or without modification, 12 | * are permitted provided that the following conditions are met: 13 | * 14 | * 1. Redistributions of source code must retain the above copyright notice, 15 | * this list of conditions and the following disclaimer. 16 | * 2. Redistributions in binary form must reproduce the above copyright notice, 17 | * this list of conditions and the following disclaimer in the documentation 18 | * and/or other materials provided with the distribution. 19 | * 3. The name of the author may not be used to endorse or promote products 20 | * derived from this software without specific prior written permission. 21 | * 22 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 23 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 24 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 25 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 26 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 27 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 29 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 30 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 31 | * OF SUCH DAMAGE. 32 | * 33 | * This file is part of the lwIP TCP/IP stack. 34 | * 35 | * Author: Adam Dunkels 36 | * 37 | */ 38 | 39 | #include "lwip/opt.h" 40 | 41 | #include "lwip/inet.h" 42 | 43 | -------------------------------------------------------------------------------- /firmware/third_party/lwip-1.4.0/port/STM32F4x7/arch/perf.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001-2003 Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, 6 | * are permitted provided that the following conditions are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 3. The name of the author may not be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 19 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 21 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 24 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 25 | * OF SUCH DAMAGE. 26 | * 27 | * This file is part of the lwIP TCP/IP stack. 28 | * 29 | * Author: Adam Dunkels 30 | * 31 | */ 32 | #ifndef __PERF_H__ 33 | #define __PERF_H__ 34 | 35 | #define PERF_START /* null definition */ 36 | #define PERF_STOP(x) /* null definition */ 37 | 38 | #endif /* __PERF_H__ */ 39 | -------------------------------------------------------------------------------- /firmware/third_party/lwip-1.4.0/port/STM32F4x7/arch/init.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001-2003 Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, 6 | * are permitted provided that the following conditions are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 3. The name of the author may not be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 19 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 21 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 24 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 25 | * OF SUCH DAMAGE. 26 | * 27 | * This file is part of the lwIP TCP/IP stack. 28 | * 29 | * Author: Adam Dunkels 30 | * 31 | */ 32 | #ifndef __ARCH_INIT_H__ 33 | #define __ARCH_INIT_H__ 34 | 35 | #define TCPIP_INIT_DONE(arg) tcpip_init_done(arg) 36 | 37 | void tcpip_init_done(void *); 38 | int wait_for_tcpip_init(void); 39 | 40 | #endif /* __ARCH_INIT_H__ */ 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /firmware/fpga/src/pinout.pcf: -------------------------------------------------------------------------------- 1 | set_io LED2 A1 2 | set_io LED3 A2 3 | set_io LED4 A5 4 | set_io clk R9 5 | set_io AUDIO_SDIN T8 6 | set_io AUDIO_SCLK T7 7 | set_io AUDIO_LRCLK T6 8 | set_io AUDIO_MCLK T5 9 | set_io CBSEL P13 10 | set_io PMOD1_1 P2 11 | set_io PMOD1_2 R2 12 | set_io PMOD1_3 T1 13 | set_io PMOD1_4 T3 14 | set_io PMOD1_7 P1 15 | set_io PMOD1_8 R1 16 | set_io PMOD1_9 R3 17 | set_io PMOD1_10 T2 18 | set_io PMOD2_1 K1 19 | set_io PMOD2_2 L3 20 | set_io PMOD2_3 M2 21 | set_io PMOD2_4 N3 22 | set_io PMOD2_7 K3 23 | set_io PMOD2_8 L1 24 | set_io PMOD2_9 M1 25 | set_io PMOD2_10 N2 26 | set_io PMOD3_1 F2 27 | set_io PMOD3_2 G3 28 | set_io PMOD3_3 H1 29 | set_io PMOD3_4 J2 30 | set_io PMOD3_7 F1 31 | set_io PMOD3_8 G2 32 | set_io PMOD3_9 H2 33 | set_io PMOD3_10 J1 34 | set_io PMOD4_1 B3 35 | set_io PMOD4_2 C3 36 | set_io PMOD4_3 D3 37 | set_io PMOD4_4 E3 38 | set_io PMOD4_7 B2 39 | set_io PMOD4_8 C2 40 | set_io PMOD4_9 D2 41 | set_io PMOD4_10 E2 42 | set_io P_A6 A6 43 | set_io P_A7 A7 44 | set_io P_A9 A9 45 | set_io P_A10 A10 46 | set_io P_A11 A11 47 | set_io P_B6 B6 48 | set_io P_B7 B7 49 | set_io P_B8 B8 50 | set_io P_B9 B9 51 | set_io P_B11 B11 52 | set_io A0 C16 53 | set_io A1 T15 54 | set_io A2 R16 55 | set_io A3 R15 56 | set_io A4 P16 57 | set_io A5 P15 58 | set_io A6 N16 59 | set_io A7 M16 60 | set_io A8 M15 61 | set_io A9 L16 62 | set_io A10 T14 63 | set_io A11 R14 64 | set_io A12 P14 65 | set_io A13 L14 66 | set_io A14 D14 67 | set_io A15 C14 68 | set_io D0 D16 69 | set_io D1 D15 70 | set_io D2 B16 71 | set_io D3 B15 72 | set_io D4 A16 73 | set_io D5 A15 74 | set_io D6 E16 75 | set_io D7 F15 76 | set_io D8 F16 77 | set_io D9 G15 78 | set_io D10 G16 79 | set_io D11 J15 80 | set_io D12 J16 81 | set_io D13 K15 82 | set_io D14 K16 83 | set_io D15 T16 84 | set_io FSMC_NOE F14 85 | set_io FSMC_NWE H14 86 | set_io FSMC_NE1 J14 87 | set_io FSMC_NE4 K14 88 | set_io FSMC_NL_NADV B14 89 | set_io FPGA_SPI_SCLK R10 90 | set_io FPGA_SPI_MOSI P10 91 | set_io FPGA_SPI_MISO N12 92 | set_io FPGA_SPI_CS T13 93 | set_io FSMC_CLK K9 94 | -------------------------------------------------------------------------------- /firmware/stm32f4xx_it.h: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | ****************************************************************************** 4 | * @attention 5 | * 6 | *

© COPYRIGHT 2016 STMicroelectronics

7 | * 8 | * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License"); 9 | * You may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at: 11 | * 12 | * http://www.st.com/software_license_agreement_liberty_v2 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | * 20 | ****************************************************************************** 21 | */ 22 | 23 | /* Define to prevent recursive inclusion -------------------------------------*/ 24 | #ifndef __STM32F4xx_IT_H 25 | #define __STM32F4xx_IT_H 26 | 27 | #ifdef __cplusplus 28 | extern "C" { 29 | #endif 30 | 31 | /* Includes ------------------------------------------------------------------*/ 32 | 33 | /* Exported types ------------------------------------------------------------*/ 34 | /* Exported constants --------------------------------------------------------*/ 35 | /* Exported macro ------------------------------------------------------------*/ 36 | /* Exported functions ------------------------------------------------------- */ 37 | 38 | void NMI_Handler(void); 39 | void HardFault_Handler(void); 40 | void MemManage_Handler(void); 41 | void BusFault_Handler(void); 42 | void UsageFault_Handler(void); 43 | void SVC_Handler(void); 44 | void DebugMon_Handler(void); 45 | void PendSV_Handler(void); 46 | void SysTick_Handler(void); 47 | 48 | #ifdef __cplusplus 49 | } 50 | #endif 51 | 52 | #endif /* __STM32F4xx_IT_H */ 53 | 54 | /******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/ 55 | -------------------------------------------------------------------------------- /firmware/COMPILING: -------------------------------------------------------------------------------- 1 | 2 | Instructions (tested on Debian 8 system) 3 | 4 | 1) download GNU ARM Embedded Toolchain from here: 5 | 6 | https://launchpad.net/gcc-arm-embedded 7 | 8 | The test firmare was compiled with version: gcc-arm-none-eabi-5_4-2016q3-20160926-linux.tar.bz2 9 | 10 | 2) *edit the makedefs_fp and change PRE_PREFIX to point to the absolute path of the toolchain directory 11 | *optionally, move the uncompressed toolchain folder to the project folder and rename to gnu_arm_toolchain 12 | 13 | 3) From the project directory, In order to re-build the FPGA binary image, type 'sh build_fpga_image.sh' 14 | (requires that Project Icestorm tools are installed) http://www.clifford.at/icestorm/ 15 | 16 | yosys (synthesis tool) 17 | ice-tools (tools for maniuplating text/binaries and programming dev boards) 18 | arache-pnr (place-and-route for specific chip implementation) https://github.com/cseed/arachne-pnr 19 | 20 | Note: The fpga binary configuration image will be compressed and converted to a header file for inclusion to the MCU firmware image: fpga_image.h 21 | The compressed image in fpga_image.h will be included in fpga.c on the next mcu firmware build (step 4) 22 | The MCU uncompresses and transfers the fpga config image during startup. 23 | 24 | 4) From the project directory, type 'make clean' followed by 'make' 25 | The resulting binary will be copied to /tmp folder and also the build_image folder in the current project directory 26 | Note: the prototypes in protos can be re-generated with 'make genprotos' if cfunctions is installed. 27 | 28 | 5) An ST-Link programmer can be used to load the resulting binary (main_image_0x8000000.bin) to address 0x8000000 29 | 30 | A $15 STM32F4 Discovery board with the jumpers set to "ST Link" (pulled off) and a straight-thru, 6-pin 0.1" pitch cable will work. 31 | 32 | Follow instructions for compiling OpenOCD http://openocd.org/ 33 | 34 | start the debugger: 'sudo src/openocd -s tcl -f tcl/board/stm32f4discovery.cfg' 35 | 36 | 'telnet localhost 4444' 37 | > reset halt 38 | > flash write_image erase build_image/main_image_0x8000000.bin 0x8000000 39 | -------------------------------------------------------------------------------- /firmware/third_party/lwip-1.4.0/src/include/netif/slipif.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001, Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions 7 | * are met: 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright 11 | * notice, this list of conditions and the following disclaimer in the 12 | * documentation and/or other materials provided with the distribution. 13 | * 3. Neither the name of the Institute nor the names of its contributors 14 | * may be used to endorse or promote products derived from this software 15 | * without specific prior written permission. 16 | * 17 | * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND 18 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE 21 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 | * SUCH DAMAGE. 28 | * 29 | * This file is part of the lwIP TCP/IP stack. 30 | * 31 | * Author: Adam Dunkels 32 | * 33 | */ 34 | #ifndef __NETIF_SLIPIF_H__ 35 | #define __NETIF_SLIPIF_H__ 36 | 37 | #include "lwip/netif.h" 38 | 39 | #ifdef __cplusplus 40 | extern "C" { 41 | #endif 42 | 43 | err_t slipif_init(struct netif * netif); 44 | void slipif_poll(struct netif *netif); 45 | 46 | #ifdef __cplusplus 47 | } 48 | #endif 49 | 50 | #endif 51 | 52 | -------------------------------------------------------------------------------- /firmware/third_party/lwip-1.4.0/src/core/sys.c: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * lwIP Operating System abstraction 4 | * 5 | */ 6 | 7 | /* 8 | * Copyright (c) 2001-2004 Swedish Institute of Computer Science. 9 | * All rights reserved. 10 | * 11 | * Redistribution and use in source and binary forms, with or without modification, 12 | * are permitted provided that the following conditions are met: 13 | * 14 | * 1. Redistributions of source code must retain the above copyright notice, 15 | * this list of conditions and the following disclaimer. 16 | * 2. Redistributions in binary form must reproduce the above copyright notice, 17 | * this list of conditions and the following disclaimer in the documentation 18 | * and/or other materials provided with the distribution. 19 | * 3. The name of the author may not be used to endorse or promote products 20 | * derived from this software without specific prior written permission. 21 | * 22 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 23 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 24 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 25 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 26 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 27 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 29 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 30 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 31 | * OF SUCH DAMAGE. 32 | * 33 | * This file is part of the lwIP TCP/IP stack. 34 | * 35 | * Author: Adam Dunkels 36 | * 37 | */ 38 | 39 | #include "lwip/opt.h" 40 | 41 | #include "lwip/sys.h" 42 | 43 | /* Most of the functions defined in sys.h must be implemented in the 44 | * architecture-dependent file sys_arch.c */ 45 | 46 | #if !NO_SYS 47 | 48 | /** 49 | * Sleep for some ms. Timeouts are NOT processed while sleeping. 50 | * 51 | * @param ms number of milliseconds to sleep 52 | */ 53 | void 54 | sys_msleep(u32_t ms) 55 | { 56 | if (ms > 0) { 57 | sys_sem_t delaysem; 58 | err_t err = sys_sem_new(&delaysem, 0); 59 | if (err == ERR_OK) { 60 | sys_arch_sem_wait(&delaysem, ms); 61 | sys_sem_free(&delaysem); 62 | } 63 | } 64 | } 65 | 66 | #endif /* !NO_SYS */ 67 | -------------------------------------------------------------------------------- /firmware/system_stm32f4xx.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file system_stm32f4xx.h 4 | * @author MCD Application Team 5 | * @version V1.0.0 6 | * @date 30-September-2011 7 | * @brief CMSIS Cortex-M4 Device System Source File for STM32F4xx devices. 8 | ****************************************************************************** 9 | * @attention 10 | * 11 | * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS 12 | * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE 13 | * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY 14 | * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING 15 | * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE 16 | * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. 17 | * 18 | *

© COPYRIGHT 2011 STMicroelectronics

19 | ****************************************************************************** 20 | */ 21 | 22 | /** @addtogroup CMSIS 23 | * @{ 24 | */ 25 | 26 | /** @addtogroup stm32f4xx_system 27 | * @{ 28 | */ 29 | 30 | /** 31 | * @brief Define to prevent recursive inclusion 32 | */ 33 | #ifndef __SYSTEM_STM32F4XX_H 34 | #define __SYSTEM_STM32F4XX_H 35 | 36 | #ifdef __cplusplus 37 | extern "C" { 38 | #endif 39 | 40 | /** @addtogroup STM32F4xx_System_Includes 41 | * @{ 42 | */ 43 | 44 | /** 45 | * @} 46 | */ 47 | 48 | 49 | /** @addtogroup STM32F4xx_System_Exported_types 50 | * @{ 51 | */ 52 | 53 | extern uint32_t SystemCoreClock; /*!< System Clock Frequency (Core Clock) */ 54 | 55 | 56 | /** 57 | * @} 58 | */ 59 | 60 | /** @addtogroup STM32F4xx_System_Exported_Constants 61 | * @{ 62 | */ 63 | 64 | /** 65 | * @} 66 | */ 67 | 68 | /** @addtogroup STM32F4xx_System_Exported_Macros 69 | * @{ 70 | */ 71 | 72 | /** 73 | * @} 74 | */ 75 | 76 | /** @addtogroup STM32F4xx_System_Exported_Functions 77 | * @{ 78 | */ 79 | 80 | extern void SystemInit(void); 81 | extern void SystemCoreClockUpdate(void); 82 | /** 83 | * @} 84 | */ 85 | 86 | #ifdef __cplusplus 87 | } 88 | #endif 89 | 90 | #endif /*__SYSTEM_STM32F4XX_H */ 91 | 92 | /** 93 | * @} 94 | */ 95 | 96 | /** 97 | * @} 98 | */ 99 | /******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/ 100 | -------------------------------------------------------------------------------- /firmware/third_party/lwip-1.4.0/src/include/ipv6/lwip/inet.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001-2004 Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, 6 | * are permitted provided that the following conditions are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 3. The name of the author may not be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 19 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 21 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 24 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 25 | * OF SUCH DAMAGE. 26 | * 27 | * This file is part of the lwIP TCP/IP stack. 28 | * 29 | * Author: Adam Dunkels 30 | * 31 | */ 32 | #ifndef __LWIP_INET_H__ 33 | #define __LWIP_INET_H__ 34 | 35 | #include "lwip/opt.h" 36 | #include "lwip/pbuf.h" 37 | #include "lwip/ip_addr.h" 38 | 39 | #ifdef __cplusplus 40 | extern "C" { 41 | #endif 42 | 43 | u16_t inet_chksum(void *data, u16_t len); 44 | u16_t inet_chksum_pbuf(struct pbuf *p); 45 | u16_t inet_chksum_pseudo(struct pbuf *p, 46 | struct ip_addr *src, struct ip_addr *dest, 47 | u8_t proto, u32_t proto_len); 48 | 49 | u32_t inet_addr(const char *cp); 50 | s8_t inet_aton(const char *cp, struct in_addr *addr); 51 | 52 | #ifndef _MACHINE_ENDIAN_H_ 53 | #ifndef _NETINET_IN_H 54 | #ifndef _LINUX_BYTEORDER_GENERIC_H 55 | u16_t htons(u16_t n); 56 | u16_t ntohs(u16_t n); 57 | u32_t htonl(u32_t n); 58 | u32_t ntohl(u32_t n); 59 | #endif /* _LINUX_BYTEORDER_GENERIC_H */ 60 | #endif /* _NETINET_IN_H */ 61 | #endif /* _MACHINE_ENDIAN_H_ */ 62 | 63 | #ifdef __cplusplus 64 | } 65 | #endif 66 | 67 | #endif /* __LWIP_INET_H__ */ 68 | 69 | -------------------------------------------------------------------------------- /firmware/third_party/lwip-1.4.0/port/STM32F4x7/arch/sys_arch.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001-2003 Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, 6 | * are permitted provided that the following conditions are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 3. The name of the author may not be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 19 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 21 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 24 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 25 | * OF SUCH DAMAGE. 26 | * 27 | * This file is part of the lwIP TCP/IP stack. 28 | * 29 | * Author: Adam Dunkels 30 | * 31 | */ 32 | #ifndef __SYS_RTXC_H__ 33 | #define __SYS_RTXC_H__ 34 | 35 | #include "FreeRTOS.h" 36 | #include "task.h" 37 | #include "queue.h" 38 | #include "semphr.h" 39 | 40 | #define SYS_MBOX_NULL (xQueueHandle)0 41 | #define SYS_SEM_NULL (xSemaphoreHandle)0 42 | #define SYS_DEFAULT_THREAD_STACK_DEPTH configMINIMAL_STACK_SIZE 43 | 44 | typedef xSemaphoreHandle sys_sem_t; 45 | typedef xQueueHandle sys_mbox_t; 46 | typedef xTaskHandle sys_thread_t; 47 | 48 | typedef struct _sys_arch_state_t 49 | { 50 | // Task creation data. 51 | char cTaskName[configMAX_TASK_NAME_LEN]; 52 | unsigned short nStackDepth; 53 | unsigned short nTaskCount; 54 | } sys_arch_state_t; 55 | 56 | 57 | 58 | //extern sys_arch_state_t s_sys_arch_state; 59 | 60 | //void sys_set_default_state(); 61 | //void sys_set_state(signed char *pTaskName, unsigned short nStackSize); 62 | 63 | /* Message queue constants. */ 64 | #define archMESG_QUEUE_LENGTH ( 6 ) 65 | #endif /* __SYS_RTXC_H__ */ 66 | 67 | -------------------------------------------------------------------------------- /firmware/STM32F4xx_DSP_StdPeriph_Lib_V1.8.0/Libraries/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_crc.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file stm32f4xx_crc.h 4 | * @author MCD Application Team 5 | * @version V1.8.0 6 | * @date 04-November-2016 7 | * @brief This file contains all the functions prototypes for the CRC firmware 8 | * library. 9 | ****************************************************************************** 10 | * @attention 11 | * 12 | *

© COPYRIGHT 2016 STMicroelectronics

13 | * 14 | * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License"); 15 | * You may not use this file except in compliance with the License. 16 | * You may obtain a copy of the License at: 17 | * 18 | * http://www.st.com/software_license_agreement_liberty_v2 19 | * 20 | * Unless required by applicable law or agreed to in writing, software 21 | * distributed under the License is distributed on an "AS IS" BASIS, 22 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 23 | * See the License for the specific language governing permissions and 24 | * limitations under the License. 25 | * 26 | ****************************************************************************** 27 | */ 28 | 29 | /* Define to prevent recursive inclusion -------------------------------------*/ 30 | #ifndef __STM32F4xx_CRC_H 31 | #define __STM32F4xx_CRC_H 32 | 33 | #ifdef __cplusplus 34 | extern "C" { 35 | #endif 36 | 37 | /* Includes ------------------------------------------------------------------*/ 38 | #include "stm32f4xx.h" 39 | 40 | /** @addtogroup STM32F4xx_StdPeriph_Driver 41 | * @{ 42 | */ 43 | 44 | /** @addtogroup CRC 45 | * @{ 46 | */ 47 | 48 | /* Exported types ------------------------------------------------------------*/ 49 | /* Exported constants --------------------------------------------------------*/ 50 | 51 | /** @defgroup CRC_Exported_Constants 52 | * @{ 53 | */ 54 | 55 | /** 56 | * @} 57 | */ 58 | 59 | /* Exported macro ------------------------------------------------------------*/ 60 | /* Exported functions --------------------------------------------------------*/ 61 | 62 | void CRC_ResetDR(void); 63 | uint32_t CRC_CalcCRC(uint32_t Data); 64 | uint32_t CRC_CalcBlockCRC(uint32_t pBuffer[], uint32_t BufferLength); 65 | uint32_t CRC_GetCRC(void); 66 | void CRC_SetIDRegister(uint8_t IDValue); 67 | uint8_t CRC_GetIDRegister(void); 68 | 69 | #ifdef __cplusplus 70 | } 71 | #endif 72 | 73 | #endif /* __STM32F4xx_CRC_H */ 74 | 75 | /** 76 | * @} 77 | */ 78 | 79 | /** 80 | * @} 81 | */ 82 | 83 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 84 | -------------------------------------------------------------------------------- /firmware/STM32F4xx_DSP_StdPeriph_Lib_V1.8.0/Libraries/CMSIS/DSP_Lib/Source/ControllerFunctions/arm_pid_reset_q15.c: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- 2 | * Copyright (C) 2010-2014 ARM Limited. All rights reserved. 3 | * 4 | * $Date: 19. March 2015 5 | * $Revision: V.1.4.5 6 | * 7 | * Project: CMSIS DSP Library 8 | * Title: arm_pid_reset_q15.c 9 | * 10 | * Description: Q15 PID Control reset function 11 | * 12 | * Target Processor: Cortex-M4/Cortex-M3/Cortex-M0 13 | * 14 | * Redistribution and use in source and binary forms, with or without 15 | * modification, are permitted provided that the following conditions 16 | * are met: 17 | * - Redistributions of source code must retain the above copyright 18 | * notice, this list of conditions and the following disclaimer. 19 | * - Redistributions in binary form must reproduce the above copyright 20 | * notice, this list of conditions and the following disclaimer in 21 | * the documentation and/or other materials provided with the 22 | * distribution. 23 | * - Neither the name of ARM LIMITED nor the names of its contributors 24 | * may be used to endorse or promote products derived from this 25 | * software without specific prior written permission. 26 | * 27 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 28 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 29 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 30 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 31 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 32 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 33 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 34 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 35 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 36 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 37 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 38 | * POSSIBILITY OF SUCH DAMAGE. 39 | * -------------------------------------------------------------------- */ 40 | 41 | #include "arm_math.h" 42 | 43 | /** 44 | * @addtogroup PID 45 | * @{ 46 | */ 47 | 48 | /** 49 | * @brief Reset function for the Q15 PID Control. 50 | * @param[in] *S Instance pointer of PID control data structure. 51 | * @return none. 52 | * \par Description: 53 | * The function resets the state buffer to zeros. 54 | */ 55 | void arm_pid_reset_q15( 56 | arm_pid_instance_q15 * S) 57 | { 58 | /* Reset state to zero, The size will be always 3 samples */ 59 | memset(S->state, 0, 3u * sizeof(q15_t)); 60 | } 61 | 62 | /** 63 | * @} end of PID group 64 | */ 65 | -------------------------------------------------------------------------------- /firmware/STM32F4xx_DSP_StdPeriph_Lib_V1.8.0/Libraries/CMSIS/Device/ST/STM32F4xx/Include/system_stm32f4xx.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file system_stm32f4xx.h 4 | * @author MCD Application Team 5 | * @version V1.8.0 6 | * @date 09-November-2016 7 | * @brief CMSIS Cortex-M4 Device System Source File for STM32F4xx devices. 8 | ****************************************************************************** 9 | * @attention 10 | * 11 | *

© COPYRIGHT 2016 STMicroelectronics

12 | * 13 | * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License"); 14 | * You may not use this file except in compliance with the License. 15 | * You may obtain a copy of the License at: 16 | * 17 | * http://www.st.com/software_license_agreement_liberty_v2 18 | * 19 | * Unless required by applicable law or agreed to in writing, software 20 | * distributed under the License is distributed on an "AS IS" BASIS, 21 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 22 | * See the License for the specific language governing permissions and 23 | * limitations under the License. 24 | * 25 | ****************************************************************************** 26 | */ 27 | 28 | /** @addtogroup CMSIS 29 | * @{ 30 | */ 31 | 32 | /** @addtogroup stm32f4xx_system 33 | * @{ 34 | */ 35 | 36 | /** 37 | * @brief Define to prevent recursive inclusion 38 | */ 39 | #ifndef __SYSTEM_STM32F4XX_H 40 | #define __SYSTEM_STM32F4XX_H 41 | 42 | #ifdef __cplusplus 43 | extern "C" { 44 | #endif 45 | 46 | /** @addtogroup STM32F4xx_System_Includes 47 | * @{ 48 | */ 49 | 50 | /** 51 | * @} 52 | */ 53 | 54 | 55 | /** @addtogroup STM32F4xx_System_Exported_types 56 | * @{ 57 | */ 58 | 59 | extern uint32_t SystemCoreClock; /*!< System Clock Frequency (Core Clock) */ 60 | 61 | 62 | /** 63 | * @} 64 | */ 65 | 66 | /** @addtogroup STM32F4xx_System_Exported_Constants 67 | * @{ 68 | */ 69 | 70 | /** 71 | * @} 72 | */ 73 | 74 | /** @addtogroup STM32F4xx_System_Exported_Macros 75 | * @{ 76 | */ 77 | 78 | /** 79 | * @} 80 | */ 81 | 82 | /** @addtogroup STM32F4xx_System_Exported_Functions 83 | * @{ 84 | */ 85 | 86 | extern void SystemInit(void); 87 | extern void SystemCoreClockUpdate(void); 88 | /** 89 | * @} 90 | */ 91 | 92 | #ifdef __cplusplus 93 | } 94 | #endif 95 | 96 | #endif /*__SYSTEM_STM32F4XX_H */ 97 | 98 | /** 99 | * @} 100 | */ 101 | 102 | /** 103 | * @} 104 | */ 105 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 106 | -------------------------------------------------------------------------------- /firmware/STM32F4xx_DSP_StdPeriph_Lib_V1.8.0/Libraries/CMSIS/DSP_Lib/Source/ControllerFunctions/arm_pid_reset_q31.c: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- 2 | * Copyright (C) 2010-2014 ARM Limited. All rights reserved. 3 | * 4 | * $Date: 19. March 2015 5 | * $Revision: V.1.4.5 6 | * 7 | * Project: CMSIS DSP Library 8 | * Title: arm_pid_reset_q31.c 9 | * 10 | * Description: Q31 PID Control reset function 11 | * 12 | * Target Processor: Cortex-M4/Cortex-M3/Cortex-M0 13 | * 14 | * Redistribution and use in source and binary forms, with or without 15 | * modification, are permitted provided that the following conditions 16 | * are met: 17 | * - Redistributions of source code must retain the above copyright 18 | * notice, this list of conditions and the following disclaimer. 19 | * - Redistributions in binary form must reproduce the above copyright 20 | * notice, this list of conditions and the following disclaimer in 21 | * the documentation and/or other materials provided with the 22 | * distribution. 23 | * - Neither the name of ARM LIMITED nor the names of its contributors 24 | * may be used to endorse or promote products derived from this 25 | * software without specific prior written permission. 26 | * 27 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 28 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 29 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 30 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 31 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 32 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 33 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 34 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 35 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 36 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 37 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 38 | * POSSIBILITY OF SUCH DAMAGE. 39 | * ------------------------------------------------------------------- */ 40 | 41 | #include "arm_math.h" 42 | 43 | /** 44 | * @addtogroup PID 45 | * @{ 46 | */ 47 | 48 | /** 49 | * @brief Reset function for the Q31 PID Control. 50 | * @param[in] *S Instance pointer of PID control data structure. 51 | * @return none. 52 | * \par Description: 53 | * The function resets the state buffer to zeros. 54 | */ 55 | void arm_pid_reset_q31( 56 | arm_pid_instance_q31 * S) 57 | { 58 | 59 | /* Clear the state buffer. The size will be always 3 samples */ 60 | memset(S->state, 0, 3u * sizeof(q31_t)); 61 | } 62 | 63 | /** 64 | * @} end of PID group 65 | */ 66 | -------------------------------------------------------------------------------- /firmware/STM32F4xx_DSP_StdPeriph_Lib_V1.8.0/Libraries/CMSIS/DSP_Lib/Source/ControllerFunctions/arm_pid_reset_f32.c: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- 2 | * Copyright (C) 2010-2014 ARM Limited. All rights reserved. 3 | * 4 | * $Date: 19. March 2015 5 | * $Revision: V.1.4.5 6 | * 7 | * Project: CMSIS DSP Library 8 | * Title: arm_pid_reset_f32.c 9 | * 10 | * Description: Floating-point PID Control reset function 11 | * 12 | * Target Processor: Cortex-M4/Cortex-M3/Cortex-M0 13 | * 14 | * Redistribution and use in source and binary forms, with or without 15 | * modification, are permitted provided that the following conditions 16 | * are met: 17 | * - Redistributions of source code must retain the above copyright 18 | * notice, this list of conditions and the following disclaimer. 19 | * - Redistributions in binary form must reproduce the above copyright 20 | * notice, this list of conditions and the following disclaimer in 21 | * the documentation and/or other materials provided with the 22 | * distribution. 23 | * - Neither the name of ARM LIMITED nor the names of its contributors 24 | * may be used to endorse or promote products derived from this 25 | * software without specific prior written permission. 26 | * 27 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 28 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 29 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 30 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 31 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 32 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 33 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 34 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 35 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 36 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 37 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 38 | * POSSIBILITY OF SUCH DAMAGE. 39 | * ------------------------------------------------------------------- */ 40 | 41 | #include "arm_math.h" 42 | 43 | /** 44 | * @addtogroup PID 45 | * @{ 46 | */ 47 | 48 | /** 49 | * @brief Reset function for the floating-point PID Control. 50 | * @param[in] *S Instance pointer of PID control data structure. 51 | * @return none. 52 | * \par Description: 53 | * The function resets the state buffer to zeros. 54 | */ 55 | void arm_pid_reset_f32( 56 | arm_pid_instance_f32 * S) 57 | { 58 | 59 | /* Clear the state buffer. The size will be always 3 samples */ 60 | memset(S->state, 0, 3u * sizeof(float32_t)); 61 | } 62 | 63 | /** 64 | * @} end of PID group 65 | */ 66 | -------------------------------------------------------------------------------- /firmware/std_io.c: -------------------------------------------------------------------------------- 1 | 2 | //MIT License 3 | // 4 | //Copyright (c) 2017 tvelliott 5 | // 6 | //Permission is hereby granted, free of charge, to any person obtaining a copy 7 | //of this software and associated documentation files (the "Software"), to deal 8 | //in the Software without restriction, including without limitation the rights 9 | //to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | //copies of the Software, and to permit persons to whom the Software is 11 | //furnished to do so, subject to the following conditions: 12 | // 13 | //The above copyright notice and this permission notice shall be included in all 14 | //copies or substantial portions of the Software. 15 | // 16 | //THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | //IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | //FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | //AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | //LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | //OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | //SOFTWARE. 23 | 24 | #include 25 | #include 26 | #include 27 | #include "std_io.h" 28 | #include "global.h" 29 | 30 | uint8_t net_buffer[MAX_NET_BUFFER]; 31 | extern int telnet_session_count; 32 | 33 | /////////////////////////////////////////////////////////////////////////////// 34 | /////////////////////////////////////////////////////////////////////////////// 35 | int32_t tn_scanf( uint8_t *outbuffer, const char * format, ...) 36 | { 37 | uint16_t ret=0; 38 | 39 | va_list args; 40 | 41 | va_start(args,format); 42 | 43 | outbuffer[MAX_PRINTF_BUFFER-1]=0; 44 | 45 | ret = vsscanf(outbuffer, format, args); 46 | 47 | va_end(args); 48 | 49 | return ret; //length sent to device 50 | } 51 | 52 | /////////////////////////////////////////////////////////////////////////////// 53 | /////////////////////////////////////////////////////////////////////////////// 54 | int get_print_buffer_left() 55 | { 56 | return MAX_NET_BUFFER-strlen(net_buffer); 57 | } 58 | 59 | /////////////////////////////////////////////////////////////////////////////// 60 | /////////////////////////////////////////////////////////////////////////////// 61 | int printf( const char * format, ...) 62 | { 63 | 64 | uint16_t ret=0; 65 | 66 | 67 | va_list args; 68 | 69 | uint8_t printf_buf[MAX_PRINTF_BUFFER]; 70 | 71 | va_start(args,format); 72 | 73 | ret = vsnprintf(printf_buf, sizeof(printf_buf)-1, format, args); 74 | printf_buf[MAX_PRINTF_BUFFER-1] = 0; 75 | 76 | int len1 = strlen(net_buffer); 77 | int len2 = strlen(printf_buf); 78 | 79 | 80 | if(len1+len2 < MAX_NET_BUFFER) { 81 | net_buffer[len1+len2]=0x00; 82 | strcat(net_buffer, printf_buf); 83 | } 84 | 85 | va_end(args); 86 | 87 | return ret; //length sent to device 88 | } 89 | -------------------------------------------------------------------------------- /gerber/dsp_ice_rev1.GPB: -------------------------------------------------------------------------------- 1 | G75* 2 | %MOIN*% 3 | %OFA0B0*% 4 | %FSLAX25Y25*% 5 | %IPPOS*% 6 | %LPD*% 7 | %AMOC8* 8 | 5,1,8,0,0,1.08239X$1,22.5* 9 | % 10 | %ADD10C,0.01819*% 11 | %ADD11C,0.00904*% 12 | D10* 13 | X0137583Y0129554D02* 14 | X0137583Y0131870D01* 15 | X0140017Y0131870D01* 16 | X0140017Y0129554D01* 17 | X0137583Y0129554D01* 18 | X0137583Y0131372D02* 19 | X0140017Y0131372D01* 20 | X0137583Y0136444D02* 21 | X0137583Y0138760D01* 22 | X0140017Y0138760D01* 23 | X0140017Y0136444D01* 24 | X0137583Y0136444D01* 25 | X0137583Y0138262D02* 26 | X0140017Y0138262D01* 27 | X0137483Y0146104D02* 28 | X0137483Y0148420D01* 29 | X0139917Y0148420D01* 30 | X0139917Y0146104D01* 31 | X0137483Y0146104D01* 32 | X0137483Y0147922D02* 33 | X0139917Y0147922D01* 34 | X0137483Y0152994D02* 35 | X0137483Y0155310D01* 36 | X0139917Y0155310D01* 37 | X0139917Y0152994D01* 38 | X0137483Y0152994D01* 39 | X0137483Y0154812D02* 40 | X0139917Y0154812D01* 41 | X0116683Y0143760D02* 42 | X0116683Y0141444D01* 43 | X0116683Y0143760D02* 44 | X0119117Y0143760D01* 45 | X0119117Y0141444D01* 46 | X0116683Y0141444D01* 47 | X0116683Y0143262D02* 48 | X0119117Y0143262D01* 49 | X0116683Y0136870D02* 50 | X0116683Y0134554D01* 51 | X0116683Y0136870D02* 52 | X0119117Y0136870D01* 53 | X0119117Y0134554D01* 54 | X0116683Y0134554D01* 55 | X0116683Y0136372D02* 56 | X0119117Y0136372D01* 57 | X0164397Y0188240D02* 58 | X0166713Y0188240D01* 59 | X0164397Y0188240D02* 60 | X0164397Y0190674D01* 61 | X0166713Y0190674D01* 62 | X0166713Y0188240D01* 63 | X0166713Y0190058D02* 64 | X0164397Y0190058D01* 65 | X0171287Y0188240D02* 66 | X0173603Y0188240D01* 67 | X0171287Y0188240D02* 68 | X0171287Y0190674D01* 69 | X0173603Y0190674D01* 70 | X0173603Y0188240D01* 71 | X0173603Y0190058D02* 72 | X0171287Y0190058D01* 73 | X0129717Y0193154D02* 74 | X0129717Y0195470D01* 75 | X0129717Y0193154D02* 76 | X0127283Y0193154D01* 77 | X0127283Y0195470D01* 78 | X0129717Y0195470D01* 79 | X0129717Y0194972D02* 80 | X0127283Y0194972D01* 81 | X0129717Y0200044D02* 82 | X0129717Y0202360D01* 83 | X0129717Y0200044D02* 84 | X0127283Y0200044D01* 85 | X0127283Y0202360D01* 86 | X0129717Y0202360D01* 87 | X0129717Y0201862D02* 88 | X0127283Y0201862D01* 89 | D11* 90 | X0172628Y0201266D02* 91 | X0174578Y0201266D01* 92 | X0174578Y0200116D01* 93 | X0172628Y0200116D01* 94 | X0172628Y0201266D01* 95 | X0172628Y0201019D02* 96 | X0174578Y0201019D01* 97 | X0174578Y0204503D02* 98 | X0172628Y0204503D01* 99 | X0174578Y0204503D02* 100 | X0174578Y0203353D01* 101 | X0172628Y0203353D01* 102 | X0172628Y0204503D01* 103 | X0172628Y0204256D02* 104 | X0174578Y0204256D01* 105 | X0179222Y0204503D02* 106 | X0181172Y0204503D01* 107 | X0181172Y0203353D01* 108 | X0179222Y0203353D01* 109 | X0179222Y0204503D01* 110 | X0179222Y0204256D02* 111 | X0181172Y0204256D01* 112 | X0181172Y0201266D02* 113 | X0179222Y0201266D01* 114 | X0181172Y0201266D02* 115 | X0181172Y0200116D01* 116 | X0179222Y0200116D01* 117 | X0179222Y0201266D01* 118 | X0179222Y0201019D02* 119 | X0181172Y0201019D01* 120 | M02* 121 | -------------------------------------------------------------------------------- /firmware/third_party/lwip-1.4.0/src/core/ipv6/ip6_addr.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001-2004 Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, 6 | * are permitted provided that the following conditions are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 3. The name of the author may not be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 19 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 21 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 24 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 25 | * OF SUCH DAMAGE. 26 | * 27 | * This file is part of the lwIP TCP/IP stack. 28 | * 29 | * Author: Adam Dunkels 30 | * 31 | */ 32 | 33 | #include "lwip/opt.h" 34 | #include "lwip/ip_addr.h" 35 | #include "lwip/inet.h" 36 | 37 | u8_t 38 | ip_addr_netcmp(struct ip_addr *addr1, struct ip_addr *addr2, 39 | struct ip_addr *mask) 40 | { 41 | return((addr1->addr[0] & mask->addr[0]) == (addr2->addr[0] & mask->addr[0]) && 42 | (addr1->addr[1] & mask->addr[1]) == (addr2->addr[1] & mask->addr[1]) && 43 | (addr1->addr[2] & mask->addr[2]) == (addr2->addr[2] & mask->addr[2]) && 44 | (addr1->addr[3] & mask->addr[3]) == (addr2->addr[3] & mask->addr[3])); 45 | 46 | } 47 | 48 | u8_t 49 | ip_addr_cmp(struct ip_addr *addr1, struct ip_addr *addr2) 50 | { 51 | return(addr1->addr[0] == addr2->addr[0] && 52 | addr1->addr[1] == addr2->addr[1] && 53 | addr1->addr[2] == addr2->addr[2] && 54 | addr1->addr[3] == addr2->addr[3]); 55 | } 56 | 57 | void 58 | ip_addr_set(struct ip_addr *dest, struct ip_addr *src) 59 | { 60 | SMEMCPY(dest, src, sizeof(struct ip_addr)); 61 | /* dest->addr[0] = src->addr[0]; 62 | dest->addr[1] = src->addr[1]; 63 | dest->addr[2] = src->addr[2]; 64 | dest->addr[3] = src->addr[3];*/ 65 | } 66 | 67 | u8_t 68 | ip_addr_isany(struct ip_addr *addr) 69 | { 70 | if (addr == NULL) return 1; 71 | return((addr->addr[0] | addr->addr[1] | addr->addr[2] | addr->addr[3]) == 0); 72 | } 73 | -------------------------------------------------------------------------------- /firmware/third_party/lwip-1.4.0/src/netif/ppp/pppdebug.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * pppdebug.h - System debugging utilities. 3 | * 4 | * Copyright (c) 2003 by Marc Boucher, Services Informatiques (MBSI) inc. 5 | * portions Copyright (c) 1998 Global Election Systems Inc. 6 | * portions Copyright (c) 2001 by Cognizant Pty Ltd. 7 | * 8 | * The authors hereby grant permission to use, copy, modify, distribute, 9 | * and license this software and its documentation for any purpose, provided 10 | * that existing copyright notices are retained in all copies and that this 11 | * notice and the following disclaimer are included verbatim in any 12 | * distributions. No written agreement, license, or royalty fee is required 13 | * for any of the authorized uses. 14 | * 15 | * THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS *AS IS* AND ANY EXPRESS OR 16 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 17 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 18 | * IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 19 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 20 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 21 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 22 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 24 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 | * 26 | ****************************************************************************** 27 | * REVISION HISTORY (please don't use tabs!) 28 | * 29 | * 03-01-01 Marc Boucher 30 | * Ported to lwIP. 31 | * 98-07-29 Guy Lancaster , Global Election Systems Inc. 32 | * Original. 33 | * 34 | ***************************************************************************** 35 | */ 36 | #ifndef PPPDEBUG_H 37 | #define PPPDEBUG_H 38 | 39 | /* Trace levels. */ 40 | #define LOG_CRITICAL (PPP_DEBUG | LWIP_DBG_LEVEL_SEVERE) 41 | #define LOG_ERR (PPP_DEBUG | LWIP_DBG_LEVEL_SEVERE) 42 | #define LOG_NOTICE (PPP_DEBUG | LWIP_DBG_LEVEL_WARNING) 43 | #define LOG_WARNING (PPP_DEBUG | LWIP_DBG_LEVEL_WARNING) 44 | #define LOG_INFO (PPP_DEBUG) 45 | #define LOG_DETAIL (PPP_DEBUG) 46 | #define LOG_DEBUG (PPP_DEBUG) 47 | 48 | 49 | #define TRACELCP PPP_DEBUG 50 | 51 | #if PPP_DEBUG 52 | 53 | #define AUTHDEBUG(a, b) LWIP_DEBUGF(a, b) 54 | #define IPCPDEBUG(a, b) LWIP_DEBUGF(a, b) 55 | #define UPAPDEBUG(a, b) LWIP_DEBUGF(a, b) 56 | #define LCPDEBUG(a, b) LWIP_DEBUGF(a, b) 57 | #define FSMDEBUG(a, b) LWIP_DEBUGF(a, b) 58 | #define CHAPDEBUG(a, b) LWIP_DEBUGF(a, b) 59 | #define PPPDEBUG(a, b) LWIP_DEBUGF(a, b) 60 | 61 | #else /* PPP_DEBUG */ 62 | 63 | #define AUTHDEBUG(a, b) 64 | #define IPCPDEBUG(a, b) 65 | #define UPAPDEBUG(a, b) 66 | #define LCPDEBUG(a, b) 67 | #define FSMDEBUG(a, b) 68 | #define CHAPDEBUG(a, b) 69 | #define PPPDEBUG(a, b) 70 | 71 | #endif /* PPP_DEBUG */ 72 | 73 | #endif /* PPPDEBUG_H */ 74 | -------------------------------------------------------------------------------- /firmware/third_party/lwip-1.4.0/src/netif/ppp/magic.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * magic.h - Network Random Number Generator header file. 3 | * 4 | * Copyright (c) 2003 by Marc Boucher, Services Informatiques (MBSI) inc. 5 | * portions Copyright (c) 1997 Global Election Systems Inc. 6 | * 7 | * The authors hereby grant permission to use, copy, modify, distribute, 8 | * and license this software and its documentation for any purpose, provided 9 | * that existing copyright notices are retained in all copies and that this 10 | * notice and the following disclaimer are included verbatim in any 11 | * distributions. No written agreement, license, or royalty fee is required 12 | * for any of the authorized uses. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS *AS IS* AND ANY EXPRESS OR 15 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 16 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 17 | * IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 18 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 19 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 20 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 21 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 23 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | * 25 | ****************************************************************************** 26 | * REVISION HISTORY 27 | * 28 | * 03-01-01 Marc Boucher 29 | * Ported to lwIP. 30 | * 97-12-04 Guy Lancaster , Global Election Systems Inc. 31 | * Original derived from BSD codes. 32 | *****************************************************************************/ 33 | /* 34 | * magic.h - PPP Magic Number definitions. 35 | * 36 | * Copyright (c) 1989 Carnegie Mellon University. 37 | * All rights reserved. 38 | * 39 | * Redistribution and use in source and binary forms are permitted 40 | * provided that the above copyright notice and this paragraph are 41 | * duplicated in all such forms and that any documentation, 42 | * advertising materials, and other materials related to such 43 | * distribution and use acknowledge that the software was developed 44 | * by Carnegie Mellon University. The name of the 45 | * University may not be used to endorse or promote products derived 46 | * from this software without specific prior written permission. 47 | * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR 48 | * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED 49 | * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. 50 | * 51 | * $Id: magic.h,v 1.3 2010/01/18 20:49:43 goldsimon Exp $ 52 | */ 53 | 54 | #ifndef MAGIC_H 55 | #define MAGIC_H 56 | 57 | /* Initialize the magic number generator */ 58 | void magicInit(void); 59 | 60 | /* Returns the next magic number */ 61 | u32_t magic(void); 62 | 63 | #endif /* MAGIC_H */ 64 | -------------------------------------------------------------------------------- /firmware/global.h: -------------------------------------------------------------------------------- 1 | 2 | //MIT License 3 | // 4 | //Copyright (c) 2017 tvelliott 5 | // 6 | //Permission is hereby granted, free of charge, to any person obtaining a copy 7 | //of this software and associated documentation files (the "Software"), to deal 8 | //in the Software without restriction, including without limitation the rights 9 | //to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | //copies of the Software, and to permit persons to whom the Software is 11 | //furnished to do so, subject to the following conditions: 12 | // 13 | //The above copyright notice and this permission notice shall be included in all 14 | //copies or substantial portions of the Software. 15 | // 16 | //THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | //IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | //FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | //AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | //LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | //OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | //SOFTWARE. 23 | 24 | #ifndef global_var_h 25 | #define global_var_h 26 | 27 | #include "arm_math.h" 28 | #include "arm_const_structs.h" 29 | 30 | #include 31 | #include 32 | #include 33 | 34 | #include "stm32f4x7_eth.h" 35 | #include "stm32f4x7_eth_bsp.h" 36 | #include "stm32f4xx_rcc.h" 37 | 38 | #ifndef htons 39 | #define htons(A) ((((uint16_t)(A) & 0xff00) >> 8) | \ 40 | (((uint16_t)(A) & 0x00ff) << 8)) 41 | #endif 42 | 43 | #ifndef htonl 44 | #define htonl(A) ((((uint32_t)(A) & 0xff000000) >> 24) | \ 45 | (((uint32_t)(A) & 0x00ff0000) >> 8) | \ 46 | (((uint32_t)(A) & 0x0000ff00) << 8) | \ 47 | (((uint32_t)(A) & 0x000000ff) << 24)) 48 | #endif 49 | 50 | /* Global pointers on Tx and Rx descriptor used to track transmit and receive descriptors */ 51 | extern __IO ETH_DMADESCTypeDef *DMATxDescToSet; 52 | extern __IO ETH_DMADESCTypeDef *DMARxDescToGet; 53 | /* Structure used to hold the last received packet descriptors info */ 54 | 55 | extern __IO ETH_DMADESCTypeDef *DMATxNextDesc; 56 | __IO ETH_DMADESCTypeDef *DMARxNextDesc; 57 | 58 | extern ETH_DMA_Rx_Frame_infos RX_Frame_Descriptor; 59 | extern __IO ETH_DMA_Rx_Frame_infos *DMA_RX_FRAME_infos; 60 | extern __IO uint32_t Frame_Rx_index; 61 | 62 | extern ETH_DMADESCTypeDef DMARxDscrTab[ETH_RXBUFNB] __attribute__ ((aligned (4))); /* Ethernet Rx DMA Descriptor */ 63 | extern ETH_DMADESCTypeDef DMATxDscrTab[ETH_TXBUFNB] __attribute__ ((aligned (4))); /* Ethernet Tx DMA Descriptor */ 64 | extern uint8_t Rx_Buff[ETH_RXBUFNB][ETH_RX_BUF_SIZE] __attribute__ ((aligned (4))); /* Ethernet Receive Buffer */ 65 | extern uint8_t Tx_Buff[ETH_TXBUFNB][ETH_TX_BUF_SIZE] __attribute__ ((aligned (4))); /* Ethernet Transmit Buffer */ 66 | 67 | 68 | extern const uint8_t fw_version[]; 69 | 70 | #define PROTO(x) x 71 | #include "protos/main_proto.h" 72 | 73 | #endif 74 | -------------------------------------------------------------------------------- /firmware/third_party/lwip-1.4.0/src/netif/ppp/md5.h: -------------------------------------------------------------------------------- 1 | /* 2 | *********************************************************************** 3 | ** md5.h -- header file for implementation of MD5 ** 4 | ** RSA Data Security, Inc. MD5 Message-Digest Algorithm ** 5 | ** Created: 2/17/90 RLR ** 6 | ** Revised: 12/27/90 SRD,AJ,BSK,JT Reference C version ** 7 | ** Revised (for MD5): RLR 4/27/91 ** 8 | ** -- G modified to have y&~z instead of y&z ** 9 | ** -- FF, GG, HH modified to add in last register done ** 10 | ** -- Access pattern: round 2 works mod 5, round 3 works mod 3 ** 11 | ** -- distinct additive constant for each step ** 12 | ** -- round 4 added, working mod 7 ** 13 | *********************************************************************** 14 | */ 15 | 16 | /* 17 | *********************************************************************** 18 | ** Copyright (C) 1990, RSA Data Security, Inc. All rights reserved. ** 19 | ** ** 20 | ** License to copy and use this software is granted provided that ** 21 | ** it is identified as the "RSA Data Security, Inc. MD5 Message- ** 22 | ** Digest Algorithm" in all material mentioning or referencing this ** 23 | ** software or this function. ** 24 | ** ** 25 | ** License is also granted to make and use derivative works ** 26 | ** provided that such works are identified as "derived from the RSA ** 27 | ** Data Security, Inc. MD5 Message-Digest Algorithm" in all ** 28 | ** material mentioning or referencing the derived work. ** 29 | ** ** 30 | ** RSA Data Security, Inc. makes no representations concerning ** 31 | ** either the merchantability of this software or the suitability ** 32 | ** of this software for any particular purpose. It is provided "as ** 33 | ** is" without express or implied warranty of any kind. ** 34 | ** ** 35 | ** These notices must be retained in any copies of any part of this ** 36 | ** documentation and/or software. ** 37 | *********************************************************************** 38 | */ 39 | 40 | #ifndef MD5_H 41 | #define MD5_H 42 | 43 | /* Data structure for MD5 (Message-Digest) computation */ 44 | typedef struct { 45 | u32_t i[2]; /* number of _bits_ handled mod 2^64 */ 46 | u32_t buf[4]; /* scratch buffer */ 47 | unsigned char in[64]; /* input buffer */ 48 | unsigned char digest[16]; /* actual digest after MD5Final call */ 49 | } MD5_CTX; 50 | 51 | void MD5Init ( MD5_CTX *mdContext); 52 | void MD5Update( MD5_CTX *mdContext, unsigned char *inBuf, unsigned int inLen); 53 | void MD5Final ( unsigned char hash[], MD5_CTX *mdContext); 54 | 55 | #endif /* MD5_H */ 56 | -------------------------------------------------------------------------------- /firmware/third_party/lwip-1.4.0/src/netif/ppp/chpms.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * chpms.h - Network Microsoft Challenge Handshake Protocol header file. 3 | * 4 | * Copyright (c) 2003 by Marc Boucher, Services Informatiques (MBSI) inc. 5 | * portions Copyright (c) 1998 Global Election Systems Inc. 6 | * 7 | * The authors hereby grant permission to use, copy, modify, distribute, 8 | * and license this software and its documentation for any purpose, provided 9 | * that existing copyright notices are retained in all copies and that this 10 | * notice and the following disclaimer are included verbatim in any 11 | * distributions. No written agreement, license, or royalty fee is required 12 | * for any of the authorized uses. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS *AS IS* AND ANY EXPRESS OR 15 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 16 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 17 | * IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 18 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 19 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 20 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 21 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 23 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | * 25 | ****************************************************************************** 26 | * REVISION HISTORY 27 | * 28 | * 03-01-01 Marc Boucher 29 | * Ported to lwIP. 30 | * 98-01-30 Guy Lancaster , Global Election Systems Inc. 31 | * Original built from BSD network code. 32 | ******************************************************************************/ 33 | /* 34 | * chap.h - Challenge Handshake Authentication Protocol definitions. 35 | * 36 | * Copyright (c) 1995 Eric Rosenquist, Strata Software Limited. 37 | * http://www.strataware.com/ 38 | * 39 | * All rights reserved. 40 | * 41 | * Redistribution and use in source and binary forms are permitted 42 | * provided that the above copyright notice and this paragraph are 43 | * duplicated in all such forms and that any documentation, 44 | * advertising materials, and other materials related to such 45 | * distribution and use acknowledge that the software was developed 46 | * by Eric Rosenquist. The name of the author may not be used to 47 | * endorse or promote products derived from this software without 48 | * specific prior written permission. 49 | * 50 | * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR 51 | * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED 52 | * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. 53 | * 54 | * $Id: chpms.h,v 1.5 2007/12/19 20:47:23 fbernon Exp $ 55 | */ 56 | 57 | #ifndef CHPMS_H 58 | #define CHPMS_H 59 | 60 | #define MAX_NT_PASSWORD 256 /* Maximum number of (Unicode) chars in an NT password */ 61 | 62 | void ChapMS (chap_state *, char *, int, char *, int); 63 | 64 | #endif /* CHPMS_H */ 65 | -------------------------------------------------------------------------------- /firmware/stm32f4x7_eth_bsp.h: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | ****************************************************************************** 4 | * @attention 5 | * 6 | *

© COPYRIGHT 2016 STMicroelectronics

7 | * 8 | * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License"); 9 | * You may not use this file except in compliance with the License. 10 | * You may obtain a copy of the License at: 11 | * 12 | * http://www.st.com/software_license_agreement_liberty_v2 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | * 20 | ****************************************************************************** 21 | */ 22 | /* Define to prevent recursive inclusion -------------------------------------*/ 23 | #ifndef __STM32F4x7_ETH_BSP_H 24 | #define __STM32F4x7_ETH_BSP_H 25 | 26 | #ifdef __cplusplus 27 | extern "C" { 28 | #endif 29 | 30 | /* Includes ------------------------------------------------------------------*/ 31 | //#include "stm324xg_eval.h" 32 | //#include "stm324xg_eval_lcd.h" 33 | //#include "stm32f4_discovery.h" 34 | 35 | /* Exported types ------------------------------------------------------------*/ 36 | /* Exported constants --------------------------------------------------------*/ 37 | #define DP83848_PHY_ADDRESS 0x01 /* Relative to STM324xG-EVAL Board */ 38 | 39 | /* Specific defines for EXTI line, used to manage Ethernet link status */ 40 | #define ETH_LINK_EXTI_LINE EXTI_Line3 41 | #define ETH_LINK_EXTI_PORT_SOURCE EXTI_PortSourceGPIOA 42 | #define ETH_LINK_EXTI_PIN_SOURCE EXTI_PinSource3 43 | #define ETH_LINK_EXTI_IRQn EXTI3_IRQn 44 | #define ETH_LINK_PIN GPIO_Pin_3 45 | #define ETH_LINK_GPIO_PORT GPIOA 46 | #define ETH_LINK_GPIO_CLK RCC_AHB1Periph_GPIOA 47 | #define PHY_MICR 0x11 /* MII Interrupt Control Register */ 48 | #define PHY_MICR_INT_EN ((uint16_t)0x0002) /* PHY Enable interrupts */ 49 | #define PHY_MICR_INT_OE ((uint16_t)0x0001) /* PHY Enable output interrupt events */ 50 | #define PHY_MISR 0x12 /* MII Interrupt Status and Misc. Control Register */ 51 | #define PHY_MISR_LINK_INT_EN ((uint16_t)0x0020) /* Enable Interrupt on change of link status */ 52 | #define PHY_LINK_STATUS ((uint16_t)0x2000) /* PHY link status interrupt mask */ 53 | 54 | /* Exported macro ------------------------------------------------------------*/ 55 | /* Exported functions ------------------------------------------------------- */ 56 | void ETH_BSP_Config(void); 57 | uint32_t Eth_Link_PHYITConfig(uint16_t PHYAddress); 58 | void Eth_Link_EXTIConfig(void); 59 | void Eth_Link_ITHandler(uint16_t PHYAddress); 60 | 61 | #ifdef __cplusplus 62 | } 63 | #endif 64 | 65 | #endif /* __STM32F4x7_ETH_BSP_H */ 66 | 67 | 68 | /******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/ 69 | -------------------------------------------------------------------------------- /firmware/third_party/lwip-1.4.0/src/include/lwip/init.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001-2004 Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, 6 | * are permitted provided that the following conditions are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 3. The name of the author may not be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 19 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 21 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 24 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 25 | * OF SUCH DAMAGE. 26 | * 27 | * This file is part of the lwIP TCP/IP stack. 28 | * 29 | * Author: Adam Dunkels 30 | * 31 | */ 32 | #ifndef __LWIP_INIT_H__ 33 | #define __LWIP_INIT_H__ 34 | 35 | #include "lwip/opt.h" 36 | 37 | #ifdef __cplusplus 38 | extern "C" { 39 | #endif 40 | 41 | /** X.x.x: Major version of the stack */ 42 | #define LWIP_VERSION_MAJOR 1U 43 | /** x.X.x: Minor version of the stack */ 44 | #define LWIP_VERSION_MINOR 4U 45 | /** x.x.X: Revision of the stack */ 46 | #define LWIP_VERSION_REVISION 0U 47 | /** For release candidates, this is set to 1..254 48 | * For official releases, this is set to 255 (LWIP_RC_RELEASE) 49 | * For development versions (CVS), this is set to 0 (LWIP_RC_DEVELOPMENT) */ 50 | #define LWIP_VERSION_RC 255U 51 | 52 | /** LWIP_VERSION_RC is set to LWIP_RC_RELEASE for official releases */ 53 | #define LWIP_RC_RELEASE 255U 54 | /** LWIP_VERSION_RC is set to LWIP_RC_DEVELOPMENT for CVS versions */ 55 | #define LWIP_RC_DEVELOPMENT 0U 56 | 57 | #define LWIP_VERSION_IS_RELEASE (LWIP_VERSION_RC == LWIP_RC_RELEASE) 58 | #define LWIP_VERSION_IS_DEVELOPMENT (LWIP_VERSION_RC == LWIP_RC_DEVELOPMENT) 59 | #define LWIP_VERSION_IS_RC ((LWIP_VERSION_RC != LWIP_RC_RELEASE) && (LWIP_VERSION_RC != LWIP_RC_DEVELOPMENT)) 60 | 61 | /** Provides the version of the stack */ 62 | #define LWIP_VERSION (LWIP_VERSION_MAJOR << 24 | LWIP_VERSION_MINOR << 16 | \ 63 | LWIP_VERSION_REVISION << 8 | LWIP_VERSION_RC) 64 | 65 | /* Modules initialization */ 66 | void lwip_init(void); 67 | 68 | #ifdef __cplusplus 69 | } 70 | #endif 71 | 72 | #endif /* __LWIP_INIT_H__ */ 73 | -------------------------------------------------------------------------------- /firmware/third_party/lwip-1.4.0/src/api/err.c: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * Error Management module 4 | * 5 | */ 6 | 7 | /* 8 | * Copyright (c) 2001-2004 Swedish Institute of Computer Science. 9 | * All rights reserved. 10 | * 11 | * Redistribution and use in source and binary forms, with or without modification, 12 | * are permitted provided that the following conditions are met: 13 | * 14 | * 1. Redistributions of source code must retain the above copyright notice, 15 | * this list of conditions and the following disclaimer. 16 | * 2. Redistributions in binary form must reproduce the above copyright notice, 17 | * this list of conditions and the following disclaimer in the documentation 18 | * and/or other materials provided with the distribution. 19 | * 3. The name of the author may not be used to endorse or promote products 20 | * derived from this software without specific prior written permission. 21 | * 22 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 23 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 24 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 25 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 26 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 27 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 29 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 30 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 31 | * OF SUCH DAMAGE. 32 | * 33 | * This file is part of the lwIP TCP/IP stack. 34 | * 35 | * Author: Adam Dunkels 36 | * 37 | */ 38 | 39 | #include "lwip/err.h" 40 | 41 | #ifdef LWIP_DEBUG 42 | 43 | static const char *err_strerr[] = { 44 | "Ok.", /* ERR_OK 0 */ 45 | "Out of memory error.", /* ERR_MEM -1 */ 46 | "Buffer error.", /* ERR_BUF -2 */ 47 | "Timeout.", /* ERR_TIMEOUT -3 */ 48 | "Routing problem.", /* ERR_RTE -4 */ 49 | "Operation in progress.", /* ERR_INPROGRESS -5 */ 50 | "Illegal value.", /* ERR_VAL -6 */ 51 | "Operation would block.", /* ERR_WOULDBLOCK -7 */ 52 | "Address in use.", /* ERR_USE -8 */ 53 | "Already connected.", /* ERR_ISCONN -9 */ 54 | "Connection aborted.", /* ERR_ABRT -10 */ 55 | "Connection reset.", /* ERR_RST -11 */ 56 | "Connection closed.", /* ERR_CLSD -12 */ 57 | "Not connected.", /* ERR_CONN -13 */ 58 | "Illegal argument.", /* ERR_ARG -14 */ 59 | "Low-level netif error.", /* ERR_IF -15 */ 60 | }; 61 | 62 | /** 63 | * Convert an lwip internal error to a string representation. 64 | * 65 | * @param err an lwip internal err_t 66 | * @return a string representation for err 67 | */ 68 | const char * 69 | lwip_strerr(err_t err) 70 | { 71 | return err_strerr[-err]; 72 | 73 | } 74 | 75 | #endif /* LWIP_DEBUG */ 76 | -------------------------------------------------------------------------------- /firmware/STM32F4xx_DSP_StdPeriph_Lib_V1.8.0/Libraries/CMSIS/DSP_Lib/Source/MatrixFunctions/arm_mat_init_q15.c: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- 2 | * Copyright (C) 2010-2014 ARM Limited. All rights reserved. 3 | * 4 | * $Date: 19. March 2015 5 | * $Revision: V.1.4.5 6 | * 7 | * Project: CMSIS DSP Library 8 | * Title: arm_mat_init_q15.c 9 | * 10 | * Description: Q15 matrix initialization. 11 | * 12 | * Target Processor: Cortex-M4/Cortex-M3/Cortex-M0 13 | * 14 | * Redistribution and use in source and binary forms, with or without 15 | * modification, are permitted provided that the following conditions 16 | * are met: 17 | * - Redistributions of source code must retain the above copyright 18 | * notice, this list of conditions and the following disclaimer. 19 | * - Redistributions in binary form must reproduce the above copyright 20 | * notice, this list of conditions and the following disclaimer in 21 | * the documentation and/or other materials provided with the 22 | * distribution. 23 | * - Neither the name of ARM LIMITED nor the names of its contributors 24 | * may be used to endorse or promote products derived from this 25 | * software without specific prior written permission. 26 | * 27 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 28 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 29 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 30 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 31 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 32 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 33 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 34 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 35 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 36 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 37 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 38 | * POSSIBILITY OF SUCH DAMAGE. 39 | * -------------------------------------------------------------------------- */ 40 | 41 | 42 | #include "arm_math.h" 43 | 44 | /** 45 | * @ingroup groupMatrix 46 | */ 47 | 48 | /** 49 | * @addtogroup MatrixInit 50 | * @{ 51 | */ 52 | 53 | /** 54 | * @brief Q15 matrix initialization. 55 | * @param[in,out] *S points to an instance of the floating-point matrix structure. 56 | * @param[in] nRows number of rows in the matrix. 57 | * @param[in] nColumns number of columns in the matrix. 58 | * @param[in] *pData points to the matrix data array. 59 | * @return none 60 | */ 61 | 62 | void arm_mat_init_q15( 63 | arm_matrix_instance_q15 * S, 64 | uint16_t nRows, 65 | uint16_t nColumns, 66 | q15_t * pData) 67 | { 68 | /* Assign Number of Rows */ 69 | S->numRows = nRows; 70 | 71 | /* Assign Number of Columns */ 72 | S->numCols = nColumns; 73 | 74 | /* Assign Data pointer */ 75 | S->pData = pData; 76 | } 77 | 78 | /** 79 | * @} end of MatrixInit group 80 | */ 81 | -------------------------------------------------------------------------------- /firmware/third_party/lwip-1.4.0/port/STM32F4x7/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 __CC_H__ 33 | #define __CC_H__ 34 | 35 | #include "cpu.h" 36 | 37 | typedef unsigned char u8_t; 38 | typedef signed char s8_t; 39 | typedef unsigned short u16_t; 40 | typedef signed short s16_t; 41 | typedef unsigned long u32_t; 42 | typedef signed long s32_t; 43 | typedef u32_t mem_ptr_t; 44 | typedef int sys_prot_t; 45 | 46 | 47 | #define U16_F "hu" 48 | #define S16_F "d" 49 | #define X16_F "hx" 50 | #define U32_F "u" 51 | #define S32_F "d" 52 | #define X32_F "x" 53 | #define SZT_F "uz" 54 | 55 | 56 | 57 | 58 | 59 | /* define compiler specific symbols */ 60 | #if defined (__ICCARM__) 61 | 62 | #define PACK_STRUCT_BEGIN 63 | #define PACK_STRUCT_STRUCT 64 | #define PACK_STRUCT_END 65 | #define PACK_STRUCT_FIELD(x) x 66 | #define PACK_STRUCT_USE_INCLUDES 67 | 68 | #elif defined (__CC_ARM) 69 | 70 | #define PACK_STRUCT_BEGIN __packed 71 | #define PACK_STRUCT_STRUCT 72 | #define PACK_STRUCT_END 73 | #define PACK_STRUCT_FIELD(x) x 74 | 75 | #elif defined (__GNUC__) 76 | 77 | #define PACK_STRUCT_BEGIN 78 | #define PACK_STRUCT_STRUCT __attribute__ ((__packed__)) 79 | #define PACK_STRUCT_END 80 | #define PACK_STRUCT_FIELD(x) x 81 | 82 | #elif defined (__TASKING__) 83 | 84 | #define PACK_STRUCT_BEGIN 85 | #define PACK_STRUCT_STRUCT 86 | #define PACK_STRUCT_END 87 | #define PACK_STRUCT_FIELD(x) x 88 | 89 | #endif 90 | 91 | #define LWIP_PLATFORM_ASSERT(x) //do { if(!(x)) while(1); } while(0) 92 | 93 | #endif /* __CC_H__ */ 94 | -------------------------------------------------------------------------------- /firmware/third_party/lwip-1.4.0/src/include/ipv4/lwip/ip_frag.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001-2004 Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, 6 | * are permitted provided that the following conditions are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 3. The name of the author may not be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 19 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 21 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 24 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 25 | * OF SUCH DAMAGE. 26 | * 27 | * This file is part of the lwIP TCP/IP stack. 28 | * 29 | * Author: Jani Monoses 30 | * 31 | */ 32 | 33 | #ifndef __LWIP_IP_FRAG_H__ 34 | #define __LWIP_IP_FRAG_H__ 35 | 36 | #include "lwip/opt.h" 37 | #include "lwip/err.h" 38 | #include "lwip/pbuf.h" 39 | #include "lwip/netif.h" 40 | #include "lwip/ip_addr.h" 41 | #include "lwip/ip.h" 42 | 43 | #ifdef __cplusplus 44 | extern "C" { 45 | #endif 46 | 47 | #if IP_REASSEMBLY 48 | /* The IP reassembly timer interval in milliseconds. */ 49 | #define IP_TMR_INTERVAL 1000 50 | 51 | /* IP reassembly helper struct. 52 | * This is exported because memp needs to know the size. 53 | */ 54 | struct ip_reassdata { 55 | struct ip_reassdata *next; 56 | struct pbuf *p; 57 | struct ip_hdr iphdr; 58 | u16_t datagram_len; 59 | u8_t flags; 60 | u8_t timer; 61 | }; 62 | 63 | void ip_reass_init(void); 64 | void ip_reass_tmr(void); 65 | struct pbuf * ip_reass(struct pbuf *p); 66 | #endif /* IP_REASSEMBLY */ 67 | 68 | #if IP_FRAG 69 | #if !IP_FRAG_USES_STATIC_BUF && !LWIP_NETIF_TX_SINGLE_PBUF 70 | /** A custom pbuf that holds a reference to another pbuf, which is freed 71 | * when this custom pbuf is freed. This is used to create a custom PBUF_REF 72 | * that points into the original pbuf. */ 73 | struct pbuf_custom_ref { 74 | /** 'base class' */ 75 | struct pbuf_custom pc; 76 | /** pointer to the original pbuf that is referenced */ 77 | struct pbuf *original; 78 | }; 79 | #endif /* !IP_FRAG_USES_STATIC_BUF && !LWIP_NETIF_TX_SINGLE_PBUF */ 80 | 81 | err_t ip_frag(struct pbuf *p, struct netif *netif, ip_addr_t *dest); 82 | #endif /* IP_FRAG */ 83 | 84 | #ifdef __cplusplus 85 | } 86 | #endif 87 | 88 | #endif /* __LWIP_IP_FRAG_H__ */ 89 | -------------------------------------------------------------------------------- /firmware/delay.c: -------------------------------------------------------------------------------- 1 | 2 | //MIT License 3 | // 4 | //Copyright (c) 2017 tvelliott 5 | // 6 | //Permission is hereby granted, free of charge, to any person obtaining a copy 7 | //of this software and associated documentation files (the "Software"), to deal 8 | //in the Software without restriction, including without limitation the rights 9 | //to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | //copies of the Software, and to permit persons to whom the Software is 11 | //furnished to do so, subject to the following conditions: 12 | // 13 | //The above copyright notice and this permission notice shall be included in all 14 | //copies or substantial portions of the Software. 15 | // 16 | //THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | //IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | //FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | //AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | //LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | //OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | //SOFTWARE. 23 | 24 | #include 25 | 26 | ///////////////////////////////////////////// 27 | // delay for 3 clock cycles * ulCount 28 | ///////////////////////////////////////////// 29 | void __attribute__((naked)) DelayClk3(unsigned long ulCount) 30 | { 31 | __asm(" subs r0, #1\n" 32 | " bne DelayClk3\n" 33 | " bx lr"); 34 | } 35 | //////////////////////////////////////////////////////////////////////////////// 36 | //////////////////////////////////////////////////////////////////////////////// 37 | void delay_ms_maintasks(int ms) 38 | { 39 | int i; 40 | for(i=0; i 29 | * Ported to lwIP. 30 | * 97-12-04 Guy Lancaster , Global Election Systems Inc. 31 | * Original based on BSD magic.c. 32 | *****************************************************************************/ 33 | /* 34 | * magic.c - PPP Magic Number routines. 35 | * 36 | * Copyright (c) 1989 Carnegie Mellon University. 37 | * All rights reserved. 38 | * 39 | * Redistribution and use in source and binary forms are permitted 40 | * provided that the above copyright notice and this paragraph are 41 | * duplicated in all such forms and that any documentation, 42 | * advertising materials, and other materials related to such 43 | * distribution and use acknowledge that the software was developed 44 | * by Carnegie Mellon University. The name of the 45 | * University may not be used to endorse or promote products derived 46 | * from this software without specific prior written permission. 47 | * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR 48 | * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED 49 | * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. 50 | */ 51 | 52 | #include "lwip/opt.h" 53 | 54 | #if PPP_SUPPORT 55 | 56 | #include "ppp.h" 57 | #include "randm.h" 58 | #include "magic.h" 59 | 60 | 61 | /* 62 | * magicInit - Initialize the magic number generator. 63 | * 64 | * Since we use another random number generator that has its own 65 | * initialization, we do nothing here. 66 | */ 67 | void magicInit() 68 | { 69 | return; 70 | } 71 | 72 | /* 73 | * magic - Returns the next magic number. 74 | */ 75 | u32_t magic() 76 | { 77 | return avRandom(); 78 | } 79 | 80 | #endif /* PPP_SUPPORT */ 81 | -------------------------------------------------------------------------------- /firmware/STM32F4xx_DSP_StdPeriph_Lib_V1.8.0/Libraries/CMSIS/DSP_Lib/Source/MatrixFunctions/arm_mat_init_q31.c: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- 2 | * Copyright (C) 2010-2014 ARM Limited. All rights reserved. 3 | * 4 | * $Date: 19. March 2015 5 | * $Revision: V.1.4.5 6 | * 7 | * Project: CMSIS DSP Library 8 | * Title: arm_mat_init_q31.c 9 | * 10 | * Description: Q31 matrix initialization. 11 | * Target Processor: Cortex-M4/Cortex-M3/Cortex-M0 12 | * 13 | * Redistribution and use in source and binary forms, with or without 14 | * modification, are permitted provided that the following conditions 15 | * are met: 16 | * - Redistributions of source code must retain the above copyright 17 | * notice, this list of conditions and the following disclaimer. 18 | * - Redistributions in binary form must reproduce the above copyright 19 | * notice, this list of conditions and the following disclaimer in 20 | * the documentation and/or other materials provided with the 21 | * distribution. 22 | * - Neither the name of ARM LIMITED nor the names of its contributors 23 | * may be used to endorse or promote products derived from this 24 | * software without specific prior written permission. 25 | * 26 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 27 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 28 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 29 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 30 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 31 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 32 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 33 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 34 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 35 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 36 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 37 | * POSSIBILITY OF SUCH DAMAGE. 38 | * -------------------------------------------------------------------------- */ 39 | 40 | 41 | #include "arm_math.h" 42 | 43 | /** 44 | * @ingroup groupMatrix 45 | */ 46 | 47 | /** 48 | * @defgroup MatrixInit Matrix Initialization 49 | * 50 | */ 51 | 52 | /** 53 | * @addtogroup MatrixInit 54 | * @{ 55 | */ 56 | 57 | /** 58 | * @brief Q31 matrix initialization. 59 | * @param[in,out] *S points to an instance of the floating-point matrix structure. 60 | * @param[in] nRows number of rows in the matrix. 61 | * @param[in] nColumns number of columns in the matrix. 62 | * @param[in] *pData points to the matrix data array. 63 | * @return none 64 | */ 65 | 66 | void arm_mat_init_q31( 67 | arm_matrix_instance_q31 * S, 68 | uint16_t nRows, 69 | uint16_t nColumns, 70 | q31_t * pData) 71 | { 72 | /* Assign Number of Rows */ 73 | S->numRows = nRows; 74 | 75 | /* Assign Number of Columns */ 76 | S->numCols = nColumns; 77 | 78 | /* Assign Data pointer */ 79 | S->pData = pData; 80 | } 81 | 82 | /** 83 | * @} end of MatrixInit group 84 | */ 85 | -------------------------------------------------------------------------------- /firmware/config.h: -------------------------------------------------------------------------------- 1 | //MIT License 2 | // 3 | //Copyright (c) 2017 tvelliott 4 | // 5 | //Permission is hereby granted, free of charge, to any person obtaining a copy 6 | //of this software and associated documentation files (the "Software"), to deal 7 | //in the Software without restriction, including without limitation the rights 8 | //to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | //copies of the Software, and to permit persons to whom the Software is 10 | //furnished to do so, subject to the following conditions: 11 | // 12 | //The above copyright notice and this permission notice shall be included in all 13 | //copies or substantial portions of the Software. 14 | // 15 | //THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | //IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | //FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | //AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | //LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | //OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | //SOFTWARE. 22 | 23 | #ifndef __CONFIG_H__ 24 | #define __CONFIG_H__ 25 | 26 | #include 27 | #include "global.h" 28 | 29 | #define HSE_VALUE 20000000 30 | 31 | #define FLASH_USER_START_ADDR ADDR_FLASH_SECTOR_11 32 | #define FLASH_USER_END_ADDR ADDR_FLASH_SECTOR_11 33 | 34 | /* Base address of the Flash sectors */ 35 | #define ADDR_FLASH_SECTOR_0 ((uint32_t)0x08000000) /* Base @ of Sector 0, 16 Kbytes */ 36 | #define ADDR_FLASH_SECTOR_1 ((uint32_t)0x08004000) /* Base @ of Sector 1, 16 Kbytes */ 37 | #define ADDR_FLASH_SECTOR_2 ((uint32_t)0x08008000) /* Base @ of Sector 2, 16 Kbytes */ 38 | #define ADDR_FLASH_SECTOR_3 ((uint32_t)0x0800C000) /* Base @ of Sector 3, 16 Kbytes */ 39 | #define ADDR_FLASH_SECTOR_4 ((uint32_t)0x08010000) /* Base @ of Sector 4, 64 Kbytes */ 40 | #define ADDR_FLASH_SECTOR_5 ((uint32_t)0x08020000) /* Base @ of Sector 5, 128 Kbytes */ 41 | 42 | #define ADDR_FLASH_SECTOR_6 ((uint32_t)0x08040000) /* Base @ of Sector 6, 128 Kbytes */ 43 | #define ADDR_FLASH_SECTOR_7 ((uint32_t)0x08060000) /* Base @ of Sector 7, 128 Kbytes */ 44 | #define ADDR_FLASH_SECTOR_8 ((uint32_t)0x08080000) /* Base @ of Sector 8, 128 Kbytes */ 45 | #define ADDR_FLASH_SECTOR_9 ((uint32_t)0x080A0000) /* Base @ of Sector 9, 128 Kbytes */ 46 | #define ADDR_FLASH_SECTOR_10 ((uint32_t)0x080C0000) /* Base @ of Sector 10, 128 Kbytes */ 47 | 48 | #define ADDR_FLASH_SECTOR_11 ((uint32_t)0x080E0000) /* Base @ of Sector 11, 128 Kbytes */ 49 | 50 | //////////////////////////////////////////////////////// 51 | //////////////////////////////////////////////////////// 52 | typedef struct __attribute__((packed)) 53 | { 54 | 55 | union __attribute__((packed)) { 56 | uint8_t ip_addr[4]; 57 | uint32_t ip_addr_u32; 58 | }; 59 | uint8_t gw_addr[4]; 60 | 61 | union __attribute__((packed)) { 62 | uint8_t netmask[4]; 63 | uint32_t netmask_u32; 64 | }; 65 | 66 | uint8_t mac_addr[6]; 67 | 68 | uint8_t tftp_serv_ip[4]; 69 | int tcp_mss; 70 | int tcp_win; 71 | uint8_t tcp_sack; 72 | 73 | uint16_t config_crc; //don't remove 74 | } 75 | sys_config; 76 | 77 | #define PROTO(x) x 78 | #include "protos/config_proto.h" 79 | 80 | #endif 81 | -------------------------------------------------------------------------------- /firmware/netconf.c: -------------------------------------------------------------------------------- 1 | 2 | //MIT License 3 | // 4 | //Copyright (c) 2017 tvelliott 5 | // 6 | //Permission is hereby granted, free of charge, to any person obtaining a copy 7 | //of this software and associated documentation files (the "Software"), to deal 8 | //in the Software without restriction, including without limitation the rights 9 | //to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | //copies of the Software, and to permit persons to whom the Software is 11 | //furnished to do so, subject to the following conditions: 12 | // 13 | //The above copyright notice and this permission notice shall be included in all 14 | //copies or substantial portions of the Software. 15 | // 16 | //THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | //IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | //FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | //AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | //LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | //OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | //SOFTWARE. 23 | 24 | #include "lwip/mem.h" 25 | #include "lwip/memp.h" 26 | #include "lwip/tcp.h" 27 | #include "lwip/udp.h" 28 | #include "netif/etharp.h" 29 | #include "lwip/tcp.h" 30 | #include "ethernetif.h" 31 | #include "main.h" 32 | #include "config.h" 33 | #include "netconf.h" 34 | #include 35 | 36 | struct netif netif_e0; 37 | 38 | uint32_t TCPTimer = 0; 39 | uint32_t ARPTimer = 0; 40 | uint32_t IPaddress = 0; 41 | 42 | #define TCP_TMR_INTERVAL 1 43 | 44 | //////////////////////////////////////////////////////////////////////////////////////////// 45 | //////////////////////////////////////////////////////////////////////////////////////////// 46 | void lwip_init(void) 47 | { 48 | struct ip_addr ipaddr; 49 | struct ip_addr netmask; 50 | struct ip_addr gw; 51 | 52 | mem_init(); 53 | 54 | memp_init(); 55 | 56 | //ethernet 57 | IP4_ADDR(&ipaddr, config.ip_addr[0], config.ip_addr[1], config.ip_addr[2], config.ip_addr[3] ); 58 | IP4_ADDR(&netmask, config.netmask[0], config.netmask[1], config.netmask[2], config.netmask[3] ); 59 | IP4_ADDR(&gw, config.gw_addr[0], config.gw_addr[1], config.gw_addr[2], config.gw_addr[3] ); 60 | 61 | netif_add(&netif_e0, &ipaddr, &netmask, &gw, NULL, ðernetif_init, ðernet_input); 62 | 63 | 64 | netif_set_default(&netif_e0); 65 | 66 | netif_set_up(&netif_e0); 67 | } 68 | 69 | //////////////////////////////////////////////////////////////////////////////////////////// 70 | //////////////////////////////////////////////////////////////////////////////////////////// 71 | void lwip_packet_in_eth(uint8_t *buffer, int16_t len) 72 | { 73 | ethernetif_input(&netif_e0, buffer, len); 74 | } 75 | 76 | //////////////////////////////////////////////////////////////////////////////////////////// 77 | //////////////////////////////////////////////////////////////////////////////////////////// 78 | void LwIP_Periodic_Handle(volatile uint32_t localtime) 79 | { 80 | if (localtime - TCPTimer >= TCP_TMR_INTERVAL) { 81 | TCPTimer = localtime; 82 | tcp_tmr(); 83 | } 84 | 85 | if ((localtime - ARPTimer) >= ARP_TMR_INTERVAL) { 86 | ARPTimer = localtime; 87 | etharp_tmr(); 88 | } 89 | } 90 | -------------------------------------------------------------------------------- /firmware/third_party/lwip-1.4.0/src/netif/ppp/randm.h: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * randm.h - Random number generator header file. 3 | * 4 | * Copyright (c) 2003 by Marc Boucher, Services Informatiques (MBSI) inc. 5 | * Copyright (c) 1998 Global Election Systems Inc. 6 | * 7 | * The authors hereby grant permission to use, copy, modify, distribute, 8 | * and license this software and its documentation for any purpose, provided 9 | * that existing copyright notices are retained in all copies and that this 10 | * notice and the following disclaimer are included verbatim in any 11 | * distributions. No written agreement, license, or royalty fee is required 12 | * for any of the authorized uses. 13 | * 14 | * THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS *AS IS* AND ANY EXPRESS OR 15 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 16 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 17 | * IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 18 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 19 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 20 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 21 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 23 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | * 25 | ****************************************************************************** 26 | * REVISION HISTORY 27 | * 28 | * 03-01-01 Marc Boucher 29 | * Ported to lwIP. 30 | * 98-05-29 Guy Lancaster , Global Election Systems Inc. 31 | * Extracted from avos. 32 | *****************************************************************************/ 33 | 34 | #ifndef RANDM_H 35 | #define RANDM_H 36 | 37 | /*********************** 38 | *** PUBLIC FUNCTIONS *** 39 | ***********************/ 40 | /* 41 | * Initialize the random number generator. 42 | */ 43 | void avRandomInit(void); 44 | 45 | /* 46 | * Churn the randomness pool on a random event. Call this early and often 47 | * on random and semi-random system events to build randomness in time for 48 | * usage. For randomly timed events, pass a null pointer and a zero length 49 | * and this will use the system timer and other sources to add randomness. 50 | * If new random data is available, pass a pointer to that and it will be 51 | * included. 52 | */ 53 | void avChurnRand(char *randData, u32_t randLen); 54 | 55 | /* 56 | * Randomize our random seed value. To be called for truely random events 57 | * such as user operations and network traffic. 58 | */ 59 | #if MD5_SUPPORT 60 | #define avRandomize() avChurnRand(NULL, 0) 61 | #else /* MD5_SUPPORT */ 62 | void avRandomize(void); 63 | #endif /* MD5_SUPPORT */ 64 | 65 | /* 66 | * Use the random pool to generate random data. This degrades to pseudo 67 | * random when used faster than randomness is supplied using churnRand(). 68 | * Thus it's important to make sure that the results of this are not 69 | * published directly because one could predict the next result to at 70 | * least some degree. Also, it's important to get a good seed before 71 | * the first use. 72 | */ 73 | void avGenRand(char *buf, u32_t bufLen); 74 | 75 | /* 76 | * Return a new random number. 77 | */ 78 | u32_t avRandom(void); 79 | 80 | 81 | #endif /* RANDM_H */ 82 | -------------------------------------------------------------------------------- /firmware/third_party/lwip-1.4.0/src/include/ipv6/lwip/icmp.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001-2004 Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, 6 | * are permitted provided that the following conditions are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 3. The name of the author may not be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 19 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 21 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 24 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 25 | * OF SUCH DAMAGE. 26 | * 27 | * This file is part of the lwIP TCP/IP stack. 28 | * 29 | * Author: Adam Dunkels 30 | * 31 | */ 32 | #ifndef __LWIP_ICMP_H__ 33 | #define __LWIP_ICMP_H__ 34 | 35 | #include "lwip/opt.h" 36 | 37 | #if LWIP_ICMP /* don't build if not configured for use in lwipopts.h */ 38 | 39 | #include "lwip/pbuf.h" 40 | #include "lwip/netif.h" 41 | 42 | #ifdef __cplusplus 43 | extern "C" { 44 | #endif 45 | 46 | #define ICMP6_DUR 1 47 | #define ICMP6_TE 3 48 | #define ICMP6_ECHO 128 /* echo */ 49 | #define ICMP6_ER 129 /* echo reply */ 50 | 51 | 52 | enum icmp_dur_type { 53 | ICMP_DUR_NET = 0, /* net unreachable */ 54 | ICMP_DUR_HOST = 1, /* host unreachable */ 55 | ICMP_DUR_PROTO = 2, /* protocol unreachable */ 56 | ICMP_DUR_PORT = 3, /* port unreachable */ 57 | ICMP_DUR_FRAG = 4, /* fragmentation needed and DF set */ 58 | ICMP_DUR_SR = 5 /* source route failed */ 59 | }; 60 | 61 | enum icmp_te_type { 62 | ICMP_TE_TTL = 0, /* time to live exceeded in transit */ 63 | ICMP_TE_FRAG = 1 /* fragment reassembly time exceeded */ 64 | }; 65 | 66 | void icmp_input(struct pbuf *p, struct netif *inp); 67 | 68 | void icmp_dest_unreach(struct pbuf *p, enum icmp_dur_type t); 69 | void icmp_time_exceeded(struct pbuf *p, enum icmp_te_type t); 70 | 71 | struct icmp_echo_hdr { 72 | u8_t type; 73 | u8_t icode; 74 | u16_t chksum; 75 | u16_t id; 76 | u16_t seqno; 77 | }; 78 | 79 | struct icmp_dur_hdr { 80 | u8_t type; 81 | u8_t icode; 82 | u16_t chksum; 83 | u32_t unused; 84 | }; 85 | 86 | struct icmp_te_hdr { 87 | u8_t type; 88 | u8_t icode; 89 | u16_t chksum; 90 | u32_t unused; 91 | }; 92 | 93 | #ifdef __cplusplus 94 | } 95 | #endif 96 | 97 | #endif /* LWIP_ICMP */ 98 | 99 | #endif /* __LWIP_ICMP_H__ */ 100 | 101 | -------------------------------------------------------------------------------- /firmware/STM32F4xx_DSP_StdPeriph_Lib_V1.8.0/Libraries/CMSIS/DSP_Lib/Source/FilteringFunctions/arm_fir_lattice_init_q31.c: -------------------------------------------------------------------------------- 1 | /*----------------------------------------------------------------------------- 2 | * Copyright (C) 2010-2014 ARM Limited. All rights reserved. 3 | * 4 | * $Date: 19. March 2015 5 | * $Revision: V.1.4.5 6 | * 7 | * Project: CMSIS DSP Library 8 | * Title: arm_fir_lattice_init_q31.c 9 | * 10 | * Description: Q31 FIR lattice filter initialization function. 11 | * 12 | * Target Processor: Cortex-M4/Cortex-M3/Cortex-M0 13 | * 14 | * Redistribution and use in source and binary forms, with or without 15 | * modification, are permitted provided that the following conditions 16 | * are met: 17 | * - Redistributions of source code must retain the above copyright 18 | * notice, this list of conditions and the following disclaimer. 19 | * - Redistributions in binary form must reproduce the above copyright 20 | * notice, this list of conditions and the following disclaimer in 21 | * the documentation and/or other materials provided with the 22 | * distribution. 23 | * - Neither the name of ARM LIMITED nor the names of its contributors 24 | * may be used to endorse or promote products derived from this 25 | * software without specific prior written permission. 26 | * 27 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 28 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 29 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 30 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 31 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 32 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 33 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 34 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 35 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 36 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 37 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 38 | * POSSIBILITY OF SUCH DAMAGE. 39 | * ---------------------------------------------------------------------------*/ 40 | 41 | #include "arm_math.h" 42 | 43 | /** 44 | * @ingroup groupFilters 45 | */ 46 | 47 | /** 48 | * @addtogroup FIR_Lattice 49 | * @{ 50 | */ 51 | 52 | /** 53 | * @brief Initialization function for the Q31 FIR lattice filter. 54 | * @param[in] *S points to an instance of the Q31 FIR lattice structure. 55 | * @param[in] numStages number of filter stages. 56 | * @param[in] *pCoeffs points to the coefficient buffer. The array is of length numStages. 57 | * @param[in] *pState points to the state buffer. The array is of length numStages. 58 | * @return none. 59 | */ 60 | 61 | void arm_fir_lattice_init_q31( 62 | arm_fir_lattice_instance_q31 * S, 63 | uint16_t numStages, 64 | q31_t * pCoeffs, 65 | q31_t * pState) 66 | { 67 | /* Assign filter taps */ 68 | S->numStages = numStages; 69 | 70 | /* Assign coefficient pointer */ 71 | S->pCoeffs = pCoeffs; 72 | 73 | /* Clear state buffer and size is always numStages */ 74 | memset(pState, 0, (numStages) * sizeof(q31_t)); 75 | 76 | /* Assign state pointer */ 77 | S->pState = pState; 78 | 79 | } 80 | 81 | /** 82 | * @} end of FIR_Lattice group 83 | */ 84 | -------------------------------------------------------------------------------- /firmware/STM32F4xx_DSP_StdPeriph_Lib_V1.8.0/Libraries/CMSIS/DSP_Lib/Source/FilteringFunctions/arm_fir_lattice_init_q15.c: -------------------------------------------------------------------------------- 1 | /*----------------------------------------------------------------------------- 2 | * Copyright (C) 2010-2014 ARM Limited. All rights reserved. 3 | * 4 | * $Date: 19. March 2015 5 | * $Revision: V.1.4.5 6 | * 7 | * Project: CMSIS DSP Library 8 | * Title: arm_fir_lattice_init_q15.c 9 | * 10 | * Description: Q15 FIR Lattice filter initialization function. 11 | * 12 | * Target Processor: Cortex-M4/Cortex-M3/Cortex-M0 13 | * 14 | * Redistribution and use in source and binary forms, with or without 15 | * modification, are permitted provided that the following conditions 16 | * are met: 17 | * - Redistributions of source code must retain the above copyright 18 | * notice, this list of conditions and the following disclaimer. 19 | * - Redistributions in binary form must reproduce the above copyright 20 | * notice, this list of conditions and the following disclaimer in 21 | * the documentation and/or other materials provided with the 22 | * distribution. 23 | * - Neither the name of ARM LIMITED nor the names of its contributors 24 | * may be used to endorse or promote products derived from this 25 | * software without specific prior written permission. 26 | * 27 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 28 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 29 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 30 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 31 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 32 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 33 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 34 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 35 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 36 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 37 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 38 | * POSSIBILITY OF SUCH DAMAGE. 39 | * ---------------------------------------------------------------------------*/ 40 | 41 | #include "arm_math.h" 42 | 43 | /** 44 | * @ingroup groupFilters 45 | */ 46 | 47 | /** 48 | * @addtogroup FIR_Lattice 49 | * @{ 50 | */ 51 | 52 | /** 53 | * @brief Initialization function for the Q15 FIR lattice filter. 54 | * @param[in] *S points to an instance of the Q15 FIR lattice structure. 55 | * @param[in] numStages number of filter stages. 56 | * @param[in] *pCoeffs points to the coefficient buffer. The array is of length numStages. 57 | * @param[in] *pState points to the state buffer. The array is of length numStages. 58 | * @return none. 59 | */ 60 | 61 | void arm_fir_lattice_init_q15( 62 | arm_fir_lattice_instance_q15 * S, 63 | uint16_t numStages, 64 | q15_t * pCoeffs, 65 | q15_t * pState) 66 | { 67 | /* Assign filter taps */ 68 | S->numStages = numStages; 69 | 70 | /* Assign coefficient pointer */ 71 | S->pCoeffs = pCoeffs; 72 | 73 | /* Clear state buffer and size is always numStages */ 74 | memset(pState, 0, (numStages) * sizeof(q15_t)); 75 | 76 | /* Assign state pointer */ 77 | S->pState = pState; 78 | 79 | } 80 | 81 | /** 82 | * @} end of FIR_Lattice group 83 | */ 84 | -------------------------------------------------------------------------------- /firmware/STM32F4xx_DSP_StdPeriph_Lib_V1.8.0/Libraries/CMSIS/DSP_Lib/Source/FilteringFunctions/arm_fir_lattice_init_f32.c: -------------------------------------------------------------------------------- 1 | /*----------------------------------------------------------------------------- 2 | * Copyright (C) 2010-2014 ARM Limited. All rights reserved. 3 | * 4 | * $Date: 19. March 2015 5 | * $Revision: V.1.4.5 6 | * 7 | * Project: CMSIS DSP Library 8 | * Title: arm_fir_lattice_init_f32.c 9 | * 10 | * Description: Floating-point FIR Lattice filter initialization function. 11 | * 12 | * Target Processor: Cortex-M4/Cortex-M3/Cortex-M0 13 | * 14 | * Redistribution and use in source and binary forms, with or without 15 | * modification, are permitted provided that the following conditions 16 | * are met: 17 | * - Redistributions of source code must retain the above copyright 18 | * notice, this list of conditions and the following disclaimer. 19 | * - Redistributions in binary form must reproduce the above copyright 20 | * notice, this list of conditions and the following disclaimer in 21 | * the documentation and/or other materials provided with the 22 | * distribution. 23 | * - Neither the name of ARM LIMITED nor the names of its contributors 24 | * may be used to endorse or promote products derived from this 25 | * software without specific prior written permission. 26 | * 27 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 28 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 29 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 30 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 31 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 32 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 33 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 34 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 35 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 36 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 37 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 38 | * POSSIBILITY OF SUCH DAMAGE. 39 | * ---------------------------------------------------------------------------*/ 40 | 41 | #include "arm_math.h" 42 | 43 | /** 44 | * @ingroup groupFilters 45 | */ 46 | 47 | /** 48 | * @addtogroup FIR_Lattice 49 | * @{ 50 | */ 51 | 52 | /** 53 | * @brief Initialization function for the floating-point FIR lattice filter. 54 | * @param[in] *S points to an instance of the floating-point FIR lattice structure. 55 | * @param[in] numStages number of filter stages. 56 | * @param[in] *pCoeffs points to the coefficient buffer. The array is of length numStages. 57 | * @param[in] *pState points to the state buffer. The array is of length numStages. 58 | * @return none. 59 | */ 60 | 61 | void arm_fir_lattice_init_f32( 62 | arm_fir_lattice_instance_f32 * S, 63 | uint16_t numStages, 64 | float32_t * pCoeffs, 65 | float32_t * pState) 66 | { 67 | /* Assign filter taps */ 68 | S->numStages = numStages; 69 | 70 | /* Assign coefficient pointer */ 71 | S->pCoeffs = pCoeffs; 72 | 73 | /* Clear state buffer and size is always numStages */ 74 | memset(pState, 0, (numStages) * sizeof(float32_t)); 75 | 76 | /* Assign state pointer */ 77 | S->pState = pState; 78 | 79 | } 80 | 81 | /** 82 | * @} end of FIR_Lattice group 83 | */ 84 | -------------------------------------------------------------------------------- /firmware/third_party/lwip-1.4.0/src/include/lwip/err.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001-2004 Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, 6 | * are permitted provided that the following conditions are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 3. The name of the author may not be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 19 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 21 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 24 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 25 | * OF SUCH DAMAGE. 26 | * 27 | * This file is part of the lwIP TCP/IP stack. 28 | * 29 | * Author: Adam Dunkels 30 | * 31 | */ 32 | #ifndef __LWIP_ERR_H__ 33 | #define __LWIP_ERR_H__ 34 | 35 | #include "lwip/opt.h" 36 | #include "lwip/arch.h" 37 | 38 | #ifdef __cplusplus 39 | extern "C" { 40 | #endif 41 | 42 | /** Define LWIP_ERR_T in cc.h if you want to use 43 | * a different type for your platform (must be signed). */ 44 | #ifdef LWIP_ERR_T 45 | typedef LWIP_ERR_T err_t; 46 | #else /* LWIP_ERR_T */ 47 | typedef s8_t err_t; 48 | #endif /* LWIP_ERR_T*/ 49 | 50 | /* Definitions for error constants. */ 51 | 52 | #define ERR_OK 0 /* No error, everything OK. */ 53 | #define ERR_MEM -1 /* Out of memory error. */ 54 | #define ERR_BUF -2 /* Buffer error. */ 55 | #define ERR_TIMEOUT -3 /* Timeout. */ 56 | #define ERR_RTE -4 /* Routing problem. */ 57 | #define ERR_INPROGRESS -5 /* Operation in progress */ 58 | #define ERR_VAL -6 /* Illegal value. */ 59 | #define ERR_WOULDBLOCK -7 /* Operation would block. */ 60 | #define ERR_USE -8 /* Address in use. */ 61 | #define ERR_ISCONN -9 /* Already connected. */ 62 | 63 | #define ERR_IS_FATAL(e) ((e) < ERR_ISCONN) 64 | 65 | #define ERR_ABRT -10 /* Connection aborted. */ 66 | #define ERR_RST -11 /* Connection reset. */ 67 | #define ERR_CLSD -12 /* Connection closed. */ 68 | #define ERR_CONN -13 /* Not connected. */ 69 | 70 | #define ERR_ARG -14 /* Illegal argument. */ 71 | 72 | #define ERR_IF -15 /* Low-level netif error */ 73 | 74 | 75 | #ifdef LWIP_DEBUG 76 | extern const char *lwip_strerr(err_t err); 77 | #else 78 | #define lwip_strerr(x) "" 79 | #endif /* LWIP_DEBUG */ 80 | 81 | #ifdef __cplusplus 82 | } 83 | #endif 84 | 85 | #endif /* __LWIP_ERR_H__ */ 86 | -------------------------------------------------------------------------------- /firmware/STM32F4xx_DSP_StdPeriph_Lib_V1.8.0/Libraries/CMSIS/DSP_Lib/Source/MatrixFunctions/arm_mat_init_f32.c: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------------- 2 | * Copyright (C) 2010-2014 ARM Limited. All rights reserved. 3 | * 4 | * $Date: 19. March 2015 5 | * $Revision: V.1.4.5 6 | * 7 | * Project: CMSIS DSP Library 8 | * Title: arm_mat_init_f32.c 9 | * 10 | * Description: Floating-point matrix initialization. 11 | * 12 | * Target Processor: Cortex-M4/Cortex-M3/Cortex-M0 13 | * 14 | * Redistribution and use in source and binary forms, with or without 15 | * modification, are permitted provided that the following conditions 16 | * are met: 17 | * - Redistributions of source code must retain the above copyright 18 | * notice, this list of conditions and the following disclaimer. 19 | * - Redistributions in binary form must reproduce the above copyright 20 | * notice, this list of conditions and the following disclaimer in 21 | * the documentation and/or other materials provided with the 22 | * distribution. 23 | * - Neither the name of ARM LIMITED nor the names of its contributors 24 | * may be used to endorse or promote products derived from this 25 | * software without specific prior written permission. 26 | * 27 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 28 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 29 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 30 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 31 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 32 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 33 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 34 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 35 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 36 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 37 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 38 | * POSSIBILITY OF SUCH DAMAGE. 39 | * -------------------------------------------------------------------------- */ 40 | 41 | #include "arm_math.h" 42 | 43 | /** 44 | * @ingroup groupMatrix 45 | */ 46 | 47 | /** 48 | * @defgroup MatrixInit Matrix Initialization 49 | * 50 | * Initializes the underlying matrix data structure. 51 | * The functions set the numRows, 52 | * numCols, and pData fields 53 | * of the matrix data structure. 54 | */ 55 | 56 | /** 57 | * @addtogroup MatrixInit 58 | * @{ 59 | */ 60 | 61 | /** 62 | * @brief Floating-point matrix initialization. 63 | * @param[in,out] *S points to an instance of the floating-point matrix structure. 64 | * @param[in] nRows number of rows in the matrix. 65 | * @param[in] nColumns number of columns in the matrix. 66 | * @param[in] *pData points to the matrix data array. 67 | * @return none 68 | */ 69 | 70 | void arm_mat_init_f32( 71 | arm_matrix_instance_f32 * S, 72 | uint16_t nRows, 73 | uint16_t nColumns, 74 | float32_t * pData) 75 | { 76 | /* Assign Number of Rows */ 77 | S->numRows = nRows; 78 | 79 | /* Assign Number of Columns */ 80 | S->numCols = nColumns; 81 | 82 | /* Assign Data pointer */ 83 | S->pData = pData; 84 | } 85 | 86 | /** 87 | * @} end of MatrixInit group 88 | */ 89 | -------------------------------------------------------------------------------- /firmware/fpga/src/spi_master.v: -------------------------------------------------------------------------------- 1 | //MIT License 2 | // 3 | //Copyright (c) 2017 tvelliott 4 | // 5 | //Permission is hereby granted, free of charge, to any person obtaining a copy 6 | //of this software and associated documentation files (the "Software"), to deal 7 | //in the Software without restriction, including without limitation the rights 8 | //to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | //copies of the Software, and to permit persons to whom the Software is 10 | //furnished to do so, subject to the following conditions: 11 | // 12 | //The above copyright notice and this permission notice shall be included in all 13 | //copies or substantial portions of the Software. 14 | // 15 | //THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | //IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | //FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | //AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | //LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | //OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | //SOFTWARE. 22 | 23 | module spi_master ( 24 | input clk, 25 | input rst, 26 | input miso, 27 | output mosi, 28 | output sck, 29 | input start, 30 | input[7:0] data_in, 31 | output[7:0] data_out, 32 | output busy, 33 | output new_data 34 | ); 35 | 36 | localparam CLK_DIV=3; 37 | 38 | localparam IDLE = 3'd0, 39 | TRANSFER = 3'd1; 40 | 41 | reg [2:0] state; 42 | 43 | reg [7:0] data; 44 | 45 | reg [CLK_DIV-1:0] sck_q; 46 | assign sck = (sck_q[CLK_DIV-1] && state!=IDLE); 47 | 48 | reg mosi; 49 | reg [2:0] ctr; 50 | reg [7:0] data_out; 51 | 52 | reg new_data; 53 | reg busy; 54 | 55 | always @(posedge clk) begin 56 | if (!rst) begin 57 | ctr <= 3'b0; 58 | sck_q <= 3'h0; 59 | mosi <= 1'b0; 60 | state <= IDLE; 61 | data_out <= 8'b0; 62 | new_data <= 1'b0; 63 | end else begin 64 | 65 | case (state) 66 | IDLE: begin 67 | sck_q <= 3'h0; 68 | ctr <= 3'b0; 69 | 70 | if (start == 1'b1) begin 71 | busy<=1'b1; 72 | new_data <= 1'b0; 73 | data <= data_in; 74 | state <= TRANSFER; 75 | end 76 | end 77 | 78 | TRANSFER: begin 79 | sck_q <= sck_q + 1'b1; 80 | 81 | case(sck_q) 82 | 3'b000: begin 83 | end 84 | 3'b001: begin 85 | end 86 | 3'b010: begin 87 | mosi <= data[7]; 88 | end 89 | 3'b011: begin 90 | end 91 | 3'b100: begin 92 | end 93 | 3'b101: begin 94 | end 95 | 3'b110: begin 96 | data <= {data[6:0], miso}; 97 | end 98 | 3'b111: begin 99 | ctr <= ctr + 1'b1; 100 | if (ctr == 3'b111) begin 101 | data_out <= data; 102 | busy<=1'b0; 103 | new_data <= 1'b1; 104 | state <= IDLE; 105 | end 106 | end 107 | endcase 108 | end 109 | 110 | default: begin 111 | state <= IDLE; 112 | end 113 | endcase 114 | end 115 | end 116 | 117 | endmodule 118 | -------------------------------------------------------------------------------- /firmware/third_party/lwip-1.4.0/README: -------------------------------------------------------------------------------- 1 | INTRODUCTION 2 | 3 | lwIP is a small independent implementation of the TCP/IP protocol 4 | suite that has been developed by Adam Dunkels at the Computer and 5 | Networks Architectures (CNA) lab at the Swedish Institute of Computer 6 | Science (SICS). 7 | 8 | The focus of the lwIP TCP/IP implementation is to reduce the RAM usage 9 | while still having a full scale TCP. This making lwIP suitable for use 10 | in embedded systems with tens of kilobytes of free RAM and room for 11 | around 40 kilobytes of code ROM. 12 | 13 | FEATURES 14 | 15 | * IP (Internet Protocol) including packet forwarding over multiple network 16 | interfaces 17 | * ICMP (Internet Control Message Protocol) for network maintenance and debugging 18 | * IGMP (Internet Group Management Protocol) for multicast traffic management 19 | * UDP (User Datagram Protocol) including experimental UDP-lite extensions 20 | * TCP (Transmission Control Protocol) with congestion control, RTT estimation 21 | and fast recovery/fast retransmit 22 | * Specialized raw/native API for enhanced performance 23 | * Optional Berkeley-like socket API 24 | * DNS (Domain names resolver) 25 | * SNMP (Simple Network Management Protocol) 26 | * DHCP (Dynamic Host Configuration Protocol) 27 | * AUTOIP (for IPv4, conform with RFC 3927) 28 | * PPP (Point-to-Point Protocol) 29 | * ARP (Address Resolution Protocol) for Ethernet 30 | 31 | LICENSE 32 | 33 | lwIP is freely available under a BSD license. 34 | 35 | DEVELOPMENT 36 | 37 | lwIP has grown into an excellent TCP/IP stack for embedded devices, 38 | and developers using the stack often submit bug fixes, improvements, 39 | and additions to the stack to further increase its usefulness. 40 | 41 | Development of lwIP is hosted on Savannah, a central point for 42 | software development, maintenance and distribution. Everyone can 43 | help improve lwIP by use of Savannah's interface, CVS and the 44 | mailing list. A core team of developers will commit changes to the 45 | CVS source tree. 46 | 47 | The lwIP TCP/IP stack is maintained in the 'lwip' CVS module and 48 | contributions (such as platform ports) are in the 'contrib' module. 49 | 50 | See doc/savannah.txt for details on CVS server access for users and 51 | developers. 52 | 53 | Last night's CVS tar ball can be downloaded from: 54 | http://savannah.gnu.org/cvs.backups/lwip.tar.gz [CHANGED - NEEDS FIXING] 55 | 56 | The current CVS trees are web-browsable: 57 | http://savannah.nongnu.org/cgi-bin/viewcvs/lwip/lwip/ 58 | http://savannah.nongnu.org/cgi-bin/viewcvs/lwip/contrib/ 59 | 60 | Submit patches and bugs via the lwIP project page: 61 | http://savannah.nongnu.org/projects/lwip/ 62 | 63 | 64 | DOCUMENTATION 65 | 66 | The original out-dated homepage of lwIP and Adam Dunkels' papers on 67 | lwIP are at the official lwIP home page: 68 | http://www.sics.se/~adam/lwip/ 69 | 70 | Self documentation of the source code is regularly extracted from the 71 | current CVS sources and is available from this web page: 72 | http://www.nongnu.org/lwip/ 73 | 74 | There is now a constantly growin wiki about lwIP at 75 | http://lwip.wikia.com/wiki/LwIP_Wiki 76 | 77 | Also, there are mailing lists you can subscribe at 78 | http://savannah.nongnu.org/mail/?group=lwip 79 | plus searchable archives: 80 | http://lists.nongnu.org/archive/html/lwip-users/ 81 | http://lists.nongnu.org/archive/html/lwip-devel/ 82 | 83 | Reading Adam's papers, the files in docs/, browsing the source code 84 | documentation and browsing the mailing list archives is a good way to 85 | become familiar with the design of lwIP. 86 | 87 | Adam Dunkels 88 | Leon Woestenberg 89 | 90 | -------------------------------------------------------------------------------- /firmware/third_party/lwip-1.4.0/src/include/lwip/timers.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001-2004 Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, 6 | * are permitted provided that the following conditions are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 3. The name of the author may not be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 19 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 21 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 24 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 25 | * OF SUCH DAMAGE. 26 | * 27 | * This file is part of the lwIP TCP/IP stack. 28 | * 29 | * Author: Adam Dunkels 30 | * Simon Goldschmidt 31 | * 32 | */ 33 | #ifndef __LWIP_TIMERS_H__ 34 | #define __LWIP_TIMERS_H__ 35 | 36 | #include "lwip/opt.h" 37 | 38 | /* Timers are not supported when NO_SYS==1 and NO_SYS_NO_TIMERS==1 */ 39 | #define LWIP_TIMERS (!NO_SYS || (NO_SYS && !NO_SYS_NO_TIMERS)) 40 | 41 | #if LWIP_TIMERS 42 | 43 | #include "lwip/err.h" 44 | #include "lwip/sys.h" 45 | 46 | #ifdef __cplusplus 47 | extern "C" { 48 | #endif 49 | 50 | #ifndef LWIP_DEBUG_TIMERNAMES 51 | #ifdef LWIP_DEBUG 52 | #define LWIP_DEBUG_TIMERNAMES SYS_DEBUG 53 | #else /* LWIP_DEBUG */ 54 | #define LWIP_DEBUG_TIMERNAMES 0 55 | #endif /* LWIP_DEBUG*/ 56 | #endif 57 | 58 | /** Function prototype for a timeout callback function. Register such a function 59 | * using sys_timeout(). 60 | * 61 | * @param arg Additional argument to pass to the function - set up by sys_timeout() 62 | */ 63 | typedef void (* sys_timeout_handler)(void *arg); 64 | 65 | struct sys_timeo { 66 | struct sys_timeo *next; 67 | u32_t time; 68 | sys_timeout_handler h; 69 | void *arg; 70 | #if LWIP_DEBUG_TIMERNAMES 71 | const char* handler_name; 72 | #endif /* LWIP_DEBUG_TIMERNAMES */ 73 | }; 74 | 75 | void sys_timeouts_init(void); 76 | 77 | #if LWIP_DEBUG_TIMERNAMES 78 | void sys_timeout_debug(u32_t msecs, sys_timeout_handler handler, void *arg, const char* handler_name); 79 | #define sys_timeout(msecs, handler, arg) sys_timeout_debug(msecs, handler, arg, #handler) 80 | #else /* LWIP_DEBUG_TIMERNAMES */ 81 | void sys_timeout(u32_t msecs, sys_timeout_handler handler, void *arg); 82 | #endif /* LWIP_DEBUG_TIMERNAMES */ 83 | 84 | void sys_untimeout(sys_timeout_handler handler, void *arg); 85 | #if NO_SYS 86 | void sys_check_timeouts(void); 87 | void sys_restart_timeouts(void); 88 | #else /* NO_SYS */ 89 | void sys_timeouts_mbox_fetch(sys_mbox_t *mbox, void **msg); 90 | #endif /* NO_SYS */ 91 | 92 | 93 | #ifdef __cplusplus 94 | } 95 | #endif 96 | 97 | #endif /* LWIP_TIMERS */ 98 | #endif /* __LWIP_TIMERS_H__ */ 99 | -------------------------------------------------------------------------------- /firmware/STM32F4xx_DSP_StdPeriph_Lib_V1.8.0/Libraries/CMSIS/DSP_Lib/Source/ControllerFunctions/arm_pid_init_f32.c: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- 2 | * Copyright (C) 2010-2014 ARM Limited. All rights reserved. 3 | * 4 | * $Date: 19. March 2015 5 | * $Revision: V.1.4.5 6 | * 7 | * Project: CMSIS DSP Library 8 | * Title: arm_pid_init_f32.c 9 | * 10 | * Description: Floating-point PID Control initialization function 11 | * 12 | * 13 | * Target Processor: Cortex-M4/Cortex-M3/Cortex-M0 14 | * 15 | * Redistribution and use in source and binary forms, with or without 16 | * modification, are permitted provided that the following conditions 17 | * are met: 18 | * - Redistributions of source code must retain the above copyright 19 | * notice, this list of conditions and the following disclaimer. 20 | * - Redistributions in binary form must reproduce the above copyright 21 | * notice, this list of conditions and the following disclaimer in 22 | * the documentation and/or other materials provided with the 23 | * distribution. 24 | * - Neither the name of ARM LIMITED nor the names of its contributors 25 | * may be used to endorse or promote products derived from this 26 | * software without specific prior written permission. 27 | * 28 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 29 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 30 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 31 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 32 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 33 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 34 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 35 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 36 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 37 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 38 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 39 | * POSSIBILITY OF SUCH DAMAGE. 40 | * ------------------------------------------------------------------- */ 41 | 42 | #include "arm_math.h" 43 | 44 | /** 45 | * @addtogroup PID 46 | * @{ 47 | */ 48 | 49 | /** 50 | * @brief Initialization function for the floating-point PID Control. 51 | * @param[in,out] *S points to an instance of the PID structure. 52 | * @param[in] resetStateFlag flag to reset the state. 0 = no change in state & 1 = reset the state. 53 | * @return none. 54 | * \par Description: 55 | * \par 56 | * The resetStateFlag specifies whether to set state to zero or not. \n 57 | * The function computes the structure fields: A0, A1 A2 58 | * using the proportional gain( \c Kp), integral gain( \c Ki) and derivative gain( \c Kd) 59 | * also sets the state variables to all zeros. 60 | */ 61 | 62 | void arm_pid_init_f32( 63 | arm_pid_instance_f32 * S, 64 | int32_t resetStateFlag) 65 | { 66 | 67 | /* Derived coefficient A0 */ 68 | S->A0 = S->Kp + S->Ki + S->Kd; 69 | 70 | /* Derived coefficient A1 */ 71 | S->A1 = (-S->Kp) - ((float32_t) 2.0 * S->Kd); 72 | 73 | /* Derived coefficient A2 */ 74 | S->A2 = S->Kd; 75 | 76 | /* Check whether state needs reset or not */ 77 | if(resetStateFlag) 78 | { 79 | /* Clear the state buffer. The size will be always 3 samples */ 80 | memset(S->state, 0, 3u * sizeof(float32_t)); 81 | } 82 | 83 | } 84 | 85 | /** 86 | * @} end of PID group 87 | */ 88 | -------------------------------------------------------------------------------- /firmware/STM32F4xx_DSP_StdPeriph_Lib_V1.8.0/Libraries/CMSIS/DSP_Lib/Source/FastMathFunctions/arm_sin_q31.c: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- 2 | * Copyright (C) 2010-2014 ARM Limited. All rights reserved. 3 | * 4 | * $Date: 19. March 2015 5 | * $Revision: V.1.4.5 6 | * 7 | * Project: CMSIS DSP Library 8 | * Title: arm_sin_q31.c 9 | * 10 | * Description: Fast sine calculation for Q31 values. 11 | * 12 | * Target Processor: Cortex-M4/Cortex-M3/Cortex-M0 13 | * 14 | * Redistribution and use in source and binary forms, with or without 15 | * modification, are permitted provided that the following conditions 16 | * are met: 17 | * - Redistributions of source code must retain the above copyright 18 | * notice, this list of conditions and the following disclaimer. 19 | * - Redistributions in binary form must reproduce the above copyright 20 | * notice, this list of conditions and the following disclaimer in 21 | * the documentation and/or other materials provided with the 22 | * distribution. 23 | * - Neither the name of ARM LIMITED nor the names of its contributors 24 | * may be used to endorse or promote products derived from this 25 | * software without specific prior written permission. 26 | * 27 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 28 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 29 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 30 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 31 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 32 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 33 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 34 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 35 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 36 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 37 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 38 | * POSSIBILITY OF SUCH DAMAGE. 39 | * -------------------------------------------------------------------- */ 40 | 41 | #include "arm_math.h" 42 | #include "arm_common_tables.h" 43 | 44 | /** 45 | * @ingroup groupFastMath 46 | */ 47 | 48 | /** 49 | * @addtogroup sin 50 | * @{ 51 | */ 52 | 53 | /** 54 | * @brief Fast approximation to the trigonometric sine function for Q31 data. 55 | * @param[in] x Scaled input value in radians. 56 | * @return sin(x). 57 | * 58 | * The Q31 input value is in the range [0 +0.9999] and is mapped to a radian value in the range [0 2*pi). */ 59 | 60 | q31_t arm_sin_q31( 61 | q31_t x) 62 | { 63 | q31_t sinVal; /* Temporary variables for input, output */ 64 | int32_t index; /* Index variables */ 65 | q31_t a, b; /* Four nearest output values */ 66 | q31_t fract; /* Temporary values for fractional values */ 67 | 68 | /* Calculate the nearest index */ 69 | index = (uint32_t)x >> FAST_MATH_Q31_SHIFT; 70 | 71 | /* Calculation of fractional value */ 72 | fract = (x - (index << FAST_MATH_Q31_SHIFT)) << 9; 73 | 74 | /* Read two nearest values of input value from the sin table */ 75 | a = sinTable_q31[index]; 76 | b = sinTable_q31[index+1]; 77 | 78 | /* Linear interpolation process */ 79 | sinVal = (q63_t)(0x80000000-fract)*a >> 32; 80 | sinVal = (q31_t)((((q63_t)sinVal << 32) + ((q63_t)fract*b)) >> 32); 81 | 82 | return sinVal << 1; 83 | } 84 | 85 | /** 86 | * @} end of sin group 87 | */ 88 | -------------------------------------------------------------------------------- /firmware/STM32F4xx_DSP_StdPeriph_Lib_V1.8.0/Libraries/CMSIS/DSP_Lib/Source/FastMathFunctions/arm_sin_q15.c: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- 2 | * Copyright (C) 2010-2014 ARM Limited. All rights reserved. 3 | * 4 | * $Date: 19. March 2015 5 | * $Revision: V.1.4.5 6 | * 7 | * Project: CMSIS DSP Library 8 | * Title: arm_sin_q15.c 9 | * 10 | * Description: Fast sine calculation for Q15 values. 11 | * 12 | * Target Processor: Cortex-M4/Cortex-M3/Cortex-M0 13 | * 14 | * Redistribution and use in source and binary forms, with or without 15 | * modification, are permitted provided that the following conditions 16 | * are met: 17 | * - Redistributions of source code must retain the above copyright 18 | * notice, this list of conditions and the following disclaimer. 19 | * - Redistributions in binary form must reproduce the above copyright 20 | * notice, this list of conditions and the following disclaimer in 21 | * the documentation and/or other materials provided with the 22 | * distribution. 23 | * - Neither the name of ARM LIMITED nor the names of its contributors 24 | * may be used to endorse or promote products derived from this 25 | * software without specific prior written permission. 26 | * 27 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 28 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 29 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 30 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 31 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 32 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 33 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 34 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 35 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 36 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 37 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 38 | * POSSIBILITY OF SUCH DAMAGE. 39 | * -------------------------------------------------------------------- */ 40 | 41 | #include "arm_math.h" 42 | #include "arm_common_tables.h" 43 | 44 | /** 45 | * @ingroup groupFastMath 46 | */ 47 | 48 | /** 49 | * @addtogroup sin 50 | * @{ 51 | */ 52 | 53 | /** 54 | * @brief Fast approximation to the trigonometric sine function for Q15 data. 55 | * @param[in] x Scaled input value in radians. 56 | * @return sin(x). 57 | * 58 | * The Q15 input value is in the range [0 +0.9999] and is mapped to a radian value in the range [0 2*pi). 59 | */ 60 | 61 | q15_t arm_sin_q15( 62 | q15_t x) 63 | { 64 | q15_t sinVal; /* Temporary variables for input, output */ 65 | int32_t index; /* Index variables */ 66 | q15_t a, b; /* Four nearest output values */ 67 | q15_t fract; /* Temporary values for fractional values */ 68 | 69 | /* Calculate the nearest index */ 70 | index = (uint32_t)x >> FAST_MATH_Q15_SHIFT; 71 | 72 | /* Calculation of fractional value */ 73 | fract = (x - (index << FAST_MATH_Q15_SHIFT)) << 9; 74 | 75 | /* Read two nearest values of input value from the sin table */ 76 | a = sinTable_q15[index]; 77 | b = sinTable_q15[index+1]; 78 | 79 | /* Linear interpolation process */ 80 | sinVal = (q31_t)(0x8000-fract)*a >> 16; 81 | sinVal = (q15_t)((((q31_t)sinVal << 16) + ((q31_t)fract*b)) >> 16); 82 | 83 | return sinVal << 1; 84 | } 85 | 86 | /** 87 | * @} end of sin group 88 | */ 89 | -------------------------------------------------------------------------------- /firmware/third_party/lwip-1.4.0/src/core/def.c: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * Common functions used throughout the stack. 4 | * 5 | */ 6 | 7 | /* 8 | * Copyright (c) 2001-2004 Swedish Institute of Computer Science. 9 | * All rights reserved. 10 | * 11 | * Redistribution and use in source and binary forms, with or without modification, 12 | * are permitted provided that the following conditions are met: 13 | * 14 | * 1. Redistributions of source code must retain the above copyright notice, 15 | * this list of conditions and the following disclaimer. 16 | * 2. Redistributions in binary form must reproduce the above copyright notice, 17 | * this list of conditions and the following disclaimer in the documentation 18 | * and/or other materials provided with the distribution. 19 | * 3. The name of the author may not be used to endorse or promote products 20 | * derived from this software without specific prior written permission. 21 | * 22 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 23 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 24 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 25 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 26 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 27 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 29 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 30 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 31 | * OF SUCH DAMAGE. 32 | * 33 | * This file is part of the lwIP TCP/IP stack. 34 | * 35 | * Author: Simon Goldschmidt 36 | * 37 | */ 38 | 39 | #include "lwip/opt.h" 40 | #include "lwip/def.h" 41 | 42 | /** 43 | * These are reference implementations of the byte swapping functions. 44 | * Again with the aim of being simple, correct and fully portable. 45 | * Byte swapping is the second thing you would want to optimize. You will 46 | * need to port it to your architecture and in your cc.h: 47 | * 48 | * #define LWIP_PLATFORM_BYTESWAP 1 49 | * #define LWIP_PLATFORM_HTONS(x) 50 | * #define LWIP_PLATFORM_HTONL(x) 51 | * 52 | * Note ntohs() and ntohl() are merely references to the htonx counterparts. 53 | */ 54 | 55 | #if (LWIP_PLATFORM_BYTESWAP == 0) && (BYTE_ORDER == LITTLE_ENDIAN) 56 | 57 | /** 58 | * Convert an u16_t from host- to network byte order. 59 | * 60 | * @param n u16_t in host byte order 61 | * @return n in network byte order 62 | */ 63 | u16_t 64 | lwip_htons(u16_t n) 65 | { 66 | return ((n & 0xff) << 8) | ((n & 0xff00) >> 8); 67 | } 68 | 69 | /** 70 | * Convert an u16_t from network- to host byte order. 71 | * 72 | * @param n u16_t in network byte order 73 | * @return n in host byte order 74 | */ 75 | u16_t 76 | lwip_ntohs(u16_t n) 77 | { 78 | return lwip_htons(n); 79 | } 80 | 81 | /** 82 | * Convert an u32_t from host- to network byte order. 83 | * 84 | * @param n u32_t in host byte order 85 | * @return n in network byte order 86 | */ 87 | u32_t 88 | lwip_htonl(u32_t n) 89 | { 90 | return ((n & 0xff) << 24) | 91 | ((n & 0xff00) << 8) | 92 | ((n & 0xff0000UL) >> 8) | 93 | ((n & 0xff000000UL) >> 24); 94 | } 95 | 96 | /** 97 | * Convert an u32_t from network- to host byte order. 98 | * 99 | * @param n u32_t in network byte order 100 | * @return n in host byte order 101 | */ 102 | u32_t 103 | lwip_ntohl(u32_t n) 104 | { 105 | return lwip_htonl(n); 106 | } 107 | 108 | #endif /* (LWIP_PLATFORM_BYTESWAP == 0) && (BYTE_ORDER == LITTLE_ENDIAN) */ 109 | -------------------------------------------------------------------------------- /firmware/STM32F4xx_DSP_StdPeriph_Lib_V1.8.0/Libraries/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_flash_ramfunc.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file stm32f4xx_flash_ramfunc.h 4 | * @author MCD Application Team 5 | * @version V1.8.0 6 | * @date 04-November-2016 7 | * @brief Header file of FLASH RAMFUNC driver. 8 | ****************************************************************************** 9 | * @attention 10 | * 11 | *

© COPYRIGHT 2016 STMicroelectronics

12 | * 13 | * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License"); 14 | * You may not use this file except in compliance with the License. 15 | * You may obtain a copy of the License at: 16 | * 17 | * http://www.st.com/software_license_agreement_liberty_v2 18 | * 19 | * Unless required by applicable law or agreed to in writing, software 20 | * distributed under the License is distributed on an "AS IS" BASIS, 21 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 22 | * See the License for the specific language governing permissions and 23 | * limitations under the License. 24 | * 25 | ****************************************************************************** 26 | */ 27 | 28 | 29 | /* Define to prevent recursive inclusion -------------------------------------*/ 30 | #ifndef __STM32F4xx_FLASH_RAMFUNC_H 31 | #define __STM32F4xx_FLASH_RAMFUNC_H 32 | 33 | #ifdef __cplusplus 34 | extern "C" { 35 | #endif 36 | 37 | /* Includes ------------------------------------------------------------------*/ 38 | #include "stm32f4xx.h" 39 | 40 | /** @addtogroup STM32F4xx_StdPeriph_Driver 41 | * @{ 42 | */ 43 | 44 | /** @addtogroup FLASH RAMFUNC 45 | * @{ 46 | */ 47 | 48 | /* Exported types ------------------------------------------------------------*/ 49 | /* Private define ------------------------------------------------------------*/ 50 | /** 51 | * @brief __RAM_FUNC definition 52 | */ 53 | #if defined ( __CC_ARM ) 54 | /* ARM Compiler 55 | ------------ 56 | RAM functions are defined using the toolchain options. 57 | Functions that are executed in RAM should reside in a separate source module. 58 | Using the 'Options for File' dialog you can simply change the 'Code / Const' 59 | area of a module to a memory space in physical RAM. 60 | Available memory areas are declared in the 'Target' tab of the 'Options for Target' 61 | dialog. 62 | */ 63 | #define __RAM_FUNC void 64 | 65 | #elif defined ( __ICCARM__ ) 66 | /* ICCARM Compiler 67 | --------------- 68 | RAM functions are defined using a specific toolchain keyword "__ramfunc". 69 | */ 70 | #define __RAM_FUNC __ramfunc void 71 | 72 | #elif defined ( __GNUC__ ) 73 | /* GNU Compiler 74 | ------------ 75 | RAM functions are defined using a specific toolchain attribute 76 | "__attribute__((section(".RamFunc")))". 77 | */ 78 | #define __RAM_FUNC void __attribute__((section(".RamFunc"))) 79 | 80 | #endif 81 | /* Exported constants --------------------------------------------------------*/ 82 | /* Exported macro ------------------------------------------------------------*/ 83 | /* Exported functions --------------------------------------------------------*/ 84 | __RAM_FUNC FLASH_FlashInterfaceCmd(FunctionalState NewState); 85 | __RAM_FUNC FLASH_FlashSleepModeCmd(FunctionalState NewState); 86 | 87 | 88 | #ifdef __cplusplus 89 | } 90 | #endif 91 | 92 | #endif /* __STM32F4xx_FLASH_RAMFUNC_H */ 93 | 94 | /** 95 | * @} 96 | */ 97 | 98 | /** 99 | * @} 100 | */ 101 | 102 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 103 | 104 | -------------------------------------------------------------------------------- /firmware/STM32F4xx_DSP_StdPeriph_Lib_V1.8.0/Libraries/CMSIS/DSP_Lib/Source/FilteringFunctions/arm_iir_lattice_init_q15.c: -------------------------------------------------------------------------------- 1 | /*----------------------------------------------------------------------------- 2 | * Copyright (C) 2010-2014 ARM Limited. All rights reserved. 3 | * 4 | * $Date: 19. March 2015 5 | * $Revision: V.1.4.5 6 | * 7 | * Project: CMSIS DSP Library 8 | * Title: arm_iir_lattice_init_q15.c 9 | * 10 | * Description: Q15 IIR lattice filter initialization function. 11 | * 12 | * Target Processor: Cortex-M4/Cortex-M3/Cortex-M0 13 | * 14 | * Redistribution and use in source and binary forms, with or without 15 | * modification, are permitted provided that the following conditions 16 | * are met: 17 | * - Redistributions of source code must retain the above copyright 18 | * notice, this list of conditions and the following disclaimer. 19 | * - Redistributions in binary form must reproduce the above copyright 20 | * notice, this list of conditions and the following disclaimer in 21 | * the documentation and/or other materials provided with the 22 | * distribution. 23 | * - Neither the name of ARM LIMITED nor the names of its contributors 24 | * may be used to endorse or promote products derived from this 25 | * software without specific prior written permission. 26 | * 27 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 28 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 29 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 30 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 31 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 32 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 33 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 34 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 35 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 36 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 37 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 38 | * POSSIBILITY OF SUCH DAMAGE. 39 | * ---------------------------------------------------------------------------*/ 40 | 41 | #include "arm_math.h" 42 | 43 | /** 44 | * @ingroup groupFilters 45 | */ 46 | 47 | /** 48 | * @addtogroup IIR_Lattice 49 | * @{ 50 | */ 51 | 52 | /** 53 | * @brief Initialization function for the Q15 IIR lattice filter. 54 | * @param[in] *S points to an instance of the Q15 IIR lattice structure. 55 | * @param[in] numStages number of stages in the filter. 56 | * @param[in] *pkCoeffs points to reflection coefficient buffer. The array is of length numStages. 57 | * @param[in] *pvCoeffs points to ladder coefficient buffer. The array is of length numStages+1. 58 | * @param[in] *pState points to state buffer. The array is of length numStages+blockSize. 59 | * @param[in] blockSize number of samples to process per call. 60 | * @return none. 61 | */ 62 | 63 | void arm_iir_lattice_init_q15( 64 | arm_iir_lattice_instance_q15 * S, 65 | uint16_t numStages, 66 | q15_t * pkCoeffs, 67 | q15_t * pvCoeffs, 68 | q15_t * pState, 69 | uint32_t blockSize) 70 | { 71 | /* Assign filter taps */ 72 | S->numStages = numStages; 73 | 74 | /* Assign reflection coefficient pointer */ 75 | S->pkCoeffs = pkCoeffs; 76 | 77 | /* Assign ladder coefficient pointer */ 78 | S->pvCoeffs = pvCoeffs; 79 | 80 | /* Clear state buffer and size is always blockSize + numStages */ 81 | memset(pState, 0, (numStages + blockSize) * sizeof(q15_t)); 82 | 83 | /* Assign state pointer */ 84 | S->pState = pState; 85 | 86 | 87 | } 88 | 89 | /** 90 | * @} end of IIR_Lattice group 91 | */ 92 | -------------------------------------------------------------------------------- /firmware/STM32F4xx_DSP_StdPeriph_Lib_V1.8.0/Libraries/CMSIS/DSP_Lib/Source/FilteringFunctions/arm_iir_lattice_init_q31.c: -------------------------------------------------------------------------------- 1 | /*----------------------------------------------------------------------------- 2 | * Copyright (C) 2010-2014 ARM Limited. All rights reserved. 3 | * 4 | * $Date: 19. March 2015 5 | * $Revision: V.1.4.5 6 | * 7 | * Project: CMSIS DSP Library 8 | * Title: arm_iir_lattice_init_q31.c 9 | * 10 | * Description: Initialization function for the Q31 IIR lattice filter. 11 | * 12 | * Target Processor: Cortex-M4/Cortex-M3/Cortex-M0 13 | * 14 | * Redistribution and use in source and binary forms, with or without 15 | * modification, are permitted provided that the following conditions 16 | * are met: 17 | * - Redistributions of source code must retain the above copyright 18 | * notice, this list of conditions and the following disclaimer. 19 | * - Redistributions in binary form must reproduce the above copyright 20 | * notice, this list of conditions and the following disclaimer in 21 | * the documentation and/or other materials provided with the 22 | * distribution. 23 | * - Neither the name of ARM LIMITED nor the names of its contributors 24 | * may be used to endorse or promote products derived from this 25 | * software without specific prior written permission. 26 | * 27 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 28 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 29 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 30 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 31 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 32 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 33 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 34 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 35 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 36 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 37 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 38 | * POSSIBILITY OF SUCH DAMAGE. 39 | * ---------------------------------------------------------------------------*/ 40 | 41 | #include "arm_math.h" 42 | 43 | /** 44 | * @ingroup groupFilters 45 | */ 46 | 47 | /** 48 | * @addtogroup IIR_Lattice 49 | * @{ 50 | */ 51 | 52 | /** 53 | * @brief Initialization function for the Q31 IIR lattice filter. 54 | * @param[in] *S points to an instance of the Q31 IIR lattice structure. 55 | * @param[in] numStages number of stages in the filter. 56 | * @param[in] *pkCoeffs points to the reflection coefficient buffer. The array is of length numStages. 57 | * @param[in] *pvCoeffs points to the ladder coefficient buffer. The array is of length numStages+1. 58 | * @param[in] *pState points to the state buffer. The array is of length numStages+blockSize. 59 | * @param[in] blockSize number of samples to process. 60 | * @return none. 61 | */ 62 | 63 | void arm_iir_lattice_init_q31( 64 | arm_iir_lattice_instance_q31 * S, 65 | uint16_t numStages, 66 | q31_t * pkCoeffs, 67 | q31_t * pvCoeffs, 68 | q31_t * pState, 69 | uint32_t blockSize) 70 | { 71 | /* Assign filter taps */ 72 | S->numStages = numStages; 73 | 74 | /* Assign reflection coefficient pointer */ 75 | S->pkCoeffs = pkCoeffs; 76 | 77 | /* Assign ladder coefficient pointer */ 78 | S->pvCoeffs = pvCoeffs; 79 | 80 | /* Clear state buffer and size is always blockSize + numStages */ 81 | memset(pState, 0, (numStages + blockSize) * sizeof(q31_t)); 82 | 83 | /* Assign state pointer */ 84 | S->pState = pState; 85 | 86 | 87 | } 88 | 89 | /** 90 | * @} end of IIR_Lattice group 91 | */ 92 | -------------------------------------------------------------------------------- /firmware/third_party/lwip-1.4.0/src/include/ipv4/lwip/inet_chksum.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001-2004 Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, 6 | * are permitted provided that the following conditions are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 3. The name of the author may not be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 19 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 21 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 24 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 25 | * OF SUCH DAMAGE. 26 | * 27 | * This file is part of the lwIP TCP/IP stack. 28 | * 29 | * Author: Adam Dunkels 30 | * 31 | */ 32 | #ifndef __LWIP_INET_CHKSUM_H__ 33 | #define __LWIP_INET_CHKSUM_H__ 34 | 35 | #include "lwip/opt.h" 36 | 37 | #include "lwip/pbuf.h" 38 | #include "lwip/ip_addr.h" 39 | 40 | /** Swap the bytes in an u16_t: much like htons() for little-endian */ 41 | #ifndef SWAP_BYTES_IN_WORD 42 | #if LWIP_PLATFORM_BYTESWAP && (BYTE_ORDER == LITTLE_ENDIAN) 43 | /* little endian and PLATFORM_BYTESWAP defined */ 44 | #define SWAP_BYTES_IN_WORD(w) LWIP_PLATFORM_HTONS(w) 45 | #else /* LWIP_PLATFORM_BYTESWAP && (BYTE_ORDER == LITTLE_ENDIAN) */ 46 | /* can't use htons on big endian (or PLATFORM_BYTESWAP not defined)... */ 47 | #define SWAP_BYTES_IN_WORD(w) (((w) & 0xff) << 8) | (((w) & 0xff00) >> 8) 48 | #endif /* LWIP_PLATFORM_BYTESWAP && (BYTE_ORDER == LITTLE_ENDIAN)*/ 49 | #endif /* SWAP_BYTES_IN_WORD */ 50 | 51 | /** Split an u32_t in two u16_ts and add them up */ 52 | #ifndef FOLD_U32T 53 | #define FOLD_U32T(u) (((u) >> 16) + ((u) & 0x0000ffffUL)) 54 | #endif 55 | 56 | #if LWIP_CHECKSUM_ON_COPY 57 | /** Function-like macro: same as MEMCPY but returns the checksum of copied data 58 | as u16_t */ 59 | #ifndef LWIP_CHKSUM_COPY 60 | #define LWIP_CHKSUM_COPY(dst, src, len) lwip_chksum_copy(dst, src, len) 61 | #ifndef LWIP_CHKSUM_COPY_ALGORITHM 62 | #define LWIP_CHKSUM_COPY_ALGORITHM 1 63 | #endif /* LWIP_CHKSUM_COPY_ALGORITHM */ 64 | #endif /* LWIP_CHKSUM_COPY */ 65 | #else /* LWIP_CHECKSUM_ON_COPY */ 66 | #define LWIP_CHKSUM_COPY_ALGORITHM 0 67 | #endif /* LWIP_CHECKSUM_ON_COPY */ 68 | 69 | #ifdef __cplusplus 70 | extern "C" { 71 | #endif 72 | 73 | u16_t inet_chksum(void *dataptr, u16_t len); 74 | u16_t inet_chksum_pbuf(struct pbuf *p); 75 | u16_t inet_chksum_pseudo(struct pbuf *p, 76 | ip_addr_t *src, ip_addr_t *dest, 77 | u8_t proto, u16_t proto_len); 78 | u16_t inet_chksum_pseudo_partial(struct pbuf *p, 79 | ip_addr_t *src, ip_addr_t *dest, 80 | u8_t proto, u16_t proto_len, u16_t chksum_len); 81 | #if LWIP_CHKSUM_COPY_ALGORITHM 82 | u16_t lwip_chksum_copy(void *dst, const void *src, u16_t len); 83 | #endif /* LWIP_CHKSUM_COPY_ALGORITHM */ 84 | 85 | #ifdef __cplusplus 86 | } 87 | #endif 88 | 89 | #endif /* __LWIP_INET_H__ */ 90 | 91 | -------------------------------------------------------------------------------- /firmware/STM32F4xx_DSP_StdPeriph_Lib_V1.8.0/Libraries/CMSIS/DSP_Lib/Source/FilteringFunctions/arm_iir_lattice_init_f32.c: -------------------------------------------------------------------------------- 1 | /*----------------------------------------------------------------------------- 2 | * Copyright (C) 2010-2014 ARM Limited. All rights reserved. 3 | * 4 | * $Date: 19. March 2015 5 | * $Revision: V.1.4.5 6 | * 7 | * Project: CMSIS DSP Library 8 | * Title: arm_iir_lattice_init_f32.c 9 | * 10 | * Description: Floating-point IIR lattice filter initialization function. 11 | * 12 | * Target Processor: Cortex-M4/Cortex-M3/Cortex-M0 13 | * 14 | * Redistribution and use in source and binary forms, with or without 15 | * modification, are permitted provided that the following conditions 16 | * are met: 17 | * - Redistributions of source code must retain the above copyright 18 | * notice, this list of conditions and the following disclaimer. 19 | * - Redistributions in binary form must reproduce the above copyright 20 | * notice, this list of conditions and the following disclaimer in 21 | * the documentation and/or other materials provided with the 22 | * distribution. 23 | * - Neither the name of ARM LIMITED nor the names of its contributors 24 | * may be used to endorse or promote products derived from this 25 | * software without specific prior written permission. 26 | * 27 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 28 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 29 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 30 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 31 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 32 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 33 | * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 34 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 35 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 36 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 37 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 38 | * POSSIBILITY OF SUCH DAMAGE. 39 | * ---------------------------------------------------------------------------*/ 40 | 41 | #include "arm_math.h" 42 | 43 | /** 44 | * @ingroup groupFilters 45 | */ 46 | 47 | /** 48 | * @addtogroup IIR_Lattice 49 | * @{ 50 | */ 51 | 52 | /** 53 | * @brief Initialization function for the floating-point IIR lattice filter. 54 | * @param[in] *S points to an instance of the floating-point IIR lattice structure. 55 | * @param[in] numStages number of stages in the filter. 56 | * @param[in] *pkCoeffs points to the reflection coefficient buffer. The array is of length numStages. 57 | * @param[in] *pvCoeffs points to the ladder coefficient buffer. The array is of length numStages+1. 58 | * @param[in] *pState points to the state buffer. The array is of length numStages+blockSize. 59 | * @param[in] blockSize number of samples to process. 60 | * @return none. 61 | */ 62 | 63 | void arm_iir_lattice_init_f32( 64 | arm_iir_lattice_instance_f32 * S, 65 | uint16_t numStages, 66 | float32_t * pkCoeffs, 67 | float32_t * pvCoeffs, 68 | float32_t * pState, 69 | uint32_t blockSize) 70 | { 71 | /* Assign filter taps */ 72 | S->numStages = numStages; 73 | 74 | /* Assign reflection coefficient pointer */ 75 | S->pkCoeffs = pkCoeffs; 76 | 77 | /* Assign ladder coefficient pointer */ 78 | S->pvCoeffs = pvCoeffs; 79 | 80 | /* Clear state buffer and size is always blockSize + numStages */ 81 | memset(pState, 0, (numStages + blockSize) * sizeof(float32_t)); 82 | 83 | /* Assign state pointer */ 84 | S->pState = pState; 85 | 86 | 87 | } 88 | 89 | /** 90 | * @} end of IIR_Lattice group 91 | */ 92 | -------------------------------------------------------------------------------- /firmware/third_party/lwip-1.4.0/src/include/lwip/raw.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001-2004 Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, 6 | * are permitted provided that the following conditions are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 3. The name of the author may not be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 19 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 21 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 24 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 25 | * OF SUCH DAMAGE. 26 | * 27 | * This file is part of the lwIP TCP/IP stack. 28 | * 29 | * Author: Adam Dunkels 30 | * 31 | */ 32 | #ifndef __LWIP_RAW_H__ 33 | #define __LWIP_RAW_H__ 34 | 35 | #include "lwip/opt.h" 36 | 37 | #if LWIP_RAW /* don't build if not configured for use in lwipopts.h */ 38 | 39 | #include "lwip/pbuf.h" 40 | #include "lwip/def.h" 41 | #include "lwip/ip.h" 42 | #include "lwip/ip_addr.h" 43 | 44 | #ifdef __cplusplus 45 | extern "C" { 46 | #endif 47 | 48 | struct raw_pcb; 49 | 50 | /** Function prototype for raw pcb receive callback functions. 51 | * @param arg user supplied argument (raw_pcb.recv_arg) 52 | * @param pcb the raw_pcb which received data 53 | * @param p the packet buffer that was received 54 | * @param addr the remote IP address from which the packet was received 55 | * @return 1 if the packet was 'eaten' (aka. deleted), 56 | * 0 if the packet lives on 57 | * If returning 1, the callback is responsible for freeing the pbuf 58 | * if it's not used any more. 59 | */ 60 | typedef u8_t (*raw_recv_fn)(void *arg, struct raw_pcb *pcb, struct pbuf *p, 61 | ip_addr_t *addr); 62 | 63 | struct raw_pcb { 64 | /* Common members of all PCB types */ 65 | IP_PCB; 66 | 67 | struct raw_pcb *next; 68 | 69 | u8_t protocol; 70 | 71 | /** receive callback function */ 72 | raw_recv_fn recv; 73 | /* user-supplied argument for the recv callback */ 74 | void *recv_arg; 75 | }; 76 | 77 | /* The following functions is the application layer interface to the 78 | RAW code. */ 79 | struct raw_pcb * raw_new (u8_t proto); 80 | void raw_remove (struct raw_pcb *pcb); 81 | err_t raw_bind (struct raw_pcb *pcb, ip_addr_t *ipaddr); 82 | err_t raw_connect (struct raw_pcb *pcb, ip_addr_t *ipaddr); 83 | 84 | void raw_recv (struct raw_pcb *pcb, raw_recv_fn recv, void *recv_arg); 85 | err_t raw_sendto (struct raw_pcb *pcb, struct pbuf *p, ip_addr_t *ipaddr); 86 | err_t raw_send (struct raw_pcb *pcb, struct pbuf *p); 87 | 88 | /* The following functions are the lower layer interface to RAW. */ 89 | u8_t raw_input (struct pbuf *p, struct netif *inp); 90 | #define raw_init() /* Compatibility define, not init needed. */ 91 | 92 | #ifdef __cplusplus 93 | } 94 | #endif 95 | 96 | #endif /* LWIP_RAW */ 97 | 98 | #endif /* __LWIP_RAW_H__ */ 99 | --------------------------------------------------------------------------------