openwch / ch32v003

CH32V003 is an ultra-cheap RISC-V MCU with 2KB SRAM, 16KB flash, and up to 18 GPIOs that sells for under $0.10
393 stars 58 forks source link

LCKK bit of GPIOx_LCKR defined incorrectly in ch32v00x.h #22

Closed basilhussain closed 10 months ago

basilhussain commented 1 year ago

In the EVT/EXAM/SRC/Peripheral/inc/ch32v00x.h header, the GPIO_LCKK definition is incorrect for CH32V003 hardware. It is defined as being in bit 16, but it is actually in bit 8. Also, it thus follows that LCK8 through LCK15 do not exist.

I propose that the definitions for GPIO_LCK8 through GPIO_LCK15 are removed, and GPIO_LCKK is modified as follows:

#define GPIO_LCKK                               ((uint32_t)0x00000100) /* Lock key */
mrx23dot commented 1 year ago

also there is no GPIOx_CFGHR register mentioned in

"The locked configuration refers to the
configuration registers GPIOx_CFGLR and
GPIOx_CFGHR."

it's not clear if it locks level or just direction.
qiyongshuang commented 11 months ago

Thanks for your suggestion.we will fix it . image

mrx23dot commented 11 months ago

Thanks for your suggestion.we will fix it .

But does that include port level too AND direction too?

qiyongshuang commented 10 months ago

Please refer to the latest manual.