
CH32V203系列是基於32位元RISC-V核心設計的工業級增強型通用微控制器,高效能,最高支援144MHz系統主頻,運作功耗低至49.3uA/MHz。機等豐富的周邊資源,同時提供TSSOP20、QFN28、QFN48X7、LQFP32、LQFP48等多種封裝供客戶彈性選擇。

1、資料手冊:CH32V203DS0.PDF,CH32FV2x_V3xRM.PDF
2、CH32V203評估板說明及參考應用範例:CH32V20xEVT.ZIP
3、整合開發環境(IDE):MounRiver Studio(MRS)
https://www.wch.cn/products/CH32V203.html

/********************************** (C) COPYRIGHT *******************************
 * File Name          : main.c
 * Author             : WCH
 * Version            : V1.0.0
 * Date               : 2021/06/06
 * Description        : Main program body.
 *********************************************************************************
 * Copyright (c) 2021 Nanjing Qinheng Microelectronics Co., Ltd.
 * Attention: This software (modified or not) and binary are used for 
 * microcontroller manufactured by Nanjing Qinheng Microelectronics.
 *******************************************************************************/
/*
 *@Note
 *USART Print debugging routine:
 *USART1_Tx(PA9).
 *This example demonstrates using USART1(PA9) as a print debug port output.
 *
 */
#include "debug.h"
/* Global typedef */
/* Global define */
/* Global Variable */
//=========== External function ====================
//==================================================
void GPIO_Toggle_INIT(void)
{
    GPIO_InitTypeDef GPIO_InitStructure = {0};
    RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB, ENABLE);
    GPIO_InitStructure.GPIO_Pin = GPIO_Pin_9;
    GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
    GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
    GPIO_Init(GPIOB, &GPIO_InitStructure);
}
/*********************************************************************
 * @fn      main
 *
 * @brief   Main program.
 *
 * @return  none
 */
int main(void)
{
    NVIC_PriorityGroupConfig(NVIC_PriorityGroup_1);
    SystemCoreClockUpdate();
    Delay_Init();
    USART_Printf_Init(115200);
    printf("SystemClk:%d\r\n", SystemCoreClock);
    printf( "ChipID:%08x\r\n", DBGMCU_GetCHIPID() );
    printf("This is printf example\r\n");
    GPIO_Toggle_INIT();
    while(1)
    {
        GPIO_WriteBit(GPIOB, GPIO_Pin_9, Bit_RESET);
        Delay_Ms(250);
        GPIO_WriteBit(GPIOB, GPIO_Pin_9, Bit_SET);
        Delay_Ms(250);
    }
}