CH32V系列MCU简洁GPIO操作芯片复制
芯片复制/例输入代码" PA O0H ;" ,GPIOA_0位输出高电平
芯片复制//例输入代码" PA O0L; " ,GPIOA_0位输出低电平
芯片复制//例输入代码" PA I0 ;" ,读取GPIOA_0位的电平
#define PA ((GPIO_TypeDef *) ((((uint32_t)0x40000000) + 0x10000) + 0x0800)) //GPIOA定义层PA
#define PB ((GPIO_TypeDef *) ((((uint32_t)0x40000000) + 0x10000) + 0x0C00)) //GPIOB定义层PB
#define PC ((GPIO_TypeDef *) ((((uint32_t)0x40000000) + 0x10000) + 0x1000)) //GPIOC定义层PC
#define PD ((GPIO_TypeDef *) ((((uint32_t)0x40000000) + 0x10000) + 0x1400)) //GPIOD定义层PD
#define PE ((GPIO_TypeDef *) ((((uint32_t)0x40000000) + 0x10000) + 0x1800)) //GPIOE定义层PE
//例" PA O0H " GPIOA_0位输出高电平
//例" PA O0L " GPIOA_0位输出低电平
#define O0H ->BSHR=0x0001
#define O0L ->BCR=0x0001
#define O1H ->BSHR=0x0002
#define O1L ->BCR=0x0002
#define O2H ->BSHR=0x0004
#define O2L ->BCR=0x0004
#define O3H ->BSHR=0x0008
#define O3L ->BCR=0x0008
#define O4H ->BSHR=0x0010
#define O4L ->BCR=0x0010
#define O5H ->BSHR=0x0020
#define O5L ->BCR=0x0020
#define O6H ->BSHR=0x0040
#define O6L ->BCR=0x0040
#define O7H ->BSHR=0x0080
#define O7L ->BCR=0x0080
#define O8H ->BSHR=0x0100
#define O8L ->BCR=0x0100
#define O9H ->BSHR=0x0200
#define O9L ->BCR=0x0200
#define O10H ->BSHR=0x0400
#define O10L ->BCR=0x0400
#define O11H ->BSHR=0x0800
#define O11L ->BCR=0x0800
#define O12H ->BSHR=0x1000
#define O12L ->BCR=0x1000
#define O13H ->BSHR=0x2000
#define O13L ->BCR=0x2000
#define O14H ->BSHR=0x4000
#define O14L ->BCR=0x4000
#define O15H ->BSHR=0x8000
#define O15L ->BCR=0x8000

芯片解密