Skip to content

Commit

Permalink
feat: timer v3
Browse files Browse the repository at this point in the history
  • Loading branch information
andelf committed May 4, 2024
1 parent 668a26b commit bf0892d
Show file tree
Hide file tree
Showing 7 changed files with 1,239 additions and 111 deletions.
121 changes: 39 additions & 82 deletions data/peripherals/FV2x_V3x_ADV_TIM1.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
- name: TIM1
address: 0x40012C00
registers:
kind: adtm
kind: timer
version: v3
block: ADTM
rcc:
Expand All @@ -18,87 +18,44 @@
field: TIM1_RM
pins:
# 00:默认映射(ETR/PA12,CH1/PA8,CH2/PA9, CH3/PA10,CH4/PA11,BKIN/PB12,CH1N/PB13, CH2N/PB14,CH3N/PB15);
- pin: PA12
signal: ETR
remap: 0b00
- pin: PA8
signal: CH1
remap: 0b00
- pin: PA9
signal: CH2
remap: 0b00
- pin: PA10
signal: CH3
remap: 0b00
- pin: PA11
signal: CH4
remap: 0b00
- pin: PB12
signal: BKIN
remap: 0b00
- pin: PB13
signal: CH1N
remap: 0b00
- pin: PB14
signal: CH2N
remap: 0b00
- pin: PB15
signal: CH3N
remap: 0b00
- { pin: "PA12", signal: "ETR", remap: 0b00 }
- { pin: "PA8", signal: "CH1", remap: 0b00 }
- { pin: "PA9", signal: "CH2", remap: 0b00 }
- { pin: "PA10", signal: "CH3", remap: 0b00 }
- { pin: "PA11", signal: "CH4", remap: 0b00 }
- { pin: "PB12", signal: "BKIN", remap: 0b00 }
- { pin: "PB13", signal: "CH1N", remap: 0b00 }
- { pin: "PB14", signal: "CH2N", remap: 0b00 }
- { pin: "PB15", signal: "CH3N", remap: 0b00 }
# 01:部分映射(ETR/PA12,CH1/PA8,CH2/PA9, CH3/PA10,CH4/PA11,BKIN/PA6,CH1N/PA7, CH2N/PB0,CH3N/PB1);
- pin: PA12
signal: ETR
remap: 0b01
- pin: PA8
signal: CH1
remap: 0b01
- pin: PA9
signal: CH2
remap: 0b01
- pin: PA10
signal: CH3
remap: 0b01
- pin: PA11
signal: CH4
remap: 0b01
- pin: PA6
signal: BKIN
remap: 0b01
- pin: PA7
signal: CH1N
remap: 0b01
- pin: PB0
signal: CH2N
remap: 0b01
- pin: PB1
signal: CH3N
remap: 0b01
- { pin: "PA12", signal: "ETR", remap: 0b01 }
- { pin: "PA8", signal: "CH1", remap: 0b01 }
- { pin: "PA9", signal: "CH2", remap: 0b01 }
- { pin: "PA10", signal: "CH3", remap: 0b01 }
- { pin: "PA11", signal: "CH4", remap: 0b01 }
- { pin: "PA6", signal: "BKIN", remap: 0b01 }
- { pin: "PA7", signal: "CH1N", remap: 0b01 }
- { pin: "PB0", signal: "CH2N", remap: 0b01 }
- { pin: "PB1", signal: "CH3N", remap: 0b01 }
# 10:保留;
# 11:完全映射(ETR/PE7,CH1/PE9,CH2/PE11, CH3/PE13,CH4/PE14,BKIN/PE15,CH1N/PE8, CH2N/PE10,CH3N/PE12)。
- pin: PE7
signal: ETR
remap: 0b11
- pin: PE9
signal: CH1
remap: 0b11
- pin: PE11
signal: CH2
remap: 0b11
- pin: PE13
signal: CH3
remap: 0b11
- pin: PE14
signal: CH4
remap: 0b11
- pin: PE15
signal: BKIN
remap: 0b11
- pin: PE8
signal: CH1N
remap: 0b11
- pin: PE10
signal: CH2N
remap: 0b11
- pin: PE12
signal: CH3N
remap: 0b11
- { pin: "PE7", signal: "ETR", remap: 0b11 }
- { pin: "PE9", signal: "CH1", remap: 0b11 }
- { pin: "PE11", signal: "CH2", remap: 0b11 }
- { pin: "PE13", signal: "CH3", remap: 0b11 }
- { pin: "PE14", signal: "CH4", remap: 0b11 }
- { pin: "PE15", signal: "BKIN", remap: 0b11 }
- { pin: "PE8", signal: "CH1N", remap: 0b11 }
- { pin: "PE10", signal: "CH2N", remap: 0b11 }
- { pin: "PE12", signal: "CH3N", remap: 0b11 }
interrupts:
- signal: BRK
interrupt: TIM1_BRK
- signal: UP
interrupt: TIM1_UP
- signal: TRG
interrupt: TIM1_TRG_COM
- signal: COM
interrupt: TIM1_TRG_COM
- signal: CC
interrupt: TIM1_CC
166 changes: 155 additions & 11 deletions data/peripherals/FV2x_V3x_ADV_TIM8910.yaml
Original file line number Diff line number Diff line change
@@ -1,28 +1,172 @@
- name: TIM8
address: 0x40013400
registers:
kind: adtm
kind: timer
version: v3
block: ADTM
# 0:默认映射(ETR/PA0,CH1/PC6,CH2/PC7, CH3/PC8 , CH4/PC9 , BKIN/PA6 , CH1N/PA7 , CH2N/PB0,CH3N/PB1);
# 1:重映射(ETR/PA0,CH1/PB6,CH2/PB7, CH3/PB8,CH4/PC13,BKIN/PB9,CH1N/PA13, CH2N/PA14,CH3N/PA15);
rcc:
bus_clock: PCLK2
kernel_clock: PCLK2
enable:
register: APB2PCENR
field: TIM8EN
reset:
register: APB2PRSTR
field: TIM8RST
remap:
register: PCFR2
field: TIM8_RM
pins:
# 0:默认映射(ETR/PA0,CH1/PC6,CH2/PC7, CH3/PC8 , CH4/PC9 , BKIN/PA6 , CH1N/PA7 , CH2N/PB0,CH3N/PB1);
- { pin: "PA0", signal: "ETR", remap: 0b0 }
- { pin: "PC6", signal: "CH1", remap: 0b0 }
- { pin: "PC7", signal: "CH2", remap: 0b0 }
- { pin: "PC8", signal: "CH3", remap: 0b0 }
- { pin: "PC9", signal: "CH4", remap: 0b0 }
- { pin: "PA6", signal: "BKIN", remap: 0b0 }
- { pin: "PA7", signal: "CH1N", remap: 0b0 }
- { pin: "PB0", signal: "CH2N", remap: 0b0 }
- { pin: "PB1", signal: "CH3N", remap: 0b0 }
# 1:重映射(ETR/PA0,CH1/PB6,CH2/PB7, CH3/PB8,CH4/PC13,BKIN/PB9,CH1N/PA13, CH2N/PA14,CH3N/PA15);
- { pin: "PA0", signal: "ETR", remap: 0b1 }
- { pin: "PB6", signal: "CH1", remap: 0b1 }
- { pin: "PB7", signal: "CH2", remap: 0b1 }
- { pin: "PB8", signal: "CH3", remap: 0b1 }
- { pin: "PC13", signal: "CH4", remap: 0b1 }
- { pin: "PB9", signal: "BKIN", remap: 0b1 }
- { pin: "PA13", signal: "CH1N", remap: 0b1 }
- { pin: "PA14", signal: "CH2N", remap: 0b1 }
- { pin: "PA15", signal: "CH3N", remap: 0b1 }
interrupts:
- signal: BRK
interrupt: TIM8_BRK
- signal: UP
interrupt: TIM8_UP
- signal: TRG
interrupt: TIM8_TRG_COM
- signal: COM
interrupt: TIM8_TRG_COM
- signal: CC
interrupt: TIM8_CC

- name: TIM9
address: 0x40014C00
registers:
kind: adtm
kind: timer
version: v3
block: ADTM
# 00:默认映射(ETR/PA2,CH1/PA2,CH2/PA3, CH3/PA4 , CH4/PC4 , BKIN/PC5 , CH1N/PC0 , CH2N/PC1,CH3N/PC2);
# 01:部分映射(ETR/PA2,CH1/PA2,CH2/PA3, CH3/PA4,CH4/PC14,BKIN/PA1,CH1N/PB0, CH2N/PB1,CH3N/PB2);
# 1x:完全映射(ETR/PD9,CH1/PD9,CH2/PD11, CH3/PD13,CH4/PD15,BKIN/PD14,CH1N/PD8, CH2N/PD10,CH3N/PD12)。
rcc:
bus_clock: PCLK2
kernel_clock: PCLK2
enable:
register: APB2PCENR
field: TIM9EN
reset:
register: APB2PRSTR
field: TIM9RST
remap:
register: PCFR2
field: TIM9_RM
pins:
# 00:默认映射(ETR/PA2,CH1/PA2,CH2/PA3, CH3/PA4 , CH4/PC4 , BKIN/PC5 , CH1N/PC0 , CH2N/PC1,CH3N/PC2);
- { pin: "PA2", signal: "ETR", remap: 0b00 }
- { pin: "PA2", signal: "CH1", remap: 0b00 }
- { pin: "PA3", signal: "CH2", remap: 0b00 }
- { pin: "PA4", signal: "CH3", remap: 0b00 }
- { pin: "PC4", signal: "CH4", remap: 0b00 }
- { pin: "PC5", signal: "BKIN", remap: 0b00 }
- { pin: "PC0", signal: "CH1N", remap: 0b00 }
- { pin: "PC1", signal: "CH2N", remap: 0b00 }
- { pin: "PC2", signal: "CH3N", remap: 0b00 }
# 01:部分映射(ETR/PA2,CH1/PA2,CH2/PA3, CH3/PA4,CH4/PC14,BKIN/PA1,CH1N/PB0, CH2N/PB1,CH3N/PB2);
- { pin: "PA2", signal: "ETR", remap: 0b01 }
- { pin: "PA2", signal: "CH1", remap: 0b01 }
- { pin: "PA3", signal: "CH2", remap: 0b01 }
- { pin: "PA4", signal: "CH3", remap: 0b01 }
- { pin: "PC14", signal: "CH4", remap: 0b01 }
- { pin: "PA1", signal: "BKIN", remap: 0b01 }
- { pin: "PB0", signal: "CH1N", remap: 0b01 }
- { pin: "PB1", signal: "CH2N", remap: 0b01 }
- { pin: "PB2", signal: "CH3N", remap: 0b01 }
# 1x:完全映射(ETR/PD9,CH1/PD9,CH2/PD11, CH3/PD13,CH4/PD15,BKIN/PD14,CH1N/PD8, CH2N/PD10,CH3N/PD12)。
- { pin: "PD9", signal: "ETR", remap: 0b10 }
- { pin: "PD9", signal: "CH1", remap: 0b10 }
- { pin: "PD11", signal: "CH2", remap: 0b10 }
- { pin: "PD13", signal: "CH3", remap: 0b10 }
- { pin: "PD15", signal: "CH4", remap: 0b10 }
- { pin: "PD14", signal: "BKIN", remap: 0b10 }
- { pin: "PD8", signal: "CH1N", remap: 0b10 }
- { pin: "PD10", signal: "CH2N", remap: 0b10 }
- { pin: "PD12", signal: "CH3N", remap: 0b10 }
interrupts:
- signal: BRK
interrupt: TIM9_BRK
- signal: UP
interrupt: TIM9_UP
- signal: TRG
interrupt: TIM9_TRG_COM
- signal: COM
interrupt: TIM9_TRG_COM
- signal: CC
interrupt: TIM9_CC

- name: TIM10
address: 0x40015000
registers:
kind: adtm
kind: timer
version: v3
block: ADTM
# 00:默认映射(ETR/PC10,CH1/PB8,CH2/PB9, CH3/PC3,CH4/PC11,BKIN/PC12,CH1N/PA12, CH2N/PA13,CH3N/PA14);
# 01:部分映射(ETR/PB11,CH1/PB3,CH2/PB4, CH3/PB5,CH4/PC15,BKIN/PB10,CH1N/PA5, CH2N/PA6,CH3N/PA7);
# 1x:完全映射(ETR/PD0,CH1/PD1,CH2/PD3, CH3/PD5 , CH4/PD7 , BKIN/PE2 , CH1N/PE3 , CH2N/PE4,CH3N/PE5)
rcc:
bus_clock: PCLK2
kernel_clock: PCLK2
enable:
register: APB2PCENR
field: TIM10EN
reset:
register: APB2PRSTR
field: TIM10RST
remap:
register: PCFR2
field: TIM10_RM
pins:
# 00:默认映射(ETR/PC10,CH1/PB8,CH2/PB9, CH3/PC3,CH4/PC11,BKIN/PC12,CH1N/PA12, CH2N/PA13,CH3N/PA14);
- { pin: "PC10", signal: "ETR", remap: 0b00 }
- { pin: "PB8", signal: "CH1", remap: 0b00 }
- { pin: "PB9", signal: "CH2", remap: 0b00 }
- { pin: "PC3", signal: "CH3", remap: 0b00 }
- { pin: "PC11", signal: "CH4", remap: 0b00 }
- { pin: "PC12", signal: "BKIN", remap: 0b00 }
- { pin: "PA12", signal: "CH1N", remap: 0b00 }
- { pin: "PA13", signal: "CH2N", remap: 0b00 }
- { pin: "PA14", signal: "CH3N", remap: 0b00 }
# 01:部分映射(ETR/PB11,CH1/PB3,CH2/PB4, CH3/PB5,CH4/PC15,BKIN/PB10,CH1N/PA5, CH2N/PA6,CH3N/PA7);
- { pin: "PB11", signal: "ETR", remap: 0b01 }
- { pin: "PB3", signal: "CH1", remap: 0b01 }
- { pin: "PB4", signal: "CH2", remap: 0b01 }
- { pin: "PB5", signal: "CH3", remap: 0b01 }
- { pin: "PC15", signal: "CH4", remap: 0b01 }
- { pin: "PB10", signal: "BKIN", remap: 0b01 }
- { pin: "PA5", signal: "CH1N", remap: 0b01 }
- { pin: "PA6", signal: "CH2N", remap: 0b01 }
- { pin: "PA7", signal: "CH3N", remap: 0b01 }
# 1x:完全映射(ETR/PD0,CH1/PD1,CH2/PD3, CH3/PD5 , CH4/PD7 , BKIN/PE2 , CH1N/PE3 , CH2N/PE4,CH3N/PE5)
- { pin: "PD0", signal: "ETR", remap: 0b10 }
- { pin: "PD1", signal: "CH1", remap: 0b10 }
- { pin: "PD3", signal: "CH2", remap: 0b10 }
- { pin: "PD5", signal: "CH3", remap: 0b10 }
- { pin: "PD7", signal: "CH4", remap: 0b10 }
- { pin: "PE2", signal: "BKIN", remap: 0b10 }
- { pin: "PE3", signal: "CH1N", remap: 0b10 }
- { pin: "PE4", signal: "CH2N", remap: 0b10 }
- { pin: "PE5", signal: "CH3N", remap: 0b10 }
interrupts:
- signal: BRK
interrupt: TIM10_BRK
- signal: UP
interrupt: TIM10_UP
- signal: TRG
interrupt: TIM10_TRG_COM
- signal: COM
interrupt: TIM10_TRG_COM
- signal: CC
interrupt: TIM10_CC
32 changes: 30 additions & 2 deletions data/peripherals/FV2x_V3x_BASIC_TIM67.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,40 @@
# BCTM, Basic Timer 6 and 7
# Only Update interrupt is available

- name: TIM6
address: 0x40001000
registers:
kind: bctm
kind: timer
version: v3
block: BCTM
rcc:
bus_clock: PCLK1
kernel_clock: PCLK1
enable:
register: APB1PCENR
field: TIM6EN
reset:
register: APB1PRSTR
field: TIM6RST
interrupts:
- signal: UP
interrupt: TIM6

- name: TIM7
address: 0x40001400
registers:
kind: bctm
kind: timer
version: v3
block: BCTM
rcc:
bus_clock: PCLK1
kernel_clock: PCLK1
enable:
register: APB1PCENR
field: TIM7EN
reset:
register: APB1PRSTR
field: TIM7RST
interrupts:
- signal: UP
interrupt: TIM7
Loading

0 comments on commit bf0892d

Please sign in to comment.