Skip to content

Documenting UART Example #2

@yathAg

Description

@yathAg

I have tested the code for UART Tx. If someone is willing to test the code for Rx and document everything, please make a pull request for the same.

Here is the code for TX

#include <ch32v00x.h>
#include <stdio.h>
#include "debug.h"

int main(void)
{
	NVIC_PriorityGroupConfig(NVIC_PriorityGroup_2);
	SystemCoreClockUpdate();
	Delay_Init();
	USART_Printf_Init(115200);
	Delay_Ms(1000); // give serial monitor time to open
	printf("SystemClk: %u\r\n", (unsigned)SystemCoreClock);
	printf("DeviceID: %08x\r\n", (unsigned)DBGMCU_GetDEVID());

	while (1)
	{
		Delay_Ms(1000);
		printf("Hello From VSDSquadron Mini!!");
	}
}

void NMI_Handler(void) __attribute__((interrupt("WCH-Interrupt-fast")));
void NMI_Handler(void) {}
void HardFault_Handler(void) __attribute__((interrupt("WCH-Interrupt-fast")));
void HardFault_Handler(void)
{
	while (1)
	{
	}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions