├── .gitignore ├── LICENSE ├── README.md └── vsf ├── app_type.h ├── compiler ├── ARMCC │ └── compiler.h ├── ARMGCC │ ├── compiler.h │ ├── compiler_string.c │ └── syscall.c ├── GCC │ └── compiler.h ├── IAR │ ├── compiler.c │ └── compiler.h └── VC │ └── compiler.h ├── component ├── crc │ ├── crc.c │ └── crc.h ├── debug │ ├── debug.c │ └── debug.h ├── fakefat32 │ ├── fakefat32.c │ └── fakefat32.h ├── file │ ├── fs │ │ └── malfs │ │ │ ├── fat │ │ │ ├── vsffat.c │ │ │ └── vsffat.h │ │ │ ├── vsf_malfs.c │ │ │ └── vsf_malfs.h │ ├── vsfile.c │ └── vsfile.h ├── fundation │ ├── bittool │ │ ├── bittool.c │ │ └── bittool.h │ ├── buffer │ │ ├── buffer.c │ │ └── buffer.h │ ├── list │ │ ├── list.c │ │ └── list.h │ └── stream │ │ ├── stream.c │ │ └── stream.h ├── mal │ ├── drivers │ │ └── embflash │ │ │ ├── embflash.c │ │ │ └── embflash.h │ ├── vsfmal.c │ ├── vsfmal.h │ ├── vsfscsi.c │ └── vsfscsi.h ├── shell │ ├── vsfshell.c │ └── vsfshell.h ├── stream │ └── usart_stream │ │ ├── usart_stream.c │ │ └── usart_stream.h ├── tcpip │ ├── netif │ │ ├── eth │ │ │ ├── broadcom │ │ │ │ ├── bcm_constants.h │ │ │ │ ├── bcm_sdpcm.h │ │ │ │ ├── bcm_wifi.h │ │ │ │ └── bus │ │ │ │ │ └── bcm_bus.h │ │ │ ├── vsfip_eth.c │ │ │ └── vsfip_eth.h │ │ ├── vsfip_netif.c │ │ └── vsfip_netif.h │ ├── proto │ │ ├── dhcp │ │ │ ├── vsfip_dhcp_common.c │ │ │ ├── vsfip_dhcp_common.h │ │ │ ├── vsfip_dhcpc.c │ │ │ ├── vsfip_dhcpc.h │ │ │ ├── vsfip_dhcpd.c │ │ │ └── vsfip_dhcpd.h │ │ ├── dns │ │ │ ├── vsfip_dnsc.c │ │ │ └── vsfip_dnsc.h │ │ ├── http │ │ │ ├── vsfip_httpc.c │ │ │ ├── vsfip_httpc.h │ │ │ ├── vsfip_httpd.c │ │ │ └── vsfip_httpd.h │ │ └── telnet │ │ │ ├── vsfip_telnetd.c │ │ │ └── vsfip_telnetd.h │ ├── vsfip.c │ ├── vsfip.h │ └── vsfip_priv.h ├── ui │ ├── vsfui.c │ └── vsfui.h └── usb │ ├── class │ ├── common │ │ ├── CDC │ │ │ ├── vsfusb_CDC.h │ │ │ ├── vsfusb_CDCACM.h │ │ │ └── vsfusb_RNDIS.h │ │ └── MSC │ │ │ └── vsfusb_MSC.h │ ├── device │ │ ├── CDC │ │ │ ├── vsfusbd_CDC.c │ │ │ ├── vsfusbd_CDC.h │ │ │ ├── vsfusbd_CDCACM.c │ │ │ ├── vsfusbd_CDCACM.h │ │ │ ├── vsfusbd_RNDIS.c │ │ │ └── vsfusbd_RNDIS.h │ │ ├── HID │ │ │ ├── vsfusbd_HID.c │ │ │ └── vsfusbd_HID.h │ │ └── MSC │ │ │ ├── vsfusbd_MSC_BOT.c │ │ │ └── vsfusbd_MSC_BOT.h │ └── host │ │ ├── HID │ │ ├── vsfusbh_HID.c │ │ └── vsfusbh_HID.h │ │ ├── HUB │ │ ├── vsfusbh_HUB.c │ │ └── vsfusbh_HUB.h │ │ ├── MSC │ │ ├── vsfusbh_MSC.c │ │ └── vsfusbh_MSC.h │ │ └── UVC │ │ ├── vsfusbh_UVC.c │ │ └── vsfusbh_UVC.h │ ├── common │ ├── usb_ch11.h │ ├── usb_ch9.h │ ├── usb_common.c │ ├── usb_common.h │ └── usb_type.h │ └── core │ ├── dcd │ ├── dcd.h │ └── sdcd │ │ ├── vsfsdcd.c │ │ └── vsfsdcd.h │ ├── dwc_otg │ ├── dwcotg_regs.h │ ├── vsfdwcotg.c │ ├── vsfdwcotg.h │ └── vsfdwcotg_priv.h │ ├── hcd │ ├── hcd.h │ └── ohci │ │ ├── vsfohci.c │ │ ├── vsfohci.h │ │ └── vsfohci_priv.h │ ├── vsfusbd.c │ ├── vsfusbd.h │ ├── vsfusbh.c │ └── vsfusbh.h ├── example ├── mscboot │ ├── config │ │ ├── app_hw_cfg.h │ │ └── vsf_cfg.h │ ├── fakefat32_fs.h │ ├── proj │ │ └── EWARM_GD32 │ │ │ ├── GD32.icf │ │ │ ├── app_cfg.h │ │ │ ├── demo.ewd │ │ │ ├── demo.ewp │ │ │ ├── demo.eww │ │ │ ├── hw_cfg_GD32.h │ │ │ └── vsfhal_cfg.h │ ├── usrapp.c │ └── usrapp.h └── vsfusbd │ ├── config │ ├── app_hw_cfg.h │ └── vsf_cfg.h │ ├── fakefat32_fs.h │ ├── gdb │ ├── vsfgdb.c │ └── vsfgdb.h │ ├── proj │ ├── EWARM_GD32 │ │ ├── GD32.icf │ │ ├── app_cfg.h │ │ ├── demo.ewd │ │ ├── demo.ewp │ │ ├── demo.eww │ │ ├── hw_cfg_GD32.h │ │ └── vsfhal_cfg.h │ ├── EWARM_NUC400 │ │ ├── app_cfg.h │ │ ├── demo.ewd │ │ ├── demo.ewp │ │ ├── demo.eww │ │ ├── hw_cfg_NUC400.h │ │ ├── nuc442.icf │ │ └── vsfhal_cfg.h │ └── EWARM_NUC505 │ │ ├── SPIROM.mac │ │ ├── SRAM.mac │ │ ├── app_cfg.h │ │ ├── demo.ewd │ │ ├── demo.ewp │ │ ├── demo.eww │ │ ├── hw_cfg_NUC505.h │ │ ├── nuc505.icf │ │ └── vsfhal_cfg.h │ ├── usrapp.c │ └── usrapp.h ├── framework ├── vsfsm │ ├── vsfsm.c │ └── vsfsm.h └── vsftimer │ ├── vsftimer.c │ └── vsftimer.h ├── hal ├── cpu │ ├── cmem7 │ │ ├── cmem7.h │ │ ├── core.c │ │ ├── core.h │ │ ├── startup │ │ │ └── startup_cmem7.s │ │ ├── usart │ │ │ ├── CMEM7_USART.c │ │ │ └── CMEM7_USART.h │ │ ├── usb │ │ │ ├── CMEM7_USB.c │ │ │ └── CMEM7_USB.h │ │ ├── vsf_basetype.h │ │ └── vsfhal_const.h │ ├── cortex-m │ │ ├── startup │ │ │ └── iar │ │ │ │ └── startup.s │ │ ├── vsf_basetype.h │ │ └── vsfhal_const.h │ ├── gd32f1x0 │ │ ├── adc │ │ │ ├── GD32_ADC.c │ │ │ └── GD32_ADC.h │ │ ├── core.c │ │ ├── core.h │ │ ├── flash │ │ │ ├── GD32F1X0_FLASH.c │ │ │ └── GD32F1X0_FLASH.h │ │ ├── gd32f1x0.h │ │ ├── gpio │ │ │ ├── GD32F1X0_GPIO.c │ │ │ └── GD32F1X0_GPIO.h │ │ ├── i2c │ │ │ ├── GD32F1X0_I2C.c │ │ │ └── GD32F1X0_I2C.h │ │ ├── pwm │ │ │ ├── GD32F1X0_PWM.c │ │ │ └── GD32F1X0_PWM.h │ │ ├── startup │ │ │ └── iar │ │ │ │ └── startup_gd32f1x0.s │ │ ├── usbd │ │ │ ├── GD32F1X0_USBD.c │ │ │ └── GD32F1X0_USBD.h │ │ ├── usbdio │ │ │ ├── GD32F1X0_USBDIO.c │ │ │ └── GD32F1X0_USBDIO.h │ │ ├── vsf_basetype.h │ │ └── vsfhal_const.h │ ├── nuc400 │ │ ├── NUC472_442.h │ │ ├── core.c │ │ ├── core.h │ │ ├── gpio │ │ │ ├── NUC400_GPIO.c │ │ │ └── NUC400_GPIO.h │ │ ├── startup │ │ │ ├── ARM │ │ │ │ └── startup_NUC472_442.s │ │ │ └── IAR │ │ │ │ └── startup_NUC472_442.s │ │ ├── usbd │ │ │ ├── NUC400_USBD.c │ │ │ └── NUC400_USBD.h │ │ ├── vsf_basetype.h │ │ └── vsfhal_const.h │ ├── nuc505 │ │ ├── NUC505Series.h │ │ ├── adc │ │ │ ├── NUC505_ADC.c │ │ │ └── NUC505_ADC.h │ │ ├── core.c │ │ ├── core.h │ │ ├── eint │ │ │ ├── NUC505_EINT.c │ │ │ └── NUC505_EINT.h │ │ ├── gpio │ │ │ ├── NUC505_GPIO.c │ │ │ └── NUC505_GPIO.h │ │ ├── i2c │ │ │ ├── NUC505_I2C.c │ │ │ └── NUC505_I2C.h │ │ ├── ohci │ │ │ ├── NUC505_OHCI.c │ │ │ └── NUC505_OHCI.h │ │ ├── sdio │ │ │ ├── NUC505_SDIO.c │ │ │ └── NUC505_SDIO.h │ │ ├── spi │ │ │ ├── NUC505_SPI.c │ │ │ └── NUC505_SPI.h │ │ ├── spirom │ │ │ ├── NUC505_SPIROM.c │ │ │ ├── NUC505_SPIROM.h │ │ │ ├── spiflash_drv.c │ │ │ ├── spiflash_drv.h │ │ │ └── spim.h │ │ ├── startup │ │ │ ├── ARM │ │ │ │ └── startup_NUC505Series.s │ │ │ └── IAR │ │ │ │ └── startup_NUC505Series.s │ │ ├── uart │ │ │ ├── NUC505_USART.c │ │ │ └── NUC505_USART.h │ │ ├── usbd │ │ │ ├── NUC505_USBD.c │ │ │ └── NUC505_USBD.h │ │ ├── vsf_basetype.h │ │ └── vsfhal_const.h │ ├── nv32 │ │ ├── NV32.h │ │ ├── core.c │ │ ├── core.h │ │ ├── driver │ │ │ ├── ics │ │ │ │ ├── ics.c │ │ │ │ └── ics.h │ │ │ ├── isr.h │ │ │ └── vector │ │ │ │ ├── vectors.c │ │ │ │ └── vectors.h │ │ ├── gpio │ │ │ ├── NV32_GPIO.c │ │ │ └── NV32_GPIO.h │ │ ├── usbdio │ │ │ ├── NV32_USBDIO.c │ │ │ ├── NV32_USBDIO.h │ │ │ └── USBDIO.s │ │ ├── vsf_basetype.h │ │ └── vsfhal_const.h │ ├── stm32 │ │ ├── adc │ │ │ ├── STM32_ADC.c │ │ │ └── STM32_ADC.h │ │ ├── clko │ │ │ ├── STM32_CLKO.c │ │ │ └── STM32_CLKO.h │ │ ├── core.c │ │ ├── core.h │ │ ├── ebi │ │ │ ├── STM32_EBI.c │ │ │ └── STM32_EBI.h │ │ ├── eint │ │ │ ├── STM32_EINT.c │ │ │ └── STM32_EINT.h │ │ ├── flash │ │ │ ├── STM32_FLASH.c │ │ │ └── STM32_FLASH.h │ │ ├── gpio │ │ │ ├── STM32_GPIO.c │ │ │ └── STM32_GPIO.h │ │ ├── sdio │ │ │ ├── STM32_SDIO.c │ │ │ └── STM32_SDIO.h │ │ ├── spi │ │ │ ├── STM32_SPI.c │ │ │ └── STM32_SPI.h │ │ ├── startup │ │ │ ├── TrueSTUDIO │ │ │ │ ├── startup_stm32f10x_cl.s │ │ │ │ ├── startup_stm32f10x_hd.s │ │ │ │ ├── startup_stm32f10x_ld.s │ │ │ │ ├── startup_stm32f10x_ld_vl.s │ │ │ │ ├── startup_stm32f10x_md.s │ │ │ │ ├── startup_stm32f10x_md_vl.s │ │ │ │ └── startup_stm32f10x_xl.s │ │ │ ├── arm │ │ │ │ ├── startup_stm32f10x_cl.s │ │ │ │ ├── startup_stm32f10x_hd.s │ │ │ │ ├── startup_stm32f10x_ld.s │ │ │ │ ├── startup_stm32f10x_ld_vl.s │ │ │ │ ├── startup_stm32f10x_md.s │ │ │ │ ├── startup_stm32f10x_md_vl.s │ │ │ │ └── startup_stm32f10x_xl.s │ │ │ ├── gcc_ride7 │ │ │ │ ├── startup_stm32f10x_cl.s │ │ │ │ ├── startup_stm32f10x_hd.s │ │ │ │ ├── startup_stm32f10x_ld.s │ │ │ │ ├── startup_stm32f10x_ld_vl.s │ │ │ │ ├── startup_stm32f10x_md.s │ │ │ │ ├── startup_stm32f10x_md_vl.s │ │ │ │ └── startup_stm32f10x_xl.s │ │ │ └── iar │ │ │ │ ├── startup_stm32f10x_cl.s │ │ │ │ ├── startup_stm32f10x_hd.s │ │ │ │ ├── startup_stm32f10x_ld.s │ │ │ │ ├── startup_stm32f10x_ld_vl.s │ │ │ │ ├── startup_stm32f10x_md.s │ │ │ │ ├── startup_stm32f10x_md_vl.s │ │ │ │ └── startup_stm32f10x_xl.s │ │ ├── stm32f10x.h │ │ ├── timer │ │ │ ├── STM32_TIM.c │ │ │ └── STM32_TIM.h │ │ ├── usart │ │ │ ├── STM32_USART.c │ │ │ └── STM32_USART.h │ │ ├── usbd │ │ │ ├── STM32_USBD.c │ │ │ └── STM32_USBD.h │ │ ├── vsf_basetype.h │ │ └── vsfhal_const.h │ ├── stm32f4 │ │ ├── core.c │ │ ├── core.h │ │ ├── gpio │ │ │ ├── STM32F4_GPIO.c │ │ │ └── STM32F4_GPIO.h │ │ ├── startup │ │ │ ├── arm │ │ │ │ ├── startup_stm32f401xc.s │ │ │ │ ├── startup_stm32f401xe.s │ │ │ │ ├── startup_stm32f405xx.s │ │ │ │ ├── startup_stm32f407xx.s │ │ │ │ ├── startup_stm32f410cx.s │ │ │ │ ├── startup_stm32f410rx.s │ │ │ │ ├── startup_stm32f410tx.s │ │ │ │ ├── startup_stm32f411xe.s │ │ │ │ ├── startup_stm32f415xx.s │ │ │ │ ├── startup_stm32f417xx.s │ │ │ │ ├── startup_stm32f427xx.s │ │ │ │ ├── startup_stm32f429xx.s │ │ │ │ ├── startup_stm32f437xx.s │ │ │ │ ├── startup_stm32f439xx.s │ │ │ │ ├── startup_stm32f446xx.s │ │ │ │ ├── startup_stm32f469xx.s │ │ │ │ └── startup_stm32f479xx.s │ │ │ ├── gcc │ │ │ │ ├── startup_stm32f401xc.s │ │ │ │ ├── startup_stm32f401xe.s │ │ │ │ ├── startup_stm32f405xx.s │ │ │ │ ├── startup_stm32f407xx.s │ │ │ │ ├── startup_stm32f410cx.s │ │ │ │ ├── startup_stm32f410rx.s │ │ │ │ ├── startup_stm32f410tx.s │ │ │ │ ├── startup_stm32f411xe.s │ │ │ │ ├── startup_stm32f415xx.s │ │ │ │ ├── startup_stm32f417xx.s │ │ │ │ ├── startup_stm32f427xx.s │ │ │ │ ├── startup_stm32f429xx.s │ │ │ │ ├── startup_stm32f437xx.s │ │ │ │ ├── startup_stm32f439xx.s │ │ │ │ ├── startup_stm32f446xx.s │ │ │ │ ├── startup_stm32f469xx.s │ │ │ │ └── startup_stm32f479xx.s │ │ │ └── iar │ │ │ │ ├── startup_stm32f401xc.s │ │ │ │ ├── startup_stm32f401xe.s │ │ │ │ ├── startup_stm32f405xx.s │ │ │ │ ├── startup_stm32f407xx.s │ │ │ │ ├── startup_stm32f410cx.s │ │ │ │ ├── startup_stm32f410rx.s │ │ │ │ ├── startup_stm32f410tx.s │ │ │ │ ├── startup_stm32f411xe.s │ │ │ │ ├── startup_stm32f415xx.s │ │ │ │ ├── startup_stm32f417xx.s │ │ │ │ ├── startup_stm32f427xx.s │ │ │ │ ├── startup_stm32f429xx.s │ │ │ │ ├── startup_stm32f437xx.s │ │ │ │ ├── startup_stm32f439xx.s │ │ │ │ ├── startup_stm32f446xx.s │ │ │ │ ├── startup_stm32f469xx.s │ │ │ │ └── startup_stm32f479xx.s │ │ ├── stm32f401xc.h │ │ ├── stm32f401xe.h │ │ ├── stm32f405xx.h │ │ ├── stm32f407xx.h │ │ ├── stm32f410cx.h │ │ ├── stm32f410rx.h │ │ ├── stm32f410tx.h │ │ ├── stm32f411xe.h │ │ ├── stm32f415xx.h │ │ ├── stm32f417xx.h │ │ ├── stm32f427xx.h │ │ ├── stm32f429xx.h │ │ ├── stm32f437xx.h │ │ ├── stm32f439xx.h │ │ ├── stm32f446xx.h │ │ ├── stm32f469xx.h │ │ ├── stm32f479xx.h │ │ ├── stm32f4xx.h │ │ ├── usart │ │ │ ├── STM32_USART.c │ │ │ └── STM32_USART.h │ │ ├── usb │ │ │ ├── usb.c │ │ │ └── usb.h │ │ ├── usbd │ │ │ ├── STM32F4_USBD.c │ │ │ └── STM32F4_USBD.h │ │ ├── vsf_basetype.h │ │ └── vsfhal_const.h │ └── stm32f7 │ │ ├── core.c │ │ ├── core.h │ │ ├── startup │ │ ├── arm │ │ │ ├── startup_stm32f745xx.s │ │ │ ├── startup_stm32f746xx.s │ │ │ └── startup_stm32f756xx.s │ │ ├── gcc │ │ │ ├── startup_stm32f745xx.s │ │ │ ├── startup_stm32f746xx.s │ │ │ └── startup_stm32f756xx.s │ │ └── iar │ │ │ ├── startup_stm32f745xx.s │ │ │ ├── startup_stm32f746xx.s │ │ │ └── startup_stm32f756xx.s │ │ ├── stm32f745xx.h │ │ ├── stm32f746xx.h │ │ ├── stm32f756xx.h │ │ ├── stm32f7xx.h │ │ ├── usb │ │ ├── usb.c │ │ └── usb.h │ │ ├── vsf_basetype.h │ │ └── vsfhal_const.h ├── vsfhal.c └── vsfhal.h ├── old ├── dal │ ├── cfi │ │ ├── cfi_drv.c │ │ └── cfi_drv.h │ ├── dal.c │ ├── dal.h │ ├── df25xx │ │ ├── df25xx_drv.c │ │ ├── df25xx_drv.h │ │ └── df25xx_drv_cfg.h │ ├── df45xx │ │ ├── df45xx_drv.c │ │ ├── df45xx_drv.h │ │ └── df45xx_drv_cfg.h │ ├── ee24cxx │ │ ├── ee24cxx_drv.c │ │ ├── ee24cxx_drv.h │ │ └── ee24cxx_drv_cfg.h │ ├── ee93cx6 │ │ ├── ee93cx6_drv.c │ │ ├── ee93cx6_drv.h │ │ └── ee93cx6_drv_cfg.h │ ├── mic2826 │ │ ├── mic2826_drv.c │ │ ├── mic2826_drv.h │ │ └── mic2826_drv_cfg.h │ ├── nand │ │ ├── nand_drv.c │ │ └── nand_drv.h │ ├── nrf24l01 │ │ ├── nrf24l01_drv.c │ │ ├── nrf24l01_drv.h │ │ └── nrf24l01_drv_cfg.h │ ├── s6b0724 │ │ ├── s6b0724_drv.c │ │ ├── s6b0724_drv.h │ │ └── s6b0724_drv_cfg.h │ ├── sd │ │ ├── sd_common.c │ │ ├── sd_common.h │ │ ├── sd_sdio_drv.c │ │ ├── sd_sdio_drv.h │ │ ├── sd_spi_drv.c │ │ ├── sd_spi_drv.h │ │ └── sd_spi_drv_cfg.h │ └── sst32hfxx │ │ ├── sst32hfxx_drv.c │ │ └── sst32hfxx_drv.h └── example │ ├── appldr │ ├── app_hw_cfg.h │ ├── driver │ │ └── windows │ │ │ └── VSFCDC.inf │ ├── main.c │ ├── module │ │ ├── app │ │ │ ├── blink │ │ │ │ └── blink.c │ │ │ └── helloworld │ │ │ │ └── helloworld.c │ │ ├── modmain.c │ │ └── vsfos │ │ │ ├── fakefat32_fs.h │ │ │ ├── usbd_desc.h │ │ │ ├── vsfos.c │ │ │ ├── vsfos.h │ │ │ ├── vsfos_busybox.c │ │ │ └── vsfos_busybox.h │ ├── proj │ │ ├── appldr_EWARM7.10_NUC505 │ │ │ ├── SPIROM.mac │ │ │ ├── SRAM.mac │ │ │ ├── app_cfg.h │ │ │ ├── demo.ewd │ │ │ ├── demo.ewp │ │ │ ├── demo.eww │ │ │ ├── hw_cfg_NUC505.h │ │ │ ├── proj_default.icf │ │ │ └── vsfhal_cfg.h │ │ ├── appldr_EWARM7.10_STM32 │ │ │ ├── STM32.icf │ │ │ ├── app_cfg.h │ │ │ ├── demo.ewd │ │ │ ├── demo.ewp │ │ │ ├── demo.eww │ │ │ ├── hw_cfg_STM32.h │ │ │ ├── vsf_cfg.h │ │ │ └── vsfhal_cfg.h │ │ └── modules │ │ │ ├── app_blink.ewd │ │ │ ├── app_blink.ewp │ │ │ ├── app_cfg.h │ │ │ ├── app_helloworld.ewd │ │ │ ├── app_helloworld.ewp │ │ │ ├── bcmwifi.ewd │ │ │ ├── bcmwifi.ewp │ │ │ ├── crc.ewd │ │ │ ├── crc.ewp │ │ │ ├── debug.ewd │ │ │ ├── debug.ewp │ │ │ ├── dhcpc.ewd │ │ │ ├── dhcpc.ewp │ │ │ ├── dhcpd.ewd │ │ │ ├── dhcpd.ewp │ │ │ ├── dnsc.ewd │ │ │ ├── dnsc.ewp │ │ │ ├── embflash.ewd │ │ │ ├── embflash.ewp │ │ │ ├── fakefat32.ewd │ │ │ ├── fakefat32.ewp │ │ │ ├── fat.ewd │ │ │ ├── fat.ewp │ │ │ ├── file.ewd │ │ │ ├── file.ewp │ │ │ ├── fixsize.vbs │ │ │ ├── httpc.ewd │ │ │ ├── httpc.ewp │ │ │ ├── httpd.ewd │ │ │ ├── httpd.ewp │ │ │ ├── mal.ewd │ │ │ ├── mal.ewp │ │ │ ├── malfs.ewd │ │ │ ├── malfs.ewp │ │ │ ├── module.icf │ │ │ ├── modules.eww │ │ │ ├── ohci.ewd │ │ │ ├── ohci.ewp │ │ │ ├── os.ewd │ │ │ ├── os.ewp │ │ │ ├── scsi.ewd │ │ │ ├── scsi.ewp │ │ │ ├── shell.ewd │ │ │ ├── shell.ewp │ │ │ ├── stream.ewd │ │ │ ├── stream.ewp │ │ │ ├── tcpip.ewd │ │ │ ├── tcpip.ewp │ │ │ ├── telnetd.ewd │ │ │ ├── telnetd.ewp │ │ │ ├── usbd.ewd │ │ │ ├── usbd.ewp │ │ │ ├── usbd_cdc.ewd │ │ │ ├── usbd_cdc.ewp │ │ │ ├── usbd_cdcacm.ewd │ │ │ ├── usbd_cdcacm.ewp │ │ │ ├── usbd_hid.ewd │ │ │ ├── usbd_hid.ewp │ │ │ ├── usbd_msc.ewd │ │ │ ├── usbd_msc.ewp │ │ │ ├── usbd_rndis.ewd │ │ │ ├── usbd_rndis.ewp │ │ │ ├── usbh.ewd │ │ │ ├── usbh.ewp │ │ │ ├── usbh_hid.ewd │ │ │ ├── usbh_hid.ewp │ │ │ ├── usbh_hub.ewd │ │ │ ├── usbh_hub.ewp │ │ │ ├── usbh_uvc.ewd │ │ │ ├── usbh_uvc.ewp │ │ │ ├── vsf_cfg.h │ │ │ └── vsfhal_cfg.h │ └── vsf_cfg │ │ └── vsfip_cfg.h │ ├── vsffat │ ├── fakefat32_fs.h │ ├── main.c │ └── proj │ │ └── EWARM7.10_STM32 │ │ ├── STM32.icf │ │ ├── app_cfg.h │ │ ├── demo.ewd │ │ ├── demo.ewp │ │ ├── demo.eww │ │ ├── hw_cfg_STM32.h │ │ ├── vsf_cfg.h │ │ └── vsfhal_cfg.h │ ├── vsfusbd_eda │ ├── driver │ │ └── windows │ │ │ ├── VSFCDC.inf │ │ │ └── VSFRNDIS.inf │ ├── fakefat32_fs.h │ ├── gdb │ │ ├── vsfgdb.c │ │ └── vsfgdb.h │ ├── httpd_fs.h │ ├── main.c │ ├── proj │ │ ├── EWARM7.10_NUC400 │ │ │ ├── app_cfg.h │ │ │ ├── demo.ewd │ │ │ ├── demo.ewp │ │ │ ├── demo.eww │ │ │ ├── hw_cfg_NUC400.h │ │ │ ├── nuc442.icf │ │ │ └── vsfhal_cfg.h │ │ ├── EWARM7.10_NUC505 │ │ │ ├── SPIROM.mac │ │ │ ├── SRAM.mac │ │ │ ├── app_cfg.h │ │ │ ├── demo.ewd │ │ │ ├── demo.ewp │ │ │ ├── demo.eww │ │ │ ├── hw_cfg_NUC505.h │ │ │ ├── proj_default.icf │ │ │ ├── vsf_cfg.h │ │ │ └── vsfhal_cfg.h │ │ └── EWARM7.10_STM32 │ │ │ ├── STM32.icf │ │ │ ├── app_cfg.h │ │ │ ├── demo.ewd │ │ │ ├── demo.ewp │ │ │ ├── demo.eww │ │ │ ├── hw_cfg_STM32.h │ │ │ ├── vsf_cfg.h │ │ │ └── vsfhal_cfg.h │ ├── usbd_desc.h │ └── vsf_cfg │ │ └── vsfip_cfg.h │ ├── vsfusbd_mscboot │ ├── main.c │ └── proj │ │ ├── EWARM7.10_NUC505 │ │ ├── SPIROM.mac │ │ ├── SRAM.mac │ │ ├── app_cfg.h │ │ ├── demo.ewd │ │ ├── demo.ewp │ │ ├── demo.eww │ │ ├── hw_cfg_NUC505.h │ │ ├── proj_default.icf │ │ ├── vsf_cfg.h │ │ └── vsfhal_cfg.h │ │ └── EWARM7.10_STM32 │ │ ├── STM32.icf │ │ ├── app_cfg.h │ │ ├── demo.ewd │ │ ├── demo.ewp │ │ ├── demo.eww │ │ ├── hw_cfg_STM32.h │ │ ├── vsf_cfg.h │ │ └── vsfhal_cfg.h │ ├── vsfusbd_sdcd │ ├── proj │ │ ├── EWARM7.10_GD32 │ │ │ ├── GD32F130x8.icf │ │ │ ├── app_cfg.h │ │ │ ├── app_hw_cfg.h │ │ │ ├── demo.ewd │ │ │ ├── demo.ewp │ │ │ ├── demo.eww │ │ │ ├── hw_cfg_GD32.h │ │ │ ├── vsf_cfg.h │ │ │ └── vsfhal_cfg.h │ │ └── EWARM7.10_NV32 │ │ │ ├── app_cfg.h │ │ │ ├── app_hw_cfg.h │ │ │ ├── demo.ewd │ │ │ ├── demo.ewp │ │ │ ├── demo.eww │ │ │ ├── hw_cfg_NV32.h │ │ │ ├── nv32.icf │ │ │ ├── vsf_cfg.h │ │ │ └── vsfhal_cfg.h │ ├── usrapp.c │ ├── usrapp.h │ └── usrapp_serial.c │ └── vsfusbh │ ├── main.c │ ├── main_stm32f4.c │ ├── main_stm32f7.c │ └── proj │ ├── EWARM7.40_NUC505 │ ├── NUC505.icf │ ├── NUC505_SPIROM.mac │ ├── NUC505_SRAM.mac │ ├── app_cfg.h │ ├── demo.ewd │ ├── demo.ewp │ ├── demo.eww │ ├── hw_cfg_nuc505.h │ ├── vsf_cfg.h │ └── vsfhal_cfg.h │ ├── EWARM7.40_STM32F401 │ ├── app_cfg.h │ ├── demo.dep │ ├── demo.ewd │ ├── demo.ewp │ ├── demo.ewt │ ├── demo.eww │ ├── hw_cfg_STM32F4.h │ ├── vsf_cfg.h │ └── vsfhal_cfg.h │ ├── EWARM7.40_STM32F746G │ ├── app_cfg.h │ ├── demo.ewd │ ├── demo.ewp │ ├── demo.ewt │ ├── demo.eww │ ├── hw_cfg_STM32F7.h │ ├── stm32f746xx_ITCM_flash.icf │ ├── stm32f746xx_flash.icf │ ├── stm32f746xx_sram.icf │ ├── vsf_cfg.h │ └── vsfhal_cfg.h │ └── Keil_v5_CMEM7 │ ├── app_cfg.h │ ├── cmem7.uvopt │ ├── cmem7.uvproj │ ├── fpga │ ├── CME_M7_EVB_V12.apj │ ├── src │ │ ├── armcm3_v1.v │ │ ├── pll_v1.v │ │ └── top.v │ └── top.aoc │ ├── hw_cfg_cmem7.h │ ├── sch │ └── cme-m7-evb_v1,1.pdf │ └── vsfhal_cfg.h ├── vsf.c ├── vsf.h ├── vsf_err.h └── vsfmain.c /.gitignore: -------------------------------------------------------------------------------- 1 | # Object files 2 | *.o 3 | *.ko 4 | *.obj 5 | *.elf 6 | 7 | # Precompiled Headers 8 | *.gch 9 | *.pch 10 | 11 | # Libraries 12 | *.lib 13 | *.a 14 | *.la 15 | *.lo 16 | 17 | # Shared objects (inc. Windows DLLs) 18 | *.dll 19 | *.so 20 | *.so.* 21 | *.dylib 22 | 23 | # Executables 24 | *.exe 25 | *.out 26 | *.app 27 | *.i*86 28 | *.x86_64 29 | *.hex 30 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | vsf 2 | === 3 | 4 | Versaloon software framework 5 | 6 | Below is the new version of vsf, old version is not maintained. 7 | https://github.com/vsfteam/vsf 8 | -------------------------------------------------------------------------------- /vsf/compiler/ARMCC/compiler.h: -------------------------------------------------------------------------------- 1 | #ifndef __COMPILER_H_INCLUDED__ 2 | #define __COMPILER_H_INCLUDED__ 3 | 4 | #include 5 | 6 | #define __VSF_FUNCNAME__ __func__ 7 | 8 | #define ROOTFUNC 9 | #define PACKED_HEAD 10 | #define PACKED_MID __attribute__ ((packed)) 11 | #define PACKED_TAIL 12 | 13 | #define vsf_enter_critical() __disable_irq() 14 | #define vsf_leave_critical() __enable_irq() 15 | 16 | #endif // __COMPILER_H_INCLUDED__ 17 | -------------------------------------------------------------------------------- /vsf/compiler/ARMGCC/compiler.h: -------------------------------------------------------------------------------- 1 | #ifndef __COMPILER_H_INCLUDED__ 2 | #define __COMPILER_H_INCLUDED__ 3 | 4 | //#define USE_BUILDIN_STRING_H 5 | 6 | #ifdef USE_BUILDIN_STRING_H 7 | #include 8 | #else 9 | extern void* memcpy(void *m0, const void *m1, int len); 10 | extern int memcmp(const void *m0, const void *m1, int len); 11 | extern void *memset(void *m, int c, int len); 12 | 13 | int strlen(const char *str); 14 | int strcmp(const char *str0, const char *str1); 15 | char* strcpy(char *dest, const char *source); 16 | char* strncpy(char *dest, const char *source, int len); 17 | char* strcat(char *dest, const char *source); 18 | char* strncat(char *dest, const char *source, int len); 19 | char* strchr(const char *str, int c); 20 | char* strstr(const char *str, const char *substr); 21 | char* strdup(const char *source); 22 | #endif 23 | 24 | #define __VSF_FUNCNAME__ __func__ 25 | 26 | #define ROOTFUNC 27 | #define PACKED_HEAD 28 | #define PACKED_MID __attribute__ ((packed)) 29 | #define PACKED_TAIL 30 | 31 | #endif // __COMPILER_H_INCLUDED__ 32 | -------------------------------------------------------------------------------- /vsf/compiler/ARMGCC/syscall.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | static char *heap = NULL; 5 | caddr_t _sbrk(int incr) 6 | { 7 | extern char _ebss; 8 | char *prev_heap; 9 | 10 | if (heap == NULL) 11 | { 12 | heap = &_ebss; 13 | } 14 | prev_heap = heap; 15 | 16 | heap += incr; 17 | return (caddr_t)prev_heap; 18 | } 19 | 20 | int _open(const char *name, int flags, int mode) 21 | { 22 | return -1; 23 | } 24 | 25 | int _close(int fd) 26 | { 27 | return 0; 28 | } 29 | 30 | int _fstat(int fd, struct stat *st) 31 | { 32 | st->st_mode = S_IFCHR; 33 | return 0; 34 | } 35 | 36 | int _isatty(int fd) 37 | { 38 | return 1; 39 | } 40 | 41 | int _lseek(int fd, int ptr, int dir) 42 | { 43 | return 0; 44 | } 45 | 46 | int _read(int fd, char *buf, int len) 47 | { 48 | return 0; 49 | } 50 | 51 | int _write(int fd, const void *buf, int len) 52 | { 53 | return len; 54 | } 55 | 56 | -------------------------------------------------------------------------------- /vsf/compiler/GCC/compiler.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2009 - 2010 by Simon Qian * 3 | * * 4 | * This program is free software; you can redistribute it and/or modify * 5 | * it under the terms of the GNU General Public License as published by * 6 | * the Free Software Foundation; either version 2 of the License, or * 7 | * (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the * 16 | * Free Software Foundation, Inc., * 17 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 18 | ***************************************************************************/ 19 | 20 | #ifndef __COMPILER_H_INCLUDED__ 21 | #define __COMPILER_H_INCLUDED__ 22 | 23 | #include 24 | 25 | #define __VSF_FUNCNAME__ __func__ 26 | 27 | #define ROOTFUNC 28 | #define PACKED_HEAD 29 | #define PACKED_MID __attribute__ ((packed)) 30 | #define PACKED_TAIL 31 | 32 | #endif // __COMPILER_H_INCLUDED__ 33 | -------------------------------------------------------------------------------- /vsf/compiler/IAR/compiler.c: -------------------------------------------------------------------------------- 1 | #include "compiler.h" 2 | 3 | unsigned char * compiler_get_heap(void) 4 | { 5 | #pragma segment="HEAP" 6 | return __sfb("HEAP"); 7 | } 8 | 9 | unsigned char * compiler_get_stack(void) 10 | { 11 | #pragma segment="STACK" 12 | return __sfe("STACK"); 13 | } 14 | 15 | -------------------------------------------------------------------------------- /vsf/compiler/IAR/compiler.h: -------------------------------------------------------------------------------- 1 | #ifndef __COMPILER_H_INCLUDED__ 2 | #define __COMPILER_H_INCLUDED__ 3 | 4 | #include 5 | #include 6 | 7 | #define __VSF_FUNCNAME__ "cur_function" 8 | 9 | #define ROOTFUNC __root 10 | #define PACKED_HEAD __packed 11 | #define PACKED_MID 12 | #define PACKED_TAIL 13 | 14 | #define vsf_gint_t __istate_t 15 | #define vsf_set_gint(gint) __set_interrupt_state(gint) 16 | #define vsf_get_gint() __get_interrupt_state() 17 | #define vsf_enter_critical() __disable_interrupt() 18 | #define vsf_leave_critical() __enable_interrupt() 19 | 20 | unsigned char * compiler_get_heap(void); 21 | unsigned char * compiler_get_stack(void); 22 | 23 | #define compiler_set_pc(reg) asm("MOV pc, %0" : :"r"(reg)) 24 | #define compiler_get_lr(reg) asm("MOV %0, lr" : "=r"(reg)) 25 | 26 | #endif // __COMPILER_H_INCLUDED__ 27 | -------------------------------------------------------------------------------- /vsf/compiler/VC/compiler.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2009 - 2010 by Simon Qian * 3 | * * 4 | * This program is free software; you can redistribute it and/or modify * 5 | * it under the terms of the GNU General Public License as published by * 6 | * the Free Software Foundation; either version 2 of the License, or * 7 | * (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the * 16 | * Free Software Foundation, Inc., * 17 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 18 | ***************************************************************************/ 19 | 20 | #ifndef __COMPILER_H_INCLUDED__ 21 | #define __COMPILER_H_INCLUDED__ 22 | 23 | #include 24 | 25 | #define __VSF_FUNCNAME__ __FUNCTION__ 26 | 27 | #define ROOTFUNC 28 | #define PACKED_HEAD #pragma pack(push, 1) 29 | #define PACKED_MID 30 | #define PACKED_TAIL #pragma pack(pop) 31 | 32 | #endif // __COMPILER_H_INCLUDED__ 33 | -------------------------------------------------------------------------------- /vsf/component/fundation/list/list.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2009 - 2010 by Simon Qian * 3 | * * 4 | * This program is free software; you can redistribute it and/or modify * 5 | * it under the terms of the GNU General Public License as published by * 6 | * the Free Software Foundation; either version 2 of the License, or * 7 | * (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the * 16 | * Free Software Foundation, Inc., * 17 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 18 | ***************************************************************************/ 19 | 20 | #ifndef __LIST_H_INCLUDED__ 21 | #define __LIST_H_INCLUDED__ 22 | 23 | struct sllist 24 | { 25 | struct sllist *next; 26 | }; 27 | 28 | #define sllist_init_node(node) ((node).next = NULL) 29 | #define sllist_insert(node, new) ((node).next = &(new)) 30 | #define sllist_get_container(p, t, m) container_of(p, t, m) 31 | 32 | int sllist_is_in(struct sllist *head, struct sllist *node); 33 | int sllist_remove(struct sllist **head, struct sllist *node); 34 | void sllist_append(struct sllist *head, struct sllist *new_node); 35 | void sllist_delete_next(struct sllist *head); 36 | 37 | #endif // __LIST_H_INCLUDED__ 38 | 39 | -------------------------------------------------------------------------------- /vsf/component/stream/usart_stream/usart_stream.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2009 - 2010 by Simon Qian * 3 | * * 4 | * This program is free software; you can redistribute it and/or modify * 5 | * it under the terms of the GNU General Public License as published by * 6 | * the Free Software Foundation; either version 2 of the License, or * 7 | * (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the * 16 | * Free Software Foundation, Inc., * 17 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 18 | ***************************************************************************/ 19 | 20 | #ifndef __USART_STREAM_H_INCLUDED__ 21 | #define __USART_STREAM_H_INCLUDED__ 22 | 23 | struct usart_stream_info_t 24 | { 25 | uint8_t index; 26 | uint8_t mode; 27 | uint16_t int_priority; 28 | uint32_t baudrate; 29 | 30 | // private 31 | struct vsf_stream_t *stream_tx; 32 | struct vsf_stream_t *stream_rx; 33 | }; 34 | 35 | vsf_err_t usart_stream_init(struct usart_stream_info_t *usart_stream); 36 | vsf_err_t usart_stream_fini(struct usart_stream_info_t *usart_stream); 37 | 38 | #endif // __USART_STREAM_H_INCLUDED__ 39 | -------------------------------------------------------------------------------- /vsf/component/tcpip/netif/eth/vsfip_eth.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2009 - 2010 by Simon Qian * 3 | * * 4 | * This program is free software; you can redistribute it and/or modify * 5 | * it under the terms of the GNU General Public License as published by * 6 | * the Free Software Foundation; either version 2 of the License, or * 7 | * (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the * 16 | * Free Software Foundation, Inc., * 17 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 18 | ***************************************************************************/ 19 | #ifndef __VSFIP_ETH_H_INCLUDED__ 20 | #define __VSFIP_ETH_H_INCLUDED__ 21 | 22 | #define VSFIP_ETH_HWTYPE 1 23 | #define VSFIP_ETH_HEADSIZE 14 24 | 25 | #ifdef VSFCFG_STANDALONE_MODULE 26 | #define vsfip_eth_header VSFIP_MOD->netif.eth.header 27 | #define vsfip_eth_input VSFIP_MOD->netif.eth.input 28 | #else 29 | vsf_err_t vsfip_eth_header(struct vsfip_buffer_t *buf, 30 | enum vsfip_netif_proto_t proto, const struct vsfip_macaddr_t *dest_addr); 31 | void vsfip_eth_input(struct vsfip_buffer_t *buf); 32 | #endif 33 | 34 | #endif // __VSFIP_ETH_H_INCLUDED__ 35 | -------------------------------------------------------------------------------- /vsf/component/tcpip/vsfip_priv.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2009 - 2010 by Simon Qian * 3 | * * 4 | * This program is free software; you can redistribute it and/or modify * 5 | * it under the terms of the GNU General Public License as published by * 6 | * the Free Software Foundation; either version 2 of the License, or * 7 | * (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the * 16 | * Free Software Foundation, Inc., * 17 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 18 | ***************************************************************************/ 19 | // vsfip_ipX_input will be called by netif layer for IP packets 20 | void vsfip_ip4_input(struct vsfip_buffer_t *buf); 21 | void vsfip_ip6_input(struct vsfip_buffer_t *buf); 22 | -------------------------------------------------------------------------------- /vsf/component/ui/vsfui.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2009 - 2010 by Simon Qian * 3 | * * 4 | * This program is free software; you can redistribute it and/or modify * 5 | * it under the terms of the GNU General Public License as published by * 6 | * the Free Software Foundation; either version 2 of the License, or * 7 | * (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the * 16 | * Free Software Foundation, Inc., * 17 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 18 | ***************************************************************************/ 19 | 20 | #ifndef __VSFUI_FB_H_INCLUDED__ 21 | #define __VSFUI_FB_H_INCLUDED__ 22 | 23 | struct vsfui_fb_t 24 | { 25 | struct vsfui_fb_screen_t 26 | { 27 | uint16_t width; 28 | uint16_t height; 29 | uint8_t pixel_size; 30 | 31 | struct dal_info_t *dal; 32 | } screen; 33 | 34 | // buffer 35 | struct vsf_multibuf_t *mbuffer; 36 | 37 | // private 38 | bool displaying; 39 | uint32_t cur_block; 40 | }; 41 | 42 | vsf_err_t vsfui_fb_init(struct vsfui_fb_t *vsfui_fb); 43 | vsf_err_t vsfui_fb_fini(struct vsfui_fb_t *vsfui_fb); 44 | void* vsfui_fb_get_buffer(struct vsfui_fb_t *vsfui_fb); 45 | vsf_err_t vsfui_fb_validate_buffer(struct vsfui_fb_t *vsfui_fb); 46 | vsf_err_t vsfui_fb_poll(struct vsfui_fb_t *vsfui_fb); 47 | 48 | #endif // __VSFUI_FB_H_INCLUDED__ -------------------------------------------------------------------------------- /vsf/component/usb/class/common/CDC/vsfusb_CDC.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2009 - 2010 by Simon Qian * 3 | * * 4 | * This program is free software; you can redistribute it and/or modify * 5 | * it under the terms of the GNU General Public License as published by * 6 | * the Free Software Foundation; either version 2 of the License, or * 7 | * (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the * 16 | * Free Software Foundation, Inc., * 17 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 18 | ***************************************************************************/ 19 | 20 | #ifndef __VSFUSB_CDC_H_INCLUDED__ 21 | #define __VSFUSB_CDC_H_INCLUDED__ 22 | 23 | enum usb_CDC_req_t 24 | { 25 | USB_CDCREQ_SEND_ENCAPSULATED_COMMAND = 0x00, 26 | USB_CDCREQ_GET_ENCAPSULATED_RESPONSE = 0x01, 27 | USB_CDCREQ_SET_COMM_FEATURE = 0x02, 28 | USB_CDCREQ_GET_COMM_FEATURE = 0x03, 29 | USB_CDCREQ_CLEAR_COMM_FEATURE = 0x04, 30 | }; 31 | 32 | #endif // __VSFUSB_CDC_H_INCLUDED__ 33 | -------------------------------------------------------------------------------- /vsf/component/usb/class/common/CDC/vsfusb_CDCACM.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2009 - 2010 by Simon Qian * 3 | * * 4 | * This program is free software; you can redistribute it and/or modify * 5 | * it under the terms of the GNU General Public License as published by * 6 | * the Free Software Foundation; either version 2 of the License, or * 7 | * (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the * 16 | * Free Software Foundation, Inc., * 17 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 18 | ***************************************************************************/ 19 | 20 | #ifndef __VSFUSB_CDCACM_H_INCLUDED__ 21 | #define __VSFUSB_CDCACM_H_INCLUDED__ 22 | 23 | struct usb_CDCACM_line_coding_t 24 | { 25 | uint32_t bitrate; 26 | uint8_t stopbittype; 27 | uint8_t paritytype; 28 | uint8_t datatype; 29 | }; 30 | 31 | #define USBCDCACM_CONTROLLINE_RTS 0x02 32 | #define USBCDCACM_CONTROLLINE_DTR 0x01 33 | #define USBCDCACM_CONTROLLINE_MASK 0x03 34 | 35 | enum usb_CDCACM_req_t 36 | { 37 | USB_CDCACMREQ_SET_LINE_CODING = 0x20, 38 | USB_CDCACMREQ_GET_LINE_CODING = 0x21, 39 | USB_CDCACMREQ_SET_CONTROL_LINE_STATE = 0x22, 40 | USB_CDCACMREQ_SEND_BREAK = 0x23, 41 | }; 42 | 43 | #endif // __VSFUSB_CDCACM_H_INCLUDED__ 44 | -------------------------------------------------------------------------------- /vsf/component/usb/class/host/HUB/vsfusbh_HUB.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2009 - 2010 by Simon Qian * 3 | * * 4 | * This program is free software; you can redistribute it and/or modify * 5 | * it under the terms of the GNU General Public License as published by * 6 | * the Free Software Foundation; either version 2 of the License, or * 7 | * (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the * 16 | * Free Software Foundation, Inc., * 17 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 18 | ***************************************************************************/ 19 | 20 | #ifndef __VSFUSBH_HUB_H_INCLUDED__ 21 | #define __VSFUSBH_HUB_H_INCLUDED__ 22 | 23 | #ifdef VSFCFG_STANDALONE_MODULE 24 | #define VSFUSBH_HUB_MODNAME "vsf.stack.usb.host.hub" 25 | 26 | struct vsfusbh_hub_modifs_t 27 | { 28 | struct vsfusbh_class_drv_t drv; 29 | }; 30 | 31 | vsf_err_t vsfusbh_hub_modexit(struct vsf_module_t*); 32 | vsf_err_t vsfusbh_hub_modinit(struct vsf_module_t*, struct app_hwcfg_t const*); 33 | 34 | #define VSFUSBH_HUBCMOD \ 35 | ((struct vsfusbh_hub_modifs_t *)vsf_module_load(VSFUSBH_HUB_MODNAME, true)) 36 | #define vsfusbh_hub_drv VSFUSBH_HUBCMOD->drv 37 | 38 | #else 39 | extern const struct vsfusbh_class_drv_t vsfusbh_hub_drv; 40 | #endif 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /vsf/component/usb/common/usb_common.c: -------------------------------------------------------------------------------- 1 | // usb_common.c is necessary for shci and sdcd 2 | #include "vsf.h" 3 | 4 | static uint16_t usb_crc16_byte(uint16_t crc, uint8_t byte) 5 | { 6 | uint8_t i; 7 | for (i = 0; i < 8; i++) 8 | { 9 | if ((crc ^ byte) & 1) 10 | crc = (crc >> 1) ^ 0xA001; 11 | else 12 | crc >>= 1; 13 | byte >>= 1; 14 | } 15 | return crc; 16 | } 17 | 18 | uint16_t usb_crc16(uint8_t *data, uint16_t len) 19 | { 20 | uint16_t result = 0xFFFF; 21 | while (len--) 22 | result = usb_crc16_byte(result, *data++); 23 | return ~result; 24 | } 25 | 26 | -------------------------------------------------------------------------------- /vsf/component/usb/common/usb_type.h: -------------------------------------------------------------------------------- 1 | #ifndef __USB_TYPE_H__ 2 | #define __USB_TYPE_H__ 3 | 4 | #include 5 | 6 | typedef uint8_t __u8; 7 | typedef uint16_t __u16; 8 | typedef uint32_t __u32; 9 | typedef uint16_t __le16; 10 | typedef uint32_t __le32; 11 | 12 | #endif // __USB_TYPE_H__ 13 | 14 | -------------------------------------------------------------------------------- /vsf/component/usb/core/dcd/dcd.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/versaloon/vsf_orig/387b344c4650415756de776866622b4c5e5266f8/vsf/component/usb/core/dcd/dcd.h -------------------------------------------------------------------------------- /vsf/component/usb/core/dcd/sdcd/vsfsdcd.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2009 - 2010 by Simon Qian * 3 | * * 4 | * This program is free software; you can redistribute it and/or modify * 5 | * it under the terms of the GNU General Public License as published by * 6 | * the Free Software Foundation; either version 2 of the License, or * 7 | * (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the * 16 | * Free Software Foundation, Inc., * 17 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 18 | ***************************************************************************/ 19 | 20 | #ifndef __VSFSDCD_H_INCLUDED__ 21 | #define __VSFSDCD_H_INCLUDED__ 22 | 23 | extern const struct vsfhal_usbd_t vsfsdcd_usbd; 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /vsf/component/usb/core/dwc_otg/vsfdwcotg.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2009 - 2010 by Simon Qian * 3 | * * 4 | * This program is free software; you can redistribute it and/or modify * 5 | * it under the terms of the GNU General Public License as published by * 6 | * the Free Software Foundation; either version 2 of the License, or * 7 | * (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the * 16 | * Free Software Foundation, Inc., * 17 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 18 | ***************************************************************************/ 19 | #ifndef __VSFDWCOTG_H___ 20 | #define __VSFDWCOTG_H___ 21 | 22 | /************************************************************************** 23 | * export data 24 | **************************************************************************/ 25 | 26 | struct vsfdwcotg_hcd_param_t 27 | { 28 | uint32_t index; 29 | 30 | uint8_t speed; 31 | uint8_t dma_en; 32 | uint8_t ulpi_en; 33 | uint8_t vbus_en; 34 | uint8_t hc_amount; 35 | uint8_t iso_packet_limit; 36 | 37 | uint16_t fifo_size; 38 | uint16_t periodic_out_packet_size_max; 39 | uint16_t non_periodic_out_packet_size_max; 40 | uint16_t in_packet_size_max; 41 | }; 42 | 43 | extern const struct vsfusbh_hcddrv_t vsfdwcotgh_drv; 44 | 45 | #endif // __VSFDWCOTG_H___ 46 | -------------------------------------------------------------------------------- /vsf/component/usb/core/hcd/hcd.h: -------------------------------------------------------------------------------- 1 | /* The D0/D1 toggle bits ... USE WITH CAUTION (they're almost hcd-internal) */ 2 | #define usb_gettoggle(dev, ep, out) (((dev)->toggle[out] >> (ep)) & 1) 3 | #define usb_dotoggle(dev, ep, out) ((dev)->toggle[out] ^= (1 << (ep))) 4 | #define usb_settoggle(dev, ep, out, bit) \ 5 | ((dev)->toggle[out] = ((dev)->toggle[out] & ~(1 << (ep))) | \ 6 | ((bit) << (ep))) 7 | 8 | -------------------------------------------------------------------------------- /vsf/component/usb/core/hcd/ohci/vsfohci.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2009 - 2010 by Simon Qian * 3 | * * 4 | * This program is free software; you can redistribute it and/or modify * 5 | * it under the terms of the GNU General Public License as published by * 6 | * the Free Software Foundation; either version 2 of the License, or * 7 | * (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the * 16 | * Free Software Foundation, Inc., * 17 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 18 | ***************************************************************************/ 19 | #ifndef __VSFOHCI_H___ 20 | #define __VSFOHCI_H___ 21 | 22 | struct vsfohci_hcd_param_t 23 | { 24 | uint32_t index; 25 | }; 26 | 27 | #ifdef VSFCFG_STANDALONE_MODULE 28 | #define VSFOHCI_MODNAME "vsf.stack.usb.host.hcd.ohci" 29 | 30 | struct vsfohci_modifs_t 31 | { 32 | struct vsfusbh_hcddrv_t drv; 33 | }; 34 | 35 | vsf_err_t vsfohci_modexit(struct vsf_module_t*); 36 | vsf_err_t vsfohci_modinit(struct vsf_module_t*, struct app_hwcfg_t const*); 37 | 38 | #define VSFOHCICMOD \ 39 | ((struct vsfohci_modifs_t *)vsf_module_load(VSFOHCI_MODNAME, true)) 40 | #define vsfohci_drv VSFOHCICMOD->drv 41 | 42 | #else 43 | extern const struct vsfusbh_hcddrv_t vsfohci_drv; 44 | #endif 45 | 46 | #endif // __VSFOHCI_H___ 47 | -------------------------------------------------------------------------------- /vsf/example/mscboot/config/app_hw_cfg.h: -------------------------------------------------------------------------------- 1 | struct app_hwcfg_t 2 | { 3 | struct 4 | { 5 | struct vsfhal_gpio_pin_t pullup; 6 | } usbd; 7 | }; 8 | -------------------------------------------------------------------------------- /vsf/example/mscboot/proj/EWARM_GD32/GD32.icf: -------------------------------------------------------------------------------- 1 | /*###ICF### Section handled by ICF editor, don't touch! ****/ 2 | /*-Editor annotation file-*/ 3 | /* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\a_v1_0.xml" */ 4 | /*-Specials-*/ 5 | define symbol __ICFEDIT_intvec_start__ = 0x08000000; 6 | /*-Memory Regions-*/ 7 | define symbol __ICFEDIT_region_ROM_start__ = 0x08000000; 8 | define symbol __ICFEDIT_region_ROM_end__ = 0x0803FFFF; 9 | define symbol __ICFEDIT_region_RAM_start__ = 0x20000000; 10 | define symbol __ICFEDIT_region_RAM_end__ = 0x2000FFFF; 11 | /*-Sizes-*/ 12 | define symbol __ICFEDIT_size_cstack__ = 0x400; 13 | define symbol __ICFEDIT_size_svcstack__ = 0; 14 | define symbol __ICFEDIT_size_irqstack__ = 0; 15 | define symbol __ICFEDIT_size_fiqstack__ = 0; 16 | define symbol __ICFEDIT_size_undstack__ = 0; 17 | define symbol __ICFEDIT_size_abtstack__ = 0; 18 | define symbol __ICFEDIT_size_heap__ = 0; 19 | /**** End of ICF editor section. ###ICF###*/ 20 | 21 | 22 | define memory mem with size = 4G; 23 | define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFEDIT_region_ROM_end__]; 24 | define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__]; 25 | 26 | define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { }; 27 | define block SVC_STACK with alignment = 8, size = __ICFEDIT_size_svcstack__ { }; 28 | define block IRQ_STACK with alignment = 8, size = __ICFEDIT_size_irqstack__ { }; 29 | define block FIQ_STACK with alignment = 8, size = __ICFEDIT_size_fiqstack__ { }; 30 | define block UND_STACK with alignment = 8, size = __ICFEDIT_size_undstack__ { }; 31 | define block ABT_STACK with alignment = 8, size = __ICFEDIT_size_abtstack__ { }; 32 | define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { }; 33 | 34 | initialize by copy { readwrite }; 35 | do not initialize { section .noinit }; 36 | 37 | place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec }; 38 | 39 | place in ROM_region { readonly }; 40 | place in RAM_region { readwrite, 41 | block CSTACK, block SVC_STACK, block IRQ_STACK, block FIQ_STACK, 42 | block UND_STACK, block ABT_STACK, block HEAP }; -------------------------------------------------------------------------------- /vsf/example/mscboot/proj/EWARM_GD32/demo.eww: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | $WS_DIR$\demo.ewp 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /vsf/example/mscboot/proj/EWARM_GD32/hw_cfg_GD32.h: -------------------------------------------------------------------------------- 1 | /************************************************************************** 2 | * Copyright (C) 2008 - 2012 by Simon Qian * 3 | * SimonQian@SimonQian.com * 4 | * * 5 | * Project: Versaloon * 6 | * File: hw_cfg_VSFCore_STM32.h * 7 | * Author: SimonQian * 8 | * Versaion: See changelog * 9 | * Purpose: hardware configuration file for VSFCore_STM32 * 10 | * License: See license * 11 | *------------------------------------------------------------------------* 12 | * Change Log: * 13 | * YYYY-MM-DD: What(by Who) * 14 | * 2008-11-07: created(by SimonQian) * 15 | * 2008-11-22: rewrite GPIO_Dir(by SimonQian) * 16 | **************************************************************************/ 17 | 18 | #define OSC_HZ ((uint32_t)8000000) 19 | 20 | #define USB_PULLUP_PORT 1 21 | #define USB_PULLUP_PIN 5 22 | -------------------------------------------------------------------------------- /vsf/example/mscboot/usrapp.h: -------------------------------------------------------------------------------- 1 | struct usrapp_t 2 | { 3 | const struct app_hwcfg_t *hwcfg; 4 | 5 | struct 6 | { 7 | struct vsfscsi_device_t scsi_dev; 8 | struct vsfscsi_lun_t lun[1]; 9 | 10 | struct vsf_scsistream_t scsistream; 11 | struct vsf_mal2scsi_t mal2scsi; 12 | struct vsfmal_t mal; 13 | struct fakefat32_param_t fakefat32; 14 | uint8_t *pbuffer[1]; 15 | uint8_t buffer[1][512]; 16 | } mal; 17 | 18 | struct 19 | { 20 | struct 21 | { 22 | struct vsfusbd_MSCBOT_param_t param; 23 | } msc; 24 | struct vsfusbd_iface_t ifaces[1]; 25 | struct vsfusbd_config_t config[1]; 26 | struct vsfusbd_device_t device; 27 | } usbd; 28 | }; 29 | 30 | extern struct usrapp_t usrapp; 31 | 32 | void usrapp_srt_init(struct usrapp_t *app); 33 | #if defined(APPCFG_USR_POLL) 34 | void usrapp_poll(struct usrapp_t *app); 35 | #endif -------------------------------------------------------------------------------- /vsf/example/vsfusbd/config/app_hw_cfg.h: -------------------------------------------------------------------------------- 1 | struct app_hwcfg_t 2 | { 3 | struct 4 | { 5 | struct vsfhal_gpio_pin_t pullup; 6 | } usbd; 7 | }; 8 | -------------------------------------------------------------------------------- /vsf/example/vsfusbd/proj/EWARM_GD32/GD32.icf: -------------------------------------------------------------------------------- 1 | /*###ICF### Section handled by ICF editor, don't touch! ****/ 2 | /*-Editor annotation file-*/ 3 | /* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\a_v1_0.xml" */ 4 | /*-Specials-*/ 5 | define symbol __ICFEDIT_intvec_start__ = 0x08000000; 6 | /*-Memory Regions-*/ 7 | define symbol __ICFEDIT_region_ROM_start__ = 0x08000000; 8 | define symbol __ICFEDIT_region_ROM_end__ = 0x0803FFFF; 9 | define symbol __ICFEDIT_region_RAM_start__ = 0x20000000; 10 | define symbol __ICFEDIT_region_RAM_end__ = 0x2000FFFF; 11 | /*-Sizes-*/ 12 | define symbol __ICFEDIT_size_cstack__ = 0x400; 13 | define symbol __ICFEDIT_size_svcstack__ = 0; 14 | define symbol __ICFEDIT_size_irqstack__ = 0; 15 | define symbol __ICFEDIT_size_fiqstack__ = 0; 16 | define symbol __ICFEDIT_size_undstack__ = 0; 17 | define symbol __ICFEDIT_size_abtstack__ = 0; 18 | define symbol __ICFEDIT_size_heap__ = 0; 19 | /**** End of ICF editor section. ###ICF###*/ 20 | 21 | 22 | define memory mem with size = 4G; 23 | define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFEDIT_region_ROM_end__]; 24 | define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__]; 25 | 26 | define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { }; 27 | define block SVC_STACK with alignment = 8, size = __ICFEDIT_size_svcstack__ { }; 28 | define block IRQ_STACK with alignment = 8, size = __ICFEDIT_size_irqstack__ { }; 29 | define block FIQ_STACK with alignment = 8, size = __ICFEDIT_size_fiqstack__ { }; 30 | define block UND_STACK with alignment = 8, size = __ICFEDIT_size_undstack__ { }; 31 | define block ABT_STACK with alignment = 8, size = __ICFEDIT_size_abtstack__ { }; 32 | define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { }; 33 | 34 | initialize by copy { readwrite }; 35 | do not initialize { section .noinit }; 36 | 37 | place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec }; 38 | 39 | place in ROM_region { readonly }; 40 | place in RAM_region { readwrite, 41 | block CSTACK, block SVC_STACK, block IRQ_STACK, block FIQ_STACK, 42 | block UND_STACK, block ABT_STACK, block HEAP }; -------------------------------------------------------------------------------- /vsf/example/vsfusbd/proj/EWARM_GD32/demo.eww: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | $WS_DIR$\demo.ewp 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /vsf/example/vsfusbd/proj/EWARM_GD32/hw_cfg_GD32.h: -------------------------------------------------------------------------------- 1 | /************************************************************************** 2 | * Copyright (C) 2008 - 2012 by Simon Qian * 3 | * SimonQian@SimonQian.com * 4 | * * 5 | * Project: Versaloon * 6 | * File: hw_cfg_VSFCore_STM32.h * 7 | * Author: SimonQian * 8 | * Versaion: See changelog * 9 | * Purpose: hardware configuration file for VSFCore_STM32 * 10 | * License: See license * 11 | *------------------------------------------------------------------------* 12 | * Change Log: * 13 | * YYYY-MM-DD: What(by Who) * 14 | * 2008-11-07: created(by SimonQian) * 15 | * 2008-11-22: rewrite GPIO_Dir(by SimonQian) * 16 | **************************************************************************/ 17 | 18 | #define OSC_HZ ((uint32_t)8000000) 19 | 20 | #define USB_PULLUP_PORT 1 21 | #define USB_PULLUP_PIN 5 22 | -------------------------------------------------------------------------------- /vsf/example/vsfusbd/proj/EWARM_NUC400/demo.eww: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | $WS_DIR$\demo.ewp 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /vsf/example/vsfusbd/proj/EWARM_NUC400/hw_cfg_NUC400.h: -------------------------------------------------------------------------------- 1 | /************************************************************************** 2 | * Copyright (C) 2008 - 2012 by Simon Qian * 3 | * SimonQian@SimonQian.com * 4 | * * 5 | * Project: Versaloon * 6 | * File: hw_cfg_VSFCore_STM32.h * 7 | * Author: SimonQian * 8 | * Versaion: See changelog * 9 | * Purpose: hardware configuration file for VSFCore_STM32 * 10 | * License: See license * 11 | *------------------------------------------------------------------------* 12 | * Change Log: * 13 | * YYYY-MM-DD: What(by Who) * 14 | * 2008-11-07: created(by SimonQian) * 15 | * 2008-11-22: rewrite GPIO_Dir(by SimonQian) * 16 | **************************************************************************/ 17 | 18 | #define OSC_HZ ((uint32_t)12000000) 19 | 20 | #define USB_PULLUP_PORT VSFHAL_DUMMY_PORT 21 | #define USB_PULLUP_PIN 0 22 | -------------------------------------------------------------------------------- /vsf/example/vsfusbd/proj/EWARM_NUC400/nuc442.icf: -------------------------------------------------------------------------------- 1 | /*###ICF### Section handled by ICF editor, don't touch! ****/ 2 | /*-Editor annotation file-*/ 3 | /* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */ 4 | /*-Specials-*/ 5 | define symbol __ICFEDIT_intvec_start__ = 0x00000000; 6 | /*-Memory Regions-*/ 7 | define symbol __ICFEDIT_region_ROM_start__ = 0x00000000; 8 | define symbol __ICFEDIT_region_ROM_end__ = 0x00020000; 9 | define symbol __ICFEDIT_region_RAM_start__ = 0x20000000; 10 | define symbol __ICFEDIT_region_RAM_end__ = 0x2000FFFF; 11 | /*-Sizes-*/ 12 | define symbol __ICFEDIT_size_cstack__ = 0x2000; 13 | define symbol __ICFEDIT_size_heap__ = 0x8000; 14 | /**** End of ICF editor section. ###ICF###*/ 15 | 16 | 17 | define memory mem with size = 4G; 18 | define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFEDIT_region_ROM_end__]; 19 | define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__]; 20 | 21 | define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { }; 22 | define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { }; 23 | 24 | initialize by copy { readwrite }; 25 | do not initialize { section .noinit }; 26 | 27 | place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec }; 28 | 29 | place in ROM_region { readonly }; 30 | place in RAM_region { readwrite, 31 | block HEAP,block CSTACK }; -------------------------------------------------------------------------------- /vsf/example/vsfusbd/proj/EWARM_NUC505/demo.eww: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | $WS_DIR$\demo.ewp 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /vsf/example/vsfusbd/proj/EWARM_NUC505/hw_cfg_NUC505.h: -------------------------------------------------------------------------------- 1 | /************************************************************************** 2 | * Copyright (C) 2008 - 2012 by Simon Qian * 3 | * SimonQian@SimonQian.com * 4 | * * 5 | * Project: Versaloon * 6 | * File: hw_cfg_VSFCore_STM32.h * 7 | * Author: SimonQian * 8 | * Versaion: See changelog * 9 | * Purpose: hardware configuration file for VSFCore_STM32 * 10 | * License: See license * 11 | *------------------------------------------------------------------------* 12 | * Change Log: * 13 | * YYYY-MM-DD: What(by Who) * 14 | * 2008-11-07: created(by SimonQian) * 15 | * 2008-11-22: rewrite GPIO_Dir(by SimonQian) * 16 | **************************************************************************/ 17 | 18 | #define OSC_HZ ((uint32_t)12000000) 19 | 20 | #define USB_PULLUP_PORT VSFHAL_DUMMY_PORT 21 | #define USB_PULLUP_PIN 0 22 | -------------------------------------------------------------------------------- /vsf/example/vsfusbd/usrapp.h: -------------------------------------------------------------------------------- 1 | struct usrapp_t 2 | { 3 | const struct app_hwcfg_t *hwcfg; 4 | 5 | #if defined(APPCFG_BUFMGR_SIZE) && (APPCFG_BUFMGR_SIZE > 0) 6 | struct vsfshell_t shell; 7 | #endif 8 | 9 | struct 10 | { 11 | struct vsfscsi_device_t scsi_dev; 12 | struct vsfscsi_lun_t lun[1]; 13 | 14 | struct vsf_scsistream_t scsistream; 15 | struct vsf_mal2scsi_t mal2scsi; 16 | struct vsfmal_t mal; 17 | struct fakefat32_param_t fakefat32; 18 | uint8_t *pbuffer[1]; 19 | uint8_t buffer[1][512]; 20 | } mal; 21 | 22 | struct 23 | { 24 | struct 25 | { 26 | struct vsfusbd_RNDIS_param_t param; 27 | struct vsfip_dhcpd_t dhcpd; 28 | } rndis; 29 | struct 30 | { 31 | struct vsfusbd_MSCBOT_param_t param; 32 | } msc; 33 | struct vsfusbd_iface_t ifaces[3]; 34 | struct vsfusbd_config_t config[1]; 35 | struct vsfusbd_device_t device; 36 | } usbd; 37 | 38 | struct 39 | { 40 | VSFPOOL_DEFINE(buffer_pool, struct vsfip_buffer_t, APPCFG_VSFIP_BUFFER_NUM); 41 | VSFPOOL_DEFINE(socket_pool, struct vsfip_socket_t, APPCFG_VSFIP_SOCKET_NUM); 42 | #if APPCFG_VSFIP_TCPPCB_NUM > 0 43 | VSFPOOL_DEFINE(tcppcb_pool, struct vsfip_tcppcb_t, APPCFG_VSFIP_TCPPCB_NUM); 44 | #endif 45 | uint8_t buffer_mem[APPCFG_VSFIP_BUFFER_NUM][VSFIP_BUFFER_SIZE]; 46 | 47 | struct 48 | { 49 | struct vsfip_telnetd_t telnetd; 50 | struct vsfip_telnetd_session_t sessions[1]; 51 | 52 | struct vsf_fifostream_t stream_tx; 53 | struct vsf_fifostream_t stream_rx; 54 | uint8_t txbuff[65]; 55 | uint8_t rxbuff[65]; 56 | } telnetd; 57 | } tcpip; 58 | }; 59 | 60 | extern struct usrapp_t usrapp; 61 | 62 | void usrapp_srt_init(struct usrapp_t *app); 63 | #if defined(APPCFG_USR_POLL) 64 | void usrapp_poll(struct usrapp_t *app); 65 | #endif -------------------------------------------------------------------------------- /vsf/hal/cpu/cmem7/usart/CMEM7_USART.h: -------------------------------------------------------------------------------- 1 | vsf_err_t cmem7_usart_init(uint8_t index); 2 | vsf_err_t cmem7_usart_fini(uint8_t index); 3 | vsf_err_t cmem7_usart_config(uint8_t index, uint32_t baudrate, uint32_t mode); 4 | vsf_err_t cmem7_usart_config_callback(uint8_t index, uint32_t int_priority, 5 | void *p, void (*ontx)(void *), void (*onrx)(void *, uint16_t)); 6 | uint16_t cmem7_usart_tx_bytes(uint8_t index, uint8_t *data, uint16_t size); 7 | uint16_t cmem7_usart_tx_get_free_size(uint8_t index); 8 | uint16_t cmem7_usart_rx_bytes(uint8_t index, uint8_t *data, uint16_t size); 9 | uint16_t cmem7_usart_rx_get_data_size(uint8_t index); 10 | 11 | -------------------------------------------------------------------------------- /vsf/hal/cpu/cmem7/usb/CMEM7_USB.h: -------------------------------------------------------------------------------- 1 | vsf_err_t cmem7_hcd_init(uint32_t index, vsf_err_t (*irq)(void *), void *param); 2 | vsf_err_t cmem7_hcd_fini(uint32_t index); 3 | void* cmem7_hcd_regbase(uint32_t index); 4 | -------------------------------------------------------------------------------- /vsf/hal/cpu/cmem7/vsf_basetype.h: -------------------------------------------------------------------------------- 1 | #ifndef __VSF_BASETYPE_H_INCLUDED__ 2 | #define __VSF_BASETYPE_H_INCLUDED__ 3 | 4 | // define the most efficient atom integer 5 | typedef int vsf_int_t; 6 | 7 | #endif // __VSF_BASETYPE_H_INCLUDED__ 8 | -------------------------------------------------------------------------------- /vsf/hal/cpu/cmem7/vsfhal_const.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2009 - 2010 by Simon Qian * 3 | * * 4 | * This program is free software; you can redistribute it and/or modify * 5 | * it under the terms of the GNU General Public License as published by * 6 | * the Free Software Foundation; either version 2 of the License, or * 7 | * (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the * 16 | * Free Software Foundation, Inc., * 17 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 18 | ***************************************************************************/ 19 | 20 | #ifndef __VSFHAL_CONST_H_INCLUDED__ 21 | #define __VSFHAL_CONST_H_INCLUDED__ 22 | 23 | // cmem7 usart 24 | #define cmem7_USART_STOPBITS_0P5 (0x0 << 0) 25 | #define cmem7_USART_STOPBITS_1 (0x1 << 0) 26 | #define cmem7_USART_STOPBITS_1P5 (0x2 << 0) 27 | #define cmem7_USART_STOPBITS_2 (0x3 << 0) 28 | #define cmem7_USART_PARITY_NONE (0x0 << 4) 29 | #define cmem7_USART_PARITY_ODD (0x1 << 4) 30 | #define cmem7_USART_PARITY_EVEN (0x2 << 4) 31 | #define cmem7_USART_DATALEN_8 (0x0 << 8) 32 | #define cmem7_USART_DATALEN_9 (0x1 << 8) 33 | 34 | 35 | #endif // __VSFHAL_CONST_H_INCLUDED__ 36 | 37 | -------------------------------------------------------------------------------- /vsf/hal/cpu/cortex-m/startup/iar/startup.s: -------------------------------------------------------------------------------- 1 | SECTION entry:CODE:ROOT(4) 2 | EXTERN module_entry 3 | EXTERN module_exit 4 | DATA 5 | DCD module_entry 6 | DCD module_exit 7 | DCD MODULE_SIZE 8 | DCD MODULE_NAME 9 | END 10 | -------------------------------------------------------------------------------- /vsf/hal/cpu/cortex-m/vsf_basetype.h: -------------------------------------------------------------------------------- 1 | #ifndef __VSF_BASETYPE_H_INCLUDED__ 2 | #define __VSF_BASETYPE_H_INCLUDED__ 3 | 4 | // define the most efficient atom integer 5 | typedef int vsf_int_t; 6 | 7 | #endif // __VSF_BASETYPE_H_INCLUDED__ 8 | -------------------------------------------------------------------------------- /vsf/hal/cpu/cortex-m/vsfhal_const.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2009 - 2010 by Simon Qian * 3 | * * 4 | * This program is free software; you can redistribute it and/or modify * 5 | * it under the terms of the GNU General Public License as published by * 6 | * the Free Software Foundation; either version 2 of the License, or * 7 | * (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the * 16 | * Free Software Foundation, Inc., * 17 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 18 | ***************************************************************************/ 19 | 20 | #ifndef __VSFHAL_CONST_H_INCLUDED__ 21 | #define __VSFHAL_CONST_H_INCLUDED__ 22 | 23 | #define VSF_BASE_ADDR 0x00000200 24 | 25 | #endif // __VSFHAL_CONST_H_INCLUDED__ 26 | -------------------------------------------------------------------------------- /vsf/hal/cpu/gd32f1x0/adc/GD32_ADC.h: -------------------------------------------------------------------------------- 1 | vsf_err_t gd32f1x0_adc_init(uint8_t index, int32_t int_priority); 2 | vsf_err_t gd32f1x0_adc_fini(uint8_t index); 3 | vsf_err_t gd32f1x0_adc_config(uint8_t index, uint32_t clock_hz, uint32_t mode); 4 | vsf_err_t gd32f1x0_adc_config_channel(uint8_t index, uint8_t channel, 5 | uint8_t cycles); 6 | vsf_err_t gd32f1x0_adc_calibrate(uint8_t index, uint8_t channel); 7 | uint32_t gd32f1x0_adc_get_max_value(uint8_t index); 8 | vsf_err_t gd32f1x0_adc_start(uint8_t index, uint8_t channel, 9 | void (callback)(void *, uint16_t), void *param); 10 | -------------------------------------------------------------------------------- /vsf/hal/cpu/gd32f1x0/flash/GD32F1X0_FLASH.h: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /vsf/hal/cpu/gd32f1x0/gpio/GD32F1X0_GPIO.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/versaloon/vsf_orig/387b344c4650415756de776866622b4c5e5266f8/vsf/hal/cpu/gd32f1x0/gpio/GD32F1X0_GPIO.h -------------------------------------------------------------------------------- /vsf/hal/cpu/gd32f1x0/i2c/GD32F1X0_I2C.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/versaloon/vsf_orig/387b344c4650415756de776866622b4c5e5266f8/vsf/hal/cpu/gd32f1x0/i2c/GD32F1X0_I2C.h -------------------------------------------------------------------------------- /vsf/hal/cpu/gd32f1x0/pwm/GD32F1X0_PWM.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/versaloon/vsf_orig/387b344c4650415756de776866622b4c5e5266f8/vsf/hal/cpu/gd32f1x0/pwm/GD32F1X0_PWM.h -------------------------------------------------------------------------------- /vsf/hal/cpu/gd32f1x0/usbdio/GD32F1X0_USBDIO.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/versaloon/vsf_orig/387b344c4650415756de776866622b4c5e5266f8/vsf/hal/cpu/gd32f1x0/usbdio/GD32F1X0_USBDIO.h -------------------------------------------------------------------------------- /vsf/hal/cpu/gd32f1x0/vsf_basetype.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef __VSF_BASETYPE_H_INCLUDED__ 3 | #define __VSF_BASETYPE_H_INCLUDED__ 4 | 5 | // define the most efficient atom integer 6 | typedef int vsf_int_t; 7 | 8 | #endif // __VSF_BASETYPE_H_INCLUDED__ 9 | -------------------------------------------------------------------------------- /vsf/hal/cpu/nuc400/NUC472_442.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/versaloon/vsf_orig/387b344c4650415756de776866622b4c5e5266f8/vsf/hal/cpu/nuc400/NUC472_442.h -------------------------------------------------------------------------------- /vsf/hal/cpu/nuc400/gpio/NUC400_GPIO.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2009 - 2010 by Simon Qian * 3 | * * 4 | * This program is free software; you can redistribute it and/or modify * 5 | * it under the terms of the GNU General Public License as published by * 6 | * the Free Software Foundation; either version 2 of the License, or * 7 | * (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the * 16 | * Free Software Foundation, Inc., * 17 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 18 | ***************************************************************************/ 19 | 20 | vsf_err_t stm32_gpio_init(uint8_t index); 21 | vsf_err_t stm32_gpio_fini(uint8_t index); 22 | vsf_err_t stm32_gpio_config_pin(uint8_t index, uint8_t pin_idx, uint32_t mode); 23 | vsf_err_t stm32_gpio_config(uint8_t index, uint32_t pin_mask, uint32_t io, 24 | uint32_t pull_en_mask, uint32_t input_pull_mask); 25 | vsf_err_t stm32_gpio_set(uint8_t index, uint32_t pin_mask); 26 | vsf_err_t stm32_gpio_clear(uint8_t index, uint32_t pin_mask); 27 | vsf_err_t stm32_gpio_out(uint8_t index, uint32_t pin_mask, uint32_t value); 28 | vsf_err_t stm32_gpio_in(uint8_t index, uint32_t pin_mask, uint32_t *value); 29 | uint32_t stm32_gpio_get(uint8_t index, uint32_t pin_mask); 30 | -------------------------------------------------------------------------------- /vsf/hal/cpu/nuc400/vsf_basetype.h: -------------------------------------------------------------------------------- 1 | #ifndef __VSF_BASETYPE_H_INCLUDED__ 2 | #define __VSF_BASETYPE_H_INCLUDED__ 3 | 4 | // define the most efficient atom integer 5 | typedef int vsf_int_t; 6 | 7 | #endif // __VSF_BASETYPE_H_INCLUDED__ 8 | -------------------------------------------------------------------------------- /vsf/hal/cpu/nuc505/adc/NUC505_ADC.h: -------------------------------------------------------------------------------- 1 | vsf_err_t nuc505_adc_init(uint8_t index); 2 | vsf_err_t nuc505_adc_fini(uint8_t index); 3 | 4 | vsf_err_t nuc505_adc_start(uint8_t index, uint8_t channel, void (*callback)(void *, uint16_t), void *param); 5 | 6 | //vsf_err_t nuc505_adc_config(uint8_t index, uint32_t clock_hz, uint32_t mode); 7 | vsf_err_t nuc505_adc_config_channel(uint8_t index, uint8_t channel, 8 | uint8_t cycles); 9 | /* 10 | vsf_err_t nuc505_adc_calibrate(uint8_t index, uint8_t channel); 11 | uint32_t nuc505_adc_get_max_value(uint8_t index); 12 | vsf_err_t nuc505_adc_isready(uint8_t index, uint8_t channel); 13 | uint32_t nuc505_adc_get(uint8_t index, uint8_t channel); 14 | */ 15 | -------------------------------------------------------------------------------- /vsf/hal/cpu/nuc505/eint/NUC505_EINT.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2009 - 2010 by Simon Qian * 3 | * * 4 | * This program is free software; you can redistribute it and/or modify * 5 | * it under the terms of the GNU General Public License as published by * 6 | * the Free Software Foundation; either version 2 of the License, or * 7 | * (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the * 16 | * Free Software Foundation, Inc., * 17 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 18 | ***************************************************************************/ 19 | 20 | vsf_err_t nuc505_eint_init(uint32_t index); 21 | vsf_err_t nuc505_eint_fini(uint32_t index); 22 | vsf_err_t nuc505_eint_config(uint32_t index, uint32_t type, 23 | uint32_t int_priority, void *param, void (*callback)(void *param)); 24 | vsf_err_t nuc505_eint_enable(uint32_t index); 25 | vsf_err_t nuc505_eint_disable(uint32_t index); 26 | -------------------------------------------------------------------------------- /vsf/hal/cpu/nuc505/gpio/NUC505_GPIO.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2009 - 2010 by Simon Qian * 3 | * * 4 | * This program is free software; you can redistribute it and/or modify * 5 | * it under the terms of the GNU General Public License as published by * 6 | * the Free Software Foundation; either version 2 of the License, or * 7 | * (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the * 16 | * Free Software Foundation, Inc., * 17 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 18 | ***************************************************************************/ 19 | 20 | vsf_err_t nuc505_gpio_init(uint8_t index); 21 | vsf_err_t nuc505_gpio_fini(uint8_t index); 22 | vsf_err_t nuc505_gpio_config_pin(uint8_t index, uint8_t pin_idx, uint32_t mode); 23 | vsf_err_t nuc505_gpio_config(uint8_t index, uint32_t pin_mask, uint32_t io, 24 | uint32_t pull_en_mask, uint32_t input_pull_mask); 25 | vsf_err_t nuc505_gpio_set(uint8_t index, uint32_t pin_mask); 26 | vsf_err_t nuc505_gpio_clear(uint8_t index, uint32_t pin_mask); 27 | vsf_err_t nuc505_gpio_out(uint8_t index, uint32_t pin_mask, uint32_t value); 28 | vsf_err_t nuc505_gpio_in(uint8_t index, uint32_t pin_mask, uint32_t *value); 29 | uint32_t nuc505_gpio_get(uint8_t index, uint32_t pin_mask); 30 | -------------------------------------------------------------------------------- /vsf/hal/cpu/nuc505/i2c/NUC505_I2C.h: -------------------------------------------------------------------------------- 1 | vsf_err_t nuc505_i2c_init(uint8_t index); 2 | vsf_err_t nuc505_i2c_fini(uint8_t index); 3 | vsf_err_t nuc505_i2c_config(uint8_t index, uint16_t kHz, void *param, 4 | void (*callback)(void *, int32_t, int32_t)); 5 | vsf_err_t nuc505_i2c_xfer(uint8_t index, uint16_t chip_addr, 6 | struct vsfi2c_msg_t *msg, uint16_t msg_len); 7 | 8 | -------------------------------------------------------------------------------- /vsf/hal/cpu/nuc505/ohci/NUC505_OHCI.h: -------------------------------------------------------------------------------- 1 | vsf_err_t nuc505_hcd_init(uint32_t index, vsf_err_t (*ohci_irq)(void *), void *param); 2 | vsf_err_t nuc505_hcd_fini(uint32_t index); 3 | void* nuc505_hcd_regbase(uint32_t index); 4 | -------------------------------------------------------------------------------- /vsf/hal/cpu/nuc505/sdio/NUC505_SDIO.h: -------------------------------------------------------------------------------- 1 | vsf_err_t nuc505_sdio_init(uint8_t index); 2 | vsf_err_t nuc505_sdio_fini(uint8_t index); 3 | vsf_err_t nuc505_sdio_config(uint8_t index, uint32_t kHz, uint8_t buswidth, 4 | void (*callback)(void *), void *param); 5 | vsf_err_t nuc505_sdio_start(uint8_t index, uint8_t cmd, uint32_t arg, 6 | struct sdio_info_t *extra_param); 7 | vsf_err_t nuc505_sdio_stop(uint8_t index); 8 | vsf_err_t nuc505_sdio_config_int(uint8_t index, void (*callback)(void *param), 9 | void *param); 10 | vsf_err_t nuc505_sdio_enable_int(uint8_t index); 11 | 12 | -------------------------------------------------------------------------------- /vsf/hal/cpu/nuc505/spi/NUC505_SPI.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2009 - 2010 by Simon Qian * 3 | * * 4 | * This program is free software; you can redistribute it and/or modify * 5 | * it under the terms of the GNU General Public License as published by * 6 | * the Free Software Foundation; either version 2 of the License, or * 7 | * (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the * 16 | * Free Software Foundation, Inc., * 17 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 18 | ***************************************************************************/ 19 | 20 | vsf_err_t nuc505_spi_init(uint8_t index); 21 | vsf_err_t nuc505_spi_fini(uint8_t index); 22 | vsf_err_t nuc505_spi_get_ability(uint8_t index, struct spi_ability_t *ability); 23 | vsf_err_t nuc505_spi_enable(uint8_t index); 24 | vsf_err_t nuc505_spi_disable(uint8_t index); 25 | vsf_err_t nuc505_spi_config(uint8_t index, uint32_t kHz, uint32_t mode); 26 | vsf_err_t nuc505_spi_config_cb(uint8_t index, uint32_t int_priority, 27 | void *p, void (*onready)(void *)); 28 | vsf_err_t nuc505_spi_select(uint8_t index, uint8_t cs); 29 | vsf_err_t nuc505_spi_deselect(uint8_t index, uint8_t cs); 30 | vsf_err_t nuc505_spi_start(uint8_t index, uint8_t *out, uint8_t *in, 31 | uint32_t len); 32 | uint32_t nuc505_spi_stop(uint8_t index); 33 | -------------------------------------------------------------------------------- /vsf/hal/cpu/nuc505/spirom/NUC505_SPIROM.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2009 - 2010 by Simon Qian * 3 | * * 4 | * This program is free software; you can redistribute it and/or modify * 5 | * it under the terms of the GNU General Public License as published by * 6 | * the Free Software Foundation; either version 2 of the License, or * 7 | * (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the * 16 | * Free Software Foundation, Inc., * 17 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 18 | ***************************************************************************/ 19 | 20 | vsf_err_t nuc505_spirom_init(void); 21 | vsf_err_t nuc505_spirom_fini(void); 22 | vsf_err_t nuc505_spirom_erase(uint32_t addr, uint32_t len); 23 | vsf_err_t nuc505_spirom_write(uint8_t *buf, uint32_t addr, uint32_t len); 24 | vsf_err_t nuc505_spirom_read(uint8_t *buf, uint32_t addr, uint32_t len); 25 | 26 | -------------------------------------------------------------------------------- /vsf/hal/cpu/nuc505/uart/NUC505_USART.h: -------------------------------------------------------------------------------- 1 | vsf_err_t nuc505_usart_init(uint8_t index); 2 | vsf_err_t nuc505_usart_fini(uint8_t index); 3 | vsf_err_t nuc505_usart_config(uint8_t index, uint32_t baudrate, uint32_t mode); 4 | vsf_err_t nuc505_usart_config_cb(uint8_t index, uint32_t int_priority, 5 | void *p, void (*ontx)(void *), void (*onrx)(void *, uint16_t)); 6 | vsf_err_t nuc505_usart_tx(uint8_t index, uint16_t data); 7 | vsf_err_t nuc505_usart_tx_isready(uint8_t index); 8 | uint16_t nuc505_usart_rx(uint8_t index); 9 | vsf_err_t nuc505_usart_rx_isready(uint8_t index); 10 | uint16_t nuc505_usart_tx_bytes(uint8_t index, uint8_t *data, uint16_t size); 11 | uint16_t nuc505_usart_tx_get_free_size(uint8_t index); 12 | uint16_t nuc505_usart_rx_bytes(uint8_t index, uint8_t *data, uint16_t size); 13 | uint16_t nuc505_usart_rx_get_data_size(uint8_t index); 14 | 15 | -------------------------------------------------------------------------------- /vsf/hal/cpu/nuc505/vsf_basetype.h: -------------------------------------------------------------------------------- 1 | #ifndef __VSF_BASETYPE_H_INCLUDED__ 2 | #define __VSF_BASETYPE_H_INCLUDED__ 3 | 4 | // define the most efficient atom integer 5 | typedef int vsf_int_t; 6 | 7 | #endif // __VSF_BASETYPE_H_INCLUDED__ 8 | -------------------------------------------------------------------------------- /vsf/hal/cpu/nv32/driver/ics/ics.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/versaloon/vsf_orig/387b344c4650415756de776866622b4c5e5266f8/vsf/hal/cpu/nv32/driver/ics/ics.c -------------------------------------------------------------------------------- /vsf/hal/cpu/nv32/driver/ics/ics.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/versaloon/vsf_orig/387b344c4650415756de776866622b4c5e5266f8/vsf/hal/cpu/nv32/driver/ics/ics.h -------------------------------------------------------------------------------- /vsf/hal/cpu/nv32/driver/isr.h: -------------------------------------------------------------------------------- 1 | #include "vsfhal.h" 2 | 3 | #if VSFHAL_USBDIO_EN 4 | # undef VECTOR_023 5 | # define VECTOR_023 USBDIO_DP_Handler 6 | void USBDIO_DP_Handler(void); 7 | #endif 8 | -------------------------------------------------------------------------------- /vsf/hal/cpu/nv32/driver/vector/vectors.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/versaloon/vsf_orig/387b344c4650415756de776866622b4c5e5266f8/vsf/hal/cpu/nv32/driver/vector/vectors.c -------------------------------------------------------------------------------- /vsf/hal/cpu/nv32/gpio/NV32_GPIO.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/versaloon/vsf_orig/387b344c4650415756de776866622b4c5e5266f8/vsf/hal/cpu/nv32/gpio/NV32_GPIO.h -------------------------------------------------------------------------------- /vsf/hal/cpu/nv32/usbdio/NV32_USBDIO.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/versaloon/vsf_orig/387b344c4650415756de776866622b4c5e5266f8/vsf/hal/cpu/nv32/usbdio/NV32_USBDIO.h -------------------------------------------------------------------------------- /vsf/hal/cpu/nv32/vsf_basetype.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef __VSF_BASETYPE_H_INCLUDED__ 3 | #define __VSF_BASETYPE_H_INCLUDED__ 4 | 5 | // define the most efficient atom integer 6 | typedef int vsf_int_t; 7 | 8 | #endif // __VSF_BASETYPE_H_INCLUDED__ 9 | -------------------------------------------------------------------------------- /vsf/hal/cpu/nv32/vsfhal_const.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2009 - 2010 by Simon Qian * 3 | * * 4 | * This program is free software; you can redistribute it and/or modify * 5 | * it under the terms of the GNU General Public License as published by * 6 | * the Free Software Foundation; either version 2 of the License, or * 7 | * (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the * 16 | * Free Software Foundation, Inc., * 17 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 18 | ***************************************************************************/ 19 | 20 | #ifndef __VSFHAL_CONST_H_INCLUDED__ 21 | #define __VSFHAL_CONST_H_INCLUDED__ 22 | 23 | #include "core.h" 24 | #include "NV32.h" 25 | 26 | #define nv32_SLEEP_WFI 0 27 | #define nv32_SLEEP_PWRDOWN 1 28 | 29 | #define nv32_GPIO_INFLOAT 0x00 30 | #define nv32_GPIO_INPU 0x02 31 | #define nv32_GPIO_INPD 0x00 32 | #define nv32_GPIO_OUTPP 0x01 33 | #define nv32_GPIO_OUTOD 0x03 34 | 35 | #endif // __VSFHAL_CONST_H_INCLUDED__ 36 | -------------------------------------------------------------------------------- /vsf/hal/cpu/stm32/adc/STM32_ADC.h: -------------------------------------------------------------------------------- 1 | vsf_err_t stm32_adc_init(uint8_t index); 2 | vsf_err_t stm32_adc_fini(uint8_t index); 3 | vsf_err_t stm32_adc_config(uint8_t index, uint32_t clock_hz, uint32_t mode); 4 | vsf_err_t stm32_adc_config_channel(uint8_t index, uint8_t channel, 5 | uint8_t cycles); 6 | vsf_err_t stm32_adc_calibrate(uint8_t index, uint8_t channel); 7 | uint32_t stm32_adc_get_max_value(uint8_t index); 8 | vsf_err_t stm32_adc_start(uint8_t index, uint8_t channel, 9 | void (callback)(void *, uint16_t), void *param); 10 | -------------------------------------------------------------------------------- /vsf/hal/cpu/stm32/clko/STM32_CLKO.h: -------------------------------------------------------------------------------- 1 | vsf_err_t stm32_clko_init(uint8_t index); 2 | vsf_err_t stm32_clko_fini(uint8_t index); 3 | vsf_err_t stm32_clko_config(uint8_t index, uint32_t kHz); 4 | vsf_err_t stm32_clko_enable(uint8_t index); 5 | vsf_err_t stm32_clko_disable(uint8_t index); 6 | -------------------------------------------------------------------------------- /vsf/hal/cpu/stm32/eint/STM32_EINT.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2009 - 2010 by Simon Qian * 3 | * * 4 | * This program is free software; you can redistribute it and/or modify * 5 | * it under the terms of the GNU General Public License as published by * 6 | * the Free Software Foundation; either version 2 of the License, or * 7 | * (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the * 16 | * Free Software Foundation, Inc., * 17 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 18 | ***************************************************************************/ 19 | 20 | vsf_err_t stm32_eint_init(uint32_t index); 21 | vsf_err_t stm32_eint_fini(uint32_t index); 22 | vsf_err_t stm32_eint_config(uint32_t index, uint32_t type, 23 | uint32_t int_priority, void *param, void (*callback)(void *param)); 24 | vsf_err_t stm32_eint_enable(uint32_t index); 25 | vsf_err_t stm32_eint_disable(uint32_t index); 26 | vsf_err_t stm32_eint_trigger(uint32_t index); 27 | -------------------------------------------------------------------------------- /vsf/hal/cpu/stm32/flash/STM32_FLASH.h: -------------------------------------------------------------------------------- 1 | vsf_err_t stm32_flash_init(uint8_t index); 2 | vsf_err_t stm32_flash_fini(uint8_t index); 3 | 4 | vsf_err_t stm32_flash_capacity(uint8_t index, uint32_t *pagesize, 5 | uint32_t *pagenum); 6 | uint32_t stm32_flash_baseaddr(uint8_t index); 7 | uint32_t stm32_flash_blocksize(uint8_t index, uint32_t addr, uint32_t size, 8 | int op); 9 | vsf_err_t stm32_flash_config_cb(uint8_t index, uint32_t int_priority, 10 | void *param, void (*onfinish)(void*, vsf_err_t)); 11 | 12 | vsf_err_t stm32_flash_erase(uint8_t index, uint32_t offset); 13 | vsf_err_t stm32_flash_read(uint8_t index, uint32_t offset, uint8_t *buff); 14 | vsf_err_t stm32_flash_write(uint8_t index, uint32_t offset, uint8_t *buff); 15 | 16 | extern const bool stm32_flash_direct_read; 17 | -------------------------------------------------------------------------------- /vsf/hal/cpu/stm32/gpio/STM32_GPIO.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2009 - 2010 by Simon Qian * 3 | * * 4 | * This program is free software; you can redistribute it and/or modify * 5 | * it under the terms of the GNU General Public License as published by * 6 | * the Free Software Foundation; either version 2 of the License, or * 7 | * (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the * 16 | * Free Software Foundation, Inc., * 17 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 18 | ***************************************************************************/ 19 | 20 | vsf_err_t stm32_gpio_init(uint8_t index); 21 | vsf_err_t stm32_gpio_fini(uint8_t index); 22 | vsf_err_t stm32_gpio_config_pin(uint8_t index, uint8_t pin_idx, uint32_t mode); 23 | vsf_err_t stm32_gpio_config(uint8_t index, uint32_t pin_mask, uint32_t io, 24 | uint32_t pull_en_mask, uint32_t input_pull_mask); 25 | vsf_err_t stm32_gpio_set(uint8_t index, uint32_t pin_mask); 26 | vsf_err_t stm32_gpio_clear(uint8_t index, uint32_t pin_mask); 27 | vsf_err_t stm32_gpio_out(uint8_t index, uint32_t pin_mask, uint32_t value); 28 | vsf_err_t stm32_gpio_in(uint8_t index, uint32_t pin_mask, uint32_t *value); 29 | uint32_t stm32_gpio_get(uint8_t index, uint32_t pin_mask); 30 | -------------------------------------------------------------------------------- /vsf/hal/cpu/stm32/spi/STM32_SPI.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2009 - 2010 by Simon Qian * 3 | * * 4 | * This program is free software; you can redistribute it and/or modify * 5 | * it under the terms of the GNU General Public License as published by * 6 | * the Free Software Foundation; either version 2 of the License, or * 7 | * (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the * 16 | * Free Software Foundation, Inc., * 17 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 18 | ***************************************************************************/ 19 | 20 | vsf_err_t stm32_spi_init(uint8_t index); 21 | vsf_err_t stm32_spi_fini(uint8_t index); 22 | vsf_err_t stm32_spi_get_ability(uint8_t index, struct spi_ability_t *ability); 23 | vsf_err_t stm32_spi_enable(uint8_t index); 24 | vsf_err_t stm32_spi_disable(uint8_t index); 25 | vsf_err_t stm32_spi_config(uint8_t index, uint32_t kHz, uint32_t mode); 26 | vsf_err_t stm32_spi_config_cb(uint8_t index, uint32_t int_priority, 27 | void *p, void (*onready)(void *)); 28 | vsf_err_t stm32_spi_select(uint8_t index, uint8_t cs); 29 | vsf_err_t stm32_spi_deselect(uint8_t index, uint8_t cs); 30 | vsf_err_t stm32_spi_start(uint8_t index, uint8_t *out, uint8_t *in, 31 | uint32_t len); 32 | uint32_t stm32_spi_stop(uint8_t index); 33 | -------------------------------------------------------------------------------- /vsf/hal/cpu/stm32/stm32f10x.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/versaloon/vsf_orig/387b344c4650415756de776866622b4c5e5266f8/vsf/hal/cpu/stm32/stm32f10x.h -------------------------------------------------------------------------------- /vsf/hal/cpu/stm32/timer/STM32_TIM.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2009 - 2010 by Simon Qian * 3 | * * 4 | * This program is free software; you can redistribute it and/or modify * 5 | * it under the terms of the GNU General Public License as published by * 6 | * the Free Software Foundation; either version 2 of the License, or * 7 | * (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the * 16 | * Free Software Foundation, Inc., * 17 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 18 | ***************************************************************************/ 19 | 20 | vsf_err_t stm32_timer_init(uint8_t index); 21 | vsf_err_t stm32_timer_fini(uint8_t index); 22 | vsf_err_t stm32_timer_config(uint8_t index, uint32_t kHz, uint32_t mode, 23 | void (*overflow)(void)); 24 | vsf_err_t stm32_timer_start(uint8_t index); 25 | vsf_err_t stm32_timer_stop(uint8_t index); 26 | vsf_err_t stm32_timer_get_count(uint8_t index, uint32_t *count); 27 | vsf_err_t stm32_timer_set_count(uint8_t index, uint32_t count); 28 | vsf_err_t stm32_timer_config_channel(uint8_t index, uint8_t channel, 29 | uint32_t mode, void (*callback)(void)); 30 | vsf_err_t stm32_timer_get_channel(uint8_t index, uint8_t channel, 31 | uint32_t *count); 32 | vsf_err_t stm32_timer_set_channel(uint8_t index, uint8_t channel, 33 | uint32_t count); 34 | -------------------------------------------------------------------------------- /vsf/hal/cpu/stm32/usart/STM32_USART.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2009 - 2010 by Simon Qian * 3 | * * 4 | * This program is free software; you can redistribute it and/or modify * 5 | * it under the terms of the GNU General Public License as published by * 6 | * the Free Software Foundation; either version 2 of the License, or * 7 | * (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the * 16 | * Free Software Foundation, Inc., * 17 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 18 | ***************************************************************************/ 19 | 20 | vsf_err_t stm32_usart_init(uint8_t index); 21 | vsf_err_t stm32_usart_fini(uint8_t index); 22 | vsf_err_t stm32_usart_config(uint8_t index, uint32_t baudrate, uint32_t mode); 23 | vsf_err_t stm32_usart_config_callback(uint8_t index, uint32_t int_priority, 24 | void *p, void (*ontx)(void *), void (*onrx)(void *, uint16_t)); 25 | vsf_err_t stm32_usart_tx(uint8_t index, uint16_t data); 26 | uint16_t stm32_usart_rx(uint8_t index); 27 | -------------------------------------------------------------------------------- /vsf/hal/cpu/stm32/vsf_basetype.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef __VSF_BASETYPE_H_INCLUDED__ 3 | #define __VSF_BASETYPE_H_INCLUDED__ 4 | 5 | // define the most efficient atom integer 6 | typedef int vsf_int_t; 7 | 8 | #endif // __VSF_BASETYPE_H_INCLUDED__ 9 | -------------------------------------------------------------------------------- /vsf/hal/cpu/stm32f4/gpio/STM32F4_GPIO.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2009 - 2010 by Simon Qian * 3 | * * 4 | * This program is free software; you can redistribute it and/or modify * 5 | * it under the terms of the GNU General Public License as published by * 6 | * the Free Software Foundation; either version 2 of the License, or * 7 | * (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the * 16 | * Free Software Foundation, Inc., * 17 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 18 | ***************************************************************************/ 19 | 20 | vsf_err_t stm32f4_gpio_init(uint8_t index); 21 | vsf_err_t stm32f4_gpio_fini(uint8_t index); 22 | vsf_err_t stm32f4_gpio_config_pin(uint8_t index, uint8_t pin_idx, uint8_t mode); 23 | vsf_err_t stm32f4_gpio_config(uint8_t index, uint32_t pin_mask, uint32_t io, 24 | uint32_t pull_en_mask, uint32_t input_pull_mask); 25 | vsf_err_t stm32f4_gpio_set(uint8_t index, uint32_t pin_mask); 26 | vsf_err_t stm32f4_gpio_clear(uint8_t index, uint32_t pin_mask); 27 | vsf_err_t stm32f4_gpio_out(uint8_t index, uint32_t pin_mask, uint32_t value); 28 | vsf_err_t stm32f4_gpio_in(uint8_t index, uint32_t pin_mask, uint32_t *value); 29 | uint32_t stm32f4_gpio_get(uint8_t index, uint32_t pin_mask); 30 | -------------------------------------------------------------------------------- /vsf/hal/cpu/stm32f4/stm32f401xc.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/versaloon/vsf_orig/387b344c4650415756de776866622b4c5e5266f8/vsf/hal/cpu/stm32f4/stm32f401xc.h -------------------------------------------------------------------------------- /vsf/hal/cpu/stm32f4/stm32f401xe.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/versaloon/vsf_orig/387b344c4650415756de776866622b4c5e5266f8/vsf/hal/cpu/stm32f4/stm32f401xe.h -------------------------------------------------------------------------------- /vsf/hal/cpu/stm32f4/stm32f405xx.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/versaloon/vsf_orig/387b344c4650415756de776866622b4c5e5266f8/vsf/hal/cpu/stm32f4/stm32f405xx.h -------------------------------------------------------------------------------- /vsf/hal/cpu/stm32f4/stm32f407xx.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/versaloon/vsf_orig/387b344c4650415756de776866622b4c5e5266f8/vsf/hal/cpu/stm32f4/stm32f407xx.h -------------------------------------------------------------------------------- /vsf/hal/cpu/stm32f4/stm32f410cx.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/versaloon/vsf_orig/387b344c4650415756de776866622b4c5e5266f8/vsf/hal/cpu/stm32f4/stm32f410cx.h -------------------------------------------------------------------------------- /vsf/hal/cpu/stm32f4/stm32f410rx.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/versaloon/vsf_orig/387b344c4650415756de776866622b4c5e5266f8/vsf/hal/cpu/stm32f4/stm32f410rx.h -------------------------------------------------------------------------------- /vsf/hal/cpu/stm32f4/stm32f410tx.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/versaloon/vsf_orig/387b344c4650415756de776866622b4c5e5266f8/vsf/hal/cpu/stm32f4/stm32f410tx.h -------------------------------------------------------------------------------- /vsf/hal/cpu/stm32f4/stm32f411xe.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/versaloon/vsf_orig/387b344c4650415756de776866622b4c5e5266f8/vsf/hal/cpu/stm32f4/stm32f411xe.h -------------------------------------------------------------------------------- /vsf/hal/cpu/stm32f4/stm32f415xx.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/versaloon/vsf_orig/387b344c4650415756de776866622b4c5e5266f8/vsf/hal/cpu/stm32f4/stm32f415xx.h -------------------------------------------------------------------------------- /vsf/hal/cpu/stm32f4/stm32f417xx.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/versaloon/vsf_orig/387b344c4650415756de776866622b4c5e5266f8/vsf/hal/cpu/stm32f4/stm32f417xx.h -------------------------------------------------------------------------------- /vsf/hal/cpu/stm32f4/stm32f427xx.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/versaloon/vsf_orig/387b344c4650415756de776866622b4c5e5266f8/vsf/hal/cpu/stm32f4/stm32f427xx.h -------------------------------------------------------------------------------- /vsf/hal/cpu/stm32f4/stm32f429xx.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/versaloon/vsf_orig/387b344c4650415756de776866622b4c5e5266f8/vsf/hal/cpu/stm32f4/stm32f429xx.h -------------------------------------------------------------------------------- /vsf/hal/cpu/stm32f4/stm32f437xx.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/versaloon/vsf_orig/387b344c4650415756de776866622b4c5e5266f8/vsf/hal/cpu/stm32f4/stm32f437xx.h -------------------------------------------------------------------------------- /vsf/hal/cpu/stm32f4/stm32f439xx.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/versaloon/vsf_orig/387b344c4650415756de776866622b4c5e5266f8/vsf/hal/cpu/stm32f4/stm32f439xx.h -------------------------------------------------------------------------------- /vsf/hal/cpu/stm32f4/stm32f446xx.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/versaloon/vsf_orig/387b344c4650415756de776866622b4c5e5266f8/vsf/hal/cpu/stm32f4/stm32f446xx.h -------------------------------------------------------------------------------- /vsf/hal/cpu/stm32f4/stm32f469xx.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/versaloon/vsf_orig/387b344c4650415756de776866622b4c5e5266f8/vsf/hal/cpu/stm32f4/stm32f469xx.h -------------------------------------------------------------------------------- /vsf/hal/cpu/stm32f4/stm32f479xx.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/versaloon/vsf_orig/387b344c4650415756de776866622b4c5e5266f8/vsf/hal/cpu/stm32f4/stm32f479xx.h -------------------------------------------------------------------------------- /vsf/hal/cpu/stm32f4/stm32f4xx.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/versaloon/vsf_orig/387b344c4650415756de776866622b4c5e5266f8/vsf/hal/cpu/stm32f4/stm32f4xx.h -------------------------------------------------------------------------------- /vsf/hal/cpu/stm32f4/usart/STM32_USART.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2009 - 2010 by Simon Qian * 3 | * * 4 | * This program is free software; you can redistribute it and/or modify * 5 | * it under the terms of the GNU General Public License as published by * 6 | * the Free Software Foundation; either version 2 of the License, or * 7 | * (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the * 16 | * Free Software Foundation, Inc., * 17 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 18 | ***************************************************************************/ 19 | 20 | vsf_err_t stm32_usart_init(uint8_t index); 21 | vsf_err_t stm32_usart_fini(uint8_t index); 22 | vsf_err_t stm32_usart_config(uint8_t index, uint32_t baudrate, uint32_t mode); 23 | vsf_err_t stm32_usart_config_callback(uint8_t index, uint32_t int_priority, 24 | void *p, void (*ontx)(void *), void (*onrx)(void *, uint16_t)); 25 | vsf_err_t stm32_usart_tx(uint8_t index, uint16_t data); 26 | uint16_t stm32_usart_rx(uint8_t index); 27 | -------------------------------------------------------------------------------- /vsf/hal/cpu/stm32f4/usb/usb.h: -------------------------------------------------------------------------------- 1 | vsf_err_t stm32f4_hcd_init(uint32_t index, vsf_err_t (*irq)(void *), void *param); 2 | vsf_err_t stm32f4_hcd_fini(uint32_t index); 3 | void* stm32f4_hcd_regbase(uint32_t index); -------------------------------------------------------------------------------- /vsf/hal/cpu/stm32f4/vsf_basetype.h: -------------------------------------------------------------------------------- 1 | #ifndef __VSF_BASETYPE_H_INCLUDED__ 2 | #define __VSF_BASETYPE_H_INCLUDED__ 3 | 4 | // define the most efficient atom integer 5 | typedef int vsf_int_t; 6 | 7 | #endif // __VSF_BASETYPE_H_INCLUDED__ 8 | -------------------------------------------------------------------------------- /vsf/hal/cpu/stm32f7/core.h: -------------------------------------------------------------------------------- 1 | #ifndef __STM32F7_CORE_H_INCLUDED__ 2 | #define __STM32F7_CORE_H_INCLUDED__ 3 | 4 | #define STM32F7_CLK_HSI (1UL << 0) 5 | #define STM32F7_CLK_HSE (1UL << 1) 6 | #define STM32F7_CLK_PLL (1UL << 2) 7 | 8 | enum stm32f7_hclksrc_t 9 | { 10 | STM32F7_HCLKSRC_HSI = 0, 11 | STM32F7_HCLKSRC_HSE = 1, 12 | STM32F7_HCLKSRC_PLL = 2 13 | }; 14 | 15 | enum stm32f7_pllsrc_t 16 | { 17 | STM32F7_PLLSRC_HSI = 0, 18 | STM32F7_PLLSRC_HSE = 1, 19 | }; 20 | 21 | struct stm32f7_info_t 22 | { 23 | uint8_t priority_group; 24 | uint32_t vector_table; 25 | 26 | uint32_t clk_enable; 27 | 28 | enum stm32f7_hclksrc_t hclksrc; 29 | enum stm32f7_pllsrc_t pllsrc; 30 | 31 | uint32_t hsi_freq_hz; 32 | uint32_t hse_freq_hz; 33 | uint32_t pll_freq_hz; 34 | uint32_t hclk_freq_hz; 35 | uint32_t pclk1_freq_hz; 36 | uint32_t pclk2_freq_hz; 37 | }; 38 | 39 | vsf_err_t stm32f7_init(void *p); 40 | vsf_err_t stm32f7_fini(void *p); 41 | vsf_err_t stm32f7_reset(void *p); 42 | uint32_t stm32f7_get_stack(void); 43 | vsf_err_t stm32f7_set_stack(uint32_t sp); 44 | void stm32f7_sleep(uint32_t mode); 45 | vsf_err_t stm32f7_pendsv_config(void (*on_pendsv)(void *), void *param); 46 | vsf_err_t stm32f7_pendsv_trigger(void); 47 | 48 | vsf_err_t stm32f7_tickclk_init(int32_t int_priotiry); 49 | vsf_err_t stm32f7_tickclk_fini(void); 50 | void stm32f7_tickclk_poll(void); 51 | vsf_err_t stm32f7_tickclk_start(void); 52 | vsf_err_t stm32f7_tickclk_stop(void); 53 | uint32_t stm32f7_tickclk_get_count(void); 54 | vsf_err_t stm32f7_tickclk_config_cb(void (*callback)(void *), void *param); 55 | 56 | #endif // __STM32F7_CORE_H_INCLUDED__ 57 | -------------------------------------------------------------------------------- /vsf/hal/cpu/stm32f7/stm32f745xx.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/versaloon/vsf_orig/387b344c4650415756de776866622b4c5e5266f8/vsf/hal/cpu/stm32f7/stm32f745xx.h -------------------------------------------------------------------------------- /vsf/hal/cpu/stm32f7/stm32f746xx.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/versaloon/vsf_orig/387b344c4650415756de776866622b4c5e5266f8/vsf/hal/cpu/stm32f7/stm32f746xx.h -------------------------------------------------------------------------------- /vsf/hal/cpu/stm32f7/stm32f756xx.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/versaloon/vsf_orig/387b344c4650415756de776866622b4c5e5266f8/vsf/hal/cpu/stm32f7/stm32f756xx.h -------------------------------------------------------------------------------- /vsf/hal/cpu/stm32f7/stm32f7xx.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/versaloon/vsf_orig/387b344c4650415756de776866622b4c5e5266f8/vsf/hal/cpu/stm32f7/stm32f7xx.h -------------------------------------------------------------------------------- /vsf/hal/cpu/stm32f7/usb/usb.h: -------------------------------------------------------------------------------- 1 | vsf_err_t stm32f7_hcd_init(uint32_t index, vsf_err_t (*irq)(void *), void *param); 2 | vsf_err_t stm32f7_hcd_fini(uint32_t index); 3 | void* stm32f7_hcd_regbase(uint32_t index); -------------------------------------------------------------------------------- /vsf/hal/cpu/stm32f7/vsf_basetype.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef __VSF_BASETYPE_H_INCLUDED__ 3 | #define __VSF_BASETYPE_H_INCLUDED__ 4 | 5 | // define the most efficient atom integer 6 | typedef int vsf_int_t; 7 | 8 | #endif // __VSF_BASETYPE_H_INCLUDED__ 9 | -------------------------------------------------------------------------------- /vsf/hal/cpu/stm32f7/vsfhal_const.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2009 - 2010 by Simon Qian * 3 | * * 4 | * This program is free software; you can redistribute it and/or modify * 5 | * it under the terms of the GNU General Public License as published by * 6 | * the Free Software Foundation; either version 2 of the License, or * 7 | * (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the * 16 | * Free Software Foundation, Inc., * 17 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 18 | ***************************************************************************/ 19 | 20 | #ifndef __STM32F7_CONST_H_INCLUDED__ 21 | #define __STM32F7_CONST_H_INCLUDED__ 22 | 23 | #define stm32f7_SLEEP_WFI 0 24 | #define stm32f7_SLEEP_PWRDOWN 1 25 | 26 | #endif // __STM32F7_CONST_H_INCLUDED__ 27 | -------------------------------------------------------------------------------- /vsf/old/dal/cfi/cfi_drv.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2009 - 2010 by Simon Qian * 3 | * * 4 | * This program is free software; you can redistribute it and/or modify * 5 | * it under the terms of the GNU General Public License as published by * 6 | * the Free Software Foundation; either version 2 of the License, or * 7 | * (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the * 16 | * Free Software Foundation, Inc., * 17 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 18 | ***************************************************************************/ 19 | 20 | #ifndef __CFI_DRV_H_INCLUDED__ 21 | #define __CFI_DRV_H_INCLUDED__ 22 | 23 | struct cfi_drv_param_t 24 | { 25 | struct ebi_sram_psram_nor_info_t nor_info; 26 | uint32_t base_addr; 27 | }; 28 | 29 | struct cfi_drv_info_t 30 | { 31 | uint8_t manufacturer_id; 32 | uint16_t device_id[3]; 33 | }; 34 | 35 | struct cfi_drv_interface_t 36 | { 37 | uint8_t ebi_port; 38 | uint8_t nor_index; 39 | }; 40 | 41 | extern const struct mal_driver_t cfi_drv; 42 | 43 | #endif /* __CFI_DRV_H_INCLUDED__ */ 44 | 45 | -------------------------------------------------------------------------------- /vsf/old/dal/dal.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2009 - 2010 by Simon Qian * 3 | * * 4 | * This program is free software; you can redistribute it and/or modify * 5 | * it under the terms of the GNU General Public License as published by * 6 | * the Free Software Foundation; either version 2 of the License, or * 7 | * (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the * 16 | * Free Software Foundation, Inc., * 17 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 18 | ***************************************************************************/ 19 | 20 | #ifndef __DAL_H_INCLUDED__ 21 | #define __DAL_H_INCLUDED__ 22 | 23 | #include "app_cfg.h" 24 | #include "app_type.h" 25 | #include "dal_cfg.h" 26 | #include "interfaces.h" 27 | 28 | struct dal_info_t 29 | { 30 | void *ifs; 31 | void *param; 32 | void *info; 33 | void *extra; 34 | }; 35 | 36 | struct dal_driver_t 37 | { 38 | char *name; 39 | #if DAL_INTERFACE_PARSER_EN 40 | char *ifs_format; 41 | vsf_err_t (*parse_interface)(struct dal_info_t *info, uint8_t *buff); 42 | #endif 43 | }; 44 | 45 | extern struct dal_driver_t *dal_drivers[]; 46 | 47 | #endif // __DAL_H_INCLUDED__ 48 | -------------------------------------------------------------------------------- /vsf/old/dal/df25xx/df25xx_drv.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2009 - 2010 by Simon Qian * 3 | * * 4 | * This program is free software; you can redistribute it and/or modify * 5 | * it under the terms of the GNU General Public License as published by * 6 | * the Free Software Foundation; either version 2 of the License, or * 7 | * (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the * 16 | * Free Software Foundation, Inc., * 17 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 18 | ***************************************************************************/ 19 | 20 | #ifndef __DF25XX_DRV_H_INCLUDED__ 21 | #define __DF25XX_DRV_H_INCLUDED__ 22 | 23 | struct df25xx_drv_param_t 24 | { 25 | uint16_t spi_khz; 26 | }; 27 | 28 | struct df25xx_drv_info_t 29 | { 30 | uint8_t manufacturer_id; 31 | uint16_t device_id; 32 | }; 33 | 34 | struct df25xx_drv_interface_t 35 | { 36 | uint8_t cs_port; 37 | uint32_t cs_pin; 38 | uint8_t spi_port; 39 | }; 40 | 41 | extern const struct mal_driver_t df25xx_drv; 42 | 43 | #endif /* __DF25XX_DRV_H_INCLUDED__ */ 44 | 45 | -------------------------------------------------------------------------------- /vsf/old/dal/df25xx/df25xx_drv_cfg.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2009 - 2010 by Simon Qian * 3 | * * 4 | * This program is free software; you can redistribute it and/or modify * 5 | * it under the terms of the GNU General Public License as published by * 6 | * the Free Software Foundation; either version 2 of the License, or * 7 | * (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the * 16 | * Free Software Foundation, Inc., * 17 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 18 | ***************************************************************************/ 19 | 20 | 21 | -------------------------------------------------------------------------------- /vsf/old/dal/df45xx/df45xx_drv.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2009 - 2010 by Simon Qian * 3 | * * 4 | * This program is free software; you can redistribute it and/or modify * 5 | * it under the terms of the GNU General Public License as published by * 6 | * the Free Software Foundation; either version 2 of the License, or * 7 | * (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the * 16 | * Free Software Foundation, Inc., * 17 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 18 | ***************************************************************************/ 19 | 20 | #ifndef __DF45XX_DRV_H_INCLUDED__ 21 | #define __DF45XX_DRV_H_INCLUDED__ 22 | 23 | struct df45xx_drv_param_t 24 | { 25 | uint16_t spi_khz; 26 | }; 27 | 28 | struct df45xx_drv_interface_t 29 | { 30 | uint8_t cs_port; 31 | uint32_t cs_pin; 32 | uint8_t spi_port; 33 | }; 34 | 35 | extern const struct mal_driver_t df45xx_drv; 36 | 37 | #endif // __DF45XX_DRV_H_INCLUDED__ 38 | 39 | -------------------------------------------------------------------------------- /vsf/old/dal/df45xx/df45xx_drv_cfg.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2009 - 2010 by Simon Qian * 3 | * * 4 | * This program is free software; you can redistribute it and/or modify * 5 | * it under the terms of the GNU General Public License as published by * 6 | * the Free Software Foundation; either version 2 of the License, or * 7 | * (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the * 16 | * Free Software Foundation, Inc., * 17 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 18 | ***************************************************************************/ 19 | 20 | -------------------------------------------------------------------------------- /vsf/old/dal/ee24cxx/ee24cxx_drv.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2009 - 2010 by Simon Qian * 3 | * * 4 | * This program is free software; you can redistribute it and/or modify * 5 | * it under the terms of the GNU General Public License as published by * 6 | * the Free Software Foundation; either version 2 of the License, or * 7 | * (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the * 16 | * Free Software Foundation, Inc., * 17 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 18 | ***************************************************************************/ 19 | 20 | #ifndef __EE24CXX_DRV_H_INCLUDED__ 21 | #define __EE24CXX_DRV_H_INCLUDED__ 22 | 23 | struct ee24cxx_drv_param_t 24 | { 25 | uint16_t iic_khz; 26 | uint8_t iic_addr; 27 | }; 28 | 29 | struct ee24cxx_drv_interface_t 30 | { 31 | uint8_t iic_port; 32 | }; 33 | 34 | extern const struct mal_driver_t ee24cxx_drv; 35 | 36 | #endif /* __EE24CXX_DRV_H_INCLUDED__ */ 37 | 38 | -------------------------------------------------------------------------------- /vsf/old/dal/ee24cxx/ee24cxx_drv_cfg.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2009 - 2010 by Simon Qian * 3 | * * 4 | * This program is free software; you can redistribute it and/or modify * 5 | * it under the terms of the GNU General Public License as published by * 6 | * the Free Software Foundation; either version 2 of the License, or * 7 | * (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the * 16 | * Free Software Foundation, Inc., * 17 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 18 | ***************************************************************************/ 19 | 20 | 21 | -------------------------------------------------------------------------------- /vsf/old/dal/ee93cx6/ee93cx6_drv.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2009 - 2010 by Simon Qian * 3 | * * 4 | * This program is free software; you can redistribute it and/or modify * 5 | * it under the terms of the GNU General Public License as published by * 6 | * the Free Software Foundation; either version 2 of the License, or * 7 | * (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the * 16 | * Free Software Foundation, Inc., * 17 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 18 | ***************************************************************************/ 19 | 20 | #ifndef __EE93CX6_DRV_H_INCLUDED__ 21 | #define __EE93CX6_DRV_H_INCLUDED__ 22 | 23 | #define EE93CX6_ORIGINATION_BYTE 0 24 | #define EE93CX6_ORIGINATION_WORD 1 25 | 26 | struct ee93cx6_drv_param_t 27 | { 28 | uint16_t iic_khz; 29 | uint8_t addr_bitlen; 30 | uint8_t cmd_bitlen; 31 | uint8_t origination_mode; 32 | }; 33 | 34 | struct ee93cx6_drv_interface_t 35 | { 36 | uint8_t mw_port; 37 | }; 38 | 39 | extern const struct mal_driver_t ee93cx6_drv; 40 | 41 | #endif /* __EE93CX6_DRV_H_INCLUDED__ */ 42 | 43 | -------------------------------------------------------------------------------- /vsf/old/dal/ee93cx6/ee93cx6_drv_cfg.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2009 - 2010 by Simon Qian * 3 | * * 4 | * This program is free software; you can redistribute it and/or modify * 5 | * it under the terms of the GNU General Public License as published by * 6 | * the Free Software Foundation; either version 2 of the License, or * 7 | * (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the * 16 | * Free Software Foundation, Inc., * 17 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 18 | ***************************************************************************/ 19 | 20 | 21 | #define EE93CX6_POLL_INTERVAL_US 10 22 | #define EE93CX6_POLL_RETRY_CNT 1000 23 | 24 | -------------------------------------------------------------------------------- /vsf/old/dal/mic2826/mic2826_drv_cfg.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2009 - 2010 by Simon Qian * 3 | * * 4 | * This program is free software; you can redistribute it and/or modify * 5 | * it under the terms of the GNU General Public License as published by * 6 | * the Free Software Foundation; either version 2 of the License, or * 7 | * (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the * 16 | * Free Software Foundation, Inc., * 17 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 18 | ***************************************************************************/ 19 | 20 | #define MIC2826_HAS_LDO3 0 21 | 22 | -------------------------------------------------------------------------------- /vsf/old/dal/nand/nand_drv.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2009 - 2010 by Simon Qian * 3 | * * 4 | * This program is free software; you can redistribute it and/or modify * 5 | * it under the terms of the GNU General Public License as published by * 6 | * the Free Software Foundation; either version 2 of the License, or * 7 | * (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the * 16 | * Free Software Foundation, Inc., * 17 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 18 | ***************************************************************************/ 19 | 20 | #ifndef __NAND_DRV_H_INCLUDED__ 21 | #define __NAND_DRV_H_INCLUDED__ 22 | 23 | struct nand_drv_param_t 24 | { 25 | struct ebi_nand_info_t nand_info; 26 | bool block_read_en; 27 | uint8_t col_addr_size; 28 | uint8_t col_addr_msb; 29 | uint8_t row_addr_lsb; 30 | uint8_t row_addr_size; 31 | // private 32 | bool addr_loadded; 33 | }; 34 | 35 | struct nand_drv_info_t 36 | { 37 | uint8_t manufacturer_id; 38 | uint16_t device_id[3]; 39 | }; 40 | 41 | struct nand_drv_interface_t 42 | { 43 | uint8_t ebi_port; 44 | uint8_t nand_index; 45 | }; 46 | 47 | extern const struct mal_driver_t nand_drv; 48 | 49 | #endif /* __NAND_DRV_H_INCLUDED__ */ 50 | 51 | -------------------------------------------------------------------------------- /vsf/old/dal/nrf24l01/nrf24l01_drv_cfg.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2009 - 2010 by Simon Qian * 3 | * * 4 | * This program is free software; you can redistribute it and/or modify * 5 | * it under the terms of the GNU General Public License as published by * 6 | * the Free Software Foundation; either version 2 of the License, or * 7 | * (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the * 16 | * Free Software Foundation, Inc., * 17 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 18 | ***************************************************************************/ 19 | 20 | -------------------------------------------------------------------------------- /vsf/old/dal/s6b0724/s6b0724_drv.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2009 - 2010 by Simon Qian * 3 | * * 4 | * This program is free software; you can redistribute it and/or modify * 5 | * it under the terms of the GNU General Public License as published by * 6 | * the Free Software Foundation; either version 2 of the License, or * 7 | * (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the * 16 | * Free Software Foundation, Inc., * 17 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 18 | ***************************************************************************/ 19 | 20 | #ifndef __S6B0724_DRV_H_INCLUDED__ 21 | #define __S6B0724_DRV_H_INCLUDED__ 22 | 23 | struct s6b0724_drv_param_t 24 | { 25 | struct ebi_sram_psram_nor_info_t nor_info; 26 | }; 27 | 28 | struct s6b0724_drv_interface_t 29 | { 30 | uint8_t ebi_port; 31 | uint8_t lcd_index; 32 | 33 | uint32_t cmd_addr; 34 | uint32_t data_addr; 35 | }; 36 | 37 | extern const struct mal_driver_t s6b0724_drv; 38 | 39 | #endif // __S6B0724_DRV_H_INCLUDED__ 40 | 41 | -------------------------------------------------------------------------------- /vsf/old/dal/s6b0724/s6b0724_drv_cfg.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2009 - 2010 by Simon Qian * 3 | * * 4 | * This program is free software; you can redistribute it and/or modify * 5 | * it under the terms of the GNU General Public License as published by * 6 | * the Free Software Foundation; either version 2 of the License, or * 7 | * (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the * 16 | * Free Software Foundation, Inc., * 17 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 18 | ***************************************************************************/ 19 | 20 | -------------------------------------------------------------------------------- /vsf/old/dal/sd/sd_sdio_drv.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2009 - 2010 by Simon Qian * 3 | * * 4 | * This program is free software; you can redistribute it and/or modify * 5 | * it under the terms of the GNU General Public License as published by * 6 | * the Free Software Foundation; either version 2 of the License, or * 7 | * (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the * 16 | * Free Software Foundation, Inc., * 17 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 18 | ***************************************************************************/ 19 | 20 | #ifndef __SD_SDIO_DRV_H_INCLUDED__ 21 | #define __SD_SDIO_DRV_H_INCLUDED__ 22 | 23 | struct sd_sdio_drv_interface_t 24 | { 25 | uint8_t sdio_port; 26 | uint8_t sdio_bus_width; 27 | }; 28 | 29 | struct sd_sdio_drv_info_t 30 | { 31 | uint16_t rca; 32 | uint64_t scr; 33 | 34 | enum sd_sdio_drv_state_t 35 | { 36 | SD_SDIO_DRV_WAITRESP, 37 | SD_SDIO_DRV_WAITBUSY, 38 | SD_SDIO_DRV_WAITDATATOK, 39 | SD_SDIO_DRV_WAITDATALASTBUSY, 40 | } state; 41 | uint32_t retry; 42 | uint64_t cur_block; 43 | uint64_t total_block; 44 | uint32_t total_size; 45 | }; 46 | 47 | extern const struct mal_driver_t sd_sdio_drv; 48 | 49 | #endif /* __SD_SDIO_DRV_H_INCLUDED__ */ 50 | 51 | -------------------------------------------------------------------------------- /vsf/old/dal/sd/sd_spi_drv.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2009 - 2010 by Simon Qian * 3 | * * 4 | * This program is free software; you can redistribute it and/or modify * 5 | * it under the terms of the GNU General Public License as published by * 6 | * the Free Software Foundation; either version 2 of the License, or * 7 | * (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the * 16 | * Free Software Foundation, Inc., * 17 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 18 | ***************************************************************************/ 19 | 20 | #ifndef __SD_SPI_DRV_H_INCLUDED__ 21 | #define __SD_SPI_DRV_H_INCLUDED__ 22 | 23 | struct sd_spi_drv_interface_t 24 | { 25 | uint8_t cs_port; 26 | uint32_t cs_pin; 27 | uint8_t spi_port; 28 | }; 29 | 30 | struct sd_spi_drv_info_t 31 | { 32 | enum sd_spi_drv_state_t 33 | { 34 | SD_SPI_DRV_WAITRESP, 35 | SD_SPI_DRV_WAITBUSY, 36 | SD_SPI_DRV_WAITDATATOK, 37 | SD_SPI_DRV_WAITDATALASTBUSY, 38 | } state; 39 | uint32_t retry; 40 | uint64_t cur_block; 41 | uint64_t total_block; 42 | }; 43 | 44 | extern const struct mal_driver_t sd_spi_drv; 45 | 46 | #endif /* __SD_SPI_DRV_H_INCLUDED__ */ 47 | 48 | -------------------------------------------------------------------------------- /vsf/old/dal/sd/sd_spi_drv_cfg.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2009 - 2010 by Simon Qian * 3 | * * 4 | * This program is free software; you can redistribute it and/or modify * 5 | * it under the terms of the GNU General Public License as published by * 6 | * the Free Software Foundation; either version 2 of the License, or * 7 | * (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the * 16 | * Free Software Foundation, Inc., * 17 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 18 | ***************************************************************************/ 19 | 20 | #define SD_SPI_CMD_TIMEOUT 32 21 | 22 | -------------------------------------------------------------------------------- /vsf/old/dal/sst32hfxx/sst32hfxx_drv.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2009 - 2010 by Simon Qian * 3 | * * 4 | * This program is free software; you can redistribute it and/or modify * 5 | * it under the terms of the GNU General Public License as published by * 6 | * the Free Software Foundation; either version 2 of the License, or * 7 | * (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the * 16 | * Free Software Foundation, Inc., * 17 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 18 | ***************************************************************************/ 19 | 20 | #ifndef __SST32HFXX_DRV_H_INCLUDED__ 21 | #define __SST32HFXX_DRV_H_INCLUDED__ 22 | 23 | struct sst32hfxx_drv_param_t 24 | { 25 | struct ebi_sram_psram_nor_info_t nor_info; 26 | uint32_t base_addr; 27 | uint16_t delayus; 28 | }; 29 | 30 | struct sst32hfxx_drv_info_t 31 | { 32 | uint8_t manufacturer_id; 33 | uint16_t device_id; 34 | }; 35 | 36 | struct sst32hfxx_drv_interface_t 37 | { 38 | uint8_t ebi_port; 39 | uint8_t nor_index; 40 | }; 41 | 42 | extern const struct mal_driver_t sst32hfxx_nor_drv; 43 | 44 | #endif /* __SST32HFXX_DRV_H_INCLUDED__ */ 45 | 46 | -------------------------------------------------------------------------------- /vsf/old/example/appldr/driver/windows/VSFCDC.inf: -------------------------------------------------------------------------------- 1 | [Version] 2 | Signature="$Windows NT$" 3 | Class=Ports 4 | ClassGuid={4D36E978-E325-11CE-BFC1-08002BE10318} 5 | Provider=%PRVDR% 6 | CatalogFile=VSF_HIDCDC_Shell.cat 7 | DriverVer=04/25/2010,1.3.1 8 | 9 | [SourceDisksNames] 10 | 1=%DriversDisk%,,, 11 | 12 | [SourceDisksFiles] 13 | 14 | [Manufacturer] 15 | %MFGNAME%=DeviceList,NT,NTamd64 16 | 17 | [DestinationDirs] 18 | DefaultDestDir = 12 19 | 20 | ;------------------------------------------------------------------------------ 21 | ; VID/PID Settings 22 | ;------------------------------------------------------------------------------ 23 | [DeviceList.NT] 24 | %DESCRIPTION%=DriverInstall,USB\VID_0483&PID_A03A&MI_00 25 | 26 | [DeviceList.NTamd64] 27 | %DESCRIPTION%=DriverInstall,USB\VID_0483&PID_A03A&MI_00 28 | 29 | [DriverInstall.NT] 30 | Include=mdmcpq.inf 31 | CopyFiles=FakeModemCopyFileSection 32 | AddReg=DriverInstall.NT.AddReg 33 | 34 | [DriverInstall.NT.AddReg] 35 | HKR,,DevLoader,,*ntkern 36 | HKR,,NTMPDriver,,usbser.sys 37 | HKR,,EnumPropPages32,,"MsPorts.dll,SerialPortPropPageProvider" 38 | 39 | [DriverInstall.NT.Services] 40 | AddService=usbser, 0x00000002, DriverServiceInst 41 | 42 | [DriverServiceInst] 43 | DisplayName=%SERVICE% 44 | ServiceType = 1 ; SERVICE_KERNEL_DRIVER 45 | StartType = 3 ; SERVICE_DEMAND_START 46 | ErrorControl = 1 ; SERVICE_ERROR_NORMAL 47 | ServiceBinary= %12%\usbser.sys 48 | LoadOrderGroup = Base 49 | 50 | ;------------------------------------------------------------------------------ 51 | ; String Definitions 52 | ;------------------------------------------------------------------------------ 53 | 54 | [Strings] 55 | PRVDR = "VSF" 56 | MFGNAME = "VSF." 57 | DESCRIPTION = "VSFCDC Shell" 58 | SERVICE = "VSFCDC_Shell" 59 | DriversDisk = "VSF Drivers Disk" 60 | -------------------------------------------------------------------------------- /vsf/old/example/appldr/main.c: -------------------------------------------------------------------------------- 1 | #include "vsf.h" 2 | #include "app_hw_cfg.h" 3 | 4 | const struct app_hwcfg_t app_hwcfg = 5 | { 6 | .board = APP_BOARD_NAME, 7 | 8 | .key.port = KEY_PORT, 9 | .key.pin = KEY_PIN, 10 | 11 | .usbd.pullup.port = USB_PULLUP_PORT, 12 | .usbd.pullup.pin = USB_PULLUP_PIN, 13 | 14 | #ifdef VSFCFG_FUNC_BCMWIFI 15 | .bcmwifi.type = BCMWIFI_PORT_TYPE, 16 | .bcmwifi.index = BCMWIFI_PORT, 17 | .bcmwifi.freq_khz = BCMWIFI_FREQ, 18 | .bcmwifi.rst.port = BCMWIFI_RST_PORT, 19 | .bcmwifi.rst.pin = BCMWIFI_RST_PIN, 20 | .bcmwifi.wakeup.port = BCMWIFI_WAKEUP_PORT, 21 | .bcmwifi.wakeup.pin = BCMWIFI_WAKEUP_PIN, 22 | .bcmwifi.mode.port = BCMWIFI_MODE_PORT, 23 | .bcmwifi.mode.pin = BCMWIFI_MODE_PIN, 24 | .bcmwifi.spi.cs.port = BCMWIFI_SPI_CS_PORT, 25 | .bcmwifi.spi.cs.pin = BCMWIFI_SPI_CS_PIN, 26 | .bcmwifi.spi.eint.port =BCMWIFI_EINT_PORT, 27 | .bcmwifi.spi.eint.pin = BCMWIFI_EINT_PIN, 28 | .bcmwifi.spi.eint_idx = BCMWIFI_EINT, 29 | .bcmwifi.pwrctrl.port = BCMWIFI_PWRCTRL_PORT, 30 | .bcmwifi.pwrctrl.pin = BCMWIFI_PWRCTRL_PIN, 31 | #endif 32 | }; 33 | 34 | struct vsfapp_t 35 | { 36 | uint8_t bufmgr_buffer[APPCFG_BUFMGR_SIZE]; 37 | } static app; 38 | 39 | void main(void) 40 | { 41 | struct vsf_module_t *module; 42 | struct vsf_module_info_t *minfo = 43 | (struct vsf_module_info_t *)APPCFG_MODULES_ADDR; 44 | int32_t pagesize; 45 | 46 | vsf_enter_critical(); 47 | vsfhal_core_init(NULL); 48 | vsfhal_flash_capacity(0, (uint32_t*)&pagesize, NULL); 49 | pagesize = msb(pagesize); 50 | vsf_bufmgr_init(app.bufmgr_buffer, sizeof(app.bufmgr_buffer)); 51 | 52 | // register modules 53 | while (minfo->entry != 0xFFFFFFFF) 54 | { 55 | module = vsf_bufmgr_malloc(sizeof(struct vsf_module_t)); 56 | if (NULL == module) 57 | { 58 | break; 59 | } 60 | 61 | module->flash = minfo; 62 | minfo = (struct vsf_module_info_t *)((uint8_t *)minfo +\ 63 | ((minfo->size + (1 << pagesize) - 1) & ~((1 << pagesize) - 1))); 64 | vsf_module_register(module); 65 | } 66 | 67 | vsf_module_load("vsf.os", true); 68 | // vsfos module SHALL never return; 69 | } 70 | -------------------------------------------------------------------------------- /vsf/old/example/appldr/module/modmain.c: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2009 - 2010 by Simon Qian * 3 | * * 4 | * This program is free software; you can redistribute it and/or modify * 5 | * it under the terms of the GNU General Public License as published by * 6 | * the Free Software Foundation; either version 2 of the License, or * 7 | * (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the * 16 | * Free Software Foundation, Inc., * 17 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 18 | ***************************************************************************/ 19 | #include "vsf.h" 20 | #include "app_hw_cfg.h" 21 | 22 | ROOTFUNC vsf_err_t module_exit(struct vsf_module_t *module) 23 | { 24 | return MODULE_EXIT(module); 25 | } 26 | 27 | ROOTFUNC vsf_err_t module_entry(struct vsf_module_t *module, 28 | struct app_hwcfg_t const *hwcfg) 29 | { 30 | // check api version 31 | if (api_ver != VSF_API_VERSION) 32 | { 33 | return VSFERR_NOT_SUPPORT; 34 | } 35 | return MODULE_INIT(module, hwcfg); 36 | } 37 | -------------------------------------------------------------------------------- /vsf/old/example/appldr/module/vsfos/vsfos_busybox.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2009 - 2010 by Simon Qian * 3 | * * 4 | * This program is free software; you can redistribute it and/or modify * 5 | * it under the terms of the GNU General Public License as published by * 6 | * the Free Software Foundation; either version 2 of the License, or * 7 | * (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the * 16 | * Free Software Foundation, Inc., * 17 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 18 | ***************************************************************************/ 19 | 20 | #ifndef __VSFOS_BUSYBOX_H_INCLUDED__ 21 | #define __VSFOS_BUSYBOX_H_INCLUDED__ 22 | 23 | vsf_err_t vsfos_busybox_init(struct vsfshell_t *shell); 24 | 25 | #endif // __VSFOS_BUSYBOX_H_INCLUDED__ 26 | -------------------------------------------------------------------------------- /vsf/old/example/appldr/proj/appldr_EWARM7.10_NUC505/app_cfg.h: -------------------------------------------------------------------------------- 1 | /************************************************************************** 2 | * Copyright (C) 2008 - 2012 by Simon Qian * 3 | * SimonQian@SimonQian.com * 4 | * * 5 | * Project: VSF * 6 | * File: app_cfg.h * 7 | * Author: SimonQian * 8 | * Versaion: See changelog * 9 | * Purpose: configuration file * 10 | * License: See license * 11 | *------------------------------------------------------------------------* 12 | * Change Log: * 13 | * YYYY-MM-DD: What(by Who) * 14 | * 2008-11-07: created(by SimonQian) * 15 | **************************************************************************/ 16 | 17 | // hardware config file 18 | #include "hw_cfg_NUC505.h" 19 | 20 | // compiler config 21 | #include "compiler.h" 22 | -------------------------------------------------------------------------------- /vsf/old/example/appldr/proj/appldr_EWARM7.10_NUC505/demo.eww: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | $WS_DIR$\demo.ewp 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /vsf/old/example/appldr/proj/appldr_EWARM7.10_STM32/STM32.icf: -------------------------------------------------------------------------------- 1 | /*###ICF### Section handled by ICF editor, don't touch! ****/ 2 | /*-Editor annotation file-*/ 3 | /* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\a_v1_0.xml" */ 4 | /*-Specials-*/ 5 | define symbol __ICFEDIT_intvec_start__ = 0x08000000; 6 | /*-Memory Regions-*/ 7 | define symbol __ICFEDIT_region_ROM_start__ = 0x08000000; 8 | define symbol __ICFEDIT_region_ROM_end__ = 0x0807FFFF; 9 | define symbol __ICFEDIT_region_RAM_start__ = 0x20000000; 10 | define symbol __ICFEDIT_region_RAM_end__ = 0x20017FFF; 11 | /*-Sizes-*/ 12 | define symbol __ICFEDIT_size_cstack__ = 0x800; 13 | define symbol __ICFEDIT_size_svcstack__ = 0; 14 | define symbol __ICFEDIT_size_irqstack__ = 0; 15 | define symbol __ICFEDIT_size_fiqstack__ = 0; 16 | define symbol __ICFEDIT_size_undstack__ = 0; 17 | define symbol __ICFEDIT_size_abtstack__ = 0; 18 | define symbol __ICFEDIT_size_heap__ = 0; 19 | /**** End of ICF editor section. ###ICF###*/ 20 | 21 | 22 | define memory mem with size = 4G; 23 | define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFEDIT_region_ROM_end__]; 24 | define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__]; 25 | 26 | define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { }; 27 | define block SVC_STACK with alignment = 8, size = __ICFEDIT_size_svcstack__ { }; 28 | define block IRQ_STACK with alignment = 8, size = __ICFEDIT_size_irqstack__ { }; 29 | define block FIQ_STACK with alignment = 8, size = __ICFEDIT_size_fiqstack__ { }; 30 | define block UND_STACK with alignment = 8, size = __ICFEDIT_size_undstack__ { }; 31 | define block ABT_STACK with alignment = 8, size = __ICFEDIT_size_abtstack__ { }; 32 | define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { }; 33 | 34 | initialize by copy { readwrite }; 35 | do not initialize { section .noinit }; 36 | 37 | place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec }; 38 | 39 | place in ROM_region { readonly }; 40 | place in RAM_region { readwrite, 41 | block CSTACK, block SVC_STACK, block IRQ_STACK, block FIQ_STACK, 42 | block UND_STACK, block ABT_STACK, block HEAP }; 43 | -------------------------------------------------------------------------------- /vsf/old/example/appldr/proj/appldr_EWARM7.10_STM32/app_cfg.h: -------------------------------------------------------------------------------- 1 | /************************************************************************** 2 | * Copyright (C) 2008 - 2012 by Simon Qian * 3 | * SimonQian@SimonQian.com * 4 | * * 5 | * Project: VSF * 6 | * File: app_cfg.h * 7 | * Author: SimonQian * 8 | * Versaion: See changelog * 9 | * Purpose: configuration file * 10 | * License: See license * 11 | *------------------------------------------------------------------------* 12 | * Change Log: * 13 | * YYYY-MM-DD: What(by Who) * 14 | * 2008-11-07: created(by SimonQian) * 15 | **************************************************************************/ 16 | 17 | // hardware config file 18 | #include "hw_cfg_STM32.h" 19 | 20 | // compiler config 21 | #include "compiler.h" 22 | 23 | #define APPCFG_BUFMGR_SIZE (60 * 1024) 24 | #define APPCFG_MODULES_ADDR 0x08008000 25 | -------------------------------------------------------------------------------- /vsf/old/example/appldr/proj/appldr_EWARM7.10_STM32/demo.eww: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | $WS_DIR$\demo.ewp 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /vsf/old/example/appldr/proj/modules/app_cfg.h: -------------------------------------------------------------------------------- 1 | /************************************************************************** 2 | * Copyright (C) 2008 - 2012 by Simon Qian * 3 | * SimonQian@SimonQian.com * 4 | * * 5 | * Project: VSF * 6 | * File: app_cfg.h * 7 | * Author: SimonQian * 8 | * Versaion: See changelog * 9 | * Purpose: configuration file * 10 | * License: See license * 11 | *------------------------------------------------------------------------* 12 | * Change Log: * 13 | * YYYY-MM-DD: What(by Who) * 14 | * 2008-11-07: created(by SimonQian) * 15 | **************************************************************************/ 16 | -------------------------------------------------------------------------------- /vsf/old/example/appldr/proj/modules/fixsize.vbs: -------------------------------------------------------------------------------- 1 | If Wscript.Arguments.Count <> 1 Then 2 | MsgBox "Format: wscript fixsize.vbs FILE" 3 | Wscript.Quit 4 | End If 5 | 6 | Const ModuleFileName = "modules.bin" 7 | Const PageSize = 2048 8 | Const DefaultByte = "FF" 9 | 10 | Dim ModuleStream, Stream, FileName, FileSize, Buffer, Str, Fso 11 | FileName = Wscript.Arguments(0) 12 | Set Stream = CreateObject("Adodb.Stream") 13 | Set ModuleStream = CreateObject("Adodb.Stream") 14 | Set Fso = CreateObject("Scripting.FileSystemObject") 15 | 16 | With Stream 17 | .Type = 1: .Mode = 3: .Open: .LoadFromFile FileName: Buffer = .Read 18 | End With 19 | 20 | FileSize = Stream.Size 21 | Buffer = Str2BinArr(Long2Str(FileSize)) 22 | 23 | Stream.Position = 8 24 | Stream.Write Buffer 25 | Stream.SaveToFile FileName, 2 26 | 27 | With ModuleStream 28 | .Type = 1: .Mode = 3: .Open 29 | End With 30 | FileName = Fso.GetParentFolderName(FileName) + "\" + ModuleFileName 31 | If Fso.FileExists(FileName) Then 32 | ModuleStream.LoadFromFile FileName 33 | ModuleStream.Position = ModuleStream.Size 34 | End If 35 | 36 | Stream.CopyTo ModuleStream, Stream.Size 37 | Stream.Close 38 | Set Stream = Nothing 39 | 40 | Buffer = Str2BinArr(DefaultByte) 41 | While (ModuleStream.Size And (PageSize - 1)) <> 0 42 | ModuleStream.Write Buffer 43 | Wend 44 | ModuleStream.SaveToFile FileName, 2 45 | ModuleStream.Close 46 | Set ModuleStream = Nothing 47 | Wscript.Quit 48 | 49 | 50 | Function Long2Str(Value) 51 | Dim i, Str, TmpByte 52 | 53 | For i = 0 To 3 54 | TmpByte = (Value / (2 ^ (i * 8))) And 255 55 | if TmpByte < 16 Then Str = Str + "0" 56 | Str = Str & Hex(CByte(TmpByte)) 57 | Next 58 | Long2Str = Str 59 | End Function 60 | 61 | Function Str2BinArr(Str) 62 | Dim XML, Element 63 | 64 | Set XML = CreateObject("Microsoft.XMLDOM") 65 | Set Element = XML.CreateElement("None") 66 | Element.DataType = "bin.hex" 67 | Element.NodeTypedValue = Str 68 | Str2BinArr = Element.NodeTypedValue 69 | Set Element = Nothing 70 | Set XML = Nothing 71 | End Function 72 | -------------------------------------------------------------------------------- /vsf/old/example/appldr/proj/modules/module.icf: -------------------------------------------------------------------------------- 1 | /*###ICF### Section handled by ICF editor, don't touch! ****/ 2 | /*-Editor annotation file-*/ 3 | /* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */ 4 | /*-Specials-*/ 5 | define symbol __ICFEDIT_entry_start__ = 0x00000000; 6 | /*-Memory Regions-*/ 7 | define symbol __ICFEDIT_region_ROM_start__ = 0x00000000; 8 | define symbol __ICFEDIT_region_ROM_end__ = 0x000FFFFF; 9 | /*-Sizes-*/ 10 | /**** End of ICF editor section. ###ICF###*/ 11 | 12 | 13 | define memory mem with size = 4G; 14 | define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFEDIT_region_ROM_end__]; 15 | 16 | place at address mem:__ICFEDIT_entry_start__ { readonly section entry }; 17 | 18 | place in ROM_region { readonly }; 19 | -------------------------------------------------------------------------------- /vsf/old/example/appldr/proj/modules/vsfhal_cfg.h: -------------------------------------------------------------------------------- 1 | /************************************************************************** 2 | * Copyright (C) 2008 - 2010 by Simon Qian * 3 | * SimonQian@SimonQian.com * 4 | * * 5 | * Project: Versaloon * 6 | * File: interfaces.h * 7 | * Author: SimonQian * 8 | * Versaion: See changelog * 9 | * Purpose: interfaces header file * 10 | * License: See license * 11 | *------------------------------------------------------------------------* 12 | * Change Log: * 13 | * YYYY-MM-DD: What(by Who) * 14 | * 2008-11-07: created(by SimonQian) * 15 | **************************************************************************/ 16 | 17 | #define VSFHAL_CONST_EN 1 18 | #define VSFHAL_FLASH_EN 1 19 | #define VSFHAL_USART_EN 0 20 | #define VSFHAL_SPI_EN 1 21 | #define VSFHAL_ADC_EN 1 22 | #define VSFHAL_GPIO_EN 1 23 | #define VSFHAL_IIC_EN 0 24 | #define VSFHAL_PWM_EN 0 25 | #define VSFHAL_MICROWIRE_EN 0 26 | #define VSFHAL_TIMER_EN 0 27 | #define VSFHAL_EINT_EN 1 28 | #define VSFHAL_EBI_EN 0 29 | #define VSFHAL_SDIO_EN 0 30 | #define VSFHAL_USBD_EN 1 31 | 32 | -------------------------------------------------------------------------------- /vsf/old/example/appldr/vsf_cfg/vsfip_cfg.h: -------------------------------------------------------------------------------- 1 | #define VSFIP_CFG_TCP_RX_WINDOW 4500 2 | #define VSFIP_CFG_TCP_TX_WINDOW 3000 3 | 4 | #define VSFIP_CFG_NETIF_HEADLEN 64 5 | -------------------------------------------------------------------------------- /vsf/old/example/vsffat/proj/EWARM7.10_STM32/STM32.icf: -------------------------------------------------------------------------------- 1 | /*###ICF### Section handled by ICF editor, don't touch! ****/ 2 | /*-Editor annotation file-*/ 3 | /* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\a_v1_0.xml" */ 4 | /*-Specials-*/ 5 | define symbol __ICFEDIT_intvec_start__ = 0x08000000; 6 | /*-Memory Regions-*/ 7 | define symbol __ICFEDIT_region_ROM_start__ = 0x08000000; 8 | define symbol __ICFEDIT_region_ROM_end__ = 0x0803FFFF; 9 | define symbol __ICFEDIT_region_RAM_start__ = 0x20000000; 10 | define symbol __ICFEDIT_region_RAM_end__ = 0x2000FFFF; 11 | /*-Sizes-*/ 12 | define symbol __ICFEDIT_size_cstack__ = 0x400; 13 | define symbol __ICFEDIT_size_svcstack__ = 0; 14 | define symbol __ICFEDIT_size_irqstack__ = 0; 15 | define symbol __ICFEDIT_size_fiqstack__ = 0; 16 | define symbol __ICFEDIT_size_undstack__ = 0; 17 | define symbol __ICFEDIT_size_abtstack__ = 0; 18 | define symbol __ICFEDIT_size_heap__ = 0x800; 19 | /**** End of ICF editor section. ###ICF###*/ 20 | 21 | 22 | define memory mem with size = 4G; 23 | define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFEDIT_region_ROM_end__]; 24 | define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__]; 25 | 26 | define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { }; 27 | define block SVC_STACK with alignment = 8, size = __ICFEDIT_size_svcstack__ { }; 28 | define block IRQ_STACK with alignment = 8, size = __ICFEDIT_size_irqstack__ { }; 29 | define block FIQ_STACK with alignment = 8, size = __ICFEDIT_size_fiqstack__ { }; 30 | define block UND_STACK with alignment = 8, size = __ICFEDIT_size_undstack__ { }; 31 | define block ABT_STACK with alignment = 8, size = __ICFEDIT_size_abtstack__ { }; 32 | define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { }; 33 | 34 | initialize by copy { readwrite }; 35 | do not initialize { section .noinit }; 36 | 37 | place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec }; 38 | 39 | place in ROM_region { readonly }; 40 | place in RAM_region { readwrite, 41 | block CSTACK, block SVC_STACK, block IRQ_STACK, block FIQ_STACK, 42 | block UND_STACK, block ABT_STACK, block HEAP }; -------------------------------------------------------------------------------- /vsf/old/example/vsffat/proj/EWARM7.10_STM32/app_cfg.h: -------------------------------------------------------------------------------- 1 | /************************************************************************** 2 | * Copyright (C) 2008 - 2012 by Simon Qian * 3 | * SimonQian@SimonQian.com * 4 | * * 5 | * Project: VSF * 6 | * File: app_cfg.h * 7 | * Author: SimonQian * 8 | * Versaion: See changelog * 9 | * Purpose: configuration file * 10 | * License: See license * 11 | *------------------------------------------------------------------------* 12 | * Change Log: * 13 | * YYYY-MM-DD: What(by Who) * 14 | * 2008-11-07: created(by SimonQian) * 15 | **************************************************************************/ 16 | 17 | // hardware config file 18 | #include "hw_cfg_STM32.h" 19 | 20 | // compiler config 21 | #include "compiler.h" 22 | -------------------------------------------------------------------------------- /vsf/old/example/vsffat/proj/EWARM7.10_STM32/demo.eww: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | $WS_DIR$\demo.ewp 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /vsf/old/example/vsffat/proj/EWARM7.10_STM32/hw_cfg_STM32.h: -------------------------------------------------------------------------------- 1 | /************************************************************************** 2 | * Copyright (C) 2008 - 2012 by Simon Qian * 3 | * SimonQian@SimonQian.com * 4 | * * 5 | * Project: Versaloon * 6 | * File: hw_cfg_VSFCore_STM32.h * 7 | * Author: SimonQian * 8 | * Versaion: See changelog * 9 | * Purpose: hardware configuration file for VSFCore_STM32 * 10 | * License: See license * 11 | *------------------------------------------------------------------------* 12 | * Change Log: * 13 | * YYYY-MM-DD: What(by Who) * 14 | * 2008-11-07: created(by SimonQian) * 15 | * 2008-11-22: rewrite GPIO_Dir(by SimonQian) * 16 | **************************************************************************/ 17 | 18 | #ifndef HSE_VALUE 19 | #define HSE_VALUE ((uint32_t)12000000) 20 | #endif 21 | 22 | #define OSC_HZ HSE_VALUE 23 | 24 | #define USB_PULLUP_PORT 2 25 | #define USB_PULLUP_PIN 13 26 | -------------------------------------------------------------------------------- /vsf/old/example/vsfusbd_eda/driver/windows/VSFCDC.inf: -------------------------------------------------------------------------------- 1 | [Version] 2 | Signature="$Windows NT$" 3 | Class=Ports 4 | ClassGuid={4D36E978-E325-11CE-BFC1-08002BE10318} 5 | Provider=%PRVDR% 6 | CatalogFile=VSFCDC.cat 7 | DriverVer=04/25/2010,1.3.1 8 | 9 | [SourceDisksNames] 10 | 1=%DriversDisk%,,, 11 | 12 | [SourceDisksFiles] 13 | 14 | [Manufacturer] 15 | %MFGNAME%=DeviceList,NT,NTamd64 16 | 17 | [DestinationDirs] 18 | DefaultDestDir = 12 19 | 20 | ;------------------------------------------------------------------------------ 21 | ; VID/PID Settings 22 | ;------------------------------------------------------------------------------ 23 | [DeviceList.NT] 24 | %DESCRIPTION%=DriverInstall,USB\VID_0483&PID_A03A&MI_02 25 | 26 | [DeviceList.NTamd64] 27 | %DESCRIPTION%=DriverInstall,USB\VID_0483&PID_A03A&MI_02 28 | 29 | [DriverInstall.NT] 30 | Include=mdmcpq.inf 31 | CopyFiles=FakeModemCopyFileSection 32 | AddReg=DriverInstall.NT.AddReg 33 | 34 | [DriverInstall.NT.AddReg] 35 | HKR,,DevLoader,,*ntkern 36 | HKR,,NTMPDriver,,usbser.sys 37 | HKR,,EnumPropPages32,,"MsPorts.dll,SerialPortPropPageProvider" 38 | 39 | [DriverInstall.NT.Services] 40 | AddService=usbser, 0x00000002, DriverServiceInst 41 | 42 | [DriverServiceInst] 43 | DisplayName=%SERVICE% 44 | ServiceType = 1 ; SERVICE_KERNEL_DRIVER 45 | StartType = 3 ; SERVICE_DEMAND_START 46 | ErrorControl = 1 ; SERVICE_ERROR_NORMAL 47 | ServiceBinary= %12%\usbser.sys 48 | LoadOrderGroup = Base 49 | 50 | ;------------------------------------------------------------------------------ 51 | ; String Definitions 52 | ;------------------------------------------------------------------------------ 53 | 54 | [Strings] 55 | PRVDR = "VSF" 56 | MFGNAME = "VSF." 57 | DESCRIPTION = "VSFCDC" 58 | SERVICE = "VSFCDC" 59 | DriversDisk = "VSF Drivers Disk" -------------------------------------------------------------------------------- /vsf/old/example/vsfusbd_eda/proj/EWARM7.10_NUC400/app_cfg.h: -------------------------------------------------------------------------------- 1 | /************************************************************************** 2 | * Copyright (C) 2008 - 2012 by Simon Qian * 3 | * SimonQian@SimonQian.com * 4 | * * 5 | * Project: VSF * 6 | * File: app_cfg.h * 7 | * Author: SimonQian * 8 | * Versaion: See changelog * 9 | * Purpose: configuration file * 10 | * License: See license * 11 | *------------------------------------------------------------------------* 12 | * Change Log: * 13 | * YYYY-MM-DD: What(by Who) * 14 | * 2008-11-07: created(by SimonQian) * 15 | **************************************************************************/ 16 | 17 | // hardware config file 18 | #include "hw_cfg_NUC400.h" 19 | 20 | // compiler config 21 | #include "compiler.h" 22 | 23 | #define APP_CFG_MSC_WRITEONLY 0 24 | #define APP_CFG_BOOTSIZE (32 * 1024) 25 | #define APP_CFG_FWSIZE (224 * 1024) 26 | -------------------------------------------------------------------------------- /vsf/old/example/vsfusbd_eda/proj/EWARM7.10_NUC400/demo.eww: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | $WS_DIR$\demo.ewp 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /vsf/old/example/vsfusbd_eda/proj/EWARM7.10_NUC400/nuc442.icf: -------------------------------------------------------------------------------- 1 | /*###ICF### Section handled by ICF editor, don't touch! ****/ 2 | /*-Editor annotation file-*/ 3 | /* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */ 4 | /*-Specials-*/ 5 | define symbol __ICFEDIT_intvec_start__ = 0x00000000; 6 | /*-Memory Regions-*/ 7 | define symbol __ICFEDIT_region_ROM_start__ = 0x00000000; 8 | define symbol __ICFEDIT_region_ROM_end__ = 0x00020000; 9 | define symbol __ICFEDIT_region_RAM_start__ = 0x20000000; 10 | define symbol __ICFEDIT_region_RAM_end__ = 0x2000FFFF; 11 | /*-Sizes-*/ 12 | define symbol __ICFEDIT_size_cstack__ = 0x2000; 13 | define symbol __ICFEDIT_size_heap__ = 0x8000; 14 | /**** End of ICF editor section. ###ICF###*/ 15 | 16 | 17 | define memory mem with size = 4G; 18 | define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFEDIT_region_ROM_end__]; 19 | define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__]; 20 | 21 | define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { }; 22 | define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { }; 23 | 24 | initialize by copy { readwrite }; 25 | do not initialize { section .noinit }; 26 | 27 | place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec }; 28 | 29 | place in ROM_region { readonly }; 30 | place in RAM_region { readwrite, 31 | block HEAP,block CSTACK }; -------------------------------------------------------------------------------- /vsf/old/example/vsfusbd_eda/proj/EWARM7.10_NUC505/app_cfg.h: -------------------------------------------------------------------------------- 1 | /************************************************************************** 2 | * Copyright (C) 2008 - 2012 by Simon Qian * 3 | * SimonQian@SimonQian.com * 4 | * * 5 | * Project: VSF * 6 | * File: app_cfg.h * 7 | * Author: SimonQian * 8 | * Versaion: See changelog * 9 | * Purpose: configuration file * 10 | * License: See license * 11 | *------------------------------------------------------------------------* 12 | * Change Log: * 13 | * YYYY-MM-DD: What(by Who) * 14 | * 2008-11-07: created(by SimonQian) * 15 | **************************************************************************/ 16 | 17 | // hardware config file 18 | #include "hw_cfg_NUC505.h" 19 | 20 | // compiler config 21 | #include "compiler.h" 22 | -------------------------------------------------------------------------------- /vsf/old/example/vsfusbd_eda/proj/EWARM7.10_NUC505/demo.eww: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | $WS_DIR$\demo.ewp 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /vsf/old/example/vsfusbd_eda/proj/EWARM7.10_STM32/STM32.icf: -------------------------------------------------------------------------------- 1 | /*###ICF### Section handled by ICF editor, don't touch! ****/ 2 | /*-Editor annotation file-*/ 3 | /* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\a_v1_0.xml" */ 4 | /*-Specials-*/ 5 | define symbol __ICFEDIT_intvec_start__ = 0x08000000; 6 | /*-Memory Regions-*/ 7 | define symbol __ICFEDIT_region_ROM_start__ = 0x08000000; 8 | define symbol __ICFEDIT_region_ROM_end__ = 0x0803FFFF; 9 | define symbol __ICFEDIT_region_RAM_start__ = 0x20000000; 10 | define symbol __ICFEDIT_region_RAM_end__ = 0x2000FFFF; 11 | /*-Sizes-*/ 12 | define symbol __ICFEDIT_size_cstack__ = 0x400; 13 | define symbol __ICFEDIT_size_svcstack__ = 0; 14 | define symbol __ICFEDIT_size_irqstack__ = 0; 15 | define symbol __ICFEDIT_size_fiqstack__ = 0; 16 | define symbol __ICFEDIT_size_undstack__ = 0; 17 | define symbol __ICFEDIT_size_abtstack__ = 0; 18 | define symbol __ICFEDIT_size_heap__ = 0x800; 19 | /**** End of ICF editor section. ###ICF###*/ 20 | 21 | 22 | define memory mem with size = 4G; 23 | define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFEDIT_region_ROM_end__]; 24 | define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__]; 25 | 26 | define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { }; 27 | define block SVC_STACK with alignment = 8, size = __ICFEDIT_size_svcstack__ { }; 28 | define block IRQ_STACK with alignment = 8, size = __ICFEDIT_size_irqstack__ { }; 29 | define block FIQ_STACK with alignment = 8, size = __ICFEDIT_size_fiqstack__ { }; 30 | define block UND_STACK with alignment = 8, size = __ICFEDIT_size_undstack__ { }; 31 | define block ABT_STACK with alignment = 8, size = __ICFEDIT_size_abtstack__ { }; 32 | define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { }; 33 | 34 | initialize by copy { readwrite }; 35 | do not initialize { section .noinit }; 36 | 37 | place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec }; 38 | 39 | place in ROM_region { readonly }; 40 | place in RAM_region { readwrite, 41 | block CSTACK, block SVC_STACK, block IRQ_STACK, block FIQ_STACK, 42 | block UND_STACK, block ABT_STACK, block HEAP }; -------------------------------------------------------------------------------- /vsf/old/example/vsfusbd_eda/proj/EWARM7.10_STM32/app_cfg.h: -------------------------------------------------------------------------------- 1 | /************************************************************************** 2 | * Copyright (C) 2008 - 2012 by Simon Qian * 3 | * SimonQian@SimonQian.com * 4 | * * 5 | * Project: VSF * 6 | * File: app_cfg.h * 7 | * Author: SimonQian * 8 | * Versaion: See changelog * 9 | * Purpose: configuration file * 10 | * License: See license * 11 | *------------------------------------------------------------------------* 12 | * Change Log: * 13 | * YYYY-MM-DD: What(by Who) * 14 | * 2008-11-07: created(by SimonQian) * 15 | **************************************************************************/ 16 | 17 | // hardware config file 18 | #include "hw_cfg_STM32.h" 19 | 20 | // compiler config 21 | #include "compiler.h" 22 | -------------------------------------------------------------------------------- /vsf/old/example/vsfusbd_eda/proj/EWARM7.10_STM32/demo.eww: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | $WS_DIR$\demo.ewp 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /vsf/old/example/vsfusbd_eda/proj/EWARM7.10_STM32/hw_cfg_STM32.h: -------------------------------------------------------------------------------- 1 | /************************************************************************** 2 | * Copyright (C) 2008 - 2012 by Simon Qian * 3 | * SimonQian@SimonQian.com * 4 | * * 5 | * Project: Versaloon * 6 | * File: hw_cfg_VSFCore_STM32.h * 7 | * Author: SimonQian * 8 | * Versaion: See changelog * 9 | * Purpose: hardware configuration file for VSFCore_STM32 * 10 | * License: See license * 11 | *------------------------------------------------------------------------* 12 | * Change Log: * 13 | * YYYY-MM-DD: What(by Who) * 14 | * 2008-11-07: created(by SimonQian) * 15 | * 2008-11-22: rewrite GPIO_Dir(by SimonQian) * 16 | **************************************************************************/ 17 | 18 | #ifndef HSE_VALUE 19 | #define HSE_VALUE ((uint32_t)12000000) 20 | #endif 21 | 22 | #define OSC_HZ HSE_VALUE 23 | 24 | #define USB_PULLUP_PORT 2 25 | #define USB_PULLUP_PIN 13 26 | -------------------------------------------------------------------------------- /vsf/old/example/vsfusbd_eda/vsf_cfg/vsfip_cfg.h: -------------------------------------------------------------------------------- 1 | #define VSFIP_CFG_TCP_RX_WINDOW 4500 2 | #define VSFIP_CFG_TCP_TX_WINDOW 3000 3 | 4 | #define VSFIP_CFG_NETIF_HEADLEN 64 5 | -------------------------------------------------------------------------------- /vsf/old/example/vsfusbd_mscboot/proj/EWARM7.10_NUC505/app_cfg.h: -------------------------------------------------------------------------------- 1 | /************************************************************************** 2 | * Copyright (C) 2008 - 2012 by Simon Qian * 3 | * SimonQian@SimonQian.com * 4 | * * 5 | * Project: VSF * 6 | * File: app_cfg.h * 7 | * Author: SimonQian * 8 | * Versaion: See changelog * 9 | * Purpose: configuration file * 10 | * License: See license * 11 | *------------------------------------------------------------------------* 12 | * Change Log: * 13 | * YYYY-MM-DD: What(by Who) * 14 | * 2008-11-07: created(by SimonQian) * 15 | **************************************************************************/ 16 | 17 | // hardware config file 18 | #include "hw_cfg_NUC505.h" 19 | 20 | // compiler config 21 | #include "compiler.h" 22 | -------------------------------------------------------------------------------- /vsf/old/example/vsfusbd_mscboot/proj/EWARM7.10_NUC505/demo.eww: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | $WS_DIR$\demo.ewp 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /vsf/old/example/vsfusbd_mscboot/proj/EWARM7.10_STM32/STM32.icf: -------------------------------------------------------------------------------- 1 | /*###ICF### Section handled by ICF editor, don't touch! ****/ 2 | /*-Editor annotation file-*/ 3 | /* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\a_v1_0.xml" */ 4 | /*-Specials-*/ 5 | define symbol __ICFEDIT_intvec_start__ = 0x08000000; 6 | /*-Memory Regions-*/ 7 | define symbol __ICFEDIT_region_ROM_start__ = 0x08000000; 8 | define symbol __ICFEDIT_region_ROM_end__ = 0x0803FFFF; 9 | define symbol __ICFEDIT_region_RAM_start__ = 0x20000000; 10 | define symbol __ICFEDIT_region_RAM_end__ = 0x20017FFF; 11 | /*-Sizes-*/ 12 | define symbol __ICFEDIT_size_cstack__ = 0x400; 13 | define symbol __ICFEDIT_size_svcstack__ = 0; 14 | define symbol __ICFEDIT_size_irqstack__ = 0; 15 | define symbol __ICFEDIT_size_fiqstack__ = 0; 16 | define symbol __ICFEDIT_size_undstack__ = 0; 17 | define symbol __ICFEDIT_size_abtstack__ = 0; 18 | define symbol __ICFEDIT_size_heap__ = 0x800; 19 | /**** End of ICF editor section. ###ICF###*/ 20 | 21 | 22 | define memory mem with size = 4G; 23 | define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFEDIT_region_ROM_end__]; 24 | define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__]; 25 | 26 | define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { }; 27 | define block SVC_STACK with alignment = 8, size = __ICFEDIT_size_svcstack__ { }; 28 | define block IRQ_STACK with alignment = 8, size = __ICFEDIT_size_irqstack__ { }; 29 | define block FIQ_STACK with alignment = 8, size = __ICFEDIT_size_fiqstack__ { }; 30 | define block UND_STACK with alignment = 8, size = __ICFEDIT_size_undstack__ { }; 31 | define block ABT_STACK with alignment = 8, size = __ICFEDIT_size_abtstack__ { }; 32 | define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { }; 33 | 34 | initialize by copy { readwrite }; 35 | do not initialize { section .noinit }; 36 | 37 | place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec }; 38 | 39 | place in ROM_region { readonly }; 40 | place in RAM_region { readwrite, 41 | block CSTACK, block SVC_STACK, block IRQ_STACK, block FIQ_STACK, 42 | block UND_STACK, block ABT_STACK, block HEAP }; -------------------------------------------------------------------------------- /vsf/old/example/vsfusbd_mscboot/proj/EWARM7.10_STM32/app_cfg.h: -------------------------------------------------------------------------------- 1 | /************************************************************************** 2 | * Copyright (C) 2008 - 2012 by Simon Qian * 3 | * SimonQian@SimonQian.com * 4 | * * 5 | * Project: VSF * 6 | * File: app_cfg.h * 7 | * Author: SimonQian * 8 | * Versaion: See changelog * 9 | * Purpose: configuration file * 10 | * License: See license * 11 | *------------------------------------------------------------------------* 12 | * Change Log: * 13 | * YYYY-MM-DD: What(by Who) * 14 | * 2008-11-07: created(by SimonQian) * 15 | **************************************************************************/ 16 | 17 | // hardware config file 18 | #include "hw_cfg_STM32.h" 19 | 20 | // compiler config 21 | #include "compiler.h" 22 | -------------------------------------------------------------------------------- /vsf/old/example/vsfusbd_mscboot/proj/EWARM7.10_STM32/demo.eww: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | $WS_DIR$\demo.ewp 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /vsf/old/example/vsfusbd_mscboot/proj/EWARM7.10_STM32/hw_cfg_STM32.h: -------------------------------------------------------------------------------- 1 | /************************************************************************** 2 | * Copyright (C) 2008 - 2012 by Simon Qian * 3 | * SimonQian@SimonQian.com * 4 | * * 5 | * Project: Versaloon * 6 | * File: hw_cfg_VSFCore_STM32.h * 7 | * Author: SimonQian * 8 | * Versaion: See changelog * 9 | * Purpose: hardware configuration file for VSFCore_STM32 * 10 | * License: See license * 11 | *------------------------------------------------------------------------* 12 | * Change Log: * 13 | * YYYY-MM-DD: What(by Who) * 14 | * 2008-11-07: created(by SimonQian) * 15 | * 2008-11-22: rewrite GPIO_Dir(by SimonQian) * 16 | **************************************************************************/ 17 | 18 | #ifndef HSE_VALUE 19 | #define HSE_VALUE ((uint32_t)12000000) 20 | #endif 21 | 22 | #define OSC_HZ HSE_VALUE 23 | 24 | #define USB_PULLUP_PORT 2 25 | #define USB_PULLUP_PIN 13 26 | -------------------------------------------------------------------------------- /vsf/old/example/vsfusbd_sdcd/proj/EWARM7.10_GD32/GD32F130x8.icf: -------------------------------------------------------------------------------- 1 | /*###ICF### Section handled by ICF editor, don't touch! ****/ 2 | /*-Editor annotation file-*/ 3 | /* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */ 4 | /*-Specials-*/ 5 | define symbol __ICFEDIT_intvec_start__ = 0x08000000; 6 | /*-Memory Regions-*/ 7 | define symbol __ICFEDIT_region_ROM_start__ = 0x08000000; 8 | define symbol __ICFEDIT_region_ROM_end__ = 0x0800FFFF; 9 | define symbol __ICFEDIT_region_SROM_start__= 0x08008000; 10 | define symbol __ICFEDIT_region_SROM_end__ = 0x0800FFFF; 11 | define symbol __ICFEDIT_region_RAM_start__ = 0x20000000; 12 | define symbol __ICFEDIT_region_RAM_end__ = 0x20001FFF; 13 | /*-Sizes-*/ 14 | define symbol __ICFEDIT_size_cstack__ = 0x800; 15 | define symbol __ICFEDIT_size_heap__ = 0; 16 | /**** End of ICF editor section. ###ICF###*/ 17 | 18 | define memory mem with size = 4G; 19 | define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFEDIT_region_ROM_end__]; 20 | define region SROM_region = mem:[from __ICFEDIT_region_SROM_start__ to __ICFEDIT_region_SROM_end__]; 21 | define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__]; 22 | 23 | define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { }; 24 | define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { }; 25 | 26 | initialize by copy { readwrite }; 27 | do not initialize { section .noinit }; 28 | 29 | place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec }; 30 | 31 | place in ROM_region { readonly }; 32 | /*place in SROM_region { readonly data };*/ 33 | place in RAM_region { readwrite, 34 | block CSTACK, block HEAP }; 35 | 36 | export symbol __ICFEDIT_region_RAM_start__; 37 | export symbol __ICFEDIT_region_RAM_end__; -------------------------------------------------------------------------------- /vsf/old/example/vsfusbd_sdcd/proj/EWARM7.10_GD32/app_cfg.h: -------------------------------------------------------------------------------- 1 | /************************************************************************** 2 | * Copyright (C) 2008 - 2012 by Simon Qian * 3 | * SimonQian@SimonQian.com * 4 | * * 5 | * Project: VSF * 6 | * File: app_cfg.h * 7 | * Author: SimonQian * 8 | * Versaion: See changelog * 9 | * Purpose: configuration file * 10 | * License: See license * 11 | *------------------------------------------------------------------------* 12 | * Change Log: * 13 | * YYYY-MM-DD: What(by Who) * 14 | * 2008-11-07: created(by SimonQian) * 15 | **************************************************************************/ 16 | 17 | // hardware config file 18 | #include "hw_cfg_GD32.h" 19 | 20 | // compiler config 21 | #include "compiler.h" 22 | 23 | #define APPCFG_VSFTIMER_NUM 16 24 | //#define APPCFG_VSFSM_PENDSVQ_LEN 16 25 | -------------------------------------------------------------------------------- /vsf/old/example/vsfusbd_sdcd/proj/EWARM7.10_GD32/app_hw_cfg.h: -------------------------------------------------------------------------------- 1 | struct app_hwcfg_t 2 | { 3 | struct 4 | { 5 | struct interface_gpio_pin_t pullup; 6 | } usbd; 7 | }; 8 | -------------------------------------------------------------------------------- /vsf/old/example/vsfusbd_sdcd/proj/EWARM7.10_GD32/demo.eww: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | $WS_DIR$\demo.ewp 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /vsf/old/example/vsfusbd_sdcd/proj/EWARM7.10_GD32/hw_cfg_GD32.h: -------------------------------------------------------------------------------- 1 | /************************************************************************** 2 | * Copyright (C) 2008 - 2012 by Simon Qian * 3 | * SimonQian@SimonQian.com * 4 | * * 5 | * Project: Versaloon * 6 | * File: hw_cfg_VSFCore_STM32.h * 7 | * Author: SimonQian * 8 | * Versaion: See changelog * 9 | * Purpose: hardware configuration file for VSFCore_STM32 * 10 | * License: See license * 11 | *------------------------------------------------------------------------* 12 | * Change Log: * 13 | * YYYY-MM-DD: What(by Who) * 14 | * 2008-11-07: created(by SimonQian) * 15 | * 2008-11-22: rewrite GPIO_Dir(by SimonQian) * 16 | **************************************************************************/ 17 | 18 | #define OSC_HZ ((uint32_t)12000000) 19 | 20 | #define USB_PULLUP_PORT 1 21 | #define USB_PULLUP_PIN 5 22 | -------------------------------------------------------------------------------- /vsf/old/example/vsfusbd_sdcd/proj/EWARM7.10_NV32/app_hw_cfg.h: -------------------------------------------------------------------------------- 1 | struct app_hwcfg_t 2 | { 3 | struct 4 | { 5 | struct interface_gpio_pin_t pullup; 6 | } usbd; 7 | }; 8 | -------------------------------------------------------------------------------- /vsf/old/example/vsfusbd_sdcd/proj/EWARM7.10_NV32/demo.eww: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | $WS_DIR$\demo.ewp 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /vsf/old/example/vsfusbd_sdcd/proj/EWARM7.10_NV32/hw_cfg_NV32.h: -------------------------------------------------------------------------------- 1 | /************************************************************************** 2 | * Copyright (C) 2008 - 2012 by Simon Qian * 3 | * SimonQian@SimonQian.com * 4 | * * 5 | * Project: Versaloon * 6 | * File: hw_cfg_VSFCore_STM32.h * 7 | * Author: SimonQian * 8 | * Versaion: See changelog * 9 | * Purpose: hardware configuration file for VSFCore_STM32 * 10 | * License: See license * 11 | *------------------------------------------------------------------------* 12 | * Change Log: * 13 | * YYYY-MM-DD: What(by Who) * 14 | * 2008-11-07: created(by SimonQian) * 15 | * 2008-11-22: rewrite GPIO_Dir(by SimonQian) * 16 | **************************************************************************/ 17 | 18 | #define OSC_HZ ((uint32_t)9600000) 19 | 20 | // for NV32, IRQ pin is multiplex with reset, there MUST be a pull-up resistor 21 | #define USB_PULLUP_PORT VSFHAL_DUMMY_PORT 22 | #define USB_PULLUP_PIN 5 23 | -------------------------------------------------------------------------------- /vsf/old/example/vsfusbd_sdcd/proj/EWARM7.10_NV32/nv32.icf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/versaloon/vsf_orig/387b344c4650415756de776866622b4c5e5266f8/vsf/old/example/vsfusbd_sdcd/proj/EWARM7.10_NV32/nv32.icf -------------------------------------------------------------------------------- /vsf/old/example/vsfusbd_sdcd/usrapp.h: -------------------------------------------------------------------------------- 1 | struct usrapp_t 2 | { 3 | const struct app_hwcfg_t *hwcfg; 4 | struct 5 | { 6 | struct usbd_cdc_t 7 | { 8 | struct vsfusbd_CDCACM_param_t param; 9 | struct vsf_fifostream_t stream_tx; 10 | struct vsf_fifostream_t stream_rx; 11 | uint8_t txbuff[65]; 12 | uint8_t rxbuff[65]; 13 | } cdc; 14 | 15 | struct vsfusbd_iface_t ifaces[2]; 16 | struct vsfusbd_config_t config[1]; 17 | struct vsfusbd_device_t device; 18 | } usbd; 19 | }; 20 | 21 | extern struct usrapp_t usrapp; 22 | 23 | void usrapp_nrt_init(struct usrapp_t *app); 24 | void usrapp_poll(struct usrapp_t *app); 25 | -------------------------------------------------------------------------------- /vsf/old/example/vsfusbh/proj/EWARM7.40_NUC505/app_cfg.h: -------------------------------------------------------------------------------- 1 | /************************************************************************** 2 | * Copyright (C) 2008 - 2012 by Simon Qian * 3 | * SimonQian@SimonQian.com * 4 | * * 5 | * Project: VSF * 6 | * File: app_cfg.h * 7 | * Author: SimonQian * 8 | * Versaion: See changelog * 9 | * Purpose: configuration file * 10 | * License: See license * 11 | *------------------------------------------------------------------------* 12 | * Change Log: * 13 | * YYYY-MM-DD: What(by Who) * 14 | * 2008-11-07: created(by SimonQian) * 15 | **************************************************************************/ 16 | 17 | // hardware config file 18 | #include "hw_cfg_NUC505.h" 19 | 20 | // compiler config 21 | #include "compiler.h" 22 | -------------------------------------------------------------------------------- /vsf/old/example/vsfusbh/proj/EWARM7.40_NUC505/demo.eww: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | $WS_DIR$\demo.ewp 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /vsf/old/example/vsfusbh/proj/EWARM7.40_NUC505/hw_cfg_nuc505.h: -------------------------------------------------------------------------------- 1 | /************************************************************************** 2 | * Copyright (C) 2008 - 2012 by Simon Qian * 3 | * SimonQian@SimonQian.com * 4 | * * 5 | * Project: Versaloon * 6 | * File: hw_cfg_VSFCore_STM32.h * 7 | * Author: SimonQian * 8 | * Versaion: See changelog * 9 | * Purpose: hardware configuration file for VSFCore_STM32 * 10 | * License: See license * 11 | *------------------------------------------------------------------------* 12 | * Change Log: * 13 | * YYYY-MM-DD: What(by Who) * 14 | * 2008-11-07: created(by SimonQian) * 15 | * 2008-11-22: rewrite GPIO_Dir(by SimonQian) * 16 | **************************************************************************/ 17 | 18 | 19 | -------------------------------------------------------------------------------- /vsf/old/example/vsfusbh/proj/EWARM7.40_STM32F401/app_cfg.h: -------------------------------------------------------------------------------- 1 | /************************************************************************** 2 | * Copyright (C) 2008 - 2012 by Simon Qian * 3 | * SimonQian@SimonQian.com * 4 | * * 5 | * Project: VSF * 6 | * File: app_cfg.h * 7 | * Author: SimonQian * 8 | * Versaion: See changelog * 9 | * Purpose: configuration file * 10 | * License: See license * 11 | *------------------------------------------------------------------------* 12 | * Change Log: * 13 | * YYYY-MM-DD: What(by Who) * 14 | * 2008-11-07: created(by SimonQian) * 15 | **************************************************************************/ 16 | 17 | // hardware config file 18 | #include "hw_cfg_STM32F4.h" 19 | 20 | // compiler config 21 | #include "compiler.h" 22 | 23 | #define PROJECT_GLOBAL_HEAP_SIZE (32 * 1024) 24 | -------------------------------------------------------------------------------- /vsf/old/example/vsfusbh/proj/EWARM7.40_STM32F401/demo.eww: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | $WS_DIR$\demo.ewp 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /vsf/old/example/vsfusbh/proj/EWARM7.40_STM32F401/hw_cfg_STM32F4.h: -------------------------------------------------------------------------------- 1 | /************************************************************************** 2 | * Copyright (C) 2008 - 2012 by Simon Qian * 3 | * SimonQian@SimonQian.com * 4 | * * 5 | * Project: Versaloon * 6 | * File: hw_cfg_VSFCore_STM32.h * 7 | * Author: SimonQian * 8 | * Versaion: See changelog * 9 | * Purpose: hardware configuration file for VSFCore_STM32 * 10 | * License: See license * 11 | *------------------------------------------------------------------------* 12 | * Change Log: * 13 | * YYYY-MM-DD: What(by Who) * 14 | * 2008-11-07: created(by SimonQian) * 15 | * 2008-11-22: rewrite GPIO_Dir(by SimonQian) * 16 | **************************************************************************/ 17 | 18 | -------------------------------------------------------------------------------- /vsf/old/example/vsfusbh/proj/EWARM7.40_STM32F401/vsf_cfg.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2009 - 2010 by Simon Qian * 3 | * * 4 | * This program is free software; you can redistribute it and/or modify * 5 | * it under the terms of the GNU General Public License as published by * 6 | * the Free Software Foundation; either version 2 of the License, or * 7 | * (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the * 16 | * Free Software Foundation, Inc., * 17 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 18 | ***************************************************************************/ 19 | 20 | // define the address of the api table 21 | #define VSFCFG_API_ADDR (SYS_MAIN_ADDR + 0x200) 22 | 23 | #define VSFCFG_DEBUG 24 | #define VSFCFG_DEBUG_INFO_LEN (80) 25 | #define VSFCFG_BUFMGR_LOG 26 | 27 | #define VSFCFG_BUFFER 28 | #define VSFCFG_LIST 29 | //#define VSFCFG_STREAM 30 | //#define VSFCFG_MAL 31 | //#define VSFCFG_SCSI 32 | //#define VSFCFG_FILE 33 | 34 | // include VSFCFG_STANDALONE_MODULE to compile the project as a module 35 | //#define VSFCFG_STANDALONE_MODULE 36 | 37 | // include VSFCFG_MODULE to enable module support 38 | //#define VSFCFG_MODULE 39 | 40 | // define VSFCFG_FUNC_XXXX to include corresponding func 41 | //#define VSFCFG_FUNC_USBD 42 | #define VSFCFG_FUNC_USBH 43 | //#define VSFCFG_FUNC_SHELL 44 | //#define VSFCFG_FUNC_TCPIP 45 | //#define VSFCFG_FUNC_BCMWIFI 46 | -------------------------------------------------------------------------------- /vsf/old/example/vsfusbh/proj/EWARM7.40_STM32F746G/app_cfg.h: -------------------------------------------------------------------------------- 1 | /************************************************************************** 2 | * Copyright (C) 2008 - 2012 by Simon Qian * 3 | * SimonQian@SimonQian.com * 4 | * * 5 | * Project: VSF * 6 | * File: app_cfg.h * 7 | * Author: SimonQian * 8 | * Versaion: See changelog * 9 | * Purpose: configuration file * 10 | * License: See license * 11 | *------------------------------------------------------------------------* 12 | * Change Log: * 13 | * YYYY-MM-DD: What(by Who) * 14 | * 2008-11-07: created(by SimonQian) * 15 | **************************************************************************/ 16 | 17 | // hardware config file 18 | #include "hw_cfg_STM32F7.h" 19 | 20 | // compiler config 21 | #include "compiler.h" 22 | 23 | #define PROJECT_GLOBAL_HEAP_SIZE (32 * 1024) 24 | -------------------------------------------------------------------------------- /vsf/old/example/vsfusbh/proj/EWARM7.40_STM32F746G/demo.eww: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | $WS_DIR$\demo.ewp 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /vsf/old/example/vsfusbh/proj/EWARM7.40_STM32F746G/hw_cfg_STM32F7.h: -------------------------------------------------------------------------------- 1 | /************************************************************************** 2 | * Copyright (C) 2008 - 2012 by Simon Qian * 3 | * SimonQian@SimonQian.com * 4 | * * 5 | * Project: Versaloon * 6 | * File: hw_cfg_VSFCore_STM32.h * 7 | * Author: SimonQian * 8 | * Versaion: See changelog * 9 | * Purpose: hardware configuration file for VSFCore_STM32 * 10 | * License: See license * 11 | *------------------------------------------------------------------------* 12 | * Change Log: * 13 | * YYYY-MM-DD: What(by Who) * 14 | * 2008-11-07: created(by SimonQian) * 15 | * 2008-11-22: rewrite GPIO_Dir(by SimonQian) * 16 | **************************************************************************/ 17 | 18 | -------------------------------------------------------------------------------- /vsf/old/example/vsfusbh/proj/EWARM7.40_STM32F746G/stm32f746xx_ITCM_flash.icf: -------------------------------------------------------------------------------- 1 | /*###ICF### Section handled by ICF editor, don't touch! ****/ 2 | /*-Editor annotation file-*/ 3 | /* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */ 4 | /*-Specials-*/ 5 | define symbol __ICFEDIT_intvec_start__ = 0x00200000; 6 | /*-Memory Regions-*/ 7 | define symbol __ICFEDIT_region_ROM_start__ = 0x00200000; 8 | define symbol __ICFEDIT_region_ROM_end__ = 0x002FFFFF; 9 | define symbol __ICFEDIT_region_RAM_start__ = 0x20000000; 10 | define symbol __ICFEDIT_region_RAM_end__ = 0x2004FFFF; 11 | define symbol __ICFEDIT_region_ITCMRAM_start__ = 0x00000000; 12 | define symbol __ICFEDIT_region_ITCMRAM_end__ = 0x00003FFF; 13 | /*-Sizes-*/ 14 | define symbol __ICFEDIT_size_cstack__ = 0x400; 15 | define symbol __ICFEDIT_size_heap__ = 0x200; 16 | /**** End of ICF editor section. ###ICF###*/ 17 | 18 | 19 | define memory mem with size = 4G; 20 | define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFEDIT_region_ROM_end__]; 21 | define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__]; 22 | define region ITCMRAM_region = mem:[from __ICFEDIT_region_ITCMRAM_start__ to __ICFEDIT_region_ITCMRAM_end__]; 23 | 24 | define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { }; 25 | define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { }; 26 | 27 | initialize by copy { readwrite }; 28 | do not initialize { section .noinit }; 29 | 30 | place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec }; 31 | 32 | place in ROM_region { readonly }; 33 | place in RAM_region { readwrite, 34 | block CSTACK, block HEAP }; -------------------------------------------------------------------------------- /vsf/old/example/vsfusbh/proj/EWARM7.40_STM32F746G/stm32f746xx_flash.icf: -------------------------------------------------------------------------------- 1 | /*###ICF### Section handled by ICF editor, don't touch! ****/ 2 | /*-Editor annotation file-*/ 3 | /* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */ 4 | /*-Specials-*/ 5 | define symbol __ICFEDIT_intvec_start__ = 0x08000000; 6 | /*-Memory Regions-*/ 7 | define symbol __ICFEDIT_region_ROM_start__ = 0x08000000; 8 | define symbol __ICFEDIT_region_ROM_end__ = 0x080FFFFF; 9 | define symbol __ICFEDIT_region_RAM_start__ = 0x20000000; 10 | define symbol __ICFEDIT_region_RAM_end__ = 0x2004FFFF; 11 | define symbol __ICFEDIT_region_ITCMRAM_start__ = 0x00000000; 12 | define symbol __ICFEDIT_region_ITCMRAM_end__ = 0x00003FFF; 13 | /*-Sizes-*/ 14 | define symbol __ICFEDIT_size_cstack__ = 0x400; 15 | define symbol __ICFEDIT_size_heap__ = 0x200; 16 | /**** End of ICF editor section. ###ICF###*/ 17 | 18 | 19 | define memory mem with size = 4G; 20 | define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFEDIT_region_ROM_end__]; 21 | define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__]; 22 | define region ITCMRAM_region = mem:[from __ICFEDIT_region_ITCMRAM_start__ to __ICFEDIT_region_ITCMRAM_end__]; 23 | 24 | define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { }; 25 | define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { }; 26 | 27 | initialize by copy { readwrite }; 28 | do not initialize { section .noinit }; 29 | 30 | place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec }; 31 | 32 | place in ROM_region { readonly }; 33 | place in RAM_region { readwrite, 34 | block CSTACK, block HEAP }; -------------------------------------------------------------------------------- /vsf/old/example/vsfusbh/proj/EWARM7.40_STM32F746G/stm32f746xx_sram.icf: -------------------------------------------------------------------------------- 1 | /*###ICF### Section handled by ICF editor, don't touch! ****/ 2 | /*-Editor annotation file-*/ 3 | /* IcfEditorFile="$TOOLKIT_DIR$\config\ide\IcfEditor\cortex_v1_0.xml" */ 4 | /*-Specials-*/ 5 | define symbol __ICFEDIT_intvec_start__ = 0x20000000; 6 | /*-Memory Regions-*/ 7 | define symbol __ICFEDIT_region_ROM_start__ = 0x20000000; 8 | define symbol __ICFEDIT_region_ROM_end__ = 0x2002FFFF; 9 | define symbol __ICFEDIT_region_RAM_start__ = 0x20030000; 10 | define symbol __ICFEDIT_region_RAM_end__ = 0x2004FFFF; 11 | define symbol __ICFEDIT_region_ITCMRAM_start__ = 0x00000000; 12 | define symbol __ICFEDIT_region_ITCMRAM_end__ = 0x00003FFF; 13 | /*-Sizes-*/ 14 | define symbol __ICFEDIT_size_cstack__ = 0x400; 15 | define symbol __ICFEDIT_size_heap__ = 0x200; 16 | /**** End of ICF editor section. ###ICF###*/ 17 | 18 | 19 | define memory mem with size = 4G; 20 | define region ROM_region = mem:[from __ICFEDIT_region_ROM_start__ to __ICFEDIT_region_ROM_end__]; 21 | define region RAM_region = mem:[from __ICFEDIT_region_RAM_start__ to __ICFEDIT_region_RAM_end__]; 22 | define region ITCMRAM_region = mem:[from __ICFEDIT_region_ITCMRAM_start__ to __ICFEDIT_region_ITCMRAM_end__]; 23 | 24 | define block CSTACK with alignment = 8, size = __ICFEDIT_size_cstack__ { }; 25 | define block HEAP with alignment = 8, size = __ICFEDIT_size_heap__ { }; 26 | 27 | initialize by copy { readwrite }; 28 | do not initialize { section .noinit }; 29 | 30 | place at address mem:__ICFEDIT_intvec_start__ { readonly section .intvec }; 31 | 32 | place in ROM_region { readonly }; 33 | place in RAM_region { readwrite, 34 | block CSTACK, block HEAP }; 35 | -------------------------------------------------------------------------------- /vsf/old/example/vsfusbh/proj/EWARM7.40_STM32F746G/vsf_cfg.h: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | * Copyright (C) 2009 - 2010 by Simon Qian * 3 | * * 4 | * This program is free software; you can redistribute it and/or modify * 5 | * it under the terms of the GNU General Public License as published by * 6 | * the Free Software Foundation; either version 2 of the License, or * 7 | * (at your option) any later version. * 8 | * * 9 | * This program is distributed in the hope that it will be useful, * 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 12 | * GNU General Public License for more details. * 13 | * * 14 | * You should have received a copy of the GNU General Public License * 15 | * along with this program; if not, write to the * 16 | * Free Software Foundation, Inc., * 17 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 18 | ***************************************************************************/ 19 | 20 | // define the address of the api table 21 | #define VSFCFG_API_ADDR (SYS_MAIN_ADDR + 0x200) 22 | 23 | #define VSFCFG_DEBUG 24 | #define VSFCFG_DEBUG_INFO_LEN (80) 25 | #define VSFCFG_BUFMGR_LOG 26 | 27 | #define VSFCFG_BUFFER 28 | #define VSFCFG_LIST 29 | //#define VSFCFG_STREAM 30 | //#define VSFCFG_MAL 31 | //#define VSFCFG_SCSI 32 | //#define VSFCFG_FILE 33 | 34 | // include VSFCFG_STANDALONE_MODULE to compile the project as a module 35 | //#define VSFCFG_STANDALONE_MODULE 36 | 37 | // include VSFCFG_MODULE to enable module support 38 | //#define VSFCFG_MODULE 39 | 40 | // define VSFCFG_FUNC_XXXX to include corresponding func 41 | //#define VSFCFG_FUNC_USBD 42 | #define VSFCFG_FUNC_USBH 43 | //#define VSFCFG_FUNC_SHELL 44 | //#define VSFCFG_FUNC_TCPIP 45 | //#define VSFCFG_FUNC_BCMWIFI 46 | -------------------------------------------------------------------------------- /vsf/old/example/vsfusbh/proj/Keil_v5_CMEM7/app_cfg.h: -------------------------------------------------------------------------------- 1 | /************************************************************************** 2 | * Copyright (C) 2008 - 2012 by Simon Qian * 3 | * SimonQian@SimonQian.com * 4 | * * 5 | * Project: VSF * 6 | * File: app_cfg.h * 7 | * Author: SimonQian * 8 | * Versaion: See changelog * 9 | * Purpose: configuration file * 10 | * License: See license * 11 | *------------------------------------------------------------------------* 12 | * Change Log: * 13 | * YYYY-MM-DD: What(by Who) * 14 | * 2008-11-07: created(by SimonQian) * 15 | **************************************************************************/ 16 | 17 | // hardware config file 18 | #include "hw_cfg_cmem7.h" 19 | 20 | // compiler config 21 | #include "compiler.h" 22 | 23 | #define PROJECT_GLOBAL_HEAP_SIZE (16 * 1024) 24 | -------------------------------------------------------------------------------- /vsf/old/example/vsfusbh/proj/Keil_v5_CMEM7/fpga/CME_M7_EVB_V12.apj: -------------------------------------------------------------------------------- 1 | 2 | 3 | CME_M7_EVB_V12 4 | M7A12N5F256C7 5 | top 6 | Default|Default 7 | 8 | 85 9 | 0 10 | 25 11 | worst 12 | 13 | 14 | 1 15 | 0 16 | 0 17 | 0 18 | x 19 | 20 | 21 | 0 22 | 23 | 0 24 | 0 25 | 1 26 | 6 27 | 0 28 | 1 29 | 0 30 | 31 | 1 32 | 0 33 | 1 34 | 1 35 | 1 36 | 4 37 | 4 38 | best_timing 39 | 1 40 | auto 41 | 42 | 43 | $(PRJ_DIR)/src/armcm3_v1.v 44 | $(PRJ_DIR)/src/pll_v1.v 45 | $(PRJ_DIR)/src/top.v 46 | 47 | 48 | -------------------------------------------------------------------------------- /vsf/old/example/vsfusbh/proj/Keil_v5_CMEM7/hw_cfg_cmem7.h: -------------------------------------------------------------------------------- 1 | /************************************************************************** 2 | * Copyright (C) 2008 - 2012 by Simon Qian * 3 | * SimonQian@SimonQian.com * 4 | * * 5 | * Project: Versaloon * 6 | * File: hw_cfg_VSFCore_STM32.h * 7 | * Author: SimonQian * 8 | * Versaion: See changelog * 9 | * Purpose: hardware configuration file for VSFCore_STM32 * 10 | * License: See license * 11 | *------------------------------------------------------------------------* 12 | * Change Log: * 13 | * YYYY-MM-DD: What(by Who) * 14 | * 2008-11-07: created(by SimonQian) * 15 | * 2008-11-22: rewrite GPIO_Dir(by SimonQian) * 16 | **************************************************************************/ 17 | 18 | 19 | -------------------------------------------------------------------------------- /vsf/old/example/vsfusbh/proj/Keil_v5_CMEM7/sch/cme-m7-evb_v1,1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/versaloon/vsf_orig/387b344c4650415756de776866622b4c5e5266f8/vsf/old/example/vsfusbh/proj/Keil_v5_CMEM7/sch/cme-m7-evb_v1,1.pdf -------------------------------------------------------------------------------- /vsf/old/example/vsfusbh/proj/Keil_v5_CMEM7/vsfhal_cfg.h: -------------------------------------------------------------------------------- 1 | /************************************************************************** 2 | * Copyright (C) 2008 - 2010 by Simon Qian * 3 | * SimonQian@SimonQian.com * 4 | * * 5 | * Project: Versaloon * 6 | * File: interfaces.h * 7 | * Author: SimonQian * 8 | * Versaion: See changelog * 9 | * Purpose: interfaces header file * 10 | * License: See license * 11 | *------------------------------------------------------------------------* 12 | * Change Log: * 13 | * YYYY-MM-DD: What(by Who) * 14 | * 2008-11-07: created(by SimonQian) * 15 | **************************************************************************/ 16 | 17 | #ifndef CORE_VECTOR_TABLE 18 | # define CORE_VECTOR_TABLE (0x08000000) 19 | #endif 20 | 21 | #define VSFHAL_FLASH_EN 0 22 | #define VSFHAL_USART_EN 1 23 | #define VSFHAL_SPI_EN 0 24 | #define VSFHAL_ADC_EN 0 25 | #define VSFHAL_GPIO_EN 0 26 | #define VSFHAL_I2C_EN 0 27 | #define VSFHAL_PWM_EN 0 28 | #define VSFHAL_MICROWIRE_EN 0 29 | #define VSFHAL_TIMER_EN 0 30 | #define VSFHAL_EINT_EN 0 31 | #define VSFHAL_EBI_EN 0 32 | #define VSFHAL_SDIO_EN 0 33 | #define VSFHAL_USBD_EN 0 34 | #define VSFHAL_HCD_EN 1 35 | 36 | -------------------------------------------------------------------------------- /vsf/vsf_err.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef __VSF_ERR_H_INCLUDED__ 3 | #define __VSF_ERR_H_INCLUDED__ 4 | 5 | #include "vsf_basetype.h" 6 | 7 | typedef vsf_int_t vsf_err_t; 8 | 9 | #define VSFERR_NOT_READY 1 10 | #define VSFERR_NONE 0 11 | #define VSFERR_NOT_SUPPORT -1 12 | #define VSFERR_NOT_AVAILABLE -3 13 | #define VSFERR_NOT_ACCESSABLE -4 14 | #define VSFERR_NOT_ENOUGH_RESOURCES -5 15 | #define VSFERR_FAIL -6 16 | #define VSFERR_INVALID_PARAMETER -7 17 | #define VSFERR_INVALID_RANGE -8 18 | #define VSFERR_INVALID_PTR -9 19 | #define VSFERR_IO -10 20 | #define VSFERR_BUG -11 21 | #define VSFERR_UNKNOWN -100 22 | 23 | #endif // __VSF_ERR_H_INCLUDED__ 24 | --------------------------------------------------------------------------------