Main Page   Modules   Data Structures   File List   Data Fields   Globals   Related Pages   Examples  

XgPrint


Functions

int NutPrintBinary (NUTDEVICE *dev, CONST char *data, int len)
 Write a buffer to a specified device.

int NutPrintBinary_P (NUTDEVICE *dev, PGM_P data, int len)
 Write a buffer in program space to a specified device.

int NutPrintString (NUTDEVICE *dev, CONST char *str)
 Print a string on a specified device.

int NutPrintString_P (NUTDEVICE *dev, PGM_P str)
 Print a string in program space on a specified device.

int NutPrintInteger (NUTDEVICE *dev, u_long val, u_char radix, u_char width, u_char flags)
 Print a numeric value on a specified device.

int NutPrintFormat (NUTDEVICE *dev, CONST char *fmt,...)
 Print parameters using a format string.

int NutPrintFlush (NUTDEVICE *dev)

Function Documentation

int NutPrintBinary NUTDEVICE   dev,
CONST char *    data,
int    len
 

Write a buffer to a specified device.

Data may not be immediately transmitted to the physical, but stored in the output buffer. Call NutPrintFlush() to force immediate transmission.

If the buffer is in program space, use NutPrintBinary_P() instead.

Parameters:
dev  Identifies the device to write to. A null pointer may be used for unbuffered output to the first on-chip UART. If this pointer is not null, it must have been retrieved by directly or indirectly calling NutDeviceOpen() for real devices. For virtual devices this pointer is returned by the function that creates the device.
data  Buffer to be written.
len  Number of characters to be printed.
Returns:
The number of characters printed or -1 in case of an error.

int NutPrintBinary_P NUTDEVICE   dev,
PGM_P    data,
int    len
 

Write a buffer in program space to a specified device.

Data may not be immediately transmitted to the physical, but stored in the output buffer. Call NutPrintFlush() to force immediate transmission.

To print a buffer in RAM, use NutPrintBinary().

Parameters:
dev  Identifies the device to write to. A null pointer may be used for unbuffered output to the first on-chip UART. If this pointer is not null, it must have been retrieved by directly or indirectly calling NutDeviceOpen() for real devices. For virtual devices this pointer is returned by the function that creates the device.
data  Buffer in program space to be printed.
len  Number of characters to be printed.
Returns:
The number of characters printed or -1 in case of an error.

int NutPrintFlush NUTDEVICE   dev
 

Send buffered characters to the specified device.

If the device's output buffer contains any, the transmitter is started, if not already running. The function returns immediately, without waiting for data being completely transmitted.

Parameters:
dev  Identifies the device to flush. This must have been retrieved by directly or indirectly calling NutDeviceOpen() for real devices. For virtual devices this pointer is returned by the function that creates the device.
Returns:
0 on success, -1 otherwise.
Examples:
adds/app/lcd.

int NutPrintFormat NUTDEVICE   dev,
CONST char *    fmt,
...   
 

Print parameters using a format string.

This function formats and prints characters and values to a specified stream device.

The format string consists of ordinary characters, escape sequences, and format specifications. Ordinary characters and escape sequences are copied to the output routine in the order of their appearance. The format is scanned from left to right. If a format specification is encountered, the value of the corresponding argument is converted and output according to that format specification. If there are more arguments than format specifications, the extra arguments are ignored. If there are more format specifications than arguments, the results are undefined.

Recognized format specifiers are:

  • %c prints a character.
  • %s prints a string.
  • %o prints a numerical value in octal digits.
  • %d prints a signed numerical value in deciaml digits.
  • %u prints an unsigned numerical value in decimal digits.
  • %x prints a numerical value in hexadecimal digits using lowercase letters.
  • %X prints a numerical value in hexadecimal digits using uppercase letters.
The resulting string may not be transmitted immediately, but stored in the output buffer. Call NutPrintFlush() to force immediate transmission.
Parameters:
dev  Identifies the device to write to. A null pointer may be used for unbuffered output to the first on-chip UART. If this pointer is not null, it must have been retrieved by directly or indirectly calling NutDeviceOpen() for real devices. For virtual devices this pointer is returned by the function that creates the device.
fmt  Format string.
Returns:
The number of characters printed, or a negative value in case of an output error.
Examples:
adds/app/flash, adds/app/keys, adds/app/lcd, adds/app/mail, adds/app/rtc, and adds/app/term.

int NutPrintInteger NUTDEVICE   dev,
u_long    val,
u_char    radix,
u_char    width,
u_char    flags
 

Print a numeric value on a specified device.

The numeric value will be converted to an ASCII string and printed to the specified stream device. The string may not be transmitted immediately, but stored in the output buffer. Call NutPrintFlush() to force immediate transmission.

Parameters:
dev  Identifies the device to write to. A null pointer may be used for unbuffered output to the first on-chip UART. If this pointer is not null, it must have been retrieved by directly or indirectly calling NutDeviceOpen() for real devices. For virtual devices this pointer is returned by the function that creates the device.
val  Value to be printed.
radix  Number base, may be any value between 2 and 16.
width  Minimum width or 0 if no justification required.
flags  Format flags. Any of the following may be ored:
  • FMTFLG_ZERO for output padding with zeros.
  • FMTFLG_PLUS forces printing a sign character.
  • FMTFLG_MINUS for left justification.
  • FMTFLG_SIGNED for signed values.
  • FMTFLG_CAPITAL for using capital letters with base above 10.
Returns:
The number of characters printed or -1 in case of an error.
See also:
Format flags

int NutPrintString NUTDEVICE   dev,
CONST char *    str
 

Print a string on a specified device.

The string may not be immediately transmitted to the physical device, but stored in the output buffer. Call NutPrintFlush() to force immediate transmission.

If the string is defined in program space, use NutPrintString_P() instead.

Parameters:
dev  Identifies the device to write to. A null pointer may be used for unbuffered output to the first on-chip UART. If this pointer is not null, it must have been retrieved by directly or indirectly calling NutDeviceOpen() for real devices. For virtual devices this pointer is returned by the function that creates the device.
str  String to be printed.
Returns:
The number of characters printed or -1 in case of an error.

int NutPrintString_P NUTDEVICE   dev,
PGM_P    str
 

Print a string in program space on a specified device.

The string may not be immediately transmitted to the physical device, but stored in the output buffer. Call NutPrintFlush() to force immediate transmission.

If the string is defined in RAM, use NutPrintString() instead.

Parameters:
dev  Identifies the device to write to. A null pointer may be used for unbuffered output to the first on-chip UART. If this pointer is not null, it must have been retrieved by directly or indirectly calling NutDeviceOpen() for real devices. For virtual devices this pointer is returned by the function that creates the device.
str  String in program space to be printed.
Returns:
The number of characters printed or -1 in case of an error.


Generated on Thu Jan 30 22:30:59 2003 for EduNet by doxygen1.2.18