├── Docu ├── STM8_Devices.ods ├── Images │ ├── STM8_logo.jpg │ ├── muBoard.jpg │ ├── stm8af_discovery.png │ ├── stm8al_discovery.png │ ├── stm8l_discovery.jpg │ └── stm8s_discovery.jpg └── README.md ├── Library ├── Libraries │ ├── FatFS_0.13 │ │ ├── documents │ │ │ └── res │ │ │ │ ├── f1.png │ │ │ │ ├── f2.png │ │ │ │ ├── f3.png │ │ │ │ ├── f4.png │ │ │ │ ├── f5.png │ │ │ │ ├── f6.png │ │ │ │ ├── f7.png │ │ │ │ ├── funcs.png │ │ │ │ ├── mkfs.xls │ │ │ │ ├── layers.png │ │ │ │ ├── layers1.png │ │ │ │ ├── layers2.png │ │ │ │ ├── layers3.png │ │ │ │ ├── mkfatimg.zip │ │ │ │ ├── modules.png │ │ │ │ ├── rwtest1.png │ │ │ │ ├── rwtest2.png │ │ │ │ ├── rwtest3.png │ │ │ │ └── app1.c │ │ ├── 00readme.txt │ │ └── inc │ │ │ └── ffinteger.h │ ├── PetitFS_0.03 │ │ ├── doc │ │ │ ├── img │ │ │ │ ├── layers3.png │ │ │ │ └── rwtest3.png │ │ │ ├── css_p.css │ │ │ └── pf │ │ │ │ ├── sdir.html │ │ │ │ ├── filename.html │ │ │ │ └── dinit.html │ │ └── inc │ │ │ ├── pffinteger.h │ │ │ └── pffdiskio.h │ └── README.md ├── Base │ ├── README.md │ └── inc │ │ ├── timeout.h │ │ ├── stopwatch.h │ │ ├── pulse.h │ │ ├── beep.h │ │ ├── shift.h │ │ ├── power-saving.h │ │ ├── getchar.h │ │ ├── putchar.h │ │ └── stdint.h ├── User │ └── README.md ├── STM8L_Discovery │ ├── README.md │ └── inc │ │ └── STM8S_Discovery_config.h ├── STM8S_Discovery │ ├── README.md │ └── inc │ │ └── STM8S_Discovery_config.h └── muBoard │ ├── README.md │ └── inc │ ├── muBoard_config.h │ ├── mub_error_codes.h │ └── mub_diffAmp.h ├── Projects ├── General_Examples │ ├── Dhrystone │ │ ├── Dhrystone.tar.gz │ │ ├── STVD_Cosmic │ │ │ └── STM8_Template.stw │ │ ├── config.h │ │ └── clean.py │ ├── Beeper │ │ ├── STVD_Cosmic │ │ │ └── STM8_Template.stw │ │ ├── config.h │ │ ├── main.c │ │ └── clean.py │ ├── I2C_read │ │ ├── STVD_Cosmic │ │ │ └── STM8_Template.stw │ │ ├── config.h │ │ └── clean.py │ ├── I2C_write │ │ ├── STVD_Cosmic │ │ │ └── STM8_Template.stw │ │ ├── config.h │ │ └── clean.py │ ├── Minimal-C │ │ ├── STVD_Cosmic │ │ │ └── STM8_Template.stw │ │ ├── config.h │ │ ├── main.c │ │ └── clean.py │ ├── echo_UART │ │ ├── STVD_Cosmic │ │ │ └── STM8_Template.stw │ │ ├── config.h │ │ ├── main.c │ │ └── clean.py │ ├── ADC_Measure │ │ ├── STVD_Cosmic │ │ │ └── STM8_Template.stw │ │ ├── config.h │ │ └── clean.py │ ├── Basic_Project │ │ ├── STVD_Cosmic │ │ │ └── STM8_Template.stw │ │ ├── config.h │ │ └── clean.py │ ├── Measure_PWM │ │ ├── STVD_Cosmic │ │ │ └── STM8_Template.stw │ │ ├── config.h │ │ └── clean.py │ ├── Pin_Interrupt │ │ ├── STVD_Cosmic │ │ │ └── STM8_Template.stw │ │ ├── config.h │ │ └── clean.py │ ├── Pin_Read_Write │ │ ├── STVD_Cosmic │ │ │ └── STM8_Template.stw │ │ ├── config.h │ │ ├── main.c │ │ └── clean.py │ ├── Port_Interrupt │ │ ├── STVD_Cosmic │ │ │ └── STM8_Template.stw │ │ ├── config.h │ │ └── clean.py │ ├── Printf_UART │ │ ├── STVD_Cosmic │ │ │ └── STM8_Template.stw │ │ ├── config.h │ │ └── clean.py │ ├── Trap_Interrupt │ │ ├── STVD_Cosmic │ │ │ └── STM8_Template.stw │ │ ├── config.h │ │ ├── main.c │ │ └── clean.py │ ├── EEPROM_Datalogger │ │ ├── STVD_Cosmic │ │ │ └── STM8_Template.stw │ │ ├── config.h │ │ └── clean.py │ ├── Gets_Printf_UART │ │ ├── STVD_Cosmic │ │ │ └── STM8_Template.stw │ │ ├── config.h │ │ └── clean.py │ ├── Minimal-C_with_ISR │ │ ├── STVD_Cosmic │ │ │ └── STM8_Template.stw │ │ ├── config.h │ │ └── clean.py │ ├── P-Flash_Datalogger │ │ ├── STVD_Cosmic │ │ │ └── STM8_Template.stw │ │ ├── config.h │ │ └── clean.py │ ├── Power_Saving_Modes │ │ ├── STVD_Cosmic │ │ │ └── STM8_Template.stw │ │ ├── config.h │ │ └── clean.py │ ├── TIM3_PWM_generate │ │ ├── STVD_Cosmic │ │ │ └── STM8_Template.stw │ │ ├── config.h │ │ └── clean.py │ ├── Timeout_Scheduler │ │ ├── STVD_Cosmic │ │ │ └── STM8_Template.stw │ │ ├── config.h │ │ └── clean.py │ ├── echo_UART_with_ISR │ │ ├── STVD_Cosmic │ │ │ └── STM8_Template.stw │ │ ├── config.h │ │ └── clean.py │ ├── mirror_two_UARTs │ │ ├── STVD_Cosmic │ │ │ └── STM8_Template.stw │ │ ├── config.h │ │ ├── main.c │ │ └── clean.py │ ├── ADC_Continuous_with_ISR │ │ ├── STVD_Cosmic │ │ │ └── STM8_Template.stw │ │ └── config.h │ ├── Attach_1ms_Interrupt │ │ ├── STVD_Cosmic │ │ │ └── STM8_Template.stw │ │ ├── config.h │ │ └── clean.py │ ├── Bootloader_Activation │ │ ├── STVD_Cosmic │ │ │ └── STM8_Template.stw │ │ └── config.h │ ├── mirror_two_UARTs_with_ISR │ │ ├── STVD_Cosmic │ │ │ └── STM8_Template.stw │ │ └── config.h │ └── PiAndMore10 │ │ ├── STM8S_Discovery │ │ ├── main.c │ │ └── config.h │ │ └── muBoard │ │ ├── config.h │ │ ├── main.c │ │ └── clean.py ├── chmod_python.sh ├── muBoard_Examples │ ├── Pin_Read_Write │ │ ├── STVD_Cosmic │ │ │ └── STM8_Template.stw │ │ ├── terminal.py │ │ ├── config.h │ │ └── clean.py │ ├── LCD-display_I2C │ │ ├── STVD_Cosmic │ │ │ └── STM8_Template.stw │ │ ├── config.h │ │ ├── main.c │ │ └── clean.py │ ├── digital-poti_I2C │ │ ├── STVD_Cosmic │ │ │ └── STM8_Template.stw │ │ ├── config.h │ │ └── main.c │ └── README.md ├── Libraries_Examples │ ├── DigPoti-AD5280 │ │ ├── STVD_Cosmic │ │ │ └── STM8_Template.stw │ │ ├── config.h │ │ ├── main.c │ │ └── clean.py │ ├── DigPoti-AD5282 │ │ ├── STVD_Cosmic │ │ │ └── STM8_Template.stw │ │ ├── config.h │ │ ├── main.c │ │ └── clean.py │ ├── LCD-BTHQ21605V │ │ ├── STVD_Cosmic │ │ │ └── STM8_Template.stw │ │ ├── config.h │ │ ├── main.c │ │ └── clean.py │ ├── SD-card_fatFS │ │ ├── STVD_Cosmic │ │ │ └── STM8_Template.stw │ │ └── clean.py │ ├── SD-card_petitFS │ │ ├── STVD_Cosmic │ │ │ └── STM8_Template.stw │ │ └── clean.py │ └── README.md ├── STM8S_Discovery_Examples │ ├── Minimal-C │ │ ├── STVD_Cosmic │ │ │ └── STM8_Template.stw │ │ ├── config.h │ │ └── main.c │ ├── Basic_Project │ │ ├── STVD_Cosmic │ │ │ └── STM8_Template.stw │ │ ├── config.h │ │ └── main.c │ ├── Attach_1ms_Interrupt │ │ ├── STVD_Cosmic │ │ │ └── STM8_Template.stw │ │ └── config.h │ └── echo_UART_with_ISR │ │ ├── STVD_Cosmic │ │ └── STM8_Template.stw │ │ └── config.h ├── STM8_StdPeriphLib_Examples │ ├── Minimal-C │ │ ├── STVD_Cosmic │ │ │ └── STM8_Template.stw │ │ ├── config.h │ │ ├── stm8s_conf.h │ │ ├── SPL.c │ │ └── main.c │ └── Basic_Project │ │ ├── STVD_Cosmic │ │ └── STM8_Template.stw │ │ ├── config.h │ │ ├── stm8s_conf.h │ │ ├── SPL.c │ │ └── main.c ├── clean_all_projects.py ├── build_all_projects.py └── README.md ├── .gitignore ├── README.md └── Tools └── README.md /Docu/STM8_Devices.ods: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gicking/STM8_templates/HEAD/Docu/STM8_Devices.ods -------------------------------------------------------------------------------- /Docu/Images/STM8_logo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gicking/STM8_templates/HEAD/Docu/Images/STM8_logo.jpg -------------------------------------------------------------------------------- /Docu/Images/muBoard.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gicking/STM8_templates/HEAD/Docu/Images/muBoard.jpg -------------------------------------------------------------------------------- /Docu/Images/stm8af_discovery.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gicking/STM8_templates/HEAD/Docu/Images/stm8af_discovery.png -------------------------------------------------------------------------------- /Docu/Images/stm8al_discovery.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gicking/STM8_templates/HEAD/Docu/Images/stm8al_discovery.png -------------------------------------------------------------------------------- /Docu/Images/stm8l_discovery.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gicking/STM8_templates/HEAD/Docu/Images/stm8l_discovery.jpg -------------------------------------------------------------------------------- /Docu/Images/stm8s_discovery.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gicking/STM8_templates/HEAD/Docu/Images/stm8s_discovery.jpg -------------------------------------------------------------------------------- /Library/Libraries/FatFS_0.13/documents/res/f1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gicking/STM8_templates/HEAD/Library/Libraries/FatFS_0.13/documents/res/f1.png -------------------------------------------------------------------------------- /Library/Libraries/FatFS_0.13/documents/res/f2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gicking/STM8_templates/HEAD/Library/Libraries/FatFS_0.13/documents/res/f2.png -------------------------------------------------------------------------------- /Library/Libraries/FatFS_0.13/documents/res/f3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gicking/STM8_templates/HEAD/Library/Libraries/FatFS_0.13/documents/res/f3.png -------------------------------------------------------------------------------- /Library/Libraries/FatFS_0.13/documents/res/f4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gicking/STM8_templates/HEAD/Library/Libraries/FatFS_0.13/documents/res/f4.png -------------------------------------------------------------------------------- /Library/Libraries/FatFS_0.13/documents/res/f5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gicking/STM8_templates/HEAD/Library/Libraries/FatFS_0.13/documents/res/f5.png -------------------------------------------------------------------------------- /Library/Libraries/FatFS_0.13/documents/res/f6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gicking/STM8_templates/HEAD/Library/Libraries/FatFS_0.13/documents/res/f6.png -------------------------------------------------------------------------------- /Library/Libraries/FatFS_0.13/documents/res/f7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gicking/STM8_templates/HEAD/Library/Libraries/FatFS_0.13/documents/res/f7.png -------------------------------------------------------------------------------- /Library/Libraries/PetitFS_0.03/doc/img/layers3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gicking/STM8_templates/HEAD/Library/Libraries/PetitFS_0.03/doc/img/layers3.png -------------------------------------------------------------------------------- /Library/Libraries/PetitFS_0.03/doc/img/rwtest3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gicking/STM8_templates/HEAD/Library/Libraries/PetitFS_0.03/doc/img/rwtest3.png -------------------------------------------------------------------------------- /Library/Libraries/FatFS_0.13/documents/res/funcs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gicking/STM8_templates/HEAD/Library/Libraries/FatFS_0.13/documents/res/funcs.png -------------------------------------------------------------------------------- /Library/Libraries/FatFS_0.13/documents/res/mkfs.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gicking/STM8_templates/HEAD/Library/Libraries/FatFS_0.13/documents/res/mkfs.xls -------------------------------------------------------------------------------- /Projects/General_Examples/Dhrystone/Dhrystone.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gicking/STM8_templates/HEAD/Projects/General_Examples/Dhrystone/Dhrystone.tar.gz -------------------------------------------------------------------------------- /Library/Libraries/FatFS_0.13/documents/res/layers.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gicking/STM8_templates/HEAD/Library/Libraries/FatFS_0.13/documents/res/layers.png -------------------------------------------------------------------------------- /Library/Libraries/FatFS_0.13/documents/res/layers1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gicking/STM8_templates/HEAD/Library/Libraries/FatFS_0.13/documents/res/layers1.png -------------------------------------------------------------------------------- /Library/Libraries/FatFS_0.13/documents/res/layers2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gicking/STM8_templates/HEAD/Library/Libraries/FatFS_0.13/documents/res/layers2.png -------------------------------------------------------------------------------- /Library/Libraries/FatFS_0.13/documents/res/layers3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gicking/STM8_templates/HEAD/Library/Libraries/FatFS_0.13/documents/res/layers3.png -------------------------------------------------------------------------------- /Library/Libraries/FatFS_0.13/documents/res/mkfatimg.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gicking/STM8_templates/HEAD/Library/Libraries/FatFS_0.13/documents/res/mkfatimg.zip -------------------------------------------------------------------------------- /Library/Libraries/FatFS_0.13/documents/res/modules.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gicking/STM8_templates/HEAD/Library/Libraries/FatFS_0.13/documents/res/modules.png -------------------------------------------------------------------------------- /Library/Libraries/FatFS_0.13/documents/res/rwtest1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gicking/STM8_templates/HEAD/Library/Libraries/FatFS_0.13/documents/res/rwtest1.png -------------------------------------------------------------------------------- /Library/Libraries/FatFS_0.13/documents/res/rwtest2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gicking/STM8_templates/HEAD/Library/Libraries/FatFS_0.13/documents/res/rwtest2.png -------------------------------------------------------------------------------- /Library/Libraries/FatFS_0.13/documents/res/rwtest3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gicking/STM8_templates/HEAD/Library/Libraries/FatFS_0.13/documents/res/rwtest3.png -------------------------------------------------------------------------------- /Docu/README.md: -------------------------------------------------------------------------------- 1 | # Docu 2 | 3 | Details on installation and an API description can be found in the project [Wiki](https://github.com/gicking/STM8_templates/wiki) 4 | 5 | -------------------------------------------------------------------------------- /Library/Libraries/PetitFS_0.03/doc/css_p.css: -------------------------------------------------------------------------------- 1 | body {margin: 8px; background-color: #ffecf0; font-color: black; font-family: serif; line-height: 133%; max-width: 1024px;} 2 | -------------------------------------------------------------------------------- /Projects/chmod_python.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # change to current working directory 4 | cd `dirname $0` 5 | 6 | # recursively make all python scripts executable 7 | find . -name "*.py" -exec chmod u+x {} \; 8 | 9 | -------------------------------------------------------------------------------- /Library/Base/README.md: -------------------------------------------------------------------------------- 1 | Generic, board independent STM8 routines and macros in C. 2 | 3 | A description of commands and API is found in the [Wiki](https://github.com/gicking/STM8_templates/wiki) 4 | 5 | Path is automatically searched by the build process -> names have to be unique 6 | 7 | -------------------------------------------------------------------------------- /Library/Libraries/README.md: -------------------------------------------------------------------------------- 1 | External libraries, and libraries to control external circuits. 2 | 3 | A description of commands and API is found in the [Wiki](https://github.com/gicking/STM8_templates/wiki) 4 | 5 | Path is automatically searched by the build process -> names have to be unique 6 | 7 | -------------------------------------------------------------------------------- /Library/User/README.md: -------------------------------------------------------------------------------- 1 | Place to store user libraries. 2 | 3 | Path is automatically searched by the build process -> names have to be unique 4 | 5 | If you implemented a useful library, please consider contributing it to this repository! Just drop me a short note. 6 | 7 | Thanks in advance! :smile: 8 | -------------------------------------------------------------------------------- /Projects/General_Examples/Beeper/STVD_Cosmic/STM8_Template.stw: -------------------------------------------------------------------------------- 1 | ; STMicroelectronics Workspace file 2 | 3 | [Version] 4 | Keyword=ST7Workspace-V0.7 5 | 6 | [Project0] 7 | Filename=stm8_template.stp 8 | Dependencies= 9 | [Options] 10 | ActiveProject=STM8_Template 11 | ActiveConfig=Release 12 | AddSortedElements=1 13 | -------------------------------------------------------------------------------- /Projects/General_Examples/Dhrystone/STVD_Cosmic/STM8_Template.stw: -------------------------------------------------------------------------------- 1 | ; STMicroelectronics Workspace file 2 | 3 | [Version] 4 | Keyword=ST7Workspace-V0.7 5 | 6 | [Project0] 7 | Filename=stm8_template.stp 8 | Dependencies= 9 | [Options] 10 | ActiveProject=STM8_Template 11 | ActiveConfig=Release 12 | AddSortedElements=1 13 | -------------------------------------------------------------------------------- /Projects/General_Examples/I2C_read/STVD_Cosmic/STM8_Template.stw: -------------------------------------------------------------------------------- 1 | ; STMicroelectronics Workspace file 2 | 3 | [Version] 4 | Keyword=ST7Workspace-V0.7 5 | 6 | [Project0] 7 | Filename=stm8_template.stp 8 | Dependencies= 9 | [Options] 10 | ActiveProject=STM8_Template 11 | ActiveConfig=Release 12 | AddSortedElements=1 13 | -------------------------------------------------------------------------------- /Projects/General_Examples/I2C_write/STVD_Cosmic/STM8_Template.stw: -------------------------------------------------------------------------------- 1 | ; STMicroelectronics Workspace file 2 | 3 | [Version] 4 | Keyword=ST7Workspace-V0.7 5 | 6 | [Project0] 7 | Filename=stm8_template.stp 8 | Dependencies= 9 | [Options] 10 | ActiveProject=STM8_Template 11 | ActiveConfig=Release 12 | AddSortedElements=1 13 | -------------------------------------------------------------------------------- /Projects/General_Examples/Minimal-C/STVD_Cosmic/STM8_Template.stw: -------------------------------------------------------------------------------- 1 | ; STMicroelectronics Workspace file 2 | 3 | [Version] 4 | Keyword=ST7Workspace-V0.7 5 | 6 | [Project0] 7 | Filename=stm8_template.stp 8 | Dependencies= 9 | [Options] 10 | ActiveProject=STM8_Template 11 | ActiveConfig=Release 12 | AddSortedElements=1 13 | -------------------------------------------------------------------------------- /Projects/General_Examples/echo_UART/STVD_Cosmic/STM8_Template.stw: -------------------------------------------------------------------------------- 1 | ; STMicroelectronics Workspace file 2 | 3 | [Version] 4 | Keyword=ST7Workspace-V0.7 5 | 6 | [Project0] 7 | Filename=stm8_template.stp 8 | Dependencies= 9 | [Options] 10 | ActiveProject=STM8_Template 11 | ActiveConfig=Release 12 | AddSortedElements=1 13 | -------------------------------------------------------------------------------- /Projects/General_Examples/ADC_Measure/STVD_Cosmic/STM8_Template.stw: -------------------------------------------------------------------------------- 1 | ; STMicroelectronics Workspace file 2 | 3 | [Version] 4 | Keyword=ST7Workspace-V0.7 5 | 6 | [Project0] 7 | Filename=stm8_template.stp 8 | Dependencies= 9 | [Options] 10 | ActiveProject=STM8_Template 11 | ActiveConfig=Release 12 | AddSortedElements=1 13 | -------------------------------------------------------------------------------- /Projects/General_Examples/Basic_Project/STVD_Cosmic/STM8_Template.stw: -------------------------------------------------------------------------------- 1 | ; STMicroelectronics Workspace file 2 | 3 | [Version] 4 | Keyword=ST7Workspace-V0.7 5 | 6 | [Project0] 7 | Filename=stm8_template.stp 8 | Dependencies= 9 | [Options] 10 | ActiveProject=STM8_Template 11 | ActiveConfig=Release 12 | AddSortedElements=1 13 | -------------------------------------------------------------------------------- /Projects/General_Examples/Measure_PWM/STVD_Cosmic/STM8_Template.stw: -------------------------------------------------------------------------------- 1 | ; STMicroelectronics Workspace file 2 | 3 | [Version] 4 | Keyword=ST7Workspace-V0.7 5 | 6 | [Project0] 7 | Filename=stm8_template.stp 8 | Dependencies= 9 | [Options] 10 | ActiveProject=STM8_Template 11 | ActiveConfig=Release 12 | AddSortedElements=1 13 | -------------------------------------------------------------------------------- /Projects/General_Examples/Pin_Interrupt/STVD_Cosmic/STM8_Template.stw: -------------------------------------------------------------------------------- 1 | ; STMicroelectronics Workspace file 2 | 3 | [Version] 4 | Keyword=ST7Workspace-V0.7 5 | 6 | [Project0] 7 | Filename=stm8_template.stp 8 | Dependencies= 9 | [Options] 10 | ActiveProject=STM8_Template 11 | ActiveConfig=Release 12 | AddSortedElements=1 13 | -------------------------------------------------------------------------------- /Projects/General_Examples/Pin_Read_Write/STVD_Cosmic/STM8_Template.stw: -------------------------------------------------------------------------------- 1 | ; STMicroelectronics Workspace file 2 | 3 | [Version] 4 | Keyword=ST7Workspace-V0.7 5 | 6 | [Project0] 7 | Filename=stm8_template.stp 8 | Dependencies= 9 | [Options] 10 | ActiveProject=STM8_Template 11 | ActiveConfig=Release 12 | AddSortedElements=1 13 | -------------------------------------------------------------------------------- /Projects/General_Examples/Port_Interrupt/STVD_Cosmic/STM8_Template.stw: -------------------------------------------------------------------------------- 1 | ; STMicroelectronics Workspace file 2 | 3 | [Version] 4 | Keyword=ST7Workspace-V0.7 5 | 6 | [Project0] 7 | Filename=stm8_template.stp 8 | Dependencies= 9 | [Options] 10 | ActiveProject=STM8_Template 11 | ActiveConfig=Release 12 | AddSortedElements=1 13 | -------------------------------------------------------------------------------- /Projects/General_Examples/Printf_UART/STVD_Cosmic/STM8_Template.stw: -------------------------------------------------------------------------------- 1 | ; STMicroelectronics Workspace file 2 | 3 | [Version] 4 | Keyword=ST7Workspace-V0.7 5 | 6 | [Project0] 7 | Filename=stm8_template.stp 8 | Dependencies= 9 | [Options] 10 | ActiveProject=STM8_Template 11 | ActiveConfig=Release 12 | AddSortedElements=1 13 | -------------------------------------------------------------------------------- /Projects/General_Examples/Trap_Interrupt/STVD_Cosmic/STM8_Template.stw: -------------------------------------------------------------------------------- 1 | ; STMicroelectronics Workspace file 2 | 3 | [Version] 4 | Keyword=ST7Workspace-V0.7 5 | 6 | [Project0] 7 | Filename=stm8_template.stp 8 | Dependencies= 9 | [Options] 10 | ActiveProject=STM8_Template 11 | ActiveConfig=Release 12 | AddSortedElements=1 13 | -------------------------------------------------------------------------------- /Projects/muBoard_Examples/Pin_Read_Write/STVD_Cosmic/STM8_Template.stw: -------------------------------------------------------------------------------- 1 | ; STMicroelectronics Workspace file 2 | 3 | [Version] 4 | Keyword=ST7Workspace-V0.7 5 | 6 | [Project0] 7 | Filename=stm8_template.stp 8 | Dependencies= 9 | [Options] 10 | ActiveProject=STM8_Template 11 | ActiveConfig=Release 12 | AddSortedElements=1 13 | -------------------------------------------------------------------------------- /Projects/General_Examples/EEPROM_Datalogger/STVD_Cosmic/STM8_Template.stw: -------------------------------------------------------------------------------- 1 | ; STMicroelectronics Workspace file 2 | 3 | [Version] 4 | Keyword=ST7Workspace-V0.7 5 | 6 | [Project0] 7 | Filename=stm8_template.stp 8 | Dependencies= 9 | [Options] 10 | ActiveProject=STM8_Template 11 | ActiveConfig=Release 12 | AddSortedElements=1 13 | -------------------------------------------------------------------------------- /Projects/General_Examples/Gets_Printf_UART/STVD_Cosmic/STM8_Template.stw: -------------------------------------------------------------------------------- 1 | ; STMicroelectronics Workspace file 2 | 3 | [Version] 4 | Keyword=ST7Workspace-V0.7 5 | 6 | [Project0] 7 | Filename=stm8_template.stp 8 | Dependencies= 9 | [Options] 10 | ActiveProject=STM8_Template 11 | ActiveConfig=Release 12 | AddSortedElements=1 13 | -------------------------------------------------------------------------------- /Projects/General_Examples/Minimal-C_with_ISR/STVD_Cosmic/STM8_Template.stw: -------------------------------------------------------------------------------- 1 | ; STMicroelectronics Workspace file 2 | 3 | [Version] 4 | Keyword=ST7Workspace-V0.7 5 | 6 | [Project0] 7 | Filename=stm8_template.stp 8 | Dependencies= 9 | [Options] 10 | ActiveProject=STM8_Template 11 | ActiveConfig=Release 12 | AddSortedElements=1 13 | -------------------------------------------------------------------------------- /Projects/General_Examples/P-Flash_Datalogger/STVD_Cosmic/STM8_Template.stw: -------------------------------------------------------------------------------- 1 | ; STMicroelectronics Workspace file 2 | 3 | [Version] 4 | Keyword=ST7Workspace-V0.7 5 | 6 | [Project0] 7 | Filename=stm8_template.stp 8 | Dependencies= 9 | [Options] 10 | ActiveProject=STM8_Template 11 | ActiveConfig=Release 12 | AddSortedElements=1 13 | -------------------------------------------------------------------------------- /Projects/General_Examples/Power_Saving_Modes/STVD_Cosmic/STM8_Template.stw: -------------------------------------------------------------------------------- 1 | ; STMicroelectronics Workspace file 2 | 3 | [Version] 4 | Keyword=ST7Workspace-V0.7 5 | 6 | [Project0] 7 | Filename=stm8_template.stp 8 | Dependencies= 9 | [Options] 10 | ActiveProject=STM8_Template 11 | ActiveConfig=Release 12 | AddSortedElements=1 13 | -------------------------------------------------------------------------------- /Projects/General_Examples/TIM3_PWM_generate/STVD_Cosmic/STM8_Template.stw: -------------------------------------------------------------------------------- 1 | ; STMicroelectronics Workspace file 2 | 3 | [Version] 4 | Keyword=ST7Workspace-V0.7 5 | 6 | [Project0] 7 | Filename=stm8_template.stp 8 | Dependencies= 9 | [Options] 10 | ActiveProject=STM8_Template 11 | ActiveConfig=Release 12 | AddSortedElements=1 13 | -------------------------------------------------------------------------------- /Projects/General_Examples/Timeout_Scheduler/STVD_Cosmic/STM8_Template.stw: -------------------------------------------------------------------------------- 1 | ; STMicroelectronics Workspace file 2 | 3 | [Version] 4 | Keyword=ST7Workspace-V0.7 5 | 6 | [Project0] 7 | Filename=stm8_template.stp 8 | Dependencies= 9 | [Options] 10 | ActiveProject=STM8_Template 11 | ActiveConfig=Release 12 | AddSortedElements=1 13 | -------------------------------------------------------------------------------- /Projects/General_Examples/echo_UART_with_ISR/STVD_Cosmic/STM8_Template.stw: -------------------------------------------------------------------------------- 1 | ; STMicroelectronics Workspace file 2 | 3 | [Version] 4 | Keyword=ST7Workspace-V0.7 5 | 6 | [Project0] 7 | Filename=stm8_template.stp 8 | Dependencies= 9 | [Options] 10 | ActiveProject=STM8_Template 11 | ActiveConfig=Release 12 | AddSortedElements=1 13 | -------------------------------------------------------------------------------- /Projects/General_Examples/mirror_two_UARTs/STVD_Cosmic/STM8_Template.stw: -------------------------------------------------------------------------------- 1 | ; STMicroelectronics Workspace file 2 | 3 | [Version] 4 | Keyword=ST7Workspace-V0.7 5 | 6 | [Project0] 7 | Filename=stm8_template.stp 8 | Dependencies= 9 | [Options] 10 | ActiveProject=STM8_Template 11 | ActiveConfig=Release 12 | AddSortedElements=1 13 | -------------------------------------------------------------------------------- /Projects/Libraries_Examples/DigPoti-AD5280/STVD_Cosmic/STM8_Template.stw: -------------------------------------------------------------------------------- 1 | ; STMicroelectronics Workspace file 2 | 3 | [Version] 4 | Keyword=ST7Workspace-V0.7 5 | 6 | [Project0] 7 | Filename=stm8_template.stp 8 | Dependencies= 9 | [Options] 10 | ActiveProject=STM8_Template 11 | ActiveConfig=Release 12 | AddSortedElements=1 13 | -------------------------------------------------------------------------------- /Projects/Libraries_Examples/DigPoti-AD5282/STVD_Cosmic/STM8_Template.stw: -------------------------------------------------------------------------------- 1 | ; STMicroelectronics Workspace file 2 | 3 | [Version] 4 | Keyword=ST7Workspace-V0.7 5 | 6 | [Project0] 7 | Filename=stm8_template.stp 8 | Dependencies= 9 | [Options] 10 | ActiveProject=STM8_Template 11 | ActiveConfig=Release 12 | AddSortedElements=1 13 | -------------------------------------------------------------------------------- /Projects/Libraries_Examples/LCD-BTHQ21605V/STVD_Cosmic/STM8_Template.stw: -------------------------------------------------------------------------------- 1 | ; STMicroelectronics Workspace file 2 | 3 | [Version] 4 | Keyword=ST7Workspace-V0.7 5 | 6 | [Project0] 7 | Filename=stm8_template.stp 8 | Dependencies= 9 | [Options] 10 | ActiveProject=STM8_Template 11 | ActiveConfig=Release 12 | AddSortedElements=1 13 | -------------------------------------------------------------------------------- /Projects/Libraries_Examples/SD-card_fatFS/STVD_Cosmic/STM8_Template.stw: -------------------------------------------------------------------------------- 1 | ; STMicroelectronics Workspace file 2 | 3 | [Version] 4 | Keyword=ST7Workspace-V0.7 5 | 6 | [Project0] 7 | Filename=stm8_template.stp 8 | Dependencies= 9 | [Options] 10 | ActiveProject=STM8_Template 11 | ActiveConfig=Release 12 | AddSortedElements=1 13 | -------------------------------------------------------------------------------- /Projects/Libraries_Examples/SD-card_petitFS/STVD_Cosmic/STM8_Template.stw: -------------------------------------------------------------------------------- 1 | ; STMicroelectronics Workspace file 2 | 3 | [Version] 4 | Keyword=ST7Workspace-V0.7 5 | 6 | [Project0] 7 | Filename=stm8_template.stp 8 | Dependencies= 9 | [Options] 10 | ActiveProject=STM8_Template 11 | ActiveConfig=Release 12 | AddSortedElements=1 13 | -------------------------------------------------------------------------------- /Projects/STM8S_Discovery_Examples/Minimal-C/STVD_Cosmic/STM8_Template.stw: -------------------------------------------------------------------------------- 1 | ; STMicroelectronics Workspace file 2 | 3 | [Version] 4 | Keyword=ST7Workspace-V0.7 5 | 6 | [Project0] 7 | Filename=stm8_template.stp 8 | Dependencies= 9 | [Options] 10 | ActiveProject=STM8_Template 11 | ActiveConfig=Release 12 | AddSortedElements=1 13 | -------------------------------------------------------------------------------- /Projects/STM8_StdPeriphLib_Examples/Minimal-C/STVD_Cosmic/STM8_Template.stw: -------------------------------------------------------------------------------- 1 | ; STMicroelectronics Workspace file 2 | 3 | [Version] 4 | Keyword=ST7Workspace-V0.7 5 | 6 | [Project0] 7 | Filename=stm8_template.stp 8 | Dependencies= 9 | [Options] 10 | ActiveProject=STM8_Template 11 | ActiveConfig=Release 12 | AddSortedElements=1 13 | -------------------------------------------------------------------------------- /Projects/muBoard_Examples/LCD-display_I2C/STVD_Cosmic/STM8_Template.stw: -------------------------------------------------------------------------------- 1 | ; STMicroelectronics Workspace file 2 | 3 | [Version] 4 | Keyword=ST7Workspace-V0.7 5 | 6 | [Project0] 7 | Filename=stm8_template.stp 8 | Dependencies= 9 | [Options] 10 | ActiveProject=STM8_Template 11 | ActiveConfig=Release 12 | AddSortedElements=1 13 | -------------------------------------------------------------------------------- /Projects/muBoard_Examples/digital-poti_I2C/STVD_Cosmic/STM8_Template.stw: -------------------------------------------------------------------------------- 1 | ; STMicroelectronics Workspace file 2 | 3 | [Version] 4 | Keyword=ST7Workspace-V0.7 5 | 6 | [Project0] 7 | Filename=stm8_template.stp 8 | Dependencies= 9 | [Options] 10 | ActiveProject=STM8_Template 11 | ActiveConfig=Release 12 | AddSortedElements=1 13 | -------------------------------------------------------------------------------- /Projects/General_Examples/ADC_Continuous_with_ISR/STVD_Cosmic/STM8_Template.stw: -------------------------------------------------------------------------------- 1 | ; STMicroelectronics Workspace file 2 | 3 | [Version] 4 | Keyword=ST7Workspace-V0.7 5 | 6 | [Project0] 7 | Filename=stm8_template.stp 8 | Dependencies= 9 | [Options] 10 | ActiveProject=STM8_Template 11 | ActiveConfig=Release 12 | AddSortedElements=1 13 | -------------------------------------------------------------------------------- /Projects/General_Examples/Attach_1ms_Interrupt/STVD_Cosmic/STM8_Template.stw: -------------------------------------------------------------------------------- 1 | ; STMicroelectronics Workspace file 2 | 3 | [Version] 4 | Keyword=ST7Workspace-V0.7 5 | 6 | [Project0] 7 | Filename=stm8_template.stp 8 | Dependencies= 9 | [Options] 10 | ActiveProject=STM8_Template 11 | ActiveConfig=Release 12 | AddSortedElements=1 13 | -------------------------------------------------------------------------------- /Projects/General_Examples/Bootloader_Activation/STVD_Cosmic/STM8_Template.stw: -------------------------------------------------------------------------------- 1 | ; STMicroelectronics Workspace file 2 | 3 | [Version] 4 | Keyword=ST7Workspace-V0.7 5 | 6 | [Project0] 7 | Filename=stm8_template.stp 8 | Dependencies= 9 | [Options] 10 | ActiveProject=STM8_Template 11 | ActiveConfig=Release 12 | AddSortedElements=1 13 | -------------------------------------------------------------------------------- /Projects/STM8S_Discovery_Examples/Basic_Project/STVD_Cosmic/STM8_Template.stw: -------------------------------------------------------------------------------- 1 | ; STMicroelectronics Workspace file 2 | 3 | [Version] 4 | Keyword=ST7Workspace-V0.7 5 | 6 | [Project0] 7 | Filename=stm8_template.stp 8 | Dependencies= 9 | [Options] 10 | ActiveProject=STM8_Template 11 | ActiveConfig=Release 12 | AddSortedElements=1 13 | -------------------------------------------------------------------------------- /Projects/STM8_StdPeriphLib_Examples/Basic_Project/STVD_Cosmic/STM8_Template.stw: -------------------------------------------------------------------------------- 1 | ; STMicroelectronics Workspace file 2 | 3 | [Version] 4 | Keyword=ST7Workspace-V0.7 5 | 6 | [Project0] 7 | Filename=stm8_template.stp 8 | Dependencies= 9 | [Options] 10 | ActiveProject=STM8_Template 11 | ActiveConfig=Release 12 | AddSortedElements=1 13 | -------------------------------------------------------------------------------- /Projects/General_Examples/mirror_two_UARTs_with_ISR/STVD_Cosmic/STM8_Template.stw: -------------------------------------------------------------------------------- 1 | ; STMicroelectronics Workspace file 2 | 3 | [Version] 4 | Keyword=ST7Workspace-V0.7 5 | 6 | [Project0] 7 | Filename=stm8_template.stp 8 | Dependencies= 9 | [Options] 10 | ActiveProject=STM8_Template 11 | ActiveConfig=Release 12 | AddSortedElements=1 13 | -------------------------------------------------------------------------------- /Projects/STM8S_Discovery_Examples/Attach_1ms_Interrupt/STVD_Cosmic/STM8_Template.stw: -------------------------------------------------------------------------------- 1 | ; STMicroelectronics Workspace file 2 | 3 | [Version] 4 | Keyword=ST7Workspace-V0.7 5 | 6 | [Project0] 7 | Filename=stm8_template.stp 8 | Dependencies= 9 | [Options] 10 | ActiveProject=STM8_Template 11 | ActiveConfig=Release 12 | AddSortedElements=1 13 | -------------------------------------------------------------------------------- /Projects/STM8S_Discovery_Examples/echo_UART_with_ISR/STVD_Cosmic/STM8_Template.stw: -------------------------------------------------------------------------------- 1 | ; STMicroelectronics Workspace file 2 | 3 | [Version] 4 | Keyword=ST7Workspace-V0.7 5 | 6 | [Project0] 7 | Filename=stm8_template.stp 8 | Dependencies= 9 | [Options] 10 | ActiveProject=STM8_Template 11 | ActiveConfig=Release 12 | AddSortedElements=1 13 | -------------------------------------------------------------------------------- /Library/STM8L_Discovery/README.md: -------------------------------------------------------------------------------- 1 | [STM8L Discovery](http://www.st.com/en/evaluation-tools/stm8l-discovery.html) specific routines and macros. This entry level board allows upload and debugging via SWIM interface. 2 | 3 | A description of commands and API is found in the [Wiki](https://github.com/gicking/STM8_templates/wiki) 4 | 5 | Path is automatically searched by the build process -> names have to be unique 6 | 7 |

8 | STM8L Discovery 9 |

10 | 11 | -------------------------------------------------------------------------------- /Library/STM8S_Discovery/README.md: -------------------------------------------------------------------------------- 1 | [STM8S Discovery](http://www.st.com/en/evaluation-tools/stm8s-discovery.html) specific routines and macros. This entry level board allows upload and debugging via SWIM interface. 2 | 3 | A description of commands and API is found in the [Wiki](https://github.com/gicking/STM8_templates/wiki) 4 | 5 | Path is automatically searched by the build process -> names have to be unique 6 | 7 |

8 | STM8S Discovery 9 |

10 | 11 | -------------------------------------------------------------------------------- /Library/muBoard/README.md: -------------------------------------------------------------------------------- 1 | muBoard v2.3 specific routines and macros. This board was developed for IC validation and testing at [Robert Bosch GmbH](http://www.bosch.com). For an overview of board functions see [here](https://frosch.piandmore.de//de/pam9/call/public-media/event_media/160611_Vortrag_Interpreter.pdf) (in German). 2 | 3 | A description of commands and API is found in the [Wiki](https://github.com/gicking/STM8_templates/wiki) 4 | 5 | Path is automatically searched by the build process -> names have to be unique 6 | 7 |

8 | muBoard 9 |

10 | 11 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # upload tools (distributed separately) 2 | stm8flash 3 | stm8flash.exe 4 | stm8gal 5 | stm8gal.exe 6 | STM8_serial_flasher 7 | STM8_serial_flasher.exe 8 | 9 | # SDCC build output 10 | Makefile 11 | output 12 | 13 | # Cosmic build output 14 | Release 15 | Debug 16 | 17 | # STM8 Standard Peripheral Library (patch distributed separately, note license) 18 | SPL 19 | *_StdPeriph_Driver 20 | 21 | # untested or unfinished projects (starting with 'x_') 22 | x_* 23 | 24 | # misc: STM8 documentation, ideas, scripts, etc. 25 | Ideen.txt 26 | doxygen/html 27 | /Docu/Manuals 28 | /Docu/Obsolete 29 | /Docu/PiAndMore_2017 30 | /Docu/.~lock.* 31 | /Tools/__pycache__/misc.cpython-35.pyc 32 | /Tools/misc.pyc 33 | /Tools/uploadHex.pyc 34 | /Tools/buildProject.pyc 35 | -------------------------------------------------------------------------------- /Projects/General_Examples/PiAndMore10/STM8S_Discovery/main.c: -------------------------------------------------------------------------------- 1 | // include modules 2 | #include "main_general.h" 3 | 4 | void toggle_LED(void); 5 | 6 | // LED pin write 7 | #define LED pinOutputReg(&PORT_D, pin0) 8 | 9 | 10 | // called once after reset 11 | void setup() { 12 | 13 | pinMode(&PORT_D, 0, OUTPUT); // configure LED pin 14 | attachInterruptMillis(toggle_LED); // attach toggle function to 1ms interrupt 15 | 16 | } // setup() 17 | 18 | 19 | // called continuously 20 | void loop() { 21 | 22 | } // loop() 23 | 24 | 25 | // toggle LED every 500th call 26 | void toggle_LED() { 27 | 28 | // every 500th time toggle LED 29 | static uint16_t count1ms = 0; 30 | if (++count1ms == 500) { 31 | count1ms = 0; 32 | LED ^= 1; 33 | } 34 | 35 | } // toggle_LED() 36 | 37 | -------------------------------------------------------------------------------- /Library/Libraries/PetitFS_0.03/inc/pffinteger.h: -------------------------------------------------------------------------------- 1 | /*-------------------------------------------*/ 2 | /* Integer type definitions for FatFs module */ 3 | /*-------------------------------------------*/ 4 | 5 | #ifndef _FF_INTEGER 6 | #define _FF_INTEGER 7 | 8 | #ifdef _WIN32 /* FatFs development platform */ 9 | 10 | #include 11 | #include 12 | 13 | #else /* Embedded platform */ 14 | 15 | /* This type MUST be 8 bit */ 16 | typedef unsigned char BYTE; 17 | 18 | /* These types MUST be 16 bit */ 19 | typedef short SHORT; 20 | typedef unsigned short WORD; 21 | typedef unsigned short WCHAR; 22 | 23 | /* These types MUST be 16 bit or 32 bit */ 24 | typedef int INT; 25 | typedef unsigned int UINT; 26 | 27 | /* These types MUST be 32 bit */ 28 | typedef long LONG; 29 | typedef unsigned long DWORD; 30 | 31 | #endif 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /Projects/clean_all_projects.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | 3 | ''' 4 | Find and execute all clean.py beneath this script 5 | ''' 6 | 7 | # required modules 8 | import sys 9 | import os 10 | sys.path.insert(0,'../Tools') 11 | import misc 12 | 13 | # execute all 'clean.py' below the current folder 14 | oldDir = os.getcwd() 15 | for file in misc.listFiles('.',"clean.py"): 16 | 17 | # change working directory 18 | os.chdir(os.path.dirname(file)) 19 | 20 | # print progress 21 | print(os.path.dirname(file)) 22 | 23 | # execute clean.py 24 | os.system('python clean.py') 25 | 26 | # restore working directory 27 | os.chdir(oldDir) 28 | 29 | # optional prompt for return, then close window 30 | if False: 31 | if (sys.version_info.major == 3): 32 | input("\npress return to exit ... ") 33 | else: 34 | raw_input("\npress return to exit ... ") 35 | sys.stdout.write('\n\n') 36 | 37 | -------------------------------------------------------------------------------- /Projects/muBoard_Examples/Pin_Read_Write/terminal.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | ''' 4 | Open terminal program 5 | ''' 6 | 7 | # set OS specific 8 | TOOL_DIR = '../../../Tools/' 9 | import platform 10 | if platform.system() == 'Windows': 11 | PORT = 'COM10' 12 | else: 13 | PORT = '/dev/ttyUSB0' 14 | 15 | # import required modules 16 | import sys 17 | import os 18 | import platform 19 | import argparse 20 | sys.path.insert(0,TOOL_DIR) # assert that TOOL_DIR is searched first 21 | import misc 22 | 23 | 24 | ################## 25 | # main program 26 | ################## 27 | 28 | cmd = 'python '+TOOL_DIR+'terminal.py -p '+PORT 29 | exitcode = os.system(cmd) 30 | if (exitcode != 0): 31 | sys.stderr.write('error '+str(exitcode)+'\n\n') 32 | misc.Exit(exitcode) 33 | 34 | # wait for return, then close window 35 | if (sys.version_info.major == 3): 36 | input("\npress return to exit ... ") 37 | else: 38 | raw_input("\npress return to exit ... ") 39 | sys.stdout.write('\n\n') 40 | 41 | # END OF MODULE 42 | -------------------------------------------------------------------------------- /Library/Libraries/FatFS_0.13/00readme.txt: -------------------------------------------------------------------------------- 1 | FatFs Module Source Files R0.13a 2 | 3 | 4 | FILES 5 | 6 | 00readme.txt This file. 7 | 00history.txt Revision history. 8 | ff.c FatFs module. 9 | ffconf.h Configuration file of FatFs module. 10 | ff.h Common include file for FatFs and application module. 11 | diskio.h Common include file for FatFs and disk I/O module. 12 | diskio.c An example of glue function to attach existing disk I/O module to FatFs. 13 | integer.h Integer type definitions for FatFs. 14 | ffunicode.c Optional Unicode utility functions. 15 | ffsystem.c An example of optional O/S related functions. 16 | 17 | 18 | Low level disk I/O module is not included in this archive because the FatFs 19 | module is only a generic file system layer and it does not depend on any specific 20 | storage device. You need to provide a low level disk I/O module written to 21 | control the storage device that attached to the target system. 22 | 23 | -------------------------------------------------------------------------------- /Library/Libraries/FatFS_0.13/inc/ffinteger.h: -------------------------------------------------------------------------------- 1 | /*-------------------------------------------*/ 2 | /* Integer type definitions for FatFs module */ 3 | /*-------------------------------------------*/ 4 | 5 | #ifndef FF_INTEGER 6 | #define FF_INTEGER 7 | 8 | #ifdef _WIN32 /* FatFs development platform */ 9 | 10 | #include 11 | #include 12 | typedef unsigned __int64 QWORD; 13 | 14 | 15 | #else /* Embedded platform */ 16 | 17 | /* These types MUST be 16-bit or 32-bit */ 18 | typedef int INT; 19 | typedef unsigned int UINT; 20 | 21 | /* This type MUST be 8-bit */ 22 | typedef unsigned char BYTE; 23 | 24 | /* These types MUST be 16-bit */ 25 | typedef short SHORT; 26 | typedef unsigned short WORD; 27 | typedef unsigned short WCHAR; 28 | 29 | /* These types MUST be 32-bit */ 30 | typedef long LONG; 31 | typedef unsigned long DWORD; 32 | 33 | /* This type MUST be 64-bit (Remove this for ANSI C (C89) compatibility) */ 34 | typedef unsigned long long QWORD; 35 | 36 | #endif 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /Projects/General_Examples/Pin_Read_Write/config.h: -------------------------------------------------------------------------------- 1 | /** 2 | \file config.h 3 | 4 | \author G. Icking-Konert 5 | \date 2013-11-22 6 | \version 0.1 7 | 8 | \brief project specific settings 9 | 10 | project specific configuration header file 11 | Select STM8 device and activate optional options 12 | */ 13 | 14 | /*----------------------------------------------------------------------------- 15 | MODULE DEFINITION FOR MULTIPLE INCLUSION 16 | -----------------------------------------------------------------------------*/ 17 | #ifndef _CONFIG_H_ 18 | #define _CONFIG_H_ 19 | 20 | // select board to set STM8 family, memory size etc. 21 | #include "muBoard_config.h" 22 | 23 | /// required for timekeeping (1ms interrupt) 24 | #define USE_TIM4_UPD_ISR 25 | 26 | /*----------------------------------------------------------------------------- 27 | END OF MODULE DEFINITION FOR MULTIPLE INLUSION 28 | -----------------------------------------------------------------------------*/ 29 | #endif // _CONFIG_H_ 30 | -------------------------------------------------------------------------------- /Projects/General_Examples/Dhrystone/config.h: -------------------------------------------------------------------------------- 1 | /** 2 | \file config.h 3 | 4 | \author G. Icking-Konert 5 | \date 2013-11-22 6 | \version 0.1 7 | 8 | \brief project specific settings 9 | 10 | project specific configuration header file 11 | Select STM8 device and activate optional options 12 | */ 13 | 14 | /*----------------------------------------------------------------------------- 15 | MODULE DEFINITION FOR MULTIPLE INCLUSION 16 | -----------------------------------------------------------------------------*/ 17 | #ifndef _CONFIG_H_ 18 | #define _CONFIG_H_ 19 | 20 | /// select STM8 device. For supported devices see file "stm8as.h" 21 | #define STM8S208 // muBoard 22 | 23 | /// required for timekeeping (1ms interrupt) 24 | #define USE_TIM4_UPD_ISR 25 | 26 | /*----------------------------------------------------------------------------- 27 | END OF MODULE DEFINITION FOR MULTIPLE INLUSION 28 | -----------------------------------------------------------------------------*/ 29 | #endif // _CONFIG_H_ 30 | -------------------------------------------------------------------------------- /Projects/General_Examples/Basic_Project/config.h: -------------------------------------------------------------------------------- 1 | /** 2 | \file config.h 3 | 4 | \author G. Icking-Konert 5 | \date 2013-11-22 6 | \version 0.1 7 | 8 | \brief project specific settings 9 | 10 | project specific configuration header file 11 | Select STM8 device and activate optional options 12 | */ 13 | 14 | /*----------------------------------------------------------------------------- 15 | MODULE DEFINITION FOR MULTIPLE INCLUSION 16 | -----------------------------------------------------------------------------*/ 17 | #ifndef _CONFIG_H_ 18 | #define _CONFIG_H_ 19 | 20 | // select board to set STM8 family, memory size etc. 21 | #include "muBoard_config.h" 22 | //#include "STM8S_Discovery_config.h" 23 | 24 | 25 | /// required for timekeeping (1ms interrupt) 26 | #define USE_TIM4_UPD_ISR 27 | 28 | /*----------------------------------------------------------------------------- 29 | END OF MODULE DEFINITION FOR MULTIPLE INLUSION 30 | -----------------------------------------------------------------------------*/ 31 | #endif // _CONFIG_H_ 32 | -------------------------------------------------------------------------------- /Projects/STM8S_Discovery_Examples/Minimal-C/config.h: -------------------------------------------------------------------------------- 1 | /** 2 | \file config.h 3 | 4 | \author G. Icking-Konert 5 | \date 2013-11-22 6 | \version 0.1 7 | 8 | \brief project specific settings 9 | 10 | project specific configuration header file 11 | Select STM8 device and activate optional options 12 | */ 13 | 14 | /*----------------------------------------------------------------------------- 15 | MODULE DEFINITION FOR MULTIPLE INCLUSION 16 | -----------------------------------------------------------------------------*/ 17 | #ifndef _CONFIG_H_ 18 | #define _CONFIG_H_ 19 | 20 | 21 | // select board to set STM8 family, memory size etc. 22 | //#include "STM8S_Discovery_config.h" 23 | 24 | /// alternatively select STM8 device directly. For supported devices see file "stm8as.h" 25 | #define STM8S105 26 | 27 | 28 | /*----------------------------------------------------------------------------- 29 | END OF MODULE DEFINITION FOR MULTIPLE INLUSION 30 | -----------------------------------------------------------------------------*/ 31 | #endif // _CONFIG_H_ 32 | -------------------------------------------------------------------------------- /Library/muBoard/inc/muBoard_config.h: -------------------------------------------------------------------------------- 1 | /** 2 | \file muBoard_config.h 3 | 4 | \author G. Icking-Konert 5 | \date 2017-04-22 6 | \version 0.1 7 | 8 | \brief muBoard specific settings 9 | 10 | muBoard specific configuration header file 11 | Selects STM8 family, memory sizes etc. 12 | */ 13 | 14 | /*----------------------------------------------------------------------------- 15 | MODULE DEFINITION FOR MULTIPLE INCLUSION 16 | -----------------------------------------------------------------------------*/ 17 | #ifndef _MUBOARD_CONFIG_H_ 18 | #define _MUBOARD_CONFIG_H_ 19 | 20 | // board name for pin initialization 21 | #define MUBOARD 22 | 23 | /// select STM8 device used for muBoard 24 | #define STM8S208 25 | 26 | // set memory size 27 | #define PFLASH_SIZE (1024L * 128) 28 | #define RAM_SIZE (1024 * 6) 29 | #define EEPROM_SIZE (2048) 30 | 31 | 32 | /*----------------------------------------------------------------------------- 33 | END OF MODULE DEFINITION FOR MULTIPLE INLUSION 34 | -----------------------------------------------------------------------------*/ 35 | #endif // _MUBOARD_CONFIG_H_ 36 | -------------------------------------------------------------------------------- /Projects/General_Examples/Minimal-C/config.h: -------------------------------------------------------------------------------- 1 | /** 2 | \file config.h 3 | 4 | \author G. Icking-Konert 5 | \date 2013-11-22 6 | \version 0.1 7 | 8 | \brief project specific settings 9 | 10 | project specific configuration header file 11 | Select STM8 device and activate optional options 12 | */ 13 | 14 | /*----------------------------------------------------------------------------- 15 | MODULE DEFINITION FOR MULTIPLE INCLUSION 16 | -----------------------------------------------------------------------------*/ 17 | #ifndef _CONFIG_H_ 18 | #define _CONFIG_H_ 19 | 20 | 21 | //#include "muBoard_config.h" 22 | #include "STM8S_Discovery_config.h" 23 | 24 | /// alternatively select STM8 device directly. For supported devices see file "stm8as.h" 25 | //#define STM8S208 // muBoard 26 | //#define STM8S105 // STM8S Discovery 27 | 28 | 29 | /*----------------------------------------------------------------------------- 30 | END OF MODULE DEFINITION FOR MULTIPLE INLUSION 31 | -----------------------------------------------------------------------------*/ 32 | #endif // _CONFIG_H_ 33 | -------------------------------------------------------------------------------- /Projects/General_Examples/PiAndMore10/muBoard/config.h: -------------------------------------------------------------------------------- 1 | /** 2 | \file config.h 3 | 4 | \author G. Icking-Konert 5 | \date 2013-11-22 6 | \version 0.1 7 | 8 | \brief project specific settings 9 | 10 | project specific configuration header file 11 | Select STM8 device and activate optional options 12 | */ 13 | 14 | /*----------------------------------------------------------------------------- 15 | MODULE DEFINITION FOR MULTIPLE INCLUSION 16 | -----------------------------------------------------------------------------*/ 17 | #ifndef _CONFIG_H_ 18 | #define _CONFIG_H_ 19 | 20 | 21 | // select board to set STM8 family, memory size etc. 22 | #include "muBoard_config.h" 23 | 24 | 25 | /// required for timekeeping (1ms interrupt) 26 | #define USE_TIM4_UPD_ISR 27 | 28 | /// allow attaching user function to 1ms interrupt 29 | #define USE_MILLI_ISR 30 | 31 | /*----------------------------------------------------------------------------- 32 | END OF MODULE DEFINITION FOR MULTIPLE INLUSION 33 | -----------------------------------------------------------------------------*/ 34 | #endif // _CONFIG_H_ 35 | -------------------------------------------------------------------------------- /Projects/General_Examples/PiAndMore10/STM8S_Discovery/config.h: -------------------------------------------------------------------------------- 1 | /** 2 | \file config.h 3 | 4 | \author G. Icking-Konert 5 | \date 2013-11-22 6 | \version 0.1 7 | 8 | \brief project specific settings 9 | 10 | project specific configuration header file 11 | Select STM8 device and activate optional options 12 | */ 13 | 14 | /*----------------------------------------------------------------------------- 15 | MODULE DEFINITION FOR MULTIPLE INCLUSION 16 | -----------------------------------------------------------------------------*/ 17 | #ifndef _CONFIG_H_ 18 | #define _CONFIG_H_ 19 | 20 | 21 | // select board to set STM8 family, memory size etc. 22 | #include "STM8S_Discovery_config.h" 23 | 24 | 25 | /// required for timekeeping (1ms interrupt) 26 | #define USE_TIM4_UPD_ISR 27 | 28 | /// allow attaching user function to 1ms interrupt 29 | #define USE_MILLI_ISR 30 | 31 | /*----------------------------------------------------------------------------- 32 | END OF MODULE DEFINITION FOR MULTIPLE INLUSION 33 | -----------------------------------------------------------------------------*/ 34 | #endif // _CONFIG_H_ 35 | -------------------------------------------------------------------------------- /Projects/General_Examples/Measure_PWM/config.h: -------------------------------------------------------------------------------- 1 | /** 2 | \file config.h 3 | 4 | \author G. Icking-Konert 5 | \date 2013-11-22 6 | \version 0.1 7 | 8 | \brief project specific settings 9 | 10 | project specific configuration header file 11 | Select STM8 device and activate optional options 12 | */ 13 | 14 | /*----------------------------------------------------------------------------- 15 | MODULE DEFINITION FOR MULTIPLE INCLUSION 16 | -----------------------------------------------------------------------------*/ 17 | #ifndef _CONFIG_H_ 18 | #define _CONFIG_H_ 19 | 20 | 21 | // select board to set STM8 family, memory size etc. 22 | //#include "muBoard_config.h" 23 | 24 | /// alternatively select STM8 device directly. For supported devices see file "stm8as.h" 25 | #define STM8S208 // muBoard 26 | 27 | /// required for timekeeping (1ms interrupt) 28 | #define USE_TIM4_UPD_ISR 29 | 30 | /*----------------------------------------------------------------------------- 31 | END OF MODULE DEFINITION FOR MULTIPLE INLUSION 32 | -----------------------------------------------------------------------------*/ 33 | #endif // _CONFIG_H_ 34 | -------------------------------------------------------------------------------- /Library/STM8L_Discovery/inc/STM8S_Discovery_config.h: -------------------------------------------------------------------------------- 1 | /** 2 | \file STM8S_Discovery_config.h 3 | 4 | \author G. Icking-Konert 5 | \date 2017-04-22 6 | \version 0.1 7 | 8 | \brief STM8S Discovery specific settings 9 | 10 | STM8S Discovery board specific configuration header file 11 | Selects STM8 family, memory sizes etc. 12 | */ 13 | 14 | /*----------------------------------------------------------------------------- 15 | MODULE DEFINITION FOR MULTIPLE INCLUSION 16 | -----------------------------------------------------------------------------*/ 17 | #ifndef _STM8S_DISCOVERY_CONFIG_H_ 18 | #define _STM8S_DISCOVERY_CONFIG_H_ 19 | 20 | // board name for pin initialization 21 | #define STM8S_DISCOVERY 22 | 23 | /// select STM8 device used for muBoard 24 | #define STM8S105 25 | 26 | // set memory size 27 | #define PFLASH_SIZE 1024*32 28 | #define RAM_SIZE 1024*2 29 | #define EEPROM_SIZE 1024 30 | 31 | 32 | /*----------------------------------------------------------------------------- 33 | END OF MODULE DEFINITION FOR MULTIPLE INLUSION 34 | -----------------------------------------------------------------------------*/ 35 | #endif // _STM8S_DISCOVERY_CONFIG_H_ 36 | -------------------------------------------------------------------------------- /Library/STM8S_Discovery/inc/STM8S_Discovery_config.h: -------------------------------------------------------------------------------- 1 | /** 2 | \file STM8S_Discovery_config.h 3 | 4 | \author G. Icking-Konert 5 | \date 2017-04-22 6 | \version 0.1 7 | 8 | \brief STM8S Discovery specific settings 9 | 10 | STM8S Discovery board specific configuration header file 11 | Selects STM8 family, memory sizes etc. 12 | */ 13 | 14 | /*----------------------------------------------------------------------------- 15 | MODULE DEFINITION FOR MULTIPLE INCLUSION 16 | -----------------------------------------------------------------------------*/ 17 | #ifndef _STM8S_DISCOVERY_CONFIG_H_ 18 | #define _STM8S_DISCOVERY_CONFIG_H_ 19 | 20 | // board name for pin initialization 21 | #define STM8S_DISCOVERY 22 | 23 | /// select STM8 device used for muBoard 24 | #define STM8S105 25 | 26 | // set memory size 27 | #define PFLASH_SIZE 1024*32 28 | #define RAM_SIZE 1024*2 29 | #define EEPROM_SIZE 1024 30 | 31 | 32 | /*----------------------------------------------------------------------------- 33 | END OF MODULE DEFINITION FOR MULTIPLE INLUSION 34 | -----------------------------------------------------------------------------*/ 35 | #endif // _STM8S_DISCOVERY_CONFIG_H_ 36 | -------------------------------------------------------------------------------- /Projects/General_Examples/Minimal-C_with_ISR/config.h: -------------------------------------------------------------------------------- 1 | /** 2 | \file config.h 3 | 4 | \author G. Icking-Konert 5 | \date 2013-11-22 6 | \version 0.1 7 | 8 | \brief project specific settings 9 | 10 | project specific configuration header file 11 | Select STM8 device and activate optional options 12 | */ 13 | 14 | /*----------------------------------------------------------------------------- 15 | MODULE DEFINITION FOR MULTIPLE INCLUSION 16 | -----------------------------------------------------------------------------*/ 17 | #ifndef _CONFIG_H_ 18 | #define _CONFIG_H_ 19 | 20 | 21 | // select board to set STM8 family, memory size etc. 22 | #include "STM8S_Discovery_config.h" 23 | 24 | /// alternatively select STM8 device directly. For supported devices see file "stm8as.h" 25 | //#define STM8S105 26 | 27 | 28 | /// required for timekeeping (1ms interrupt) 29 | #define USE_TIM4_UPD_ISR 30 | 31 | /*----------------------------------------------------------------------------- 32 | END OF MODULE DEFINITION FOR MULTIPLE INLUSION 33 | -----------------------------------------------------------------------------*/ 34 | #endif // _CONFIG_H_ 35 | -------------------------------------------------------------------------------- /Projects/General_Examples/echo_UART/config.h: -------------------------------------------------------------------------------- 1 | /** 2 | \file config.h 3 | 4 | \author G. Icking-Konert 5 | \date 2013-11-22 6 | \version 0.1 7 | 8 | \brief project specific settings 9 | 10 | project specific configuration header file 11 | Select STM8 device and activate optional options 12 | */ 13 | 14 | /*----------------------------------------------------------------------------- 15 | MODULE DEFINITION FOR MULTIPLE INCLUSION 16 | -----------------------------------------------------------------------------*/ 17 | #ifndef _CONFIG_H_ 18 | #define _CONFIG_H_ 19 | 20 | 21 | // select board to set STM8 family, memory size etc. 22 | //#include "muBoard_config.h" 23 | 24 | /// alternatively select STM8 device directly. For supported devices see file "stm8as.h" 25 | #define STM8S208 // muBoard 26 | 27 | 28 | /// required for timekeeping (1ms interrupt) 29 | #define USE_TIM4_UPD_ISR 30 | 31 | 32 | /*----------------------------------------------------------------------------- 33 | END OF MODULE DEFINITION FOR MULTIPLE INLUSION 34 | -----------------------------------------------------------------------------*/ 35 | #endif // _CONFIG_H_ 36 | -------------------------------------------------------------------------------- /Projects/STM8S_Discovery_Examples/Basic_Project/config.h: -------------------------------------------------------------------------------- 1 | /** 2 | \file config.h 3 | 4 | \author G. Icking-Konert 5 | \date 2013-11-22 6 | \version 0.1 7 | 8 | \brief project specific settings 9 | 10 | project specific configuration header file 11 | Select STM8 device and activate optional options 12 | */ 13 | 14 | /*----------------------------------------------------------------------------- 15 | MODULE DEFINITION FOR MULTIPLE INCLUSION 16 | -----------------------------------------------------------------------------*/ 17 | #ifndef _CONFIG_H_ 18 | #define _CONFIG_H_ 19 | 20 | 21 | // select board to set STM8 family, memory size etc. 22 | //#include "STM8S_Discovery_config.h" 23 | 24 | /// alternatively select STM8 device directly. For supported devices see file "stm8as.h" 25 | #define STM8S105 26 | 27 | 28 | /// required for timekeeping (1ms interrupt) 29 | #define USE_TIM4_UPD_ISR 30 | 31 | /*----------------------------------------------------------------------------- 32 | END OF MODULE DEFINITION FOR MULTIPLE INLUSION 33 | -----------------------------------------------------------------------------*/ 34 | #endif // _CONFIG_H_ 35 | -------------------------------------------------------------------------------- /Projects/General_Examples/Bootloader_Activation/config.h: -------------------------------------------------------------------------------- 1 | /** 2 | \file config.h 3 | 4 | \author G. Icking-Konert 5 | \date 2013-11-22 6 | \version 0.1 7 | 8 | \brief project specific settings 9 | 10 | project specific configuration header file 11 | Select STM8 device and activate optional options 12 | */ 13 | 14 | /*----------------------------------------------------------------------------- 15 | MODULE DEFINITION FOR MULTIPLE INCLUSION 16 | -----------------------------------------------------------------------------*/ 17 | #ifndef _CONFIG_H_ 18 | #define _CONFIG_H_ 19 | 20 | 21 | // select board to set STM8 family, memory size etc. 22 | //#include "muBoard_config.h" 23 | 24 | /// alternatively select STM8 device directly. For supported devices see file "stm8as.h" 25 | #define STM8S208 // muBoard 26 | 27 | 28 | /// required for timekeeping (1ms interrupt) 29 | #define USE_TIM4_UPD_ISR 30 | 31 | /*----------------------------------------------------------------------------- 32 | END OF MODULE DEFINITION FOR MULTIPLE INLUSION 33 | -----------------------------------------------------------------------------*/ 34 | #endif // _CONFIG_H_ 35 | -------------------------------------------------------------------------------- /Projects/General_Examples/Timeout_Scheduler/config.h: -------------------------------------------------------------------------------- 1 | /** 2 | \file config.h 3 | 4 | \author G. Icking-Konert 5 | \date 2013-11-22 6 | \version 0.1 7 | 8 | \brief project specific settings 9 | 10 | project specific configuration header file 11 | Select STM8 device and activate optional options 12 | */ 13 | 14 | /*----------------------------------------------------------------------------- 15 | MODULE DEFINITION FOR MULTIPLE INCLUSION 16 | -----------------------------------------------------------------------------*/ 17 | #ifndef _CONFIG_H_ 18 | #define _CONFIG_H_ 19 | 20 | 21 | // select board to set STM8 family, memory size etc. 22 | #include "muBoard_config.h" 23 | 24 | /// alternatively select STM8 device directly. For supported devices see file "stm8as.h" 25 | //#define STM8S208 // muBoard 26 | 27 | 28 | /// required for timekeeping (1ms interrupt) 29 | #define USE_TIM4_UPD_ISR 30 | 31 | /*----------------------------------------------------------------------------- 32 | END OF MODULE DEFINITION FOR MULTIPLE INLUSION 33 | -----------------------------------------------------------------------------*/ 34 | #endif // _CONFIG_H_ 35 | -------------------------------------------------------------------------------- /Projects/General_Examples/Gets_Printf_UART/config.h: -------------------------------------------------------------------------------- 1 | /** 2 | \file config.h 3 | 4 | \author G. Icking-Konert 5 | \date 2013-11-22 6 | \version 0.1 7 | 8 | \brief project specific settings 9 | 10 | project specific configuration header file 11 | Select STM8 device and activate optional options 12 | */ 13 | 14 | /*----------------------------------------------------------------------------- 15 | MODULE DEFINITION FOR MULTIPLE INCLUSION 16 | -----------------------------------------------------------------------------*/ 17 | #ifndef _CONFIG_H_ 18 | #define _CONFIG_H_ 19 | 20 | 21 | // select board to set STM8 family, memory size etc. 22 | //#include "muBoard_config.h" 23 | 24 | /// alternatively select STM8 device directly. For supported devices see file "stm8as.h" 25 | #define STM8S208 // muBoard 26 | 27 | 28 | /// required for timekeeping (1ms interrupt) 29 | #define USE_TIM4_UPD_ISR 30 | 31 | 32 | /*----------------------------------------------------------------------------- 33 | END OF MODULE DEFINITION FOR MULTIPLE INLUSION 34 | -----------------------------------------------------------------------------*/ 35 | #endif // _CONFIG_H_ 36 | -------------------------------------------------------------------------------- /Projects/General_Examples/mirror_two_UARTs/config.h: -------------------------------------------------------------------------------- 1 | /** 2 | \file config.h 3 | 4 | \author G. Icking-Konert 5 | \date 2013-11-22 6 | \version 0.1 7 | 8 | \brief project specific settings 9 | 10 | project specific configuration header file 11 | Select STM8 device and activate optional options 12 | */ 13 | 14 | /*----------------------------------------------------------------------------- 15 | MODULE DEFINITION FOR MULTIPLE INCLUSION 16 | -----------------------------------------------------------------------------*/ 17 | #ifndef _CONFIG_H_ 18 | #define _CONFIG_H_ 19 | 20 | 21 | // select board to set STM8 family, memory size etc. 22 | //#include "muBoard_config.h" 23 | 24 | /// alternatively select STM8 device directly. For supported devices see file "stm8as.h" 25 | #define STM8S208 // muBoard 26 | 27 | 28 | /// required for timekeeping (1ms interrupt) 29 | #define USE_TIM4_UPD_ISR 30 | 31 | 32 | /*----------------------------------------------------------------------------- 33 | END OF MODULE DEFINITION FOR MULTIPLE INLUSION 34 | -----------------------------------------------------------------------------*/ 35 | #endif // _CONFIG_H_ 36 | -------------------------------------------------------------------------------- /Projects/General_Examples/Beeper/config.h: -------------------------------------------------------------------------------- 1 | /** 2 | \file config.h 3 | 4 | \author G. Icking-Konert 5 | \date 2013-11-22 6 | \version 0.1 7 | 8 | \brief project specific settings 9 | 10 | project specific configuration header file 11 | Select STM8 device and activate optional options 12 | */ 13 | 14 | /*----------------------------------------------------------------------------- 15 | MODULE DEFINITION FOR MULTIPLE INCLUSION 16 | -----------------------------------------------------------------------------*/ 17 | #ifndef _CONFIG_H_ 18 | #define _CONFIG_H_ 19 | 20 | 21 | // select board to set STM8 family, memory size etc. 22 | //#include "muBoard_config.h" 23 | 24 | /// select STM8 device (no default). For supported devices see file "stm8as.h" 25 | #define STM8S208 // muBoard 26 | //#define STM8S105 // STM8S Discovery 27 | 28 | 29 | /// required for timekeeping (1ms interrupt) 30 | #define USE_TIM4_UPD_ISR 31 | 32 | /*----------------------------------------------------------------------------- 33 | END OF MODULE DEFINITION FOR MULTIPLE INLUSION 34 | -----------------------------------------------------------------------------*/ 35 | #endif // _CONFIG_H_ 36 | -------------------------------------------------------------------------------- /Projects/General_Examples/Power_Saving_Modes/config.h: -------------------------------------------------------------------------------- 1 | /** 2 | \file config.h 3 | 4 | \author G. Icking-Konert 5 | \date 2013-11-22 6 | \version 0.1 7 | 8 | \brief project specific settings 9 | 10 | project specific configuration header file 11 | Select STM8 device and activate optional options 12 | */ 13 | 14 | /*----------------------------------------------------------------------------- 15 | MODULE DEFINITION FOR MULTIPLE INCLUSION 16 | -----------------------------------------------------------------------------*/ 17 | #ifndef _CONFIG_H_ 18 | #define _CONFIG_H_ 19 | 20 | 21 | /// alternatively select STM8 device directly. For supported devices see file "stm8as.h" 22 | #define STM8S208 // muBoard 23 | 24 | /// required for timekeeping (1ms interrupt) 25 | #define USE_TIM4_UPD_ISR 26 | 27 | /// use AWU interrupt 28 | #define USE_AWU_ISR 29 | 30 | /// use EXINT interrupt for port E 31 | #define USE_PORTE_ISR 32 | 33 | 34 | /*----------------------------------------------------------------------------- 35 | END OF MODULE DEFINITION FOR MULTIPLE INLUSION 36 | -----------------------------------------------------------------------------*/ 37 | #endif // _CONFIG_H_ 38 | -------------------------------------------------------------------------------- /Projects/STM8_StdPeriphLib_Examples/Minimal-C/config.h: -------------------------------------------------------------------------------- 1 | /** 2 | \file config.h 3 | 4 | \author G. Icking-Konert 5 | \date 2013-11-22 6 | \version 0.1 7 | 8 | \brief project specific settings 9 | 10 | project specific configuration header file 11 | Select STM8 device and activate optional options 12 | */ 13 | 14 | /*----------------------------------------------------------------------------- 15 | MODULE DEFINITION FOR MULTIPLE INCLUSION 16 | -----------------------------------------------------------------------------*/ 17 | #ifndef _CONFIG_H_ 18 | #define _CONFIG_H_ 19 | 20 | 21 | //#include "muBoard_config.h" 22 | //#include "STM8S_Discovery_config.h" 23 | 24 | /// alternatively select STM8 device directly. For supported devices see file "stm8as.h" 25 | #if !defined(STM8S208) 26 | #define STM8S208 // muBoard 27 | #endif 28 | #if !defined(STM8S105) 29 | #define STM8S105 // STM8S Discovery 30 | #endif 31 | 32 | 33 | /*----------------------------------------------------------------------------- 34 | END OF MODULE DEFINITION FOR MULTIPLE INLUSION 35 | -----------------------------------------------------------------------------*/ 36 | #endif // _CONFIG_H_ 37 | -------------------------------------------------------------------------------- /Projects/STM8_StdPeriphLib_Examples/Basic_Project/config.h: -------------------------------------------------------------------------------- 1 | /** 2 | \file config.h 3 | 4 | \author G. Icking-Konert 5 | \date 2013-11-22 6 | \version 0.1 7 | 8 | \brief project specific settings 9 | 10 | project specific configuration header file 11 | Select STM8 device and activate optional options 12 | */ 13 | 14 | /*----------------------------------------------------------------------------- 15 | MODULE DEFINITION FOR MULTIPLE INCLUSION 16 | -----------------------------------------------------------------------------*/ 17 | #ifndef _CONFIG_H_ 18 | #define _CONFIG_H_ 19 | 20 | 21 | // select board to set STM8 family, memory size etc. 22 | //#include "STM8S_Discovery_config.h" 23 | 24 | /// alternatively select STM8 device directly. For supported devices see file "stm8as.h" 25 | #if !defined(STM8S105) 26 | #define STM8S105 27 | #endif 28 | 29 | 30 | /// required for timekeeping (1ms interrupt) 31 | #define USE_TIM4_UPD_ISR 32 | 33 | /*----------------------------------------------------------------------------- 34 | END OF MODULE DEFINITION FOR MULTIPLE INLUSION 35 | -----------------------------------------------------------------------------*/ 36 | #endif // _CONFIG_H_ 37 | -------------------------------------------------------------------------------- /Projects/General_Examples/TIM3_PWM_generate/config.h: -------------------------------------------------------------------------------- 1 | /** 2 | \file config.h 3 | 4 | \author G. Icking-Konert 5 | \date 2013-11-22 6 | \version 0.1 7 | 8 | \brief project specific settings 9 | 10 | project specific configuration header file 11 | Select STM8 device and activate optional options 12 | */ 13 | 14 | /*----------------------------------------------------------------------------- 15 | MODULE DEFINITION FOR MULTIPLE INCLUSION 16 | -----------------------------------------------------------------------------*/ 17 | #ifndef _CONFIG_H_ 18 | #define _CONFIG_H_ 19 | 20 | 21 | // select board to set STM8 family, memory size etc. 22 | //#include "STM8S_Discovery_config.h" 23 | 24 | /// alternatively select STM8 device directly. For supported devices see file "stm8as.h" 25 | #define STM8S105 // STM8S Discovery 26 | //#define STM8S208 // muBoard 27 | 28 | 29 | /// required for timekeeping (1ms interrupt) 30 | #define USE_TIM4_UPD_ISR 31 | 32 | /*----------------------------------------------------------------------------- 33 | END OF MODULE DEFINITION FOR MULTIPLE INLUSION 34 | -----------------------------------------------------------------------------*/ 35 | #endif // _CONFIG_H_ 36 | -------------------------------------------------------------------------------- /Projects/General_Examples/Trap_Interrupt/config.h: -------------------------------------------------------------------------------- 1 | /** 2 | \file config.h 3 | 4 | \author G. Icking-Konert 5 | \date 2013-11-22 6 | \version 0.1 7 | 8 | \brief project specific settings 9 | 10 | project specific configuration header file 11 | Select STM8 device and activate optional options 12 | */ 13 | 14 | /*----------------------------------------------------------------------------- 15 | MODULE DEFINITION FOR MULTIPLE INCLUSION 16 | -----------------------------------------------------------------------------*/ 17 | #ifndef _CONFIG_H_ 18 | #define _CONFIG_H_ 19 | 20 | 21 | // select board to set STM8 family, memory size etc. 22 | //#include "muBoard_config.h" 23 | 24 | /// alternatively select STM8 device directly. For supported devices see file "stm8as.h" 25 | #define STM8S208 // muBoard 26 | 27 | 28 | /// required for timekeeping (1ms interrupt) 29 | #define USE_TIM4_UPD_ISR 30 | 31 | /// use TRAP interrupt 32 | #define USE_TRAP 33 | 34 | 35 | /*----------------------------------------------------------------------------- 36 | END OF MODULE DEFINITION FOR MULTIPLE INLUSION 37 | -----------------------------------------------------------------------------*/ 38 | #endif // _CONFIG_H_ 39 | -------------------------------------------------------------------------------- /Projects/Libraries_Examples/DigPoti-AD5280/config.h: -------------------------------------------------------------------------------- 1 | /** 2 | \file config.h 3 | 4 | \author G. Icking-Konert 5 | \date 2013-11-22 6 | \version 0.1 7 | 8 | \brief project specific settings 9 | 10 | project specific configuration header file 11 | Select STM8 device and project options as required 12 | */ 13 | 14 | /*----------------------------------------------------------------------------- 15 | MODULE DEFINITION FOR MULTIPLE INCLUSION 16 | -----------------------------------------------------------------------------*/ 17 | #ifndef _CONFIG_H_ 18 | #define _CONFIG_H_ 19 | 20 | 21 | /*----------------------------------------------------------------------------- 22 | GENERAL PROJECT SETTINGS 23 | -----------------------------------------------------------------------------*/ 24 | 25 | // select board to set STM8 family, memory size etc. 26 | #include "muBoard_config.h" 27 | 28 | /// required for timekeeping (1ms interrupt) 29 | #define USE_TIM4_UPD_ISR 30 | 31 | 32 | /*----------------------------------------------------------------------------- 33 | END OF MODULE DEFINITION FOR MULTIPLE INLUSION 34 | -----------------------------------------------------------------------------*/ 35 | #endif // _CONFIG_H_ 36 | -------------------------------------------------------------------------------- /Projects/Libraries_Examples/DigPoti-AD5282/config.h: -------------------------------------------------------------------------------- 1 | /** 2 | \file config.h 3 | 4 | \author G. Icking-Konert 5 | \date 2013-11-22 6 | \version 0.1 7 | 8 | \brief project specific settings 9 | 10 | project specific configuration header file 11 | Select STM8 device and project options as required 12 | */ 13 | 14 | /*----------------------------------------------------------------------------- 15 | MODULE DEFINITION FOR MULTIPLE INCLUSION 16 | -----------------------------------------------------------------------------*/ 17 | #ifndef _CONFIG_H_ 18 | #define _CONFIG_H_ 19 | 20 | 21 | /*----------------------------------------------------------------------------- 22 | GENERAL PROJECT SETTINGS 23 | -----------------------------------------------------------------------------*/ 24 | 25 | // select board to set STM8 family, memory size etc. 26 | #include "muBoard_config.h" 27 | 28 | /// required for timekeeping (1ms interrupt) 29 | #define USE_TIM4_UPD_ISR 30 | 31 | 32 | /*----------------------------------------------------------------------------- 33 | END OF MODULE DEFINITION FOR MULTIPLE INLUSION 34 | -----------------------------------------------------------------------------*/ 35 | #endif // _CONFIG_H_ 36 | -------------------------------------------------------------------------------- /Projects/Libraries_Examples/LCD-BTHQ21605V/config.h: -------------------------------------------------------------------------------- 1 | /** 2 | \file config.h 3 | 4 | \author G. Icking-Konert 5 | \date 2013-11-22 6 | \version 0.1 7 | 8 | \brief project specific settings 9 | 10 | project specific configuration header file 11 | Select STM8 device and project options as required 12 | */ 13 | 14 | /*----------------------------------------------------------------------------- 15 | MODULE DEFINITION FOR MULTIPLE INCLUSION 16 | -----------------------------------------------------------------------------*/ 17 | #ifndef _CONFIG_H_ 18 | #define _CONFIG_H_ 19 | 20 | 21 | /*----------------------------------------------------------------------------- 22 | GENERAL PROJECT SETTINGS 23 | -----------------------------------------------------------------------------*/ 24 | 25 | // select board to set STM8 family, memory size etc. 26 | #include "muBoard_config.h" 27 | 28 | /// required for timekeeping (1ms interrupt) 29 | #define USE_TIM4_UPD_ISR 30 | 31 | 32 | /*----------------------------------------------------------------------------- 33 | END OF MODULE DEFINITION FOR MULTIPLE INLUSION 34 | -----------------------------------------------------------------------------*/ 35 | #endif // _CONFIG_H_ 36 | -------------------------------------------------------------------------------- /Projects/muBoard_Examples/LCD-display_I2C/config.h: -------------------------------------------------------------------------------- 1 | /** 2 | \file config.h 3 | 4 | \author G. Icking-Konert 5 | \date 2013-11-22 6 | \version 0.1 7 | 8 | \brief project specific settings 9 | 10 | project specific configuration header file 11 | Select STM8 device and project options as required 12 | */ 13 | 14 | /*----------------------------------------------------------------------------- 15 | MODULE DEFINITION FOR MULTIPLE INCLUSION 16 | -----------------------------------------------------------------------------*/ 17 | #ifndef _CONFIG_H_ 18 | #define _CONFIG_H_ 19 | 20 | 21 | /*----------------------------------------------------------------------------- 22 | GENERAL PROJECT SETTINGS 23 | -----------------------------------------------------------------------------*/ 24 | 25 | // select board to set STM8 family, memory size etc. 26 | #include "muBoard_config.h" 27 | 28 | /// required for timekeeping (1ms interrupt) 29 | #define USE_TIM4_UPD_ISR 30 | 31 | 32 | /*----------------------------------------------------------------------------- 33 | END OF MODULE DEFINITION FOR MULTIPLE INLUSION 34 | -----------------------------------------------------------------------------*/ 35 | #endif // _CONFIG_H_ 36 | -------------------------------------------------------------------------------- /Projects/muBoard_Examples/Pin_Read_Write/config.h: -------------------------------------------------------------------------------- 1 | /** 2 | \file config.h 3 | 4 | \author G. Icking-Konert 5 | \date 2013-11-22 6 | \version 0.1 7 | 8 | \brief project specific settings 9 | 10 | project specific configuration header file 11 | Select STM8 device and project options as required 12 | */ 13 | 14 | /*----------------------------------------------------------------------------- 15 | MODULE DEFINITION FOR MULTIPLE INCLUSION 16 | -----------------------------------------------------------------------------*/ 17 | #ifndef _CONFIG_H_ 18 | #define _CONFIG_H_ 19 | 20 | 21 | /*----------------------------------------------------------------------------- 22 | GENERAL PROJECT SETTINGS 23 | -----------------------------------------------------------------------------*/ 24 | 25 | // select board to set STM8 family, memory size etc. 26 | #include "muBoard_config.h" 27 | 28 | /// required for timekeeping (1ms interrupt) 29 | #define USE_TIM4_UPD_ISR 30 | 31 | 32 | /*----------------------------------------------------------------------------- 33 | END OF MODULE DEFINITION FOR MULTIPLE INLUSION 34 | -----------------------------------------------------------------------------*/ 35 | #endif // _CONFIG_H_ 36 | -------------------------------------------------------------------------------- /Projects/muBoard_Examples/digital-poti_I2C/config.h: -------------------------------------------------------------------------------- 1 | /** 2 | \file config.h 3 | 4 | \author G. Icking-Konert 5 | \date 2013-11-22 6 | \version 0.1 7 | 8 | \brief project specific settings 9 | 10 | project specific configuration header file 11 | Select STM8 device and project options as required 12 | */ 13 | 14 | /*----------------------------------------------------------------------------- 15 | MODULE DEFINITION FOR MULTIPLE INCLUSION 16 | -----------------------------------------------------------------------------*/ 17 | #ifndef _CONFIG_H_ 18 | #define _CONFIG_H_ 19 | 20 | 21 | /*----------------------------------------------------------------------------- 22 | GENERAL PROJECT SETTINGS 23 | -----------------------------------------------------------------------------*/ 24 | 25 | // select board to set STM8 family, memory size etc. 26 | #include "muBoard_config.h" 27 | 28 | /// required for timekeeping (1ms interrupt) 29 | #define USE_TIM4_UPD_ISR 30 | 31 | 32 | /*----------------------------------------------------------------------------- 33 | END OF MODULE DEFINITION FOR MULTIPLE INLUSION 34 | -----------------------------------------------------------------------------*/ 35 | #endif // _CONFIG_H_ 36 | -------------------------------------------------------------------------------- /Projects/General_Examples/Pin_Interrupt/config.h: -------------------------------------------------------------------------------- 1 | /** 2 | \file config.h 3 | 4 | \author G. Icking-Konert 5 | \date 2013-11-22 6 | \version 0.1 7 | 8 | \brief project specific settings 9 | 10 | project specific configuration header file 11 | Select STM8 device and activate optional options 12 | */ 13 | 14 | /*----------------------------------------------------------------------------- 15 | MODULE DEFINITION FOR MULTIPLE INCLUSION 16 | -----------------------------------------------------------------------------*/ 17 | #ifndef _CONFIG_H_ 18 | #define _CONFIG_H_ 19 | 20 | 21 | // select board to set STM8 family, memory size etc. 22 | //#include "muBoard_config.h" 23 | 24 | /// alternatively select STM8 device directly. For supported devices see file "stm8as.h" 25 | #define STM8S208 // muBoard 26 | 27 | 28 | /// required for timekeeping (1ms interrupt) 29 | #define USE_TIM4_UPD_ISR 30 | 31 | /// use TLI interrupt for pin PD7 32 | #define USE_TLI_ISR 33 | 34 | 35 | /*----------------------------------------------------------------------------- 36 | END OF MODULE DEFINITION FOR MULTIPLE INLUSION 37 | -----------------------------------------------------------------------------*/ 38 | #endif // _CONFIG_H_ 39 | -------------------------------------------------------------------------------- /Projects/General_Examples/PiAndMore10/muBoard/main.c: -------------------------------------------------------------------------------- 1 | // include modules 2 | #include "main_general.h" 3 | #include "uart1.h" // UART1 communication 4 | #include "putchar.h" // for printf() 5 | 6 | void toggle_LED(void); 7 | 8 | // LED pin write 9 | #define LED pinOutputReg(&PORT_H, pin3) // muBoard LED 10 | 11 | 12 | // called once after reset 13 | void setup() { 14 | 15 | pinMode(&PORT_H, 3, OUTPUT); // configure LED pin 16 | attachInterruptMillis(toggle_LED); // attach toggle function to 1ms interrupt 17 | 18 | UART1_begin(115200); // init UART1 to 115.2kBaud 19 | putcharAttach(UART1_write); // printf() uses UART1_write() 20 | 21 | } // setup() 22 | 23 | 24 | // called continuously 25 | void loop() { 26 | 27 | // print time every 1s 28 | static uint32_t nextTime = 0; 29 | if (nextTime - millis() >= 1000) { 30 | nextTime += 1000; 31 | printf("time is %ds\n", (int) (millis()/1000L)); 32 | } 33 | 34 | } // loop() 35 | 36 | 37 | // toggle LED every 500th call 38 | void toggle_LED() { 39 | 40 | // every 500th time toggle LED 41 | static uint16_t count1ms = 0; 42 | if (++count1ms == 500) { 43 | count1ms = 0; 44 | LED ^= 1; 45 | } 46 | 47 | } // toggle_LED() 48 | 49 | -------------------------------------------------------------------------------- /Projects/General_Examples/Port_Interrupt/config.h: -------------------------------------------------------------------------------- 1 | /** 2 | \file config.h 3 | 4 | \author G. Icking-Konert 5 | \date 2013-11-22 6 | \version 0.1 7 | 8 | \brief project specific settings 9 | 10 | project specific configuration header file 11 | Select STM8 device and activate optional options 12 | */ 13 | 14 | /*----------------------------------------------------------------------------- 15 | MODULE DEFINITION FOR MULTIPLE INCLUSION 16 | -----------------------------------------------------------------------------*/ 17 | #ifndef _CONFIG_H_ 18 | #define _CONFIG_H_ 19 | 20 | 21 | // select board to set STM8 family, memory size etc. 22 | //#include "muBoard_config.h" 23 | 24 | /// alternatively select STM8 device directly. For supported devices see file "stm8as.h" 25 | #define STM8S208 // muBoard 26 | 27 | 28 | /// required for timekeeping (1ms interrupt) 29 | #define USE_TIM4_UPD_ISR 30 | 31 | /// use EXINT interrupt for port E 32 | #define USE_PORTE_ISR 33 | 34 | 35 | /*----------------------------------------------------------------------------- 36 | END OF MODULE DEFINITION FOR MULTIPLE INLUSION 37 | -----------------------------------------------------------------------------*/ 38 | #endif // _CONFIG_H_ 39 | -------------------------------------------------------------------------------- /Projects/STM8_StdPeriphLib_Examples/Basic_Project/stm8s_conf.h: -------------------------------------------------------------------------------- 1 | /** 2 | \file stm8s_conf.h 3 | 4 | \author G. Icking-Konert 5 | \date 2017-12-26 6 | \version 0.1 7 | 8 | \brief configuration for SPL part of the project 9 | 10 | project specific SPL configuration header file. 11 | Select SPL modules to use in project 12 | */ 13 | 14 | /*----------------------------------------------------------------------------- 15 | MODULE DEFINITION FOR MULTIPLE INCLUSION 16 | -----------------------------------------------------------------------------*/ 17 | /* Define to prevent recursive inclusion -------------------------------------*/ 18 | #ifndef __STM8S_CONF_H 19 | #define __STM8S_CONF_H 20 | 21 | // SPL headers -> modules to include. Don't mix SPL and STM8_template headers! 22 | #include "stm8s.h" 23 | #include "stm8s_gpio.h" 24 | 25 | 26 | // assert is required by SPL (even a dummy one) 27 | #define USE_FULL_ASSERT (0) 28 | #ifdef USE_FULL_ASSERT 29 | #define assert_param(expr) ((expr) ? (void)0 : assert_failed((uint8_t *)__FILE__, __LINE__)) 30 | void assert_failed(uint8_t* file, uint32_t line); 31 | #else 32 | #define assert_param(expr) ((void)0) 33 | #endif // USE_FULL_ASSERT 34 | 35 | #endif // __STM8S_CONF_H 36 | 37 | -------------------------------------------------------------------------------- /Projects/General_Examples/Attach_1ms_Interrupt/config.h: -------------------------------------------------------------------------------- 1 | /** 2 | \file config.h 3 | 4 | \author G. Icking-Konert 5 | \date 2013-11-22 6 | \version 0.1 7 | 8 | \brief project specific settings 9 | 10 | project specific configuration header file 11 | Select STM8 device and activate optional options 12 | */ 13 | 14 | /*----------------------------------------------------------------------------- 15 | MODULE DEFINITION FOR MULTIPLE INCLUSION 16 | -----------------------------------------------------------------------------*/ 17 | #ifndef _CONFIG_H_ 18 | #define _CONFIG_H_ 19 | 20 | 21 | // select board to set STM8 family, memory size etc. 22 | #include "muBoard_config.h" 23 | 24 | /// alternatively select STM8 device directly. For supported devices see file "stm8as.h" 25 | //#define STM8S208 // muBoard 26 | 27 | 28 | /// required for timekeeping (1ms interrupt) 29 | #define USE_TIM4_UPD_ISR 30 | 31 | /// allow attaching user function to 1ms interrupt 32 | #define USE_MILLI_ISR 33 | 34 | /*----------------------------------------------------------------------------- 35 | END OF MODULE DEFINITION FOR MULTIPLE INLUSION 36 | -----------------------------------------------------------------------------*/ 37 | #endif // _CONFIG_H_ 38 | -------------------------------------------------------------------------------- /Projects/STM8S_Discovery_Examples/Attach_1ms_Interrupt/config.h: -------------------------------------------------------------------------------- 1 | /** 2 | \file config.h 3 | 4 | \author G. Icking-Konert 5 | \date 2013-11-22 6 | \version 0.1 7 | 8 | \brief project specific settings 9 | 10 | project specific configuration header file 11 | Select STM8 device and activate optional options 12 | */ 13 | 14 | /*----------------------------------------------------------------------------- 15 | MODULE DEFINITION FOR MULTIPLE INCLUSION 16 | -----------------------------------------------------------------------------*/ 17 | #ifndef _CONFIG_H_ 18 | #define _CONFIG_H_ 19 | 20 | 21 | // select board to set STM8 family, memory size etc. 22 | #include "STM8S_Discovery_config.h" 23 | 24 | /// alternatively select STM8 device directly. For supported devices see file "stm8as.h" 25 | //#define STM8S105 26 | 27 | 28 | /// required for timekeeping (1ms interrupt) 29 | #define USE_TIM4_UPD_ISR 30 | 31 | /// allow attaching user function to 1ms interrupt 32 | #define USE_MILLI_ISR 33 | 34 | 35 | /*----------------------------------------------------------------------------- 36 | END OF MODULE DEFINITION FOR MULTIPLE INLUSION 37 | -----------------------------------------------------------------------------*/ 38 | #endif // _CONFIG_H_ 39 | -------------------------------------------------------------------------------- /Projects/General_Examples/Printf_UART/config.h: -------------------------------------------------------------------------------- 1 | /** 2 | \file config.h 3 | 4 | \author G. Icking-Konert 5 | \date 2013-11-22 6 | \version 0.1 7 | 8 | \brief project specific settings 9 | 10 | project specific configuration header file 11 | Select STM8 device and activate optional options 12 | */ 13 | 14 | /*----------------------------------------------------------------------------- 15 | MODULE DEFINITION FOR MULTIPLE INCLUSION 16 | -----------------------------------------------------------------------------*/ 17 | #ifndef _CONFIG_H_ 18 | #define _CONFIG_H_ 19 | 20 | 21 | // select board to set STM8 family, memory size etc. 22 | //#include "muBoard_config.h" 23 | 24 | /// alternatively select STM8 device directly. For supported devices see file "stm8as.h" 25 | #define STM8S208 // muBoard 26 | 27 | 28 | /// required for timekeeping (1ms interrupt) 29 | #define USE_TIM4_UPD_ISR 30 | 31 | // use ftoa() function for printing floats. Requires ~3.3kB flash 32 | //#define USE_FTOA 33 | 34 | 35 | /*----------------------------------------------------------------------------- 36 | END OF MODULE DEFINITION FOR MULTIPLE INLUSION 37 | -----------------------------------------------------------------------------*/ 38 | #endif // _CONFIG_H_ 39 | -------------------------------------------------------------------------------- /Projects/STM8_StdPeriphLib_Examples/Minimal-C/stm8s_conf.h: -------------------------------------------------------------------------------- 1 | /** 2 | \file stm8s_conf.h 3 | 4 | \author G. Icking-Konert 5 | \date 2017-12-26 6 | \version 0.1 7 | 8 | \brief configuration for SPL part of the project 9 | 10 | project specific SPL configuration header file. 11 | Select SPL modules to use in project 12 | */ 13 | 14 | /*----------------------------------------------------------------------------- 15 | MODULE DEFINITION FOR MULTIPLE INCLUSION 16 | -----------------------------------------------------------------------------*/ 17 | /* Define to prevent recursive inclusion -------------------------------------*/ 18 | #ifndef __STM8S_CONF_H 19 | #define __STM8S_CONF_H 20 | 21 | // SPL headers -> modules to include. Don't mix SPL and STM8_template headers! 22 | #include "stm8s.h" 23 | #include "stm8s_clk.h" 24 | #include "stm8s_gpio.h" 25 | 26 | 27 | // assert is required by SPL (even a dummy one) 28 | #define USE_FULL_ASSERT (0) 29 | #ifdef USE_FULL_ASSERT 30 | #define assert_param(expr) ((expr) ? (void)0 : assert_failed((uint8_t *)__FILE__, __LINE__)) 31 | void assert_failed(uint8_t* file, uint32_t line); 32 | #else 33 | #define assert_param(expr) ((void)0) 34 | #endif // USE_FULL_ASSERT 35 | 36 | #endif // __STM8S_CONF_H 37 | 38 | -------------------------------------------------------------------------------- /Projects/STM8S_Discovery_Examples/echo_UART_with_ISR/config.h: -------------------------------------------------------------------------------- 1 | /** 2 | \file config.h 3 | 4 | \author G. Icking-Konert 5 | \date 2013-11-22 6 | \version 0.1 7 | 8 | \brief project specific settings 9 | 10 | project specific configuration header file 11 | Select STM8 device and activate optional options 12 | */ 13 | 14 | /*----------------------------------------------------------------------------- 15 | MODULE DEFINITION FOR MULTIPLE INCLUSION 16 | -----------------------------------------------------------------------------*/ 17 | #ifndef _CONFIG_H_ 18 | #define _CONFIG_H_ 19 | 20 | 21 | // select board to set STM8 family, memory size etc. 22 | //#include "muBoard_config.h" 23 | 24 | /// alternatively select STM8 device directly. For supported devices see file "stm8as.h" 25 | #define STM8S105 26 | 27 | 28 | /// required for timekeeping (1ms interrupt) 29 | #define USE_TIM4_UPD_ISR 30 | 31 | /// define UART2 send & receive ISRs 32 | #define USE_UART234_RXF_ISR 33 | #define USE_UART234_TXE_ISR 34 | 35 | 36 | /*----------------------------------------------------------------------------- 37 | END OF MODULE DEFINITION FOR MULTIPLE INLUSION 38 | -----------------------------------------------------------------------------*/ 39 | #endif // _CONFIG_H_ 40 | -------------------------------------------------------------------------------- /Projects/General_Examples/echo_UART_with_ISR/config.h: -------------------------------------------------------------------------------- 1 | /** 2 | \file config.h 3 | 4 | \author G. Icking-Konert 5 | \date 2013-11-22 6 | \version 0.1 7 | 8 | \brief project specific settings 9 | 10 | project specific configuration header file 11 | Select STM8 device and activate optional options 12 | */ 13 | 14 | /*----------------------------------------------------------------------------- 15 | MODULE DEFINITION FOR MULTIPLE INCLUSION 16 | -----------------------------------------------------------------------------*/ 17 | #ifndef _CONFIG_H_ 18 | #define _CONFIG_H_ 19 | 20 | 21 | // select board to set STM8 family, memory size etc. 22 | //#include "muBoard_config.h" 23 | 24 | /// alternatively select STM8 device directly. For supported devices see file "stm8as.h" 25 | #define STM8S208 // muBoard 26 | 27 | 28 | /// required for timekeeping (1ms interrupt) 29 | #define USE_TIM4_UPD_ISR 30 | 31 | /// define UART send & receive ISRs 32 | #define USE_UART1_RXF_ISR 33 | #define USE_UART1_TXE_ISR 34 | 35 | 36 | /*----------------------------------------------------------------------------- 37 | END OF MODULE DEFINITION FOR MULTIPLE INLUSION 38 | -----------------------------------------------------------------------------*/ 39 | #endif // _CONFIG_H_ 40 | -------------------------------------------------------------------------------- /Projects/build_all_projects.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | 3 | ''' 4 | Find and execute all clean.py beneath this script 5 | ''' 6 | 7 | # required modules 8 | import sys 9 | import os 10 | import platform 11 | sys.path.insert(0,'../Tools') 12 | import misc 13 | 14 | # execute all 'clean.py' below the current folder 15 | oldDir = os.getcwd() 16 | for file in misc.listFiles('.',"build_upload.py"): 17 | 18 | # change working directory 19 | os.chdir(os.path.dirname(file)) 20 | 21 | # show progress 22 | sys.stdout.write('compile ' + os.path.dirname(file) + ' ... ') 23 | sys.stdout.flush() 24 | 25 | # build w/o upload 26 | if platform.system() == 'Windows': 27 | err = os.system('python build_upload.py --skipupload --skipterminal --skippause > NUL') 28 | else: 29 | err = os.system('python build_upload.py --skipupload --skipterminal --skippause > /dev/null') 30 | if err != 0: 31 | misc.Exit(err) 32 | 33 | # print message 34 | sys.stdout.write('done\n') 35 | sys.stdout.flush() 36 | 37 | # restore working directory 38 | os.chdir(oldDir) 39 | 40 | # optional prompt for return, then close window 41 | if True: 42 | if (sys.version_info.major == 3): 43 | input("\npress return to exit ... ") 44 | else: 45 | raw_input("\npress return to exit ... ") 46 | sys.stdout.write('\n\n') 47 | 48 | -------------------------------------------------------------------------------- /Projects/General_Examples/EEPROM_Datalogger/config.h: -------------------------------------------------------------------------------- 1 | /** 2 | \file config.h 3 | 4 | \author G. Icking-Konert 5 | \date 2013-11-22 6 | \version 0.1 7 | 8 | \brief project specific settings 9 | 10 | project specific configuration header file 11 | Select STM8 device and activate optional options 12 | */ 13 | 14 | /*----------------------------------------------------------------------------- 15 | MODULE DEFINITION FOR MULTIPLE INCLUSION 16 | -----------------------------------------------------------------------------*/ 17 | #ifndef _CONFIG_H_ 18 | #define _CONFIG_H_ 19 | 20 | 21 | // select board to set STM8 family, memory size etc. 22 | #include "muBoard_config.h" 23 | 24 | /// alternatively select STM8 family and memory size directly. For supported devices see file "stm8as.h" 25 | /* 26 | #define STM8S208 27 | #define PFLASH_SIZE (1024L * 128) 28 | #define RAM_SIZE (1024 * 6) 29 | #define EEPROM_SIZE (2048) 30 | */ 31 | 32 | 33 | /// required for timekeeping (1ms interrupt) 34 | #define USE_TIM4_UPD_ISR 35 | 36 | /*----------------------------------------------------------------------------- 37 | END OF MODULE DEFINITION FOR MULTIPLE INLUSION 38 | -----------------------------------------------------------------------------*/ 39 | #endif // _CONFIG_H_ 40 | -------------------------------------------------------------------------------- /Projects/General_Examples/P-Flash_Datalogger/config.h: -------------------------------------------------------------------------------- 1 | /** 2 | \file config.h 3 | 4 | \author G. Icking-Konert 5 | \date 2013-11-22 6 | \version 0.1 7 | 8 | \brief project specific settings 9 | 10 | project specific configuration header file 11 | Select STM8 device and activate optional options 12 | */ 13 | 14 | /*----------------------------------------------------------------------------- 15 | MODULE DEFINITION FOR MULTIPLE INCLUSION 16 | -----------------------------------------------------------------------------*/ 17 | #ifndef _CONFIG_H_ 18 | #define _CONFIG_H_ 19 | 20 | 21 | // select board to set STM8 family, memory size etc. 22 | #include "muBoard_config.h" 23 | 24 | /// alternatively select STM8 family and memory size directly. For supported devices see file "stm8as.h" 25 | /* 26 | #define STM8S208 27 | #define PFLASH_SIZE (1024L * 128) 28 | #define RAM_SIZE (1024 * 6) 29 | #define EEPROM_SIZE (2048) 30 | */ 31 | 32 | 33 | /// required for timekeeping (1ms interrupt) 34 | #define USE_TIM4_UPD_ISR 35 | 36 | /*----------------------------------------------------------------------------- 37 | END OF MODULE DEFINITION FOR MULTIPLE INLUSION 38 | -----------------------------------------------------------------------------*/ 39 | #endif // _CONFIG_H_ 40 | -------------------------------------------------------------------------------- /Projects/Libraries_Examples/DigPoti-AD5280/main.c: -------------------------------------------------------------------------------- 1 | /********************** 2 | Arduino-like project with setup() & loop(). 3 | Ramp up resistance of 1-channel poti AD5280 via I2C. 4 | **********************/ 5 | 6 | /*---------------------------------------------------------- 7 | INCLUDE FILES 8 | ----------------------------------------------------------*/ 9 | #include "main_general.h" // board-independent main 10 | #include "digPoti-AD5280.h" 11 | 12 | 13 | /*---------------------------------------------------------- 14 | FUNCTIONS 15 | ----------------------------------------------------------*/ 16 | 17 | ////////// 18 | // user setup, called once after reset 19 | ////////// 20 | void setup() { 21 | 22 | // init I2C module 23 | i2c_init(); 24 | 25 | } // setup 26 | 27 | 28 | ////////// 29 | // user loop, called continuously 30 | ////////// 31 | void loop() { 32 | 33 | static uint8_t res = 0; 34 | 35 | // set resistance to Rmax/255*res 36 | AD5280_set_poti(res); 37 | 38 | // wait a while 39 | delay(500); 40 | 41 | // ramp up 42 | res += 8; 43 | 44 | } // loop 45 | 46 | /*----------------------------------------------------------------------------- 47 | END OF MODULE 48 | -----------------------------------------------------------------------------*/ 49 | -------------------------------------------------------------------------------- /Library/Libraries/FatFS_0.13/documents/res/app1.c: -------------------------------------------------------------------------------- 1 | /*------------------------------------------------------------/ 2 | / Open or create a file in append mode 3 | / (This function was sperseded by FA_OPEN_APPEND flag at FatFs R0.12a) 4 | /------------------------------------------------------------*/ 5 | 6 | FRESULT open_append ( 7 | FIL* fp, /* [OUT] File object to create */ 8 | const char* path /* [IN] File name to be opened */ 9 | ) 10 | { 11 | FRESULT fr; 12 | 13 | /* Opens an existing file. If not exist, creates a new file. */ 14 | fr = f_open(fp, path, FA_WRITE | FA_OPEN_ALWAYS); 15 | if (fr == FR_OK) { 16 | /* Seek to end of the file to append data */ 17 | fr = f_lseek(fp, f_size(fp)); 18 | if (fr != FR_OK) 19 | f_close(fp); 20 | } 21 | return fr; 22 | } 23 | 24 | 25 | int main (void) 26 | { 27 | FRESULT fr; 28 | FATFS fs; 29 | FIL fil; 30 | 31 | /* Open or create a log file and ready to append */ 32 | f_mount(&fs, "", 0); 33 | fr = open_append(&fil, "logfile.txt"); 34 | if (fr != FR_OK) return 1; 35 | 36 | /* Append a line */ 37 | f_printf(&fil, "%02u/%02u/%u, %2u:%02u\n", Mday, Mon, Year, Hour, Min); 38 | 39 | /* Close the file */ 40 | f_close(&fil); 41 | 42 | return 0; 43 | } 44 | 45 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | STM8 Templates with Arduino look&feel 2 | ================= 3 | 4 | **Sorry, we're closed!** 5 | 6 | Due to lack of time and shifted emphasis this repository is no longer maintained. Sorry for any inconvenience and thanks a lot for your understanding! 7 | 8 | ------------------ 9 | 10 | This repository provides "Arduino-like" C-libraries & -templates for the low-cost [STM8A and STM8S](https://en.wikipedia.org/wiki/STM8) 8-bit microcontrollers by [STMicro](http://st.com). 11 | 12 | Where sensible, compatibility with Arduino has been kept. However, due to focus on easy porting to new STM8 boards and some new features, 100% Arduino-compatibility was not always achievable. If you seek this, please check out the [_sduino_ project](https://github.com/tenbaht/sduino). 13 | 14 | - details on installation and an API description can be found in the [Wiki](https://github.com/gicking/STM8_templates/wiki) 15 | - a more detailed description of the implementation can be generated by running [_doxygen_](http://www.stack.nl/~dimitri/doxygen/) with file 'Doxyfile' in folder 'Docu' 16 | - for bugs reports, feature requests, please drop me a note or use the [issues page](https://github.com/gicking/STM8_templates/issues) 17 | - for legal stuff see [LICENSE](LICENSE) 18 | - and, last but not least, volunteers are highly welcome... 19 | 20 | Have fun! 21 | Georg Icking-Konert 22 | 23 | -------------------------------------------------------------------------------- /Library/Base/inc/timeout.h: -------------------------------------------------------------------------------- 1 | /** 2 | \file timeout.h 3 | 4 | \author G. Icking-Konert 5 | \date 2013-11-22 6 | \version 0.1 7 | 8 | \brief declaration of timeouts based on 1ms clock 9 | 10 | declaration of timeouts based on 1ms clock (TIM4 ISR) 11 | Optional functionality via #define: 12 | - USE_TIM4_UPD_ISR: required for TIM4 ISR 13 | - NUM_TIMEOUTS: custom number of timeouts (default=5) 14 | */ 15 | 16 | /*----------------------------------------------------------------------------- 17 | MODULE DEFINITION FOR MULTIPLE INCLUSION 18 | -----------------------------------------------------------------------------*/ 19 | #ifndef _TIMEOUT_H_ 20 | #define _TIMEOUT_H_ 21 | 22 | 23 | /*----------------------------------------------------------------------------- 24 | DECLARATION OF GLOBAL FUNCTIONS 25 | -----------------------------------------------------------------------------*/ 26 | 27 | /// start timeout N (0..NUM_TIMEOUTS-1) with 'ms' 28 | void setTimeout(uint8_t N, uint32_t ms); 29 | 30 | /// check timeout N (0..NUM_TIMEOUTS-1) 31 | uint8_t checkTimeout(uint8_t N); 32 | 33 | 34 | /*----------------------------------------------------------------------------- 35 | END OF MODULE DEFINITION FOR MULTIPLE INLUSION 36 | -----------------------------------------------------------------------------*/ 37 | #endif // _TIMEOUT_H_ 38 | -------------------------------------------------------------------------------- /Projects/muBoard_Examples/README.md: -------------------------------------------------------------------------------- 1 | back to [Wiki](https://github.com/gicking/STM8_templates/wiki) 2 | 3 | 4 | muBoard Examples 5 | ================= 6 | 7 | This folder contains some [muBoard](https://frosch.piandmore.de//de/pam9/call/public-media/event_media/160611_Vortrag_Interpreter.pdf) specific example projects for 8 | the STM8 template library. The functionality (loosely sorted by 9 | rising complexity) is as follows: 10 | 11 | LCD-display_I2C: 12 | ---------- 13 | Arduino-like project with setup() & loop(). 14 | Periodically print text to 2x16 char LCD attached to I2C (muBoard) 15 | Used display: Batron BTHQ21605V-COG-FSRE-I2C 2X16 (Farnell 1220409) 16 | connected via I2C pins PE1/SCL, PE2/SDA, and GPIO PE3 for LCD reset (see i2c_lcd.c) 17 | Functionality: 18 | - initialize I2C bus 19 | - initialize and reset LCD display 20 | - periodically print time to LCD 21 | 22 | 23 | digital-poti_I2C: 24 | ---------- 25 | Arduino-like project with setup() & loop(). 26 | Periodically ramp potentiometer resistance attached to I2C (muBoard). 27 | Used 20kR potentiometer: Analog Devices AD5280BRUZ20 (Farnell 1438441). 28 | Connected via I2C pins PE1/SCL and PE2/SDA 29 | Functionality: 30 | - initialize I2C bus 31 | - periodically ramp resistance 32 | - print current value via UART1 33 | 34 | 35 | back to [Wiki](https://github.com/gicking/STM8_templates/wiki) 36 | 37 | -------------------------------------------------------------------------------- /Library/Base/inc/stopwatch.h: -------------------------------------------------------------------------------- 1 | /** 2 | \file stopwatch.h 3 | 4 | \author G. Icking-Konert 5 | \date 2018-01-18 6 | \version 0.1 7 | 8 | \brief declaration of stopwatches based on 1ms clock 9 | 10 | declaration of stopwatches based on 1ms clock (TIM4 ISR) 11 | Optional functionality via #define: 12 | - USE_TIM4_UPD_ISR: required for TIM4 ISR 13 | - NUM_STOPWATCH: custom number of stopwatches (default=5) 14 | */ 15 | 16 | /*----------------------------------------------------------------------------- 17 | MODULE DEFINITION FOR MULTIPLE INCLUSION 18 | -----------------------------------------------------------------------------*/ 19 | #ifndef _STOPWATCH_H_ 20 | #define _STOPWATCH_H_ 21 | 22 | 23 | /*----------------------------------------------------------------------------- 24 | DECLARATION OF GLOBAL FUNCTIONS 25 | -----------------------------------------------------------------------------*/ 26 | 27 | /// start stopwatch N (0..NUM_STOPWATCH-1) 28 | void startStopwatch(uint8_t N); 29 | 30 | /// read stopwatch N (0..NUM_STOPWATCH-1) 31 | uint32_t getStopwatch(uint8_t N); 32 | 33 | 34 | /*----------------------------------------------------------------------------- 35 | END OF MODULE DEFINITION FOR MULTIPLE INLUSION 36 | -----------------------------------------------------------------------------*/ 37 | #endif // _STOPWATCH_H_ 38 | -------------------------------------------------------------------------------- /Projects/General_Examples/mirror_two_UARTs_with_ISR/config.h: -------------------------------------------------------------------------------- 1 | /** 2 | \file config.h 3 | 4 | \author G. Icking-Konert 5 | \date 2013-11-22 6 | \version 0.1 7 | 8 | \brief project specific settings 9 | 10 | project specific configuration header file 11 | Select STM8 device and activate optional options 12 | */ 13 | 14 | /*----------------------------------------------------------------------------- 15 | MODULE DEFINITION FOR MULTIPLE INCLUSION 16 | -----------------------------------------------------------------------------*/ 17 | #ifndef _CONFIG_H_ 18 | #define _CONFIG_H_ 19 | 20 | 21 | // select board to set STM8 family, memory size etc. 22 | //#include "muBoard_config.h" 23 | 24 | /// alternatively select STM8 device directly. For supported devices see file "stm8as.h" 25 | #define STM8S208 // muBoard 26 | 27 | 28 | /// required for timekeeping (1ms interrupt) 29 | #define USE_TIM4_UPD_ISR 30 | 31 | /// define UART1 and UART3 send & receive ISRs 32 | #define USE_UART1_RXF_ISR 33 | #define USE_UART1_TXE_ISR 34 | #define USE_UART234_RXF_ISR 35 | #define USE_UART234_TXE_ISR 36 | 37 | 38 | /*----------------------------------------------------------------------------- 39 | END OF MODULE DEFINITION FOR MULTIPLE INLUSION 40 | -----------------------------------------------------------------------------*/ 41 | #endif // _CONFIG_H_ 42 | -------------------------------------------------------------------------------- /Library/Libraries/PetitFS_0.03/doc/pf/sdir.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Petit FatFs - DIR 10 | 11 | 12 | 13 | 14 |
15 |

DIR

16 |

The DIR structure is used for the work area to read a directory by pf_oepndir, pf_readdir function.

17 |
18 | typedef struct {
19 |     WORD    index;     /* Current read/write index number */
20 |     BYTE*   fn;        /* Pointer to the SFN (in/out) {file[8],ext[3],status[1]} */
21 |     CLUST   sclust;    /* Table start cluster (0:Static table) */
22 |     CLUST   clust;     /* Current cluster */
23 |     DWORD   sect;      /* Current sector */
24 | } DIR;
25 | 
26 |
27 | 28 |

Return

29 | 30 | 31 | -------------------------------------------------------------------------------- /Library/Base/inc/pulse.h: -------------------------------------------------------------------------------- 1 | /** 2 | \file pulse.h 3 | 4 | \author G. Icking-Konert 5 | \date 2018-01-25 6 | \version 0.1 7 | 8 | \brief declaration of pulseIn() 9 | 10 | declaration of routine to measure pulse durations (blocking). 11 | */ 12 | 13 | /*----------------------------------------------------------------------------- 14 | MODULE DEFINITION FOR MULTIPLE INCLUSION 15 | -----------------------------------------------------------------------------*/ 16 | #ifndef _PULSE_H_ 17 | #define _PULSE_H_ 18 | 19 | /*----------------------------------------------------------------------------- 20 | INCLUDE FILES 21 | -----------------------------------------------------------------------------*/ 22 | #include "stm8as.h" 23 | #include "config.h" 24 | #include "gpio.h" 25 | 26 | 27 | /*----------------------------------------------------------------------------- 28 | DECLARATION OF GLOBAL FUNCTIONS 29 | -----------------------------------------------------------------------------*/ 30 | 31 | /// measure pulse duration with timepout 32 | uint32_t pulseIn(PORT_t *pPort, uint8_t pin, uint8_t state, uint16_t timeout); 33 | 34 | /*----------------------------------------------------------------------------- 35 | END OF MODULE DEFINITION FOR MULTIPLE INLUSION 36 | -----------------------------------------------------------------------------*/ 37 | #endif // _PULSE_H_ 38 | -------------------------------------------------------------------------------- /Projects/Libraries_Examples/DigPoti-AD5282/main.c: -------------------------------------------------------------------------------- 1 | /********************** 2 | Arduino-like project with setup() & loop(). 3 | Ramp up/down resistances of 2-channel poti AD5282 via I2C. 4 | **********************/ 5 | 6 | /*---------------------------------------------------------- 7 | INCLUDE FILES 8 | ----------------------------------------------------------*/ 9 | #include "main_general.h" // board-independent main 10 | #include "digPoti-AD5282.h" 11 | 12 | 13 | /*---------------------------------------------------------- 14 | FUNCTIONS 15 | ----------------------------------------------------------*/ 16 | 17 | ////////// 18 | // user setup, called once after reset 19 | ////////// 20 | void setup() { 21 | 22 | // init I2C module 23 | i2c_init(); 24 | 25 | } // setup 26 | 27 | 28 | ////////// 29 | // user loop, called continuously 30 | ////////// 31 | void loop() { 32 | 33 | static uint8_t res = 0; 34 | 35 | // set resistance of channel A to Rmax/255*res, and B to Rmax/255*(255-res) 36 | AD5282_set_poti(0, res); 37 | AD5282_set_poti(1, 255-res); 38 | 39 | // wait a while 40 | delay(500); 41 | 42 | // ramp up 43 | res += 8; 44 | 45 | } // loop 46 | 47 | /*----------------------------------------------------------------------------- 48 | END OF MODULE 49 | -----------------------------------------------------------------------------*/ 50 | -------------------------------------------------------------------------------- /Projects/STM8S_Discovery_Examples/Minimal-C/main.c: -------------------------------------------------------------------------------- 1 | /********************** 2 | simple C-project without Arduino-like initialization and 3 | setup()/loop(). No assumption is made, no interrupts used. 4 | Can be used as starting point for projects with extreme 5 | memory limitations or real-time requirements. 6 | Functionality: 7 | - init FCPU to 16MHz 8 | - configure LED pin as output 9 | - toggle LED every 500ms w/o timer -> blocking 10 | **********************/ 11 | 12 | /*---------------------------------------------------------- 13 | INCLUDE FILES 14 | ----------------------------------------------------------*/ 15 | #include "stm8as.h" // STM8 peripheral registers 16 | #include "gpio.h" // pin access routines 17 | #include "sw_delay.h" // dummy pause without timer 18 | 19 | 20 | // define board LED pin for STM8S Discovery Board 21 | #define LED pinOutputReg(&PORT_D, pin0) 22 | 23 | // main routine 24 | void main(void) { 25 | 26 | // switch to 16MHz (default is 2MHz) 27 | CLK.CKDIVR.byte = 0x00; 28 | 29 | // configure LED pin as output 30 | pinMode(&PORT_D, 0, OUTPUT); 31 | 32 | // main loop 33 | while (1) { 34 | 35 | // toggle LED 36 | //LED ^= 1; // direct (bitwise) pin access 37 | pinToggle(&PORT_D, 0); // "normal" access via pin number 38 | 39 | // wait some time 40 | sw_delay(500); 41 | 42 | } // main loop 43 | 44 | } // main 45 | 46 | -------------------------------------------------------------------------------- /Library/Libraries/PetitFS_0.03/doc/pf/filename.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Petit FatFs - Path Names 10 | 11 | 12 | 13 | 14 |
15 |

Format of the path names

16 |

The path name format on the Petit FatFs module is similer to MS-DOS as follows.

17 |
"[/]directory/file"
18 |

The Petit FatFs module supports only 8.3 format file name. The sub-directories are separated with a /. The path name is terminated with a nul character, control character or white space. Heading spaces are ignored and skipped. When _USE_LCC == 1, lower case characters are allowed for the path name.

19 |

The Petit FatFs module does not have a concept of current directory like OS oriented file system. All objects on the volume are always specified in full path name following from the root directory. Heading separator is ignored and it can be exist or omitted.

20 |
21 | 22 | 23 | -------------------------------------------------------------------------------- /Tools/README.md: -------------------------------------------------------------------------------- 1 | Helper Tools for STM8 Templates 2 | ================================= 3 | 4 | For installation of required tools, e.g. compiler, see [Docu](../Docu) 5 | 6 | 7 | [stm8flash](https://github.com/vdudouyt/stm8flash) (external): 8 | ---------------------------------- 9 | Tool for uploading hexfile to STM8 via SWIM debug interface. Open source, platform independent. 10 | - requires libusb-dev (e.g. `sudo apt-get install libusb-1.0-0-dev`) 11 | - on Linux grant write access to ST-Link debugger by creating a file `/etc/udev/rules.d/99-stlinkv2.rules` with content 12 | `SUBSYSTEM=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="3744", MODE="0666"` 13 | Note: check the idProduct of your ST-Link device via terminal command `usb-devices` 14 | 15 | 16 | [STM8 serial flasher](https://github.com/gicking/STM8_serial_flasher) (external): 17 | ---------------------------------- 18 | Tool for uploading hexfile to STM8 via UART bootloader. Open source, platform independent 19 | 20 | 21 | terminal.py (provided): 22 | ---------------------------------- 23 | Simple serial terminal in Python. Requires [Python](https://www.python.org/) installation with additional package `pySerial` 24 | 25 | 26 | buildProject.py (provided): 27 | ---------------------------------- 28 | Routines for generate Makefile and build project. Is called by project build script 29 | 30 | 31 | misc.py (provided): 32 | ---------------------------------- 33 | Gereric helper routines 34 | 35 | -------------------------------------------------------------------------------- /Projects/General_Examples/echo_UART/main.c: -------------------------------------------------------------------------------- 1 | /********************** 2 | Arduino-like project with setup() & loop(). 3 | Echo bytes received via UART1 with polling. 4 | Functionality: 5 | - configure UART1 for PC in-/output 6 | - poll if byte was received via UART1 7 | - echo bytes+1 back to PC 8 | **********************/ 9 | 10 | /*---------------------------------------------------------- 11 | INCLUDE FILES 12 | ----------------------------------------------------------*/ 13 | #include "main_general.h" // board-independent main 14 | #include "uart1.h" // UART1 communication 15 | 16 | 17 | /*---------------------------------------------------------- 18 | FUNCTIONS 19 | ----------------------------------------------------------*/ 20 | 21 | ////////// 22 | // user setup, called once after reset 23 | ////////// 24 | void setup() { 25 | 26 | // init UART1 to 115.2kBaud, 8N1, full duplex 27 | UART1_begin(115200); 28 | 29 | } // setup 30 | 31 | 32 | 33 | ////////// 34 | // user loop, called continuously 35 | ////////// 36 | void loop() { 37 | 38 | char c; 39 | 40 | // check for character received 41 | if (UART1_available()) { 42 | c = UART1_read(); 43 | UART1_write(c+1); 44 | } 45 | 46 | } // loop 47 | 48 | /*----------------------------------------------------------------------------- 49 | END OF MODULE 50 | -----------------------------------------------------------------------------*/ 51 | -------------------------------------------------------------------------------- /Projects/General_Examples/I2C_read/config.h: -------------------------------------------------------------------------------- 1 | /** 2 | \file config.h 3 | 4 | \author G. Icking-Konert 5 | \date 2013-11-22 6 | \version 0.1 7 | 8 | \brief project specific settings 9 | 10 | project specific configuration header file 11 | Select STM8 device and project options as required 12 | */ 13 | 14 | /*----------------------------------------------------------------------------- 15 | MODULE DEFINITION FOR MULTIPLE INCLUSION 16 | -----------------------------------------------------------------------------*/ 17 | #ifndef _CONFIG_H_ 18 | #define _CONFIG_H_ 19 | 20 | 21 | /*----------------------------------------------------------------------------- 22 | GENERAL PROJECT SETTINGS 23 | -----------------------------------------------------------------------------*/ 24 | 25 | /// select STM8 device (no default). For supported devices see file "stm8as.h" 26 | #define STM8S208 // muBoard 27 | 28 | 29 | /*----------------------------------------------------------------------------- 30 | ADC2 SETTINGS 31 | -----------------------------------------------------------------------------*/ 32 | 33 | /// required for timekeeping (1ms interrupt) 34 | #define USE_TIM4_UPD_ISR 35 | 36 | 37 | /*----------------------------------------------------------------------------- 38 | END OF MODULE DEFINITION FOR MULTIPLE INLUSION 39 | -----------------------------------------------------------------------------*/ 40 | #endif // _CONFIG_H_ 41 | -------------------------------------------------------------------------------- /Projects/General_Examples/I2C_write/config.h: -------------------------------------------------------------------------------- 1 | /** 2 | \file config.h 3 | 4 | \author G. Icking-Konert 5 | \date 2013-11-22 6 | \version 0.1 7 | 8 | \brief project specific settings 9 | 10 | project specific configuration header file 11 | Select STM8 device and project options as required 12 | */ 13 | 14 | /*----------------------------------------------------------------------------- 15 | MODULE DEFINITION FOR MULTIPLE INCLUSION 16 | -----------------------------------------------------------------------------*/ 17 | #ifndef _CONFIG_H_ 18 | #define _CONFIG_H_ 19 | 20 | 21 | /*----------------------------------------------------------------------------- 22 | GENERAL PROJECT SETTINGS 23 | -----------------------------------------------------------------------------*/ 24 | 25 | /// select STM8 device (no default). For supported devices see file "stm8as.h" 26 | #define STM8S208 // muBoard 27 | 28 | 29 | /*----------------------------------------------------------------------------- 30 | ADC2 SETTINGS 31 | -----------------------------------------------------------------------------*/ 32 | 33 | /// required for timekeeping (1ms interrupt) 34 | #define USE_TIM4_UPD_ISR 35 | 36 | 37 | /*----------------------------------------------------------------------------- 38 | END OF MODULE DEFINITION FOR MULTIPLE INLUSION 39 | -----------------------------------------------------------------------------*/ 40 | #endif // _CONFIG_H_ 41 | -------------------------------------------------------------------------------- /Projects/STM8_StdPeriphLib_Examples/Basic_Project/SPL.c: -------------------------------------------------------------------------------- 1 | /********************** 2 | Interface functions between STM8_templates and STM8 Standard Peripheral Library 3 | (SDCC patch available from https://github.com/gicking/STM8-SPL_SDCC_patch). 4 | Is required because the different device headers from STM8_templates 5 | and SPL are incompatible. 6 | Advantage is transparent mixing of STM8_templates (simple) with STM8 7 | SPL library (powerful) and examples by STM. 8 | **********************/ 9 | 10 | /*---------------------------------------------------------- 11 | INCLUDE FILES 12 | ----------------------------------------------------------*/ 13 | #include "stm8s_conf.h" // set required SPL modules only in this header 14 | 15 | 16 | ////////// 17 | // SPL setup, called once by setup() in main.c 18 | ////////// 19 | void SPL_setup() { 20 | 21 | /* Initialize LED pins in Output Mode */ 22 | GPIO_Init(GPIOD, (GPIO_Pin_TypeDef)GPIO_PIN_0, GPIO_MODE_OUT_PP_LOW_FAST); 23 | GPIO_WriteHigh(GPIOD, (GPIO_Pin_TypeDef)GPIO_PIN_0); 24 | 25 | } // SPL_setup() 26 | 27 | 28 | 29 | ////////// 30 | // SPL loop, called periodically by main() in main.c 31 | ////////// 32 | void SPL_loop() { 33 | 34 | // toogle LED 35 | GPIO_WriteReverse(GPIOD, (GPIO_Pin_TypeDef)GPIO_PIN_0); 36 | 37 | } // SPL_setup() 38 | 39 | 40 | 41 | ////////// 42 | // required by SPL. Just copy 43 | ////////// 44 | #ifdef USE_FULL_ASSERT 45 | void assert_failed(uint8_t* file, uint32_t line) { 46 | while (1); 47 | } 48 | #endif 49 | 50 | -------------------------------------------------------------------------------- /Projects/General_Examples/ADC_Measure/config.h: -------------------------------------------------------------------------------- 1 | /** 2 | \file config.h 3 | 4 | \author G. Icking-Konert 5 | \date 2013-11-22 6 | \version 0.1 7 | 8 | \brief project specific settings 9 | 10 | project specific configuration header file 11 | Select STM8 device and project options as required 12 | */ 13 | 14 | /*----------------------------------------------------------------------------- 15 | MODULE DEFINITION FOR MULTIPLE INCLUSION 16 | -----------------------------------------------------------------------------*/ 17 | #ifndef _CONFIG_H_ 18 | #define _CONFIG_H_ 19 | 20 | 21 | /*----------------------------------------------------------------------------- 22 | GENERAL PROJECT SETTINGS 23 | -----------------------------------------------------------------------------*/ 24 | 25 | /// alternatively select STM8 device directly. For supported devices see file "stm8as.h" 26 | #define STM8S105 // STM8S Discovery 27 | //#define STM8S208 // muBoard 28 | 29 | 30 | /*----------------------------------------------------------------------------- 31 | ADC2 SETTINGS 32 | -----------------------------------------------------------------------------*/ 33 | 34 | /// required for timekeeping (1ms interrupt) 35 | #define USE_TIM4_UPD_ISR 36 | 37 | /*----------------------------------------------------------------------------- 38 | END OF MODULE DEFINITION FOR MULTIPLE INLUSION 39 | -----------------------------------------------------------------------------*/ 40 | #endif // _CONFIG_H_ 41 | -------------------------------------------------------------------------------- /Projects/Libraries_Examples/LCD-BTHQ21605V/main.c: -------------------------------------------------------------------------------- 1 | /********************** 2 | Arduino-like project with setup() & loop(). 3 | Print current millis() to the LCD screen. 4 | **********************/ 5 | 6 | /*---------------------------------------------------------- 7 | INCLUDE FILES 8 | ----------------------------------------------------------*/ 9 | #include "main_general.h" // board-independent main 10 | #include "lcd-BTHQ21605V.h" 11 | 12 | 13 | /*---------------------------------------------------------- 14 | FUNCTIONS 15 | ----------------------------------------------------------*/ 16 | 17 | ////////// 18 | // user setup, called once after reset 19 | ////////// 20 | void setup() { 21 | 22 | // init I2C module 23 | i2c_init(); 24 | 25 | // init and reset LCD display 26 | BTHQ21605V_lcd_init(&PORT_E, 3); 27 | 28 | // print to LCD 29 | BTHQ21605V_lcd_print(1, 1, "hello user"); 30 | 31 | } // setup() 32 | 33 | 34 | 35 | ////////// 36 | // user loop, called continuously 37 | ////////// 38 | void loop() { 39 | 40 | char str[20]; // string buffer for LCD output 41 | 42 | // print to LCD 43 | sprintf(str, "time = %d s", (int) (millis()/1000L)); 44 | BTHQ21605V_lcd_print(2, 1, str); 45 | 46 | // wait 1s 47 | sw_delay(1000); 48 | 49 | } // loop 50 | 51 | /*----------------------------------------------------------------------------- 52 | END OF MODULE 53 | -----------------------------------------------------------------------------*/ 54 | -------------------------------------------------------------------------------- /Projects/STM8S_Discovery_Examples/Basic_Project/main.c: -------------------------------------------------------------------------------- 1 | /********************** 2 | Arduino-like project with setup() & loop(). Only 1ms interrupts 3 | are used, but no other optional features. Can be used as a 4 | starting point for simple Arduino-like STM8 projects. 5 | Functionality: 6 | - configure LED pin as output 7 | - poll SW clock and toggle LED every 500ms -> non-blocking 8 | **********************/ 9 | 10 | /*---------------------------------------------------------- 11 | INCLUDE FILES 12 | ----------------------------------------------------------*/ 13 | #include "main_general.h" // board-independent main 14 | 15 | 16 | /*---------------------------------------------------------- 17 | MACROS 18 | ----------------------------------------------------------*/ 19 | 20 | // define board LED pin on STM8S Discovery Board 21 | #define LED pinOutputReg(&PORT_D, pin0) 22 | 23 | 24 | /*---------------------------------------------------------- 25 | FUNCTIONS 26 | ----------------------------------------------------------*/ 27 | 28 | ////////// 29 | // user setup, called once after reset 30 | ////////// 31 | void setup() { 32 | 33 | // configure LED pin as output 34 | pinMode(&PORT_D, 0, OUTPUT); 35 | 36 | } // setup 37 | 38 | 39 | 40 | ////////// 41 | // user loop, called continuously 42 | ////////// 43 | void loop() { 44 | 45 | // toggle LED 46 | LED ^= 1; 47 | 48 | // wait 500ms 49 | delay(500); 50 | //delayMicroseconds(500000L); 51 | 52 | } // loop 53 | 54 | -------------------------------------------------------------------------------- /Library/Base/inc/beep.h: -------------------------------------------------------------------------------- 1 | /** 2 | \file beep.h 3 | 4 | \author G. Icking-Konert 5 | \date 2013-11-22 6 | \version 0.1 7 | 8 | \brief declaration of beeper control 9 | 10 | declaration of functions for beeper control to play tone. 11 | Note that the beeper has very basic functionality and coarse resolution. 12 | For flexible frequencies and/or duty cycle use timer PWM modules instead. 13 | */ 14 | 15 | /*----------------------------------------------------------------------------- 16 | MODULE DEFINITION FOR MULTIPLE INCLUSION 17 | -----------------------------------------------------------------------------*/ 18 | #ifndef _BEEP_H_ 19 | #define _BEEP_H_ 20 | 21 | #include 22 | 23 | 24 | /*----------------------------------------------------------------------------- 25 | DECLARATION OF GLOBAL MACROS 26 | -----------------------------------------------------------------------------*/ 27 | 28 | /// switch off tone 29 | #define noBeep() beep(0,0); 30 | 31 | 32 | /*----------------------------------------------------------------------------- 33 | DECLARATION OF GLOBAL FUNCTIONS 34 | -----------------------------------------------------------------------------*/ 35 | 36 | /// play tone via beeper module 37 | void beep(uint16_t freq, uint16_t duration); 38 | 39 | 40 | /*----------------------------------------------------------------------------- 41 | END OF MODULE DEFINITION FOR MULTIPLE INLUSION 42 | -----------------------------------------------------------------------------*/ 43 | #endif // _BEEP_H_ 44 | -------------------------------------------------------------------------------- /Library/Libraries/PetitFS_0.03/inc/pffdiskio.h: -------------------------------------------------------------------------------- 1 | /*----------------------------------------------------------------------- 2 | / PFF - Low level disk interface modlue include file (C)ChaN, 2014 3 | /-----------------------------------------------------------------------*/ 4 | 5 | #ifndef _DISKIO_DEFINED 6 | #define _DISKIO_DEFINED 7 | 8 | #ifdef __cplusplus 9 | extern "C" { 10 | #endif 11 | 12 | #include "pffinteger.h" 13 | 14 | 15 | /* Status of Disk Functions */ 16 | typedef BYTE DSTATUS; 17 | 18 | 19 | /* Results of Disk Functions */ 20 | typedef enum { 21 | RES_OK = 0, /* 0: Function succeeded */ 22 | RES_ERROR, /* 1: Disk error */ 23 | RES_NOTRDY, /* 2: Not ready */ 24 | RES_PARERR /* 3: Invalid parameter */ 25 | } DRESULT; 26 | 27 | 28 | /*---------------------------------------*/ 29 | /* Prototypes for disk control functions */ 30 | 31 | void pf_print_error(BYTE rc, BYTE halt); 32 | DSTATUS disk_initialize (void); 33 | DRESULT disk_readp (BYTE* buff, DWORD sector, UINT offser, UINT count); 34 | DRESULT disk_writep (const BYTE* buff, DWORD sc); 35 | 36 | #define STA_NOINIT 0x01 /* Drive not initialized */ 37 | #define STA_NODISK 0x02 /* No medium in the drive */ 38 | 39 | /* Card type flags (CardType) */ 40 | #define CT_MMC 0x01 /* MMC ver 3 */ 41 | #define CT_SD1 0x02 /* SD ver 1 */ 42 | #define CT_SD2 0x04 /* SD ver 2 */ 43 | #define CT_SDC (CT_SD1|CT_SD2) /* SD */ 44 | #define CT_BLOCK 0x08 /* Block addressing */ 45 | 46 | 47 | #ifdef __cplusplus 48 | } 49 | #endif 50 | 51 | #endif /* _DISKIO_DEFINED */ 52 | -------------------------------------------------------------------------------- /Projects/General_Examples/Minimal-C/main.c: -------------------------------------------------------------------------------- 1 | /********************** 2 | simple C-project without Arduino-like initialization and setup()/loop(). 3 | No assumption is made, no interrupts used. Can be used as starting point 4 | for projects with extreme memory limitations. 5 | Functionality: 6 | - init FCPU to 16MHz 7 | - configure pin as output 8 | - toggle pin every 500ms with delay (->blocking) 9 | **********************/ 10 | 11 | /*---------------------------------------------------------- 12 | INCLUDE FILES 13 | ----------------------------------------------------------*/ 14 | #include "stm8as.h" // STM8 peripheral registers 15 | #include "gpio.h" // pin access routines 16 | #include "sw_delay.h" // SW pause without timer 17 | 18 | // direct pin output register (not suitable for function parameters) 19 | #define LED pinOutputReg(&PORT_D, pin0) 20 | 21 | // main routine 22 | void main(void) { 23 | 24 | // switch to 16MHz (default is 2MHz) 25 | CLK.CKDIVR.byte = 0x00; 26 | 27 | // configure LED pin as output (STM8S Discovery Board) 28 | pinMode(&PORT_D, 0, OUTPUT); 29 | 30 | // main loop, toggle LED state 31 | while (1) { 32 | 33 | // manually high / low 34 | /* 35 | pinHigh(&PORT_D, 0); 36 | sw_delay(500); 37 | pinLow(&PORT_D, 0); 38 | */ 39 | 40 | // via pin toggle 41 | //pinToggle(&PORT_D, 0); 42 | 43 | // via direct pin access 44 | LED ^= 0x01; 45 | 46 | // wait a bit 47 | sw_delay(500); 48 | 49 | } // main loop 50 | 51 | } // main 52 | 53 | -------------------------------------------------------------------------------- /Projects/General_Examples/Trap_Interrupt/main.c: -------------------------------------------------------------------------------- 1 | /********************** 2 | Arduino-like project with setup() & loop(). 3 | Trigger TRAP interrupt by software. 4 | Functionality: 5 | - configure pin as input pull-up 6 | - on pin=low, trigger TRAP_ISR 7 | **********************/ 8 | 9 | /*---------------------------------------------------------- 10 | INCLUDE FILES 11 | ----------------------------------------------------------*/ 12 | #include "main_general.h" // board-independent main 13 | 14 | 15 | /*---------------------------------------------------------- 16 | FUNCTIONS 17 | ----------------------------------------------------------*/ 18 | 19 | ////////// 20 | // toggle LED 21 | ////////// 22 | ISR_HANDLER_TRAP(TRAP_ISR) { 23 | 24 | // toggle LED state 25 | pinToggle(&PORT_H, 2); 26 | 27 | // wait a while for debouncing 28 | sw_delay(50); 29 | 30 | } // TRAP_ISR 31 | 32 | 33 | 34 | ////////// 35 | // user setup, called once after reset 36 | ////////// 37 | void setup() { 38 | 39 | // configure button pin PE5 as input pull-up with interrupt 40 | pinMode(&PORT_E, 5, INPUT_PULLUP); 41 | 42 | // configure LED pin as output 43 | pinMode(&PORT_H, 2, OUTPUT); 44 | pinMode(&PORT_H, 3, OUTPUT); 45 | 46 | } // setup 47 | 48 | 49 | 50 | ////////// 51 | // user loop, called continuously 52 | ////////// 53 | void loop() { 54 | 55 | uint8_t s = pinRead(&PORT_E, 5); 56 | 57 | pinSet(&PORT_H, 3, s); 58 | 59 | // if PE5 is low, trigger trap 60 | if (s == 0) 61 | trap(); 62 | 63 | } // loop 64 | 65 | -------------------------------------------------------------------------------- /Projects/README.md: -------------------------------------------------------------------------------- 1 | back to [Wiki](https://github.com/gicking/STM8_templates/wiki) 2 | 3 | 4 | STM8 Example Projects 5 | ================================= 6 | 7 | Loose collection of STM8 projects for SDCC or Cosmic compilers. These can be used as starting point for own projects. If you have implemented an interesting STM8 project, please consider contributing it to this repository. Thanks in advance! 8 | 9 | 10 | [General Examples](General_Examples) 11 | ---------------------------------- 12 | Generic, board independent STM8 projects routines and macros. 13 | 14 | 15 | [Libraries Examples](Libraries_Examples) 16 | ---------------------------------- 17 | Example projects for external libraries and libs to control STM8 external peripherals, e.g. LCD. 18 | 19 | 20 | [STM8S Discovery Examples](STM8S_Discovery_Examples) 21 | ---------------------------------- 22 | Some [STM8S Discovery Examples](http://www.st.com/en/evaluation-tools/stm8s-discovery.html) board specific projects. 23 | 24 | 25 | [STM8L Discovery Examples](STM8L_Discovery_Examples) 26 | ---------------------------------- 27 | Some [STM8L Discovery Examples](http://www.st.com/en/evaluation-tools/stm8l-discovery.html) board specific projects. 28 | 29 | 30 | [muBoard Examples](muBoard_Examples) 31 | ---------------------------------- 32 | Some [muBoard](https://frosch.piandmore.de//de/pam9/call/public-media/event_media/160611_Vortrag_Interpreter.pdf) specific routines and macros. This board was developed for IC validation and testing at [Robert Bosch GmbH](http://www.bosch.com). 33 | 34 | 35 | back to [Wiki](https://github.com/gicking/STM8_templates/wiki) 36 | 37 | -------------------------------------------------------------------------------- /Library/muBoard/inc/mub_error_codes.h: -------------------------------------------------------------------------------- 1 | /** 2 | \file mub_error_codes.h 3 | 4 | \author G. Icking-Konert 5 | \date 2017-02-11 6 | \version 0.1 7 | \copyright MIT License (MIT) 8 | 9 | \brief declaration of muBoard error codes 10 | 11 | declaration of common muBoard error codes for debugging 12 | */ 13 | 14 | /*----------------------------------------------------------------------------- 15 | MODULE DEFINITION FOR MULTIPLE INCLUSION 16 | -----------------------------------------------------------------------------*/ 17 | #ifndef _ERROR_CODES_H_ 18 | #define _ERROR_CODES_H_ 19 | 20 | 21 | /*----------------------------------------------------------------------------- 22 | DEFINITION OF GLOBAL MACROS/#DEFINES 23 | -----------------------------------------------------------------------------*/ 24 | 25 | // error codes 26 | #define SUCCESS 0 // no error 27 | #define ERROR_TIMOUT 1 // timeout 28 | #define ERROR_COMM 2 // communication error 29 | #define ERROR_RANGE 3 // out of range error 30 | #define ERROR_ILLPRM 5 // illegal parameter error 31 | #define ERROR_CHK 6 // checksum error 32 | #define ERROR_FLASH 7 // flash error (e.g. during write) 33 | #define ERROR_MISC 255 // misc error and muCom indicator for error (precedes actual error code) 34 | 35 | 36 | /*----------------------------------------------------------------------------- 37 | END OF MODULE DEFINITION FOR MULTIPLE INLUSION 38 | -----------------------------------------------------------------------------*/ 39 | #endif // _ERROR_CODES_H_ 40 | -------------------------------------------------------------------------------- /Library/muBoard/inc/mub_diffAmp.h: -------------------------------------------------------------------------------- 1 | /** 2 | \file mub_diffAmp.h 3 | 4 | \author G. Icking-Konert 5 | \date 2018-01-28 6 | \version 0.1 7 | 8 | \brief declaration of function to control the differential amplifier 9 | 10 | declaration of function to control the differential amplifier via I2C. Type 11 | OPAMP LM2904 (Farnell 2450774) with feedback via digital poti AD5282BRUZ200 (Farnell 1438442). 12 | Connect SCL/SDA of digital poti and of STM8 13 | */ 14 | 15 | /*----------------------------------------------------------------------------- 16 | MODULE DEFINITION FOR MULTIPLE INCLUSION 17 | -----------------------------------------------------------------------------*/ 18 | #ifndef _MUB_DIFFAMP_ 19 | #define _MUB_DIFFAMP_ 20 | 21 | 22 | /*----------------------------------------------------------------------------- 23 | INCLUDE FILES 24 | -----------------------------------------------------------------------------*/ 25 | #include 26 | #include "config.h" 27 | #include "stm8as.h" 28 | #include "misc.h" 29 | #include "digPoti-AD5282.h" 30 | 31 | 32 | /*----------------------------------------------------------------------------- 33 | DECLARATION OF GLOBAL FUNCTIONS 34 | -----------------------------------------------------------------------------*/ 35 | 36 | /// differential amplifier control 37 | uint8_t set_diff_amplifier(uint8_t gain); 38 | 39 | 40 | /*----------------------------------------------------------------------------- 41 | END OF MODULE DEFINITION FOR MULTIPLE INLUSION 42 | -----------------------------------------------------------------------------*/ 43 | #endif // _MUB_DIFFAMP_ 44 | -------------------------------------------------------------------------------- /Projects/General_Examples/ADC_Continuous_with_ISR/config.h: -------------------------------------------------------------------------------- 1 | /** 2 | \file config.h 3 | 4 | \author G. Icking-Konert 5 | \date 2013-11-22 6 | \version 0.1 7 | 8 | \brief project specific settings 9 | 10 | project specific configuration header file 11 | Select STM8 device and project options as required 12 | */ 13 | 14 | /*----------------------------------------------------------------------------- 15 | MODULE DEFINITION FOR MULTIPLE INCLUSION 16 | -----------------------------------------------------------------------------*/ 17 | #ifndef _CONFIG_H_ 18 | #define _CONFIG_H_ 19 | 20 | 21 | /*----------------------------------------------------------------------------- 22 | GENERAL PROJECT SETTINGS 23 | -----------------------------------------------------------------------------*/ 24 | 25 | // select board to set STM8 family, memory size etc. 26 | //#include "muBoard_config.h" 27 | 28 | /// alternatively select STM8 device directly. For supported devices see file "stm8as.h" 29 | #define STM8S208 // muBoard 30 | 31 | 32 | /*----------------------------------------------------------------------------- 33 | ADC2 SETTINGS 34 | -----------------------------------------------------------------------------*/ 35 | 36 | /// required for timekeeping (1ms interrupt) 37 | #define USE_TIM4_UPD_ISR 38 | 39 | /// use ADC2 end-of-conversion interrupt 40 | #define USE_ADC_ISR 41 | 42 | /*----------------------------------------------------------------------------- 43 | END OF MODULE DEFINITION FOR MULTIPLE INLUSION 44 | -----------------------------------------------------------------------------*/ 45 | #endif // _CONFIG_H_ 46 | -------------------------------------------------------------------------------- /Projects/Libraries_Examples/README.md: -------------------------------------------------------------------------------- 1 | back to [Wiki](https://github.com/gicking/STM8_templates/wiki) 2 | 3 | 4 | Libraries Examples 5 | ================= 6 | 7 | This folder contains examples for the external libraries and routines to control external circuits. 8 | The functionality is (loosely) unsorted. 9 | 10 | LCD-BTHQ21605V: 11 | ---------- 12 | Arduino-like project with setup() & loop(). 13 | Print current millis() to the LCD screen. 14 | 15 | 16 | DigPoti-AD5280 17 | ---------- 18 | Arduino-like project with setup() & loop(). 19 | Ramp up resistance of 1-channel poti AD5280 via I2C. 20 | 21 | 22 | DigPoti-AD5282 23 | ---------- 24 | Arduino-like project with setup() & loop(). 25 | Ramp up/down resistances of 2-channel poti AD5282 via I2C. 26 | 27 | 28 | SD-card_petitFS 29 | ---------- 30 | Arduino-like project with setup() & loop(). 31 | Read & write to SD card via [PetitFS](http://elm-chan.org/fsw/ff/00index_p.html) 32 | and bitbanging -> slow (meas. 27kB/s), but requires no dedicated SPI. 33 | Notes: 34 | - SD cards generally use 3.3V -> check schematics 35 | - PetitFS can only change file content, not create or extend. For this use FatFS 36 | - pin macros are required in `config.h` 37 | 38 | 39 | SD-card_fatFS 40 | ---------- 41 | Arduino-like project with setup() & loop(). 42 | Read & write to SD card via [FatFS](http://www.elm-chan.org/fsw/ff/00index_e.html) 43 | and bitbanging -> slow (meas. 27kB/s), but requires no dedicated SPI. 44 | Notes: 45 | - SD cards generally use 3.3V -> check schematics 46 | - pin macros are required in `config.h` 47 | 48 | 49 | back to [Wiki](https://github.com/gicking/STM8_templates/wiki) 50 | 51 | -------------------------------------------------------------------------------- /Projects/muBoard_Examples/LCD-display_I2C/main.c: -------------------------------------------------------------------------------- 1 | /********************** 2 | Arduino-like project with setup() & loop(). 3 | Periodically print text to 2x16 char LCD attached to I2C (muBoard) 4 | Used display: Batron BTHQ21605V-COG-FSRE-I2C 2X16 (Farnell 1220409) 5 | connected via I2C pins PE1/SCL, PE2/SDA, and GPIO PE3 for LCD reset (see i2c_lcd.c) 6 | Functionality: 7 | - initialize I2C bus 8 | - initialize and reset LCD display 9 | - periodically print time to LCD 10 | **********************/ 11 | 12 | /*---------------------------------------------------------- 13 | INCLUDE FILES 14 | ----------------------------------------------------------*/ 15 | #include "main_muBoard.h" // board-independent main 16 | 17 | 18 | /*---------------------------------------------------------- 19 | FUNCTIONS 20 | ----------------------------------------------------------*/ 21 | 22 | ////////// 23 | // user setup, called once after reset 24 | ////////// 25 | void setup() { 26 | 27 | // print to LCD 28 | lcd_print(1, 1, "hello user..."); 29 | delay(1000); 30 | 31 | } // setup 32 | 33 | 34 | 35 | ////////// 36 | // user loop, called continuously 37 | ////////// 38 | void loop() { 39 | 40 | char str[20]; // string buffer for LCD output 41 | 42 | // print to LCD 43 | sprintf(str, "time = %d s", (int) (millis()/1000L)); 44 | lcd_print(2, 1, str); 45 | 46 | // wait 1s 47 | sw_delay(1000); 48 | 49 | } // loop 50 | 51 | /*----------------------------------------------------------------------------- 52 | END OF MODULE 53 | -----------------------------------------------------------------------------*/ 54 | -------------------------------------------------------------------------------- /Projects/muBoard_Examples/digital-poti_I2C/main.c: -------------------------------------------------------------------------------- 1 | /********************** 2 | Arduino-like project with setup() & loop(). 3 | Periodically ramp potentiometer resistance via I2C. 4 | Used 20kR potentiometer: Analog Devices AD5280BRUZ20 (Farnell 1438441). 5 | **********************/ 6 | 7 | /*---------------------------------------------------------- 8 | INCLUDE FILES 9 | ----------------------------------------------------------*/ 10 | #include "main_muBoard.h" // board-independent main 11 | #include "uart1.h" // UART1 communication 12 | #include "putchar.h" // for printf() 13 | 14 | 15 | /*---------------------------------------------------------- 16 | FUNCTIONS 17 | ----------------------------------------------------------*/ 18 | 19 | ////////// 20 | // user setup, called once after reset 21 | ////////// 22 | void setup() { 23 | 24 | // nothing to do, initialization is done in main() 25 | 26 | } // setup 27 | 28 | 29 | 30 | ////////// 31 | // user loop, called continuously 32 | ////////// 33 | void loop() { 34 | 35 | static uint8_t res = 0; // resistance in [20kR/255] 36 | uint8_t err; // I2C status response 37 | 38 | // set new resistance 39 | err = set_dig_poti(res); 40 | 41 | // print to terminal 42 | printf("%d Ohm, err=%d\n", (int) (((long) res * 20000L) >> 8), (int) err); 43 | 44 | // wait a bit 45 | sw_delay(1000); 46 | 47 | // set new value 48 | res += 8; 49 | 50 | } // loop 51 | 52 | /*----------------------------------------------------------------------------- 53 | END OF MODULE 54 | -----------------------------------------------------------------------------*/ 55 | -------------------------------------------------------------------------------- /Projects/STM8_StdPeriphLib_Examples/Minimal-C/SPL.c: -------------------------------------------------------------------------------- 1 | /********************** 2 | Interface functions between STM8_templates and STM8 Standard Peripheral Library 3 | (SDCC patch available from https://github.com/gicking/STM8-SPL_SDCC_patch). 4 | Is required because the different device headers from STM8_templates 5 | and SPL are incompatible. 6 | Advantage is transparent mixing of STM8_templates (simple) with STM8 7 | SPL library (powerful) and examples by STM. 8 | **********************/ 9 | 10 | /*---------------------------------------------------------- 11 | INCLUDE FILES 12 | ----------------------------------------------------------*/ 13 | #include "stm8s_conf.h" // set required SPL modules only in this header 14 | 15 | 16 | ////////// 17 | // init peripherals using SPL 18 | ////////// 19 | void SPL_init() { 20 | 21 | // SPL: switch to 16MHz (default is 2MHz) 22 | CLK_HSIPrescalerConfig(CLK_PRESCALER_HSIDIV1); 23 | 24 | // SPL: configure STM8S Discovery Board LED pin as output 25 | GPIO_Init(GPIOD, (GPIO_Pin_TypeDef)GPIO_PIN_0, GPIO_MODE_OUT_PP_LOW_FAST); 26 | GPIO_WriteHigh(GPIOD, (GPIO_Pin_TypeDef)GPIO_PIN_0); 27 | 28 | } // SPL_init() 29 | 30 | 31 | 32 | ////////// 33 | // set GPIO state using SPL 34 | ////////// 35 | void SPL_setPin(uint8_t state) { 36 | 37 | // SPL: set new pin state 38 | if (state) 39 | GPIO_WriteHigh(GPIOD, (GPIO_Pin_TypeDef)GPIO_PIN_0); 40 | else 41 | GPIO_WriteLow(GPIOD, (GPIO_Pin_TypeDef)GPIO_PIN_0); 42 | 43 | } // SPL_setPin() 44 | 45 | 46 | 47 | ////////// 48 | // required by SPL. Just copy 49 | ////////// 50 | #ifdef USE_FULL_ASSERT 51 | void assert_failed(uint8_t* file, uint32_t line) { 52 | while (1); 53 | } 54 | #endif 55 | 56 | -------------------------------------------------------------------------------- /Library/Libraries/PetitFS_0.03/doc/pf/dinit.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Petit FatFs - disk_initialize 10 | 11 | 12 | 13 | 14 |
15 |

disk_initialize

16 |

The disk_initialize function initializes the disk drive.

17 |
18 | DSTATUS disk_initialize (void)
19 | 
20 |
21 | 22 |
23 |

Return Values

24 |

The disk status is returned in combination of following flags.

25 |
26 |
STA_NOINIT
27 |
Indicates that the disk drive has not been initialized. This flag is set on: system reset, disk removal and disk_initialize function failed, and cleared on: disk_initialize function succeeded.
28 |
STA_NODISK
29 |
Indicates that no medium in the drive. This is always cleared on fixed disk drive. This flag is not referred by Petit FatFs.
30 |
31 |
32 | 33 |
34 |

Description

35 |

The disk_initialize function initializes the storage device. If the function succeeded, STA_NOINIT flag in the return value is cleared.

36 |
37 | 38 |

Return

39 | 40 | 41 | -------------------------------------------------------------------------------- /Projects/General_Examples/Pin_Read_Write/main.c: -------------------------------------------------------------------------------- 1 | /********************** 2 | Arduino-like project with setup() & loop(). Mirror switch 3 | input state to LED (i.e. pin read and write) 4 | Functionality: 5 | - configure pin as input with pull-up 6 | - configure other pin as output 7 | - mirror input to output 8 | **********************/ 9 | 10 | /*---------------------------------------------------------- 11 | INCLUDE FILES 12 | ----------------------------------------------------------*/ 13 | #include "main_general.h" // board-independent main 14 | 15 | // access button(=PE5=io_1) and LED(=PH3) pins. See gpio.h 16 | #define BUTTON pinInputReg(&PORT_E, pin5) 17 | #define LED pinOutputReg(&PORT_H, pin3) 18 | 19 | 20 | /*---------------------------------------------------------- 21 | MACROS 22 | ----------------------------------------------------------*/ 23 | 24 | /*---------------------------------------------------------- 25 | FUNCTIONS 26 | ----------------------------------------------------------*/ 27 | 28 | ////////// 29 | // user setup, called once after reset 30 | ////////// 31 | void setup() { 32 | 33 | // configure PE5 (=io_1 on muBoard) as input with pull-up 34 | pinMode(&PORT_E, 5, INPUT_PULLUP); 35 | 36 | // configure PH3 (=red LED on muBoard) as output 37 | pinMode(&PORT_H, 3, OUTPUT); 38 | 39 | } // setup 40 | 41 | 42 | 43 | ////////// 44 | // user loop, called continuously 45 | ////////// 46 | void loop() { 47 | 48 | // mirror pin PE5 to pin PH3 49 | pinSet(&PORT_H,3, pinRead(&PORT_E, 5)); // via "normal" functions 50 | //LED = BUTTON; // via direct (bitwise) access 51 | 52 | } // loop 53 | 54 | -------------------------------------------------------------------------------- /Projects/STM8_StdPeriphLib_Examples/Minimal-C/main.c: -------------------------------------------------------------------------------- 1 | /********************** 2 | simple C-project without Arduino-like initialization and with calls to the 3 | STM8 Standard Peripheral Library (SPL) 4 | (SDCC patch available from https://github.com/gicking/STM8-SPL_SDCC_patch) 5 | No further assumption is made, no interrupts are used. 6 | Can be used as starting point for SPL projects with extreme memory limitations. 7 | Note that device headers from STM8_templates and SPL are incompatible -> 8 | need to create separate SPL.c file in project folder and use interface 9 | functions (here simply 'SPL_init()' and 'SPL_setPin()'). 10 | Advantage is transparent mixing of STM8_templates (simple) with STM8 11 | SPL library (powerful) and examples by STM. 12 | Functionality: 13 | - init FCPU to 16MHz 14 | - configure pin as output 15 | - toggle pin every 500ms w/o timer -> blocking 16 | **********************/ 17 | 18 | /*---------------------------------------------------------- 19 | INCLUDE FILES 20 | ----------------------------------------------------------*/ 21 | #include "stm8as.h" // STM8 peripheral registers 22 | #include "sw_delay.h" // dummy pause without timer 23 | 24 | // interface functions for SPL calls. Here simply setup/loop 25 | void SPL_init(void); 26 | void SPL_setPin(uint8_t state); 27 | 28 | 29 | // main routine 30 | void main(void) { 31 | 32 | uint8_t state = 0; 33 | 34 | // init peripherals using SPL 35 | SPL_init(); 36 | 37 | // main loop 38 | while (1) { 39 | 40 | // toggle LED 41 | SPL_setPin(state); 42 | state = ~state; 43 | 44 | // wait some time 45 | sw_delay(300); 46 | 47 | } // main loop 48 | 49 | } // main 50 | 51 | -------------------------------------------------------------------------------- /Library/Base/inc/shift.h: -------------------------------------------------------------------------------- 1 | /** 2 | \file shift.h 3 | 4 | \author G. Icking-Konert 5 | \date 2018-01-25 6 | \version 0.1 7 | 8 | \brief declaration of shiftIn() and shiftOut() 9 | 10 | declaration of synchronous data transmit (shiftOut) and receive (shiftIn) 11 | software implementations. 12 | */ 13 | 14 | /*----------------------------------------------------------------------------- 15 | MODULE DEFINITION FOR MULTIPLE INCLUSION 16 | -----------------------------------------------------------------------------*/ 17 | #ifndef _SHIFT_H_ 18 | #define _SHIFT_H_ 19 | 20 | /*----------------------------------------------------------------------------- 21 | INCLUDE FILES 22 | -----------------------------------------------------------------------------*/ 23 | #include "stm8as.h" 24 | #include "config.h" 25 | #include "gpio.h" 26 | 27 | 28 | /*----------------------------------------------------------------------------- 29 | DECLARATION OF GLOBAL FUNCTIONS 30 | -----------------------------------------------------------------------------*/ 31 | 32 | /// synchronous data transmit via software (master mode) 33 | void shiftOut(PORT_t *pPortData, uint8_t pinData, PORT_t *pPortClock, uint8_t pinClock, uint16_t clockWidth, uint8_t bitOrder, uint8_t data); 34 | 35 | /// synchronous data receive via software (master mode) 36 | uint8_t shiftIn(PORT_t *pPortData, uint8_t pinData, PORT_t *pPortClock, uint8_t pinClock, uint16_t clockWidth, uint8_t bitOrder); 37 | 38 | /*----------------------------------------------------------------------------- 39 | END OF MODULE DEFINITION FOR MULTIPLE INLUSION 40 | -----------------------------------------------------------------------------*/ 41 | #endif // _SHIFT_H_ 42 | -------------------------------------------------------------------------------- /Projects/General_Examples/mirror_two_UARTs/main.c: -------------------------------------------------------------------------------- 1 | /********************** 2 | Arduino-like project with setup() & loop(). 3 | Mirror bytes received via UART1 to UART3 and vice 4 | versa with polling. 5 | Functionality: 6 | - configure UART1 to 115.2kBaud 7 | - configure UART3 to 19.2kBaud 8 | - poll if byte was received via UART1 or UART3 9 | - if byte received, mirror to other UART 10 | **********************/ 11 | 12 | /*---------------------------------------------------------- 13 | INCLUDE FILES 14 | ----------------------------------------------------------*/ 15 | #include "main_general.h" // board-independent main 16 | #include "uart1.h" // UART1 communication 17 | #include "uart3.h" // UART3 communication 18 | 19 | 20 | /*---------------------------------------------------------- 21 | FUNCTIONS 22 | ----------------------------------------------------------*/ 23 | 24 | ////////// 25 | // user setup, called once after reset 26 | ////////// 27 | void setup() { 28 | 29 | // init UART1 to 115.2kBaud and UART3 to 19.2kBaud 30 | UART1_begin(115200); 31 | UART3_begin(19200); 32 | 33 | } // setup 34 | 35 | 36 | 37 | ////////// 38 | // user loop, called continuously 39 | ////////// 40 | void loop() { 41 | 42 | // if character received via UART1, mirror it to UART3 43 | if (UART1_available()) 44 | UART3_write(UART1_read()); 45 | 46 | // if character received via UART3, mirror it to UART1 47 | if (UART3_available()) 48 | UART1_write(UART3_read()); 49 | 50 | } // loop 51 | 52 | /*----------------------------------------------------------------------------- 53 | END OF MODULE 54 | -----------------------------------------------------------------------------*/ 55 | -------------------------------------------------------------------------------- /Library/Base/inc/power-saving.h: -------------------------------------------------------------------------------- 1 | /** 2 | \file power-saving.h 3 | 4 | \author G. Icking-Konert 5 | \date 2018-01-20 6 | \version 0.1 7 | 8 | \brief declaration of functions/macros for low-power modes 9 | 10 | declaration of functions/macros for low-power modes 11 | Optional functionality via #define: 12 | - see ISR of respective wake peripheral! 13 | */ 14 | 15 | /*----------------------------------------------------------------------------- 16 | MODULE DEFINITION FOR MULTIPLE INCLUSION 17 | -----------------------------------------------------------------------------*/ 18 | #ifndef _POWER_SAVING_H_ 19 | #define _POWER_SAVING_H_ 20 | 21 | /*----------------------------------------------------------------------------- 22 | INCLUDE FILES 23 | -----------------------------------------------------------------------------*/ 24 | 25 | #include 26 | #include "stm8as.h" 27 | #include "config.h" 28 | #include "awu.h" 29 | 30 | 31 | /*----------------------------------------------------------------------------- 32 | DECLARATION OF GLOBAL FUNCTIONS 33 | -----------------------------------------------------------------------------*/ 34 | 35 | /// enter WAIT mode: only stop CPU, wake via any interrupt 36 | void lowPower_Wait(void); 37 | 38 | /// enter HALT mode: all clocks off, wake only via EXINT 39 | void lowPower_Halt(void); 40 | 41 | /// enter active HALT mode: only LSI active, wake via AWU or EXINT 42 | void lowPower_HaltAWU(uint16_t ms); 43 | 44 | 45 | /*----------------------------------------------------------------------------- 46 | END OF MODULE DEFINITION FOR MULTIPLE INLUSION 47 | -----------------------------------------------------------------------------*/ 48 | #endif // _POWER_SAVING_H_ 49 | -------------------------------------------------------------------------------- /Projects/General_Examples/Beeper/main.c: -------------------------------------------------------------------------------- 1 | /********************** 2 | Arduino-like project with setup() & loop(). 3 | Demonstrate tone output via beeper module. 4 | Beeper requires option byte AFR7=1 for alternate usage of BEEP pin 5 | Functionality: 6 | - assert option byte setting for beeper output 7 | - play tones with different pitch 8 | Note: the beeper module is VERY basic. For flexible tones use timer instead 9 | **********************/ 10 | 11 | /*---------------------------------------------------------- 12 | INCLUDE FILES 13 | ----------------------------------------------------------*/ 14 | #include "main_general.h" // board-independent main 15 | #include "eeprom.h" 16 | #include "beep.h" 17 | 18 | 19 | /*---------------------------------------------------------- 20 | MACROS 21 | ----------------------------------------------------------*/ 22 | 23 | /*---------------------------------------------------------- 24 | FUNCTIONS 25 | ----------------------------------------------------------*/ 26 | 27 | ////////// 28 | // user setup, called once after reset 29 | ////////// 30 | void setup() { 31 | 32 | // assert option byte for using PD4 for beeper. See STM8 UM for details 33 | uint8_t flagChanged = 0; 34 | flagChanged += OPT_writeByte(OPT2, 0x80); 35 | flagChanged += OPT_writeByte(NOPT2, 0x7F); 36 | 37 | // if changed, trigger reset 38 | if (flagChanged) 39 | SW_RESET; 40 | 41 | } // setup 42 | 43 | 44 | 45 | ////////// 46 | // user loop, called continuously 47 | ////////// 48 | void loop() { 49 | 50 | uint16_t freq; 51 | 52 | for (freq=500; freq<=4000; freq+=100) { 53 | beep(freq,0); 54 | sw_delay(75); 55 | } 56 | noBeep(); 57 | sw_delay(1500); 58 | 59 | } // loop 60 | 61 | -------------------------------------------------------------------------------- /Library/Base/inc/getchar.h: -------------------------------------------------------------------------------- 1 | /** 2 | \file getchar.h 3 | 4 | \author G. Icking-Konert 5 | \date 2017-04-15 6 | \version 0.1 7 | 8 | \brief declaration of getchar() function for gets() 9 | 10 | declaration of getchar() function required for stdio.h 11 | functions, e.g. gets(). 12 | */ 13 | 14 | /*----------------------------------------------------------------------------- 15 | MODULE DEFINITION FOR MULTIPLE INCLUSION 16 | -----------------------------------------------------------------------------*/ 17 | #ifndef _CUSTOM_GETCHAR_H_ 18 | #define _CUSTOM_GETCHAR_H_ 19 | 20 | /*----------------------------------------------------------------------------- 21 | INCLUDE FILES 22 | -----------------------------------------------------------------------------*/ 23 | #include "stm8as.h" 24 | #include "config.h" 25 | 26 | 27 | /*----------------------------------------------------------------------------- 28 | DECLARATION OF GLOBAL MACROS 29 | -----------------------------------------------------------------------------*/ 30 | 31 | /// detach receive function 32 | #define getcharDetach() getcharAttach(getchar_Default) 33 | 34 | 35 | /*----------------------------------------------------------------------------- 36 | DECLARATION OF GLOBAL FUNCTIONS 37 | -----------------------------------------------------------------------------*/ 38 | 39 | /// dummy getchar() receive function 40 | uint8_t getchar_Default(void); 41 | 42 | /// set getchar() receive function 43 | void getcharAttach(uint8_t (*pFct)(void)); 44 | 45 | /*----------------------------------------------------------------------------- 46 | END OF MODULE 47 | -----------------------------------------------------------------------------*/ 48 | #endif // _CUSTOM_GETCHAR_H_ 49 | -------------------------------------------------------------------------------- /Library/Base/inc/putchar.h: -------------------------------------------------------------------------------- 1 | /** 2 | \file putchar.h 3 | 4 | \author G. Icking-Konert 5 | \date 2015-04-09 6 | \version 0.1 7 | 8 | \brief declaration of putchar() function for printf() 9 | 10 | declaration of putchar() function required for stdio.h 11 | functions, e.g. printf(). 12 | */ 13 | 14 | /*----------------------------------------------------------------------------- 15 | MODULE DEFINITION FOR MULTIPLE INCLUSION 16 | -----------------------------------------------------------------------------*/ 17 | #ifndef _CUSTOM_PUTCHAR_H_ 18 | #define _CUSTOM_PUTCHAR_H_ 19 | 20 | /*----------------------------------------------------------------------------- 21 | INCLUDE FILES 22 | -----------------------------------------------------------------------------*/ 23 | #include "stm8as.h" 24 | #include "config.h" 25 | 26 | 27 | /*----------------------------------------------------------------------------- 28 | DECLARATION OF GLOBAL MACROS 29 | -----------------------------------------------------------------------------*/ 30 | 31 | /// detach send function 32 | #define putcharDetach() putcharAttach(putchar_Default) 33 | 34 | 35 | /*----------------------------------------------------------------------------- 36 | DECLARATION OF GLOBAL FUNCTIONS 37 | -----------------------------------------------------------------------------*/ 38 | 39 | /// dummy putchar() send function 40 | void putchar_Default(uint8_t data); 41 | 42 | /// set putchar() send function 43 | void putcharAttach(void (*pFct)(uint8_t)); 44 | 45 | /*----------------------------------------------------------------------------- 46 | END OF MODULE 47 | -----------------------------------------------------------------------------*/ 48 | #endif // _CUSTOM_PUTCHAR_H_ 49 | -------------------------------------------------------------------------------- /Projects/General_Examples/Beeper/clean.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | ############# 4 | # clean up project outputs and temporary files 5 | ############# 6 | 7 | # required modules 8 | import os 9 | 10 | 11 | ################## 12 | # helper functions 13 | ################## 14 | 15 | ######### 16 | def removeFolder(foldername): 17 | """ 18 | delete folder and content 19 | """ 20 | 21 | #if folder exists 22 | if os.path.exists(foldername): 23 | # recursively remove files in folder 24 | for root, dirs, files in os.walk(foldername, topdown=False): 25 | for name in files: 26 | os.remove(os.path.join(root, name)) 27 | for name in dirs: 28 | os.rmdir(os.path.join(root, name)) 29 | 30 | # delete folder itself 31 | os.rmdir(foldername) 32 | # end removeFolder() 33 | 34 | 35 | ######### 36 | def removeFile(path=os.curdir, pattern='XYX'): 37 | """ 38 | delete file ending with pattern 39 | """ 40 | if os.path.exists(path): 41 | for filename in os.listdir(path): 42 | if filename.endswith(pattern): 43 | os.remove(os.path.join(path, filename)) 44 | #print(filename) 45 | # end removeFile() 46 | 47 | 48 | 49 | ################## 50 | # main program 51 | ################## 52 | 53 | removeFile('.','Makefile') 54 | removeFile('.','.DS_Store') 55 | removeFile('./STVD_Cosmic','.DS_Store') 56 | removeFile('.','*.TMP') 57 | removeFile('./STVD_Cosmic','.TMP') 58 | removeFile('./STVD_Cosmic','.spy') 59 | #removeFile('./STVD_Cosmic','.dep') 60 | removeFile('./STVD_Cosmic','.pdb') 61 | removeFile('./STVD_Cosmic','.wdb') 62 | #removeFile('./STVD_Cosmic','.wed') 63 | removeFolder('./-p') 64 | removeFolder('./output') 65 | removeFolder('./STVD_Cosmic/Release') 66 | removeFolder('./STVD_Cosmic/Debug') 67 | 68 | # END OF MODULE 69 | 70 | -------------------------------------------------------------------------------- /Projects/General_Examples/Dhrystone/clean.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | ############# 4 | # clean up project outputs and temporary files 5 | ############# 6 | 7 | # required modules 8 | import os 9 | 10 | 11 | ################## 12 | # helper functions 13 | ################## 14 | 15 | ######### 16 | def removeFolder(foldername): 17 | """ 18 | delete folder and content 19 | """ 20 | 21 | #if folder exists 22 | if os.path.exists(foldername): 23 | # recursively remove files in folder 24 | for root, dirs, files in os.walk(foldername, topdown=False): 25 | for name in files: 26 | os.remove(os.path.join(root, name)) 27 | for name in dirs: 28 | os.rmdir(os.path.join(root, name)) 29 | 30 | # delete folder itself 31 | os.rmdir(foldername) 32 | # end removeFolder() 33 | 34 | 35 | ######### 36 | def removeFile(path=os.curdir, pattern='XYX'): 37 | """ 38 | delete file ending with pattern 39 | """ 40 | if os.path.exists(path): 41 | for filename in os.listdir(path): 42 | if filename.endswith(pattern): 43 | os.remove(os.path.join(path, filename)) 44 | #print(filename) 45 | # end removeFile() 46 | 47 | 48 | 49 | ################## 50 | # main program 51 | ################## 52 | 53 | removeFile('.','Makefile') 54 | removeFile('.','.DS_Store') 55 | removeFile('./STVD_Cosmic','.DS_Store') 56 | removeFile('.','*.TMP') 57 | removeFile('./STVD_Cosmic','.TMP') 58 | removeFile('./STVD_Cosmic','.spy') 59 | #removeFile('./STVD_Cosmic','.dep') 60 | removeFile('./STVD_Cosmic','.pdb') 61 | removeFile('./STVD_Cosmic','.wdb') 62 | #removeFile('./STVD_Cosmic','.wed') 63 | removeFolder('./-p') 64 | removeFolder('./output') 65 | removeFolder('./STVD_Cosmic/Release') 66 | removeFolder('./STVD_Cosmic/Debug') 67 | 68 | # END OF MODULE 69 | 70 | -------------------------------------------------------------------------------- /Projects/General_Examples/I2C_read/clean.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | ############# 4 | # clean up project outputs and temporary files 5 | ############# 6 | 7 | # required modules 8 | import os 9 | 10 | 11 | ################## 12 | # helper functions 13 | ################## 14 | 15 | ######### 16 | def removeFolder(foldername): 17 | """ 18 | delete folder and content 19 | """ 20 | 21 | #if folder exists 22 | if os.path.exists(foldername): 23 | # recursively remove files in folder 24 | for root, dirs, files in os.walk(foldername, topdown=False): 25 | for name in files: 26 | os.remove(os.path.join(root, name)) 27 | for name in dirs: 28 | os.rmdir(os.path.join(root, name)) 29 | 30 | # delete folder itself 31 | os.rmdir(foldername) 32 | # end removeFolder() 33 | 34 | 35 | ######### 36 | def removeFile(path=os.curdir, pattern='XYX'): 37 | """ 38 | delete file ending with pattern 39 | """ 40 | if os.path.exists(path): 41 | for filename in os.listdir(path): 42 | if filename.endswith(pattern): 43 | os.remove(os.path.join(path, filename)) 44 | #print(filename) 45 | # end removeFile() 46 | 47 | 48 | 49 | ################## 50 | # main program 51 | ################## 52 | 53 | removeFile('.','Makefile') 54 | removeFile('.','.DS_Store') 55 | removeFile('./STVD_Cosmic','.DS_Store') 56 | removeFile('.','*.TMP') 57 | removeFile('./STVD_Cosmic','.TMP') 58 | removeFile('./STVD_Cosmic','.spy') 59 | #removeFile('./STVD_Cosmic','.dep') 60 | removeFile('./STVD_Cosmic','.pdb') 61 | removeFile('./STVD_Cosmic','.wdb') 62 | #removeFile('./STVD_Cosmic','.wed') 63 | removeFolder('./-p') 64 | removeFolder('./output') 65 | removeFolder('./STVD_Cosmic/Release') 66 | removeFolder('./STVD_Cosmic/Debug') 67 | 68 | # END OF MODULE 69 | 70 | -------------------------------------------------------------------------------- /Projects/General_Examples/I2C_write/clean.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | ############# 4 | # clean up project outputs and temporary files 5 | ############# 6 | 7 | # required modules 8 | import os 9 | 10 | 11 | ################## 12 | # helper functions 13 | ################## 14 | 15 | ######### 16 | def removeFolder(foldername): 17 | """ 18 | delete folder and content 19 | """ 20 | 21 | #if folder exists 22 | if os.path.exists(foldername): 23 | # recursively remove files in folder 24 | for root, dirs, files in os.walk(foldername, topdown=False): 25 | for name in files: 26 | os.remove(os.path.join(root, name)) 27 | for name in dirs: 28 | os.rmdir(os.path.join(root, name)) 29 | 30 | # delete folder itself 31 | os.rmdir(foldername) 32 | # end removeFolder() 33 | 34 | 35 | ######### 36 | def removeFile(path=os.curdir, pattern='XYX'): 37 | """ 38 | delete file ending with pattern 39 | """ 40 | if os.path.exists(path): 41 | for filename in os.listdir(path): 42 | if filename.endswith(pattern): 43 | os.remove(os.path.join(path, filename)) 44 | #print(filename) 45 | # end removeFile() 46 | 47 | 48 | 49 | ################## 50 | # main program 51 | ################## 52 | 53 | removeFile('.','Makefile') 54 | removeFile('.','.DS_Store') 55 | removeFile('./STVD_Cosmic','.DS_Store') 56 | removeFile('.','*.TMP') 57 | removeFile('./STVD_Cosmic','.TMP') 58 | removeFile('./STVD_Cosmic','.spy') 59 | #removeFile('./STVD_Cosmic','.dep') 60 | removeFile('./STVD_Cosmic','.pdb') 61 | removeFile('./STVD_Cosmic','.wdb') 62 | #removeFile('./STVD_Cosmic','.wed') 63 | removeFolder('./-p') 64 | removeFolder('./output') 65 | removeFolder('./STVD_Cosmic/Release') 66 | removeFolder('./STVD_Cosmic/Debug') 67 | 68 | # END OF MODULE 69 | 70 | -------------------------------------------------------------------------------- /Projects/General_Examples/Minimal-C/clean.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | ############# 4 | # clean up project outputs and temporary files 5 | ############# 6 | 7 | # required modules 8 | import os 9 | 10 | 11 | ################## 12 | # helper functions 13 | ################## 14 | 15 | ######### 16 | def removeFolder(foldername): 17 | """ 18 | delete folder and content 19 | """ 20 | 21 | #if folder exists 22 | if os.path.exists(foldername): 23 | # recursively remove files in folder 24 | for root, dirs, files in os.walk(foldername, topdown=False): 25 | for name in files: 26 | os.remove(os.path.join(root, name)) 27 | for name in dirs: 28 | os.rmdir(os.path.join(root, name)) 29 | 30 | # delete folder itself 31 | os.rmdir(foldername) 32 | # end removeFolder() 33 | 34 | 35 | ######### 36 | def removeFile(path=os.curdir, pattern='XYX'): 37 | """ 38 | delete file ending with pattern 39 | """ 40 | if os.path.exists(path): 41 | for filename in os.listdir(path): 42 | if filename.endswith(pattern): 43 | os.remove(os.path.join(path, filename)) 44 | #print(filename) 45 | # end removeFile() 46 | 47 | 48 | 49 | ################## 50 | # main program 51 | ################## 52 | 53 | removeFile('.','Makefile') 54 | removeFile('.','.DS_Store') 55 | removeFile('./STVD_Cosmic','.DS_Store') 56 | removeFile('.','*.TMP') 57 | removeFile('./STVD_Cosmic','.TMP') 58 | removeFile('./STVD_Cosmic','.spy') 59 | #removeFile('./STVD_Cosmic','.dep') 60 | removeFile('./STVD_Cosmic','.pdb') 61 | removeFile('./STVD_Cosmic','.wdb') 62 | #removeFile('./STVD_Cosmic','.wed') 63 | removeFolder('./-p') 64 | removeFolder('./output') 65 | removeFolder('./STVD_Cosmic/Release') 66 | removeFolder('./STVD_Cosmic/Debug') 67 | 68 | # END OF MODULE 69 | 70 | -------------------------------------------------------------------------------- /Projects/General_Examples/echo_UART/clean.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | ############# 4 | # clean up project outputs and temporary files 5 | ############# 6 | 7 | # required modules 8 | import os 9 | 10 | 11 | ################## 12 | # helper functions 13 | ################## 14 | 15 | ######### 16 | def removeFolder(foldername): 17 | """ 18 | delete folder and content 19 | """ 20 | 21 | #if folder exists 22 | if os.path.exists(foldername): 23 | # recursively remove files in folder 24 | for root, dirs, files in os.walk(foldername, topdown=False): 25 | for name in files: 26 | os.remove(os.path.join(root, name)) 27 | for name in dirs: 28 | os.rmdir(os.path.join(root, name)) 29 | 30 | # delete folder itself 31 | os.rmdir(foldername) 32 | # end removeFolder() 33 | 34 | 35 | ######### 36 | def removeFile(path=os.curdir, pattern='XYX'): 37 | """ 38 | delete file ending with pattern 39 | """ 40 | if os.path.exists(path): 41 | for filename in os.listdir(path): 42 | if filename.endswith(pattern): 43 | os.remove(os.path.join(path, filename)) 44 | #print(filename) 45 | # end removeFile() 46 | 47 | 48 | 49 | ################## 50 | # main program 51 | ################## 52 | 53 | removeFile('.','Makefile') 54 | removeFile('.','.DS_Store') 55 | removeFile('./STVD_Cosmic','.DS_Store') 56 | removeFile('.','*.TMP') 57 | removeFile('./STVD_Cosmic','.TMP') 58 | removeFile('./STVD_Cosmic','.spy') 59 | #removeFile('./STVD_Cosmic','.dep') 60 | removeFile('./STVD_Cosmic','.pdb') 61 | removeFile('./STVD_Cosmic','.wdb') 62 | #removeFile('./STVD_Cosmic','.wed') 63 | removeFolder('./-p') 64 | removeFolder('./output') 65 | removeFolder('./STVD_Cosmic/Release') 66 | removeFolder('./STVD_Cosmic/Debug') 67 | 68 | # END OF MODULE 69 | 70 | -------------------------------------------------------------------------------- /Library/Base/inc/stdint.h: -------------------------------------------------------------------------------- 1 | /** 2 | \file stdint.h 3 | 4 | \author G. Icking-Konert 5 | \date 2013-11-22 6 | \version 0.1 7 | \copyright MIT License (MIT) 8 | 9 | \brief substitute for , if missing 10 | 11 | if is missing in compiler, e.g. Cosmic, define common 12 | data types with corresponding min/max values here 13 | */ 14 | 15 | /*----------------------------------------------------------------------------- 16 | MODULE DEFINITION FOR MULTIPLE INCLUSION 17 | -----------------------------------------------------------------------------*/ 18 | #ifndef _STDINT_H_ 19 | #define _STDINT_H_ 20 | 21 | #define TRUE 1 22 | #define FALSE 0 23 | 24 | // compiler specific --> If possible, use from compiler 25 | #if !defined(U8_MAX) 26 | typedef signed long int32_t; 27 | typedef signed short int16_t; 28 | typedef signed char int8_t; 29 | 30 | typedef unsigned long uint32_t; 31 | typedef unsigned short uint16_t; 32 | typedef unsigned char uint8_t; 33 | #endif 34 | 35 | // define min/max values 36 | #define INT8_MAX 0x7f 37 | #define INT8_MIN (-INT8_MAX - 1) 38 | 39 | #define UINT8_MAX 0xFF 40 | #define UINT8_MIN 0 41 | 42 | #define INT16_MAX 0x7fff 43 | #define INT16_MIN (-INT16_MAX - 1) 44 | 45 | #define UINT16_MAX 0xFFFF 46 | #define UINT16_MIN 0 47 | 48 | #define INT32_MAX 0x7fffffffL 49 | #define INT32_MIN (-INT32_MAX - 1L) 50 | 51 | #define UINT32_MAX 0xFFFFFFFF 52 | #define UINT32_MIN 0 53 | 54 | 55 | /*----------------------------------------------------------------------------- 56 | END OF MODULE DEFINITION FOR MULTIPLE INLUSION 57 | -----------------------------------------------------------------------------*/ 58 | #endif // _STDINT_H_ 59 | -------------------------------------------------------------------------------- /Projects/General_Examples/ADC_Measure/clean.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | ############# 4 | # clean up project outputs and temporary files 5 | ############# 6 | 7 | # required modules 8 | import os 9 | 10 | 11 | ################## 12 | # helper functions 13 | ################## 14 | 15 | ######### 16 | def removeFolder(foldername): 17 | """ 18 | delete folder and content 19 | """ 20 | 21 | #if folder exists 22 | if os.path.exists(foldername): 23 | # recursively remove files in folder 24 | for root, dirs, files in os.walk(foldername, topdown=False): 25 | for name in files: 26 | os.remove(os.path.join(root, name)) 27 | for name in dirs: 28 | os.rmdir(os.path.join(root, name)) 29 | 30 | # delete folder itself 31 | os.rmdir(foldername) 32 | # end removeFolder() 33 | 34 | 35 | ######### 36 | def removeFile(path=os.curdir, pattern='XYX'): 37 | """ 38 | delete file ending with pattern 39 | """ 40 | if os.path.exists(path): 41 | for filename in os.listdir(path): 42 | if filename.endswith(pattern): 43 | os.remove(os.path.join(path, filename)) 44 | #print(filename) 45 | # end removeFile() 46 | 47 | 48 | 49 | ################## 50 | # main program 51 | ################## 52 | 53 | removeFile('.','Makefile') 54 | removeFile('.','.DS_Store') 55 | removeFile('./STVD_Cosmic','.DS_Store') 56 | removeFile('.','*.TMP') 57 | removeFile('./STVD_Cosmic','.TMP') 58 | removeFile('./STVD_Cosmic','.spy') 59 | #removeFile('./STVD_Cosmic','.dep') 60 | removeFile('./STVD_Cosmic','.pdb') 61 | removeFile('./STVD_Cosmic','.wdb') 62 | #removeFile('./STVD_Cosmic','.wed') 63 | removeFolder('./-p') 64 | removeFolder('./output') 65 | removeFolder('./STVD_Cosmic/Release') 66 | removeFolder('./STVD_Cosmic/Debug') 67 | 68 | # END OF MODULE 69 | 70 | -------------------------------------------------------------------------------- /Projects/General_Examples/Basic_Project/clean.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | ############# 4 | # clean up project outputs and temporary files 5 | ############# 6 | 7 | # required modules 8 | import os 9 | 10 | 11 | ################## 12 | # helper functions 13 | ################## 14 | 15 | ######### 16 | def removeFolder(foldername): 17 | """ 18 | delete folder and content 19 | """ 20 | 21 | #if folder exists 22 | if os.path.exists(foldername): 23 | # recursively remove files in folder 24 | for root, dirs, files in os.walk(foldername, topdown=False): 25 | for name in files: 26 | os.remove(os.path.join(root, name)) 27 | for name in dirs: 28 | os.rmdir(os.path.join(root, name)) 29 | 30 | # delete folder itself 31 | os.rmdir(foldername) 32 | # end removeFolder() 33 | 34 | 35 | ######### 36 | def removeFile(path=os.curdir, pattern='XYX'): 37 | """ 38 | delete file ending with pattern 39 | """ 40 | if os.path.exists(path): 41 | for filename in os.listdir(path): 42 | if filename.endswith(pattern): 43 | os.remove(os.path.join(path, filename)) 44 | #print(filename) 45 | # end removeFile() 46 | 47 | 48 | 49 | ################## 50 | # main program 51 | ################## 52 | 53 | removeFile('.','Makefile') 54 | removeFile('.','.DS_Store') 55 | removeFile('./STVD_Cosmic','.DS_Store') 56 | removeFile('.','*.TMP') 57 | removeFile('./STVD_Cosmic','.TMP') 58 | removeFile('./STVD_Cosmic','.spy') 59 | #removeFile('./STVD_Cosmic','.dep') 60 | removeFile('./STVD_Cosmic','.pdb') 61 | removeFile('./STVD_Cosmic','.wdb') 62 | #removeFile('./STVD_Cosmic','.wed') 63 | removeFolder('./-p') 64 | removeFolder('./output') 65 | removeFolder('./STVD_Cosmic/Release') 66 | removeFolder('./STVD_Cosmic/Debug') 67 | 68 | # END OF MODULE 69 | 70 | -------------------------------------------------------------------------------- /Projects/General_Examples/Measure_PWM/clean.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | ############# 4 | # clean up project outputs and temporary files 5 | ############# 6 | 7 | # required modules 8 | import os 9 | 10 | 11 | ################## 12 | # helper functions 13 | ################## 14 | 15 | ######### 16 | def removeFolder(foldername): 17 | """ 18 | delete folder and content 19 | """ 20 | 21 | #if folder exists 22 | if os.path.exists(foldername): 23 | # recursively remove files in folder 24 | for root, dirs, files in os.walk(foldername, topdown=False): 25 | for name in files: 26 | os.remove(os.path.join(root, name)) 27 | for name in dirs: 28 | os.rmdir(os.path.join(root, name)) 29 | 30 | # delete folder itself 31 | os.rmdir(foldername) 32 | # end removeFolder() 33 | 34 | 35 | ######### 36 | def removeFile(path=os.curdir, pattern='XYX'): 37 | """ 38 | delete file ending with pattern 39 | """ 40 | if os.path.exists(path): 41 | for filename in os.listdir(path): 42 | if filename.endswith(pattern): 43 | os.remove(os.path.join(path, filename)) 44 | #print(filename) 45 | # end removeFile() 46 | 47 | 48 | 49 | ################## 50 | # main program 51 | ################## 52 | 53 | removeFile('.','Makefile') 54 | removeFile('.','.DS_Store') 55 | removeFile('./STVD_Cosmic','.DS_Store') 56 | removeFile('.','*.TMP') 57 | removeFile('./STVD_Cosmic','.TMP') 58 | removeFile('./STVD_Cosmic','.spy') 59 | #removeFile('./STVD_Cosmic','.dep') 60 | removeFile('./STVD_Cosmic','.pdb') 61 | removeFile('./STVD_Cosmic','.wdb') 62 | #removeFile('./STVD_Cosmic','.wed') 63 | removeFolder('./-p') 64 | removeFolder('./output') 65 | removeFolder('./STVD_Cosmic/Release') 66 | removeFolder('./STVD_Cosmic/Debug') 67 | 68 | # END OF MODULE 69 | 70 | -------------------------------------------------------------------------------- /Projects/General_Examples/Pin_Interrupt/clean.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | ############# 4 | # clean up project outputs and temporary files 5 | ############# 6 | 7 | # required modules 8 | import os 9 | 10 | 11 | ################## 12 | # helper functions 13 | ################## 14 | 15 | ######### 16 | def removeFolder(foldername): 17 | """ 18 | delete folder and content 19 | """ 20 | 21 | #if folder exists 22 | if os.path.exists(foldername): 23 | # recursively remove files in folder 24 | for root, dirs, files in os.walk(foldername, topdown=False): 25 | for name in files: 26 | os.remove(os.path.join(root, name)) 27 | for name in dirs: 28 | os.rmdir(os.path.join(root, name)) 29 | 30 | # delete folder itself 31 | os.rmdir(foldername) 32 | # end removeFolder() 33 | 34 | 35 | ######### 36 | def removeFile(path=os.curdir, pattern='XYX'): 37 | """ 38 | delete file ending with pattern 39 | """ 40 | if os.path.exists(path): 41 | for filename in os.listdir(path): 42 | if filename.endswith(pattern): 43 | os.remove(os.path.join(path, filename)) 44 | #print(filename) 45 | # end removeFile() 46 | 47 | 48 | 49 | ################## 50 | # main program 51 | ################## 52 | 53 | removeFile('.','Makefile') 54 | removeFile('.','.DS_Store') 55 | removeFile('./STVD_Cosmic','.DS_Store') 56 | removeFile('.','*.TMP') 57 | removeFile('./STVD_Cosmic','.TMP') 58 | removeFile('./STVD_Cosmic','.spy') 59 | #removeFile('./STVD_Cosmic','.dep') 60 | removeFile('./STVD_Cosmic','.pdb') 61 | removeFile('./STVD_Cosmic','.wdb') 62 | #removeFile('./STVD_Cosmic','.wed') 63 | removeFolder('./-p') 64 | removeFolder('./output') 65 | removeFolder('./STVD_Cosmic/Release') 66 | removeFolder('./STVD_Cosmic/Debug') 67 | 68 | # END OF MODULE 69 | 70 | -------------------------------------------------------------------------------- /Projects/General_Examples/Pin_Read_Write/clean.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | ############# 4 | # clean up project outputs and temporary files 5 | ############# 6 | 7 | # required modules 8 | import os 9 | 10 | 11 | ################## 12 | # helper functions 13 | ################## 14 | 15 | ######### 16 | def removeFolder(foldername): 17 | """ 18 | delete folder and content 19 | """ 20 | 21 | #if folder exists 22 | if os.path.exists(foldername): 23 | # recursively remove files in folder 24 | for root, dirs, files in os.walk(foldername, topdown=False): 25 | for name in files: 26 | os.remove(os.path.join(root, name)) 27 | for name in dirs: 28 | os.rmdir(os.path.join(root, name)) 29 | 30 | # delete folder itself 31 | os.rmdir(foldername) 32 | # end removeFolder() 33 | 34 | 35 | ######### 36 | def removeFile(path=os.curdir, pattern='XYX'): 37 | """ 38 | delete file ending with pattern 39 | """ 40 | if os.path.exists(path): 41 | for filename in os.listdir(path): 42 | if filename.endswith(pattern): 43 | os.remove(os.path.join(path, filename)) 44 | #print(filename) 45 | # end removeFile() 46 | 47 | 48 | 49 | ################## 50 | # main program 51 | ################## 52 | 53 | removeFile('.','Makefile') 54 | removeFile('.','.DS_Store') 55 | removeFile('./STVD_Cosmic','.DS_Store') 56 | removeFile('.','*.TMP') 57 | removeFile('./STVD_Cosmic','.TMP') 58 | removeFile('./STVD_Cosmic','.spy') 59 | #removeFile('./STVD_Cosmic','.dep') 60 | removeFile('./STVD_Cosmic','.pdb') 61 | removeFile('./STVD_Cosmic','.wdb') 62 | #removeFile('./STVD_Cosmic','.wed') 63 | removeFolder('./-p') 64 | removeFolder('./output') 65 | removeFolder('./STVD_Cosmic/Release') 66 | removeFolder('./STVD_Cosmic/Debug') 67 | 68 | # END OF MODULE 69 | 70 | -------------------------------------------------------------------------------- /Projects/General_Examples/Port_Interrupt/clean.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | ############# 4 | # clean up project outputs and temporary files 5 | ############# 6 | 7 | # required modules 8 | import os 9 | 10 | 11 | ################## 12 | # helper functions 13 | ################## 14 | 15 | ######### 16 | def removeFolder(foldername): 17 | """ 18 | delete folder and content 19 | """ 20 | 21 | #if folder exists 22 | if os.path.exists(foldername): 23 | # recursively remove files in folder 24 | for root, dirs, files in os.walk(foldername, topdown=False): 25 | for name in files: 26 | os.remove(os.path.join(root, name)) 27 | for name in dirs: 28 | os.rmdir(os.path.join(root, name)) 29 | 30 | # delete folder itself 31 | os.rmdir(foldername) 32 | # end removeFolder() 33 | 34 | 35 | ######### 36 | def removeFile(path=os.curdir, pattern='XYX'): 37 | """ 38 | delete file ending with pattern 39 | """ 40 | if os.path.exists(path): 41 | for filename in os.listdir(path): 42 | if filename.endswith(pattern): 43 | os.remove(os.path.join(path, filename)) 44 | #print(filename) 45 | # end removeFile() 46 | 47 | 48 | 49 | ################## 50 | # main program 51 | ################## 52 | 53 | removeFile('.','Makefile') 54 | removeFile('.','.DS_Store') 55 | removeFile('./STVD_Cosmic','.DS_Store') 56 | removeFile('.','*.TMP') 57 | removeFile('./STVD_Cosmic','.TMP') 58 | removeFile('./STVD_Cosmic','.spy') 59 | #removeFile('./STVD_Cosmic','.dep') 60 | removeFile('./STVD_Cosmic','.pdb') 61 | removeFile('./STVD_Cosmic','.wdb') 62 | #removeFile('./STVD_Cosmic','.wed') 63 | removeFolder('./-p') 64 | removeFolder('./output') 65 | removeFolder('./STVD_Cosmic/Release') 66 | removeFolder('./STVD_Cosmic/Debug') 67 | 68 | # END OF MODULE 69 | 70 | -------------------------------------------------------------------------------- /Projects/General_Examples/Printf_UART/clean.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | ############# 4 | # clean up project outputs and temporary files 5 | ############# 6 | 7 | # required modules 8 | import os 9 | 10 | 11 | ################## 12 | # helper functions 13 | ################## 14 | 15 | ######### 16 | def removeFolder(foldername): 17 | """ 18 | delete folder and content 19 | """ 20 | 21 | #if folder exists 22 | if os.path.exists(foldername): 23 | # recursively remove files in folder 24 | for root, dirs, files in os.walk(foldername, topdown=False): 25 | for name in files: 26 | os.remove(os.path.join(root, name)) 27 | for name in dirs: 28 | os.rmdir(os.path.join(root, name)) 29 | 30 | # delete folder itself 31 | os.rmdir(foldername) 32 | # end removeFolder() 33 | 34 | 35 | ######### 36 | def removeFile(path=os.curdir, pattern='XYX'): 37 | """ 38 | delete file ending with pattern 39 | """ 40 | if os.path.exists(path): 41 | for filename in os.listdir(path): 42 | if filename.endswith(pattern): 43 | os.remove(os.path.join(path, filename)) 44 | #print(filename) 45 | # end removeFile() 46 | 47 | 48 | 49 | ################## 50 | # main program 51 | ################## 52 | 53 | removeFile('.','Makefile') 54 | removeFile('.','.DS_Store') 55 | removeFile('./STVD_Cosmic','.DS_Store') 56 | removeFile('.','*.TMP') 57 | removeFile('./STVD_Cosmic','.TMP') 58 | removeFile('./STVD_Cosmic','.spy') 59 | #removeFile('./STVD_Cosmic','.dep') 60 | removeFile('./STVD_Cosmic','.pdb') 61 | removeFile('./STVD_Cosmic','.wdb') 62 | #removeFile('./STVD_Cosmic','.wed') 63 | removeFolder('./-p') 64 | removeFolder('./output') 65 | removeFolder('./STVD_Cosmic/Release') 66 | removeFolder('./STVD_Cosmic/Debug') 67 | 68 | # END OF MODULE 69 | 70 | -------------------------------------------------------------------------------- /Projects/General_Examples/Trap_Interrupt/clean.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | ############# 4 | # clean up project outputs and temporary files 5 | ############# 6 | 7 | # required modules 8 | import os 9 | 10 | 11 | ################## 12 | # helper functions 13 | ################## 14 | 15 | ######### 16 | def removeFolder(foldername): 17 | """ 18 | delete folder and content 19 | """ 20 | 21 | #if folder exists 22 | if os.path.exists(foldername): 23 | # recursively remove files in folder 24 | for root, dirs, files in os.walk(foldername, topdown=False): 25 | for name in files: 26 | os.remove(os.path.join(root, name)) 27 | for name in dirs: 28 | os.rmdir(os.path.join(root, name)) 29 | 30 | # delete folder itself 31 | os.rmdir(foldername) 32 | # end removeFolder() 33 | 34 | 35 | ######### 36 | def removeFile(path=os.curdir, pattern='XYX'): 37 | """ 38 | delete file ending with pattern 39 | """ 40 | if os.path.exists(path): 41 | for filename in os.listdir(path): 42 | if filename.endswith(pattern): 43 | os.remove(os.path.join(path, filename)) 44 | #print(filename) 45 | # end removeFile() 46 | 47 | 48 | 49 | ################## 50 | # main program 51 | ################## 52 | 53 | removeFile('.','Makefile') 54 | removeFile('.','.DS_Store') 55 | removeFile('./STVD_Cosmic','.DS_Store') 56 | removeFile('.','*.TMP') 57 | removeFile('./STVD_Cosmic','.TMP') 58 | removeFile('./STVD_Cosmic','.spy') 59 | #removeFile('./STVD_Cosmic','.dep') 60 | removeFile('./STVD_Cosmic','.pdb') 61 | removeFile('./STVD_Cosmic','.wdb') 62 | #removeFile('./STVD_Cosmic','.wed') 63 | removeFolder('./-p') 64 | removeFolder('./output') 65 | removeFolder('./STVD_Cosmic/Release') 66 | removeFolder('./STVD_Cosmic/Debug') 67 | 68 | # END OF MODULE 69 | 70 | -------------------------------------------------------------------------------- /Projects/Libraries_Examples/SD-card_fatFS/clean.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | ############# 4 | # clean up project outputs and temporary files 5 | ############# 6 | 7 | # required modules 8 | import os 9 | 10 | 11 | ################## 12 | # helper functions 13 | ################## 14 | 15 | ######### 16 | def removeFolder(foldername): 17 | """ 18 | delete folder and content 19 | """ 20 | 21 | #if folder exists 22 | if os.path.exists(foldername): 23 | # recursively remove files in folder 24 | for root, dirs, files in os.walk(foldername, topdown=False): 25 | for name in files: 26 | os.remove(os.path.join(root, name)) 27 | for name in dirs: 28 | os.rmdir(os.path.join(root, name)) 29 | 30 | # delete folder itself 31 | os.rmdir(foldername) 32 | # end removeFolder() 33 | 34 | 35 | ######### 36 | def removeFile(path=os.curdir, pattern='XYX'): 37 | """ 38 | delete file ending with pattern 39 | """ 40 | if os.path.exists(path): 41 | for filename in os.listdir(path): 42 | if filename.endswith(pattern): 43 | os.remove(os.path.join(path, filename)) 44 | #print(filename) 45 | # end removeFile() 46 | 47 | 48 | 49 | ################## 50 | # main program 51 | ################## 52 | 53 | removeFile('.','Makefile') 54 | removeFile('.','.DS_Store') 55 | removeFile('./STVD_Cosmic','.DS_Store') 56 | removeFile('.','*.TMP') 57 | removeFile('./STVD_Cosmic','.TMP') 58 | removeFile('./STVD_Cosmic','.spy') 59 | #removeFile('./STVD_Cosmic','.dep') 60 | removeFile('./STVD_Cosmic','.pdb') 61 | removeFile('./STVD_Cosmic','.wdb') 62 | #removeFile('./STVD_Cosmic','.wed') 63 | removeFolder('./-p') 64 | removeFolder('./output') 65 | removeFolder('./STVD_Cosmic/Release') 66 | removeFolder('./STVD_Cosmic/Debug') 67 | 68 | # END OF MODULE 69 | 70 | -------------------------------------------------------------------------------- /Projects/STM8_StdPeriphLib_Examples/Basic_Project/main.c: -------------------------------------------------------------------------------- 1 | /********************** 2 | Arduino-like project with calls to the STM8 Standard Peripheral Library 3 | (SDCC patch available from https://github.com/gicking/STM8-SPL_SDCC_patch). 4 | Note that device headers from STM8_templates and SPL are incompatible -> 5 | need to create separate SPL.c file in project folder and use interface 6 | functions (here simply 'SPL_setup()' and 'SPL_loop()'). 7 | Advantage is transparent mixing of STM8_templates (simple) with STM8 8 | SPL library (powerful) and examples by STM. 9 | Functionality: 10 | - use SPL to configure LED pin as output 11 | - toggle LED via SPL every 500ms 12 | **********************/ 13 | 14 | /*---------------------------------------------------------- 15 | INCLUDE FILES 16 | ----------------------------------------------------------*/ 17 | #include "main_general.h" // board-independent main 18 | 19 | // interface functions for SPL calls. Here simply setup/loop 20 | void SPL_setup(void); 21 | void SPL_loop(void); 22 | 23 | 24 | /*---------------------------------------------------------- 25 | FUNCTIONS 26 | ----------------------------------------------------------*/ 27 | 28 | ////////// 29 | // user setup, called once after reset 30 | ////////// 31 | void setup() { 32 | 33 | // call SPL setup function 34 | SPL_setup(); 35 | 36 | } // setup 37 | 38 | 39 | 40 | ////////// 41 | // user loop, called continuously 42 | ////////// 43 | void loop() { 44 | 45 | // poll 1ms flag 46 | if (flagMilli()) { 47 | clearFlagMilli(); // reset 1ms flag 48 | 49 | // every 500ms call SPL function (toggle LED) 50 | if (!(millis() % 500)) 51 | SPL_loop(); 52 | 53 | } // if flagMilli 54 | 55 | } // loop 56 | 57 | -------------------------------------------------------------------------------- /Projects/muBoard_Examples/LCD-display_I2C/clean.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | ############# 4 | # clean up project outputs and temporary files 5 | ############# 6 | 7 | # required modules 8 | import os 9 | 10 | 11 | ################## 12 | # helper functions 13 | ################## 14 | 15 | ######### 16 | def removeFolder(foldername): 17 | """ 18 | delete folder and content 19 | """ 20 | 21 | #if folder exists 22 | if os.path.exists(foldername): 23 | # recursively remove files in folder 24 | for root, dirs, files in os.walk(foldername, topdown=False): 25 | for name in files: 26 | os.remove(os.path.join(root, name)) 27 | for name in dirs: 28 | os.rmdir(os.path.join(root, name)) 29 | 30 | # delete folder itself 31 | os.rmdir(foldername) 32 | # end removeFolder() 33 | 34 | 35 | ######### 36 | def removeFile(path=os.curdir, pattern='XYX'): 37 | """ 38 | delete file ending with pattern 39 | """ 40 | if os.path.exists(path): 41 | for filename in os.listdir(path): 42 | if filename.endswith(pattern): 43 | os.remove(os.path.join(path, filename)) 44 | #print(filename) 45 | # end removeFile() 46 | 47 | 48 | 49 | ################## 50 | # main program 51 | ################## 52 | 53 | removeFile('.','Makefile') 54 | removeFile('.','.DS_Store') 55 | removeFile('./STVD_Cosmic','.DS_Store') 56 | removeFile('.','*.TMP') 57 | removeFile('./STVD_Cosmic','.TMP') 58 | removeFile('./STVD_Cosmic','.spy') 59 | #removeFile('./STVD_Cosmic','.dep') 60 | removeFile('./STVD_Cosmic','.pdb') 61 | removeFile('./STVD_Cosmic','.wdb') 62 | #removeFile('./STVD_Cosmic','.wed') 63 | removeFolder('./-p') 64 | removeFolder('./output') 65 | removeFolder('./STVD_Cosmic/Release') 66 | removeFolder('./STVD_Cosmic/Debug') 67 | 68 | # END OF MODULE 69 | 70 | -------------------------------------------------------------------------------- /Projects/muBoard_Examples/Pin_Read_Write/clean.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | ############# 4 | # clean up project outputs and temporary files 5 | ############# 6 | 7 | # required modules 8 | import os 9 | 10 | 11 | ################## 12 | # helper functions 13 | ################## 14 | 15 | ######### 16 | def removeFolder(foldername): 17 | """ 18 | delete folder and content 19 | """ 20 | 21 | #if folder exists 22 | if os.path.exists(foldername): 23 | # recursively remove files in folder 24 | for root, dirs, files in os.walk(foldername, topdown=False): 25 | for name in files: 26 | os.remove(os.path.join(root, name)) 27 | for name in dirs: 28 | os.rmdir(os.path.join(root, name)) 29 | 30 | # delete folder itself 31 | os.rmdir(foldername) 32 | # end removeFolder() 33 | 34 | 35 | ######### 36 | def removeFile(path=os.curdir, pattern='XYX'): 37 | """ 38 | delete file ending with pattern 39 | """ 40 | if os.path.exists(path): 41 | for filename in os.listdir(path): 42 | if filename.endswith(pattern): 43 | os.remove(os.path.join(path, filename)) 44 | #print(filename) 45 | # end removeFile() 46 | 47 | 48 | 49 | ################## 50 | # main program 51 | ################## 52 | 53 | removeFile('.','Makefile') 54 | removeFile('.','.DS_Store') 55 | removeFile('./STVD_Cosmic','.DS_Store') 56 | removeFile('.','*.TMP') 57 | removeFile('./STVD_Cosmic','.TMP') 58 | removeFile('./STVD_Cosmic','.spy') 59 | #removeFile('./STVD_Cosmic','.dep') 60 | removeFile('./STVD_Cosmic','.pdb') 61 | removeFile('./STVD_Cosmic','.wdb') 62 | #removeFile('./STVD_Cosmic','.wed') 63 | removeFolder('./-p') 64 | removeFolder('./output') 65 | removeFolder('./STVD_Cosmic/Release') 66 | removeFolder('./STVD_Cosmic/Debug') 67 | 68 | # END OF MODULE 69 | 70 | -------------------------------------------------------------------------------- /Projects/General_Examples/Attach_1ms_Interrupt/clean.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | ############# 4 | # clean up project outputs and temporary files 5 | ############# 6 | 7 | # required modules 8 | import os 9 | 10 | 11 | ################## 12 | # helper functions 13 | ################## 14 | 15 | ######### 16 | def removeFolder(foldername): 17 | """ 18 | delete folder and content 19 | """ 20 | 21 | #if folder exists 22 | if os.path.exists(foldername): 23 | # recursively remove files in folder 24 | for root, dirs, files in os.walk(foldername, topdown=False): 25 | for name in files: 26 | os.remove(os.path.join(root, name)) 27 | for name in dirs: 28 | os.rmdir(os.path.join(root, name)) 29 | 30 | # delete folder itself 31 | os.rmdir(foldername) 32 | # end removeFolder() 33 | 34 | 35 | ######### 36 | def removeFile(path=os.curdir, pattern='XYX'): 37 | """ 38 | delete file ending with pattern 39 | """ 40 | if os.path.exists(path): 41 | for filename in os.listdir(path): 42 | if filename.endswith(pattern): 43 | os.remove(os.path.join(path, filename)) 44 | #print(filename) 45 | # end removeFile() 46 | 47 | 48 | 49 | ################## 50 | # main program 51 | ################## 52 | 53 | removeFile('.','Makefile') 54 | removeFile('.','.DS_Store') 55 | removeFile('./STVD_Cosmic','.DS_Store') 56 | removeFile('.','*.TMP') 57 | removeFile('./STVD_Cosmic','.TMP') 58 | removeFile('./STVD_Cosmic','.spy') 59 | #removeFile('./STVD_Cosmic','.dep') 60 | removeFile('./STVD_Cosmic','.pdb') 61 | removeFile('./STVD_Cosmic','.wdb') 62 | #removeFile('./STVD_Cosmic','.wed') 63 | removeFolder('./-p') 64 | removeFolder('./output') 65 | removeFolder('./STVD_Cosmic/Release') 66 | removeFolder('./STVD_Cosmic/Debug') 67 | 68 | # END OF MODULE 69 | 70 | -------------------------------------------------------------------------------- /Projects/General_Examples/EEPROM_Datalogger/clean.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | ############# 4 | # clean up project outputs and temporary files 5 | ############# 6 | 7 | # required modules 8 | import os 9 | 10 | 11 | ################## 12 | # helper functions 13 | ################## 14 | 15 | ######### 16 | def removeFolder(foldername): 17 | """ 18 | delete folder and content 19 | """ 20 | 21 | #if folder exists 22 | if os.path.exists(foldername): 23 | # recursively remove files in folder 24 | for root, dirs, files in os.walk(foldername, topdown=False): 25 | for name in files: 26 | os.remove(os.path.join(root, name)) 27 | for name in dirs: 28 | os.rmdir(os.path.join(root, name)) 29 | 30 | # delete folder itself 31 | os.rmdir(foldername) 32 | # end removeFolder() 33 | 34 | 35 | ######### 36 | def removeFile(path=os.curdir, pattern='XYX'): 37 | """ 38 | delete file ending with pattern 39 | """ 40 | if os.path.exists(path): 41 | for filename in os.listdir(path): 42 | if filename.endswith(pattern): 43 | os.remove(os.path.join(path, filename)) 44 | #print(filename) 45 | # end removeFile() 46 | 47 | 48 | 49 | ################## 50 | # main program 51 | ################## 52 | 53 | removeFile('.','Makefile') 54 | removeFile('.','.DS_Store') 55 | removeFile('./STVD_Cosmic','.DS_Store') 56 | removeFile('.','*.TMP') 57 | removeFile('./STVD_Cosmic','.TMP') 58 | removeFile('./STVD_Cosmic','.spy') 59 | #removeFile('./STVD_Cosmic','.dep') 60 | removeFile('./STVD_Cosmic','.pdb') 61 | removeFile('./STVD_Cosmic','.wdb') 62 | #removeFile('./STVD_Cosmic','.wed') 63 | removeFolder('./-p') 64 | removeFolder('./output') 65 | removeFolder('./STVD_Cosmic/Release') 66 | removeFolder('./STVD_Cosmic/Debug') 67 | 68 | # END OF MODULE 69 | 70 | -------------------------------------------------------------------------------- /Projects/General_Examples/Gets_Printf_UART/clean.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | ############# 4 | # clean up project outputs and temporary files 5 | ############# 6 | 7 | # required modules 8 | import os 9 | 10 | 11 | ################## 12 | # helper functions 13 | ################## 14 | 15 | ######### 16 | def removeFolder(foldername): 17 | """ 18 | delete folder and content 19 | """ 20 | 21 | #if folder exists 22 | if os.path.exists(foldername): 23 | # recursively remove files in folder 24 | for root, dirs, files in os.walk(foldername, topdown=False): 25 | for name in files: 26 | os.remove(os.path.join(root, name)) 27 | for name in dirs: 28 | os.rmdir(os.path.join(root, name)) 29 | 30 | # delete folder itself 31 | os.rmdir(foldername) 32 | # end removeFolder() 33 | 34 | 35 | ######### 36 | def removeFile(path=os.curdir, pattern='XYX'): 37 | """ 38 | delete file ending with pattern 39 | """ 40 | if os.path.exists(path): 41 | for filename in os.listdir(path): 42 | if filename.endswith(pattern): 43 | os.remove(os.path.join(path, filename)) 44 | #print(filename) 45 | # end removeFile() 46 | 47 | 48 | 49 | ################## 50 | # main program 51 | ################## 52 | 53 | removeFile('.','Makefile') 54 | removeFile('.','.DS_Store') 55 | removeFile('./STVD_Cosmic','.DS_Store') 56 | removeFile('.','*.TMP') 57 | removeFile('./STVD_Cosmic','.TMP') 58 | removeFile('./STVD_Cosmic','.spy') 59 | #removeFile('./STVD_Cosmic','.dep') 60 | removeFile('./STVD_Cosmic','.pdb') 61 | removeFile('./STVD_Cosmic','.wdb') 62 | #removeFile('./STVD_Cosmic','.wed') 63 | removeFolder('./-p') 64 | removeFolder('./output') 65 | removeFolder('./STVD_Cosmic/Release') 66 | removeFolder('./STVD_Cosmic/Debug') 67 | 68 | # END OF MODULE 69 | 70 | -------------------------------------------------------------------------------- /Projects/General_Examples/Minimal-C_with_ISR/clean.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | ############# 4 | # clean up project outputs and temporary files 5 | ############# 6 | 7 | # required modules 8 | import os 9 | 10 | 11 | ################## 12 | # helper functions 13 | ################## 14 | 15 | ######### 16 | def removeFolder(foldername): 17 | """ 18 | delete folder and content 19 | """ 20 | 21 | #if folder exists 22 | if os.path.exists(foldername): 23 | # recursively remove files in folder 24 | for root, dirs, files in os.walk(foldername, topdown=False): 25 | for name in files: 26 | os.remove(os.path.join(root, name)) 27 | for name in dirs: 28 | os.rmdir(os.path.join(root, name)) 29 | 30 | # delete folder itself 31 | os.rmdir(foldername) 32 | # end removeFolder() 33 | 34 | 35 | ######### 36 | def removeFile(path=os.curdir, pattern='XYX'): 37 | """ 38 | delete file ending with pattern 39 | """ 40 | if os.path.exists(path): 41 | for filename in os.listdir(path): 42 | if filename.endswith(pattern): 43 | os.remove(os.path.join(path, filename)) 44 | #print(filename) 45 | # end removeFile() 46 | 47 | 48 | 49 | ################## 50 | # main program 51 | ################## 52 | 53 | removeFile('.','Makefile') 54 | removeFile('.','.DS_Store') 55 | removeFile('./STVD_Cosmic','.DS_Store') 56 | removeFile('.','*.TMP') 57 | removeFile('./STVD_Cosmic','.TMP') 58 | removeFile('./STVD_Cosmic','.spy') 59 | #removeFile('./STVD_Cosmic','.dep') 60 | removeFile('./STVD_Cosmic','.pdb') 61 | removeFile('./STVD_Cosmic','.wdb') 62 | #removeFile('./STVD_Cosmic','.wed') 63 | removeFolder('./-p') 64 | removeFolder('./output') 65 | removeFolder('./STVD_Cosmic/Release') 66 | removeFolder('./STVD_Cosmic/Debug') 67 | 68 | # END OF MODULE 69 | 70 | -------------------------------------------------------------------------------- /Projects/General_Examples/P-Flash_Datalogger/clean.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | ############# 4 | # clean up project outputs and temporary files 5 | ############# 6 | 7 | # required modules 8 | import os 9 | 10 | 11 | ################## 12 | # helper functions 13 | ################## 14 | 15 | ######### 16 | def removeFolder(foldername): 17 | """ 18 | delete folder and content 19 | """ 20 | 21 | #if folder exists 22 | if os.path.exists(foldername): 23 | # recursively remove files in folder 24 | for root, dirs, files in os.walk(foldername, topdown=False): 25 | for name in files: 26 | os.remove(os.path.join(root, name)) 27 | for name in dirs: 28 | os.rmdir(os.path.join(root, name)) 29 | 30 | # delete folder itself 31 | os.rmdir(foldername) 32 | # end removeFolder() 33 | 34 | 35 | ######### 36 | def removeFile(path=os.curdir, pattern='XYX'): 37 | """ 38 | delete file ending with pattern 39 | """ 40 | if os.path.exists(path): 41 | for filename in os.listdir(path): 42 | if filename.endswith(pattern): 43 | os.remove(os.path.join(path, filename)) 44 | #print(filename) 45 | # end removeFile() 46 | 47 | 48 | 49 | ################## 50 | # main program 51 | ################## 52 | 53 | removeFile('.','Makefile') 54 | removeFile('.','.DS_Store') 55 | removeFile('./STVD_Cosmic','.DS_Store') 56 | removeFile('.','*.TMP') 57 | removeFile('./STVD_Cosmic','.TMP') 58 | removeFile('./STVD_Cosmic','.spy') 59 | #removeFile('./STVD_Cosmic','.dep') 60 | removeFile('./STVD_Cosmic','.pdb') 61 | removeFile('./STVD_Cosmic','.wdb') 62 | #removeFile('./STVD_Cosmic','.wed') 63 | removeFolder('./-p') 64 | removeFolder('./output') 65 | removeFolder('./STVD_Cosmic/Release') 66 | removeFolder('./STVD_Cosmic/Debug') 67 | 68 | # END OF MODULE 69 | 70 | -------------------------------------------------------------------------------- /Projects/General_Examples/PiAndMore10/muBoard/clean.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | ############# 4 | # clean up project outputs and temporary files 5 | ############# 6 | 7 | # required modules 8 | import os 9 | 10 | 11 | ################## 12 | # helper functions 13 | ################## 14 | 15 | ######### 16 | def removeFolder(foldername): 17 | """ 18 | delete folder and content 19 | """ 20 | 21 | #if folder exists 22 | if os.path.exists(foldername): 23 | # recursively remove files in folder 24 | for root, dirs, files in os.walk(foldername, topdown=False): 25 | for name in files: 26 | os.remove(os.path.join(root, name)) 27 | for name in dirs: 28 | os.rmdir(os.path.join(root, name)) 29 | 30 | # delete folder itself 31 | os.rmdir(foldername) 32 | # end removeFolder() 33 | 34 | 35 | ######### 36 | def removeFile(path=os.curdir, pattern='XYX'): 37 | """ 38 | delete file ending with pattern 39 | """ 40 | if os.path.exists(path): 41 | for filename in os.listdir(path): 42 | if filename.endswith(pattern): 43 | os.remove(os.path.join(path, filename)) 44 | #print(filename) 45 | # end removeFile() 46 | 47 | 48 | 49 | ################## 50 | # main program 51 | ################## 52 | 53 | removeFile('.','Makefile') 54 | removeFile('.','.DS_Store') 55 | removeFile('./STVD_Cosmic','.DS_Store') 56 | removeFile('.','*.TMP') 57 | removeFile('./STVD_Cosmic','.TMP') 58 | removeFile('./STVD_Cosmic','.spy') 59 | #removeFile('./STVD_Cosmic','.dep') 60 | removeFile('./STVD_Cosmic','.pdb') 61 | removeFile('./STVD_Cosmic','.wdb') 62 | #removeFile('./STVD_Cosmic','.wed') 63 | removeFolder('./-p') 64 | removeFolder('./output') 65 | removeFolder('./STVD_Cosmic/Release') 66 | removeFolder('./STVD_Cosmic/Debug') 67 | 68 | # END OF MODULE 69 | 70 | -------------------------------------------------------------------------------- /Projects/General_Examples/Power_Saving_Modes/clean.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | ############# 4 | # clean up project outputs and temporary files 5 | ############# 6 | 7 | # required modules 8 | import os 9 | 10 | 11 | ################## 12 | # helper functions 13 | ################## 14 | 15 | ######### 16 | def removeFolder(foldername): 17 | """ 18 | delete folder and content 19 | """ 20 | 21 | #if folder exists 22 | if os.path.exists(foldername): 23 | # recursively remove files in folder 24 | for root, dirs, files in os.walk(foldername, topdown=False): 25 | for name in files: 26 | os.remove(os.path.join(root, name)) 27 | for name in dirs: 28 | os.rmdir(os.path.join(root, name)) 29 | 30 | # delete folder itself 31 | os.rmdir(foldername) 32 | # end removeFolder() 33 | 34 | 35 | ######### 36 | def removeFile(path=os.curdir, pattern='XYX'): 37 | """ 38 | delete file ending with pattern 39 | """ 40 | if os.path.exists(path): 41 | for filename in os.listdir(path): 42 | if filename.endswith(pattern): 43 | os.remove(os.path.join(path, filename)) 44 | #print(filename) 45 | # end removeFile() 46 | 47 | 48 | 49 | ################## 50 | # main program 51 | ################## 52 | 53 | removeFile('.','Makefile') 54 | removeFile('.','.DS_Store') 55 | removeFile('./STVD_Cosmic','.DS_Store') 56 | removeFile('.','*.TMP') 57 | removeFile('./STVD_Cosmic','.TMP') 58 | removeFile('./STVD_Cosmic','.spy') 59 | #removeFile('./STVD_Cosmic','.dep') 60 | removeFile('./STVD_Cosmic','.pdb') 61 | removeFile('./STVD_Cosmic','.wdb') 62 | #removeFile('./STVD_Cosmic','.wed') 63 | removeFolder('./-p') 64 | removeFolder('./output') 65 | removeFolder('./STVD_Cosmic/Release') 66 | removeFolder('./STVD_Cosmic/Debug') 67 | 68 | # END OF MODULE 69 | 70 | -------------------------------------------------------------------------------- /Projects/General_Examples/TIM3_PWM_generate/clean.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | ############# 4 | # clean up project outputs and temporary files 5 | ############# 6 | 7 | # required modules 8 | import os 9 | 10 | 11 | ################## 12 | # helper functions 13 | ################## 14 | 15 | ######### 16 | def removeFolder(foldername): 17 | """ 18 | delete folder and content 19 | """ 20 | 21 | #if folder exists 22 | if os.path.exists(foldername): 23 | # recursively remove files in folder 24 | for root, dirs, files in os.walk(foldername, topdown=False): 25 | for name in files: 26 | os.remove(os.path.join(root, name)) 27 | for name in dirs: 28 | os.rmdir(os.path.join(root, name)) 29 | 30 | # delete folder itself 31 | os.rmdir(foldername) 32 | # end removeFolder() 33 | 34 | 35 | ######### 36 | def removeFile(path=os.curdir, pattern='XYX'): 37 | """ 38 | delete file ending with pattern 39 | """ 40 | if os.path.exists(path): 41 | for filename in os.listdir(path): 42 | if filename.endswith(pattern): 43 | os.remove(os.path.join(path, filename)) 44 | #print(filename) 45 | # end removeFile() 46 | 47 | 48 | 49 | ################## 50 | # main program 51 | ################## 52 | 53 | removeFile('.','Makefile') 54 | removeFile('.','.DS_Store') 55 | removeFile('./STVD_Cosmic','.DS_Store') 56 | removeFile('.','*.TMP') 57 | removeFile('./STVD_Cosmic','.TMP') 58 | removeFile('./STVD_Cosmic','.spy') 59 | #removeFile('./STVD_Cosmic','.dep') 60 | removeFile('./STVD_Cosmic','.pdb') 61 | removeFile('./STVD_Cosmic','.wdb') 62 | #removeFile('./STVD_Cosmic','.wed') 63 | removeFolder('./-p') 64 | removeFolder('./output') 65 | removeFolder('./STVD_Cosmic/Release') 66 | removeFolder('./STVD_Cosmic/Debug') 67 | 68 | # END OF MODULE 69 | 70 | -------------------------------------------------------------------------------- /Projects/General_Examples/Timeout_Scheduler/clean.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | ############# 4 | # clean up project outputs and temporary files 5 | ############# 6 | 7 | # required modules 8 | import os 9 | 10 | 11 | ################## 12 | # helper functions 13 | ################## 14 | 15 | ######### 16 | def removeFolder(foldername): 17 | """ 18 | delete folder and content 19 | """ 20 | 21 | #if folder exists 22 | if os.path.exists(foldername): 23 | # recursively remove files in folder 24 | for root, dirs, files in os.walk(foldername, topdown=False): 25 | for name in files: 26 | os.remove(os.path.join(root, name)) 27 | for name in dirs: 28 | os.rmdir(os.path.join(root, name)) 29 | 30 | # delete folder itself 31 | os.rmdir(foldername) 32 | # end removeFolder() 33 | 34 | 35 | ######### 36 | def removeFile(path=os.curdir, pattern='XYX'): 37 | """ 38 | delete file ending with pattern 39 | """ 40 | if os.path.exists(path): 41 | for filename in os.listdir(path): 42 | if filename.endswith(pattern): 43 | os.remove(os.path.join(path, filename)) 44 | #print(filename) 45 | # end removeFile() 46 | 47 | 48 | 49 | ################## 50 | # main program 51 | ################## 52 | 53 | removeFile('.','Makefile') 54 | removeFile('.','.DS_Store') 55 | removeFile('./STVD_Cosmic','.DS_Store') 56 | removeFile('.','*.TMP') 57 | removeFile('./STVD_Cosmic','.TMP') 58 | removeFile('./STVD_Cosmic','.spy') 59 | #removeFile('./STVD_Cosmic','.dep') 60 | removeFile('./STVD_Cosmic','.pdb') 61 | removeFile('./STVD_Cosmic','.wdb') 62 | #removeFile('./STVD_Cosmic','.wed') 63 | removeFolder('./-p') 64 | removeFolder('./output') 65 | removeFolder('./STVD_Cosmic/Release') 66 | removeFolder('./STVD_Cosmic/Debug') 67 | 68 | # END OF MODULE 69 | 70 | -------------------------------------------------------------------------------- /Projects/General_Examples/echo_UART_with_ISR/clean.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | ############# 4 | # clean up project outputs and temporary files 5 | ############# 6 | 7 | # required modules 8 | import os 9 | 10 | 11 | ################## 12 | # helper functions 13 | ################## 14 | 15 | ######### 16 | def removeFolder(foldername): 17 | """ 18 | delete folder and content 19 | """ 20 | 21 | #if folder exists 22 | if os.path.exists(foldername): 23 | # recursively remove files in folder 24 | for root, dirs, files in os.walk(foldername, topdown=False): 25 | for name in files: 26 | os.remove(os.path.join(root, name)) 27 | for name in dirs: 28 | os.rmdir(os.path.join(root, name)) 29 | 30 | # delete folder itself 31 | os.rmdir(foldername) 32 | # end removeFolder() 33 | 34 | 35 | ######### 36 | def removeFile(path=os.curdir, pattern='XYX'): 37 | """ 38 | delete file ending with pattern 39 | """ 40 | if os.path.exists(path): 41 | for filename in os.listdir(path): 42 | if filename.endswith(pattern): 43 | os.remove(os.path.join(path, filename)) 44 | #print(filename) 45 | # end removeFile() 46 | 47 | 48 | 49 | ################## 50 | # main program 51 | ################## 52 | 53 | removeFile('.','Makefile') 54 | removeFile('.','.DS_Store') 55 | removeFile('./STVD_Cosmic','.DS_Store') 56 | removeFile('.','*.TMP') 57 | removeFile('./STVD_Cosmic','.TMP') 58 | removeFile('./STVD_Cosmic','.spy') 59 | #removeFile('./STVD_Cosmic','.dep') 60 | removeFile('./STVD_Cosmic','.pdb') 61 | removeFile('./STVD_Cosmic','.wdb') 62 | #removeFile('./STVD_Cosmic','.wed') 63 | removeFolder('./-p') 64 | removeFolder('./output') 65 | removeFolder('./STVD_Cosmic/Release') 66 | removeFolder('./STVD_Cosmic/Debug') 67 | 68 | # END OF MODULE 69 | 70 | -------------------------------------------------------------------------------- /Projects/General_Examples/mirror_two_UARTs/clean.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | ############# 4 | # clean up project outputs and temporary files 5 | ############# 6 | 7 | # required modules 8 | import os 9 | 10 | 11 | ################## 12 | # helper functions 13 | ################## 14 | 15 | ######### 16 | def removeFolder(foldername): 17 | """ 18 | delete folder and content 19 | """ 20 | 21 | #if folder exists 22 | if os.path.exists(foldername): 23 | # recursively remove files in folder 24 | for root, dirs, files in os.walk(foldername, topdown=False): 25 | for name in files: 26 | os.remove(os.path.join(root, name)) 27 | for name in dirs: 28 | os.rmdir(os.path.join(root, name)) 29 | 30 | # delete folder itself 31 | os.rmdir(foldername) 32 | # end removeFolder() 33 | 34 | 35 | ######### 36 | def removeFile(path=os.curdir, pattern='XYX'): 37 | """ 38 | delete file ending with pattern 39 | """ 40 | if os.path.exists(path): 41 | for filename in os.listdir(path): 42 | if filename.endswith(pattern): 43 | os.remove(os.path.join(path, filename)) 44 | #print(filename) 45 | # end removeFile() 46 | 47 | 48 | 49 | ################## 50 | # main program 51 | ################## 52 | 53 | removeFile('.','Makefile') 54 | removeFile('.','.DS_Store') 55 | removeFile('./STVD_Cosmic','.DS_Store') 56 | removeFile('.','*.TMP') 57 | removeFile('./STVD_Cosmic','.TMP') 58 | removeFile('./STVD_Cosmic','.spy') 59 | #removeFile('./STVD_Cosmic','.dep') 60 | removeFile('./STVD_Cosmic','.pdb') 61 | removeFile('./STVD_Cosmic','.wdb') 62 | #removeFile('./STVD_Cosmic','.wed') 63 | removeFolder('./-p') 64 | removeFolder('./output') 65 | removeFolder('./STVD_Cosmic/Release') 66 | removeFolder('./STVD_Cosmic/Debug') 67 | 68 | # END OF MODULE 69 | 70 | -------------------------------------------------------------------------------- /Projects/Libraries_Examples/DigPoti-AD5280/clean.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | ############# 4 | # clean up project outputs and temporary files 5 | ############# 6 | 7 | # required modules 8 | import os 9 | 10 | 11 | ################## 12 | # helper functions 13 | ################## 14 | 15 | ######### 16 | def removeFolder(foldername): 17 | """ 18 | delete folder and content 19 | """ 20 | 21 | #if folder exists 22 | if os.path.exists(foldername): 23 | # recursively remove files in folder 24 | for root, dirs, files in os.walk(foldername, topdown=False): 25 | for name in files: 26 | os.remove(os.path.join(root, name)) 27 | for name in dirs: 28 | os.rmdir(os.path.join(root, name)) 29 | 30 | # delete folder itself 31 | os.rmdir(foldername) 32 | # end removeFolder() 33 | 34 | 35 | ######### 36 | def removeFile(path=os.curdir, pattern='XYX'): 37 | """ 38 | delete file ending with pattern 39 | """ 40 | if os.path.exists(path): 41 | for filename in os.listdir(path): 42 | if filename.endswith(pattern): 43 | os.remove(os.path.join(path, filename)) 44 | #print(filename) 45 | # end removeFile() 46 | 47 | 48 | 49 | ################## 50 | # main program 51 | ################## 52 | 53 | removeFile('.','Makefile') 54 | removeFile('.','.DS_Store') 55 | removeFile('./STVD_Cosmic','.DS_Store') 56 | removeFile('.','*.TMP') 57 | removeFile('./STVD_Cosmic','.TMP') 58 | removeFile('./STVD_Cosmic','.spy') 59 | #removeFile('./STVD_Cosmic','.dep') 60 | removeFile('./STVD_Cosmic','.pdb') 61 | removeFile('./STVD_Cosmic','.wdb') 62 | #removeFile('./STVD_Cosmic','.wed') 63 | removeFolder('./-p') 64 | removeFolder('./output') 65 | removeFolder('./STVD_Cosmic/Release') 66 | removeFolder('./STVD_Cosmic/Debug') 67 | 68 | # END OF MODULE 69 | 70 | -------------------------------------------------------------------------------- /Projects/Libraries_Examples/DigPoti-AD5282/clean.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | ############# 4 | # clean up project outputs and temporary files 5 | ############# 6 | 7 | # required modules 8 | import os 9 | 10 | 11 | ################## 12 | # helper functions 13 | ################## 14 | 15 | ######### 16 | def removeFolder(foldername): 17 | """ 18 | delete folder and content 19 | """ 20 | 21 | #if folder exists 22 | if os.path.exists(foldername): 23 | # recursively remove files in folder 24 | for root, dirs, files in os.walk(foldername, topdown=False): 25 | for name in files: 26 | os.remove(os.path.join(root, name)) 27 | for name in dirs: 28 | os.rmdir(os.path.join(root, name)) 29 | 30 | # delete folder itself 31 | os.rmdir(foldername) 32 | # end removeFolder() 33 | 34 | 35 | ######### 36 | def removeFile(path=os.curdir, pattern='XYX'): 37 | """ 38 | delete file ending with pattern 39 | """ 40 | if os.path.exists(path): 41 | for filename in os.listdir(path): 42 | if filename.endswith(pattern): 43 | os.remove(os.path.join(path, filename)) 44 | #print(filename) 45 | # end removeFile() 46 | 47 | 48 | 49 | ################## 50 | # main program 51 | ################## 52 | 53 | removeFile('.','Makefile') 54 | removeFile('.','.DS_Store') 55 | removeFile('./STVD_Cosmic','.DS_Store') 56 | removeFile('.','*.TMP') 57 | removeFile('./STVD_Cosmic','.TMP') 58 | removeFile('./STVD_Cosmic','.spy') 59 | #removeFile('./STVD_Cosmic','.dep') 60 | removeFile('./STVD_Cosmic','.pdb') 61 | removeFile('./STVD_Cosmic','.wdb') 62 | #removeFile('./STVD_Cosmic','.wed') 63 | removeFolder('./-p') 64 | removeFolder('./output') 65 | removeFolder('./STVD_Cosmic/Release') 66 | removeFolder('./STVD_Cosmic/Debug') 67 | 68 | # END OF MODULE 69 | 70 | -------------------------------------------------------------------------------- /Projects/Libraries_Examples/LCD-BTHQ21605V/clean.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | ############# 4 | # clean up project outputs and temporary files 5 | ############# 6 | 7 | # required modules 8 | import os 9 | 10 | 11 | ################## 12 | # helper functions 13 | ################## 14 | 15 | ######### 16 | def removeFolder(foldername): 17 | """ 18 | delete folder and content 19 | """ 20 | 21 | #if folder exists 22 | if os.path.exists(foldername): 23 | # recursively remove files in folder 24 | for root, dirs, files in os.walk(foldername, topdown=False): 25 | for name in files: 26 | os.remove(os.path.join(root, name)) 27 | for name in dirs: 28 | os.rmdir(os.path.join(root, name)) 29 | 30 | # delete folder itself 31 | os.rmdir(foldername) 32 | # end removeFolder() 33 | 34 | 35 | ######### 36 | def removeFile(path=os.curdir, pattern='XYX'): 37 | """ 38 | delete file ending with pattern 39 | """ 40 | if os.path.exists(path): 41 | for filename in os.listdir(path): 42 | if filename.endswith(pattern): 43 | os.remove(os.path.join(path, filename)) 44 | #print(filename) 45 | # end removeFile() 46 | 47 | 48 | 49 | ################## 50 | # main program 51 | ################## 52 | 53 | removeFile('.','Makefile') 54 | removeFile('.','.DS_Store') 55 | removeFile('./STVD_Cosmic','.DS_Store') 56 | removeFile('.','*.TMP') 57 | removeFile('./STVD_Cosmic','.TMP') 58 | removeFile('./STVD_Cosmic','.spy') 59 | #removeFile('./STVD_Cosmic','.dep') 60 | removeFile('./STVD_Cosmic','.pdb') 61 | removeFile('./STVD_Cosmic','.wdb') 62 | #removeFile('./STVD_Cosmic','.wed') 63 | removeFolder('./-p') 64 | removeFolder('./output') 65 | removeFolder('./STVD_Cosmic/Release') 66 | removeFolder('./STVD_Cosmic/Debug') 67 | 68 | # END OF MODULE 69 | 70 | -------------------------------------------------------------------------------- /Projects/Libraries_Examples/SD-card_petitFS/clean.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | ############# 4 | # clean up project outputs and temporary files 5 | ############# 6 | 7 | # required modules 8 | import os 9 | 10 | 11 | ################## 12 | # helper functions 13 | ################## 14 | 15 | ######### 16 | def removeFolder(foldername): 17 | """ 18 | delete folder and content 19 | """ 20 | 21 | #if folder exists 22 | if os.path.exists(foldername): 23 | # recursively remove files in folder 24 | for root, dirs, files in os.walk(foldername, topdown=False): 25 | for name in files: 26 | os.remove(os.path.join(root, name)) 27 | for name in dirs: 28 | os.rmdir(os.path.join(root, name)) 29 | 30 | # delete folder itself 31 | os.rmdir(foldername) 32 | # end removeFolder() 33 | 34 | 35 | ######### 36 | def removeFile(path=os.curdir, pattern='XYX'): 37 | """ 38 | delete file ending with pattern 39 | """ 40 | if os.path.exists(path): 41 | for filename in os.listdir(path): 42 | if filename.endswith(pattern): 43 | os.remove(os.path.join(path, filename)) 44 | #print(filename) 45 | # end removeFile() 46 | 47 | 48 | 49 | ################## 50 | # main program 51 | ################## 52 | 53 | removeFile('.','Makefile') 54 | removeFile('.','.DS_Store') 55 | removeFile('./STVD_Cosmic','.DS_Store') 56 | removeFile('.','*.TMP') 57 | removeFile('./STVD_Cosmic','.TMP') 58 | removeFile('./STVD_Cosmic','.spy') 59 | #removeFile('./STVD_Cosmic','.dep') 60 | removeFile('./STVD_Cosmic','.pdb') 61 | removeFile('./STVD_Cosmic','.wdb') 62 | #removeFile('./STVD_Cosmic','.wed') 63 | removeFolder('./-p') 64 | removeFolder('./output') 65 | removeFolder('./STVD_Cosmic/Release') 66 | removeFolder('./STVD_Cosmic/Debug') 67 | 68 | # END OF MODULE 69 | 70 | --------------------------------------------------------------------------------