Files
rosaled/firmware/STM8L15X_LD/stm8l15x_gpio.rst
seppl a3ccaae6cc ..
2025-06-30 20:58:09 +02:00

350 lines
24 KiB
ReStructuredText

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 ; -----------------------------------------
00848F 63 _GPIO_DeInit:
64 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 98: GPIOx->CR2 = GPIO_CR2_RESET_VALUE; /* Reset Control Register 2 */
00848F 90 93 [ 1] 65 ldw y, x
008491 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 */
008493 90 7F [ 1] 68 clr (y)
69 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 100: GPIOx->DDR = GPIO_DDR_RESET_VALUE; /* Reset Data Direction Register */
008495 93 [ 1] 70 ldw x, y
008496 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 */
008498 93 [ 1] 73 ldw x, y
008499 6F 03 [ 1] 74 clr (0x0003, x)
75 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 102: }
00849B 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 ; -----------------------------------------
00849C 81 _GPIO_Init:
00849C 52 08 [ 2] 82 sub sp, #8
00849E 1F 07 [ 2] 83 ldw (0x07, sp), x
0084A0 6B 06 [ 1] 84 ld (0x06, sp), a
85 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 143: GPIOx->CR2 &= (uint8_t)(~(GPIO_Pin));
0084A2 1E 07 [ 2] 86 ldw x, (0x07, sp)
0084A4 1C 00 04 [ 2] 87 addw x, #0x0004
0084A7 1F 01 [ 2] 88 ldw (0x01, sp), x
0084A9 F6 [ 1] 89 ld a, (x)
0084AA 88 [ 1] 90 push a
0084AB 7B 07 [ 1] 91 ld a, (0x07, sp)
0084AD 43 [ 1] 92 cpl a
0084AE 6B 04 [ 1] 93 ld (0x04, sp), a
0084B0 84 [ 1] 94 pop a
0084B1 14 03 [ 1] 95 and a, (0x03, sp)
0084B3 1E 01 [ 2] 96 ldw x, (0x01, sp)
0084B5 F7 [ 1] 97 ld (x), a
98 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 159: GPIOx->DDR |= GPIO_Pin;
0084B6 1E 07 [ 2] 99 ldw x, (0x07, sp)
0084B8 5C [ 1] 100 incw x
0084B9 5C [ 1] 101 incw x
0084BA 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 */
0084BC 0D 0B [ 1] 104 tnz (0x0b, sp)
0084BE 2A 1D [ 1] 105 jrpl 00105$
106 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 153: GPIOx->ODR |= GPIO_Pin;
0084C0 1E 07 [ 2] 107 ldw x, (0x07, sp)
0084C2 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 */
0084C3 88 [ 1] 110 push a
0084C4 7B 0C [ 1] 111 ld a, (0x0c, sp)
0084C6 A5 10 [ 1] 112 bcp a, #0x10
0084C8 84 [ 1] 113 pop a
0084C9 27 05 [ 1] 114 jreq 00102$
115 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 153: GPIOx->ODR |= GPIO_Pin;
0084CB 1A 06 [ 1] 116 or a, (0x06, sp)
0084CD F7 [ 1] 117 ld (x), a
0084CE 20 03 [ 2] 118 jra 00103$
0084D0 119 00102$:
120 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 156: GPIOx->ODR &= (uint8_t)(~(GPIO_Pin));
0084D0 14 03 [ 1] 121 and a, (0x03, sp)
0084D2 F7 [ 1] 122 ld (x), a
0084D3 123 00103$:
124 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 159: GPIOx->DDR |= GPIO_Pin;
0084D3 1E 04 [ 2] 125 ldw x, (0x04, sp)
0084D5 F6 [ 1] 126 ld a, (x)
0084D6 1A 06 [ 1] 127 or a, (0x06, sp)
0084D8 1E 04 [ 2] 128 ldw x, (0x04, sp)
0084DA F7 [ 1] 129 ld (x), a
0084DB 20 08 [ 2] 130 jra 00106$
0084DD 131 00105$:
132 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 163: GPIOx->DDR &= (uint8_t)(~(GPIO_Pin));
0084DD 1E 04 [ 2] 133 ldw x, (0x04, sp)
0084DF F6 [ 1] 134 ld a, (x)
0084E0 14 03 [ 1] 135 and a, (0x03, sp)
0084E2 1E 04 [ 2] 136 ldw x, (0x04, sp)
0084E4 F7 [ 1] 137 ld (x), a
0084E5 138 00106$:
139 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 172: GPIOx->CR1 |= GPIO_Pin;
0084E5 1E 07 [ 2] 140 ldw x, (0x07, sp)
0084E7 1C 00 03 [ 2] 141 addw x, #0x0003
0084EA 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 */
0084EB 88 [ 1] 144 push a
0084EC 7B 0C [ 1] 145 ld a, (0x0c, sp)
0084EE A5 40 [ 1] 146 bcp a, #0x40
0084F0 84 [ 1] 147 pop a
0084F1 27 05 [ 1] 148 jreq 00108$
149 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 172: GPIOx->CR1 |= GPIO_Pin;
0084F3 1A 06 [ 1] 150 or a, (0x06, sp)
0084F5 F7 [ 1] 151 ld (x), a
0084F6 20 03 [ 2] 152 jra 00109$
0084F8 153 00108$:
154 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 175: GPIOx->CR1 &= (uint8_t)(~(GPIO_Pin));
0084F8 14 03 [ 1] 155 and a, (0x03, sp)
0084FA F7 [ 1] 156 ld (x), a
0084FB 157 00109$:
158 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 143: GPIOx->CR2 &= (uint8_t)(~(GPIO_Pin));
0084FB 1E 01 [ 2] 159 ldw x, (0x01, sp)
0084FD 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 */
0084FE 88 [ 1] 162 push a
0084FF 7B 0C [ 1] 163 ld a, (0x0c, sp)
008501 A5 20 [ 1] 164 bcp a, #0x20
008503 84 [ 1] 165 pop a
008504 27 07 [ 1] 166 jreq 00111$
167 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 184: GPIOx->CR2 |= GPIO_Pin;
008506 1A 06 [ 1] 168 or a, (0x06, sp)
008508 1E 01 [ 2] 169 ldw x, (0x01, sp)
00850A F7 [ 1] 170 ld (x), a
00850B 20 05 [ 2] 171 jra 00113$
00850D 172 00111$:
173 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 187: GPIOx->CR2 &= (uint8_t)(~(GPIO_Pin));
00850D 14 03 [ 1] 174 and a, (0x03, sp)
00850F 1E 01 [ 2] 175 ldw x, (0x01, sp)
008511 F7 [ 1] 176 ld (x), a
008512 177 00113$:
178 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 190: }
008512 5B 08 [ 2] 179 addw sp, #8
008514 85 [ 2] 180 popw x
008515 84 [ 1] 181 pop a
008516 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 ; -----------------------------------------
008517 187 _GPIO_ExternalPullUpConfig:
008517 88 [ 1] 188 push a
189 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 217: GPIOx->CR1 |= GPIO_Pin;
008518 1C 00 03 [ 2] 190 addw x, #0x0003
00851B 88 [ 1] 191 push a
00851C F6 [ 1] 192 ld a, (x)
00851D 6B 02 [ 1] 193 ld (0x02, sp), a
00851F 84 [ 1] 194 pop a
195 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 215: if (NewState != DISABLE) /* External Pull-Up Set*/
008520 0D 04 [ 1] 196 tnz (0x04, sp)
008522 27 05 [ 1] 197 jreq 00102$
198 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 217: GPIOx->CR1 |= GPIO_Pin;
008524 1A 01 [ 1] 199 or a, (0x01, sp)
008526 F7 [ 1] 200 ld (x), a
008527 20 04 [ 2] 201 jra 00104$
008529 202 00102$:
203 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 220: GPIOx->CR1 &= (uint8_t)(~(GPIO_Pin));
008529 43 [ 1] 204 cpl a
00852A 14 01 [ 1] 205 and a, (0x01, sp)
00852C F7 [ 1] 206 ld (x), a
00852D 207 00104$:
208 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 222: }
00852D 84 [ 1] 209 pop a
00852E 85 [ 2] 210 popw x
00852F 84 [ 1] 211 pop a
008530 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 ; -----------------------------------------
008531 217 _GPIO_Write:
218 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 250: GPIOx->ODR = GPIO_PortVal;
008531 F7 [ 1] 219 ld (x), a
220 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 251: }
008532 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 ; -----------------------------------------
008533 226 _GPIO_WriteBit:
008533 88 [ 1] 227 push a
228 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 278: GPIOx->ODR |= GPIO_Pin;
008534 88 [ 1] 229 push a
008535 F6 [ 1] 230 ld a, (x)
008536 6B 02 [ 1] 231 ld (0x02, sp), a
008538 84 [ 1] 232 pop a
233 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 276: if (GPIO_BitVal != RESET)
008539 0D 04 [ 1] 234 tnz (0x04, sp)
00853B 27 05 [ 1] 235 jreq 00102$
236 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 278: GPIOx->ODR |= GPIO_Pin;
00853D 1A 01 [ 1] 237 or a, (0x01, sp)
00853F F7 [ 1] 238 ld (x), a
008540 20 04 [ 2] 239 jra 00104$
008542 240 00102$:
241 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 283: GPIOx->ODR &= (uint8_t)(~GPIO_Pin);
008542 43 [ 1] 242 cpl a
008543 14 01 [ 1] 243 and a, (0x01, sp)
008545 F7 [ 1] 244 ld (x), a
008546 245 00104$:
246 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 285: }
008546 84 [ 1] 247 pop a
008547 85 [ 2] 248 popw x
008548 84 [ 1] 249 pop a
008549 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 ; -----------------------------------------
00854A 255 _GPIO_SetBits:
00854A 88 [ 1] 256 push a
00854B 6B 01 [ 1] 257 ld (0x01, sp), a
258 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 305: GPIOx->ODR |= GPIO_Pin;
00854D F6 [ 1] 259 ld a, (x)
00854E 1A 01 [ 1] 260 or a, (0x01, sp)
008550 F7 [ 1] 261 ld (x), a
262 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 306: }
008551 84 [ 1] 263 pop a
008552 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 ; -----------------------------------------
008553 269 _GPIO_ResetBits:
008553 88 [ 1] 270 push a
271 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 326: GPIOx->ODR &= (uint8_t)(~GPIO_Pin);
008554 88 [ 1] 272 push a
008555 F6 [ 1] 273 ld a, (x)
008556 6B 02 [ 1] 274 ld (0x02, sp), a
008558 84 [ 1] 275 pop a
008559 43 [ 1] 276 cpl a
00855A 14 01 [ 1] 277 and a, (0x01, sp)
00855C F7 [ 1] 278 ld (x), a
279 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 327: }
00855D 84 [ 1] 280 pop a
00855E 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 ; -----------------------------------------
00855F 286 _GPIO_ToggleBits:
00855F 88 [ 1] 287 push a
008560 6B 01 [ 1] 288 ld (0x01, sp), a
289 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 338: GPIOx->ODR ^= GPIO_Pin;
008562 F6 [ 1] 290 ld a, (x)
008563 18 01 [ 1] 291 xor a, (0x01, sp)
008565 F7 [ 1] 292 ld (x), a
293 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 339: }
008566 84 [ 1] 294 pop a
008567 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 ; -----------------------------------------
008568 300 _GPIO_ReadInputData:
301 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 349: return ((uint8_t)GPIOx->IDR);
008568 E6 01 [ 1] 302 ld a, (0x1, x)
303 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 350: }
00856A 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 ; -----------------------------------------
00856B 309 _GPIO_ReadOutputData:
310 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 360: return ((uint8_t)GPIOx->ODR);
00856B F6 [ 1] 311 ld a, (x)
312 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 361: }
00856C 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 ; -----------------------------------------
00856D 318 _GPIO_ReadInputDataBit:
00856D 88 [ 1] 319 push a
00856E 6B 01 [ 1] 320 ld (0x01, sp), a
321 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 380: return ((BitStatus)(GPIOx->IDR & (uint8_t)GPIO_Pin));
008570 E6 01 [ 1] 322 ld a, (0x1, x)
008572 14 01 [ 1] 323 and a, (0x01, sp)
008574 40 [ 1] 324 neg a
008575 4F [ 1] 325 clr a
008576 49 [ 1] 326 rlc a
327 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 381: }
008577 5B 01 [ 2] 328 addw sp, #1
008579 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 ; -----------------------------------------
00857A 334 _GPIO_ReadOutputDataBit:
00857A 88 [ 1] 335 push a
00857B 6B 01 [ 1] 336 ld (0x01, sp), a
337 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 391: return ((BitStatus)(GPIOx->ODR & (uint8_t)GPIO_Pin));
00857D F6 [ 1] 338 ld a, (x)
00857E 14 01 [ 1] 339 and a, (0x01, sp)
008580 40 [ 1] 340 neg a
008581 4F [ 1] 341 clr a
008582 49 [ 1] 342 rlc a
343 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 392: }
008583 5B 01 [ 2] 344 addw sp, #1
008585 81 [ 4] 345 ret
346 .area CODE
347 .area CONST
348 .area INITIALIZER
349 .area CABS (ABS)