├── .gitattributes ├── LICENSE ├── README.md ├── demo ├── env │ ├── stm32f10x │ │ ├── README.md │ │ ├── non_os │ │ │ ├── EWARM │ │ │ │ ├── .gitignore │ │ │ │ ├── EasyFlash.ewp │ │ │ │ └── EasyFlash.eww │ │ │ ├── Libraries │ │ │ │ ├── CMSIS_EWARM │ │ │ │ │ ├── CM3 │ │ │ │ │ │ └── DeviceSupport │ │ │ │ │ │ │ └── ST │ │ │ │ │ │ │ └── STM32F10x │ │ │ │ │ │ │ ├── Release_Notes.html │ │ │ │ │ │ │ ├── startup │ │ │ │ │ │ │ └── iar │ │ │ │ │ │ │ │ ├── startup_stm32f10x_cl.s │ │ │ │ │ │ │ │ ├── startup_stm32f10x_hd.s │ │ │ │ │ │ │ │ ├── startup_stm32f10x_hd_vl.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 │ │ │ │ │ │ │ ├── system_stm32f10x.c │ │ │ │ │ │ │ └── system_stm32f10x.h │ │ │ │ │ ├── CMSIS END USER LICENCE AGREEMENT.pdf │ │ │ │ │ ├── CMSIS debug support.htm │ │ │ │ │ ├── CMSIS_changes.htm │ │ │ │ │ ├── Documentation │ │ │ │ │ │ └── CMSIS_Core.htm │ │ │ │ │ ├── Include │ │ │ │ │ │ ├── arm_common_tables.h │ │ │ │ │ │ ├── arm_math.h │ │ │ │ │ │ ├── core_cm0.h │ │ │ │ │ │ ├── core_cm0plus.h │ │ │ │ │ │ ├── core_cm3.h │ │ │ │ │ │ ├── core_cm4.h │ │ │ │ │ │ ├── core_cm4_simd.h │ │ │ │ │ │ ├── core_cmFunc.h │ │ │ │ │ │ ├── core_cmInstr.h │ │ │ │ │ │ ├── core_sc000.h │ │ │ │ │ │ └── core_sc300.h │ │ │ │ │ ├── License.doc │ │ │ │ │ ├── README.txt │ │ │ │ │ ├── index.htm │ │ │ │ │ └── readme_patch.txt │ │ │ │ ├── CMSIS_RVMDK │ │ │ │ │ ├── CM3 │ │ │ │ │ │ ├── CoreSupport │ │ │ │ │ │ │ ├── core_cm3.c │ │ │ │ │ │ │ └── core_cm3.h │ │ │ │ │ │ └── DeviceSupport │ │ │ │ │ │ │ └── ST │ │ │ │ │ │ │ ├── Release_Notes_for_STM32F10x_CMSIS.html │ │ │ │ │ │ │ └── STM32F10x │ │ │ │ │ │ │ ├── Release_Notes.html │ │ │ │ │ │ │ ├── startup │ │ │ │ │ │ │ └── arm │ │ │ │ │ │ │ │ ├── startup_stm32f10x_cl.s │ │ │ │ │ │ │ │ ├── startup_stm32f10x_hd.s │ │ │ │ │ │ │ │ ├── startup_stm32f10x_hd_vl.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 │ │ │ │ │ │ │ ├── system_stm32f10x.c │ │ │ │ │ │ │ └── system_stm32f10x.h │ │ │ │ │ ├── CMSIS debug support.htm │ │ │ │ │ ├── CMSIS_changes.htm │ │ │ │ │ ├── Documentation │ │ │ │ │ │ └── CMSIS_Core.htm │ │ │ │ │ └── License.doc │ │ │ │ ├── SConscript │ │ │ │ └── STM32F10x_StdPeriph_Driver │ │ │ │ │ ├── Release_Notes.html │ │ │ │ │ ├── Release_Notes_for_STM32F10x_StdPeriph_Driver.html │ │ │ │ │ ├── inc │ │ │ │ │ ├── misc.h │ │ │ │ │ ├── stm32f10x_adc.h │ │ │ │ │ ├── stm32f10x_bkp.h │ │ │ │ │ ├── stm32f10x_can.h │ │ │ │ │ ├── stm32f10x_cec.h │ │ │ │ │ ├── stm32f10x_crc.h │ │ │ │ │ ├── stm32f10x_dac.h │ │ │ │ │ ├── stm32f10x_dbgmcu.h │ │ │ │ │ ├── stm32f10x_dma.h │ │ │ │ │ ├── stm32f10x_exti.h │ │ │ │ │ ├── stm32f10x_flash.h │ │ │ │ │ ├── stm32f10x_fsmc.h │ │ │ │ │ ├── stm32f10x_gpio.h │ │ │ │ │ ├── stm32f10x_i2c.h │ │ │ │ │ ├── stm32f10x_iwdg.h │ │ │ │ │ ├── stm32f10x_pwr.h │ │ │ │ │ ├── stm32f10x_rcc.h │ │ │ │ │ ├── stm32f10x_rtc.h │ │ │ │ │ ├── stm32f10x_sdio.h │ │ │ │ │ ├── stm32f10x_spi.h │ │ │ │ │ ├── stm32f10x_tim.h │ │ │ │ │ ├── stm32f10x_usart.h │ │ │ │ │ └── stm32f10x_wwdg.h │ │ │ │ │ └── src │ │ │ │ │ ├── misc.c │ │ │ │ │ ├── stm32f10x_adc.c │ │ │ │ │ ├── stm32f10x_bkp.c │ │ │ │ │ ├── stm32f10x_can.c │ │ │ │ │ ├── stm32f10x_cec.c │ │ │ │ │ ├── stm32f10x_crc.c │ │ │ │ │ ├── stm32f10x_dac.c │ │ │ │ │ ├── stm32f10x_dbgmcu.c │ │ │ │ │ ├── stm32f10x_dma.c │ │ │ │ │ ├── stm32f10x_exti.c │ │ │ │ │ ├── stm32f10x_flash.c │ │ │ │ │ ├── stm32f10x_fsmc.c │ │ │ │ │ ├── stm32f10x_gpio.c │ │ │ │ │ ├── stm32f10x_i2c.c │ │ │ │ │ ├── stm32f10x_iwdg.c │ │ │ │ │ ├── stm32f10x_pwr.c │ │ │ │ │ ├── stm32f10x_rcc.c │ │ │ │ │ ├── stm32f10x_rtc.c │ │ │ │ │ ├── stm32f10x_sdio.c │ │ │ │ │ ├── stm32f10x_spi.c │ │ │ │ │ ├── stm32f10x_tim.c │ │ │ │ │ ├── stm32f10x_usart.c │ │ │ │ │ └── stm32f10x_wwdg.c │ │ │ ├── README.md │ │ │ ├── RVMDK │ │ │ │ ├── .gitignore │ │ │ │ ├── EasyFlash.uvopt │ │ │ │ └── EasyFlash.uvproj │ │ │ ├── app │ │ │ │ ├── inc │ │ │ │ │ ├── stm32f10x_conf.h │ │ │ │ │ └── stm32f10x_it.h │ │ │ │ └── src │ │ │ │ │ ├── app.c │ │ │ │ │ └── stm32f10x_it.c │ │ │ └── components │ │ │ │ ├── easyflash │ │ │ │ ├── inc │ │ │ │ │ └── ef_cfg.h │ │ │ │ └── port │ │ │ │ │ └── ef_port.c │ │ │ │ └── others │ │ │ │ ├── bsp.c │ │ │ │ ├── bsp.h │ │ │ │ ├── stm32f103xB.icf │ │ │ │ ├── stm32f103xE.icf │ │ │ │ └── types.h │ │ ├── non_os_spi_flash │ │ │ ├── EWARM │ │ │ │ ├── .gitignore │ │ │ │ ├── EasyFlash.ewp │ │ │ │ ├── EasyFlash.ewt │ │ │ │ └── EasyFlash.eww │ │ │ ├── Libraries │ │ │ │ ├── CMSIS_EWARM │ │ │ │ │ ├── CM3 │ │ │ │ │ │ └── DeviceSupport │ │ │ │ │ │ │ └── ST │ │ │ │ │ │ │ └── STM32F10x │ │ │ │ │ │ │ ├── Release_Notes.html │ │ │ │ │ │ │ ├── startup │ │ │ │ │ │ │ └── iar │ │ │ │ │ │ │ │ ├── startup_stm32f10x_cl.s │ │ │ │ │ │ │ │ ├── startup_stm32f10x_hd.s │ │ │ │ │ │ │ │ ├── startup_stm32f10x_hd_vl.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 │ │ │ │ │ │ │ ├── system_stm32f10x.c │ │ │ │ │ │ │ └── system_stm32f10x.h │ │ │ │ │ ├── CMSIS END USER LICENCE AGREEMENT.pdf │ │ │ │ │ ├── CMSIS debug support.htm │ │ │ │ │ ├── CMSIS_changes.htm │ │ │ │ │ ├── Documentation │ │ │ │ │ │ └── CMSIS_Core.htm │ │ │ │ │ ├── Include │ │ │ │ │ │ ├── arm_common_tables.h │ │ │ │ │ │ ├── arm_math.h │ │ │ │ │ │ ├── core_cm0.h │ │ │ │ │ │ ├── core_cm0plus.h │ │ │ │ │ │ ├── core_cm3.h │ │ │ │ │ │ ├── core_cm4.h │ │ │ │ │ │ ├── core_cm4_simd.h │ │ │ │ │ │ ├── core_cmFunc.h │ │ │ │ │ │ ├── core_cmInstr.h │ │ │ │ │ │ ├── core_sc000.h │ │ │ │ │ │ └── core_sc300.h │ │ │ │ │ ├── License.doc │ │ │ │ │ ├── README.txt │ │ │ │ │ ├── index.htm │ │ │ │ │ └── readme_patch.txt │ │ │ │ ├── CMSIS_RVMDK │ │ │ │ │ ├── CM3 │ │ │ │ │ │ ├── CoreSupport │ │ │ │ │ │ │ ├── core_cm3.c │ │ │ │ │ │ │ └── core_cm3.h │ │ │ │ │ │ └── DeviceSupport │ │ │ │ │ │ │ └── ST │ │ │ │ │ │ │ ├── Release_Notes_for_STM32F10x_CMSIS.html │ │ │ │ │ │ │ └── STM32F10x │ │ │ │ │ │ │ ├── Release_Notes.html │ │ │ │ │ │ │ ├── startup │ │ │ │ │ │ │ └── arm │ │ │ │ │ │ │ │ ├── startup_stm32f10x_cl.s │ │ │ │ │ │ │ │ ├── startup_stm32f10x_hd.s │ │ │ │ │ │ │ │ ├── startup_stm32f10x_hd_vl.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 │ │ │ │ │ │ │ ├── system_stm32f10x.c │ │ │ │ │ │ │ └── system_stm32f10x.h │ │ │ │ │ ├── CMSIS debug support.htm │ │ │ │ │ ├── CMSIS_changes.htm │ │ │ │ │ ├── Documentation │ │ │ │ │ │ └── CMSIS_Core.htm │ │ │ │ │ └── License.doc │ │ │ │ ├── SConscript │ │ │ │ └── STM32F10x_StdPeriph_Driver │ │ │ │ │ ├── Release_Notes.html │ │ │ │ │ ├── Release_Notes_for_STM32F10x_StdPeriph_Driver.html │ │ │ │ │ ├── inc │ │ │ │ │ ├── misc.h │ │ │ │ │ ├── stm32f10x_adc.h │ │ │ │ │ ├── stm32f10x_bkp.h │ │ │ │ │ ├── stm32f10x_can.h │ │ │ │ │ ├── stm32f10x_cec.h │ │ │ │ │ ├── stm32f10x_crc.h │ │ │ │ │ ├── stm32f10x_dac.h │ │ │ │ │ ├── stm32f10x_dbgmcu.h │ │ │ │ │ ├── stm32f10x_dma.h │ │ │ │ │ ├── stm32f10x_exti.h │ │ │ │ │ ├── stm32f10x_flash.h │ │ │ │ │ ├── stm32f10x_fsmc.h │ │ │ │ │ ├── stm32f10x_gpio.h │ │ │ │ │ ├── stm32f10x_i2c.h │ │ │ │ │ ├── stm32f10x_iwdg.h │ │ │ │ │ ├── stm32f10x_pwr.h │ │ │ │ │ ├── stm32f10x_rcc.h │ │ │ │ │ ├── stm32f10x_rtc.h │ │ │ │ │ ├── stm32f10x_sdio.h │ │ │ │ │ ├── stm32f10x_spi.h │ │ │ │ │ ├── stm32f10x_tim.h │ │ │ │ │ ├── stm32f10x_usart.h │ │ │ │ │ └── stm32f10x_wwdg.h │ │ │ │ │ └── src │ │ │ │ │ ├── misc.c │ │ │ │ │ ├── stm32f10x_adc.c │ │ │ │ │ ├── stm32f10x_bkp.c │ │ │ │ │ ├── stm32f10x_can.c │ │ │ │ │ ├── stm32f10x_cec.c │ │ │ │ │ ├── stm32f10x_crc.c │ │ │ │ │ ├── stm32f10x_dac.c │ │ │ │ │ ├── stm32f10x_dbgmcu.c │ │ │ │ │ ├── stm32f10x_dma.c │ │ │ │ │ ├── stm32f10x_exti.c │ │ │ │ │ ├── stm32f10x_flash.c │ │ │ │ │ ├── stm32f10x_fsmc.c │ │ │ │ │ ├── stm32f10x_gpio.c │ │ │ │ │ ├── stm32f10x_i2c.c │ │ │ │ │ ├── stm32f10x_iwdg.c │ │ │ │ │ ├── stm32f10x_pwr.c │ │ │ │ │ ├── stm32f10x_rcc.c │ │ │ │ │ ├── stm32f10x_rtc.c │ │ │ │ │ ├── stm32f10x_sdio.c │ │ │ │ │ ├── stm32f10x_spi.c │ │ │ │ │ ├── stm32f10x_tim.c │ │ │ │ │ ├── stm32f10x_usart.c │ │ │ │ │ └── stm32f10x_wwdg.c │ │ │ ├── README.md │ │ │ ├── RVMDK │ │ │ │ ├── .gitignore │ │ │ │ ├── EasyFlash.uvopt │ │ │ │ └── EasyFlash.uvproj │ │ │ ├── app │ │ │ │ ├── inc │ │ │ │ │ ├── stm32f10x_conf.h │ │ │ │ │ └── stm32f10x_it.h │ │ │ │ └── src │ │ │ │ │ ├── app.c │ │ │ │ │ └── stm32f10x_it.c │ │ │ └── components │ │ │ │ ├── easyflash │ │ │ │ ├── inc │ │ │ │ │ └── ef_cfg.h │ │ │ │ └── port │ │ │ │ │ └── ef_port.c │ │ │ │ ├── others │ │ │ │ ├── bsp.c │ │ │ │ ├── bsp.h │ │ │ │ ├── stm32f103xB.icf │ │ │ │ ├── stm32f103xE.icf │ │ │ │ └── types.h │ │ │ │ └── sfud │ │ │ │ ├── LICENSE │ │ │ │ ├── README.md │ │ │ │ ├── inc │ │ │ │ ├── sfud.h │ │ │ │ ├── sfud_cfg.h │ │ │ │ ├── sfud_def.h │ │ │ │ └── sfud_flash_def.h │ │ │ │ ├── port │ │ │ │ └── sfud_port.c │ │ │ │ └── src │ │ │ │ ├── sfud.c │ │ │ │ └── sfud_sfdp.c │ │ └── rtt │ │ │ ├── EWARM │ │ │ ├── .gitignore │ │ │ ├── EasyFlash.ewp │ │ │ └── EasyFlash.eww │ │ │ ├── Libraries │ │ │ ├── CMSIS_EWARM │ │ │ │ ├── CM3 │ │ │ │ │ └── DeviceSupport │ │ │ │ │ │ └── ST │ │ │ │ │ │ └── STM32F10x │ │ │ │ │ │ ├── Release_Notes.html │ │ │ │ │ │ ├── startup │ │ │ │ │ │ └── iar │ │ │ │ │ │ │ ├── startup_stm32f10x_cl.s │ │ │ │ │ │ │ ├── startup_stm32f10x_hd.s │ │ │ │ │ │ │ ├── startup_stm32f10x_hd_vl.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 │ │ │ │ │ │ ├── system_stm32f10x.c │ │ │ │ │ │ └── system_stm32f10x.h │ │ │ │ ├── CMSIS END USER LICENCE AGREEMENT.pdf │ │ │ │ ├── CMSIS debug support.htm │ │ │ │ ├── CMSIS_changes.htm │ │ │ │ ├── Documentation │ │ │ │ │ └── CMSIS_Core.htm │ │ │ │ ├── Include │ │ │ │ │ ├── arm_common_tables.h │ │ │ │ │ ├── arm_math.h │ │ │ │ │ ├── core_cm0.h │ │ │ │ │ ├── core_cm0plus.h │ │ │ │ │ ├── core_cm3.h │ │ │ │ │ ├── core_cm4.h │ │ │ │ │ ├── core_cm4_simd.h │ │ │ │ │ ├── core_cmFunc.h │ │ │ │ │ ├── core_cmInstr.h │ │ │ │ │ ├── core_sc000.h │ │ │ │ │ └── core_sc300.h │ │ │ │ ├── License.doc │ │ │ │ ├── README.txt │ │ │ │ ├── index.htm │ │ │ │ └── readme_patch.txt │ │ │ ├── CMSIS_RVMDK │ │ │ │ ├── CM3 │ │ │ │ │ ├── CoreSupport │ │ │ │ │ │ ├── core_cm3.c │ │ │ │ │ │ └── core_cm3.h │ │ │ │ │ └── DeviceSupport │ │ │ │ │ │ └── ST │ │ │ │ │ │ ├── Release_Notes_for_STM32F10x_CMSIS.html │ │ │ │ │ │ └── STM32F10x │ │ │ │ │ │ ├── Release_Notes.html │ │ │ │ │ │ ├── startup │ │ │ │ │ │ └── arm │ │ │ │ │ │ │ ├── startup_stm32f10x_cl.s │ │ │ │ │ │ │ ├── startup_stm32f10x_hd.s │ │ │ │ │ │ │ ├── startup_stm32f10x_hd_vl.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 │ │ │ │ │ │ ├── system_stm32f10x.c │ │ │ │ │ │ └── system_stm32f10x.h │ │ │ │ ├── CMSIS debug support.htm │ │ │ │ ├── CMSIS_changes.htm │ │ │ │ ├── Documentation │ │ │ │ │ └── CMSIS_Core.htm │ │ │ │ └── License.doc │ │ │ ├── SConscript │ │ │ └── STM32F10x_StdPeriph_Driver │ │ │ │ ├── Release_Notes.html │ │ │ │ ├── Release_Notes_for_STM32F10x_StdPeriph_Driver.html │ │ │ │ ├── inc │ │ │ │ ├── misc.h │ │ │ │ ├── stm32f10x_adc.h │ │ │ │ ├── stm32f10x_bkp.h │ │ │ │ ├── stm32f10x_can.h │ │ │ │ ├── stm32f10x_cec.h │ │ │ │ ├── stm32f10x_crc.h │ │ │ │ ├── stm32f10x_dac.h │ │ │ │ ├── stm32f10x_dbgmcu.h │ │ │ │ ├── stm32f10x_dma.h │ │ │ │ ├── stm32f10x_exti.h │ │ │ │ ├── stm32f10x_flash.h │ │ │ │ ├── stm32f10x_fsmc.h │ │ │ │ ├── stm32f10x_gpio.h │ │ │ │ ├── stm32f10x_i2c.h │ │ │ │ ├── stm32f10x_iwdg.h │ │ │ │ ├── stm32f10x_pwr.h │ │ │ │ ├── stm32f10x_rcc.h │ │ │ │ ├── stm32f10x_rtc.h │ │ │ │ ├── stm32f10x_sdio.h │ │ │ │ ├── stm32f10x_spi.h │ │ │ │ ├── stm32f10x_tim.h │ │ │ │ ├── stm32f10x_usart.h │ │ │ │ └── stm32f10x_wwdg.h │ │ │ │ └── src │ │ │ │ ├── misc.c │ │ │ │ ├── stm32f10x_adc.c │ │ │ │ ├── stm32f10x_bkp.c │ │ │ │ ├── stm32f10x_can.c │ │ │ │ ├── stm32f10x_cec.c │ │ │ │ ├── stm32f10x_crc.c │ │ │ │ ├── stm32f10x_dac.c │ │ │ │ ├── stm32f10x_dbgmcu.c │ │ │ │ ├── stm32f10x_dma.c │ │ │ │ ├── stm32f10x_exti.c │ │ │ │ ├── stm32f10x_flash.c │ │ │ │ ├── stm32f10x_fsmc.c │ │ │ │ ├── stm32f10x_gpio.c │ │ │ │ ├── stm32f10x_i2c.c │ │ │ │ ├── stm32f10x_iwdg.c │ │ │ │ ├── stm32f10x_pwr.c │ │ │ │ ├── stm32f10x_rcc.c │ │ │ │ ├── stm32f10x_rtc.c │ │ │ │ ├── stm32f10x_sdio.c │ │ │ │ ├── stm32f10x_spi.c │ │ │ │ ├── stm32f10x_tim.c │ │ │ │ ├── stm32f10x_usart.c │ │ │ │ └── stm32f10x_wwdg.c │ │ │ ├── README.md │ │ │ ├── RT-Thread-1.2.2 │ │ │ ├── AUTHORS │ │ │ ├── COPYING │ │ │ ├── components │ │ │ │ ├── SConscript │ │ │ │ ├── drivers │ │ │ │ │ ├── SConscript │ │ │ │ │ ├── include │ │ │ │ │ │ ├── drivers │ │ │ │ │ │ │ ├── alarm.h │ │ │ │ │ │ │ ├── i2c-bit-ops.h │ │ │ │ │ │ │ ├── i2c.h │ │ │ │ │ │ │ ├── i2c_dev.h │ │ │ │ │ │ │ ├── mmcsd_card.h │ │ │ │ │ │ │ ├── mmcsd_cmd.h │ │ │ │ │ │ │ ├── mmcsd_core.h │ │ │ │ │ │ │ ├── mmcsd_host.h │ │ │ │ │ │ │ ├── mtd_nand.h │ │ │ │ │ │ │ ├── mtd_nor.h │ │ │ │ │ │ │ ├── rtc.h │ │ │ │ │ │ │ ├── sd.h │ │ │ │ │ │ │ ├── sdio.h │ │ │ │ │ │ │ ├── sdio_func_ids.h │ │ │ │ │ │ │ ├── serial.h │ │ │ │ │ │ │ ├── spi.h │ │ │ │ │ │ │ ├── usb_common.h │ │ │ │ │ │ │ ├── usb_device.h │ │ │ │ │ │ │ └── usb_host.h │ │ │ │ │ │ └── rtdevice.h │ │ │ │ │ ├── serial │ │ │ │ │ │ ├── SConscript │ │ │ │ │ │ └── serial.c │ │ │ │ │ └── src │ │ │ │ │ │ ├── SConscript │ │ │ │ │ │ ├── completion.c │ │ │ │ │ │ ├── dataqueue.c │ │ │ │ │ │ ├── pipe.c │ │ │ │ │ │ ├── portal.c │ │ │ │ │ │ ├── ringbuffer.c │ │ │ │ │ │ └── wrokqueue.c │ │ │ │ └── finsh │ │ │ │ │ ├── SConscript │ │ │ │ │ ├── cmd.c │ │ │ │ │ ├── finsh.h │ │ │ │ │ ├── finsh_compiler.c │ │ │ │ │ ├── finsh_error.c │ │ │ │ │ ├── finsh_error.h │ │ │ │ │ ├── finsh_heap.c │ │ │ │ │ ├── finsh_heap.h │ │ │ │ │ ├── finsh_init.c │ │ │ │ │ ├── finsh_node.c │ │ │ │ │ ├── finsh_node.h │ │ │ │ │ ├── finsh_ops.c │ │ │ │ │ ├── finsh_ops.h │ │ │ │ │ ├── finsh_parser.c │ │ │ │ │ ├── finsh_parser.h │ │ │ │ │ ├── finsh_token.c │ │ │ │ │ ├── finsh_token.h │ │ │ │ │ ├── finsh_var.c │ │ │ │ │ ├── finsh_var.h │ │ │ │ │ ├── finsh_vm.c │ │ │ │ │ ├── finsh_vm.h │ │ │ │ │ ├── msh.c │ │ │ │ │ ├── msh.h │ │ │ │ │ ├── msh_cmd.c │ │ │ │ │ ├── shell.c │ │ │ │ │ ├── shell.h │ │ │ │ │ └── symbol.c │ │ │ ├── include │ │ │ │ ├── cpuusage.h │ │ │ │ ├── rtdebug.h │ │ │ │ ├── rtdef.h │ │ │ │ ├── rthw.h │ │ │ │ ├── rtm.h │ │ │ │ ├── rtservice.h │ │ │ │ └── rtthread.h │ │ │ ├── libcpu │ │ │ │ ├── SConscript │ │ │ │ └── arm │ │ │ │ │ └── cortex-m3 │ │ │ │ │ ├── context_gcc.S │ │ │ │ │ ├── context_iar.S │ │ │ │ │ ├── context_rvds.S │ │ │ │ │ └── cpuport.c │ │ │ └── src │ │ │ │ ├── SConscript │ │ │ │ ├── clock.c │ │ │ │ ├── cpuusage.c │ │ │ │ ├── device.c │ │ │ │ ├── idle.c │ │ │ │ ├── ipc.c │ │ │ │ ├── irq.c │ │ │ │ ├── kservice.c │ │ │ │ ├── mem.c │ │ │ │ ├── memheap.c │ │ │ │ ├── mempool.c │ │ │ │ ├── module.c │ │ │ │ ├── module.h │ │ │ │ ├── object.c │ │ │ │ ├── scheduler.c │ │ │ │ ├── slab.c │ │ │ │ ├── thread.c │ │ │ │ └── timer.c │ │ │ ├── RVMDK │ │ │ ├── .gitignore │ │ │ ├── EasyFlash.uvopt │ │ │ └── EasyFlash.uvproj │ │ │ ├── app │ │ │ ├── inc │ │ │ │ ├── app_task.h │ │ │ │ ├── delay_conf.h │ │ │ │ ├── rtconfig.h │ │ │ │ ├── stm32f10x_conf.h │ │ │ │ └── stm32f10x_it.h │ │ │ └── src │ │ │ │ ├── app.c │ │ │ │ ├── app_task.c │ │ │ │ ├── stm32f10x_it.c │ │ │ │ └── user_finsh_cmd.c │ │ │ └── components │ │ │ ├── easyflash │ │ │ ├── inc │ │ │ │ └── ef_cfg.h │ │ │ └── port │ │ │ │ └── ef_port.c │ │ │ ├── others │ │ │ ├── bsp.c │ │ │ ├── bsp.h │ │ │ ├── stm32f103xB.icf │ │ │ ├── stm32f103xE.icf │ │ │ ├── types.h │ │ │ ├── utils.c │ │ │ └── utils.h │ │ │ └── rtt_uart │ │ │ ├── usart.c │ │ │ └── usart.h │ └── stm32f4xx │ │ ├── EWARM │ │ ├── .gitignore │ │ ├── EasyFlash.ewp │ │ ├── EasyFlash.ewt │ │ └── EasyFlash.eww │ │ ├── Libraries │ │ ├── CMSIS │ │ │ ├── CMSIS_END_USER_LICENCE_AGREEMENT.pdf │ │ │ ├── CMSIS_END_USER_LICENCE_AGREEMENT.rtf │ │ │ ├── Device │ │ │ │ └── ST │ │ │ │ │ └── STM32F4xx │ │ │ │ │ ├── Include │ │ │ │ │ ├── stm32f4xx.h │ │ │ │ │ └── system_stm32f4xx.h │ │ │ │ │ ├── Release_Notes.html │ │ │ │ │ └── Source │ │ │ │ │ └── Templates │ │ │ │ │ ├── TASKING │ │ │ │ │ └── cstart_thumb2.asm │ │ │ │ │ ├── TrueSTUDIO │ │ │ │ │ ├── startup_stm32f401xx.s │ │ │ │ │ ├── startup_stm32f40_41xxx.s │ │ │ │ │ ├── startup_stm32f40xx.s │ │ │ │ │ ├── startup_stm32f411xe.s │ │ │ │ │ ├── startup_stm32f427_437xx.s │ │ │ │ │ ├── startup_stm32f427xx.s │ │ │ │ │ ├── startup_stm32f429_439xx.s │ │ │ │ │ └── startup_stm32f446xx.s │ │ │ │ │ ├── arm │ │ │ │ │ ├── startup_stm32f401xx.s │ │ │ │ │ ├── startup_stm32f40_41xxx.s │ │ │ │ │ ├── startup_stm32f40xx.s │ │ │ │ │ ├── startup_stm32f411xe.s │ │ │ │ │ ├── startup_stm32f427_437xx.s │ │ │ │ │ ├── startup_stm32f427x.s │ │ │ │ │ ├── startup_stm32f429_439xx.s │ │ │ │ │ └── startup_stm32f446xx.s │ │ │ │ │ ├── gcc_ride7 │ │ │ │ │ ├── startup_stm32f401xx.s │ │ │ │ │ ├── startup_stm32f40_41xxx.s │ │ │ │ │ ├── startup_stm32f40xx.s │ │ │ │ │ ├── startup_stm32f427_437xx.s │ │ │ │ │ ├── startup_stm32f427x.s │ │ │ │ │ └── startup_stm32f429_439xx.s │ │ │ │ │ ├── iar │ │ │ │ │ ├── startup_stm32f401xx.s │ │ │ │ │ ├── startup_stm32f40_41xxx.s │ │ │ │ │ ├── startup_stm32f40xx.s │ │ │ │ │ ├── startup_stm32f411xe.s │ │ │ │ │ ├── startup_stm32f427_437xx.s │ │ │ │ │ ├── startup_stm32f427x.s │ │ │ │ │ ├── startup_stm32f429_439xx.s │ │ │ │ │ └── startup_stm32f446xx.s │ │ │ │ │ └── system_stm32f4xx.c │ │ │ ├── Include │ │ │ │ ├── arm_common_tables.h │ │ │ │ ├── arm_const_structs.h │ │ │ │ ├── arm_math.h │ │ │ │ ├── core_cm0.h │ │ │ │ ├── core_cm0plus.h │ │ │ │ ├── core_cm3.h │ │ │ │ ├── core_cm4.h │ │ │ │ ├── core_cm7.h │ │ │ │ ├── core_cmFunc.h │ │ │ │ ├── core_cmInstr.h │ │ │ │ ├── core_cmSimd.h │ │ │ │ ├── core_sc000.h │ │ │ │ └── core_sc300.h │ │ │ ├── README.txt │ │ │ └── index.html │ │ └── STM32F4xx_StdPeriph_Driver │ │ │ ├── Release_Notes.html │ │ │ ├── inc │ │ │ ├── misc.h │ │ │ ├── stm32f4xx_adc.h │ │ │ ├── stm32f4xx_can.h │ │ │ ├── stm32f4xx_cec.h │ │ │ ├── stm32f4xx_crc.h │ │ │ ├── stm32f4xx_cryp.h │ │ │ ├── stm32f4xx_dac.h │ │ │ ├── stm32f4xx_dbgmcu.h │ │ │ ├── stm32f4xx_dcmi.h │ │ │ ├── stm32f4xx_dma.h │ │ │ ├── stm32f4xx_dma2d.h │ │ │ ├── stm32f4xx_exti.h │ │ │ ├── stm32f4xx_flash.h │ │ │ ├── stm32f4xx_flash_ramfunc.h │ │ │ ├── stm32f4xx_fmc.h │ │ │ ├── stm32f4xx_fmpi2c.h │ │ │ ├── stm32f4xx_fsmc.h │ │ │ ├── stm32f4xx_gpio.h │ │ │ ├── stm32f4xx_hash.h │ │ │ ├── stm32f4xx_i2c.h │ │ │ ├── stm32f4xx_iwdg.h │ │ │ ├── stm32f4xx_ltdc.h │ │ │ ├── stm32f4xx_pwr.h │ │ │ ├── stm32f4xx_qspi.h │ │ │ ├── stm32f4xx_rcc.h │ │ │ ├── stm32f4xx_rng.h │ │ │ ├── stm32f4xx_rtc.h │ │ │ ├── stm32f4xx_sai.h │ │ │ ├── stm32f4xx_sdio.h │ │ │ ├── stm32f4xx_spdifrx.h │ │ │ ├── stm32f4xx_spi.h │ │ │ ├── stm32f4xx_syscfg.h │ │ │ ├── stm32f4xx_tim.h │ │ │ ├── stm32f4xx_usart.h │ │ │ └── stm32f4xx_wwdg.h │ │ │ └── src │ │ │ ├── misc.c │ │ │ ├── stm32f4xx_adc.c │ │ │ ├── stm32f4xx_can.c │ │ │ ├── stm32f4xx_cec.c │ │ │ ├── stm32f4xx_crc.c │ │ │ ├── stm32f4xx_cryp.c │ │ │ ├── stm32f4xx_cryp_aes.c │ │ │ ├── stm32f4xx_cryp_des.c │ │ │ ├── stm32f4xx_cryp_tdes.c │ │ │ ├── stm32f4xx_dac.c │ │ │ ├── stm32f4xx_dbgmcu.c │ │ │ ├── stm32f4xx_dcmi.c │ │ │ ├── stm32f4xx_dma.c │ │ │ ├── stm32f4xx_dma2d.c │ │ │ ├── stm32f4xx_exti.c │ │ │ ├── stm32f4xx_flash.c │ │ │ ├── stm32f4xx_flash_ramfunc.c │ │ │ ├── stm32f4xx_fmc.c │ │ │ ├── stm32f4xx_fmpi2c.c │ │ │ ├── stm32f4xx_fsmc.c │ │ │ ├── stm32f4xx_gpio.c │ │ │ ├── stm32f4xx_hash.c │ │ │ ├── stm32f4xx_hash_md5.c │ │ │ ├── stm32f4xx_hash_sha1.c │ │ │ ├── stm32f4xx_i2c.c │ │ │ ├── stm32f4xx_iwdg.c │ │ │ ├── stm32f4xx_ltdc.c │ │ │ ├── stm32f4xx_pwr.c │ │ │ ├── stm32f4xx_qspi.c │ │ │ ├── stm32f4xx_rcc.c │ │ │ ├── stm32f4xx_rng.c │ │ │ ├── stm32f4xx_rtc.c │ │ │ ├── stm32f4xx_sai.c │ │ │ ├── stm32f4xx_sdio.c │ │ │ ├── stm32f4xx_spdifrx.c │ │ │ ├── stm32f4xx_spi.c │ │ │ ├── stm32f4xx_syscfg.c │ │ │ ├── stm32f4xx_tim.c │ │ │ ├── stm32f4xx_usart.c │ │ │ └── stm32f4xx_wwdg.c │ │ ├── README.md │ │ ├── RT-Thread-1.2.2 │ │ ├── AUTHORS │ │ ├── COPYING │ │ ├── components │ │ │ ├── SConscript │ │ │ ├── drivers │ │ │ │ ├── SConscript │ │ │ │ ├── include │ │ │ │ │ ├── drivers │ │ │ │ │ │ ├── alarm.h │ │ │ │ │ │ ├── i2c-bit-ops.h │ │ │ │ │ │ ├── i2c.h │ │ │ │ │ │ ├── i2c_dev.h │ │ │ │ │ │ ├── mmcsd_card.h │ │ │ │ │ │ ├── mmcsd_cmd.h │ │ │ │ │ │ ├── mmcsd_core.h │ │ │ │ │ │ ├── mmcsd_host.h │ │ │ │ │ │ ├── mtd_nand.h │ │ │ │ │ │ ├── mtd_nor.h │ │ │ │ │ │ ├── rtc.h │ │ │ │ │ │ ├── sd.h │ │ │ │ │ │ ├── sdio.h │ │ │ │ │ │ ├── sdio_func_ids.h │ │ │ │ │ │ ├── serial.h │ │ │ │ │ │ ├── spi.h │ │ │ │ │ │ ├── usb_common.h │ │ │ │ │ │ ├── usb_device.h │ │ │ │ │ │ └── usb_host.h │ │ │ │ │ └── rtdevice.h │ │ │ │ ├── serial │ │ │ │ │ ├── SConscript │ │ │ │ │ └── serial.c │ │ │ │ └── src │ │ │ │ │ ├── SConscript │ │ │ │ │ ├── completion.c │ │ │ │ │ ├── dataqueue.c │ │ │ │ │ ├── pipe.c │ │ │ │ │ ├── portal.c │ │ │ │ │ ├── ringbuffer.c │ │ │ │ │ └── wrokqueue.c │ │ │ └── finsh │ │ │ │ ├── SConscript │ │ │ │ ├── cmd.c │ │ │ │ ├── finsh.h │ │ │ │ ├── finsh_compiler.c │ │ │ │ ├── finsh_error.c │ │ │ │ ├── finsh_error.h │ │ │ │ ├── finsh_heap.c │ │ │ │ ├── finsh_heap.h │ │ │ │ ├── finsh_init.c │ │ │ │ ├── finsh_node.c │ │ │ │ ├── finsh_node.h │ │ │ │ ├── finsh_ops.c │ │ │ │ ├── finsh_ops.h │ │ │ │ ├── finsh_parser.c │ │ │ │ ├── finsh_parser.h │ │ │ │ ├── finsh_token.c │ │ │ │ ├── finsh_token.h │ │ │ │ ├── finsh_var.c │ │ │ │ ├── finsh_var.h │ │ │ │ ├── finsh_vm.c │ │ │ │ ├── finsh_vm.h │ │ │ │ ├── msh.c │ │ │ │ ├── msh.h │ │ │ │ ├── msh_cmd.c │ │ │ │ ├── shell.c │ │ │ │ ├── shell.h │ │ │ │ └── symbol.c │ │ ├── include │ │ │ ├── cpuusage.h │ │ │ ├── rtdebug.h │ │ │ ├── rtdef.h │ │ │ ├── rthw.h │ │ │ ├── rtm.h │ │ │ ├── rtservice.h │ │ │ └── rtthread.h │ │ ├── libcpu │ │ │ ├── SConscript │ │ │ └── arm │ │ │ │ └── cortex-m4 │ │ │ │ ├── context_gcc.S │ │ │ │ ├── context_iar.S │ │ │ │ ├── context_rvds.S │ │ │ │ └── cpuport.c │ │ └── src │ │ │ ├── SConscript │ │ │ ├── clock.c │ │ │ ├── cpuusage.c │ │ │ ├── device.c │ │ │ ├── idle.c │ │ │ ├── ipc.c │ │ │ ├── irq.c │ │ │ ├── kservice.c │ │ │ ├── mem.c │ │ │ ├── memheap.c │ │ │ ├── mempool.c │ │ │ ├── module.c │ │ │ ├── module.h │ │ │ ├── object.c │ │ │ ├── scheduler.c │ │ │ ├── slab.c │ │ │ ├── thread.c │ │ │ └── timer.c │ │ ├── RVMDK │ │ └── .gitignore │ │ ├── app │ │ ├── inc │ │ │ ├── app_task.h │ │ │ ├── delay_conf.h │ │ │ ├── rtconfig.h │ │ │ ├── stm32f4xx_conf.h │ │ │ └── stm32f4xx_it.h │ │ └── src │ │ │ ├── app.c │ │ │ ├── app_task.c │ │ │ ├── stm32f4xx_it.c │ │ │ └── user_finsh_cmd.c │ │ └── components │ │ ├── easyflash │ │ ├── inc │ │ │ └── ef_cfg.h │ │ └── port │ │ │ └── ef_port.c │ │ ├── others │ │ ├── bsp.c │ │ ├── bsp.h │ │ ├── stm32f103xB.icf │ │ ├── stm32f103xE.icf │ │ ├── stm32f405xG.icf │ │ ├── types.h │ │ ├── utils.c │ │ └── utils.h │ │ └── rtt_uart │ │ ├── usart.c │ │ └── usart.h ├── iap │ ├── README.md │ └── ymodem+rtt.c └── log │ ├── README.md │ └── easylogger.c ├── docs ├── en │ ├── api.md │ ├── images │ │ ├── EnvDemo.gif │ │ ├── IapDemo.gif │ │ └── LogDemo.gif │ └── readme.md ├── readme.md └── zh │ ├── api.md │ ├── design.md │ ├── images │ ├── BackupAreaPartition.jpg │ ├── EnvDemo.gif │ ├── IapDemo.gif │ ├── LogDemo.gif │ ├── env_op1_step1.png │ ├── env_op1_step2.png │ ├── env_op1_step3.png │ ├── env_op1_step4.png │ ├── ng_mode_data_structure.png │ └── wechat_support.png │ ├── port.md │ ├── readme.md │ └── v4_migrate.md └── easyflash ├── inc ├── easyflash.h ├── ef_cfg.h └── ef_def.h ├── plugins └── types │ ├── README.md │ ├── ef_types.c │ ├── ef_types.h │ └── struct2json │ ├── inc │ ├── cJSON.h │ ├── s2j.h │ └── s2jdef.h │ ├── readme.md │ └── src │ ├── cJSON.c │ └── s2j.c ├── port └── ef_port.c └── src ├── easyflash.c ├── ef_env.c ├── ef_env_legacy.c ├── ef_env_legacy_wl.c ├── ef_iap.c ├── ef_log.c └── ef_utils.c /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | 3 | *.S text 4 | *.asm text 5 | *.c text 6 | *.cc text 7 | *.cpp text 8 | *.cxx text 9 | *.h text 10 | *.htm text 11 | *.html text 12 | *.in text 13 | *.ld text 14 | *.m4 text 15 | *.mak text 16 | *.mk text 17 | *.py text 18 | *.rb text 19 | *.s text 20 | *.sct text 21 | *.sh text 22 | *.txt text 23 | *.xml text 24 | Makefile text 25 | AUTHORS text 26 | COPYING text 27 | 28 | *.LZO -text 29 | *.Opt -text 30 | *.Uv2 -text 31 | *.ewp -text 32 | *.eww -text 33 | *.vcproj -text 34 | *.bat -text 35 | *.dos -text 36 | *.icf -text 37 | *.inf -text 38 | *.ini -text 39 | *.sct -text 40 | *.xsd -text 41 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014-2020 Armink (armink.ztl@gmail.com) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining 6 | a copy of this software and associated documentation files (the 7 | 'Software'), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to 11 | the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 21 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 22 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /demo/env/stm32f10x/README.md: -------------------------------------------------------------------------------- 1 | # stm32f10x Demo 2 | 3 | --- 4 | 5 | |File or folder name |Description| 6 | |:----- |:----| 7 | |non_os |STM32F10X non-os platform demo| 8 | |non_os_spi_flash |STM32F10X non-os platform for using SPI Flash demo| 9 | |rtt |STM32F10X for [RT-Thread](http://www.rt-thread.org/) operating system platform demo| 10 | -------------------------------------------------------------------------------- /demo/env/stm32f10x/non_os/EWARM/.gitignore: -------------------------------------------------------------------------------- 1 | /stm32f103xB 2 | /stm32f103xE 3 | /Debug 4 | /Release 5 | /settings 6 | *.dep 7 | *.ewd 8 | -------------------------------------------------------------------------------- /demo/env/stm32f10x/non_os/EWARM/EasyFlash.eww: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | $WS_DIR$\EasyFlash.ewp 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /demo/env/stm32f10x/non_os/Libraries/CMSIS_EWARM/CM3/DeviceSupport/ST/STM32F10x/stm32f10x.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armink/EasyFlash/45d22e238adbabb4a070835fcf0c05673b35ec71/demo/env/stm32f10x/non_os/Libraries/CMSIS_EWARM/CM3/DeviceSupport/ST/STM32F10x/stm32f10x.h -------------------------------------------------------------------------------- /demo/env/stm32f10x/non_os/Libraries/CMSIS_EWARM/CM3/DeviceSupport/ST/STM32F10x/system_stm32f10x.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file system_stm32f10x.h 4 | * @author MCD Application Team 5 | * @version V3.5.0 6 | * @date 11-March-2011 7 | * @brief CMSIS Cortex-M3 Device Peripheral Access Layer System Header File. 8 | ****************************************************************************** 9 | * @attention 10 | * 11 | * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS 12 | * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE 13 | * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY 14 | * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING 15 | * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE 16 | * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. 17 | * 18 | *

© COPYRIGHT 2011 STMicroelectronics

19 | ****************************************************************************** 20 | */ 21 | 22 | /** @addtogroup CMSIS 23 | * @{ 24 | */ 25 | 26 | /** @addtogroup stm32f10x_system 27 | * @{ 28 | */ 29 | 30 | /** 31 | * @brief Define to prevent recursive inclusion 32 | */ 33 | #ifndef __SYSTEM_STM32F10X_H 34 | #define __SYSTEM_STM32F10X_H 35 | 36 | #ifdef __cplusplus 37 | extern "C" { 38 | #endif 39 | 40 | /** @addtogroup STM32F10x_System_Includes 41 | * @{ 42 | */ 43 | 44 | /** 45 | * @} 46 | */ 47 | 48 | 49 | /** @addtogroup STM32F10x_System_Exported_types 50 | * @{ 51 | */ 52 | 53 | extern uint32_t SystemCoreClock; /*!< System Clock Frequency (Core Clock) */ 54 | 55 | /** 56 | * @} 57 | */ 58 | 59 | /** @addtogroup STM32F10x_System_Exported_Constants 60 | * @{ 61 | */ 62 | 63 | /** 64 | * @} 65 | */ 66 | 67 | /** @addtogroup STM32F10x_System_Exported_Macros 68 | * @{ 69 | */ 70 | 71 | /** 72 | * @} 73 | */ 74 | 75 | /** @addtogroup STM32F10x_System_Exported_Functions 76 | * @{ 77 | */ 78 | 79 | extern void SystemInit(void); 80 | extern void SystemCoreClockUpdate(void); 81 | /** 82 | * @} 83 | */ 84 | 85 | #ifdef __cplusplus 86 | } 87 | #endif 88 | 89 | #endif /*__SYSTEM_STM32F10X_H */ 90 | 91 | /** 92 | * @} 93 | */ 94 | 95 | /** 96 | * @} 97 | */ 98 | /******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/ 99 | -------------------------------------------------------------------------------- /demo/env/stm32f10x/non_os/Libraries/CMSIS_EWARM/CMSIS END USER LICENCE AGREEMENT.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armink/EasyFlash/45d22e238adbabb4a070835fcf0c05673b35ec71/demo/env/stm32f10x/non_os/Libraries/CMSIS_EWARM/CMSIS END USER LICENCE AGREEMENT.pdf -------------------------------------------------------------------------------- /demo/env/stm32f10x/non_os/Libraries/CMSIS_EWARM/CMSIS debug support.htm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armink/EasyFlash/45d22e238adbabb4a070835fcf0c05673b35ec71/demo/env/stm32f10x/non_os/Libraries/CMSIS_EWARM/CMSIS debug support.htm -------------------------------------------------------------------------------- /demo/env/stm32f10x/non_os/Libraries/CMSIS_EWARM/Documentation/CMSIS_Core.htm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armink/EasyFlash/45d22e238adbabb4a070835fcf0c05673b35ec71/demo/env/stm32f10x/non_os/Libraries/CMSIS_EWARM/Documentation/CMSIS_Core.htm -------------------------------------------------------------------------------- /demo/env/stm32f10x/non_os/Libraries/CMSIS_EWARM/Include/arm_common_tables.h: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- 2 | * Copyright (C) 2010 ARM Limited. All rights reserved. 3 | * 4 | * $Date: 11. November 2010 5 | * $Revision: V1.0.2 6 | * 7 | * Project: CMSIS DSP Library 8 | * Title: arm_common_tables.h 9 | * 10 | * Description: This file has extern declaration for common tables like Bitreverse, reciprocal etc which are used across different functions 11 | * 12 | * Target Processor: Cortex-M4/Cortex-M3 13 | * 14 | * Version 1.0.2 2010/11/11 15 | * Documentation updated. 16 | * 17 | * Version 1.0.1 2010/10/05 18 | * Production release and review comments incorporated. 19 | * 20 | * Version 1.0.0 2010/09/20 21 | * Production release and review comments incorporated. 22 | * -------------------------------------------------------------------- */ 23 | 24 | #ifndef _ARM_COMMON_TABLES_H 25 | #define _ARM_COMMON_TABLES_H 26 | 27 | #include "arm_math.h" 28 | 29 | extern const uint16_t armBitRevTable[1024]; 30 | extern const q15_t armRecipTableQ15[64]; 31 | extern const q31_t armRecipTableQ31[64]; 32 | extern const q31_t realCoefAQ31[1024]; 33 | extern const q31_t realCoefBQ31[1024]; 34 | extern const float32_t twiddleCoef[6144]; 35 | extern const q31_t twiddleCoefQ31[6144]; 36 | extern const q15_t twiddleCoefQ15[6144]; 37 | 38 | #endif /* ARM_COMMON_TABLES_H */ 39 | -------------------------------------------------------------------------------- /demo/env/stm32f10x/non_os/Libraries/CMSIS_EWARM/License.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armink/EasyFlash/45d22e238adbabb4a070835fcf0c05673b35ec71/demo/env/stm32f10x/non_os/Libraries/CMSIS_EWARM/License.doc -------------------------------------------------------------------------------- /demo/env/stm32f10x/non_os/Libraries/CMSIS_EWARM/README.txt: -------------------------------------------------------------------------------- 1 | * ------------------------------------------------------------------- 2 | * Copyright (C) 2011-2012 ARM Limited. All rights reserved. 3 | * 4 | * Date: 07 March 2012 5 | * Revision: V3.01 6 | * 7 | * Project: Cortex Microcontroller Software Interface Standard (CMSIS) 8 | * Title: Release Note for CMSIS 9 | * 10 | * ------------------------------------------------------------------- 11 | 12 | 13 | NOTE - Open the index.html file to access CMSIS documentation 14 | 15 | 16 | The Cortex Microcontroller Software Interface Standard (CMSIS) provides a single standard across all 17 | Cortex-Mx processor series vendors. It enables code re-use and code sharing across software projects 18 | and reduces time-to-market for new embedded applications. 19 | 20 | CMSIS is released under the terms of the end user license agreement ("CMSIS END USER LICENCE AGREEMENT.pdf"). 21 | Any user of the software package is bound to the terms and conditions of the end user license agreement. 22 | 23 | 24 | You will find the following sub-directories: 25 | 26 | Documentation - Contains CMSIS documentation. 27 | 28 | DSP_Lib - MDK project files, Examples and source files etc.. to build the 29 | CMSIS DSP Software Library for Cortex-M0, Cortex-M3, Cortex-M4 processors. 30 | 31 | Include - CMSIS Core Support and CMSIS DSP Include Files. 32 | 33 | Lib - CMSIS DSP Libraries. 34 | 35 | RTOS - CMSIS RTOS API template header file. 36 | 37 | SVD - CMSIS SVD Schema files and Conversion Utility. 38 | -------------------------------------------------------------------------------- /demo/env/stm32f10x/non_os/Libraries/CMSIS_EWARM/index.htm: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Redirect to the CMSIS main page after 0 seconds 5 | 6 | 7 | 8 | 9 | 10 | 11 | If the automatic redirection is failing, click open CMSIS Documentation. 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /demo/env/stm32f10x/non_os/Libraries/CMSIS_EWARM/readme_patch.txt: -------------------------------------------------------------------------------- 1 | No CMSIS patch is included in this version. 2 | -------------------------------------------------------------------------------- /demo/env/stm32f10x/non_os/Libraries/CMSIS_RVMDK/CM3/DeviceSupport/ST/STM32F10x/stm32f10x.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armink/EasyFlash/45d22e238adbabb4a070835fcf0c05673b35ec71/demo/env/stm32f10x/non_os/Libraries/CMSIS_RVMDK/CM3/DeviceSupport/ST/STM32F10x/stm32f10x.h -------------------------------------------------------------------------------- /demo/env/stm32f10x/non_os/Libraries/CMSIS_RVMDK/CM3/DeviceSupport/ST/STM32F10x/system_stm32f10x.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file system_stm32f10x.h 4 | * @author MCD Application Team 5 | * @version V3.5.0 6 | * @date 11-March-2011 7 | * @brief CMSIS Cortex-M3 Device Peripheral Access Layer System Header File. 8 | ****************************************************************************** 9 | * @attention 10 | * 11 | * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS 12 | * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE 13 | * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY 14 | * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING 15 | * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE 16 | * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. 17 | * 18 | *

© COPYRIGHT 2011 STMicroelectronics

19 | ****************************************************************************** 20 | */ 21 | 22 | /** @addtogroup CMSIS 23 | * @{ 24 | */ 25 | 26 | /** @addtogroup stm32f10x_system 27 | * @{ 28 | */ 29 | 30 | /** 31 | * @brief Define to prevent recursive inclusion 32 | */ 33 | #ifndef __SYSTEM_STM32F10X_H 34 | #define __SYSTEM_STM32F10X_H 35 | 36 | #ifdef __cplusplus 37 | extern "C" { 38 | #endif 39 | 40 | /** @addtogroup STM32F10x_System_Includes 41 | * @{ 42 | */ 43 | 44 | /** 45 | * @} 46 | */ 47 | 48 | 49 | /** @addtogroup STM32F10x_System_Exported_types 50 | * @{ 51 | */ 52 | 53 | extern uint32_t SystemCoreClock; /*!< System Clock Frequency (Core Clock) */ 54 | 55 | /** 56 | * @} 57 | */ 58 | 59 | /** @addtogroup STM32F10x_System_Exported_Constants 60 | * @{ 61 | */ 62 | 63 | /** 64 | * @} 65 | */ 66 | 67 | /** @addtogroup STM32F10x_System_Exported_Macros 68 | * @{ 69 | */ 70 | 71 | /** 72 | * @} 73 | */ 74 | 75 | /** @addtogroup STM32F10x_System_Exported_Functions 76 | * @{ 77 | */ 78 | 79 | extern void SystemInit(void); 80 | extern void SystemCoreClockUpdate(void); 81 | /** 82 | * @} 83 | */ 84 | 85 | #ifdef __cplusplus 86 | } 87 | #endif 88 | 89 | #endif /*__SYSTEM_STM32F10X_H */ 90 | 91 | /** 92 | * @} 93 | */ 94 | 95 | /** 96 | * @} 97 | */ 98 | /******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/ 99 | -------------------------------------------------------------------------------- /demo/env/stm32f10x/non_os/Libraries/CMSIS_RVMDK/CMSIS debug support.htm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armink/EasyFlash/45d22e238adbabb4a070835fcf0c05673b35ec71/demo/env/stm32f10x/non_os/Libraries/CMSIS_RVMDK/CMSIS debug support.htm -------------------------------------------------------------------------------- /demo/env/stm32f10x/non_os/Libraries/CMSIS_RVMDK/Documentation/CMSIS_Core.htm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armink/EasyFlash/45d22e238adbabb4a070835fcf0c05673b35ec71/demo/env/stm32f10x/non_os/Libraries/CMSIS_RVMDK/Documentation/CMSIS_Core.htm -------------------------------------------------------------------------------- /demo/env/stm32f10x/non_os/Libraries/CMSIS_RVMDK/License.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armink/EasyFlash/45d22e238adbabb4a070835fcf0c05673b35ec71/demo/env/stm32f10x/non_os/Libraries/CMSIS_RVMDK/License.doc -------------------------------------------------------------------------------- /demo/env/stm32f10x/non_os/Libraries/STM32F10x_StdPeriph_Driver/inc/stm32f10x_crc.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file stm32f10x_crc.h 4 | * @author MCD Application Team 5 | * @version V3.5.0 6 | * @date 11-March-2011 7 | * @brief This file contains all the functions prototypes for the CRC firmware 8 | * library. 9 | ****************************************************************************** 10 | * @attention 11 | * 12 | * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS 13 | * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE 14 | * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY 15 | * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING 16 | * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE 17 | * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. 18 | * 19 | *

© COPYRIGHT 2011 STMicroelectronics

20 | ****************************************************************************** 21 | */ 22 | 23 | /* Define to prevent recursive inclusion -------------------------------------*/ 24 | #ifndef __STM32F10x_CRC_H 25 | #define __STM32F10x_CRC_H 26 | 27 | #ifdef __cplusplus 28 | extern "C" { 29 | #endif 30 | 31 | /* Includes ------------------------------------------------------------------*/ 32 | #include "stm32f10x.h" 33 | 34 | /** @addtogroup STM32F10x_StdPeriph_Driver 35 | * @{ 36 | */ 37 | 38 | /** @addtogroup CRC 39 | * @{ 40 | */ 41 | 42 | /** @defgroup CRC_Exported_Types 43 | * @{ 44 | */ 45 | 46 | /** 47 | * @} 48 | */ 49 | 50 | /** @defgroup CRC_Exported_Constants 51 | * @{ 52 | */ 53 | 54 | /** 55 | * @} 56 | */ 57 | 58 | /** @defgroup CRC_Exported_Macros 59 | * @{ 60 | */ 61 | 62 | /** 63 | * @} 64 | */ 65 | 66 | /** @defgroup CRC_Exported_Functions 67 | * @{ 68 | */ 69 | 70 | void CRC_ResetDR(void); 71 | uint32_t CRC_CalcCRC(uint32_t Data); 72 | uint32_t CRC_CalcBlockCRC(uint32_t pBuffer[], uint32_t BufferLength); 73 | uint32_t CRC_GetCRC(void); 74 | void CRC_SetIDRegister(uint8_t IDValue); 75 | uint8_t CRC_GetIDRegister(void); 76 | 77 | #ifdef __cplusplus 78 | } 79 | #endif 80 | 81 | #endif /* __STM32F10x_CRC_H */ 82 | /** 83 | * @} 84 | */ 85 | 86 | /** 87 | * @} 88 | */ 89 | 90 | /** 91 | * @} 92 | */ 93 | 94 | /******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/ 95 | -------------------------------------------------------------------------------- /demo/env/stm32f10x/non_os/Libraries/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armink/EasyFlash/45d22e238adbabb4a070835fcf0c05673b35ec71/demo/env/stm32f10x/non_os/Libraries/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c -------------------------------------------------------------------------------- /demo/env/stm32f10x/non_os/Libraries/STM32F10x_StdPeriph_Driver/src/stm32f10x_i2c.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armink/EasyFlash/45d22e238adbabb4a070835fcf0c05673b35ec71/demo/env/stm32f10x/non_os/Libraries/STM32F10x_StdPeriph_Driver/src/stm32f10x_i2c.c -------------------------------------------------------------------------------- /demo/env/stm32f10x/non_os/Libraries/STM32F10x_StdPeriph_Driver/src/stm32f10x_usart.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armink/EasyFlash/45d22e238adbabb4a070835fcf0c05673b35ec71/demo/env/stm32f10x/non_os/Libraries/STM32F10x_StdPeriph_Driver/src/stm32f10x_usart.c -------------------------------------------------------------------------------- /demo/env/stm32f10x/non_os/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armink/EasyFlash/45d22e238adbabb4a070835fcf0c05673b35ec71/demo/env/stm32f10x/non_os/README.md -------------------------------------------------------------------------------- /demo/env/stm32f10x/non_os/RVMDK/.gitignore: -------------------------------------------------------------------------------- 1 | /Output 2 | JLinkLog.txt 3 | JLinkSettings.ini 4 | *.bak 5 | *.dep 6 | *.uvguix* 7 | *.uvgui* 8 | -------------------------------------------------------------------------------- /demo/env/stm32f10x/non_os/app/inc/stm32f10x_it.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file Project/Template/stm32f10x_it.h 4 | * @author MCD Application Team 5 | * @version V3.1.0 6 | * @date 06/19/2009 7 | * @brief This file contains the headers of the interrupt handlers. 8 | ****************************************************************************** 9 | * @copy 10 | * 11 | * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS 12 | * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE 13 | * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY 14 | * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING 15 | * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE 16 | * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. 17 | * 18 | *

© COPYRIGHT 2009 STMicroelectronics

19 | */ 20 | 21 | /* Define to prevent recursive inclusion -------------------------------------*/ 22 | #ifndef __STM32F10x_IT_H 23 | #define __STM32F10x_IT_H 24 | 25 | #ifdef __cplusplus 26 | extern "C" { 27 | #endif 28 | 29 | /* Includes ------------------------------------------------------------------*/ 30 | 31 | #include "bsp.h" 32 | 33 | /* Exported types ------------------------------------------------------------*/ 34 | /* Exported constants --------------------------------------------------------*/ 35 | /* Exported macro ------------------------------------------------------------*/ 36 | /* Exported functions ------------------------------------------------------- */ 37 | 38 | void NMI_Handler(void); 39 | void HardFault_Handler(void); 40 | void MemManage_Handler(void); 41 | void BusFault_Handler(void); 42 | void UsageFault_Handler(void); 43 | void SVC_Handler(void); 44 | void DebugMon_Handler(void); 45 | void PendSV_Handler(void); 46 | void SysTick_Handler(void); 47 | 48 | #ifdef __cplusplus 49 | } 50 | #endif 51 | 52 | #endif /* __STM32F10x_IT_H */ 53 | 54 | /******************* (C) COPYRIGHT 2009 STMicroelectronics *****END OF FILE****/ 55 | -------------------------------------------------------------------------------- /demo/env/stm32f10x/non_os/app/src/app.c: -------------------------------------------------------------------------------- 1 | #include "bsp.h" 2 | #include "easyflash.h" 3 | #include 4 | #include 5 | 6 | static void test_env(void); 7 | 8 | int main(void){ 9 | 10 | BSP_Init(); 11 | 12 | if (easyflash_init() == EF_NO_ERR) { 13 | /* test Env demo */ 14 | test_env(); 15 | } 16 | 17 | while(1) { 18 | LED_RUN_ON; 19 | delay(1000000); 20 | LED_RUN_OFF; 21 | delay(1000000); 22 | } 23 | 24 | return 0; 25 | } 26 | 27 | /** 28 | * Env demo. 29 | */ 30 | static void test_env(void) { 31 | uint32_t i_boot_times = NULL; 32 | char *c_old_boot_times, c_new_boot_times[11] = {0}; 33 | 34 | /* get the boot count number from Env */ 35 | c_old_boot_times = ef_get_env("boot_times"); 36 | assert_param(c_old_boot_times); 37 | i_boot_times = atol(c_old_boot_times); 38 | /* boot count +1 */ 39 | i_boot_times ++; 40 | printf("The system now boot %d times\n\r", i_boot_times); 41 | /* interger to string */ 42 | sprintf(c_new_boot_times,"%ld", i_boot_times); 43 | /* set and store the boot count number to Env */ 44 | ef_set_env("boot_times", c_new_boot_times); 45 | ef_save_env(); 46 | } 47 | -------------------------------------------------------------------------------- /demo/env/stm32f10x/non_os/components/others/bsp.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armink/EasyFlash/45d22e238adbabb4a070835fcf0c05673b35ec71/demo/env/stm32f10x/non_os/components/others/bsp.c -------------------------------------------------------------------------------- /demo/env/stm32f10x/non_os/components/others/stm32f103xB.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 | /* software version and hardware version store start address */ 7 | define symbol __ICFEDIT_version_start__ = __ICFEDIT_intvec_start__ + 512; 8 | /*-Memory Regions-*/ 9 | define symbol __ICFEDIT_region_ROM_start__ = __ICFEDIT_intvec_start__; 10 | define symbol __ICFEDIT_region_ROM_end__ = 0x0801FFFF; 11 | define symbol __ICFEDIT_region_RAM_start__ = 0x20000000; 12 | define symbol __ICFEDIT_region_RAM_end__ = 0x20004FFF; 13 | /*-Sizes-*/ 14 | define symbol __ICFEDIT_size_cstack__ = 0x800; 15 | define symbol __ICFEDIT_size_heap__ = 0x800; 16 | 17 | /**** End of ICF editor section. ###ICF###*/ 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 | 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 RAM_region { readwrite, 33 | block CSTACK, block HEAP }; 34 | 35 | /* armink add for version storage */ 36 | keep { section .version }; 37 | place at address mem:__ICFEDIT_version_start__ { readonly section .version }; 38 | 39 | /* armink add for rtt finsh */ 40 | keep { section FSymTab }; 41 | keep { section VSymTab }; -------------------------------------------------------------------------------- /demo/env/stm32f10x/non_os/components/others/stm32f103xE.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 | /* software version and hardware version store start address */ 7 | define symbol __ICFEDIT_version_start__ = __ICFEDIT_intvec_start__ + 512; 8 | /*-Memory Regions-*/ 9 | define symbol __ICFEDIT_region_ROM_start__ = __ICFEDIT_intvec_start__; 10 | define symbol __ICFEDIT_region_ROM_end__ = 0x0807FFFF; 11 | define symbol __ICFEDIT_region_RAM_start__ = 0x20000000; 12 | define symbol __ICFEDIT_region_RAM_end__ = 0x2000FFFF; 13 | /*-Sizes-*/ 14 | define symbol __ICFEDIT_size_cstack__ = 0x1000; 15 | define symbol __ICFEDIT_size_heap__ = 0x1000; 16 | 17 | /**** End of ICF editor section. ###ICF###*/ 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 | 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 RAM_region { readwrite, 33 | block CSTACK, block HEAP }; 34 | 35 | /* armink add for version storage */ 36 | keep { section .version }; 37 | place at address mem:__ICFEDIT_version_start__ { readonly section .version }; 38 | 39 | /* armink add for rtt finsh */ 40 | keep { section FSymTab }; 41 | keep { section VSymTab }; -------------------------------------------------------------------------------- /demo/env/stm32f10x/non_os/components/others/types.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef TYPES_H_ 3 | #define TYPES_H_ 4 | 5 | #include 6 | #include 7 | typedef int bool_t; /**< boolean type */ 8 | 9 | #ifndef TRUE 10 | #define TRUE 1 11 | #endif 12 | 13 | #ifndef FALSE 14 | #define FALSE 0 15 | #endif 16 | 17 | #ifndef NULL 18 | #define NULL 0 19 | #endif 20 | 21 | #define success 0 22 | #define fail 1 23 | 24 | 25 | #ifndef disable 26 | #define disable 0 27 | #endif 28 | 29 | #ifndef enable 30 | #define enable 1 31 | #endif 32 | 33 | #endif /* TYPES_H_ */ 34 | -------------------------------------------------------------------------------- /demo/env/stm32f10x/non_os_spi_flash/EWARM/.gitignore: -------------------------------------------------------------------------------- 1 | /stm32f103xB 2 | /stm32f103xE 3 | /Debug 4 | /Release 5 | /settings 6 | *.dep 7 | *.ewd 8 | -------------------------------------------------------------------------------- /demo/env/stm32f10x/non_os_spi_flash/EWARM/EasyFlash.eww: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | $WS_DIR$\EasyFlash.ewp 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /demo/env/stm32f10x/non_os_spi_flash/Libraries/CMSIS_EWARM/CM3/DeviceSupport/ST/STM32F10x/stm32f10x.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armink/EasyFlash/45d22e238adbabb4a070835fcf0c05673b35ec71/demo/env/stm32f10x/non_os_spi_flash/Libraries/CMSIS_EWARM/CM3/DeviceSupport/ST/STM32F10x/stm32f10x.h -------------------------------------------------------------------------------- /demo/env/stm32f10x/non_os_spi_flash/Libraries/CMSIS_EWARM/CM3/DeviceSupport/ST/STM32F10x/system_stm32f10x.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file system_stm32f10x.h 4 | * @author MCD Application Team 5 | * @version V3.5.0 6 | * @date 11-March-2011 7 | * @brief CMSIS Cortex-M3 Device Peripheral Access Layer System Header File. 8 | ****************************************************************************** 9 | * @attention 10 | * 11 | * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS 12 | * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE 13 | * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY 14 | * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING 15 | * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE 16 | * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. 17 | * 18 | *

© COPYRIGHT 2011 STMicroelectronics

19 | ****************************************************************************** 20 | */ 21 | 22 | /** @addtogroup CMSIS 23 | * @{ 24 | */ 25 | 26 | /** @addtogroup stm32f10x_system 27 | * @{ 28 | */ 29 | 30 | /** 31 | * @brief Define to prevent recursive inclusion 32 | */ 33 | #ifndef __SYSTEM_STM32F10X_H 34 | #define __SYSTEM_STM32F10X_H 35 | 36 | #ifdef __cplusplus 37 | extern "C" { 38 | #endif 39 | 40 | /** @addtogroup STM32F10x_System_Includes 41 | * @{ 42 | */ 43 | 44 | /** 45 | * @} 46 | */ 47 | 48 | 49 | /** @addtogroup STM32F10x_System_Exported_types 50 | * @{ 51 | */ 52 | 53 | extern uint32_t SystemCoreClock; /*!< System Clock Frequency (Core Clock) */ 54 | 55 | /** 56 | * @} 57 | */ 58 | 59 | /** @addtogroup STM32F10x_System_Exported_Constants 60 | * @{ 61 | */ 62 | 63 | /** 64 | * @} 65 | */ 66 | 67 | /** @addtogroup STM32F10x_System_Exported_Macros 68 | * @{ 69 | */ 70 | 71 | /** 72 | * @} 73 | */ 74 | 75 | /** @addtogroup STM32F10x_System_Exported_Functions 76 | * @{ 77 | */ 78 | 79 | extern void SystemInit(void); 80 | extern void SystemCoreClockUpdate(void); 81 | /** 82 | * @} 83 | */ 84 | 85 | #ifdef __cplusplus 86 | } 87 | #endif 88 | 89 | #endif /*__SYSTEM_STM32F10X_H */ 90 | 91 | /** 92 | * @} 93 | */ 94 | 95 | /** 96 | * @} 97 | */ 98 | /******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/ 99 | -------------------------------------------------------------------------------- /demo/env/stm32f10x/non_os_spi_flash/Libraries/CMSIS_EWARM/CMSIS END USER LICENCE AGREEMENT.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armink/EasyFlash/45d22e238adbabb4a070835fcf0c05673b35ec71/demo/env/stm32f10x/non_os_spi_flash/Libraries/CMSIS_EWARM/CMSIS END USER LICENCE AGREEMENT.pdf -------------------------------------------------------------------------------- /demo/env/stm32f10x/non_os_spi_flash/Libraries/CMSIS_EWARM/CMSIS debug support.htm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armink/EasyFlash/45d22e238adbabb4a070835fcf0c05673b35ec71/demo/env/stm32f10x/non_os_spi_flash/Libraries/CMSIS_EWARM/CMSIS debug support.htm -------------------------------------------------------------------------------- /demo/env/stm32f10x/non_os_spi_flash/Libraries/CMSIS_EWARM/Documentation/CMSIS_Core.htm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armink/EasyFlash/45d22e238adbabb4a070835fcf0c05673b35ec71/demo/env/stm32f10x/non_os_spi_flash/Libraries/CMSIS_EWARM/Documentation/CMSIS_Core.htm -------------------------------------------------------------------------------- /demo/env/stm32f10x/non_os_spi_flash/Libraries/CMSIS_EWARM/Include/arm_common_tables.h: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- 2 | * Copyright (C) 2010 ARM Limited. All rights reserved. 3 | * 4 | * $Date: 11. November 2010 5 | * $Revision: V1.0.2 6 | * 7 | * Project: CMSIS DSP Library 8 | * Title: arm_common_tables.h 9 | * 10 | * Description: This file has extern declaration for common tables like Bitreverse, reciprocal etc which are used across different functions 11 | * 12 | * Target Processor: Cortex-M4/Cortex-M3 13 | * 14 | * Version 1.0.2 2010/11/11 15 | * Documentation updated. 16 | * 17 | * Version 1.0.1 2010/10/05 18 | * Production release and review comments incorporated. 19 | * 20 | * Version 1.0.0 2010/09/20 21 | * Production release and review comments incorporated. 22 | * -------------------------------------------------------------------- */ 23 | 24 | #ifndef _ARM_COMMON_TABLES_H 25 | #define _ARM_COMMON_TABLES_H 26 | 27 | #include "arm_math.h" 28 | 29 | extern const uint16_t armBitRevTable[1024]; 30 | extern const q15_t armRecipTableQ15[64]; 31 | extern const q31_t armRecipTableQ31[64]; 32 | extern const q31_t realCoefAQ31[1024]; 33 | extern const q31_t realCoefBQ31[1024]; 34 | extern const float32_t twiddleCoef[6144]; 35 | extern const q31_t twiddleCoefQ31[6144]; 36 | extern const q15_t twiddleCoefQ15[6144]; 37 | 38 | #endif /* ARM_COMMON_TABLES_H */ 39 | -------------------------------------------------------------------------------- /demo/env/stm32f10x/non_os_spi_flash/Libraries/CMSIS_EWARM/License.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armink/EasyFlash/45d22e238adbabb4a070835fcf0c05673b35ec71/demo/env/stm32f10x/non_os_spi_flash/Libraries/CMSIS_EWARM/License.doc -------------------------------------------------------------------------------- /demo/env/stm32f10x/non_os_spi_flash/Libraries/CMSIS_EWARM/README.txt: -------------------------------------------------------------------------------- 1 | * ------------------------------------------------------------------- 2 | * Copyright (C) 2011-2012 ARM Limited. All rights reserved. 3 | * 4 | * Date: 07 March 2012 5 | * Revision: V3.01 6 | * 7 | * Project: Cortex Microcontroller Software Interface Standard (CMSIS) 8 | * Title: Release Note for CMSIS 9 | * 10 | * ------------------------------------------------------------------- 11 | 12 | 13 | NOTE - Open the index.html file to access CMSIS documentation 14 | 15 | 16 | The Cortex Microcontroller Software Interface Standard (CMSIS) provides a single standard across all 17 | Cortex-Mx processor series vendors. It enables code re-use and code sharing across software projects 18 | and reduces time-to-market for new embedded applications. 19 | 20 | CMSIS is released under the terms of the end user license agreement ("CMSIS END USER LICENCE AGREEMENT.pdf"). 21 | Any user of the software package is bound to the terms and conditions of the end user license agreement. 22 | 23 | 24 | You will find the following sub-directories: 25 | 26 | Documentation - Contains CMSIS documentation. 27 | 28 | DSP_Lib - MDK project files, Examples and source files etc.. to build the 29 | CMSIS DSP Software Library for Cortex-M0, Cortex-M3, Cortex-M4 processors. 30 | 31 | Include - CMSIS Core Support and CMSIS DSP Include Files. 32 | 33 | Lib - CMSIS DSP Libraries. 34 | 35 | RTOS - CMSIS RTOS API template header file. 36 | 37 | SVD - CMSIS SVD Schema files and Conversion Utility. 38 | -------------------------------------------------------------------------------- /demo/env/stm32f10x/non_os_spi_flash/Libraries/CMSIS_EWARM/index.htm: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Redirect to the CMSIS main page after 0 seconds 5 | 6 | 7 | 8 | 9 | 10 | 11 | If the automatic redirection is failing, click open CMSIS Documentation. 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /demo/env/stm32f10x/non_os_spi_flash/Libraries/CMSIS_EWARM/readme_patch.txt: -------------------------------------------------------------------------------- 1 | No CMSIS patch is included in this version. 2 | -------------------------------------------------------------------------------- /demo/env/stm32f10x/non_os_spi_flash/Libraries/CMSIS_RVMDK/CM3/DeviceSupport/ST/STM32F10x/stm32f10x.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armink/EasyFlash/45d22e238adbabb4a070835fcf0c05673b35ec71/demo/env/stm32f10x/non_os_spi_flash/Libraries/CMSIS_RVMDK/CM3/DeviceSupport/ST/STM32F10x/stm32f10x.h -------------------------------------------------------------------------------- /demo/env/stm32f10x/non_os_spi_flash/Libraries/CMSIS_RVMDK/CM3/DeviceSupport/ST/STM32F10x/system_stm32f10x.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file system_stm32f10x.h 4 | * @author MCD Application Team 5 | * @version V3.5.0 6 | * @date 11-March-2011 7 | * @brief CMSIS Cortex-M3 Device Peripheral Access Layer System Header File. 8 | ****************************************************************************** 9 | * @attention 10 | * 11 | * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS 12 | * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE 13 | * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY 14 | * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING 15 | * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE 16 | * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. 17 | * 18 | *

© COPYRIGHT 2011 STMicroelectronics

19 | ****************************************************************************** 20 | */ 21 | 22 | /** @addtogroup CMSIS 23 | * @{ 24 | */ 25 | 26 | /** @addtogroup stm32f10x_system 27 | * @{ 28 | */ 29 | 30 | /** 31 | * @brief Define to prevent recursive inclusion 32 | */ 33 | #ifndef __SYSTEM_STM32F10X_H 34 | #define __SYSTEM_STM32F10X_H 35 | 36 | #ifdef __cplusplus 37 | extern "C" { 38 | #endif 39 | 40 | /** @addtogroup STM32F10x_System_Includes 41 | * @{ 42 | */ 43 | 44 | /** 45 | * @} 46 | */ 47 | 48 | 49 | /** @addtogroup STM32F10x_System_Exported_types 50 | * @{ 51 | */ 52 | 53 | extern uint32_t SystemCoreClock; /*!< System Clock Frequency (Core Clock) */ 54 | 55 | /** 56 | * @} 57 | */ 58 | 59 | /** @addtogroup STM32F10x_System_Exported_Constants 60 | * @{ 61 | */ 62 | 63 | /** 64 | * @} 65 | */ 66 | 67 | /** @addtogroup STM32F10x_System_Exported_Macros 68 | * @{ 69 | */ 70 | 71 | /** 72 | * @} 73 | */ 74 | 75 | /** @addtogroup STM32F10x_System_Exported_Functions 76 | * @{ 77 | */ 78 | 79 | extern void SystemInit(void); 80 | extern void SystemCoreClockUpdate(void); 81 | /** 82 | * @} 83 | */ 84 | 85 | #ifdef __cplusplus 86 | } 87 | #endif 88 | 89 | #endif /*__SYSTEM_STM32F10X_H */ 90 | 91 | /** 92 | * @} 93 | */ 94 | 95 | /** 96 | * @} 97 | */ 98 | /******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/ 99 | -------------------------------------------------------------------------------- /demo/env/stm32f10x/non_os_spi_flash/Libraries/CMSIS_RVMDK/CMSIS debug support.htm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armink/EasyFlash/45d22e238adbabb4a070835fcf0c05673b35ec71/demo/env/stm32f10x/non_os_spi_flash/Libraries/CMSIS_RVMDK/CMSIS debug support.htm -------------------------------------------------------------------------------- /demo/env/stm32f10x/non_os_spi_flash/Libraries/CMSIS_RVMDK/Documentation/CMSIS_Core.htm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armink/EasyFlash/45d22e238adbabb4a070835fcf0c05673b35ec71/demo/env/stm32f10x/non_os_spi_flash/Libraries/CMSIS_RVMDK/Documentation/CMSIS_Core.htm -------------------------------------------------------------------------------- /demo/env/stm32f10x/non_os_spi_flash/Libraries/CMSIS_RVMDK/License.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armink/EasyFlash/45d22e238adbabb4a070835fcf0c05673b35ec71/demo/env/stm32f10x/non_os_spi_flash/Libraries/CMSIS_RVMDK/License.doc -------------------------------------------------------------------------------- /demo/env/stm32f10x/non_os_spi_flash/Libraries/STM32F10x_StdPeriph_Driver/inc/stm32f10x_crc.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file stm32f10x_crc.h 4 | * @author MCD Application Team 5 | * @version V3.5.0 6 | * @date 11-March-2011 7 | * @brief This file contains all the functions prototypes for the CRC firmware 8 | * library. 9 | ****************************************************************************** 10 | * @attention 11 | * 12 | * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS 13 | * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE 14 | * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY 15 | * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING 16 | * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE 17 | * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. 18 | * 19 | *

© COPYRIGHT 2011 STMicroelectronics

20 | ****************************************************************************** 21 | */ 22 | 23 | /* Define to prevent recursive inclusion -------------------------------------*/ 24 | #ifndef __STM32F10x_CRC_H 25 | #define __STM32F10x_CRC_H 26 | 27 | #ifdef __cplusplus 28 | extern "C" { 29 | #endif 30 | 31 | /* Includes ------------------------------------------------------------------*/ 32 | #include "stm32f10x.h" 33 | 34 | /** @addtogroup STM32F10x_StdPeriph_Driver 35 | * @{ 36 | */ 37 | 38 | /** @addtogroup CRC 39 | * @{ 40 | */ 41 | 42 | /** @defgroup CRC_Exported_Types 43 | * @{ 44 | */ 45 | 46 | /** 47 | * @} 48 | */ 49 | 50 | /** @defgroup CRC_Exported_Constants 51 | * @{ 52 | */ 53 | 54 | /** 55 | * @} 56 | */ 57 | 58 | /** @defgroup CRC_Exported_Macros 59 | * @{ 60 | */ 61 | 62 | /** 63 | * @} 64 | */ 65 | 66 | /** @defgroup CRC_Exported_Functions 67 | * @{ 68 | */ 69 | 70 | void CRC_ResetDR(void); 71 | uint32_t CRC_CalcCRC(uint32_t Data); 72 | uint32_t CRC_CalcBlockCRC(uint32_t pBuffer[], uint32_t BufferLength); 73 | uint32_t CRC_GetCRC(void); 74 | void CRC_SetIDRegister(uint8_t IDValue); 75 | uint8_t CRC_GetIDRegister(void); 76 | 77 | #ifdef __cplusplus 78 | } 79 | #endif 80 | 81 | #endif /* __STM32F10x_CRC_H */ 82 | /** 83 | * @} 84 | */ 85 | 86 | /** 87 | * @} 88 | */ 89 | 90 | /** 91 | * @} 92 | */ 93 | 94 | /******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/ 95 | -------------------------------------------------------------------------------- /demo/env/stm32f10x/non_os_spi_flash/Libraries/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armink/EasyFlash/45d22e238adbabb4a070835fcf0c05673b35ec71/demo/env/stm32f10x/non_os_spi_flash/Libraries/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c -------------------------------------------------------------------------------- /demo/env/stm32f10x/non_os_spi_flash/Libraries/STM32F10x_StdPeriph_Driver/src/stm32f10x_i2c.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armink/EasyFlash/45d22e238adbabb4a070835fcf0c05673b35ec71/demo/env/stm32f10x/non_os_spi_flash/Libraries/STM32F10x_StdPeriph_Driver/src/stm32f10x_i2c.c -------------------------------------------------------------------------------- /demo/env/stm32f10x/non_os_spi_flash/Libraries/STM32F10x_StdPeriph_Driver/src/stm32f10x_usart.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armink/EasyFlash/45d22e238adbabb4a070835fcf0c05673b35ec71/demo/env/stm32f10x/non_os_spi_flash/Libraries/STM32F10x_StdPeriph_Driver/src/stm32f10x_usart.c -------------------------------------------------------------------------------- /demo/env/stm32f10x/non_os_spi_flash/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armink/EasyFlash/45d22e238adbabb4a070835fcf0c05673b35ec71/demo/env/stm32f10x/non_os_spi_flash/README.md -------------------------------------------------------------------------------- /demo/env/stm32f10x/non_os_spi_flash/RVMDK/.gitignore: -------------------------------------------------------------------------------- 1 | /Output 2 | JLinkLog.txt 3 | JLinkSettings.ini 4 | *.bak 5 | *.dep 6 | *.uvguix* 7 | *.uvgui* 8 | -------------------------------------------------------------------------------- /demo/env/stm32f10x/non_os_spi_flash/app/inc/stm32f10x_it.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file Project/Template/stm32f10x_it.h 4 | * @author MCD Application Team 5 | * @version V3.1.0 6 | * @date 06/19/2009 7 | * @brief This file contains the headers of the interrupt handlers. 8 | ****************************************************************************** 9 | * @copy 10 | * 11 | * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS 12 | * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE 13 | * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY 14 | * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING 15 | * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE 16 | * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. 17 | * 18 | *

© COPYRIGHT 2009 STMicroelectronics

19 | */ 20 | 21 | /* Define to prevent recursive inclusion -------------------------------------*/ 22 | #ifndef __STM32F10x_IT_H 23 | #define __STM32F10x_IT_H 24 | 25 | #ifdef __cplusplus 26 | extern "C" { 27 | #endif 28 | 29 | /* Includes ------------------------------------------------------------------*/ 30 | 31 | #include "bsp.h" 32 | 33 | /* Exported types ------------------------------------------------------------*/ 34 | /* Exported constants --------------------------------------------------------*/ 35 | /* Exported macro ------------------------------------------------------------*/ 36 | /* Exported functions ------------------------------------------------------- */ 37 | 38 | void NMI_Handler(void); 39 | void HardFault_Handler(void); 40 | void MemManage_Handler(void); 41 | void BusFault_Handler(void); 42 | void UsageFault_Handler(void); 43 | void SVC_Handler(void); 44 | void DebugMon_Handler(void); 45 | void PendSV_Handler(void); 46 | void SysTick_Handler(void); 47 | 48 | #ifdef __cplusplus 49 | } 50 | #endif 51 | 52 | #endif /* __STM32F10x_IT_H */ 53 | 54 | /******************* (C) COPYRIGHT 2009 STMicroelectronics *****END OF FILE****/ 55 | -------------------------------------------------------------------------------- /demo/env/stm32f10x/non_os_spi_flash/app/src/app.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | static void test_env(void); 7 | 8 | int main(void){ 9 | 10 | BSP_Init(); 11 | 12 | if (easyflash_init() == EF_NO_ERR) { 13 | /* test Env demo */ 14 | test_env(); 15 | } 16 | 17 | while(1) { 18 | LED_RUN_ON; 19 | delay(6000000); 20 | LED_RUN_OFF; 21 | delay(6000000); 22 | } 23 | 24 | return 0; 25 | } 26 | 27 | /** 28 | * Env demo. 29 | */ 30 | static void test_env(void) { 31 | uint32_t i_boot_times = NULL; 32 | char *c_old_boot_times, c_new_boot_times[11] = {0}; 33 | 34 | /* get the boot count number from Env */ 35 | c_old_boot_times = ef_get_env("boot_times"); 36 | assert_param(c_old_boot_times); 37 | i_boot_times = atol(c_old_boot_times); 38 | /* boot count +1 */ 39 | i_boot_times ++; 40 | printf("The system now boot %d times\n\r", i_boot_times); 41 | /* interger to string */ 42 | sprintf(c_new_boot_times,"%ld", i_boot_times); 43 | /* set and store the boot count number to Env */ 44 | ef_set_env("boot_times", c_new_boot_times); 45 | ef_save_env(); 46 | } 47 | -------------------------------------------------------------------------------- /demo/env/stm32f10x/non_os_spi_flash/components/others/bsp.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armink/EasyFlash/45d22e238adbabb4a070835fcf0c05673b35ec71/demo/env/stm32f10x/non_os_spi_flash/components/others/bsp.c -------------------------------------------------------------------------------- /demo/env/stm32f10x/non_os_spi_flash/components/others/stm32f103xB.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 | /* software version and hardware version store start address */ 7 | define symbol __ICFEDIT_version_start__ = __ICFEDIT_intvec_start__ + 512; 8 | /*-Memory Regions-*/ 9 | define symbol __ICFEDIT_region_ROM_start__ = __ICFEDIT_intvec_start__; 10 | define symbol __ICFEDIT_region_ROM_end__ = 0x0801FFFF; 11 | define symbol __ICFEDIT_region_RAM_start__ = 0x20000000; 12 | define symbol __ICFEDIT_region_RAM_end__ = 0x20004FFF; 13 | /*-Sizes-*/ 14 | define symbol __ICFEDIT_size_cstack__ = 0x800; 15 | define symbol __ICFEDIT_size_heap__ = 0x800; 16 | 17 | /**** End of ICF editor section. ###ICF###*/ 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 | 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 RAM_region { readwrite, 33 | block CSTACK, block HEAP }; 34 | 35 | /* armink add for version storage */ 36 | keep { section .version }; 37 | place at address mem:__ICFEDIT_version_start__ { readonly section .version }; 38 | 39 | /* armink add for rtt finsh */ 40 | keep { section FSymTab }; 41 | keep { section VSymTab }; -------------------------------------------------------------------------------- /demo/env/stm32f10x/non_os_spi_flash/components/others/stm32f103xE.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 | /* software version and hardware version store start address */ 7 | define symbol __ICFEDIT_version_start__ = __ICFEDIT_intvec_start__ + 512; 8 | /*-Memory Regions-*/ 9 | define symbol __ICFEDIT_region_ROM_start__ = __ICFEDIT_intvec_start__; 10 | define symbol __ICFEDIT_region_ROM_end__ = 0x0807FFFF; 11 | define symbol __ICFEDIT_region_RAM_start__ = 0x20000000; 12 | define symbol __ICFEDIT_region_RAM_end__ = 0x2000FFFF; 13 | /*-Sizes-*/ 14 | define symbol __ICFEDIT_size_cstack__ = 0x1000; 15 | define symbol __ICFEDIT_size_heap__ = 0x1000; 16 | 17 | /**** End of ICF editor section. ###ICF###*/ 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 | 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 RAM_region { readwrite, 33 | block CSTACK, block HEAP }; 34 | 35 | /* armink add for version storage */ 36 | keep { section .version }; 37 | place at address mem:__ICFEDIT_version_start__ { readonly section .version }; 38 | 39 | /* armink add for rtt finsh */ 40 | keep { section FSymTab }; 41 | keep { section VSymTab }; -------------------------------------------------------------------------------- /demo/env/stm32f10x/non_os_spi_flash/components/others/types.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef TYPES_H_ 3 | #define TYPES_H_ 4 | 5 | #include 6 | #include 7 | typedef int bool_t; /**< boolean type */ 8 | 9 | #ifndef TRUE 10 | #define TRUE 1 11 | #endif 12 | 13 | #ifndef FALSE 14 | #define FALSE 0 15 | #endif 16 | 17 | #ifndef NULL 18 | #define NULL 0 19 | #endif 20 | 21 | #define success 0 22 | #define fail 1 23 | 24 | 25 | #ifndef disable 26 | #define disable 0 27 | #endif 28 | 29 | #ifndef enable 30 | #define enable 1 31 | #endif 32 | 33 | #endif /* TYPES_H_ */ 34 | -------------------------------------------------------------------------------- /demo/env/stm32f10x/non_os_spi_flash/components/sfud/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Armink (armink.ztl@gmail.com) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining 6 | a copy of this software and associated documentation files (the 7 | 'Software'), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to 11 | the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 20 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 21 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 22 | SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /demo/env/stm32f10x/non_os_spi_flash/components/sfud/inc/sfud_cfg.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Serial Flash Universal Driver Library. 3 | * 4 | * Copyright (c) 2016, Armink, 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining 7 | * a copy of this software and associated documentation files (the 8 | * 'Software'), to deal in the Software without restriction, including 9 | * without limitation the rights to use, copy, modify, merge, publish, 10 | * distribute, sublicense, and/or sell copies of the Software, and to 11 | * permit persons to whom the Software is furnished to do so, subject to 12 | * the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be 15 | * included in all copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, 18 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 19 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 20 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 21 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 22 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 23 | * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 24 | * 25 | * Function: It is the configure head file for this library. 26 | * Created on: 2016-04-23 27 | */ 28 | 29 | #ifndef _SFUD_CFG_H_ 30 | #define _SFUD_CFG_H_ 31 | 32 | #define SFUD_DEBUG_MODE 33 | 34 | #define SFUD_USING_SFDP 35 | 36 | #define SFUD_USING_FLASH_INFO_TABLE 37 | 38 | enum { 39 | SFUD_SST25_DEVICE_INDEX = 0, 40 | }; 41 | 42 | #define SFUD_FLASH_DEVICE_TABLE \ 43 | { \ 44 | [SFUD_SST25_DEVICE_INDEX] = {.name = "SST25VF016B", .spi.name = "SPI1"}, \ 45 | } 46 | 47 | #endif /* _SFUD_CFG_H_ */ 48 | -------------------------------------------------------------------------------- /demo/env/stm32f10x/non_os_spi_flash/components/sfud/port/sfud_port.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armink/EasyFlash/45d22e238adbabb4a070835fcf0c05673b35ec71/demo/env/stm32f10x/non_os_spi_flash/components/sfud/port/sfud_port.c -------------------------------------------------------------------------------- /demo/env/stm32f10x/non_os_spi_flash/components/sfud/src/sfud_sfdp.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armink/EasyFlash/45d22e238adbabb4a070835fcf0c05673b35ec71/demo/env/stm32f10x/non_os_spi_flash/components/sfud/src/sfud_sfdp.c -------------------------------------------------------------------------------- /demo/env/stm32f10x/rtt/EWARM/.gitignore: -------------------------------------------------------------------------------- 1 | /stm32f103xB 2 | /stm32f103xE 3 | /Debug 4 | /Release 5 | /settings 6 | *.dep 7 | *.ewd 8 | -------------------------------------------------------------------------------- /demo/env/stm32f10x/rtt/EWARM/EasyFlash.eww: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | $WS_DIR$\EasyFlash.ewp 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /demo/env/stm32f10x/rtt/Libraries/CMSIS_EWARM/CM3/DeviceSupport/ST/STM32F10x/stm32f10x.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armink/EasyFlash/45d22e238adbabb4a070835fcf0c05673b35ec71/demo/env/stm32f10x/rtt/Libraries/CMSIS_EWARM/CM3/DeviceSupport/ST/STM32F10x/stm32f10x.h -------------------------------------------------------------------------------- /demo/env/stm32f10x/rtt/Libraries/CMSIS_EWARM/CM3/DeviceSupport/ST/STM32F10x/system_stm32f10x.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file system_stm32f10x.h 4 | * @author MCD Application Team 5 | * @version V3.5.0 6 | * @date 11-March-2011 7 | * @brief CMSIS Cortex-M3 Device Peripheral Access Layer System Header File. 8 | ****************************************************************************** 9 | * @attention 10 | * 11 | * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS 12 | * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE 13 | * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY 14 | * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING 15 | * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE 16 | * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. 17 | * 18 | *

© COPYRIGHT 2011 STMicroelectronics

19 | ****************************************************************************** 20 | */ 21 | 22 | /** @addtogroup CMSIS 23 | * @{ 24 | */ 25 | 26 | /** @addtogroup stm32f10x_system 27 | * @{ 28 | */ 29 | 30 | /** 31 | * @brief Define to prevent recursive inclusion 32 | */ 33 | #ifndef __SYSTEM_STM32F10X_H 34 | #define __SYSTEM_STM32F10X_H 35 | 36 | #ifdef __cplusplus 37 | extern "C" { 38 | #endif 39 | 40 | /** @addtogroup STM32F10x_System_Includes 41 | * @{ 42 | */ 43 | 44 | /** 45 | * @} 46 | */ 47 | 48 | 49 | /** @addtogroup STM32F10x_System_Exported_types 50 | * @{ 51 | */ 52 | 53 | extern uint32_t SystemCoreClock; /*!< System Clock Frequency (Core Clock) */ 54 | 55 | /** 56 | * @} 57 | */ 58 | 59 | /** @addtogroup STM32F10x_System_Exported_Constants 60 | * @{ 61 | */ 62 | 63 | /** 64 | * @} 65 | */ 66 | 67 | /** @addtogroup STM32F10x_System_Exported_Macros 68 | * @{ 69 | */ 70 | 71 | /** 72 | * @} 73 | */ 74 | 75 | /** @addtogroup STM32F10x_System_Exported_Functions 76 | * @{ 77 | */ 78 | 79 | extern void SystemInit(void); 80 | extern void SystemCoreClockUpdate(void); 81 | /** 82 | * @} 83 | */ 84 | 85 | #ifdef __cplusplus 86 | } 87 | #endif 88 | 89 | #endif /*__SYSTEM_STM32F10X_H */ 90 | 91 | /** 92 | * @} 93 | */ 94 | 95 | /** 96 | * @} 97 | */ 98 | /******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/ 99 | -------------------------------------------------------------------------------- /demo/env/stm32f10x/rtt/Libraries/CMSIS_EWARM/CMSIS END USER LICENCE AGREEMENT.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armink/EasyFlash/45d22e238adbabb4a070835fcf0c05673b35ec71/demo/env/stm32f10x/rtt/Libraries/CMSIS_EWARM/CMSIS END USER LICENCE AGREEMENT.pdf -------------------------------------------------------------------------------- /demo/env/stm32f10x/rtt/Libraries/CMSIS_EWARM/CMSIS debug support.htm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armink/EasyFlash/45d22e238adbabb4a070835fcf0c05673b35ec71/demo/env/stm32f10x/rtt/Libraries/CMSIS_EWARM/CMSIS debug support.htm -------------------------------------------------------------------------------- /demo/env/stm32f10x/rtt/Libraries/CMSIS_EWARM/Documentation/CMSIS_Core.htm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armink/EasyFlash/45d22e238adbabb4a070835fcf0c05673b35ec71/demo/env/stm32f10x/rtt/Libraries/CMSIS_EWARM/Documentation/CMSIS_Core.htm -------------------------------------------------------------------------------- /demo/env/stm32f10x/rtt/Libraries/CMSIS_EWARM/Include/arm_common_tables.h: -------------------------------------------------------------------------------- 1 | /* ---------------------------------------------------------------------- 2 | * Copyright (C) 2010 ARM Limited. All rights reserved. 3 | * 4 | * $Date: 11. November 2010 5 | * $Revision: V1.0.2 6 | * 7 | * Project: CMSIS DSP Library 8 | * Title: arm_common_tables.h 9 | * 10 | * Description: This file has extern declaration for common tables like Bitreverse, reciprocal etc which are used across different functions 11 | * 12 | * Target Processor: Cortex-M4/Cortex-M3 13 | * 14 | * Version 1.0.2 2010/11/11 15 | * Documentation updated. 16 | * 17 | * Version 1.0.1 2010/10/05 18 | * Production release and review comments incorporated. 19 | * 20 | * Version 1.0.0 2010/09/20 21 | * Production release and review comments incorporated. 22 | * -------------------------------------------------------------------- */ 23 | 24 | #ifndef _ARM_COMMON_TABLES_H 25 | #define _ARM_COMMON_TABLES_H 26 | 27 | #include "arm_math.h" 28 | 29 | extern const uint16_t armBitRevTable[1024]; 30 | extern const q15_t armRecipTableQ15[64]; 31 | extern const q31_t armRecipTableQ31[64]; 32 | extern const q31_t realCoefAQ31[1024]; 33 | extern const q31_t realCoefBQ31[1024]; 34 | extern const float32_t twiddleCoef[6144]; 35 | extern const q31_t twiddleCoefQ31[6144]; 36 | extern const q15_t twiddleCoefQ15[6144]; 37 | 38 | #endif /* ARM_COMMON_TABLES_H */ 39 | -------------------------------------------------------------------------------- /demo/env/stm32f10x/rtt/Libraries/CMSIS_EWARM/License.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armink/EasyFlash/45d22e238adbabb4a070835fcf0c05673b35ec71/demo/env/stm32f10x/rtt/Libraries/CMSIS_EWARM/License.doc -------------------------------------------------------------------------------- /demo/env/stm32f10x/rtt/Libraries/CMSIS_EWARM/README.txt: -------------------------------------------------------------------------------- 1 | * ------------------------------------------------------------------- 2 | * Copyright (C) 2011-2012 ARM Limited. All rights reserved. 3 | * 4 | * Date: 07 March 2012 5 | * Revision: V3.01 6 | * 7 | * Project: Cortex Microcontroller Software Interface Standard (CMSIS) 8 | * Title: Release Note for CMSIS 9 | * 10 | * ------------------------------------------------------------------- 11 | 12 | 13 | NOTE - Open the index.html file to access CMSIS documentation 14 | 15 | 16 | The Cortex Microcontroller Software Interface Standard (CMSIS) provides a single standard across all 17 | Cortex-Mx processor series vendors. It enables code re-use and code sharing across software projects 18 | and reduces time-to-market for new embedded applications. 19 | 20 | CMSIS is released under the terms of the end user license agreement ("CMSIS END USER LICENCE AGREEMENT.pdf"). 21 | Any user of the software package is bound to the terms and conditions of the end user license agreement. 22 | 23 | 24 | You will find the following sub-directories: 25 | 26 | Documentation - Contains CMSIS documentation. 27 | 28 | DSP_Lib - MDK project files, Examples and source files etc.. to build the 29 | CMSIS DSP Software Library for Cortex-M0, Cortex-M3, Cortex-M4 processors. 30 | 31 | Include - CMSIS Core Support and CMSIS DSP Include Files. 32 | 33 | Lib - CMSIS DSP Libraries. 34 | 35 | RTOS - CMSIS RTOS API template header file. 36 | 37 | SVD - CMSIS SVD Schema files and Conversion Utility. 38 | -------------------------------------------------------------------------------- /demo/env/stm32f10x/rtt/Libraries/CMSIS_EWARM/index.htm: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Redirect to the CMSIS main page after 0 seconds 5 | 6 | 7 | 8 | 9 | 10 | 11 | If the automatic redirection is failing, click open CMSIS Documentation. 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /demo/env/stm32f10x/rtt/Libraries/CMSIS_EWARM/readme_patch.txt: -------------------------------------------------------------------------------- 1 | No CMSIS patch is included in this version. 2 | -------------------------------------------------------------------------------- /demo/env/stm32f10x/rtt/Libraries/CMSIS_RVMDK/CM3/DeviceSupport/ST/STM32F10x/stm32f10x.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armink/EasyFlash/45d22e238adbabb4a070835fcf0c05673b35ec71/demo/env/stm32f10x/rtt/Libraries/CMSIS_RVMDK/CM3/DeviceSupport/ST/STM32F10x/stm32f10x.h -------------------------------------------------------------------------------- /demo/env/stm32f10x/rtt/Libraries/CMSIS_RVMDK/CM3/DeviceSupport/ST/STM32F10x/system_stm32f10x.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file system_stm32f10x.h 4 | * @author MCD Application Team 5 | * @version V3.5.0 6 | * @date 11-March-2011 7 | * @brief CMSIS Cortex-M3 Device Peripheral Access Layer System Header File. 8 | ****************************************************************************** 9 | * @attention 10 | * 11 | * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS 12 | * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE 13 | * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY 14 | * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING 15 | * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE 16 | * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. 17 | * 18 | *

© COPYRIGHT 2011 STMicroelectronics

19 | ****************************************************************************** 20 | */ 21 | 22 | /** @addtogroup CMSIS 23 | * @{ 24 | */ 25 | 26 | /** @addtogroup stm32f10x_system 27 | * @{ 28 | */ 29 | 30 | /** 31 | * @brief Define to prevent recursive inclusion 32 | */ 33 | #ifndef __SYSTEM_STM32F10X_H 34 | #define __SYSTEM_STM32F10X_H 35 | 36 | #ifdef __cplusplus 37 | extern "C" { 38 | #endif 39 | 40 | /** @addtogroup STM32F10x_System_Includes 41 | * @{ 42 | */ 43 | 44 | /** 45 | * @} 46 | */ 47 | 48 | 49 | /** @addtogroup STM32F10x_System_Exported_types 50 | * @{ 51 | */ 52 | 53 | extern uint32_t SystemCoreClock; /*!< System Clock Frequency (Core Clock) */ 54 | 55 | /** 56 | * @} 57 | */ 58 | 59 | /** @addtogroup STM32F10x_System_Exported_Constants 60 | * @{ 61 | */ 62 | 63 | /** 64 | * @} 65 | */ 66 | 67 | /** @addtogroup STM32F10x_System_Exported_Macros 68 | * @{ 69 | */ 70 | 71 | /** 72 | * @} 73 | */ 74 | 75 | /** @addtogroup STM32F10x_System_Exported_Functions 76 | * @{ 77 | */ 78 | 79 | extern void SystemInit(void); 80 | extern void SystemCoreClockUpdate(void); 81 | /** 82 | * @} 83 | */ 84 | 85 | #ifdef __cplusplus 86 | } 87 | #endif 88 | 89 | #endif /*__SYSTEM_STM32F10X_H */ 90 | 91 | /** 92 | * @} 93 | */ 94 | 95 | /** 96 | * @} 97 | */ 98 | /******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/ 99 | -------------------------------------------------------------------------------- /demo/env/stm32f10x/rtt/Libraries/CMSIS_RVMDK/CMSIS debug support.htm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armink/EasyFlash/45d22e238adbabb4a070835fcf0c05673b35ec71/demo/env/stm32f10x/rtt/Libraries/CMSIS_RVMDK/CMSIS debug support.htm -------------------------------------------------------------------------------- /demo/env/stm32f10x/rtt/Libraries/CMSIS_RVMDK/Documentation/CMSIS_Core.htm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armink/EasyFlash/45d22e238adbabb4a070835fcf0c05673b35ec71/demo/env/stm32f10x/rtt/Libraries/CMSIS_RVMDK/Documentation/CMSIS_Core.htm -------------------------------------------------------------------------------- /demo/env/stm32f10x/rtt/Libraries/CMSIS_RVMDK/License.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armink/EasyFlash/45d22e238adbabb4a070835fcf0c05673b35ec71/demo/env/stm32f10x/rtt/Libraries/CMSIS_RVMDK/License.doc -------------------------------------------------------------------------------- /demo/env/stm32f10x/rtt/Libraries/STM32F10x_StdPeriph_Driver/inc/stm32f10x_crc.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file stm32f10x_crc.h 4 | * @author MCD Application Team 5 | * @version V3.5.0 6 | * @date 11-March-2011 7 | * @brief This file contains all the functions prototypes for the CRC firmware 8 | * library. 9 | ****************************************************************************** 10 | * @attention 11 | * 12 | * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS 13 | * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE 14 | * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY 15 | * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING 16 | * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE 17 | * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. 18 | * 19 | *

© COPYRIGHT 2011 STMicroelectronics

20 | ****************************************************************************** 21 | */ 22 | 23 | /* Define to prevent recursive inclusion -------------------------------------*/ 24 | #ifndef __STM32F10x_CRC_H 25 | #define __STM32F10x_CRC_H 26 | 27 | #ifdef __cplusplus 28 | extern "C" { 29 | #endif 30 | 31 | /* Includes ------------------------------------------------------------------*/ 32 | #include "stm32f10x.h" 33 | 34 | /** @addtogroup STM32F10x_StdPeriph_Driver 35 | * @{ 36 | */ 37 | 38 | /** @addtogroup CRC 39 | * @{ 40 | */ 41 | 42 | /** @defgroup CRC_Exported_Types 43 | * @{ 44 | */ 45 | 46 | /** 47 | * @} 48 | */ 49 | 50 | /** @defgroup CRC_Exported_Constants 51 | * @{ 52 | */ 53 | 54 | /** 55 | * @} 56 | */ 57 | 58 | /** @defgroup CRC_Exported_Macros 59 | * @{ 60 | */ 61 | 62 | /** 63 | * @} 64 | */ 65 | 66 | /** @defgroup CRC_Exported_Functions 67 | * @{ 68 | */ 69 | 70 | void CRC_ResetDR(void); 71 | uint32_t CRC_CalcCRC(uint32_t Data); 72 | uint32_t CRC_CalcBlockCRC(uint32_t pBuffer[], uint32_t BufferLength); 73 | uint32_t CRC_GetCRC(void); 74 | void CRC_SetIDRegister(uint8_t IDValue); 75 | uint8_t CRC_GetIDRegister(void); 76 | 77 | #ifdef __cplusplus 78 | } 79 | #endif 80 | 81 | #endif /* __STM32F10x_CRC_H */ 82 | /** 83 | * @} 84 | */ 85 | 86 | /** 87 | * @} 88 | */ 89 | 90 | /** 91 | * @} 92 | */ 93 | 94 | /******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/ 95 | -------------------------------------------------------------------------------- /demo/env/stm32f10x/rtt/Libraries/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armink/EasyFlash/45d22e238adbabb4a070835fcf0c05673b35ec71/demo/env/stm32f10x/rtt/Libraries/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.c -------------------------------------------------------------------------------- /demo/env/stm32f10x/rtt/Libraries/STM32F10x_StdPeriph_Driver/src/stm32f10x_i2c.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armink/EasyFlash/45d22e238adbabb4a070835fcf0c05673b35ec71/demo/env/stm32f10x/rtt/Libraries/STM32F10x_StdPeriph_Driver/src/stm32f10x_i2c.c -------------------------------------------------------------------------------- /demo/env/stm32f10x/rtt/Libraries/STM32F10x_StdPeriph_Driver/src/stm32f10x_usart.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armink/EasyFlash/45d22e238adbabb4a070835fcf0c05673b35ec71/demo/env/stm32f10x/rtt/Libraries/STM32F10x_StdPeriph_Driver/src/stm32f10x_usart.c -------------------------------------------------------------------------------- /demo/env/stm32f10x/rtt/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armink/EasyFlash/45d22e238adbabb4a070835fcf0c05673b35ec71/demo/env/stm32f10x/rtt/README.md -------------------------------------------------------------------------------- /demo/env/stm32f10x/rtt/RT-Thread-1.2.2/AUTHORS: -------------------------------------------------------------------------------- 1 | Kernel Design & Implementation 2 | - Bernard Xiong 3 | 4 | LwIP 1.3.0/1.3.1/1.3.2/1.4.0 5 | - Porting 6 | Qiu Yi 7 | Mbbill 8 | - Testing 9 | Bernard Xiong 10 | 11 | Filesystem 12 | - Porting and Add Virtual Filesystem 13 | - Testing 14 | Qiu Yi 15 | prife 16 | 17 | RTGUI 18 | - Design and Implemenation 19 | Bernard Xiong 20 | Grissiom 21 | 22 | BSP 23 | Bernard Xiong 24 | - ATMEL AT91SAM7S64 & AT91SAM7X256 Porting 25 | - STM32 Porting 26 | - S3C4510 Porting 27 | 28 | Mbbill 29 | - ATMEL AT91SAM7X256 30 | 31 | Xulong Cao 32 | - QEMU/x86 33 | 34 | Aozima 35 | - LPC 2148 Porting 36 | - STM32 Porting 37 | 38 | Jing Lee 39 | - LPC 2478 Porting 40 | 41 | Qiu Yi 42 | - S3C2410 & S3C2440 Porting 43 | - TI LM3S 44 | 45 | others... 46 | -------------------------------------------------------------------------------- /demo/env/stm32f10x/rtt/RT-Thread-1.2.2/components/SConscript: -------------------------------------------------------------------------------- 1 | # for module compiling 2 | import os 3 | Import('remove_components') 4 | from building import * 5 | 6 | objs = [] 7 | cwd = GetCurrentDir() 8 | list = os.listdir(cwd) 9 | 10 | for item in list: 11 | if item in remove_components: 12 | continue 13 | 14 | if os.path.isfile(os.path.join(cwd, item, 'SConscript')): 15 | objs = objs + SConscript(os.path.join(item, 'SConscript')) 16 | 17 | Return('objs') 18 | -------------------------------------------------------------------------------- /demo/env/stm32f10x/rtt/RT-Thread-1.2.2/components/drivers/SConscript: -------------------------------------------------------------------------------- 1 | # for module compiling 2 | import os 3 | from building import * 4 | 5 | cwd = GetCurrentDir() 6 | objs = [] 7 | list = os.listdir(cwd) 8 | 9 | for d in list: 10 | path = os.path.join(cwd, d) 11 | if os.path.isfile(os.path.join(path, 'SConscript')): 12 | objs = objs + SConscript(os.path.join(d, 'SConscript')) 13 | 14 | Return('objs') 15 | -------------------------------------------------------------------------------- /demo/env/stm32f10x/rtt/RT-Thread-1.2.2/components/drivers/include/drivers/i2c-bit-ops.h: -------------------------------------------------------------------------------- 1 | /* 2 | * File : i2c-bit-ops.h 3 | * This file is part of RT-Thread RTOS 4 | * COPYRIGHT (C) 2006 - 2012, RT-Thread Development Team 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License along 17 | * with this program; if not, write to the Free Software Foundation, Inc., 18 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 19 | * 20 | * Change Logs: 21 | * Date Author Notes 22 | * 2012-04-25 weety first version 23 | */ 24 | 25 | #ifndef __I2C_BIT_OPS_H__ 26 | #define __I2C_BIT_OPS_H__ 27 | 28 | #ifdef __cplusplus 29 | extern "C" { 30 | #endif 31 | 32 | struct rt_i2c_bit_ops 33 | { 34 | void *data; /* private data for lowlevel routines */ 35 | void (*set_sda)(void *data, rt_int32_t state); 36 | void (*set_scl)(void *data, rt_int32_t state); 37 | rt_int32_t (*get_sda)(void *data); 38 | rt_int32_t (*get_scl)(void *data); 39 | 40 | void (*udelay)(rt_uint32_t us); 41 | 42 | rt_uint32_t delay_us; /* scl and sda line delay */ 43 | rt_uint32_t timeout; /* in tick */ 44 | }; 45 | 46 | rt_err_t rt_i2c_bit_add_bus(struct rt_i2c_bus_device *bus, 47 | const char *bus_name); 48 | 49 | #ifdef __cplusplus 50 | } 51 | #endif 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /demo/env/stm32f10x/rtt/RT-Thread-1.2.2/components/drivers/include/drivers/i2c_dev.h: -------------------------------------------------------------------------------- 1 | /* 2 | * File : i2c_dev.h 3 | * This file is part of RT-Thread RTOS 4 | * COPYRIGHT (C) 2006 - 2012, RT-Thread Development Team 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License along 17 | * with this program; if not, write to the Free Software Foundation, Inc., 18 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 19 | * 20 | * Change Logs: 21 | * Date Author Notes 22 | * 2012-04-25 weety first version 23 | */ 24 | 25 | #ifndef __I2C_DEV_H__ 26 | #define __I2C_DEV_H__ 27 | 28 | #include 29 | 30 | #ifdef __cplusplus 31 | extern "C" { 32 | #endif 33 | 34 | #define RT_I2C_DEV_CTRL_10BIT 0x20 35 | #define RT_I2C_DEV_CTRL_ADDR 0x21 36 | #define RT_I2C_DEV_CTRL_TIMEOUT 0x22 37 | #define RT_I2C_DEV_CTRL_RW 0x23 38 | 39 | struct rt_i2c_priv_data 40 | { 41 | struct rt_i2c_msg *msgs; 42 | rt_size_t number; 43 | }; 44 | 45 | rt_err_t rt_i2c_bus_device_device_init(struct rt_i2c_bus_device *bus, 46 | const char *name); 47 | 48 | #ifdef __cplusplus 49 | } 50 | #endif 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /demo/env/stm32f10x/rtt/RT-Thread-1.2.2/components/drivers/include/drivers/rtc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * File : rtc.h 3 | * This file is part of RT-Thread RTOS 4 | * COPYRIGHT (C) 2006 - 2012, RT-Thread Development Team 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License along 17 | * with this program; if not, write to the Free Software Foundation, Inc., 18 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 19 | * 20 | * Change Logs: 21 | * Date Author Notes 22 | * 2012-10-10 aozima first version. 23 | */ 24 | 25 | #ifndef RTC_H_INCLUDED 26 | #define RTC_H_INCLUDED 27 | 28 | extern rt_err_t set_date(rt_uint32_t year, 29 | rt_uint32_t month, 30 | rt_uint32_t day); 31 | 32 | extern rt_err_t set_time(rt_uint32_t hour, 33 | rt_uint32_t minute, 34 | rt_uint32_t second); 35 | 36 | #endif // RTC_H_INCLUDED 37 | -------------------------------------------------------------------------------- /demo/env/stm32f10x/rtt/RT-Thread-1.2.2/components/drivers/include/drivers/sd.h: -------------------------------------------------------------------------------- 1 | /* 2 | * File : sd.h 3 | * This file is part of RT-Thread RTOS 4 | * COPYRIGHT (C) 2006, RT-Thread Development Team 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License along 17 | * with this program; if not, write to the Free Software Foundation, Inc., 18 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 19 | * 20 | * Change Logs: 21 | * Date Author Notes 22 | * 2011-07-25 weety first version 23 | */ 24 | 25 | #ifndef __SD_H__ 26 | #define __SD_H__ 27 | 28 | #include 29 | #include 30 | 31 | #ifdef __cplusplus 32 | extern "C" { 33 | #endif 34 | 35 | rt_err_t mmcsd_send_if_cond(struct rt_mmcsd_host *host, rt_uint32_t ocr); 36 | rt_err_t mmcsd_send_app_op_cond(struct rt_mmcsd_host *host, rt_uint32_t ocr, rt_uint32_t *rocr); 37 | rt_int32_t init_sd(struct rt_mmcsd_host *host, rt_uint32_t ocr); 38 | 39 | #ifdef __cplusplus 40 | } 41 | #endif 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /demo/env/stm32f10x/rtt/RT-Thread-1.2.2/components/drivers/include/drivers/sdio_func_ids.h: -------------------------------------------------------------------------------- 1 | /* 2 | * File : sdio_func_ids.h 3 | * This file is part of RT-Thread RTOS 4 | * COPYRIGHT (C) 2006, RT-Thread Development Team 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License along 17 | * with this program; if not, write to the Free Software Foundation, Inc., 18 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 19 | * 20 | * Change Logs: 21 | * Date Author Notes 22 | * 2012-02-26 weety first version 23 | */ 24 | 25 | #ifndef __SDIO_FUNC_IDS_H__ 26 | #define __SDIO_FUNC_IDS_H__ 27 | 28 | #ifdef __cplusplus 29 | extern "C" { 30 | #endif 31 | 32 | /* Standard SDIO Function Interfaces */ 33 | 34 | #define SDIO_FUNC_CODE_NONE 0x00 /* Not a SDIO standard interface */ 35 | #define SDIO_FUNC_CODE_UART 0x01 /* SDIO Standard UART */ 36 | #define SDIO_FUNC_CODE_BT_A 0x02 /* SDIO Type-A for Bluetooth standard interface */ 37 | #define SDIO_FUNC_CODE_BT_B 0x03 /* SDIO Type-B for Bluetooth standard interface */ 38 | #define SDIO_FUNC_CODE_GPS 0x04 /* SDIO GPS standard interface */ 39 | #define SDIO_FUNC_CODE_CAMERA 0x05 /* SDIO Camera standard interface */ 40 | #define SDIO_FUNC_CODE_PHS 0x06 /* SDIO PHS standard interface */ 41 | #define SDIO_FUNC_CODE_WLAN 0x07 /* SDIO WLAN interface */ 42 | #define SDIO_FUNC_CODE_ATA 0x08 /* Embedded SDIO-ATA standard interface */ 43 | 44 | /* manufacturer id, product io */ 45 | 46 | #define SDIO_MANUFACTURER_ID_MARVELL 0x02df 47 | #define SDIO_PRODUCT_ID_MARVELL_88W8686 0x9103 48 | 49 | #ifdef __cplusplus 50 | } 51 | #endif 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /demo/env/stm32f10x/rtt/RT-Thread-1.2.2/components/drivers/include/drivers/spi.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armink/EasyFlash/45d22e238adbabb4a070835fcf0c05673b35ec71/demo/env/stm32f10x/rtt/RT-Thread-1.2.2/components/drivers/include/drivers/spi.h -------------------------------------------------------------------------------- /demo/env/stm32f10x/rtt/RT-Thread-1.2.2/components/drivers/serial/SConscript: -------------------------------------------------------------------------------- 1 | from building import * 2 | 3 | cwd = GetCurrentDir() 4 | src = Glob('*.c') 5 | CPPPATH = [cwd + '/../include'] 6 | group = DefineGroup('DeviceDrivers', src, depend = ['RT_USING_SERIAL'], CPPPATH = CPPPATH) 7 | 8 | Return('group') 9 | -------------------------------------------------------------------------------- /demo/env/stm32f10x/rtt/RT-Thread-1.2.2/components/drivers/src/SConscript: -------------------------------------------------------------------------------- 1 | from building import * 2 | 3 | cwd = GetCurrentDir() 4 | src = Glob('*.c') 5 | CPPPATH = [cwd + '/../include'] 6 | group = DefineGroup('DeviceDrivers', src, depend = ['RT_USING_DEVICE_IPC'], CPPPATH = CPPPATH) 7 | 8 | Return('group') 9 | -------------------------------------------------------------------------------- /demo/env/stm32f10x/rtt/RT-Thread-1.2.2/components/drivers/src/wrokqueue.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #ifdef RT_USING_HEAP 5 | static void _workqueue_thread_entry(void* parameter) 6 | { 7 | struct rt_work* work; 8 | struct rt_workqueue* queue; 9 | 10 | queue = (struct rt_workqueue*) parameter; 11 | RT_ASSERT(queue != RT_NULL); 12 | 13 | while (1) 14 | { 15 | if (rt_list_isempty(&(queue->work_list))) 16 | { 17 | /* no software timer exist, suspend self. */ 18 | rt_thread_suspend(rt_thread_self()); 19 | rt_schedule(); 20 | } 21 | 22 | /* we have work to do with. */ 23 | rt_enter_critical(); 24 | work = rt_list_entry(queue->work_list.next, struct rt_work, list); 25 | rt_list_remove(&(work->list)); 26 | rt_exit_critical(); 27 | 28 | /* do work */ 29 | work->work_func(work, work->work_data); 30 | } 31 | } 32 | 33 | struct rt_workqueue *rt_workqueue_create(const char* name, rt_uint16_t stack_size, rt_uint8_t priority) 34 | { 35 | struct rt_workqueue *queue = RT_NULL; 36 | 37 | queue = (struct rt_workqueue*)RT_KERNEL_MALLOC(sizeof(struct rt_workqueue)); 38 | if (queue != RT_NULL) 39 | { 40 | /* initialize work list */ 41 | rt_list_init(&(queue->work_list)); 42 | 43 | /* create the work thread */ 44 | queue->work_thread = rt_thread_create(name, _workqueue_thread_entry, queue, stack_size, priority, 10); 45 | if (queue->work_thread == RT_NULL) 46 | { 47 | RT_KERNEL_FREE(queue); 48 | return RT_NULL; 49 | } 50 | 51 | rt_thread_startup(queue->work_thread); 52 | } 53 | 54 | return queue; 55 | } 56 | 57 | rt_err_t rt_workqueue_destroy(struct rt_workqueue* queue) 58 | { 59 | RT_ASSERT(queue != RT_NULL); 60 | 61 | rt_thread_delete(queue->work_thread); 62 | RT_KERNEL_FREE(queue); 63 | 64 | return RT_EOK; 65 | } 66 | 67 | rt_err_t rt_workqueue_dowork(struct rt_workqueue* queue, struct rt_work* work) 68 | { 69 | RT_ASSERT(queue != RT_NULL); 70 | RT_ASSERT(work != RT_NULL); 71 | 72 | rt_enter_critical(); 73 | /* NOTE: the work MUST be initialized firstly */ 74 | rt_list_remove(&(work->list)); 75 | 76 | rt_list_insert_after(queue->work_list.prev, &(work->list)); 77 | if (queue->work_thread->stat != RT_THREAD_READY) 78 | { 79 | rt_exit_critical(); 80 | /* resume work thread */ 81 | rt_thread_resume(queue->work_thread); 82 | rt_schedule(); 83 | } 84 | else rt_exit_critical(); 85 | 86 | return RT_EOK; 87 | } 88 | 89 | rt_err_t rt_workqueue_cancel_work(struct rt_workqueue* queue, struct rt_work* work) 90 | { 91 | RT_ASSERT(queue != RT_NULL); 92 | RT_ASSERT(work != RT_NULL); 93 | 94 | rt_enter_critical(); 95 | rt_list_remove(&(work->list)); 96 | rt_exit_critical(); 97 | 98 | return RT_EOK; 99 | } 100 | 101 | #endif 102 | -------------------------------------------------------------------------------- /demo/env/stm32f10x/rtt/RT-Thread-1.2.2/components/finsh/SConscript: -------------------------------------------------------------------------------- 1 | Import('rtconfig') 2 | from building import * 3 | 4 | cwd = GetCurrentDir() 5 | src = Split(''' 6 | shell.c 7 | symbol.c 8 | cmd.c 9 | ''') 10 | 11 | fsh_src = Split(''' 12 | finsh_compiler.c 13 | finsh_error.c 14 | finsh_heap.c 15 | finsh_init.c 16 | finsh_node.c 17 | finsh_ops.c 18 | finsh_parser.c 19 | finsh_var.c 20 | finsh_vm.c 21 | finsh_token.c 22 | ''') 23 | 24 | msh_src = Split(''' 25 | msh_cmd.c 26 | msh.c 27 | ''') 28 | 29 | CPPPATH = [cwd] 30 | if rtconfig.CROSS_TOOL == 'keil': 31 | LINKFLAGS = ' --keep __fsym_*' 32 | 33 | if not GetDepend('FINSH_USING_MSH_ONLY'): 34 | LINKFLAGS = LINKFLAGS + ' --keep __vsym_* ' 35 | else: 36 | LINKFLAGS = '' 37 | 38 | if GetDepend('FINSH_USING_MSH'): 39 | src = src + msh_src 40 | if not GetDepend('FINSH_USING_MSH_ONLY'): 41 | src = src + fsh_src 42 | 43 | group = DefineGroup('finsh', src, depend = ['RT_USING_FINSH'], CPPPATH = CPPPATH, LINKFLAGS = LINKFLAGS) 44 | 45 | Return('group') 46 | -------------------------------------------------------------------------------- /demo/env/stm32f10x/rtt/RT-Thread-1.2.2/components/finsh/finsh_error.c: -------------------------------------------------------------------------------- 1 | /* 2 | * error number for finsh shell. 3 | * 4 | * COPYRIGHT (C) 2013, Shanghai Real-Thread Technology Co., Ltd 5 | * 6 | * This file is part of RT-Thread (http://www.rt-thread.org) 7 | * Maintainer: bernard.xiong 8 | * 9 | * All rights reserved. 10 | * 11 | * This program is free software; you can redistribute it and/or modify 12 | * it under the terms of the GNU General Public License as published by 13 | * the Free Software Foundation; either version 2 of the License, or 14 | * (at your option) any later version. 15 | * 16 | * This program is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | * GNU General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU General Public License along 22 | * with this program; if not, write to the Free Software Foundation, Inc., 23 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 24 | * 25 | * Change Logs: 26 | * Date Author Notes 27 | * 2010-03-22 Bernard first version 28 | */ 29 | #include "finsh_error.h" 30 | 31 | u_char global_errno; 32 | 33 | static const char * finsh_error_string_table[] = 34 | { 35 | "No error", 36 | "Invalid token", 37 | "Expect a type", 38 | "Unknown type", 39 | "Variable exist", 40 | "Expect a operater", 41 | "Memory full", 42 | "Unknown operator", 43 | "Unknown node", 44 | "Expect a character", 45 | "Unexpect end", 46 | "Unknown token", 47 | "Float not supported", 48 | "Unknown symbol", 49 | "Null node" 50 | }; 51 | 52 | int finsh_error_init() 53 | { 54 | global_errno = FINSH_ERROR_OK; 55 | 56 | return 0; 57 | } 58 | 59 | int finsh_error_set(u_char type) 60 | { 61 | global_errno = type; 62 | 63 | return 0; 64 | } 65 | 66 | u_char finsh_errno() 67 | { 68 | return global_errno; 69 | } 70 | 71 | const char* finsh_error_string(u_char type) 72 | { 73 | return finsh_error_string_table[type]; 74 | } 75 | -------------------------------------------------------------------------------- /demo/env/stm32f10x/rtt/RT-Thread-1.2.2/components/finsh/finsh_error.h: -------------------------------------------------------------------------------- 1 | /* 2 | * error number for finsh shell. 3 | * 4 | * COPYRIGHT (C) 2013, Shanghai Real-Thread Technology Co., Ltd 5 | * 6 | * This file is part of RT-Thread (http://www.rt-thread.org) 7 | * Maintainer: bernard.xiong 8 | * 9 | * All rights reserved. 10 | * 11 | * This program is free software; you can redistribute it and/or modify 12 | * it under the terms of the GNU General Public License as published by 13 | * the Free Software Foundation; either version 2 of the License, or 14 | * (at your option) any later version. 15 | * 16 | * This program is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | * GNU General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU General Public License along 22 | * with this program; if not, write to the Free Software Foundation, Inc., 23 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 24 | * 25 | * Change Logs: 26 | * Date Author Notes 27 | * 2010-03-22 Bernard first version 28 | */ 29 | #ifndef __FINSH_ERROR_H__ 30 | #define __FINSH_ERROR_H__ 31 | 32 | #include 33 | 34 | int finsh_error_init(void); 35 | 36 | /* get error number */ 37 | u_char finsh_errno(void); 38 | 39 | int finsh_error_set(u_char type); 40 | const char* finsh_error_string(u_char type); 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /demo/env/stm32f10x/rtt/RT-Thread-1.2.2/components/finsh/finsh_heap.h: -------------------------------------------------------------------------------- 1 | /* 2 | * heap management in finsh shell. 3 | * 4 | * COPYRIGHT (C) 2006 - 2013, RT-Thread Development Team 5 | * 6 | * This file is part of RT-Thread (http://www.rt-thread.org) 7 | * Maintainer: bernard.xiong 8 | * 9 | * All rights reserved. 10 | * 11 | * This program is free software; you can redistribute it and/or modify 12 | * it under the terms of the GNU General Public License as published by 13 | * the Free Software Foundation; either version 2 of the License, or 14 | * (at your option) any later version. 15 | * 16 | * This program is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | * GNU General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU General Public License along 22 | * with this program; if not, write to the Free Software Foundation, Inc., 23 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 24 | * 25 | * Change Logs: 26 | * Date Author Notes 27 | * 2010-03-22 Bernard first version 28 | */ 29 | #include 30 | 31 | #ifndef __FINSH_HEAP_H__ 32 | #define __FINSH_HEAP_H__ 33 | 34 | int finsh_heap_init(void); 35 | void* finsh_heap_allocate(size_t size); 36 | void finsh_heap_free(void*ptr); 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /demo/env/stm32f10x/rtt/RT-Thread-1.2.2/components/finsh/finsh_init.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Initialization procedure for finsh shell. 3 | * 4 | * COPYRIGHT (C) 2006 - 2013, RT-Thread Development Team 5 | * 6 | * This file is part of RT-Thread (http://www.rt-thread.org) 7 | * Maintainer: bernard.xiong 8 | * 9 | * All rights reserved. 10 | * 11 | * This program is free software; you can redistribute it and/or modify 12 | * it under the terms of the GNU General Public License as published by 13 | * the Free Software Foundation; either version 2 of the License, or 14 | * (at your option) any later version. 15 | * 16 | * This program is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | * GNU General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU General Public License along 22 | * with this program; if not, write to the Free Software Foundation, Inc., 23 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 24 | * 25 | * Change Logs: 26 | * Date Author Notes 27 | * 2010-03-22 Bernard first version 28 | */ 29 | #include 30 | 31 | #include "finsh_node.h" 32 | #include "finsh_vm.h" 33 | #include "finsh_parser.h" 34 | #include "finsh_var.h" 35 | #include "finsh_error.h" 36 | #include "finsh_heap.h" 37 | 38 | int finsh_init(struct finsh_parser* parser) 39 | { 40 | finsh_parser_init(parser); 41 | 42 | /* finsh init */ 43 | finsh_node_init(); 44 | finsh_var_init(); 45 | finsh_error_init(); 46 | finsh_heap_init(); 47 | 48 | return 0; 49 | } 50 | 51 | long finsh_stack_bottom() 52 | { 53 | return finsh_vm_stack[0].long_value; 54 | } 55 | 56 | int finsh_flush(struct finsh_parser* parser) 57 | { 58 | finsh_parser_init(parser); 59 | 60 | /* finsh init */ 61 | finsh_node_init(); 62 | finsh_error_init(); 63 | 64 | return 0; 65 | } 66 | 67 | int finsh_reset(struct finsh_parser* parser) 68 | { 69 | /* finsh init */ 70 | finsh_node_init(); 71 | finsh_var_init(); 72 | finsh_error_init(); 73 | finsh_heap_init(); 74 | 75 | return 0; 76 | } 77 | -------------------------------------------------------------------------------- /demo/env/stm32f10x/rtt/RT-Thread-1.2.2/components/finsh/finsh_parser.h: -------------------------------------------------------------------------------- 1 | /* 2 | * script parser for finsh shell. 3 | * 4 | * COPYRIGHT (C) 2006 - 2013, RT-Thread Development Team 5 | * 6 | * This file is part of RT-Thread (http://www.rt-thread.org) 7 | * Maintainer: bernard.xiong 8 | * 9 | * All rights reserved. 10 | * 11 | * This program is free software; you can redistribute it and/or modify 12 | * it under the terms of the GNU General Public License as published by 13 | * the Free Software Foundation; either version 2 of the License, or 14 | * (at your option) any later version. 15 | * 16 | * This program is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | * GNU General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU General Public License along 22 | * with this program; if not, write to the Free Software Foundation, Inc., 23 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 24 | * 25 | * Change Logs: 26 | * Date Author Notes 27 | * 2010-03-22 Bernard first version 28 | */ 29 | #ifndef __FINSH_PARSER_H__ 30 | #define __FINSH_PARSER_H__ 31 | 32 | #include 33 | 34 | int finsh_parser_init(struct finsh_parser* self); 35 | void finsh_parser_run(struct finsh_parser* self, const u_char* string); 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /demo/env/stm32f10x/rtt/RT-Thread-1.2.2/components/finsh/finsh_var.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Variable implementation in finsh shell. 3 | * 4 | * COPYRIGHT (C) 2006 - 2013, RT-Thread Development Team 5 | * 6 | * This file is part of RT-Thread (http://www.rt-thread.org) 7 | * Maintainer: bernard.xiong 8 | * 9 | * All rights reserved. 10 | * 11 | * This program is free software; you can redistribute it and/or modify 12 | * it under the terms of the GNU General Public License as published by 13 | * the Free Software Foundation; either version 2 of the License, or 14 | * (at your option) any later version. 15 | * 16 | * This program is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | * GNU General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU General Public License along 22 | * with this program; if not, write to the Free Software Foundation, Inc., 23 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 24 | * 25 | * Change Logs: 26 | * Date Author Notes 27 | * 2010-03-22 Bernard first version 28 | */ 29 | #ifndef __FINSH_VAR_H__ 30 | #define __FINSH_VAR_H__ 31 | 32 | #include 33 | 34 | /* 35 | * The variable in finsh is put in data segment as a global variable. 36 | * The 'finsh_var' structure presents the structure of variable in data segment. 37 | */ 38 | struct finsh_var 39 | { 40 | char name[FINSH_NAME_MAX + 1]; /* the name of variable */ 41 | 42 | u_char type; /* the type of variable */ 43 | 44 | /* variable value */ 45 | union { 46 | char char_value; 47 | short short_value; 48 | int int_value; 49 | long long_value; 50 | void* ptr; 51 | }value; 52 | }; 53 | extern struct finsh_var global_variable[]; 54 | 55 | int finsh_var_init(void); 56 | int finsh_var_insert(const char* name, int type); 57 | int finsh_var_delete(const char* name); 58 | struct finsh_var* finsh_var_lookup(const char* name); 59 | 60 | #endif 61 | -------------------------------------------------------------------------------- /demo/env/stm32f10x/rtt/RT-Thread-1.2.2/components/finsh/finsh_vm.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Virtual machine finsh shell. 3 | * 4 | * COPYRIGHT (C) 2006 - 2013, RT-Thread Development Team 5 | * 6 | * This file is part of RT-Thread (http://www.rt-thread.org) 7 | * Maintainer: bernard.xiong 8 | * 9 | * All rights reserved. 10 | * 11 | * This program is free software; you can redistribute it and/or modify 12 | * it under the terms of the GNU General Public License as published by 13 | * the Free Software Foundation; either version 2 of the License, or 14 | * (at your option) any later version. 15 | * 16 | * This program is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | * GNU General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU General Public License along 22 | * with this program; if not, write to the Free Software Foundation, Inc., 23 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 24 | * 25 | * Change Logs: 26 | * Date Author Notes 27 | * 2010-03-22 Bernard first version 28 | */ 29 | #ifndef __FINSH_VM_H__ 30 | #define __FINSH_VM_H__ 31 | 32 | #include 33 | 34 | #include "finsh_var.h" 35 | 36 | union finsh_value { 37 | char char_value; 38 | short short_value; 39 | long long_value; 40 | void* ptr; 41 | }; 42 | 43 | extern union finsh_value* finsh_sp; /* stack pointer */ 44 | extern u_char* finsh_pc; /* PC */ 45 | 46 | /* stack */ 47 | extern union finsh_value finsh_vm_stack[FINSH_STACK_MAX]; 48 | /* text segment */ 49 | extern u_char text_segment[FINSH_TEXT_MAX]; 50 | 51 | void finsh_vm_run(void); 52 | //void finsh_disassemble(void); 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /demo/env/stm32f10x/rtt/RT-Thread-1.2.2/components/finsh/msh.h: -------------------------------------------------------------------------------- 1 | /* 2 | * RT-Thread module shell implementation. 3 | * 4 | * COPYRIGHT (C) 2013, Shanghai Real-Thread Technology Co., Ltd 5 | * 6 | * This file is part of RT-Thread (http://www.rt-thread.org) 7 | * Maintainer: bernard.xiong 8 | * 9 | * All rights reserved. 10 | * 11 | * This program is free software; you can redistribute it and/or modify 12 | * it under the terms of the GNU General Public License as published by 13 | * the Free Software Foundation; either version 2 of the License, or 14 | * (at your option) any later version. 15 | * 16 | * This program is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | * GNU General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU General Public License along 22 | * with this program; if not, write to the Free Software Foundation, Inc., 23 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 24 | * 25 | * Change Logs: 26 | * Date Author Notes 27 | * 2013-03-30 Bernard the first verion for FinSH 28 | */ 29 | 30 | #ifndef __M_SHELL__ 31 | #define __M_SHELL__ 32 | 33 | #include 34 | 35 | rt_bool_t msh_is_used(void); 36 | int msh_exec(char* cmd, rt_size_t length); 37 | void msh_auto_complete(char *prefix); 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /demo/env/stm32f10x/rtt/RT-Thread-1.2.2/components/finsh/shell.h: -------------------------------------------------------------------------------- 1 | /* 2 | * shell implementation for finsh shell. 3 | * 4 | * COPYRIGHT (C) 2006 - 2013, RT-Thread Development Team 5 | * 6 | * This file is part of RT-Thread (http://www.rt-thread.org) 7 | * Maintainer: bernard.xiong 8 | * 9 | * All rights reserved. 10 | * 11 | * This program is free software; you can redistribute it and/or modify 12 | * it under the terms of the GNU General Public License as published by 13 | * the Free Software Foundation; either version 2 of the License, or 14 | * (at your option) any later version. 15 | * 16 | * This program is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | * GNU General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU General Public License along 22 | * with this program; if not, write to the Free Software Foundation, Inc., 23 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 24 | * 25 | * Change Logs: 26 | * Date Author Notes 27 | * 2011-06-02 Bernard Add finsh_get_prompt function declaration 28 | */ 29 | 30 | #ifndef __SHELL_H__ 31 | #define __SHELL_H__ 32 | 33 | #include 34 | #include "finsh.h" 35 | 36 | #define FINSH_USING_HISTORY 37 | #ifndef FINSH_THREAD_PRIORITY 38 | #define FINSH_THREAD_PRIORITY 20 39 | #endif 40 | #ifndef FINSH_THREAD_STACK_SIZE 41 | #define FINSH_THREAD_STACK_SIZE 2048 42 | #endif 43 | #define FINSH_CMD_SIZE 80 44 | 45 | #define FINSH_OPTION_ECHO 0x01 46 | #if defined(FINSH_USING_MSH) || (defined(RT_USING_DFS) && defined(DFS_USING_WORKDIR)) 47 | #define FINSH_PROMPT finsh_get_prompt() 48 | const char* finsh_get_prompt(void); 49 | #else 50 | #define FINSH_PROMPT "finsh>>" 51 | #endif 52 | 53 | #ifdef FINSH_USING_HISTORY 54 | #ifndef FINSH_HISTORY_LINES 55 | #define FINSH_HISTORY_LINES 5 56 | #endif 57 | #endif 58 | 59 | enum input_stat 60 | { 61 | WAIT_NORMAL, 62 | WAIT_SPEC_KEY, 63 | WAIT_FUNC_KEY, 64 | }; 65 | struct finsh_shell 66 | { 67 | struct rt_semaphore rx_sem; 68 | 69 | enum input_stat stat; 70 | 71 | rt_uint8_t echo_mode:1; 72 | 73 | #ifdef FINSH_USING_HISTORY 74 | rt_uint16_t current_history; 75 | rt_uint16_t history_count; 76 | 77 | char cmd_history[FINSH_HISTORY_LINES][FINSH_CMD_SIZE]; 78 | #endif 79 | 80 | #ifndef FINSH_USING_MSH_ONLY 81 | struct finsh_parser parser; 82 | #endif 83 | 84 | char line[FINSH_CMD_SIZE]; 85 | rt_uint8_t line_position; 86 | rt_uint8_t line_curpos; 87 | 88 | rt_device_t device; 89 | }; 90 | 91 | void finsh_set_echo(rt_uint32_t echo); 92 | rt_uint32_t finsh_get_echo(void); 93 | 94 | int finsh_system_init(void); 95 | void finsh_set_device(const char* device_name); 96 | const char* finsh_get_device(void); 97 | 98 | #endif 99 | -------------------------------------------------------------------------------- /demo/env/stm32f10x/rtt/RT-Thread-1.2.2/components/finsh/symbol.c: -------------------------------------------------------------------------------- 1 | /* 2 | * symbols in finsh shell. 3 | * 4 | * COPYRIGHT (C) 2006 - 2013, RT-Thread Development Team 5 | * 6 | * This file is part of RT-Thread (http://www.rt-thread.org) 7 | * Maintainer: bernard.xiong 8 | * 9 | * All rights reserved. 10 | * 11 | * This program is free software; you can redistribute it and/or modify 12 | * it under the terms of the GNU General Public License as published by 13 | * the Free Software Foundation; either version 2 of the License, or 14 | * (at your option) any later version. 15 | * 16 | * This program is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | * GNU General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU General Public License along 22 | * with this program; if not, write to the Free Software Foundation, Inc., 23 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 24 | * 25 | * Change Logs: 26 | * Date Author Notes 27 | * 2010-03-22 Bernard first version 28 | */ 29 | #include "finsh.h" 30 | 31 | long hello(void); 32 | long version(void); 33 | long list(void); 34 | long list_thread(void); 35 | long list_sem(void); 36 | long list_mutex(void); 37 | long list_fevent(void); 38 | long list_event(void); 39 | long list_mailbox(void); 40 | long list_msgqueue(void); 41 | long list_mempool(void); 42 | long list_timer(void); 43 | 44 | #ifdef FINSH_USING_SYMTAB 45 | struct finsh_syscall *_syscall_table_begin = NULL; 46 | struct finsh_syscall *_syscall_table_end = NULL; 47 | struct finsh_sysvar *_sysvar_table_begin = NULL; 48 | struct finsh_sysvar *_sysvar_table_end = NULL; 49 | #else 50 | struct finsh_syscall _syscall_table[] = 51 | { 52 | {"hello", hello}, 53 | {"version", version}, 54 | {"list", list}, 55 | {"list_thread", list_thread}, 56 | #ifdef RT_USING_SEMAPHORE 57 | {"list_sem", list_sem}, 58 | #endif 59 | #ifdef RT_USING_MUTEX 60 | {"list_mutex", list_mutex}, 61 | #endif 62 | #ifdef RT_USING_FEVENT 63 | {"list_fevent", list_fevent}, 64 | #endif 65 | #ifdef RT_USING_EVENT 66 | {"list_event", list_event}, 67 | #endif 68 | #ifdef RT_USING_MAILBOX 69 | {"list_mb", list_mailbox}, 70 | #endif 71 | #ifdef RT_USING_MESSAGEQUEUE 72 | {"list_mq", list_msgqueue}, 73 | #endif 74 | #ifdef RT_USING_MEMPOOL 75 | {"list_memp", list_mempool}, 76 | #endif 77 | {"list_timer", list_timer}, 78 | }; 79 | struct finsh_syscall *_syscall_table_begin = &_syscall_table[0]; 80 | struct finsh_syscall *_syscall_table_end = &_syscall_table[sizeof(_syscall_table) / sizeof(struct finsh_syscall)]; 81 | 82 | struct finsh_sysvar *_sysvar_table_begin = NULL; 83 | struct finsh_sysvar *_sysvar_table_end = NULL; 84 | #endif 85 | -------------------------------------------------------------------------------- /demo/env/stm32f10x/rtt/RT-Thread-1.2.2/include/cpuusage.h: -------------------------------------------------------------------------------- 1 | #ifndef CPUUSAGE_H 2 | #define CPUUSAGE_H 3 | 4 | 5 | static void cpu_usage_idle_hook(void); 6 | void cpu_usage_get(rt_uint8_t *major, rt_uint8_t *minor); 7 | void cpu_usage_init(void); 8 | 9 | #endif 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /demo/env/stm32f10x/rtt/RT-Thread-1.2.2/include/rtm.h: -------------------------------------------------------------------------------- 1 | /* 2 | * File : rtm.h 3 | * This file is part of RT-Thread RTOS 4 | * COPYRIGHT (C) 2006 - 2012, RT-Thread Development Team 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License along 17 | * with this program; if not, write to the Free Software Foundation, Inc., 18 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 19 | */ 20 | 21 | #ifndef __RTM_H__ 22 | #define __RTM_H__ 23 | 24 | #include 25 | #include 26 | 27 | #ifdef RT_USING_MODULE 28 | struct rt_module_symtab 29 | { 30 | void *addr; 31 | const char *name; 32 | }; 33 | 34 | #if defined(_MSC_VER) 35 | #pragma section("RTMSymTab$f",read) 36 | #define RTM_EXPORT(symbol) \ 37 | __declspec(allocate("RTMSymTab$f"))const char __rtmsym_##symbol##_name[] = "__vs_rtm_"#symbol; 38 | #pragma comment(linker, "/merge:RTMSymTab=mytext") 39 | 40 | #elif defined(__MINGW32__) 41 | #define RTM_EXPORT(symbol) 42 | 43 | #else 44 | #define RTM_EXPORT(symbol) \ 45 | const char __rtmsym_##symbol##_name[] = #symbol; \ 46 | const struct rt_module_symtab __rtmsym_##symbol SECTION("RTMSymTab")= \ 47 | { \ 48 | (void *)&symbol, \ 49 | __rtmsym_##symbol##_name \ 50 | }; 51 | #endif 52 | 53 | #else 54 | #define RTM_EXPORT(symbol) 55 | #endif 56 | 57 | #endif 58 | -------------------------------------------------------------------------------- /demo/env/stm32f10x/rtt/RT-Thread-1.2.2/libcpu/SConscript: -------------------------------------------------------------------------------- 1 | Import('RTT_ROOT') 2 | Import('rtconfig') 3 | from building import * 4 | 5 | comm = rtconfig.ARCH + '/common' 6 | path = rtconfig.ARCH + '/' + rtconfig.CPU 7 | 8 | # The set of source files associated with this SConscript file. 9 | if rtconfig.PLATFORM == 'armcc': 10 | src = Glob(path + '/*.c') + Glob(path + '/*_rvds.S') + Glob(comm + '/*.c') 11 | 12 | if rtconfig.PLATFORM == 'gcc': 13 | src = Glob(path + '/*.c') + Glob(path + '/*_gcc.S') + Glob(comm + '/*.c') + Glob(path + '/*_init.S') 14 | 15 | if rtconfig.PLATFORM == 'iar': 16 | src = Glob(path + '/*.c') + Glob(path + '/*_iar.S') + Glob(comm + '/*.c') 17 | 18 | if rtconfig.PLATFORM == 'cl': 19 | src = Glob(path + '/*.c') 20 | 21 | if rtconfig.PLATFORM == 'mingw': 22 | src = Glob(path + '/*.c') 23 | 24 | CPPPATH = [RTT_ROOT + '/libcpu/' + rtconfig.ARCH + '/' + rtconfig.CPU, RTT_ROOT + '/libcpu/' + rtconfig.ARCH + '/common'] 25 | group = DefineGroup(rtconfig.CPU.upper(), src, depend = [''], CPPPATH = CPPPATH) 26 | 27 | Return('group') 28 | -------------------------------------------------------------------------------- /demo/env/stm32f10x/rtt/RT-Thread-1.2.2/src/SConscript: -------------------------------------------------------------------------------- 1 | Import('RTT_ROOT') 2 | Import('rtconfig') 3 | from building import * 4 | 5 | src = Glob('*.c') 6 | 7 | CPPPATH = [RTT_ROOT + '/include'] 8 | if rtconfig.CROSS_TOOL == 'keil' and GetDepend('RT_USING_MODULE') == True: 9 | LINKFLAGS = ' --keep __rtmsym_* ' 10 | else: 11 | LINKFLAGS = '' 12 | 13 | if GetDepend('RT_USING_MODULE') == False: 14 | SrcRemove(src, ['module.c']) 15 | 16 | if GetDepend('RT_USING_HEAP') == False or GetDepend('RT_USING_SMALL_MEM') == False: 17 | SrcRemove(src, ['mem.c']) 18 | 19 | if GetDepend('RT_USING_HEAP') == False or GetDepend('RT_USING_SLAB') == False: 20 | SrcRemove(src, ['slab.c']) 21 | 22 | if GetDepend('RT_USING_MEMPOOL') == False: 23 | SrcRemove(src, ['mempool.c']) 24 | 25 | if GetDepend('RT_USING_MEMHEAP') == False: 26 | SrcRemove(src, ['memheap.c']) 27 | if GetDepend('RT_USING_MEMHEAP_AS_HEAP'): 28 | SrcRemove(src, ['mem.c']) 29 | 30 | if GetDepend('RT_USING_DEVICE') == False: 31 | SrcRemove(src, ['device.c']) 32 | 33 | group = DefineGroup('Kernel', src, depend = [''], CPPPATH = CPPPATH, LINKFLAGS = LINKFLAGS) 34 | 35 | Return('group') 36 | -------------------------------------------------------------------------------- /demo/env/stm32f10x/rtt/RT-Thread-1.2.2/src/cpuusage.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #define CPU_USAGE_CALC_TICK 10 5 | #define CPU_USAGE_LOOP 100 6 | 7 | static rt_uint8_t cpu_usage_major = 0, cpu_usage_minor= 0; 8 | static rt_uint32_t total_count = 0; 9 | 10 | static void cpu_usage_idle_hook() 11 | { 12 | rt_tick_t tick; 13 | rt_uint32_t count; 14 | volatile rt_uint32_t loop; 15 | 16 | if (total_count == 0) 17 | { 18 | /* get total count */ 19 | rt_enter_critical(); 20 | tick = rt_tick_get(); 21 | while(rt_tick_get() - tick < CPU_USAGE_CALC_TICK) 22 | { 23 | total_count ++; 24 | loop = 0; 25 | while (loop < CPU_USAGE_LOOP) loop ++; 26 | } 27 | rt_exit_critical(); 28 | } 29 | 30 | count = 0; 31 | /* get CPU usage */ 32 | tick = rt_tick_get(); 33 | while (rt_tick_get() - tick < CPU_USAGE_CALC_TICK) 34 | { 35 | count ++; 36 | loop = 0; 37 | while (loop < CPU_USAGE_LOOP) loop ++; 38 | } 39 | 40 | /* calculate major and minor */ 41 | if (count < total_count) 42 | { 43 | count = total_count - count; 44 | cpu_usage_major = (count * 100) / total_count; 45 | cpu_usage_minor = ((count * 100) % total_count) * 100 / total_count; 46 | } 47 | else 48 | { 49 | total_count = count; 50 | 51 | /* no CPU usage */ 52 | cpu_usage_major = 0; 53 | cpu_usage_minor = 0; 54 | } 55 | } 56 | 57 | void cpu_usage_get(rt_uint8_t *major, rt_uint8_t *minor) 58 | { 59 | RT_ASSERT(major != RT_NULL); 60 | RT_ASSERT(minor != RT_NULL); 61 | 62 | *major = cpu_usage_major; 63 | *minor = cpu_usage_minor; 64 | } 65 | 66 | void cpu_usage_init() 67 | { 68 | /* set idle thread hook */ 69 | rt_thread_idle_sethook(cpu_usage_idle_hook); 70 | } 71 | -------------------------------------------------------------------------------- /demo/env/stm32f10x/rtt/RT-Thread-1.2.2/src/irq.c: -------------------------------------------------------------------------------- 1 | /* 2 | * File : irq.c 3 | * This file is part of RT-Thread RTOS 4 | * COPYRIGHT (C) 2006 - 2012, RT-Thread Development Team 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License along 17 | * with this program; if not, write to the Free Software Foundation, Inc., 18 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 19 | * 20 | * Change Logs: 21 | * Date Author Notes 22 | * 2006-02-24 Bernard first version 23 | * 2006-05-03 Bernard add IRQ_DEBUG 24 | */ 25 | 26 | #include 27 | #include 28 | 29 | /* #define IRQ_DEBUG */ 30 | 31 | /** 32 | * @addtogroup Kernel 33 | */ 34 | 35 | /*@{*/ 36 | 37 | volatile rt_uint8_t rt_interrupt_nest; 38 | 39 | /** 40 | * This function will be invoked by BSP, when enter interrupt service routine 41 | * 42 | * @note please don't invoke this routine in application 43 | * 44 | * @see rt_interrupt_leave 45 | */ 46 | void rt_interrupt_enter(void) 47 | { 48 | rt_base_t level; 49 | 50 | RT_DEBUG_LOG(RT_DEBUG_IRQ, ("irq coming..., irq nest:%d\n", 51 | rt_interrupt_nest)); 52 | 53 | level = rt_hw_interrupt_disable(); 54 | rt_interrupt_nest ++; 55 | rt_hw_interrupt_enable(level); 56 | } 57 | RTM_EXPORT(rt_interrupt_enter); 58 | 59 | /** 60 | * This function will be invoked by BSP, when leave interrupt service routine 61 | * 62 | * @note please don't invoke this routine in application 63 | * 64 | * @see rt_interrupt_enter 65 | */ 66 | void rt_interrupt_leave(void) 67 | { 68 | rt_base_t level; 69 | 70 | RT_DEBUG_LOG(RT_DEBUG_IRQ, ("irq leave, irq nest:%d\n", 71 | rt_interrupt_nest)); 72 | 73 | level = rt_hw_interrupt_disable(); 74 | rt_interrupt_nest --; 75 | rt_hw_interrupt_enable(level); 76 | } 77 | RTM_EXPORT(rt_interrupt_leave); 78 | 79 | /** 80 | * This function will return the nest of interrupt. 81 | * 82 | * User application can invoke this function to get whether current 83 | * context is interrupt context. 84 | * 85 | * @return the number of nested interrupts. 86 | */ 87 | rt_uint8_t rt_interrupt_get_nest(void) 88 | { 89 | return rt_interrupt_nest; 90 | } 91 | RTM_EXPORT(rt_interrupt_get_nest); 92 | 93 | RTM_EXPORT(rt_hw_interrupt_disable); 94 | RTM_EXPORT(rt_hw_interrupt_enable); 95 | 96 | /*@}*/ 97 | 98 | -------------------------------------------------------------------------------- /demo/env/stm32f10x/rtt/RVMDK/.gitignore: -------------------------------------------------------------------------------- 1 | /Output 2 | JLinkLog.txt 3 | JLinkSettings.ini 4 | *.bak 5 | *.dep 6 | *.uvguix* 7 | *.uvgui* 8 | -------------------------------------------------------------------------------- /demo/env/stm32f10x/rtt/app/inc/app_task.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************************************* 2 | // NCLUDE FILES 3 | *********************************************************************************************************/ 4 | #ifndef APP_TASK_H 5 | #define APP_TASK_H 6 | 7 | #include 8 | #include 9 | #include 10 | 11 | void rtthread_startup(void); 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /demo/env/stm32f10x/rtt/app/inc/delay_conf.h: -------------------------------------------------------------------------------- 1 | #ifndef __DELAY_CONF_H__ 2 | #define __DELAY_CONF_H__ 3 | 4 | #include"rtconfig.h" 5 | 6 | #if RT_TICK_PER_SECOND == 1 7 | #define DELAY_1S (RT_TICK_PER_SECOND) 8 | #define DELAY_S(X) (X*DELAY_1S) 9 | 10 | #elif RT_TICK_PER_SECOND == 10 11 | #define DELAY_100MS(X) (X) 12 | #define DELAY_S(X) (X*10) 13 | 14 | #elif RT_TICK_PER_SECOND == 100 15 | #define DELAY_10MS(X) (X) 16 | #define DELAY_100MS(X) (X*10) 17 | #define DELAY_S(X) (X*100) 18 | 19 | #elif (RT_TICK_PER_SECOND == 1000) 20 | 21 | #define DELAY_1MS (RT_TICK_PER_SECOND/1000) 22 | #define DELAY_MS(X) (X*DELAY_1MS) 23 | #define DELAY_S(X) (X*1000*DELAY_1MS) 24 | 25 | #elif (RT_TICK_PER_SECOND == 10000) 26 | #define DELAY_100US(X) (X*RT_TICK_PER_SECOND/10000) 27 | #define DELAY_1MS (RT_TICK_PER_SECOND/1000) 28 | #define DELAY_MS(X) (X*DELAY_1MS) 29 | #define DELAY_S(X) (X*1000*DELAY_1MS) 30 | 31 | #endif 32 | 33 | #define DELAY_SYS_INIT_LED_ON DELAY_MS(90) 34 | #define DELAY_SYS_INIT_LED_OFF DELAY_MS(10) 35 | #define DELAY_SYS_RUN_LED_ON DELAY_MS(1950) 36 | #define DELAY_SYS_RUN_LED_OFF DELAY_MS(150) 37 | #define DELAY_SYS_FAULT_LED_ON DELAY_MS(50) 38 | #define DELAY_SYS_FAULT_LED_OFF DELAY_MS(950) 39 | 40 | #endif 41 | 42 | -------------------------------------------------------------------------------- /demo/env/stm32f10x/rtt/app/inc/rtconfig.h: -------------------------------------------------------------------------------- 1 | /* RT-Thread config file */ 2 | #ifndef __RTTHREAD_CFG_H__ 3 | #define __RTTHREAD_CFG_H__ 4 | 5 | /* RT_NAME_MAX*/ 6 | #define RT_NAME_MAX 24 7 | 8 | /* RT_ALIGN_SIZE*/ 9 | #define RT_ALIGN_SIZE 8 10 | 11 | /* PRIORITY_MAX */ 12 | #define RT_THREAD_PRIORITY_MAX 32 13 | 14 | /* Tick per Second */ 15 | #define RT_TICK_PER_SECOND 10000 //0.1ms 16 | 17 | /* SECTION: RT_DEBUG */ 18 | /* Thread Debug */ 19 | #define RT_DEBUG 20 | #define RT_THREAD_DEBUG 21 | 22 | #define RT_USING_OVERFLOW_CHECK 23 | 24 | /* Using Hook */ 25 | #define RT_USING_HOOK 26 | 27 | /* Using Software Timer */ 28 | /* #define RT_USING_TIMER_SOFT */ 29 | #define RT_TIMER_THREAD_PRIO 4 30 | #define RT_TIMER_THREAD_STACK_SIZE 512 31 | #define RT_TIMER_TICK_PER_SECOND 1000 32 | 33 | /* SECTION: IPC */ 34 | /* Using Semaphore*/ 35 | #define RT_USING_SEMAPHORE 36 | 37 | /* Using Mutex */ 38 | #define RT_USING_MUTEX 39 | 40 | /* Using Event */ 41 | #define RT_USING_EVENT 42 | 43 | /* Using MailBox */ 44 | //#define RT_USING_MAILBOX 45 | 46 | /* Using Message Queue */ 47 | //#define RT_USING_MESSAGEQUEUE 48 | 49 | /* SECTION: Memory Management */ 50 | /* Using Memory Pool Management*/ 51 | //#define RT_USING_MEMPOOL 52 | 53 | /* Using Dynamic Heap Management */ 54 | #define RT_USING_HEAP 55 | 56 | /* Using Small MM */ 57 | #define RT_USING_SMALL_MEM 58 | 59 | /* SECTION: Device System */ 60 | /* Using Device System */ 61 | #define RT_USING_CONSOLE 62 | // 63 | #define RT_CONSOLE_DEVICE_NAME "uart1" 64 | 65 | /* SECTION: Console options */ 66 | /* the buffer size of console*/ 67 | #define RT_CONSOLEBUF_SIZE 512 68 | 69 | /* SECTION: finsh, a C-Express shell */ 70 | #define RT_USING_FINSH 71 | /* Using symbol table */ 72 | #define FINSH_USING_SYMTAB 73 | #define FINSH_USING_DESCRIPTION 74 | /* Using msh and finsh */ 75 | #define FINSH_USING_MSH 76 | /* Using msh only */ 77 | #define FINSH_USING_MSH_ONLY 78 | 79 | /* SECTION: Device System */ 80 | /* Using Device System */ 81 | #define RT_USING_DEVICE 82 | // 83 | #define RT_USING_DEVICE_IPC 84 | // 85 | #define RT_USING_SERIAL 86 | 87 | #endif 88 | -------------------------------------------------------------------------------- /demo/env/stm32f10x/rtt/app/inc/stm32f10x_it.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file Project/Template/stm32f10x_it.h 4 | * @author MCD Application Team 5 | * @version V3.1.0 6 | * @date 06/19/2009 7 | * @brief This file contains the headers of the interrupt handlers. 8 | ****************************************************************************** 9 | * @copy 10 | * 11 | * THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS 12 | * WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE 13 | * TIME. AS A RESULT, STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY 14 | * DIRECT, INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING 15 | * FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE 16 | * CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS. 17 | * 18 | *

© COPYRIGHT 2009 STMicroelectronics

19 | */ 20 | 21 | /* Define to prevent recursive inclusion -------------------------------------*/ 22 | #ifndef __STM32F10x_IT_H 23 | #define __STM32F10x_IT_H 24 | 25 | #ifdef __cplusplus 26 | extern "C" { 27 | #endif 28 | 29 | /* Includes ------------------------------------------------------------------*/ 30 | 31 | #include "bsp.h" 32 | 33 | /* Exported types ------------------------------------------------------------*/ 34 | /* Exported constants --------------------------------------------------------*/ 35 | /* Exported macro ------------------------------------------------------------*/ 36 | /* Exported functions ------------------------------------------------------- */ 37 | 38 | void NMI_Handler(void); 39 | void HardFault_Handler(void); 40 | void MemManage_Handler(void); 41 | void BusFault_Handler(void); 42 | void UsageFault_Handler(void); 43 | void SVC_Handler(void); 44 | void DebugMon_Handler(void); 45 | void PendSV_Handler(void); 46 | void SysTick_Handler(void); 47 | 48 | #ifdef __cplusplus 49 | } 50 | #endif 51 | 52 | #endif /* __STM32F10x_IT_H */ 53 | 54 | /******************* (C) COPYRIGHT 2009 STMicroelectronics *****END OF FILE****/ 55 | -------------------------------------------------------------------------------- /demo/env/stm32f10x/rtt/app/src/app.c: -------------------------------------------------------------------------------- 1 | #include "app_task.h" 2 | 3 | int main(void){ 4 | /* disable interrupt first */ 5 | rt_hw_interrupt_disable(); 6 | 7 | /* startup RT-Thread RTOS */ 8 | rtthread_startup(); 9 | 10 | return 0; 11 | } 12 | 13 | 14 | -------------------------------------------------------------------------------- /demo/env/stm32f10x/rtt/app/src/user_finsh_cmd.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armink/EasyFlash/45d22e238adbabb4a070835fcf0c05673b35ec71/demo/env/stm32f10x/rtt/app/src/user_finsh_cmd.c -------------------------------------------------------------------------------- /demo/env/stm32f10x/rtt/components/others/bsp.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armink/EasyFlash/45d22e238adbabb4a070835fcf0c05673b35ec71/demo/env/stm32f10x/rtt/components/others/bsp.c -------------------------------------------------------------------------------- /demo/env/stm32f10x/rtt/components/others/stm32f103xB.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 | /* software version and hardware version store start address */ 7 | define symbol __ICFEDIT_version_start__ = __ICFEDIT_intvec_start__ + 512; 8 | /*-Memory Regions-*/ 9 | define symbol __ICFEDIT_region_ROM_start__ = __ICFEDIT_intvec_start__; 10 | define symbol __ICFEDIT_region_ROM_end__ = 0x0801FFFF; 11 | define symbol __ICFEDIT_region_RAM_start__ = 0x20000000; 12 | define symbol __ICFEDIT_region_RAM_end__ = 0x20004FFF; 13 | /*-Sizes-*/ 14 | define symbol __ICFEDIT_size_cstack__ = 0x800; 15 | define symbol __ICFEDIT_size_heap__ = 0x800; 16 | 17 | /**** End of ICF editor section. ###ICF###*/ 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 | 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 RAM_region { readwrite, 33 | block CSTACK, block HEAP }; 34 | 35 | /* armink add for version storage */ 36 | keep { section .version }; 37 | place at address mem:__ICFEDIT_version_start__ { readonly section .version }; 38 | 39 | /* armink add for rtt finsh */ 40 | keep { section FSymTab }; 41 | keep { section VSymTab }; -------------------------------------------------------------------------------- /demo/env/stm32f10x/rtt/components/others/stm32f103xE.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 | /* software version and hardware version store start address */ 7 | define symbol __ICFEDIT_version_start__ = __ICFEDIT_intvec_start__ + 512; 8 | /*-Memory Regions-*/ 9 | define symbol __ICFEDIT_region_ROM_start__ = __ICFEDIT_intvec_start__; 10 | define symbol __ICFEDIT_region_ROM_end__ = 0x0807FFFF; 11 | define symbol __ICFEDIT_region_RAM_start__ = 0x20000000; 12 | define symbol __ICFEDIT_region_RAM_end__ = 0x2000FFFF; 13 | /*-Sizes-*/ 14 | define symbol __ICFEDIT_size_cstack__ = 0x1000; 15 | define symbol __ICFEDIT_size_heap__ = 0x1000; 16 | 17 | /**** End of ICF editor section. ###ICF###*/ 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 | 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 RAM_region { readwrite, 33 | block CSTACK, block HEAP }; 34 | 35 | /* armink add for version storage */ 36 | keep { section .version }; 37 | place at address mem:__ICFEDIT_version_start__ { readonly section .version }; 38 | 39 | /* armink add for rtt finsh */ 40 | keep { section FSymTab }; 41 | keep { section VSymTab }; -------------------------------------------------------------------------------- /demo/env/stm32f10x/rtt/components/others/types.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef TYPES_H_ 3 | #define TYPES_H_ 4 | 5 | #include 6 | #include 7 | typedef int bool_t; /**< boolean type */ 8 | 9 | #ifndef TRUE 10 | #define TRUE 1 11 | #endif 12 | 13 | #ifndef FALSE 14 | #define FALSE 0 15 | #endif 16 | 17 | #ifndef NULL 18 | #define NULL 0 19 | #endif 20 | 21 | #define success 0 22 | #define fail 1 23 | 24 | 25 | #ifndef disable 26 | #define disable 0 27 | #endif 28 | 29 | #ifndef enable 30 | #define enable 1 31 | #endif 32 | 33 | #endif /* TYPES_H_ */ 34 | -------------------------------------------------------------------------------- /demo/env/stm32f10x/rtt/components/others/utils.c: -------------------------------------------------------------------------------- 1 | #include "utils.h" 2 | 3 | /* current system status */ 4 | static SystemStatus cur_system_status = SYSTEM_STATUS_INIT; 5 | 6 | 7 | /** 8 | * System go to fault status. 9 | */ 10 | void system_go_to_fault_status(void){ 11 | cur_system_status = SYSTEM_STATUS_FAULT; 12 | } 13 | 14 | /** 15 | * Set current system status. 16 | * 17 | * @param status system status 18 | */ 19 | void set_system_status(SystemStatus status){ 20 | cur_system_status = status; 21 | } 22 | 23 | /** 24 | * Get current system status. 25 | * 26 | * @return current system status 27 | */ 28 | SystemStatus get_system_status(void){ 29 | return cur_system_status; 30 | } 31 | -------------------------------------------------------------------------------- /demo/env/stm32f10x/rtt/components/others/utils.h: -------------------------------------------------------------------------------- 1 | #ifndef UTILS_H_ 2 | #define UTILS_H_ 3 | 4 | #include 5 | #include 6 | 7 | /* system status */ 8 | typedef enum{ 9 | SYSTEM_STATUS_INIT, 10 | SYSTEM_STATUS_RUN, 11 | SYSTEM_STATUS_FAULT, 12 | SYSTEM_STATUS_SLEEP, 13 | }SystemStatus; 14 | 15 | void Delay(vu32 nCount); 16 | void system_go_to_fault_status(void); 17 | void set_system_status(SystemStatus status); 18 | SystemStatus get_system_status(void); 19 | 20 | #endif /* UTILS_H_ */ 21 | -------------------------------------------------------------------------------- /demo/env/stm32f10x/rtt/components/rtt_uart/usart.h: -------------------------------------------------------------------------------- 1 | /* 2 | * File : usart.h 3 | * This file is part of RT-Thread RTOS 4 | * COPYRIGHT (C) 2009, RT-Thread Development Team 5 | * 6 | * The license and distribution terms for this file may be 7 | * found in the file LICENSE in this distribution or at 8 | * http://www.rt-thread.org/license/LICENSE 9 | * 10 | * Change Logs: 11 | * Date Author Notes 12 | * 2009-01-05 Bernard the first version 13 | */ 14 | 15 | #ifndef __USART_H__ 16 | #define __USART_H__ 17 | 18 | #include 19 | #include 20 | 21 | #define UART_ENABLE_IRQ(n) NVIC_EnableIRQ((n)) 22 | #define UART_DISABLE_IRQ(n) NVIC_DisableIRQ((n)) 23 | 24 | void rt_hw_usart_init(void); 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /demo/env/stm32f4xx/EWARM/.gitignore: -------------------------------------------------------------------------------- 1 | /STM32F405RG 2 | /Debug 3 | /Release 4 | /settings 5 | *.dep 6 | *.ewd 7 | -------------------------------------------------------------------------------- /demo/env/stm32f4xx/EWARM/EasyFlash.eww: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | $WS_DIR$\EasyFlash.ewp 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /demo/env/stm32f4xx/Libraries/CMSIS/CMSIS_END_USER_LICENCE_AGREEMENT.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armink/EasyFlash/45d22e238adbabb4a070835fcf0c05673b35ec71/demo/env/stm32f4xx/Libraries/CMSIS/CMSIS_END_USER_LICENCE_AGREEMENT.pdf -------------------------------------------------------------------------------- /demo/env/stm32f4xx/Libraries/CMSIS/Device/ST/STM32F4xx/Include/stm32f4xx.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armink/EasyFlash/45d22e238adbabb4a070835fcf0c05673b35ec71/demo/env/stm32f4xx/Libraries/CMSIS/Device/ST/STM32F4xx/Include/stm32f4xx.h -------------------------------------------------------------------------------- /demo/env/stm32f4xx/Libraries/CMSIS/Device/ST/STM32F4xx/Include/system_stm32f4xx.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file system_stm32f4xx.h 4 | * @author MCD Application Team 5 | * @version V1.5.0 6 | * @date 06-March-2015 7 | * @brief CMSIS Cortex-M4 Device System Source File for STM32F4xx devices. 8 | ****************************************************************************** 9 | * @attention 10 | * 11 | *

© COPYRIGHT 2015 STMicroelectronics

12 | * 13 | * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License"); 14 | * You may not use this file except in compliance with the License. 15 | * You may obtain a copy of the License at: 16 | * 17 | * http://www.st.com/software_license_agreement_liberty_v2 18 | * 19 | * Unless required by applicable law or agreed to in writing, software 20 | * distributed under the License is distributed on an "AS IS" BASIS, 21 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 22 | * See the License for the specific language governing permissions and 23 | * limitations under the License. 24 | * 25 | ****************************************************************************** 26 | */ 27 | 28 | /** @addtogroup CMSIS 29 | * @{ 30 | */ 31 | 32 | /** @addtogroup stm32f4xx_system 33 | * @{ 34 | */ 35 | 36 | /** 37 | * @brief Define to prevent recursive inclusion 38 | */ 39 | #ifndef __SYSTEM_STM32F4XX_H 40 | #define __SYSTEM_STM32F4XX_H 41 | 42 | #ifdef __cplusplus 43 | extern "C" { 44 | #endif 45 | 46 | /** @addtogroup STM32F4xx_System_Includes 47 | * @{ 48 | */ 49 | 50 | /** 51 | * @} 52 | */ 53 | 54 | 55 | /** @addtogroup STM32F4xx_System_Exported_types 56 | * @{ 57 | */ 58 | 59 | extern uint32_t SystemCoreClock; /*!< System Clock Frequency (Core Clock) */ 60 | 61 | 62 | /** 63 | * @} 64 | */ 65 | 66 | /** @addtogroup STM32F4xx_System_Exported_Constants 67 | * @{ 68 | */ 69 | 70 | /** 71 | * @} 72 | */ 73 | 74 | /** @addtogroup STM32F4xx_System_Exported_Macros 75 | * @{ 76 | */ 77 | 78 | /** 79 | * @} 80 | */ 81 | 82 | /** @addtogroup STM32F4xx_System_Exported_Functions 83 | * @{ 84 | */ 85 | 86 | extern void SystemInit(void); 87 | extern void SystemCoreClockUpdate(void); 88 | /** 89 | * @} 90 | */ 91 | 92 | #ifdef __cplusplus 93 | } 94 | #endif 95 | 96 | #endif /*__SYSTEM_STM32F4XX_H */ 97 | 98 | /** 99 | * @} 100 | */ 101 | 102 | /** 103 | * @} 104 | */ 105 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 106 | -------------------------------------------------------------------------------- /demo/env/stm32f4xx/Libraries/CMSIS/Device/ST/STM32F4xx/Source/Templates/system_stm32f4xx.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armink/EasyFlash/45d22e238adbabb4a070835fcf0c05673b35ec71/demo/env/stm32f4xx/Libraries/CMSIS/Device/ST/STM32F4xx/Source/Templates/system_stm32f4xx.c -------------------------------------------------------------------------------- /demo/env/stm32f4xx/Libraries/CMSIS/README.txt: -------------------------------------------------------------------------------- 1 | * ------------------------------------------------------------------- 2 | * Copyright (C) 2011-2014 ARM Limited. All rights reserved. 3 | * 4 | * Date: 17 February 2014 5 | * Revision: V4.00 6 | * 7 | * Project: Cortex Microcontroller Software Interface Standard (CMSIS) 8 | * Title: Release Note for CMSIS 9 | * 10 | * ------------------------------------------------------------------- 11 | 12 | 13 | NOTE - Open the index.html file to access CMSIS documentation 14 | 15 | 16 | The Cortex Microcontroller Software Interface Standard (CMSIS) provides a single standard across all 17 | Cortex-Mx processor series vendors. It enables code re-use and code sharing across software projects 18 | and reduces time-to-market for new embedded applications. 19 | 20 | CMSIS is released under the terms of the end user license agreement ("CMSIS_END_USER_LICENCE_AGREEMENT.pdf"). 21 | Any user of the software package is bound to the terms and conditions of the end user license agreement. 22 | 23 | 24 | You will find the following sub-directories: 25 | 26 | Documentation - Contains CMSIS documentation. 27 | 28 | DSP_Lib - MDK project files, Examples and source files etc.. to build the 29 | CMSIS DSP Software Library for Cortex-M0, Cortex-M3, Cortex-M4 processors. 30 | 31 | Include - CMSIS Core Support and CMSIS DSP Include Files. 32 | 33 | Lib - CMSIS DSP Libraries. 34 | 35 | RTOS - CMSIS RTOS API template header file. 36 | 37 | Driver - CMSIS Peripheral Driver Interface. 38 | 39 | Pack - CMSIS Software Packs. 40 | Mechanism to install software, device support, APIs, and example projects. 41 | 42 | SVD - CMSIS SVD Schema files and Conversion Utility. 43 | -------------------------------------------------------------------------------- /demo/env/stm32f4xx/Libraries/CMSIS/index.html: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | Redirect to the CMSIS main page after 0 seconds 5 | 6 | 7 | 8 | 9 | 10 | 11 | If the automatic redirection is failing, click open CMSIS Documentation. 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /demo/env/stm32f4xx/Libraries/STM32F4xx_StdPeriph_Driver/Release_Notes.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armink/EasyFlash/45d22e238adbabb4a070835fcf0c05673b35ec71/demo/env/stm32f4xx/Libraries/STM32F4xx_StdPeriph_Driver/Release_Notes.html -------------------------------------------------------------------------------- /demo/env/stm32f4xx/Libraries/STM32F4xx_StdPeriph_Driver/inc/stm32f4xx_crc.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file stm32f4xx_crc.h 4 | * @author MCD Application Team 5 | * @version V1.5.0 6 | * @date 06-March-2015 7 | * @brief This file contains all the functions prototypes for the CRC firmware 8 | * library. 9 | ****************************************************************************** 10 | * @attention 11 | * 12 | *

© COPYRIGHT 2015 STMicroelectronics

13 | * 14 | * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License"); 15 | * You may not use this file except in compliance with the License. 16 | * You may obtain a copy of the License at: 17 | * 18 | * http://www.st.com/software_license_agreement_liberty_v2 19 | * 20 | * Unless required by applicable law or agreed to in writing, software 21 | * distributed under the License is distributed on an "AS IS" BASIS, 22 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 23 | * See the License for the specific language governing permissions and 24 | * limitations under the License. 25 | * 26 | ****************************************************************************** 27 | */ 28 | 29 | /* Define to prevent recursive inclusion -------------------------------------*/ 30 | #ifndef __STM32F4xx_CRC_H 31 | #define __STM32F4xx_CRC_H 32 | 33 | #ifdef __cplusplus 34 | extern "C" { 35 | #endif 36 | 37 | /* Includes ------------------------------------------------------------------*/ 38 | #include "stm32f4xx.h" 39 | 40 | /** @addtogroup STM32F4xx_StdPeriph_Driver 41 | * @{ 42 | */ 43 | 44 | /** @addtogroup CRC 45 | * @{ 46 | */ 47 | 48 | /* Exported types ------------------------------------------------------------*/ 49 | /* Exported constants --------------------------------------------------------*/ 50 | 51 | /** @defgroup CRC_Exported_Constants 52 | * @{ 53 | */ 54 | 55 | /** 56 | * @} 57 | */ 58 | 59 | /* Exported macro ------------------------------------------------------------*/ 60 | /* Exported functions --------------------------------------------------------*/ 61 | 62 | void CRC_ResetDR(void); 63 | uint32_t CRC_CalcCRC(uint32_t Data); 64 | uint32_t CRC_CalcBlockCRC(uint32_t pBuffer[], uint32_t BufferLength); 65 | uint32_t CRC_GetCRC(void); 66 | void CRC_SetIDRegister(uint8_t IDValue); 67 | uint8_t CRC_GetIDRegister(void); 68 | 69 | #ifdef __cplusplus 70 | } 71 | #endif 72 | 73 | #endif /* __STM32F4xx_CRC_H */ 74 | 75 | /** 76 | * @} 77 | */ 78 | 79 | /** 80 | * @} 81 | */ 82 | 83 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 84 | -------------------------------------------------------------------------------- /demo/env/stm32f4xx/Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_qspi.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armink/EasyFlash/45d22e238adbabb4a070835fcf0c05673b35ec71/demo/env/stm32f4xx/Libraries/STM32F4xx_StdPeriph_Driver/src/stm32f4xx_qspi.c -------------------------------------------------------------------------------- /demo/env/stm32f4xx/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armink/EasyFlash/45d22e238adbabb4a070835fcf0c05673b35ec71/demo/env/stm32f4xx/README.md -------------------------------------------------------------------------------- /demo/env/stm32f4xx/RT-Thread-1.2.2/AUTHORS: -------------------------------------------------------------------------------- 1 | Kernel Design & Implementation 2 | - Bernard Xiong 3 | 4 | LwIP 1.3.0/1.3.1/1.3.2/1.4.0 5 | - Porting 6 | Qiu Yi 7 | Mbbill 8 | - Testing 9 | Bernard Xiong 10 | 11 | Filesystem 12 | - Porting and Add Virtual Filesystem 13 | - Testing 14 | Qiu Yi 15 | prife 16 | 17 | RTGUI 18 | - Design and Implemenation 19 | Bernard Xiong 20 | Grissiom 21 | 22 | BSP 23 | Bernard Xiong 24 | - ATMEL AT91SAM7S64 & AT91SAM7X256 Porting 25 | - STM32 Porting 26 | - S3C4510 Porting 27 | 28 | Mbbill 29 | - ATMEL AT91SAM7X256 30 | 31 | Xulong Cao 32 | - QEMU/x86 33 | 34 | Aozima 35 | - LPC 2148 Porting 36 | - STM32 Porting 37 | 38 | Jing Lee 39 | - LPC 2478 Porting 40 | 41 | Qiu Yi 42 | - S3C2410 & S3C2440 Porting 43 | - TI LM3S 44 | 45 | others... 46 | -------------------------------------------------------------------------------- /demo/env/stm32f4xx/RT-Thread-1.2.2/components/SConscript: -------------------------------------------------------------------------------- 1 | # for module compiling 2 | import os 3 | Import('remove_components') 4 | from building import * 5 | 6 | objs = [] 7 | cwd = GetCurrentDir() 8 | list = os.listdir(cwd) 9 | 10 | for item in list: 11 | if item in remove_components: 12 | continue 13 | 14 | if os.path.isfile(os.path.join(cwd, item, 'SConscript')): 15 | objs = objs + SConscript(os.path.join(item, 'SConscript')) 16 | 17 | Return('objs') 18 | -------------------------------------------------------------------------------- /demo/env/stm32f4xx/RT-Thread-1.2.2/components/drivers/SConscript: -------------------------------------------------------------------------------- 1 | # for module compiling 2 | import os 3 | from building import * 4 | 5 | cwd = GetCurrentDir() 6 | objs = [] 7 | list = os.listdir(cwd) 8 | 9 | for d in list: 10 | path = os.path.join(cwd, d) 11 | if os.path.isfile(os.path.join(path, 'SConscript')): 12 | objs = objs + SConscript(os.path.join(d, 'SConscript')) 13 | 14 | Return('objs') 15 | -------------------------------------------------------------------------------- /demo/env/stm32f4xx/RT-Thread-1.2.2/components/drivers/include/drivers/i2c-bit-ops.h: -------------------------------------------------------------------------------- 1 | /* 2 | * File : i2c-bit-ops.h 3 | * This file is part of RT-Thread RTOS 4 | * COPYRIGHT (C) 2006 - 2012, RT-Thread Development Team 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License along 17 | * with this program; if not, write to the Free Software Foundation, Inc., 18 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 19 | * 20 | * Change Logs: 21 | * Date Author Notes 22 | * 2012-04-25 weety first version 23 | */ 24 | 25 | #ifndef __I2C_BIT_OPS_H__ 26 | #define __I2C_BIT_OPS_H__ 27 | 28 | #ifdef __cplusplus 29 | extern "C" { 30 | #endif 31 | 32 | struct rt_i2c_bit_ops 33 | { 34 | void *data; /* private data for lowlevel routines */ 35 | void (*set_sda)(void *data, rt_int32_t state); 36 | void (*set_scl)(void *data, rt_int32_t state); 37 | rt_int32_t (*get_sda)(void *data); 38 | rt_int32_t (*get_scl)(void *data); 39 | 40 | void (*udelay)(rt_uint32_t us); 41 | 42 | rt_uint32_t delay_us; /* scl and sda line delay */ 43 | rt_uint32_t timeout; /* in tick */ 44 | }; 45 | 46 | rt_err_t rt_i2c_bit_add_bus(struct rt_i2c_bus_device *bus, 47 | const char *bus_name); 48 | 49 | #ifdef __cplusplus 50 | } 51 | #endif 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /demo/env/stm32f4xx/RT-Thread-1.2.2/components/drivers/include/drivers/i2c_dev.h: -------------------------------------------------------------------------------- 1 | /* 2 | * File : i2c_dev.h 3 | * This file is part of RT-Thread RTOS 4 | * COPYRIGHT (C) 2006 - 2012, RT-Thread Development Team 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License along 17 | * with this program; if not, write to the Free Software Foundation, Inc., 18 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 19 | * 20 | * Change Logs: 21 | * Date Author Notes 22 | * 2012-04-25 weety first version 23 | */ 24 | 25 | #ifndef __I2C_DEV_H__ 26 | #define __I2C_DEV_H__ 27 | 28 | #include 29 | 30 | #ifdef __cplusplus 31 | extern "C" { 32 | #endif 33 | 34 | #define RT_I2C_DEV_CTRL_10BIT 0x20 35 | #define RT_I2C_DEV_CTRL_ADDR 0x21 36 | #define RT_I2C_DEV_CTRL_TIMEOUT 0x22 37 | #define RT_I2C_DEV_CTRL_RW 0x23 38 | 39 | struct rt_i2c_priv_data 40 | { 41 | struct rt_i2c_msg *msgs; 42 | rt_size_t number; 43 | }; 44 | 45 | rt_err_t rt_i2c_bus_device_device_init(struct rt_i2c_bus_device *bus, 46 | const char *name); 47 | 48 | #ifdef __cplusplus 49 | } 50 | #endif 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /demo/env/stm32f4xx/RT-Thread-1.2.2/components/drivers/include/drivers/rtc.h: -------------------------------------------------------------------------------- 1 | /* 2 | * File : rtc.h 3 | * This file is part of RT-Thread RTOS 4 | * COPYRIGHT (C) 2006 - 2012, RT-Thread Development Team 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License along 17 | * with this program; if not, write to the Free Software Foundation, Inc., 18 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 19 | * 20 | * Change Logs: 21 | * Date Author Notes 22 | * 2012-10-10 aozima first version. 23 | */ 24 | 25 | #ifndef RTC_H_INCLUDED 26 | #define RTC_H_INCLUDED 27 | 28 | extern rt_err_t set_date(rt_uint32_t year, 29 | rt_uint32_t month, 30 | rt_uint32_t day); 31 | 32 | extern rt_err_t set_time(rt_uint32_t hour, 33 | rt_uint32_t minute, 34 | rt_uint32_t second); 35 | 36 | #endif // RTC_H_INCLUDED 37 | -------------------------------------------------------------------------------- /demo/env/stm32f4xx/RT-Thread-1.2.2/components/drivers/include/drivers/sd.h: -------------------------------------------------------------------------------- 1 | /* 2 | * File : sd.h 3 | * This file is part of RT-Thread RTOS 4 | * COPYRIGHT (C) 2006, RT-Thread Development Team 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License along 17 | * with this program; if not, write to the Free Software Foundation, Inc., 18 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 19 | * 20 | * Change Logs: 21 | * Date Author Notes 22 | * 2011-07-25 weety first version 23 | */ 24 | 25 | #ifndef __SD_H__ 26 | #define __SD_H__ 27 | 28 | #include 29 | #include 30 | 31 | #ifdef __cplusplus 32 | extern "C" { 33 | #endif 34 | 35 | rt_err_t mmcsd_send_if_cond(struct rt_mmcsd_host *host, rt_uint32_t ocr); 36 | rt_err_t mmcsd_send_app_op_cond(struct rt_mmcsd_host *host, rt_uint32_t ocr, rt_uint32_t *rocr); 37 | rt_int32_t init_sd(struct rt_mmcsd_host *host, rt_uint32_t ocr); 38 | 39 | #ifdef __cplusplus 40 | } 41 | #endif 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /demo/env/stm32f4xx/RT-Thread-1.2.2/components/drivers/include/drivers/sdio_func_ids.h: -------------------------------------------------------------------------------- 1 | /* 2 | * File : sdio_func_ids.h 3 | * This file is part of RT-Thread RTOS 4 | * COPYRIGHT (C) 2006, RT-Thread Development Team 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License along 17 | * with this program; if not, write to the Free Software Foundation, Inc., 18 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 19 | * 20 | * Change Logs: 21 | * Date Author Notes 22 | * 2012-02-26 weety first version 23 | */ 24 | 25 | #ifndef __SDIO_FUNC_IDS_H__ 26 | #define __SDIO_FUNC_IDS_H__ 27 | 28 | #ifdef __cplusplus 29 | extern "C" { 30 | #endif 31 | 32 | /* Standard SDIO Function Interfaces */ 33 | 34 | #define SDIO_FUNC_CODE_NONE 0x00 /* Not a SDIO standard interface */ 35 | #define SDIO_FUNC_CODE_UART 0x01 /* SDIO Standard UART */ 36 | #define SDIO_FUNC_CODE_BT_A 0x02 /* SDIO Type-A for Bluetooth standard interface */ 37 | #define SDIO_FUNC_CODE_BT_B 0x03 /* SDIO Type-B for Bluetooth standard interface */ 38 | #define SDIO_FUNC_CODE_GPS 0x04 /* SDIO GPS standard interface */ 39 | #define SDIO_FUNC_CODE_CAMERA 0x05 /* SDIO Camera standard interface */ 40 | #define SDIO_FUNC_CODE_PHS 0x06 /* SDIO PHS standard interface */ 41 | #define SDIO_FUNC_CODE_WLAN 0x07 /* SDIO WLAN interface */ 42 | #define SDIO_FUNC_CODE_ATA 0x08 /* Embedded SDIO-ATA standard interface */ 43 | 44 | /* manufacturer id, product io */ 45 | 46 | #define SDIO_MANUFACTURER_ID_MARVELL 0x02df 47 | #define SDIO_PRODUCT_ID_MARVELL_88W8686 0x9103 48 | 49 | #ifdef __cplusplus 50 | } 51 | #endif 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /demo/env/stm32f4xx/RT-Thread-1.2.2/components/drivers/include/drivers/spi.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armink/EasyFlash/45d22e238adbabb4a070835fcf0c05673b35ec71/demo/env/stm32f4xx/RT-Thread-1.2.2/components/drivers/include/drivers/spi.h -------------------------------------------------------------------------------- /demo/env/stm32f4xx/RT-Thread-1.2.2/components/drivers/serial/SConscript: -------------------------------------------------------------------------------- 1 | from building import * 2 | 3 | cwd = GetCurrentDir() 4 | src = Glob('*.c') 5 | CPPPATH = [cwd + '/../include'] 6 | group = DefineGroup('DeviceDrivers', src, depend = ['RT_USING_SERIAL'], CPPPATH = CPPPATH) 7 | 8 | Return('group') 9 | -------------------------------------------------------------------------------- /demo/env/stm32f4xx/RT-Thread-1.2.2/components/drivers/src/SConscript: -------------------------------------------------------------------------------- 1 | from building import * 2 | 3 | cwd = GetCurrentDir() 4 | src = Glob('*.c') 5 | CPPPATH = [cwd + '/../include'] 6 | group = DefineGroup('DeviceDrivers', src, depend = ['RT_USING_DEVICE_IPC'], CPPPATH = CPPPATH) 7 | 8 | Return('group') 9 | -------------------------------------------------------------------------------- /demo/env/stm32f4xx/RT-Thread-1.2.2/components/drivers/src/wrokqueue.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #ifdef RT_USING_HEAP 5 | static void _workqueue_thread_entry(void* parameter) 6 | { 7 | struct rt_work* work; 8 | struct rt_workqueue* queue; 9 | 10 | queue = (struct rt_workqueue*) parameter; 11 | RT_ASSERT(queue != RT_NULL); 12 | 13 | while (1) 14 | { 15 | if (rt_list_isempty(&(queue->work_list))) 16 | { 17 | /* no software timer exist, suspend self. */ 18 | rt_thread_suspend(rt_thread_self()); 19 | rt_schedule(); 20 | } 21 | 22 | /* we have work to do with. */ 23 | rt_enter_critical(); 24 | work = rt_list_entry(queue->work_list.next, struct rt_work, list); 25 | rt_list_remove(&(work->list)); 26 | rt_exit_critical(); 27 | 28 | /* do work */ 29 | work->work_func(work, work->work_data); 30 | } 31 | } 32 | 33 | struct rt_workqueue *rt_workqueue_create(const char* name, rt_uint16_t stack_size, rt_uint8_t priority) 34 | { 35 | struct rt_workqueue *queue = RT_NULL; 36 | 37 | queue = (struct rt_workqueue*)RT_KERNEL_MALLOC(sizeof(struct rt_workqueue)); 38 | if (queue != RT_NULL) 39 | { 40 | /* initialize work list */ 41 | rt_list_init(&(queue->work_list)); 42 | 43 | /* create the work thread */ 44 | queue->work_thread = rt_thread_create(name, _workqueue_thread_entry, queue, stack_size, priority, 10); 45 | if (queue->work_thread == RT_NULL) 46 | { 47 | RT_KERNEL_FREE(queue); 48 | return RT_NULL; 49 | } 50 | 51 | rt_thread_startup(queue->work_thread); 52 | } 53 | 54 | return queue; 55 | } 56 | 57 | rt_err_t rt_workqueue_destroy(struct rt_workqueue* queue) 58 | { 59 | RT_ASSERT(queue != RT_NULL); 60 | 61 | rt_thread_delete(queue->work_thread); 62 | RT_KERNEL_FREE(queue); 63 | 64 | return RT_EOK; 65 | } 66 | 67 | rt_err_t rt_workqueue_dowork(struct rt_workqueue* queue, struct rt_work* work) 68 | { 69 | RT_ASSERT(queue != RT_NULL); 70 | RT_ASSERT(work != RT_NULL); 71 | 72 | rt_enter_critical(); 73 | /* NOTE: the work MUST be initialized firstly */ 74 | rt_list_remove(&(work->list)); 75 | 76 | rt_list_insert_after(queue->work_list.prev, &(work->list)); 77 | if (queue->work_thread->stat != RT_THREAD_READY) 78 | { 79 | rt_exit_critical(); 80 | /* resume work thread */ 81 | rt_thread_resume(queue->work_thread); 82 | rt_schedule(); 83 | } 84 | else rt_exit_critical(); 85 | 86 | return RT_EOK; 87 | } 88 | 89 | rt_err_t rt_workqueue_cancel_work(struct rt_workqueue* queue, struct rt_work* work) 90 | { 91 | RT_ASSERT(queue != RT_NULL); 92 | RT_ASSERT(work != RT_NULL); 93 | 94 | rt_enter_critical(); 95 | rt_list_remove(&(work->list)); 96 | rt_exit_critical(); 97 | 98 | return RT_EOK; 99 | } 100 | 101 | #endif 102 | -------------------------------------------------------------------------------- /demo/env/stm32f4xx/RT-Thread-1.2.2/components/finsh/SConscript: -------------------------------------------------------------------------------- 1 | Import('rtconfig') 2 | from building import * 3 | 4 | cwd = GetCurrentDir() 5 | src = Split(''' 6 | shell.c 7 | symbol.c 8 | cmd.c 9 | ''') 10 | 11 | fsh_src = Split(''' 12 | finsh_compiler.c 13 | finsh_error.c 14 | finsh_heap.c 15 | finsh_init.c 16 | finsh_node.c 17 | finsh_ops.c 18 | finsh_parser.c 19 | finsh_var.c 20 | finsh_vm.c 21 | finsh_token.c 22 | ''') 23 | 24 | msh_src = Split(''' 25 | msh_cmd.c 26 | msh.c 27 | ''') 28 | 29 | CPPPATH = [cwd] 30 | if rtconfig.CROSS_TOOL == 'keil': 31 | LINKFLAGS = ' --keep __fsym_*' 32 | 33 | if not GetDepend('FINSH_USING_MSH_ONLY'): 34 | LINKFLAGS = LINKFLAGS + ' --keep __vsym_* ' 35 | else: 36 | LINKFLAGS = '' 37 | 38 | if GetDepend('FINSH_USING_MSH'): 39 | src = src + msh_src 40 | if not GetDepend('FINSH_USING_MSH_ONLY'): 41 | src = src + fsh_src 42 | 43 | group = DefineGroup('finsh', src, depend = ['RT_USING_FINSH'], CPPPATH = CPPPATH, LINKFLAGS = LINKFLAGS) 44 | 45 | Return('group') 46 | -------------------------------------------------------------------------------- /demo/env/stm32f4xx/RT-Thread-1.2.2/components/finsh/finsh_error.c: -------------------------------------------------------------------------------- 1 | /* 2 | * error number for finsh shell. 3 | * 4 | * COPYRIGHT (C) 2013, Shanghai Real-Thread Technology Co., Ltd 5 | * 6 | * This file is part of RT-Thread (http://www.rt-thread.org) 7 | * Maintainer: bernard.xiong 8 | * 9 | * All rights reserved. 10 | * 11 | * This program is free software; you can redistribute it and/or modify 12 | * it under the terms of the GNU General Public License as published by 13 | * the Free Software Foundation; either version 2 of the License, or 14 | * (at your option) any later version. 15 | * 16 | * This program is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | * GNU General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU General Public License along 22 | * with this program; if not, write to the Free Software Foundation, Inc., 23 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 24 | * 25 | * Change Logs: 26 | * Date Author Notes 27 | * 2010-03-22 Bernard first version 28 | */ 29 | #include "finsh_error.h" 30 | 31 | u_char global_errno; 32 | 33 | static const char * finsh_error_string_table[] = 34 | { 35 | "No error", 36 | "Invalid token", 37 | "Expect a type", 38 | "Unknown type", 39 | "Variable exist", 40 | "Expect a operater", 41 | "Memory full", 42 | "Unknown operator", 43 | "Unknown node", 44 | "Expect a character", 45 | "Unexpect end", 46 | "Unknown token", 47 | "Float not supported", 48 | "Unknown symbol", 49 | "Null node" 50 | }; 51 | 52 | int finsh_error_init() 53 | { 54 | global_errno = FINSH_ERROR_OK; 55 | 56 | return 0; 57 | } 58 | 59 | int finsh_error_set(u_char type) 60 | { 61 | global_errno = type; 62 | 63 | return 0; 64 | } 65 | 66 | u_char finsh_errno() 67 | { 68 | return global_errno; 69 | } 70 | 71 | const char* finsh_error_string(u_char type) 72 | { 73 | return finsh_error_string_table[type]; 74 | } 75 | -------------------------------------------------------------------------------- /demo/env/stm32f4xx/RT-Thread-1.2.2/components/finsh/finsh_error.h: -------------------------------------------------------------------------------- 1 | /* 2 | * error number for finsh shell. 3 | * 4 | * COPYRIGHT (C) 2013, Shanghai Real-Thread Technology Co., Ltd 5 | * 6 | * This file is part of RT-Thread (http://www.rt-thread.org) 7 | * Maintainer: bernard.xiong 8 | * 9 | * All rights reserved. 10 | * 11 | * This program is free software; you can redistribute it and/or modify 12 | * it under the terms of the GNU General Public License as published by 13 | * the Free Software Foundation; either version 2 of the License, or 14 | * (at your option) any later version. 15 | * 16 | * This program is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | * GNU General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU General Public License along 22 | * with this program; if not, write to the Free Software Foundation, Inc., 23 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 24 | * 25 | * Change Logs: 26 | * Date Author Notes 27 | * 2010-03-22 Bernard first version 28 | */ 29 | #ifndef __FINSH_ERROR_H__ 30 | #define __FINSH_ERROR_H__ 31 | 32 | #include 33 | 34 | int finsh_error_init(void); 35 | 36 | /* get error number */ 37 | u_char finsh_errno(void); 38 | 39 | int finsh_error_set(u_char type); 40 | const char* finsh_error_string(u_char type); 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /demo/env/stm32f4xx/RT-Thread-1.2.2/components/finsh/finsh_heap.h: -------------------------------------------------------------------------------- 1 | /* 2 | * heap management in finsh shell. 3 | * 4 | * COPYRIGHT (C) 2006 - 2013, RT-Thread Development Team 5 | * 6 | * This file is part of RT-Thread (http://www.rt-thread.org) 7 | * Maintainer: bernard.xiong 8 | * 9 | * All rights reserved. 10 | * 11 | * This program is free software; you can redistribute it and/or modify 12 | * it under the terms of the GNU General Public License as published by 13 | * the Free Software Foundation; either version 2 of the License, or 14 | * (at your option) any later version. 15 | * 16 | * This program is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | * GNU General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU General Public License along 22 | * with this program; if not, write to the Free Software Foundation, Inc., 23 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 24 | * 25 | * Change Logs: 26 | * Date Author Notes 27 | * 2010-03-22 Bernard first version 28 | */ 29 | #include 30 | 31 | #ifndef __FINSH_HEAP_H__ 32 | #define __FINSH_HEAP_H__ 33 | 34 | int finsh_heap_init(void); 35 | void* finsh_heap_allocate(size_t size); 36 | void finsh_heap_free(void*ptr); 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /demo/env/stm32f4xx/RT-Thread-1.2.2/components/finsh/finsh_init.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Initialization procedure for finsh shell. 3 | * 4 | * COPYRIGHT (C) 2006 - 2013, RT-Thread Development Team 5 | * 6 | * This file is part of RT-Thread (http://www.rt-thread.org) 7 | * Maintainer: bernard.xiong 8 | * 9 | * All rights reserved. 10 | * 11 | * This program is free software; you can redistribute it and/or modify 12 | * it under the terms of the GNU General Public License as published by 13 | * the Free Software Foundation; either version 2 of the License, or 14 | * (at your option) any later version. 15 | * 16 | * This program is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | * GNU General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU General Public License along 22 | * with this program; if not, write to the Free Software Foundation, Inc., 23 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 24 | * 25 | * Change Logs: 26 | * Date Author Notes 27 | * 2010-03-22 Bernard first version 28 | */ 29 | #include 30 | 31 | #include "finsh_node.h" 32 | #include "finsh_vm.h" 33 | #include "finsh_parser.h" 34 | #include "finsh_var.h" 35 | #include "finsh_error.h" 36 | #include "finsh_heap.h" 37 | 38 | int finsh_init(struct finsh_parser* parser) 39 | { 40 | finsh_parser_init(parser); 41 | 42 | /* finsh init */ 43 | finsh_node_init(); 44 | finsh_var_init(); 45 | finsh_error_init(); 46 | finsh_heap_init(); 47 | 48 | return 0; 49 | } 50 | 51 | long finsh_stack_bottom() 52 | { 53 | return finsh_vm_stack[0].long_value; 54 | } 55 | 56 | int finsh_flush(struct finsh_parser* parser) 57 | { 58 | finsh_parser_init(parser); 59 | 60 | /* finsh init */ 61 | finsh_node_init(); 62 | finsh_error_init(); 63 | 64 | return 0; 65 | } 66 | 67 | int finsh_reset(struct finsh_parser* parser) 68 | { 69 | /* finsh init */ 70 | finsh_node_init(); 71 | finsh_var_init(); 72 | finsh_error_init(); 73 | finsh_heap_init(); 74 | 75 | return 0; 76 | } 77 | -------------------------------------------------------------------------------- /demo/env/stm32f4xx/RT-Thread-1.2.2/components/finsh/finsh_parser.h: -------------------------------------------------------------------------------- 1 | /* 2 | * script parser for finsh shell. 3 | * 4 | * COPYRIGHT (C) 2006 - 2013, RT-Thread Development Team 5 | * 6 | * This file is part of RT-Thread (http://www.rt-thread.org) 7 | * Maintainer: bernard.xiong 8 | * 9 | * All rights reserved. 10 | * 11 | * This program is free software; you can redistribute it and/or modify 12 | * it under the terms of the GNU General Public License as published by 13 | * the Free Software Foundation; either version 2 of the License, or 14 | * (at your option) any later version. 15 | * 16 | * This program is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | * GNU General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU General Public License along 22 | * with this program; if not, write to the Free Software Foundation, Inc., 23 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 24 | * 25 | * Change Logs: 26 | * Date Author Notes 27 | * 2010-03-22 Bernard first version 28 | */ 29 | #ifndef __FINSH_PARSER_H__ 30 | #define __FINSH_PARSER_H__ 31 | 32 | #include 33 | 34 | int finsh_parser_init(struct finsh_parser* self); 35 | void finsh_parser_run(struct finsh_parser* self, const u_char* string); 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /demo/env/stm32f4xx/RT-Thread-1.2.2/components/finsh/finsh_var.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Variable implementation in finsh shell. 3 | * 4 | * COPYRIGHT (C) 2006 - 2013, RT-Thread Development Team 5 | * 6 | * This file is part of RT-Thread (http://www.rt-thread.org) 7 | * Maintainer: bernard.xiong 8 | * 9 | * All rights reserved. 10 | * 11 | * This program is free software; you can redistribute it and/or modify 12 | * it under the terms of the GNU General Public License as published by 13 | * the Free Software Foundation; either version 2 of the License, or 14 | * (at your option) any later version. 15 | * 16 | * This program is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | * GNU General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU General Public License along 22 | * with this program; if not, write to the Free Software Foundation, Inc., 23 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 24 | * 25 | * Change Logs: 26 | * Date Author Notes 27 | * 2010-03-22 Bernard first version 28 | */ 29 | #ifndef __FINSH_VAR_H__ 30 | #define __FINSH_VAR_H__ 31 | 32 | #include 33 | 34 | /* 35 | * The variable in finsh is put in data segment as a global variable. 36 | * The 'finsh_var' structure presents the structure of variable in data segment. 37 | */ 38 | struct finsh_var 39 | { 40 | char name[FINSH_NAME_MAX + 1]; /* the name of variable */ 41 | 42 | u_char type; /* the type of variable */ 43 | 44 | /* variable value */ 45 | union { 46 | char char_value; 47 | short short_value; 48 | int int_value; 49 | long long_value; 50 | void* ptr; 51 | }value; 52 | }; 53 | extern struct finsh_var global_variable[]; 54 | 55 | int finsh_var_init(void); 56 | int finsh_var_insert(const char* name, int type); 57 | int finsh_var_delete(const char* name); 58 | struct finsh_var* finsh_var_lookup(const char* name); 59 | 60 | #endif 61 | -------------------------------------------------------------------------------- /demo/env/stm32f4xx/RT-Thread-1.2.2/components/finsh/finsh_vm.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Virtual machine finsh shell. 3 | * 4 | * COPYRIGHT (C) 2006 - 2013, RT-Thread Development Team 5 | * 6 | * This file is part of RT-Thread (http://www.rt-thread.org) 7 | * Maintainer: bernard.xiong 8 | * 9 | * All rights reserved. 10 | * 11 | * This program is free software; you can redistribute it and/or modify 12 | * it under the terms of the GNU General Public License as published by 13 | * the Free Software Foundation; either version 2 of the License, or 14 | * (at your option) any later version. 15 | * 16 | * This program is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | * GNU General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU General Public License along 22 | * with this program; if not, write to the Free Software Foundation, Inc., 23 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 24 | * 25 | * Change Logs: 26 | * Date Author Notes 27 | * 2010-03-22 Bernard first version 28 | */ 29 | #ifndef __FINSH_VM_H__ 30 | #define __FINSH_VM_H__ 31 | 32 | #include 33 | 34 | #include "finsh_var.h" 35 | 36 | union finsh_value { 37 | char char_value; 38 | short short_value; 39 | long long_value; 40 | void* ptr; 41 | }; 42 | 43 | extern union finsh_value* finsh_sp; /* stack pointer */ 44 | extern u_char* finsh_pc; /* PC */ 45 | 46 | /* stack */ 47 | extern union finsh_value finsh_vm_stack[FINSH_STACK_MAX]; 48 | /* text segment */ 49 | extern u_char text_segment[FINSH_TEXT_MAX]; 50 | 51 | void finsh_vm_run(void); 52 | //void finsh_disassemble(void); 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /demo/env/stm32f4xx/RT-Thread-1.2.2/components/finsh/msh.h: -------------------------------------------------------------------------------- 1 | /* 2 | * RT-Thread module shell implementation. 3 | * 4 | * COPYRIGHT (C) 2013, Shanghai Real-Thread Technology Co., Ltd 5 | * 6 | * This file is part of RT-Thread (http://www.rt-thread.org) 7 | * Maintainer: bernard.xiong 8 | * 9 | * All rights reserved. 10 | * 11 | * This program is free software; you can redistribute it and/or modify 12 | * it under the terms of the GNU General Public License as published by 13 | * the Free Software Foundation; either version 2 of the License, or 14 | * (at your option) any later version. 15 | * 16 | * This program is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | * GNU General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU General Public License along 22 | * with this program; if not, write to the Free Software Foundation, Inc., 23 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 24 | * 25 | * Change Logs: 26 | * Date Author Notes 27 | * 2013-03-30 Bernard the first verion for FinSH 28 | */ 29 | 30 | #ifndef __M_SHELL__ 31 | #define __M_SHELL__ 32 | 33 | #include 34 | 35 | rt_bool_t msh_is_used(void); 36 | int msh_exec(char* cmd, rt_size_t length); 37 | void msh_auto_complete(char *prefix); 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /demo/env/stm32f4xx/RT-Thread-1.2.2/components/finsh/shell.h: -------------------------------------------------------------------------------- 1 | /* 2 | * shell implementation for finsh shell. 3 | * 4 | * COPYRIGHT (C) 2006 - 2013, RT-Thread Development Team 5 | * 6 | * This file is part of RT-Thread (http://www.rt-thread.org) 7 | * Maintainer: bernard.xiong 8 | * 9 | * All rights reserved. 10 | * 11 | * This program is free software; you can redistribute it and/or modify 12 | * it under the terms of the GNU General Public License as published by 13 | * the Free Software Foundation; either version 2 of the License, or 14 | * (at your option) any later version. 15 | * 16 | * This program is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | * GNU General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU General Public License along 22 | * with this program; if not, write to the Free Software Foundation, Inc., 23 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 24 | * 25 | * Change Logs: 26 | * Date Author Notes 27 | * 2011-06-02 Bernard Add finsh_get_prompt function declaration 28 | */ 29 | 30 | #ifndef __SHELL_H__ 31 | #define __SHELL_H__ 32 | 33 | #include 34 | #include "finsh.h" 35 | 36 | #define FINSH_USING_HISTORY 37 | #ifndef FINSH_THREAD_PRIORITY 38 | #define FINSH_THREAD_PRIORITY 20 39 | #endif 40 | #ifndef FINSH_THREAD_STACK_SIZE 41 | #define FINSH_THREAD_STACK_SIZE 2048 42 | #endif 43 | #define FINSH_CMD_SIZE 80 44 | 45 | #define FINSH_OPTION_ECHO 0x01 46 | #if defined(FINSH_USING_MSH) || (defined(RT_USING_DFS) && defined(DFS_USING_WORKDIR)) 47 | #define FINSH_PROMPT finsh_get_prompt() 48 | const char* finsh_get_prompt(void); 49 | #else 50 | #define FINSH_PROMPT "finsh>>" 51 | #endif 52 | 53 | #ifdef FINSH_USING_HISTORY 54 | #ifndef FINSH_HISTORY_LINES 55 | #define FINSH_HISTORY_LINES 5 56 | #endif 57 | #endif 58 | 59 | enum input_stat 60 | { 61 | WAIT_NORMAL, 62 | WAIT_SPEC_KEY, 63 | WAIT_FUNC_KEY, 64 | }; 65 | struct finsh_shell 66 | { 67 | struct rt_semaphore rx_sem; 68 | 69 | enum input_stat stat; 70 | 71 | rt_uint8_t echo_mode:1; 72 | 73 | #ifdef FINSH_USING_HISTORY 74 | rt_uint16_t current_history; 75 | rt_uint16_t history_count; 76 | 77 | char cmd_history[FINSH_HISTORY_LINES][FINSH_CMD_SIZE]; 78 | #endif 79 | 80 | #ifndef FINSH_USING_MSH_ONLY 81 | struct finsh_parser parser; 82 | #endif 83 | 84 | char line[FINSH_CMD_SIZE]; 85 | rt_uint8_t line_position; 86 | rt_uint8_t line_curpos; 87 | 88 | rt_device_t device; 89 | }; 90 | 91 | void finsh_set_echo(rt_uint32_t echo); 92 | rt_uint32_t finsh_get_echo(void); 93 | 94 | int finsh_system_init(void); 95 | void finsh_set_device(const char* device_name); 96 | const char* finsh_get_device(void); 97 | 98 | #endif 99 | -------------------------------------------------------------------------------- /demo/env/stm32f4xx/RT-Thread-1.2.2/components/finsh/symbol.c: -------------------------------------------------------------------------------- 1 | /* 2 | * symbols in finsh shell. 3 | * 4 | * COPYRIGHT (C) 2006 - 2013, RT-Thread Development Team 5 | * 6 | * This file is part of RT-Thread (http://www.rt-thread.org) 7 | * Maintainer: bernard.xiong 8 | * 9 | * All rights reserved. 10 | * 11 | * This program is free software; you can redistribute it and/or modify 12 | * it under the terms of the GNU General Public License as published by 13 | * the Free Software Foundation; either version 2 of the License, or 14 | * (at your option) any later version. 15 | * 16 | * This program is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | * GNU General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU General Public License along 22 | * with this program; if not, write to the Free Software Foundation, Inc., 23 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 24 | * 25 | * Change Logs: 26 | * Date Author Notes 27 | * 2010-03-22 Bernard first version 28 | */ 29 | #include "finsh.h" 30 | 31 | long hello(void); 32 | long version(void); 33 | long list(void); 34 | long list_thread(void); 35 | long list_sem(void); 36 | long list_mutex(void); 37 | long list_fevent(void); 38 | long list_event(void); 39 | long list_mailbox(void); 40 | long list_msgqueue(void); 41 | long list_mempool(void); 42 | long list_timer(void); 43 | 44 | #ifdef FINSH_USING_SYMTAB 45 | struct finsh_syscall *_syscall_table_begin = NULL; 46 | struct finsh_syscall *_syscall_table_end = NULL; 47 | struct finsh_sysvar *_sysvar_table_begin = NULL; 48 | struct finsh_sysvar *_sysvar_table_end = NULL; 49 | #else 50 | struct finsh_syscall _syscall_table[] = 51 | { 52 | {"hello", hello}, 53 | {"version", version}, 54 | {"list", list}, 55 | {"list_thread", list_thread}, 56 | #ifdef RT_USING_SEMAPHORE 57 | {"list_sem", list_sem}, 58 | #endif 59 | #ifdef RT_USING_MUTEX 60 | {"list_mutex", list_mutex}, 61 | #endif 62 | #ifdef RT_USING_FEVENT 63 | {"list_fevent", list_fevent}, 64 | #endif 65 | #ifdef RT_USING_EVENT 66 | {"list_event", list_event}, 67 | #endif 68 | #ifdef RT_USING_MAILBOX 69 | {"list_mb", list_mailbox}, 70 | #endif 71 | #ifdef RT_USING_MESSAGEQUEUE 72 | {"list_mq", list_msgqueue}, 73 | #endif 74 | #ifdef RT_USING_MEMPOOL 75 | {"list_memp", list_mempool}, 76 | #endif 77 | {"list_timer", list_timer}, 78 | }; 79 | struct finsh_syscall *_syscall_table_begin = &_syscall_table[0]; 80 | struct finsh_syscall *_syscall_table_end = &_syscall_table[sizeof(_syscall_table) / sizeof(struct finsh_syscall)]; 81 | 82 | struct finsh_sysvar *_sysvar_table_begin = NULL; 83 | struct finsh_sysvar *_sysvar_table_end = NULL; 84 | #endif 85 | -------------------------------------------------------------------------------- /demo/env/stm32f4xx/RT-Thread-1.2.2/include/cpuusage.h: -------------------------------------------------------------------------------- 1 | #ifndef CPUUSAGE_H 2 | #define CPUUSAGE_H 3 | 4 | 5 | static void cpu_usage_idle_hook(void); 6 | void cpu_usage_get(rt_uint8_t *major, rt_uint8_t *minor); 7 | void cpu_usage_init(void); 8 | 9 | #endif 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /demo/env/stm32f4xx/RT-Thread-1.2.2/include/rtm.h: -------------------------------------------------------------------------------- 1 | /* 2 | * File : rtm.h 3 | * This file is part of RT-Thread RTOS 4 | * COPYRIGHT (C) 2006 - 2012, RT-Thread Development Team 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License along 17 | * with this program; if not, write to the Free Software Foundation, Inc., 18 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 19 | */ 20 | 21 | #ifndef __RTM_H__ 22 | #define __RTM_H__ 23 | 24 | #include 25 | #include 26 | 27 | #ifdef RT_USING_MODULE 28 | struct rt_module_symtab 29 | { 30 | void *addr; 31 | const char *name; 32 | }; 33 | 34 | #if defined(_MSC_VER) 35 | #pragma section("RTMSymTab$f",read) 36 | #define RTM_EXPORT(symbol) \ 37 | __declspec(allocate("RTMSymTab$f"))const char __rtmsym_##symbol##_name[] = "__vs_rtm_"#symbol; 38 | #pragma comment(linker, "/merge:RTMSymTab=mytext") 39 | 40 | #elif defined(__MINGW32__) 41 | #define RTM_EXPORT(symbol) 42 | 43 | #else 44 | #define RTM_EXPORT(symbol) \ 45 | const char __rtmsym_##symbol##_name[] = #symbol; \ 46 | const struct rt_module_symtab __rtmsym_##symbol SECTION("RTMSymTab")= \ 47 | { \ 48 | (void *)&symbol, \ 49 | __rtmsym_##symbol##_name \ 50 | }; 51 | #endif 52 | 53 | #else 54 | #define RTM_EXPORT(symbol) 55 | #endif 56 | 57 | #endif 58 | -------------------------------------------------------------------------------- /demo/env/stm32f4xx/RT-Thread-1.2.2/libcpu/SConscript: -------------------------------------------------------------------------------- 1 | Import('RTT_ROOT') 2 | Import('rtconfig') 3 | from building import * 4 | 5 | comm = rtconfig.ARCH + '/common' 6 | path = rtconfig.ARCH + '/' + rtconfig.CPU 7 | 8 | # The set of source files associated with this SConscript file. 9 | if rtconfig.PLATFORM == 'armcc': 10 | src = Glob(path + '/*.c') + Glob(path + '/*_rvds.S') + Glob(comm + '/*.c') 11 | 12 | if rtconfig.PLATFORM == 'gcc': 13 | src = Glob(path + '/*.c') + Glob(path + '/*_gcc.S') + Glob(comm + '/*.c') + Glob(path + '/*_init.S') 14 | 15 | if rtconfig.PLATFORM == 'iar': 16 | src = Glob(path + '/*.c') + Glob(path + '/*_iar.S') + Glob(comm + '/*.c') 17 | 18 | if rtconfig.PLATFORM == 'cl': 19 | src = Glob(path + '/*.c') 20 | 21 | if rtconfig.PLATFORM == 'mingw': 22 | src = Glob(path + '/*.c') 23 | 24 | CPPPATH = [RTT_ROOT + '/libcpu/' + rtconfig.ARCH + '/' + rtconfig.CPU, RTT_ROOT + '/libcpu/' + rtconfig.ARCH + '/common'] 25 | group = DefineGroup(rtconfig.CPU.upper(), src, depend = [''], CPPPATH = CPPPATH) 26 | 27 | Return('group') 28 | -------------------------------------------------------------------------------- /demo/env/stm32f4xx/RT-Thread-1.2.2/src/SConscript: -------------------------------------------------------------------------------- 1 | Import('RTT_ROOT') 2 | Import('rtconfig') 3 | from building import * 4 | 5 | src = Glob('*.c') 6 | 7 | CPPPATH = [RTT_ROOT + '/include'] 8 | if rtconfig.CROSS_TOOL == 'keil' and GetDepend('RT_USING_MODULE') == True: 9 | LINKFLAGS = ' --keep __rtmsym_* ' 10 | else: 11 | LINKFLAGS = '' 12 | 13 | if GetDepend('RT_USING_MODULE') == False: 14 | SrcRemove(src, ['module.c']) 15 | 16 | if GetDepend('RT_USING_HEAP') == False or GetDepend('RT_USING_SMALL_MEM') == False: 17 | SrcRemove(src, ['mem.c']) 18 | 19 | if GetDepend('RT_USING_HEAP') == False or GetDepend('RT_USING_SLAB') == False: 20 | SrcRemove(src, ['slab.c']) 21 | 22 | if GetDepend('RT_USING_MEMPOOL') == False: 23 | SrcRemove(src, ['mempool.c']) 24 | 25 | if GetDepend('RT_USING_MEMHEAP') == False: 26 | SrcRemove(src, ['memheap.c']) 27 | if GetDepend('RT_USING_MEMHEAP_AS_HEAP'): 28 | SrcRemove(src, ['mem.c']) 29 | 30 | if GetDepend('RT_USING_DEVICE') == False: 31 | SrcRemove(src, ['device.c']) 32 | 33 | group = DefineGroup('Kernel', src, depend = [''], CPPPATH = CPPPATH, LINKFLAGS = LINKFLAGS) 34 | 35 | Return('group') 36 | -------------------------------------------------------------------------------- /demo/env/stm32f4xx/RT-Thread-1.2.2/src/cpuusage.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #define CPU_USAGE_CALC_TICK 10 5 | #define CPU_USAGE_LOOP 100 6 | 7 | static rt_uint8_t cpu_usage_major = 0, cpu_usage_minor= 0; 8 | static rt_uint32_t total_count = 0; 9 | 10 | static void cpu_usage_idle_hook() 11 | { 12 | rt_tick_t tick; 13 | rt_uint32_t count; 14 | volatile rt_uint32_t loop; 15 | 16 | if (total_count == 0) 17 | { 18 | /* get total count */ 19 | rt_enter_critical(); 20 | tick = rt_tick_get(); 21 | while(rt_tick_get() - tick < CPU_USAGE_CALC_TICK) 22 | { 23 | total_count ++; 24 | loop = 0; 25 | while (loop < CPU_USAGE_LOOP) loop ++; 26 | } 27 | rt_exit_critical(); 28 | } 29 | 30 | count = 0; 31 | /* get CPU usage */ 32 | tick = rt_tick_get(); 33 | while (rt_tick_get() - tick < CPU_USAGE_CALC_TICK) 34 | { 35 | count ++; 36 | loop = 0; 37 | while (loop < CPU_USAGE_LOOP) loop ++; 38 | } 39 | 40 | /* calculate major and minor */ 41 | if (count < total_count) 42 | { 43 | count = total_count - count; 44 | cpu_usage_major = (count * 100) / total_count; 45 | cpu_usage_minor = ((count * 100) % total_count) * 100 / total_count; 46 | } 47 | else 48 | { 49 | total_count = count; 50 | 51 | /* no CPU usage */ 52 | cpu_usage_major = 0; 53 | cpu_usage_minor = 0; 54 | } 55 | } 56 | 57 | void cpu_usage_get(rt_uint8_t *major, rt_uint8_t *minor) 58 | { 59 | RT_ASSERT(major != RT_NULL); 60 | RT_ASSERT(minor != RT_NULL); 61 | 62 | *major = cpu_usage_major; 63 | *minor = cpu_usage_minor; 64 | } 65 | 66 | void cpu_usage_init() 67 | { 68 | /* set idle thread hook */ 69 | rt_thread_idle_sethook(cpu_usage_idle_hook); 70 | } 71 | -------------------------------------------------------------------------------- /demo/env/stm32f4xx/RT-Thread-1.2.2/src/irq.c: -------------------------------------------------------------------------------- 1 | /* 2 | * File : irq.c 3 | * This file is part of RT-Thread RTOS 4 | * COPYRIGHT (C) 2006 - 2012, RT-Thread Development Team 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License along 17 | * with this program; if not, write to the Free Software Foundation, Inc., 18 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 19 | * 20 | * Change Logs: 21 | * Date Author Notes 22 | * 2006-02-24 Bernard first version 23 | * 2006-05-03 Bernard add IRQ_DEBUG 24 | */ 25 | 26 | #include 27 | #include 28 | 29 | /* #define IRQ_DEBUG */ 30 | 31 | /** 32 | * @addtogroup Kernel 33 | */ 34 | 35 | /*@{*/ 36 | 37 | volatile rt_uint8_t rt_interrupt_nest; 38 | 39 | /** 40 | * This function will be invoked by BSP, when enter interrupt service routine 41 | * 42 | * @note please don't invoke this routine in application 43 | * 44 | * @see rt_interrupt_leave 45 | */ 46 | void rt_interrupt_enter(void) 47 | { 48 | rt_base_t level; 49 | 50 | RT_DEBUG_LOG(RT_DEBUG_IRQ, ("irq coming..., irq nest:%d\n", 51 | rt_interrupt_nest)); 52 | 53 | level = rt_hw_interrupt_disable(); 54 | rt_interrupt_nest ++; 55 | rt_hw_interrupt_enable(level); 56 | } 57 | RTM_EXPORT(rt_interrupt_enter); 58 | 59 | /** 60 | * This function will be invoked by BSP, when leave interrupt service routine 61 | * 62 | * @note please don't invoke this routine in application 63 | * 64 | * @see rt_interrupt_enter 65 | */ 66 | void rt_interrupt_leave(void) 67 | { 68 | rt_base_t level; 69 | 70 | RT_DEBUG_LOG(RT_DEBUG_IRQ, ("irq leave, irq nest:%d\n", 71 | rt_interrupt_nest)); 72 | 73 | level = rt_hw_interrupt_disable(); 74 | rt_interrupt_nest --; 75 | rt_hw_interrupt_enable(level); 76 | } 77 | RTM_EXPORT(rt_interrupt_leave); 78 | 79 | /** 80 | * This function will return the nest of interrupt. 81 | * 82 | * User application can invoke this function to get whether current 83 | * context is interrupt context. 84 | * 85 | * @return the number of nested interrupts. 86 | */ 87 | rt_uint8_t rt_interrupt_get_nest(void) 88 | { 89 | return rt_interrupt_nest; 90 | } 91 | RTM_EXPORT(rt_interrupt_get_nest); 92 | 93 | RTM_EXPORT(rt_hw_interrupt_disable); 94 | RTM_EXPORT(rt_hw_interrupt_enable); 95 | 96 | /*@}*/ 97 | 98 | -------------------------------------------------------------------------------- /demo/env/stm32f4xx/RVMDK/.gitignore: -------------------------------------------------------------------------------- 1 | /Output 2 | -------------------------------------------------------------------------------- /demo/env/stm32f4xx/app/inc/app_task.h: -------------------------------------------------------------------------------- 1 | /********************************************************************************************************* 2 | // NCLUDE FILES 3 | *********************************************************************************************************/ 4 | #ifndef APP_TASK_H 5 | #define APP_TASK_H 6 | 7 | #include 8 | #include 9 | #include 10 | 11 | void rtthread_startup(void); 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /demo/env/stm32f4xx/app/inc/delay_conf.h: -------------------------------------------------------------------------------- 1 | #ifndef __DELAY_CONF_H__ 2 | #define __DELAY_CONF_H__ 3 | 4 | #include"rtconfig.h" 5 | 6 | #if RT_TICK_PER_SECOND == 1 7 | #define DELAY_1S (RT_TICK_PER_SECOND) 8 | #define DELAY_S(X) (X*DELAY_1S) 9 | 10 | #elif RT_TICK_PER_SECOND == 10 11 | #define DELAY_100MS(X) (X) 12 | #define DELAY_S(X) (X*10) 13 | 14 | #elif RT_TICK_PER_SECOND == 100 15 | #define DELAY_10MS(X) (X) 16 | #define DELAY_100MS(X) (X*10) 17 | #define DELAY_S(X) (X*100) 18 | 19 | #elif (RT_TICK_PER_SECOND == 1000) 20 | 21 | #define DELAY_1MS (RT_TICK_PER_SECOND/1000) 22 | #define DELAY_MS(X) (X*DELAY_1MS) 23 | #define DELAY_S(X) (X*1000*DELAY_1MS) 24 | 25 | #elif (RT_TICK_PER_SECOND == 10000) 26 | #define DELAY_100US(X) (X*RT_TICK_PER_SECOND/10000) 27 | #define DELAY_1MS (RT_TICK_PER_SECOND/1000) 28 | #define DELAY_MS(X) (X*DELAY_1MS) 29 | #define DELAY_S(X) (X*1000*DELAY_1MS) 30 | 31 | #endif 32 | 33 | #define DELAY_SYS_INIT_LED_ON DELAY_MS(90) 34 | #define DELAY_SYS_INIT_LED_OFF DELAY_MS(10) 35 | #define DELAY_SYS_RUN_LED_ON DELAY_MS(1950) 36 | #define DELAY_SYS_RUN_LED_OFF DELAY_MS(150) 37 | #define DELAY_SYS_FAULT_LED_ON DELAY_MS(50) 38 | #define DELAY_SYS_FAULT_LED_OFF DELAY_MS(950) 39 | 40 | #endif 41 | 42 | -------------------------------------------------------------------------------- /demo/env/stm32f4xx/app/inc/rtconfig.h: -------------------------------------------------------------------------------- 1 | /* RT-Thread config file */ 2 | #ifndef __RTTHREAD_CFG_H__ 3 | #define __RTTHREAD_CFG_H__ 4 | 5 | /* RT_NAME_MAX*/ 6 | #define RT_NAME_MAX 24 7 | 8 | /* RT_ALIGN_SIZE*/ 9 | #define RT_ALIGN_SIZE 8 10 | 11 | /* PRIORITY_MAX */ 12 | #define RT_THREAD_PRIORITY_MAX 32 13 | 14 | /* Tick per Second */ 15 | #define RT_TICK_PER_SECOND 10000 //0.1ms 16 | 17 | /* SECTION: RT_DEBUG */ 18 | /* Thread Debug */ 19 | #define RT_DEBUG 20 | #define RT_THREAD_DEBUG 21 | 22 | #define RT_USING_OVERFLOW_CHECK 23 | 24 | /* Using Hook */ 25 | #define RT_USING_HOOK 26 | 27 | /* Using Software Timer */ 28 | /* #define RT_USING_TIMER_SOFT */ 29 | #define RT_TIMER_THREAD_PRIO 4 30 | #define RT_TIMER_THREAD_STACK_SIZE 512 31 | #define RT_TIMER_TICK_PER_SECOND 1000 32 | 33 | /* SECTION: IPC */ 34 | /* Using Semaphore*/ 35 | #define RT_USING_SEMAPHORE 36 | 37 | /* Using Mutex */ 38 | #define RT_USING_MUTEX 39 | 40 | /* Using Event */ 41 | #define RT_USING_EVENT 42 | 43 | /* Using MailBox */ 44 | //#define RT_USING_MAILBOX 45 | 46 | /* Using Message Queue */ 47 | //#define RT_USING_MESSAGEQUEUE 48 | 49 | /* SECTION: Memory Management */ 50 | /* Using Memory Pool Management*/ 51 | //#define RT_USING_MEMPOOL 52 | 53 | /* Using Dynamic Heap Management */ 54 | #define RT_USING_HEAP 55 | 56 | /* Using Small MM */ 57 | #define RT_USING_SMALL_MEM 58 | 59 | /* SECTION: Device System */ 60 | /* Using Device System */ 61 | #define RT_USING_CONSOLE 62 | // 63 | #define RT_CONSOLE_DEVICE_NAME "uart1" 64 | 65 | /* SECTION: Console options */ 66 | /* the buffer size of console*/ 67 | #define RT_CONSOLEBUF_SIZE 512 68 | 69 | /* SECTION: finsh, a C-Express shell */ 70 | #define RT_USING_FINSH 71 | /* Using symbol table */ 72 | #define FINSH_USING_SYMTAB 73 | #define FINSH_USING_DESCRIPTION 74 | /* Using msh and finsh */ 75 | #define FINSH_USING_MSH 76 | /* Using msh only */ 77 | #define FINSH_USING_MSH_ONLY 78 | 79 | /* SECTION: Device System */ 80 | /* Using Device System */ 81 | #define RT_USING_DEVICE 82 | // 83 | #define RT_USING_DEVICE_IPC 84 | // 85 | #define RT_USING_SERIAL 86 | 87 | #endif 88 | -------------------------------------------------------------------------------- /demo/env/stm32f4xx/app/inc/stm32f4xx_it.h: -------------------------------------------------------------------------------- 1 | /** 2 | ****************************************************************************** 3 | * @file Project/STM32F4xx_StdPeriph_Templates/stm32f4xx_it.h 4 | * @author MCD Application Team 5 | * @version V1.5.0 6 | * @date 06-March-2015 7 | * @brief This file contains the headers of the interrupt handlers. 8 | ****************************************************************************** 9 | * @attention 10 | * 11 | *

© COPYRIGHT 2015 STMicroelectronics

12 | * 13 | * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License"); 14 | * You may not use this file except in compliance with the License. 15 | * You may obtain a copy of the License at: 16 | * 17 | * http://www.st.com/software_license_agreement_liberty_v2 18 | * 19 | * Unless required by applicable law or agreed to in writing, software 20 | * distributed under the License is distributed on an "AS IS" BASIS, 21 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 22 | * See the License for the specific language governing permissions and 23 | * limitations under the License. 24 | * 25 | ****************************************************************************** 26 | */ 27 | 28 | /* Define to prevent recursive inclusion -------------------------------------*/ 29 | #ifndef __STM32F4xx_IT_H 30 | #define __STM32F4xx_IT_H 31 | 32 | #ifdef __cplusplus 33 | extern "C" { 34 | #endif 35 | 36 | /* Includes ------------------------------------------------------------------*/ 37 | #include "stm32f4xx.h" 38 | 39 | /* Exported types ------------------------------------------------------------*/ 40 | /* Exported constants --------------------------------------------------------*/ 41 | /* Exported macro ------------------------------------------------------------*/ 42 | /* Exported functions ------------------------------------------------------- */ 43 | 44 | void NMI_Handler(void); 45 | void MemManage_Handler(void); 46 | void BusFault_Handler(void); 47 | void UsageFault_Handler(void); 48 | void SVC_Handler(void); 49 | void DebugMon_Handler(void); 50 | void SysTick_Handler(void); 51 | 52 | #ifdef __cplusplus 53 | } 54 | #endif 55 | 56 | #endif /* __STM32F4xx_IT_H */ 57 | 58 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 59 | -------------------------------------------------------------------------------- /demo/env/stm32f4xx/app/src/app.c: -------------------------------------------------------------------------------- 1 | #include "app_task.h" 2 | 3 | int main(void){ 4 | /* disable interrupt first */ 5 | rt_hw_interrupt_disable(); 6 | 7 | /* startup RT-Thread RTOS */ 8 | rtthread_startup(); 9 | 10 | return 0; 11 | } 12 | 13 | 14 | -------------------------------------------------------------------------------- /demo/env/stm32f4xx/app/src/user_finsh_cmd.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armink/EasyFlash/45d22e238adbabb4a070835fcf0c05673b35ec71/demo/env/stm32f4xx/app/src/user_finsh_cmd.c -------------------------------------------------------------------------------- /demo/env/stm32f4xx/components/others/bsp.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armink/EasyFlash/45d22e238adbabb4a070835fcf0c05673b35ec71/demo/env/stm32f4xx/components/others/bsp.c -------------------------------------------------------------------------------- /demo/env/stm32f4xx/components/others/stm32f103xB.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 | /* software version and hardware version store start address */ 7 | define symbol __ICFEDIT_version_start__ = __ICFEDIT_intvec_start__ + 512; 8 | /*-Memory Regions-*/ 9 | define symbol __ICFEDIT_region_ROM_start__ = __ICFEDIT_intvec_start__; 10 | define symbol __ICFEDIT_region_ROM_end__ = 0x0801FFFF; 11 | define symbol __ICFEDIT_region_RAM_start__ = 0x20000000; 12 | define symbol __ICFEDIT_region_RAM_end__ = 0x20004FFF; 13 | /*-Sizes-*/ 14 | define symbol __ICFEDIT_size_cstack__ = 0x800; 15 | define symbol __ICFEDIT_size_heap__ = 0x800; 16 | 17 | /**** End of ICF editor section. ###ICF###*/ 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 | 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 RAM_region { readwrite, 33 | block CSTACK, block HEAP }; 34 | 35 | /* armink add for version storage */ 36 | keep { section .version }; 37 | place at address mem:__ICFEDIT_version_start__ { readonly section .version }; 38 | 39 | /* armink add for rtt finsh */ 40 | keep { section FSymTab }; 41 | keep { section VSymTab }; -------------------------------------------------------------------------------- /demo/env/stm32f4xx/components/others/stm32f103xE.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 | /* software version and hardware version store start address */ 7 | define symbol __ICFEDIT_version_start__ = __ICFEDIT_intvec_start__ + 512; 8 | /*-Memory Regions-*/ 9 | define symbol __ICFEDIT_region_ROM_start__ = __ICFEDIT_intvec_start__; 10 | define symbol __ICFEDIT_region_ROM_end__ = 0x0807FFFF; 11 | define symbol __ICFEDIT_region_RAM_start__ = 0x20000000; 12 | define symbol __ICFEDIT_region_RAM_end__ = 0x2000FFFF; 13 | /*-Sizes-*/ 14 | define symbol __ICFEDIT_size_cstack__ = 0x1000; 15 | define symbol __ICFEDIT_size_heap__ = 0x1000; 16 | 17 | /**** End of ICF editor section. ###ICF###*/ 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 | 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 RAM_region { readwrite, 33 | block CSTACK, block HEAP }; 34 | 35 | /* armink add for version storage */ 36 | keep { section .version }; 37 | place at address mem:__ICFEDIT_version_start__ { readonly section .version }; 38 | 39 | /* armink add for rtt finsh */ 40 | keep { section FSymTab }; 41 | keep { section VSymTab }; -------------------------------------------------------------------------------- /demo/env/stm32f4xx/components/others/stm32f405xG.icf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armink/EasyFlash/45d22e238adbabb4a070835fcf0c05673b35ec71/demo/env/stm32f4xx/components/others/stm32f405xG.icf -------------------------------------------------------------------------------- /demo/env/stm32f4xx/components/others/types.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef TYPES_H_ 3 | #define TYPES_H_ 4 | 5 | #include 6 | #include 7 | typedef int bool_t; /**< boolean type */ 8 | 9 | #ifndef TRUE 10 | #define TRUE 1 11 | #endif 12 | 13 | #ifndef FALSE 14 | #define FALSE 0 15 | #endif 16 | 17 | #ifndef NULL 18 | #define NULL 0 19 | #endif 20 | 21 | #define success 0 22 | #define fail 1 23 | 24 | 25 | #ifndef disable 26 | #define disable 0 27 | #endif 28 | 29 | #ifndef enable 30 | #define enable 1 31 | #endif 32 | 33 | #endif /* TYPES_H_ */ 34 | -------------------------------------------------------------------------------- /demo/env/stm32f4xx/components/others/utils.c: -------------------------------------------------------------------------------- 1 | #include "utils.h" 2 | 3 | /* current system status */ 4 | static SystemStatus cur_system_status = SYSTEM_STATUS_INIT; 5 | 6 | 7 | /** 8 | * System go to fault status. 9 | */ 10 | void system_go_to_fault_status(void){ 11 | cur_system_status = SYSTEM_STATUS_FAULT; 12 | } 13 | 14 | /** 15 | * Set current system status. 16 | * 17 | * @param status system status 18 | */ 19 | void set_system_status(SystemStatus status){ 20 | cur_system_status = status; 21 | } 22 | 23 | /** 24 | * Get current system status. 25 | * 26 | * @return current system status 27 | */ 28 | SystemStatus get_system_status(void){ 29 | return cur_system_status; 30 | } 31 | -------------------------------------------------------------------------------- /demo/env/stm32f4xx/components/others/utils.h: -------------------------------------------------------------------------------- 1 | #ifndef UTILS_H_ 2 | #define UTILS_H_ 3 | 4 | #include 5 | #include 6 | 7 | /* system status */ 8 | typedef enum{ 9 | SYSTEM_STATUS_INIT, 10 | SYSTEM_STATUS_RUN, 11 | SYSTEM_STATUS_FAULT, 12 | SYSTEM_STATUS_SLEEP, 13 | }SystemStatus; 14 | 15 | void Delay(vu32 nCount); 16 | void system_go_to_fault_status(void); 17 | void set_system_status(SystemStatus status); 18 | SystemStatus get_system_status(void); 19 | 20 | #endif /* UTILS_H_ */ 21 | -------------------------------------------------------------------------------- /demo/env/stm32f4xx/components/rtt_uart/usart.h: -------------------------------------------------------------------------------- 1 | /* 2 | * File : usart.h 3 | * This file is part of RT-Thread RTOS 4 | * COPYRIGHT (C) 2009, RT-Thread Development Team 5 | * 6 | * The license and distribution terms for this file may be 7 | * found in the file LICENSE in this distribution or at 8 | * http://www.rt-thread.org/license/LICENSE 9 | * 10 | * Change Logs: 11 | * Date Author Notes 12 | * 2009-01-05 Bernard the first version 13 | */ 14 | 15 | #ifndef __USART_H__ 16 | #define __USART_H__ 17 | 18 | #include 19 | #include 20 | 21 | #define UART_ENABLE_IRQ(n) NVIC_EnableIRQ((n)) 22 | #define UART_DISABLE_IRQ(n) NVIC_DisableIRQ((n)) 23 | 24 | int stm32_hw_usart_init(void); 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /demo/iap/README.md: -------------------------------------------------------------------------------- 1 | # IAP Deno 2 | 3 | --- 4 | 5 | |File or folder name |Description| 6 | |:----- |:----| 7 | |ymodem+rtt.c |Using RT-Thread RTOS and it ymodem utils| 8 | -------------------------------------------------------------------------------- /demo/iap/ymodem+rtt.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armink/EasyFlash/45d22e238adbabb4a070835fcf0c05673b35ec71/demo/iap/ymodem+rtt.c -------------------------------------------------------------------------------- /demo/log/README.md: -------------------------------------------------------------------------------- 1 | # Log Deno 2 | 3 | --- 4 | 5 | |File or folder name |Description| 6 | |:----- |:----| 7 | |easylogger.c |Using [EasyLogger lib](https://github.com/armink/EasyLogger) function| 8 | -------------------------------------------------------------------------------- /docs/en/api.md: -------------------------------------------------------------------------------- 1 | # Coming soon... -------------------------------------------------------------------------------- /docs/en/images/EnvDemo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armink/EasyFlash/45d22e238adbabb4a070835fcf0c05673b35ec71/docs/en/images/EnvDemo.gif -------------------------------------------------------------------------------- /docs/en/images/IapDemo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armink/EasyFlash/45d22e238adbabb4a070835fcf0c05673b35ec71/docs/en/images/IapDemo.gif -------------------------------------------------------------------------------- /docs/en/images/LogDemo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armink/EasyFlash/45d22e238adbabb4a070835fcf0c05673b35ec71/docs/en/images/LogDemo.gif -------------------------------------------------------------------------------- /docs/en/readme.md: -------------------------------------------------------------------------------- 1 | |File name |Description| 2 | |:----- |:----| 3 | |api.md |API description| -------------------------------------------------------------------------------- /docs/readme.md: -------------------------------------------------------------------------------- 1 | |File or folder name |Description| 2 | |:----- |:----| 3 | |en |English documents| 4 | |zh |中文文档(简体)| -------------------------------------------------------------------------------- /docs/zh/images/BackupAreaPartition.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armink/EasyFlash/45d22e238adbabb4a070835fcf0c05673b35ec71/docs/zh/images/BackupAreaPartition.jpg -------------------------------------------------------------------------------- /docs/zh/images/EnvDemo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armink/EasyFlash/45d22e238adbabb4a070835fcf0c05673b35ec71/docs/zh/images/EnvDemo.gif -------------------------------------------------------------------------------- /docs/zh/images/IapDemo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armink/EasyFlash/45d22e238adbabb4a070835fcf0c05673b35ec71/docs/zh/images/IapDemo.gif -------------------------------------------------------------------------------- /docs/zh/images/LogDemo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armink/EasyFlash/45d22e238adbabb4a070835fcf0c05673b35ec71/docs/zh/images/LogDemo.gif -------------------------------------------------------------------------------- /docs/zh/images/env_op1_step1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armink/EasyFlash/45d22e238adbabb4a070835fcf0c05673b35ec71/docs/zh/images/env_op1_step1.png -------------------------------------------------------------------------------- /docs/zh/images/env_op1_step2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armink/EasyFlash/45d22e238adbabb4a070835fcf0c05673b35ec71/docs/zh/images/env_op1_step2.png -------------------------------------------------------------------------------- /docs/zh/images/env_op1_step3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armink/EasyFlash/45d22e238adbabb4a070835fcf0c05673b35ec71/docs/zh/images/env_op1_step3.png -------------------------------------------------------------------------------- /docs/zh/images/env_op1_step4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armink/EasyFlash/45d22e238adbabb4a070835fcf0c05673b35ec71/docs/zh/images/env_op1_step4.png -------------------------------------------------------------------------------- /docs/zh/images/ng_mode_data_structure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armink/EasyFlash/45d22e238adbabb4a070835fcf0c05673b35ec71/docs/zh/images/ng_mode_data_structure.png -------------------------------------------------------------------------------- /docs/zh/images/wechat_support.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armink/EasyFlash/45d22e238adbabb4a070835fcf0c05673b35ec71/docs/zh/images/wechat_support.png -------------------------------------------------------------------------------- /docs/zh/readme.md: -------------------------------------------------------------------------------- 1 | |文件名 |描述| 2 | |:----- |:----| 3 | |api.md |API 说明| 4 | |port.md |移植说明| -------------------------------------------------------------------------------- /docs/zh/v4_migrate.md: -------------------------------------------------------------------------------- 1 | # V4.0 迁移指南 2 | 3 | ## 1、V3.0 与 V4.0 差异 4 | 5 | ### 1.1 API 接口方面 6 | 7 | #### 1.1.1 完全兼容旧版 8 | 9 | V4.0 在设计时,已经做到接口完全兼容旧版本,所以如果你的应用使用的是旧版本,那么无需修改任何源代码即可做到无缝迁移。 10 | 11 | #### 1.1.2 新增接口 12 | 13 | V4.0 底层对于 ENV 的存储使用的 blob 格式,所以增加如下 blob 操作接口,替代 V3.0 的基于字符串的接口 14 | 15 | - `size_t ef_get_env_blob(const char *key, void *value_buf, size_t buf_len, size_t *value_len)` 16 | - `EfErrCode ef_set_env_blob(const char *key, const void *value_buf, size_t buf_len)` 17 | 18 | #### 1.1.3 废弃接口 19 | 20 | 以下接口在 V4.0 中仍然可用,但已经由于种种原因被废弃,可能将会在 V5.0 版本中被正式删除 21 | 22 | - `char *ef_get_env(const char *key)` 23 | 24 | - 注意:由于 V4.0 版本开始,在该函数内部具有环境变量的缓冲区,不允许连续多次同时使用该函数,例如如下代码: 25 | 26 | ```C 27 | // 错误的使用方法 28 | ssid = ef_get_env("ssid"); 29 | password = ef_get_env("password"); // 由于 buf 共用,password 与 ssid 会返回相同的 buf 地址 30 | 31 | // 建议改为下面的方式 32 | ssid = strdup(ef_get_env("ssid")); // 克隆获取回来的环境变量 33 | password = strdup(ef_get_env("password")); 34 | 35 | // 使用完成后,释放资源 36 | free(ssid); // 与 strdup 成对 37 | free(password); 38 | ``` 39 | 40 | 41 | 42 | - `EfErrCode ef_save_env(void)` 43 | 44 | - `EfErrCode ef_set_and_save_env(const char *key, const char *value)` 45 | 46 | - `EfErrCode ef_del_and_save_env(const char *key)` 47 | 48 | - `size_t ef_get_env_write_bytes(void)` 49 | 50 | ## 2、主要修改项 51 | 52 | ### 2.1 配置方面 53 | 54 | - 删除 EF_ENV_USING_WL_MODE:V4.0 原生支持磨损平衡,无需额外开启 55 | - 删除 EF_ENV_USING_PFS_MODE:V4.0 自带掉电保护功能,无需额外开启 56 | - 删除 ENV_USER_SETTING_SIZE:V4.0 无需 RAM 缓存 57 | - 增加 EF_WRITE_GRAN :详见移植文档 58 | 59 | ### 2.2 接口改进 60 | 61 | - 建议使用 ef_get_env_blob 接口替代 ef_get_env,使用方法详见 API 文档 62 | - V4.0 无需额外执行保存动作,所以使用这些接口的代码在 V4..0 无意义,可以移除 63 | - ef_save_env 64 | - ef_set_and_save_env 65 | - ef_del_and_save_env 66 | 67 | -------------------------------------------------------------------------------- /easyflash/plugins/types/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armink/EasyFlash/45d22e238adbabb4a070835fcf0c05673b35ec71/easyflash/plugins/types/README.md -------------------------------------------------------------------------------- /easyflash/plugins/types/struct2json/readme.md: -------------------------------------------------------------------------------- 1 | # C结构体与 JSON 快速互转库 2 | 3 | --- 4 | 5 | ## struct2json 6 | 7 | [struct2json](https://github.com/armink/struct2json) 是一个开源的C结构体与 JSON 快速互转库,它可以快速实现 **结构体对象** 与 **JSON 对象** 之间序列化及反序列化要求。快速、简洁的 API 设计,大大降低直接使用 JSON 解析库来实现此类功能的代码复杂度。 8 | 9 | ## 起源 10 | 11 | 把面向对象设计应用到C语言中,是当下很流行的设计思想。由于C语言中没有类,所以一般使用结构体 `struct` 充当类,那么结构体变量就是对象。有了对象之后,很多时候需要考虑对象的序列化及反序列化问题。C语言不像很多高级语言拥有反射等机制,使得对象序列化及反序列化被原生的支持。 12 | 13 | 对于C语言来说,序列化为 JSON 字符串是个不错的选择,所以就得使用 [cJSON](https://github.com/kbranigan/cJSON) 这类 JSON 解析库,但是使用后的代码冗余且逻辑性差,所以萌生对cJSON库进行二次封装,实现一个 struct 与 JSON 之间快速互转的库。 struct2json 就诞生于此。下面是 struct2json 主要使用场景: 14 | 15 | - **持久化** :结构体对象序列化为 JSON 对象后,可直接保存至文件、Flash,实现对结构体对象的掉电存储; 16 | - **通信** :高级语言对JSON支持的很友好,例如: Javascript、Groovy 就对 JSON 具有原生的支持,所以 JSON 也可作为C语言与其他语言软件之间的通信协议格式及对象传递格式; 17 | - **可视化** :序列化为 JSON 后的对象,可以更加直观的展示到控制台或者 UI 上,可用于产品调试、产品二次开发等场景; 18 | 19 | ## 如何使用 20 | 21 | ### 声明结构体 22 | 23 | 如下声明了两个结构体,结构体 `Hometown` 是结构体 `Student` 的子结构体 24 | 25 | ```C 26 | /* 籍贯 */ 27 | typedef struct { 28 | char name[16]; 29 | } Hometown; 30 | 31 | /* 学生 */ 32 | typedef struct { 33 | uint8_t id; 34 | uint8_t score[8]; 35 | char name[10]; 36 | double weight; 37 | Hometown hometown; 38 | } Student; 39 | ``` 40 | 41 | ### 将结构体对象序列化为 JSON 对象 42 | 43 | |使用前([源文件](https://github.com/armink/struct2json/blob/master/docs/zh/assets/not_use_struct2json.c))|使用后([源文件](https://github.com/armink/struct2json/blob/master/docs/zh/assets/used_struct2json.c))| 44 | |:-----:|:-----:| 45 | |![结构体转JSON-使用前](https://git.oschina.net/Armink/struct2json/raw/master/docs/zh/images/not_use_struct2json.png)| ![结构体转JSON-使用后](https://git.oschina.net/Armink/struct2json/raw/master/docs/zh/images/used_struct2json.png)| 46 | 47 | ### 将 JSON 对象反序列化为结构体对象 48 | 49 | |使用前([源文件](https://github.com/armink/struct2json/blob/master/docs/zh/assets/not_use_struct2json_for_json.c))|使用后([源文件](https://github.com/armink/struct2json/blob/master/docs/zh/assets/used_struct2json_for_json.c))| 50 | |:-----:|:-----:| 51 | |![JSON转结构体-使用前](https://git.oschina.net/Armink/struct2json/raw/master/docs/zh/images/not_use_struct2json_for_json.png)| ![JSON转结构体-使用后](https://git.oschina.net/Armink/struct2json/raw/master/docs/zh/images/used_struct2json_for_json.png)| 52 | 53 | 欢迎大家 **fork and pull request**([Github](https://github.com/armink/struct2json)|[OSChina](http://git.oschina.net/armink/struct2json)|[Coding](https://coding.net/u/armink/p/struct2json/git)) 。如果觉得这个开源项目很赞,可以点击[项目主页](https://github.com/armink/struct2json) 右上角的**Star**,同时把它推荐给更多有需要的朋友。 54 | 55 | ## 文档 56 | 57 | 具体内容参考[`\docs\zh\`](https://github.com/armink/struct2json/tree/master/docs/zh)下的文件。务必保证在 **阅读文档** 后再使用。 58 | 59 | ## 许可 60 | 61 | MIT Copyright (c) armink.ztl@gmail.com 62 | -------------------------------------------------------------------------------- /easyflash/plugins/types/struct2json/src/s2j.c: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the struct2json Library. 3 | * 4 | * Copyright (c) 2015, Armink, 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining 7 | * a copy of this software and associated documentation files (the 8 | * 'Software'), to deal in the Software without restriction, including 9 | * without limitation the rights to use, copy, modify, merge, publish, 10 | * distribute, sublicense, and/or sell copies of the Software, and to 11 | * permit persons to whom the Software is furnished to do so, subject to 12 | * the following conditions: 13 | * 14 | * The above copyright notice and this permission notice shall be 15 | * included in all copies or substantial portions of the Software. 16 | * 17 | * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, 18 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 19 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 20 | * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 21 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 22 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 23 | * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 24 | * 25 | * Function: Initialize interface for this library. 26 | * Created on: 2015-10-14 27 | */ 28 | 29 | #include 30 | #include 31 | 32 | S2jHook s2jHook = { 33 | .malloc_fn = malloc, 34 | .free_fn = free, 35 | }; 36 | 37 | /** 38 | * struct2json library initialize 39 | * @note It will initialize cJSON library hooks. 40 | */ 41 | void s2j_init(S2jHook *hook) { 42 | /* initialize cJSON library */ 43 | cJSON_InitHooks((cJSON_Hooks *)hook); 44 | /* initialize hooks */ 45 | if (hook) { 46 | s2jHook.malloc_fn = (hook->malloc_fn) ? hook->malloc_fn : malloc; 47 | s2jHook.free_fn = (hook->free_fn) ? hook->free_fn : free; 48 | } else { 49 | s2jHook.malloc_fn = malloc; 50 | s2jHook.free_fn = free; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /easyflash/src/ef_env.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/armink/EasyFlash/45d22e238adbabb4a070835fcf0c05673b35ec71/easyflash/src/ef_env.c --------------------------------------------------------------------------------