add spl, first tries programming

This commit is contained in:
seppl
2025-06-28 16:14:14 +02:00
parent 2155e2b176
commit 012355c2e8
104 changed files with 58111 additions and 3 deletions

View File

@@ -0,0 +1,349 @@
1 ;--------------------------------------------------------
2 ; File Created by SDCC : free open source ISO C Compiler
3 ; Version 4.5.0 #15242 (Linux)
4 ;--------------------------------------------------------
5 .module stm8l15x_gpio
6
7 ;--------------------------------------------------------
8 ; Public variables in this module
9 ;--------------------------------------------------------
10 .globl _GPIO_DeInit
11 .globl _GPIO_Init
12 .globl _GPIO_ExternalPullUpConfig
13 .globl _GPIO_Write
14 .globl _GPIO_WriteBit
15 .globl _GPIO_SetBits
16 .globl _GPIO_ResetBits
17 .globl _GPIO_ToggleBits
18 .globl _GPIO_ReadInputData
19 .globl _GPIO_ReadOutputData
20 .globl _GPIO_ReadInputDataBit
21 .globl _GPIO_ReadOutputDataBit
22 ;--------------------------------------------------------
23 ; ram data
24 ;--------------------------------------------------------
25 .area DATA
26 ;--------------------------------------------------------
27 ; ram data
28 ;--------------------------------------------------------
29 .area INITIALIZED
30 ;--------------------------------------------------------
31 ; absolute external ram data
32 ;--------------------------------------------------------
33 .area DABS (ABS)
34
35 ; default segment ordering for linker
36 .area HOME
37 .area GSINIT
38 .area GSFINAL
39 .area CONST
40 .area INITIALIZER
41 .area CODE
42
43 ;--------------------------------------------------------
44 ; global & static initialisations
45 ;--------------------------------------------------------
46 .area HOME
47 .area GSINIT
48 .area GSFINAL
49 .area GSINIT
50 ;--------------------------------------------------------
51 ; Home
52 ;--------------------------------------------------------
53 .area HOME
54 .area HOME
55 ;--------------------------------------------------------
56 ; code
57 ;--------------------------------------------------------
58 .area CODE
59 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 96: void GPIO_DeInit(GPIO_TypeDef* GPIOx)
60 ; -----------------------------------------
61 ; function GPIO_DeInit
62 ; -----------------------------------------
00881B 63 _GPIO_DeInit:
64 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 98: GPIOx->CR2 = GPIO_CR2_RESET_VALUE; /* Reset Control Register 2 */
00881B 90 93 [ 1] 65 ldw y, x
00881D 6F 04 [ 1] 66 clr (0x0004, x)
67 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 99: GPIOx->ODR = GPIO_ODR_RESET_VALUE; /* Reset Output Data Register */
00881F 90 7F [ 1] 68 clr (y)
69 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 100: GPIOx->DDR = GPIO_DDR_RESET_VALUE; /* Reset Data Direction Register */
008821 93 [ 1] 70 ldw x, y
008822 6F 02 [ 1] 71 clr (0x02, x)
72 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 101: GPIOx->CR1 = GPIO_CR1_RESET_VALUE; /* Reset Control Register 1 */
008824 93 [ 1] 73 ldw x, y
008825 6F 03 [ 1] 74 clr (0x0003, x)
75 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 102: }
008827 81 [ 4] 76 ret
77 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 133: void GPIO_Init(GPIO_TypeDef* GPIOx, uint8_t GPIO_Pin, GPIO_Mode_TypeDef GPIO_Mode)
78 ; -----------------------------------------
79 ; function GPIO_Init
80 ; -----------------------------------------
008828 81 _GPIO_Init:
008828 52 08 [ 2] 82 sub sp, #8
00882A 1F 07 [ 2] 83 ldw (0x07, sp), x
00882C 6B 06 [ 1] 84 ld (0x06, sp), a
85 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 143: GPIOx->CR2 &= (uint8_t)(~(GPIO_Pin));
00882E 1E 07 [ 2] 86 ldw x, (0x07, sp)
008830 1C 00 04 [ 2] 87 addw x, #0x0004
008833 1F 01 [ 2] 88 ldw (0x01, sp), x
008835 F6 [ 1] 89 ld a, (x)
008836 88 [ 1] 90 push a
008837 7B 07 [ 1] 91 ld a, (0x07, sp)
008839 43 [ 1] 92 cpl a
00883A 6B 04 [ 1] 93 ld (0x04, sp), a
00883C 84 [ 1] 94 pop a
00883D 14 03 [ 1] 95 and a, (0x03, sp)
00883F 1E 01 [ 2] 96 ldw x, (0x01, sp)
008841 F7 [ 1] 97 ld (x), a
98 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 159: GPIOx->DDR |= GPIO_Pin;
008842 1E 07 [ 2] 99 ldw x, (0x07, sp)
008844 5C [ 1] 100 incw x
008845 5C [ 1] 101 incw x
008846 1F 04 [ 2] 102 ldw (0x04, sp), x
103 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 149: if ((((uint8_t)(GPIO_Mode)) & (uint8_t)0x80) != (uint8_t)0x00) /* Output mode */
008848 0D 0B [ 1] 104 tnz (0x0b, sp)
00884A 2A 1D [ 1] 105 jrpl 00105$
106 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 153: GPIOx->ODR |= GPIO_Pin;
00884C 1E 07 [ 2] 107 ldw x, (0x07, sp)
00884E F6 [ 1] 108 ld a, (x)
109 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 151: if ((((uint8_t)(GPIO_Mode)) & (uint8_t)0x10) != (uint8_t)0x00) /* High level */
00884F 88 [ 1] 110 push a
008850 7B 0C [ 1] 111 ld a, (0x0c, sp)
008852 A5 10 [ 1] 112 bcp a, #0x10
008854 84 [ 1] 113 pop a
008855 27 05 [ 1] 114 jreq 00102$
115 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 153: GPIOx->ODR |= GPIO_Pin;
008857 1A 06 [ 1] 116 or a, (0x06, sp)
008859 F7 [ 1] 117 ld (x), a
00885A 20 03 [ 2] 118 jra 00103$
00885C 119 00102$:
120 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 156: GPIOx->ODR &= (uint8_t)(~(GPIO_Pin));
00885C 14 03 [ 1] 121 and a, (0x03, sp)
00885E F7 [ 1] 122 ld (x), a
00885F 123 00103$:
124 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 159: GPIOx->DDR |= GPIO_Pin;
00885F 1E 04 [ 2] 125 ldw x, (0x04, sp)
008861 F6 [ 1] 126 ld a, (x)
008862 1A 06 [ 1] 127 or a, (0x06, sp)
008864 1E 04 [ 2] 128 ldw x, (0x04, sp)
008866 F7 [ 1] 129 ld (x), a
008867 20 08 [ 2] 130 jra 00106$
008869 131 00105$:
132 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 163: GPIOx->DDR &= (uint8_t)(~(GPIO_Pin));
008869 1E 04 [ 2] 133 ldw x, (0x04, sp)
00886B F6 [ 1] 134 ld a, (x)
00886C 14 03 [ 1] 135 and a, (0x03, sp)
00886E 1E 04 [ 2] 136 ldw x, (0x04, sp)
008870 F7 [ 1] 137 ld (x), a
008871 138 00106$:
139 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 172: GPIOx->CR1 |= GPIO_Pin;
008871 1E 07 [ 2] 140 ldw x, (0x07, sp)
008873 1C 00 03 [ 2] 141 addw x, #0x0003
008876 F6 [ 1] 142 ld a, (x)
143 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 170: if ((((uint8_t)(GPIO_Mode)) & (uint8_t)0x40) != (uint8_t)0x00) /* Pull-Up or Push-Pull */
008877 88 [ 1] 144 push a
008878 7B 0C [ 1] 145 ld a, (0x0c, sp)
00887A A5 40 [ 1] 146 bcp a, #0x40
00887C 84 [ 1] 147 pop a
00887D 27 05 [ 1] 148 jreq 00108$
149 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 172: GPIOx->CR1 |= GPIO_Pin;
00887F 1A 06 [ 1] 150 or a, (0x06, sp)
008881 F7 [ 1] 151 ld (x), a
008882 20 03 [ 2] 152 jra 00109$
008884 153 00108$:
154 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 175: GPIOx->CR1 &= (uint8_t)(~(GPIO_Pin));
008884 14 03 [ 1] 155 and a, (0x03, sp)
008886 F7 [ 1] 156 ld (x), a
008887 157 00109$:
158 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 143: GPIOx->CR2 &= (uint8_t)(~(GPIO_Pin));
008887 1E 01 [ 2] 159 ldw x, (0x01, sp)
008889 F6 [ 1] 160 ld a, (x)
161 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 182: if ((((uint8_t)(GPIO_Mode)) & (uint8_t)0x20) != (uint8_t)0x00) /* Interrupt or Slow slope */
00888A 88 [ 1] 162 push a
00888B 7B 0C [ 1] 163 ld a, (0x0c, sp)
00888D A5 20 [ 1] 164 bcp a, #0x20
00888F 84 [ 1] 165 pop a
008890 27 07 [ 1] 166 jreq 00111$
167 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 184: GPIOx->CR2 |= GPIO_Pin;
008892 1A 06 [ 1] 168 or a, (0x06, sp)
008894 1E 01 [ 2] 169 ldw x, (0x01, sp)
008896 F7 [ 1] 170 ld (x), a
008897 20 05 [ 2] 171 jra 00113$
008899 172 00111$:
173 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 187: GPIOx->CR2 &= (uint8_t)(~(GPIO_Pin));
008899 14 03 [ 1] 174 and a, (0x03, sp)
00889B 1E 01 [ 2] 175 ldw x, (0x01, sp)
00889D F7 [ 1] 176 ld (x), a
00889E 177 00113$:
178 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 190: }
00889E 5B 08 [ 2] 179 addw sp, #8
0088A0 85 [ 2] 180 popw x
0088A1 84 [ 1] 181 pop a
0088A2 FC [ 2] 182 jp (x)
183 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 209: void GPIO_ExternalPullUpConfig(GPIO_TypeDef* GPIOx, uint8_t GPIO_Pin, FunctionalState NewState)
184 ; -----------------------------------------
185 ; function GPIO_ExternalPullUpConfig
186 ; -----------------------------------------
0088A3 187 _GPIO_ExternalPullUpConfig:
0088A3 88 [ 1] 188 push a
189 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 217: GPIOx->CR1 |= GPIO_Pin;
0088A4 1C 00 03 [ 2] 190 addw x, #0x0003
0088A7 88 [ 1] 191 push a
0088A8 F6 [ 1] 192 ld a, (x)
0088A9 6B 02 [ 1] 193 ld (0x02, sp), a
0088AB 84 [ 1] 194 pop a
195 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 215: if (NewState != DISABLE) /* External Pull-Up Set*/
0088AC 0D 04 [ 1] 196 tnz (0x04, sp)
0088AE 27 05 [ 1] 197 jreq 00102$
198 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 217: GPIOx->CR1 |= GPIO_Pin;
0088B0 1A 01 [ 1] 199 or a, (0x01, sp)
0088B2 F7 [ 1] 200 ld (x), a
0088B3 20 04 [ 2] 201 jra 00104$
0088B5 202 00102$:
203 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 220: GPIOx->CR1 &= (uint8_t)(~(GPIO_Pin));
0088B5 43 [ 1] 204 cpl a
0088B6 14 01 [ 1] 205 and a, (0x01, sp)
0088B8 F7 [ 1] 206 ld (x), a
0088B9 207 00104$:
208 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 222: }
0088B9 84 [ 1] 209 pop a
0088BA 85 [ 2] 210 popw x
0088BB 84 [ 1] 211 pop a
0088BC FC [ 2] 212 jp (x)
213 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 248: void GPIO_Write(GPIO_TypeDef* GPIOx, uint8_t GPIO_PortVal)
214 ; -----------------------------------------
215 ; function GPIO_Write
216 ; -----------------------------------------
0088BD 217 _GPIO_Write:
218 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 250: GPIOx->ODR = GPIO_PortVal;
0088BD F7 [ 1] 219 ld (x), a
220 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 251: }
0088BE 81 [ 4] 221 ret
222 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 270: void GPIO_WriteBit(GPIO_TypeDef* GPIOx, GPIO_Pin_TypeDef GPIO_Pin, BitAction GPIO_BitVal)
223 ; -----------------------------------------
224 ; function GPIO_WriteBit
225 ; -----------------------------------------
0088BF 226 _GPIO_WriteBit:
0088BF 88 [ 1] 227 push a
228 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 278: GPIOx->ODR |= GPIO_Pin;
0088C0 88 [ 1] 229 push a
0088C1 F6 [ 1] 230 ld a, (x)
0088C2 6B 02 [ 1] 231 ld (0x02, sp), a
0088C4 84 [ 1] 232 pop a
233 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 276: if (GPIO_BitVal != RESET)
0088C5 0D 04 [ 1] 234 tnz (0x04, sp)
0088C7 27 05 [ 1] 235 jreq 00102$
236 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 278: GPIOx->ODR |= GPIO_Pin;
0088C9 1A 01 [ 1] 237 or a, (0x01, sp)
0088CB F7 [ 1] 238 ld (x), a
0088CC 20 04 [ 2] 239 jra 00104$
0088CE 240 00102$:
241 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 283: GPIOx->ODR &= (uint8_t)(~GPIO_Pin);
0088CE 43 [ 1] 242 cpl a
0088CF 14 01 [ 1] 243 and a, (0x01, sp)
0088D1 F7 [ 1] 244 ld (x), a
0088D2 245 00104$:
246 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 285: }
0088D2 84 [ 1] 247 pop a
0088D3 85 [ 2] 248 popw x
0088D4 84 [ 1] 249 pop a
0088D5 FC [ 2] 250 jp (x)
251 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 303: void GPIO_SetBits(GPIO_TypeDef* GPIOx, uint8_t GPIO_Pin)
252 ; -----------------------------------------
253 ; function GPIO_SetBits
254 ; -----------------------------------------
0088D6 255 _GPIO_SetBits:
0088D6 88 [ 1] 256 push a
0088D7 6B 01 [ 1] 257 ld (0x01, sp), a
258 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 305: GPIOx->ODR |= GPIO_Pin;
0088D9 F6 [ 1] 259 ld a, (x)
0088DA 1A 01 [ 1] 260 or a, (0x01, sp)
0088DC F7 [ 1] 261 ld (x), a
262 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 306: }
0088DD 84 [ 1] 263 pop a
0088DE 81 [ 4] 264 ret
265 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 324: void GPIO_ResetBits(GPIO_TypeDef* GPIOx, uint8_t GPIO_Pin)
266 ; -----------------------------------------
267 ; function GPIO_ResetBits
268 ; -----------------------------------------
0088DF 269 _GPIO_ResetBits:
0088DF 88 [ 1] 270 push a
271 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 326: GPIOx->ODR &= (uint8_t)(~GPIO_Pin);
0088E0 88 [ 1] 272 push a
0088E1 F6 [ 1] 273 ld a, (x)
0088E2 6B 02 [ 1] 274 ld (0x02, sp), a
0088E4 84 [ 1] 275 pop a
0088E5 43 [ 1] 276 cpl a
0088E6 14 01 [ 1] 277 and a, (0x01, sp)
0088E8 F7 [ 1] 278 ld (x), a
279 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 327: }
0088E9 84 [ 1] 280 pop a
0088EA 81 [ 4] 281 ret
282 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 336: void GPIO_ToggleBits(GPIO_TypeDef* GPIOx, uint8_t GPIO_Pin)
283 ; -----------------------------------------
284 ; function GPIO_ToggleBits
285 ; -----------------------------------------
0088EB 286 _GPIO_ToggleBits:
0088EB 88 [ 1] 287 push a
0088EC 6B 01 [ 1] 288 ld (0x01, sp), a
289 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 338: GPIOx->ODR ^= GPIO_Pin;
0088EE F6 [ 1] 290 ld a, (x)
0088EF 18 01 [ 1] 291 xor a, (0x01, sp)
0088F1 F7 [ 1] 292 ld (x), a
293 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 339: }
0088F2 84 [ 1] 294 pop a
0088F3 81 [ 4] 295 ret
296 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 347: uint8_t GPIO_ReadInputData(GPIO_TypeDef* GPIOx)
297 ; -----------------------------------------
298 ; function GPIO_ReadInputData
299 ; -----------------------------------------
0088F4 300 _GPIO_ReadInputData:
301 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 349: return ((uint8_t)GPIOx->IDR);
0088F4 E6 01 [ 1] 302 ld a, (0x1, x)
303 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 350: }
0088F6 81 [ 4] 304 ret
305 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 358: uint8_t GPIO_ReadOutputData(GPIO_TypeDef* GPIOx)
306 ; -----------------------------------------
307 ; function GPIO_ReadOutputData
308 ; -----------------------------------------
0088F7 309 _GPIO_ReadOutputData:
310 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 360: return ((uint8_t)GPIOx->ODR);
0088F7 F6 [ 1] 311 ld a, (x)
312 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 361: }
0088F8 81 [ 4] 313 ret
314 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 378: BitStatus GPIO_ReadInputDataBit(GPIO_TypeDef* GPIOx, GPIO_Pin_TypeDef GPIO_Pin)
315 ; -----------------------------------------
316 ; function GPIO_ReadInputDataBit
317 ; -----------------------------------------
0088F9 318 _GPIO_ReadInputDataBit:
0088F9 88 [ 1] 319 push a
0088FA 6B 01 [ 1] 320 ld (0x01, sp), a
321 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 380: return ((BitStatus)(GPIOx->IDR & (uint8_t)GPIO_Pin));
0088FC E6 01 [ 1] 322 ld a, (0x1, x)
0088FE 14 01 [ 1] 323 and a, (0x01, sp)
008900 40 [ 1] 324 neg a
008901 4F [ 1] 325 clr a
008902 49 [ 1] 326 rlc a
327 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 381: }
008903 5B 01 [ 2] 328 addw sp, #1
008905 81 [ 4] 329 ret
330 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 389: BitStatus GPIO_ReadOutputDataBit(GPIO_TypeDef* GPIOx, GPIO_Pin_TypeDef GPIO_Pin)
331 ; -----------------------------------------
332 ; function GPIO_ReadOutputDataBit
333 ; -----------------------------------------
008906 334 _GPIO_ReadOutputDataBit:
008906 88 [ 1] 335 push a
008907 6B 01 [ 1] 336 ld (0x01, sp), a
337 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 391: return ((BitStatus)(GPIOx->ODR & (uint8_t)GPIO_Pin));
008909 F6 [ 1] 338 ld a, (x)
00890A 14 01 [ 1] 339 and a, (0x01, sp)
00890C 40 [ 1] 340 neg a
00890D 4F [ 1] 341 clr a
00890E 49 [ 1] 342 rlc a
343 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 392: }
00890F 5B 01 [ 2] 344 addw sp, #1
008911 81 [ 4] 345 ret
346 .area CODE
347 .area CONST
348 .area INITIALIZER
349 .area CABS (ABS)