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 ; ----------------------------------------- 000000 63 _GPIO_DeInit: 64 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 98: GPIOx->CR2 = GPIO_CR2_RESET_VALUE; /* Reset Control Register 2 */ 000000 90 93 [ 1] 65 ldw y, x 000002 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 */ 000004 90 7F [ 1] 68 clr (y) 69 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 100: GPIOx->DDR = GPIO_DDR_RESET_VALUE; /* Reset Data Direction Register */ 000006 93 [ 1] 70 ldw x, y 000007 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 */ 000009 93 [ 1] 73 ldw x, y 00000A 6F 03 [ 1] 74 clr (0x0003, x) 75 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 102: } 00000C 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 ; ----------------------------------------- 00000D 81 _GPIO_Init: 00000D 52 08 [ 2] 82 sub sp, #8 00000F 1F 07 [ 2] 83 ldw (0x07, sp), x 000011 6B 06 [ 1] 84 ld (0x06, sp), a 85 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 143: GPIOx->CR2 &= (uint8_t)(~(GPIO_Pin)); 000013 1E 07 [ 2] 86 ldw x, (0x07, sp) 000015 1C 00 04 [ 2] 87 addw x, #0x0004 000018 1F 01 [ 2] 88 ldw (0x01, sp), x 00001A F6 [ 1] 89 ld a, (x) 00001B 88 [ 1] 90 push a 00001C 7B 07 [ 1] 91 ld a, (0x07, sp) 00001E 43 [ 1] 92 cpl a 00001F 6B 04 [ 1] 93 ld (0x04, sp), a 000021 84 [ 1] 94 pop a 000022 14 03 [ 1] 95 and a, (0x03, sp) 000024 1E 01 [ 2] 96 ldw x, (0x01, sp) 000026 F7 [ 1] 97 ld (x), a 98 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 159: GPIOx->DDR |= GPIO_Pin; 000027 1E 07 [ 2] 99 ldw x, (0x07, sp) 000029 5C [ 1] 100 incw x 00002A 5C [ 1] 101 incw x 00002B 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 */ 00002D 0D 0B [ 1] 104 tnz (0x0b, sp) 00002F 2A 1D [ 1] 105 jrpl 00105$ 106 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 153: GPIOx->ODR |= GPIO_Pin; 000031 1E 07 [ 2] 107 ldw x, (0x07, sp) 000033 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 */ 000034 88 [ 1] 110 push a 000035 7B 0C [ 1] 111 ld a, (0x0c, sp) 000037 A5 10 [ 1] 112 bcp a, #0x10 000039 84 [ 1] 113 pop a 00003A 27 05 [ 1] 114 jreq 00102$ 115 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 153: GPIOx->ODR |= GPIO_Pin; 00003C 1A 06 [ 1] 116 or a, (0x06, sp) 00003E F7 [ 1] 117 ld (x), a 00003F 20 03 [ 2] 118 jra 00103$ 000041 119 00102$: 120 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 156: GPIOx->ODR &= (uint8_t)(~(GPIO_Pin)); 000041 14 03 [ 1] 121 and a, (0x03, sp) 000043 F7 [ 1] 122 ld (x), a 000044 123 00103$: 124 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 159: GPIOx->DDR |= GPIO_Pin; 000044 1E 04 [ 2] 125 ldw x, (0x04, sp) 000046 F6 [ 1] 126 ld a, (x) 000047 1A 06 [ 1] 127 or a, (0x06, sp) 000049 1E 04 [ 2] 128 ldw x, (0x04, sp) 00004B F7 [ 1] 129 ld (x), a 00004C 20 08 [ 2] 130 jra 00106$ 00004E 131 00105$: 132 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 163: GPIOx->DDR &= (uint8_t)(~(GPIO_Pin)); 00004E 1E 04 [ 2] 133 ldw x, (0x04, sp) 000050 F6 [ 1] 134 ld a, (x) 000051 14 03 [ 1] 135 and a, (0x03, sp) 000053 1E 04 [ 2] 136 ldw x, (0x04, sp) 000055 F7 [ 1] 137 ld (x), a 000056 138 00106$: 139 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 172: GPIOx->CR1 |= GPIO_Pin; 000056 1E 07 [ 2] 140 ldw x, (0x07, sp) 000058 1C 00 03 [ 2] 141 addw x, #0x0003 00005B 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 */ 00005C 88 [ 1] 144 push a 00005D 7B 0C [ 1] 145 ld a, (0x0c, sp) 00005F A5 40 [ 1] 146 bcp a, #0x40 000061 84 [ 1] 147 pop a 000062 27 05 [ 1] 148 jreq 00108$ 149 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 172: GPIOx->CR1 |= GPIO_Pin; 000064 1A 06 [ 1] 150 or a, (0x06, sp) 000066 F7 [ 1] 151 ld (x), a 000067 20 03 [ 2] 152 jra 00109$ 000069 153 00108$: 154 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 175: GPIOx->CR1 &= (uint8_t)(~(GPIO_Pin)); 000069 14 03 [ 1] 155 and a, (0x03, sp) 00006B F7 [ 1] 156 ld (x), a 00006C 157 00109$: 158 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 143: GPIOx->CR2 &= (uint8_t)(~(GPIO_Pin)); 00006C 1E 01 [ 2] 159 ldw x, (0x01, sp) 00006E 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 */ 00006F 88 [ 1] 162 push a 000070 7B 0C [ 1] 163 ld a, (0x0c, sp) 000072 A5 20 [ 1] 164 bcp a, #0x20 000074 84 [ 1] 165 pop a 000075 27 07 [ 1] 166 jreq 00111$ 167 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 184: GPIOx->CR2 |= GPIO_Pin; 000077 1A 06 [ 1] 168 or a, (0x06, sp) 000079 1E 01 [ 2] 169 ldw x, (0x01, sp) 00007B F7 [ 1] 170 ld (x), a 00007C 20 05 [ 2] 171 jra 00113$ 00007E 172 00111$: 173 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 187: GPIOx->CR2 &= (uint8_t)(~(GPIO_Pin)); 00007E 14 03 [ 1] 174 and a, (0x03, sp) 000080 1E 01 [ 2] 175 ldw x, (0x01, sp) 000082 F7 [ 1] 176 ld (x), a 000083 177 00113$: 178 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 190: } 000083 5B 08 [ 2] 179 addw sp, #8 000085 85 [ 2] 180 popw x 000086 84 [ 1] 181 pop a 000087 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 ; ----------------------------------------- 000088 187 _GPIO_ExternalPullUpConfig: 000088 88 [ 1] 188 push a 189 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 217: GPIOx->CR1 |= GPIO_Pin; 000089 1C 00 03 [ 2] 190 addw x, #0x0003 00008C 88 [ 1] 191 push a 00008D F6 [ 1] 192 ld a, (x) 00008E 6B 02 [ 1] 193 ld (0x02, sp), a 000090 84 [ 1] 194 pop a 195 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 215: if (NewState != DISABLE) /* External Pull-Up Set*/ 000091 0D 04 [ 1] 196 tnz (0x04, sp) 000093 27 05 [ 1] 197 jreq 00102$ 198 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 217: GPIOx->CR1 |= GPIO_Pin; 000095 1A 01 [ 1] 199 or a, (0x01, sp) 000097 F7 [ 1] 200 ld (x), a 000098 20 04 [ 2] 201 jra 00104$ 00009A 202 00102$: 203 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 220: GPIOx->CR1 &= (uint8_t)(~(GPIO_Pin)); 00009A 43 [ 1] 204 cpl a 00009B 14 01 [ 1] 205 and a, (0x01, sp) 00009D F7 [ 1] 206 ld (x), a 00009E 207 00104$: 208 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 222: } 00009E 84 [ 1] 209 pop a 00009F 85 [ 2] 210 popw x 0000A0 84 [ 1] 211 pop a 0000A1 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 ; ----------------------------------------- 0000A2 217 _GPIO_Write: 218 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 250: GPIOx->ODR = GPIO_PortVal; 0000A2 F7 [ 1] 219 ld (x), a 220 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 251: } 0000A3 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 ; ----------------------------------------- 0000A4 226 _GPIO_WriteBit: 0000A4 88 [ 1] 227 push a 228 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 278: GPIOx->ODR |= GPIO_Pin; 0000A5 88 [ 1] 229 push a 0000A6 F6 [ 1] 230 ld a, (x) 0000A7 6B 02 [ 1] 231 ld (0x02, sp), a 0000A9 84 [ 1] 232 pop a 233 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 276: if (GPIO_BitVal != RESET) 0000AA 0D 04 [ 1] 234 tnz (0x04, sp) 0000AC 27 05 [ 1] 235 jreq 00102$ 236 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 278: GPIOx->ODR |= GPIO_Pin; 0000AE 1A 01 [ 1] 237 or a, (0x01, sp) 0000B0 F7 [ 1] 238 ld (x), a 0000B1 20 04 [ 2] 239 jra 00104$ 0000B3 240 00102$: 241 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 283: GPIOx->ODR &= (uint8_t)(~GPIO_Pin); 0000B3 43 [ 1] 242 cpl a 0000B4 14 01 [ 1] 243 and a, (0x01, sp) 0000B6 F7 [ 1] 244 ld (x), a 0000B7 245 00104$: 246 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 285: } 0000B7 84 [ 1] 247 pop a 0000B8 85 [ 2] 248 popw x 0000B9 84 [ 1] 249 pop a 0000BA 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 ; ----------------------------------------- 0000BB 255 _GPIO_SetBits: 0000BB 88 [ 1] 256 push a 0000BC 6B 01 [ 1] 257 ld (0x01, sp), a 258 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 305: GPIOx->ODR |= GPIO_Pin; 0000BE F6 [ 1] 259 ld a, (x) 0000BF 1A 01 [ 1] 260 or a, (0x01, sp) 0000C1 F7 [ 1] 261 ld (x), a 262 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 306: } 0000C2 84 [ 1] 263 pop a 0000C3 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 ; ----------------------------------------- 0000C4 269 _GPIO_ResetBits: 0000C4 88 [ 1] 270 push a 271 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 326: GPIOx->ODR &= (uint8_t)(~GPIO_Pin); 0000C5 88 [ 1] 272 push a 0000C6 F6 [ 1] 273 ld a, (x) 0000C7 6B 02 [ 1] 274 ld (0x02, sp), a 0000C9 84 [ 1] 275 pop a 0000CA 43 [ 1] 276 cpl a 0000CB 14 01 [ 1] 277 and a, (0x01, sp) 0000CD F7 [ 1] 278 ld (x), a 279 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 327: } 0000CE 84 [ 1] 280 pop a 0000CF 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 ; ----------------------------------------- 0000D0 286 _GPIO_ToggleBits: 0000D0 88 [ 1] 287 push a 0000D1 6B 01 [ 1] 288 ld (0x01, sp), a 289 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 338: GPIOx->ODR ^= GPIO_Pin; 0000D3 F6 [ 1] 290 ld a, (x) 0000D4 18 01 [ 1] 291 xor a, (0x01, sp) 0000D6 F7 [ 1] 292 ld (x), a 293 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 339: } 0000D7 84 [ 1] 294 pop a 0000D8 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 ; ----------------------------------------- 0000D9 300 _GPIO_ReadInputData: 301 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 349: return ((uint8_t)GPIOx->IDR); 0000D9 E6 01 [ 1] 302 ld a, (0x1, x) 303 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 350: } 0000DB 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 ; ----------------------------------------- 0000DC 309 _GPIO_ReadOutputData: 310 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 360: return ((uint8_t)GPIOx->ODR); 0000DC F6 [ 1] 311 ld a, (x) 312 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 361: } 0000DD 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 ; ----------------------------------------- 0000DE 318 _GPIO_ReadInputDataBit: 0000DE 88 [ 1] 319 push a 0000DF 6B 01 [ 1] 320 ld (0x01, sp), a 321 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 380: return ((BitStatus)(GPIOx->IDR & (uint8_t)GPIO_Pin)); 0000E1 E6 01 [ 1] 322 ld a, (0x1, x) 0000E3 14 01 [ 1] 323 and a, (0x01, sp) 0000E5 40 [ 1] 324 neg a 0000E6 4F [ 1] 325 clr a 0000E7 49 [ 1] 326 rlc a 327 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 381: } 0000E8 5B 01 [ 2] 328 addw sp, #1 0000EA 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 ; ----------------------------------------- 0000EB 334 _GPIO_ReadOutputDataBit: 0000EB 88 [ 1] 335 push a 0000EC 6B 01 [ 1] 336 ld (0x01, sp), a 337 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 391: return ((BitStatus)(GPIOx->ODR & (uint8_t)GPIO_Pin)); 0000EE F6 [ 1] 338 ld a, (x) 0000EF 14 01 [ 1] 339 and a, (0x01, sp) 0000F1 40 [ 1] 340 neg a 0000F2 4F [ 1] 341 clr a 0000F3 49 [ 1] 342 rlc a 343 ; ../inc/stm8l151x/src/stm8l15x_gpio.c: 392: } 0000F4 5B 01 [ 2] 344 addw sp, #1 0000F6 81 [ 4] 345 ret 346 .area CODE 347 .area CONST 348 .area INITIALIZER 349 .area CABS (ABS)