forked from vdudouyt/stm8flash
-
Notifications
You must be signed in to change notification settings - Fork 0
/
stm8.c
72 lines (69 loc) · 1.35 KB
/
stm8.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#include <stdio.h>
#include "stm8.h"
#define REGS_STM8S { \
.CLK_CKDIVR = 0x50c6, \
.FLASH_PUKR = 0x5062, \
.FLASH_DUKR = 0x5064, \
.FLASH_IAPSR = 0x505f, \
.FLASH_CR2 = 0x505b, \
}
#define REGS_STM8L { \
.CLK_CKDIVR = 0x50c6, \
.FLASH_PUKR = 0x5052, \
.FLASH_DUKR = 0x5053, \
.FLASH_IAPSR = 0x5054, \
.FLASH_CR2 = 0x5051, \
}
stm8_device_t stm8_devices[] = {
{
.name = "stm8s003",
.ram_start = 0x0000,
.ram_size = 1*1024,
.eeprom_start = 0x4000,
.eeprom_size = 128,
.flash_start = 0x8000,
.flash_size = 8*1024,
REGS_STM8S
},
{
.name = "stm8s103",
.ram_start = 0x0000,
.ram_size = 1*1024,
.eeprom_start = 0x4000,
.eeprom_size = 640,
.flash_start = 0x8000,
.flash_size = 8*1024,
REGS_STM8S
},
{
.name = "stm8s105",
.ram_start = 0x0000,
.ram_size = 2*1024,
.eeprom_start = 0x4000,
.eeprom_size = 1024,
.flash_start = 0x8000,
.flash_size = 16*1024,
REGS_STM8S
},
{
.name = "stm8s208",
.ram_start = 0x0000,
.ram_size = 6*1024,
.eeprom_start = 0x4000,
.eeprom_size = 2048,
.flash_start = 0x8000,
.flash_size = 32*1024,
REGS_STM8S
},
{
.name = "stm8l150",
.ram_start = 0x0000,
.ram_size = 2*1024,
.eeprom_start = 0x1000,
.eeprom_size = 1024,
.flash_start = 0x8000,
.flash_size = 32*1024,
REGS_STM8L
},
{ NULL },
};