printf.h
Go to the documentation of this file.
1 
2 /********************************************************************************************************
3  * @file printf.h
4  *
5  * @brief This is the header file for TLSR8258
6  *
7  * @author Driver Group
8  * @date May 8, 2018
9  *
10  * @par Copyright (c) 2018, Telink Semiconductor (Shanghai) Co., Ltd.
11  * All rights reserved.
12  *
13  * The information contained herein is confidential property of Telink
14  * Semiconductor (Shanghai) Co., Ltd. and is available under the terms
15  * of Commercial License Agreement between Telink Semiconductor (Shanghai)
16  * Co., Ltd. and the licensee or the terms described here-in. This heading
17  * MUST NOT be removed from this file.
18  *
19  * Licensees are granted free, non-transferable use of the information in this
20  * file under Mutual Non-Disclosure Agreement. NO WARRENTY of ANY KIND is provided.
21  * @par History:
22  * 1.initial release(DEC. 26 2018)
23  *
24  * @version A001
25  *
26  *******************************************************************************************************/
27 #include "gpio.h"
28 #pragma once
29 
30 #if(DEBUG_MODE==1)
31 
32 #define DEBUG_IO 1
33 #define DEBUG_USB 2
34 
35 #define DEBUG_BUS 2
36 
37 #if (DEBUG_BUS==DEBUG_USB)
38 
44 void usb_printf(const char *format, ...);
45 #define printf usb_printf
46 #elif (DEBUG_BUS==DEBUG_IO)
47 #define PRINT_BAUD_RATE 1000000 //1M baud rate,should Not bigger than 1Mb/s
48 #define DEBUG_INFO_TX_PIN GPIO_PC5
49 #define TX_PIN_GPIO_EN() gpio_set_func(DEBUG_INFO_TX_PIN , AS_GPIO);
50 #define TX_PIN_PULLUP_1M() gpio_setup_up_down_resistor(DEBUG_INFO_TX_PIN, PM_PIN_PULLUP_1M);
51 #define TX_PIN_OUTPUT_EN() gpio_set_output_en(DEBUG_INFO_TX_PIN,1)
52 #define TX_PIN_OUTPUT_REG (0x583+((DEBUG_INFO_TX_PIN>>8)<<3))
53 
60 void io_printf(const char *format, ...);
61 
62 #define printf io_printf
63 #endif
64 #else
65 
66 static inline void no_printf(const char *format, ...)
67 {
68  return;
69 }
70 #define printf no_printf
71 
72 #endif
73 
static void no_printf(const char *format,...)
Definition: printf.h:66