diff --git a/README.md b/README.md
index 7fa5d9e..73e8274 100644
--- a/README.md
+++ b/README.md
@@ -87,93 +87,45 @@ specify the `.map` file as an input.
### Creating a configuration file
-The configuration file is a `.yaml` file containing all the required information to tell LinkerScope what and how to draw the maps.
-All information there is optional.
+The configuration file is a `.yaml` file containing all the required information to tell LinkerScope what and how to draw the memory map.
+All information there is optional, including the file itself. If this information is not provided, the default values will be used.
-Normally, a configuration file contains style information, memory areas, and links.
+Normally, a configuration file contains **areas**, **links** and **style** information.
+
+**Areas** provides a list of memory areas to be displayed, with information regarding its position and size on the map, memory range to include or specific drawing style.
+Additionally, it can contain a **sections** sub-property where specific sections can be added to modify desired properties
+
+**Links** provides a simple way of graphically relating same memory addresses across different areas
+
+**Style** defines the parent drawing style properties that will be used at the document. Additionally, each area can override specific style properties at its style section.
+Lastly, sections can override parent (area) style as well
```yaml
style:
- ...
+ background: '#99B898'
+ stroke: 'black'
+ # ...
areas:
- area:
style:
- ...
-
- address:
- lowest: 0x0
- highest: 0x200000000
-
- size:
- ...
+ # ...
+ title: Register Map
+ range: [0x0, 0x100000000]
+ sections:
+ - names: [USART1, USART2]
+ style:
+ hide-name: true
+ # ...
- area:
- ...
+ # ...
links:
- addresses: [ 0x80045d4, ...]
- sections: [__malloc_av_, ...]
-
+ addresses: [0x80045d4]
+ sections: [__malloc_av_, [TIM2, TIM3]]
```
-#### Styles
-
-The style can be defined at map level, where it will be applied to all areas, but also at area or even at section level.
-Specifying a style at are level will override the specified configuration for the whole map where it was defined.
-Specifying it at section level, it will override style information from map and area.
-```yaml
-style:
- # RGB colors or english plain text color names can be used
- box_fill_color: '#CCE5FF'
- label_color: 'blue'
- box_stroke_color: '#3399FF'
- box_stroke_width: 2
- link_stroke_width: 2
- link_stroke_color: 'grey'
- label_font: 'Helvetica Bold'
- label_size: '16px'
- label_stroke_width: 0.5px
- area_fill_color: 'lightgrey'
-```
-- Window:
- - `background_color`
-- Area background
- - `area_background_color`
-- Memory section rectangle
- - `box_fill_color`
- - `box_stroke_color`
- - `box_stroke_width`
-- Section name, address and size
- - `label_color`
- - `label_font`
- - `label_size`
- - `label_stroke_width`
-- Link lines between addresses at different maps
- - `link_stroke_width`
- - `link_stroke_color`
-
-If the style at specific sections needs to be defined/overridden, it will be specified under `style -> overrides -> sections` property at
-area level, by specifying the names of the regions whose properties want to be overridden, followed by the properties to override:
-
-```yaml
-- area:
- ...
- address:
- ...
- style:
- # Area style definition
- link_stroke_color: 'grey'
- link_stroke_width: 1
- section_stroke_width: 0
- section_fill_color: 'blue'
- # Area style overrides for specified sections
- overrrides:
- - sections: [ ROM Table, Peripheral, External RAM ]
- section_fill_color: '#99B898'
- - sections: [ External PPB ]
- section_fill_color: '#FECEA8'
-```
#### Areas
The diagram can have one or multiple areas. When multiple areas are declared,
@@ -248,7 +200,7 @@ areas:
flags: break
```
-##### `grows-up` / `grows-down`
+##### Growths
These flags specify the section as growing section, for instance, if the section is meant to grow into one direction, such as the stack.
When flagging a section with `grows-down`, an arrow pointing downwards will be appended to the bottom of the section indicating that the section is growing into that direction:
@@ -291,9 +243,56 @@ links:
```
+#### Styles
+
+The style can be defined at document level, where it will be applied to all areas, but also at area or even at section level.
+Specifying a style at area level will override the specified properties for the whole area where it was defined.
+Specifying it at section level, it will override style only for the specified section or group of sections.
+
+```yaml
+style:
+ # This is a style defined at document level
+ text-fill: 'lightgrey'
+ background: 'black'
+ stroke: '#99B898'
+ stroke-width: 1
+ font-type: 'Helvetica'
+
+areas:
+- area:
+ title: 'Internal Memory'
+ pos: [30, 50]
+ style:
+ # This is a style defined at area level, which will override fill property only applied at Main Memory area
+ fill: 'blue'
+ sections:
+ - names: [ SRAM, Flash ]
+ style:
+ # This is a style defined at section level, and will be applied only to SRAM and Flash sections
+ fill: 'green'
+ hide-address: true
+- area:
+ title: 'External Memory'
+ # ...
+```
+
+Below a list of style properties with general use and specific for sections:
+##### General
+ - `background`, `fill`, `font-size`, `font-type`, `opacity`, `size`, `stroke`, `stroke_dasharray`, `stroke-width`, `text-stroke`,`text-fill`,`text-stroke-width`, `weigth`
+
+##### Section properties:
+ - `break-type`: specify memory break type. See [`break`](#break) section
+ - `break-size`: specify memory break size in pixels. See [`break`](#break) section
+ - `growth-arrow-size`: size of the direction growth arrow. See [`Growths`](#growths) section
+ - `growth-arrow-fill`: color for the direction growth arrow. See [`Growths`](#growths) section
+ - `growth-arrow-stroke`: stroke color for the direction growth arrow. See [`Growths`](#growths) section
+ - `hide-size`: hides the size label of a section
+ - `hide-name`: hides the name label of a section
+ - `hide-address`: hides the address label of a section
+
#### Other properties
-##### Document size
+_Document size_
The generated SVG document has a fixed size. If you want to adjust it, use the `size` property at root level to pass
desired document width and height in pixels.
diff --git a/examples/link_example_config.yaml b/examples/link_example_config.yaml
index ab46946..d1378b1 100755
--- a/examples/link_example_config.yaml
+++ b/examples/link_example_config.yaml
@@ -15,7 +15,7 @@ style:
stroke-width: 1
text-stroke: 'black'
text-stroke-width: 0
- font_type: 'Helvetica'
+ font-type: 'Helvetica'
areas:
- area:
diff --git a/examples/link_example_map.svg b/examples/link_example_map.svg
index 04212b8..79caa9f 100644
--- a/examples/link_example_map.svg
+++ b/examples/link_example_map.svg
@@ -1,2 +1,2 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/examples/stm32f103_config.yaml b/examples/stm32f103_config.yaml
new file mode 100644
index 0000000..a186454
--- /dev/null
+++ b/examples/stm32f103_config.yaml
@@ -0,0 +1,58 @@
+size: [800,900]
+variables:
+ graphite: &graphite '#2A363B'
+ pastel_green: &pastel_green '#99B898'
+ pastel_yellow: &pastel_yellow '#FECEA8'
+ pastel_orange: &pastel_orange '#FF847C'
+ pastel_red: &pastel_red '#E84A5F'
+
+style:
+ text-fill: 'lightgrey'
+ break-size: 60
+ break-type: '~'
+ growth-arrow-size: 2
+ growth-arrow-fill: 'white'
+ growth-arrow-stroke: 'black'
+ background: *graphite
+ fill: '#99B898'
+
+ stroke: *graphite
+ stroke-width: 1
+ text-stroke: 'black'
+ text-stroke-width: 0
+ font_type: 'Helvetica'
+
+areas:
+# total area area
+- area:
+ range: [0x0, 0x100000000]
+ size: [200, 700]
+ style:
+ fill: *pastel_green
+ hide-size: true
+ sections:
+ - names: [none]
+ style:
+ hide-name: true
+ fill: grey
+
+- area:
+ range: [0x40000000, 0x40030000]
+ pos: [500]
+ size: [200, 700]
+ style:
+ fill: *pastel_green
+ background: grey
+ hide-size: true
+ sections:
+ - names: [none]
+ style:
+ hide-name: true
+ fill: grey
+
+links:
+ style:
+ fill: grey
+ sections: [[TIM2, CRC]]
+
+
diff --git a/examples/stm32f103_map.yaml b/examples/stm32f103_map.yaml
new file mode 100644
index 0000000..469f8c2
--- /dev/null
+++ b/examples/stm32f103_map.yaml
@@ -0,0 +1,186 @@
+map:
+ - id: none
+ address: 0x00000000
+ size: 0x20000000
+ type: area
+ - id: none
+ address: 0x20000000
+ size: 0x20000000
+ type: area
+ - id: none
+ address: 0x40000000
+ size: 0x20000000
+ type: area
+ - id: none
+ address: 0x60000000
+ size: 0x20000000
+ type: area
+ - id: none
+ address: 0x80000000
+ size: 0x20000000
+ type: area
+ - id: none
+ address: 0xA0000000
+ size: 0x20000000
+ type: area
+ - id: none
+ address: 0xC0000000
+ size: 0x20000000
+ type: area
+
+
+
+ - id: none
+ address: 0xE0100000
+ size: 0x0FE00000
+ type: area
+
+ - id: SRAM
+ address: 0x20000000
+ size: 0x08000000
+ type: area
+
+ - id: Peripherals
+ address: 0x40000000
+ size: 0x08000000
+ type: area
+
+ - id: M3 Cortex Internal Peripherals
+ address: 0xE0000000
+ size: 0x01000000
+ type: area
+
+ - id: TIM2
+ address: 0x40000000
+ size: 0x00000400
+ type: area
+ - id: TIM3
+ address: 0x40000400
+ size: 0x00000400
+ type: area
+ - id: TIM4
+ address: 0x40000800
+ size: 0x00000400
+ type: area
+ - id: RTC
+ address: 0x40002800
+ size: 0x00000400
+ type: area
+ - id: WWDG
+ address: 0x40002C00
+ size: 0x00000400
+ type: area
+ - id: IWDG
+ address: 0x40003000
+ size: 0x00000400
+ type: area
+ - id: SPI2
+ address: 0x40003800
+ size: 0x00000400
+ type: area
+ - id: USART2
+ address: 0x40004400
+ size: 0x00000400
+ type: area
+ - id: USART3
+ address: 0x40004800
+ size: 0x00000400
+ type: area
+ - id: I2C1
+ address: 0x40005400
+ size: 0x00000400
+ type: area
+ - id: I2C2
+ address: 0x40005800
+ size: 0x00000400
+ type: area
+ - id: USB Registers
+ address: 0x40005C00
+ size: 0x00000400
+ type: area
+ - id: USB/CAN SRAM
+ address: 0x40006000
+ size: 0x00000400
+ type: area
+ - id: BXCAN
+ address: 0x40006400
+ size: 0x00000400
+ type: area
+ - id: BKP
+ address: 0x40006C00
+ size: 0x00000400
+ type: area
+ - id: POWER
+ address: 0x40007000
+ size: 0x00000400
+ type: area
+ - id: AFIO
+ address: 0x40010000
+ size: 0x00000400
+ type: area
+ - id: EXTI
+ address: 0x40010400
+ size: 0x00000400
+ type: area
+ - id: PORT A
+ address: 0x40010800
+ size: 0x00000400
+ type: area
+ - id: PORT B
+ address: 0x40010C00
+ size: 0x00000400
+ type: area
+ - id: PORT C
+ address: 0x40011000
+ size: 0x00000400
+ type: area
+ - id: PORT D
+ address: 0x40011400
+ size: 0x00000400
+ type: area
+ - id: PORT E
+ address: 0x40011800
+ size: 0x00000400
+ type: area
+ - id: ADC1
+ address: 0x40012400
+ size: 0x00000400
+ type: area
+ - id: ADC2
+ address: 0x40012800
+ size: 0x00000400
+ type: area
+ - id: TIM1
+ address: 0x40012C00
+ size: 0x00000400
+ type: area
+ - id: SPI1
+ address: 0x40013000
+ size: 0x00000400
+ type: area
+ - id:
+ address: 0x40010000
+ size: 0x00000400
+ type: area
+ - id: USART1
+ address: 0x40013800
+ size: 0x00000400
+ type: area
+ - id: DMA
+ address: 0x40020000
+ size: 0x00000400
+ type: area
+ - id: RCC
+ address: 0x40021000
+ size: 0x00000400
+ type: area
+ - id: Flash Interface
+ address: 0x40022000
+ size: 0x00000400
+ type: area
+ - id: CRC
+ address: 0x40023000
+ size: 0x00000400
+ type: area
+
+
diff --git a/style.py b/style.py
index 32c685e..3192d11 100644
--- a/style.py
+++ b/style.py
@@ -66,7 +66,6 @@ def get_default():
default_style.growth_arrow_size = 1
default_style.background = 'white'
- default_style.fill = '#CCE5FF'
default_style.stroke = 'black'
default_style.stroke_width = 1
default_style.size = 2