PropWare  3.0.0.229
C++ objects and CMake build system for Parallax Propeller
Classes | Macros | Typedefs | Functions
simpletext.h File Reference

This library provides a collection of functions for communicating with text devices such as SimpleIDE Terminal, serial peripheral devices, and even VGA displays. Libraries like serial, fdserial, and vgatext return pointer/identifiers that can be used with this library's dprint, dscan, and write/read function parameters that have text_t types. The identifier allows the application's code to specify which connection to use for sending and receiving formatted text. More...

#include <propeller.h>
#include "serial.h"
+ Include dependency graph for simpletext.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  text_struct
 Structure that contains data used by simple text device libraries. More...
 

Macros

#define SIMPLETEXT_ECS
 
#define ECHO_RX_TO_TX   32
 

Typedefs

typedef struct text_struct text_t
 Structure that contains data used by simple text device libraries.
 
typedef text_t terminal
 

Functions

void set_endChars (text_t *text, char cA, char cB)
 
void set_endCharSequence (text_t *text, char cA, char cB)
 
void putByte (char c)
 
int getByte (void)
 
int readByte (text_t *text)
 
void writeByte (text_t *p, char c)
 
void terminal_setEcho (text_t *text, int state)
 
int terminal_checkEcho (text_t *text)
 
int print (const char *format,...) __attribute__((format(printf
 Print format "..." args to the default simple terminal device. The output is limited to 256 bytes. More...
 
int int scan (const char *fmt,...) __attribute__((format(printf
 Convert formatted simple terminal input to the "..." args. The input is limited to 256 bytes. More...
 
int int int sprint (char *buffer, const char *format,...) __attribute__((format(printf
 Print format "..." args to the output buffer. The output buffer must be big enough for the output. More...
 
int int int int sscan (const char *buffer, const char *fmt,...) __attribute__((format(printf
 Convert formatted buffer to the "..." args. More...
 
int int int int int sscanAfterStr (char *buffer, char *str, char *fmt,...) __attribute__((format(printf
 Store values represented by characters in a buffer in variable list using "..." args. More...
 
Print/Scan for Device Communication
int dprint (text_t *device, const char *format,...) __attribute__((format(printf
 Print format "..." args to the device The output is limited to 256 bytes. More...
 
int int dscan (text_t *device, const char *fmt,...) __attribute__((format(printf
 Convert formatted device input to the "..." args. The input is limited to 256 bytes. More...
 
Integer-Only Versions

For reduced program sizes if no floating point values are printed/scanned.

int printi (const char *format,...) __attribute__((format(printf
 Print integer and char only format "..." args to the default simple terminal device. This version does not support floating point. The output is limited to 256 bytes. More...
 
int int scani (const char *fmt,...) __attribute__((format(printf
 Convert formatted simple terminal input to the "..." args. This version does not provide floating point conversions. The input is limited to 256 bytes. More...
 
int int int dprinti (text_t *device, const char *format,...) __attribute__((format(printf
 Print integer and char only format "..." args to the default simple terminal device. This version does not support floating point. The output is limited to 256 bytes. More...
 
int int int int dscani (text_t *device, const char *fmt,...) __attribute__((format(printf
 Convert formatted device input to the "..." args. This version does not provide floating point conversions. The input is limited to 256 bytes. More...
 
int int int int int sprinti (char *buffer, const char *format,...) __attribute__((format(printf
 Print integer and char only format "..." args to the default simple terminal device. This version does not support floating point. The output is limited to 256 bytes. More...
 
int int int int int int sscani (const char *buffer, const char *fmt,...) __attribute__((format(printf
 Convert formatted buffer to the "..." args. This version does not provide floating point conversions. More...
 
Output to Terminal
void putChar (char c)
 Print a char to the debug port. More...
 
int putStr (const char *str)
 Print string to the debug port. More...
 
void putDec (int value)
 Print string representation of a decimal number to the debug port. More...
 
void putFloat (float value)
 Print string representation of a 32 bit floating point number to the debug port. More...
 
void putBin (int value)
 Print string representation of a binary number to the debug port. More...
 
void putHex (int value)
 Print string representation of a hexadecimal number to the debug port. More...
 
int putStrLen (char *str, int width)
 Send a string with a certain number of characters. More...
 
void putDecLen (int value, int width)
 Print string representation of a decimal number to the debug port. More...
 
void putFloatPrecision (float value, int width, int precision)
 Print string representation of a 32 bit floating point number to the debug port with a fixed number of digits. More...
 
void putBinLen (int value, int digits)
 Print string representation of a binary number to debug port with a fixed number of digits. More...
 
void putHexLen (int value, int digits)
 Print string representation of a hexadecimal number to the debug port with a fixed number of digits. More...
 
int putln (const char *str)
 Print string + new line on the transmit debug port. More...
 
int putLine (const char *str)
 Print string + new line on the transmit debug port. This is an alias of putln. More...
 
int putStrWithNpcVals (const char *s)
 Print string to the debug port, and display all non printable characters (NPCs) as decimal ASCII values in brackets. For example, delete would be [127]. This function also displays the null [0] terminator. More...
 
Input from Terminal
int getBin (void)
 Get binary number from the debug port. More...
 
int getChar (void)
 Get char from the debug port. More...
 
int getDec (void)
 Get decimal number from the debug port. More...
 
float getFloat (void)
 Get floating point number from the debug port. More...
 
int getHex (void)
 Get hexadecimal number from the debug port. More...
 
chargetStr (char *buffer, int max)
 Get string of chars from the debug port. More...
 
Output to Device
void writeChar (text_t *device, char c)
 Send a character to the device. More...
 
int writeStr (text_t *device, char *str)
 Send a string to the device. More...
 
void writeDec (text_t *device, int value)
 Print string representation of a decimal number to output. More...
 
void writeFloat (text_t *device, float value)
 Print string representation of a 32 bit floating point number to device. More...
 
void writeBin (text_t *device, int value)
 Print string representation of a binary number to the receive device. More...
 
void writeHex (text_t *device, int value)
 Print string representation of a hexadecimal number to output device. More...
 
int writeStrLen (text_t *device, char *str, int width)
 Send a string to the device. More...
 
void writeDecLen (text_t *device, int value, int width)
 Print string representation of a decimal number to output device with a fixed number of digits. More...
 
void writeFloatPrecision (text_t *device, float value, int width, int precision)
 Print string representation of a 32 bit floating point number to device with a certain number of decimal point digits. More...
 
void writeBinLen (text_t *device, int value, int digits)
 Print string representation of a binary number to output with a fixed number of digits. More...
 
void writeHexLen (text_t *device, int value, int digits)
 Print string representation of a hexadecimal number to output device with a fixed number of digits. More...
 
int writeLine (text_t *device, char *str)
 Send a string + new line to the device. More...
 
Input from Device
int readChar (text_t *device)
 Get char from the device. More...
 
charreadStr (text_t *device, char *buffer, int max)
 Get string of chars from the device. More...
 
int readDec (text_t *device)
 Get decimal number from the device. More...
 
float readFloat (text_t *device)
 Get floating point number from the device. More...
 
int readBin (text_t *device)
 Get binary number from the device. More...
 
int readHex (text_t *device)
 Get hexadecimal number from the device. More...
 
For Passing Terminal Control between Cogs and/or Devices
terminalsimpleterm_open (void)
 Reopens the SimpleIDE Terminal connection if it was closed previously. The SimpleIDE Terminal connection transmits on P30 and receives on P31 at 115200 bps. The port is a simple serial driver running in the same cog, and does not buffer bytes. More...
 
void simpleterm_close (void)
 Closes the SimpleIDE Terminal connection in one cog so that it can be opened in another cog with simpleterm_open, fdserial_open(30, 31, 0, 115200), or some other driver.
 
terminalsimpleterm_reopen (int rxpin, int txpin, int mode, int baud)
 Closes and the simple terminal connection, and reopens it in the calling cog. Depending on the parameters used, it can also be used to switch from one terminal device to another. More...
 
static void simpleterm_set (text_t *ptr)
 Sets default debug port device. Make sure to open a connection to the device before calling the function. Please use the simpleterm_reopen() is recommended because this function may cause bad character output in some cases. More...
 
terminalsimpleterm_pointer (void)
 Get default device pointer to SimpleIDE Terminal. More...
 

Detailed Description

This library provides a collection of functions for communicating with text devices such as SimpleIDE Terminal, serial peripheral devices, and even VGA displays. Libraries like serial, fdserial, and vgatext return pointer/identifiers that can be used with this library's dprint, dscan, and write/read function parameters that have text_t types. The identifier allows the application's code to specify which connection to use for sending and receiving formatted text.

Author
Steve Denson

Features:

Core Usage
Functions in this library do not use any additional cores; however, the device driver library that returns a text_t pointer for use with this library might. For example, fdserial and vgatext each take launch a core. Check the device driver library's documentation for details.
Memory Models
Use with CMM or LMM.
Version
0.99.1 Correct scan function s formatting flag bugs.
0.99 Digits versions of put/get and write/read added for transmitting and receiving values with fixed numbers of digits. Floating point output functions updated to handle nan (not a number) and +/- inf (infinity). printi, dprinti, scani, dscani, sprinti, sscani functions added for supporting non-floating point with less program space. functions with Len in their names added for transmitting strings and values represented with a fixed number of characters.

Definition in file simpletext.h.

Macro Definition Documentation

◆ ECHO_RX_TO_TX

#define ECHO_RX_TO_TX   32

Mode bit 5 can be set to 1 to locally echo characters.

Definition at line 64 of file simpletext.h.

Typedef Documentation

◆ terminal

typedef text_t terminal

By default the terminal will use simple serial for input/output It can be overloaded.

Definition at line 266 of file simpletext.h.

Function Documentation

◆ dprint()

int dprint ( text_t device,
const char format,
  ... 
)

Print format "..." args to the device The output is limited to 256 bytes.

Note
See print for format specifiers.
Parameters
*deviceConnection identifier to serial, fdserial, or other text_t compatible device that has been opened.
formatC printf comparable format string.
...Arguments to use with the format string.
Returns
Number of bytes placed into the buffer.
Examples
FdSerial_Demo.c, and SimpleText_Demo.c.
+ Here is the caller graph for this function:

◆ dprinti()

int int int dprinti ( text_t device,
const char format,
  ... 
)

Print integer and char only format "..." args to the default simple terminal device. This version does not support floating point. The output is limited to 256 bytes.

Note
See print for format specifiers except f.
Parameters
*deviceConnection identifier to serial, fdserial, or other text_t compatible device that has been opened.
formatC printf comparable format string.
...Arguments to use with the format string.
Returns
Number of bytes placed into the buffer.
Examples
Hello_Demo.cpp, and Spin2Dat_Demo.cpp.

◆ dscan()

int int dscan ( text_t device,
const char fmt,
  ... 
)

Convert formatted device input to the "..." args. The input is limited to 256 bytes.

Note
See scan for format specifiers.
Parameters
*deviceConnection identifier to serial, fdserial, or other text_t compatible device that has been opened.
*fmtC printf comparable format string.
...Arguments where output will go and must be pointers.
Returns
Number of bytes placed into the buffer.
Examples
SimpleText_Demo.c.

◆ dscani()

int int int int dscani ( text_t device,
const char fmt,
  ... 
)

Convert formatted device input to the "..." args. This version does not provide floating point conversions. The input is limited to 256 bytes.

Note
See scan for format specifiers.
Parameters
*deviceConnection identifier to serial, fdserial, or other text_t compatible device that has been opened.
*fmtC printf comparable format string.
...Arguments where output will go and must be pointers.
Returns
Number of bytes placed into the buffer.

◆ getBin()

int getBin ( void  )

Get binary number from the debug port.

Returns
Value received.

Definition at line 10 of file getBin.c.

+ Here is the call graph for this function:

◆ getChar()

int getChar ( void  )

Get char from the debug port.

Returns
Character received as an integer.

Definition at line 11 of file getChar.c.

+ Here is the call graph for this function:

◆ getDec()

int getDec ( void  )

Get decimal number from the debug port.

Returns
Value received.

Definition at line 11 of file getDec.c.

+ Here is the call graph for this function:

◆ getFloat()

float getFloat ( void  )

Get floating point number from the debug port.

Returns
Value received.
Examples
SimpleText_Demo.c.

Definition at line 10 of file getFloat.c.

+ Here is the call graph for this function:

◆ getHex()

int getHex ( void  )

Get hexadecimal number from the debug port.

Returns
Value received.

Definition at line 10 of file getHex.c.

+ Here is the call graph for this function:

◆ getStr()

char* getStr ( char buffer,
int  max 
)

Get string of chars from the debug port.

Parameters
*bufferarray of chars with enough elements to hold the input string plus 2 null terminators.
maxMaximum size to read and should be less or equal buffer size.
Returns
Pointer to string received.
Examples
SimpleText_Demo.c.

Definition at line 19 of file getStr.c.

◆ print()

int print ( const char format,
  ... 
)

Print format "..." args to the default simple terminal device. The output is limited to 256 bytes.

Format specifiers for print dprint, and sprint:

%% Prints % sign to the output.

b Prints binary representation of an int parameter.
Note: b is not an ANSI standard format specifier.

c Prints char representation of a char parameter.

d Prints decimal integer representation of an int parameter.

f Prints floating point representation of a float parameter.

s Prints string representation of a char* parameter.

u Prints unsigned integer representation of an unsigned int parameter.

x Prints hexadecimal integer representation of an int parameter.

Width and precision n.p cause n integer digits of a float to print, and p digits to the right of the decimal to print.

Parameters
formatC printf comparable format string.
...Arguments to use with the format string.
Returns
Number of bytes placed into the buffer.
Examples
MeasureVolts_Demo.c, and SimpleText_Demo.c.
+ Here is the caller graph for this function:

◆ printi()

int printi ( const char format,
  ... 
)

Print integer and char only format "..." args to the default simple terminal device. This version does not support floating point. The output is limited to 256 bytes.

Note
See print for format specifiers except f.
Parameters
formatC printf comparable format string.
...Arguments to use with the format string.
Returns
Number of bytes placed into the buffer.
Examples
Hello_Demo.cpp.
+ Here is the caller graph for this function:

◆ putBin()

void putBin ( int  value)

Print string representation of a binary number to the debug port.

Parameters
valueNumber to print.

Definition at line 10 of file putBin.c.

◆ putBinLen()

void putBinLen ( int  value,
int  digits 
)

Print string representation of a binary number to debug port with a fixed number of digits.

Parameters
valueNumber to print.
digitsNumber of characters to print.

Definition at line 10 of file putBinDigits.c.

◆ putChar()

void putChar ( char  c)

Print a char to the debug port.

Parameters
cChar to send.
Examples
Hybrid_Demo.cpp, MeasureVolts_Demo.c, and SimpleText_Demo.c.

Definition at line 30 of file putChar.c.

+ Here is the caller graph for this function:

◆ putDec()

void putDec ( int  value)

Print string representation of a decimal number to the debug port.

Parameters
valueNumber to print.
Examples
SimpleText_Demo.c.

Definition at line 10 of file putDec.c.

+ Here is the call graph for this function:

◆ putDecLen()

void putDecLen ( int  value,
int  width 
)

Print string representation of a decimal number to the debug port.

Parameters
valueNumber to print.
widthNumber of characters to print padded by zeroes.

Definition at line 10 of file putDecDigits.c.

+ Here is the call graph for this function:

◆ putFloat()

void putFloat ( float  value)

Print string representation of a 32 bit floating point number to the debug port.

Parameters
valueNumber to print.
Examples
SimpleText_Demo.c.

Definition at line 10 of file putFloat.c.

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

◆ putFloatPrecision()

void putFloatPrecision ( float  value,
int  width,
int  precision 
)

Print string representation of a 32 bit floating point number to the debug port with a fixed number of digits.

Parameters
valueNumber to print.
widthNumber of characters to print.
precisionNumber of decimal point digits to print.

Definition at line 10 of file putFloatPrecision.c.

+ Here is the call graph for this function:

◆ putHex()

void putHex ( int  value)

Print string representation of a hexadecimal number to the debug port.

Parameters
valueNumber to print.

Definition at line 10 of file putHex.c.

◆ putHexLen()

void putHexLen ( int  value,
int  digits 
)

Print string representation of a hexadecimal number to the debug port with a fixed number of digits.

Parameters
valueNumber to print.
digitsNumber of hexadecimal characters to print padded by zeroes.

Definition at line 10 of file putHexDigits.c.

◆ putLine()

int putLine ( const char str)

Print string + new line on the transmit debug port. This is an alias of putln.

Parameters
*strNull terminated string to send.
Examples
SimpleText_Demo.c.

Definition at line 14 of file putLine.c.

+ Here is the call graph for this function:

◆ putln()

int putln ( const char str)

Print string + new line on the transmit debug port.

Parameters
*strNull terminated string to send.
Examples
SimpleText_Demo.c.

Definition at line 13 of file putln.c.

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

◆ putStr()

int putStr ( const char str)

Print string to the debug port.

Parameters
*strNull terminated string to send.
Examples
Hybrid_Demo.cpp, and SimpleText_Demo.c.

Definition at line 10 of file putStr.c.

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

◆ putStrLen()

int putStrLen ( char str,
int  width 
)

Send a string with a certain number of characters.

Parameters
strNull terminated string to send.
widthNumber of characters to print padded by spaces.
Examples
SimpleText_Demo.c.

Definition at line 11 of file putStrDigits.c.

+ Here is the call graph for this function:

◆ putStrWithNpcVals()

int putStrWithNpcVals ( const char s)

Print string to the debug port, and display all non printable characters (NPCs) as decimal ASCII values in brackets. For example, delete would be [127]. This function also displays the null [0] terminator.

Parameters
*strNull terminated string to send.

Definition at line 12 of file putStrWithNpcVals.c.

+ Here is the call graph for this function:

◆ readBin()

int readBin ( text_t device)

Get binary number from the device.

Parameters
*deviceConnection identifier to serial, fdserial, or other text_t compatible device that has been opened.
Returns
Number received.
Examples
SimpleText_Demo.c.

Definition at line 16 of file getBin.c.

+ Here is the caller graph for this function:

◆ readChar()

int readChar ( text_t device)

Get char from the device.

Parameters
*deviceConnection identifier to serial, fdserial, or other text_t compatible device that has been opened.
Returns
character received as an int value.
Examples
SimpleText_Demo.c.

Definition at line 17 of file getChar.c.

+ Here is the caller graph for this function:

◆ readDec()

int readDec ( text_t device)

Get decimal number from the device.

Parameters
*deviceConnection identifier to serial, fdserial, or other text_t compatible device that has been opened.
Returns
Number received.
Examples
SimpleText_Demo.c.

Definition at line 17 of file getDec.c.

+ Here is the caller graph for this function:

◆ readFloat()

float readFloat ( text_t device)

Get floating point number from the device.

Parameters
*deviceConnection identifier to serial, fdserial, or other text_t compatible device that has been opened.
Returns
Number received.
Examples
SimpleText_Demo.c.

Definition at line 16 of file getFloat.c.

+ Here is the caller graph for this function:

◆ readHex()

int readHex ( text_t device)

Get hexadecimal number from the device.

Parameters
*deviceConnection identifier to serial, fdserial, or other text_t compatible device that has been opened.
Returns
Number received.
Examples
SimpleText_Demo.c.

Definition at line 15 of file getHex.c.

+ Here is the caller graph for this function:

◆ readStr()

char* readStr ( text_t device,
char buffer,
int  max 
)

Get string of chars from the device.

Parameters
*deviceConnection identifier to serial, fdserial, or other text_t compatible device that has been opened.
bufferChar array with enough elements to hold the input string.
maxMaximum size to read and should be less or equal buffer size.
Returns
string received.
Examples
SimpleText_Demo.c.

Definition at line 25 of file getStr.c.

◆ scan()

int int scan ( const char fmt,
  ... 
)

Convert formatted simple terminal input to the "..." args. The input is limited to 256 bytes.

Format specifiers for scan, dscan, and sscan:

  • %% Scan % sign to the input.
  • b Scans binary representation to the int parameter. Note: b is not an ANSI standard format specifier.
  • c Scans char representation to a char parameter.
  • d Scans integer representation to an int parameter.
  • f Scans floating point representation to a float parameter.
  • s Scans string representation to a char* parameter.
  • u Scans unsigned integer representation to an unsigned int parameter.
  • x Scans hexadecimal integer representation to the int parameter.

Width and precision n.p cause n integer digits to scan to the left of the decimal point, p digits to the right.

Parameters
*fmtC printf comparable format string.
...Arguments where output will go and must be pointers.
Returns
Number of bytes placed into the buffer.
Examples
SimpleText_Demo.c.

◆ scani()

int int scani ( const char fmt,
  ... 
)

Convert formatted simple terminal input to the "..." args. This version does not provide floating point conversions. The input is limited to 256 bytes.

Note
See scan for format specifiers.
Parameters
*fmtC printf comparable format string.
...Arguments where output will go and must be pointers.
Returns
Number of bytes placed into the buffer.

◆ simpleterm_open()

terminal* simpleterm_open ( void  )

Reopens the SimpleIDE Terminal connection if it was closed previously. The SimpleIDE Terminal connection transmits on P30 and receives on P31 at 115200 bps. The port is a simple serial driver running in the same cog, and does not buffer bytes.

Returns
0 if port is already open, else returns term pointer.

◆ simpleterm_pointer()

terminal* simpleterm_pointer ( void  )

Get default device pointer to SimpleIDE Terminal.

Returns
terminal* Pointer to SimpleIDE Terminal device.

Get the SimpleTerm default text_t pointer

Examples
SimpleText_Demo.c.

Definition at line 51 of file simpleterm.c.

+ Here is the caller graph for this function:

◆ simpleterm_reopen()

terminal* simpleterm_reopen ( int  rxpin,
int  txpin,
int  mode,
int  baud 
)

Closes and the simple terminal connection, and reopens it in the calling cog. Depending on the parameters used, it can also be used to switch from one terminal device to another.

Parameters
rxpinSerial input pin, receives serial data. The default on start- up is P31 for receiving characters from the host computer's terminal.
txpinSerial output pin, transmits serial data. The default on start-up is P30 for sending characters to the host computer's terminal.
modeUnused mode field (for fdserial compatibility).
baudBit value transmit rate, 9600, 31250, etc... The default on start-up is 115200.
Returns
simpleterm pointer for use as an identifier for serial and simpletext library functions that have serial or text_t parameter types.

Definition at line 35 of file simpleterm_close.c.

+ Here is the call graph for this function:

◆ simpleterm_set()

static void simpleterm_set ( text_t ptr)
static

Sets default debug port device. Make sure to open a connection to the device before calling the function. Please use the simpleterm_reopen() is recommended because this function may cause bad character output in some cases.

Parameters
*ptrDevice ID pointer to serial, fdserial, or other text_t device.

Definition at line 1058 of file simpletext.h.

+ Here is the call graph for this function:

◆ sprint()

int int int sprint ( char buffer,
const char format,
  ... 
)

Print format "..." args to the output buffer. The output buffer must be big enough for the output.

Note
See print for format specifiers.
Parameters
bufferPointer to memory where formatted output can be stored.
*formatis a C printf comparable format string.
...is the arguments to use with the format string.
Returns
the number of bytes placed into the buffer.
Examples
SimpleText_Demo.c.

◆ sprinti()

int int int int int sprinti ( char buffer,
const char format,
  ... 
)

Print integer and char only format "..." args to the default simple terminal device. This version does not support floating point. The output is limited to 256 bytes.

Note
See print for format specifiers except f.
Parameters
bufferPointer to memory where formatted output can be stored.
*formatC printf comparable format string.
...Arguments to use with the format string.
Returns
Number of bytes placed into the buffer.

◆ sscan()

int int int int sscan ( const char buffer,
const char fmt,
  ... 
)

Convert formatted buffer to the "..." args.

Note
See scan for format specifiers.
Parameters
*bufferPointer to memory where formatted output can be stored.
*fmtC printf comparable format string.
...Arguments where output will go and must be pointers.
Returns
Number of bytes placed into the buffer.
Examples
SimpleText_Demo.c.
+ Here is the caller graph for this function:

◆ sscanAfterStr()

int int int int int sscanAfterStr ( char buffer,
char str,
char fmt,
  ... 
)

Store values represented by characters in a buffer in variable list using "..." args.

Note
See scan for format specifiers.
Parameters
*bufferPointer to string with formatted values.
*strString to find before scanning. Scanning starts after the last character. in this string.
*fmtC printf comparable format string.
...Arguments where output will go and must be pointers.
Returns
Number of % specifiers successfully matched.

◆ sscani()

int int int int int int sscani ( const char buffer,
const char fmt,
  ... 
)

Convert formatted buffer to the "..." args. This version does not provide floating point conversions.

Note
See scan for format specifiers.
Parameters
bufferPointer to memory where formatted output can be stored.
*fmtC printf comparable format string.
...Arguments where output will go and must be pointers.
Returns
Number of bytes placed into the buffer.

◆ writeBin()

void writeBin ( text_t device,
int  value 
)

Print string representation of a binary number to the receive device.

Parameters
*deviceConnection identifier to serial, fdserial, or other text_t compatible device that has been opened.
valueNumber to print.
Examples
SimpleText_Demo.c.

Definition at line 10 of file writeBin.c.

◆ writeBinLen()

void writeBinLen ( text_t device,
int  value,
int  digits 
)

Print string representation of a binary number to output with a fixed number of digits.

Parameters
*deviceConnection identifier to serial, fdserial, or other text_t compatible device that has been opened.
valueNumber to print.
digitsNumber of characters to print.
Examples
SimpleText_Demo.c.

Definition at line 10 of file writeBinDigits.c.

◆ writeChar()

void writeChar ( text_t device,
char  c 
)

Send a character to the device.

Parameters
*deviceConnection identifier to serial, fdserial, or other text_t compatible device that has been opened.
cCharacter to send.
Examples
SimpleText_Demo.c.

Definition at line 11 of file writeChar.c.

+ Here is the caller graph for this function:

◆ writeDec()

void writeDec ( text_t device,
int  value 
)

Print string representation of a decimal number to output.

Parameters
*deviceConnection identifier to serial, fdserial, or other text_t compatible device that has been opened.
valueNumber to print.
Examples
SimpleText_Demo.c.

Definition at line 10 of file writeDec.c.

+ Here is the call graph for this function:

◆ writeDecLen()

void writeDecLen ( text_t device,
int  value,
int  width 
)

Print string representation of a decimal number to output device with a fixed number of digits.

Parameters
*deviceConnection identifier to serial, fdserial, or other text_t compatible device that has been opened.
valueNumber to print.
widthNumber of characters to print padded by spaces.
Examples
SimpleText_Demo.c.

Definition at line 10 of file writeDecDigits.c.

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

◆ writeFloat()

void writeFloat ( text_t device,
float  value 
)

Print string representation of a 32 bit floating point number to device.

Parameters
*deviceConnection identifier to serial, fdserial, or other text_t compatible device that has been opened.
valueNumber to print.
Examples
SimpleText_Demo.c.

Definition at line 10 of file writeFloat.c.

+ Here is the call graph for this function:

◆ writeFloatPrecision()

void writeFloatPrecision ( text_t device,
float  value,
int  width,
int  precision 
)

Print string representation of a 32 bit floating point number to device with a certain number of decimal point digits.

Parameters
*deviceConnection identifier to serial, fdserial, or other text_t compatible device that has been opened.
widthNumber of characters to print.
precisionNumber of decimal point digits to print.
valueNumber to print.
Examples
SimpleText_Demo.c.

Definition at line 10 of file writeFloatPrecision.c.

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

◆ writeHex()

void writeHex ( text_t device,
int  value 
)

Print string representation of a hexadecimal number to output device.

Parameters
*deviceConnection identifier to serial, fdserial, or other text_t compatible device that has been opened.
valueNumber to print.
Examples
SimpleText_Demo.c.

Definition at line 10 of file writeHex.c.

◆ writeHexLen()

void writeHexLen ( text_t device,
int  value,
int  digits 
)

Print string representation of a hexadecimal number to output device with a fixed number of digits.

Parameters
*deviceConnection identifier to serial, fdserial, or other text_t compatible device that has been opened.
valueNumber to print.
digitsNumber of hexadecimal characters to print.
Examples
SimpleText_Demo.c.

Definition at line 10 of file writeHexDigits.c.

◆ writeLine()

int writeLine ( text_t device,
char str 
)

Send a string + new line to the device.

Parameters
*deviceConnection identifier to serial, fdserial, or other text_t compatible device that has been opened.
strNull terminated string to send.
Examples
SimpleText_Demo.c.

Definition at line 10 of file writeLine.c.

+ Here is the call graph for this function:

◆ writeStr()

int writeStr ( text_t device,
char str 
)

Send a string to the device.

Parameters
*deviceConnection identifier to serial, fdserial, or other text_t compatible device that has been opened.
strNull terminated string to send.
Examples
SimpleText_Demo.c.

Definition at line 10 of file writeStr.c.

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

◆ writeStrLen()

int writeStrLen ( text_t device,
char str,
int  width 
)

Send a string to the device.

Parameters
*deviceConnection identifier to serial, fdserial, or other text_t compatible device that has been opened.
strNull terminated string to send.
widthNumber of characters to print padded by spaces.
Examples
SimpleText_Demo.c.

Definition at line 11 of file writeStrDigits.c.

+ Here is the call graph for this function: