Paparazzi UAS  v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
uart_print.h File Reference
#include "mcu_periph/uart.h"
#include "mcu_periph/usb_serial.h"
#include "pprzlink/pprzlink_device.h"
+ Include dependency graph for uart_print.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define _PrintString(out_fun, s)
 
#define _PrintHex(out_fun, c)
 
#define _PrintHex16(out_fun, c)
 
#define _PrintHex32(out_fun, c)
 
#define UsbSPrintHex(c)   _PrintHex(VCOM_putchar, c)
 
#define UsbSPrintHex16(c)   _PrintHex16(VCOM_putchar, c)
 
#define UsbSPrintString(s)   _PrintString(VCOM_putchar, s)
 

Functions

static void print_string (struct link_device *dev, char *s)
 
static void print_hex (struct link_device *dev, uint8_t c)
 
static void print_hex16 (struct link_device *dev, uint16_t c)
 
static void print_hex32 (struct link_device *dev, uint32_t c)
 

Macro Definition Documentation

◆ _PrintHex

#define _PrintHex (   out_fun,
  c 
)
Value:
{ \
const uint8_t hex[16] = { '0', '1', '2', '3', '4', '5', '6', '7', \
'8', '9', 'A', 'B', 'C', 'D', 'E', 'F' }; \
uint8_t high = (c & 0xF0)>>4; \
uint8_t low = c & 0x0F; \
out_fun(hex[high]); \
out_fun(hex[low]); \
}

Definition at line 47 of file uart_print.h.

◆ _PrintHex16

#define _PrintHex16 (   out_fun,
  c 
)
Value:
{ \
uint8_t high16 = (uint8_t)(c>>8); \
uint8_t low16 = (uint8_t)(c); \
_PrintHex(out_fun, high16); \
_PrintHex(out_fun, low16); \
}

Definition at line 67 of file uart_print.h.

◆ _PrintHex32

#define _PrintHex32 (   out_fun,
  c 
)
Value:
{ \
uint16_t high32 = (uint16_t)(c>>16); \
uint16_t low32 = (uint16_t)(c); \
_PrintHex16(out_fun, high32); \
_PrintHex16(out_fun, low32); \
}

Definition at line 82 of file uart_print.h.

◆ _PrintString

#define _PrintString (   out_fun,
  s 
)
Value:
{ \
uint8_t i = 0; \
while (s[i]) { \
out_fun(s[i]); \
i++; \
} \
}

Definition at line 30 of file uart_print.h.

◆ UsbSPrintHex

#define UsbSPrintHex (   c)    _PrintHex(VCOM_putchar, c)

Definition at line 160 of file uart_print.h.

◆ UsbSPrintHex16

#define UsbSPrintHex16 (   c)    _PrintHex16(VCOM_putchar, c)

Definition at line 161 of file uart_print.h.

◆ UsbSPrintString

#define UsbSPrintString (   s)    _PrintString(VCOM_putchar, s)

Definition at line 162 of file uart_print.h.

Function Documentation

◆ print_hex()

static void print_hex ( struct link_device *  dev,
uint8_t  c 
)
inlinestatic

Definition at line 56 of file uart_print.h.

References c(), and dev.

Referenced by print_hex16().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ print_hex16()

static void print_hex16 ( struct link_device *  dev,
uint16_t  c 
)
inlinestatic

Definition at line 74 of file uart_print.h.

References c(), dev, and print_hex().

Referenced by print_hex32().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ print_hex32()

static void print_hex32 ( struct link_device *  dev,
uint32_t  c 
)
inlinestatic

Definition at line 89 of file uart_print.h.

References c(), dev, and print_hex16().

+ Here is the call graph for this function:

◆ print_string()

static void print_string ( struct link_device *  dev,
char *  s 
)
inlinestatic

Definition at line 38 of file uart_print.h.

References dev, and s.

c
VIC slots used for the LPC2148 define name e g gps UART1_VIC_SLOT e g modem SPI1_VIC_SLOT SPI1 in mcu_periph spi_arch c or spi_slave_hs_arch c(and some others not using the SPI peripheral yet..) I2C0_VIC_SLOT 8 mcu_periph/i2c_arch.c I2C1_VIC_SLOT 9 mcu_periph/i2c_arch.c USB_VIC_SLOT 10 usb
uint16_t
unsigned short uint16_t
Definition: types.h:16
s
static uint32_t s
Definition: light_scheduler.c:33
uint8_t
unsigned char uint8_t
Definition: types.h:14