Compare commits

...

60 Commits

Author SHA1 Message Date
160921a008
update otg high speed 2024-04-14 18:35:33 -04:00
d8716bffb5
fix generate.sh 2024-04-14 13:06:14 -04:00
325a87c07a
u5a5 use otg-hs 2024-04-14 12:50:18 -04:00
61897bd9d6
add generate.sh 2024-04-14 12:43:45 -04:00
a98c13faf5
Merge branch 'embassy-rs:main' into main 2024-04-14 12:39:59 -04:00
94439f8c67
init otg highspeed 2024-04-14 12:37:15 -04:00
Dario Nieuwenhuis
d674277b78 update sources (adds missing irq) 2024-04-13 03:51:22 +02:00
Dario Nieuwenhuis
0c4baf4783 Remove a few zero-sized memory regions that are breaking memory.x generation. 2024-04-13 03:27:35 +02:00
Dario Nieuwenhuis
9a0154110c
Merge pull request #466 from embassy-rs/u0
Add stm32u0.
2024-04-13 01:18:48 +00:00
Dario Nieuwenhuis
d4a97f60b1 Add stm32u0. 2024-04-13 03:16:25 +02:00
Dario Nieuwenhuis
7197df07de
Merge pull request #464 from wagcampbell/wgc/stm32u5-memory-fix
Corrects STM32U5 memory sizes
2024-04-12 21:26:40 +00:00
Dario Nieuwenhuis
b1034db59a
Merge pull request #463 from MaxiluxSystems/feature/product-states
flash_h50: add PRODUCT_STATE enum; improve a couple other fields
2024-04-12 19:38:24 +00:00
Torin Cooper-Bennun
62b1ab50db flash_h50: rename BKSEL variants 2024-04-12 17:04:33 +01:00
Torin Cooper-Bennun
4df4f6840c flash_h50: plain bool for SWAP_BANK fields 2024-04-12 17:03:44 +01:00
Warren Campbell
af9e902172 Corrects STM32U5 memory sizes 2024-04-11 18:04:35 -04:00
Torin Cooper-Bennun
a0c7c136fa flash_h50: add PRODUCT_STATE enum
the values are taken from the official HAL headers; I have only included
enum variants which are definitively mentioned in RM0492, excluding
other variants mentioned in the HAL headers
2024-04-11 10:25:07 +01:00
Torin Cooper-Bennun
f60ad0d665 flash_h50: make _CUR registers read-only 2024-04-11 10:24:55 +01:00
Dario Nieuwenhuis
1f79295b80
Merge pull request #460 from embassy-rs/memfix
Manually maintain memory maps instead of parsing them from cubeprogdb.
2024-04-09 02:15:22 +00:00
Dario Nieuwenhuis
8e26f36a8e Manually maintain memory maps instead of parsing them from cubeprogdb.
First step towards fixing #301

The cubeprogdb has turned out to be a quite bad data source. It's not granular
enough (it has one entry per chip die, not per chip) so the previous code joined
the data with the C headers and cubedb to fill in the gaps, essentialy "guessing"
stuff. This has been quite error prone (see #301) and hard to make fixes to.

Instead, we're going to manually maintain memory maps in a .rs file. This way, if
something is wrong we can simply go and fix it.

This commit just migrates the existing data, even if it's wrong. (it does fix
a few very minor mistakes). Next steps is actually fixing the memory maps.
2024-04-09 03:38:33 +02:00
Dario Nieuwenhuis
9d3d5c9690 Sort memory regions by addr. 2024-04-09 02:43:44 +02:00
Dario Nieuwenhuis
4e3ed9abee Remove OTP from memory map. 2024-04-09 02:19:17 +02:00
Dario Nieuwenhuis
2480982cc5
Merge pull request #450 from taunusflieger/feature/HSEM
Add support for HSEM
2024-04-08 12:10:36 +00:00
Dario Nieuwenhuis
604890b9ba hsem: rename more MASTERID->COREID 2024-04-08 14:07:46 +02:00
Michael Zill
b782384611 Arrayfied IER, ICR, ISR and MISR
IRQ registers have for all 4 variants the same name.
V1 - array size = 2 (2 cores)
V2 - array size = 1 (1 core)
V3 - array size = 2 (2 cores)
V4 - array size = 1 (1 core)

HSEM added to GHOST_PERIS
2024-04-08 13:38:36 +02:00
Michael Zill
840e5ec5db Fixed length COREID in v1, v2 renamed MASTERID to COREID 2024-04-08 13:36:40 +02:00
Michael Zill
e029a55f7a Arrayfied v2, v3, v4 - removed enums, aligned yaml structure
The following list shows the different hsem yaml versions and the coresponding chips.

    wba is on purpose not included at is complex and very different from the others which will
    also make the HSEM implementation in the HAL more complex. I leave this out for another PR.

    h747
    wb55

    h735
    h7b3
    h753v
    h753
    h743
    h743v

    wl5x_cm0p
    wl5x_cm4

    wle5
2024-04-08 13:36:40 +02:00
Michael Zill
bde330f46e Fixed C1ICR, C2ICR read/write 2024-04-08 13:36:40 +02:00
Michael Zill
c0c35d80f9 Remove temp patch doc 2024-04-08 13:36:40 +02:00
Michael Zill
6ba934d366 Remote debug code 2024-04-08 13:36:40 +02:00
Michael Zill
d1f1f4bfeb Arrayfied v1 and v8 - preliminary fix for missing HSEM in Cube XML 2024-04-08 13:36:40 +02:00
Michael Zill
44967f3776 Initial add 2024-04-08 13:36:40 +02:00
Dario Nieuwenhuis
378deee68b
Merge pull request #457 from eZioPan/UID-to-GHOST_PERIS
move "UID" to "GHOST_PERIS"
2024-04-06 20:41:14 +00:00
eZio Pan
60398cad51 move "UID" to "GHOST_PERIS" 2024-04-06 22:07:19 +08:00
Dario Nieuwenhuis
fff3cddff0
Merge pull request #455 from dlaw/main
Add 8 and 16 bit wide SPI data registers
2024-04-05 18:12:54 +00:00
David Lawrence
bef34f5e8a Add 8 and 16 bit wide SPI data registers 2024-04-05 14:07:39 -04:00
Dario Nieuwenhuis
5a39cb448a
Merge pull request #454 from dlaw/main
Split STM32G4 flash peripheral by device category
2024-04-05 16:31:59 +00:00
David Lawrence
d258cf858d Split STM32G4 flash peripheral by device category 2024-04-05 12:10:59 -04:00
Dario Nieuwenhuis
73ab4d3f67
Merge pull request #451 from eZioPan/lptim-v2
lptim v2
2024-04-05 11:28:05 +00:00
Dario Nieuwenhuis
e0a0af600e
Merge pull request #452 from qff233/main
Fix ADC resolution enum for stm32g4
2024-04-05 11:20:07 +00:00
eZio Pan
16b4fd12c1 merge lptim CCMR output and input
move overlap to field level
2024-04-05 15:01:07 +08:00
qff233
a2c4423ed5 Fix DMA enum 2024-04-05 13:07:24 +08:00
qff233
408a20839a Fix serial registers for stm32g4 serial:q 2024-04-05 12:58:59 +08:00
eZio Pan
f789074a4b merge input mode and output mode 2024-04-05 12:36:35 +08:00
qff233
9dfb42cd91 Fix ADC sample_time enum for stm32g4 2024-04-05 01:39:04 +08:00
qff233
cf5ab0f41b Fix ADC resolution enum for stm32g4 2024-04-05 01:13:23 +08:00
eZio Pan
d9625637f2 add lptim_v2a to chips.rs 2024-04-05 00:06:01 +08:00
eZio Pan
8b036d7f87 add enum 2024-04-04 23:47:06 +08:00
eZio Pan
c25b401647 extract lptim_v2a from l5 2024-04-04 23:40:12 +08:00
eZio Pan
029320446b add lptim to u5 wba 2024-04-04 23:29:48 +08:00
eZio Pan
59cb83596f add to chips.rs 2024-04-04 23:04:21 +08:00
eZio Pan
8bd35deb56 add enum 2024-04-04 23:04:21 +08:00
eZio Pan
8bfe8b90f4 split lptim and bug fix ...
LPTIM4 has less function, so it's a LPTIM_Basic, the reset are full feature, thus a LPTIM_Adv.
2024-04-04 23:04:21 +08:00
eZio Pan
43e02bf3ec apply transform 2024-04-04 23:04:21 +08:00
eZio Pan
ac23a24b9b extract lptim_v2h5 from h573 lptim1 2024-04-04 23:04:21 +08:00
Dario Nieuwenhuis
2b7ec569a5
Merge pull request #446 from kkoppul2/ospi_h7ab_corrections
Fix mislabeling for h7ab octospi rcc registers
2024-04-03 17:22:49 +00:00
Karun Koppula
ad31d48657 Fix mislabeling for h7ab octospi rcc registers 2024-04-03 13:16:08 -04:00
Dario Nieuwenhuis
5af9045202
Merge pull request #443 from Ecco/stm32wba-tsc-support
Add TSC support for STM32WBA
2024-04-03 12:15:03 +00:00
Romain Goyet
e7b493c058 Add TSC support for STM32WBA 2024-04-02 20:30:35 -04:00
Dario Nieuwenhuis
ac187e40aa
Merge pull request #442 from kkoppul2/ospi_corrections
updated l4plus and l5 rcc registers
2024-04-02 19:23:44 +00:00
Karun Koppula
c4be0da68c updated l4plus and l5 rcc registers 2024-04-02 15:05:12 -04:00
38 changed files with 9426 additions and 566 deletions

2
.gitignore vendored
View File

@ -3,7 +3,9 @@
/sources
/tmp
.idea/
.DS_Store
# transform*.yaml
__pycache__
target/
venv/

View File

@ -3,6 +3,9 @@
"[toml]": {
"editor.formatOnSave": false
},
"[yaml]": {
"editor.formatOnSave": false
},
"[c]": {
"editor.formatOnSave": false
},

5
d
View File

@ -4,7 +4,7 @@ set -e
cd $(dirname $0)
CMD=$1
REV=796a8322b8f6e4329002a1fb49438aec95dae812
REV=74b97817d4c4ed0db9d19a8eac46720b3c5b0d57
shift
case "$CMD" in
@ -56,7 +56,7 @@ case "$CMD" in
cargo run --release --bin stm32-data-gen
cargo run --release --bin stm32-metapac-gen
cd build/stm32-metapac
find . -name '*.rs' -not -path '*target*' | xargs rustfmt --skip-children --unstable-features --edition 2021
#find . -name '*.rs' -not -path '*target*' | xargs rustfmt --skip-children --unstable-features --edition 2021
cargo check --features stm32h755zi-cm7,pac,metadata
cargo check --features stm32f777zi,pac
cargo check --features stm32u585zi,metadata
@ -65,4 +65,3 @@ case "$CMD" in
echo "unknown command"
;;
esac

View File

@ -0,0 +1,76 @@
GENERATOR0: 1
GENERATOR1: 2
GENERATOR2: 3
GENERATOR3: 4
ADC1: 5
AES_IN: 6
AES_OUT: 7
DAC1_CH1: 8
I2C1_RX: 9
I2C1_TX: 10
I2C2_RX: 11
I2C2_TX: 12
I2C3_RX: 13
I2C3_TX: 14
I2C4_RX: 15
I2C4_TX: 16
LPTIM1_IC1: 17
LPTIM1_IC2: 18
LPTIM1_IC3: 19
LPTIM1_IC4: 20
LPTIM1_UE4: 21
LPTIM2_IC1: 22
LPTIM2_IC2: 23
LPTIM2_UE: 24
LPTIM3_IC1: 25
LPTIM3_IC2: 26
LPTIM3_IC3: 27
LPTIM3_IC4: 28
LPTIM3_UE: 29
LPUART1_RX: 30
LPUART1_TX: 31
LPUART2_RX: 32
LPUART2_TX: 33
LPUART3_RX: 34
LPUART3_TX: 35
SPI1_RX: 36
SPI1_TX: 37
SPI2_RX: 38
SPI2_TX: 39
SPI3_RX: 40
SPI3_TX: 41
TIM1_CH1: 42
TIM1_CH2: 43
TIM1_CH3: 44
TIM1_CH4: 45
TIM1_TRIG_COM: 46
TIM1_UP: 47
TIM2_CH1: 48
TIM2_CH2: 49
TIM2_CH3: 50
TIM2_CH4: 51
TIM2_TRIG: 52
TIM2_UP: 53
TIM3_CH1: 54
TIM3_CH2: 55
TIM3_CH3: 56
TIM3_CH4: 57
TIM3_TRIG: 58
TIM3_UP: 59
TIM6_UP: 60
TIM7_UP: 61
TIM15_CH1: 62
TIM15_CH2: 63
TIM15_TRIG_COM: 64
TIM15_UP: 65
TIM16_CH1: 66
TIM16_COM: 67
TIM16_UP: 68
USART1_RX: 69
USART1_TX: 70
USART2_RX: 71
USART2_TX: 72
USART3_RX: 73
USART3_TX: 74
USART4_RX: 75
USART4_TX: 76

743
data/registers/adc_g4.yaml Normal file
View File

@ -0,0 +1,743 @@
block/ADC:
description: Analog to Digital Converter
items:
- name: ISR
description: interrupt and status register
byte_offset: 0
fieldset: ISR
- name: IER
description: interrupt enable register
byte_offset: 4
fieldset: IER
- name: CR
description: control register
byte_offset: 8
fieldset: CR
- name: CFGR
description: configuration register 1
byte_offset: 12
fieldset: CFGR
- name: CFGR2
description: configuration register 2
byte_offset: 16
fieldset: CFGR2
- name: SMPR
description: sampling time register 1
byte_offset: 20
fieldset: SMPR
- name: SMPR2
description: sampling time register 2
byte_offset: 24
fieldset: SMPR2
- name: TR1
description: analog watchdog threshold register 1
byte_offset: 32
fieldset: TR1
- name: TR2
description: analog watchdog threshold register 2
byte_offset: 36
fieldset: TR2
- name: TR3
description: analog watchdog threshold register 3
byte_offset: 40
fieldset: TR3
- name: SQR1
description: group regular sequencer ranks register 1
byte_offset: 48
fieldset: SQR1
- name: SQR2
description: group regular sequencer ranks register 2
byte_offset: 52
fieldset: SQR2
- name: SQR3
description: group regular sequencer ranks register 3
byte_offset: 56
fieldset: SQR3
- name: SQR4
description: group regular sequencer ranks register 4
byte_offset: 60
fieldset: SQR4
- name: DR
description: group regular conversion data register
byte_offset: 64
access: Read
fieldset: DR
- name: JSQR
description: group injected sequencer register
byte_offset: 76
fieldset: JSQR
- name: OFR
description: offset number 1-4 register
array:
len: 4
stride: 4
byte_offset: 96
fieldset: OFR
- name: JDR
description: group injected sequencer rank 1-4 register
array:
len: 4
stride: 4
byte_offset: 128
access: Read
fieldset: JDR
- name: AWD2CR
description: analog watchdog 2 configuration register
byte_offset: 160
fieldset: AWD2CR
- name: AWD3CR
description: analog watchdog 3 configuration register
byte_offset: 164
fieldset: AWD3CR
- name: DIFSEL
description: channel differential or single-ended mode selection register
byte_offset: 176
fieldset: DIFSEL
- name: CALFACT
description: calibration factors register
byte_offset: 180
fieldset: CALFACT
- name: GCOMP
description: Gain compensation register
byte_offset: 192
fieldset: GCOMP
fieldset/AWD2CR:
description: analog watchdog 2 configuration register
fields:
- name: AWD2CH
description: analog watchdog 2 channel selection
bit_offset: 0
bit_size: 19
fieldset/AWD3CR:
description: analog watchdog 3 configuration register
fields:
- name: AWD3CH
description: analog watchdog 3 channel selection
bit_offset: 0
bit_size: 19
fieldset/CALFACT:
description: calibration factors register
fields:
- name: CALFACT_S
description: calibration factor in single-ended mode
bit_offset: 0
bit_size: 7
- name: CALFACT_D
description: calibration factor in differential mode
bit_offset: 16
bit_size: 7
fieldset/CFGR:
description: configuration register 1
fields:
- name: DMAEN
description: Direct memory access enable
bit_offset: 0
bit_size: 1
enum: DMAEN
- name: DMACFG
description: direct memory access configuration
bit_offset: 0
bit_size: 1
enum: DMACFG
- name: RES
description: data resolution
bit_offset: 3
bit_size: 2
enum: RES
- name: EXTSEL
description: external trigger selection for regular group
bit_offset: 5
bit_size: 5
- name: EXTEN
description: external trigger enable and polarity selection for regular channels
bit_offset: 10
bit_size: 2
enum: EXTEN
- name: OVRMOD
description: overrun mode
bit_offset: 12
bit_size: 1
enum: OVRMOD
- name: CONT
description: single / continuous conversion mode for regular conversions
bit_offset: 13
bit_size: 1
- name: AUTDLY
description: delayed conversion mode
bit_offset: 14
bit_size: 1
- name: ALIGN
description: data alignment
bit_offset: 15
bit_size: 1
- name: DISCEN
description: discontinuous mode for regular channels
bit_offset: 16
bit_size: 1
- name: DISCNUM
description: discontinuous mode channel count
bit_offset: 17
bit_size: 3
- name: JDISCEN
description: discontinuous mode on injected channels
bit_offset: 20
bit_size: 1
- name: JQM
description: JSQR queue mode
bit_offset: 21
bit_size: 1
enum: JQM
- name: AWD1SGL
description: enable the watchdog 1 on a single channel or on all channels
bit_offset: 22
bit_size: 1
enum: AWD1SGL
- name: AWD1EN
description: analog watchdog 1 enable on regular channels
bit_offset: 23
bit_size: 1
- name: JAWD1EN
description: analog watchdog 1 enable on injected channels
bit_offset: 24
bit_size: 1
- name: JAUTO
description: automatic injected group conversion
bit_offset: 25
bit_size: 1
- name: AWD1CH
description: analog watchdog 1 channel selection
bit_offset: 26
bit_size: 5
- name: JQDIS
description: injected queue disable
bit_offset: 31
bit_size: 1
fieldset/CFGR2:
description: configuration register 2
fields:
- name: ROVSE
description: Regular Oversampling Enable
bit_offset: 0
bit_size: 1
- name: JOVSE
description: Injected Oversampling Enable
bit_offset: 1
bit_size: 1
- name: OVSR
description: Oversampling ratio
bit_offset: 2
bit_size: 3
- name: OVSS
description: Oversampling shift
bit_offset: 5
bit_size: 4
- name: TROVS
description: Triggered Regular Oversampling
bit_offset: 9
bit_size: 1
enum: TROVS
- name: ROVSM
description: Regular Oversampling mode
bit_offset: 10
bit_size: 1
enum: ROVSM
- name: GCOMP
description: Gain compensation mode
bit_offset: 16
bit_size: 1
- name: SWTRIG
description: Software trigger bit for sampling time control trigger mode
bit_offset: 25
bit_size: 1
- name: BULB
description: Bulb sampling mode
bit_offset: 26
bit_size: 1
- name: SMPTRIG
description: Sampling time control trigger mode
bit_offset: 27
bit_size: 1
fieldset/CR:
description: control register
fields:
- name: ADEN
description: enable
bit_offset: 0
bit_size: 1
- name: ADDIS
description: disable
bit_offset: 1
bit_size: 1
- name: ADSTART
description: group regular conversion start
bit_offset: 2
bit_size: 1
- name: JADSTART
description: group injected conversion start
bit_offset: 3
bit_size: 1
- name: ADSTP
description: group regular conversion stop
bit_offset: 4
bit_size: 1
enum: ADSTP
- name: JADSTP
description: group injected conversion stop
bit_offset: 5
bit_size: 1
enum: ADSTP
- name: ADVREGEN
description: voltage regulator enable
bit_offset: 28
bit_size: 1
- name: DEEPPWD
description: deep power down enable
bit_offset: 29
bit_size: 1
- name: ADCALDIF
description: differential mode for calibration
bit_offset: 30
bit_size: 1
enum: ADCALDIF
- name: ADCAL
description: calibration
bit_offset: 31
bit_size: 1
fieldset/DIFSEL:
description: channel differential or single-ended mode selection register
fields:
- name: DIFSEL
description: channel differential or single-ended mode for channel
bit_offset: 0
bit_size: 1
array:
len: 18
stride: 1
enum: DIFSEL
fieldset/DR:
description: group regular conversion data register
fields:
- name: RDATA
description: group regular conversion data
bit_offset: 0
bit_size: 16
fieldset/IER:
description: interrupt enable register
fields:
- name: ADRDYIE
description: ready interrupt
bit_offset: 0
bit_size: 1
- name: EOSMPIE
description: group regular end of sampling interrupt
bit_offset: 1
bit_size: 1
- name: EOCIE
description: group regular end of unitary conversion interrupt
bit_offset: 2
bit_size: 1
- name: EOSIE
description: group regular end of sequence conversions interrupt
bit_offset: 3
bit_size: 1
- name: OVRIE
description: group regular overrun interrupt
bit_offset: 4
bit_size: 1
- name: JEOCIE
description: group injected end of unitary conversion interrupt
bit_offset: 5
bit_size: 1
- name: JEOSIE
description: group injected end of sequence conversions interrupt
bit_offset: 6
bit_size: 1
- name: AWD1IE
description: analog watchdog 1 interrupt
bit_offset: 7
bit_size: 1
- name: AWD2IE
description: analog watchdog 2 interrupt
bit_offset: 8
bit_size: 1
- name: AWD3IE
description: analog watchdog 3 interrupt
bit_offset: 9
bit_size: 1
- name: JQOVFIE
description: group injected contexts queue overflow interrupt
bit_offset: 10
bit_size: 1
fieldset/ISR:
description: interrupt and status register
fields:
- name: ADRDY
description: ready flag
bit_offset: 0
bit_size: 1
- name: EOSMP
description: group regular end of sampling flag
bit_offset: 1
bit_size: 1
- name: EOC
description: group regular end of unitary conversion flag
bit_offset: 2
bit_size: 1
- name: EOS
description: group regular end of sequence conversions flag
bit_offset: 3
bit_size: 1
- name: OVR
description: group regular overrun flag
bit_offset: 4
bit_size: 1
- name: JEOC
description: group injected end of unitary conversion flag
bit_offset: 5
bit_size: 1
- name: JEOS
description: group injected end of sequence conversions flag
bit_offset: 6
bit_size: 1
- name: AWD1
description: analog watchdog 1 flag
bit_offset: 7
bit_size: 1
- name: AWD2
description: analog watchdog 2 flag
bit_offset: 8
bit_size: 1
- name: AWD3
description: analog watchdog 3 flag
bit_offset: 9
bit_size: 1
- name: JQOVF
description: group injected contexts queue overflow flag
bit_offset: 10
bit_size: 1
fieldset/JDR:
description: group injected sequencer rank 1-4 register
fields:
- name: JDATA
description: group injected sequencer rank conversion data
bit_offset: 0
bit_size: 16
fieldset/JSQR:
description: group injected sequencer register
fields:
- name: JL
description: group injected sequencer scan length
bit_offset: 0
bit_size: 2
- name: JEXTSEL
description: group injected external trigger source
bit_offset: 2
bit_size: 5
- name: JEXTEN
description: group injected external trigger polarity
bit_offset: 7
bit_size: 2
enum: JEXTEN
- name: JSQ
description: group injected sequencer rank 1-4
bit_offset: 9
bit_size: 5
array:
len: 4
stride: 6
fieldset/TR1:
description: analog watchdog threshold register 1
fields:
- name: LT1
description: analog watchdog 1 lower threshold
bit_offset: 0
bit_size: 12
- name: AWDFILT
description: analog watchdog filtering parameter
bit_offset: 12
bit_size: 3
- name: HT1
description: analog watchdog 1 higher threshold
bit_offset: 16
bit_size: 12
fieldset/TR2:
description: analog watchdog threshold register 2
fields:
- name: LT2
description: analog watchdog 2 lower threshold
bit_offset: 0
bit_size: 8
- name: HT2
description: analog watchdog 2 higher threshold
bit_offset: 16
bit_size: 8
fieldset/TR3:
description: analog watchdog threshold register 3
fields:
- name: LT3
description: analog watchdog 3 lower threshold
bit_offset: 0
bit_size: 8
- name: HT3
description: analog watchdog 3 higher threshold
bit_offset: 16
bit_size: 8
fieldset/OFR:
description: offset number x register
fields:
- name: OFFSET
description: data offset
bit_offset: 0
bit_size: 12
- name: OFFSETPOS
description: Positive offset
bit_offset: 24
bit_size: 1
- name: SATEN
description: Saturation enable
bit_offset: 25
bit_size: 1
- name: OFFSET1_CH
description: Channel selection for the data offset
bit_offset: 26
bit_size: 5
- name: OFFSET_EN
description: Offset enable
bit_offset: 31
bit_size: 1
fieldset/SMPR:
description: sampling time register
fields:
- name: SMP
description: channel n * 10 + x sampling time
bit_offset: 0
bit_size: 3
array:
len: 10
stride: 3
enum: SAMPLE_TIME
- name: SMPPLUS
description: Addition of one clock cycle to the sampling time
bit_offset: 31
bit_size: 1
fieldset/SMPR2:
description: sampling time register
fields:
- name: SMP
description: channel n * 10 + x sampling time
bit_offset: 0
bit_size: 3
array:
len: 9
stride: 3
enum: SAMPLE_TIME
fieldset/SQR1:
description: group regular sequencer ranks register 1
fields:
- name: L
description: L
bit_offset: 0
bit_size: 4
- name: SQ
description: group regular sequencer rank 1-4
bit_offset: 6
bit_size: 5
array:
len: 4
stride: 6
fieldset/SQR2:
description: group regular sequencer ranks register 2
fields:
- name: SQ
description: group regular sequencer rank 5-9
bit_offset: 0
bit_size: 5
array:
len: 5
stride: 6
fieldset/SQR3:
description: group regular sequencer ranks register 3
fields:
- name: SQ
description: group regular sequencer rank 10-14
bit_offset: 0
bit_size: 5
array:
len: 5
stride: 6
fieldset/SQR4:
description: group regular sequencer ranks register 4
fields:
- name: SQ
description: group regular sequencer rank 15-16
bit_offset: 0
bit_size: 5
array:
len: 2
stride: 6
fieldset/GCOMP:
description: Gain compensation coefficient
fields:
- name: GCOMPCOEFF
description: Gain compensation coefficient
bit_offset: 0
bit_size: 14
enum/ADCALDIF:
bit_size: 1
variants:
- name: SingleEnded
description: Calibration for single-ended mode
value: 0
- name: Differential
description: Calibration for differential mode
value: 1
enum/ADSTP:
bit_size: 1
variants:
- name: Stop
description: Stop conversion of channel
value: 1
enum/AWD1SGL:
bit_size: 1
variants:
- name: All
description: Analog watchdog 1 enabled on all channels
value: 0
- name: Single
description: Analog watchdog 1 enabled on single channel selected in AWD1CH
value: 1
enum/DIFSEL:
bit_size: 1
variants:
- name: SingleEnded
description: Input channel is configured in single-ended mode
value: 0
- name: Differential
description: Input channel is configured in differential mode
value: 1
enum/DMAEN:
bit_size: 1
variants:
- name: Disable
description: DMA disable
value: 0
- name: Enable
description: DMA enable
value: 1
enum/DMACFG:
bit_size: 1
variants:
- name: OneShotMode
description: DMA One Shot mode selected
value: 0
- name: CircularMode
description: DMA Circular mode selected
value: 1
enum/EXTEN:
bit_size: 2
variants:
- name: Disabled
description: Trigger detection disabled
value: 0
- name: RisingEdge
description: Trigger detection on the rising edge
value: 1
- name: FallingEdge
description: Trigger detection on the falling edge
value: 2
- name: BothEdges
description: Trigger detection on both the rising and falling edges
value: 3
enum/JEXTEN:
bit_size: 2
variants:
- name: Disabled
description: Trigger detection disabled
value: 0
- name: RisingEdge
description: Trigger detection on the rising edge
value: 1
- name: FallingEdge
description: Trigger detection on the falling edge
value: 2
- name: BothEdges
description: Trigger detection on both the rising and falling edges
value: 3
enum/JQM:
bit_size: 1
variants:
- name: Mode0
description: 'JSQR Mode 0: Queue maintains the last written configuration into JSQR'
value: 0
- name: Mode1
description: 'JSQR Mode 1: An empty queue disables software and hardware triggers of the injected sequence'
value: 1
enum/OVRMOD:
bit_size: 1
variants:
- name: Preserve
description: Preserve DR register when an overrun is detected
value: 0
- name: Overwrite
description: Overwrite DR register when an overrun is detected
value: 1
enum/RES:
bit_size: 2
variants:
- name: Bits12
description: 12-bit resolution
value: 0
- name: Bits10
description: 10-bit resolution
value: 1
- name: Bits8
description: 8-bit resolution
value: 2
- name: Bits6
description: 6-bit resolution
value: 3
enum/ROVSM:
bit_size: 1
variants:
- name: Continued
description: Oversampling is temporary stopped and continued after injection sequence
value: 0
- name: Resumed
description: Oversampling is aborted and resumed from start after injection sequence
value: 1
enum/SAMPLE_TIME:
bit_size: 3
variants:
- name: Cycles2_5
description: 2.5 clock cycles
value: 0
- name: Cycles6_5
description: 6.5 clock cycles
value: 1
- name: Cycles12_5
description: 12.5 clock cycles
value: 2
- name: Cycles24_5
description: 24.5 clock cycles
value: 3
- name: Cycles47_5
description: 47.5 clock cycles
value: 4
- name: Cycles92_5
description: 92.5 clock cycles
value: 5
- name: Cycles247_5
description: 247.5 clock cycles
value: 6
- name: Cycles640_5
description: 640.5 clock cycles
value: 7
enum/TROVS:
bit_size: 1
variants:
- name: Automatic
description: All oversampled conversions for a channel are done consecutively following a trigger
value: 0
- name: Triggered
description: Each oversampled conversion for a channel needs a new trigger
value: 1

View File

@ -1,7 +1,7 @@
block/CRC:
description: Cyclic Redundancy Check calculation unit
items:
- name: DR
- name: DR32
description: Data register
byte_offset: 0
- name: DR16

View File

@ -1,7 +1,7 @@
block/CRC:
description: Cyclic Redundancy Check calculation unit
items:
- name: DR
- name: DR32
description: Data register
byte_offset: 0
- name: DR16

View File

@ -0,0 +1,79 @@
block/EXTI:
description: External interrupt/event controller
items:
- name: RTSR
description: Rising Trigger selection register
array:
len: 1
stride: 40
byte_offset: 0
fieldset: LINES
- name: FTSR
description: Falling Trigger selection register
array:
len: 1
stride: 40
byte_offset: 4
fieldset: LINES
- name: SWIER
description: Software interrupt event register
array:
len: 1
stride: 40
byte_offset: 8
fieldset: LINES
- name: RPR
description: Rising pending register
array:
len: 1
stride: 40
byte_offset: 12
fieldset: LINES
- name: FPR
description: Falling pending register
array:
len: 1
stride: 40
byte_offset: 16
fieldset: LINES
- name: EXTICR
description: Configuration register
array:
len: 4
stride: 4
byte_offset: 96
fieldset: EXTICR
- name: IMR
description: Interrupt mask register
array:
len: 2
stride: 16
byte_offset: 128
fieldset: LINES
- name: EMR
description: Event mask register
array:
len: 2
stride: 16
byte_offset: 132
fieldset: LINES
fieldset/EXTICR:
description: external interrupt configuration register 1
fields:
- name: EXTI
description: EXTI configuration bits
bit_offset: 0
bit_size: 8
array:
len: 4
stride: 8
fieldset/LINES:
description: EXTI lines register, 1 bit per line
fields:
- name: LINE
description: EXTI line
bit_offset: 0
bit_size: 1
array:
len: 32
stride: 1

View File

@ -0,0 +1,414 @@
block/FLASH:
description: Flash
items:
- name: ACR
description: Access control register
byte_offset: 0
fieldset: ACR
- name: PDKEYR
description: Power down key register
byte_offset: 4
access: Write
- name: KEYR
description: Flash key register
byte_offset: 8
access: Write
- name: OPTKEYR
description: Option byte key register
byte_offset: 12
access: Write
- name: SR
description: Status register
byte_offset: 16
fieldset: SR
- name: CR
description: Flash control register
byte_offset: 20
fieldset: CR
- name: ECCR
description: Flash ECC register
byte_offset: 24
fieldset: ECCR
- name: OPTR
description: Flash option register
byte_offset: 32
fieldset: OPTR
- name: PCROP1SR
description: Flash Bank 1 PCROP Start address register
byte_offset: 36
fieldset: PCROP1SR
- name: PCROP1ER
description: Flash Bank 1 PCROP End address register
byte_offset: 40
fieldset: PCROP1ER
- name: WRP1AR
description: Flash Bank 1 WRP area A address register
byte_offset: 44
fieldset: WRP1AR
- name: WRP1BR
description: Flash Bank 1 WRP area B address register
byte_offset: 48
fieldset: WRP1BR
- name: SEC1R
description: securable area bank1 register
byte_offset: 112
fieldset: SEC1R
fieldset/ACR:
description: Access control register
fields:
- name: LATENCY
description: Latency
bit_offset: 0
bit_size: 4
enum: LATENCY
- name: PRFTEN
description: Prefetch enable
bit_offset: 8
bit_size: 1
- name: ICEN
description: Instruction cache enable
bit_offset: 9
bit_size: 1
- name: DCEN
description: Data cache enable
bit_offset: 10
bit_size: 1
- name: ICRST
description: Instruction cache reset
bit_offset: 11
bit_size: 1
- name: DCRST
description: Data cache reset
bit_offset: 12
bit_size: 1
- name: RUN_PD
description: Flash Power-down mode during Low-power run mode
bit_offset: 13
bit_size: 1
- name: SLEEP_PD
description: Flash Power-down mode during Low-power sleep mode
bit_offset: 14
bit_size: 1
- name: DBG_SWEN
description: Debug software enable
bit_offset: 18
bit_size: 1
fieldset/CR:
description: Flash control register
fields:
- name: PG
description: Programming
bit_offset: 0
bit_size: 1
- name: PER
description: Page erase
bit_offset: 1
bit_size: 1
- name: MER1
description: Bank 1 Mass erase
bit_offset: 2
bit_size: 1
- name: PNB
description: Page number
bit_offset: 3
bit_size: 7
- name: MER2
description: Bank 2 Mass erase
bit_offset: 15
bit_size: 1
- name: STRT
description: Start
bit_offset: 16
bit_size: 1
- name: OPTSTRT
description: Options modification start
bit_offset: 17
bit_size: 1
- name: FSTPG
description: Fast programming
bit_offset: 18
bit_size: 1
- name: EOPIE
description: End of operation interrupt enable
bit_offset: 24
bit_size: 1
- name: ERRIE
description: Error interrupt enable
bit_offset: 25
bit_size: 1
- name: RDERRIE
description: PCROP read error interrupt enable
bit_offset: 26
bit_size: 1
- name: OBL_LAUNCH
description: Force the option byte loading
bit_offset: 27
bit_size: 1
- name: SEC_PROT1
description: Securable memory area protection enable
bit_offset: 28
bit_size: 1
- name: OPTLOCK
description: Options Lock
bit_offset: 30
bit_size: 1
- name: LOCK
description: FLASH_CR Lock
bit_offset: 31
bit_size: 1
fieldset/ECCR:
description: Flash ECC register
fields:
- name: ADDR_ECC
description: ECC fail address
bit_offset: 0
bit_size: 19
- name: BK_ECC
description: ECC fail for Corrected ECC Error or Double ECC Error in info block
bit_offset: 21
bit_size: 1
- name: SYSF_ECC
description: ECC fail for Corrected ECC Error or Double ECC Error in info block
bit_offset: 22
bit_size: 1
- name: ECCIE
description: ECC correction interrupt enable
bit_offset: 24
bit_size: 1
- name: ECCC2
description: ECC correction
bit_offset: 28
bit_size: 1
- name: ECCD2
description: ECC2 detection
bit_offset: 29
bit_size: 1
- name: ECCC
description: ECC correction
bit_offset: 30
bit_size: 1
- name: ECCD
description: ECC detection
bit_offset: 31
bit_size: 1
fieldset/OPTR:
description: Flash option register
fields:
- name: RDP
description: Read protection level
bit_offset: 0
bit_size: 8
enum: RDP
- name: BOR_LEV
description: BOR reset Level
bit_offset: 8
bit_size: 3
- name: nRST_STOP
description: nRST_STOP
bit_offset: 12
bit_size: 1
- name: nRST_STDBY
description: nRST_STDBY
bit_offset: 13
bit_size: 1
- name: nRST_SHDW
description: nRST_SHDW
bit_offset: 14
bit_size: 1
- name: IDWG_SW
description: Independent watchdog selection
bit_offset: 16
bit_size: 1
- name: IWDG_STOP
description: Independent watchdog counter freeze in Stop mode
bit_offset: 17
bit_size: 1
- name: IWDG_STDBY
description: Independent watchdog counter freeze in Standby mode
bit_offset: 18
bit_size: 1
- name: WWDG_SW
description: Window watchdog selection
bit_offset: 19
bit_size: 1
- name: BFB2
description: Dual bank boot
bit_offset: 20
bit_size: 1
- name: DBANK
description: Dual bank memory mode
bit_offset: 22
bit_size: 1
- name: nBOOT1
description: Boot configuration
bit_offset: 23
bit_size: 1
- name: SRAM2_PE
description: SRAM2 parity check enable
bit_offset: 24
bit_size: 1
- name: SRAM2_RST
description: SRAM2 Erase when system reset
bit_offset: 25
bit_size: 1
- name: nSWBOOT0
description: nSWBOOT0
bit_offset: 26
bit_size: 1
- name: nBOOT0
description: nBOOT0 option bit
bit_offset: 27
bit_size: 1
- name: NRST_MODE
description: NRST_MODE
bit_offset: 28
bit_size: 2
enum: NRST_MODE
- name: IRHEN
description: Internal reset holder enable bit
bit_offset: 30
bit_size: 1
fieldset/PCROP1ER:
description: Flash Bank 1 PCROP End address register
fields:
- name: PCROP1_END
description: Bank 1 PCROP area end offset
bit_offset: 0
bit_size: 15
- name: PCROP_RDP
description: PCROP area preserved when RDP level decreased
bit_offset: 31
bit_size: 1
fieldset/PCROP1SR:
description: Flash Bank 1 PCROP Start address register
fields:
- name: PCROP1_STRT
description: Bank 1 PCROP area start offset
bit_offset: 0
bit_size: 15
fieldset/SEC1R:
description: securable area bank1 register
fields:
- name: SEC_SIZE1
description: SEC_SIZE1
bit_offset: 0
bit_size: 8
- name: BOOT_LOCK
description: used to force boot from user area
bit_offset: 16
bit_size: 1
fieldset/SR:
description: Status register
fields:
- name: EOP
description: End of operation
bit_offset: 0
bit_size: 1
- name: OPERR
description: Operation error
bit_offset: 1
bit_size: 1
- name: PROGERR
description: Programming error
bit_offset: 3
bit_size: 1
- name: WRPERR
description: Write protected error
bit_offset: 4
bit_size: 1
- name: PGAERR
description: Programming alignment error
bit_offset: 5
bit_size: 1
- name: SIZERR
description: Size error
bit_offset: 6
bit_size: 1
- name: PGSERR
description: Programming sequence error
bit_offset: 7
bit_size: 1
- name: MISERR
description: Fast programming data miss error
bit_offset: 8
bit_size: 1
- name: FASTERR
description: Fast programming error
bit_offset: 9
bit_size: 1
- name: RDERR
description: PCROP read error
bit_offset: 14
bit_size: 1
- name: OPTVERR
description: Option validity error
bit_offset: 15
bit_size: 1
- name: BSY
description: Busy
bit_offset: 16
bit_size: 1
fieldset/WRP1AR:
description: Flash Bank 1 WRP area A address register
fields:
- name: WRP1A_STRT
description: Bank 1 WRP first area start offset
bit_offset: 0
bit_size: 7
- name: WRP1A_END
description: Bank 1 WRP first area A end offset
bit_offset: 16
bit_size: 7
fieldset/WRP1BR:
description: Flash Bank 1 WRP area B address register
fields:
- name: WRP1B_STRT
description: Bank 1 WRP second area B end offset
bit_offset: 0
bit_size: 7
- name: WRP1B_END
description: Bank 1 WRP second area B start offset
bit_offset: 16
bit_size: 7
enum/LATENCY:
bit_size: 4
variants:
- name: WS0
description: Zero wait states
value: 0
- name: WS1
description: One wait state
value: 1
- name: WS2
description: Two wait states
value: 2
- name: WS3
description: Three wait states
value: 3
- name: WS4
description: Four wait states
value: 4
enum/NRST_MODE:
bit_size: 2
variants:
- name: INPUT_ONLY
description: Reset pin is in reset input mode only
value: 1
- name: GPIO
description: Reset pin is in GPIO mode only
value: 2
- name: INPUT_OUTPUT
description: Reset pin is in reset input and output mode
value: 3
enum/RDP:
bit_size: 8
variants:
- name: LEVEL_0
description: Read protection not active
value: 170
- name: LEVEL_1
description: Memories read protection active
value: 187
- name: LEVEL_2
description: Chip read protection active
value: 204

View File

@ -0,0 +1,406 @@
block/FLASH:
description: Flash
items:
- name: ACR
description: Access control register
byte_offset: 0
fieldset: ACR
- name: PDKEYR
description: Power down key register
byte_offset: 4
access: Write
- name: KEYR
description: Flash key register
byte_offset: 8
access: Write
- name: OPTKEYR
description: Option byte key register
byte_offset: 12
access: Write
- name: SR
description: Status register
byte_offset: 16
fieldset: SR
- name: CR
description: Flash control register
byte_offset: 20
fieldset: CR
- name: ECCR
description: Flash ECC register
byte_offset: 24
fieldset: ECCR
- name: OPTR
description: Flash option register
byte_offset: 32
fieldset: OPTR
- name: PCROP1SR
description: Flash Bank 1 PCROP Start address register
byte_offset: 36
fieldset: PCROP1SR
- name: PCROP1ER
description: Flash Bank 1 PCROP End address register
byte_offset: 40
fieldset: PCROP1ER
- name: WRP1AR
description: Flash Bank 1 WRP area A address register
byte_offset: 44
fieldset: WRP1AR
- name: WRP1BR
description: Flash Bank 1 WRP area B address register
byte_offset: 48
fieldset: WRP1BR
- name: SEC1R
description: securable area bank1 register
byte_offset: 112
fieldset: SEC1R
fieldset/ACR:
description: Access control register
fields:
- name: LATENCY
description: Latency
bit_offset: 0
bit_size: 4
enum: LATENCY
- name: PRFTEN
description: Prefetch enable
bit_offset: 8
bit_size: 1
- name: ICEN
description: Instruction cache enable
bit_offset: 9
bit_size: 1
- name: DCEN
description: Data cache enable
bit_offset: 10
bit_size: 1
- name: ICRST
description: Instruction cache reset
bit_offset: 11
bit_size: 1
- name: DCRST
description: Data cache reset
bit_offset: 12
bit_size: 1
- name: RUN_PD
description: Flash Power-down mode during Low-power run mode
bit_offset: 13
bit_size: 1
- name: SLEEP_PD
description: Flash Power-down mode during Low-power sleep mode
bit_offset: 14
bit_size: 1
- name: DBG_SWEN
description: Debug software enable
bit_offset: 18
bit_size: 1
fieldset/CR:
description: Flash control register
fields:
- name: PG
description: Programming
bit_offset: 0
bit_size: 1
- name: PER
description: Page erase
bit_offset: 1
bit_size: 1
- name: MER1
description: Bank 1 Mass erase
bit_offset: 2
bit_size: 1
- name: PNB
description: Page number
bit_offset: 3
bit_size: 7
- name: STRT
description: Start
bit_offset: 16
bit_size: 1
- name: OPTSTRT
description: Options modification start
bit_offset: 17
bit_size: 1
- name: FSTPG
description: Fast programming
bit_offset: 18
bit_size: 1
- name: EOPIE
description: End of operation interrupt enable
bit_offset: 24
bit_size: 1
- name: ERRIE
description: Error interrupt enable
bit_offset: 25
bit_size: 1
- name: RDERRIE
description: PCROP read error interrupt enable
bit_offset: 26
bit_size: 1
- name: OBL_LAUNCH
description: Force the option byte loading
bit_offset: 27
bit_size: 1
- name: SEC_PROT1
description: Securable memory area protection enable
bit_offset: 28
bit_size: 1
- name: OPTLOCK
description: Options Lock
bit_offset: 30
bit_size: 1
- name: LOCK
description: FLASH_CR Lock
bit_offset: 31
bit_size: 1
fieldset/ECCR:
description: Flash ECC register
fields:
- name: ADDR_ECC
description: ECC fail address
bit_offset: 0
bit_size: 19
- name: BK_ECC
description: ECC fail for Corrected ECC Error or Double ECC Error in info block
bit_offset: 21
bit_size: 1
- name: SYSF_ECC
description: ECC fail for Corrected ECC Error or Double ECC Error in info block
bit_offset: 22
bit_size: 1
- name: ECCIE
description: ECC correction interrupt enable
bit_offset: 24
bit_size: 1
- name: ECCC2
description: ECC correction
bit_offset: 28
bit_size: 1
- name: ECCD2
description: ECC2 detection
bit_offset: 29
bit_size: 1
- name: ECCC
description: ECC correction
bit_offset: 30
bit_size: 1
- name: ECCD
description: ECC detection
bit_offset: 31
bit_size: 1
fieldset/OPTR:
description: Flash option register
fields:
- name: RDP
description: Read protection level
bit_offset: 0
bit_size: 8
enum: RDP
- name: BOR_LEV
description: BOR reset Level
bit_offset: 8
bit_size: 3
- name: nRST_STOP
description: nRST_STOP
bit_offset: 12
bit_size: 1
- name: nRST_STDBY
description: nRST_STDBY
bit_offset: 13
bit_size: 1
- name: nRST_SHDW
description: nRST_SHDW
bit_offset: 14
bit_size: 1
- name: IDWG_SW
description: Independent watchdog selection
bit_offset: 16
bit_size: 1
- name: IWDG_STOP
description: Independent watchdog counter freeze in Stop mode
bit_offset: 17
bit_size: 1
- name: IWDG_STDBY
description: Independent watchdog counter freeze in Standby mode
bit_offset: 18
bit_size: 1
- name: WWDG_SW
description: Window watchdog selection
bit_offset: 19
bit_size: 1
- name: PB4_PUPEN
description: PB4 pull-up enable
bit_offset: 22
bit_size: 1
- name: nBOOT1
description: Boot configuration
bit_offset: 23
bit_size: 1
- name: SRAM2_PE
description: SRAM2 parity check enable
bit_offset: 24
bit_size: 1
- name: SRAM2_RST
description: SRAM2 Erase when system reset
bit_offset: 25
bit_size: 1
- name: nSWBOOT0
description: nSWBOOT0
bit_offset: 26
bit_size: 1
- name: nBOOT0
description: nBOOT0 option bit
bit_offset: 27
bit_size: 1
- name: NRST_MODE
description: NRST_MODE
bit_offset: 28
bit_size: 2
enum: NRST_MODE
- name: IRHEN
description: Internal reset holder enable bit
bit_offset: 30
bit_size: 1
fieldset/PCROP1ER:
description: Flash Bank 1 PCROP End address register
fields:
- name: PCROP1_END
description: Bank 1 PCROP area end offset
bit_offset: 0
bit_size: 15
- name: PCROP_RDP
description: PCROP area preserved when RDP level decreased
bit_offset: 31
bit_size: 1
fieldset/PCROP1SR:
description: Flash Bank 1 PCROP Start address register
fields:
- name: PCROP1_STRT
description: Bank 1 PCROP area start offset
bit_offset: 0
bit_size: 15
fieldset/SEC1R:
description: securable area bank1 register
fields:
- name: SEC_SIZE1
description: SEC_SIZE1
bit_offset: 0
bit_size: 8
- name: BOOT_LOCK
description: used to force boot from user area
bit_offset: 16
bit_size: 1
fieldset/SR:
description: Status register
fields:
- name: EOP
description: End of operation
bit_offset: 0
bit_size: 1
- name: OPERR
description: Operation error
bit_offset: 1
bit_size: 1
- name: PROGERR
description: Programming error
bit_offset: 3
bit_size: 1
- name: WRPERR
description: Write protected error
bit_offset: 4
bit_size: 1
- name: PGAERR
description: Programming alignment error
bit_offset: 5
bit_size: 1
- name: SIZERR
description: Size error
bit_offset: 6
bit_size: 1
- name: PGSERR
description: Programming sequence error
bit_offset: 7
bit_size: 1
- name: MISERR
description: Fast programming data miss error
bit_offset: 8
bit_size: 1
- name: FASTERR
description: Fast programming error
bit_offset: 9
bit_size: 1
- name: RDERR
description: PCROP read error
bit_offset: 14
bit_size: 1
- name: OPTVERR
description: Option validity error
bit_offset: 15
bit_size: 1
- name: BSY
description: Busy
bit_offset: 16
bit_size: 1
fieldset/WRP1AR:
description: Flash Bank 1 WRP area A address register
fields:
- name: WRP1A_STRT
description: Bank 1 WRP first area start offset
bit_offset: 0
bit_size: 7
- name: WRP1A_END
description: Bank 1 WRP first area A end offset
bit_offset: 16
bit_size: 7
fieldset/WRP1BR:
description: Flash Bank 1 WRP area B address register
fields:
- name: WRP1B_STRT
description: Bank 1 WRP second area B end offset
bit_offset: 0
bit_size: 7
- name: WRP1B_END
description: Bank 1 WRP second area B start offset
bit_offset: 16
bit_size: 7
enum/LATENCY:
bit_size: 4
variants:
- name: WS0
description: Zero wait states
value: 0
- name: WS1
description: One wait state
value: 1
- name: WS2
description: Two wait states
value: 2
- name: WS3
description: Three wait states
value: 3
- name: WS4
description: Four wait states
value: 4
enum/NRST_MODE:
bit_size: 2
variants:
- name: INPUT_ONLY
description: Reset pin is in reset input mode only
value: 1
- name: GPIO
description: Reset pin is in GPIO mode only
value: 2
- name: INPUT_OUTPUT
description: Reset pin is in reset input and output mode
value: 3
enum/RDP:
bit_size: 8
variants:
- name: LEVEL_0
description: Read protection not active
value: 170
- name: LEVEL_1
description: Memories read protection active
value: 187
- name: LEVEL_2
description: Chip read protection active
value: 204

View File

@ -46,6 +46,7 @@ block/FLASH:
- name: OPTSR_CUR
description: FLASH option status register
byte_offset: 80
access: Read
fieldset: OPTSR
- name: OPTSR_PRG
description: FLASH option status register
@ -54,6 +55,7 @@ block/FLASH:
- name: OPTSR2_CUR
description: FLASH option status register 2
byte_offset: 112
access: Read
fieldset: OPTSR2
- name: OPTSR2_PRG
description: FLASH option status register 2
@ -62,6 +64,7 @@ block/FLASH:
- name: NSBOOTR_CUR
description: FLASH non-secure unique boot entry register
byte_offset: 128
access: Read
fieldset: NSBOOTR
- name: NSBOOTR_PRG
description: FLASH non-secure unique boot entry address
@ -70,6 +73,7 @@ block/FLASH:
- name: OTPBLR_CUR
description: FLASH non-secure OTP block lock
byte_offset: 144
access: Read
fieldset: OTPBLR
- name: OTPBLR_PRG
description: FLASH non-secure OTP block lock
@ -82,6 +86,7 @@ block/FLASH:
- name: WRPSGN1R_CUR
description: FLASH write sector protection for Bank1
byte_offset: 232
access: Read
fieldset: WRP
- name: WRPSGN1R_PRG
description: FLASH write sector protection for Bank1
@ -90,6 +95,7 @@ block/FLASH:
- name: HDP1R_CUR
description: FLASH HDP Bank1 register
byte_offset: 248
access: Read
fieldset: HDP1R
- name: HDP1R_PRG
description: FLASH HDP Bank1 register
@ -110,6 +116,7 @@ block/FLASH:
- name: WRPSGN2R_CUR
description: FLASH write sector protection for Bank2
byte_offset: 488
access: Read
fieldset: WRP
- name: WRPSGN2R_PRG
description: FLASH write sector protection for Bank2
@ -118,6 +125,7 @@ block/FLASH:
- name: HDP2R_CUR
description: FLASH HDP Bank2 register
byte_offset: 504
access: Read
fieldset: HDP2R
- name: HDP2R_PRG
description: FLASH HDP Bank2 register
@ -413,7 +421,6 @@ fieldset/OPTCR:
description: "Bank swapping option configuration bit\r SWAP_BANK controls whether Bank1 and Bank2 are swapped or not. This bit is loaded with the SWAP_BANK bit of FLASH_OPTSR_CUR register only after reset or POR."
bit_offset: 31
bit_size: 1
enum: OPTCR_SWAP_BANK
fieldset/OPTSR:
description: FLASH option status register
fields:
@ -452,9 +459,10 @@ fieldset/OPTSR:
bit_size: 1
enum: OPTSR_NRST_STDBY
- name: PRODUCT_STATE
description: Life state code (based on Hamming 8,4). More information in .
description: Life state code (based on Hamming 8,4).
bit_offset: 8
bit_size: 8
enum: PRODUCT_STATE
- name: IO_VDD_HSLV
description: High-speed IO at low VDD voltage status bit. This bit can be set only with VDD below 2.5 V.
bit_offset: 16
@ -479,7 +487,6 @@ fieldset/OPTSR:
description: "Bank swapping option status bit\r SWAP_BANK reflects whether Bank1 and Bank2 are swapped or not.\r SWAP_BANK is loaded to SWAP_BANK of FLASH_OPTCR after a reset."
bit_offset: 31
bit_size: 1
enum: OPTSR_SWAP_BANK
fieldset/OPTSR2:
description: FLASH option status register 2
fields:
@ -574,11 +581,11 @@ fieldset/WRP:
enum/BKSEL:
bit_size: 1
variants:
- name: B_0x0
- name: BANK1
description: Bank1 is selected for Bank erase / sector erase / interrupt enable
value: 0
- name: B_0x1
description: Bank2 is selected for BER / SER
- name: BANK2
description: Bank1 is selected for Bank erase / sector erase / interrupt enable
value: 1
enum/CODE_OP:
bit_size: 3
@ -619,15 +626,6 @@ enum/NSPRIV:
- name: B_0x1
description: access to non secure registers is denied in case of non privileged access.
value: 1
enum/OPTCR_SWAP_BANK:
bit_size: 1
variants:
- name: B_0x0
description: Bank1 and Bank2 not swapped
value: 0
- name: B_0x1
description: Bank1 and Bank2 swapped
value: 1
enum/OPTSR_BKPRAM_ECC:
bit_size: 1
variants:
@ -715,6 +713,27 @@ enum/OPTSR_NRST_STDBY:
- name: B_0x1
description: no reset generated when entering Standby mode on core domain.
value: 1
enum/PRODUCT_STATE:
bit_size: 8
variants:
- name: OPEN
description: Open
value: 0xED
- name: PROVISIONING
description: Provisioning
value: 0x17
- name: IROT_PROVISIONED
description: iROT-Provisioned
value: 0x2E
- name: CLOSED
description: Closed
value: 0x72
- name: LOCKED
description: Locked
value: 0x5C
- name: REGRESSION
description: Regression
value: 0x9A
enum/OPTSR_NRST_STOP:
bit_size: 1
variants:
@ -733,15 +752,6 @@ enum/OPTSR_SRAM_ECC:
- name: B_0x1
description: SRAM2 ECC check disabled
value: 1
enum/OPTSR_SWAP_BANK:
bit_size: 1
variants:
- name: B_0x0
description: Bank1 and Bank2 not swapped
value: 0
- name: B_0x1
description: Bank1 and Bank2 swapped
value: 1
enum/OPTSR_WWDG_SW:
bit_size: 1
variants:

View File

@ -0,0 +1,368 @@
block/FLASH:
description: Mamba FLASH register block
items:
- name: ACR
description: FLASH access control register
byte_offset: 0
fieldset: ACR
- name: KEYR
description: FLASH key register
byte_offset: 8
fieldset: KEYR
- name: OPTKEYR
description: FLASH option key register
byte_offset: 12
fieldset: OPTKEYR
- name: SR
description: FLASH status register
byte_offset: 16
fieldset: SR
- name: CR
description: FLASH control register
byte_offset: 20
fieldset: CR
- name: ECCR
description: FLASH ECC register
byte_offset: 24
fieldset: ECCR
- name: OPTR
description: FLASH option register
byte_offset: 32
fieldset: OPTR
- name: WRP1AR
description: FLASH WRP area A address register
byte_offset: 44
fieldset: WRP1AR
- name: WRP1BR
description: FLASH WRP area B address register
byte_offset: 48
fieldset: WRP1BR
- name: SECR
description: FLASH security register
byte_offset: 128
fieldset: SECR
fieldset/ACR:
description: FLASH access control register
fields:
- name: LATENCY
description: 'Flash memory access latency The value in this bitfield represents the number of CPU wait states when accessing the flash memory. Other: Reserved A new write into the bitfield becomes effective when it returns the same value upon read.'
bit_offset: 0
bit_size: 3
- name: PRFTEN
description: CPU Prefetch enable
bit_offset: 8
bit_size: 1
- name: ICEN
description: CPU Instruction cache enable
bit_offset: 9
bit_size: 1
- name: ICRST
description: CPU Instruction cache reset This bit can be written only when the instruction cache is disabled.
bit_offset: 11
bit_size: 1
- name: EMPTY
description: Main flash memory area empty This bit indicates whether the first location of the main flash memory area is erased or has a programmed value. The bit can be set and reset by software.
bit_offset: 16
bit_size: 1
- name: DBG_SWEN
description: Debug access software enable Software may use this bit to enable/disable the debugger read access.
bit_offset: 18
bit_size: 1
fieldset/CR:
description: FLASH control register
fields:
- name: PG
description: Flash memory programming enable
bit_offset: 0
bit_size: 1
- name: PER
description: Page erase enable
bit_offset: 1
bit_size: 1
- name: MER1
description: Mass erase When set, this bit triggers the mass erase, that is, all user pages.
bit_offset: 2
bit_size: 1
- name: PNB
description: 'Page number selection These bits select the page to erase: ... Note: Values corresponding to addresses outside the main memory are not allowed.'
bit_offset: 3
bit_size: 7
- name: STRT
description: Start erase operation This bit triggers an erase operation when set. This bit is possible to set only by software and to clear only by hardware. The hardware clears it when one of BSY1 and BSY2 flags in the FLASH_SR register transits to zero.
bit_offset: 16
bit_size: 1
- name: OPTSTRT
description: Start of modification of option bytes This bit triggers an options operation when set. This bit is set only by software, and is cleared when the BSY1 bit is cleared in FLASH_SR.
bit_offset: 17
bit_size: 1
- name: FSTPG
description: Fast programming enable
bit_offset: 18
bit_size: 1
- name: EOPIE
description: End-of-operation interrupt enable This bit enables the interrupt generation upon setting the EOP flag in the FLASH_SR register.
bit_offset: 24
bit_size: 1
- name: ERRIE
description: Error interrupt enable This bit enables the interrupt generation upon setting the OPERR flag in the FLASH_SR register.
bit_offset: 25
bit_size: 1
- name: RDERRIE
description: PCROP read error interrupt enable This bit enables the interrupt generation upon setting the RDERR flag in the FLASH_SR register.
bit_offset: 26
bit_size: 1
- name: OBL_LAUNCH
description: Option byte load launch When set, this bit triggers the load of option bytes into option registers. It is automatically cleared upon the completion of the load. The high state of the bit indicates pending option byte load. The bit cannot be cleared by software. It cannot be written as long as OPTLOCK is set.
bit_offset: 27
bit_size: 1
- name: SEC_PROT
description: Securable memory area protection enable This bit enables the protection on securable area, provided that a non-null securable memory area size (SEC_SIZE[4:0]) is defined in option bytes. This bit is possible to set only by software and to clear only through a system reset.
bit_offset: 28
bit_size: 1
- name: OPTLOCK
description: Options Lock This bit is set only. When set, all bits concerning user option in FLASH_CR register and so option page are locked. This bit is cleared by hardware after detecting the unlock sequence. The LOCK bit must be cleared before doing the unlock sequence for OPTLOCK bit. In case of an unsuccessful unlock operation, this bit remains set until the next reset.
bit_offset: 30
bit_size: 1
- name: LOCK
description: FLASH_CR Lock This bit is set only. When set, the FLASH_CR register is locked. It is cleared by hardware after detecting the unlock sequence. In case of an unsuccessful unlock operation, this bit remains set until the next system reset.
bit_offset: 31
bit_size: 1
fieldset/ECCR:
description: FLASH ECC register
fields:
- name: ADDR_ECC
description: ECC fail double-word address offset In case of ECC error or ECC correction detected, this bitfield contains double-word offset (multiple of 64 bits) to main Flash memory.
bit_offset: 0
bit_size: 14
- name: SYSF_ECC
description: System Flash memory ECC fail This bit indicates that the ECC error correction or double ECC error detection is located in the system Flash memory.
bit_offset: 20
bit_size: 1
- name: ECCCIE
description: ECC correction interrupt enable
bit_offset: 24
bit_size: 1
- name: ECCC
description: ECC correction Set by hardware when one ECC error has been detected and corrected. An interrupt is generated if ECCIE is set. Cleared by writing 1.
bit_offset: 30
bit_size: 1
- name: ECCD
description: ECC detection Set by hardware when two ECC errors have been detected. When this bit is set, a NMI is generated. Cleared by writing 1.
bit_offset: 31
bit_size: 1
fieldset/KEYR:
description: FLASH key register
fields:
- name: KEY
description: 'FLASH key The following values must be written consecutively to unlock the FLASH control register (FLASH_CR), thus enabling programming/erasing operations: KEY1: 0x4567 0123 KEY2: 0xCDEF 89AB'
bit_offset: 0
bit_size: 32
fieldset/OPTKEYR:
description: FLASH option key register
fields:
- name: OPTKEY
description: 'Option byte key The following values must be written consecutively to unlock the flash memory option registers, enabling option byte programming/erasing operations: KEY1: 0x0819 2A3B KEY2: 0x4C5D 6E7F'
bit_offset: 0
bit_size: 32
fieldset/OPTR:
description: FLASH option register
fields:
- name: RDP
description: 'Read protection level Other: Level 1, memories read protection active'
bit_offset: 0
bit_size: 8
enum: RDP
- name: BORR_LEV
description: BOR reset level
bit_offset: 8
bit_size: 3
enum: BORR_LEV
- name: NRST_STOP
description: Reset generated when entering Stop mode
bit_offset: 13
bit_size: 1
- name: NRST_STDBY
description: Reset generated when entering Standby mode
bit_offset: 14
bit_size: 1
- name: NRST_SHDW
description: Reset generated when entering Shutdown mode
bit_offset: 15
bit_size: 1
- name: IWDG_SW
description: Independent watchdog selection
bit_offset: 16
bit_size: 1
- name: IWDG_STOP
description: Independent watchdog counter freeze in Stop mode
bit_offset: 17
bit_size: 1
- name: IWDG_STDBY
description: Independent watchdog counter freeze in Standby mode
bit_offset: 18
bit_size: 1
- name: WWDG_SW
description: Window watchdog selection
bit_offset: 19
bit_size: 1
- name: BDRST
description: Backup domain reset
bit_offset: 21
bit_size: 1
- name: RAM_PARITY_CHECK
description: SRAM parity check control enable/disable
bit_offset: 22
bit_size: 1
- name: BKPSRAM_HW_ERASE_DISABLE
description: Backup SRAM erase prevention
bit_offset: 23
bit_size: 1
- name: NBOOT_SEL
description: BOOT0 signal source selection This option bit defines the source of the BOOT0 signal.
bit_offset: 24
bit_size: 1
- name: NBOOT1
description: 'Boot configuration Together with the BOOT0 pin or option bit NBOOT0 (depending on NBOOT_SEL option bit configuration), this bit selects boot mode from the main flash memory, SRAM or the system memory. Refer to Section12.5: Boot configuration.'
bit_offset: 25
bit_size: 1
- name: NBOOT0
description: NBOOT0 option bit
bit_offset: 26
bit_size: 1
- name: NRST_MODE
description: NRST pin configuration
bit_offset: 27
bit_size: 2
enum: NRST_MODE
- name: IRHEN
description: Internal reset holder enable bit
bit_offset: 29
bit_size: 1
fieldset/SECR:
description: FLASH security register
fields:
- name: HDP1_PEND
description: Last page of the first hide protection area
bit_offset: 0
bit_size: 7
- name: BOOT_LOCK
description: used to force boot from user area If the bit is set in association with RDP level 1, the debug capabilities are disabled, except in the case of a bad OBL (mismatch).
bit_offset: 16
bit_size: 1
- name: HDP1EN
description: Hide protection area enable
bit_offset: 24
bit_size: 8
fieldset/SR:
description: FLASH status register
fields:
- name: EOP
description: End of operation Set by hardware when one or more flash memory operation (programming / erase) has been completed successfully. This bit is set only if the end of operation interrupts are enabled (EOPIE=1). Cleared by writing 1.
bit_offset: 0
bit_size: 1
- name: OPERR
description: Operation error Set by hardware when a flash memory operation (program / erase) completes unsuccessfully. This bit is set only if error interrupts are enabled (ERRIE=1). Cleared by writing 1.
bit_offset: 1
bit_size: 1
- name: PROGERR
description: Programming error Set by hardware when a double-word address to be programmed contains a value different from '0xFFFF FFFF' before programming, except if the data to write is '0x0000 0000'. Cleared by writing 1.
bit_offset: 3
bit_size: 1
- name: WRPERR
description: Write protection error Set by hardware when an address to be erased/programmed belongs to a write-protected part (by WRP, PCROP or RDP Level 1) of the flash memory. Cleared by writing 1.
bit_offset: 4
bit_size: 1
- name: PGAERR
description: Programming alignment error Set by hardware when the data to program cannot be contained in the same double word (64-bit) flash memory in case of standard programming, or if there is a change of page during fast programming. Cleared by writing 1.
bit_offset: 5
bit_size: 1
- name: SIZERR
description: 'Size error Set by hardware when the size of the access is a byte or half-word during a program or a fast program sequence. Only double word programming is allowed (consequently: word access). Cleared by writing 1.'
bit_offset: 6
bit_size: 1
- name: PGSERR
description: Programming sequence error Set by hardware when a write access to the flash memory is performed by the code while PG or FSTPG have not been set previously. Set also by hardware when PROGERR, SIZERR, PGAERR, WRPERR, MISSERR or FASTERR is set due to a previous programming error. Cleared by writing 1.
bit_offset: 7
bit_size: 1
- name: MISSERR
description: Fast programming data miss error In Fast programming mode, 16 double words (128 bytes) must be sent to flash memory successively, and the new data must be sent to the logic control before the current data is fully programmed. MISSERR is set by hardware when the new data is not present in time. Cleared by writing 1.
bit_offset: 8
bit_size: 1
- name: FASTERR
description: Fast programming error Set by hardware when a fast programming sequence (activated by FSTPG) is interrupted due to an error (alignment, size, write protection or data miss). The corresponding status bit (PGAERR, SIZERR, WRPERR or MISSERR) is set at the same time. Cleared by writing 1.
bit_offset: 9
bit_size: 1
- name: RDERR
description: PCROP read error Set by hardware when an address to be read belongs to a read protected area of the flash memory (PCROP protection). An interrupt is generated if RDERRIE is set in FLASH_CR. Cleared by writing 1.
bit_offset: 14
bit_size: 1
- name: OPTVERR
description: Option and Engineering bits loading validity error
bit_offset: 15
bit_size: 1
- name: BSY1
description: Busy This flag indicates that a flash memory operation requested by FLASH control register (FLASH_CR) is in progress. This bit is set at the beginning of the flash memory operation, and cleared when the operation finishes or when an error occurs.
bit_offset: 16
bit_size: 1
- name: CFGBSY
description: Programming or erase configuration busy. This flag is set and cleared by hardware. It is set when the first word is sent for program or when setting the STRT bit of FLASH control register (FLASH_CR) for erase. It is cleared when the flash memory program or erase operation completes or ends with an error. When set, launching any other operation through the FLASH control register (FLASH_CR) is impossible, and must be postponed (a programming or erase operation is ongoing). When cleared, the program and erase settings in the FLASH control register (FLASH_CR) can be modified.
bit_offset: 18
bit_size: 1
fieldset/WRP1AR:
description: FLASH WRP area A address register
fields:
- name: WRP1A_STRT
description: 'WRP area A start offset This bitfield contains the offset of the first page of the WRP area A. Note: The number of effective bits depends on the size of the flash memory in the device.'
bit_offset: 0
bit_size: 7
- name: WRP1A_END
description: 'WRP area A end offset This bitfield contains the offset of the last page of the WRP area A. Note: The number of effective bits depends on the size of the flash memory in the device.'
bit_offset: 16
bit_size: 7
fieldset/WRP1BR:
description: FLASH WRP area B address register
fields:
- name: WRP1B_STRT
description: 'WRP area B start offset This bitfield contains the offset of the first page of the WRP area B. Note: The number of effective bits depends on the size of the flash memory in the device.'
bit_offset: 0
bit_size: 7
- name: WRP1B_END
description: 'WRP area B end offset This bitfield contains the offset of the last page of the WRP area B. Note: The number of effective bits depends on the size of the flash memory in the device.'
bit_offset: 16
bit_size: 7
enum/BORR_LEV:
bit_size: 3
variants:
- name: Level1
description: BOR rising level 1 with threshold around 2.1 V
value: 0
- name: Level2
description: BOR rising level 2 with threshold around 2.3 V
value: 1
- name: Level3
description: BOR rising level 3 with threshold around 2.6 V
value: 2
- name: Level4
description: BOR rising level 4 with threshold around 2.9 V
value: 3
enum/NRST_MODE:
bit_size: 2
variants:
- name: OnlyInput
description: 'Reset input only: a low level on the NRST pin generates system reset; internal RESET is not propagated to the NRST pin.'
value: 1
- name: OnlyInternal
description: 'Standard GPIO: only internal RESET is possible'
value: 2
- name: Bidirectional
description: 'Bidirectional reset: the NRST pin is configured in reset input/output (legacy) mode'
value: 3
enum/RDP:
bit_size: 8
variants:
- name: Level0
description: Level 0, read protection not active
value: 170
- name: Level2
description: Level 2, chip read protection active
value: 204

144
data/registers/hsem_v1.yaml Normal file
View File

@ -0,0 +1,144 @@
block/HSEM:
description: Hardware semaphore (HSEM).
items:
- name: R
description: HSEM register HSEM_R%s HSEM_R31.
array:
len: 32
stride: 4
byte_offset: 0
fieldset: R
- name: RLR
description: HSEM Read lock register.
array:
len: 32
stride: 4
byte_offset: 128
access: Read
fieldset: RLR
- name: IER
description: HSEM Interrupt enable register.
byte_offset: 256
fieldset: IER
array:
len: 2
stride: 16
- name: ICR
description: HSEM Interrupt clear register.
byte_offset: 260
fieldset: ICR
array:
len: 2
stride: 16
- name: ISR
description: HSEM Interrupt status register.
byte_offset: 264
access: Read
fieldset: ISR
array:
len: 2
stride: 16
- name: MISR
description: HSEM Masked interrupt status register.
byte_offset: 268
access: Read
fieldset: MISR
array:
len: 2
stride: 16
- name: CR
description: HSEM Clear register.
byte_offset: 320
fieldset: CR
- name: KEYR
description: HSEM Interrupt clear register.
byte_offset: 324
fieldset: KEYR
fieldset/CR:
description: HSEM Clear register.
fields:
- name: COREID
description: COREID of semaphores to be cleared.
bit_offset: 8
bit_size: 4
- name: KEY
description: Semaphore clear Key.
bit_offset: 16
bit_size: 16
fieldset/KEYR:
description: HSEM Interrupt clear register.
fields:
- name: KEY
description: Semaphore Clear Key.
bit_offset: 16
bit_size: 16
fieldset/R:
description: HSEM register HSEM_R%s HSEM_R31.
fields:
- name: PROCID
description: Semaphore ProcessID.
bit_offset: 0
bit_size: 8
- name: COREID
description: Semaphore COREID.
bit_offset: 8
bit_size: 4
- name: LOCK
description: Lock indication.
bit_offset: 31
bit_size: 1
fieldset/RLR:
description: HSEM Read lock register.
fields:
- name: PROCID
description: Semaphore ProcessID.
bit_offset: 0
bit_size: 8
- name: COREID
description: Semaphore COREID.
bit_offset: 8
bit_size: 4
- name: LOCK
description: Lock indication.
bit_offset: 31
bit_size: 1
fieldset/IER:
description: HSEM Interrupt enable register.
fields:
- name: ISE
description: Interrupt semaphore x enable bit.
bit_offset: 0
bit_size: 1
array:
len: 32
stride: 1
fieldset/ICR:
description: HSEM Interrupt clear register.
fields:
- name: ISC
description: Interrupt semaphore x clear bit.
bit_offset: 0
bit_size: 1
array:
len: 32
stride: 1
fieldset/ISR:
description: HSEM Interrupt status register.
fields:
- name: ISF
description: Interrupt semaphore x status bit before enable (mask).
bit_offset: 0
bit_size: 1
array:
len: 32
stride: 1
fieldset/MISR:
description: HSEM Masked interrupt status register.
fields:
- name: MISF
description: masked interrupt semaphore x status bit after enable (mask).
bit_offset: 0
bit_size: 1
array:
len: 32
stride: 1

145
data/registers/hsem_v2.yaml Normal file
View File

@ -0,0 +1,145 @@
block/HSEM:
description: HSEM.
items:
- name: R
description: HSEM register HSEM_R%s HSEM_R31.
array:
len: 32
stride: 4
byte_offset: 0
fieldset: R
- name: RLR
description: HSEM Read lock register.
array:
len: 32
stride: 4
byte_offset: 128
access: Read
fieldset: RLR
- name: IER
description: HSEM Interrupt enable register.
byte_offset: 256
fieldset: IER
array:
len: 1
stride: 16
- name: ICR
description: HSEM Interrupt clear register.
byte_offset: 260
access: Read
fieldset: ICR
array:
len: 1
stride: 16
- name: ISR
description: HSEM Interrupt status register.
byte_offset: 264
access: Read
fieldset: ISR
array:
len: 1
stride: 16
- name: MISR
description: HSEM Masked interrupt status register.
byte_offset: 268
access: Read
fieldset: MISR
array:
len: 1
stride: 16
- name: CR
description: HSEM Clear register.
byte_offset: 320
fieldset: CR
- name: KEYR
description: HSEM Interrupt clear register.
byte_offset: 324
fieldset: KEYR
fieldset/CR:
description: HSEM Clear register.
fields:
- name: COREID
description: COREID of semaphores to be cleared.
bit_offset: 8
bit_size: 4
- name: KEY
description: Semaphore clear Key.
bit_offset: 16
bit_size: 16
fieldset/KEYR:
description: HSEM Interrupt clear register.
fields:
- name: KEY
description: Semaphore Clear Key.
bit_offset: 16
bit_size: 16
fieldset/R:
description: HSEM register HSEM_R%s HSEM_R31.
fields:
- name: PROCID
description: Semaphore ProcessID.
bit_offset: 0
bit_size: 8
- name: COREID
description: Semaphore COREID.
bit_offset: 8
bit_size: 4
- name: LOCK
description: Lock indication.
bit_offset: 31
bit_size: 1
fieldset/RLR:
description: HSEM Read lock register.
fields:
- name: PROCID
description: Semaphore ProcessID.
bit_offset: 0
bit_size: 8
- name: COREID
description: Semaphore COREID.
bit_offset: 8
bit_size: 4
- name: LOCK
description: Lock indication.
bit_offset: 31
bit_size: 1
fieldset/IER:
description: HSEM Interrupt enable register.
fields:
- name: ISE
description: Interrupt semaphore x enable bit.
bit_offset: 0
bit_size: 1
array:
len: 32
stride: 1
fieldset/ICR:
description: HSEM Interrupt clear register.
fields:
- name: ISC
description: Interrupt semaphore x clear bit.
bit_offset: 0
bit_size: 1
array:
len: 32
stride: 1
fieldset/ISR:
description: HSEM Interrupt status register.
fields:
- name: ISF
description: Interrupt semaphore x status bit before enable (mask).
bit_offset: 0
bit_size: 1
array:
len: 32
stride: 1
fieldset/MISR:
description: HSEM Masked interrupt status register.
fields:
- name: MISF
description: masked interrupt semaphore x status bit after enable (mask).
bit_offset: 0
bit_size: 1
array:
len: 32
stride: 1

145
data/registers/hsem_v3.yaml Normal file
View File

@ -0,0 +1,145 @@
block/HSEM:
description: Hardware semaphore.
items:
- name: R
description: HSEM register HSEM_R%s HSEM_R31.
array:
len: 16
stride: 4
byte_offset: 0
fieldset: R
- name: RLR
description: HSEM Read lock register.
array:
len: 16
stride: 4
byte_offset: 128
access: Read
fieldset: RLR
- name: IER
description: HSEM Interrupt enable register.
byte_offset: 256
fieldset: IER
array:
len: 2
stride: 16
- name: ICR
description: HSEM Interrupt clear register.
byte_offset: 260
fieldset: ICR
array:
len: 2
stride: 16
- name: ISR
description: HSEM Interrupt status register.
byte_offset: 264
access: Read
fieldset: ISR
array:
len: 2
stride: 16
- name: MISR
description: HSEM Masked interrupt status register.
byte_offset: 268
access: Read
fieldset: MISR
array:
len: 2
stride: 16
- name: CR
description: HSEM Clear register.
byte_offset: 320
access: Write
fieldset: CR
- name: KEYR
description: HSEM Interrupt clear register.
byte_offset: 324
fieldset: KEYR
fieldset/CR:
description: HSEM Clear register.
fields:
- name: COREID
description: COREID.
bit_offset: 8
bit_size: 4
- name: KEY
description: Semaphore clear Key.
bit_offset: 16
bit_size: 16
fieldset/KEYR:
description: HSEM Interrupt clear register.
fields:
- name: KEY
description: Semaphore Clear Key.
bit_offset: 16
bit_size: 16
fieldset/R:
description: HSEM register HSEM_R%s HSEM_R31.
fields:
- name: PROCID
description: Semaphore ProcessID.
bit_offset: 0
bit_size: 8
- name: COREID
description: COREID.
bit_offset: 8
bit_size: 4
- name: LOCK
description: Lock indication.
bit_offset: 31
bit_size: 1
fieldset/RLR:
description: HSEM Read lock register.
fields:
- name: PROCID
description: Semaphore ProcessID.
bit_offset: 0
bit_size: 8
- name: COREID
description: COREID.
bit_offset: 8
bit_size: 4
- name: LOCK
description: Lock indication.
bit_offset: 31
bit_size: 1
fieldset/IER:
description: HSEM Interrupt enable register.
fields:
- name: ISE
description: Interrupt semaphore x enable bit.
bit_offset: 0
bit_size: 1
array:
len: 16
stride: 1
fieldset/ICR:
description: HSEM Interrupt clear register.
fields:
- name: ISC
description: Interrupt semaphore x clear bit.
bit_offset: 0
bit_size: 1
array:
len: 16
stride: 1
fieldset/ISR:
description: HSEM Interrupt status register.
fields:
- name: ISF
description: Interrupt semaphore x status bit before enable (mask).
bit_offset: 0
bit_size: 1
array:
len: 16
stride: 1
fieldset/MISR:
description: HSEM Masked interrupt status register.
fields:
- name: MISF
description: masked interrupt semaphore x status bit after enable (mask).
bit_offset: 0
bit_size: 1
array:
len: 16
stride: 1

145
data/registers/hsem_v4.yaml Normal file
View File

@ -0,0 +1,145 @@
block/HSEM:
description: Hardware semaphore.
items:
- name: R
description: HSEM register HSEM_R%s HSEM_R31.
array:
len: 16
stride: 4
byte_offset: 0
fieldset: R
- name: RLR
description: HSEM Read lock register.
array:
len: 16
stride: 4
byte_offset: 128
access: Read
fieldset: RLR
- name: IER
description: HSEM Interrupt enable register.
byte_offset: 256
fieldset: IER
array:
len: 1
stride: 16
- name: ICR
description: HSEM Interrupt clear register.
byte_offset: 260
fieldset: ICR
array:
len: 1
stride: 16
- name: ISR
description: HSEM Interrupt status register.
byte_offset: 264
access: Read
fieldset: ISR
array:
len: 1
stride: 16
- name: MISR
description: HSEM Masked interrupt status register.
byte_offset: 268
access: Read
fieldset: MISR
array:
len: 1
stride: 16
- name: CR
description: HSEM Clear register.
byte_offset: 320
access: Write
fieldset: CR
- name: KEYR
description: HSEM Interrupt clear register.
byte_offset: 324
fieldset: KEYR
fieldset/ICR:
description: HSEM Interrupt clear register.
fields:
- name: ISC
description: Interrupt(N) semaphore n clear bit.
bit_offset: 0
bit_size: 1
array:
len: 16
stride: 1
fieldset/IER:
description: HSEM Interrupt enable register.
fields:
- name: ISE
description: Interrupt semaphore n enable bit.
bit_offset: 0
bit_size: 1
array:
len: 16
stride: 1
fieldset/ISR:
description: HSEM Interrupt status register.
fields:
- name: ISF
description: Interrupt(N) semaphore n status bit before enable (mask).
bit_offset: 0
bit_size: 1
array:
len: 16
stride: 1
fieldset/MISR:
description: HSEM Masked interrupt status register.
fields:
- name: MISF
description: masked interrupt(N) semaphore n status bit after enable (mask).
bit_offset: 0
bit_size: 1
array:
len: 16
stride: 1
fieldset/CR:
description: HSEM Clear register.
fields:
- name: COREID
description: COREID.
bit_offset: 8
bit_size: 4
- name: KEY
description: Semaphore clear Key.
bit_offset: 16
bit_size: 16
fieldset/KEYR:
description: HSEM Interrupt clear register.
fields:
- name: KEY
description: Semaphore Clear Key.
bit_offset: 16
bit_size: 16
fieldset/R:
description: HSEM register HSEM_R%s HSEM_R31.
fields:
- name: PROCID
description: Semaphore ProcessID.
bit_offset: 0
bit_size: 8
- name: COREID
description: Semaphore COREID.
bit_offset: 8
bit_size: 4
- name: LOCK
description: Lock indication.
bit_offset: 31
bit_size: 1
fieldset/RLR:
description: HSEM Read lock register.
fields:
- name: PROCID
description: Semaphore ProcessID.
bit_offset: 0
bit_size: 8
- name: COREID
description: Semaphore COREID.
bit_offset: 8
bit_size: 4
- name: LOCK
description: Lock indication.
bit_offset: 31
bit_size: 1

View File

@ -0,0 +1,324 @@
block/LPTIM:
description: Low power timer.
items:
- name: ISR
description: Interrupt and Status Register.
byte_offset: 0
access: Read
fieldset: ISR
- name: ICR
description: Interrupt Clear Register.
byte_offset: 4
access: Write
fieldset: ICR
- name: IER
description: Interrupt Enable Register.
byte_offset: 8
fieldset: IER
- name: CFGR
description: Configuration Register.
byte_offset: 12
fieldset: CFGR
- name: CR
description: Control Register.
byte_offset: 16
fieldset: CR
- name: CMP
description: Compare Register.
byte_offset: 20
fieldset: CMP
- name: ARR
description: Autoreload Register.
byte_offset: 24
fieldset: ARR
- name: CNT
description: Counter Register.
byte_offset: 28
access: Read
fieldset: CNT
- name: OR
description: LPTIM option register.
byte_offset: 32
- name: RCR
description: LPTIM repetition register.
byte_offset: 40
fieldset: RCR
fieldset/ARR:
description: Autoreload Register.
fields:
- name: ARR
description: Auto reload value.
bit_offset: 0
bit_size: 16
fieldset/CFGR:
description: Configuration Register.
fields:
- name: CKSEL
description: Clock selector.
bit_offset: 0
bit_size: 1
enum: CKSEL
- name: CKPOL
description: Clock Polarity.
bit_offset: 1
bit_size: 2
enum: CKPOL
- name: CKFLT
description: Configurable digital filter for external clock.
bit_offset: 3
bit_size: 2
enum: Filter
- name: TRGFLT
description: Configurable digital filter for trigger.
bit_offset: 6
bit_size: 2
enum: Filter
- name: PRESC
description: Clock prescaler.
bit_offset: 9
bit_size: 3
enum: PRESC
- name: TRIGSEL
description: Trigger selector.
bit_offset: 13
bit_size: 3
- name: TRIGEN
description: Trigger enable and polarity.
bit_offset: 17
bit_size: 2
- name: TIMOUT
description: Timeout enable.
bit_offset: 19
bit_size: 1
- name: WAVE
description: Waveform shape.
bit_offset: 20
bit_size: 1
- name: WAVPOL
description: Waveform shape polarity.
bit_offset: 21
bit_size: 1
- name: PRELOAD
description: Registers update mode.
bit_offset: 22
bit_size: 1
- name: COUNTMODE
description: counter mode enabled.
bit_offset: 23
bit_size: 1
- name: ENC
description: Encoder mode enable.
bit_offset: 24
bit_size: 1
fieldset/CMP:
description: Compare Register.
fields:
- name: CMP
description: Compare value.
bit_offset: 0
bit_size: 16
fieldset/CNT:
description: Counter Register.
fields:
- name: CNT
description: Counter value.
bit_offset: 0
bit_size: 16
fieldset/CR:
description: Control Register.
fields:
- name: ENABLE
description: LPTIM Enable.
bit_offset: 0
bit_size: 1
- name: SNGSTRT
description: LPTIM start in single mode.
bit_offset: 1
bit_size: 1
- name: CNTSTRT
description: Timer start in continuous mode.
bit_offset: 2
bit_size: 1
- name: RSTARE
description: Reset after read enable.
bit_offset: 3
bit_size: 1
- name: COUNTRST
description: Counter reset.
bit_offset: 4
bit_size: 1
fieldset/ICR:
description: Interrupt Clear Register.
fields:
- name: CMPMCF
description: compare match Clear Flag.
bit_offset: 0
bit_size: 1
- name: ARRMCF
description: Autoreload match Clear Flag.
bit_offset: 1
bit_size: 1
- name: EXTTRIGCF
description: External trigger valid edge Clear Flag.
bit_offset: 2
bit_size: 1
- name: CMPOKCF
description: Compare register update OK Clear Flag.
bit_offset: 3
bit_size: 1
- name: ARROKCF
description: Autoreload register update OK Clear Flag.
bit_offset: 4
bit_size: 1
- name: UPCF
description: Direction change to UP Clear Flag.
bit_offset: 5
bit_size: 1
- name: DOWNCF
description: Direction change to down Clear Flag.
bit_offset: 6
bit_size: 1
- name: UECF
description: Update event clear flag.
bit_offset: 7
bit_size: 1
- name: REPOKCF
description: Repetition register update OK clear flag.
bit_offset: 8
bit_size: 1
fieldset/IER:
description: Interrupt Enable Register.
fields:
- name: CMPMIE
description: Compare match Interrupt Enable.
bit_offset: 0
bit_size: 1
- name: ARRMIE
description: Autoreload match Interrupt Enable.
bit_offset: 1
bit_size: 1
- name: EXTTRIGIE
description: External trigger valid edge Interrupt Enable.
bit_offset: 2
bit_size: 1
- name: CMPOKIE
description: Compare register update OK Interrupt Enable.
bit_offset: 3
bit_size: 1
- name: ARROKIE
description: Autoreload register update OK Interrupt Enable.
bit_offset: 4
bit_size: 1
- name: UPIE
description: Direction change to UP Interrupt Enable.
bit_offset: 5
bit_size: 1
- name: DOWNIE
description: Direction change to down Interrupt Enable.
bit_offset: 6
bit_size: 1
- name: UEIE
description: Update event interrupt enable.
bit_offset: 7
bit_size: 1
- name: REPOKIE
description: REPOKIE.
bit_offset: 8
bit_size: 1
fieldset/ISR:
description: Interrupt and Status Register.
fields:
- name: CMPM
description: Compare match.
bit_offset: 0
bit_size: 1
- name: ARRM
description: Autoreload match.
bit_offset: 1
bit_size: 1
- name: EXTTRIG
description: External trigger edge event.
bit_offset: 2
bit_size: 1
- name: CMPOK
description: Compare register update OK.
bit_offset: 3
bit_size: 1
- name: ARROK
description: Autoreload register update OK.
bit_offset: 4
bit_size: 1
- name: UP
description: Counter direction change down to up.
bit_offset: 5
bit_size: 1
- name: DOWN
description: Counter direction change up to down.
bit_offset: 6
bit_size: 1
- name: UE
description: LPTIM update event occurred.
bit_offset: 7
bit_size: 1
- name: REPOK
description: Repetition register update Ok.
bit_offset: 8
bit_size: 1
fieldset/RCR:
description: LPTIM repetition register.
fields:
- name: REP
description: Repetition register value.
bit_offset: 0
bit_size: 8
enum/CKPOL:
bit_size: 2
variants:
- name: Rising
description: the rising edge is the active edge used for counting. If the LPTIM is configured in Encoder mode (ENC bit is set), the encoder sub-mode 1 is active.
value: 0
- name: Falling
description: the falling edge is the active edge used for counting. If the LPTIM is configured in Encoder mode (ENC bit is set), the encoder sub-mode 2 is active.
value: 1
- name: Both
description: both edges are active edges. When both external clock signal edges are considered active ones, the LPTIM must also be clocked by an internal clock source with a frequency equal to at least four times the external clock frequency. If the LPTIM is configured in Encoder mode (ENC bit is set), the encoder sub-mode 3 is active.
value: 2
enum/CKSEL:
bit_size: 1
variants:
- name: Internal
description: LPTIM is clocked by internal clock source (APB clock or any of the embedded oscillators)
value: 0
- name: External
description: LPTIM is clocked by an external clock source through the LPTIM external Input1
value: 1
enum/Filter:
bit_size: 2
variants:
- name: Count1
value: 0
- name: Count2
value: 1
- name: Count4
value: 2
- name: Count8
value: 3
enum/PRESC:
bit_size: 3
variants:
- name: Div1
value: 0
- name: Div2
value: 1
- name: Div4
value: 2
- name: Div8
value: 3
- name: Div16
value: 4
- name: Div32
value: 5
- name: Div64
value: 6
- name: Div128
value: 7

View File

@ -0,0 +1,568 @@
block/LPTIM_ADV:
extends: LPTIM_BASIC
description: Low power timer with Output Compare
items:
- name: ISR
description: LPTIM interrupt and status register.
byte_offset: 0
fieldset: ISR_ADV
- name: ICR
description: LPTIM interrupt clear register.
byte_offset: 4
fieldset: ICR_ADV
- name: DIER
description: LPTIM interrupt enable register.
byte_offset: 8
fieldset: DIER_ADV
- name: CCR
description: LPTIM compare register 1.
array:
len: 2
stride: 32
byte_offset: 20
fieldset: CCR
- name: CCMR
description: LPTIM capture/compare mode register 1.
byte_offset: 44
fieldset: CCMR
block/LPTIM_BASIC:
description: Low power timer with Output Compare
items:
- name: ISR
description: LPTIM interrupt and status register.
byte_offset: 0
fieldset: ISR_BASIC
- name: ICR
description: LPTIM interrupt clear register.
byte_offset: 4
fieldset: ICR_BASIC
- name: DIER
description: LPTIM interrupt enable register.
byte_offset: 8
fieldset: DIER_BASIC
- name: CFGR
description: LPTIM configuration register.
byte_offset: 12
fieldset: CFGR
- name: CR
description: LPTIM control register.
byte_offset: 16
fieldset: CR
- name: CCR
description: LPTIM compare register 1.
array:
len: 1
stride: 32
byte_offset: 20
fieldset: CCR
- name: ARR
description: LPTIM autoreload register.
byte_offset: 24
fieldset: ARR
- name: CNT
description: LPTIM counter register.
byte_offset: 28
fieldset: CNT
- name: CFGR2
description: LPTIM configuration register 2.
byte_offset: 36
fieldset: CFGR2
- name: RCR
description: LPTIM repetition register.
byte_offset: 40
fieldset: RCR
fieldset/ARR:
description: LPTIM autoreload register.
fields:
- name: ARR
description: Auto reload value ARR is the autoreload value for the LPTIM. This value must be strictly greater than the CCRx[15:0] value.
bit_offset: 0
bit_size: 16
fieldset/CCMR:
description: LPTIM capture/compare mode register 1.
fields:
- name: CCSEL
description: Capture/compare 1 selection This bitfield defines the direction of the channel input (capture) or output mode.
bit_offset: 0
bit_size: 1
array:
len: 2
stride: 16
enum: CCSEL
- name: CCE
description: Capture/compare 1 output enable. This bit determines if a capture of the counter value can actually be done into the input capture/compare register 1 (LPTIM_CCR1) or not.
bit_offset: 1
bit_size: 1
array:
len: 2
stride: 16
- name: CCP_Input
description: Capture/compare 1 output polarity. Only bit2 is used to set polarity when output mode is enabled, bit3 is don't care. This field is used to select the IC1 polarity for capture operations.
bit_offset: 2
bit_size: 2
array:
len: 2
stride: 16
enum: CCP_Input
- name: CCP_Output
description: Capture/compare 1 output polarity. Only bit2 is used to set polarity when output mode is enabled, bit3 is don't care. This field is used to select the IC1 polarity for capture operations.
bit_offset: 2
bit_size: 2
array:
len: 2
stride: 16
enum: CCP_Output
- name: ICPSC
description: Input capture 1 prescaler This bitfield defines the ratio of the prescaler acting on the CC1 input (IC1).
bit_offset: 8
bit_size: 2
array:
len: 2
stride: 16
enum: Filter
- name: ICF
description: Input capture 1 filter This bitfield defines the number of consecutive equal samples that should be detected when a level change occurs on an external input capture signal before it is considered as a valid level transition. An internal clock source must be present to use this feature.
bit_offset: 12
bit_size: 2
array:
len: 2
stride: 16
enum: Filter
fieldset/CCR:
description: LPTIM compare register 1.
fields:
- name: CCR
description: 'Capture/compare 1 value If channel CC1 is configured as output: CCR1 is the value to be loaded in the capture/compare 1 register. Depending on the PRELOAD option, the CCR1 register is immediately updated if the PRELOAD bit is reset and updated at next LPTIM update event if PREOAD bit is reset. The capture/compare register 1 contains the value to be compared to the counter LPTIM_CNT and signaled on OC1 output. If channel CC1 is configured as input: CCR1 contains the counter value transferred by the last input capture 1 event. The LPTIM_CCR1 register is read-only and cannot be programmed. If LPTIM does not implement any channel: The compare register 1 contains the value to be compared to the counter LPTIM_CNT and signaled on LPTIM output.'
bit_offset: 0
bit_size: 16
fieldset/CFGR:
description: LPTIM configuration register.
fields:
- name: CKSEL
description: Clock selector The CKSEL bit selects which clock source the LPTIM uses:.
bit_offset: 0
bit_size: 1
enum: CKSEL
- name: CKPOL
description: 'Clock Polarity When the LPTIM is clocked by an external clock source, CKPOL bits is used to configure the active edge or edges used by the counter: If the LPTIM is configured in Encoder mode (ENC bit is set), the encoder sub-mode 1 is active. If the LPTIM is configured in Encoder mode (ENC bit is set), the encoder sub-mode 2 is active. Refer to for more details about Encoder mode sub-modes.'
bit_offset: 1
bit_size: 2
enum: CKPOL
- name: CKFLT
description: Configurable digital filter for external clock The CKFLT value sets the number of consecutive equal samples that should be detected when a level change occurs on an external clock signal before it is considered as a valid level transition. An internal clock source must be present to use this feature.
bit_offset: 3
bit_size: 2
enum: Filter
- name: TRGFLT
description: Configurable digital filter for trigger The TRGFLT value sets the number of consecutive equal samples that should be detected when a level change occurs on an internal trigger before it is considered as a valid level transition. An internal clock source must be present to use this feature.
bit_offset: 6
bit_size: 2
enum: Filter
- name: PRESC
description: Clock prescaler The PRESC bits configure the prescaler division factor. It can be one among the following division factors:.
bit_offset: 9
bit_size: 3
enum: PRESC
- name: TRIGSEL
description: 'Trigger selector The TRIGSEL bits select the trigger source that serves as a trigger event for the LPTIM among the below 8 available sources: See for details.'
bit_offset: 13
bit_size: 3
- name: TRIGEN
description: Trigger enable and polarity The TRIGEN bits controls whether the LPTIM counter is started by an external trigger or not. If the external trigger option is selected, three configurations are possible for the trigger active edge:.
bit_offset: 17
bit_size: 2
enum: TRIGEN
- name: TIMOUT
description: Timeout enable The TIMOUT bit controls the Timeout feature.
bit_offset: 19
bit_size: 1
- name: WAVE
description: Waveform shape The WAVE bit controls the output shape.
bit_offset: 20
bit_size: 1
- name: WAVPOL
description: 'Waveform shape polarity The WAVEPOL bit controls the output polarity Note: If the LPTIM implements at least one capture/compare channel, this bit is reserved. Please refer to.'
bit_offset: 21
bit_size: 1
- name: PRELOAD
description: Registers update mode The PRELOAD bit controls the LPTIM_ARR, LPTIM_RCR and the LPTIM_CCRx registers update modality.
bit_offset: 22
bit_size: 1
- name: COUNTMODE
description: counter mode enabled The COUNTMODE bit selects which clock source is used by the LPTIM to clock the counter:.
bit_offset: 23
bit_size: 1
- name: ENC
description: 'Encoder mode enable The ENC bit controls the Encoder mode Note: If the LPTIM does not support encoder mode feature, this bit is reserved. Please refer to.'
bit_offset: 24
bit_size: 1
fieldset/CFGR2:
description: LPTIM configuration register 2.
fields:
- name: INSEL
description: LPTIM input 1 selection The IN1SEL bits control the LPTIM input 1 multiplexer, which connects LPTIM input 1 to one of the available inputs. For connection details refer to.
bit_offset: 0
bit_size: 2
array:
len: 2
stride: 4
- name: ICSEL
description: LPTIM input capture 1 selection The IC1SEL bits control the LPTIM Input capture 1 multiplexer, which connects LPTIM Input capture 1 to one of the available inputs. For connection details refer to.
bit_offset: 16
bit_size: 2
array:
len: 2
stride: 4
fieldset/CNT:
description: LPTIM counter register.
fields:
- name: CNT
description: Counter value When the LPTIM is running with an asynchronous clock, reading the LPTIM_CNT register may return unreliable values. So in this case it is necessary to perform two consecutive read accesses and verify that the two returned values are identical.
bit_offset: 0
bit_size: 16
fieldset/CR:
description: LPTIM control register.
fields:
- name: ENABLE
description: LPTIM enable The ENABLE bit is set and cleared by software.
bit_offset: 0
bit_size: 1
- name: SNGSTRT
description: LPTIM start in Single mode This bit is set by software and cleared by hardware. In case of software start (TRIGEN[1:0] = 00), setting this bit starts the LPTIM in single pulse mode. If the software start is disabled (TRIGEN[1:0] different than 00), setting this bit starts the LPTIM in single pulse mode as soon as an external trigger is detected. If this bit is set when the LPTIM is in continuous counting mode, then the LPTIM stops at the following match between LPTIM_ARR and LPTIM_CNT registers. This bit can only be set when the LPTIM is enabled. It is automatically reset by hardware.
bit_offset: 1
bit_size: 1
- name: CNTSTRT
description: Timer start in Continuous mode This bit is set by software and cleared by hardware. In case of software start (TRIGEN[1:0] = 00), setting this bit starts the LPTIM in Continuous mode. If the software start is disabled (TRIGEN[1:0] different than 00), setting this bit starts the timer in Continuous mode as soon as an external trigger is detected. If this bit is set when a single pulse mode counting is ongoing, then the timer does not stop at the next match between the LPTIM_ARR and LPTIM_CNT registers and the LPTIM counter keeps counting in Continuous mode. This bit can be set only when the LPTIM is enabled. It is automatically reset by hardware.
bit_offset: 2
bit_size: 1
- name: COUNTRST
description: Counter reset This bit is set by software and cleared by hardware. When set to '1' this bit triggers a synchronous reset of the LPTIM_CNT counter register. Due to the synchronous nature of this reset, it only takes place after a synchronization delay of 3 LPTimer core clock cycles (LPTimer core clock may be different from APB clock). This bit can be set only when the LPTIM is enabled. It is automatically reset by hardware. COUNTRST must never be set to '1' by software before it is already cleared to '0' by hardware. Software should consequently check that COUNTRST bit is already cleared to '0' before attempting to set it to '1'.
bit_offset: 3
bit_size: 1
- name: RSTARE
description: Reset after read enable This bit is set and cleared by software. When RSTARE is set to '1', any read access to LPTIM_CNT register asynchronously resets LPTIM_CNT register content. This bit can be set only when the LPTIM is enabled.
bit_offset: 4
bit_size: 1
fieldset/DIER_ADV:
extends: DIER_BASIC
description: LPTIM interrupt enable register.
fields:
- name: CCIE
description: Capture/compare 1 interrupt enable.
bit_offset: 0
bit_size: 1
array:
len: 2
stride: 9
- name: CMPOKIE
description: Compare register 1 update OK interrupt enable.
bit_offset: 3
bit_size: 1
array:
len: 2
stride: 16
- name: CCOIE
description: 'Capture/compare 1 over-capture interrupt enable Note: If LPTIM does not implement at least 1 channel this bit is reserved. Please refer to.'
bit_offset: 12
bit_size: 1
array:
len: 2
stride: 1
- name: CCDE
description: 'Capture/compare 1 DMA request enable Note: If LPTIM does not implement at least 1 channel this bit is reserved. Please refer to.'
bit_offset: 16
bit_size: 1
array:
len: 2
stride: 9
fieldset/DIER_BASIC:
description: LPTIM interrupt enable register.
fields:
- name: CCIE
description: Capture/compare 1 interrupt enable.
bit_offset: 0
bit_size: 1
array:
len: 1
stride: 9
- name: ARRMIE
description: Autoreload match Interrupt Enable.
bit_offset: 1
bit_size: 1
- name: EXTTRIGIE
description: External trigger valid edge Interrupt Enable.
bit_offset: 2
bit_size: 1
- name: CMPOKIE
description: Compare register 1 update OK interrupt enable.
bit_offset: 3
bit_size: 1
array:
len: 1
stride: 16
- name: ARROKIE
description: Autoreload register update OK Interrupt Enable.
bit_offset: 4
bit_size: 1
- name: UPIE
description: 'Direction change to UP Interrupt Enable Note: If the LPTIM does not support encoder mode feature, this bit is reserved. Please refer to.'
bit_offset: 5
bit_size: 1
- name: DOWNIE
description: 'Direction change to down Interrupt Enable Note: If the LPTIM does not support encoder mode feature, this bit is reserved. Please refer to.'
bit_offset: 6
bit_size: 1
- name: UEIE
description: Update event interrupt enable.
bit_offset: 7
bit_size: 1
- name: REPOKIE
description: Repetition register update OK interrupt Enable.
bit_offset: 8
bit_size: 1
fieldset/ICR_ADV:
extends: ICR_BASIC
description: LPTIM interrupt clear register.
fields:
- name: CCCF
description: Capture/compare 1 clear flag Writing 1 to this bit clears the CC1IF flag in the LPTIM_ISR register.
bit_offset: 0
bit_size: 1
array:
len: 2
stride: 9
- name: CMPOKCF
description: Compare register 1 update OK clear flag Writing 1 to this bit clears the CMP1OK flag in the LPTIM_ISR register.
bit_offset: 3
bit_size: 1
array:
len: 2
stride: 16
- name: CCOCF
description: 'Capture/compare 1 over-capture clear flag Writing 1 to this bit clears the CC1OF flag in the LPTIM_ISR register. Note: If LPTIM does not implement at least 1 channel this bit is reserved. Please refer to.'
bit_offset: 12
bit_size: 1
array:
len: 2
stride: 1
fieldset/ICR_BASIC:
description: LPTIM interrupt clear register.
fields:
- name: CCCF
description: Capture/compare 1 clear flag Writing 1 to this bit clears the CC1IF flag in the LPTIM_ISR register.
bit_offset: 0
bit_size: 1
array:
len: 1
stride: 9
- name: ARRMCF
description: Autoreload match clear flag Writing 1 to this bit clears the ARRM flag in the LPTIM_ISR register.
bit_offset: 1
bit_size: 1
- name: EXTTRIGCF
description: External trigger valid edge clear flag Writing 1 to this bit clears the EXTTRIG flag in the LPTIM_ISR register.
bit_offset: 2
bit_size: 1
- name: CMPOKCF
description: Compare register 1 update OK clear flag Writing 1 to this bit clears the CMP1OK flag in the LPTIM_ISR register.
bit_offset: 3
bit_size: 1
array:
len: 1
stride: 16
- name: ARROKCF
description: Autoreload register update OK clear flag Writing 1 to this bit clears the ARROK flag in the LPTIM_ISR register.
bit_offset: 4
bit_size: 1
- name: UPCF
description: 'Direction change to UP clear flag Writing 1 to this bit clear the UP flag in the LPTIM_ISR register. Note: If the LPTIM does not support encoder mode feature, this bit is reserved. Please refer to.'
bit_offset: 5
bit_size: 1
- name: DOWNCF
description: 'Direction change to down clear flag Writing 1 to this bit clear the DOWN flag in the LPTIM_ISR register. Note: If the LPTIM does not support encoder mode feature, this bit is reserved. Please refer to.'
bit_offset: 6
bit_size: 1
- name: UECF
description: Update event clear flag Writing 1 to this bit clear the UE flag in the LPTIM_ISR register.
bit_offset: 7
bit_size: 1
- name: REPOKCF
description: Repetition register update OK clear flag Writing 1 to this bit clears the REPOK flag in the LPTIM_ISR register.
bit_offset: 8
bit_size: 1
- name: DIEROKCF
description: Interrupt enable register update OK clear flag Writing 1 to this bit clears the DIEROK flag in the LPTIM_ISR register.
bit_offset: 24
bit_size: 1
fieldset/ISR_ADV:
extends: ISR_BASIC
description: LPTIM interrupt and status register.
fields:
- name: CCIF
description: Compare 1 interrupt flag The CC1IF flag is set by hardware to inform application that LPTIM_CNT register value matches the compare register's value. The CC1IF flag can be cleared by writing 1 to the CC1CF bit in the LPTIM_ICR register.
bit_offset: 0
bit_size: 1
array:
len: 2
stride: 9
- name: CMPOK
description: Compare register 1 update OK CMP1OK is set by hardware to inform application that the APB bus write operation to the LPTIM_CCR1 register has been successfully completed. CMP1OK flag can be cleared by writing 1 to the CMP1OKCF bit in the LPTIM_ICR register.
bit_offset: 3
bit_size: 1
array:
len: 2
stride: 16
- name: CCOF
description: 'Capture 1 over-capture flag This flag is set by hardware only when the corresponding channel is configured in input capture mode. It is cleared by software by writing 1 to the CC1OCF bit in the LPTIM_ICR register. Note: If LPTIM does not implement at least 1 channel this bit is reserved. Please refer to.'
bit_offset: 12
bit_size: 1
array:
len: 2
stride: 1
fieldset/ISR_BASIC:
description: LPTIM interrupt and status register.
fields:
- name: CCIF
description: Compare 1 interrupt flag The CC1IF flag is set by hardware to inform application that LPTIM_CNT register value matches the compare register's value. The CC1IF flag can be cleared by writing 1 to the CC1CF bit in the LPTIM_ICR register.
bit_offset: 0
bit_size: 1
array:
len: 1
stride: 9
- name: ARRM
description: Autoreload match ARRM is set by hardware to inform application that LPTIM_CNT registers value reached the LPTIM_ARR registers value. ARRM flag can be cleared by writing 1 to the ARRMCF bit in the LPTIM_ICR register.
bit_offset: 1
bit_size: 1
- name: EXTTRIG
description: External trigger edge event EXTTRIG is set by hardware to inform application that a valid edge on the selected external trigger input has occurred. If the trigger is ignored because the timer has already started, then this flag is not set. EXTTRIG flag can be cleared by writing 1 to the EXTTRIGCF bit in the LPTIM_ICR register.
bit_offset: 2
bit_size: 1
- name: CMPOK
description: Compare register 1 update OK CMP1OK is set by hardware to inform application that the APB bus write operation to the LPTIM_CCR1 register has been successfully completed. CMP1OK flag can be cleared by writing 1 to the CMP1OKCF bit in the LPTIM_ICR register.
bit_offset: 3
bit_size: 1
array:
len: 1
stride: 16
- name: ARROK
description: Autoreload register update OK ARROK is set by hardware to inform application that the APB bus write operation to the LPTIM_ARR register has been successfully completed. ARROK flag can be cleared by writing 1 to the ARROKCF bit in the LPTIM_ICR register.
bit_offset: 4
bit_size: 1
- name: UP
description: 'Counter direction change down to up In Encoder mode, UP bit is set by hardware to inform application that the counter direction has changed from down to up. UP flag can be cleared by writing 1 to the UPCF bit in the LPTIM_ICR register. Note: If the LPTIM does not support encoder mode feature, this bit is reserved. Please refer to.'
bit_offset: 5
bit_size: 1
- name: DOWN
description: 'Counter direction change up to down In Encoder mode, DOWN bit is set by hardware to inform application that the counter direction has changed from up to down. DOWN flag can be cleared by writing 1 to the DOWNCF bit in the LPTIM_ICR register. Note: If the LPTIM does not support encoder mode feature, this bit is reserved. Please refer to.'
bit_offset: 6
bit_size: 1
- name: UE
description: LPTIM update event occurred UE is set by hardware to inform application that an update event was generated. UE flag can be cleared by writing 1 to the UECF bit in the LPTIM_ICR register.
bit_offset: 7
bit_size: 1
- name: REPOK
description: Repetition register update OK REPOK is set by hardware to inform application that the APB bus write operation to the LPTIM_RCR register has been successfully completed. REPOK flag can be cleared by writing 1 to the REPOKCF bit in the LPTIM_ICR register.
bit_offset: 8
bit_size: 1
- name: DIEROK
description: Interrupt enable register update OK DIEROK is set by hardware to inform application that the APB bus write operation to the LPTIM_DIER register has been successfully completed. DIEROK flag can be cleared by writing 1 to the DIEROKCF bit in the LPTIM_ICR register.
bit_offset: 24
bit_size: 1
fieldset/RCR:
description: LPTIM repetition register.
fields:
- name: REP
description: Repetition register value REP is the repetition value for the LPTIM.
bit_offset: 0
bit_size: 8
enum/CCP_Input:
bit_size: 2
variants:
- name: Rising
value: 0
- name: Falling
value: 1
- name: Both
value: 3
enum/CCP_Output:
bit_size: 2
variants:
- name: ActiveHigh
value: 0
- name: ActiveLow
value: 1
enum/CCSEL:
bit_size: 1
variants:
- name: OutputCompare
description: channel is configured in output PWM mode
value: 0
- name: InputCapture
description: channel is configured in input capture mode
value: 1
enum/CKPOL:
bit_size: 2
variants:
- name: Rising
description: the rising edge is the active edge used for counting. If the LPTIM is configured in Encoder mode (ENC bit is set), the encoder sub-mode 1 is active.
value: 0
- name: Falling
description: the falling edge is the active edge used for counting. If the LPTIM is configured in Encoder mode (ENC bit is set), the encoder sub-mode 2 is active.
value: 1
- name: Both
description: both edges are active edges. When both external clock signal edges are considered active ones, the LPTIM must also be clocked by an internal clock source with a frequency equal to at least four times the external clock frequency. If the LPTIM is configured in Encoder mode (ENC bit is set), the encoder sub-mode 3 is active.
value: 2
enum/CKSEL:
bit_size: 1
variants:
- name: Internal
description: LPTIM is clocked by internal clock source (APB clock or any of the embedded oscillators)
value: 0
- name: External
description: LPTIM is clocked by an external clock source through the LPTIM external Input1
value: 1
enum/Filter:
bit_size: 2
variants:
- name: Count1
value: 0
- name: Count2
value: 1
- name: Count4
value: 2
- name: Count8
value: 3
enum/PRESC:
bit_size: 3
variants:
- name: Div1
value: 0
- name: Div2
value: 1
- name: Div4
value: 2
- name: Div8
value: 3
- name: Div16
value: 4
- name: Div32
value: 5
- name: Div64
value: 6
- name: Div128
value: 7
enum/TRIGEN:
bit_size: 2
variants:
- name: Software
description: software trigger (counting start is initiated by software)
value: 0
- name: RisingEdge
description: rising edge is the active edge
value: 1
- name: FallingEdge
description: falling edge is the active edge
value: 2
- name: BothEdge
description: both edges are active edges
value: 3

1593
data/registers/otg_v2.yaml Normal file

File diff suppressed because it is too large Load Diff

978
data/registers/pwr_u0.yaml Normal file
View File

@ -0,0 +1,978 @@
block/PWR:
description: PWR register block
items:
- name: CR1
description: Power control register 1
byte_offset: 0
fieldset: CR1
- name: CR2
description: Power control register 2
byte_offset: 4
fieldset: CR2
- name: CR3
description: Power control register 3
byte_offset: 8
fieldset: CR3
- name: CR4
description: Power control register 4
byte_offset: 12
fieldset: CR4
- name: SR1
description: Power status register 1
byte_offset: 16
fieldset: SR1
- name: SR2
description: Power status register 2
byte_offset: 20
fieldset: SR2
- name: SCR
description: Power status clear register
byte_offset: 24
fieldset: SCR
- name: PUCRA
description: Power Port A pull-up control register
byte_offset: 32
fieldset: PUCRA
- name: PDCRA
description: Power Port A pull-down control register
byte_offset: 36
fieldset: PDCRA
- name: PUCRB
description: Power Port B pull-up control register
byte_offset: 40
fieldset: PUCRB
- name: PDCRB
description: Power Port B pull-down control register
byte_offset: 44
fieldset: PDCRB
- name: PUCRC
description: Power Port C pull-up control register
byte_offset: 48
fieldset: PUCRC
- name: PDCRC
description: Power Port C pull-down control register
byte_offset: 52
fieldset: PDCRC
- name: PUCRD
description: Power Port D pull-up control register
byte_offset: 56
fieldset: PUCRD
- name: PDCRD
description: Power Port D pull-down control register
byte_offset: 60
fieldset: PDCRD
- name: PUCRE
description: Power Port E pull-up control register
byte_offset: 64
fieldset: PUCRE
- name: PDCRE
description: Power Port E pull-down control register
byte_offset: 68
fieldset: PDCRE
- name: PUCRF
description: Power Port F pull-up control register
byte_offset: 72
fieldset: PUCRF
- name: PDCRF
description: Power Port F pull-down control register
byte_offset: 76
fieldset: PDCRF
fieldset/CR1:
description: Power control register 1
fields:
- name: LPMS
description: 'Low-power mode selection These bits select the low-power mode entered when CPU enters the deepsleep mode. 1xx: Shutdown mode Note: If LPR bit is set, Stop 2 mode cannot be selected and Stop 1 mode shall be entered instead of Stop 2. Note: In Standby mode, SRAM2 can be preserved or not, depending on RRS bit configuration in PWR_CR3.'
bit_offset: 0
bit_size: 3
enum: LPMS
- name: FPD_STOP
description: Flash memory powered down during Stop mode. This bit determines whether the flash memory is put in power-down mode or remains in idle mode when the device enters Stop mode.
bit_offset: 3
bit_size: 1
- name: FPD_LPRUN
description: Flash memory powered down during Low-power run mode. This bit determines whether the flash memory is put in power-down mode or remains in idle mode when the device enters Low-power sleep mode.
bit_offset: 4
bit_size: 1
- name: FPD_LPSLP
description: Flash memory powered down during Low-power sleep mode. This bit determines whether the flash memory is put in power-down mode or remains in idle mode when the device enters Low-power sleep mode.
bit_offset: 5
bit_size: 1
- name: DBP
description: Disable backup domain write protection In reset state, the RTC and backup registers are protected against parasitic write access. This bit must be set to enable write access to these registers.
bit_offset: 8
bit_size: 1
- name: VOS
description: Voltage scaling range selection
bit_offset: 9
bit_size: 2
enum: VOS
- name: LPR
description: 'Low-power run When this bit is set, the regulator is switched from main mode (MR) to low-power mode (LPR). Note: Stop 2 mode cannot be entered when LPR bit is set. Stop 1 is entered instead.'
bit_offset: 14
bit_size: 1
fieldset/CR2:
description: Power control register 2
fields:
- name: PVDE
description: 'Programmable voltage detector enable Note: This bit is write-protected when the bit PVDL (PVD Lock) is set in the SYSCFG_CBR register. Note: This bit is reset only by a system reset.'
bit_offset: 0
bit_size: 1
- name: PLS
description: 'Programmable voltage detector level selection. These bits select the voltage threshold detected by the programmable voltage detector: Note: These bits are write-protected when the bit PVDL (PVD Lock) is set in the SYSCFG_CBR register. Note: These bits are reset only by a system reset.'
bit_offset: 1
bit_size: 3
enum: PLS
- name: PVME1
description: 'Peripheral voltage monitoring 1 enable: V<sub>DDUSB</sub> vs. 1.21V'
bit_offset: 4
bit_size: 1
- name: PVME3
description: 'Peripheral voltage monitoring 3 enable: V<sub>DDA</sub> vs. 1.621V'
bit_offset: 5
bit_size: 1
- name: PVME4
description: 'Peripheral voltage monitoring 4 enable: V<sub>DDA</sub> vs. 1.861V'
bit_offset: 6
bit_size: 1
- name: USV
description: V<sub>DDUSB</sub> USB supply valid This bit is used to validate the V<sub>DDUSB</sub> supply for electrical and logical isolation purpose. Setting this bit is mandatory to use the USB FS peripheral. If V<sub>DDUSB</sub> is not always present in the application, the PVM can be used to determine whether this supply is ready or not.
bit_offset: 10
bit_size: 1
fieldset/CR3:
description: Power control register 3
fields:
- name: EWUP1
description: Enable Wake-up pin WKUP1 When this bit is set, the external wake-up pin WKUP1 is enabled and triggers a wake-up from Standby or Shutdown event when a rising or a falling edge occurs. The active edge is configured via the WP1 bit in the PWR_CR4 register.
bit_offset: 0
bit_size: 1
- name: EWUP2
description: Enable Wake-up pin WKUP2 When this bit is set, the external wake-up pin WKUP2 is enabled and triggers a wake-up from Standby or Shutdown event when a rising or a falling edge occurs. The active edge is configured via the WP2 bit in the PWR_CR4 register.
bit_offset: 1
bit_size: 1
- name: EWUP3
description: Enable Wake-up pin WKUP3 When this bit is set, the external wake-up pin WKUP3 is enabled and triggers a wake-up from Standby or Shutdown event when a rising or a falling edge occurs. The active edge is configured via the WP3 bit in the PWR_CR4 register.
bit_offset: 2
bit_size: 1
- name: EWUP4
description: Enable Wake-up pin WKUP4 When this bit is set, the external wake-up pin WKUP4 is enabled and triggers a wake-up from Standby or Shutdown event when a rising or a falling edge occurs. The active edge is configured via the WP4 bit in the PWR_CR4 register.
bit_offset: 3
bit_size: 1
- name: EWUP5
description: Enable Wake-up pin WKUP5 When this bit is set, the external wake-up pin WKUP5 is enabled and triggers a wake-up from Standby or Shutdown event when a rising or a falling edge occurs.The active edge is configured via the WP5 bit in the PWR_CR4 register.
bit_offset: 4
bit_size: 1
- name: EWUP7
description: Enable Wake-up pin WKUP7. When this bit is set, the external wake-up pin WKUP7 is enabled and triggers a wake-up from Standby or Shutdown event when a rising or a falling edge occurs.The active edge is configured via the WP7 bit in the PWR_CR4 register.
bit_offset: 6
bit_size: 1
- name: RRS
description: SRAM2 retention in Standby mode
bit_offset: 8
bit_size: 1
- name: ENULP
description: Enable ULP sampling When this bit is set, the BORL, BORH and PVD are periodically sampled instead continuous monitoring to reduce power consumption. Fast supply drop between two sample/compare phases is not detected in this mode. This bit has impact only on STOP2, Standby and shutdown low power modes.
bit_offset: 9
bit_size: 1
- name: APC
description: Apply pull-up and pull-down configuration When this bit is set, the I/O pull-up and pull-down configurations defined in the PWR_PUCRx and PWR_PDCRx registers are applied. When this bit is cleared, the PWR_PUCRx and PWR_PDCRx registers are not applied to the I/Os, instead the I/Os are in floating mode during Standby or configured according GPIO controller GPIOx_PUPDR register during RUN mode.
bit_offset: 10
bit_size: 1
- name: EIWUL
description: Enable internal wake-up line
bit_offset: 15
bit_size: 1
fieldset/CR4:
description: Power control register 4
fields:
- name: WP1
description: Wake-up pin WKUP1 polarity This bit defines the polarity used for an event detection on external wake-up pin, WKUP1
bit_offset: 0
bit_size: 1
- name: WP2
description: Wake-up pin WKUP2 polarity This bit defines the polarity used for an event detection on external wake-up pin, WKUP2
bit_offset: 1
bit_size: 1
- name: WP3
description: Wake-up pin WKUP3 polarity This bit defines the polarity used for an event detection on external wake-up pin, WKUP3
bit_offset: 2
bit_size: 1
- name: WP4
description: Wake-up pin WKUP4 polarity This bit defines the polarity used for an event detection on external wake-up pin, WKUP4
bit_offset: 3
bit_size: 1
- name: WP5
description: Wake-up pin WKUP5 polarity This bit defines the polarity used for an event detection on external wake-up pin, WKUP5
bit_offset: 4
bit_size: 1
- name: WP7
description: Wake-up pin WKUP7 polarity This bit defines the polarity used for an event detection on external wake-up pin, WKUP7
bit_offset: 6
bit_size: 1
- name: VBE
description: V<sub>BAT</sub> battery charging enable
bit_offset: 8
bit_size: 1
- name: VBRS
description: V<sub>BAT</sub> battery charging resistor selection
bit_offset: 9
bit_size: 1
fieldset/PDCRA:
description: Power Port A pull-down control register
fields:
- name: PD0
description: Port A pull-down bit y When set, this bit activates the pull-down on PA[y] when APC bit is set in PWR_CR3 register.
bit_offset: 0
bit_size: 1
- name: PD1
description: Port A pull-down bit y When set, this bit activates the pull-down on PA[y] when APC bit is set in PWR_CR3 register.
bit_offset: 1
bit_size: 1
- name: PD2
description: Port A pull-down bit y When set, this bit activates the pull-down on PA[y] when APC bit is set in PWR_CR3 register.
bit_offset: 2
bit_size: 1
- name: PD3
description: Port A pull-down bit y When set, this bit activates the pull-down on PA[y] when APC bit is set in PWR_CR3 register.
bit_offset: 3
bit_size: 1
- name: PD4
description: Port A pull-down bit y When set, this bit activates the pull-down on PA[y] when APC bit is set in PWR_CR3 register.
bit_offset: 4
bit_size: 1
- name: PD5
description: Port A pull-down bit y When set, this bit activates the pull-down on PA[y] when APC bit is set in PWR_CR3 register.
bit_offset: 5
bit_size: 1
- name: PD6
description: Port A pull-down bit y When set, this bit activates the pull-down on PA[y] when APC bit is set in PWR_CR3 register.
bit_offset: 6
bit_size: 1
- name: PD7
description: Port A pull-down bit y When set, this bit activates the pull-down on PA[y] when APC bit is set in PWR_CR3 register.
bit_offset: 7
bit_size: 1
- name: PD8
description: Port A pull-down bit y When set, this bit activates the pull-down on PA[y] when APC bit is set in PWR_CR3 register.
bit_offset: 8
bit_size: 1
- name: PD9
description: Port A pull-down bit y When set, this bit activates the pull-down on PA[y] when APC bit is set in PWR_CR3 register.
bit_offset: 9
bit_size: 1
- name: PD10
description: Port A pull-down bit y When set, this bit activates the pull-down on PA[y] when APC bit is set in PWR_CR3 register.
bit_offset: 10
bit_size: 1
- name: PD11
description: Port A pull-down bit y When set, this bit activates the pull-down on PA[y] when APC bit is set in PWR_CR3 register.
bit_offset: 11
bit_size: 1
- name: PD12
description: Port A pull-down bit y When set, this bit activates the pull-down on PA[y] when APC bit is set in PWR_CR3 register.
bit_offset: 12
bit_size: 1
- name: PD13
description: Port A pull-down bit y When set, this bit activates the pull-down on PA[y] when APC bit is set in PWR_CR3 register.
bit_offset: 13
bit_size: 1
- name: PD14
description: Port A pull-down bit y When set, this bit activates the pull-down on PA[y] when APC bit is set in PWR_CR3 register.
bit_offset: 14
bit_size: 1
- name: PD15
description: Port A pull-down bit y When set, this bit activates the pull-down on PA[y] when APC bit is set in PWR_CR3 register.
bit_offset: 15
bit_size: 1
fieldset/PDCRB:
description: Power Port B pull-down control register
fields:
- name: PD0
description: Port B pull-down bit y When set, this bit activates the pull-down on PB[y] when APC bit is set in PWR_CR3 register.
bit_offset: 0
bit_size: 1
- name: PD1
description: Port B pull-down bit y When set, this bit activates the pull-down on PB[y] when APC bit is set in PWR_CR3 register.
bit_offset: 1
bit_size: 1
- name: PD2
description: Port B pull-down bit y When set, this bit activates the pull-down on PB[y] when APC bit is set in PWR_CR3 register.
bit_offset: 2
bit_size: 1
- name: PD3
description: Port B pull-down bit y When set, this bit activates the pull-down on PB[y] when APC bit is set in PWR_CR3 register.
bit_offset: 3
bit_size: 1
- name: PD4
description: Port B pull-down bit y When set, this bit activates the pull-down on PB[y] when APC bit is set in PWR_CR3 register.
bit_offset: 4
bit_size: 1
- name: PD5
description: Port B pull-down bit y When set, this bit activates the pull-down on PB[y] when APC bit is set in PWR_CR3 register.
bit_offset: 5
bit_size: 1
- name: PD6
description: Port B pull-down bit y When set, this bit activates the pull-down on PB[y] when APC bit is set in PWR_CR3 register.
bit_offset: 6
bit_size: 1
- name: PD7
description: Port B pull-down bit y When set, this bit activates the pull-down on PB[y] when APC bit is set in PWR_CR3 register.
bit_offset: 7
bit_size: 1
- name: PD8
description: Port B pull-down bit y When set, this bit activates the pull-down on PB[y] when APC bit is set in PWR_CR3 register.
bit_offset: 8
bit_size: 1
- name: PD9
description: Port B pull-down bit y When set, this bit activates the pull-down on PB[y] when APC bit is set in PWR_CR3 register.
bit_offset: 9
bit_size: 1
- name: PD10
description: Port B pull-down bit y When set, this bit activates the pull-down on PB[y] when APC bit is set in PWR_CR3 register.
bit_offset: 10
bit_size: 1
- name: PD11
description: Port B pull-down bit y When set, this bit activates the pull-down on PB[y] when APC bit is set in PWR_CR3 register.
bit_offset: 11
bit_size: 1
- name: PD12
description: Port B pull-down bit y When set, this bit activates the pull-down on PB[y] when APC bit is set in PWR_CR3 register.
bit_offset: 12
bit_size: 1
- name: PD13
description: Port B pull-down bit y When set, this bit activates the pull-down on PB[y] when APC bit is set in PWR_CR3 register.
bit_offset: 13
bit_size: 1
- name: PD14
description: Port B pull-down bit y When set, this bit activates the pull-down on PB[y] when APC bit is set in PWR_CR3 register.
bit_offset: 14
bit_size: 1
- name: PD15
description: Port B pull-down bit y When set, this bit activates the pull-down on PB[y] when APC bit is set in PWR_CR3 register.
bit_offset: 15
bit_size: 1
fieldset/PDCRC:
description: Power Port C pull-down control register
fields:
- name: PD0
description: Port C pull-down bit y When set, this bit activates the pull-down on PC[y] when APC bit is set in PWR_CR3 register.
bit_offset: 0
bit_size: 1
- name: PD1
description: Port C pull-down bit y When set, this bit activates the pull-down on PC[y] when APC bit is set in PWR_CR3 register.
bit_offset: 1
bit_size: 1
- name: PD2
description: Port C pull-down bit y When set, this bit activates the pull-down on PC[y] when APC bit is set in PWR_CR3 register.
bit_offset: 2
bit_size: 1
- name: PD3
description: Port C pull-down bit y When set, this bit activates the pull-down on PC[y] when APC bit is set in PWR_CR3 register.
bit_offset: 3
bit_size: 1
- name: PD4
description: Port C pull-down bit y When set, this bit activates the pull-down on PC[y] when APC bit is set in PWR_CR3 register.
bit_offset: 4
bit_size: 1
- name: PD5
description: Port C pull-down bit y When set, this bit activates the pull-down on PC[y] when APC bit is set in PWR_CR3 register.
bit_offset: 5
bit_size: 1
- name: PD6
description: Port C pull-down bit y When set, this bit activates the pull-down on PC[y] when APC bit is set in PWR_CR3 register.
bit_offset: 6
bit_size: 1
- name: PD7
description: Port C pull-down bit y When set, this bit activates the pull-down on PC[y] when APC bit is set in PWR_CR3 register.
bit_offset: 7
bit_size: 1
- name: PD8
description: Port C pull-down bit y When set, this bit activates the pull-down on PC[y] when APC bit is set in PWR_CR3 register.
bit_offset: 8
bit_size: 1
- name: PD9
description: Port C pull-down bit y When set, this bit activates the pull-down on PC[y] when APC bit is set in PWR_CR3 register.
bit_offset: 9
bit_size: 1
- name: PD10
description: Port C pull-down bit y When set, this bit activates the pull-down on PC[y] when APC bit is set in PWR_CR3 register.
bit_offset: 10
bit_size: 1
- name: PD11
description: Port C pull-down bit y When set, this bit activates the pull-down on PC[y] when APC bit is set in PWR_CR3 register.
bit_offset: 11
bit_size: 1
- name: PD12
description: Port C pull-down bit y When set, this bit activates the pull-down on PC[y] when APC bit is set in PWR_CR3 register.
bit_offset: 12
bit_size: 1
- name: PD13
description: Port C pull-down bit y When set, this bit activates the pull-down on PC[y] when APC bit is set in PWR_CR3 register.
bit_offset: 13
bit_size: 1
- name: PD14
description: Port C pull-down bit y When set, this bit activates the pull-down on PC[y] when APC bit is set in PWR_CR3 register.
bit_offset: 14
bit_size: 1
- name: PD15
description: Port C pull-down bit y When set, this bit activates the pull-down on PC[y] when APC bit is set in PWR_CR3 register.
bit_offset: 15
bit_size: 1
fieldset/PDCRD:
description: Power Port D pull-down control register
fields:
- name: PD0
description: Port D pull-down bit y When set, this bit activates the pull-down on PD[y] when APC bit is set in PWR_CR3 register.
bit_offset: 0
bit_size: 1
- name: PD1
description: Port D pull-down bit y When set, this bit activates the pull-down on PD[y] when APC bit is set in PWR_CR3 register.
bit_offset: 1
bit_size: 1
- name: PD2
description: Port D pull-down bit y When set, this bit activates the pull-down on PD[y] when APC bit is set in PWR_CR3 register.
bit_offset: 2
bit_size: 1
- name: PD3
description: Port D pull-down bit y When set, this bit activates the pull-down on PD[y] when APC bit is set in PWR_CR3 register.
bit_offset: 3
bit_size: 1
- name: PD4
description: Port D pull-down bit y When set, this bit activates the pull-down on PD[y] when APC bit is set in PWR_CR3 register.
bit_offset: 4
bit_size: 1
- name: PD5
description: Port D pull-down bit y When set, this bit activates the pull-down on PD[y] when APC bit is set in PWR_CR3 register.
bit_offset: 5
bit_size: 1
- name: PD6
description: Port D pull-down bit y When set, this bit activates the pull-down on PD[y] when APC bit is set in PWR_CR3 register.
bit_offset: 6
bit_size: 1
- name: PD8
description: Port D pull-down bit y When set, this bit activates the pull-down on PD[y] when APC bit is set in PWR_CR3 register.
bit_offset: 8
bit_size: 1
- name: PD9
description: Port D pull-down bit y When set, this bit activates the pull-down on PD[y] when APC bit is set in PWR_CR3 register.
bit_offset: 9
bit_size: 1
- name: PD10
description: Port D pull-down bit y When set, this bit activates the pull-down on PD[y] when APC bit is set in PWR_CR3 register.
bit_offset: 10
bit_size: 1
- name: PD11
description: Port D pull-down bit y When set, this bit activates the pull-down on PD[y] when APC bit is set in PWR_CR3 register.
bit_offset: 11
bit_size: 1
- name: PD12
description: Port D pull-down bit y When set, this bit activates the pull-down on PD[y] when APC bit is set in PWR_CR3 register.
bit_offset: 12
bit_size: 1
- name: PD13
description: Port D pull-down bit y When set, this bit activates the pull-down on PD[y] when APC bit is set in PWR_CR3 register.
bit_offset: 13
bit_size: 1
fieldset/PDCRE:
description: Power Port E pull-down control register
fields:
- name: PD3
description: Port E pull-down bit 3 When set, this bit activates the pull-down on PE[y] when APC bit is set in PWR_CR3 register.
bit_offset: 3
bit_size: 1
- name: PD7
description: Port E pull-down bit y When set, this bit activates the pull-down on PE[y] when APC bit is set in PWR_CR3 register.
bit_offset: 7
bit_size: 1
- name: PD8
description: Port E pull-down bit y When set, this bit activates the pull-down on PE[y] when APC bit is set in PWR_CR3 register.
bit_offset: 8
bit_size: 1
- name: PD9
description: Port E pull-down bit y When set, this bit activates the pull-down on PE[y] when APC bit is set in PWR_CR3 register.
bit_offset: 9
bit_size: 1
fieldset/PDCRF:
description: Power Port F pull-down control register
fields:
- name: PD0
description: Port F pull-down bit y When set, this bit activates the pull-down on PH[y] when APC bit is set in PWR_CR3 register.
bit_offset: 0
bit_size: 1
- name: PD1
description: Port F pull-down bit y When set, this bit activates the pull-down on PH[y] when APC bit is set in PWR_CR3 register.
bit_offset: 1
bit_size: 1
- name: PD2
description: Port F pull-down bit y When set, this bit activates the pull-down on PH[y] when APC bit is set in PWR_CR3 register.
bit_offset: 2
bit_size: 1
- name: PD3
description: Port F pull-down bit y When set, this bit activates the pull-down on PH[y] when APC bit is set in PWR_CR3 register.
bit_offset: 3
bit_size: 1
fieldset/PUCRA:
description: Power Port A pull-up control register
fields:
- name: PU0
description: Port A pull-up bit y (y1=115 to 0) When set, this bit activates the pull-up on PA[y] when APC bit is set in PWR_CR3 register. If the corresponding PDy bit is also set, the pull-up is not activated and the pull-down is activated instead with highest priority.
bit_offset: 0
bit_size: 1
- name: PU1
description: Port A pull-up bit y (y1=115 to 0) When set, this bit activates the pull-up on PA[y] when APC bit is set in PWR_CR3 register. If the corresponding PDy bit is also set, the pull-up is not activated and the pull-down is activated instead with highest priority.
bit_offset: 1
bit_size: 1
- name: PU2
description: Port A pull-up bit y (y1=115 to 0) When set, this bit activates the pull-up on PA[y] when APC bit is set in PWR_CR3 register. If the corresponding PDy bit is also set, the pull-up is not activated and the pull-down is activated instead with highest priority.
bit_offset: 2
bit_size: 1
- name: PU3
description: Port A pull-up bit y (y1=115 to 0) When set, this bit activates the pull-up on PA[y] when APC bit is set in PWR_CR3 register. If the corresponding PDy bit is also set, the pull-up is not activated and the pull-down is activated instead with highest priority.
bit_offset: 3
bit_size: 1
- name: PU4
description: Port A pull-up bit y (y1=115 to 0) When set, this bit activates the pull-up on PA[y] when APC bit is set in PWR_CR3 register. If the corresponding PDy bit is also set, the pull-up is not activated and the pull-down is activated instead with highest priority.
bit_offset: 4
bit_size: 1
- name: PU5
description: Port A pull-up bit y (y1=115 to 0) When set, this bit activates the pull-up on PA[y] when APC bit is set in PWR_CR3 register. If the corresponding PDy bit is also set, the pull-up is not activated and the pull-down is activated instead with highest priority.
bit_offset: 5
bit_size: 1
- name: PU6
description: Port A pull-up bit y (y1=115 to 0) When set, this bit activates the pull-up on PA[y] when APC bit is set in PWR_CR3 register. If the corresponding PDy bit is also set, the pull-up is not activated and the pull-down is activated instead with highest priority.
bit_offset: 6
bit_size: 1
- name: PU7
description: Port A pull-up bit y (y1=115 to 0) When set, this bit activates the pull-up on PA[y] when APC bit is set in PWR_CR3 register. If the corresponding PDy bit is also set, the pull-up is not activated and the pull-down is activated instead with highest priority.
bit_offset: 7
bit_size: 1
- name: PU8
description: Port A pull-up bit y (y1=115 to 0) When set, this bit activates the pull-up on PA[y] when APC bit is set in PWR_CR3 register. If the corresponding PDy bit is also set, the pull-up is not activated and the pull-down is activated instead with highest priority.
bit_offset: 8
bit_size: 1
- name: PU9
description: Port A pull-up bit y (y1=115 to 0) When set, this bit activates the pull-up on PA[y] when APC bit is set in PWR_CR3 register. If the corresponding PDy bit is also set, the pull-up is not activated and the pull-down is activated instead with highest priority.
bit_offset: 9
bit_size: 1
- name: PU10
description: Port A pull-up bit y (y1=115 to 0) When set, this bit activates the pull-up on PA[y] when APC bit is set in PWR_CR3 register. If the corresponding PDy bit is also set, the pull-up is not activated and the pull-down is activated instead with highest priority.
bit_offset: 10
bit_size: 1
- name: PU11
description: Port A pull-up bit y (y1=115 to 0) When set, this bit activates the pull-up on PA[y] when APC bit is set in PWR_CR3 register. If the corresponding PDy bit is also set, the pull-up is not activated and the pull-down is activated instead with highest priority.
bit_offset: 11
bit_size: 1
- name: PU12
description: Port A pull-up bit y (y1=115 to 0) When set, this bit activates the pull-up on PA[y] when APC bit is set in PWR_CR3 register. If the corresponding PDy bit is also set, the pull-up is not activated and the pull-down is activated instead with highest priority.
bit_offset: 12
bit_size: 1
- name: PU13
description: Port A pull-up bit y (y1=115 to 0) When set, this bit activates the pull-up on PA[y] when APC bit is set in PWR_CR3 register. If the corresponding PDy bit is also set, the pull-up is not activated and the pull-down is activated instead with highest priority.
bit_offset: 13
bit_size: 1
- name: PU14
description: Port A pull-up bit y (y1=115 to 0) When set, this bit activates the pull-up on PA[y] when APC bit is set in PWR_CR3 register. If the corresponding PDy bit is also set, the pull-up is not activated and the pull-down is activated instead with highest priority.
bit_offset: 14
bit_size: 1
- name: PU15
description: Port A pull-up bit y (y1=115 to 0) When set, this bit activates the pull-up on PA[y] when APC bit is set in PWR_CR3 register. If the corresponding PDy bit is also set, the pull-up is not activated and the pull-down is activated instead with highest priority.
bit_offset: 15
bit_size: 1
fieldset/PUCRB:
description: Power Port B pull-up control register
fields:
- name: PU0
description: Port B pull-up bit y When set, this bit activates the pull-up on PB[y] when APC bit is set in PWR_CR3 register.
bit_offset: 0
bit_size: 1
- name: PU1
description: Port B pull-up bit y When set, this bit activates the pull-up on PB[y] when APC bit is set in PWR_CR3 register.
bit_offset: 1
bit_size: 1
- name: PU2
description: Port B pull-up bit y When set, this bit activates the pull-up on PB[y] when APC bit is set in PWR_CR3 register.
bit_offset: 2
bit_size: 1
- name: PU3
description: Port B pull-up bit y When set, this bit activates the pull-up on PB[y] when APC bit is set in PWR_CR3 register.
bit_offset: 3
bit_size: 1
- name: PU4
description: Port B pull-up bit y When set, this bit activates the pull-up on PB[y] when APC bit is set in PWR_CR3 register.
bit_offset: 4
bit_size: 1
- name: PU5
description: Port B pull-up bit y When set, this bit activates the pull-up on PB[y] when APC bit is set in PWR_CR3 register.
bit_offset: 5
bit_size: 1
- name: PU6
description: Port B pull-up bit y When set, this bit activates the pull-up on PB[y] when APC bit is set in PWR_CR3 register.
bit_offset: 6
bit_size: 1
- name: PU7
description: Port B pull-up bit y When set, this bit activates the pull-up on PB[y] when APC bit is set in PWR_CR3 register.
bit_offset: 7
bit_size: 1
- name: PU8
description: Port B pull-up bit y When set, this bit activates the pull-up on PB[y] when APC bit is set in PWR_CR3 register.
bit_offset: 8
bit_size: 1
- name: PU9
description: Port B pull-up bit y When set, this bit activates the pull-up on PB[y] when APC bit is set in PWR_CR3 register.
bit_offset: 9
bit_size: 1
- name: PU10
description: Port B pull-up bit y When set, this bit activates the pull-up on PB[y] when APC bit is set in PWR_CR3 register.
bit_offset: 10
bit_size: 1
- name: PU11
description: Port B pull-up bit y When set, this bit activates the pull-up on PB[y] when APC bit is set in PWR_CR3 register.
bit_offset: 11
bit_size: 1
- name: PU12
description: Port B pull-up bit y When set, this bit activates the pull-up on PB[y] when APC bit is set in PWR_CR3 register.
bit_offset: 12
bit_size: 1
- name: PU13
description: Port B pull-up bit y When set, this bit activates the pull-up on PB[y] when APC bit is set in PWR_CR3 register.
bit_offset: 13
bit_size: 1
- name: PU14
description: Port B pull-up bit y When set, this bit activates the pull-up on PB[y] when APC bit is set in PWR_CR3 register.
bit_offset: 14
bit_size: 1
- name: PU15
description: Port B pull-up bit y When set, this bit activates the pull-up on PB[y] when APC bit is set in PWR_CR3 register.
bit_offset: 15
bit_size: 1
fieldset/PUCRC:
description: Power Port C pull-up control register
fields:
- name: PU0
description: Port C pull-up bit y When set, this bit activates the pull-up on PC[y] when APC bit is set in PWR_CR3 register. If the corresponding PDy bit is also set, the pull-up is not activated and the pull-down is activated instead with highest priority.
bit_offset: 0
bit_size: 1
- name: PU1
description: Port C pull-up bit y When set, this bit activates the pull-up on PC[y] when APC bit is set in PWR_CR3 register. If the corresponding PDy bit is also set, the pull-up is not activated and the pull-down is activated instead with highest priority.
bit_offset: 1
bit_size: 1
- name: PU2
description: Port C pull-up bit y When set, this bit activates the pull-up on PC[y] when APC bit is set in PWR_CR3 register. If the corresponding PDy bit is also set, the pull-up is not activated and the pull-down is activated instead with highest priority.
bit_offset: 2
bit_size: 1
- name: PU3
description: Port C pull-up bit y When set, this bit activates the pull-up on PC[y] when APC bit is set in PWR_CR3 register. If the corresponding PDy bit is also set, the pull-up is not activated and the pull-down is activated instead with highest priority.
bit_offset: 3
bit_size: 1
- name: PU4
description: Port C pull-up bit y When set, this bit activates the pull-up on PC[y] when APC bit is set in PWR_CR3 register. If the corresponding PDy bit is also set, the pull-up is not activated and the pull-down is activated instead with highest priority.
bit_offset: 4
bit_size: 1
- name: PU5
description: Port C pull-up bit y When set, this bit activates the pull-up on PC[y] when APC bit is set in PWR_CR3 register. If the corresponding PDy bit is also set, the pull-up is not activated and the pull-down is activated instead with highest priority.
bit_offset: 5
bit_size: 1
- name: PU6
description: Port C pull-up bit y When set, this bit activates the pull-up on PC[y] when APC bit is set in PWR_CR3 register. If the corresponding PDy bit is also set, the pull-up is not activated and the pull-down is activated instead with highest priority.
bit_offset: 6
bit_size: 1
- name: PU7
description: Port C pull-up bit y When set, this bit activates the pull-up on PC[y] when APC bit is set in PWR_CR3 register. If the corresponding PDy bit is also set, the pull-up is not activated and the pull-down is activated instead with highest priority.
bit_offset: 7
bit_size: 1
- name: PU8
description: Port C pull-up bit y When set, this bit activates the pull-up on PC[y] when APC bit is set in PWR_CR3 register. If the corresponding PDy bit is also set, the pull-up is not activated and the pull-down is activated instead with highest priority.
bit_offset: 8
bit_size: 1
- name: PU9
description: Port C pull-up bit y When set, this bit activates the pull-up on PC[y] when APC bit is set in PWR_CR3 register. If the corresponding PDy bit is also set, the pull-up is not activated and the pull-down is activated instead with highest priority.
bit_offset: 9
bit_size: 1
- name: PU10
description: Port C pull-up bit y When set, this bit activates the pull-up on PC[y] when APC bit is set in PWR_CR3 register. If the corresponding PDy bit is also set, the pull-up is not activated and the pull-down is activated instead with highest priority.
bit_offset: 10
bit_size: 1
- name: PU11
description: Port C pull-up bit y When set, this bit activates the pull-up on PC[y] when APC bit is set in PWR_CR3 register. If the corresponding PDy bit is also set, the pull-up is not activated and the pull-down is activated instead with highest priority.
bit_offset: 11
bit_size: 1
- name: PU12
description: Port C pull-up bit y When set, this bit activates the pull-up on PC[y] when APC bit is set in PWR_CR3 register. If the corresponding PDy bit is also set, the pull-up is not activated and the pull-down is activated instead with highest priority.
bit_offset: 12
bit_size: 1
- name: PU13
description: Port C pull-up bit y When set, this bit activates the pull-up on PC[y] when APC bit is set in PWR_CR3 register. If the corresponding PDy bit is also set, the pull-up is not activated and the pull-down is activated instead with highest priority.
bit_offset: 13
bit_size: 1
- name: PU14
description: Port C pull-up bit y When set, this bit activates the pull-up on PC[y] when APC bit is set in PWR_CR3 register. If the corresponding PDy bit is also set, the pull-up is not activated and the pull-down is activated instead with highest priority.
bit_offset: 14
bit_size: 1
- name: PU15
description: Port C pull-up bit y When set, this bit activates the pull-up on PC[y] when APC bit is set in PWR_CR3 register. If the corresponding PDy bit is also set, the pull-up is not activated and the pull-down is activated instead with highest priority.
bit_offset: 15
bit_size: 1
fieldset/PUCRD:
description: Power Port D pull-up control register
fields:
- name: PU0
description: Port D pull-up bit y When set, this bit activates the pull-up on PD[y] when APC bit is set in PWR_CR3 register. If the corresponding PDy bit is also set, the pull-up is not activated and the pull-down is activated instead with highest priority.
bit_offset: 0
bit_size: 1
- name: PU1
description: Port D pull-up bit y When set, this bit activates the pull-up on PD[y] when APC bit is set in PWR_CR3 register. If the corresponding PDy bit is also set, the pull-up is not activated and the pull-down is activated instead with highest priority.
bit_offset: 1
bit_size: 1
- name: PU2
description: Port D pull-up bit y When set, this bit activates the pull-up on PD[y] when APC bit is set in PWR_CR3 register. If the corresponding PDy bit is also set, the pull-up is not activated and the pull-down is activated instead with highest priority.
bit_offset: 2
bit_size: 1
- name: PU3
description: Port D pull-up bit y When set, this bit activates the pull-up on PD[y] when APC bit is set in PWR_CR3 register. If the corresponding PDy bit is also set, the pull-up is not activated and the pull-down is activated instead with highest priority.
bit_offset: 3
bit_size: 1
- name: PU4
description: Port D pull-up bit y When set, this bit activates the pull-up on PD[y] when APC bit is set in PWR_CR3 register. If the corresponding PDy bit is also set, the pull-up is not activated and the pull-down is activated instead with highest priority.
bit_offset: 4
bit_size: 1
- name: PU5
description: Port D pull-up bit y When set, this bit activates the pull-up on PD[y] when APC bit is set in PWR_CR3 register. If the corresponding PDy bit is also set, the pull-up is not activated and the pull-down is activated instead with highest priority.
bit_offset: 5
bit_size: 1
- name: PU6
description: Port D pull-up bit y When set, this bit activates the pull-up on PD[y] when APC bit is set in PWR_CR3 register. If the corresponding PDy bit is also set, the pull-up is not activated and the pull-down is activated instead with highest priority.
bit_offset: 6
bit_size: 1
- name: PU8
description: Port D pull-up bit y When set, this bit activates the pull-up on PD[y] when APC bit is set in PWR_CR3 register. If the corresponding PDy bit is also set, the pull-up is not activated and the pull-down is activated instead with highest priority.
bit_offset: 8
bit_size: 1
- name: PU9
description: Port D pull-up bit y When set, this bit activates the pull-up on PD[y] when APC bit is set in PWR_CR3 register. If the corresponding PDy bit is also set, the pull-up is not activated and the pull-down is activated instead with highest priority.
bit_offset: 9
bit_size: 1
- name: PU10
description: Port D pull-up bit y When set, this bit activates the pull-up on PD[y] when APC bit is set in PWR_CR3 register. If the corresponding PDy bit is also set, the pull-up is not activated and the pull-down is activated instead with highest priority.
bit_offset: 10
bit_size: 1
- name: PU11
description: Port D pull-up bit y When set, this bit activates the pull-up on PD[y] when APC bit is set in PWR_CR3 register. If the corresponding PDy bit is also set, the pull-up is not activated and the pull-down is activated instead with highest priority.
bit_offset: 11
bit_size: 1
- name: PU12
description: Port D pull-up bit y When set, this bit activates the pull-up on PD[y] when APC bit is set in PWR_CR3 register. If the corresponding PDy bit is also set, the pull-up is not activated and the pull-down is activated instead with highest priority.
bit_offset: 12
bit_size: 1
- name: PU13
description: Port D pull-up bit y When set, this bit activates the pull-up on PD[y] when APC bit is set in PWR_CR3 register. If the corresponding PDy bit is also set, the pull-up is not activated and the pull-down is activated instead with highest priority.
bit_offset: 13
bit_size: 1
fieldset/PUCRE:
description: Power Port E pull-up control register
fields:
- name: PU3
description: Port E pull-up bit 3 When set, this bit activates the pull-up on PE[y] when APC bit is set in PWR_CR3 register. If the corresponding PDy bit is also set, the pull-up is not activated and the pull-down is activated instead with highest priority.
bit_offset: 3
bit_size: 1
- name: PU7
description: Port E pull-up bit y When set, this bit activates the pull-up on PE[y] when APC bit is set in PWR_CR3 register. If the corresponding PDy bit is also set, the pull-up is not activated and the pull-down is activated instead with highest priority.
bit_offset: 7
bit_size: 1
- name: PU8
description: Port E pull-up bit y When set, this bit activates the pull-up on PE[y] when APC bit is set in PWR_CR3 register. If the corresponding PDy bit is also set, the pull-up is not activated and the pull-down is activated instead with highest priority.
bit_offset: 8
bit_size: 1
- name: PU9
description: Port E pull-up bit y When set, this bit activates the pull-up on PE[y] when APC bit is set in PWR_CR3 register. If the corresponding PDy bit is also set, the pull-up is not activated and the pull-down is activated instead with highest priority.
bit_offset: 9
bit_size: 1
fieldset/PUCRF:
description: Power Port F pull-up control register
fields:
- name: PU0
description: Port F pull-up bit y When set, this bit activates the pull-up on PH[y] when APC bit is set in PWR_CR3 register. If the corresponding PDy bit is also set, the pull-up is not activated and the pull-down is activated instead with highest priority.
bit_offset: 0
bit_size: 1
- name: PU1
description: Port F pull-up bit y When set, this bit activates the pull-up on PH[y] when APC bit is set in PWR_CR3 register. If the corresponding PDy bit is also set, the pull-up is not activated and the pull-down is activated instead with highest priority.
bit_offset: 1
bit_size: 1
- name: PU2
description: Port F pull-up bit y When set, this bit activates the pull-up on PH[y] when APC bit is set in PWR_CR3 register. If the corresponding PDy bit is also set, the pull-up is not activated and the pull-down is activated instead with highest priority.
bit_offset: 2
bit_size: 1
- name: PU3
description: Port F pull-up bit y When set, this bit activates the pull-up on PH[y] when APC bit is set in PWR_CR3 register. If the corresponding PDy bit is also set, the pull-up is not activated and the pull-down is activated instead with highest priority.
bit_offset: 3
bit_size: 1
fieldset/SCR:
description: Power status clear register
fields:
- name: CWUF1
description: Clear wake-up flag 1 Setting this bit clears the WUF1 flag in the PWR_SR1 register.
bit_offset: 0
bit_size: 1
- name: CWUF2
description: Clear wake-up flag 2 Setting this bit clears the WUF2 flag in the PWR_SR1 register.
bit_offset: 1
bit_size: 1
- name: CWUF3
description: Clear wake-up flag 3 Setting this bit clears the WUF3 flag in the PWR_SR1 register.
bit_offset: 2
bit_size: 1
- name: CWUF4
description: Clear wake-up flag 4 Setting this bit clears the WUF4 flag in the PWR_SR1 register.
bit_offset: 3
bit_size: 1
- name: CWUF5
description: Clear wake-up flag 5 Setting this bit clears the WUF5 flag in the PWR_SR1 register.
bit_offset: 4
bit_size: 1
- name: CWUF7
description: Clear wake-up flag 7 Setting this bit clears the WUF7 flag in the PWR_SR1 register.
bit_offset: 6
bit_size: 1
- name: CSBF
description: Clear standby flag Setting this bit clears the SBF flag in the PWR_SR1 register.
bit_offset: 8
bit_size: 1
fieldset/SR1:
description: Power status register 1
fields:
- name: WUF1
description: Wake-up flag 1 This bit is set when a wake-up event is detected on wake-up pin, WKUP1. It is cleared by writing 1 in the CWUF1 bit of the PWR_SCR register.
bit_offset: 0
bit_size: 1
- name: WUF2
description: Wake-up flag 2 This bit is set when a wake-up event is detected on wake-up pin, WKUP2. It is cleared by writing 1 in the CWUF2 bit of the PWR_SCR register.
bit_offset: 1
bit_size: 1
- name: WUF3
description: Wake-up flag 3 This bit is set when a wake-up event is detected on wake-up pin, WKUP3. It is cleared by writing 1 in the CWUF3 bit of the PWR_SCR register.
bit_offset: 2
bit_size: 1
- name: WUF4
description: Wake-up flag 4 This bit is set when a wake-up event is detected on wake-up pin,WKUP4. It is cleared by writing 1 in the CWUF4 bit of the PWR_SCR register.
bit_offset: 3
bit_size: 1
- name: WUF5
description: Wake-up flag 5 This bit is set when a wake-up event is detected on wake-up pin, WKUP5. It is cleared by writing 1 in the CWUF5 bit of the PWR_SCR register.
bit_offset: 4
bit_size: 1
- name: WUF7
description: Wake-up flag 7 This bit is set when a wake-up event is detected on wake-up pin, WKUP7. It is cleared by writing 1 in the CWUF7 bit of the PWR_SCR register.
bit_offset: 6
bit_size: 1
- name: SBF
description: Standby flag This bit is set by hardware when the device enters the Standby mode and is cleared by setting the CSBF bit in the PWR_SCR register, or by a power-on reset. It is not cleared by the system reset.
bit_offset: 8
bit_size: 1
- name: STOPF
description: Stop Flags These bits are set by hardware when the device enters any stop mode and are cleared by setting the CSBF bit in the PWR_SCR register, or by a power-on reset. It is not cleared by the system reset.
bit_offset: 9
bit_size: 3
enum: STOPF
- name: WUFI
description: Wake-up flag internal This bit is set when a wake-up is detected on the internal wake-up line. It is cleared when all internal wake-up sources are cleared.
bit_offset: 15
bit_size: 1
fieldset/SR2:
description: Power status register 2
fields:
- name: FLASH_RDY
description: 'Flash ready flag This bit is set by hardware to indicate when the flash memory is readey to be accessed after wake-up from power-down. To place the flash memory in power-down, set either FPD_LPRUN, FPD_LPSLP or FPD_STP bits. Note : If the system boots from SRAM, the user application must wait until the FLASH_RDY bit is set, prior to jumping to flash memory.'
bit_offset: 7
bit_size: 1
- name: REGLPS
description: Low-power regulator started This bit provides the information whether the low-power regulator is ready after a power-on reset or a Standby/Shutdown. If the Standby mode is entered while REGLPS bit is still cleared, the wake-up from Standby mode time may be increased.
bit_offset: 8
bit_size: 1
- name: REGLPF
description: Low-power regulator flag This bit is set by hardware when the MCU is in Low-power run mode. When the MCU exits from the Low-power run mode, this bit remains at 1 until the regulator is ready in main mode. A polling on this bit must be done before increasing the product frequency. This bit is cleared by hardware when the regulator is ready.
bit_offset: 9
bit_size: 1
- name: VOSF
description: Voltage scaling flag A delay is required for the internal regulator to be ready after the voltage scaling has been changed. VOSF indicates that the regulator reached the voltage level defined with VOS bits of the PWR_CR1 register.
bit_offset: 10
bit_size: 1
- name: PVDO
description: Programmable voltage detector output
bit_offset: 11
bit_size: 1
- name: PVMO1
description: 'Peripheral voltage monitoring output: V<sub>DDUSB</sub> vs. 1.2 V Note: PVMO1 is cleared when PVM1 is disabled (PVME1 = 0). After enabling PVM1, the PVM1 output is valid after the PVM1 wake-up time.'
bit_offset: 12
bit_size: 1
- name: PVMO3
description: 'Peripheral voltage monitoring output: V<sub>DDA</sub> vs. 1.621V Note: PVMO3 is cleared when PVM3 is disabled (PVME3 = 0). After enabling PVM3, the PVM3 output is valid after the PVM3 wake-up time.'
bit_offset: 14
bit_size: 1
- name: PVMO4
description: 'Peripheral voltage monitoring output: V<sub>DDA</sub> vs. 2.21V Note: PVMO4 is cleared when PVM4 is disabled (PVME4 = 0). After enabling PVM4, the PVM4 output is valid after the PVM4 wake-up time.'
bit_offset: 15
bit_size: 1
enum/LPMS:
bit_size: 3
variants:
- name: Stop0
description: Stop 0 mode
value: 0
- name: Stop1
description: Stop 1 mode
value: 1
- name: Stop2
description: Stop 2 mode
value: 2
- name: Standby
description: Standby mode
value: 3
enum/PLS:
bit_size: 3
variants:
- name: B_0x0
description: V<sub>PVD0</sub> around 2.01V
value: 0
- name: B_0x1
description: V<sub>PVD1</sub> around 2.21V
value: 1
- name: B_0x2
description: V<sub>PVD2</sub> around 2.41V
value: 2
- name: B_0x3
description: V<sub>PVD3</sub> around 2.51V
value: 3
- name: B_0x4
description: V<sub>PVD4</sub> around 2.61V
value: 4
- name: B_0x5
description: V<sub>PVD5</sub> around 2.81V
value: 5
- name: B_0x6
description: V<sub>PVD6</sub> around 2.91V
value: 6
- name: B_0x7
description: External input analog voltage PVD_IN (compared internally to VREFINT)
value: 7
enum/STOPF:
bit_size: 3
variants:
- name: None
description: The device did not enter any Stop mode.
value: 0
- name: Stop0
description: The device entered in Stop 0 mode.
value: 4
- name: Stop1
description: The device entered in Stop 1 mode.
value: 5
- name: Stop2
description: The device entered in Stop 2 mode.
value: 6
enum/VOS:
bit_size: 2
variants:
- name: Range1
description: Range 1
value: 1
- name: Range2
description: Range 2
value: 2

View File

@ -486,8 +486,8 @@ fieldset/AHB3ENR:
description: FMC Peripheral Clocks Enable
bit_offset: 12
bit_size: 1
- name: QUADSPIEN
description: QUADSPI and QUADSPI Delay Clock Enable
- name: OCTOSPI1EN
description: OCTOSPI1 and OCTOSPI1 Delay Clock Enable
bit_offset: 14
bit_size: 1
- name: SDMMC1EN
@ -549,8 +549,8 @@ fieldset/AHB3LPENR:
description: FMC Peripheral Clocks Enable During CSleep Mode
bit_offset: 12
bit_size: 1
- name: QUADSPILPEN
description: QUADSPI and QUADSPI Delay Clock Enable During CSleep Mode
- name: OCTOSPI1LPEN
description: OCTOSPI1 and OCTOSPI1 Delay Clock Enable During CSleep Mode
bit_offset: 14
bit_size: 1
- name: SDMMC1LPEN
@ -608,8 +608,8 @@ fieldset/AHB3RSTR:
description: FMC block reset
bit_offset: 12
bit_size: 1
- name: QUADSPIRST
description: QUADSPI and QUADSPI delay block reset
- name: OCTOSPI1RST
description: OCTOSPI1 and OCTOSPI1 delay block reset
bit_offset: 14
bit_size: 1
- name: SDMMC1RST

View File

@ -311,7 +311,7 @@ fieldset/AHB2ENR:
description: Random Number Generator clock enable
bit_offset: 18
bit_size: 1
- name: OSPIMEN
- name: OCTOSPIMEN
description: OctoSPI IO manager clock enable
bit_offset: 20
bit_size: 1
@ -390,7 +390,7 @@ fieldset/AHB2RSTR:
description: Random number generator reset
bit_offset: 18
bit_size: 1
- name: OSPIMRST
- name: OCTOSPIMRST
description: OCTOSPI IO manager reset
bit_offset: 20
bit_size: 1
@ -485,7 +485,7 @@ fieldset/AHB2SMENR:
description: Random Number Generator clocks enable during Sleep and Stop modes
bit_offset: 18
bit_size: 1
- name: OSPIMSMEN
- name: OCTOSPIMSMEN
description: OctoSPI IO manager clocks enable during Sleep and Stop modes
bit_offset: 20
bit_size: 1
@ -504,11 +504,11 @@ fieldset/AHB3ENR:
description: Flexible memory controller clock enable
bit_offset: 0
bit_size: 1
- name: OSPI1EN
- name: OCTOSPI1EN
description: OctoSPI1 memory interface clock enable
bit_offset: 8
bit_size: 1
- name: OSPI2EN
- name: OCTOSPI2EN
description: OSPI2EN memory interface clock enable
bit_offset: 9
bit_size: 1
@ -519,11 +519,11 @@ fieldset/AHB3RSTR:
description: Flexible memory controller reset
bit_offset: 0
bit_size: 1
- name: OSPI1RST
- name: OCTOSPI1RST
description: OctoSPI1 memory interface reset
bit_offset: 8
bit_size: 1
- name: OSPI2RST
- name: OCTOSPI2RST
description: OctOSPI2 memory interface reset
bit_offset: 9
bit_size: 1
@ -534,11 +534,11 @@ fieldset/AHB3SMENR:
description: Flexible memory controller clocks enable during Sleep and Stop modes
bit_offset: 0
bit_size: 1
- name: OSPI1SMEN
- name: OCTOSPI1SMEN
description: OctoSPI1 memory interface clocks enable during Sleep and Stop modes
bit_offset: 8
bit_size: 1
- name: OCTOSPI2
- name: OCTOSPI2SMEN
description: OctoSPI2 memory interface clocks enable during Sleep and Stop modes
bit_offset: 9
bit_size: 1
@ -1197,11 +1197,11 @@ fieldset/CCIPR2:
description: division factor for LTDC clock
bit_offset: 16
bit_size: 2
- name: OSPISEL
- name: OCTOSPISEL
description: Octospi clock source selection
bit_offset: 20
bit_size: 2
enum: OSPISEL
enum: OCTOSPISEL
fieldset/CFGR:
description: Clock configuration register
fields:
@ -1962,7 +1962,7 @@ enum/MSIRGSEL:
- name: CR
description: MSI Range is provided by MSIRANGE[3:0] in the RCC_CR register
value: 1
enum/OSPISEL:
enum/OCTOSPISEL:
bit_size: 2
variants:
- name: SYS

View File

@ -556,8 +556,8 @@ fieldset/AHB3ENR:
description: Flexible memory controller clock enable
bit_offset: 0
bit_size: 1
- name: OSPI1EN
description: OSPI1EN
- name: OCTOSPI1EN
description: OCTOSPI1EN
bit_offset: 8
bit_size: 1
fieldset/AHB3RSTR:
@ -567,8 +567,8 @@ fieldset/AHB3RSTR:
description: Flexible memory controller reset
bit_offset: 0
bit_size: 1
- name: OSPI1RST
description: OSPI1RST
- name: OCTOSPI1RST
description: OCTOSPI1RST
bit_offset: 8
bit_size: 1
fieldset/AHB3SECSR:
@ -578,8 +578,8 @@ fieldset/AHB3SECSR:
description: FSMCSECF
bit_offset: 0
bit_size: 1
- name: OSPI1SECF
description: OSPI1SECF
- name: OCTOSPI1SECF
description: OCTOSPI1SECF
bit_offset: 8
bit_size: 1
fieldset/AHB3SMENR:
@ -589,8 +589,8 @@ fieldset/AHB3SMENR:
description: Flexible memory controller clocks enable during Sleep and Stop modes
bit_offset: 0
bit_size: 1
- name: OSPI1SMEN
description: OSPI1SMEN
- name: OCTOSPI1SMEN
description: OCTOSPI1SMEN
bit_offset: 8
bit_size: 1
fieldset/APB1ENR1:
@ -1412,7 +1412,7 @@ fieldset/CCIPR2:
description: SDMMC clock selection
bit_offset: 14
bit_size: 1
- name: OSPISEL
- name: OCTOSPISEL
description: Octospi clock source selection
bit_offset: 20
bit_size: 2

1911
data/registers/rcc_u0.yaml Normal file

File diff suppressed because it is too large Load Diff

View File

@ -13,10 +13,14 @@ block/SPI:
description: status register
byte_offset: 8
fieldset: SR
- name: DR
description: data register
- name: DR16
description: data register - half-word sized
byte_offset: 12
fieldset: DR
bit_size: 16
- name: DR8
description: data register - byte sized
byte_offset: 12
bit_size: 8
- name: CRCPR
description: CRC polynomial register
byte_offset: 16
@ -171,13 +175,6 @@ fieldset/CRCPR:
description: CRC polynomial register
bit_offset: 0
bit_size: 16
fieldset/DR:
description: data register
fields:
- name: DR
description: Data register
bit_offset: 0
bit_size: 16
fieldset/I2SCFGR:
description: I2S configuration register
fields:

View File

@ -31,16 +31,34 @@ block/SPI:
byte_offset: 24
access: Write
fieldset: IFCR
- name: TXDR
- name: TXDR32
description: Transmit Data Register
byte_offset: 32
access: Write
fieldset: TXDR
- name: RXDR
- name: TXDR16
description: Transmit Data Register - half-word sized
byte_offset: 32
bit_size: 16
access: Write
- name: TXDR8
description: Transmit Data Register - byte sized
byte_offset: 32
bit_size: 8
access: Write
- name: RXDR32
description: Receive Data Register
byte_offset: 48
access: Read
fieldset: RXDR
- name: RXDR16
description: Receive Data Register - half-word sized
byte_offset: 48
bit_size: 16
access: Read
- name: RXDR8
description: Receive Data Register - byte sized
byte_offset: 48
bit_size: 8
access: Read
- name: CRCPOLY
description: Polynomial Register
byte_offset: 64
@ -324,13 +342,6 @@ fieldset/RXCRC:
description: CRC register for receiver
bit_offset: 0
bit_size: 32
fieldset/RXDR:
description: Receive Data Register
fields:
- name: RXDR
description: Receive data register
bit_offset: 0
bit_size: 32
fieldset/SR:
description: Status Register
fields:
@ -407,13 +418,6 @@ fieldset/TXCRC:
description: CRC register for transmitter
bit_offset: 0
bit_size: 32
fieldset/TXDR:
description: Transmit Data Register
fields:
- name: TXDR
description: Transmit data register
bit_offset: 0
bit_size: 32
fieldset/UDRDR:
description: Underrun Data Register
fields:

View File

@ -31,16 +31,34 @@ block/SPI:
byte_offset: 24
access: Write
fieldset: IFCR
- name: TXDR
- name: TXDR32
description: Transmit Data Register
byte_offset: 32
access: Write
fieldset: TXDR
- name: RXDR
- name: TXDR16
description: Transmit Data Register - half-word sized
byte_offset: 32
bit_size: 16
access: Write
- name: TXDR8
description: Transmit Data Register - byte sized
byte_offset: 32
bit_size: 8
access: Write
- name: RXDR32
description: Receive Data Register
byte_offset: 48
access: Read
fieldset: RXDR
- name: RXDR16
description: Receive Data Register - half-word sized
byte_offset: 48
bit_size: 16
access: Read
- name: RXDR8
description: Receive Data Register - byte sized
byte_offset: 48
bit_size: 8
access: Read
- name: CRCPOLY
description: Polynomial Register
byte_offset: 64
@ -323,13 +341,6 @@ fieldset/RXCRC:
description: CRC register for receiver
bit_offset: 0
bit_size: 32
fieldset/RXDR:
description: Receive Data Register
fields:
- name: RXDR
description: Receive data register
bit_offset: 0
bit_size: 32
fieldset/SR:
description: Status Register
fields:
@ -402,13 +413,6 @@ fieldset/TXCRC:
description: CRC register for transmitter
bit_offset: 0
bit_size: 32
fieldset/TXDR:
description: Transmit Data Register
fields:
- name: TXDR
description: Transmit data register
bit_offset: 0
bit_size: 32
fieldset/UDRDR:
description: Underrun Data Register
fields:

View File

@ -34,16 +34,34 @@ block/SPI:
- name: AUTOCR
byte_offset: 28
fieldset: AUTOCR
- name: TXDR
- name: TXDR32
description: Transmit Data Register
byte_offset: 32
access: Write
fieldset: TXDR
- name: RXDR
- name: TXDR16
description: Transmit Data Register - half-word sized
byte_offset: 32
bit_size: 16
access: Write
- name: TXDR8
description: Transmit Data Register - byte sized
byte_offset: 32
bit_size: 8
access: Write
- name: RXDR32
description: Receive Data Register
byte_offset: 48
access: Read
fieldset: RXDR
- name: RXDR16
description: Receive Data Register - half-word sized
byte_offset: 48
bit_size: 16
access: Read
- name: RXDR8
description: Receive Data Register - byte sized
byte_offset: 48
bit_size: 8
access: Read
- name: CRCPOLY
description: Polynomial Register
byte_offset: 64
@ -348,13 +366,6 @@ fieldset/RXCRC:
description: CRC register for receiver
bit_offset: 0
bit_size: 32
fieldset/RXDR:
description: Receive Data Register
fields:
- name: RXDR
description: Receive data register
bit_offset: 0
bit_size: 32
fieldset/SR:
description: Status Register
fields:
@ -427,13 +438,6 @@ fieldset/TXCRC:
description: CRC register for transmitter
bit_offset: 0
bit_size: 32
fieldset/TXDR:
description: Transmit Data Register
fields:
- name: TXDR
description: Transmit data register
bit_offset: 0
bit_size: 32
fieldset/UDRDR:
description: Underrun Data Register
fields:

View File

@ -0,0 +1,752 @@
block/SYSCFG:
description: SYSCFG register block
items:
- name: CFGR1
description: SYSCFG configuration register 1
byte_offset: 0
fieldset: CFGR1
- name: CFGR2
description: SYSCFG configuration register 2
byte_offset: 24
fieldset: CFGR2
- name: SCSR
description: SYSCFG SRAM2 control and status register
byte_offset: 28
fieldset: SCSR
- name: SKR
description: SYSCFG SRAM2 key register
byte_offset: 32
fieldset: SKR
- name: TSCCR
description: SYSCFG TSC comparator register
byte_offset: 36
fieldset: TSCCR
- name: ITLINE0
description: SYSCFG interrupt line 0 status register
byte_offset: 128
fieldset: ITLINE0
- name: ITLINE1
description: SYSCFG interrupt line 1 status register
byte_offset: 132
fieldset: ITLINE1
- name: ITLINE2
description: SYSCFG interrupt line 2 status register
byte_offset: 136
fieldset: ITLINE2
- name: ITLINE3
description: SYSCFG interrupt line 3 status register
byte_offset: 140
fieldset: ITLINE3
- name: ITLINE4
description: SYSCFG interrupt line 4 status register
byte_offset: 144
fieldset: ITLINE4
- name: ITLINE5
description: SYSCFG interrupt line 5 status register
byte_offset: 148
fieldset: ITLINE5
- name: ITLINE6
description: SYSCFG interrupt line 6 status register
byte_offset: 152
fieldset: ITLINE6
- name: ITLINE7
description: SYSCFG interrupt line 7 status register
byte_offset: 156
fieldset: ITLINE7
- name: ITLINE8
description: SYSCFG interrupt line 8 status register
byte_offset: 160
fieldset: ITLINE8
- name: ITLINE9
description: SYSCFG interrupt line 9 status register
byte_offset: 164
fieldset: ITLINE9
- name: ITLINE10
description: SYSCFG interrupt line 10 status register
byte_offset: 168
fieldset: ITLINE10
- name: ITLINE11
description: SYSCFG interrupt line 11 status register
byte_offset: 172
fieldset: ITLINE11
- name: ITLINE12
description: SYSCFG interrupt line 12 status register
byte_offset: 176
fieldset: ITLINE12
- name: ITLINE13
description: SYSCFG interrupt line 13 status register
byte_offset: 180
fieldset: ITLINE13
- name: ITLINE14
description: SYSCFG interrupt line 14 status register
byte_offset: 184
fieldset: ITLINE14
- name: ITLINE15
description: SYSCFG interrupt line 15 status register
byte_offset: 188
fieldset: ITLINE15
- name: ITLINE16
description: SYSCFG interrupt line 16 status register
byte_offset: 192
fieldset: ITLINE16
- name: ITLINE17
description: SYSCFG interrupt line 17 status register
byte_offset: 196
fieldset: ITLINE17
- name: ITLINE18
description: SYSCFG interrupt line 18 status register
byte_offset: 200
fieldset: ITLINE18
- name: ITLINE19
description: SYSCFG interrupt line 19 status register
byte_offset: 204
fieldset: ITLINE19
- name: ITLINE20
description: SYSCFG interrupt line 20 status register
byte_offset: 208
fieldset: ITLINE20
- name: ITLINE21
description: SYSCFG interrupt line 21 status register
byte_offset: 212
fieldset: ITLINE21
- name: ITLINE22
description: SYSCFG interrupt line 22 status register
byte_offset: 216
fieldset: ITLINE22
- name: ITLINE23
description: SYSCFG interrupt line 23 status register
byte_offset: 220
fieldset: ITLINE23
- name: ITLINE24
description: SYSCFG interrupt line 24 status register
byte_offset: 224
fieldset: ITLINE24
- name: ITLINE25
description: SYSCFG interrupt line 25 status register
byte_offset: 228
fieldset: ITLINE25
- name: ITLINE26
description: SYSCFG interrupt line 26 status register
byte_offset: 232
fieldset: ITLINE26
- name: ITLINE27
description: SYSCFG interrupt line 27 status register
byte_offset: 236
fieldset: ITLINE27
- name: ITLINE28
description: SYSCFG interrupt line 28 status register
byte_offset: 240
fieldset: ITLINE28
- name: ITLINE29
description: SYSCFG interrupt line 29 status register
byte_offset: 244
fieldset: ITLINE29
- name: ITLINE30
description: SYSCFG interrupt line 30 status register
byte_offset: 248
fieldset: ITLINE30
- name: ITLINE31
description: SYSCFG interrupt line 31 status register
byte_offset: 252
fieldset: ITLINE31
fieldset/CFGR1:
description: SYSCFG configuration register 1
fields:
- name: MEM_MODE
description: 'Memory mapping selection bits These bits are set and cleared by software. They control the memory internal mapping at address 0x000010000. After reset these bits take on the value selected by the actual boot mode configuration. Refer to Section12.5: Boot configuration for more details. X0: Main flash memory mapped at 0x000010000'
bit_offset: 0
bit_size: 2
enum: MEM_MODE
- name: PA11_RMP
description: |-
PA11 pin remapping This bit is set and cleared by software. When set, it remaps the PA11 pin to operate as PA9 GPIO port, instead as PA11 GPIO port.
0: No remap (PA11)
1: Remap (PA9)
bit_offset: 3
bit_size: 1
- name: PA12_RMP
description: |-
PA12 pin remapping This bit is set and cleared by software. When set, it remaps the PA12 pin to operate as PA10 GPIO port, instead as PA12 GPIO port.
0: No remap (PA12)
1: Remap (PA10)
bit_offset: 4
bit_size: 1
- name: IR_POL
description: IR output polarity selection
bit_offset: 5
bit_size: 1
- name: IR_MOD
description: 'IR Modulation Envelope signal selection This bitfield selects the signal for IR modulation envelope:'
bit_offset: 6
bit_size: 2
enum: IR_MOD
- name: BOOSTEN
description: 'I/O analog switch voltage booster enable This bit selects the way of supplying I/O analog switches: When using the analog inputs , setting to 0 is recommended for high V<sub>DD</sub>, setting to 1 for low V<sub>DD</sub> (less than 2.4 V).'
bit_offset: 8
bit_size: 1
- name: I2C_PB6_FMP
description: |-
Fast Mode Plus (FM+) enable for PB6 This bit is set and cleared by software. It enables I<sup>2</sup>C FM+ driving capability on PB6 I/O port. With this bit in disable state, the I<sup>2</sup>C FM+ driving capability on this I/O port can be enabled through one of I2Cx_FMP bits. When I<sup>2</sup>C FM+ is enabled, the speed control is ignored. Note: This control bit is kept for legacy reasons. It is recommended to use the FMP bit of the I2Cx_CR1 register instead.
0: Disable
1: Enable
bit_offset: 16
bit_size: 1
- name: I2C_PB7_FMP
description: |-
Fast Mode Plus (FM+) enable for PB7 This bit is set and cleared by software. It enables I<sup>2</sup>C FM+ driving capability on PB7 I/O port. With this bit in disable state, the I<sup>2</sup>C FM+ driving capability on this I/O port can be enabled through one of I2Cx_FMP bits. When I<sup>2</sup>C FM+ is enabled, the speed control is ignored. Note: This control bit is kept for legacy reasons. It is recommended to use the FMP bit of the I2Cx_CR1 register instead.
0: Disable
1: Enable
bit_offset: 17
bit_size: 1
- name: I2C_PB8_FMP
description: |-
Fast Mode Plus (FM+) enable for PB8 This bit is set and cleared by software. It enables I<sup>2</sup>C FM+ driving capability on PB8 I/O port. With this bit in disable state, the I<sup>2</sup>C FM+ driving capability on this I/O port can be enabled through one of I2Cx_FMP bits. When I<sup>2</sup>C FM+ is enabled, the speed control is ignored. Note: This control bit is kept for legacy reasons. It is recommended to use the FMP bit of the I2Cx_CR1 register instead.
0: Disable
1: Enable
bit_offset: 18
bit_size: 1
- name: I2C_PB9_FMP
description: |-
Fast Mode Plus (FM+) enable for PB9 This bit is set and cleared by software. It enables I<sup>2</sup>C FM+ driving capability on PB9 I/O port. With this bit in disable state, the I<sup>2</sup>C FM+ driving capability on this I/O port can be enabled through one of I2Cx_FMP bits. When I<sup>2</sup>C FM+ is enabled, the speed control is ignored. Note: This control bit is kept for legacy reasons. It is recommended to use the FMP bit of the I2Cx_CR1 register instead.
0: Disable
1: Enable
bit_offset: 19
bit_size: 1
- name: I2C_PA9_FMP
description: |-
Fast Mode Plus (FM+) enable for PA9 This bit is set and cleared by software. It enables I<sup>2</sup>C FM+ driving capability on PA9 I/O port. With this bit in disable state, the I<sup>2</sup>C FM+ driving capability on this I/O port can be enabled through one of I2Cx_FMP bits. When I<sup>2</sup>C FM+ is enabled, the speed control is ignored. Note: This control bit is kept for legacy reasons. It is recommended to use the FMP bit of the I2Cx_CR1 register instead.
0: Disable
1: Enable
bit_offset: 22
bit_size: 1
- name: I2C_PA10_FMP
description: |-
Fast Mode Plus (FM+) enable for PA10 This bit is set and cleared by software. It enables I<sup>2</sup>C FM+ driving capability on PA10 I/O port. With this bit in disable state, the I<sup>2</sup>C FM+ driving capability on this I/O port can be enabled through one of I2Cx_FMP bits. When I<sup>2</sup>C FM+ is enabled, the speed control is ignored. Note: This control bit is kept for legacy reasons. It is recommended to use the FMP bit of the I2Cx_CR1 register instead.
0: Disable
1: Enable
bit_offset: 23
bit_size: 1
- name: I2C3_FMP
description: |-
Fast Mode Plus (FM+) enable for I2C3 This bit is set and cleared by software. It enables I<sup>2</sup>C FM+ driving capability on I/O ports configured as I2C3 through GPIOx_AFR registers. With this bit in disable state, the I<sup>2</sup>C FM+ driving capability on I/O ports configured as I2C3 can be enabled through their corresponding I2Cx_FMP bit. When I<sup>2</sup>C FM+ is enabled, the speed control is ignored. Note: This control bit is kept for legacy reasons. It is recommended to use the FMP bit of the I2Cx_CR1 register instead.
0: Disable
1: Enable
bit_offset: 24
bit_size: 1
fieldset/CFGR2:
description: SYSCFG configuration register 2
fields:
- name: CCL
description: Cortex<Superscript>1<Default 1 Font>-M0+ LOCKUP bit enable bit This bit is set by software and cleared by a system reset. It can be use to enable and lock the connection of Cortex<Superscript>1<Default 1 Font>-M0+ LOCKUP (Hardfault) output to TIM1/15/16 Break input.
bit_offset: 0
bit_size: 1
- name: SPL
description: SRAM1 parity lock bit This bit is set by software and cleared by a system reset. It can be used to enable and lock the SRAM1 parity error signal connection to TIM1/15/16 Break input.
bit_offset: 1
bit_size: 1
- name: PVDL
description: PVD lock enable bit This bit is set by software and cleared by a system reset. It can be used to enable and lock the PVD connection to TIM1/15/16 Break input, as well as the PVDE and PLS[2:0] in the PWR_CR register.
bit_offset: 2
bit_size: 1
- name: ECCL
description: ECC error lock bit This bit is set by software and cleared by a system reset. It can be used to enable and lock the flash ECC 2-bit error detection signal connection to TIM1/15/16 Break input.
bit_offset: 3
bit_size: 1
- name: BKPL
description: Backup SRAM2 parity lock This bit is set by software and cleared by a system reset. It can be used to enable and lock the SRAM2 parity error signal connection to TIM1/15/16 Break input.
bit_offset: 4
bit_size: 1
- name: BKPF
description: Backup SRAM2 parity error flag This bit is set by hardware when an SRAM2 parity error is detected. It is cleared by software by writing 1.
bit_offset: 7
bit_size: 1
- name: SPF
description: SRAM1 parity error flag This bit is set by hardware when an SRAM1 parity error is detected. It is cleared by software by writing 1.
bit_offset: 8
bit_size: 1
fieldset/ITLINE0:
description: SYSCFG interrupt line 0 status register
fields:
- name: WWDG
description: Window watchdog interrupt pending flag
bit_offset: 0
bit_size: 1
fieldset/ITLINE1:
description: SYSCFG interrupt line 1 status register
fields:
- name: PVDOUT
description: PVD supply monitoring interrupt request pending (EXTI line 16).
bit_offset: 0
bit_size: 1
- name: PVMOUT1
description: V<sub>DDUSB</sub> supply monitoring interrupt request pending (EXTI line 19)
bit_offset: 1
bit_size: 1
- name: PVMOUT3
description: ADC supply monitoring interrupt request pending (EXTI line 20)
bit_offset: 2
bit_size: 1
- name: PVMOUT4
description: DAC supply monitoring interrupt request pending (EXTI line 21)
bit_offset: 3
bit_size: 1
fieldset/ITLINE10:
description: SYSCFG interrupt line 10 status register
fields:
- name: DMA1_CH2
description: DMA1 channel 2 interrupt request pending
bit_offset: 0
bit_size: 1
- name: DMA1_CH3
description: DMA1 channel 3 interrupt request pending
bit_offset: 1
bit_size: 1
fieldset/ITLINE11:
description: SYSCFG interrupt line 11 status register
fields:
- name: DMAMUX
description: DMAMUX interrupt request pending
bit_offset: 0
bit_size: 1
- name: DMA1_CH4
description: DMA1 channel 4 interrupt request pending
bit_offset: 1
bit_size: 1
- name: DMA1_CH5
description: DMA1 channel 5 interrupt request pending
bit_offset: 2
bit_size: 1
- name: DMA1_CH6
description: DMA1 channel 6 interrupt request pending
bit_offset: 3
bit_size: 1
- name: DMA1_CH7
description: DMA1 channel 7 interrupt request pending
bit_offset: 4
bit_size: 1
- name: DMA2_CH1
description: DMA2 channel 1 interrupt request pending
bit_offset: 5
bit_size: 1
- name: DMA2_CH2
description: DMA2 channel 2 interrupt request pending
bit_offset: 6
bit_size: 1
- name: DMA2_CH3
description: DMA2 channel 3 interrupt request pending
bit_offset: 7
bit_size: 1
- name: DMA2_CH4
description: DMA2 channel 4 interrupt request pending
bit_offset: 8
bit_size: 1
- name: DMA2_CH5
description: DMA2 channel 5 interrupt request pending
bit_offset: 9
bit_size: 1
fieldset/ITLINE12:
description: SYSCFG interrupt line 12 status register
fields:
- name: ADC
description: ADC interrupt request pending
bit_offset: 0
bit_size: 1
- name: COMP1
description: Comparator 1 interrupt request pending (EXTI line 17)
bit_offset: 1
bit_size: 1
- name: COMP2
description: Comparator 2 interrupt request pending (EXTI line 18)
bit_offset: 2
bit_size: 1
fieldset/ITLINE13:
description: SYSCFG interrupt line 13 status register
fields:
- name: TIM1_CCU
description: Timer 1 commutation interrupt request pending
bit_offset: 0
bit_size: 1
- name: TIM1_TRG
description: Timer 1 trigger interrupt request pending
bit_offset: 1
bit_size: 1
- name: TIM1_UPD
description: Timer 1 update interrupt request pending
bit_offset: 2
bit_size: 1
- name: TIM1_BRK
description: Timer 1 break interrupt request pending
bit_offset: 3
bit_size: 1
fieldset/ITLINE14:
description: SYSCFG interrupt line 14 status register
fields:
- name: TIM1_CC1
description: Timer 1 capture compare 1 interrupt request pending
bit_offset: 0
bit_size: 1
- name: TIM1_CC2
description: Timer 1 capture compare 2 interrupt request pending
bit_offset: 1
bit_size: 1
- name: TIM1_CC3
description: Timer 1 capture compare 3 interrupt request pending
bit_offset: 2
bit_size: 1
- name: TIM1_CC4
description: Timer 1 capture compare 4 interrupt request pending
bit_offset: 3
bit_size: 1
fieldset/ITLINE15:
description: SYSCFG interrupt line 15 status register
fields:
- name: TIM2
description: Timer 2 interrupt request pending
bit_offset: 0
bit_size: 1
fieldset/ITLINE16:
description: SYSCFG interrupt line 16 status register
fields:
- name: TIM3
description: Timer 3 interrupt request pending
bit_offset: 0
bit_size: 1
fieldset/ITLINE17:
description: SYSCFG interrupt line 17 status register
fields:
- name: TIM6
description: Timer 6 interrupt request pending
bit_offset: 0
bit_size: 1
- name: DAC
description: DAC underrun interrupt request pending
bit_offset: 1
bit_size: 1
- name: LPTIM1
description: Low-power timer 1 interrupt request pending (EXTI line 29)
bit_offset: 2
bit_size: 1
fieldset/ITLINE18:
description: SYSCFG interrupt line 18 status register
fields:
- name: TIM7
description: Timer 7 interrupt request pending
bit_offset: 0
bit_size: 1
- name: LPTIM2
description: Low-power timer 2 interrupt request pending (EXTI line 30)
bit_offset: 1
bit_size: 1
fieldset/ITLINE19:
description: SYSCFG interrupt line 19 status register
fields:
- name: TIM15
description: Timer 15 interrupt request pending
bit_offset: 0
bit_size: 1
- name: LPTIM3
description: Low-power timer 3 interrupt request pending
bit_offset: 1
bit_size: 1
fieldset/ITLINE2:
description: SYSCFG interrupt line 2 status register
fields:
- name: TAMP
description: Tamper interrupt request pending (EXTI line 21)
bit_offset: 0
bit_size: 1
- name: RTC
description: RTC interrupt request pending (EXTI line 19)
bit_offset: 1
bit_size: 1
fieldset/ITLINE20:
description: SYSCFG interrupt line 20 status register
fields:
- name: TIM16
description: Timer 16 interrupt request pending
bit_offset: 0
bit_size: 1
fieldset/ITLINE21:
description: SYSCFG interrupt line 21 status register
fields:
- name: TSC_MCE
description: TSC max count error interrupt request pending
bit_offset: 0
bit_size: 1
- name: TSC_EOA
description: TSC end of acquisition interrupt request pending
bit_offset: 1
bit_size: 1
fieldset/ITLINE22:
description: SYSCFG interrupt line 22 status register
fields:
- name: LCD
description: LCD interrupt request pending
bit_offset: 0
bit_size: 1
fieldset/ITLINE23:
description: SYSCFG interrupt line 23 status register
fields:
- name: I2C1
description: I2C1 interrupt request pending (EXTI line 33)
bit_offset: 0
bit_size: 1
fieldset/ITLINE24:
description: SYSCFG interrupt line 24 status register
fields:
- name: I2C2
description: I2C2 interrupt request pending
bit_offset: 0
bit_size: 1
- name: I2C4
description: I2C4 interrupt request pending
bit_offset: 1
bit_size: 1
- name: I2C3
description: I2C3 interrupt request pending (EXTI line 23)
bit_offset: 2
bit_size: 1
fieldset/ITLINE25:
description: SYSCFG interrupt line 25 status register
fields:
- name: SPI1
description: SPI1 interrupt request pending
bit_offset: 0
bit_size: 1
fieldset/ITLINE26:
description: SYSCFG interrupt line 26 status register
fields:
- name: SPI2
description: SPI2 interrupt request pending
bit_offset: 0
bit_size: 1
- name: SPI3
description: SPI3 interrupt request pending
bit_offset: 1
bit_size: 1
fieldset/ITLINE27:
description: SYSCFG interrupt line 27 status register
fields:
- name: USART1
description: USART1 interrupt request pending, combined with EXTI line 25
bit_offset: 0
bit_size: 1
fieldset/ITLINE28:
description: SYSCFG interrupt line 28 status register
fields:
- name: USART2
description: USART2 interrupt request pending (EXTI line 35)
bit_offset: 0
bit_size: 1
- name: LPUART2
description: LPUART2 interrupt request pending (EXTI line 31)
bit_offset: 1
bit_size: 1
fieldset/ITLINE29:
description: SYSCFG interrupt line 29 status register
fields:
- name: USART3
description: USART3 interrupt request pending
bit_offset: 0
bit_size: 1
- name: LPUART1
description: LPUART1 interrupt request pending (EXTI line 30)
bit_offset: 1
bit_size: 1
fieldset/ITLINE3:
description: SYSCFG interrupt line 3 status register
fields:
- name: FLASH_ITF
description: Flash interface interrupt request pending
bit_offset: 0
bit_size: 1
- name: FLASH_ECC
description: Flash interface ECC interrupt request pending
bit_offset: 1
bit_size: 1
fieldset/ITLINE30:
description: SYSCFG interrupt line 30 status register
fields:
- name: USART4
description: USART4 interrupt request pending
bit_offset: 0
bit_size: 1
- name: LPUART3
description: LPUART3 interrupt request pending (EXTI line 32)
bit_offset: 1
bit_size: 1
fieldset/ITLINE31:
description: SYSCFG interrupt line 31 status register
fields:
- name: RNG
description: RNG interrupt request pending
bit_offset: 0
bit_size: 1
- name: AES
description: AES interrupt request pending
bit_offset: 1
bit_size: 1
fieldset/ITLINE4:
description: SYSCFG interrupt line 4 status register
fields:
- name: RCC
description: Reset and clock control interrupt request pending
bit_offset: 0
bit_size: 1
- name: CRS
description: CRS interrupt request pending
bit_offset: 1
bit_size: 1
fieldset/ITLINE5:
description: SYSCFG interrupt line 5 status register
fields:
- name: EXTI0
description: EXTI line 0 interrupt request pending
bit_offset: 0
bit_size: 1
- name: EXTI1
description: EXTI line 1 interrupt request pending
bit_offset: 1
bit_size: 1
fieldset/ITLINE6:
description: SYSCFG interrupt line 6 status register
fields:
- name: EXTI2
description: EXTI line 2 interrupt request pending
bit_offset: 0
bit_size: 1
- name: EXTI3
description: EXTI line 3 interrupt request pending
bit_offset: 1
bit_size: 1
fieldset/ITLINE7:
description: SYSCFG interrupt line 7 status register
fields:
- name: EXTI4
description: EXTI line 4 interrupt request pending
bit_offset: 0
bit_size: 1
- name: EXTI5
description: EXTI line 5 interrupt request pending
bit_offset: 1
bit_size: 1
- name: EXTI6
description: EXTI line 6 interrupt request pending
bit_offset: 2
bit_size: 1
- name: EXTI7
description: EXTI line 7 interrupt request pending
bit_offset: 3
bit_size: 1
- name: EXTI8
description: EXTI line 8 interrupt request pending
bit_offset: 4
bit_size: 1
- name: EXTI9
description: EXTI line 9 interrupt request pending
bit_offset: 5
bit_size: 1
- name: EXTI10
description: EXTI line 10 interrupt request pending
bit_offset: 6
bit_size: 1
- name: EXTI11
description: EXTI line 11 interrupt request pending
bit_offset: 7
bit_size: 1
- name: EXTI12
description: EXTI line 12 interrupt request pending
bit_offset: 8
bit_size: 1
- name: EXTI13
description: EXTI line 13 interrupt request pending
bit_offset: 9
bit_size: 1
- name: EXTI14
description: EXTI line 14 interrupt request pending
bit_offset: 10
bit_size: 1
- name: EXTI15
description: EXTI line 15 interrupt request pending
bit_offset: 11
bit_size: 1
fieldset/ITLINE8:
description: SYSCFG interrupt line 8 status register
fields:
- name: USB
description: USB interrupt request pending
bit_offset: 0
bit_size: 1
fieldset/ITLINE9:
description: SYSCFG interrupt line 9 status register
fields:
- name: DMA1_CH1
description: DMA1 channel 1 interrupt request pending
bit_offset: 0
bit_size: 1
fieldset/SCSR:
description: SYSCFG SRAM2 control and status register
fields:
- name: SRAM2ER
description: 'SRAM2 erase Setting this bit starts a hardware SRAM2 erase operation. This bit is automatically cleared at the end of the SRAM2 erase operation. Note: This bit is write-protected: setting this bit is possible only after the correct key sequence is written in the SYSCFG_SKR register.'
bit_offset: 0
bit_size: 1
- name: SRAM2BSY
description: SRAM2 busy by erase operation
bit_offset: 1
bit_size: 1
fieldset/SKR:
description: SYSCFG SRAM2 key register
fields:
- name: KEY
description: 'SRAM2 write protection key for software erase The following steps are required to unlock the write protection of the SRAM2ER bit in the SYSCFG_CFGR2 register: Write 0xCA into KEY[7:0] Write 0x53 into KEY[7:0] Writing a wrong key reactivates the write protection.'
bit_offset: 0
bit_size: 8
fieldset/TSCCR:
description: SYSCFG TSC comparator register
fields:
- name: G2_IO1
description: Comparator mode for group 2 on I/O 1
bit_offset: 0
bit_size: 1
- name: G2_IO3
description: Comparator mode for group 2 on I/O 3
bit_offset: 1
bit_size: 1
- name: G4_IO3
description: Comparator mode for group 4 on I/O 3
bit_offset: 2
bit_size: 1
- name: G6_IO1
description: Comparator mode for group 6 on I/O 1
bit_offset: 3
bit_size: 1
- name: G7_IO1
description: Comparator mode for group 7 on I/O 1
bit_offset: 4
bit_size: 1
- name: TSC_IOCTRL
description: I/O control in comparator mode The I/O control in comparator mode can be overwritten by hardware.
bit_offset: 5
bit_size: 1
enum/IR_MOD:
bit_size: 2
variants:
- name: TIM16
description: TIM16
value: 0
- name: USART1
description: USART1
value: 1
- name: USART2
description: USART2
value: 2
enum/MEM_MODE:
bit_size: 2
variants:
- name: System_Flash
description: System flash memory mapped at 0x000010000
value: 1
- name: SRAM
description: Embedded SRAM mapped at 0x000010000
value: 3

13
generate.sh Normal file
View File

@ -0,0 +1,13 @@
#/bin/bash -v
git clone --depth 1 ssh://gitea@git.ggeta.com:2002/guangzong/stm32-data-generated.git build -q
rm -rf ./build/data
rm -rf ./build/stm32-metapac
./d download-all
cargo run --release --bin stm32-data-gen
cargo run --release --bin stm32-metapac-gen
export COMMIT_HASH=$(git rev-parse HEAD)
cd build/
git add data stm32-metapac
git commit -m "Generated from stm32-data $COMMIT_HASH"
git tag -a stm32-data-$COMMIT -m "Generated from stm32-data $COMMIT_HASH"
git push --follow-tags

View File

@ -58,7 +58,9 @@ mod xml {
}
pub struct Chip {
#[allow(dead_code)]
flash: u32,
#[allow(dead_code)]
ram: u32,
group_idx: usize,
packages: Vec<stm32_data_serde::chip::Package>,
@ -210,7 +212,7 @@ impl PeriMatcher {
("STM32WLE.*:ADC:.*", ("adc", "g0", "ADC")),
("STM32G0.*:ADC:.*", ("adc", "g0", "ADC")),
("STM32G0.*:ADC_COMMON:.*", ("adccommon", "v3", "ADC_COMMON")),
("STM32G4.*:ADC:.*", ("adc", "v4", "ADC")),
("STM32G4.*:ADC:.*", ("adc", "g4", "ADC")),
("STM32G4.*:ADC_COMMON:.*", ("adccommon", "v4", "ADC_COMMON")),
(".*:ADC_COMMON:aditf2_v1_1", ("adccommon", "v2", "ADC_COMMON")),
(".*:ADC_COMMON:aditf5_v2_0", ("adccommon", "v3", "ADC_COMMON")),
@ -247,6 +249,7 @@ impl PeriMatcher {
("syscfg", "h7od", "SYSCFG"),
),
("STM32H7.*:SYSCFG:.*", ("syscfg", "h7", "SYSCFG")),
("STM32U0.*:SYSCFG:.*", ("syscfg", "u0", "SYSCFG")),
("STM32U5.*:SYSCFG:.*", ("syscfg", "u5", "SYSCFG")),
("STM32WBA.*:SYSCFG:.*", ("syscfg", "wba", "SYSCFG")),
("STM32WB.*:SYSCFG:.*", ("syscfg", "wb", "SYSCFG")),
@ -309,7 +312,7 @@ impl PeriMatcher {
("STM32(G0|H5|U5).*:USBRAM:.*", ("usbram", "32_2048", "USBRAM")),
// # USB OTG
(".*:USB_OTG_FS:otgfs1_.*", ("otg", "v1", "OTG")),
(".*:USB_OTG_HS:otghs1_.*", ("otg", "v1", "OTG")),
("STM32U5A.*:USB_OTG_HS:otghs1_.*", ("otg", "v2", "OTG")),
("STM32C0.*:RCC:.*", ("rcc", "c0", "RCC")),
("STM32F030.[46].*:RCC:.*", ("rcc", "f0v1", "RCC")),
("STM32F05[128].*:RCC:.*", ("rcc", "f0v1", "RCC")),
@ -342,6 +345,7 @@ impl PeriMatcher {
("STM32L4[PQRS].*:RCC:.*", ("rcc", "l4plus", "RCC")),
("STM32L4.*:RCC:.*", ("rcc", "l4", "RCC")),
("STM32L5.*:RCC:.*", ("rcc", "l5", "RCC")),
("STM32U0.*:RCC:.*", ("rcc", "u0", "RCC")),
("STM32U5.*:RCC:.*", ("rcc", "u5", "RCC")),
("STM32H50.*:RCC:.*", ("rcc", "h50", "RCC")),
("STM32H5.*:RCC:.*", ("rcc", "h5", "RCC")),
@ -357,6 +361,7 @@ impl PeriMatcher {
("STM32C0.*:EXTI:.*", ("exti", "c0", "EXTI")),
("STM32G0.*:EXTI:.*", ("exti", "g0", "EXTI")),
("STM32H7.*:EXTI:.*", ("exti", "h7", "EXTI")),
("STM32U0.*:EXTI:.*", ("exti", "u0", "EXTI")),
("STM32U5.*:EXTI:.*", ("exti", "u5", "EXTI")),
("STM32WB.*:EXTI:.*", ("exti", "w", "EXTI")),
("STM32WL5.*:EXTI:.*", ("exti", "w", "EXTI")),
@ -394,6 +399,7 @@ impl PeriMatcher {
("STM32L1.*:PWR:.*", ("pwr", "l1", "PWR")),
("STM32L4.*:PWR:.*", ("pwr", "l4", "PWR")),
("STM32L5.*:PWR:.*", ("pwr", "l5", "PWR")),
("STM32U0.*:PWR:.*", ("pwr", "u0", "PWR")),
("STM32U5.*:PWR:.*", ("pwr", "u5", "PWR")),
("STM32WL.*:PWR:.*", ("pwr", "wl5", "PWR")),
("STM32WBA.*:PWR:.*", ("pwr", "wba", "PWR")),
@ -413,13 +419,16 @@ impl PeriMatcher {
("STM32L1.*:FLASH:.*", ("flash", "l1", "FLASH")),
("STM32L4.*:FLASH:.*", ("flash", "l4", "FLASH")),
("STM32L5.*:FLASH:.*", ("flash", "l5", "FLASH")),
("STM32U0.*:FLASH:.*", ("flash", "u0", "FLASH")),
("STM32U5.*:FLASH:.*", ("flash", "u5", "FLASH")),
("STM32WBA.*:FLASH:.*", ("flash", "wba", "FLASH")),
("STM32WB.*:FLASH:.*", ("flash", "wb", "FLASH")),
("STM32WL.*:FLASH:.*", ("flash", "wl", "FLASH")),
("STM32C0.*:FLASH:.*", ("flash", "c0", "FLASH")),
("STM32G0.*:FLASH:.*", ("flash", "g0", "FLASH")),
("STM32G4.*:FLASH:.*", ("flash", "g4", "FLASH")),
("STM32G4(3|4).*:FLASH:.*", ("flash", "g4c2", "FLASH")),
("STM32G4(7|8).*:FLASH:.*", ("flash", "g4c3", "FLASH")),
("STM32G4(9|A).*:FLASH:.*", ("flash", "g4c4", "FLASH")),
("STM32H50.*:FLASH:.*", ("flash", "h50", "FLASH")),
("STM32H5.*:FLASH:.*", ("flash", "h5", "FLASH")),
("STM32F107.*:ETH:.*", ("eth", "v1a", "ETH")),
@ -482,18 +491,25 @@ impl PeriMatcher {
("STM32L.*:TIM(9|21|22):.*", ("timer", "v1", "TIM_2CH")),
("STM32L.*:TIM15:.*", ("timer", "v1", "TIM_2CH_CMP")),
("STM32L.*:TIM(16|17):.*", ("timer", "v1", "TIM_1CH_CMP")),
("STM32L5.*:LPTIM.*:.*", ("lptim", "v2a", "LPTIM")),
("STM32L.*:LPTIM(1|2|3):.*", ("lptim", "v1", "LPTIM")),
// AN4013 Table 4: STM32Gx/Hx/Ux/Wx (and Cx) serials
// timer_v2 for STM32Gx/Hx/Ux/Wx (and Cx) serials
("STM32U5.*:TIM(3|4):.*", ("timer", "v2", "TIM_GP32")),
("STM32(G4|H5|U5|WBA).*:TIM(1|8|20):.*", ("timer", "v2", "TIM_ADV")),
("STM32(G4|H5|U5|WBA).*:TIM(2|5|23|24):.*", ("timer", "v2", "TIM_GP32")),
("STM32(G4|H5|U5|WBA).*:TIM(3|4):.*", ("timer", "v2", "TIM_GP16")),
("STM32(G4|H5|U5|WBA).*:TIM(6|7):.*", ("timer", "v2", "TIM_BASIC")),
("STM32(G4|H5|U5|WBA).*:TIM(13|14):.*", ("timer", "v2", "TIM_1CH")),
("STM32(G4|H5|U5|WBA).*:TIM12:.*", ("timer", "v2", "TIM_2CH")),
("STM32(G4|H5|U5|WBA).*:TIM15:.*", ("timer", "v2", "TIM_2CH_CMP")),
("STM32(G4|H5|U5|WBA).*:TIM(16|17):.*", ("timer", "v2", "TIM_1CH_CMP")),
("STM32(G4|H5|U0|U5|WBA).*:TIM(1|8|20):.*", ("timer", "v2", "TIM_ADV")),
(
"STM32(G4|H5|U0|U5|WBA).*:TIM(2|5|23|24):.*",
("timer", "v2", "TIM_GP32"),
),
("STM32(G4|H5|U0|U5|WBA).*:TIM(3|4):.*", ("timer", "v2", "TIM_GP16")),
("STM32(G4|H5|U0|U5|WBA).*:TIM(6|7):.*", ("timer", "v2", "TIM_BASIC")),
("STM32(G4|H5|U0|U5|WBA).*:TIM(13|14):.*", ("timer", "v2", "TIM_1CH")),
("STM32(G4|H5|U0|U5|WBA).*:TIM12:.*", ("timer", "v2", "TIM_2CH")),
("STM32(G4|H5|U0|U5|WBA).*:TIM15:.*", ("timer", "v2", "TIM_2CH_CMP")),
("STM32(G4|H5|U0|U5|WBA).*:TIM(16|17):.*", ("timer", "v2", "TIM_1CH_CMP")),
("STM32WL.*:LPTIM.*:.*", ("lptim", "v2a", "LPTIM")),
("STM32(H5|U5|WBA).*:LPTIM[12356]:.*", ("lptim", "v2b", "LPTIM_ADV")),
("STM32(H5|U5).*:LPTIM4:.*", ("lptim", "v2b", "LPTIM_BASIC")),
("STM32G4.*:HRTIM1:.*", ("hrtim", "v2", "HRTIM")),
// timer_v1 for STM32Gx/Hx/Ux/Wx (and Cx) serials
("STM32(C|G0|H7|WB|WL).*:TIM(1|8|20):.*", ("timer", "v1", "TIM_ADV")),
@ -504,7 +520,7 @@ impl PeriMatcher {
("STM32(C|G0|H7|WB|WL).*:TIM12:.*", ("timer", "v1", "TIM_2CH")),
("STM32(C|G0|H7|WB|WL).*:TIM15:.*", ("timer", "v1", "TIM_2CH_CMP")),
("STM32(C|G0|H7|WB|WL).*:TIM(16|17):.*", ("timer", "v1", "TIM_1CH_CMP")),
("STM32[CGHUW].*:LPTIM[1-6]:.*", ("lptim", "v1", "LPTIM")),
("STM32(C|G|H7|U|W).*:LPTIM[1-6]:.*", ("lptim", "v1", "LPTIM")),
("STM32[CGHUW].*:HRTIM1?:.*", ("hrtim", "v1", "HRTIM")),
//
//// TIM mapping ends here ////
@ -530,6 +546,14 @@ impl PeriMatcher {
("STM32F1.*:GPIO.*", ("gpio", "v1", "GPIO")),
(".*:GPIO.*", ("gpio", "v2", "GPIO")),
(".*:IPCC:v1_0", ("ipcc", "v1", "IPCC")),
("STM32H7(4|5)(5|7).*:HSEM:.*", ("hsem", "v1", "HSEM")),
("STM32WB55.*:HSEM:.*", ("hsem", "v1", "HSEM")),
("STM32H735.*:HSEM:.*", ("hsem", "v2", "HSEM")),
("STM32H7B3.*:HSEM:.*", ("hsem", "v2", "HSEM")),
("STM32H753.*:HSEM:.*", ("hsem", "v2", "HSEM")),
("STM32H743.*:HSEM:.*", ("hsem", "v2", "HSEM")),
("STM32WL5.*:HSEM:.*", ("hsem", "v3", "HSEM")),
("STM32WLE.*:HSEM:.*", ("hsem", "v4", "HSEM")),
(".*:DMAMUX.*", ("dmamux", "v1", "DMAMUX")),
(r".*:GPDMA\d?:.*", ("gpdma", "v1", "GPDMA")),
(r".*:BDMA\d?:.*", ("bdma", "v1", "DMA")),
@ -603,6 +627,7 @@ impl PeriMatcher {
("STM32F0x[128].*:TSC:.*", ("tsc", "v1", "TSC")),
("STM32F3[07][123].*:TSC:.*", ("tsc", "v1", "TSC")),
("STM32WB55.*:TSC:.*", ("tsc", "v2", "TSC")),
("STM32WBA.*:TSC:.*", ("tsc", "v1", "TSC")),
("STM32L[045].*:TSC:.*", ("tsc", "v3", "TSC")),
("STM32U5.*:TSC:.*", ("tsc", "v3", "TSC")),
("*:VREFINTCAL:.*", ("vrefintcal", "v1", "VREFINTCAL")),
@ -760,11 +785,19 @@ pub fn parse_groups() -> Result<(HashMap<String, Chip>, Vec<ChipGroup>), anyhow:
static NOPELIST: &[&str] = &[
// Not supported, not planned unless someone wants to do it.
"STM32MP",
// not supported yet, planned. Pull requests welcome!
"STM32H52",
"STM32H53",
"STM32H7R",
"STM32H7S",
"STM32U5F",
"STM32U5G",
"STM32WBA50",
"STM32WBA54",
"STM32WBA55",
// Does not exist in ST website. No datasheet, no RM.
"STM32GBK",
"STM32L485",
"STM32U5F",
"STM32U5G",
// STM32WxM modules. These are based on a chip that's supported on its own,
// not sure why we want a separate target for it.
"STM32WL5M",
@ -889,7 +922,6 @@ fn process_group(
peripheral_to_clock: &rcc::ParsedRccs,
dma_channels: &dma::DmaChannels,
chips: &HashMap<String, Chip>,
memories: &memory::Memories,
docs: &docs::Docs,
) -> Result<(), anyhow::Error> {
let chip_name = group.chip_names[0].clone();
@ -906,6 +938,7 @@ fn process_group(
let chip_af = &group.ips.values().find(|x| x.name == "GPIO").unwrap().version;
let chip_af = chip_af.strip_suffix("_gpio_v1_0").unwrap();
let chip_af = af.0.get(chip_af);
let cores: Vec<_> = group
.xml
.cores
@ -927,7 +960,7 @@ fn process_group(
.collect();
for chip_name in &group.chip_names {
process_chip(chips, chip_name, h, memories, docs, &group, &cores)?;
process_chip(chips, chip_name, h, docs, &group, &cores)?;
}
Ok(())
@ -950,7 +983,6 @@ fn process_core(
let defines = h.get_defines(&core_name);
let mut peri_kinds = HashMap::new();
peri_kinds.insert("UID".to_string(), "UID".to_string());
for ip in group.ips.values() {
let pname = ip.instance_name.clone();
let pkind = format!("{}:{}", ip.name, ip.version);
@ -1041,6 +1073,8 @@ fn process_core(
"BKP",
"USBRAM",
"VREFINTCAL",
"UID",
"HSEM",
];
for pname in GHOST_PERIS {
if let Entry::Vacant(entry) = peri_kinds.entry(pname.to_string()) {
@ -1322,160 +1356,21 @@ fn process_core(
fn process_chip(
chips: &HashMap<String, Chip>,
chip_name: &str,
h: &header::ParsedHeader,
memories: &memory::Memories,
_h: &header::ParsedHeader,
docs: &docs::Docs,
group: &ChipGroup,
cores: &[stm32_data_serde::chip::Core],
) -> Result<(), anyhow::Error> {
let chip = chips.get(chip_name).unwrap();
let flash_size = chip.flash * 1024;
let ram_total = chip.ram * 1024;
let memory = memories.get(group.die.as_ref().unwrap());
let mut flash_remaining = flash_size;
let mut memory_regions = Vec::new();
let mut found = HashSet::<&str>::new();
for each in [
// We test FLASH_BANKx _before_ FLASH as we prefer their definition over the legacy one
"FLASH_BANK1",
"FLASH_BANK2",
"FLASH",
"FLASH_OTP",
"D1_AXIFLASH",
"D1_AXIICP",
] {
if let Some(address) = h.defines.get("all").unwrap().0.get(&format!("{each}_BASE")) {
let (key, banks) = match each {
"FLASH" => (
"BANK_1",
Some([memory::FlashBank::Bank1, memory::FlashBank::Bank2].as_ref()),
),
"FLASH_BANK1" => ("BANK_1", Some([memory::FlashBank::Bank1].as_ref())),
"FLASH_BANK2" => ("BANK_2", Some([memory::FlashBank::Bank2].as_ref())),
"FLASH_OTP" => ("OTP", Some([memory::FlashBank::Otp].as_ref())),
each => (each, None),
};
if found.contains(key) {
continue;
}
found.insert(key);
if let Some(banks) = banks {
for bank in banks {
let bank_name = match bank {
memory::FlashBank::Bank1 => "BANK_1",
memory::FlashBank::Bank2 => "BANK_2",
memory::FlashBank::Otp => "OTP",
};
let regions: Vec<_> = memory
.flash_regions
.iter()
.filter(|region| region.bank == *bank)
.enumerate()
.map_while(|(index, region)| {
let size = if *bank == memory::FlashBank::Bank1 || *bank == memory::FlashBank::Bank2 {
// Truncate region to the total amount of remaining chip flash
let size = std::cmp::min(region.bytes, flash_remaining);
flash_remaining -= size;
if size == 0 {
// No more regions are present on this chip
return None;
}
size
} else {
region.bytes
};
Some((index, region.address, size, region.settings.clone()))
})
.collect();
let has_multiple_regions = regions.len() > 1;
for (index, address, size, settings) in regions {
let name = if has_multiple_regions {
format!("{}_REGION_{}", bank_name, index + 1)
} else {
bank_name.to_string()
};
memory_regions.push(stm32_data_serde::chip::Memory {
name,
kind: stm32_data_serde::chip::memory::Kind::Flash,
address,
size,
settings: Some(settings.clone()),
});
}
}
} else {
memory_regions.push(stm32_data_serde::chip::Memory {
name: key.to_string(),
kind: stm32_data_serde::chip::memory::Kind::Flash,
address: u32::try_from(*address).unwrap(),
size: 0,
settings: None,
})
}
}
}
let mut found = HashSet::new();
for each in [
"SRAM",
"SRAM1",
"SRAM2",
"D1_AXISRAM",
"D1_ITCMRAM",
"D1_DTCMRAM",
"D1_AHBSRAM",
"D2_AXISRAM",
"D3_BKPSRAM",
"D3_SRAM",
] {
if let Some(address) = h.defines.get("all").unwrap().0.get(&format!("{each}_BASE")) {
let key = match each {
"D1_AXISRAM" => "SRAM",
"SRAM1" => "SRAM",
each => each,
};
if found.contains(key) {
continue;
}
found.insert(key);
let size = if key == "SRAM" {
// if memory.ram.bytes != ram_total {
// println!(
// "SRAM mismatch for chip {} with die {}: Expected {} was {}",
// chip_name,
// group.die.as_ref().unwrap(),
// ram_total,
// memory.ram.bytes,
// );
// }
std::cmp::min(memory.ram.bytes, ram_total)
} else {
0
};
memory_regions.push(stm32_data_serde::chip::Memory {
name: key.to_string(),
kind: stm32_data_serde::chip::memory::Kind::Ram,
address: u32::try_from(*address).unwrap(),
size,
settings: None,
})
}
}
let docs = docs.documents_for(chip_name);
let chip = stm32_data_serde::Chip {
name: chip_name.to_string(),
family: group.family.clone().unwrap(),
line: group.line.clone().unwrap(),
die: group.die.clone().unwrap(),
device_id: memory.device_id,
device_id: u16::from_str_radix(&group.die.as_ref().unwrap()[3..], 16).unwrap(),
packages: chip.packages.clone(),
memory: memory_regions,
memory: memory::get(chip_name),
docs,
cores: cores.to_vec(),
};
@ -1516,7 +1411,6 @@ pub fn dump_all_chips(
peripheral_to_clock: rcc::ParsedRccs,
dma_channels: dma::DmaChannels,
chips: std::collections::HashMap<String, Chip>,
memories: memory::Memories,
docs: docs::Docs,
) -> Result<(), anyhow::Error> {
std::fs::create_dir_all("build/data/chips")?;
@ -1537,7 +1431,6 @@ pub fn dump_all_chips(
&peripheral_to_clock,
&dma_channels,
&chips,
&memories,
&docs,
)
})
@ -1556,7 +1449,6 @@ pub fn dump_all_chips(
&peripheral_to_clock,
&dma_channels,
&chips,
&memories,
&docs,
)
})

View File

@ -245,6 +245,14 @@ impl ChipInterrupts {
interrupt_signals.insert(("RCC".to_string(), "CRS".to_string()));
} else if name == "RCC" {
interrupt_signals.insert(("RCC".to_string(), "GLOBAL".to_string()));
} else if name == "RNG_CRYP" {
interrupt_signals.insert(("RNG".to_string(), "GLOBAL".to_string()));
interrupt_signals.insert(("CRYP".to_string(), "GLOBAL".to_string()));
} else if name == "WWDG_IWDG" {
interrupt_signals.insert(("WWDG".to_string(), "GLOBAL".to_string()));
interrupt_signals.insert(("IWDG".to_string(), "GLOBAL".to_string()));
} else if name == "RCC_AUDIOSYNC" {
// ignore
} else {
if parts[2].is_empty() {
trace!(" skipping because parts[2].is_empty()");

View File

@ -69,9 +69,6 @@ fn main() -> anyhow::Result<()> {
let registers = registers::Registers::parse()?;
registers.write()?;
// stopwatch.section("Parsing memories");
let memories = memory::Memories::parse()?;
// stopwatch.section("Parsing interrupts");
let chip_interrupts = interrupts::ChipInterrupts::parse()?;
@ -99,7 +96,6 @@ fn main() -> anyhow::Result<()> {
peripheral_to_clock,
dma_channels,
chips,
memories,
docs,
)?;

View File

@ -1,288 +1,359 @@
use std::cmp::Ordering;
use std::collections::HashMap;
use std::fs;
use regex::Regex;
use stm32_data_serde::chip::memory::{self, Settings};
use stm32_data_serde::chip::Memory;
#[derive(Debug, PartialEq)]
pub struct Memory {
pub device_id: u16,
pub ram: Ram,
pub flash_size: u32,
pub flash_regions: Vec<FlashRegion>,
struct Mem {
name: &'static str,
address: u32,
size: u32,
}
#[derive(Clone, Copy, Debug, PartialEq)]
pub struct Ram {
pub address: u32,
pub bytes: u32,
}
#[derive(Clone, Debug, PartialEq)]
pub struct FlashRegion {
pub bank: FlashBank,
pub address: u32,
pub bytes: u32,
pub settings: stm32_data_serde::chip::memory::Settings,
}
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum FlashBank {
Bank1,
Bank2,
Otp,
}
mod xml {
use serde::Deserialize;
pub fn from_hex<'de, T, D>(deserializer: D) -> Result<T, D::Error>
where
D: serde::Deserializer<'de>,
T: num::Num,
T::FromStrRadixErr: std::fmt::Display,
{
use serde::de::Error;
let s: &str = Deserialize::deserialize(deserializer)?;
let s = s.trim();
let (prefix, num) = s.split_at(2);
if prefix != "0x" && prefix != "0X" {
panic!("no hex prefix");
}
T::from_str_radix(num, 16).map_err(D::Error::custom)
}
pub fn opt_from_hex<'de, T, D>(deserializer: D) -> Result<Option<T>, D::Error>
where
D: serde::Deserializer<'de>,
T: num::Num,
T::FromStrRadixErr: std::fmt::Display,
{
Ok(Some(from_hex(deserializer)?))
}
#[derive(Debug, Deserialize, PartialEq)]
pub struct Root {
#[serde(rename = "Device")]
pub device: root::Device,
}
mod root {
use serde::Deserialize;
use super::from_hex;
#[derive(Debug, Deserialize, PartialEq)]
pub struct Device {
#[serde(rename = "DeviceID", deserialize_with = "from_hex")]
pub device_id: u16,
#[serde(rename = "Name")]
pub name: String,
#[serde(rename = "Peripherals")]
pub peripherals: device::Peripherals,
}
mod device {
use serde::Deserialize;
#[derive(Debug, Deserialize, PartialEq)]
pub struct Peripherals {
#[serde(rename = "Peripheral")]
pub peripharal: Vec<peripherals::Peripheral>,
}
mod peripherals {
use serde::Deserialize;
use super::super::super::opt_from_hex;
#[derive(Debug, Deserialize, PartialEq)]
pub struct Peripheral {
#[serde(rename = "Name")]
// pub name: peripheral::Name,
pub name: String,
#[serde(rename = "ErasedValue", deserialize_with = "opt_from_hex", default)]
pub erased_value: Option<u8>,
#[serde(rename = "Configuration", default)]
pub configuration: Vec<peripheral::Configuration>,
}
mod peripheral {
use serde::Deserialize;
use super::super::super::super::opt_from_hex;
#[derive(Debug, Deserialize, PartialEq)]
pub struct Configuration {
#[serde(rename = "Parameters", default)]
pub parameters: Option<configuration::Parameters>,
#[serde(rename = "Organization", default)]
pub organization: Option<String>,
#[serde(rename = "Allignement", deserialize_with = "opt_from_hex", default)]
pub allignement: Option<u32>,
#[serde(rename = "Bank")]
pub bank: Vec<configuration::Bank>,
}
mod configuration {
use serde::Deserialize;
use super::super::super::super::super::{from_hex, opt_from_hex};
#[derive(Debug, Deserialize, PartialEq)]
pub struct Parameters {
#[serde(deserialize_with = "from_hex")]
pub address: u32,
#[serde(deserialize_with = "from_hex")]
pub size: u32,
#[serde(deserialize_with = "opt_from_hex", default)]
pub occurence: Option<u32>,
}
#[derive(Debug, Deserialize, PartialEq)]
pub struct Bank {
#[serde(default)]
pub name: Option<String>,
#[serde(rename = "Field", default)]
pub field: Vec<bank::Field>,
}
mod bank {
use serde::Deserialize;
#[derive(Debug, Deserialize, PartialEq)]
pub struct Field {
#[serde(rename = "Parameters")]
pub parameters: super::Parameters,
}
}
}
}
}
}
}
}
pub struct Memories(HashMap<u16, Memory>);
impl Memories {
pub fn parse() -> anyhow::Result<Self> {
let mut paths: Vec<_> = glob::glob("sources/cubeprogdb/db/*.xml")
.unwrap()
.map(Result::unwrap)
.collect();
paths.sort();
let mut memories = HashMap::new();
for f in paths {
// println!("Parsing {f:?}");
let file = fs::read_to_string(f)?;
let parsed: xml::Root = quick_xml::de::from_str(&file)?;
// dbg!(&parsed);
let device_id = parsed.device.device_id;
let mut ram = None;
let mut flash_size = None;
let mut flash_regions = vec![];
for mut peripheral in parsed.device.peripherals.peripharal {
if peripheral.name == "Embedded SRAM" && ram.is_none() {
let config = peripheral.configuration.first().unwrap();
let parameters = config.parameters.as_ref().unwrap();
ram = Some(Ram {
address: parameters.address,
bytes: parameters.size,
});
}
enum BlockKind {
Main,
Otp,
}
let kind = match peripheral.name.as_str() {
"Embedded Flash" => Some(BlockKind::Main),
"OTP" => Some(BlockKind::Otp),
_ => None,
};
if let Some(kind) = kind {
peripheral.configuration.sort_by(|a, b| {
// Prefer largest size
let ordering = b
.parameters
.as_ref()
.unwrap()
.size
.partial_cmp(&a.parameters.as_ref().unwrap().size)
.unwrap();
// ... then prefer single ordering over dual
if ordering == Ordering::Equal {
// Possible values are Single and Dual
b.organization.partial_cmp(&a.organization).unwrap()
} else {
ordering
}
});
let config = peripheral.configuration.first().unwrap();
if flash_size.is_none() {
let parameters = config.parameters.as_ref().unwrap();
flash_size = Some(parameters.size);
}
for bank in config.bank.iter() {
let flash_bank = match kind {
BlockKind::Main => match bank.name.as_deref() {
Some("Bank 1") => Some(FlashBank::Bank1),
Some("Bank 2") => Some(FlashBank::Bank2),
Some("EEPROM1") => None,
Some("EEPROM2") => None,
None => {
assert_eq!(1, config.bank.len());
Some(FlashBank::Bank1)
}
Some(other) => unimplemented!("Unsupported flash bank {}", other),
},
BlockKind::Otp => Some(FlashBank::Otp),
};
if let Some(flash_bank) = flash_bank {
let erase_value = peripheral.erased_value.unwrap();
let write_size = config.allignement.unwrap();
flash_regions.extend(bank.field.iter().map(|field| FlashRegion {
bank: flash_bank,
address: field.parameters.address,
bytes: field.parameters.occurence.unwrap() * field.parameters.size,
settings: stm32_data_serde::chip::memory::Settings {
erase_value,
write_size,
erase_size: field.parameters.size,
},
}));
}
}
}
}
memories.insert(
device_id,
Memory {
device_id,
ram: ram.unwrap(),
flash_size: flash_size.unwrap_or_default(),
flash_regions,
macro_rules! mem {
($($name:ident $addr:literal $size:literal),*) => {
&[
$(
Mem {
name: stringify!($name),
address: $addr,
size: $size*1024,
},
);
}
)*
]
};
}
Ok(Self(memories))
#[rustfmt::skip]
static MEMS: RegexMap<&[Mem]> = RegexMap::new(&[
// C0. TODO: check
("STM32C01..4", mem!(BANK_1 0x08000000 16, SRAM 0x20000000 6)),
("STM32C01..6", mem!(BANK_1 0x08000000 32, SRAM 0x20000000 6)),
("STM32C03..4", mem!(BANK_1 0x08000000 16, SRAM 0x20000000 12)),
("STM32C03..6", mem!(BANK_1 0x08000000 32, SRAM 0x20000000 12)),
// F0. TODO: check
("STM32F0...C", mem!(BANK_1 0x08000000 256, SRAM 0x20000000 32)),
("STM32F0[35]..8", mem!(BANK_1 0x08000000 64, SRAM 0x20000000 8)),
("STM32F0[47]..6", mem!(BANK_1 0x08000000 32, SRAM 0x20000000 6)),
("STM32F03..4", mem!(BANK_1 0x08000000 16, SRAM 0x20000000 4)),
("STM32F03..6", mem!(BANK_1 0x08000000 32, SRAM 0x20000000 4)),
("STM32F04..4", mem!(BANK_1 0x08000000 16, SRAM 0x20000000 6)),
("STM32F05..4", mem!(BANK_1 0x08000000 16, SRAM 0x20000000 8)),
("STM32F05..6", mem!(BANK_1 0x08000000 32, SRAM 0x20000000 8)),
("STM32F07..8", mem!(BANK_1 0x08000000 64, SRAM 0x20000000 16)),
("STM32F07..B", mem!(BANK_1 0x08000000 128, SRAM 0x20000000 16)),
("STM32F09..B", mem!(BANK_1 0x08000000 128, SRAM 0x20000000 32)),
// F1. TODO: check
("STM32F1.[12].6", mem!(BANK_1 0x08000000 32, SRAM 0x20000000 6)),
("STM32F1.[12].8", mem!(BANK_1 0x08000000 64, SRAM 0x20000000 10)),
("STM32F1.[12].B", mem!(BANK_1 0x08000000 128, SRAM 0x20000000 16)),
("STM32F1.[57].B", mem!(BANK_1 0x08000000 128, SRAM 0x20000000 64)),
("STM32F1.[57].C", mem!(BANK_1 0x08000000 256, SRAM 0x20000000 64)),
("STM32F1.0.6", mem!(BANK_1 0x08000000 32, SRAM 0x20000000 4)),
("STM32F1.0.8", mem!(BANK_1 0x08000000 64, SRAM 0x20000000 8)),
("STM32F1.0.B", mem!(BANK_1 0x08000000 128, SRAM 0x20000000 8)),
("STM32F1.0.C", mem!(BANK_1 0x08000000 256, SRAM 0x20000000 24)),
("STM32F1.0.D", mem!(BANK_1 0x08000000 384, SRAM 0x20000000 32)),
("STM32F1.0.E", mem!(BANK_1 0x08000000 512, SRAM 0x20000000 32)),
("STM32F1.1.C", mem!(BANK_1 0x08000000 256, SRAM 0x20000000 32)),
("STM32F1.1.D", mem!(BANK_1 0x08000000 384, SRAM 0x20000000 48)),
("STM32F1.1.E", mem!(BANK_1 0x08000000 512, SRAM 0x20000000 48)),
("STM32F1.1.F", mem!(BANK_1 0x08000000 512, BANK_2 0x08080000 256, SRAM 0x20000000 80)),
("STM32F1.1.G", mem!(BANK_1 0x08000000 512, BANK_2 0x08080000 512, SRAM 0x20000000 80)),
("STM32F1.3.6", mem!(BANK_1 0x08000000 32, SRAM 0x20000000 10)),
("STM32F1.3.8", mem!(BANK_1 0x08000000 64, SRAM 0x20000000 20)),
("STM32F1.3.B", mem!(BANK_1 0x08000000 128, SRAM 0x20000000 20)),
("STM32F1.3.C", mem!(BANK_1 0x08000000 256, SRAM 0x20000000 48)),
("STM32F1.3.D", mem!(BANK_1 0x08000000 384, SRAM 0x20000000 64)),
("STM32F1.3.E", mem!(BANK_1 0x08000000 512, SRAM 0x20000000 64)),
("STM32F1.3.F", mem!(BANK_1 0x08000000 512, BANK_2 0x08080000 256, SRAM 0x20000000 96)),
("STM32F1.3.G", mem!(BANK_1 0x08000000 512, BANK_2 0x08080000 512, SRAM 0x20000000 96)),
("STM32F1.5.8", mem!(BANK_1 0x08000000 64, SRAM 0x20000000 64)),
("STM32F10[012].4", mem!(BANK_1 0x08000000 16, SRAM 0x20000000 4)),
("STM32F103.4", mem!(BANK_1 0x08000000 16, SRAM 0x20000000 6)),
// F2. TODO: check
("STM32F2...B", mem!(BANK_1 0x08000000 128, SRAM 0x20000000 64, SRAM2 0x2001c000 0)),
("STM32F2...E", mem!(BANK_1 0x08000000 512, SRAM 0x20000000 128, SRAM2 0x2001c000 0)),
("STM32F2...F", mem!(BANK_1 0x08000000 768, SRAM 0x20000000 128, SRAM2 0x2001c000 0)),
("STM32F2...G", mem!(BANK_1 0x08000000 1024, SRAM 0x20000000 128, SRAM2 0x2001c000 0)),
("STM32F2.5.C", mem!(BANK_1 0x08000000 256, SRAM 0x20000000 96, SRAM2 0x2001c000 0)),
("STM32F2.7.C", mem!(BANK_1 0x08000000 256, SRAM 0x20000000 128, SRAM2 0x2001c000 0)),
// F3. TODO: check
("STM32F3...4", mem!(BANK_1 0x08000000 16, SRAM 0x20000000 12)),
("STM32F3...D", mem!(BANK_1 0x08000000 384, SRAM 0x20000000 64)),
("STM32F3...E", mem!(BANK_1 0x08000000 512, SRAM 0x20000000 64)),
("STM32F3.[12].6", mem!(BANK_1 0x08000000 32, SRAM 0x20000000 16)),
("STM32F3.[34].6", mem!(BANK_1 0x08000000 32, SRAM 0x20000000 12)),
("STM32F3([17]..8|0[12].8)", mem!(BANK_1 0x08000000 64, SRAM 0x20000000 16)),
("STM32F3([23]..8|03.8)", mem!(BANK_1 0x08000000 64, SRAM 0x20000000 12)),
("STM32F3[05]..C", mem!(BANK_1 0x08000000 256, SRAM 0x20000000 40)),
("STM32F30..B", mem!(BANK_1 0x08000000 128, SRAM 0x20000000 32)),
("STM32F37..B", mem!(BANK_1 0x08000000 128, SRAM 0x20000000 24)),
("STM32F37..C", mem!(BANK_1 0x08000000 256, SRAM 0x20000000 32)),
// F4. TODO: check
("STM32F4...8", mem!(BANK_1 0x08000000 64, SRAM 0x20000000 32)),
("STM32F4...D", mem!(BANK_1 0x08000000 384, SRAM 0x20000000 64)),
("STM32F4...H", mem!(BANK_1 0x08000000 1536, SRAM 0x20000000 320, SRAM2 0x20040000 0)),
("STM32F4.[567].E", mem!(BANK_1 0x08000000 512, SRAM 0x20000000 128, SRAM2 0x2001c000 0)),
("STM32F4.1.C", mem!(BANK_1 0x08000000 256, SRAM 0x20000000 64)),
("STM32F4.1.E", mem!(BANK_1 0x08000000 512, SRAM 0x20000000 64)),
("STM32F4.2.E", mem!(BANK_1 0x08000000 512, SRAM 0x20000000 256)),
("STM32F4.6.C", mem!(BANK_1 0x08000000 256, SRAM 0x20000000 128, SRAM2 0x2001c000 0)),
("STM32F4(1[57].G|0..G)", mem!(BANK_1 0x08000000 1024, SRAM 0x20000000 128, SRAM2 0x2001c000 0)),
("STM32F4[23]..G", mem!(BANK_1 0x08000000 1024, SRAM 0x20000000 192, SRAM2 0x2001c000 0)),
("STM32F4[23]..I", mem!(BANK_1 0x08000000 1024, BANK_2 0x08100000 1024, SRAM 0x20000000 192, SRAM2 0x2001c000 0)),
("STM32F4[67]..G", mem!(BANK_1 0x08000000 1024, SRAM 0x20000000 320, SRAM2 0x20028000 0)),
("STM32F4[67]..I", mem!(BANK_1 0x08000000 1024, BANK_2 0x08100000 1024, SRAM 0x20000000 320, SRAM2 0x20028000 0)),
("STM32F40..B", mem!(BANK_1 0x08000000 128, SRAM 0x20000000 64)),
("STM32F41..B", mem!(BANK_1 0x08000000 128, SRAM 0x20000000 32)),
("STM32F412.G", mem!(BANK_1 0x08000000 1024, SRAM 0x20000000 256)),
("STM32F413.G", mem!(BANK_1 0x08000000 1024, SRAM 0x20000000 320, SRAM2 0x20040000 0)),
("STM32F429.E", mem!(BANK_1 0x08000000 512, SRAM 0x20000000 192, SRAM2 0x2001c000 0)),
("STM32F469.E", mem!(BANK_1 0x08000000 512, SRAM 0x20000000 320, SRAM2 0x20028000 0)),
// F7. TODO: check
("STM32F7...C", mem!(BANK_1 0x08000000 256, SRAM 0x20010000 192, SRAM2 0x2003c000 0)),
("STM32F7...I", mem!(BANK_1 0x08000000 2048, SRAM 0x20020000 384, SRAM2 0x2007c000 0)),
("STM32F7[23]..E", mem!(BANK_1 0x08000000 512, SRAM 0x20010000 192, SRAM2 0x2003c000 0)),
("STM32F7[45]..G", mem!(BANK_1 0x08000000 1024, SRAM 0x20010000 320, SRAM2 0x2004c000 0)),
("STM32F73..8", mem!(BANK_1 0x08000000 64, SRAM 0x20010000 192, SRAM2 0x2003c000 0)),
("STM32F74..E", mem!(BANK_1 0x08000000 512, SRAM 0x20010000 320, SRAM2 0x2004c000 0)),
("STM32F75..8", mem!(BANK_1 0x08000000 64, SRAM 0x20010000 320, SRAM2 0x2004c000 0)),
("STM32F76..G", mem!(BANK_1 0x08000000 1024, SRAM 0x20020000 384, SRAM2 0x2007c000 0)),
// G0. TODO: check
("STM32G0...4", mem!(BANK_1 0x08000000 16, SRAM 0x20000000 8)),
("STM32G0...C", mem!(BANK_1 0x08000000 256, SRAM 0x20000000 128)),
("STM32G0...E", mem!(BANK_1 0x08000000 256, BANK_2 0x08040000 256, SRAM 0x20000000 128)),
("STM32G0[34]..[68]", mem!(BANK_1 0x08000000 32, SRAM 0x20000000 8)),
("STM32G0[56]..6", mem!(BANK_1 0x08000000 32, SRAM 0x20000000 16)),
("STM32G0[56]..8", mem!(BANK_1 0x08000000 64, SRAM 0x20000000 16)),
("STM32G0[78]..B", mem!(BANK_1 0x08000000 128, SRAM 0x20000000 32)),
("STM32G07..6", mem!(BANK_1 0x08000000 32, SRAM 0x20000000 32)),
("STM32G07..8", mem!(BANK_1 0x08000000 64, SRAM 0x20000000 32)),
("STM32G0B..B", mem!(BANK_1 0x08000000 128, SRAM 0x20000000 128)),
// G4. TODO: check
("STM32G4...6", mem!(BANK_1 0x08000000 32, SRAM 0x20000000 20, SRAM2 0x20004000 0)),
("STM32G4...8", mem!(BANK_1 0x08000000 64, SRAM 0x20000000 20, SRAM2 0x20004000 0)),
("STM32G4[34]..B", mem!(BANK_1 0x08000000 128, SRAM 0x20000000 20, SRAM2 0x20004000 0)),
("STM32G4[78]..E", mem!(BANK_1 0x08000000 512, SRAM 0x20000000 96, SRAM2 0x20014000 0)),
("STM32G4[9A]..E", mem!(BANK_1 0x08000000 512, SRAM 0x20000000 32, SRAM2 0x20014000 0)),
("STM32G47..B", mem!(BANK_1 0x08000000 128, SRAM 0x20000000 96, SRAM2 0x20014000 0)),
("STM32G47..C", mem!(BANK_1 0x08000000 256, SRAM 0x20000000 96, SRAM2 0x20014000 0)),
("STM32G49..C", mem!(BANK_1 0x08000000 256, SRAM 0x20000000 32, SRAM2 0x20014000 0)),
// H5. TODO: check
("STM32H5...B", mem!(BANK_1 0x08000000 64, BANK_2 0x08010000 64, SRAM 0x20000000 32, SRAM2 0x20004000 0)),
("STM32H5...G", mem!(BANK_1 0x08000000 1024, SRAM 0x20000000 256, SRAM2 0x20040000 0)),
("STM32H5...I", mem!(BANK_1 0x08000000 1024, BANK_2 0x08100000 1024, SRAM 0x20000000 256, SRAM2 0x20040000 0)),
// H7. TODO: check
("STM32H7...E", mem!(BANK_1 0x08000000 512, SRAM 0x24000000 128)),
("STM32H7[23]..G", mem!(BANK_1 0x08000000 1024, SRAM 0x24000000 128)),
("STM32H7[45]..I", mem!(BANK_1 0x08000000 1024, BANK_2 0x08100000 1024, SRAM 0x24000000 512)),
("STM32H7[AB]..I", mem!(BANK_1 0x08000000 1024, BANK_2 0x08100000 1024, SRAM 0x24000000 1024)),
("STM32H73..B", mem!(BANK_1 0x08000000 128, SRAM 0x24000000 128)),
("STM32H74..G", mem!(BANK_1 0x08000000 1024, SRAM 0x24000000 512)),
("STM32H75..B", mem!(BANK_1 0x08000000 128, SRAM 0x24000000 512)),
("STM32H7A..G", mem!(BANK_1 0x08000000 1024, SRAM 0x24000000 1024)),
("STM32H7B..B", mem!(BANK_1 0x08000000 128, SRAM 0x24000000 1024)),
// L0. TODO: check
("STM32L0...3", mem!(BANK_1 0x08000000 8, SRAM 0x20000000 2)),
("STM32L0...6", mem!(BANK_1 0x08000000 32, SRAM 0x20000000 8)),
("STM32L0...B", mem!(BANK_1 0x08000000 128, SRAM 0x20000000 20)),
("STM32L0...Z", mem!(BANK_1 0x08000000 192, SRAM 0x20000000 20)),
("STM32L0[12]..4", mem!(BANK_1 0x08000000 16, SRAM 0x20000000 2)),
("STM32L0[156]..8", mem!(BANK_1 0x08000000 64, SRAM 0x20000000 8)),
("STM32L0[34]..4", mem!(BANK_1 0x08000000 16, SRAM 0x20000000 8)),
("STM32L0[78]..8", mem!(BANK_1 0x08000000 64, SRAM 0x20000000 20)),
// L1. TODO: check
("STM32L1...B", mem!(BANK_1 0x08000000 128, SRAM 0x20000000 10)),
("STM32L1...C..", mem!(BANK_1 0x08000000 192, BANK_2 0x08030000 64, SRAM 0x20000000 32)),
("STM32L1...D..", mem!(BANK_1 0x08000000 128, BANK_2 0x08040000 256, SRAM 0x20000000 80)),
("STM32L1...D", mem!(BANK_1 0x08000000 192, BANK_2 0x08030000 192, SRAM 0x20000000 48)),
("STM32L1...E", mem!(BANK_1 0x08000000 256, BANK_2 0x08040000 256, SRAM 0x20000000 80)),
("STM32L1(6.[RV]C|5.[CRUV]C)", mem!(BANK_1 0x08000000 256, SRAM 0x20000000 32)),
("STM32L1[56].[QZ]C", mem!(BANK_1 0x08000000 192, BANK_2 0x08030000 64, SRAM 0x20000000 32)),
("STM32L10..6..", mem!(BANK_1 0x08000000 32, SRAM 0x20000000 10)),
("STM32L10..6", mem!(BANK_1 0x08000000 32, SRAM 0x20000000 4)),
("STM32L10..8..", mem!(BANK_1 0x08000000 64, SRAM 0x20000000 10)),
("STM32L10..8", mem!(BANK_1 0x08000000 64, SRAM 0x20000000 8)),
("STM32L10..B..", mem!(BANK_1 0x08000000 128, SRAM 0x20000000 10)),
("STM32L10..C", mem!(BANK_1 0x08000000 256, SRAM 0x20000000 16)),
("STM32L15..6..", mem!(BANK_1 0x08000000 32, SRAM 0x20000000 16)),
("STM32L15..6", mem!(BANK_1 0x08000000 32, SRAM 0x20000000 10)),
("STM32L15..8..", mem!(BANK_1 0x08000000 64, SRAM 0x20000000 16)),
("STM32L15..8", mem!(BANK_1 0x08000000 64, SRAM 0x20000000 10)),
("STM32L15..B..", mem!(BANK_1 0x08000000 128, SRAM 0x20000000 16)),
// L4. TODO: check
("STM32L4...8", mem!(BANK_1 0x08000000 64, SRAM 0x20000000 40)),
("STM32L4...I", mem!(BANK_1 0x08000000 2048, SRAM 0x20000000 192)),
("STM32L4[12]..B", mem!(BANK_1 0x08000000 128, SRAM 0x20000000 40)),
("STM32L4[34]..C", mem!(BANK_1 0x08000000 256, SRAM 0x20000000 48)),
("STM32L4[56]..E", mem!(BANK_1 0x08000000 512, SRAM 0x20000000 128)),
("STM32L4[78]..G", mem!(BANK_1 0x08000000 512, BANK_2 0x08080000 512, SRAM 0x20000000 96)),
("STM32L4[9A]..G", mem!(BANK_1 0x08000000 512, BANK_2 0x08080000 512, SRAM 0x20000000 256)),
("STM32L43..B", mem!(BANK_1 0x08000000 128, SRAM 0x20000000 48)),
("STM32L45..C", mem!(BANK_1 0x08000000 256, SRAM 0x20000000 128)),
("STM32L47..C", mem!(BANK_1 0x08000000 256, SRAM 0x20000000 96)),
("STM32L47..E", mem!(BANK_1 0x08000000 512, SRAM 0x20000000 96)),
("STM32L49..E", mem!(BANK_1 0x08000000 512, SRAM 0x20000000 256)),
// L4+. TODO: check
("STM32L4[PQR]..G", mem!(BANK_1 0x08000000 1024, SRAM 0x20000000 192)),
("STM32L4P..E", mem!(BANK_1 0x08000000 512, SRAM 0x20000000 192)),
// L5. TODO: check
("STM32L5...C", mem!(BANK_1 0x08000000 256, SRAM 0x20000000 256, SRAM2 0x20030000 0)),
("STM32L5...E", mem!(BANK_1 0x08000000 512, SRAM 0x20000000 256, SRAM2 0x20030000 0)),
// U0
("STM32U031.4", mem!(BANK_1 0x08000000 16, SRAM 0x20000000 12)),
("STM32U031.6", mem!(BANK_1 0x08000000 32, SRAM 0x20000000 12)),
("STM32U031.8", mem!(BANK_1 0x08000000 64, SRAM 0x20000000 12)),
("STM32U0[78]3.8", mem!(BANK_1 0x08000000 64, SRAM 0x20000000 40)),
("STM32U0[78]3.B", mem!(BANK_1 0x08000000 128, SRAM 0x20000000 40)),
("STM32U0[78]3.C", mem!(BANK_1 0x08000000 256, SRAM 0x20000000 40)),
// U5
("STM32U5[34]..B", mem!(BANK_1 0x08000000 64, BANK_2 0x08010000 64, SRAM 0x20000000 192, SRAM2 0x20030000 64)),
("STM32U5[34]..C", mem!(BANK_1 0x08000000 128, BANK_2 0x08020000 128, SRAM 0x20000000 192, SRAM2 0x20030000 64)),
("STM32U5[43]..E", mem!(BANK_1 0x08000000 256, BANK_2 0x08040000 256, SRAM 0x20000000 192, SRAM2 0x20030000 64)),
("STM32U5[78]..G", mem!(BANK_1 0x08000000 512, BANK_2 0x08080000 512, SRAM 0x20000000 192, SRAM2 0x20030000 64, SRAM3 0x20040000 512)),
("STM32U5[78]..I", mem!(BANK_1 0x08000000 1024, BANK_2 0x08100000 1024, SRAM 0x20000000 192, SRAM2 0x20030000 64, SRAM3 0x20040000 512)),
("STM32U5[9A]..I", mem!(BANK_1 0x08000000 1024, BANK_2 0x08100000 1024, SRAM 0x20000000 768, SRAM2 0x200c0000 64, SRAM3 0x200d0000 832, SRAM5 0x201a0000 832)),
("STM32U5[9A]..J", mem!(BANK_1 0x08000000 2048, BANK_2 0x08200000 2048, SRAM 0x20000000 768, SRAM2 0x200c0000 64, SRAM3 0x200d0000 832, SRAM5 0x201a0000 832)),
("STM32U5[FG]..J", mem!(BANK_1 0x08000000 2048, BANK_2 0x08200000 2048, SRAM 0x20000000 768, SRAM2 0x200c0000 64, SRAM3 0x200d0000 832, SRAM5 0x201a0000 832, SRAM6 0x20270000 512)),
// WB. TODO: check
("STM32WB...Y", mem!(BANK_1 0x08000000 640, SRAM 0x20000000 192)),
("STM32WB.(0C|5V)G", mem!(BANK_1 0x08000000 1024, SRAM 0x20000000 128)),
("STM32WB.(5C|5R)G", mem!(BANK_1 0x08000000 1024, SRAM 0x20000000 192)),
("STM32WB1..C", mem!(BANK_1 0x08000000 320, SRAM 0x20000000 12)),
("STM32WB3..C", mem!(BANK_1 0x08000000 256, SRAM 0x20000000 96)),
("STM32WB3..E", mem!(BANK_1 0x08000000 512, SRAM 0x20000000 96)),
("STM32WB5..C", mem!(BANK_1 0x08000000 256, SRAM 0x20000000 128)),
("STM32WB5.[CR]E", mem!(BANK_1 0x08000000 512, SRAM 0x20000000 192)),
("STM32WB5.VE", mem!(BANK_1 0x08000000 512, SRAM 0x20000000 128)),
// WBA. TODO: check
("STM32WBA...E", mem!(BANK_1 0x08000000 512, SRAM 0x20000000 96, SRAM2 0x20010000 0)),
("STM32WBA...G", mem!(BANK_1 0x08000000 1024, SRAM 0x20000000 128, SRAM2 0x20010000 0)),
// WL. TODO: check
("STM32WL...8", mem!(BANK_1 0x08000000 64, SRAM 0x20000000 12, SRAM2 0x20008000 0)),
("STM32WL...B", mem!(BANK_1 0x08000000 128, SRAM 0x20000000 12, SRAM2 0x20008000 0)),
("STM32WL...C", mem!(BANK_1 0x08000000 256, SRAM 0x20000000 12, SRAM2 0x20008000 0)),
]);
struct FlashInfo {
write_size: u32,
erase_size: &'static [(u32, u32)],
erase_value: u8,
}
#[rustfmt::skip]
static FLASH_INFO: RegexMap<FlashInfo> = RegexMap::new(&[
("STM32C0.*", FlashInfo{ erase_value: 0xFF, write_size: 8, erase_size: &[( 2*1024, 0)] }),
("STM32F030.C", FlashInfo{ erase_value: 0xFF, write_size: 4, erase_size: &[( 2*1024, 0)] }),
("STM32F070.6", FlashInfo{ erase_value: 0xFF, write_size: 4, erase_size: &[( 1*1024, 0)] }),
("STM32F0[79].*", FlashInfo{ erase_value: 0xFF, write_size: 4, erase_size: &[( 2*1024, 0)] }),
("STM32F0.*", FlashInfo{ erase_value: 0xFF, write_size: 4, erase_size: &[( 1*1024, 0)] }),
("STM32F10[0123].[468B]", FlashInfo{ erase_value: 0xFF, write_size: 4, erase_size: &[( 1*1024, 0)] }),
("STM32F1.*", FlashInfo{ erase_value: 0xFF, write_size: 4, erase_size: &[( 2*1024, 0)] }),
("STM32F2.*", FlashInfo{ erase_value: 0xFF, write_size: 4, erase_size: &[( 16*1024, 4), (64*1024, 1), ( 128*1024, 0)] }),
("STM32F3.*", FlashInfo{ erase_value: 0xFF, write_size: 8, erase_size: &[( 2*1024, 0)] }),
("STM32F4.*", FlashInfo{ erase_value: 0xFF, write_size: 4, erase_size: &[( 16*1024, 4), (64*1024, 1), ( 128*1024, 0)] }),
("STM32F7[4567].*", FlashInfo{ erase_value: 0xFF, write_size: 16, erase_size: &[( 32*1024, 4), (128*1024, 1), ( 256*1024, 0)] }),
("STM32F7.*", FlashInfo{ erase_value: 0xFF, write_size: 16, erase_size: &[( 16*1024, 4), (64*1024, 1), ( 128*1024, 0)] }),
("STM32G0.*", FlashInfo{ erase_value: 0xFF, write_size: 8, erase_size: &[( 2*1024, 0)] }),
("STM32G4[78].*", FlashInfo{ erase_value: 0xFF, write_size: 8, erase_size: &[( 4*1024, 0)] }),
("STM32G4.*", FlashInfo{ erase_value: 0xFF, write_size: 8, erase_size: &[( 2*1024, 0)] }),
("STM32H5.*", FlashInfo{ erase_value: 0xFF, write_size: 16, erase_size: &[( 8*1024, 0)] }),
("STM32H7[AB].*", FlashInfo{ erase_value: 0xFF, write_size: 32, erase_size: &[( 8*1024, 0)] }),
("STM32H7.*", FlashInfo{ erase_value: 0xFF, write_size: 32, erase_size: &[(128*1024, 0)] }),
("STM32L4[PQRS].*", FlashInfo{ erase_value: 0xFF, write_size: 8, erase_size: &[( 8*1024, 0)] }),
("STM32L4.*", FlashInfo{ erase_value: 0xFF, write_size: 8, erase_size: &[( 2*1024, 0)] }),
("STM32L0.*", FlashInfo{ erase_value: 0x00, write_size: 4, erase_size: &[( 128, 0)] }),
("STM32L1.*", FlashInfo{ erase_value: 0x00, write_size: 4, erase_size: &[( 256, 0)] }),
("STM32L5.*", FlashInfo{ erase_value: 0xFF, write_size: 8, erase_size: &[( 4*1024, 0)] }),
("STM32U0.*", FlashInfo{ erase_value: 0xFF, write_size: 8, erase_size: &[( 2*1024, 0)] }),
("STM32U5[78].*", FlashInfo{ erase_value: 0xFF, write_size: 16, erase_size: &[( 8*1024, 0)] }),
("STM32U5.*", FlashInfo{ erase_value: 0xFF, write_size: 16, erase_size: &[( 16*1024, 0)] }),
("STM32WBA.*", FlashInfo{ erase_value: 0xFF, write_size: 16, erase_size: &[( 8*1024, 0)] }),
("STM32WB1.*", FlashInfo{ erase_value: 0x00, write_size: 8, erase_size: &[( 2*1024, 0)] }),
("STM32WB.*", FlashInfo{ erase_value: 0xFF, write_size: 8, erase_size: &[( 4*1024, 0)] }),
("STM32WL.*", FlashInfo{ erase_value: 0xFF, write_size: 8, erase_size: &[( 2*1024, 0)] }),
("STM32.*", FlashInfo{ erase_value: 0xFF, write_size: 8, erase_size: &[( 2*1024, 0)] }),
]);
struct RegexMap<T: 'static> {
map: &'static [(&'static str, T)],
}
impl<T: 'static> RegexMap<T> {
const fn new(map: &'static [(&'static str, T)]) -> Self {
Self { map }
}
pub fn get(&self, die: &str) -> &Memory {
assert!(die.starts_with("DIE"));
let device_id = u16::from_str_radix(&die[3..], 16).unwrap();
self.0.get(&device_id).unwrap()
fn get(&self, key: &str) -> Option<&T> {
for (k, v) in self.map {
if Regex::new(&format!("^{k}$")).unwrap().is_match(key) {
return Some(v);
}
}
None
}
}
pub fn get(chip: &str) -> Vec<Memory> {
let mems = *MEMS.get(chip).unwrap();
let flash = FLASH_INFO.get(chip).unwrap();
let mut res = Vec::new();
for mem in mems {
if mem.name.starts_with("BANK") {
if flash.erase_size.len() == 1 || mem.size <= flash.erase_size[0].0 * flash.erase_size[0].1 {
res.push(Memory {
name: mem.name.to_string(),
address: mem.address,
size: mem.size,
kind: memory::Kind::Flash,
settings: Some(Settings {
write_size: flash.write_size,
erase_size: flash.erase_size[0].0,
erase_value: flash.erase_value,
}),
});
} else {
let mut offs = 0;
for (i, &(erase_size, count)) in flash.erase_size.iter().enumerate() {
if offs >= mem.size {
break;
}
let left = mem.size - offs;
let mut size = left;
if i != flash.erase_size.len() - 1 {
size = size.min(erase_size * count);
}
res.push(Memory {
name: format!("{}_REGION_{}", mem.name, i + 1),
address: mem.address + offs,
size: size,
kind: memory::Kind::Flash,
settings: Some(Settings {
write_size: flash.write_size,
erase_size: erase_size,
erase_value: flash.erase_value,
}),
});
offs += size;
}
}
} else {
let mut kind = memory::Kind::Ram;
if mem.name.contains("FLASH") || mem.name.contains("AXIICP") {
kind = memory::Kind::Flash;
}
res.push(Memory {
name: mem.name.to_string(),
address: mem.address,
size: mem.size,
kind,
settings: None,
});
}
}
res.sort_by_key(|m| (m.address, m.name.clone()));
res
}

View File

@ -36,6 +36,7 @@ flavors = [
{ regex_feature = "stm32l1.*", target = "thumbv7m-none-eabi" },
{ regex_feature = "stm32l4.*", target = "thumbv7em-none-eabi" },
{ regex_feature = "stm32l5.*", target = "thumbv8m.main-none-eabihf" },
{ regex_feature = "stm32u0.*", target = "thumbv6m-none-eabi" },
{ regex_feature = "stm32u5.*", target = "thumbv8m.main-none-eabihf" },
{ regex_feature = "stm32wb.*", target = "thumbv7em-none-eabi" },
{ regex_feature = "stm32wl.*", target = "thumbv7em-none-eabi" },

View File

@ -0,0 +1,8 @@
transforms:
- !Rename
from: ^LPTIM1$
to: LPTIM
- !DeleteFieldsets
from: OR

57
transforms/LPTIM_v2b.yaml Normal file
View File

@ -0,0 +1,57 @@
transforms:
- !Rename
from: ^LPTIM1$
to: LPTIM_Adv
- !RenameRegisters
block: LPTIM_Adv
from: (.*)intput
to: ${1}input
- !Rename
from: (.*)intput
to: ${1}input
- !MakeBlock
blocks: ^LPTIM_Adv$
from: ^(.+)_output$
to_outer: Output
to_block: Output
to_inner: ${1}
- !MakeBlock
blocks: ^LPTIM_Adv$
from: ^(.+)_input$
to_outer: Input
to_block: Input
to_inner: ${1}
- !RenameFields
fieldset: CCR\d
from: CCR\d
to: CCR
- !MergeFieldsets
from: CCR\d
to: CCR
- !MakeRegisterArray
blocks: LPTIM_Adv
from: CCR\d
to: CCR
- !MakeFieldArray
fieldsets: CFGR2
from: (I[CN])\d(SEL)
to: $1$2
- !MakeFieldArray
fieldsets: CCMR\d
from: (.*)\d(.*)
to: $1$2
- !MakeFieldArray
fieldsets: (ISR|ICR|DIER).*
from: (.*)\d(.*)
to: $1$2