Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,7 @@ devices.soft_i2c:
- CONFIG_RT_SOFT_I2C2_SCL_PIN=32
- CONFIG_RT_SOFT_I2C2_SDA_PIN=33
- CONFIG_RT_SOFT_I2C2_BUS_NAME="swi2c2"

devices.pm:
kconfig:
- CONFIG_BSP_USING_PM=y
1 change: 1 addition & 0 deletions bsp/wch/risc-v/ch32v208w-r0/.config
Original file line number Diff line number Diff line change
Expand Up @@ -1468,6 +1468,7 @@ CONFIG_BSP_USING_UART1=y
# CONFIG_BSP_USING_DAC is not set
# CONFIG_BSP_USING_SOFT_I2C is not set
# CONFIG_BSP_USING_SPI is not set
# CONFIG_BSP_USING_PM is not set
# CONFIG_BSP_USING_RTC is not set
CONFIG_LSI_VALUE=40000
# CONFIG_BSP_USING_IWDT is not set
Expand Down
34 changes: 34 additions & 0 deletions bsp/wch/risc-v/ch32v208w-r0/board/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,40 @@ menu "On-chip Peripheral Drivers"
string
default "swspi2" if RT_USING_SOFT_SPI2

menuconfig BSP_USING_PM
bool "Enable CH32V208 power management"
select RT_USING_PM
depends on !BSP_USING_RTC
default n

if BSP_USING_PM
choice BSP_PM_RTC_CLK_SEL
prompt "PM RTC clock source"
default BSP_PM_USING_LSI

config BSP_PM_USING_LSI
bool "LSI (calibrated against HCLK)"

config BSP_PM_USING_LSE
bool "LSE (32.768 kHz crystal)"
endchoice

config BSP_PM_BOOT_DELAY
int "Delay before enabling STOP (seconds)"
range 0 60
default 10

config BSP_PM_PARK_UNUSED_GPIO
bool "Park unused GPIO as analog inputs and disable SWJ"
depends on BSP_PM_BOOT_DELAY >= 10
default n
help
Apply the PM measurement board's pin masks after the
reflash window. Keep PA0, UART1 and the crystal pins.
Adapt the masks before using other peripherals or GPIO
wake sources.
endif

config BSP_USING_RTC
bool "Enable RTC"
select RT_USING_RTC
Expand Down
3 changes: 3 additions & 0 deletions bsp/wch/risc-v/ch32v208w-r0/board/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ board.c
software_irq.c
''')

if GetDepend('BSP_USING_PM'):
src += ['drv_pm.c']

path = [cwd]

group = DefineGroup('Drivers', src, depend = [''], CPPPATH = path)
Expand Down
Loading
Loading