diff --git a/bsp/swm320/libraries/CMSIS/DeviceSupport/SWM320.h b/bsp/swm320/libraries/CMSIS/DeviceSupport/SWM320.h index 4ac927b7b9..423290614f 100644 --- a/bsp/swm320/libraries/CMSIS/DeviceSupport/SWM320.h +++ b/bsp/swm320/libraries/CMSIS/DeviceSupport/SWM320.h @@ -123,9 +123,9 @@ typedef struct { uint32_t RESERVED0[6]; - __IO uint32_t RTCBKP_ISO; //[0] 1 RTC备份电源域处于隔离状态 0 RTC备份电源域可访问 + __IO uint32_t RTCBKP_ISO; //[0] 1 RTC澶囦唤鐢垫簮鍩熷浜庨殧绂荤姸鎬 0 RTC澶囦唤鐢垫簮鍩熷彲璁块棶 - __IO uint32_t RTCWKEN; //[0] 1 使能RTC唤醒功能 + __IO uint32_t RTCWKEN; //[0] 1 浣胯兘RTC鍞ら啋鍔熻兘 uint32_t RESERVED[52+64]; @@ -135,7 +135,7 @@ typedef struct { uint32_t RESERVED2[1+4]; - __IO uint32_t PAWKSR; //Port A Wakeup Status Register,写1清零 + __IO uint32_t PAWKSR; //Port A Wakeup Status Register锛屽啓1娓呴浂 __IO uint32_t PBWKSR; __IO uint32_t PCWKSR; @@ -146,12 +146,12 @@ typedef struct { uint32_t RESERVED4[61+64]; - __IO uint32_t BKP[3]; //数据备份寄存器 + __IO uint32_t BKP[3]; //鏁版嵁澶囦唤瀵勫瓨鍣 //RTC Power Domain: 0x4001E000 uint32_t RESERVED5[(0x4001E000-0x40000508)/4-1]; - __IO uint32_t RTCBKP[8]; //RTC电源域数据备份寄存器 + __IO uint32_t RTCBKP[8]; //RTC鐢垫簮鍩熸暟鎹浠藉瘎瀛樺櫒 __IO uint32_t LRCCR; //Low speed RC Control Register __IO uint32_t LRCTRIM0; //Low speed RC Trim @@ -173,7 +173,7 @@ typedef struct { __IO uint32_t PLLCR; __IO uint32_t PLLDIV; __IO uint32_t PLLSET; - __IO uint32_t PLLLOCK; //[0] 1 PLL已锁定 + __IO uint32_t PLLLOCK; //[0] 1 PLL宸查攣瀹 __IO uint32_t BODIE; __IO uint32_t BODIF; @@ -186,16 +186,16 @@ typedef struct { #define SYS_CLKSEL_LFCK_Msk (0x01 << SYS_CLKSEL_LFCK_Pos) #define SYS_CLKSEL_HFCK_Pos 1 //High Frequency Clock Source 0 HRC 1 XTAL #define SYS_CLKSEL_HFCK_Msk (0x01 << SYS_CLKSEL_HFCK_Pos) -#define SYS_CLKSEL_SYS_Pos 2 //系统时钟选择 0 LFCK 1 HFCK +#define SYS_CLKSEL_SYS_Pos 2 //绯荤粺鏃堕挓閫夋嫨 0 LFCK 1 HFCK #define SYS_CLKSEL_SYS_Msk (0x01 << SYS_CLKSEL_SYS_Pos) -#define SYS_CLKDIV_SYS_Pos 0 //系统时钟分频 0 1分频 1 2分频 +#define SYS_CLKDIV_SYS_Pos 0 //绯荤粺鏃堕挓鍒嗛 0 1鍒嗛 1 2鍒嗛 #define SYS_CLKDIV_SYS_Msk (0x01 << SYS_CLKDIV_SYS_Pos) -#define SYS_CLKDIV_PWM_Pos 1 //PWM 时钟分频 0 1分频 1 8分频 +#define SYS_CLKDIV_PWM_Pos 1 //PWM 鏃堕挓鍒嗛 0 1鍒嗛 1 8鍒嗛 #define SYS_CLKDIV_PWM_Msk (0x01 << SYS_CLKDIV_PWM_Pos) -#define SYS_CLKDIV_SDRAM_Pos 2 //SDRAM时钟分频 0 1分频 1 2分频 2 4分频 +#define SYS_CLKDIV_SDRAM_Pos 2 //SDRAM鏃堕挓鍒嗛 0 1鍒嗛 1 2鍒嗛 2 4鍒嗛 #define SYS_CLKDIV_SDRAM_Msk (0x03 << SYS_CLKDIV_SDRAM_Pos) -#define SYS_CLKDIV_SDIO_Pos 4 //SDIO时钟分频 0 1分频 1 2分频 2 4分频 3 8分频 +#define SYS_CLKDIV_SDIO_Pos 4 //SDIO鏃堕挓鍒嗛 0 1鍒嗛 1 2鍒嗛 2 4鍒嗛 3 8鍒嗛 #define SYS_CLKDIV_SDIO_Msk (0x03 << SYS_CLKDIV_SDIO_Pos) #define SYS_CLKEN_GPIOA_Pos 0 @@ -240,7 +240,7 @@ typedef struct { #define SYS_CLKEN_LCD_Msk (0x01 << SYS_CLKEN_LCD_Pos) #define SYS_CLKEN_GPIOP_Pos 21 #define SYS_CLKEN_GPIOP_Msk (0x01 << SYS_CLKEN_GPIOP_Pos) -#define SYS_CLKEN_ANAC_Pos 22 //模拟控制单元时钟使能 +#define SYS_CLKEN_ANAC_Pos 22 //妯℃嫙鎺у埗鍗曞厓鏃堕挓浣胯兘 #define SYS_CLKEN_ANAC_Msk (0x01 << SYS_CLKEN_ANAC_Pos) #define SYS_CLKEN_CRC_Pos 23 #define SYS_CLKEN_CRC_Msk (0x01 << SYS_CLKEN_CRC_Pos) @@ -258,59 +258,59 @@ typedef struct { #define SYS_CLKEN_SDIO_Msk (0x01 << SYS_CLKEN_SDIO_Pos) #define SYS_CLKEN_ADC1_Pos 30 #define SYS_CLKEN_ADC1_Msk (0x01 << SYS_CLKEN_ADC1_Pos) -#define SYS_CLKEN_ALIVE_Pos 31 //CHIPALIVE电源域系统时钟使能 +#define SYS_CLKEN_ALIVE_Pos 31 //CHIPALIVE鐢垫簮鍩熺郴缁熸椂閽熶娇鑳 #define SYS_CLKEN_ALIVE_Msk (0x01 << SYS_CLKEN_ALIVE_Pos) -#define SYS_SLEEP_SLEEP_Pos 0 //将该位置1后,系统将进入SLEEP模式 +#define SYS_SLEEP_SLEEP_Pos 0 //灏嗚浣嶇疆1鍚庯紝绯荤粺灏嗚繘鍏LEEP妯″紡 #define SYS_SLEEP_SLEEP_Msk (0x01 << SYS_SLEEP_SLEEP_Pos) -#define SYS_SLEEP_DEEP_Pos 1 //将该位置1后,系统将进入STOP SLEEP模式 +#define SYS_SLEEP_DEEP_Pos 1 //灏嗚浣嶇疆1鍚庯紝绯荤粺灏嗚繘鍏TOP SLEEP妯″紡 #define SYS_SLEEP_DEEP_Msk (0x01 << SYS_SLEEP_DEEP_Pos) -#define SYS_RSTCR_SYS_Pos 0 //写1进行系统复位,硬件自动清零 +#define SYS_RSTCR_SYS_Pos 0 //鍐1杩涜绯荤粺澶嶄綅锛岀‖浠惰嚜鍔ㄦ竻闆 #define SYS_RSTCR_SYS_Msk (0x01 << SYS_RSTCR_SYS_Pos) -#define SYS_RSTCR_FLASH_Pos 1 //写1对FLASH控制器进行一次复位,硬件自动清零 +#define SYS_RSTCR_FLASH_Pos 1 //鍐1瀵笷LASH鎺у埗鍣ㄨ繘琛屼竴娆″浣嶏紝纭欢鑷姩娓呴浂 #define SYS_RSTCR_FLASH_Msk (0x01 << SYS_RSTCR_FLASH_Pos) -#define SYS_RSTCR_PWM_Pos 2 //写1对PWM进行一次复位,硬件自动清零 +#define SYS_RSTCR_PWM_Pos 2 //鍐1瀵筆WM杩涜涓娆″浣嶏紝纭欢鑷姩娓呴浂 #define SYS_RSTCR_PWM_Msk (0x01 << SYS_RSTCR_PWM_Pos) -#define SYS_RSTCR_CPU_Pos 3 //写1对CPU进行一次复位,硬件自动清零 +#define SYS_RSTCR_CPU_Pos 3 //鍐1瀵笴PU杩涜涓娆″浣嶏紝纭欢鑷姩娓呴浂 #define SYS_RSTCR_CPU_Msk (0x01 << SYS_RSTCR_CPU_Pos) -#define SYS_RSTCR_DMA_Pos 4 //写1对DMA进行一次复位,硬件自动清零 +#define SYS_RSTCR_DMA_Pos 4 //鍐1瀵笵MA杩涜涓娆″浣嶏紝纭欢鑷姩娓呴浂 #define SYS_RSTCR_DMA_Msk (0x01 << SYS_RSTCR_DMA_Pos) -#define SYS_RSTCR_NORFLASH_Pos 5 //写1对NOR Flash控制器进行一次复位,硬件自动清零 +#define SYS_RSTCR_NORFLASH_Pos 5 //鍐1瀵筃OR Flash鎺у埗鍣ㄨ繘琛屼竴娆″浣嶏紝纭欢鑷姩娓呴浂 #define SYS_RSTCR_NORFLASH_Msk (0x01 << SYS_RSTCR_NORFLASH_Pos) -#define SYS_RSTCR_SRAM_Pos 6 //写1对SRAM控制器进行一次复位,硬件自动清零 +#define SYS_RSTCR_SRAM_Pos 6 //鍐1瀵筍RAM鎺у埗鍣ㄨ繘琛屼竴娆″浣嶏紝纭欢鑷姩娓呴浂 #define SYS_RSTCR_SRAM_Msk (0x01 << SYS_RSTCR_SRAM_Pos) -#define SYS_RSTCR_SDRAM_Pos 7 //写1对SDRAM控制器进行一次复位,硬件自动清零 +#define SYS_RSTCR_SDRAM_Pos 7 //鍐1瀵筍DRAM鎺у埗鍣ㄨ繘琛屼竴娆″浣嶏紝纭欢鑷姩娓呴浂 #define SYS_RSTCR_SDRAM_Msk (0x01 << SYS_RSTCR_SDRAM_Pos) -#define SYS_RSTCR_SDIO_Pos 8 //写1对SDIO进行一次复位,硬件自动清零 +#define SYS_RSTCR_SDIO_Pos 8 //鍐1瀵筍DIO杩涜涓娆″浣嶏紝纭欢鑷姩娓呴浂 #define SYS_RSTCR_SDIO_Msk (0x01 << SYS_RSTCR_SDIO_Pos) -#define SYS_RSTCR_LCD_Pos 9 //写1对LCD进行一次复位,硬件自动清零 +#define SYS_RSTCR_LCD_Pos 9 //鍐1瀵筁CD杩涜涓娆″浣嶏紝纭欢鑷姩娓呴浂 #define SYS_RSTCR_LCD_Msk (0x01 << SYS_RSTCR_LCD_Pos) -#define SYS_RSTCR_CAN_Pos 10 //写1对CAN进行一次复位,硬件自动清零 +#define SYS_RSTCR_CAN_Pos 10 //鍐1瀵笴AN杩涜涓娆″浣嶏紝纭欢鑷姩娓呴浂 #define SYS_RSTCR_CAN_Msk (0x01 << SYS_RSTCR_CAN_Pos) -#define SYS_RSTSR_POR_Pos 0 //1 出现过POR复位,写1清零 +#define SYS_RSTSR_POR_Pos 0 //1 鍑虹幇杩嘝OR澶嶄綅锛屽啓1娓呴浂 #define SYS_RSTSR_POR_Msk (0x01 << SYS_RSTSR_POR_Pos) -#define SYS_RSTSR_BOD_Pos 1 //1 出现过BOD复位,写1清零 +#define SYS_RSTSR_BOD_Pos 1 //1 鍑虹幇杩嘊OD澶嶄綅锛屽啓1娓呴浂 #define SYS_RSTSR_BOD_Msk (0x01 << SYS_RSTSR_BOD_Pos) -#define SYS_RSTSR_PIN_Pos 2 //1 出现过外部引脚复位,写1清零 +#define SYS_RSTSR_PIN_Pos 2 //1 鍑虹幇杩囧閮ㄥ紩鑴氬浣嶏紝鍐1娓呴浂 #define SYS_RSTSR_PIN_Msk (0x01 << SYS_RSTSR_PIN_Pos) -#define SYS_RSTSR_WDT_Pos 3 //1 出现过WDT复位,写1清零 +#define SYS_RSTSR_WDT_Pos 3 //1 鍑虹幇杩嘩DT澶嶄綅锛屽啓1娓呴浂 #define SYS_RSTSR_WDT_Msk (0x01 << SYS_RSTSR_WDT_Pos) -#define SYS_RSTSR_SWRST_Pos 4 //Software Reset, 1 出现过软件复位,写1清零 +#define SYS_RSTSR_SWRST_Pos 4 //Software Reset, 1 鍑虹幇杩囪蒋浠跺浣嶏紝鍐1娓呴浂 #define SYS_RSTSR_SWRST_Msk (0x01 << SYS_RSTSR_SWRST_Pos) #define SYS_LRCCR_OFF_Pos 0 //Low Speed RC Off #define SYS_LRCCR_OFF_Msk (0x01 << SYS_LRCCR_OFF_Pos) -#define SYS_LRCTRIM0_R_Pos 0 //LRC粗调控制位 +#define SYS_LRCTRIM0_R_Pos 0 //LRC绮楄皟鎺у埗浣 #define SYS_LRCTRIM0_R_Msk (0x7FFF << SYS_LRCTRIM0_R_Pos) -#define SYS_LRCTRIM0_M_Pos 15 //LRC中调控制位 +#define SYS_LRCTRIM0_M_Pos 15 //LRC涓皟鎺у埗浣 #define SYS_LRCTRIM0_M_Msk (0x3F << SYS_LRCTRIM2_M_Pos) -#define SYS_LRCTRIM0_F_Pos 21 //LRC细调控制位 +#define SYS_LRCTRIM0_F_Pos 21 //LRC缁嗚皟鎺у埗浣 #define SYS_LRCTRIM0_F_Msk (0x7FF << SYS_LRCTRIM0_F_Pos) -#define SYS_LRCTRIM1_U_Pos 0 //LRC U调控制位 +#define SYS_LRCTRIM1_U_Pos 0 //LRC U璋冩帶鍒朵綅 #define SYS_LRCTRIM1_U_Msk (0x7FFF << SYS_LRCTRIM1_U_Pos) @@ -322,24 +322,24 @@ typedef struct { #define SYS_XTALCR_EN_Pos 0 #define SYS_XTALCR_EN_Msk (0x01 << SYS_XTALCR_EN_Pos) -#define SYS_PLLCR_OUTEN_Pos 0 //只能LOCK后设置 +#define SYS_PLLCR_OUTEN_Pos 0 //鍙兘LOCK鍚庤缃 #define SYS_PLLCR_OUTEN_Msk (0x01 << SYS_PLLCR_OUTEN_Pos) #define SYS_PLLCR_INSEL_Pos 1 //0 XTAL 1 HRC #define SYS_PLLCR_INSEL_Msk (0x01 << SYS_PLLCR_INSEL_Pos) #define SYS_PLLCR_OFF_Pos 2 #define SYS_PLLCR_OFF_Msk (0x01 << SYS_PLLCR_OFF_Pos) -#define SYS_PLLDIV_FBDIV_Pos 0 //PLL FeedBack分频寄存器 - //VCO输出频率 = PLL输入时钟 / INDIV * 4 * FBDIV - //PLL输出频率 = PLL输入时钟 / INDIV * 4 * FBDIV / OUTDIV = VCO输出频率 / OUTDIV +#define SYS_PLLDIV_FBDIV_Pos 0 //PLL FeedBack鍒嗛瀵勫瓨鍣 + //VCO杈撳嚭棰戠巼 = PLL杈撳叆鏃堕挓 / INDIV * 4 * FBDIV + //PLL杈撳嚭棰戠巼 = PLL杈撳叆鏃堕挓 / INDIV * 4 * FBDIV / OUTDIV = VCO杈撳嚭棰戠巼 / OUTDIV #define SYS_PLLDIV_FBDIV_Msk (0x1FF << SYS_PLLDIV_FBDIV_Pos) -#define SYS_PLLDIV_ADDIV_Pos 9 //ADC时钟基(即VCO输出分频后的时钟)经ADDIV分频后作为ADC的转换时钟 +#define SYS_PLLDIV_ADDIV_Pos 9 //ADC鏃堕挓鍩猴紙鍗砎CO杈撳嚭鍒嗛鍚庣殑鏃堕挓锛夌粡ADDIV鍒嗛鍚庝綔涓篈DC鐨勮浆鎹㈡椂閽 #define SYS_PLLDIV_ADDIV_Msk (0x1F << SYS_PLLDIV_ADDIV_Pos) -#define SYS_PLLDIV_ADVCO_Pos 14 //0 VCO输出16分频作为ADC时钟基 1 VCO输出经过32分频作为ADC时钟基 2 VCO输出经过64分频作为ADC时钟基 +#define SYS_PLLDIV_ADVCO_Pos 14 //0 VCO杈撳嚭16鍒嗛浣滀负ADC鏃堕挓鍩 1 VCO杈撳嚭缁忚繃32鍒嗛浣滀负ADC鏃堕挓鍩 2 VCO杈撳嚭缁忚繃64鍒嗛浣滀负ADC鏃堕挓鍩 #define SYS_PLLDIV_ADVCO_Msk (0x03 << SYS_PLLDIV_ADVCO_Pos) -#define SYS_PLLDIV_INDIV_Pos 16 //PLL 输入源时钟分频 +#define SYS_PLLDIV_INDIV_Pos 16 //PLL 杈撳叆婧愭椂閽熷垎棰 #define SYS_PLLDIV_INDIV_Msk (0x1F << SYS_PLLDIV_INDIV_Pos) -#define SYS_PLLDIV_OUTDIV_Pos 24 //PLL 输出分频,0 8分频 1 4分频 0 2分频 +#define SYS_PLLDIV_OUTDIV_Pos 24 //PLL 杈撳嚭鍒嗛锛0 8鍒嗛 1 4鍒嗛 0 2鍒嗛 #define SYS_PLLDIV_OUTDIV_Msk (0x03 << SYS_PLLDIV_OUTDIV_Pos) #define SYS_PLLSET_LPFBW_Pos 0 //PLL Low Pass Filter Bandwidth @@ -353,23 +353,23 @@ typedef struct { #define SYS_PLLSET_CHPADJM_Pos 11 //PLL charge pump MSB current Adjustment #define SYS_PLLSET_CHPADJM_Msk (0x03 << SYS_PLLSET_CHPADJM_Pos) -#define SYS_BODIE_2V2_Pos 1 //BOD 2.2V等级触发中断使能 +#define SYS_BODIE_2V2_Pos 1 //BOD 2.2V绛夌骇瑙﹀彂涓柇浣胯兘 #define SYS_BODIE_2V2_Msk (0x01 << SYS_BODIE_2V2_Pos) -#define SYS_BODIF_2V2_Pos 1 //BOD 2.2V等级触发中断状态,写1清零 +#define SYS_BODIF_2V2_Pos 1 //BOD 2.2V绛夌骇瑙﹀彂涓柇鐘舵侊紝鍐1娓呴浂 #define SYS_BODIF_2V2_Msk (0x01 << SYS_BODIF_2V2_Pos) -#define SYS_ADC1IN7_SEL_Pos 0 //ADC1模块模拟通道7,1 温度传感器 2 电池电压 3 RTC电源域BG 4 主电源域BG 5 PDM33 +#define SYS_ADC1IN7_SEL_Pos 0 //ADC1妯″潡妯℃嫙閫氶亾7锛1 娓╁害浼犳劅鍣 2 鐢垫睜鐢靛帇 3 RTC鐢垫簮鍩烞G 4 涓荤數婧愬煙BG 5 PDM33 #define SYS_ADC1IN7_SEL_Msk (0x0F << SYS_ADC1IN7_SEL_Pos) -#define SYS_ADC1IN7_IOON_Pos 4 //ADC1模块模拟通道7所用IO开关 +#define SYS_ADC1IN7_IOON_Pos 4 //ADC1妯″潡妯℃嫙閫氶亾7鎵鐢↖O寮鍏 #define SYS_ADC1IN7_IOON_Msk (0x01 << SYS_ADC1IN7_IOON_Pos) typedef struct { - __IO uint32_t PORTA_SEL; //给PORTA_SEL[2n+2:2n]赋相应的值,将PORTA.PINn引脚配置成GPIO、模拟、数字等功能 - //当赋值为PORTA_PINn_FUNMUX时,PORTA.PINn引脚可通过PORTA_MUX寄存器连接到各种数字外设 + __IO uint32_t PORTA_SEL; //缁橮ORTA_SEL[2n+2:2n]璧嬬浉搴旂殑鍊硷紝灏哖ORTA.PINn寮曡剼閰嶇疆鎴怗PIO銆佹ā鎷熴佹暟瀛楃瓑鍔熻兘 + //褰撹祴鍊间负PORTA_PINn_FUNMUX鏃讹紝PORTA.PINn寮曡剼鍙氳繃PORTA_MUX瀵勫瓨鍣ㄨ繛鎺ュ埌鍚勭鏁板瓧澶栬 __IO uint32_t PORTB_SEL; __IO uint32_t PORTC_SEL; @@ -438,7 +438,7 @@ typedef struct { uint32_t RESERVED9[28]; - __IO uint32_t PORTA_PULLU; //上拉使能 + __IO uint32_t PORTA_PULLU; //涓婃媺浣胯兘 uint32_t RESERVED10[3]; @@ -454,7 +454,7 @@ typedef struct { uint32_t RESERVED13[51]; - __IO uint32_t PORTB_PULLD; //下拉使能 + __IO uint32_t PORTB_PULLD; //涓嬫媺浣胯兘 uint32_t RESERVED14[3]; @@ -466,7 +466,7 @@ typedef struct { uint32_t RESERVED16[135]; - __IO uint32_t PORTM_DRIVS; //驱动强度 + __IO uint32_t PORTM_DRIVS; //椹卞姩寮哄害 uint32_t RESERVED17[3]; @@ -478,7 +478,7 @@ typedef struct { uint32_t RESERVED19[39]; - __IO uint32_t PORTA_INEN; //输入使能 + __IO uint32_t PORTA_INEN; //杈撳叆浣胯兘 uint32_t RESERVED20[3]; @@ -1172,21 +1172,21 @@ typedef struct { #define PIN23 23 #define PIN24 24 - __IO uint32_t DIR; //0 输入 1 输出 + __IO uint32_t DIR; //0 杈撳叆 1 杈撳嚭 - __IO uint32_t INTLVLTRG; //Interrupt Level Trigger 1 电平触发中断 0 边沿触发中断 + __IO uint32_t INTLVLTRG; //Interrupt Level Trigger 1 鐢靛钩瑙﹀彂涓柇 0 杈规部瑙﹀彂涓柇 - __IO uint32_t INTBE; //Both Edge,当INTLVLTRG设为边沿触发中断时,此位置1表示上升沿和下降沿都触发中断,置0时触发边沿由INTRISEEN选择 + __IO uint32_t INTBE; //Both Edge锛屽綋INTLVLTRG璁句负杈规部瑙﹀彂涓柇鏃讹紝姝や綅缃1琛ㄧず涓婂崌娌垮拰涓嬮檷娌块兘瑙﹀彂涓柇锛岀疆0鏃惰Е鍙戣竟娌跨敱INTRISEEN閫夋嫨 - __IO uint32_t INTRISEEN; //Interrupt Rise Edge Enable 1 上升沿/高电平触发中断 0 下降沿/低电平触发中断 + __IO uint32_t INTRISEEN; //Interrupt Rise Edge Enable 1 涓婂崌娌/楂樼數骞宠Е鍙戜腑鏂 0 涓嬮檷娌/浣庣數骞宠Е鍙戜腑鏂 - __IO uint32_t INTEN; //1 中断使能 0 中断禁止 + __IO uint32_t INTEN; //1 涓柇浣胯兘 0 涓柇绂佹 - __IO uint32_t INTRAWSTAT; //中断检测单元是否检测到了触发中断的条件 1 检测到了中断触发条件 0 没有检测到中断触发条件 + __IO uint32_t INTRAWSTAT; //涓柇妫娴嬪崟鍏冩槸鍚︽娴嬪埌浜嗚Е鍙戜腑鏂殑鏉′欢 1 妫娴嬪埌浜嗕腑鏂Е鍙戞潯浠 0 娌℃湁妫娴嬪埌涓柇瑙﹀彂鏉′欢 __IO uint32_t INTSTAT; //INTSTAT.PIN0 = INTRAWSTAT.PIN0 & INTEN.PIN0 - __IO uint32_t INTCLR; //写1清除中断标志,只对边沿触发中断有用 + __IO uint32_t INTCLR; //鍐1娓呴櫎涓柇鏍囧織锛屽彧瀵硅竟娌胯Е鍙戜腑鏂湁鐢 } GPIO_TypeDef; @@ -1635,26 +1635,26 @@ typedef struct { typedef struct { - __IO uint32_t LDVAL; //定时器加载值,使能后定时器从此数值开始向下递减计数 + __IO uint32_t LDVAL; //瀹氭椂鍣ㄥ姞杞藉硷紝浣胯兘鍚庡畾鏃跺櫒浠庢鏁板煎紑濮嬪悜涓嬮掑噺璁℃暟 - __I uint32_t CVAL; //定时器当前值,LDVAL-CVAL 可计算出计时时长 + __I uint32_t CVAL; //瀹氭椂鍣ㄥ綋鍓嶅硷紝LDVAL-CVAL 鍙绠楀嚭璁℃椂鏃堕暱 __IO uint32_t CTRL; } TIMR_TypeDef; -#define TIMR_CTRL_EN_Pos 0 //此位赋1导致TIMR从LDVAL开始向下递减计数 +#define TIMR_CTRL_EN_Pos 0 //姝や綅璧1瀵艰嚧TIMR浠嶭DVAL寮濮嬪悜涓嬮掑噺璁℃暟 #define TIMR_CTRL_EN_Msk (0x01 << TIMR_CTRL_EN_Pos) -#define TIMR_CTRL_CLKSRC_Pos 1 //时钟源:0 内部系统时钟 1 外部引脚脉冲计数 +#define TIMR_CTRL_CLKSRC_Pos 1 //鏃堕挓婧愶細0 鍐呴儴绯荤粺鏃堕挓 1 澶栭儴寮曡剼鑴夊啿璁℃暟 #define TIMR_CTRL_CLKSRC_Msk (0x01 << TIMR_CTRL_CLKSRC_Pos) -#define TIMR_CTRL_CASCADE_Pos 2 //1 TIMRx的计数时钟为TIMRx-1的溢出信号 +#define TIMR_CTRL_CASCADE_Pos 2 //1 TIMRx鐨勮鏁版椂閽熶负TIMRx-1鐨勬孩鍑轰俊鍙 #define TIMR_CTRL_CASCADE_Msk (0x01 << TIMR_CTRL_CASCADE_Pos) typedef struct { - __IO uint32_t PCTRL; //Pulse Control,脉宽测量模块控制寄存器 + __IO uint32_t PCTRL; //Pulse Control锛岃剦瀹芥祴閲忔ā鍧楁帶鍒跺瘎瀛樺櫒 - __I uint32_t PCVAL; //脉宽测量定时器当前值 + __I uint32_t PCVAL; //鑴夊娴嬮噺瀹氭椂鍣ㄥ綋鍓嶅 uint32_t RESERVED[2]; @@ -1666,11 +1666,11 @@ typedef struct { } TIMRG_TypeDef; -#define TIMRG_PCTRL_EN_Pos 0 //开始测量脉宽,脉宽内32位计数器从0开始向上计数 +#define TIMRG_PCTRL_EN_Pos 0 //寮濮嬫祴閲忚剦瀹斤紝鑴夊鍐32浣嶈鏁板櫒浠0寮濮嬪悜涓婅鏁 #define TIMRG_PCTRL_EN_Msk (0x01 << TIMRG_PCTRL_EN_Pos) -#define TIMRG_PCTRL_HIGH_Pos 1 //0 测量低电平长度 1 测量高电平长度 +#define TIMRG_PCTRL_HIGH_Pos 1 //0 娴嬮噺浣庣數骞抽暱搴 1 娴嬮噺楂樼數骞抽暱搴 #define TIMRG_PCTRL_HIGH_Msk (0x01 << TIMRG_PCTRL_HIGH_Pos) -#define TIMRG_PCTRL_CLKSRC_Pos 2 //时钟源:0 内部系统时钟 1 脉宽测量模块变成一个计数器,不再具有脉宽测量功能 +#define TIMRG_PCTRL_CLKSRC_Pos 2 //鏃堕挓婧愶細0 鍐呴儴绯荤粺鏃堕挓 1 鑴夊娴嬮噺妯″潡鍙樻垚涓涓鏁板櫒锛屼笉鍐嶅叿鏈夎剦瀹芥祴閲忓姛鑳 #define TIMRG_PCTRL_CLKSRC_Msk (0x01 << TIMRG_PCTRL_CLKSRC_Pos) #define TIMRG_IE_TIMR0_Pos 0 @@ -1688,7 +1688,7 @@ typedef struct { #define TIMRG_IE_PULSE_Pos 16 #define TIMRG_IE_PULSE_Msk (0x01 << TIMRG_IE_PULSE_Pos) -#define TIMRG_IF_TIMR0_Pos 0 //写1清零 +#define TIMRG_IF_TIMR0_Pos 0 //鍐1娓呴浂 #define TIMRG_IF_TIMR0_Msk (0x01 << TIMRG_IF_TIMR0_Pos) #define TIMRG_IF_TIMR1_Pos 1 #define TIMRG_IF_TIMR1_Msk (0x01 << TIMRG_IF_TIMR1_Pos) @@ -1703,7 +1703,7 @@ typedef struct { #define TIMRG_IF_PULSE_Pos 16 #define TIMRG_IF_PULSE_Msk (0x01 << TIMRG_IF_PULSE_Pos) -#define TIMRG_HALT_TIMR0_Pos 0 //1 暂停计数 +#define TIMRG_HALT_TIMR0_Pos 0 //1 鏆傚仠璁℃暟 #define TIMRG_HALT_TIMR0_Msk (0x01 << TIMRG_HALT_TIMR0_Pos) #define TIMRG_HALT_TIMR1_Pos 1 #define TIMRG_HALT_TIMR1_Msk (0x01 << TIMRG_HALT_TIMR1_Pos) @@ -1740,114 +1740,114 @@ typedef struct { #define UART_DATA_DATA_Pos 0 #define UART_DATA_DATA_Msk (0x1FF << UART_DATA_DATA_Pos) -#define UART_DATA_VALID_Pos 9 //当DATA字段有有效的接收数据时,该位硬件置1,读取数据后自动清零 +#define UART_DATA_VALID_Pos 9 //褰揇ATA瀛楁鏈夋湁鏁堢殑鎺ユ敹鏁版嵁鏃讹紝璇ヤ綅纭欢缃1锛岃鍙栨暟鎹悗鑷姩娓呴浂 #define UART_DATA_VALID_Msk (0x01 << UART_DATA_VALID_Pos) #define UART_DATA_PAERR_Pos 10 //Parity Error #define UART_DATA_PAERR_Msk (0x01 << UART_DATA_PAERR_Pos) -#define UART_CTRL_TXIDLE_Pos 0 //TX IDLE: 0 正在发送数据 1 空闲状态,没有数据发送 +#define UART_CTRL_TXIDLE_Pos 0 //TX IDLE: 0 姝e湪鍙戦佹暟鎹 1 绌洪棽鐘舵侊紝娌℃湁鏁版嵁鍙戦 #define UART_CTRL_TXIDLE_Msk (0x01 << UART_CTRL_TXIDLE_Pos) #define UART_CTRL_TXFF_Pos 1 //TX FIFO Full #define UART_CTRL_TXFF_Msk (0x01 << UART_CTRL_TXFF_Pos) -#define UART_CTRL_TXIE_Pos 2 //TX 中断使能: 1 TX FF 中数据少于设定个数时产生中断 +#define UART_CTRL_TXIE_Pos 2 //TX 涓柇浣胯兘: 1 TX FF 涓暟鎹皯浜庤瀹氫釜鏁版椂浜х敓涓柇 #define UART_CTRL_TXIE_Msk (0x01 << UART_CTRL_TXIE_Pos) #define UART_CTRL_RXNE_Pos 3 //RX FIFO Not Empty #define UART_CTRL_RXNE_Msk (0x01 << UART_CTRL_RXNE_Pos) -#define UART_CTRL_RXIE_Pos 4 //RX 中断使能: 1 RX FF 中数据达到设定个数时产生中断 +#define UART_CTRL_RXIE_Pos 4 //RX 涓柇浣胯兘: 1 RX FF 涓暟鎹揪鍒拌瀹氫釜鏁版椂浜х敓涓柇 #define UART_CTRL_RXIE_Msk (0x01 << UART_CTRL_RXIE_Pos) -#define UART_CTRL_RXOV_Pos 5 //RX FIFO Overflow,写1清零 +#define UART_CTRL_RXOV_Pos 5 //RX FIFO Overflow锛屽啓1娓呴浂 #define UART_CTRL_RXOV_Msk (0x01 << UART_CTRL_RXOV_Pos) -#define UART_CTRL_TXDOIE_Pos 6 //TX Done 中断使能,发送FIFO空且发送发送移位寄存器已将最后一位发送出去 +#define UART_CTRL_TXDOIE_Pos 6 //TX Done 涓柇浣胯兘锛屽彂閫丗IFO绌轰笖鍙戦佸彂閫佺Щ浣嶅瘎瀛樺櫒宸插皢鏈鍚庝竴浣嶅彂閫佸嚭鍘 #define UART_CTRL_TXDOIE_Msk (0x01 << UART_CTRL_TXDOIE_Pos) #define UART_CTRL_EN_Pos 9 #define UART_CTRL_EN_Msk (0x01 << UART_CTRL_EN_Pos) #define UART_CTRL_LOOP_Pos 10 #define UART_CTRL_LOOP_Msk (0x01 << UART_CTRL_LOOP_Pos) -#define UART_CTRL_BAUDEN_Pos 13 //必须写1 +#define UART_CTRL_BAUDEN_Pos 13 //蹇呴』鍐1 #define UART_CTRL_BAUDEN_Msk (0x01 << UART_CTRL_BAUDEN_Pos) -#define UART_CTRL_TOIE_Pos 14 //TimeOut 中断使能,接收到上个字符后,超过 TOTIME/BAUDRAUD 秒没有接收到新的数据 +#define UART_CTRL_TOIE_Pos 14 //TimeOut 涓柇浣胯兘锛屾帴鏀跺埌涓婁釜瀛楃鍚庯紝瓒呰繃 TOTIME/BAUDRAUD 绉掓病鏈夋帴鏀跺埌鏂扮殑鏁版嵁 #define UART_CTRL_TOIE_Msk (0x01 << UART_CTRL_TOIE_Pos) -#define UART_CTRL_BRKDET_Pos 15 //LIN Break Detect,检测到LIN Break,即RX线上检测到连续11位低电平 +#define UART_CTRL_BRKDET_Pos 15 //LIN Break Detect锛屾娴嬪埌LIN Break锛屽嵆RX绾夸笂妫娴嬪埌杩炵画11浣嶄綆鐢靛钩 #define UART_CTRL_BRKDET_Msk (0x01 << UART_CTRL_BRKDET_Pos) -#define UART_CTRL_BRKIE_Pos 16 //LIN Break Detect 中断使能 +#define UART_CTRL_BRKIE_Pos 16 //LIN Break Detect 涓柇浣胯兘 #define UART_CTRL_BRKIE_Msk (0x01 << UART_CTRL_BRKIE_Pos) -#define UART_CTRL_GENBRK_Pos 17 //Generate LIN Break,发送LIN Break +#define UART_CTRL_GENBRK_Pos 17 //Generate LIN Break锛屽彂閫丩IN Break #define UART_CTRL_GENBRK_Msk (0x01 << UART_CTRL_GENBRK_Pos) -#define UART_CTRL_DATA9b_Pos 18 //1 9位数据位 0 8位数据位 +#define UART_CTRL_DATA9b_Pos 18 //1 9浣嶆暟鎹綅 0 8浣嶆暟鎹綅 #define UART_CTRL_DATA9b_Msk (0x01 << UART_CTRL_DATA9b_Pos) -#define UART_CTRL_PARITY_Pos 19 //000 无校验 001 奇校验 011 偶校验 101 固定为1 111 固定为0 +#define UART_CTRL_PARITY_Pos 19 //000 鏃犳牎楠 001 濂囨牎楠 011 鍋舵牎楠 101 鍥哄畾涓1 111 鍥哄畾涓0 #define UART_CTRL_PARITY_Msk (0x07 << UART_CTRL_PARITY_Pos) -#define UART_CTRL_STOP2b_Pos 22 //1 2位停止位 0 1位停止位 +#define UART_CTRL_STOP2b_Pos 22 //1 2浣嶅仠姝綅 0 1浣嶅仠姝綅 #define UART_CTRL_STOP2b_Msk (0x03 << UART_CTRL_STOP2b_Pos) -#define UART_CTRL_TOTIME_Pos 24 //TimeOut 时长 = TOTIME/(BAUDRAUD/10) 秒 +#define UART_CTRL_TOTIME_Pos 24 //TimeOut 鏃堕暱 = TOTIME/(BAUDRAUD/10) 绉 #define UART_CTRL_TOTIME_Msk (0xFFu<< UART_CTRL_TOTIME_Pos) -#define UART_BAUD_BAUD_Pos 0 //串口波特率 = SYS_Freq/16/BAUD - 1 +#define UART_BAUD_BAUD_Pos 0 //涓插彛娉㈢壒鐜 = SYS_Freq/16/BAUD - 1 #define UART_BAUD_BAUD_Msk (0x3FFF << UART_BAUD_BAUD_Pos) -#define UART_BAUD_TXD_Pos 14 //通过此位可直接读取串口TXD引脚上的电平 +#define UART_BAUD_TXD_Pos 14 //閫氳繃姝や綅鍙洿鎺ヨ鍙栦覆鍙XD寮曡剼涓婄殑鐢靛钩 #define UART_BAUD_TXD_Msk (0x01 << UART_BAUD_TXD_Pos) -#define UART_BAUD_RXD_Pos 15 //通过此位可直接读取串口RXD引脚上的电平 +#define UART_BAUD_RXD_Pos 15 //閫氳繃姝や綅鍙洿鎺ヨ鍙栦覆鍙XD寮曡剼涓婄殑鐢靛钩 #define UART_BAUD_RXD_Msk (0x01 << UART_BAUD_RXD_Pos) -#define UART_BAUD_RXTOIF_Pos 16 //接收&超时的中断标志 = RXIF | TOIF +#define UART_BAUD_RXTOIF_Pos 16 //鎺ユ敹&瓒呮椂鐨勪腑鏂爣蹇 = RXIF | TOIF #define UART_BAUD_RXTOIF_Msk (0x01 << UART_BAUD_RXTOIF_Pos) -#define UART_BAUD_TXIF_Pos 17 //发送中断标志 = TXTHRF & TXIE +#define UART_BAUD_TXIF_Pos 17 //鍙戦佷腑鏂爣蹇 = TXTHRF & TXIE #define UART_BAUD_TXIF_Msk (0x01 << UART_BAUD_TXIF_Pos) -#define UART_BAUD_BRKIF_Pos 18 //LIN Break Detect 中断标志,检测到LIN Break时若BRKIE=1,此位由硬件置位 +#define UART_BAUD_BRKIF_Pos 18 //LIN Break Detect 涓柇鏍囧織锛屾娴嬪埌LIN Break鏃惰嫢BRKIE=1锛屾浣嶇敱纭欢缃綅 #define UART_BAUD_BRKIF_Msk (0x01 << UART_BAUD_BRKIF_Pos) -#define UART_BAUD_RXTHRF_Pos 19 //RX FIFO Threshold Flag,RX FIFO中数据达到设定个数(RXLVL >= RXTHR)时硬件置1 +#define UART_BAUD_RXTHRF_Pos 19 //RX FIFO Threshold Flag锛孯X FIFO涓暟鎹揪鍒拌瀹氫釜鏁帮紙RXLVL >= RXTHR锛夋椂纭欢缃1 #define UART_BAUD_RXTHRF_Msk (0x01 << UART_BAUD_RXTHRF_Pos) -#define UART_BAUD_TXTHRF_Pos 20 //TX FIFO Threshold Flag,TX FIFO中数据少于设定个数(TXLVL <= TXTHR)时硬件置1 +#define UART_BAUD_TXTHRF_Pos 20 //TX FIFO Threshold Flag锛孴X FIFO涓暟鎹皯浜庤瀹氫釜鏁帮紙TXLVL <= TXTHR锛夋椂纭欢缃1 #define UART_BAUD_TXTHRF_Msk (0x01 << UART_BAUD_TXTHRF_Pos) -#define UART_BAUD_TOIF_Pos 21 //TimeOut 中断标志,超过 TOTIME/BAUDRAUD 秒没有接收到新的数据时若TOIE=1,此位由硬件置位 +#define UART_BAUD_TOIF_Pos 21 //TimeOut 涓柇鏍囧織锛岃秴杩 TOTIME/BAUDRAUD 绉掓病鏈夋帴鏀跺埌鏂扮殑鏁版嵁鏃惰嫢TOIE=1锛屾浣嶇敱纭欢缃綅 #define UART_BAUD_TOIF_Msk (0x01 << UART_BAUD_TOIF_Pos) -#define UART_BAUD_RXIF_Pos 22 //接收中断标志 = RXTHRF & RXIE +#define UART_BAUD_RXIF_Pos 22 //鎺ユ敹涓柇鏍囧織 = RXTHRF & RXIE #define UART_BAUD_RXIF_Msk (0x01 << UART_BAUD_RXIF_Pos) -#define UART_BAUD_ABREN_Pos 23 //Auto Baudrate Enable,写1启动自动波特率校准,完成后自动清零 +#define UART_BAUD_ABREN_Pos 23 //Auto Baudrate Enable锛屽啓1鍚姩鑷姩娉㈢壒鐜囨牎鍑嗭紝瀹屾垚鍚庤嚜鍔ㄦ竻闆 #define UART_BAUD_ABREN_Msk (0x01 << UART_BAUD_ABREN_Pos) -#define UART_BAUD_ABRBIT_Pos 24 //Auto Baudrate Bit,用于计算波特率的检测位长,0 1位,通过测起始位 脉宽计算波特率,要求发送端发送0xFF - // 1 2位,通过测起始位加1位数据位脉宽计算波特率,要求发送端发送0xFE - // 1 4位,通过测起始位加3位数据位脉宽计算波特率,要求发送端发送0xF8 - // 1 8位,通过测起始位加7位数据位脉宽计算波特率,要求发送端发送0x80 +#define UART_BAUD_ABRBIT_Pos 24 //Auto Baudrate Bit锛岀敤浜庤绠楁尝鐗圭巼鐨勬娴嬩綅闀匡紝0 1浣嶏紝閫氳繃娴嬭捣濮嬩綅 鑴夊璁$畻娉㈢壒鐜囷紝瑕佹眰鍙戦佺鍙戦0xFF + // 1 2浣嶏紝閫氳繃娴嬭捣濮嬩綅鍔1浣嶆暟鎹綅鑴夊璁$畻娉㈢壒鐜囷紝瑕佹眰鍙戦佺鍙戦0xFE + // 1 4浣嶏紝閫氳繃娴嬭捣濮嬩綅鍔3浣嶆暟鎹綅鑴夊璁$畻娉㈢壒鐜囷紝瑕佹眰鍙戦佺鍙戦0xF8 + // 1 8浣嶏紝閫氳繃娴嬭捣濮嬩綅鍔7浣嶆暟鎹綅鑴夊璁$畻娉㈢壒鐜囷紝瑕佹眰鍙戦佺鍙戦0x80 #define UART_BAUD_ABRBIT_Msk (0x03 << UART_BAUD_ABRBIT_Pos) -#define UART_BAUD_ABRERR_Pos 26 //Auto Baudrate Error,0 自动波特率校准成功 1 自动波特率校准失败 +#define UART_BAUD_ABRERR_Pos 26 //Auto Baudrate Error锛0 鑷姩娉㈢壒鐜囨牎鍑嗘垚鍔 1 鑷姩娉㈢壒鐜囨牎鍑嗗け璐 #define UART_BAUD_ABRERR_Msk (0x01 << UART_BAUD_ABRERR_Pos) -#define UART_BAUD_TXDOIF_Pos 27 //TX Done 中断标志,发送FIFO空且发送发送移位寄存器已将最后一位发送出去 +#define UART_BAUD_TXDOIF_Pos 27 //TX Done 涓柇鏍囧織锛屽彂閫丗IFO绌轰笖鍙戦佸彂閫佺Щ浣嶅瘎瀛樺櫒宸插皢鏈鍚庝竴浣嶅彂閫佸嚭鍘 #define UART_BAUD_TXDOIF_Msk (0x01 << UART_BAUD_TXDOIF_Pos) -#define UART_FIFO_RXLVL_Pos 0 //RX FIFO Level,RX FIFO 中字符个数 +#define UART_FIFO_RXLVL_Pos 0 //RX FIFO Level锛孯X FIFO 涓瓧绗︿釜鏁 #define UART_FIFO_RXLVL_Msk (0xFF << UART_FIFO_RXLVL_Pos) -#define UART_FIFO_TXLVL_Pos 8 //TX FIFO Level,TX FIFO 中字符个数 +#define UART_FIFO_TXLVL_Pos 8 //TX FIFO Level锛孴X FIFO 涓瓧绗︿釜鏁 #define UART_FIFO_TXLVL_Msk (0xFF << UART_FIFO_TXLVL_Pos) -#define UART_FIFO_RXTHR_Pos 16 //RX FIFO Threshold,RX中断触发门限,中断使能时 RXLVL >= RXTHR 触发RX中断 +#define UART_FIFO_RXTHR_Pos 16 //RX FIFO Threshold锛孯X涓柇瑙﹀彂闂ㄩ檺锛屼腑鏂娇鑳芥椂 RXLVL >= RXTHR 瑙﹀彂RX涓柇 #define UART_FIFO_RXTHR_Msk (0xFF << UART_FIFO_RXTHR_Pos) -#define UART_FIFO_TXTHR_Pos 24 //TX FIFO Threshold,TX中断触发门限,中断使能时 TXLVL <= TXTHR 触发TX中断 +#define UART_FIFO_TXTHR_Pos 24 //TX FIFO Threshold锛孴X涓柇瑙﹀彂闂ㄩ檺锛屼腑鏂娇鑳芥椂 TXLVL <= TXTHR 瑙﹀彂TX涓柇 #define UART_FIFO_TXTHR_Msk (0xFFu<< UART_FIFO_TXTHR_Pos) -#define UART_LINCR_BRKDETIE_Pos 0 //检测到LIN Break中断使能 +#define UART_LINCR_BRKDETIE_Pos 0 //妫娴嬪埌LIN Break涓柇浣胯兘 #define UART_LINCR_BRKDETIE_Msk (0x01 << UART_LINCR_BRKDETIE_Pos) -#define UART_LINCR_BRKDETIF_Pos 1 //检测到LIN Break中断状态 +#define UART_LINCR_BRKDETIF_Pos 1 //妫娴嬪埌LIN Break涓柇鐘舵 #define UART_LINCR_BRKDETIF_Msk (0x01 << UART_LINCR_BRKDETIF_Pos) -#define UART_LINCR_GENBRKIE_Pos 2 //发送LIN Break完成中断使能 +#define UART_LINCR_GENBRKIE_Pos 2 //鍙戦丩IN Break瀹屾垚涓柇浣胯兘 #define UART_LINCR_GENBRKIE_Msk (0x01 << UART_LINCR_GENBRKIE_Pos) -#define UART_LINCR_GENBRKIF_Pos 3 //发送LIN Break完成中断状态 +#define UART_LINCR_GENBRKIF_Pos 3 //鍙戦丩IN Break瀹屾垚涓柇鐘舵 #define UART_LINCR_GENBRKIF_Msk (0x01 << UART_LINCR_GENBRKIF_Pos) -#define UART_LINCR_GENBRK_Pos 4 //发送LIN Break,发送完成自动清零 +#define UART_LINCR_GENBRK_Pos 4 //鍙戦丩IN Break锛屽彂閫佸畬鎴愯嚜鍔ㄦ竻闆 #define UART_LINCR_GENBRK_Msk (0x01 << UART_LINCR_GENBRK_Pos) -#define UART_CTSCR_EN_Pos 0 //CTS流控使能 +#define UART_CTSCR_EN_Pos 0 //CTS娴佹帶浣胯兘 #define UART_CTSCR_EN_Msk (0x01 << UART_CTSCR_EN_Pos) -#define UART_CTSCR_POL_Pos 2 //CTS信号极性,0 低有效,CTS输入为低表示可以发送数据 +#define UART_CTSCR_POL_Pos 2 //CTS淇″彿鏋佹э紝0 浣庢湁鏁堬紝CTS杈撳叆涓轰綆琛ㄧず鍙互鍙戦佹暟鎹 #define UART_CTSCR_POL_Msk (0x01 << UART_CTSCR_POL_Pos) -#define UART_CTSCR_STAT_Pos 7 //CTS信号的当前状态 +#define UART_CTSCR_STAT_Pos 7 //CTS淇″彿鐨勫綋鍓嶇姸鎬 #define UART_CTSCR_STAT_Msk (0x01 << UART_CTSCR_STAT_Pos) -#define UART_RTSCR_EN_Pos 1 //RTS流控使能 +#define UART_RTSCR_EN_Pos 1 //RTS娴佹帶浣胯兘 #define UART_RTSCR_EN_Msk (0x01 << UART_RTSCR_EN_Pos) -#define UART_RTSCR_POL_Pos 3 //RTS信号极性 0 低有效,RTS输入为低表示可以接收数据 +#define UART_RTSCR_POL_Pos 3 //RTS淇″彿鏋佹 0 浣庢湁鏁堬紝RTS杈撳叆涓轰綆琛ㄧず鍙互鎺ユ敹鏁版嵁 #define UART_RTSCR_POL_Msk (0x01 << UART_RTSCR_POL_Pos) -#define UART_RTSCR_THR_Pos 4 //RTS流控的触发阈值 0 1字节 1 2字节 2 4字节 3 6字节 +#define UART_RTSCR_THR_Pos 4 //RTS娴佹帶鐨勮Е鍙戦槇鍊 0 1瀛楄妭 1 2瀛楄妭 2 4瀛楄妭 3 6瀛楄妭 #define UART_RTSCR_THR_Msk (0x07 << UART_RTSCR_THR_Pos) -#define UART_RTSCR_STAT_Pos 8 //RTS信号的当前状态 +#define UART_RTSCR_STAT_Pos 8 //RTS淇″彿鐨勫綋鍓嶇姸鎬 #define UART_RTSCR_STAT_Msk (0x01 << UART_RTSCR_STAT_Pos) @@ -1866,46 +1866,46 @@ typedef struct { } SPI_TypeDef; -#define SPI_CTRL_CLKDIV_Pos 0 //Clock Divider, SPI工作时钟 = SYS_Freq/pow(2, CLKDIV+2) +#define SPI_CTRL_CLKDIV_Pos 0 //Clock Divider, SPI宸ヤ綔鏃堕挓 = SYS_Freq/pow(2, CLKDIV+2) #define SPI_CTRL_CLKDIV_Msk (0x07 << SPI_CTRL_CLKDIV_Pos) #define SPI_CTRL_EN_Pos 3 #define SPI_CTRL_EN_Msk (0x01 << SPI_CTRL_EN_Pos) -#define SPI_CTRL_SIZE_Pos 4 //Data Size Select, 取值3--15,表示4--16位 +#define SPI_CTRL_SIZE_Pos 4 //Data Size Select, 鍙栧3--15锛岃〃绀4--16浣 #define SPI_CTRL_SIZE_Msk (0x0F << SPI_CTRL_SIZE_Pos) -#define SPI_CTRL_CPHA_Pos 8 //0 在SCLK的第一个跳变沿采样数据 1 在SCLK的第二个跳变沿采样数据 +#define SPI_CTRL_CPHA_Pos 8 //0 鍦⊿CLK鐨勭涓涓烦鍙樻部閲囨牱鏁版嵁 1 鍦⊿CLK鐨勭浜屼釜璺冲彉娌块噰鏍锋暟鎹 #define SPI_CTRL_CPHA_Msk (0x01 << SPI_CTRL_CPHA_Pos) -#define SPI_CTRL_CPOL_Pos 9 //0 空闲状态下SCLK为低电平 1 空闲状态下SCLK为高电平 +#define SPI_CTRL_CPOL_Pos 9 //0 绌洪棽鐘舵佷笅SCLK涓轰綆鐢靛钩 1 绌洪棽鐘舵佷笅SCLK涓洪珮鐢靛钩 #define SPI_CTRL_CPOL_Msk (0x01 << SPI_CTRL_CPOL_Pos) #define SPI_CTRL_FFS_Pos 10 //Frame Format Select, 0 SPI 1 TI SSI 2 SPI 3 SPI #define SPI_CTRL_FFS_Msk (0x03 << SPI_CTRL_FFS_Pos) -#define SPI_CTRL_MSTR_Pos 12 //Master, 1 主模式 0 从模式 +#define SPI_CTRL_MSTR_Pos 12 //Master, 1 涓绘ā寮 0 浠庢ā寮 #define SPI_CTRL_MSTR_Msk (0x01 << SPI_CTRL_MSTR_Pos) -#define SPI_CTRL_FAST_Pos 13 //1 SPI工作时钟 = SYS_Freq/2 0 SPI工作时钟由SPI->CTRL.CLKDIV设置 +#define SPI_CTRL_FAST_Pos 13 //1 SPI宸ヤ綔鏃堕挓 = SYS_Freq/2 0 SPI宸ヤ綔鏃堕挓鐢盨PI->CTRL.CLKDIV璁剧疆 #define SPI_CTRL_FAST_Msk (0x01 << SPI_CTRL_FAST_Pos) -#define SPI_CTRL_FILTE_Pos 16 //1 对SPI输入信号进行去抖操作 0 对SPI输入信号不进行去抖操作 +#define SPI_CTRL_FILTE_Pos 16 //1 瀵筍PI杈撳叆淇″彿杩涜鍘绘姈鎿嶄綔 0 瀵筍PI杈撳叆淇″彿涓嶈繘琛屽幓鎶栨搷浣 #define SPI_CTRL_FILTE_Msk (0x01 << SPI_CTRL_FILTE_Pos) -#define SPI_CTRL_SSN_H_Pos 17 //0 传输过程中SSN始终为0 1 传输过程中每字符之间会将SSN拉高半个SCLK周期 +#define SPI_CTRL_SSN_H_Pos 17 //0 浼犺緭杩囩▼涓璖SN濮嬬粓涓0 1 浼犺緭杩囩▼涓瘡瀛楃涔嬮棿浼氬皢SSN鎷夐珮鍗婁釜SCLK鍛ㄦ湡 #define SPI_CTRL_SSN_H_Msk (0x01 << SPI_CTRL_SSN_H_Pos) #define SPI_CTRL_TFCLR_Pos 24 //TX FIFO Clear #define SPI_CTRL_TFCLR_Msk (0x01 << SPI_CTRL_TFCLR_Pos) #define SPI_CTRL_RFCLR_Pos 25 //RX FIFO Clear #define SPI_CTRL_RFCLR_Msk (0x01 << SPI_CTRL_RFCLR_Pos) -#define SPI_STAT_WTC_Pos 0 //Word Transmit Complete,每传输完成一个数据字由硬件置1,软件写1清零 +#define SPI_STAT_WTC_Pos 0 //Word Transmit Complete锛屾瘡浼犺緭瀹屾垚涓涓暟鎹瓧鐢辩‖浠剁疆1锛岃蒋浠跺啓1娓呴浂 #define SPI_STAT_WTC_Msk (0x01 << SPI_STAT_WTC_Pos) -#define SPI_STAT_TFE_Pos 1 //发送FIFO Empty +#define SPI_STAT_TFE_Pos 1 //鍙戦丗IFO Empty #define SPI_STAT_TFE_Msk (0x01 << SPI_STAT_TFE_Pos) -#define SPI_STAT_TFNF_Pos 2 //发送FIFO Not Full +#define SPI_STAT_TFNF_Pos 2 //鍙戦丗IFO Not Full #define SPI_STAT_TFNF_Msk (0x01 << SPI_STAT_TFNF_Pos) -#define SPI_STAT_RFNE_Pos 3 //接收FIFO Not Empty +#define SPI_STAT_RFNE_Pos 3 //鎺ユ敹FIFO Not Empty #define SPI_STAT_RFNE_Msk (0x01 << SPI_STAT_RFNE_Pos) -#define SPI_STAT_RFF_Pos 4 //接收FIFO Full +#define SPI_STAT_RFF_Pos 4 //鎺ユ敹FIFO Full #define SPI_STAT_RFF_Msk (0x01 << SPI_STAT_RFF_Pos) -#define SPI_STAT_RFOVF_Pos 5 //接收FIFO Overflow +#define SPI_STAT_RFOVF_Pos 5 //鎺ユ敹FIFO Overflow #define SPI_STAT_RFOVF_Msk (0x01 << SPI_STAT_RFOVF_Pos) -#define SPI_STAT_TFLVL_Pos 6 //发送FIFO中数据个数, 0 TFNF=0时表示FIFO内有8个数据,TFNF=1时表示FIFO内有0个数据 1--7 FIFO内有1--7个数据 +#define SPI_STAT_TFLVL_Pos 6 //鍙戦丗IFO涓暟鎹釜鏁帮紝 0 TFNF=0鏃惰〃绀篎IFO鍐呮湁8涓暟鎹紝TFNF=1鏃惰〃绀篎IFO鍐呮湁0涓暟鎹 1--7 FIFO鍐呮湁1--7涓暟鎹 #define SPI_STAT_TFLVL_Msk (0x07 << SPI_STAT_TFLVL_Pos) -#define SPI_STAT_RFLVL_Pos 9 //接收FIFO中数据个数, 0 RFF=1时表示FIFO内有8个数据, RFF=0时表示FIFO内有0个数据 1--7 FIFO内有1--7个数据 +#define SPI_STAT_RFLVL_Pos 9 //鎺ユ敹FIFO涓暟鎹釜鏁帮紝 0 RFF=1鏃惰〃绀篎IFO鍐呮湁8涓暟鎹紝 RFF=0鏃惰〃绀篎IFO鍐呮湁0涓暟鎹 1--7 FIFO鍐呮湁1--7涓暟鎹 #define SPI_STAT_RFLVL_Msk (0x07 << SPI_STAT_RFLVL_Pos) #define SPI_STAT_BUSY_Pos 15 #define SPI_STAT_BUSY_Msk (0x01 << SPI_STAT_BUSY_Pos) @@ -1925,7 +1925,7 @@ typedef struct { #define SPI_IE_FTC_Pos 9 //Frame Transmit Complete #define SPI_IE_FTC_Msk (0x01 << SPI_IE_FTC_Pos) -#define SPI_IF_RFOVF_Pos 0 //写1清零 +#define SPI_IF_RFOVF_Pos 0 //鍐1娓呴浂 #define SPI_IF_RFOVF_Msk (0x01 << SPI_IF_RFOVF_Pos) #define SPI_IF_RFF_Pos 1 #define SPI_IF_RFF_Msk (0x01 << SPI_IF_RFF_Pos) @@ -1935,16 +1935,16 @@ typedef struct { #define SPI_IF_TFE_Msk (0x01 << SPI_IF_TFE_Pos) #define SPI_IF_TFHF_Pos 4 #define SPI_IF_TFHF_Msk (0x01 << SPI_IF_TFHF_Pos) -#define SPI_IF_WTC_Pos 8 //Word Transmit Complete,每传输完成一个数据字由硬件置1 +#define SPI_IF_WTC_Pos 8 //Word Transmit Complete锛屾瘡浼犺緭瀹屾垚涓涓暟鎹瓧鐢辩‖浠剁疆1 #define SPI_IF_WTC_Msk (0x01 << SPI_IF_WTC_Pos) -#define SPI_IF_FTC_Pos 9 //Frame Transmit Complete,WTC置位时若TX FIFO是空的,则FTC置位 +#define SPI_IF_FTC_Pos 9 //Frame Transmit Complete锛學TC缃綅鏃惰嫢TX FIFO鏄┖鐨勶紝鍒橣TC缃綅 #define SPI_IF_FTC_Msk (0x01 << SPI_IF_FTC_Pos) typedef struct { - __IO uint32_t CLKDIV; //[15:0] 须将内部工作频率分到SCL频率的5倍,即CLKDIV = SYS_Freq/5/SCL_Freq - 1 + __IO uint32_t CLKDIV; //[15:0] 椤诲皢鍐呴儴宸ヤ綔棰戠巼鍒嗗埌SCL棰戠巼鐨5鍊嶏紝鍗矯LKDIV = SYS_Freq/5/SCL_Freq - 1 __IO uint32_t CTRL; @@ -1967,61 +1967,61 @@ typedef struct { #define I2C_CTRL_EN_Pos 7 #define I2C_CTRL_EN_Msk (0x01 << I2C_CTRL_EN_Pos) -#define I2C_MSTCMD_IF_Pos 0 //1 有等待处理的中断,写1清零 有两种情况下此位硬件置位:1、一个字节传输完成 2、总线访问权丢失 +#define I2C_MSTCMD_IF_Pos 0 //1 鏈夌瓑寰呭鐞嗙殑涓柇锛屽啓1娓呴浂 鏈変袱绉嶆儏鍐典笅姝や綅纭欢缃綅锛1銆佷竴涓瓧鑺備紶杈撳畬鎴 2銆佹荤嚎璁块棶鏉冧涪澶 #define I2C_MSTCMD_IF_Msk (0x01 << I2C_MSTCMD_IF_Pos) #define I2C_MSTCMD_TIP_Pos 1 //Transmission In Process #define I2C_MSTCMD_TIP_Msk (0x01 << I2C_MSTCMD_TIP_Pos) -#define I2C_MSTCMD_ACK_Pos 3 //接收模式下,0 向发送端反馈ACK 1 向发送端反馈NACK +#define I2C_MSTCMD_ACK_Pos 3 //鎺ユ敹妯″紡涓嬶紝0 鍚戝彂閫佺鍙嶉ACK 1 鍚戝彂閫佺鍙嶉NACK #define I2C_MSTCMD_ACK_Msk (0x01 << I2C_MSTCMD_ACK_Pos) -#define I2C_MSTCMD_WR_Pos 4 // 向Slave写数据时,把这一位写1,自动清零 +#define I2C_MSTCMD_WR_Pos 4 // 鍚慡lave鍐欐暟鎹椂锛屾妸杩欎竴浣嶅啓1锛岃嚜鍔ㄦ竻闆 #define I2C_MSTCMD_WR_Msk (0x01 << I2C_MSTCMD_WR_Pos) -#define I2C_MSTCMD_RD_Pos 5 //写:从Slave读数据时,把这一位写1,自动清零 读:当I2C模块失去总线的访问权时硬件置1 +#define I2C_MSTCMD_RD_Pos 5 //鍐欙細浠嶴lave璇绘暟鎹椂锛屾妸杩欎竴浣嶅啓1锛岃嚜鍔ㄦ竻闆 璇伙細褰揑2C妯″潡澶卞幓鎬荤嚎鐨勮闂潈鏃剁‖浠剁疆1 #define I2C_MSTCMD_RD_Msk (0x01 << I2C_MSTCMD_RD_Pos) -#define I2C_MSTCMD_BUSY_Pos 6 //读:当检测到START之后,这一位变1;当检测到STOP之后,这一位变0 +#define I2C_MSTCMD_BUSY_Pos 6 //璇伙細褰撴娴嬪埌START涔嬪悗锛岃繖涓浣嶅彉1锛涘綋妫娴嬪埌STOP涔嬪悗锛岃繖涓浣嶅彉0 #define I2C_MSTCMD_BUSY_Msk (0x01 << I2C_MSTCMD_BUSY_Pos) -#define I2C_MSTCMD_STO_Pos 6 //写:产生STOP,自动清零 +#define I2C_MSTCMD_STO_Pos 6 //鍐欙細浜х敓STOP锛岃嚜鍔ㄦ竻闆 #define I2C_MSTCMD_STO_Msk (0x01 << I2C_MSTCMD_STO_Pos) -#define I2C_MSTCMD_RXACK_Pos 7 //读:接收到的Slave的ACK位,0 收到ACK 1 收到NACK +#define I2C_MSTCMD_RXACK_Pos 7 //璇伙細鎺ユ敹鍒扮殑Slave鐨凙CK浣嶏紝0 鏀跺埌ACK 1 鏀跺埌NACK #define I2C_MSTCMD_RXACK_Msk (0x01 << I2C_MSTCMD_RXACK_Pos) -#define I2C_MSTCMD_STA_Pos 7 //写:产生START,自动清零 +#define I2C_MSTCMD_STA_Pos 7 //鍐欙細浜х敓START锛岃嚜鍔ㄦ竻闆 #define I2C_MSTCMD_STA_Msk (0x01 << I2C_MSTCMD_STA_Pos) -#define I2C_SLVCR_IM_RXEND_Pos 0 //接收完成中断禁止 +#define I2C_SLVCR_IM_RXEND_Pos 0 //鎺ユ敹瀹屾垚涓柇绂佹 #define I2C_SLVCR_IM_RXEND_Msk (0x01 << I2C_SLVCR_IM_RXEND_Pos) -#define I2C_SLVCR_IM_TXEND_Pos 1 //发送完成中断禁止 +#define I2C_SLVCR_IM_TXEND_Pos 1 //鍙戦佸畬鎴愪腑鏂姝 #define I2C_SLVCR_IM_TXEND_Msk (0x01 << I2C_SLVCR_IM_TXEND_Pos) -#define I2C_SLVCR_IM_STADET_Pos 2 //检测到起始中断禁止 +#define I2C_SLVCR_IM_STADET_Pos 2 //妫娴嬪埌璧峰涓柇绂佹 #define I2C_SLVCR_IM_STADET_Msk (0x01 << I2C_SLVCR_IM_STADET_Pos) -#define I2C_SLVCR_IM_STODET_Pos 3 //检测到停止中断禁止 +#define I2C_SLVCR_IM_STODET_Pos 3 //妫娴嬪埌鍋滄涓柇绂佹 #define I2C_SLVCR_IM_STODET_Msk (0x01 << I2C_SLVCR_IM_STODET_Pos) -#define I2C_SLVCR_IM_RDREQ_Pos 4 //接收到读请求中断禁止 +#define I2C_SLVCR_IM_RDREQ_Pos 4 //鎺ユ敹鍒拌璇锋眰涓柇绂佹 #define I2C_SLVCR_IM_RDREQ_Msk (0x01 << I2C_SLVCR_IM_RDREQ_Pos) -#define I2C_SLVCR_IM_WRREQ_Pos 5 //接收到写请求中断禁止 +#define I2C_SLVCR_IM_WRREQ_Pos 5 //鎺ユ敹鍒板啓璇锋眰涓柇绂佹 #define I2C_SLVCR_IM_WRREQ_Msk (0x01 << I2C_SLVCR_IM_WRREQ_Pos) -#define I2C_SLVCR_ADDR7b_Pos 16 //1 7位地址模式 0 10位地址模式 +#define I2C_SLVCR_ADDR7b_Pos 16 //1 7浣嶅湴鍧妯″紡 0 10浣嶅湴鍧妯″紡 #define I2C_SLVCR_ADDR7b_Msk (0x01 << I2C_SLVCR_ADDR7b_Pos) -#define I2C_SLVCR_ACK_Pos 17 //1 应答ACK 0 应答NACK +#define I2C_SLVCR_ACK_Pos 17 //1 搴旂瓟ACK 0 搴旂瓟NACK #define I2C_SLVCR_ACK_Msk (0x01 << I2C_SLVCR_ACK_Pos) -#define I2C_SLVCR_SLAVE_Pos 18 //1 从机模式 0 主机模式 +#define I2C_SLVCR_SLAVE_Pos 18 //1 浠庢満妯″紡 0 涓绘満妯″紡 #define I2C_SLVCR_SLAVE_Msk (0x01 << I2C_SLVCR_SLAVE_Pos) -#define I2C_SLVCR_DEBOUNCE_Pos 19 //去抖动使能 +#define I2C_SLVCR_DEBOUNCE_Pos 19 //鍘绘姈鍔ㄤ娇鑳 #define I2C_SLVCR_DEBOUNCE_Msk (0x01 << I2C_SLVCR_DEBOUNCE_Pos) -#define I2C_SLVCR_ADDR_Pos 20 //从机地址 +#define I2C_SLVCR_ADDR_Pos 20 //浠庢満鍦板潃 #define I2C_SLVCR_ADDR_Msk (0x3FF << I2C_SLVCR_ADDR_Pos) -#define I2C_SLVIF_RXEND_Pos 0 //接收完成中断标志,写1清零 +#define I2C_SLVIF_RXEND_Pos 0 //鎺ユ敹瀹屾垚涓柇鏍囧織锛屽啓1娓呴浂 #define I2C_SLVIF_RXEND_Msk (0x01 << I2C_SLVIF_RXEND_Pos) -#define I2C_SLVIF_TXEND_Pos 1 //发送完成中断标志,写1清零 +#define I2C_SLVIF_TXEND_Pos 1 //鍙戦佸畬鎴愪腑鏂爣蹇楋紝鍐1娓呴浂 #define I2C_SLVIF_TXEND_Msk (0x01 << I2C_SLVIF_TXEND_Pos) -#define I2C_SLVIF_STADET_Pos 2 //检测到起始中断标志,写1清零 +#define I2C_SLVIF_STADET_Pos 2 //妫娴嬪埌璧峰涓柇鏍囧織锛屽啓1娓呴浂 #define I2C_SLVIF_STADET_Msk (0x01 << I2C_SLVIF_STADET_Pos) -#define I2C_SLVIF_STODET_Pos 3 //检测到停止中断标志,写1清零 +#define I2C_SLVIF_STODET_Pos 3 //妫娴嬪埌鍋滄涓柇鏍囧織锛屽啓1娓呴浂 #define I2C_SLVIF_STODET_Msk (0x01 << I2C_SLVIF_STODET_Pos) -#define I2C_SLVIF_RDREQ_Pos 4 //接收到读请求中断标志 +#define I2C_SLVIF_RDREQ_Pos 4 //鎺ユ敹鍒拌璇锋眰涓柇鏍囧織 #define I2C_SLVIF_RDREQ_Msk (0x01 << I2C_SLVIF_RDREQ_Pos) -#define I2C_SLVIF_WRREQ_Pos 5 //接收到写请求中断标志 +#define I2C_SLVIF_WRREQ_Pos 5 //鎺ユ敹鍒板啓璇锋眰涓柇鏍囧織 #define I2C_SLVIF_WRREQ_Msk (0x01 << I2C_SLVIF_WRREQ_Pos) -#define I2C_SLVIF_ACTIVE_Pos 6 //slave 有效 +#define I2C_SLVIF_ACTIVE_Pos 6 //slave 鏈夋晥 #define I2C_SLVIF_ACTIVE_Msk (0x01 << I2C_SLVIF_ACTIVE_Pos) @@ -2056,7 +2056,7 @@ typedef struct { } ADC_TypeDef; -#define ADC_CTRL_CH0_Pos 0 //通道选中 +#define ADC_CTRL_CH0_Pos 0 //閫氶亾閫変腑 #define ADC_CTRL_CH0_Msk (0x01 << ADC_CTRL_CH0_Pos) #define ADC_CTRL_CH1_Pos 1 #define ADC_CTRL_CH1_Msk (0x01 << ADC_CTRL_CH1_Pos) @@ -2072,20 +2072,20 @@ typedef struct { #define ADC_CTRL_CH6_Msk (0x01 << ADC_CTRL_CH6_Pos) #define ADC_CTRL_CH7_Pos 7 #define ADC_CTRL_CH7_Msk (0x01 << ADC_CTRL_CH7_Pos) -#define ADC_CTRL_AVG_Pos 8 //0 1次采样 1 2次采样取平均值 3 4次采样取平均值 7 8次采样取平均值 15 16次采样取平均值 +#define ADC_CTRL_AVG_Pos 8 //0 1娆¢噰鏍 1 2娆¢噰鏍峰彇骞冲潎鍊 3 4娆¢噰鏍峰彇骞冲潎鍊 7 8娆¢噰鏍峰彇骞冲潎鍊 15 16娆¢噰鏍峰彇骞冲潎鍊 #define ADC_CTRL_AVG_Msk (0x0F << ADC_CTRL_AVG_Pos) #define ADC_CTRL_EN_Pos 12 #define ADC_CTRL_EN_Msk (0x01 << ADC_CTRL_EN_Pos) -#define ADC_CTRL_CONT_Pos 13 //Continuous conversion,只在软件启动模式下有效,0 单次转换,转换完成后START位自动清除停止转换 -#define ADC_CTRL_CONT_Msk (0x01 << ADC_CTRL_CONT_Pos) // 1 连续转换,启动后一直采样、转换,直到软件清除START位 -#define ADC_CTRL_TRIG_Pos 14 //转换触发方式:0 软件启动转换 1 PWM触发 +#define ADC_CTRL_CONT_Pos 13 //Continuous conversion锛屽彧鍦ㄨ蒋浠跺惎鍔ㄦā寮忎笅鏈夋晥锛0 鍗曟杞崲锛岃浆鎹㈠畬鎴愬悗START浣嶈嚜鍔ㄦ竻闄ゅ仠姝㈣浆鎹 +#define ADC_CTRL_CONT_Msk (0x01 << ADC_CTRL_CONT_Pos) // 1 杩炵画杞崲锛屽惎鍔ㄥ悗涓鐩撮噰鏍枫佽浆鎹紝鐩村埌杞欢娓呴櫎START浣 +#define ADC_CTRL_TRIG_Pos 14 //杞崲瑙﹀彂鏂瑰紡锛0 杞欢鍚姩杞崲 1 PWM瑙﹀彂 #define ADC_CTRL_TRIG_Msk (0x01 << ADC_CTRL_TRIG_Pos) #define ADC_CTRL_CLKSRC_Pos 15 //0 VCO 1 HRC #define ADC_CTRL_CLKSRC_Msk (0x01 << ADC_CTRL_CLKSRC_Pos) #define ADC_CTRL_FIFOCLR_Pos 24 //[24] CH0_FIFO_CLR [25] CH1_FIFO_CLR ... [31] CH7_FIFO_CLR #define ADC_CTRL_FIFOCLR_Msk (0xFFu<< ADC_CTRL_FIFOCLR_Pos) -#define ADC_START_GO_Pos 0 //软件触发模式下,写1启动ADC采样和转换,在单次模式下转换完成后硬件自动清零,在扫描模式下必须软件写0停止ADC转换 +#define ADC_START_GO_Pos 0 //杞欢瑙﹀彂妯″紡涓嬶紝鍐1鍚姩ADC閲囨牱鍜岃浆鎹紝鍦ㄥ崟娆℃ā寮忎笅杞崲瀹屾垚鍚庣‖浠惰嚜鍔ㄦ竻闆讹紝鍦ㄦ壂鎻忔ā寮忎笅蹇呴』杞欢鍐0鍋滄ADC杞崲 #define ADC_START_GO_Msk (0x01 << ADC_START_GO_Pos) #define ADC_START_BUSY_Pos 4 #define ADC_START_BUSY_Msk (0x01 << ADC_START_BUSY_Pos) @@ -2155,13 +2155,13 @@ typedef struct { #define ADC_IE_CH7FULL_Pos 31 #define ADC_IE_CH7FULL_Msk (0x01u<< ADC_IE_CH7FULL_Pos) -#define ADC_IF_CH0EOC_Pos 0 //写1清零 +#define ADC_IF_CH0EOC_Pos 0 //鍐1娓呴浂 #define ADC_IF_CH0EOC_Msk (0x01 << ADC_IF_CH0EOC_Pos) -#define ADC_IF_CH0OVF_Pos 1 //写1清零 +#define ADC_IF_CH0OVF_Pos 1 //鍐1娓呴浂 #define ADC_IF_CH0OVF_Msk (0x01 << ADC_IF_CH0OVF_Pos) -#define ADC_IF_CH0HFULL_Pos 2 //写1清零 +#define ADC_IF_CH0HFULL_Pos 2 //鍐1娓呴浂 #define ADC_IF_CH0HFULL_Msk (0x01 << ADC_IF_CH0HFULL_Pos) -#define ADC_IF_CH0FULL_Pos 3 //写1清零 +#define ADC_IF_CH0FULL_Pos 3 //鍐1娓呴浂 #define ADC_IF_CH0FULL_Msk (0x01 << ADC_IF_CH0FULL_Pos) #define ADC_IF_CH1EOC_Pos 4 #define ADC_IF_CH1EOC_Msk (0x01 << ADC_IF_CH1EOC_Pos) @@ -2220,9 +2220,9 @@ typedef struct { #define ADC_IF_CH7FULL_Pos 31 #define ADC_IF_CH7FULL_Msk (0x01 << ADC_IF_CH7FULL_Pos) -#define ADC_STAT_EOC_Pos 0 //写1清零 +#define ADC_STAT_EOC_Pos 0 //鍐1娓呴浂 #define ADC_STAT_EOC_Msk (0x01 << ADC_STAT_EOC_Pos) -#define ADC_STAT_OVF_Pos 1 //读数据寄存器清除 +#define ADC_STAT_OVF_Pos 1 //璇绘暟鎹瘎瀛樺櫒娓呴櫎 #define ADC_STAT_OVF_Msk (0x01 << ADC_STAT_OVF_Pos) #define ADC_STAT_HFULL_Pos 2 #define ADC_STAT_HFULL_Msk (0x01 << ADC_STAT_HFULL_Pos) @@ -2231,20 +2231,20 @@ typedef struct { #define ADC_STAT_EMPTY_Pos 4 #define ADC_STAT_EMPTY_Msk (0x01 << ADC_STAT_EMPTY_Pos) -#define ADC_CTRL1_RIN_Pos 4 //输入阻抗:0 无穷大 1 105K 2 90K 3 75K 4 60K 5 45K 6 30K 7 15K +#define ADC_CTRL1_RIN_Pos 4 //杈撳叆闃绘姉锛0 鏃犵┓澶 1 105K 2 90K 3 75K 4 60K 5 45K 6 30K 7 15K #define ADC_CTRL1_RIN_Msk (0x07 << ADC_CTRL1_RIN_Pos) -#define ADC_CTRL2_RESET_Pos 0 //数字电路复位 +#define ADC_CTRL2_RESET_Pos 0 //鏁板瓧鐢佃矾澶嶄綅 #define ADC_CTRL2_RESET_Msk (0x01 << ADC_CTRL2_RESET_Pos) -#define ADC_CTRL2_ADCEVCM_Pos 1 //ADC External VCM,ADC与PGA输出共模电平选择 +#define ADC_CTRL2_ADCEVCM_Pos 1 //ADC External VCM锛孉DC涓嶱GA杈撳嚭鍏辨ā鐢靛钩閫夋嫨 #define ADC_CTRL2_ADCEVCM_Msk (0x01 << ADC_CTRL2_ADCEVCM_Pos) -#define ADC_CTRL2_PGAIVCM_Pos 2 //PGA Internal VCM,PGA输入共模电平选择 +#define ADC_CTRL2_PGAIVCM_Pos 2 //PGA Internal VCM锛孭GA杈撳叆鍏辨ā鐢靛钩閫夋嫨 #define ADC_CTRL2_PGAIVCM_Msk (0x01 << ADC_CTRL2_PGAIVCM_Pos) #define ADC_CTRL2_PGAGAIN_Pos 3 //0 25.1dB 1 21.6dB 2 11.1dB 3 3.5dB 4 0dB(1.8V) 5 -2.9dB 6 -5.3dB #define ADC_CTRL2_PGAGAIN_Msk (0x07 << ADC_CTRL2_PGAGAIN_Pos) -#define ADC_CTRL2_REFPOUT_Pos 23 //1 ADC 内部 1.2V REFP电压输出到外部REFP引脚,用于测量,或在需要1.2V外部REFP时节省成本 +#define ADC_CTRL2_REFPOUT_Pos 23 //1 ADC 鍐呴儴 1.2V REFP鐢靛帇杈撳嚭鍒板閮≧EFP寮曡剼锛岀敤浜庢祴閲忥紝鎴栧湪闇瑕1.2V澶栭儴REFP鏃惰妭鐪佹垚鏈 #define ADC_CTRL2_REFPOUT_Msk (0x01 << ADC_CTRL2_REFPOUT_Pos -#define ADC_CTRL2_CLKDIV_Pos 24 //时钟分频,只在时钟源为HRC时有效 +#define ADC_CTRL2_CLKDIV_Pos 24 //鏃堕挓鍒嗛锛屽彧鍦ㄦ椂閽熸簮涓篐RC鏃舵湁鏁 #define ADC_CTRL2_CLKDIV_Msk (0x1F << ADC_CTRL2_CLKDIV_Pos) #define ADC_CTRL2_PGAVCM_Pos 29 #define ADC_CTRL2_PGAVCM_Msk (0x07u<< ADC_CTRL2_PGAVCM_Pos) @@ -2263,17 +2263,17 @@ typedef struct { typedef struct { - __IO uint32_t MODE; //0 普通模式,A、B两路输出互相独立 - //1 互补模式,A、B两路输出都由PERA、HIGHA控制,B路输出与A路输出极性相反,且DZA、DZB控制A、B路输出上升沿推迟时间 - //2 单次模式,同普通模式,但一个周期后自动停止 - //3 对称模式,A、B两路输出互相独立,以两个计数周期产生一个波形输出周期,分辨率提升一倍、频率降低一倍 - //4 对称互补模式,对称模式和互补模式的综合 + __IO uint32_t MODE; //0 鏅氭ā寮忥紝A銆丅涓よ矾杈撳嚭浜掔浉鐙珛 + //1 浜掕ˉ妯″紡锛孉銆丅涓よ矾杈撳嚭閮界敱PERA銆丠IGHA鎺у埗锛孊璺緭鍑轰笌A璺緭鍑烘瀬鎬х浉鍙嶏紝涓擠ZA銆丏ZB鎺у埗A銆丅璺緭鍑轰笂鍗囨部鎺ㄨ繜鏃堕棿 + //2 鍗曟妯″紡锛屽悓鏅氭ā寮忥紝浣嗕竴涓懆鏈熷悗鑷姩鍋滄 + //3 瀵圭О妯″紡锛孉銆丅涓よ矾杈撳嚭浜掔浉鐙珛锛屼互涓や釜璁℃暟鍛ㄦ湡浜х敓涓涓尝褰㈣緭鍑哄懆鏈燂紝鍒嗚鲸鐜囨彁鍗囦竴鍊嶃侀鐜囬檷浣庝竴鍊 + //4 瀵圭О浜掕ˉ妯″紡锛屽绉版ā寮忓拰浜掕ˉ妯″紡鐨勭患鍚 - __IO uint32_t PERA; //[15:0] 周期 + __IO uint32_t PERA; //[15:0] 鍛ㄦ湡 - __IO uint32_t HIGHA; //[15:0] 高电平持续时长 + __IO uint32_t HIGHA; //[15:0] 楂樼數骞虫寔缁椂闀 - __IO uint32_t DZA; //[9:0] 死区,即上升沿推迟时长,必须小于HIGHA + __IO uint32_t DZA; //[9:0] 姝诲尯锛屽嵆涓婂崌娌挎帹杩熸椂闀匡紝蹇呴』灏忎簬HIGHA __IO uint32_t PERB; @@ -2281,7 +2281,7 @@ typedef struct { __IO uint32_t DZB; - __IO uint32_t INIOUT; //Init Output level,初始输出电平 + __IO uint32_t INIOUT; //Init Output level锛屽垵濮嬭緭鍑虹數骞 } PWM_TypeDef; @@ -2314,7 +2314,7 @@ typedef struct { uint32_t RESERVED[3]; - __IO uint32_t HALT; //刹车控制 + __IO uint32_t HALT; //鍒硅溅鎺у埗 __IO uint32_t CHEN; @@ -2343,7 +2343,7 @@ typedef struct { #define PWMG_ADTRG_VALUE_Pos 0 #define PWMG_ADTRG_VALUE_Msk (0xFFFF << PWMG_ADTRG0A_VALUE_Pos) -#define PWMG_ADTRG_EVEN_Pos 16 //1 偶数周期生效 0 奇数周期生效 +#define PWMG_ADTRG_EVEN_Pos 16 //1 鍋舵暟鍛ㄦ湡鐢熸晥 0 濂囨暟鍛ㄦ湡鐢熸晥 #define PWMG_ADTRG_EVEN_Msk (0x01 << PWMG_ADTRG0A_EVEN_Pos) #define PWMG_ADTRG_EN_Pos 17 #define PWMG_ADTRG_EN_Msk (0x01 << PWMG_ADTRG0A_EN_Pos) @@ -2362,13 +2362,13 @@ typedef struct { #define PWMG_HALT_PWM4_Msk (0x01 << PWMG_HALT_PWM4_Pos) #define PWMG_HALT_PWM5_Pos 6 #define PWMG_HALT_PWM5_Msk (0x01 << PWMG_HALT_PWM5_Pos) -#define PWMG_HALT_STOPCNT_Pos 7 //1 刹车时将PWM计数器清零,停止计数 0 刹车时,PWM计数器继续计数 +#define PWMG_HALT_STOPCNT_Pos 7 //1 鍒硅溅鏃跺皢PWM璁℃暟鍣ㄦ竻闆讹紝鍋滄璁℃暟 0 鍒硅溅鏃讹紝PWM璁℃暟鍣ㄧ户缁鏁 #define PWMG_HALT_STOPCNT_Msk (0x01 << PWMG_HALT_STOPCNT_Pos) -#define PWMG_HALT_INLVL_Pos 8 //1 刹车输入高电平有效 +#define PWMG_HALT_INLVL_Pos 8 //1 鍒硅溅杈撳叆楂樼數骞虫湁鏁 #define PWMG_HALT_INLVL_Msk (0x01 << PWMG_HALT_INLVL_Pos) -#define PWMG_HALT_OUTLVL_Pos 9 //1 刹车过程中输出高电平 +#define PWMG_HALT_OUTLVL_Pos 9 //1 鍒硅溅杩囩▼涓緭鍑洪珮鐢靛钩 #define PWMG_HALT_OUTLVL_Msk (0x01 << PWMG_HALT_OUTLVL_Pos) -#define PWMG_HALT_STAT_Pos 10 //1 正在刹车 +#define PWMG_HALT_STAT_Pos 10 //1 姝e湪鍒硅溅 #define PWMG_HALT_STAT_Msk (0x01 << PWMG_HALT_STAT_Pos) #define PWMG_CHEN_PWM0A_Pos 0 @@ -2607,11 +2607,11 @@ typedef struct { typedef struct { __IO uint32_t EN; //[0] ENABLE - __IO uint32_t IE; //只有为1时,IF[CHx]在DMA传输结束时才能变为1,否则将一直保持在0 + __IO uint32_t IE; //鍙湁涓1鏃讹紝IF[CHx]鍦―MA浼犺緭缁撴潫鏃舵墠鑳藉彉涓1锛屽惁鍒欏皢涓鐩翠繚鎸佸湪0 - __IO uint32_t IM; //当为1时,即使IF[CHx]为1,dma_int也不会因此变1 + __IO uint32_t IM; //褰撲负1鏃讹紝鍗充娇IF[CHx]涓1锛宒ma_int涔熶笉浼氬洜姝ゅ彉1 - __IO uint32_t IF; //写1清零 + __IO uint32_t IF; //鍐1娓呴浂 uint32_t RESERVED[12]; @@ -2622,23 +2622,23 @@ typedef struct { __IO uint32_t SRC; - __IO uint32_t SRCSGADDR1; //只在Scatter Gather模式下使用 + __IO uint32_t SRCSGADDR1; //鍙湪Scatter Gather妯″紡涓嬩娇鐢 - __IO uint32_t SRCSGADDR2; //只在Scatter Gather模式下使用 + __IO uint32_t SRCSGADDR2; //鍙湪Scatter Gather妯″紡涓嬩娇鐢 - __IO uint32_t SRCSGADDR3; //只在Scatter Gather模式下使用 + __IO uint32_t SRCSGADDR3; //鍙湪Scatter Gather妯″紡涓嬩娇鐢 - __IO uint32_t SRCSGLEN; //只在Scatter Gather模式下使用 + __IO uint32_t SRCSGLEN; //鍙湪Scatter Gather妯″紡涓嬩娇鐢 __IO uint32_t DST; - __IO uint32_t DSTSGADDR1; //只在Scatter Gather模式下使用 + __IO uint32_t DSTSGADDR1; //鍙湪Scatter Gather妯″紡涓嬩娇鐢 - __IO uint32_t DSTSGADDR2; //只在Scatter Gather模式下使用 + __IO uint32_t DSTSGADDR2; //鍙湪Scatter Gather妯″紡涓嬩娇鐢 - __IO uint32_t DSTSGADDR3; //只在Scatter Gather模式下使用 + __IO uint32_t DSTSGADDR3; //鍙湪Scatter Gather妯″紡涓嬩娇鐢 - __IO uint32_t DSTSGLEN; //只在Scatter Gather模式下使用 + __IO uint32_t DSTSGLEN; //鍙湪Scatter Gather妯″紡涓嬩娇鐢 uint32_t RESERVED[4]; } CH[3]; @@ -2696,16 +2696,16 @@ typedef struct { #define DMA_IF_CH7_Pos 7 #define DMA_IF_CH7_Msk (0x01 << DMA_IF_CH7_Pos) -#define DMA_CR_LEN_Pos 0 //此通道传输总长度,0对应1字节,最大4096字节 +#define DMA_CR_LEN_Pos 0 //姝ら氶亾浼犺緭鎬婚暱搴︼紝0瀵瑰簲1瀛楄妭锛屾渶澶4096瀛楄妭 #define DMA_CR_LEN_Msk (0xFFF << DMA_CR_LEN_Pos) #define DMA_CR_RXEN_Pos 16 #define DMA_CR_RXEN_Msk (0x01 << DMA_CR_RXEN_Pos) #define DMA_CR_TXEN_Pos 17 #define DMA_CR_TXEN_Msk (0x01 << DMA_CR_TXEN_Pos) -#define DMA_CR_AUTORE_Pos 18 //Auto Restart, 通道在传输完成后,是否自动重新启动 +#define DMA_CR_AUTORE_Pos 18 //Auto Restart, 閫氶亾鍦ㄤ紶杈撳畬鎴愬悗锛屾槸鍚﹁嚜鍔ㄩ噸鏂板惎鍔 #define DMA_CR_AUTORE_Msk (0x01 << DMA_CR_AUTORE_Pos) -#define DMA_AM_SRCAM_Pos 0 //Address Mode 0 地址固定 1 地址递增 2 scatter gather模式 +#define DMA_AM_SRCAM_Pos 0 //Address Mode 0 鍦板潃鍥哄畾 1 鍦板潃閫掑 2 scatter gather妯″紡 #define DMA_AM_SRCAM_Msk (0x03 << DMA_AM_SRCAM_Pos) #define DMA_AM_DSTAM_Pos 8 #define DMA_AM_DSTAM_Msk (0x03 << DMA_AM_DSTAM_Pos) @@ -2722,7 +2722,7 @@ typedef struct { __I uint32_t SR; //Status Register - __I uint32_t IF; //Interrupt Flag,读取清零 + __I uint32_t IF; //Interrupt Flag锛岃鍙栨竻闆 __IO uint32_t IE; //Interrupt Enable @@ -2734,26 +2734,26 @@ typedef struct { uint32_t RESERVED2[3]; - __I uint32_t ALC; //Arbitration Lost Capture, 仲裁丢失捕捉 + __I uint32_t ALC; //Arbitration Lost Capture, 浠茶涓㈠け鎹曟崏 - __I uint32_t ECC; //Error code capture, 错误代码捕捉 + __I uint32_t ECC; //Error code capture, 閿欒浠g爜鎹曟崏 - __IO uint32_t EWLIM; //Error Warning Limit, 错误报警限制 + __IO uint32_t EWLIM; //Error Warning Limit, 閿欒鎶ヨ闄愬埗 - __IO uint32_t RXERR; //RX错误计数 + __IO uint32_t RXERR; //RX閿欒璁℃暟 - __IO uint32_t TXERR; //TX错误计数 + __IO uint32_t TXERR; //TX閿欒璁℃暟 union { - struct { //在复位时可读写,正常工作模式下不可访问 - __IO uint32_t ACR[4]; //Acceptance Check Register, 验收寄存器 + struct { //鍦ㄥ浣嶆椂鍙鍐欙紝姝e父宸ヤ綔妯″紡涓嬩笉鍙闂 + __IO uint32_t ACR[4]; //Acceptance Check Register, 楠屾敹瀵勫瓨鍣 - __IO uint32_t AMR[4]; //Acceptance Mask Register, 验收屏蔽寄存器;对应位写0,ID必须和验收寄存器匹配 + __IO uint32_t AMR[4]; //Acceptance Mask Register, 楠屾敹灞忚斀瀵勫瓨鍣紱瀵瑰簲浣嶅啓0锛孖D蹇呴』鍜岄獙鏀跺瘎瀛樺櫒鍖归厤 uint32_t RESERVED[5]; } FILTER; - union { //在正常工作模式下可读写,复位时不可访问 + union { //鍦ㄦ甯稿伐浣滄ā寮忎笅鍙鍐欙紝澶嶄綅鏃朵笉鍙闂 struct { __O uint32_t INFO; @@ -2772,7 +2772,7 @@ typedef struct { uint32_t RESERVED3[66]; - struct { //TXFRAME的读接口 + struct { //TXFRAME鐨勮鎺ュ彛 __I uint32_t INFO; __I uint32_t DATA[12]; @@ -2784,11 +2784,11 @@ typedef struct { #define CAN_CR_RST_Msk (0x01 << CAN_CR_RST_Pos) #define CAN_CR_LOM_Pos 1 //Listen Only Mode #define CAN_CR_LOM_Msk (0x01 << CAN_CR_LOM_Pos) -#define CAN_CR_STM_Pos 2 //Self Test Mode, 此模式下即使没有应答,CAN控制器也可以成功发送 +#define CAN_CR_STM_Pos 2 //Self Test Mode, 姝ゆā寮忎笅鍗充娇娌℃湁搴旂瓟锛孋AN鎺у埗鍣ㄤ篃鍙互鎴愬姛鍙戦 #define CAN_CR_STM_Msk (0x01 << CAN_CR_STM_Pos) -#define CAN_CR_AFM_Pos 3 //Acceptance Filter Mode, 1 单个验收滤波器(32位) 0 两个验收滤波器(16位) +#define CAN_CR_AFM_Pos 3 //Acceptance Filter Mode, 1 鍗曚釜楠屾敹婊ゆ尝鍣紙32浣嶏級 0 涓や釜楠屾敹婊ゆ尝鍣紙16浣嶏級 #define CAN_CR_AFM_Msk (0x01 << CAN_CR_AFM_Pos) -#define CAN_CR_SLEEP_Pos 4 //写1进入睡眠模式,有总线活动或中断时唤醒并自动清零此位 +#define CAN_CR_SLEEP_Pos 4 //鍐1杩涘叆鐫$湢妯″紡锛屾湁鎬荤嚎娲诲姩鎴栦腑鏂椂鍞ら啋骞惰嚜鍔ㄦ竻闆舵浣 #define CAN_CR_SLEEP_Msk (0x01 << CAN_CR_SLEEP_Pos) #define CAN_CMD_TXREQ_Pos 0 //Transmission Request @@ -2802,38 +2802,38 @@ typedef struct { #define CAN_CMD_SRR_Pos 4 //Self Reception Request #define CAN_CMD_SRR_Msk (0x01 << CAN_CMD_SRR_Pos) -#define CAN_SR_RXDA_Pos 0 //Receive Data Available,接收FIFO中有完整消息可以读取 +#define CAN_SR_RXDA_Pos 0 //Receive Data Available锛屾帴鏀禙IFO涓湁瀹屾暣娑堟伅鍙互璇诲彇 #define CAN_SR_RXDA_Msk (0x01 << CAN_SR_RXDA_Pos) -#define CAN_SR_RXOV_Pos 1 //Receive FIFO Overrun,新接收的信息由于接收FIFO已满而丢掉 +#define CAN_SR_RXOV_Pos 1 //Receive FIFO Overrun锛屾柊鎺ユ敹鐨勪俊鎭敱浜庢帴鏀禙IFO宸叉弧鑰屼涪鎺 #define CAN_SR_RXOV_Msk (0x01 << CAN_SR_RXOV_Pos) -#define CAN_SR_TXBR_Pos 2 //Transmit Buffer Release,0 正在处理前面的发送,现在不能写新的消息 1 可以写入新的消息发送 +#define CAN_SR_TXBR_Pos 2 //Transmit Buffer Release锛0 姝e湪澶勭悊鍓嶉潰鐨勫彂閫侊紝鐜板湪涓嶈兘鍐欐柊鐨勬秷鎭 1 鍙互鍐欏叆鏂扮殑娑堟伅鍙戦 #define CAN_SR_TXBR_Msk (0x01 << CAN_SR_TXBR_Pos) -#define CAN_SR_TXOK_Pos 3 //Transmit OK,successfully completed +#define CAN_SR_TXOK_Pos 3 //Transmit OK锛宻uccessfully completed #define CAN_SR_TXOK_Msk (0x01 << CAN_SR_TXOK_Pos) -#define CAN_SR_RXBUSY_Pos 4 //Receive Busy,正在接收 +#define CAN_SR_RXBUSY_Pos 4 //Receive Busy锛屾鍦ㄦ帴鏀 #define CAN_SR_RXBUSY_Msk (0x01 << CAN_SR_RXBUSY_Pos) -#define CAN_SR_TXBUSY_Pos 5 //Transmit Busy,正在发送 +#define CAN_SR_TXBUSY_Pos 5 //Transmit Busy锛屾鍦ㄥ彂閫 #define CAN_SR_TXBUSY_Msk (0x01 << CAN_SR_TXBUSY_Pos) -#define CAN_SR_ERRWARN_Pos 6 //1 至少一个错误计数器达到 Warning Limit +#define CAN_SR_ERRWARN_Pos 6 //1 鑷冲皯涓涓敊璇鏁板櫒杈惧埌 Warning Limit #define CAN_SR_ERRWARN_Msk (0x01 << CAN_SR_ERRWARN_Pos) -#define CAN_SR_BUSOFF_Pos 7 //1 CAN 控制器处于总线关闭状态,没有参与到总线活动 +#define CAN_SR_BUSOFF_Pos 7 //1 CAN 鎺у埗鍣ㄥ浜庢荤嚎鍏抽棴鐘舵侊紝娌℃湁鍙備笌鍒版荤嚎娲诲姩 #define CAN_SR_BUSOFF_Msk (0x01 << CAN_SR_BUSOFF_Pos) #define CAN_IF_RXDA_Pos 0 //IF.RXDA = SR.RXDA & IE.RXDA #define CAN_IF_RXDA_Msk (0x01 << CAN_IF_RXDA_Pos) -#define CAN_IF_TXBR_Pos 1 //当IE.TXBR=1时,SR.TXBR由0变成1将置位此位 +#define CAN_IF_TXBR_Pos 1 //褰揑E.TXBR=1鏃讹紝SR.TXBR鐢0鍙樻垚1灏嗙疆浣嶆浣 #define CAN_IF_TXBR_Msk (0x01 << CAN_IF_TXBR_Pos) -#define CAN_IF_ERRWARN_Pos 2 //当IE.ERRWARN=1时,SR.ERRWARN或SR.BUSOFF 0-to-1 或 1-to-0将置位此位 +#define CAN_IF_ERRWARN_Pos 2 //褰揑E.ERRWARN=1鏃讹紝SR.ERRWARN鎴朣R.BUSOFF 0-to-1 鎴 1-to-0灏嗙疆浣嶆浣 #define CAN_IF_ERRWARN_Msk (0x01 << CAN_IF_ERRWARN_Pos) #define CAN_IF_RXOV_Pos 3 //IF.RXOV = SR.RXOV & IE.RXOV #define CAN_IF_RXOV_Msk (0x01 << CAN_IF_RXOV_Pos) -#define CAN_IF_WKUP_Pos 4 //当IE.WKUP=1时,在睡眠模式下的CAN控制器检测到总线活动时硬件置位 +#define CAN_IF_WKUP_Pos 4 //褰揑E.WKUP=1鏃讹紝鍦ㄧ潯鐪犳ā寮忎笅鐨凜AN鎺у埗鍣ㄦ娴嬪埌鎬荤嚎娲诲姩鏃剁‖浠剁疆浣 #define CAN_IF_WKUP_Msk (0x01 << CAN_IF_WKUP_Pos) #define CAN_IF_ERRPASS_Pos 5 // #define CAN_IF_ERRPASS_Msk (0x01 << CAN_IF_ERRPASS_Pos) -#define CAN_IF_ARBLOST_Pos 6 //Arbitration Lost,当IE.ARBLOST=1时,CAN控制器丢失仲裁变成接收方时硬件置位 +#define CAN_IF_ARBLOST_Pos 6 //Arbitration Lost锛屽綋IE.ARBLOST=1鏃讹紝CAN鎺у埗鍣ㄤ涪澶变徊瑁佸彉鎴愭帴鏀舵柟鏃剁‖浠剁疆浣 #define CAN_IF_ARBLOST_Msk (0x01 << CAN_IF_ARBLOST_Pos) -#define CAN_IF_BUSERR_Pos 7 //当IE.BUSERR=1时,CAN控制器检测到总线错误时硬件置位 +#define CAN_IF_BUSERR_Pos 7 //褰揑E.BUSERR=1鏃讹紝CAN鎺у埗鍣ㄦ娴嬪埌鎬荤嚎閿欒鏃剁‖浠剁疆浣 #define CAN_IF_BUSERR_Msk (0x01 << CAN_IF_BUSERR_Pos) #define CAN_IE_RXDA_Pos 0 @@ -2853,68 +2853,68 @@ typedef struct { #define CAN_IE_BUSERR_Pos 7 #define CAN_IE_BUSERR_Msk (0x01 << CAN_IE_BUSERR_Pos) -#define CAN_BT0_BRP_Pos 0 //Baud Rate Prescaler,CAN时间单位=2*Tsysclk*(BRP+1) +#define CAN_BT0_BRP_Pos 0 //Baud Rate Prescaler锛孋AN鏃堕棿鍗曚綅=2*Tsysclk*(BRP+1) #define CAN_BT0_BRP_Msk (0x3F << CAN_BT0_BRP_Pos) #define CAN_BT0_SJW_Pos 6 //Synchronization Jump Width #define CAN_BT0_SJW_Msk (0x03 << CAN_BT0_SJW_Pos) -#define CAN_BT1_TSEG1_Pos 0 //t_tseg1 = CAN时间单位 * (TSEG1+1) +#define CAN_BT1_TSEG1_Pos 0 //t_tseg1 = CAN鏃堕棿鍗曚綅 * (TSEG1+1) #define CAN_BT1_TSEG1_Msk (0x0F << CAN_BT1_TSEG1_Pos) -#define CAN_BT1_TSEG2_Pos 4 //t_tseg2 = CAN时间单位 * (TSEG2+1) +#define CAN_BT1_TSEG2_Pos 4 //t_tseg2 = CAN鏃堕棿鍗曚綅 * (TSEG2+1) #define CAN_BT1_TSEG2_Msk (0x07 << CAN_BT1_TSEG2_Pos) -#define CAN_BT1_SAM_Pos 7 //采样次数 0: sampled once 1: sampled three times +#define CAN_BT1_SAM_Pos 7 //閲囨牱娆℃暟 0: sampled once 1: sampled three times #define CAN_BT1_SAM_Msk (0x01 << CAN_BT1_SAM_Pos) #define CAN_ECC_SEGCODE_Pos 0 //Segment Code #define CAN_ECC_SEGCODE_Msk (0x1F << CAN_ECC_SEGCODE_Pos) #define CAN_ECC_DIR_Pos 5 //0 error occurred during transmission 1 during reception #define CAN_ECC_DIR_Msk (0x01 << CAN_ECC_DIR_Pos) -#define CAN_ECC_ERRCODE_Pos 6 //Error Code:0 Bit error 1 Form error 2 Stuff error 3 other error +#define CAN_ECC_ERRCODE_Pos 6 //Error Code锛0 Bit error 1 Form error 2 Stuff error 3 other error #define CAN_ECC_ERRCODE_Msk (0x03 << CAN_ECC_ERRCODE_Pos) #define CAN_INFO_DLC_Pos 0 //Data Length Control #define CAN_INFO_DLC_Msk (0x0F << CAN_INFO_DLC_Pos) -#define CAN_INFO_RTR_Pos 6 //Remote Frame,1 远程帧 0 数据帧 +#define CAN_INFO_RTR_Pos 6 //Remote Frame锛1 杩滅▼甯 0 鏁版嵁甯 #define CAN_INFO_RTR_Msk (0x01 << CAN_INFO_RTR_Pos) -#define CAN_INFO_FF_Pos 7 //Frame Format,0 标准帧格式 1 扩展帧格式 +#define CAN_INFO_FF_Pos 7 //Frame Format锛0 鏍囧噯甯ф牸寮 1 鎵╁睍甯ф牸寮 #define CAN_INFO_FF_Msk (0x01 << CAN_INFO_FF_Pos) typedef struct { - __IO uint32_t IE; //[0] 为0的时候,IF[0]维持为0 + __IO uint32_t IE; //[0] 涓0鐨勬椂鍊欙紝IF[0]缁存寔涓0 - __IO uint32_t IF; //[0] 当完成指定长度的数据传输时置1,写1清零 + __IO uint32_t IF; //[0] 褰撳畬鎴愭寚瀹氶暱搴︾殑鏁版嵁浼犺緭鏃剁疆1锛屽啓1娓呴浂 - __IO uint32_t IM; //[0] 当该寄存器为1时,LCDC的中断不会输出给系统的中断控制寄存器 + __IO uint32_t IM; //[0] 褰撹瀵勫瓨鍣ㄤ负1鏃讹紝LCDC鐨勪腑鏂笉浼氳緭鍑虹粰绯荤粺鐨勪腑鏂帶鍒跺瘎瀛樺櫒 __IO uint32_t START; - __IO uint32_t SRCADDR; //数据源地址寄存器,必须字对齐(即地址的低2位必须是0) + __IO uint32_t SRCADDR; //鏁版嵁婧愬湴鍧瀵勫瓨鍣紝蹇呴』瀛楀榻愶紙鍗冲湴鍧鐨勪綆2浣嶅繀椤绘槸0锛 __IO uint32_t CR0; __IO uint32_t CR1; - __IO uint32_t PRECMDV; //在MPU接口中,发送数据前,RS拉低的那一拍,数据总线上的值 + __IO uint32_t PRECMDV; //鍦∕PU鎺ュ彛涓紝鍙戦佹暟鎹墠锛孯S鎷変綆鐨勯偅涓鎷嶏紝鏁版嵁鎬荤嚎涓婄殑鍊 } LCD_TypeDef; -#define LCD_START_GO_Pos 1 //写1开始传输数据,数据传输结束后自动清零 +#define LCD_START_GO_Pos 1 //鍐1寮濮嬩紶杈撴暟鎹紝鏁版嵁浼犺緭缁撴潫鍚庤嚜鍔ㄦ竻闆 #define LCD_START_GO_Msk (0x01 << LCD_START_GO_Pos) #define LCD_START_BURST_Pos 2 #define LCD_START_BURST_Msk (0x01 << LCD_START_BURST_Pos) -#define LCD_CR0_VPIX_Pos 0 //当portrait为0时,表示垂直方向的像素个数,0表示1个,最大为767 - //当portrait为1时,表示水平方向的像素个数,0表示1个,最大为767 +#define LCD_CR0_VPIX_Pos 0 //褰損ortrait涓0鏃讹紝琛ㄧず鍨傜洿鏂瑰悜鐨勫儚绱犱釜鏁帮紝0琛ㄧず1涓紝鏈澶т负767 + //褰損ortrait涓1鏃讹紝琛ㄧず姘村钩鏂瑰悜鐨勫儚绱犱釜鏁帮紝0琛ㄧず1涓紝鏈澶т负767 #define LCD_CR0_VPIX_Msk (0x3FF << LCD_CR0_VPIX_Pos) -#define LCD_CR0_HPIX_Pos 10 //当portrait为0时,表示水平方向的像素个数,0表示1个,最大为1023 - //当portrait为1时,表示垂直方向的像素个数,0表示1个,最大为1023 +#define LCD_CR0_HPIX_Pos 10 //褰損ortrait涓0鏃讹紝琛ㄧず姘村钩鏂瑰悜鐨勫儚绱犱釜鏁帮紝0琛ㄧず1涓紝鏈澶т负1023 + //褰損ortrait涓1鏃讹紝琛ㄧず鍨傜洿鏂瑰悜鐨勫儚绱犱釜鏁帮紝0琛ㄧず1涓紝鏈澶т负1023 #define LCD_CR0_HPIX_Msk (0x3FF << LCD_CR0_HPIX_Pos) -#define LCD_CR0_DCLK_Pos 20 //0 DOTCLK一直翻转 1 DOTCLK在空闲时停在1 +#define LCD_CR0_DCLK_Pos 20 //0 DOTCLK涓鐩寸炕杞 1 DOTCLK鍦ㄧ┖闂叉椂鍋滃湪1 #define LCD_CR0_DCLK_Msk (0x01 << LCD_CR0_DCLK_Pos) -#define LCD_CR0_HLOW_Pos 21 //输出HSYNC低电平持续多少个DOTCLK周期,0表示1个周期 +#define LCD_CR0_HLOW_Pos 21 //杈撳嚭HSYNC浣庣數骞虫寔缁灏戜釜DOTCLK鍛ㄦ湡锛0琛ㄧず1涓懆鏈 #define LCD_CR0_HLOW_Msk (0x03 << LCD_CR0_HLOW_Pos) #define LCD_CR1_VFP_Pos 1 @@ -2925,9 +2925,9 @@ typedef struct { #define LCD_CR1_HFP_Msk (0x1F << LCD_CR1_HFP_Pos) #define LCD_CR1_HBP_Pos 14 #define LCD_CR1_HBP_Msk (0x7F << LCD_CR1_HBP_Pos) -#define LCD_CR1_DCLKDIV_Pos 21 //DOTCLK相对于模块时钟的分频比,0表示2分频,1表示4分频 ... +#define LCD_CR1_DCLKDIV_Pos 21 //DOTCLK鐩稿浜庢ā鍧楁椂閽熺殑鍒嗛姣旓紝0琛ㄧず2鍒嗛锛1琛ㄧず4鍒嗛 ... #define LCD_CR1_DCLKDIV_Msk (0x1F << LCD_CR1_DCLKDIV_Pos) -#define LCD_CR1_DCLKINV_Pos 26 //1 输出DOTCLK反向,应用于用DOTCLK下降沿采样数据的屏 +#define LCD_CR1_DCLKINV_Pos 26 //1 杈撳嚭DOTCLK鍙嶅悜锛屽簲鐢ㄤ簬鐢―OTCLK涓嬮檷娌块噰鏍锋暟鎹殑灞 #define LCD_CR1_DCLKINV_Msk (0x01 << LCD_CR1_DCLKINV_Pos) @@ -2966,9 +2966,9 @@ typedef struct { } SDIO_TypeDef; -#define SDIO_BLK_SIZE_Pos 0 //0x200 512字节 0x400 1024字节 0x800 2048字节 +#define SDIO_BLK_SIZE_Pos 0 //0x200 512瀛楄妭 0x400 1024瀛楄妭 0x800 2048瀛楄妭 #define SDIO_BLK_SIZE_Msk (0xFFF << SDIO_BLK_SIZE_Pos) -#define SDIO_BLK_COUNT_Pos 16 //0 Stop Transfer 1 1块 2 2块 ... ... +#define SDIO_BLK_COUNT_Pos 16 //0 Stop Transfer 1 1鍧 2 2鍧 ... ... #define SDIO_BLK_COUNT_Msk (0xFFF << SDIO_BLK_COUNT_Pos) #define SDIO_CMD_DMAEN_Pos 0 @@ -2981,7 +2981,7 @@ typedef struct { #define SDIO_CMD_DIRREAD_Msk (0x01 << SDIO_CMD_DIRREAD_Pos) #define SDIO_CMD_MULTBLK_Pos 5 //0 Single Block 1 Multiple Block #define SDIO_CMD_MULTBLK_Msk (0x01 << SDIO_CMD_MULTBLK_Pos) -#define SDIO_CMD_RESPTYPE_Pos 16 //响应类型,0 无响应 1 136位响应 2 48位响应 3 48位响应,Busy after response +#define SDIO_CMD_RESPTYPE_Pos 16 //鍝嶅簲绫诲瀷锛0 鏃犲搷搴 1 136浣嶅搷搴 2 48浣嶅搷搴 3 48浣嶅搷搴旓紝Busy after response #define SDIO_CMD_RESPTYPE_Msk (0x03 << SDIO_CMD_RESPTYPE_Pos) #define SDIO_CMD_CRCCHECK_Pos 19 //Command CRC Check Enable #define SDIO_CMD_CRCCHECK_Msk (0x01 << SDIO_CMD_CRCCHECK_Pos) @@ -2991,7 +2991,7 @@ typedef struct { #define SDIO_CMD_HAVEDATA_Msk (0x01 << SDIO_CMD_HAVEDATA_Pos) #define SDIO_CMD_CMDTYPE_Pos 22 //0 NORMAL 1 SUSPEND 2 RESUME 3 ABORT #define SDIO_CMD_CMDTYPE_Msk (0x03 << SDIO_CMD_CMDTYPE_Pos) -#define SDIO_CMD_CMDINDX_Pos 24 //Command Index,CMD0-63、ACMD0-63 +#define SDIO_CMD_CMDINDX_Pos 24 //Command Index锛孋MD0-63銆丄CMD0-63 #define SDIO_CMD_CMDINDX_Msk (0x3F << SDIO_CMD_CMDINDX_Pos) #define SDIO_CR1_4BIT_Pos 1 //1 4 bit mode 0 1 bit mode @@ -3000,7 +3000,7 @@ typedef struct { #define SDIO_CR1_8BIT_Msk (0x01 << SDIO_CR1_8BIT_Pos) #define SDIO_CR1_CDBIT_Pos 6 //0 No Card 1 Card Inserted #define SDIO_CR1_CDBIT_Msk (0x01 << SDIO_CR1_CDBIT_Pos) -#define SDIO_CR1_CDSRC_Pos 7 //Card Detect Source, 1 CR1.CDBIT位 0 SD_Detect引脚 +#define SDIO_CR1_CDSRC_Pos 7 //Card Detect Source, 1 CR1.CDBIT浣 0 SD_Detect寮曡剼 #define SDIO_CR1_CDSRC_Msk (0x01 << SDIO_CR1_CDSRC_Pos) #define SDIO_CR1_PWRON_Pos 8 //1 Power on 0 Power off #define SDIO_CR1_PWRON_Msk (0x01 << SDIO_CR1_PWRON_Pos) @@ -3013,7 +3013,7 @@ typedef struct { #define SDIO_CR2_CLKRDY_Msk (0x01 << SDIO_CR2_CLKRDY_Pos) #define SDIO_CR2_SDCLKEN_Pos 2 //SDCLK Enable #define SDIO_CR2_SDCLKEN_Msk (0x01 << SDIO_CR2_SDCLKEN_Pos) -#define SDIO_CR2_SDCLKDIV_Pos 8 //SDCLK Frequency Div, 0x00 不分频 0x01 2分频 0x02 4分频 0x04 8分频 0x08 16分频 ... 0x80 256分频 +#define SDIO_CR2_SDCLKDIV_Pos 8 //SDCLK Frequency Div, 0x00 涓嶅垎棰 0x01 2鍒嗛 0x02 4鍒嗛 0x04 8鍒嗛 0x08 16鍒嗛 ... 0x80 256鍒嗛 #define SDIO_CR2_SDCLKDIV_Msk (0xFF << SDIO_CR2_SDCLKDIV_Pos) #define SDIO_CR2_TIMEOUT_Pos 16 //0 TMCLK*2^13 1 TMCLK*2^14 ... 14 TMCLK*2^27 #define SDIO_CR2_TIMEOUT_Msk (0x0F << SDIO_CR2_TIMEOUT_Pos) @@ -3190,11 +3190,11 @@ typedef struct { } SRAMC_TypeDef; -#define SRAMC_CR_RWTIME_Pos 0 //读写操作持续多少个时钟周期。0表示1个时钟周期。最小设置为4 +#define SRAMC_CR_RWTIME_Pos 0 //璇诲啓鎿嶄綔鎸佺画澶氬皯涓椂閽熷懆鏈熴0琛ㄧず1涓椂閽熷懆鏈熴傛渶灏忚缃负4 #define SRAMC_CR_RWTIME_Msk (0x0F << SRAMC_CR_RWTIME_Pos) -#define SRAMC_CR_BYTEIF_Pos 4 //外部SRAM数据宽度,0 16位 1 8位 +#define SRAMC_CR_BYTEIF_Pos 4 //澶栭儴SRAM鏁版嵁瀹藉害锛0 16浣 1 8浣 #define SRAMC_CR_BYTEIF_Msk (0x01 << SRAMC_CR_BYTEIF_Pos) -#define SRAMC_CR_HBLBDIS_Pos 5 //1 ADDR[23:22]为地址线 0 ADDR[23]为高字节使能,ADDR[22]为低字节使能 +#define SRAMC_CR_HBLBDIS_Pos 5 //1 ADDR[23:22]涓哄湴鍧绾 0 ADDR[23]涓洪珮瀛楄妭浣胯兘锛孉DDR[22]涓轰綆瀛楄妭浣胯兘 #define SRAMC_CR_HBLBDIS_Msk (0x01 << SRAMC_CR_HBLBDIS_Pos) @@ -3206,17 +3206,17 @@ typedef struct { __IO uint32_t REFRESH; - __IO uint32_t NOPNUM; //[15:0] 初始化完成后,在正常操作之前,发送多少个NOP命令 + __IO uint32_t NOPNUM; //[15:0] 鍒濆鍖栧畬鎴愬悗锛屽湪姝e父鎿嶄綔涔嬪墠锛屽彂閫佸灏戜釜NOP鍛戒护 __IO uint32_t LATCH; - __IO uint32_t REFDONE; //[0] Frefresh Done,上电初始化完成 + __IO uint32_t REFDONE; //[0] Frefresh Done锛屼笂鐢靛垵濮嬪寲瀹屾垚 } SDRAMC_TypeDef; -#define SDRAMC_CR0_BURSTLEN_Pos 0 //必须取2,表示Burst Length为4 +#define SDRAMC_CR0_BURSTLEN_Pos 0 //蹇呴』鍙2锛岃〃绀築urst Length涓4 #define SDRAMC_CR0_BURSTLEN_Msk (0x07 << SDRAMC_CR0_BURSTLEN_Pos) -#define SDRAMC_CR0_CASDELAY_Pos 4 //CAS Latency, 2 2 3 3 +#define SDRAMC_CR0_CASDELAY_Pos 4 //CAS Latency锛 2 2 3 3 #define SDRAMC_CR0_CASDELAY_Msk (0x07 << SDRAMC_CR0_CASDELAY_Pos) #define SDRAMC_CR1_TRP_Pos 0 @@ -3231,15 +3231,15 @@ typedef struct { #define SDRAMC_CR1_TRRD_Msk (0x03 << SDRAMC_CR1_TRRD_Pos) #define SDRAMC_CR1_TMRD_Pos 15 #define SDRAMC_CR1_TMRD_Msk (0x07 << SDRAMC_CR1_TMRD_Pos) -#define SDRAMC_CR1_32BIT_Pos 18 //SDRAMC的接口数据位宽,1 32bit 0 16bit +#define SDRAMC_CR1_32BIT_Pos 18 //SDRAMC鐨勬帴鍙f暟鎹綅瀹斤紝1 32bit 0 16bit #define SDRAMC_CR1_32BIT_Msk (0x01 << SDRAMC_CR1_32BIT_Pos) -#define SDRAMC_CR1_BANK_Pos 19 //SDRAM每个颗粒有几个bank,0 2 banks 1 4 banks +#define SDRAMC_CR1_BANK_Pos 19 //SDRAM姣忎釜棰楃矑鏈夊嚑涓猙ank锛0 2 banks 1 4 banks #define SDRAMC_CR1_BANK_Msk (0x01 << SDRAMC_CR1_BANK_Pos) -#define SDRAMC_CR1_CELL32BIT_Pos 20 //SDRAM颗粒的位宽,1 32bit 0 16bit +#define SDRAMC_CR1_CELL32BIT_Pos 20 //SDRAM棰楃矑鐨勪綅瀹斤紝1 32bit 0 16bit #define SDRAMC_CR1_CELL32BIT_Msk (0x01 << SDRAMC_CR1_CELL32BIT_Pos) -#define SDRAMC_CR1_CELLSIZE_Pos 21 //SDRAM颗粒的容量,0 64Mb 1 128Mb 2 256Mb 3 16Mb +#define SDRAMC_CR1_CELLSIZE_Pos 21 //SDRAM棰楃矑鐨勫閲忥紝0 64Mb 1 128Mb 2 256Mb 3 16Mb #define SDRAMC_CR1_CELLSIZE_Msk (0x03 << SDRAMC_CR1_CELLSIZE_Pos) -#define SDRAMC_CR1_HIGHSPEED_Pos 23 //当hclk大于100MHz时,这一位必须配置为1,否则为0 +#define SDRAMC_CR1_HIGHSPEED_Pos 23 //褰揾clk澶т簬100MHz鏃讹紝杩欎竴浣嶅繀椤婚厤缃负1锛屽惁鍒欎负0 #define SDRAMC_CR1_HIGHSPEED_Msk (0x01 << SDRAMC_CR1_HIGHSPEED_Pos) #define SDRAMC_REFRESH_RATE_Pos 0 @@ -3247,9 +3247,9 @@ typedef struct { #define SDRAMC_REFRESH_EN_Pos 12 #define SDRAMC_REFRESH_EN_Msk (0x01 << SDRAMC_REFRESH_EN_Pos) -#define SDRAMC_LATCH_INEDGE_Pos 0 //哪个沿来锁存从SDRAM中读回的数据,0 上升沿 1 下降沿 +#define SDRAMC_LATCH_INEDGE_Pos 0 //鍝釜娌挎潵閿佸瓨浠嶴DRAM涓鍥炵殑鏁版嵁锛0 涓婂崌娌 1 涓嬮檷娌 #define SDRAMC_LATCH_INEDGE_Msk (0x01 << SDRAMC_LATCH_INEDGE_Pos) -#define SDRAMC_LATCH_OUTEDGE_Pos 1 //哪个沿去锁存送给SDRAM的数据,1 上升沿 0 下降沿 +#define SDRAMC_LATCH_OUTEDGE_Pos 1 //鍝釜娌垮幓閿佸瓨閫佺粰SDRAM鐨勬暟鎹紝1 涓婂崌娌 0 涓嬮檷娌 #define SDRAMC_LATCH_OUTEDGE_Msk (0x01 << SDRAMC_LATCH_OUTEDGE_Pos) #define SDRAMC_LATCH_WAITST_Pos 2 #define SDRAMC_LATCH_WAITST_Msk (0x01 << SDRAMC_LATCH_WAITST_Pos) @@ -3260,7 +3260,7 @@ typedef struct { typedef struct { __IO uint32_t IE; - __IO uint32_t IF; //写1清零 + __IO uint32_t IF; //鍐1娓呴浂 __IO uint32_t IM; @@ -3287,16 +3287,16 @@ typedef struct { #define NORFLC_IM_TIMEOUT_Pos 1 #define NORFLC_IM_TIMEOUT_Msk (0x01 << NORFLC_IM_TIMEOUT_Pos) -#define NORFLC_CR_RDTIME_Pos 0 //Oen下降沿后多少个时钟周期后采样读回的数据。0表示1个时钟周期 +#define NORFLC_CR_RDTIME_Pos 0 //Oen涓嬮檷娌垮悗澶氬皯涓椂閽熷懆鏈熷悗閲囨牱璇诲洖鐨勬暟鎹0琛ㄧず1涓椂閽熷懆鏈 #define NORFLC_CR_RDTIME_Msk (0x1F << NORFLC_CR_RDTIME_Pos) -#define NORFLC_CR_WRTIME_Pos 5 //输出Wen的低电平宽度。0表示1个时钟周期 +#define NORFLC_CR_WRTIME_Pos 5 //杈撳嚭Wen鐨勪綆鐢靛钩瀹藉害銆0琛ㄧず1涓椂閽熷懆鏈 #define NORFLC_CR_WRTIME_Msk (0x07 << NORFLC_CR_WRTIME_Pos) -#define NORFLC_CR_BYTEIF_Pos 8 //外部NOR FLASH数据宽度,1 8位 0 16位 +#define NORFLC_CR_BYTEIF_Pos 8 //澶栭儴NOR FLASH鏁版嵁瀹藉害锛1 8浣 0 16浣 #define NORFLC_CR_BYTEIF_Msk (0x01 << NORFLC_CR_BYTEIF_Pos) -#define NORFLC_CMD_DATA_Pos 0 //在PROGRAM命令中,DATA是要写入NOR FLASH的数据;在READ命令中,DATA是从NOR FLASH读回的数据 +#define NORFLC_CMD_DATA_Pos 0 //鍦≒ROGRAM鍛戒护涓紝DATA鏄鍐欏叆NOR FLASH鐨勬暟鎹紱鍦≧EAD鍛戒护涓紝DATA鏄粠NOR FLASH璇诲洖鐨勬暟鎹 #define NORFLC_CMD_DATA_Msk (0xFFFF << NORFLC_CMD_DATA_Pos) -#define NORFLC_CMD_CMD_Pos 16 //需要执行的命令,0 READ 1 RESET 2 AUTOMATIC SELECT 3 PROGRAM 4 CHIP ERASE 5 SECTOR ERASE +#define NORFLC_CMD_CMD_Pos 16 //闇瑕佹墽琛岀殑鍛戒护锛0 READ 1 RESET 2 AUTOMATIC SELECT 3 PROGRAM 4 CHIP ERASE 5 SECTOR ERASE #define NORFLC_CMD_CMD_Msk (0x07 << NORFLC_CMD_CMD_Pos) @@ -3315,44 +3315,44 @@ typedef struct { #define CRC_CR_EN_Pos 0 #define CRC_CR_EN_Msk (0x01 << CRC_CR_EN_Pos) -#define CRC_CR_OREV_Pos 1 //输出结果是否翻转 +#define CRC_CR_OREV_Pos 1 //杈撳嚭缁撴灉鏄惁缈昏浆 #define CRC_CR_OREV_Msk (0x01 << CRC_CR_OREV_Pos) -#define CRC_CR_ONOT_Pos 2 //输出结果是否取反 +#define CRC_CR_ONOT_Pos 2 //杈撳嚭缁撴灉鏄惁鍙栧弽 #define CRC_CR_ONOT_Msk (0x01 << CRC_CR_ONOT_Pos) #define CRC_CR_CRC16_Pos 3 //1 CRC16 0 CRC32 #define CRC_CR_CRC16_Msk (0x01 << CRC_CR_CRC16_Pos) -#define CRC_CR_IBITS_Pos 4 //输入数据有效位数 0 32位 1 16位 2 8位 +#define CRC_CR_IBITS_Pos 4 //杈撳叆鏁版嵁鏈夋晥浣嶆暟 0 32浣 1 16浣 2 8浣 #define CRC_CR_IBITS_Msk (0x03 << CRC_CR_IBITS_Pos) typedef struct { - __IO uint32_t MINSEC; //分秒计数 + __IO uint32_t MINSEC; //鍒嗙璁℃暟 - __IO uint32_t DATHUR; //日时计数 + __IO uint32_t DATHUR; //鏃ユ椂璁℃暟 - __IO uint32_t MONDAY; //月周计数 + __IO uint32_t MONDAY; //鏈堝懆璁℃暟 - __IO uint32_t YEAR; //[11:0] 年计数,支持1901-2199 + __IO uint32_t YEAR; //[11:0] 骞磋鏁帮紝鏀寔1901-2199 - __IO uint32_t MINSECAL; //分秒闹铃设置 + __IO uint32_t MINSECAL; //鍒嗙闂归搩璁剧疆 - __IO uint32_t DAYHURAL; //周时闹铃设置 + __IO uint32_t DAYHURAL; //鍛ㄦ椂闂归搩璁剧疆 - __IO uint32_t LOAD; //将设置寄存器中的值同步到RTC中,同步完成自动清零 + __IO uint32_t LOAD; //灏嗚缃瘎瀛樺櫒涓殑鍊煎悓姝ュ埌RTC涓紝鍚屾瀹屾垚鑷姩娓呴浂 __IO uint32_t IE; - __IO uint32_t IF; //写1清零 + __IO uint32_t IF; //鍐1娓呴浂 - __IO uint32_t EN; //[0] 1 RTC使能 + __IO uint32_t EN; //[0] 1 RTC浣胯兘 - __IO uint32_t CFGABLE; //[0] 1 RTC可配置 + __IO uint32_t CFGABLE; //[0] 1 RTC鍙厤缃 - __IO uint32_t TRIM; //时钟调整 + __IO uint32_t TRIM; //鏃堕挓璋冩暣 - __IO uint32_t TRIMM; //时钟微调整 + __IO uint32_t TRIMM; //鏃堕挓寰皟鏁 } RTC_TypeDef; @@ -3361,44 +3361,44 @@ typedef struct { #define RTC_LOAD_ALARM_Pos 1 #define RTC_LOAD_ALARM_Msk (0x01 << RTC_LOAD_ALARM_Pos) -#define RTC_MINSEC_SEC_Pos 0 //秒计数,取值0--59 +#define RTC_MINSEC_SEC_Pos 0 //绉掕鏁帮紝鍙栧0--59 #define RTC_MINSEC_SEC_Msk (0x3F << RTC_MINSEC_SEC_Pos) -#define RTC_MINSEC_MIN_Pos 6 //分钟计数,取值0--59 +#define RTC_MINSEC_MIN_Pos 6 //鍒嗛挓璁℃暟锛屽彇鍊0--59 #define RTC_MINSEC_MIN_Msk (0x3F << RTC_MINSEC_MIN_Pos) -#define RTC_DATHUR_HOUR_Pos 0 //小时计数,取值0--23 +#define RTC_DATHUR_HOUR_Pos 0 //灏忔椂璁℃暟锛屽彇鍊0--23 #define RTC_DATHUR_HOUR_Msk (0x1F << RTC_DATHUR_HOUR_Pos) -#define RTC_DATHUR_DATE_Pos 5 //date of month,取值1--31 +#define RTC_DATHUR_DATE_Pos 5 //date of month锛屽彇鍊1--31 #define RTC_DATHUR_DATE_Msk (0x1F << RTC_DATHUR_DATE_Pos) -#define RTC_MONDAY_DAY_Pos 0 //day of week,取值0--6 +#define RTC_MONDAY_DAY_Pos 0 //day of week锛屽彇鍊0--6 #define RTC_MONDAY_DAY_Msk (0x07 << RTC_MONDAY_DAY_Pos) -#define RTC_MONDAY_MON_Pos 3 //月份计数,取值1--12 +#define RTC_MONDAY_MON_Pos 3 //鏈堜唤璁℃暟锛屽彇鍊1--12 #define RTC_MONDAY_MON_Msk (0x0F << RTC_MONDAY_MON_Pos) -#define RTC_MINSECAL_SEC_Pos 0 //闹钟秒设置 +#define RTC_MINSECAL_SEC_Pos 0 //闂归挓绉掕缃 #define RTC_MINSECAL_SEC_Msk (0x3F << RTC_MINSECAL_SEC_Pos) -#define RTC_MINSECAL_MIN_Pos 6 //闹钟分钟设置 +#define RTC_MINSECAL_MIN_Pos 6 //闂归挓鍒嗛挓璁剧疆 #define RTC_MINSECAL_MIN_Msk (0x3F << RTC_MINSECAL_MIN_Pos) -#define RTC_DAYHURAL_HOUR_Pos 0 //闹钟小时设置 +#define RTC_DAYHURAL_HOUR_Pos 0 //闂归挓灏忔椂璁剧疆 #define RTC_DAYHURAL_HOUR_Msk (0x1F << RTC_DAYHURAL_HOUR_Pos) -#define RTC_DAYHURAL_SUN_Pos 5 //周日闹钟有效 +#define RTC_DAYHURAL_SUN_Pos 5 //鍛ㄦ棩闂归挓鏈夋晥 #define RTC_DAYHURAL_SUN_Msk (0x01 << RTC_DAYHURAL_SUN_Pos) -#define RTC_DAYHURAL_MON_Pos 6 //周一闹钟有效 +#define RTC_DAYHURAL_MON_Pos 6 //鍛ㄤ竴闂归挓鏈夋晥 #define RTC_DAYHURAL_MON_Msk (0x01 << RTC_DAYHURAL_MON_Pos) -#define RTC_DAYHURAL_TUE_Pos 7 //周二闹钟有效 +#define RTC_DAYHURAL_TUE_Pos 7 //鍛ㄤ簩闂归挓鏈夋晥 #define RTC_DAYHURAL_TUE_Msk (0x01 << RTC_DAYHURAL_TUE_Pos) -#define RTC_DAYHURAL_WED_Pos 8 //周三闹钟有效 +#define RTC_DAYHURAL_WED_Pos 8 //鍛ㄤ笁闂归挓鏈夋晥 #define RTC_DAYHURAL_WED_Msk (0x01 << RTC_DAYHURAL_WED_Pos) -#define RTC_DAYHURAL_THU_Pos 9 //周四闹钟有效 +#define RTC_DAYHURAL_THU_Pos 9 //鍛ㄥ洓闂归挓鏈夋晥 #define RTC_DAYHURAL_THU_Msk (0x01 << RTC_DAYHURAL_THU_Pos) -#define RTC_DAYHURAL_FRI_Pos 10 //周五闹钟有效 +#define RTC_DAYHURAL_FRI_Pos 10 //鍛ㄤ簲闂归挓鏈夋晥 #define RTC_DAYHURAL_FRI_Msk (0x01 << RTC_DAYHURAL_FRI_Pos) -#define RTC_DAYHURAL_SAT_Pos 11 //周六闹钟有效 +#define RTC_DAYHURAL_SAT_Pos 11 //鍛ㄥ叚闂归挓鏈夋晥 #define RTC_DAYHURAL_SAT_Msk (0x01 << RTC_DAYHURAL_SAT_Pos) -#define RTC_IE_SEC_Pos 0 //秒中断使能 +#define RTC_IE_SEC_Pos 0 //绉掍腑鏂娇鑳 #define RTC_IE_SEC_Msk (0x01 << RTC_IE_SEC_Pos) #define RTC_IE_MIN_Pos 1 #define RTC_IE_MIN_Msk (0x01 << RTC_IE_MIN_Pos) @@ -3409,7 +3409,7 @@ typedef struct { #define RTC_IE_ALARM_Pos 4 #define RTC_IE_ALARM_Msk (0x01 << RTC_IE_ALARM_Pos) -#define RTC_IF_SEC_Pos 0 //写1清零 +#define RTC_IF_SEC_Pos 0 //鍐1娓呴浂 #define RTC_IF_SEC_Msk (0x01 << RTC_IF_SEC_Pos) #define RTC_IF_MIN_Pos 1 #define RTC_IF_MIN_Msk (0x01 << RTC_IF_MIN_Pos) @@ -3420,13 +3420,13 @@ typedef struct { #define RTC_IF_ALARM_Pos 4 #define RTC_IF_ALARM_Msk (0x01 << RTC_IF_ALARM_Pos) -#define RTC_TRIM_ADJ_Pos 0 //用于调整BASECNT的计数周期,默认为32768,如果DEC为1,则计数周期调整为32768-ADJ,否则调整为32768+ADJ +#define RTC_TRIM_ADJ_Pos 0 //鐢ㄤ簬璋冩暣BASECNT鐨勮鏁板懆鏈燂紝榛樿涓32768锛屽鏋淒EC涓1锛屽垯璁℃暟鍛ㄦ湡璋冩暣涓32768-ADJ锛屽惁鍒欒皟鏁翠负32768+ADJ #define RTC_TRIM_ADJ_Msk (0xFF << RTC_TRIM_ADJ_Pos) #define RTC_TRIM_DEC_Pos 8 #define RTC_TRIM_DEC_Msk (0x01 << RTC_TRIM_DEC_Pos) -#define RTC_TRIMM_CYCLE_Pos 0 //用于计数周期微调,如果INC为1,则第n个计数周期调整为(32768±ADJ)+1,否则调整为(32768±ADJ)-1 - //cycles=0时,不进行微调整;cycles=1,则n为2;cycles=7,则n为8;以此类推 +#define RTC_TRIMM_CYCLE_Pos 0 //鐢ㄤ簬璁℃暟鍛ㄦ湡寰皟锛屽鏋淚NC涓1锛屽垯绗琻涓鏁板懆鏈熻皟鏁翠负(32768卤ADJ)+1,鍚﹀垯璋冩暣涓(32768卤ADJ)-1 + //cycles=0鏃讹紝涓嶈繘琛屽井璋冩暣锛沜ycles=1锛屽垯n涓2锛沜ycles=7锛屽垯n涓8锛涗互姝ょ被鎺 #define RTC_TRIMM_CYCLE_Msk (0x07 << RTC_TRIMM_CYCLE_Pos) #define RTC_TRIMM_INC_Pos 3 #define RTC_TRIMM_INC_Msk (0x01 << RTC_TRIMM_INC_Pos) @@ -3435,15 +3435,15 @@ typedef struct { typedef struct { - __IO uint32_t LOAD; //喂狗使计数器装载LOAD值 + __IO uint32_t LOAD; //鍠傜嫍浣胯鏁板櫒瑁呰浇LOAD鍊 __I uint32_t VALUE; __IO uint32_t CR; - __IO uint32_t IF; //计数到0时硬件置位,软件写1清除标志 + __IO uint32_t IF; //璁℃暟鍒0鏃剁‖浠剁疆浣嶏紝杞欢鍐1娓呴櫎鏍囧織 - __IO uint32_t FEED; //写0x55喂狗 + __IO uint32_t FEED; //鍐0x55鍠傜嫍 } WDT_TypeDef; diff --git a/bsp/swm320/libraries/CMSIS/DeviceSupport/startup/arm/startup_SWM320.s b/bsp/swm320/libraries/CMSIS/DeviceSupport/startup/arm/startup_SWM320.s index 72562473f2..aa7fb9c2cf 100644 --- a/bsp/swm320/libraries/CMSIS/DeviceSupport/startup/arm/startup_SWM320.s +++ b/bsp/swm320/libraries/CMSIS/DeviceSupport/startup/arm/startup_SWM320.s @@ -1,10 +1,10 @@ ;****************************************************************************************************************************************** -; 文件名称: startup_SWM320.s -; 功能说明: SWM2400单片机的启动文件 -; 技术支持: http://www.synwit.com.cn/e/tool/gbook/?bid=1 -; 注意事项: -; 版本日期: V1.1.0 2017年10月25日 -; 升级记录: +; 鏂囦欢鍚嶇О: startup_SWM320.s +; 鍔熻兘璇存槑: SWM2400鍗曠墖鏈虹殑鍚姩鏂囦欢 +; 鎶鏈敮鎸: http://www.synwit.com.cn/e/tool/gbook/?bid=1 +; 娉ㄦ剰浜嬮」: +; 鐗堟湰鏃ユ湡: V1.1.0 2017骞10鏈25鏃 +; 鍗囩骇璁板綍: ; ; ;****************************************************************************************************************************************** diff --git a/bsp/swm320/libraries/CMSIS/DeviceSupport/system_SWM320.c b/bsp/swm320/libraries/CMSIS/DeviceSupport/system_SWM320.c index a99fa78fc9..08f5a59bc3 100644 --- a/bsp/swm320/libraries/CMSIS/DeviceSupport/system_SWM320.c +++ b/bsp/swm320/libraries/CMSIS/DeviceSupport/system_SWM320.c @@ -1,10 +1,10 @@ /****************************************************************************************************************************************** -* 文件名称: system_SWM320.c -* 功能说明: SWM320单片机的时钟设置 -* 技术支持: http://www.synwit.com.cn/e/tool/gbook/?bid=1 -* 注意事项: -* 版本日期: V1.1.0 2017年10月25日 -* 升级记录: +* 鏂囦欢鍚嶇О: system_SWM320.c +* 鍔熻兘璇存槑: SWM320鍗曠墖鏈虹殑鏃堕挓璁剧疆 +* 鎶鏈敮鎸: http://www.synwit.com.cn/e/tool/gbook/?bid=1 +* 娉ㄦ剰浜嬮」: +* 鐗堟湰鏃ユ湡: V1.1.0 2017骞10鏈25鏃 +* 鍗囩骇璁板綍: * * ******************************************************************************************************************************************* @@ -23,13 +23,13 @@ /****************************************************************************************************************************************** - * 系统时钟设定 + * 绯荤粺鏃堕挓璁惧畾 *****************************************************************************************************************************************/ -#define SYS_CLK_20MHz 0 //0 内部高频20MHz RC振荡器 -#define SYS_CLK_40MHz 1 //1 内部高频40MHz RC振荡器 -#define SYS_CLK_32KHz 2 //2 内部低频32KHz RC振荡器 -#define SYS_CLK_XTAL 3 //3 外部晶体振荡器(2-30MHz) -#define SYS_CLK_PLL 4 //4 片内锁相环输出 +#define SYS_CLK_20MHz 0 //0 鍐呴儴楂橀20MHz RC鎸崱鍣 +#define SYS_CLK_40MHz 1 //1 鍐呴儴楂橀40MHz RC鎸崱鍣 +#define SYS_CLK_32KHz 2 //2 鍐呴儴浣庨32KHz RC鎸崱鍣 +#define SYS_CLK_XTAL 3 //3 澶栭儴鏅朵綋鎸崱鍣紙2-30MHz锛 +#define SYS_CLK_PLL 4 //4 鐗囧唴閿佺浉鐜緭鍑 #define SYS_CLK SYS_CLK_PLL @@ -40,16 +40,16 @@ #define SYS_CLK_DIV SYS_CLK_DIV_1 -#define __HSI (20000000UL) //高速内部时钟 -#define __LSI ( 32000UL) //低速内部时钟 -#define __HSE (20000000UL) //高速外部时钟 +#define __HSI (20000000UL) //楂橀熷唴閮ㄦ椂閽 +#define __LSI ( 32000UL) //浣庨熷唴閮ㄦ椂閽 +#define __HSE (20000000UL) //楂橀熷閮ㄦ椂閽 -/********************************** PLL 设定 ********************************************** - * VCO输出频率 = PLL输入时钟 / INDIV * 4 * FBDIV - * PLL输出频率 = PLL输入时钟 / INDIV * 4 * FBDIV / OUTDIV = VCO输出频率 / OUTDIV +/********************************** PLL 璁惧畾 ********************************************** + * VCO杈撳嚭棰戠巼 = PLL杈撳叆鏃堕挓 / INDIV * 4 * FBDIV + * PLL杈撳嚭棰戠巼 = PLL杈撳叆鏃堕挓 / INDIV * 4 * FBDIV / OUTDIV = VCO杈撳嚭棰戠巼 / OUTDIV *****************************************************************************************/ -#define SYS_PLL_SRC SYS_CLK_20MHz //可取值SYS_CLK_20MHz、SYS_CLK_XTAL +#define SYS_PLL_SRC SYS_CLK_20MHz //鍙彇鍊糞YS_CLK_20MHz銆丼YS_CLK_XTAL #define PLL_IN_DIV 5 @@ -69,11 +69,11 @@ uint32_t CyclesPerUs = (__HSI / 1000000); //Cycles per micro second /****************************************************************************************************************************************** -* 函数名称: -* 功能说明: This function is used to update the variable SystemCoreClock and must be called whenever the core clock is changed -* 输 入: -* 输 出: -* 注意事项: +* 鍑芥暟鍚嶇О: +* 鍔熻兘璇存槑: This function is used to update the variable SystemCoreClock and must be called whenever the core clock is changed +* 杈 鍏: +* 杈 鍑: +* 娉ㄦ剰浜嬮」: ******************************************************************************************************************************************/ void SystemCoreClockUpdate(void) { @@ -122,11 +122,11 @@ void SystemCoreClockUpdate(void) } /****************************************************************************************************************************************** -* 函数名称: -* 功能说明: The necessary initializaiton of systerm -* 输 入: -* 输 出: -* 注意事项: +* 鍑芥暟鍚嶇О: +* 鍔熻兘璇存槑: The necessary initializaiton of systerm +* 杈 鍏: +* 杈 鍑: +* 娉ㄦ剰浜嬮」: ******************************************************************************************************************************************/ void SystemInit(void) { @@ -136,23 +136,23 @@ void SystemInit(void) switch(SYS_CLK) { - case SYS_CLK_20MHz: //0 内部高频20MHz RC振荡器 + case SYS_CLK_20MHz: //0 鍐呴儴楂橀20MHz RC鎸崱鍣 switchCLK_20MHz(); break; - case SYS_CLK_40MHz: //1 内部高频40MHz RC振荡器 + case SYS_CLK_40MHz: //1 鍐呴儴楂橀40MHz RC鎸崱鍣 switchCLK_40MHz(); break; - case SYS_CLK_32KHz: //2 内部低频32KHz RC振荡器 + case SYS_CLK_32KHz: //2 鍐呴儴浣庨32KHz RC鎸崱鍣 switchCLK_32KHz(); break; - case SYS_CLK_XTAL: //3 外部晶体振荡器(2-30MHz) + case SYS_CLK_XTAL: //3 澶栭儴鏅朵綋鎸崱鍣紙2-30MHz锛 switchCLK_XTAL(); break; - case SYS_CLK_PLL: //4 片内锁相环输出 + case SYS_CLK_PLL: //4 鐗囧唴閿佺浉鐜緭鍑 switchCLK_PLL(); break; } @@ -276,5 +276,5 @@ void PLLInit(void) SYS->PLLCR &= ~(1 << SYS_PLLCR_OFF_Pos); - while(SYS->PLLLOCK == 0); //等待PLL锁定 + while(SYS->PLLLOCK == 0); //绛夊緟PLL閿佸畾 }