 |
PropWare
3.0.0.229
C++ objects and CMake build system for Parallax Propeller
|
Go to the documentation of this file.
48 #ifndef __SimpleTEXT__
49 #define __SimpleTEXT__
51 #include <propeller.h>
59 #define SIMPLETEXT_ECS
64 #define ECHO_RX_TO_TX 32
69 #if !defined(__PROPELLER_32BIT_DOUBLES__)
70 #error "This library requires 32bit doubles"
74 #define TERM_NAME_LEN 20
75 #define TERM_COG_LEN 7
107 void set_endChars(
text_t *text,
char cA,
char cB);
108 void set_endCharSequence(
text_t *text,
char cA,
char cB);
109 void putByte(
char c);
111 int readByte(
text_t *text);
112 void writeByte(
text_t *p,
char c);
113 void terminal_setEcho(
text_t *text,
int state);
114 int terminal_checkEcho(
text_t *text);
118 #define getStopCOGID(id) ((id)-(1))
119 #define setStopCOGID(id) ((id)+(1))
309 int print(
const char *format, ...) __attribute__((format (printf, 1, 2)));
352 int scan(const
char *fmt, ...) __attribute__((format (printf, 1, 2)));
369 int sprint(
char *buffer, const
char *format, ...) __attribute__((format (printf, 2, 3)));
385 int sscan(const
char *buffer, const
char *fmt, ...) __attribute__((format (printf, 2, 3)));
405 int sscanAfterStr(
char *buffer,
char *str,
char *fmt, ...) __attribute__((format (printf, 3, 4)));
430 int dprint(
text_t* device, const
char *format, ...) __attribute__((format (printf, 2, 3)));
448 int dscan(
text_t* device, const
char *fmt, ...) __attribute__((format (printf, 2, 3)));
471 int printi(const
char *format, ...) __attribute__((format (printf, 1, 2)));
487 int scani(const
char *fmt, ...) __attribute__((format (printf, 1, 2)));
507 int dprinti(
text_t* device, const
char *format, ...) __attribute__((format (printf, 2, 3)));
526 int dscani(
text_t* device, const
char *fmt, ...) __attribute__((format (printf, 2, 3)));
544 int sprinti(
char *buffer, const
char *format, ...) __attribute__((format (printf, 2, 3)));
561 int sscani(const
char *buffer, const
char *fmt, ...) __attribute__((format (printf, 2, 3)));
583 int putStr(const
char* str);
680 int putln(const
char* str);
762 char *
getStr(
char *buffer,
int max);
1060 extern text_t *dport_ptr;
1106 int printNumber(
text_t *p,
unsigned long u,
int base,
int width,
int fill_char);
1107 char* _safe_gets(
text_t *term,
char* origBuf,
int count);
1108 const char* _scanf_getf(
const char *str,
float* dst);
1109 const char* _scanf_getl(
const char *str,
int* dst,
int base,
unsigned width,
int isSigned);
1111 int SPUTC(
int c,
char *buf);
1112 int SPUTS(
char *s,
char *obuf);
1113 int SPUTL(
unsigned long u,
int base,
int width,
int fill_char,
char *obuf);
1116 int _doscanf(
const char* str,
const char *fmt, va_list args);
1117 int _intscanf(
const char* str,
const char *fmt, va_list args);
1118 int _dosprnt(
const char *fmt, va_list args,
char *obuf);
1119 int _intsprnt(
const char *fmt, va_list args,
char *obuf);
1121 char* float2string(
float f,
char *s,
int width,
int precision);
1122 float string2float(
char *s,
char **end);
int int scani(const char *fmt,...) __attribute__((format(printf
Convert formatted simple terminal input to the "..." args. This version does not provide floating poi...
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.
void putBinLen(int value, int digits)
Print string representation of a binary number to debug port with a fixed number of digits.
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.
int(* rxChar)(struct text_struct *p)
int putln(const char *str)
Print string + new line on the transmit debug port.
void putHexLen(int value, int digits)
Print string representation of a hexadecimal number to the debug port with a fixed number of digits.
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 parame...
int(* txChar)(struct text_struct *p, int ch)
void writeBinLen(text_t *device, int value, int digits)
Print string representation of a binary number to output with a fixed number of digits.
terminal * simpleterm_pointer(void)
Get default device pointer to SimpleIDE Terminal.
int putStrLen(char *str, int width)
Send a string with a certain number of characters.
int getHex(void)
Get hexadecimal number from the debug port.
int writeLine(text_t *device, char *str)
Send a string + new line to the device.
This library supports creating and managing one or more half duplex serial connections with periphera...
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.
void putFloat(float value)
Print string representation of a 32 bit floating point number to the debug port.
int getDec(void)
Get decimal number from the debug port.
int dprint(text_t *device, const char *format,...) __attribute__((format(printf
Print format "..." args to the device The output is limited to 256 bytes.
int putLine(const char *str)
Print string + new line on the transmit debug port. This is an alias of putln.
void putDec(int value)
Print string representation of a decimal number to the debug port.
int getBin(void)
Get binary number from the debug port.
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....
char * getStr(char *buffer, int max)
Get string of chars from the debug port.
void writeDec(text_t *device, int value)
Print string representation of a decimal number to output.
char * readStr(text_t *device, char *buffer, int max)
Get string of chars from the device.
int print(const char *format,...) __attribute__((format(printf
Print format "..." args to the default simple terminal device. The output is limited to 256 bytes.
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 deci...
int readDec(text_t *device)
Get decimal number from the device.
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 conver...
int putStrWithNpcVals(const char *s)
Print string to the debug port, and display all non printable characters (NPCs) as decimal ASCII valu...
void putDecLen(int value, int width)
Print string representation of a decimal number to the debug port.
void simpleterm_close(void)
Closes the SimpleIDE Terminal connection in one cog so that it can be opened in another cog with simp...
float getFloat(void)
Get floating point number from the debug port.
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.
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.
void writeFloat(text_t *device, float value)
Print string representation of a 32 bit floating point number to device.
int readChar(text_t *device)
Get char from the device.
struct text_struct text_t
Structure that contains data used by simple text device libraries.
void writeHex(text_t *device, int value)
Print string representation of a hexadecimal number to output device.
void writeChar(text_t *device, char c)
Send a character to the device.
int getChar(void)
Get char from the debug port.
void putChar(char c)
Print a char to the debug port.
int int scan(const char *fmt,...) __attribute__((format(printf
Convert formatted simple terminal input to the "..." args. The input is limited to 256 bytes.
Structure that contains data used by simple text device libraries.
static void simpleterm_set(text_t *ptr)
Sets default debug port device. Make sure to open a connection to the device before calling the funct...
void putHex(int value)
Print string representation of a hexadecimal number to the debug port.
float readFloat(text_t *device)
Get floating point number from the device.
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 o...
terminal * simpleterm_open(void)
Reopens the SimpleIDE Terminal connection if it was closed previously. The SimpleIDE Terminal connect...
volatile int terminalEcho
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.
int writeStr(text_t *device, char *str)
Send a string to the device.
void putBin(int value)
Print string representation of a binary number to the debug port.
void writeBin(text_t *device, int value)
Print string representation of a binary number to the receive device.
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....
int putStr(const char *str)
Print string to the debug port.
int readHex(text_t *device)
Get hexadecimal number from the device.
int writeStrLen(text_t *device, char *str, int width)
Send a string to the device.
int printi(const char *format,...) __attribute__((format(printf
Print integer and char only format "..." args to the default simple terminal device....
int int int int sscan(const char *buffer, const char *fmt,...) __attribute__((format(printf
Convert formatted buffer to the "..." args.
int readBin(text_t *device)
Get binary number from the device.