33 lines
698 B
C

#ifndef __DEBUG_H
#define __DEBUG_H
#include <ch32v00x.h>
#include <stdio.h>
/* UART Printf Definition */
#define DEBUG_UART1_NoRemap 1 // Tx-PD5
#define DEBUG_UART1_Remap1 2 // Tx-PD0
#define DEBUG_UART1_Remap2 3 // Tx-PD6
#define DEBUG_UART1_Remap3 4 // Tx-PC0
/* DEBUG UATR Definition */
#ifndef DEBUG
# define DEBUG DEBUG_UART1_NoRemap
#endif
/* SDI Printf Definition */
#define SDI_PR_CLOSE 0
#define SDI_PR_OPEN 1
#ifndef SDI_PRINT
# define SDI_PRINT SDI_PR_CLOSE
#endif
void Delay_Init(void);
void Delay_Us(uint32_t n);
void Delay_Ms(uint32_t n);
void USART_Printf_Init(uint32_t baudrate);
void SDI_Printf_Enable(void);
#endif /* __DEBUG_H */