debug.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /********************************** (C) COPYRIGHT *******************************
  2. * File Name : debug.h
  3. * Author : WCH
  4. * Version : V1.0.0
  5. * Date : 2021/06/06
  6. * Description : This file contains all the functions prototypes for UART
  7. * Printf , Delay functions.
  8. *********************************************************************************
  9. * Copyright (c) 2021 Nanjing Qinheng Microelectronics Co., Ltd.
  10. * Attention: This software (modified or not) and binary are used for
  11. * microcontroller manufactured by Nanjing Qinheng Microelectronics.
  12. *******************************************************************************/
  13. #ifndef __DEBUG_H
  14. #define __DEBUG_H
  15. #ifdef __cplusplus
  16. extern "C" {
  17. #endif
  18. #include "stdio.h"
  19. #include "ch32v30x.h"
  20. /* UART Printf Definition */
  21. #define DEBUG_UART1 1
  22. #define DEBUG_UART2 2
  23. #define DEBUG_UART3 3
  24. #define DEBUG_UART7 7
  25. /* DEBUG UATR Definition */
  26. #ifndef DEBUG
  27. #define DEBUG DEBUG_UART7
  28. #endif
  29. /* SDI Printf Definition */
  30. #define SDI_PR_CLOSE 0
  31. #define SDI_PR_OPEN 1
  32. #ifndef SDI_PRINT
  33. #define SDI_PRINT SDI_PR_CLOSE
  34. #endif
  35. void Delay_Init(void);
  36. void Delay_Us (uint32_t n);
  37. void Delay_Ms (uint32_t n);
  38. void USART_Printf_Init(uint32_t baudrate);
  39. void SDI_Printf_Enable(void);
  40. #ifdef __cplusplus
  41. }
  42. #endif
  43. #endif