├── Fritzing ├── Fritzing Layout.fzz ├── Fritzing Layout_bb.png ├── Fritzing Layout_bb.svg └── Readme.md ├── README.md ├── src ├── .gitignore ├── LC-SCSI.sln └── LCSCSI-STM32 │ ├── LCSCSI-STM32-Debug.vgdbsettings │ ├── LCSCSI-STM32-Release.vgdbsettings │ ├── LCSCSI-STM32.vcxproj │ ├── LCSCSI-STM32.vcxproj.filters │ ├── STM32HAL_printf_uart.c │ ├── VisualGDB │ └── VisualGDBCache │ │ └── EmbeddedProject3-Debug │ │ └── MemoryUtilizationReport.xml │ ├── debug.c │ ├── debug.h │ ├── defines.h │ ├── filesystem.c │ ├── filesystem.h │ ├── hostadapter.c │ ├── hostadapter.h │ ├── main.c │ ├── scsi.c │ ├── scsi.h │ ├── stm32.props │ ├── stm32.xml │ ├── stm32 │ ├── FreeRTOS │ │ ├── CMSIS_RTOS │ │ │ ├── cmsis_os.c │ │ │ └── cmsis_os.h │ │ ├── croutine.c │ │ ├── event_groups.c │ │ ├── include │ │ │ ├── FreeRTOS.h │ │ │ ├── FreeRTOSConfig_template.h │ │ │ ├── StackMacros.h │ │ │ ├── croutine.h │ │ │ ├── deprecated_definitions.h │ │ │ ├── event_groups.h │ │ │ ├── list.h │ │ │ ├── mpu_wrappers.h │ │ │ ├── portable.h │ │ │ ├── projdefs.h │ │ │ ├── queue.h │ │ │ ├── semphr.h │ │ │ ├── stdint.readme │ │ │ ├── task.h │ │ │ └── timers.h │ │ ├── list.c │ │ ├── portable │ │ │ ├── GCC │ │ │ │ ├── ARM_CM0 │ │ │ │ │ ├── port.c │ │ │ │ │ └── portmacro.h │ │ │ │ ├── ARM_CM3 │ │ │ │ │ ├── port.c │ │ │ │ │ └── portmacro.h │ │ │ │ ├── ARM_CM3_MPU │ │ │ │ │ ├── port.c │ │ │ │ │ └── portmacro.h │ │ │ │ ├── ARM_CM4F │ │ │ │ │ ├── port.c │ │ │ │ │ └── portmacro.h │ │ │ │ └── ARM_CM7 │ │ │ │ │ ├── ReadMe.txt │ │ │ │ │ └── r0p1 │ │ │ │ │ ├── port.c │ │ │ │ │ └── portmacro.h │ │ │ ├── IAR │ │ │ │ ├── ARM_CM0 │ │ │ │ │ ├── port.c │ │ │ │ │ ├── portasm.s │ │ │ │ │ └── portmacro.h │ │ │ │ ├── ARM_CM3 │ │ │ │ │ ├── port.c │ │ │ │ │ ├── portasm.s │ │ │ │ │ └── portmacro.h │ │ │ │ ├── ARM_CM4F │ │ │ │ │ ├── port.c │ │ │ │ │ ├── portasm.s │ │ │ │ │ └── portmacro.h │ │ │ │ └── ARM_CM7 │ │ │ │ │ ├── ReadMe.txt │ │ │ │ │ └── r0p1 │ │ │ │ │ ├── port.c │ │ │ │ │ ├── portasm.s │ │ │ │ │ └── portmacro.h │ │ │ ├── Keil │ │ │ │ └── See-also-the-RVDS-directory.txt │ │ │ ├── MemMang │ │ │ │ ├── heap_1.c │ │ │ │ ├── heap_2.c │ │ │ │ ├── heap_3.c │ │ │ │ ├── heap_4.c │ │ │ │ └── heap_5.c │ │ │ ├── RVDS │ │ │ │ ├── ARM_CM0 │ │ │ │ │ ├── port_cm0.c │ │ │ │ │ └── portmacro.h │ │ │ │ ├── ARM_CM3 │ │ │ │ │ ├── port_cm3.c │ │ │ │ │ └── portmacro.h │ │ │ │ ├── ARM_CM4F │ │ │ │ │ ├── port_cm4.c │ │ │ │ │ └── portmacro.h │ │ │ │ └── ARM_CM7 │ │ │ │ │ ├── port_cm7.c │ │ │ │ │ └── portmacro.h │ │ │ ├── Tasking │ │ │ │ └── ARM_CM4F │ │ │ │ │ ├── port.c │ │ │ │ │ ├── port_asm.asm │ │ │ │ │ └── portmacro.h │ │ │ └── readme.txt │ │ ├── queue.c │ │ ├── tasks.c │ │ └── timers.c │ ├── PT │ │ ├── lc-addrlabels.h │ │ ├── lc-switch.h │ │ ├── lc.h │ │ ├── pt-sem.h │ │ └── pt.h │ ├── USB_Device │ │ ├── Class │ │ │ ├── AUDIO │ │ │ │ ├── Inc │ │ │ │ │ ├── usbd_audio.h │ │ │ │ │ └── usbd_audio_if_template.h │ │ │ │ └── Src │ │ │ │ │ ├── usbd_audio.c │ │ │ │ │ └── usbd_audio_if_template.c │ │ │ ├── CDC │ │ │ │ ├── Inc │ │ │ │ │ ├── usbd_cdc.h │ │ │ │ │ ├── usbd_cdc_if.h │ │ │ │ │ └── usbd_cdc_if_template.h │ │ │ │ └── Src │ │ │ │ │ ├── usbd_cdc.c │ │ │ │ │ ├── usbd_cdc_if.c │ │ │ │ │ └── usbd_cdc_if_template.c │ │ │ ├── CustomHID │ │ │ │ ├── Inc │ │ │ │ │ ├── usbd_customhid.h │ │ │ │ │ └── usbd_customhid_if_template.h │ │ │ │ └── Src │ │ │ │ │ ├── usbd_customhid.c │ │ │ │ │ └── usbd_customhid_if_template.c │ │ │ ├── DFU │ │ │ │ ├── Inc │ │ │ │ │ ├── usbd_dfu.h │ │ │ │ │ └── usbd_dfu_media_template.h │ │ │ │ └── Src │ │ │ │ │ ├── usbd_dfu.c │ │ │ │ │ └── usbd_dfu_media_template.c │ │ │ ├── HID │ │ │ │ ├── Inc │ │ │ │ │ └── usbd_hid.h │ │ │ │ └── Src │ │ │ │ │ └── usbd_hid.c │ │ │ ├── MSC │ │ │ │ ├── Inc │ │ │ │ │ ├── usbd_msc.h │ │ │ │ │ ├── usbd_msc_bot.h │ │ │ │ │ ├── usbd_msc_data.h │ │ │ │ │ ├── usbd_msc_scsi.h │ │ │ │ │ ├── usbd_msc_storage.h │ │ │ │ │ └── usbd_msc_storage_template.h │ │ │ │ └── Src │ │ │ │ │ ├── usbd_msc.c │ │ │ │ │ ├── usbd_msc_bot.c │ │ │ │ │ ├── usbd_msc_data.c │ │ │ │ │ ├── usbd_msc_scsi.c │ │ │ │ │ ├── usbd_msc_storage.c │ │ │ │ │ └── usbd_msc_storage_template.c │ │ │ └── Template │ │ │ │ ├── Inc │ │ │ │ └── usbd_template.h │ │ │ │ └── Src │ │ │ │ └── usbd_template.c │ │ ├── Core │ │ │ ├── Inc │ │ │ │ ├── usbd_conf.h │ │ │ │ ├── usbd_conf_template.h │ │ │ │ ├── usbd_core.h │ │ │ │ ├── usbd_ctlreq.h │ │ │ │ ├── usbd_def.h │ │ │ │ ├── usbd_desc.h │ │ │ │ └── usbd_ioreq.h │ │ │ └── Src │ │ │ │ ├── usbd_conf.c │ │ │ │ ├── usbd_conf_template.c │ │ │ │ ├── usbd_core.c │ │ │ │ ├── usbd_ctlreq.c │ │ │ │ └── usbd_ioreq.c │ │ └── Release_Notes.html │ ├── USB_Host │ │ ├── Class │ │ │ ├── AUDIO │ │ │ │ ├── Inc │ │ │ │ │ └── usbh_audio.h │ │ │ │ └── Src │ │ │ │ │ └── usbh_audio.c │ │ │ ├── CDC │ │ │ │ ├── Inc │ │ │ │ │ └── usbh_cdc.h │ │ │ │ └── Src │ │ │ │ │ └── usbh_cdc.c │ │ │ ├── HID │ │ │ │ ├── Inc │ │ │ │ │ ├── usbh_hid.h │ │ │ │ │ ├── usbh_hid_keybd.h │ │ │ │ │ ├── usbh_hid_mouse.h │ │ │ │ │ ├── usbh_hid_parser.h │ │ │ │ │ └── usbh_hid_usage.h │ │ │ │ └── Src │ │ │ │ │ ├── usbh_hid.c │ │ │ │ │ ├── usbh_hid_keybd.c │ │ │ │ │ ├── usbh_hid_mouse.c │ │ │ │ │ └── usbh_hid_parser.c │ │ │ ├── MSC │ │ │ │ ├── Inc │ │ │ │ │ ├── usbh_msc.h │ │ │ │ │ ├── usbh_msc_bot.h │ │ │ │ │ └── usbh_msc_scsi.h │ │ │ │ └── Src │ │ │ │ │ ├── usbh_msc.c │ │ │ │ │ ├── usbh_msc_bot.c │ │ │ │ │ └── usbh_msc_scsi.c │ │ │ ├── MTP │ │ │ │ ├── Inc │ │ │ │ │ ├── usbh_mtp.h │ │ │ │ │ └── usbh_mtp_ptp.h │ │ │ │ └── Src │ │ │ │ │ ├── usbh_mtp.c │ │ │ │ │ └── usbh_mtp_ptp.c │ │ │ └── Template │ │ │ │ ├── Inc │ │ │ │ └── usbh_template.h │ │ │ │ └── Src │ │ │ │ └── usbh_template.c │ │ ├── Core │ │ │ ├── Inc │ │ │ │ ├── usbh_conf.h │ │ │ │ ├── usbh_conf_template.h │ │ │ │ ├── usbh_core.h │ │ │ │ ├── usbh_ctlreq.h │ │ │ │ ├── usbh_def.h │ │ │ │ ├── usbh_ioreq.h │ │ │ │ └── usbh_pipes.h │ │ │ └── Src │ │ │ │ ├── usbh_conf.c │ │ │ │ ├── usbh_conf_template.c │ │ │ │ ├── usbh_core.c │ │ │ │ ├── usbh_ctlreq.c │ │ │ │ ├── usbh_ioreq.c │ │ │ │ └── usbh_pipes.c │ │ └── Release_Notes.html │ ├── attributes.h │ ├── fatfs │ │ ├── diskio.c │ │ ├── diskio.h │ │ ├── drivers │ │ │ ├── fatfs_sd.c │ │ │ ├── fatfs_sd.h │ │ │ ├── fatfs_sd_sdio.c │ │ │ ├── fatfs_sd_sdio.h │ │ │ ├── fatfs_sdram.c │ │ │ ├── fatfs_sdram.h │ │ │ ├── fatfs_spi_flash.c │ │ │ ├── fatfs_spi_flash.h │ │ │ ├── fatfs_usb.c │ │ │ └── fatfs_usb.h │ │ ├── ff.c │ │ ├── ff.h │ │ ├── ffconf.h │ │ ├── ffconf_org.h │ │ ├── integer.h │ │ └── option │ │ │ ├── cc932.c │ │ │ ├── cc936.c │ │ │ ├── cc949.c │ │ │ ├── cc950.c │ │ │ ├── ccsbcs.c │ │ │ ├── syscall.c │ │ │ └── unicode.c │ ├── lwip │ │ ├── TM_README.txt │ │ ├── doc │ │ │ ├── FILES │ │ │ ├── contrib.txt │ │ │ ├── rawapi.txt │ │ │ ├── savannah.txt │ │ │ ├── snmp_agent.txt │ │ │ └── sys_arch.txt │ │ ├── fs.c │ │ ├── fs.h │ │ ├── fsdata.c │ │ ├── fsdata.h │ │ ├── httpd.c │ │ ├── httpd.h │ │ ├── httpd_cgi_ssi.c │ │ ├── httpd_structs.h │ │ ├── lwipopts.h │ │ ├── netconf.c │ │ ├── netconf.h │ │ ├── port │ │ │ ├── arch │ │ │ │ ├── bpstruct.h │ │ │ │ ├── cc.h │ │ │ │ ├── cpu.h │ │ │ │ ├── epstruct.h │ │ │ │ ├── init.h │ │ │ │ ├── lib.h │ │ │ │ ├── perf.h │ │ │ │ └── sys_arch.h │ │ │ ├── ethernetif.c │ │ │ └── ethernetif.h │ │ ├── src │ │ │ ├── FILES │ │ │ ├── api │ │ │ │ ├── api_lib.c │ │ │ │ ├── api_msg.c │ │ │ │ ├── err.c │ │ │ │ ├── netbuf.c │ │ │ │ ├── netdb.c │ │ │ │ ├── netifapi.c │ │ │ │ ├── sockets.c │ │ │ │ └── tcpip.c │ │ │ ├── core │ │ │ │ ├── def.c │ │ │ │ ├── dhcp.c │ │ │ │ ├── dns.c │ │ │ │ ├── init.c │ │ │ │ ├── ipv4 │ │ │ │ │ ├── autoip.c │ │ │ │ │ ├── icmp.c │ │ │ │ │ ├── igmp.c │ │ │ │ │ ├── inet.c │ │ │ │ │ ├── inet_chksum.c │ │ │ │ │ ├── ip.c │ │ │ │ │ ├── ip_addr.c │ │ │ │ │ └── ip_frag.c │ │ │ │ ├── ipv6 │ │ │ │ │ ├── README │ │ │ │ │ ├── icmp6.c │ │ │ │ │ ├── inet6.c │ │ │ │ │ ├── ip6.c │ │ │ │ │ └── ip6_addr.c │ │ │ │ ├── mem.c │ │ │ │ ├── memp.c │ │ │ │ ├── netif.c │ │ │ │ ├── pbuf.c │ │ │ │ ├── raw.c │ │ │ │ ├── snmp │ │ │ │ │ ├── asn1_dec.c │ │ │ │ │ ├── asn1_enc.c │ │ │ │ │ ├── mib2.c │ │ │ │ │ ├── mib_structs.c │ │ │ │ │ ├── msg_in.c │ │ │ │ │ └── msg_out.c │ │ │ │ ├── stats.c │ │ │ │ ├── sys.c │ │ │ │ ├── tcp.c │ │ │ │ ├── tcp_in.c │ │ │ │ ├── tcp_out.c │ │ │ │ ├── timers.c │ │ │ │ └── udp.c │ │ │ ├── include │ │ │ │ ├── ipv4 │ │ │ │ │ └── lwip │ │ │ │ │ │ ├── autoip.h │ │ │ │ │ │ ├── icmp.h │ │ │ │ │ │ ├── igmp.h │ │ │ │ │ │ ├── inet.h │ │ │ │ │ │ ├── inet_chksum.h │ │ │ │ │ │ ├── ip.h │ │ │ │ │ │ ├── ip_addr.h │ │ │ │ │ │ └── ip_frag.h │ │ │ │ ├── ipv6 │ │ │ │ │ └── lwip │ │ │ │ │ │ ├── icmp.h │ │ │ │ │ │ ├── inet.h │ │ │ │ │ │ ├── ip.h │ │ │ │ │ │ └── ip_addr.h │ │ │ │ ├── lwip │ │ │ │ │ ├── api.h │ │ │ │ │ ├── api_msg.h │ │ │ │ │ ├── arch.h │ │ │ │ │ ├── debug.h │ │ │ │ │ ├── def.h │ │ │ │ │ ├── dhcp.h │ │ │ │ │ ├── dns.h │ │ │ │ │ ├── err.h │ │ │ │ │ ├── init.h │ │ │ │ │ ├── mem.h │ │ │ │ │ ├── memp.h │ │ │ │ │ ├── memp_std.h │ │ │ │ │ ├── netbuf.h │ │ │ │ │ ├── netdb.h │ │ │ │ │ ├── netif.h │ │ │ │ │ ├── netifapi.h │ │ │ │ │ ├── opt.h │ │ │ │ │ ├── pbuf.h │ │ │ │ │ ├── raw.h │ │ │ │ │ ├── sio.h │ │ │ │ │ ├── snmp.h │ │ │ │ │ ├── snmp_asn1.h │ │ │ │ │ ├── snmp_msg.h │ │ │ │ │ ├── snmp_structs.h │ │ │ │ │ ├── sockets.h │ │ │ │ │ ├── stats.h │ │ │ │ │ ├── sys.h │ │ │ │ │ ├── tcp.h │ │ │ │ │ ├── tcp_impl.h │ │ │ │ │ ├── tcpip.h │ │ │ │ │ ├── timers.h │ │ │ │ │ └── udp.h │ │ │ │ ├── netif │ │ │ │ │ ├── etharp.h │ │ │ │ │ ├── ppp_oe.h │ │ │ │ │ └── slipif.h │ │ │ │ └── posix │ │ │ │ │ ├── netdb.h │ │ │ │ │ └── sys │ │ │ │ │ └── socket.h │ │ │ └── netif │ │ │ │ ├── FILES │ │ │ │ ├── etharp.c │ │ │ │ ├── ethernetif.c │ │ │ │ ├── ppp │ │ │ │ ├── auth.c │ │ │ │ ├── auth.h │ │ │ │ ├── chap.c │ │ │ │ ├── chap.h │ │ │ │ ├── chpms.c │ │ │ │ ├── chpms.h │ │ │ │ ├── fsm.c │ │ │ │ ├── fsm.h │ │ │ │ ├── ipcp.c │ │ │ │ ├── ipcp.h │ │ │ │ ├── lcp.c │ │ │ │ ├── lcp.h │ │ │ │ ├── magic.c │ │ │ │ ├── magic.h │ │ │ │ ├── md5.c │ │ │ │ ├── md5.h │ │ │ │ ├── pap.c │ │ │ │ ├── pap.h │ │ │ │ ├── ppp.c │ │ │ │ ├── ppp.h │ │ │ │ ├── ppp_impl.h │ │ │ │ ├── ppp_oe.c │ │ │ │ ├── pppdebug.h │ │ │ │ ├── randm.c │ │ │ │ ├── randm.h │ │ │ │ ├── vj.c │ │ │ │ └── vj.h │ │ │ │ └── slipif.c │ │ ├── stm32f4x7_eth.c │ │ ├── stm32f4x7_eth.h │ │ ├── stm32f4x7_eth_bsp.c │ │ ├── stm32f4x7_eth_bsp.h │ │ ├── stm32f4x7_eth_conf.h │ │ ├── tcp_echoclient.c │ │ ├── tcp_echoclient.h │ │ ├── test │ │ │ └── unit │ │ │ │ ├── core │ │ │ │ ├── test_mem.c │ │ │ │ └── test_mem.h │ │ │ │ ├── etharp │ │ │ │ ├── test_etharp.c │ │ │ │ └── test_etharp.h │ │ │ │ ├── lwip_check.h │ │ │ │ ├── lwip_unittests.c │ │ │ │ ├── lwipopts.h │ │ │ │ ├── tcp │ │ │ │ ├── tcp_helper.c │ │ │ │ ├── tcp_helper.h │ │ │ │ ├── test_tcp.c │ │ │ │ ├── test_tcp.h │ │ │ │ ├── test_tcp_oos.c │ │ │ │ └── test_tcp_oos.h │ │ │ │ └── udp │ │ │ │ ├── test_udp.c │ │ │ │ └── test_udp.h │ │ └── www │ │ │ ├── 404.html │ │ │ ├── favicon.ico │ │ │ ├── image.png │ │ │ ├── index.shtml │ │ │ ├── index.shtml.html │ │ │ ├── post.shtml │ │ │ ├── post.shtml.html │ │ │ ├── style.css │ │ │ ├── subpage.shtml │ │ │ └── subpage.shtml.html │ ├── stm32fxxx_hal.h │ ├── tm_stm32_adc.c │ ├── tm_stm32_adc.h │ ├── tm_stm32_ahrs_imu.c │ ├── tm_stm32_ahrs_imu.h │ ├── tm_stm32_am2301.c │ ├── tm_stm32_am2301.h │ ├── tm_stm32_bmp180.c │ ├── tm_stm32_bmp180.h │ ├── tm_stm32_bor.c │ ├── tm_stm32_bor.h │ ├── tm_stm32_buffer.c │ ├── tm_stm32_buffer.h │ ├── tm_stm32_button.c │ ├── tm_stm32_button.h │ ├── tm_stm32_cpu_load.c │ ├── tm_stm32_cpu_load.h │ ├── tm_stm32_crc.c │ ├── tm_stm32_crc.h │ ├── tm_stm32_dac.c │ ├── tm_stm32_dac.h │ ├── tm_stm32_delay.c │ ├── tm_stm32_delay.h │ ├── tm_stm32_disco.c │ ├── tm_stm32_disco.h │ ├── tm_stm32_dma.c │ ├── tm_stm32_dma.h │ ├── tm_stm32_dma2d_graphic.c │ ├── tm_stm32_dma2d_graphic.h │ ├── tm_stm32_ds18b20.c │ ├── tm_stm32_ds18b20.h │ ├── tm_stm32_exti.c │ ├── tm_stm32_exti.h │ ├── tm_stm32_fatfs.c │ ├── tm_stm32_fatfs.h │ ├── tm_stm32_fft.c │ ├── tm_stm32_fft.h │ ├── tm_stm32_filters.c │ ├── tm_stm32_filters.h │ ├── tm_stm32_fonts.c │ ├── tm_stm32_fonts.h │ ├── tm_stm32_general.c │ ├── tm_stm32_general.h │ ├── tm_stm32_gpio.c │ ├── tm_stm32_gpio.h │ ├── tm_stm32_gps.c │ ├── tm_stm32_gps.h │ ├── tm_stm32_hd44780.c │ ├── tm_stm32_hd44780.h │ ├── tm_stm32_i2c.c │ ├── tm_stm32_i2c.h │ ├── tm_stm32_i2c_dma.c │ ├── tm_stm32_i2c_dma.h │ ├── tm_stm32_id.c │ ├── tm_stm32_id.h │ ├── tm_stm32_iwdg.c │ ├── tm_stm32_iwdg.h │ ├── tm_stm32_lcd.c │ ├── tm_stm32_lcd.h │ ├── tm_stm32_library_template.c │ ├── tm_stm32_library_template.h │ ├── tm_stm32_lis302dl_lis3dsh.c │ ├── tm_stm32_lis302dl_lis3dsh.h │ ├── tm_stm32_mpu6050.c │ ├── tm_stm32_mpu6050.h │ ├── tm_stm32_mpu9250.c │ ├── tm_stm32_mpu9250.h │ ├── tm_stm32_nrf24l01.c │ ├── tm_stm32_nrf24l01.h │ ├── tm_stm32_onewire.c │ ├── tm_stm32_onewire.h │ ├── tm_stm32_pvd.c │ ├── tm_stm32_pvd.h │ ├── tm_stm32_qspiflash.c │ ├── tm_stm32_qspiflash.h │ ├── tm_stm32_rcc.c │ ├── tm_stm32_rcc.h │ ├── tm_stm32_rng.c │ ├── tm_stm32_rng.h │ ├── tm_stm32_rotary_encoder.c │ ├── tm_stm32_rotary_encoder.h │ ├── tm_stm32_rtc.c │ ├── tm_stm32_rtc.h │ ├── tm_stm32_sdram.c │ ├── tm_stm32_sdram.h │ ├── tm_stm32_spi.c │ ├── tm_stm32_spi.h │ ├── tm_stm32_spi_dma.c │ ├── tm_stm32_spi_dma.h │ ├── tm_stm32_ssd1306.c │ ├── tm_stm32_ssd1306.h │ ├── tm_stm32_string.c │ ├── tm_stm32_string.h │ ├── tm_stm32_touch.c │ ├── tm_stm32_touch.h │ ├── tm_stm32_touch_ft5336.c │ ├── tm_stm32_touch_ft5336.h │ ├── tm_stm32_touch_ts3510.c │ ├── tm_stm32_touch_ts3510.h │ ├── tm_stm32_usart.c │ ├── tm_stm32_usart.h │ ├── tm_stm32_usart_dma.c │ ├── tm_stm32_usart_dma.h │ ├── tm_stm32_usb.c │ ├── tm_stm32_usb.h │ ├── tm_stm32_usb_device.c │ ├── tm_stm32_usb_device.h │ ├── tm_stm32_usb_device_cdc.c │ ├── tm_stm32_usb_device_cdc.h │ ├── tm_stm32_usb_device_msc.c │ ├── tm_stm32_usb_device_msc.h │ ├── tm_stm32_usb_host.c │ ├── tm_stm32_usb_host.h │ ├── tm_stm32_usb_host_hid.c │ ├── tm_stm32_usb_host_hid.h │ ├── tm_stm32_usb_host_msc.c │ └── tm_stm32_usb_host_msc.h │ ├── stm32f4xx_hal_conf.h │ ├── stm32f4xx_hal_msp.c │ ├── stm32f4xx_it.c │ ├── stm32f4xx_it.h │ ├── stm32fxxx_hal.h │ └── system_stm32f4xx.c └── test-disks └── OS_755_500MB.zip /Fritzing/Fritzing Layout.fzz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pgodwin/LC-SCSI/932dee4ad179bbc891c01385586574af78597bf7/Fritzing/Fritzing Layout.fzz -------------------------------------------------------------------------------- /Fritzing/Fritzing Layout_bb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pgodwin/LC-SCSI/932dee4ad179bbc891c01385586574af78597bf7/Fritzing/Fritzing Layout_bb.png -------------------------------------------------------------------------------- /Fritzing/Readme.md: -------------------------------------------------------------------------------- 1 | # Fritzing Breadboard Layout 2 | 3 | Quick layout in Fritzing so I could plan out how I was going to hook things up... 4 | 5 | ![Breadboard](https://raw.githubusercontent.com/pgodwin/LC-SCSI/master/Fritzing/Fritzing%20Layout_bb.png) 6 | 7 | ## Fritzing Notes 8 | I've decided Fritzing isn't for me. It's slow, buggy, and lacks simple features. 9 | 10 | If these features exist I can't find them: 11 | * naming a net/bus. 12 | * you can name wires, but they don't show up in between breadboard and schematic mode 13 | * swapping parts 14 | * dragging to a breadboard - if I drag from a component to the breadboard it won't attach to the breadboard. Dragging from the breadboard to the component does work. 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # LC-SCSI 2 | Low-cost SCSI emulator project based around the STM32. 3 | 4 | ### Status: Planning - check the wiki 5 | 6 | ## Aims: 7 | * Emulate SCSI HDD Target, SCSI 1 8 | * SD Card for storage 9 | * Low Cost, target BOM <$10USD 10 | * STM32/GD32 as the target controller 11 | * simple code with lots of documentation 12 | * allow me to replace SCSI HDDs in my legacy Macs with SD cards 13 | 14 | ## What it's **not**: 15 | * complete SCSI solution 16 | * super-fast 17 | * feature rich 18 | 19 | 20 | ## Development Target 21 | Using the NUCLEO-F401RE board, based around the STM32F401RE. 22 | This will be fine for development, but is an expensive micro. 23 | The STM32F401RCT6 is almost as capable and quite a bit cheaper (~$1.80 USD). 24 | 25 | ## Other projects 26 | If you need a solution today there are a couple of great options: 27 | 28 | * SCSI2SD - http://www.codesrc.com/mediawiki/index.php/SCSI2SD 29 | 30 | Feature filled, high-speed and readily available. 31 | 32 | * RaSCSI - http://www.geocities.jp/kugimoto0715/rascsi/ 33 | 34 | Original built for X68000 machines, this one is based on the Raspberry PI as the host. 35 | Looks like it supports Target and Initiator modes. 36 | 37 | 38 | -------------------------------------------------------------------------------- /src/LC-SCSI.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 15 4 | VisualStudioVersion = 15.0.27428.2015 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "LCSCSI-STM32", "LCSCSI-STM32\LCSCSI-STM32.vcxproj", "{601A04C3-1445-4040-BA83-C55F39B2BF8B}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|VisualGDB = Debug|VisualGDB 11 | Release|VisualGDB = Release|VisualGDB 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {601A04C3-1445-4040-BA83-C55F39B2BF8B}.Debug|VisualGDB.ActiveCfg = Debug|VisualGDB 15 | {601A04C3-1445-4040-BA83-C55F39B2BF8B}.Debug|VisualGDB.Build.0 = Debug|VisualGDB 16 | {601A04C3-1445-4040-BA83-C55F39B2BF8B}.Release|VisualGDB.ActiveCfg = Release|VisualGDB 17 | {601A04C3-1445-4040-BA83-C55F39B2BF8B}.Release|VisualGDB.Build.0 = Release|VisualGDB 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {746F8944-5321-43A7-9999-688673067E99} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /src/LCSCSI-STM32/STM32HAL_printf_uart.c: -------------------------------------------------------------------------------- 1 | /* USER CODE BEGIN Includes */ 2 | #include 3 | #include 4 | 5 | 6 | 7 | /* USER CODE BEGIN 0 */ 8 | 9 | /* PRINTF REDIRECT to UART BEGIN */ 10 | // @see http://www.keil.com/forum/60531/ 11 | // @see https://stackoverflow.com/questions/45535126/stm32-printf-redirect 12 | 13 | struct __FILE { 14 | int handle; 15 | /* Whatever you require here. If the only file you are using is */ 16 | /* standard output using printf() for debugging, no file handling */ 17 | /* is required. */ 18 | } 19 | ; 20 | 21 | FILE __stdout; 22 | 23 | int fputc(int ch, FILE *f) { 24 | HAL_UART_Transmit(&uart1, (uint8_t *)&ch, 1, 0xFFFF); 25 | return ch; 26 | } 27 | 28 | int ferror(FILE *f) { 29 | /* Your implementation of ferror(). */ 30 | return 0; 31 | } 32 | /* PRINTF REDIRECT to UART END */ 33 | 34 | /* USER CODE END 0 */ -------------------------------------------------------------------------------- /src/LCSCSI-STM32/VisualGDB/VisualGDBCache/EmbeddedProject3-Debug/MemoryUtilizationReport.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | FLASH 6 | 62936 7 | 524288 8 | 9 | 10 | SRAM 11 | 66676 12 | 98304 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/LCSCSI-STM32/debug.h: -------------------------------------------------------------------------------- 1 | 2 | #define PSTR(str) (str) 3 | 4 | // External globals 5 | extern volatile bool debugFlag_filesystem; 6 | extern volatile bool debugFlag_scsiCommands; 7 | extern volatile bool debugFlag_scsiBlocks; 8 | extern volatile bool debugFlag_scsiFcodes; 9 | extern volatile bool debugFlag_scsiState; 10 | extern volatile bool debugFlag_fatfs; 11 | 12 | // Function prototypes 13 | void debugString(char *string); 14 | void debugString_P(char *string); 15 | 16 | void debugStringInt8Hex_P(const char *addr, uint8_t integerValue, bool newLine); 17 | void debugStringInt16_P(const char *addr, uint16_t integerValue, bool newLine); 18 | void debugStringInt32_P(const char *addr, uint32_t integerValue, bool newLine); 19 | 20 | void debugSectorBufferHex(uint8_t *buffer, uint16_t numberOfBytes); 21 | void debugLunDescriptor(uint8_t *buffer); 22 | 23 | void u_printf(const char *fmt, ...); -------------------------------------------------------------------------------- /src/LCSCSI-STM32/defines.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Defines for your entire project at one place 3 | * 4 | * @author Tilen Majerle 5 | * @email tilen@majerle.eu 6 | * @website http://stm32f4-discovery.net 7 | * @version v1.0 8 | * @ide Keil uVision 5 9 | * @license GNU GPL v3 10 | * 11 | * |---------------------------------------------------------------------- 12 | * | Copyright (C) Tilen Majerle, 2015 13 | * | 14 | * | This program is free software: you can redistribute it and/or modify 15 | * | it under the terms of the GNU General Public License as published by 16 | * | the Free Software Foundation, either version 3 of the License, or 17 | * | any later version. 18 | * | 19 | * | This program is distributed in the hope that it will be useful, 20 | * | but WITHOUT ANY WARRANTY; without even the implied warranty of 21 | * | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 22 | * | GNU General Public License for more details. 23 | * | 24 | * | You should have received a copy of the GNU General Public License 25 | * | along with this program. If not, see . 26 | * |---------------------------------------------------------------------- 27 | */ 28 | #ifndef TM_DEFINES_H 29 | #define TM_DEFINES_H 30 | 31 | /* Put your global defines for all libraries here used in your project */ 32 | #define STM32F4xx 33 | #define NUCLEO_F401 34 | 35 | 36 | /* Defines for RCC settings for system */ 37 | /* I've added these defines in options for target in Keil uVision for each target different settings */ 38 | //#define RCC_OSCILLATORTYPE RCC_OSCILLATORTYPE_HSE /*!< Used to select system oscillator type */ 39 | //#define RCC_PLLM 8 /*!< Used for PLL M parameter */ 40 | //#define RCC_PLLN 360 /*!< Used for PLL N parameter */ 41 | //#define RCC_PLLP 2 /*!< Used for PLL P parameter */ 42 | //#define RCC_PLLQ 7 /*!< Used for PLL Q parameter */ 43 | //#define RCC_PLLR 10 /*!< Used for PLL R parameter, available on STM32F446xx */ 44 | //Disable EXTI0_IRQHandler function 45 | //#define EXTI_DISABLE_DEFAULT_HANDLER_0 46 | //Disable EXTI1_IRQHandler function 47 | //#define EXTI_DISABLE_DEFAULT_HANDLER_1 48 | 49 | /* Activate SDIO 4-bit mode */ 50 | //#define FATFS_SDIO_4BIT 1 51 | #define FATFS_SDIO_4BIT 0 52 | 53 | #endif -------------------------------------------------------------------------------- /src/LCSCSI-STM32/filesystem.h: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #define SECTOR_SIZE 512 4 | 5 | // Read/Write sector buffer (must be 256 bytes minimum) 6 | // Testing shows that this is optimal when it matches the sector size of 7 | // the SD card (which is 512 bytes). 8 | 9 | #define SECTOR_BUFFER_SIZE SECTOR_SIZE 10 | 11 | 12 | // Calculate the length of the sector buffer in 256 byte sectors 13 | #define SECTOR_BUFFER_LENGTH (SECTOR_BUFFER_SIZE / SECTOR_SIZE) 14 | 15 | // External prototypes 16 | void filesystemInitialise(void); 17 | void filesystemReset(void); 18 | 19 | bool filesystemMount(void); 20 | bool filesystemDismount(void); 21 | 22 | void filesystemSetLunDirectory(uint8_t lunDirectoryNumber); 23 | uint8_t filesystemGetLunDirectory(void); 24 | 25 | bool filesystemSetLunStatus(uint8_t lunNumber, bool lunStatus); 26 | bool filesystemReadLunStatus(uint8_t lunNumber); 27 | bool filesystemTestLunStatus(uint8_t lunNumber); 28 | void filesystemReadLunUserCode(uint8_t lunNumber, uint8_t userCode[5]); 29 | 30 | bool filesystemCheckLunDirectory(uint8_t lunDirectory); 31 | bool filesystemCheckLunImage(uint8_t lunNumber); 32 | 33 | uint32_t filesystemGetLunSizeFromDsc(uint8_t lunDirectory, uint8_t lunNumber); 34 | bool filesystemCreateDscFromLunImage(uint8_t lunDirectory, uint8_t lunNumber, uint32_t lunFileSize); 35 | 36 | void filesystemGetUserCodeFromUcd(uint8_t lunDirectoryNumber, uint8_t lunNumber); 37 | 38 | bool filesystemCreateLunImage(uint8_t lunNumber); 39 | bool filesystemCreateLunDescriptor(uint8_t lunNumber); 40 | bool filesystemReadLunDescriptor(uint8_t lunNumber, uint8_t buffer[]); 41 | bool filesystemWriteLunDescriptor(uint8_t lunNumber, uint8_t buffer[]); 42 | bool filesystemFormatLun(uint8_t lunNumber, uint8_t dataPattern); 43 | 44 | bool filesystemOpenLunForRead(uint8_t lunNumber, uint32_t startSector, uint32_t requiredNumberOfSectors); 45 | bool filesystemReadNextSector(uint8_t buffer[]); 46 | bool filesystemCloseLunForRead(void); 47 | bool filesystemOpenLunForWrite(uint8_t lunNumber, uint32_t startSector, uint32_t requiredNumberOfSectors); 48 | bool filesystemWriteNextSector(uint8_t buffer[]); 49 | bool filesystemCloseLunForWrite(void); 50 | 51 | bool filesystemSetFatDirectory(uint8_t *buffer); 52 | bool filesystemGetFatFileInfo(uint32_t fileNumber, uint8_t *buffer); 53 | bool filesystemOpenFatForRead(uint32_t fileNumber, uint32_t blockNumber); 54 | bool filesystemReadNextFatBlock(uint8_t *buffer); 55 | bool filesystemCloseFatForRead(void); 56 | -------------------------------------------------------------------------------- /src/LCSCSI-STM32/scsi.h: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | // SCSI emulation bus states 4 | #define SCSI_BUSFREE 0 5 | #define SCSI_COMMAND 1 6 | #define SCSI_STATUS 2 7 | #define SCSI_MESSAGE 3 8 | 9 | // Extras 10 | #define SCSI_BUSBUSY 4 11 | 12 | 13 | 14 | // SCSI emulation command states (Group 0 commands) 15 | #define SCSI_TESTUNITREADY 10 16 | #define SCSI_REZEROUNIT 11 17 | #define SCSI_REQUESTSENSE 12 18 | #define SCSI_FORMAT 13 19 | #define SCSI_READ6 14 20 | #define SCSI_WRITE6 15 21 | #define SCSI_SEEK 16 22 | #define SCSI_TRANSLATE 17 23 | #define SCSI_MODESELECT 18 24 | #define SCSI_MODESENSE 19 25 | #define SCSI_STARTSTOP 20 26 | #define SCSI_VERIFY 21 27 | #define SCSI_INQUIRY 22 28 | #define SCSI_SELECT 23 29 | 30 | // SCSI Information transfer phases 31 | #define ITPHASE_DATAOUT 0 32 | #define ITPHASE_DATAIN 1 33 | #define ITPHASE_COMMAND 2 34 | #define ITPHASE_STATUS 3 35 | #define ITPHASE_MESSAGEOUT 4 36 | #define ITPHASE_MESSAGEIN 5 37 | 38 | void scsiInitialise(void); 39 | void scsiReset(void); 40 | 41 | 42 | // Emulation mode (fixed / LV-DOS) 43 | #define FIXED_EMULATION 0 44 | #define LVDOS_EMULATION 1 45 | 46 | 47 | void scsiProcessEmulation(void); 48 | void scsiInformationTransferPhase(uint8_t transferPhase); 49 | 50 | uint8_t scsiEmulationBusFree(void); 51 | uint8_t scsiEmulationCommand(void); 52 | uint8_t scsiEmulationStatus(void); 53 | uint8_t scsiEmulationMessage(void); 54 | 55 | uint8_t scsiCommandTestUnitReady(void); 56 | uint8_t scsiCommandRezeroUnit(void); 57 | uint8_t scsiCommandRequestSense(void); 58 | uint8_t scsiCommandFormat(void); 59 | uint8_t scsiCommandRead6(void); 60 | uint8_t scsiCommandWrite6(void); 61 | uint8_t scsiCommandSeek(void); 62 | uint8_t scsiCommandTranslate(void); 63 | uint8_t scsiCommandModeSelect(void); 64 | uint8_t scsiCommandModeSense(void); 65 | uint8_t scsiCommandStartStop(void); 66 | uint8_t scsiCommandVerify(void); 67 | 68 | uint8_t scsiCommandInquiry(void); 69 | uint8_t scsiCommandSelect(void); 70 | 71 | 72 | uint8_t scsiWriteFCode(void); 73 | uint8_t scsiReadFCode(void); 74 | 75 | uint8_t scsiBeebScsiSense(void); 76 | uint8_t scsiBeebScsiSelect(void); 77 | 78 | uint8_t scsiBeebScsiFatPath(void); 79 | uint8_t scsiBeebScsiFatInfo(void); 80 | uint8_t scsiBeebScsiFatRead(void); -------------------------------------------------------------------------------- /src/LCSCSI-STM32/stm32.props: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 11 | 12 | ARM_MATH_CM4;sram_layout;STM32F401RE;STM32F401xE;VECT_TAB_SRAM;%(ClCompile.PreprocessorDefinitions) 13 | $(ProjectDir);$(BSP_ROOT)/STM32F4xxxx/STM32F4xx_HAL_Driver/Inc;$(BSP_ROOT)/STM32F4xxxx/STM32F4xx_HAL_Driver/Inc/Legacy;$(BSP_ROOT)/STM32F4xxxx/CMSIS_HAL/Device/ST/STM32F4xx/Include;$(BSP_ROOT)/STM32F4xxxx/CMSIS_HAL/Include;%(ClCompile.AdditionalIncludeDirectories) 14 | 15 | 16 | 17 | 18 | $(BSP_ROOT)/STM32F4xxxx/LinkerScripts/STM32F401RE_sram.lds 19 | --specs=nano.specs --specs=nosys.specs %(Link.AdditionalOptions) 20 | 21 | 22 | 23 | $(BSP_ROOT)/STM32F4xxxx/LinkerScripts/STM32F401RE_sram.lds 24 | 25 | 26 | 27 | 28 | cortex-m4 29 | THUMB 30 | fpv4-sp-d16 31 | soft 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /src/LCSCSI-STM32/stm32.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | com.visualgdb.arm-eabi 4 | 5 | 7.2.0 6 | 8.0.1 7 | 3 8 | 9 | com.sysprogs.arm.stm32 10 | 2018.08 11 | STM32F401RE 12 | STM32F4xxxx/DeviceDefinitions/stm32f401xe.xml 13 | 14 | 15 | 16 | com.sysprogs.bspoptions.primary_memory 17 | sram 18 | 19 | 20 | com.sysprogs.bspoptions.arm.floatmode 21 | -mfloat-abi=soft 22 | 23 | 24 | com.sysprogs.mcuoptions.ignore_startup_file 25 | 26 | 27 | 28 | com.sysprogs.toolchainoptions.arm.libctype 29 | --specs=nano.specs 30 | 31 | 32 | com.sysprogs.toolchainoptions.arm.libnosys 33 | --specs=nosys.specs 34 | 35 | 36 | 37 | Device-specific files 38 | stm32.mak 39 | 40 | com.sysprogs.arm.stm32.hal 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /src/LCSCSI-STM32/stm32/FreeRTOS/include/stdint.readme: -------------------------------------------------------------------------------- 1 | 2 | #ifndef FREERTOS_STDINT 3 | #define FREERTOS_STDINT 4 | 5 | /******************************************************************************* 6 | * THIS IS NOT A FULL stdint.h IMPLEMENTATION - It only contains the definitions 7 | * necessary to build the FreeRTOS code. It is provided to allow FreeRTOS to be 8 | * built using compilers that do not provide their own stdint.h definition. 9 | * 10 | * To use this file: 11 | * 12 | * 1) Copy this file into the directory that contains your FreeRTOSConfig.h 13 | * header file, as that directory will already be in the compilers include 14 | * path. 15 | * 16 | * 2) Rename the copied file stdint.h. 17 | * 18 | */ 19 | 20 | typedef signed char int8_t; 21 | typedef unsigned char uint8_t; 22 | typedef short int16_t; 23 | typedef unsigned short uint16_t; 24 | typedef long int32_t; 25 | typedef unsigned long uint32_t; 26 | 27 | #endif /* FREERTOS_STDINT */ 28 | -------------------------------------------------------------------------------- /src/LCSCSI-STM32/stm32/FreeRTOS/portable/GCC/ARM_CM7/ReadMe.txt: -------------------------------------------------------------------------------- 1 | There are two options for running FreeRTOS on ARM Cortex-M7 microcontrollers. 2 | The best option depends on the revision of the ARM Cortex-M7 core in use. The 3 | revision is specified by an 'r' number, and a 'p' number, so will look something 4 | like 'r0p1'. Check the documentation for the microcontroller in use to find the 5 | revision of the Cortex-M7 core used in that microcontroller. If in doubt, use 6 | the FreeRTOS port provided specifically for r0p1 revisions, as that can be used 7 | with all core revisions. 8 | 9 | The first option is to use the ARM Cortex-M4F port, and the second option is to 10 | use the Cortex-M7 r0p1 port - the latter containing a minor errata workaround. 11 | 12 | If the revision of the ARM Cortex-M7 core is not r0p1 then either option can be 13 | used, but it is recommended to use the FreeRTOS ARM Cortex-M4F port located in 14 | the /FreeRTOS/Source/portable/GCC/ARM_CM4F directory. 15 | 16 | If the revision of the ARM Cortex-M7 core is r0p1 then use the FreeRTOS ARM 17 | Cortex-M7 r0p1 port located in the /FreeRTOS/Source/portable/GCC/ARM_CM7/r0p1 18 | directory. -------------------------------------------------------------------------------- /src/LCSCSI-STM32/stm32/FreeRTOS/portable/IAR/ARM_CM7/ReadMe.txt: -------------------------------------------------------------------------------- 1 | There are two options for running FreeRTOS on ARM Cortex-M7 microcontrollers. 2 | The best option depends on the revision of the ARM Cortex-M7 core in use. The 3 | revision is specified by an 'r' number, and a 'p' number, so will look something 4 | like 'r0p1'. Check the documentation for the microcontroller in use to find the 5 | revision of the Cortex-M7 core used in that microcontroller. If in doubt, use 6 | the FreeRTOS port provided specifically for r0p1 revisions, as that can be used 7 | with all core revisions. 8 | 9 | The first option is to use the ARM Cortex-M4F port, and the second option is to 10 | use the Cortex-M7 r0p1 port - the latter containing a minor errata workaround. 11 | 12 | If the revision of the ARM Cortex-M7 core is not r0p1 then either option can be 13 | used, but it is recommended to use the FreeRTOS ARM Cortex-M4F port located in 14 | the /FreeRTOS/Source/portable/IAR/ARM_CM4F directory. 15 | 16 | If the revision of the ARM Cortex-M7 core is r0p1 then use the FreeRTOS ARM 17 | Cortex-M7 r0p1 port located in the /FreeRTOS/Source/portable/IAR/ARM_CM7/r0p1 18 | directory. -------------------------------------------------------------------------------- /src/LCSCSI-STM32/stm32/FreeRTOS/portable/Keil/See-also-the-RVDS-directory.txt: -------------------------------------------------------------------------------- 1 | Nothing to see here. -------------------------------------------------------------------------------- /src/LCSCSI-STM32/stm32/FreeRTOS/portable/readme.txt: -------------------------------------------------------------------------------- 1 | Each real time kernel port consists of three files that contain the core kernel 2 | components and are common to every port, and one or more files that are 3 | specific to a particular microcontroller and/or compiler. 4 | 5 | 6 | + The FreeRTOS/Source/Portable/MemMang directory contains the three sample 7 | memory allocators as described on the http://www.FreeRTOS.org WEB site. 8 | 9 | + The other directories each contain files specific to a particular 10 | microcontroller or compiler. 11 | 12 | 13 | 14 | For example, if you are interested in the GCC port for the ATMega323 15 | microcontroller then the port specific files are contained in 16 | FreeRTOS/Source/Portable/GCC/ATMega323 directory. If this is the only 17 | port you are interested in then all the other directories can be 18 | ignored. 19 | 20 | -------------------------------------------------------------------------------- /src/LCSCSI-STM32/stm32/PT/lc-addrlabels.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2004-2005, 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 Contiki operating system. 30 | * 31 | * Author: Adam Dunkels 32 | * 33 | * $Id: lc-addrlabels.h,v 1.4 2006/06/03 11:29:43 adam Exp $ 34 | */ 35 | 36 | /** 37 | * \addtogroup lc 38 | * @{ 39 | */ 40 | 41 | /** 42 | * \file 43 | * Implementation of local continuations based on the "Labels as 44 | * values" feature of gcc 45 | * \author 46 | * Adam Dunkels 47 | * 48 | * This implementation of local continuations is based on a special 49 | * feature of the GCC C compiler called "labels as values". This 50 | * feature allows assigning pointers with the address of the code 51 | * corresponding to a particular C label. 52 | * 53 | * For more information, see the GCC documentation: 54 | * http://gcc.gnu.org/onlinedocs/gcc/Labels-as-Values.html 55 | * 56 | */ 57 | 58 | #ifndef __LC_ADDRLABELS_H__ 59 | #define __LC_ADDRLABELS_H__ 60 | 61 | /** \hideinitializer */ 62 | typedef void * lc_t; 63 | 64 | #define LC_INIT(s) s = NULL 65 | 66 | #define LC_RESUME(s) \ 67 | do { \ 68 | if(s != NULL) { \ 69 | goto *s; \ 70 | } \ 71 | } while(0) 72 | 73 | #define LC_CONCAT2(s1, s2) s1##s2 74 | #define LC_CONCAT(s1, s2) LC_CONCAT2(s1, s2) 75 | 76 | #define LC_SET(s) \ 77 | do { \ 78 | LC_CONCAT(LC_LABEL, __LINE__): \ 79 | (s) = &&LC_CONCAT(LC_LABEL, __LINE__); \ 80 | } while(0) 81 | 82 | #define LC_END(s) 83 | 84 | #endif /* __LC_ADDRLABELS_H__ */ 85 | /** @} */ 86 | -------------------------------------------------------------------------------- /src/LCSCSI-STM32/stm32/PT/lc-switch.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2004-2005, 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 Contiki operating system. 30 | * 31 | * Author: Adam Dunkels 32 | * 33 | * $Id: lc-switch.h,v 1.4 2006/06/03 11:29:43 adam Exp $ 34 | */ 35 | 36 | /** 37 | * \addtogroup lc 38 | * @{ 39 | */ 40 | 41 | /** 42 | * \file 43 | * Implementation of local continuations based on switch() statment 44 | * \author Adam Dunkels 45 | * 46 | * This implementation of local continuations uses the C switch() 47 | * statement to resume execution of a function somewhere inside the 48 | * function's body. The implementation is based on the fact that 49 | * switch() statements are able to jump directly into the bodies of 50 | * control structures such as if() or while() statmenets. 51 | * 52 | * This implementation borrows heavily from Simon Tatham's coroutines 53 | * implementation in C: 54 | * http://www.chiark.greenend.org.uk/~sgtatham/coroutines.html 55 | */ 56 | 57 | #ifndef __LC_SWITCH_H__ 58 | #define __LC_SWITCH_H__ 59 | 60 | /* WARNING! lc implementation using switch() does not work if an 61 | LC_SET() is done within another switch() statement! */ 62 | 63 | /** \hideinitializer */ 64 | typedef unsigned short lc_t; 65 | 66 | #define LC_INIT(s) s = 0; 67 | 68 | #define LC_RESUME(s) switch(s) { case 0: 69 | 70 | #define LC_SET(s) s = __LINE__; case __LINE__: 71 | 72 | #define LC_END(s) } 73 | 74 | #endif /* __LC_SWITCH_H__ */ 75 | 76 | /** @} */ 77 | -------------------------------------------------------------------------------- /src/LCSCSI-STM32/stm32/USB_Device/Class/AUDIO/Inc/usbd_audio_if_template.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file usbd_audio_if_template.h 4 | * @author MCD Application Team 5 | * @version V2.4.1 6 | * @date 19-June-2015 7 | * @brief Header for usbd_audio_if_template.c file. 8 | ****************************************************************************** 9 | * @attention 10 | * 11 | *

© COPYRIGHT 2015 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 | /* Define to prevent recursive inclusion -------------------------------------*/ 29 | #ifndef __USBD_AUDIO_IF_TEMPLATE_H 30 | #define __USBD_AUDIO_IF_TEMPLATE_H 31 | 32 | #ifdef __cplusplus 33 | extern "C" { 34 | #endif 35 | 36 | /* Includes ------------------------------------------------------------------*/ 37 | #include "usbd_audio.h" 38 | 39 | /* Exported types ------------------------------------------------------------*/ 40 | /* Exported constants --------------------------------------------------------*/ 41 | 42 | extern USBD_AUDIO_ItfTypeDef USBD_AUDIO_Template_fops; 43 | 44 | /* Exported macro ------------------------------------------------------------*/ 45 | /* Exported functions ------------------------------------------------------- */ 46 | 47 | #ifdef __cplusplus 48 | } 49 | #endif 50 | 51 | #endif /* __USBD_AUDIO_IF_TEMPLATE_H */ 52 | 53 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 54 | -------------------------------------------------------------------------------- /src/LCSCSI-STM32/stm32/USB_Device/Class/CDC/Inc/usbd_cdc_if.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file usbd_cdc_if_template.h 4 | * @author MCD Application Team 5 | * @version V2.4.1 6 | * @date 19-June-2015 7 | * @brief Header for usbd_cdc_if_template.c file. 8 | ****************************************************************************** 9 | * @attention 10 | * 11 | *

© COPYRIGHT 2015 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 | /* Define to prevent recursive inclusion -------------------------------------*/ 29 | #ifndef __USBD_CDC_IF_H 30 | #define __USBD_CDC_IF_H 31 | 32 | #ifdef __cplusplus 33 | extern "C" { 34 | #endif 35 | 36 | /* Includes ------------------------------------------------------------------*/ 37 | #include "usbd_cdc.h" 38 | #include "tm_stm32_usb_device_cdc.h" 39 | 40 | /* Exported types ------------------------------------------------------------*/ 41 | /* Exported constants --------------------------------------------------------*/ 42 | 43 | extern USBD_CDC_ItfTypeDef USBD_CDC_fops[]; 44 | 45 | /* Exported macro ------------------------------------------------------------*/ 46 | /* Exported functions ------------------------------------------------------- */ 47 | 48 | #ifdef __cplusplus 49 | } 50 | #endif 51 | 52 | #endif /* __USBD_CDC_IF_TEMPLATE_H */ 53 | 54 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 55 | -------------------------------------------------------------------------------- /src/LCSCSI-STM32/stm32/USB_Device/Class/CDC/Inc/usbd_cdc_if_template.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file usbd_cdc_if_template.h 4 | * @author MCD Application Team 5 | * @version V2.4.1 6 | * @date 19-June-2015 7 | * @brief Header for usbd_cdc_if_template.c file. 8 | ****************************************************************************** 9 | * @attention 10 | * 11 | *

© COPYRIGHT 2015 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 | /* Define to prevent recursive inclusion -------------------------------------*/ 29 | #ifndef __USBD_CDC_IF_TEMPLATE_H 30 | #define __USBD_CDC_IF_TEMPLATE_H 31 | 32 | #ifdef __cplusplus 33 | extern "C" { 34 | #endif 35 | 36 | /* Includes ------------------------------------------------------------------*/ 37 | #include "usbd_cdc.h" 38 | 39 | /* Exported types ------------------------------------------------------------*/ 40 | /* Exported constants --------------------------------------------------------*/ 41 | 42 | extern USBD_CDC_ItfTypeDef USBD_CDC_Template_fops; 43 | 44 | /* Exported macro ------------------------------------------------------------*/ 45 | /* Exported functions ------------------------------------------------------- */ 46 | 47 | #ifdef __cplusplus 48 | } 49 | #endif 50 | 51 | #endif /* __USBD_CDC_IF_TEMPLATE_H */ 52 | 53 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 54 | -------------------------------------------------------------------------------- /src/LCSCSI-STM32/stm32/USB_Device/Class/CustomHID/Inc/usbd_customhid_if_template.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file usbd_customhid_if_template.h 4 | * @author MCD Application Team 5 | * @version V2.4.1 6 | * @date 19-June-2015 7 | * @brief Header for usbd_customhid_if_template.c file. 8 | ****************************************************************************** 9 | * @attention 10 | * 11 | *

© COPYRIGHT 2015 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 th? 23 | e specific language governing permissions and 24 | * limitations under the License. 25 | * 26 | ****************************************************************************** 27 | */ 28 | 29 | /* Define to prevent recursive inclusion -------------------------------------*/ 30 | #ifndef __USBD_CUSTOMHID_IF_TEMPLATE_H 31 | #define __USBD_CUSTOMHID_IF_TEMPLATE_H 32 | 33 | #ifdef __cplusplus 34 | extern "C" { 35 | #endif 36 | 37 | /* Includes ------------------------------------------------------------------*/ 38 | #include "usbd_customhid.h" 39 | 40 | /* Exported types ------------------------------------------------------------*/ 41 | /* Exported constants --------------------------------------------------------*/ 42 | /* Exported macro ------------------------------------------------------------*/ 43 | /* Exported functions ------------------------------------------------------- */ 44 | extern USBD_CUSTOM_HID_ItfTypeDef USBD_CustomHID_template_fops; 45 | 46 | #ifdef __cplusplus 47 | } 48 | #endif 49 | 50 | #endif /* __USBD_CUSTOMHID_IF_TEMPLATE_H */ 51 | 52 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 53 | -------------------------------------------------------------------------------- /src/LCSCSI-STM32/stm32/USB_Device/Class/DFU/Inc/usbd_dfu_media_template.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file usbd_dfu_media_template.h 4 | * @author MCD Application Team 5 | * @version V2.4.1 6 | * @date 19-June-2015 7 | * @brief header file for the usbd_dfu_media_template.c file 8 | ****************************************************************************** 9 | * @attention 10 | * 11 | *

© COPYRIGHT 2015 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 | /* Define to prevent recursive inclusion -------------------------------------*/ 29 | #ifndef __USBD_DFU_MEDIA_TEMPLATE_H 30 | #define __USBD_DFU_MEDIA_TEMPLATE_H 31 | 32 | #ifdef __cplusplus 33 | extern "C" { 34 | #endif 35 | 36 | /* Includes ------------------------------------------------------------------*/ 37 | #include "usbd_dfu.h" 38 | 39 | /** @addtogroup STM32_USB_DEVICE_LIBRARY 40 | * @{ 41 | */ 42 | 43 | /** @defgroup USBD_MEDIA 44 | * @brief header file for the usbd_dfu_media_template.c file 45 | * @{ 46 | */ 47 | 48 | /** @defgroup USBD_MEDIA_Exported_Defines 49 | * @{ 50 | */ 51 | /** 52 | * @} 53 | */ 54 | 55 | 56 | /** @defgroup USBD_MEDIA_Exported_Types 57 | * @{ 58 | */ 59 | 60 | 61 | /** 62 | * @} 63 | */ 64 | 65 | 66 | 67 | /** @defgroup USBD_MEDIA_Exported_Macros 68 | * @{ 69 | */ 70 | 71 | /** 72 | * @} 73 | */ 74 | 75 | /** @defgroup USBD_MEDIA_Exported_Variables 76 | * @{ 77 | */ 78 | extern USBD_DFU_MediaTypeDef USBD_DFU_MEDIA_Template_fops; 79 | /** 80 | * @} 81 | */ 82 | 83 | /** @defgroup USBD_MEDIA_Exported_FunctionsPrototype 84 | * @{ 85 | */ 86 | 87 | 88 | /** 89 | * @} 90 | */ 91 | 92 | #ifdef __cplusplus 93 | } 94 | #endif 95 | 96 | #endif /* __USBD_DFU_MEDIA_TEMPLATE_H */ 97 | 98 | /** 99 | * @} 100 | */ 101 | 102 | /** 103 | * @} 104 | */ 105 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 106 | -------------------------------------------------------------------------------- /src/LCSCSI-STM32/stm32/USB_Device/Class/MSC/Inc/usbd_msc_data.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file usbd_msc_data.h 4 | * @author MCD Application Team 5 | * @version V2.4.1 6 | * @date 19-June-2015 7 | * @brief Header for the usbd_msc_data.c file 8 | ****************************************************************************** 9 | * @attention 10 | * 11 | *

© COPYRIGHT 2015 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 | /* Define to prevent recursive inclusion -------------------------------------*/ 29 | #ifndef __USBD_MSC_DATA_H 30 | #define __USBD_MSC_DATA_H 31 | 32 | #ifdef __cplusplus 33 | extern "C" { 34 | #endif 35 | 36 | /* Includes ------------------------------------------------------------------*/ 37 | #include "usbd_conf.h" 38 | 39 | /** @addtogroup STM32_USB_DEVICE_LIBRARY 40 | * @{ 41 | */ 42 | 43 | /** @defgroup USB_INFO 44 | * @brief general defines for the usb device library file 45 | * @{ 46 | */ 47 | 48 | /** @defgroup USB_INFO_Exported_Defines 49 | * @{ 50 | */ 51 | #define MODE_SENSE6_LEN 8 52 | #define MODE_SENSE10_LEN 8 53 | #define LENGTH_INQUIRY_PAGE00 7 54 | #define LENGTH_FORMAT_CAPACITIES 20 55 | 56 | /** 57 | * @} 58 | */ 59 | 60 | 61 | /** @defgroup USBD_INFO_Exported_TypesDefinitions 62 | * @{ 63 | */ 64 | /** 65 | * @} 66 | */ 67 | 68 | 69 | 70 | /** @defgroup USBD_INFO_Exported_Macros 71 | * @{ 72 | */ 73 | 74 | /** 75 | * @} 76 | */ 77 | 78 | /** @defgroup USBD_INFO_Exported_Variables 79 | * @{ 80 | */ 81 | extern const uint8_t MSC_Page00_Inquiry_Data[]; 82 | extern const uint8_t MSC_Mode_Sense6_data[]; 83 | extern const uint8_t MSC_Mode_Sense10_data[] ; 84 | 85 | /** 86 | * @} 87 | */ 88 | 89 | /** @defgroup USBD_INFO_Exported_FunctionsPrototype 90 | * @{ 91 | */ 92 | 93 | /** 94 | * @} 95 | */ 96 | 97 | #ifdef __cplusplus 98 | } 99 | #endif 100 | 101 | #endif /* __USBD_MSC_DATA_H */ 102 | 103 | /** 104 | * @} 105 | */ 106 | 107 | /** 108 | * @} 109 | */ 110 | 111 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 112 | -------------------------------------------------------------------------------- /src/LCSCSI-STM32/stm32/USB_Device/Class/MSC/Inc/usbd_msc_storage.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file usbd_msc_storage.h 4 | * @author MCD Application Team 5 | * @version V2.4.1 6 | * @date 19-June-2015 7 | * @brief Header file for the usbd_msc_storage.c file 8 | ****************************************************************************** 9 | * @attention 10 | * 11 | *

© COPYRIGHT 2015 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 | /* Define to prevent recursive inclusion -------------------------------------*/ 29 | #ifndef __USBD_MSC_STORAGE_H 30 | #define __USBD_MSC_STORAGE_H 31 | 32 | #ifdef __cplusplus 33 | extern "C" { 34 | #endif 35 | 36 | /* Includes ------------------------------------------------------------------*/ 37 | #include "usbd_msc.h" 38 | 39 | /** @addtogroup STM32_USB_DEVICE_LIBRARY 40 | * @{ 41 | */ 42 | 43 | /** @defgroup USBD_STORAGE 44 | * @brief header file for the usbd_msc_storage.c file 45 | * @{ 46 | */ 47 | 48 | /** @defgroup USBD_STORAGE_Exported_Defines 49 | * @{ 50 | */ 51 | /** 52 | * @} 53 | */ 54 | 55 | 56 | /** @defgroup USBD_STORAGE_Exported_Types 57 | * @{ 58 | */ 59 | 60 | 61 | /** 62 | * @} 63 | */ 64 | 65 | 66 | 67 | /** @defgroup USBD_STORAGE_Exported_Macros 68 | * @{ 69 | */ 70 | 71 | /** 72 | * @} 73 | */ 74 | 75 | /** @defgroup USBD_STORAGE_Exported_Variables 76 | * @{ 77 | */ 78 | extern USBD_StorageTypeDef USBD_MSC_Template_fops; 79 | /** 80 | * @} 81 | */ 82 | 83 | /** @defgroup USBD_STORAGE_Exported_FunctionsPrototype 84 | * @{ 85 | */ 86 | 87 | 88 | /** 89 | * @} 90 | */ 91 | 92 | #ifdef __cplusplus 93 | } 94 | #endif 95 | 96 | #endif /* __USBD_MSC_STORAGE_H */ 97 | 98 | /** 99 | * @} 100 | */ 101 | 102 | /** 103 | * @} 104 | */ 105 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 106 | -------------------------------------------------------------------------------- /src/LCSCSI-STM32/stm32/USB_Device/Class/MSC/Inc/usbd_msc_storage_template.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file usbd_msc_storage.h 4 | * @author MCD Application Team 5 | * @version V2.4.1 6 | * @date 19-June-2015 7 | * @brief Header file for the usbd_msc_storage.c file 8 | ****************************************************************************** 9 | * @attention 10 | * 11 | *

© COPYRIGHT 2015 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 | /* Define to prevent recursive inclusion -------------------------------------*/ 29 | #ifndef __USBD_MSC_STORAGE_H 30 | #define __USBD_MSC_STORAGE_H 31 | 32 | #ifdef __cplusplus 33 | extern "C" { 34 | #endif 35 | 36 | /* Includes ------------------------------------------------------------------*/ 37 | #include "usbd_msc.h" 38 | 39 | /** @addtogroup STM32_USB_DEVICE_LIBRARY 40 | * @{ 41 | */ 42 | 43 | /** @defgroup USBD_STORAGE 44 | * @brief header file for the usbd_msc_storage.c file 45 | * @{ 46 | */ 47 | 48 | /** @defgroup USBD_STORAGE_Exported_Defines 49 | * @{ 50 | */ 51 | /** 52 | * @} 53 | */ 54 | 55 | 56 | /** @defgroup USBD_STORAGE_Exported_Types 57 | * @{ 58 | */ 59 | 60 | 61 | /** 62 | * @} 63 | */ 64 | 65 | 66 | 67 | /** @defgroup USBD_STORAGE_Exported_Macros 68 | * @{ 69 | */ 70 | 71 | /** 72 | * @} 73 | */ 74 | 75 | /** @defgroup USBD_STORAGE_Exported_Variables 76 | * @{ 77 | */ 78 | extern USBD_StorageTypeDef USBD_MSC_Template_fops; 79 | /** 80 | * @} 81 | */ 82 | 83 | /** @defgroup USBD_STORAGE_Exported_FunctionsPrototype 84 | * @{ 85 | */ 86 | 87 | 88 | /** 89 | * @} 90 | */ 91 | 92 | #ifdef __cplusplus 93 | } 94 | #endif 95 | 96 | #endif /* __USBD_MSC_STORAGE_H */ 97 | 98 | /** 99 | * @} 100 | */ 101 | 102 | /** 103 | * @} 104 | */ 105 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 106 | -------------------------------------------------------------------------------- /src/LCSCSI-STM32/stm32/USB_Device/Class/MSC/Src/usbd_msc_data.c: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file usbd_msc_data.c 4 | * @author MCD Application Team 5 | * @version V2.4.1 6 | * @date 19-June-2015 7 | * @brief This file provides all the vital inquiry pages and sense data. 8 | ****************************************************************************** 9 | * @attention 10 | * 11 | *

© COPYRIGHT 2015 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 | /* Includes ------------------------------------------------------------------*/ 29 | #include "usbd_msc_data.h" 30 | 31 | 32 | /** @addtogroup STM32_USB_DEVICE_LIBRARY 33 | * @{ 34 | */ 35 | 36 | 37 | /** @defgroup MSC_DATA 38 | * @brief Mass storage info/data module 39 | * @{ 40 | */ 41 | 42 | /** @defgroup MSC_DATA_Private_TypesDefinitions 43 | * @{ 44 | */ 45 | /** 46 | * @} 47 | */ 48 | 49 | 50 | /** @defgroup MSC_DATA_Private_Defines 51 | * @{ 52 | */ 53 | /** 54 | * @} 55 | */ 56 | 57 | 58 | /** @defgroup MSC_DATA_Private_Macros 59 | * @{ 60 | */ 61 | /** 62 | * @} 63 | */ 64 | 65 | 66 | /** @defgroup MSC_DATA_Private_Variables 67 | * @{ 68 | */ 69 | 70 | 71 | /* USB Mass storage Page 0 Inquiry Data */ 72 | const uint8_t MSC_Page00_Inquiry_Data[] = {//7 73 | 0x00, 74 | 0x00, 75 | 0x00, 76 | (LENGTH_INQUIRY_PAGE00 - 4), 77 | 0x00, 78 | 0x80, 79 | 0x83 80 | }; 81 | /* USB Mass storage sense 6 Data */ 82 | const uint8_t MSC_Mode_Sense6_data[] = { 83 | 0x00, 84 | 0x00, 85 | 0x00, 86 | 0x00, 87 | 0x00, 88 | 0x00, 89 | 0x00, 90 | 0x00 91 | }; 92 | /* USB Mass storage sense 10 Data */ 93 | const uint8_t MSC_Mode_Sense10_data[] = { 94 | 0x00, 95 | 0x06, 96 | 0x00, 97 | 0x00, 98 | 0x00, 99 | 0x00, 100 | 0x00, 101 | 0x00 102 | }; 103 | /** 104 | * @} 105 | */ 106 | 107 | 108 | /** @defgroup MSC_DATA_Private_FunctionPrototypes 109 | * @{ 110 | */ 111 | /** 112 | * @} 113 | */ 114 | 115 | 116 | /** @defgroup MSC_DATA_Private_Functions 117 | * @{ 118 | */ 119 | 120 | /** 121 | * @} 122 | */ 123 | 124 | 125 | /** 126 | * @} 127 | */ 128 | 129 | 130 | /** 131 | * @} 132 | */ 133 | 134 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 135 | -------------------------------------------------------------------------------- /src/LCSCSI-STM32/stm32/USB_Device/Class/Template/Inc/usbd_template.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file usbd_template_core.h 4 | * @author MCD Application Team 5 | * @version V2.4.1 6 | * @date 19-June-2015 7 | * @brief Header file for the usbd_template_core.c file. 8 | ****************************************************************************** 9 | * @attention 10 | * 11 | *

© COPYRIGHT 2015 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 | /* Define to prevent recursive inclusion -------------------------------------*/ 29 | #ifndef __USB_TEMPLATE_CORE_H 30 | #define __USB_TEMPLATE_CORE_H 31 | 32 | #ifdef __cplusplus 33 | extern "C" { 34 | #endif 35 | 36 | /* Includes ------------------------------------------------------------------*/ 37 | #include "usbd_ioreq.h" 38 | 39 | /** @addtogroup STM32_USB_DEVICE_LIBRARY 40 | * @{ 41 | */ 42 | 43 | /** @defgroup USBD_TEMPLATE 44 | * @brief This file is the header file for usbd_template_core.c 45 | * @{ 46 | */ 47 | 48 | 49 | /** @defgroup USBD_TEMPLATE_Exported_Defines 50 | * @{ 51 | */ 52 | #define TEMPLATE_EPIN_ADDR 0x81 53 | #define TEMPLATE_EPIN_SIZE 0x10 54 | 55 | #define USB_TEMPLATE_CONFIG_DESC_SIZ 64 56 | 57 | /** 58 | * @} 59 | */ 60 | 61 | 62 | /** @defgroup USBD_CORE_Exported_TypesDefinitions 63 | * @{ 64 | */ 65 | 66 | /** 67 | * @} 68 | */ 69 | 70 | 71 | 72 | /** @defgroup USBD_CORE_Exported_Macros 73 | * @{ 74 | */ 75 | 76 | /** 77 | * @} 78 | */ 79 | 80 | /** @defgroup USBD_CORE_Exported_Variables 81 | * @{ 82 | */ 83 | 84 | extern USBD_ClassTypeDef USBD_TEMPLATE_ClassDriver; 85 | /** 86 | * @} 87 | */ 88 | 89 | /** @defgroup USB_CORE_Exported_Functions 90 | * @{ 91 | */ 92 | /** 93 | * @} 94 | */ 95 | 96 | #ifdef __cplusplus 97 | } 98 | #endif 99 | 100 | #endif /* __USB_TEMPLATE_CORE_H */ 101 | /** 102 | * @} 103 | */ 104 | 105 | /** 106 | * @} 107 | */ 108 | 109 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 110 | -------------------------------------------------------------------------------- /src/LCSCSI-STM32/stm32/USB_Device/Core/Inc/usbd_ctlreq.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file usbd_req.h 4 | * @author MCD Application Team 5 | * @version V2.4.1 6 | * @date 19-June-2015 7 | * @brief Header file for the usbd_req.c file 8 | ****************************************************************************** 9 | * @attention 10 | * 11 | *

© COPYRIGHT 2015 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 | /* Define to prevent recursive inclusion -------------------------------------*/ 29 | #ifndef __USB_REQUEST_H 30 | #define __USB_REQUEST_H 31 | 32 | #ifdef __cplusplus 33 | extern "C" { 34 | #endif 35 | 36 | /* Includes ------------------------------------------------------------------*/ 37 | #include "usbd_def.h" 38 | 39 | 40 | /** @addtogroup STM32_USB_DEVICE_LIBRARY 41 | * @{ 42 | */ 43 | 44 | /** @defgroup USBD_REQ 45 | * @brief header file for the usbd_req.c file 46 | * @{ 47 | */ 48 | 49 | /** @defgroup USBD_REQ_Exported_Defines 50 | * @{ 51 | */ 52 | /** 53 | * @} 54 | */ 55 | 56 | 57 | /** @defgroup USBD_REQ_Exported_Types 58 | * @{ 59 | */ 60 | /** 61 | * @} 62 | */ 63 | 64 | 65 | 66 | /** @defgroup USBD_REQ_Exported_Macros 67 | * @{ 68 | */ 69 | /** 70 | * @} 71 | */ 72 | 73 | /** @defgroup USBD_REQ_Exported_Variables 74 | * @{ 75 | */ 76 | /** 77 | * @} 78 | */ 79 | 80 | /** @defgroup USBD_REQ_Exported_FunctionsPrototype 81 | * @{ 82 | */ 83 | 84 | USBD_StatusTypeDef USBD_StdDevReq (USBD_HandleTypeDef *pdev, USBD_SetupReqTypedef *req); 85 | USBD_StatusTypeDef USBD_StdItfReq (USBD_HandleTypeDef *pdev, USBD_SetupReqTypedef *req); 86 | USBD_StatusTypeDef USBD_StdEPReq (USBD_HandleTypeDef *pdev, USBD_SetupReqTypedef *req); 87 | 88 | 89 | void USBD_CtlError (USBD_HandleTypeDef *pdev, USBD_SetupReqTypedef *req); 90 | 91 | void USBD_ParseSetupRequest (USBD_SetupReqTypedef *req, uint8_t *pdata); 92 | 93 | void USBD_GetString (uint8_t *desc, uint8_t *unicode, uint16_t *len); 94 | /** 95 | * @} 96 | */ 97 | 98 | #ifdef __cplusplus 99 | } 100 | #endif 101 | 102 | #endif /* __USB_REQUEST_H */ 103 | 104 | /** 105 | * @} 106 | */ 107 | 108 | /** 109 | * @} 110 | */ 111 | 112 | 113 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 114 | -------------------------------------------------------------------------------- /src/LCSCSI-STM32/stm32/USB_Device/Core/Inc/usbd_desc.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file USB_Device/DualCore_Standalone/Inc/usbd_desc.h 4 | * @author MCD Application Team 5 | * @version V1.0.1 6 | * @date 25-June-2015 7 | * @brief Header for usbd_desc.c module 8 | ****************************************************************************** 9 | * @attention 10 | * 11 | *

© COPYRIGHT(c) 2015 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 | /* Define to prevent recursive inclusion -------------------------------------*/ 29 | #ifndef __USBD_DESC_H 30 | #define __USBD_DESC_H 31 | 32 | /* Includes ------------------------------------------------------------------*/ 33 | 34 | /* Exported types ------------------------------------------------------------*/ 35 | /* Exported constants --------------------------------------------------------*/ 36 | /* Exported macro ------------------------------------------------------------*/ 37 | /* Exported functions ------------------------------------------------------- */ 38 | 39 | #endif /* __USBD_DESC_H */ 40 | 41 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 42 | -------------------------------------------------------------------------------- /src/LCSCSI-STM32/stm32/USB_Host/Class/HID/Inc/usbh_hid_mouse.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file usbh_hid_mouse.h 4 | * @author MCD Application Team 5 | * @version V3.2.2 6 | * @date 07-July-2015 7 | * @brief This file contains all the prototypes for the usbh_hid_mouse.c 8 | ****************************************************************************** 9 | * @attention 10 | * 11 | *

© COPYRIGHT 2015 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 | /* Define to prevent recursive ----------------------------------------------*/ 29 | #ifndef __USBH_HID_MOUSE_H 30 | #define __USBH_HID_MOUSE_H 31 | 32 | #ifdef __cplusplus 33 | extern "C" { 34 | #endif 35 | 36 | /* Includes ------------------------------------------------------------------*/ 37 | #include "usbh_hid.h" 38 | 39 | /** @addtogroup USBH_LIB 40 | * @{ 41 | */ 42 | 43 | /** @addtogroup USBH_CLASS 44 | * @{ 45 | */ 46 | 47 | /** @addtogroup USBH_HID_CLASS 48 | * @{ 49 | */ 50 | 51 | /** @defgroup USBH_HID_MOUSE 52 | * @brief This file is the Header file for usbh_hid_mouse.c 53 | * @{ 54 | */ 55 | 56 | 57 | /** @defgroup USBH_HID_MOUSE_Exported_Types 58 | * @{ 59 | */ 60 | 61 | typedef struct _HID_MOUSE_Info 62 | { 63 | uint8_t x; 64 | uint8_t y; 65 | uint8_t buttons[3]; 66 | } 67 | HID_MOUSE_Info_TypeDef; 68 | 69 | /** 70 | * @} 71 | */ 72 | 73 | /** @defgroup USBH_HID_MOUSE_Exported_Defines 74 | * @{ 75 | */ 76 | /** 77 | * @} 78 | */ 79 | 80 | /** @defgroup USBH_HID_MOUSE_Exported_Macros 81 | * @{ 82 | */ 83 | /** 84 | * @} 85 | */ 86 | 87 | /** @defgroup USBH_HID_MOUSE_Exported_Variables 88 | * @{ 89 | */ 90 | /** 91 | * @} 92 | */ 93 | 94 | /** @defgroup USBH_HID_MOUSE_Exported_FunctionsPrototype 95 | * @{ 96 | */ 97 | USBH_StatusTypeDef USBH_HID_MouseInit(USBH_HandleTypeDef *phost); 98 | HID_MOUSE_Info_TypeDef *USBH_HID_GetMouseInfo(USBH_HandleTypeDef *phost); 99 | 100 | /** 101 | * @} 102 | */ 103 | 104 | #ifdef __cplusplus 105 | } 106 | #endif 107 | 108 | #endif /* __USBH_HID_MOUSE_H */ 109 | 110 | /** 111 | * @} 112 | */ 113 | 114 | /** 115 | * @} 116 | */ 117 | 118 | /** 119 | * @} 120 | */ 121 | 122 | /** 123 | * @} 124 | */ 125 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 126 | -------------------------------------------------------------------------------- /src/LCSCSI-STM32/stm32/USB_Host/Class/HID/Inc/usbh_hid_parser.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file usbh_hid_parser.c 4 | * @author MCD Application Team 5 | * @version V3.2.2 6 | * @date 07-July-2015 7 | * @brief This file is the header file of the usbh_hid_parser.c 8 | ****************************************************************************** 9 | * @attention 10 | * 11 | *

© COPYRIGHT 2015 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 | /* Define to prevent recursive -----------------------------------------------*/ 29 | #ifndef __USBH_HID_PARSER_H 30 | #define __USBH_HID_PARSER_H 31 | 32 | #ifdef __cplusplus 33 | extern "C" { 34 | #endif 35 | 36 | /* Includes ------------------------------------------------------------------*/ 37 | #include "usbh_hid.h" 38 | #include "usbh_hid_usage.h" 39 | 40 | /** @addtogroup USBH_LIB 41 | * @{ 42 | */ 43 | 44 | /** @addtogroup USBH_CLASS 45 | * @{ 46 | */ 47 | 48 | /** @addtogroup USBH_HID_CLASS 49 | * @{ 50 | */ 51 | 52 | /** @defgroup USBH_HID_PARSER 53 | * @brief This file is the Header file for usbh_hid_parser.c 54 | * @{ 55 | */ 56 | 57 | 58 | /** @defgroup USBH_HID_PARSER_Exported_Types 59 | * @{ 60 | */ 61 | typedef struct 62 | { 63 | uint8_t *data; 64 | uint32_t size; 65 | uint8_t shift; 66 | uint8_t count; 67 | uint8_t sign; 68 | uint32_t logical_min; /*min value device can return*/ 69 | uint32_t logical_max; /*max value device can return*/ 70 | uint32_t physical_min; /*min vale read can report*/ 71 | uint32_t physical_max; /*max value read can report*/ 72 | uint32_t resolution; 73 | } 74 | HID_Report_ItemTypedef; 75 | 76 | 77 | uint32_t HID_ReadItem (HID_Report_ItemTypedef *ri, uint8_t ndx); 78 | uint32_t HID_WriteItem(HID_Report_ItemTypedef *ri, uint32_t value, uint8_t ndx); 79 | 80 | 81 | /** 82 | * @} 83 | */ 84 | 85 | #ifdef __cplusplus 86 | } 87 | #endif 88 | 89 | #endif /* __USBH_HID_PARSER_H */ 90 | 91 | /** 92 | * @} 93 | */ 94 | 95 | /** 96 | * @} 97 | */ 98 | 99 | /** 100 | * @} 101 | */ 102 | 103 | /** 104 | * @} 105 | */ 106 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 107 | -------------------------------------------------------------------------------- /src/LCSCSI-STM32/stm32/USB_Host/Class/Template/Inc/usbh_template.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file usbh_template.h 4 | * @author MCD Application Team 5 | * @version V3.2.2 6 | * @date 07-July-2015 7 | * @brief This file contains all the prototypes for the usbh_template.c 8 | ****************************************************************************** 9 | * @attention 10 | * 11 | *

© COPYRIGHT 2015 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 | /* Define to prevent recursive ----------------------------------------------*/ 29 | #ifndef __USBH_TEMPLATE_H 30 | #define __USBH_TEMPLATE_H 31 | 32 | #ifdef __cplusplus 33 | extern "C" { 34 | #endif 35 | 36 | /* Includes ------------------------------------------------------------------*/ 37 | #include "usbh_core.h" 38 | 39 | 40 | /** @addtogroup USBH_LIB 41 | * @{ 42 | */ 43 | 44 | /** @addtogroup USBH_CLASS 45 | * @{ 46 | */ 47 | 48 | /** @addtogroup USBH_TEMPLATE_CLASS 49 | * @{ 50 | */ 51 | 52 | /** @defgroup USBH_TEMPLATE_CLASS 53 | * @brief This file is the Header file for usbh_template.c 54 | * @{ 55 | */ 56 | 57 | 58 | /** 59 | * @} 60 | */ 61 | 62 | /** @defgroup USBH_TEMPLATE_CLASS_Exported_Types 63 | * @{ 64 | */ 65 | 66 | /* States for TEMPLATE State Machine */ 67 | 68 | 69 | /** 70 | * @} 71 | */ 72 | 73 | /** @defgroup USBH_TEMPLATE_CLASS_Exported_Defines 74 | * @{ 75 | */ 76 | 77 | /** 78 | * @} 79 | */ 80 | 81 | /** @defgroup USBH_TEMPLATE_CLASS_Exported_Macros 82 | * @{ 83 | */ 84 | /** 85 | * @} 86 | */ 87 | 88 | /** @defgroup USBH_TEMPLATE_CLASS_Exported_Variables 89 | * @{ 90 | */ 91 | extern USBH_ClassTypeDef TEMPLATE_Class; 92 | #define USBH_TEMPLATE_CLASS &TEMPLATE_Class 93 | 94 | /** 95 | * @} 96 | */ 97 | 98 | /** @defgroup USBH_TEMPLATE_CLASS_Exported_FunctionsPrototype 99 | * @{ 100 | */ 101 | USBH_StatusTypeDef USBH_TEMPLATE_IOProcess (USBH_HandleTypeDef *phost); 102 | USBH_StatusTypeDef USBH_TEMPLATE_Init (USBH_HandleTypeDef *phost); 103 | /** 104 | * @} 105 | */ 106 | 107 | #ifdef __cplusplus 108 | } 109 | #endif 110 | 111 | #endif /* __USBH_TEMPLATE_H */ 112 | 113 | /** 114 | * @} 115 | */ 116 | 117 | /** 118 | * @} 119 | */ 120 | 121 | /** 122 | * @} 123 | */ 124 | 125 | /** 126 | * @} 127 | */ 128 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 129 | 130 | -------------------------------------------------------------------------------- /src/LCSCSI-STM32/stm32/USB_Host/Release_Notes.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pgodwin/LC-SCSI/932dee4ad179bbc891c01385586574af78597bf7/src/LCSCSI-STM32/stm32/USB_Host/Release_Notes.html -------------------------------------------------------------------------------- /src/LCSCSI-STM32/stm32/attributes.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Attributes for different compilers 3 | * 4 | * @author Tilen Majerle 5 | * @email tilen@majerle.eu 6 | * @website http://stm32f4-discovery.net 7 | * @version v1.0 8 | * @ide Keil uVision 5 9 | * @license GNU GPL v3 10 | * 11 | * |---------------------------------------------------------------------- 12 | * | Copyright (C) Tilen Majerle, 2014 13 | * | 14 | * | This program is free software: you can redistribute it and/or modify 15 | * | it under the terms of the GNU General Public License as published by 16 | * | the Free Software Foundation, either version 3 of the License, or 17 | * | any later version. 18 | * | 19 | * | This program is distributed in the hope that it will be useful, 20 | * | but WITHOUT ANY WARRANTY; without even the implied warranty of 21 | * | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 22 | * | GNU General Public License for more details. 23 | * | 24 | * | You should have received a copy of the GNU General Public License 25 | * | along with this program. If not, see . 26 | * |---------------------------------------------------------------------- 27 | * 28 | * Different compilers uses different special keywords for functions/variables. etc. 29 | * For this purpose that file has been made. On one place to all possible attributes used in my libs. 30 | */ 31 | #ifndef TM_ATTRIBUTES_H 32 | #define TM_ATTRIBUTES_H 33 | 34 | /* Check for GNUC */ 35 | #if defined (__GNUC__) 36 | #ifndef __weak 37 | #define __weak __attribute__((weak)) 38 | #endif /* Weak attribute */ 39 | #ifndef __packed 40 | #define __packed __attribute__((__packed__)) 41 | #endif /* Packed attribute */ 42 | #endif 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /src/LCSCSI-STM32/stm32/fatfs/drivers/fatfs_sd.h: -------------------------------------------------------------------------------- 1 | /*-----------------------------------------------------------------------/ 2 | / Low level disk interface module include file (C)ChaN, 2013 / 3 | /-----------------------------------------------------------------------*/ 4 | 5 | #ifndef _DISKIO_DEFINED_SD 6 | #define _DISKIO_DEFINED_SD 7 | 8 | #define _USE_WRITE 1 /* 1: Enable disk_write function */ 9 | #define _USE_IOCTL 1 /* 1: Enable disk_ioctl fucntion */ 10 | 11 | #include "diskio.h" 12 | #include "integer.h" 13 | 14 | #include "stm32fxxx_hal.h" 15 | #include "defines.h" 16 | #include "tm_stm32_fatfs.h" 17 | #include "tm_stm32_spi.h" 18 | #include "tm_stm32_delay.h" 19 | 20 | /* DMA for STM32F4xx and STM32F7xx */ 21 | #if defined(STM32F4xx) || defined(STM32F7xx) 22 | #include "tm_stm32_spi_dma.h" 23 | #define FATFS_DMA 1 24 | #else 25 | #define FATFS_DMA 0 26 | #endif 27 | 28 | /* SPI settings */ 29 | #ifndef FATFS_SPI 30 | #define FATFS_SPI SPI1 31 | #define FATFS_SPI_PINSPACK TM_SPI_PinsPack_1 32 | #endif 33 | 34 | /* CS pin settings */ 35 | #ifndef FATFS_CS_PIN 36 | #define FATFS_CS_PORT GPIOB 37 | #define FATFS_CS_PIN GPIO_PIN_5 38 | #endif 39 | 40 | /* CS pin */ 41 | #define FATFS_CS_LOW TM_GPIO_SetPinLow(FATFS_CS_PORT, FATFS_CS_PIN) 42 | #define FATFS_CS_HIGH TM_GPIO_SetPinHigh(FATFS_CS_PORT, FATFS_CS_PIN) 43 | 44 | #endif 45 | 46 | -------------------------------------------------------------------------------- /src/LCSCSI-STM32/stm32/fatfs/drivers/fatfs_sdram.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @author Tilen Majerle 3 | * @email tilen@majerle.eu 4 | * @website http://stm32f4-discovery.net 5 | * @link 6 | * @version v1.0 7 | * @ide Keil uVision 8 | * @license GNU GPL v3 9 | * @brief Library template 10 | * 11 | \verbatim 12 | ---------------------------------------------------------------------- 13 | Copyright (C) Tilen Majerle, 2015 14 | 15 | This program is free software: you can redistribute it and/or modify 16 | it under the terms of the GNU General Public License as published by 17 | the Free Software Foundation, either version 3 of the License, or 18 | any later version. 19 | 20 | This program is distributed in the hope that it will be useful, 21 | but WITHOUT ANY WARRANTY; without even the implied warranty of 22 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 23 | GNU General Public License for more details. 24 | 25 | You should have received a copy of the GNU General Public License 26 | along with this program. If not, see . 27 | ---------------------------------------------------------------------- 28 | \endverbatim 29 | */ 30 | #ifndef TM_FATFS_SDRAM_H 31 | #define TM_FATFS_SDRAM_H 100 32 | 33 | /* C++ detection */ 34 | #ifdef __cplusplus 35 | extern "C" { 36 | #endif 37 | 38 | /** 39 | * @addtogroup TM_STM32Fxxx_HAL_Libraries 40 | * @{ 41 | */ 42 | 43 | /** 44 | * @defgroup TM_FATFS_SDRAM 45 | * @brief Library description here 46 | * @{ 47 | * 48 | * \par Changelog 49 | * 50 | \verbatim 51 | Version 1.0 52 | - First release 53 | \endverbatim 54 | * 55 | * \par Dependencies 56 | * 57 | \verbatim 58 | - STM32Fxxx HAL 59 | - defines.h 60 | - TM SDRAM 61 | \endverbatim 62 | */ 63 | 64 | #include "stm32fxxx_hal.h" 65 | #include "defines.h" 66 | #include "tm_stm32_sdram.h" 67 | #include "string.h" 68 | 69 | /* FATFS functions */ 70 | #include "diskio.h" 71 | 72 | /** 73 | * @defgroup TM_FATFS_SDRAM_Macros 74 | * @brief Library defines 75 | * @{ 76 | */ 77 | 78 | #ifndef FATFS_SDRAM_SECTOR_SIZE 79 | #define FATFS_SDRAM_SECTOR_SIZE 512 80 | #endif 81 | 82 | /** 83 | * @} 84 | */ 85 | 86 | /** 87 | * @defgroup TM_FATFS_SDRAM_Typedefs 88 | * @brief Library Typedefs 89 | * @{ 90 | */ 91 | /* Typedefs here */ 92 | /** 93 | * @} 94 | */ 95 | 96 | /** 97 | * @defgroup TM_FATFS_SDRAM_Functions 98 | * @brief Library Functions - Low level functions for FATFS implementation 99 | * @{ 100 | */ 101 | 102 | DSTATUS TM_FATFS_SDRAM_disk_initialize(void); 103 | DSTATUS TM_FATFS_SDRAM_disk_status(void); 104 | DRESULT TM_FATFS_SDRAM_disk_ioctl(BYTE cmd, void *buff); 105 | DRESULT TM_FATFS_SDRAM_disk_read(BYTE *buff, DWORD sector, UINT count); 106 | DRESULT TM_FATFS_SDRAM_disk_write(const BYTE *buff, DWORD sector, UINT count); 107 | 108 | /** 109 | * @} 110 | */ 111 | 112 | /** 113 | * @} 114 | */ 115 | 116 | /** 117 | * @} 118 | */ 119 | 120 | /* C++ detection */ 121 | #ifdef __cplusplus 122 | } 123 | #endif 124 | 125 | #endif 126 | -------------------------------------------------------------------------------- /src/LCSCSI-STM32/stm32/fatfs/drivers/fatfs_spi_flash.c: -------------------------------------------------------------------------------- 1 | /** 2 | * |---------------------------------------------------------------------- 3 | * | Copyright (C) Tilen Majerle, 2015 4 | * | 5 | * | This program is free software: you can redistribute it and/or modify 6 | * | it under the terms of the GNU General Public License as published by 7 | * | the Free Software Foundation, either version 3 of the License, or 8 | * | any later version. 9 | * | 10 | * | This program is distributed in the hope that it will be useful, 11 | * | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * | GNU General Public License for more details. 14 | * | 15 | * | You should have received a copy of the GNU General Public License 16 | * | along with this program. If not, see . 17 | * |---------------------------------------------------------------------- 18 | */ 19 | #include "fatfs_spi_flash.h" 20 | 21 | /* Status for SPIFLASH */ 22 | static volatile DSTATUS SPI_FLASH_Status = STA_NOINIT; 23 | 24 | DSTATUS TM_FATFS_SPI_FLASH_disk_initialize(void) { 25 | /* Clear NOINIT flag */ 26 | //SPI_FLASH_Status &= ~STA_NOINIT; 27 | 28 | /* Return status */ 29 | return SPI_FLASH_Status; 30 | } 31 | 32 | DSTATUS TM_FATFS_SPI_FLASH_disk_status(void) { 33 | /* Return disk status */ 34 | return SPI_FLASH_Status; 35 | } 36 | 37 | DRESULT TM_FATFS_SPI_FLASH_disk_ioctl(BYTE cmd, void *buff) { 38 | /* Get command */ 39 | switch (cmd) { 40 | case GET_SECTOR_COUNT: /* Get drive capacity in unit of sector (DWORD) */ 41 | //*(DWORD *)buff = SPI_FLASH_MEMORY_SIZE / FATFS_SPI_FLASH_SECTOR_SIZE; 42 | break; 43 | case GET_BLOCK_SIZE: /* Get erase block size in unit of sector (DWORD) */ 44 | //*(WORD *)buff = 32; 45 | break; 46 | case CTRL_SYNC: 47 | case CTRL_ERASE_SECTOR: 48 | break; 49 | default: 50 | break; 51 | } 52 | 53 | /* Return ERROR */ 54 | return RES_ERROR; 55 | } 56 | 57 | DRESULT TM_FATFS_SPI_FLASH_disk_read(BYTE *buff, DWORD sector, UINT count) { 58 | /* Future use */ 59 | return RES_ERROR; 60 | } 61 | 62 | DRESULT TM_FATFS_SPI_FLASH_disk_write(const BYTE *buff, DWORD sector, UINT count) { 63 | /* Future use */ 64 | return RES_ERROR; 65 | } 66 | -------------------------------------------------------------------------------- /src/LCSCSI-STM32/stm32/fatfs/drivers/fatfs_spi_flash.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @author Tilen Majerle 3 | * @email tilen@majerle.eu 4 | * @website http://stm32f4-discovery.net 5 | * @link 6 | * @version v1.0 7 | * @ide Keil uVision 8 | * @license GNU GPL v3 9 | * @brief SPI based flash low level implementation for FATFS 10 | * 11 | \verbatim 12 | ---------------------------------------------------------------------- 13 | Copyright (C) Tilen Majerle, 2015 14 | 15 | This program is free software: you can redistribute it and/or modify 16 | it under the terms of the GNU General Public License as published by 17 | the Free Software Foundation, either version 3 of the License, or 18 | any later version. 19 | 20 | This program is distributed in the hope that it will be useful, 21 | but WITHOUT ANY WARRANTY; without even the implied warranty of 22 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 23 | GNU General Public License for more details. 24 | 25 | You should have received a copy of the GNU General Public License 26 | along with this program. If not, see . 27 | ---------------------------------------------------------------------- 28 | \endverbatim 29 | */ 30 | #ifndef TM_FATFS_SPI_FLASH_H 31 | #define TM_FATFS_SPI_FLASH_H 100 32 | 33 | /* C++ detection */ 34 | #ifdef __cplusplus 35 | extern C { 36 | #endif 37 | 38 | /** 39 | * @addtogroup TM_STM32Fxxx_HAL_Libraries 40 | * @{ 41 | */ 42 | 43 | /** 44 | * @defgroup TM_FATFS_SPI_FLASH 45 | * @brief Library description here 46 | * @{ 47 | * 48 | * \par Changelog 49 | * 50 | \verbatim 51 | Version 1.0 52 | - First release 53 | \endverbatim 54 | * 55 | * \par Dependencies 56 | * 57 | \verbatim 58 | - STM32F4xx 59 | - defines.h 60 | - TM SDRAM 61 | \endverbatim 62 | */ 63 | 64 | #include "stm32fxxx_hal.h" 65 | #include "defines.h" 66 | #include "diskio.h" 67 | 68 | /** 69 | * @defgroup TM_FATFS_SPI_FLASH_Macros 70 | * @brief Library defines 71 | * @{ 72 | */ 73 | 74 | /* Sector size on flash memory */ 75 | #ifndef FATFS_SPI_FLASH_SECTOR_SIZE 76 | #define FATFS_SPI_FLASH_SECTOR_SIZE 512 77 | #endif 78 | 79 | /* Memory size on flash */ 80 | #ifndef FATFS_SPI_FLASH_MEMORY_SIZE 81 | #define FATFS_SPI_FLASH_MEMORY_SIZE 512 82 | #endif 83 | /** 84 | * @} 85 | */ 86 | 87 | /** 88 | * @defgroup TM_FATFS_SPI_FLASH_Typedefs 89 | * @brief Library Typedefs 90 | * @{ 91 | */ 92 | /* Typedefs here */ 93 | /** 94 | * @} 95 | */ 96 | 97 | /** 98 | * @defgroup TM_FATFS_SPI_FLASH_Functions 99 | * @brief Library Functions 100 | * @{ 101 | */ 102 | 103 | DSTATUS TM_FATFS_SPI_FLASH_disk_initialize(void); 104 | DSTATUS TM_FATFS_SPI_FLASH_disk_status(void); 105 | DRESULT TM_FATFS_SPI_FLASH_disk_ioctl(BYTE cmd, void *buff); 106 | DRESULT TM_FATFS_SPI_FLASH_disk_read(BYTE *buff, DWORD sector, UINT count); 107 | DRESULT TM_FATFS_SPI_FLASH_disk_write(const BYTE *buff, DWORD sector, UINT count); 108 | 109 | /** 110 | * @} 111 | */ 112 | 113 | /** 114 | * @} 115 | */ 116 | 117 | /** 118 | * @} 119 | */ 120 | 121 | /* C++ detection */ 122 | #ifdef __cplusplus 123 | } 124 | #endif 125 | 126 | #endif 127 | -------------------------------------------------------------------------------- /src/LCSCSI-STM32/stm32/fatfs/drivers/fatfs_usb.h: -------------------------------------------------------------------------------- 1 | /*-----------------------------------------------------------------------/ 2 | / Low level disk interface modlue include file (C)ChaN, 2013 / 3 | /-----------------------------------------------------------------------*/ 4 | 5 | #ifndef _DISKIO_DEFINED_USB 6 | #define _DISKIO_DEFINED_USB 7 | 8 | #include "diskio.h" 9 | #include "integer.h" 10 | 11 | #include "stm32fxxx_hal.h" 12 | #include "defines.h" 13 | 14 | #include "tm_stm32_usb.h" 15 | #include "tm_stm32_usb_host.h" 16 | #include "usbh_msc.h" 17 | 18 | /* USB timeout max value */ 19 | #ifndef FATFS_USB_TIMEOUT 20 | #define FATFS_USB_TIMEOUT 50000 21 | #endif 22 | 23 | /*---------------------------------------*/ 24 | /* Prototypes for disk control functions */ 25 | extern DSTATUS TM_FATFS_USBFS_disk_initialize(void); 26 | extern DSTATUS TM_FATFS_USBFS_disk_status(void); 27 | extern DRESULT TM_FATFS_USBFS_disk_read(BYTE* buff, DWORD sector, UINT count); 28 | extern DRESULT TM_FATFS_USBFS_disk_write(const BYTE* buff, DWORD sector, UINT count); 29 | extern DRESULT TM_FATFS_USBFS_disk_ioctl(BYTE cmd, void* buff); 30 | extern DSTATUS TM_FATFS_USBHS_disk_initialize(void); 31 | extern DSTATUS TM_FATFS_USBHS_disk_status(void); 32 | extern DRESULT TM_FATFS_USBHS_disk_read(BYTE* buff, DWORD sector, UINT count); 33 | extern DRESULT TM_FATFS_USBHS_disk_write(const BYTE* buff, DWORD sector, UINT count); 34 | extern DRESULT TM_FATFS_USBHS_disk_ioctl(BYTE cmd, void* buff); 35 | 36 | #endif 37 | 38 | -------------------------------------------------------------------------------- /src/LCSCSI-STM32/stm32/fatfs/integer.h: -------------------------------------------------------------------------------- 1 | /*-------------------------------------------*/ 2 | /* Integer type definitions for FatFs module */ 3 | /*-------------------------------------------*/ 4 | 5 | #ifndef _FF_INTEGER 6 | #define _FF_INTEGER 7 | 8 | #ifdef _WIN32 /* FatFs development platform */ 9 | 10 | #include 11 | #include 12 | typedef unsigned __int64 QWORD; 13 | 14 | 15 | #else /* Embedded platform */ 16 | 17 | /* These types MUST be 16-bit or 32-bit */ 18 | typedef int INT; 19 | typedef unsigned int UINT; 20 | 21 | /* This type MUST be 8-bit */ 22 | typedef unsigned char BYTE; 23 | 24 | /* These types MUST be 16-bit */ 25 | typedef short SHORT; 26 | typedef unsigned short WORD; 27 | typedef unsigned short WCHAR; 28 | 29 | /* These types MUST be 32-bit */ 30 | typedef long LONG; 31 | typedef unsigned long DWORD; 32 | 33 | /* This type MUST be 64-bit (Remove this for C89 compatibility) */ 34 | typedef unsigned long long QWORD; 35 | 36 | #endif 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /src/LCSCSI-STM32/stm32/fatfs/option/unicode.c: -------------------------------------------------------------------------------- 1 | #include "../ff.h" 2 | 3 | #if _USE_LFN != 0 4 | 5 | #if _CODE_PAGE == 932 /* Japanese Shift_JIS */ 6 | #include "cc932.c" 7 | #elif _CODE_PAGE == 936 /* Simplified Chinese GBK */ 8 | #include "cc936.c" 9 | #elif _CODE_PAGE == 949 /* Korean */ 10 | #include "cc949.c" 11 | #elif _CODE_PAGE == 950 /* Traditional Chinese Big5 */ 12 | #include "cc950.c" 13 | #else /* Single Byte Character-Set */ 14 | #include "ccsbcs.c" 15 | #endif 16 | 17 | #endif 18 | -------------------------------------------------------------------------------- /src/LCSCSI-STM32/stm32/lwip/TM_README.txt: -------------------------------------------------------------------------------- 1 | Place folder www to your SD card if you want to run SD card server example -------------------------------------------------------------------------------- /src/LCSCSI-STM32/stm32/lwip/doc/FILES: -------------------------------------------------------------------------------- 1 | savannah.txt - How to obtain the current development source code. 2 | contrib.txt - How to contribute to lwIP as a developer. 3 | rawapi.txt - The documentation for the core API of lwIP. 4 | Also provides an overview about the other APIs and multithreading. 5 | snmp_agent.txt - The documentation for the lwIP SNMP agent. 6 | sys_arch.txt - The documentation for a system abstraction layer of lwIP. 7 | -------------------------------------------------------------------------------- /src/LCSCSI-STM32/stm32/lwip/fsdata.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 __FSDATA_H__ 33 | #define __FSDATA_H__ 34 | 35 | #include "lwip/opt.h" 36 | #include "fs.h" 37 | 38 | struct fsdata_file { 39 | const struct fsdata_file *next; 40 | const unsigned char *name; 41 | const unsigned char *data; 42 | int len; 43 | u8_t http_header_included; 44 | #if HTTPD_PRECALCULATED_CHECKSUM 45 | u16_t chksum_count; 46 | const struct fsdata_chksum *chksum; 47 | #endif /* HTTPD_PRECALCULATED_CHECKSUM */ 48 | }; 49 | 50 | extern const struct fsdata_file file__404_html[]; 51 | extern const struct fsdata_file file__index_shtml[]; 52 | 53 | extern const unsigned char data__index_html[]; 54 | 55 | #define FS_ROOT file__index_shtml 56 | #define FS_NUMFILES 3 57 | 58 | #endif /* __FSDATA_H__ */ 59 | -------------------------------------------------------------------------------- /src/LCSCSI-STM32/stm32/lwip/httpd_cgi_ssi.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pgodwin/LC-SCSI/932dee4ad179bbc891c01385586574af78597bf7/src/LCSCSI-STM32/stm32/lwip/httpd_cgi_ssi.c -------------------------------------------------------------------------------- /src/LCSCSI-STM32/stm32/lwip/netconf.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file netconf.h 4 | * @author MCD Application Team 5 | * @version V1.1.0 6 | * @date 31-July-2013 7 | * @brief This file contains all the functions prototypes for the netconf.c 8 | * file. 9 | ****************************************************************************** 10 | * @attention 11 | * 12 | *

© COPYRIGHT 2013 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 __NETCONF_H 31 | #define __NETCONF_H 32 | 33 | #ifdef __cplusplus 34 | extern "C" { 35 | #endif 36 | 37 | #include "tm_stm32f4_ethernet.h" 38 | 39 | /* Includes ------------------------------------------------------------------*/ 40 | /* Exported types ------------------------------------------------------------*/ 41 | #define DHCP_START 1 42 | #define DHCP_WAIT_ADDRESS 2 43 | #define DHCP_ADDRESS_ASSIGNED 3 44 | #define DHCP_TIMEOUT 4 45 | #define DHCP_LINK_DOWN 5 46 | /* Exported constants --------------------------------------------------------*/ 47 | /* Exported macro ------------------------------------------------------------*/ 48 | /* Exported functions ------------------------------------------------------- */ 49 | void LwIP_Init(void); 50 | void LwIP_Pkt_Handle(void); 51 | void LwIP_Periodic_Handle(__IO uint32_t localtime); 52 | uint32_t LwIP_CheckFrameReceived(void); 53 | 54 | #ifdef __cplusplus 55 | } 56 | #endif 57 | 58 | #endif /* __NETCONF_H */ 59 | 60 | 61 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 62 | 63 | -------------------------------------------------------------------------------- /src/LCSCSI-STM32/stm32/lwip/port/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 | -------------------------------------------------------------------------------- /src/LCSCSI-STM32/stm32/lwip/port/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 | -------------------------------------------------------------------------------- /src/LCSCSI-STM32/stm32/lwip/port/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 | -------------------------------------------------------------------------------- /src/LCSCSI-STM32/stm32/lwip/port/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 | -------------------------------------------------------------------------------- /src/LCSCSI-STM32/stm32/lwip/port/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 | -------------------------------------------------------------------------------- /src/LCSCSI-STM32/stm32/lwip/port/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 | -------------------------------------------------------------------------------- /src/LCSCSI-STM32/stm32/lwip/port/arch/perf.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001-2003 Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, 6 | * are permitted provided that the following conditions are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 3. The name of the author may not be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 19 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 21 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 24 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 25 | * OF SUCH DAMAGE. 26 | * 27 | * This file is part of the lwIP TCP/IP stack. 28 | * 29 | * Author: Adam Dunkels 30 | * 31 | */ 32 | #ifndef __PERF_H__ 33 | #define __PERF_H__ 34 | 35 | #define PERF_START /* null definition */ 36 | #define PERF_STOP(x) /* null definition */ 37 | 38 | #endif /* __PERF_H__ */ 39 | -------------------------------------------------------------------------------- /src/LCSCSI-STM32/stm32/lwip/port/arch/sys_arch.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001-2003 Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, 6 | * are permitted provided that the following conditions are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 3. The name of the author may not be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 19 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 21 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 24 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 25 | * OF SUCH DAMAGE. 26 | * 27 | * This file is part of the lwIP TCP/IP stack. 28 | * 29 | * Author: Adam Dunkels 30 | * 31 | */ 32 | #ifndef __SYS_RTXC_H__ 33 | #define __SYS_RTXC_H__ 34 | 35 | #include "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 xSemaphoreHandle sys_mutex_t; 46 | typedef xQueueHandle sys_mbox_t; 47 | typedef xTaskHandle sys_thread_t; 48 | 49 | typedef struct _sys_arch_state_t 50 | { 51 | // Task creation data. 52 | char cTaskName[configMAX_TASK_NAME_LEN]; 53 | unsigned short nStackDepth; 54 | unsigned short nTaskCount; 55 | } sys_arch_state_t; 56 | 57 | 58 | 59 | //extern sys_arch_state_t s_sys_arch_state; 60 | 61 | //void sys_set_default_state(); 62 | //void sys_set_state(signed char *pTaskName, unsigned short nStackSize); 63 | 64 | /* Message queue constants. */ 65 | #define archMESG_QUEUE_LENGTH ( 6 ) 66 | #endif /* __SYS_RTXC_H__ */ 67 | 68 | -------------------------------------------------------------------------------- /src/LCSCSI-STM32/stm32/lwip/port/ethernetif.h: -------------------------------------------------------------------------------- 1 | #ifndef __ETHERNETIF_H__ 2 | #define __ETHERNETIF_H__ 3 | 4 | 5 | #include "lwip/err.h" 6 | #include "lwip/netif.h" 7 | 8 | err_t ethernetif_init(struct netif *netif); 9 | err_t ethernetif_input(struct netif *netif); 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /src/LCSCSI-STM32/stm32/lwip/src/FILES: -------------------------------------------------------------------------------- 1 | api/ - The code for the high-level wrapper API. Not needed if 2 | you use the lowel-level call-back/raw API. 3 | 4 | core/ - The core of the TPC/IP stack; protocol implementations, 5 | memory and buffer management, and the low-level raw API. 6 | 7 | include/ - lwIP include files. 8 | 9 | netif/ - Generic network interface device drivers are kept here, 10 | as well as the ARP module. 11 | 12 | For more information on the various subdirectories, check the FILES 13 | file in each directory. 14 | -------------------------------------------------------------------------------- /src/LCSCSI-STM32/stm32/lwip/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 | -------------------------------------------------------------------------------- /src/LCSCSI-STM32/stm32/lwip/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 | -------------------------------------------------------------------------------- /src/LCSCSI-STM32/stm32/lwip/src/core/ipv6/README: -------------------------------------------------------------------------------- 1 | IPv6 support in lwIP is very experimental. 2 | -------------------------------------------------------------------------------- /src/LCSCSI-STM32/stm32/lwip/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 | -------------------------------------------------------------------------------- /src/LCSCSI-STM32/stm32/lwip/src/core/sys.c: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * lwIP Operating System abstraction 4 | * 5 | */ 6 | 7 | /* 8 | * Copyright (c) 2001-2004 Swedish Institute of Computer Science. 9 | * All rights reserved. 10 | * 11 | * Redistribution and use in source and binary forms, with or without modification, 12 | * are permitted provided that the following conditions are met: 13 | * 14 | * 1. Redistributions of source code must retain the above copyright notice, 15 | * this list of conditions and the following disclaimer. 16 | * 2. Redistributions in binary form must reproduce the above copyright notice, 17 | * this list of conditions and the following disclaimer in the documentation 18 | * and/or other materials provided with the distribution. 19 | * 3. The name of the author may not be used to endorse or promote products 20 | * derived from this software without specific prior written permission. 21 | * 22 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 23 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 24 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 25 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 26 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 27 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 29 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 30 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 31 | * OF SUCH DAMAGE. 32 | * 33 | * This file is part of the lwIP TCP/IP stack. 34 | * 35 | * Author: Adam Dunkels 36 | * 37 | */ 38 | 39 | #include "lwip/opt.h" 40 | 41 | #include "lwip/sys.h" 42 | 43 | /* Most of the functions defined in sys.h must be implemented in the 44 | * architecture-dependent file sys_arch.c */ 45 | 46 | #if !NO_SYS 47 | 48 | #ifndef sys_msleep 49 | /** 50 | * Sleep for some ms. Timeouts are NOT processed while sleeping. 51 | * 52 | * @param ms number of milliseconds to sleep 53 | */ 54 | void 55 | sys_msleep(u32_t ms) 56 | { 57 | if (ms > 0) { 58 | sys_sem_t delaysem; 59 | err_t err = sys_sem_new(&delaysem, 0); 60 | if (err == ERR_OK) { 61 | sys_arch_sem_wait(&delaysem, ms); 62 | sys_sem_free(&delaysem); 63 | } 64 | } 65 | } 66 | #endif /* sys_msleep */ 67 | 68 | #endif /* !NO_SYS */ 69 | -------------------------------------------------------------------------------- /src/LCSCSI-STM32/stm32/lwip/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 | -------------------------------------------------------------------------------- /src/LCSCSI-STM32/stm32/lwip/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 | -------------------------------------------------------------------------------- /src/LCSCSI-STM32/stm32/lwip/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 | -------------------------------------------------------------------------------- /src/LCSCSI-STM32/stm32/lwip/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 1U 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 | -------------------------------------------------------------------------------- /src/LCSCSI-STM32/stm32/lwip/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/opt.h" 38 | #include "lwip/netif.h" 39 | 40 | /** Set this to 1 to start a thread that blocks reading on the serial line 41 | * (using sio_read()). 42 | */ 43 | #ifndef SLIP_USE_RX_THREAD 44 | #define SLIP_USE_RX_THREAD !NO_SYS 45 | #endif 46 | 47 | /** Set this to 1 to enable functions to pass in RX bytes from ISR context. 48 | * If enabled, slipif_received_byte[s]() process incoming bytes and put assembled 49 | * packets on a queue, which is fed into lwIP from slipif_poll(). 50 | * If disabled, slipif_poll() polls the serila line (using sio_tryread()). 51 | */ 52 | #ifndef SLIP_RX_FROM_ISR 53 | #define SLIP_RX_FROM_ISR 0 54 | #endif 55 | 56 | /** Set this to 1 (default for SLIP_RX_FROM_ISR) to queue incoming packets 57 | * received by slipif_received_byte[s]() as long as PBUF_POOL pbufs are available. 58 | * If disabled, packets will be dropped if more than one packet is received. 59 | */ 60 | #ifndef SLIP_RX_QUEUE 61 | #define SLIP_RX_QUEUE SLIP_RX_FROM_ISR 62 | #endif 63 | 64 | #ifdef __cplusplus 65 | extern "C" { 66 | #endif 67 | 68 | err_t slipif_init(struct netif * netif); 69 | void slipif_poll(struct netif *netif); 70 | #if SLIP_RX_FROM_ISR 71 | void slipif_process_rxqueue(struct netif *netif); 72 | void slipif_received_byte(struct netif *netif, u8_t data); 73 | void slipif_received_bytes(struct netif *netif, u8_t *data, u8_t len); 74 | #endif /* SLIP_RX_FROM_ISR */ 75 | 76 | #ifdef __cplusplus 77 | } 78 | #endif 79 | 80 | #endif 81 | 82 | -------------------------------------------------------------------------------- /src/LCSCSI-STM32/stm32/lwip/src/include/posix/netdb.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * This file is a posix wrapper for lwip/netdb.h. 4 | */ 5 | 6 | /* 7 | * Redistribution and use in source and binary forms, with or without modification, 8 | * are permitted provided that the following conditions are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright notice, 11 | * this list of conditions and the following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright notice, 13 | * this list of conditions and the following disclaimer in the documentation 14 | * and/or other materials provided with the distribution. 15 | * 3. The name of the author may not be used to endorse or promote products 16 | * derived from this software without specific prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 19 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 20 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 21 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 22 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 23 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 25 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 26 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 27 | * OF SUCH DAMAGE. 28 | * 29 | * This file is part of the lwIP TCP/IP stack. 30 | * 31 | */ 32 | 33 | #include "lwip/netdb.h" 34 | -------------------------------------------------------------------------------- /src/LCSCSI-STM32/stm32/lwip/src/include/posix/sys/socket.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file 3 | * This file is a posix wrapper for lwip/sockets.h. 4 | */ 5 | 6 | /* 7 | * Redistribution and use in source and binary forms, with or without modification, 8 | * are permitted provided that the following conditions are met: 9 | * 10 | * 1. Redistributions of source code must retain the above copyright notice, 11 | * this list of conditions and the following disclaimer. 12 | * 2. Redistributions in binary form must reproduce the above copyright notice, 13 | * this list of conditions and the following disclaimer in the documentation 14 | * and/or other materials provided with the distribution. 15 | * 3. The name of the author may not be used to endorse or promote products 16 | * derived from this software without specific prior written permission. 17 | * 18 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 19 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 20 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 21 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 22 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 23 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 25 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 26 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 27 | * OF SUCH DAMAGE. 28 | * 29 | * This file is part of the lwIP TCP/IP stack. 30 | * 31 | */ 32 | 33 | #include "lwip/sockets.h" 34 | -------------------------------------------------------------------------------- /src/LCSCSI-STM32/stm32/lwip/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. -------------------------------------------------------------------------------- /src/LCSCSI-STM32/stm32/lwip/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 | -------------------------------------------------------------------------------- /src/LCSCSI-STM32/stm32/lwip/src/netif/ppp/magic.c: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * magic.c - Network Random Number Generator program file. 3 | * 4 | * Copyright (c) 2003 by Marc Boucher, Services Informatiques (MBSI) inc. 5 | * portions Copyright (c) 1997 by 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 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_impl.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 | -------------------------------------------------------------------------------- /src/LCSCSI-STM32/stm32/lwip/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 | -------------------------------------------------------------------------------- /src/LCSCSI-STM32/stm32/lwip/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 | -------------------------------------------------------------------------------- /src/LCSCSI-STM32/stm32/lwip/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 | -------------------------------------------------------------------------------- /src/LCSCSI-STM32/stm32/lwip/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 | -------------------------------------------------------------------------------- /src/LCSCSI-STM32/stm32/lwip/stm32f4x7_eth.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pgodwin/LC-SCSI/932dee4ad179bbc891c01385586574af78597bf7/src/LCSCSI-STM32/stm32/lwip/stm32f4x7_eth.c -------------------------------------------------------------------------------- /src/LCSCSI-STM32/stm32/lwip/stm32f4x7_eth.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pgodwin/LC-SCSI/932dee4ad179bbc891c01385586574af78597bf7/src/LCSCSI-STM32/stm32/lwip/stm32f4x7_eth.h -------------------------------------------------------------------------------- /src/LCSCSI-STM32/stm32/lwip/stm32f4x7_eth_bsp.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file stm32f4x7_eth_bsp.h 4 | * @author MCD Application Team 5 | * @version V1.1.0 6 | * @date 31-July-2013 7 | * @brief Header for stm32f4x7_eth_bsp.c file. 8 | ****************************************************************************** 9 | * @attention 10 | * 11 | *

© COPYRIGHT 2013 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 | /* Define to prevent recursive inclusion -------------------------------------*/ 29 | #ifndef __STM32F4x7_ETH_BSP_H 30 | #define __STM32F4x7_ETH_BSP_H 31 | 32 | #ifdef __cplusplus 33 | extern "C" { 34 | #endif 35 | 36 | #include "stm32f4xx.h" 37 | #include "netif.h" 38 | 39 | /* Exported types ------------------------------------------------------------*/ 40 | /* Exported constants --------------------------------------------------------*/ 41 | #define ETHERNET_PHY_ADDRESS ((uint16_t) 0x01) /* Relative to STM324xG-EVAL Board */ 42 | 43 | /* Ethernet Flags for EthStatus variable */ 44 | #define ETH_INIT_FLAG 0x01 /* Ethernet Init Flag */ 45 | #define ETH_LINK_FLAG 0x10 /* Ethernet Link Flag */ 46 | 47 | /* Exported macro ------------------------------------------------------------*/ 48 | /* Exported functions ------------------------------------------------------- */ 49 | uint8_t ETH_BSP_Config(void); 50 | uint32_t Eth_Link_PHYITConfig(uint16_t PHYAddress); 51 | void Eth_Link_EXTIConfig(void); 52 | void ETH_CheckLinkStatus(uint16_t PHYAddress); 53 | void ETH_link_callback(struct netif *netif); 54 | 55 | #ifdef __cplusplus 56 | } 57 | #endif 58 | 59 | #endif /* __STM32F4x7_ETH_BSP_H */ 60 | 61 | 62 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 63 | -------------------------------------------------------------------------------- /src/LCSCSI-STM32/stm32/lwip/tcp_echoclient.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file tcp_echoclient.h 4 | * @author MCD Application Team 5 | * @version V1.1.0 6 | * @date 31-July-2013 7 | * @brief Header file for tcp_echoclient.c 8 | ****************************************************************************** 9 | * @attention 10 | * 11 | *

© COPYRIGHT 2013 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 | /* Define to prevent recursive inclusion -------------------------------------*/ 29 | #ifndef __TCP_ECHOCLIENT_H__ 30 | #define __TCP_ECHOCLIENT_H__ 31 | 32 | #include "stm32f4xx.h" 33 | #include "err.h" 34 | #include "tm_stm32f4_ethernet.h" 35 | 36 | 37 | /* Includes ------------------------------------------------------------------*/ 38 | /* Exported types ------------------------------------------------------------*/ 39 | /* Exported constants --------------------------------------------------------*/ 40 | /* Exported macro ------------------------------------------------------------*/ 41 | /* Exported functions ------------------------------------------------------- */ 42 | err_t tcp_echoclient_connect(char* conn_name, uint8_t ip1, uint8_t ip2, uint8_t ip3, uint8_t ip4, uint16_t port, void* user_parameters); 43 | 44 | void tcp_echoclient_link_is_up_callback(void); 45 | void tcp_echoclient_link_is_down_callback(void); 46 | 47 | #endif /* __TCP_ECHOCLIENT_H__ */ 48 | 49 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 50 | -------------------------------------------------------------------------------- /src/LCSCSI-STM32/stm32/lwip/test/unit/core/test_mem.c: -------------------------------------------------------------------------------- 1 | #include "test_mem.h" 2 | 3 | #include "lwip/mem.h" 4 | #include "lwip/stats.h" 5 | 6 | #if !LWIP_STATS || !MEM_STATS 7 | #error "This tests needs MEM-statistics enabled" 8 | #endif 9 | #if LWIP_DNS 10 | #error "This test needs DNS turned off (as it mallocs on init)" 11 | #endif 12 | 13 | /* Setups/teardown functions */ 14 | 15 | static void 16 | mem_setup(void) 17 | { 18 | } 19 | 20 | static void 21 | mem_teardown(void) 22 | { 23 | } 24 | 25 | 26 | /* Test functions */ 27 | 28 | /** Call mem_malloc, mem_free and mem_trim and check stats */ 29 | START_TEST(test_mem_one) 30 | { 31 | #define SIZE1 16 32 | #define SIZE1_2 12 33 | #define SIZE2 16 34 | void *p1, *p2; 35 | mem_size_t s1, s2; 36 | LWIP_UNUSED_ARG(_i); 37 | 38 | #if LWIP_DNS 39 | fail("This test needs DNS turned off (as it mallocs on init)"); 40 | #endif 41 | 42 | fail_unless(lwip_stats.mem.used == 0); 43 | 44 | p1 = mem_malloc(SIZE1); 45 | fail_unless(p1 != NULL); 46 | fail_unless(lwip_stats.mem.used >= SIZE1); 47 | s1 = lwip_stats.mem.used; 48 | 49 | p2 = mem_malloc(SIZE2); 50 | fail_unless(p2 != NULL); 51 | fail_unless(lwip_stats.mem.used >= SIZE2 + s1); 52 | s2 = lwip_stats.mem.used; 53 | 54 | mem_trim(p1, SIZE1_2); 55 | 56 | mem_free(p2); 57 | fail_unless(lwip_stats.mem.used <= s2 - SIZE2); 58 | 59 | mem_free(p1); 60 | fail_unless(lwip_stats.mem.used == 0); 61 | } 62 | END_TEST 63 | 64 | 65 | /** Create the suite including all tests for this module */ 66 | Suite * 67 | mem_suite(void) 68 | { 69 | TFun tests[] = { 70 | test_mem_one 71 | }; 72 | return create_suite("MEM", tests, sizeof(tests)/sizeof(TFun), mem_setup, mem_teardown); 73 | } 74 | -------------------------------------------------------------------------------- /src/LCSCSI-STM32/stm32/lwip/test/unit/core/test_mem.h: -------------------------------------------------------------------------------- 1 | #ifndef __TEST_MEM_H__ 2 | #define __TEST_MEM_H__ 3 | 4 | #include "../lwip_check.h" 5 | 6 | Suite *mem_suite(void); 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /src/LCSCSI-STM32/stm32/lwip/test/unit/etharp/test_etharp.h: -------------------------------------------------------------------------------- 1 | #ifndef __TEST_ETHARP_H__ 2 | #define __TEST_ETHARP_H__ 3 | 4 | #include "../lwip_check.h" 5 | 6 | Suite* etharp_suite(void); 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /src/LCSCSI-STM32/stm32/lwip/test/unit/lwip_check.h: -------------------------------------------------------------------------------- 1 | #ifndef __LWIP_CHECK_H__ 2 | #define __LWIP_CHECK_H__ 3 | 4 | /* Common header file for lwIP unit tests using the check framework */ 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | #define FAIL_RET() do { fail(); return; } while(0) 11 | #define EXPECT(x) fail_unless(x) 12 | #define EXPECT_RET(x) do { fail_unless(x); if(!(x)) { return; }} while(0) 13 | #define EXPECT_RETX(x, y) do { fail_unless(x); if(!(x)) { return y; }} while(0) 14 | #define EXPECT_RETNULL(x) EXPECT_RETX(x, NULL) 15 | 16 | /** typedef for a function returning a test suite */ 17 | typedef Suite* (suite_getter_fn)(void); 18 | 19 | /** Create a test suite */ 20 | static Suite* create_suite(const char* name, TFun *tests, size_t num_tests, SFun setup, SFun teardown) 21 | { 22 | size_t i; 23 | Suite *s = suite_create(name); 24 | 25 | for(i = 0; i < num_tests; i++) { 26 | /* Core test case */ 27 | TCase *tc_core = tcase_create("Core"); 28 | if ((setup != NULL) || (teardown != NULL)) { 29 | tcase_add_checked_fixture(tc_core, setup, teardown); 30 | } 31 | tcase_add_test(tc_core, tests[i]); 32 | suite_add_tcase(s, tc_core); 33 | } 34 | return s; 35 | } 36 | 37 | #endif /* __LWIP_CHECK_H__ */ 38 | -------------------------------------------------------------------------------- /src/LCSCSI-STM32/stm32/lwip/test/unit/lwip_unittests.c: -------------------------------------------------------------------------------- 1 | #include "lwip_check.h" 2 | 3 | #include "udp/test_udp.h" 4 | #include "tcp/test_tcp.h" 5 | #include "tcp/test_tcp_oos.h" 6 | #include "core/test_mem.h" 7 | #include "etharp/test_etharp.h" 8 | 9 | #include "lwip/init.h" 10 | 11 | 12 | int main() 13 | { 14 | int number_failed; 15 | SRunner *sr; 16 | size_t i; 17 | suite_getter_fn* suites[] = { 18 | udp_suite, 19 | tcp_suite, 20 | tcp_oos_suite, 21 | mem_suite, 22 | etharp_suite 23 | }; 24 | size_t num = sizeof(suites)/sizeof(void*); 25 | LWIP_ASSERT("No suites defined", num > 0); 26 | 27 | lwip_init(); 28 | 29 | sr = srunner_create((suites[0])()); 30 | for(i = 1; i < num; i++) { 31 | srunner_add_suite(sr, ((suite_getter_fn*)suites[i])()); 32 | } 33 | 34 | #ifdef LWIP_UNITTESTS_NOFORK 35 | srunner_set_fork_status(sr, CK_NOFORK); 36 | #endif 37 | #ifdef LWIP_UNITTESTS_FORK 38 | srunner_set_fork_status(sr, CK_FORK); 39 | #endif 40 | 41 | srunner_run_all(sr, CK_NORMAL); 42 | number_failed = srunner_ntests_failed(sr); 43 | srunner_free(sr); 44 | return (number_failed == 0) ? EXIT_SUCCESS : EXIT_FAILURE; 45 | } 46 | -------------------------------------------------------------------------------- /src/LCSCSI-STM32/stm32/lwip/test/unit/lwipopts.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2001-2003 Swedish Institute of Computer Science. 3 | * All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without modification, 6 | * are permitted provided that the following conditions are met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright notice, 9 | * this list of conditions and the following disclaimer. 10 | * 2. Redistributions in binary form must reproduce the above copyright notice, 11 | * this list of conditions and the following disclaimer in the documentation 12 | * and/or other materials provided with the distribution. 13 | * 3. The name of the author may not be used to endorse or promote products 14 | * derived from this software without specific prior written permission. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 17 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 18 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 19 | * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 20 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 21 | * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 24 | * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 25 | * OF SUCH DAMAGE. 26 | * 27 | * This file is part of the lwIP TCP/IP stack. 28 | * 29 | * Author: Simon Goldschmidt 30 | * 31 | */ 32 | #ifndef __LWIPOPTS_H__ 33 | #define __LWIPOPTS_H__ 34 | 35 | /* Prevent having to link sys_arch.c (we don't test the API layers in unit tests) */ 36 | #define NO_SYS 1 37 | #define LWIP_NETCONN 0 38 | #define LWIP_SOCKET 0 39 | 40 | /* Minimal changes to opt.h required for tcp unit tests: */ 41 | #define MEM_SIZE 16000 42 | #define TCP_SND_QUEUELEN 40 43 | #define MEMP_NUM_TCP_SEG TCP_SND_QUEUELEN 44 | #define TCP_SND_BUF (12 * TCP_MSS) 45 | #define TCP_WND (10 * TCP_MSS) 46 | 47 | /* Minimal changes to opt.h required for etharp unit tests: */ 48 | #define ETHARP_SUPPORT_STATIC_ENTRIES 1 49 | 50 | #endif /* __LWIPOPTS_H__ */ 51 | -------------------------------------------------------------------------------- /src/LCSCSI-STM32/stm32/lwip/test/unit/tcp/tcp_helper.h: -------------------------------------------------------------------------------- 1 | #ifndef __TCP_HELPER_H__ 2 | #define __TCP_HELPER_H__ 3 | 4 | #include "../lwip_check.h" 5 | #include "lwip/arch.h" 6 | #include "lwip/tcp.h" 7 | #include "lwip/netif.h" 8 | 9 | /* counters used for test_tcp_counters_* callback functions */ 10 | struct test_tcp_counters { 11 | u32_t recv_calls; 12 | u32_t recved_bytes; 13 | u32_t recv_calls_after_close; 14 | u32_t recved_bytes_after_close; 15 | u32_t close_calls; 16 | u32_t err_calls; 17 | err_t last_err; 18 | char* expected_data; 19 | u32_t expected_data_len; 20 | }; 21 | 22 | struct test_tcp_txcounters { 23 | u32_t num_tx_calls; 24 | u32_t num_tx_bytes; 25 | u8_t copy_tx_packets; 26 | struct pbuf *tx_packets; 27 | }; 28 | 29 | /* Helper functions */ 30 | void tcp_remove_all(void); 31 | 32 | struct pbuf* tcp_create_segment(ip_addr_t* src_ip, ip_addr_t* dst_ip, 33 | u16_t src_port, u16_t dst_port, void* data, size_t data_len, 34 | u32_t seqno, u32_t ackno, u8_t headerflags); 35 | struct pbuf* tcp_create_rx_segment(struct tcp_pcb* pcb, void* data, size_t data_len, 36 | u32_t seqno_offset, u32_t ackno_offset, u8_t headerflags); 37 | struct pbuf* tcp_create_rx_segment_wnd(struct tcp_pcb* pcb, void* data, size_t data_len, 38 | u32_t seqno_offset, u32_t ackno_offset, u8_t headerflags, u16_t wnd); 39 | void tcp_set_state(struct tcp_pcb* pcb, enum tcp_state state, ip_addr_t* local_ip, 40 | ip_addr_t* remote_ip, u16_t local_port, u16_t remote_port); 41 | void test_tcp_counters_err(void* arg, err_t err); 42 | err_t test_tcp_counters_recv(void* arg, struct tcp_pcb* pcb, struct pbuf* p, err_t err); 43 | 44 | struct tcp_pcb* test_tcp_new_counters_pcb(struct test_tcp_counters* counters); 45 | 46 | void test_tcp_input(struct pbuf *p, struct netif *inp); 47 | 48 | void test_tcp_init_netif(struct netif *netif, struct test_tcp_txcounters *txcounters, 49 | ip_addr_t *ip_addr, ip_addr_t *netmask); 50 | 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /src/LCSCSI-STM32/stm32/lwip/test/unit/tcp/test_tcp.h: -------------------------------------------------------------------------------- 1 | #ifndef __TEST_TCP_H__ 2 | #define __TEST_TCP_H__ 3 | 4 | #include "../lwip_check.h" 5 | 6 | Suite *tcp_suite(void); 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /src/LCSCSI-STM32/stm32/lwip/test/unit/tcp/test_tcp_oos.h: -------------------------------------------------------------------------------- 1 | #ifndef __TEST_TCP_OOS_H__ 2 | #define __TEST_TCP_OOS_H__ 3 | 4 | #include "../lwip_check.h" 5 | 6 | Suite *tcp_oos_suite(void); 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /src/LCSCSI-STM32/stm32/lwip/test/unit/udp/test_udp.c: -------------------------------------------------------------------------------- 1 | #include "test_udp.h" 2 | 3 | #include "lwip/udp.h" 4 | #include "lwip/stats.h" 5 | 6 | #if !LWIP_STATS || !UDP_STATS || !MEMP_STATS 7 | #error "This tests needs UDP- and MEMP-statistics enabled" 8 | #endif 9 | 10 | /* Helper functions */ 11 | static void 12 | udp_remove_all(void) 13 | { 14 | struct udp_pcb *pcb = udp_pcbs; 15 | struct udp_pcb *pcb2; 16 | 17 | while(pcb != NULL) { 18 | pcb2 = pcb; 19 | pcb = pcb->next; 20 | udp_remove(pcb2); 21 | } 22 | fail_unless(lwip_stats.memp[MEMP_UDP_PCB].used == 0); 23 | } 24 | 25 | /* Setups/teardown functions */ 26 | 27 | static void 28 | udp_setup(void) 29 | { 30 | udp_remove_all(); 31 | } 32 | 33 | static void 34 | udp_teardown(void) 35 | { 36 | udp_remove_all(); 37 | } 38 | 39 | 40 | /* Test functions */ 41 | 42 | START_TEST(test_udp_new_remove) 43 | { 44 | struct udp_pcb* pcb; 45 | LWIP_UNUSED_ARG(_i); 46 | 47 | fail_unless(lwip_stats.memp[MEMP_UDP_PCB].used == 0); 48 | 49 | pcb = udp_new(); 50 | fail_unless(pcb != NULL); 51 | if (pcb != NULL) { 52 | fail_unless(lwip_stats.memp[MEMP_UDP_PCB].used == 1); 53 | udp_remove(pcb); 54 | fail_unless(lwip_stats.memp[MEMP_UDP_PCB].used == 0); 55 | } 56 | } 57 | END_TEST 58 | 59 | 60 | /** Create the suite including all tests for this module */ 61 | Suite * 62 | udp_suite(void) 63 | { 64 | TFun tests[] = { 65 | test_udp_new_remove, 66 | }; 67 | return create_suite("UDP", tests, sizeof(tests)/sizeof(TFun), udp_setup, udp_teardown); 68 | } 69 | -------------------------------------------------------------------------------- /src/LCSCSI-STM32/stm32/lwip/test/unit/udp/test_udp.h: -------------------------------------------------------------------------------- 1 | #ifndef __TEST_UDP_H__ 2 | #define __TEST_UDP_H__ 3 | 4 | #include "../lwip_check.h" 5 | 6 | Suite* udp_suite(void); 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /src/LCSCSI-STM32/stm32/lwip/www/404.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Sub page on SD card 9 | 10 | 11 | 14 |
15 |

Go back to first site

16 | 17 | 18 | 19 |
Error 404
Requested page is not available!
20 |
21 | 22 | -------------------------------------------------------------------------------- /src/LCSCSI-STM32/stm32/lwip/www/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pgodwin/LC-SCSI/932dee4ad179bbc891c01385586574af78597bf7/src/LCSCSI-STM32/stm32/lwip/www/favicon.ico -------------------------------------------------------------------------------- /src/LCSCSI-STM32/stm32/lwip/www/image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pgodwin/LC-SCSI/932dee4ad179bbc891c01385586574af78597bf7/src/LCSCSI-STM32/stm32/lwip/www/image.png -------------------------------------------------------------------------------- /src/LCSCSI-STM32/stm32/lwip/www/post.shtml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | POST request on SD card 9 | 10 | 11 | 14 |
15 |

Go back to first site

16 | 17 | 18 | 19 | 60 |
Post request
20 |
21 |
22 |
Text input
23 |
24 | 25 |
26 |
27 |
28 |
29 |
Textarea
30 |
31 | 32 |
33 |
34 |
35 |
36 |
Checkbox
37 |
38 | 39 |
40 |
41 |
42 |
43 |
Radio
44 |
45 | 46 | 47 | 48 |
49 |
50 |
51 |
52 |
Submit
53 |
54 | 55 |
56 |
57 |
58 |
59 |
61 |
62 | 63 | -------------------------------------------------------------------------------- /src/LCSCSI-STM32/stm32/lwip/www/post.shtml.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | POST request on SD card 9 | 10 | 11 | 14 |
15 |

Go back to first site

16 | 17 | 18 | 19 | 60 |
Post request
20 |
21 |
22 |
Text input
23 |
24 | 25 |
26 |
27 |
28 |
29 |
Textarea
30 |
31 | 32 |
33 |
34 |
35 |
36 |
Checkbox
37 |
38 | 39 |
40 |
41 |
42 |
43 |
Radio
44 |
45 | 46 | 47 | 48 |
49 |
50 |
51 |
52 |
Submit
53 |
54 | 55 |
56 |
57 |
58 |
59 |
61 |
62 | 63 | -------------------------------------------------------------------------------- /src/LCSCSI-STM32/stm32/lwip/www/style.css: -------------------------------------------------------------------------------- 1 | html, 2 | body { 3 | width: 100%; 4 | margin: 0; 5 | padding: 0; 6 | font-family: Arial, Calibri; 7 | font-size: 11px; 8 | } 9 | 10 | /*---------------------------------------------*/ 11 | /* Container */ 12 | /*---------------------------------------------*/ 13 | #header { 14 | background: #DDDDDD; 15 | text-align: center; 16 | font-size: 36px; 17 | padding: 20px; 18 | white-space: nowrap; 19 | border-bottom: 1px solid #999999; 20 | } 21 | 22 | #main { 23 | margin: 0 auto; 24 | width: 450px; 25 | } 26 | 27 | /*---------------------------------------------*/ 28 | /* Table settings */ 29 | /*---------------------------------------------*/ 30 | table { 31 | border-collapse: collapse; 32 | border: 1px solid #DDDDDD; 33 | width: 450px !important; 34 | margin: 0 auto; 35 | width: 100%; 36 | } 37 | 38 | th, 39 | td { 40 | text-align: left; 41 | border-collapse: collapse; 42 | border: 1px solid #CCCCCC; 43 | padding: 5px; 44 | font-size: 11px; 45 | } 46 | 47 | td.td_header { 48 | text-align: center; 49 | padding: 4px; 50 | background: #CCCCCC; 51 | font-size: 13px; 52 | font-weight: bold; 53 | } 54 | 55 | /*---------------------------------------------*/ 56 | /* Colors */ 57 | /*---------------------------------------------*/ 58 | .blue { 59 | color: blue; 60 | } 61 | 62 | .red { 63 | color: red; 64 | } 65 | 66 | .orange { 67 | color: orange; 68 | } 69 | 70 | .green { 71 | color: green; 72 | } 73 | 74 | /*---------------------------------------------*/ 75 | /* Hyperlinks */ 76 | /*---------------------------------------------*/ 77 | a:link, 78 | a:visited { 79 | border: 1px solid #CCCCCC; 80 | background: #EEEEEE; 81 | display: inline-block; 82 | padding: 3px 6px; 83 | color: #333333; 84 | margin: 0 2px; 85 | } 86 | 87 | a:hover { 88 | border-color: #BBBBBB; 89 | background: #DDDDDD; 90 | } 91 | 92 | /*---------------------------------------------*/ 93 | /* Miscellaneous */ 94 | /*---------------------------------------------*/ 95 | /* Bold text */ 96 | .bold { 97 | font-weight: bold; 98 | } 99 | /* Center aligned */ 100 | .align_center { 101 | text-align: center; 102 | } 103 | /* Float right */ 104 | .float_right { 105 | float: right; 106 | } 107 | /* Clear */ 108 | .clear { 109 | clear: both; 110 | } 111 | 112 | /* Img */ 113 | img { 114 | max-width: 450px; 115 | } 116 | 117 | /*---------------------------------------------*/ 118 | /* Inputs */ 119 | /*---------------------------------------------*/ 120 | .div_input { 121 | 122 | } 123 | 124 | .div_input_left { 125 | float: left; 126 | width: 60px; 127 | } 128 | 129 | .div_input_right { 130 | margin-left: 60px; 131 | } 132 | -------------------------------------------------------------------------------- /src/LCSCSI-STM32/stm32/lwip/www/subpage.shtml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Sub page on SD card 9 | 10 | 11 | 14 |
15 |

Go back to first site

16 | 17 | 18 | 19 |
Image on SD card
20 |
21 | 22 | -------------------------------------------------------------------------------- /src/LCSCSI-STM32/stm32/lwip/www/subpage.shtml.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Sub page on SD card 9 | 10 | 11 | 14 |
15 |

Go back to first site

16 | 17 | 18 | 19 |
Image on SD card
20 |
21 | 22 | -------------------------------------------------------------------------------- /src/LCSCSI-STM32/stm32/tm_stm32_am2301.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pgodwin/LC-SCSI/932dee4ad179bbc891c01385586574af78597bf7/src/LCSCSI-STM32/stm32/tm_stm32_am2301.h -------------------------------------------------------------------------------- /src/LCSCSI-STM32/stm32/tm_stm32_bor.c: -------------------------------------------------------------------------------- 1 | /** 2 | * |---------------------------------------------------------------------- 3 | * | Copyright (c) 2016 Tilen Majerle 4 | * | 5 | * | Permission is hereby granted, free of charge, to any person 6 | * | obtaining a copy of this software and associated documentation 7 | * | files (the "Software"), to deal in the Software without restriction, 8 | * | including without limitation the rights to use, copy, modify, merge, 9 | * | publish, distribute, sublicense, and/or sell copies of the Software, 10 | * | and to permit persons to whom the Software is furnished to do so, 11 | * | subject to the following conditions: 12 | * | 13 | * | The above copyright notice and this permission notice shall be 14 | * | included in all copies or substantial portions of the Software. 15 | * | 16 | * | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | * | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | * | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE 19 | * | AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | * | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | * | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | * | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | * | OTHER DEALINGS IN THE SOFTWARE. 24 | * |---------------------------------------------------------------------- 25 | */ 26 | #include "tm_stm32_bor.h" 27 | 28 | TM_BOR_Result_t TM_BOR_Set(TM_BOR_Level_t BORValue) { 29 | HAL_StatusTypeDef status; 30 | FLASH_OBProgramInitTypeDef FLASH_Handle; 31 | 32 | /* Check current BOR value */ 33 | if (TM_BOR_Get() != BORValue) { 34 | /* Set new value */ 35 | 36 | /* Select the desired V(BOR) Level */ 37 | FLASH_Handle.BORLevel = (uint32_t)BORValue; 38 | FLASH_Handle.OptionType = OPTIONBYTE_BOR; 39 | 40 | /* Unlocks the option bytes block access */ 41 | HAL_FLASH_OB_Unlock(); 42 | 43 | /* Set value */ 44 | HAL_FLASHEx_OBProgram(&FLASH_Handle); 45 | 46 | /* Launch the option byte loading */ 47 | status = HAL_FLASH_OB_Launch(); 48 | 49 | /* Lock access to registers */ 50 | HAL_FLASH_OB_Lock(); 51 | 52 | /* Check success */ 53 | if (status != HAL_OK) { 54 | /* Return error */ 55 | return TM_BOR_Result_Error; 56 | } 57 | } 58 | 59 | /* Return OK */ 60 | return TM_BOR_Result_Ok; 61 | } 62 | 63 | TM_BOR_Level_t TM_BOR_Get(void) { 64 | FLASH_OBProgramInitTypeDef FLASH_Handle; 65 | 66 | /* Read option bytes */ 67 | HAL_FLASHEx_OBGetConfig(&FLASH_Handle); 68 | 69 | /* Return BOR value */ 70 | return (TM_BOR_Level_t) FLASH_Handle.BORLevel; 71 | } 72 | -------------------------------------------------------------------------------- /src/LCSCSI-STM32/stm32/tm_stm32_cpu_load.c: -------------------------------------------------------------------------------- 1 | /** 2 | * |---------------------------------------------------------------------- 3 | * | Copyright (c) 2016 Tilen Majerle 4 | * | 5 | * | Permission is hereby granted, free of charge, to any person 6 | * | obtaining a copy of this software and associated documentation 7 | * | files (the "Software"), to deal in the Software without restriction, 8 | * | including without limitation the rights to use, copy, modify, merge, 9 | * | publish, distribute, sublicense, and/or sell copies of the Software, 10 | * | and to permit persons to whom the Software is furnished to do so, 11 | * | subject to the following conditions: 12 | * | 13 | * | The above copyright notice and this permission notice shall be 14 | * | included in all copies or substantial portions of the Software. 15 | * | 16 | * | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | * | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | * | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE 19 | * | AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | * | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | * | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | * | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | * | OTHER DEALINGS IN THE SOFTWARE. 24 | * |---------------------------------------------------------------------- 25 | */ 26 | #include "tm_stm32_cpu_load.h" 27 | 28 | uint8_t TM_CPULOAD_Init(TM_CPULOAD_t* CPU_Load) { 29 | /* Set values to 0 */ 30 | CPU_Load->Load = 0; 31 | CPU_Load->SCNT = 0; 32 | CPU_Load->WCNT = 0; 33 | CPU_Load->Updated = 0; 34 | 35 | /* Return DWT counter enabled status */ 36 | return TM_GENERAL_DWTCounterEnable(); 37 | } 38 | 39 | uint8_t TM_CPULOAD_GoToSleepMode(TM_CPULOAD_t* CPU_Load) { 40 | uint32_t t; 41 | static uint32_t l = 0; 42 | static uint32_t WorkingTime = 0; 43 | static uint32_t SleepingTime = 0; 44 | uint8_t irq_status; 45 | 46 | /* Add to working time */ 47 | WorkingTime += DWT->CYCCNT - l; 48 | 49 | /* Save count cycle time */ 50 | t = DWT->CYCCNT; 51 | 52 | /* Get interrupt status */ 53 | irq_status = __get_PRIMASK(); 54 | 55 | /* Disable interrupts */ 56 | __disable_irq(); 57 | 58 | /* Go to sleep mode */ 59 | /* Wait for wake up interrupt, systick can do it too */ 60 | __WFI(); 61 | 62 | /* Increase number of sleeping time in CPU cycles */ 63 | SleepingTime += DWT->CYCCNT - t; 64 | 65 | /* Save current time to get number of working CPU cycles */ 66 | l = DWT->CYCCNT; 67 | 68 | /* Enable interrupts, process/execute an interrupt routine which wake up CPU */ 69 | if (!irq_status) { 70 | __enable_irq(); 71 | } 72 | 73 | /* Reset flag */ 74 | CPU_Load->Updated = 0; 75 | 76 | /* Every 1000ms print CPU load via USART */ 77 | if ((SleepingTime + WorkingTime) >= HAL_RCC_GetHCLKFreq()) { 78 | /* Save values */ 79 | CPU_Load->SCNT = SleepingTime; 80 | CPU_Load->WCNT = WorkingTime; 81 | CPU_Load->Load = ((float)WorkingTime / (float)(SleepingTime + WorkingTime) * 100); 82 | CPU_Load->Updated = 1; 83 | 84 | /* Reset time */ 85 | SleepingTime = 0; 86 | WorkingTime = 0; 87 | } 88 | 89 | /* Return updated status */ 90 | return CPU_Load->Updated; 91 | } 92 | -------------------------------------------------------------------------------- /src/LCSCSI-STM32/stm32/tm_stm32_id.c: -------------------------------------------------------------------------------- 1 | /** 2 | * |---------------------------------------------------------------------- 3 | * | Copyright (c) 2016 Tilen Majerle 4 | * | 5 | * | Permission is hereby granted, free of charge, to any person 6 | * | obtaining a copy of this software and associated documentation 7 | * | files (the "Software"), to deal in the Software without restriction, 8 | * | including without limitation the rights to use, copy, modify, merge, 9 | * | publish, distribute, sublicense, and/or sell copies of the Software, 10 | * | and to permit persons to whom the Software is furnished to do so, 11 | * | subject to the following conditions: 12 | * | 13 | * | The above copyright notice and this permission notice shall be 14 | * | included in all copies or substantial portions of the Software. 15 | * | 16 | * | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | * | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | * | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE 19 | * | AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | * | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | * | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | * | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | * | OTHER DEALINGS IN THE SOFTWARE. 24 | * |---------------------------------------------------------------------- 25 | */ 26 | #include "tm_stm32_id.h" 27 | 28 | /* Nothing is needed here. Everything is done in header file with macros! */ 29 | -------------------------------------------------------------------------------- /src/LCSCSI-STM32/stm32/tm_stm32_library_template.c: -------------------------------------------------------------------------------- 1 | /** 2 | * |---------------------------------------------------------------------- 3 | * | Copyright (c) 2016 Tilen Majerle 4 | * | 5 | * | Permission is hereby granted, free of charge, to any person 6 | * | obtaining a copy of this software and associated documentation 7 | * | files (the "Software"), to deal in the Software without restriction, 8 | * | including without limitation the rights to use, copy, modify, merge, 9 | * | publish, distribute, sublicense, and/or sell copies of the Software, 10 | * | and to permit persons to whom the Software is furnished to do so, 11 | * | subject to the following conditions: 12 | * | 13 | * | The above copyright notice and this permission notice shall be 14 | * | included in all copies or substantial portions of the Software. 15 | * | 16 | * | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | * | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | * | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE 19 | * | AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | * | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | * | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | * | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | * | OTHER DEALINGS IN THE SOFTWARE. 24 | * |---------------------------------------------------------------------- 25 | */ 26 | 27 | 28 | -------------------------------------------------------------------------------- /src/LCSCSI-STM32/stm32/tm_stm32_library_template.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @author Tilen Majerle 3 | * @email tilen@majerle.eu 4 | * @website http://stm32f4-discovery.net 5 | * @link 6 | * @version v1.0 7 | * @ide Keil uVision 8 | * @license MIT 9 | * @brief Library template 10 | * 11 | \verbatim 12 | ---------------------------------------------------------------------- 13 | Copyright (c) 2016 Tilen Majerle 14 | 15 | Permission is hereby granted, free of charge, to any person 16 | obtaining a copy of this software and associated documentation 17 | files (the "Software"), to deal in the Software without restriction, 18 | including without limitation the rights to use, copy, modify, merge, 19 | publish, distribute, sublicense, and/or sell copies of the Software, 20 | and to permit persons to whom the Software is furnished to do so, 21 | subject to the following conditions: 22 | 23 | The above copyright notice and this permission notice shall be 24 | included in all copies or substantial portions of the Software. 25 | 26 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 27 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 28 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE 29 | AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 30 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 31 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 32 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 33 | OTHER DEALINGS IN THE SOFTWARE. 34 | ---------------------------------------------------------------------- 35 | \endverbatim 36 | */ 37 | #ifndef TM_LIBRARY_H 38 | #define TM_LIBRARY_H 100 39 | 40 | /* C++ detection */ 41 | #ifdef __cplusplus 42 | extern "C" { 43 | #endif 44 | 45 | /** 46 | * @addtogroup TM_STM32Fxxx_HAL_Libraries 47 | * @{ 48 | */ 49 | 50 | /** 51 | * @defgroup TM_LIBNAME 52 | * @brief Library description here 53 | * @{ 54 | * 55 | * \par Changelog 56 | * 57 | \verbatim 58 | Version 1.0 59 | - First release 60 | \endverbatim 61 | * 62 | * \par Dependencies 63 | * 64 | \verbatim 65 | - STM32Fxxx HAL 66 | - defines.h 67 | \endverbatim 68 | */ 69 | 70 | #include "stm32fxxx_hal.h" 71 | #include "defines.h" 72 | 73 | /** 74 | * @defgroup TM_LIB_Macros 75 | * @brief Library defines 76 | * @{ 77 | */ 78 | /* Macros here */ 79 | /** 80 | * @} 81 | */ 82 | 83 | /** 84 | * @defgroup TM_LIB_Typedefs 85 | * @brief Library Typedefs 86 | * @{ 87 | */ 88 | /* Typedefs here */ 89 | /** 90 | * @} 91 | */ 92 | 93 | /** 94 | * @defgroup TM_LIB_Functions 95 | * @brief Library Functions 96 | * @{ 97 | */ 98 | /* Functions here */ 99 | /** 100 | * @} 101 | */ 102 | 103 | /** 104 | * @} 105 | */ 106 | 107 | /** 108 | * @} 109 | */ 110 | 111 | /* C++ detection */ 112 | #ifdef __cplusplus 113 | } 114 | #endif 115 | 116 | #endif 117 | -------------------------------------------------------------------------------- /src/LCSCSI-STM32/stm32/tm_stm32_nrf24l01.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pgodwin/LC-SCSI/932dee4ad179bbc891c01385586574af78597bf7/src/LCSCSI-STM32/stm32/tm_stm32_nrf24l01.c -------------------------------------------------------------------------------- /src/LCSCSI-STM32/stm32/tm_stm32_pvd.c: -------------------------------------------------------------------------------- 1 | /** 2 | * |---------------------------------------------------------------------- 3 | * | Copyright (c) 2016 Tilen Majerle 4 | * | 5 | * | Permission is hereby granted, free of charge, to any person 6 | * | obtaining a copy of this software and associated documentation 7 | * | files (the "Software"), to deal in the Software without restriction, 8 | * | including without limitation the rights to use, copy, modify, merge, 9 | * | publish, distribute, sublicense, and/or sell copies of the Software, 10 | * | and to permit persons to whom the Software is furnished to do so, 11 | * | subject to the following conditions: 12 | * | 13 | * | The above copyright notice and this permission notice shall be 14 | * | included in all copies or substantial portions of the Software. 15 | * | 16 | * | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | * | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | * | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE 19 | * | AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | * | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | * | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | * | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | * | OTHER DEALINGS IN THE SOFTWARE. 24 | * |---------------------------------------------------------------------- 25 | */ 26 | #include "tm_stm32_pvd.h" 27 | 28 | void TM_PVD_Enable(TM_PVD_Level_t Level, TM_PVD_Trigger_t Trigger) { 29 | PWR_PVDTypeDef ConfigPVD; 30 | 31 | /* Enable PWR clock */ 32 | __HAL_RCC_PWR_CLK_ENABLE(); 33 | 34 | /* Set interrupt to NVIC */ 35 | HAL_NVIC_SetPriority(PVD_IRQn, PVD_NVIC_PRIORITY, PVD_NVIC_SUBPRIORITY); 36 | 37 | /* Enable interrupt */ 38 | HAL_NVIC_EnableIRQ(PVD_IRQn); 39 | 40 | /* Set level and mode */ 41 | ConfigPVD.PVDLevel = (uint32_t)Level; 42 | ConfigPVD.Mode = Trigger; 43 | 44 | /* Config and enable PVD */ 45 | HAL_PWR_ConfigPVD(&ConfigPVD); 46 | 47 | /* Enable PVD */ 48 | HAL_PWR_EnablePVD(); 49 | } 50 | 51 | void TM_PVD_Disable(void) { 52 | /* Disable PVD */ 53 | HAL_PWR_DisablePVD(); 54 | 55 | /* Disable EXTI interrupt for PVD */ 56 | __HAL_PWR_PVD_EXTI_DISABLE_IT(); 57 | 58 | /* Disable NVIC */ 59 | NVIC_DisableIRQ(PVD_IRQn); 60 | } 61 | 62 | /*****************************************************************/ 63 | /* PVD INTERRUPT USER CALLBACK */ 64 | /*****************************************************************/ 65 | __weak void TM_PVD_Handler(uint8_t status) { 66 | /* NOTE: This function should not be modified, when the callback is needed, 67 | the TM_PVD_Handler could be implemented in the user file 68 | */ 69 | } 70 | 71 | /*****************************************************************/ 72 | /* PVD INTERRUPT HANDLER */ 73 | /*****************************************************************/ 74 | void PVD_IRQHandler(void) { 75 | /* Call user function if needed */ 76 | if (__HAL_PWR_PVD_EXTI_GET_FLAG() != RESET) { 77 | #if defined(PWR_CSR_PVDO) 78 | /* Call user function with status */ 79 | TM_PVD_Handler((PWR->CSR & PWR_CSR_PVDO) ? 1 : 0); 80 | #endif 81 | #if defined(PWR_CSR1_PVDO) 82 | /* Call user function with status */ 83 | TM_PVD_Handler((PWR->CSR1 & PWR_CSR1_PVDO) ? 1 : 0); 84 | #endif 85 | /* Clear PWR EXTI pending bit */ 86 | __HAL_PWR_PVD_EXTI_CLEAR_FLAG(); 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /src/LCSCSI-STM32/stm32/tm_stm32_qspiflash.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @author Tilen Majerle 3 | * @email tilen@majerle.eu 4 | * @website http://stm32f4-discovery.net 5 | * @link 6 | * @version v1.0 7 | * @ide Keil uVision 8 | * @license MIT 9 | * @brief Library template 10 | * 11 | \verbatim 12 | ---------------------------------------------------------------------- 13 | Copyright (c) 2016 Tilen Majerle 14 | 15 | Permission is hereby granted, free of charge, to any person 16 | obtaining a copy of this software and associated documentation 17 | files (the "Software"), to deal in the Software without restriction, 18 | including without limitation the rights to use, copy, modify, merge, 19 | publish, distribute, sublicense, and/or sell copies of the Software, 20 | and to permit persons to whom the Software is furnished to do so, 21 | subject to the following conditions: 22 | 23 | The above copyright notice and this permission notice shall be 24 | included in all copies or substantial portions of the Software. 25 | 26 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 27 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 28 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE 29 | AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 30 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 31 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 32 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 33 | OTHER DEALINGS IN THE SOFTWARE. 34 | ---------------------------------------------------------------------- 35 | \endverbatim 36 | */ 37 | #ifndef TM_LIBRARY_H 38 | #define TM_LIBRARY_H 100 39 | 40 | /* C++ detection */ 41 | #ifdef __cplusplus 42 | extern "C" { 43 | #endif 44 | 45 | /** 46 | * @addtogroup TM_STM32Fxxx_HAL_Libraries 47 | * @{ 48 | */ 49 | 50 | /** 51 | * @defgroup TM_LIBNAME 52 | * @brief Library description here 53 | * @{ 54 | * 55 | * \par Changelog 56 | * 57 | \verbatim 58 | Version 1.0 59 | - First release 60 | \endverbatim 61 | * 62 | * \par Dependencies 63 | * 64 | \verbatim 65 | - STM32Fxxx HAL 66 | - defines.h 67 | \endverbatim 68 | */ 69 | 70 | #include "stm32fxxx_hal.h" 71 | #include "defines.h" 72 | 73 | /** 74 | * @defgroup TM_LIB_Macros 75 | * @brief Library defines 76 | * @{ 77 | */ 78 | /* Macros here */ 79 | /** 80 | * @} 81 | */ 82 | 83 | /** 84 | * @defgroup TM_LIB_Typedefs 85 | * @brief Library Typedefs 86 | * @{ 87 | */ 88 | /* Typedefs here */ 89 | /** 90 | * @} 91 | */ 92 | 93 | /** 94 | * @defgroup TM_LIB_Functions 95 | * @brief Library Functions 96 | * @{ 97 | */ 98 | /* Functions here */ 99 | /** 100 | * @} 101 | */ 102 | 103 | /** 104 | * @} 105 | */ 106 | 107 | /** 108 | * @} 109 | */ 110 | 111 | /* C++ detection */ 112 | #ifdef __cplusplus 113 | } 114 | #endif 115 | 116 | #endif 117 | -------------------------------------------------------------------------------- /src/LCSCSI-STM32/stm32/tm_stm32_rng.c: -------------------------------------------------------------------------------- 1 | /** 2 | * |---------------------------------------------------------------------- 3 | * | Copyright (c) 2016 Tilen Majerle 4 | * | 5 | * | Permission is hereby granted, free of charge, to any person 6 | * | obtaining a copy of this software and associated documentation 7 | * | files (the "Software"), to deal in the Software without restriction, 8 | * | including without limitation the rights to use, copy, modify, merge, 9 | * | publish, distribute, sublicense, and/or sell copies of the Software, 10 | * | and to permit persons to whom the Software is furnished to do so, 11 | * | subject to the following conditions: 12 | * | 13 | * | The above copyright notice and this permission notice shall be 14 | * | included in all copies or substantial portions of the Software. 15 | * | 16 | * | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | * | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | * | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE 19 | * | AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | * | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | * | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | * | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | * | OTHER DEALINGS IN THE SOFTWARE. 24 | * |---------------------------------------------------------------------- 25 | */ 26 | #include "tm_stm32_rng.h" 27 | 28 | void TM_RNG_Init(void) { 29 | /* Enable RNG clock source */ 30 | __HAL_RCC_RNG_CLK_ENABLE(); 31 | 32 | /* RNG Peripheral enable */ 33 | RNG->CR |= RNG_CR_RNGEN; 34 | } 35 | 36 | void TM_RNG_DeInit(void) { 37 | /* Disable RNG peripheral */ 38 | RNG->CR &= ~RNG_CR_RNGEN; 39 | 40 | /* Disable RNG clock source */ 41 | __HAL_RCC_RNG_CLK_DISABLE(); 42 | } 43 | 44 | uint32_t TM_RNG_Get(void) { 45 | /* Wait until one RNG number is ready */ 46 | while (!(RNG->SR & (RNG_SR_DRDY))); 47 | 48 | /* Get a 32-bit Random number */ 49 | return RNG->DR; 50 | } 51 | -------------------------------------------------------------------------------- /src/LCSCSI-STM32/stm32/tm_stm32_rng.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @author Tilen Majerle 3 | * @email tilen@majerle.eu 4 | * @website http://stm32f4-discovery.net 5 | * @link http://stm32f4-discovery.net/2015/07/hal-library-18-rng-for-stm32fxxx/ 6 | * @version v1.0 7 | * @ide Keil uVision 8 | * @license MIT 9 | * @brief Library template 10 | * 11 | \verbatim 12 | ---------------------------------------------------------------------- 13 | Copyright (c) 2016 Tilen Majerle 14 | 15 | Permission is hereby granted, free of charge, to any person 16 | obtaining a copy of this software and associated documentation 17 | files (the "Software"), to deal in the Software without restriction, 18 | including without limitation the rights to use, copy, modify, merge, 19 | publish, distribute, sublicense, and/or sell copies of the Software, 20 | and to permit persons to whom the Software is furnished to do so, 21 | subject to the following conditions: 22 | 23 | The above copyright notice and this permission notice shall be 24 | included in all copies or substantial portions of the Software. 25 | 26 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 27 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 28 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE 29 | AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 30 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 31 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 32 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 33 | OTHER DEALINGS IN THE SOFTWARE. 34 | ---------------------------------------------------------------------- 35 | \endverbatim 36 | */ 37 | #ifndef TM_RNG_H 38 | #define TM_RNG_H 100 39 | 40 | /* C++ detection */ 41 | #ifdef __cplusplus 42 | extern "C" { 43 | #endif 44 | 45 | /** 46 | * @addtogroup TM_STM32Fxxx_HAL_Libraries 47 | * @{ 48 | */ 49 | 50 | /** 51 | * @defgroup TM_RNG 52 | * @brief Random number generator library for STM32Fxxx devices - http://stm32f4-discovery.net/2015/07/hal-library-18-rng-for-stm32fxxx/ 53 | * @{ 54 | * 55 | * \par Changelog 56 | * 57 | \verbatim 58 | Version 1.0 59 | - First release 60 | \endverbatim 61 | * 62 | * \par Dependencies 63 | * 64 | \verbatim 65 | - STM32Fxxx HAL 66 | - defines.h 67 | \endverbatim 68 | */ 69 | #include "stm32fxxx_hal.h" 70 | #include "defines.h" 71 | 72 | /** 73 | * @defgroup TM_RNG_Functions 74 | * @brief Library Functions 75 | * @{ 76 | */ 77 | 78 | /** 79 | * @brief Initializes RNG peripheral and enables clock 80 | * @param None 81 | * @retval None 82 | */ 83 | void TM_RNG_Init(void); 84 | 85 | /** 86 | * @brief De initializes RNG peripheral and disables clock 87 | * @param None 88 | * @retval None 89 | */ 90 | void TM_RNG_DeInit(void); 91 | 92 | /** 93 | * @brief Gets 32-bit random number 94 | * @param None 95 | * @retval 32-bit random number 96 | */ 97 | uint32_t TM_RNG_Get(void); 98 | 99 | /** 100 | * @} 101 | */ 102 | 103 | /** 104 | * @} 105 | */ 106 | 107 | /** 108 | * @} 109 | */ 110 | 111 | /* C++ detection */ 112 | #ifdef __cplusplus 113 | } 114 | #endif 115 | 116 | #endif 117 | 118 | -------------------------------------------------------------------------------- /src/LCSCSI-STM32/stm32/tm_stm32_touch_ts3510.c: -------------------------------------------------------------------------------- 1 | /** 2 | * |---------------------------------------------------------------------- 3 | * | Copyright (c) 2016 Tilen Majerle 4 | * | 5 | * | Permission is hereby granted, free of charge, to any person 6 | * | obtaining a copy of this software and associated documentation 7 | * | files (the "Software"), to deal in the Software without restriction, 8 | * | including without limitation the rights to use, copy, modify, merge, 9 | * | publish, distribute, sublicense, and/or sell copies of the Software, 10 | * | and to permit persons to whom the Software is furnished to do so, 11 | * | subject to the following conditions: 12 | * | 13 | * | The above copyright notice and this permission notice shall be 14 | * | included in all copies or substantial portions of the Software. 15 | * | 16 | * | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | * | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | * | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE 19 | * | AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | * | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | * | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | * | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | * | OTHER DEALINGS IN THE SOFTWARE. 24 | * |---------------------------------------------------------------------- 25 | */ 26 | #include "tm_stm32_touch_ts3510.h" 27 | 28 | uint8_t TM_TOUCH_TS3510_Init(TM_TOUCH_t* TS) { 29 | /* Init I2C */ 30 | TM_I2C_Init(TOUCH_TS3510_I2C, TOUCH_TS3510_I2C_PP, 100000); 31 | 32 | /* Set max values */ 33 | TS->MaxX = 639; 34 | TS->MaxY = 479; 35 | 36 | /* Return 0 = OK */ 37 | return 0; 38 | } 39 | 40 | uint8_t TM_TOUCH_TS3510_Read(TM_TOUCH_t* TS) { 41 | uint8_t DataSend[] = {0x81, 0x08}; 42 | uint8_t DataReceive[11]; 43 | uint16_t X1, Y1, X2, Y2; 44 | 45 | /* Read data */ 46 | TM_I2C_WriteReadRepeatedStart( 47 | TOUCH_TS3510_I2C, 48 | TOUCH_TS3510_I2C_DEV, 49 | 0x00, 50 | DataSend, 51 | 2, 52 | 0x8A, 53 | DataReceive, 54 | 11 55 | ); 56 | 57 | /* Format data */ 58 | X1 = DataReceive[1] << 8 | DataReceive[2]; 59 | Y1 = DataReceive[3] << 8 | DataReceive[4]; 60 | X2 = DataReceive[5] << 8 | DataReceive[6]; 61 | Y2 = DataReceive[7] << 8 | DataReceive[8]; 62 | 63 | /* Check values */ 64 | if (X1 != 0xFFFF && Y1 != 0xFFFF) { 65 | /* At least one is detected */ 66 | TS->NumPresses = 1; 67 | TS->X[0] = X1; 68 | TS->Y[0] = Y1; 69 | 70 | /* Check values */ 71 | if (X2 != 0xFFFF && Y2 != 0xFFFF) { 72 | /* Second is also detected */ 73 | TS->NumPresses++; 74 | TS->X[1] = X2; 75 | TS->Y[1] = Y2; 76 | } 77 | } else { 78 | /* No press detected */ 79 | TS->NumPresses = 0; 80 | } 81 | 82 | /* Everything OK */ 83 | return 0; 84 | } 85 | -------------------------------------------------------------------------------- /src/LCSCSI-STM32/stm32/tm_stm32_usb_host_msc.c: -------------------------------------------------------------------------------- 1 | /** 2 | * |---------------------------------------------------------------------- 3 | * | Copyright (c) 2016 Tilen Majerle 4 | * | 5 | * | Permission is hereby granted, free of charge, to any person 6 | * | obtaining a copy of this software and associated documentation 7 | * | files (the "Software"), to deal in the Software without restriction, 8 | * | including without limitation the rights to use, copy, modify, merge, 9 | * | publish, distribute, sublicense, and/or sell copies of the Software, 10 | * | and to permit persons to whom the Software is furnished to do so, 11 | * | subject to the following conditions: 12 | * | 13 | * | The above copyright notice and this permission notice shall be 14 | * | included in all copies or substantial portions of the Software. 15 | * | 16 | * | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | * | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 18 | * | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE 19 | * | AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 20 | * | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 21 | * | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 22 | * | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 23 | * | OTHER DEALINGS IN THE SOFTWARE. 24 | * |---------------------------------------------------------------------- 25 | */ 26 | #include "tm_stm32_usb_host_msc.h" 27 | 28 | TM_USBH_Result_t TM_USBH_MSC_Init(TM_USB_t USB_Mode) { 29 | #ifdef USB_USE_FS 30 | /* Init HID class for FS */ 31 | if (USB_Mode == TM_USB_FS || USB_Mode == TM_USB_Both) { 32 | /* Add class for HID to FS */ 33 | USBH_RegisterClass(&hUSBHost_FS, USBH_MSC_CLASS); 34 | } 35 | #endif 36 | 37 | #ifdef USB_USE_HS 38 | /* Init HID class for HS */ 39 | if (USB_Mode == TM_USB_HS || USB_Mode == TM_USB_Both) { 40 | /* Add class for HID to HS */ 41 | USBH_RegisterClass(&hUSBHost_HS, USBH_MSC_CLASS); 42 | } 43 | #endif 44 | 45 | /* Return OK */ 46 | return TM_USBH_Result_Ok; 47 | } 48 | 49 | TM_USBH_Result_t TM_USBH_MSC_IsConnected(TM_USB_t USB_Mode) { 50 | USBH_HandleTypeDef* USBHandle = TM_USBH_GetUSBPointer(USB_Mode); 51 | 52 | /* Check if device is connected and MSC class is active */ 53 | if (USBHandle->device.is_connected && USBH_GetActiveClass(USBHandle) == USB_MSC_CLASS) { 54 | /* MSC is connected */ 55 | return TM_USBH_Result_Ok; 56 | } 57 | 58 | /* Return error */ 59 | return TM_USBH_Result_Error; 60 | } 61 | 62 | TM_USBH_Result_t TM_USBH_MSC_IsReady(TM_USB_t USB_Mode) { 63 | USBH_HandleTypeDef* USBHandle = TM_USBH_GetUSBPointer(USB_Mode); 64 | 65 | /* Check if device is ready */ 66 | if (USBH_MSC_IsReady(USBHandle)) { 67 | /* MSC is ready */ 68 | return TM_USBH_Result_Ok; 69 | } 70 | 71 | /* Return error */ 72 | return TM_USBH_Result_Error; 73 | } 74 | -------------------------------------------------------------------------------- /src/LCSCSI-STM32/stm32f4xx_it.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file stm32f4xx_it.h 4 | * @brief This file contains the headers of the interrupt handlers. 5 | ****************************************************************************** 6 | * 7 | * COPYRIGHT(c) 2019 STMicroelectronics 8 | * 9 | * Redistribution and use in source and binary forms, with or without modification, 10 | * are permitted provided that the following conditions are met: 11 | * 1. Redistributions of source code must retain the above copyright notice, 12 | * this list of conditions and the following disclaimer. 13 | * 2. Redistributions in binary form must reproduce the above copyright notice, 14 | * this list of conditions and the following disclaimer in the documentation 15 | * and/or other materials provided with the distribution. 16 | * 3. Neither the name of STMicroelectronics nor the names of its contributors 17 | * may be used to endorse or promote products derived from this software 18 | * without specific prior written permission. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | * 31 | ****************************************************************************** 32 | */ 33 | 34 | /* Define to prevent recursive inclusion -------------------------------------*/ 35 | #ifndef __STM32F4xx_IT_H 36 | #define __STM32F4xx_IT_H 37 | 38 | #ifdef __cplusplus 39 | extern "C" { 40 | #endif 41 | 42 | /* Includes ------------------------------------------------------------------*/ 43 | /* Exported types ------------------------------------------------------------*/ 44 | /* Exported constants --------------------------------------------------------*/ 45 | /* Exported macro ------------------------------------------------------------*/ 46 | /* Exported functions ------------------------------------------------------- */ 47 | 48 | void SysTick_Handler(void); 49 | 50 | #ifdef __cplusplus 51 | } 52 | #endif 53 | 54 | #endif /* __STM32F4xx_IT_H */ 55 | 56 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 57 | -------------------------------------------------------------------------------- /test-disks/OS_755_500MB.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pgodwin/LC-SCSI/932dee4ad179bbc891c01385586574af78597bf7/test-disks/OS_755_500MB.zip --------------------------------------------------------------------------------