1- ## ST Standard Library
1+ ## ST Standard Peripherie Library
22
3- Can be [ downloaded from the ST website]
4- (http://www.st.com/en/embedded-software/stsw-stm8069.html )
5- (free registration required). Don't miss the Examples folder within the
6- downloaded zip file. This is the most useful reference on using this library
7- and programming the STM8 in general.
3+ The Library an be [ downloaded from the ST
4+ website] ( http://www.st.com/en/embedded-software/stsw-stm8069.html ) (free
5+ registration required). A slightly older version is part of the [ STM8S_Teach
6+ presentation] ( https://github.com/VincentYChen/STM8teach/tree/master/code/Project/STM8S_StdPeriph_Examples ) ,
7+
8+ Don't miss the Examples folder within the downloaded
9+ zip file. This and [ Lujji's
10+ blog] ( https://lujji.github.io/blog/bare-metal-programming-stm8/ ) is the most
11+ useful reference on using this library and programming the STM8 in general.
812
913For use with SDCC the library needs to be patched:
1014
11- git clone https://github.com/g-gabber/STM8S_StdPeriph_Driver.git
12- git clone https://github.com/gicking/SPL_2.2.0_SDCC_patch.git
13- cp ../STM8S_SPL_2.2.0/Libraries/STM8S_StdPeriph_Driver/inc/stm8s.h .
14- patch -p1 < ../SPL_2.2.0_SDCC_patch/STM8_SPL_v2.2.0_SDCC.patch
15- cp -av ../STM8S_StdPeriph_Lib/Project/STM8S_StdPeriph_Template/stm8s_conf.h .
16- cp -av ../STM8S_StdPeriph_Lib/Project/STM8S_StdPeriph_Template/stm8s_it.h .
15+ ``` bash
16+ git clone https://github.com/g-gabber/STM8S_StdPeriph_Driver.git
17+ git clone https://github.com/gicking/SPL_2.2.0_SDCC_patch.git
18+ cp ../STM8S_SPL_2.2.0/Libraries/STM8S_StdPeriph_Driver/inc/stm8s.h .
19+ patch -p1 < ../SPL_2.2.0_SDCC_patch/STM8_SPL_v2.2.0_SDCC.patch
20+ cp -av ../STM8S_StdPeriph_Lib/Project/STM8S_StdPeriph_Template/stm8s_conf.h .
21+ cp -av ../STM8S_StdPeriph_Lib/Project/STM8S_StdPeriph_Template/stm8s_it.h .
22+ ```
1723
1824SDCC uses .rel as the file extension for its object files.
1925
@@ -82,16 +88,17 @@ The SPL folder in this archive contains a script `doit` to separate the
8288functions before compilation.
8389FIXME : description needed
8490
85- Erklärung wie zumindest die Interrupt-Vektoren in die eigene Datei kommen
86- können :
91+ A suggestion how to move at least the IRQ vectors away from the libray into
92+ the own source files :
8793http ://richs-words.blogspot.de/2010/09/stm8s-interrupt-handling.html
8894
8995
9096
9197# ## Interrupts
9298
93- Namen definiert in stm8s_itc.h
94- Interrupt-Routine definieren :
99+ Interrupt names are defined in stm8s_itc.h
100+
101+ Declaration of an interrupt function for SDCC :
95102
96103```c
97104/* UART1 TX */
@@ -100,15 +107,15 @@ void UART1_TX_IRQHandler(void) __interrupt(ITC_IRQ_UART1_TX)
100107}
101108```
102109
103- Jetzt muss noch das passende IRQ-Enable-Flag gesetzt werden und Interrupt
104- generell freigegeben werden, also hier:
110+ Set the matching IRQ enable flag and globally allow interrupts:
105111
106112``` c
107113UART1_ITConfig (UART1_IT_TXE, ENABLE);
108114enableInterrupts();
109115```
110116
111- Unklar ist, was die ITC-Prioritäten bewirken. Es geht jedenfalls auch ohne:
117+ Not sure about the meaning of the ITC priorities. It works even without
118+ them:
112119
113120```c
114121ITC_DeInit();
0 commit comments