Skip to content

Commit

Permalink
fix: remove GPIOE remappings on ch32v20x USART4 & TIM1
Browse files Browse the repository at this point in the history
  • Loading branch information
marti157 authored and andelf committed May 10, 2024
1 parent 80fd465 commit 312cba6
Show file tree
Hide file tree
Showing 8 changed files with 47 additions and 9 deletions.
2 changes: 1 addition & 1 deletion data/chips/CH32V203C6T6.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
4 changes: 2 additions & 2 deletions data/chips/CH32V203C8T6.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ cores:
- "../peripherals/FV2x_V3x_USART1.yaml"
- "../peripherals/FV2x_V3x_USART2.yaml"
- "../peripherals/FV2x_V3x_USART3.yaml"
- "../peripherals/FV2x_V3x_USART4.yaml"
- "../peripherals/FV2x_V3x_ADV_TIM1.yaml"
- "../peripherals/V2x_USART4.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
4 changes: 2 additions & 2 deletions data/chips/CH32V203C8U6.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ cores:
- "../peripherals/FV2x_V3x_USART1.yaml"
- "../peripherals/FV2x_V3x_USART2.yaml"
- "../peripherals/FV2x_V3x_USART3.yaml"
- "../peripherals/FV2x_V3x_USART4.yaml"
- "../peripherals/FV2x_V3x_ADV_TIM1.yaml"
- "../peripherals/V2x_USART4.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 @@ -34,7 +34,7 @@ cores:
- "../peripherals/FV2x_V3x_USART1.yaml"
- "../peripherals/FV2x_V3x_USART2.yaml"
- "../peripherals/FV2x_V3x_USART3.yaml"
- "../peripherals/FV2x_V3x_USART4.yaml"
- "../peripherals/V2x_USART4.yaml"
- "../peripherals/V1x_V2x_ADV_TIM1.yaml"
- "../peripherals/FV2x_V3x_GP16_TIM234.yaml"
- "../peripherals/FV2x_V3x_GP32_TIM5.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 @@ -35,7 +35,7 @@ cores:
- "../peripherals/FV2x_V3x_USART1.yaml"
- "../peripherals/FV2x_V3x_USART2.yaml"
- "../peripherals/FV2x_V3x_USART3.yaml"
- "../peripherals/FV2x_V3x_USART4.yaml"
- "../peripherals/V2x_USART4.yaml"
- "../peripherals/V1x_V2x_ADV_TIM1.yaml"
- "../peripherals/FV2x_V3x_GP16_TIM234.yaml"
- "../peripherals/FV2x_V3x_GP32_TIM5.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 @@ -35,7 +35,7 @@ cores:
- "../peripherals/FV2x_V3x_USART1.yaml"
- "../peripherals/FV2x_V3x_USART2.yaml"
- "../peripherals/FV2x_V3x_USART3.yaml"
- "../peripherals/FV2x_V3x_USART4.yaml"
- "../peripherals/V2x_USART4.yaml"
- "../peripherals/V1x_V2x_ADV_TIM1.yaml"
- "../peripherals/FV2x_V3x_GP16_TIM234.yaml"
- "../peripherals/FV2x_V3x_GP32_TIM5.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 @@ -35,7 +35,7 @@ cores:
- "../peripherals/FV2x_V3x_USART1.yaml"
- "../peripherals/FV2x_V3x_USART2.yaml"
- "../peripherals/FV2x_V3x_USART3.yaml"
- "../peripherals/FV2x_V3x_USART4.yaml"
- "../peripherals/V2x_USART4.yaml"
- "../peripherals/V1x_V2x_ADV_TIM1.yaml"
- "../peripherals/FV2x_V3x_GP16_TIM234.yaml"
- "../peripherals/FV2x_V3x_GP32_TIM5.yaml"
Expand Down
38 changes: 38 additions & 0 deletions data/peripherals/V2x_USART4.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# No GPIOE

- name: USART4
address: 0x40004C00
registers:
kind: usart
version: common
block: USART
rcc:
bus_clock: PCLK1
kernel_clock: PCLK1
enable:
register: APB1PCENR
field: USART4EN
reset:
register: APB1PRSTR
field: USART4RST
interrupts:
- signal: GLOBAL
interrupt: UART4
remap:
register: PCFR2
field: USART4_RM
pins:
# 00:默认映射(TX/PC10,RX/PC11);
- pin: PC10
signal: TX
remap: 0b00
- pin: PC11
signal: RX
remap: 0b00
# 01:重映射(TX/PB0,RX/PB1);
- pin: PB0
signal: TX
remap: 0b01
- pin: PB1
signal: RX
remap: 0b01

0 comments on commit 312cba6

Please sign in to comment.