28 #include "pprzlink/pprzlink_device.h"
30 #define _PrintString(out_fun, s) { \
42 dev->put_byte(
dev->periph, 0,
s[i]);
47 #define _PrintHex(out_fun, c) { \
48 const uint8_t hex[16] = { '0', '1', '2', '3', '4', '5', '6', '7', \
49 '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' }; \
50 uint8_t high = (c & 0xF0)>>4; \
51 uint8_t low = c & 0x0F; \
59 {
'0',
'1',
'2',
'3',
'4',
'5',
'6',
'7',
60 '8',
'9',
'A',
'B',
'C',
'D',
'E',
'F' };
63 dev->put_byte(
dev->periph, 0, hex[high]);
64 dev->put_byte(
dev->periph, 0, hex[low]);
67 #define _PrintHex16(out_fun, c ) { \
68 uint8_t high16 = (uint8_t)(c>>8); \
69 uint8_t low16 = (uint8_t)(c); \
70 _PrintHex(out_fun, high16); \
71 _PrintHex(out_fun, low16); \
82 #define _PrintHex32(out_fun, c ) { \
83 uint16_t high32 = (uint16_t)(c>>16); \
84 uint16_t low32 = (uint16_t)(c); \
85 _PrintHex16(out_fun, high32); \
86 _PrintHex16(out_fun, low32); \
99 #define UART0PrintHex(c) _PrintHex(UART0Transmit, c)
100 #define UART0PrintHex16(c) _PrintHex16(UART0Transmit, c)
101 #define UART0PrintHex32(c) _PrintHex32(UART0Transmit, c)
102 #define UART0PrintString(s) _PrintString(UART0Transmit, s)
108 #define UART1PrintHex(c) _PrintHex(UART1Transmit, c)
109 #define UART1PrintHex16(c) _PrintHex16(UART1Transmit, c)
110 #define UART1PrintHex32(c) _PrintHex32(UART1Transmit, c)
111 #define UART1PrintString(s) _PrintString(UART1Transmit, s)
117 #define UART2PrintHex(c) _PrintHex(UART2Transmit, c)
118 #define UART2PrintHex16(c) _PrintHex16(UART2Transmit, c)
119 #define UART2PrintHex32(c) _PrintHex32(UART2Transmit, c)
120 #define UART2PrintString(s) _PrintString(UART2Transmit, s)
126 #define UART3PrintHex(c) _PrintHex(UART3Transmit, c)
127 #define UART3PrintHex16(c) _PrintHex16(UART3Transmit, c)
128 #define UART3PrintHex32(c) _PrintHex32(UART3Transmit, c)
129 #define UART3PrintString(s) _PrintString(UART3Transmit, s)
135 #define UART4PrintHex(c) _PrintHex(UART4Transmit, c)
136 #define UART4PrintHex16(c) _PrintHex16(UART4Transmit, c)
137 #define UART4PrintHex32(c) _PrintHex32(UART4Transmit, c)
138 #define UART4PrintString(s) _PrintString(UART4Transmit, s)
144 #define UART5PrintHex(c) _PrintHex(UART5Transmit, c)
145 #define UART5PrintHex16(c) _PrintHex16(UART5Transmit, c)
146 #define UART5PrintHex32(c) _PrintHex32(UART5Transmit, c)
147 #define UART5PrintString(s) _PrintString(UART5Transmit, s)
153 #define UART6PrintHex(c) _PrintHex(UART6Transmit, c)
154 #define UART6PrintHex16(c) _PrintHex16(UART6Transmit, c)
155 #define UART6PrintHex32(c) _PrintHex32(UART6Transmit, c)
156 #define UART6PrintString(s) _PrintString(UART6Transmit, s)
160 #define UsbSPrintHex(c) _PrintHex(VCOM_putchar, c)
161 #define UsbSPrintHex16(c) _PrintHex16(VCOM_putchar, c)
162 #define UsbSPrintString(s) _PrintString(VCOM_putchar, s)
static const struct usb_device_descriptor dev
arch independent UART (Universal Asynchronous Receiver/Transmitter) API
static void print_hex32(struct link_device *dev, uint32_t c)
static void print_hex16(struct link_device *dev, uint16_t c)
static void print_string(struct link_device *dev, char *s)
static void print_hex(struct link_device *dev, uint8_t c)
unsigned short uint16_t
Typedef defining 16 bit unsigned short type.
unsigned int uint32_t
Typedef defining 32 bit unsigned int type.
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.