Skip to content

Commit

Permalink
fix: tim1 pins
Browse files Browse the repository at this point in the history
  • Loading branch information
andelf committed May 5, 2024
1 parent 83cd2f0 commit 335300b
Show file tree
Hide file tree
Showing 19 changed files with 69 additions and 75 deletions.
3 changes: 2 additions & 1 deletion data/chips/CH32V103C6T6.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ cores:
- "../family/CH32V1.yaml"
- "../peripherals/FV2x_V3x_I2C1.yaml"
- "../peripherals/FV2x_V3x_SPI1.yaml"
- "../peripherals/V103_GP16_TIM23.yaml"
- "../peripherals/V1x_V2x_ADV_TIM1.yaml"
- "../peripherals/V1x_GP16_TIM23.yaml"
include_interrupts: "../interrupts/CH32V1.yaml"
include_dma_channels:
DMA1: "../dma/CH32V103.yaml"
Expand Down
1 change: 1 addition & 0 deletions data/chips/CH32V103C8T6.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ cores:
- "../peripherals/FV2x_V3x_I2C2.yaml"
- "../peripherals/FV2x_V3x_SPI1.yaml"
- "../peripherals/FV2x_V3x_SPI2.yaml"
- "../peripherals/V1x_V2x_ADV_TIM1.yaml"
- "../peripherals/FV2x_V3x_GP16_TIM234.yaml"
include_interrupts: "../interrupts/CH32V1.yaml"
include_dma_channels:
Expand Down
1 change: 1 addition & 0 deletions data/chips/CH32V103C8U6.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ cores:
- "../peripherals/FV2x_V3x_I2C2.yaml"
- "../peripherals/FV2x_V3x_SPI1.yaml"
- "../peripherals/FV2x_V3x_SPI2.yaml"
- "../peripherals/V1x_V2x_ADV_TIM1.yaml"
- "../peripherals/FV2x_V3x_GP16_TIM234.yaml"
include_interrupts: "../interrupts/CH32V1.yaml"
include_dma_channels:
Expand Down
1 change: 1 addition & 0 deletions data/chips/CH32V103R8T6.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ cores:
- "../peripherals/FV2x_V3x_I2C2.yaml"
- "../peripherals/FV2x_V3x_SPI1.yaml"
- "../peripherals/FV2x_V3x_SPI2.yaml"
- "../peripherals/V1x_V2x_ADV_TIM1.yaml"
- "../peripherals/FV2x_V3x_GP16_TIM234.yaml"
include_interrupts: "../interrupts/CH32V1.yaml"
include_dma_channels:
Expand Down
2 changes: 1 addition & 1 deletion data/chips/CH32V203F6P6.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ cores:
include_peripherals:
- "../family/CH32V2.yaml"
- "../peripherals/FV2x_V3x_USART1.yaml"
- "../peripherals/FV2x_V3x_ADV_TIM1.yaml"
- "../peripherals/V1x_V2x_ADV_TIM1.yaml"
- "../peripherals/FV2x_V3x_GP16_TIM234.yaml"
- "../peripherals/FV2x_V3x_ADC1.yaml"
- "../peripherals/FV2x_V3x_ADC2.yaml"
Expand Down
2 changes: 1 addition & 1 deletion data/chips/CH32V203F8P6.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ cores:
- "../family/CH32V2.yaml"
- "../peripherals/FV2x_V3x_USART1.yaml"
- "../peripherals/FV2x_V3x_USART2.yaml"
- "../peripherals/FV2x_V3x_ADV_TIM1.yaml"
- "../peripherals/V1x_V2x_ADV_TIM1.yaml"
- "../peripherals/FV2x_V3x_GP16_TIM234.yaml"
- "../peripherals/FV2x_V3x_ADC1.yaml"
- "../peripherals/FV2x_V3x_ADC2.yaml"
Expand Down
2 changes: 1 addition & 1 deletion data/chips/CH32V203F8U6.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ cores:
- "../family/CH32V2.yaml"
- "../peripherals/FV2x_V3x_USART1.yaml"
- "../peripherals/FV2x_V3x_USART2.yaml"
- "../peripherals/FV2x_V3x_ADV_TIM1.yaml"
- "../peripherals/V1x_V2x_ADV_TIM1.yaml"
- "../peripherals/FV2x_V3x_GP16_TIM234.yaml"
- "../peripherals/FV2x_V3x_ADC1.yaml"
- "../peripherals/FV2x_V3x_ADC2.yaml"
Expand Down
2 changes: 1 addition & 1 deletion data/chips/CH32V203G6U6.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ cores:
- "../family/CH32V2.yaml"
- "../peripherals/FV2x_V3x_USART1.yaml"
- "../peripherals/FV2x_V3x_USART2.yaml"
- "../peripherals/FV2x_V3x_ADV_TIM1.yaml"
- "../peripherals/V1x_V2x_ADV_TIM1.yaml"
- "../peripherals/FV2x_V3x_GP16_TIM234.yaml"
- "../peripherals/FV2x_V3x_ADC1.yaml"
- "../peripherals/FV2x_V3x_ADC2.yaml"
Expand Down
2 changes: 1 addition & 1 deletion data/chips/CH32V203G8R6.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ cores:
- "../family/CH32V2.yaml"
- "../peripherals/FV2x_V3x_USART1.yaml"
- "../peripherals/FV2x_V3x_USART2.yaml"
- "../peripherals/FV2x_V3x_ADV_TIM1.yaml"
- "../peripherals/V1x_V2x_ADV_TIM1.yaml"
- "../peripherals/FV2x_V3x_GP16_TIM234.yaml"
- "../peripherals/FV2x_V3x_ADC1.yaml"
- "../peripherals/FV2x_V3x_ADC2.yaml"
Expand Down
2 changes: 1 addition & 1 deletion data/chips/CH32V203K6T6.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ cores:
- "../family/CH32V2.yaml"
- "../peripherals/FV2x_V3x_USART1.yaml"
- "../peripherals/FV2x_V3x_USART2.yaml"
- "../peripherals/FV2x_V3x_ADV_TIM1.yaml"
- "../peripherals/V1x_V2x_ADV_TIM1.yaml"
- "../peripherals/FV2x_V3x_GP16_TIM234.yaml"
- "../peripherals/FV2x_V3x_ADC1.yaml"
- "../peripherals/FV2x_V3x_ADC2.yaml"
Expand Down
2 changes: 1 addition & 1 deletion data/chips/CH32V203K8T6.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ cores:
- "../family/CH32V2.yaml"
- "../peripherals/FV2x_V3x_USART1.yaml"
- "../peripherals/FV2x_V3x_USART2.yaml"
- "../peripherals/FV2x_V3x_ADV_TIM1.yaml"
- "../peripherals/V1x_V2x_ADV_TIM1.yaml"
- "../peripherals/FV2x_V3x_GP16_TIM234.yaml"
- "../peripherals/FV2x_V3x_ADC1.yaml"
- "../peripherals/FV2x_V3x_ADC2.yaml"
Expand Down
2 changes: 1 addition & 1 deletion data/chips/CH32V203RBT6.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ cores:
- "../peripherals/FV2x_V3x_USART2.yaml"
- "../peripherals/FV2x_V3x_USART3.yaml"
- "../peripherals/FV2x_V3x_USART4.yaml"
- "../peripherals/FV2x_V3x_ADV_TIM1.yaml"
- "../peripherals/V1x_V2x_ADV_TIM1.yaml"
- "../peripherals/FV2x_V3x_GP16_TIM234.yaml"
- "../peripherals/FV2x_V3x_GP32_TIM5.yaml"
- "../peripherals/FV2x_V3x_ADC1.yaml"
Expand Down
2 changes: 1 addition & 1 deletion data/chips/CH32V208CBU6.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ cores:
- "../peripherals/FV2x_V3x_USART2.yaml"
- "../peripherals/FV2x_V3x_USART3.yaml"
- "../peripherals/FV2x_V3x_USART4.yaml"
- "../peripherals/FV2x_V3x_ADV_TIM1.yaml"
- "../peripherals/V1x_V2x_ADV_TIM1.yaml"
- "../peripherals/FV2x_V3x_GP16_TIM234.yaml"
- "../peripherals/FV2x_V3x_GP32_TIM5.yaml"
- "../peripherals/FV2x_V3x_ADC1.yaml"
Expand Down
2 changes: 1 addition & 1 deletion data/chips/CH32V208GBU6.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ cores:
- "../family/CH32V2.yaml"
- "../peripherals/FV2x_V3x_USART1.yaml"
- "../peripherals/FV2x_V3x_USART2.yaml"
- "../peripherals/FV2x_V3x_ADV_TIM1.yaml"
- "../peripherals/V1x_V2x_ADV_TIM1.yaml"
- "../peripherals/FV2x_V3x_GP16_TIM234.yaml"
- "../peripherals/FV2x_V3x_GP32_TIM5.yaml"
- "../peripherals/FV2x_V3x_ADC1.yaml"
Expand Down
2 changes: 1 addition & 1 deletion data/chips/CH32V208RBT6.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ cores:
- "../peripherals/FV2x_V3x_USART2.yaml"
- "../peripherals/FV2x_V3x_USART3.yaml"
- "../peripherals/FV2x_V3x_USART4.yaml"
- "../peripherals/FV2x_V3x_ADV_TIM1.yaml"
- "../peripherals/V1x_V2x_ADV_TIM1.yaml"
- "../peripherals/FV2x_V3x_GP16_TIM234.yaml"
- "../peripherals/FV2x_V3x_GP32_TIM5.yaml"
- "../peripherals/FV2x_V3x_ADC1.yaml"
Expand Down
2 changes: 1 addition & 1 deletion data/chips/CH32V208WBU6.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ cores:
- "../peripherals/FV2x_V3x_USART2.yaml"
- "../peripherals/FV2x_V3x_USART3.yaml"
- "../peripherals/FV2x_V3x_USART4.yaml"
- "../peripherals/FV2x_V3x_ADV_TIM1.yaml"
- "../peripherals/V1x_V2x_ADV_TIM1.yaml"
- "../peripherals/FV2x_V3x_GP16_TIM234.yaml"
- "../peripherals/FV2x_V3x_GP32_TIM5.yaml"
- "../peripherals/FV2x_V3x_ADC1.yaml"
Expand Down
62 changes: 0 additions & 62 deletions data/family/CH32V1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -369,65 +369,3 @@
signal: IN14
- pin: PC5
signal: IN15

- name: TIM1
address: 0x40012C00
registers:
kind: timer
version: v3
block: ADTM
rcc:
bus_clock: PCLK2
kernel_clock: PCLK2
enable:
register: APB2PCENR
field: TIM1EN
reset:
register: APB2PRSTR
field: TIM1RST
remap:
register: PCFR1
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 }
# 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 }
# 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 }
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
File renamed without changes.
52 changes: 52 additions & 0 deletions data/peripherals/V1x_V2x_ADV_TIM1.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# No GPIOE

- name: TIM1
address: 0x40012C00
registers:
kind: timer
version: v3
block: ADTM
rcc:
bus_clock: PCLK2
kernel_clock: PCLK2
enable:
register: APB2PCENR
field: TIM1EN
reset:
register: APB2PRSTR
field: TIM1RST
remap:
register: PCFR1
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 }
# 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 }
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

0 comments on commit 335300b

Please sign in to comment.