48 #ifndef __SimpleTEXT__
49 #define __SimpleTEXT__
51 #include <propeller.h>
58 #if !defined(__PROPELLER_32BIT_DOUBLES__)
59 #error "This library requires 32bit doubles"
63 #define TERM_NAME_LEN 20
64 #define TERM_COG_LEN 7
83 #define getStopCOGID(id) ((id)-(1))
84 #define setStopCOGID(id) ((id)+(1))
275 int print(
const char *format, ...) __attribute__((format (printf, 1, 2)));
318 int scan(const
char *fmt, ...) __attribute__((format (printf, 1, 2)));
335 int sprint(
char *buffer, const
char *format, ...) __attribute__((format (printf, 2, 3)));
351 int sscan(const
char *buffer, const
char *fmt, ...) __attribute__((format (printf, 2, 3)));
375 int dprint(
text_t* device, const
char *format, ...) __attribute__((format (printf, 2, 3)));
393 int dscan(
text_t* device, const
char *fmt, ...) __attribute__((format (printf, 2, 3)));
416 int printi(const
char *format, ...) __attribute__((format (printf, 1, 2)));
432 int scani(const
char *fmt, ...) __attribute__((format (printf, 1, 2)));
452 int dprinti(
text_t* device, const
char *format, ...) __attribute__((format (printf, 2, 3)));
471 int dscani(
text_t* device, const
char *fmt, ...) __attribute__((format (printf, 2, 3)));
489 int sprinti(
char *buffer, const
char *format, ...) __attribute__((format (printf, 2, 3)));
506 int sscani(const
char *buffer, const
char *fmt, ...) __attribute__((format (printf, 2, 3)));
520 void putChar(
char c);
528 int putStr(const
char* str);
536 void putDec(
int value);
545 void putFloat(
float value);
553 void putBin(
int value);
562 void putHex(
int value);
572 int putStrLen(
char* str,
int width);
582 void putDecLen(
int value,
int width);
595 void putFloatPrecision(
float value,
int width,
int precision);
606 void putBinLen(
int value,
int digits);
617 void putHexLen(
int value,
int digits);
625 int putln(const
char* str);
634 int putLine(const
char* str);
674 float getFloat(
void);
695 char *getStr(
char *buffer,
int max);
714 void writeChar(
text_t *device,
char c);
725 int writeStr(
text_t *device,
char* str);
736 void writeDec(
text_t *device,
int value);
748 void writeFloat(
text_t *device,
float value);
760 void writeBin(
text_t *device,
int value);
772 void writeHex(
text_t *device,
int value);
799 void writeDecLen(
text_t *device,
int value,
int width);
815 void writeFloatPrecision(
text_t *device,
float value,
int width,
int precision);
829 void writeBinLen(
text_t *device,
int value,
int digits);
843 void writeHexLen(
text_t *device,
int value,
int digits);
854 int writeLine(
text_t *device,
char* str);
873 int readChar(
text_t *device);
888 char *readStr(
text_t *device,
char *buffer,
int max);
899 int readDec(
text_t *device);
910 float readFloat(
text_t *device);
921 int readBin(
text_t *device);
932 int readHex(
text_t *device);
958 void simpleterm_close(
void);
980 terminal *simpleterm_reopen(
int rxpin,
int txpin,
int mode,
int baud);
990 static inline
void simpleterm_set(
text_t *ptr)
1002 terminal *simpleterm_pointer(
void);
1014 int printNumber(
text_t *p,
unsigned long u,
int base,
int width,
int fill_char);
1015 char* _safe_gets(
text_t *term,
char* origBuf,
int count);
1016 const char* _scanf_getf(
const char *str,
float* dst);
1017 const char* _scanf_getl(
const char *str,
int* dst,
int base,
unsigned width,
int isSigned);
1019 int SPUTC(
int c,
char *buf);
1020 int SPUTS(
char *s,
char *obuf);
1021 int SPUTL(
unsigned long u,
int base,
int width,
int fill_char,
char *obuf);
1024 int _doscanf(
const char* str,
const char *fmt, va_list args);
1025 int _intscanf(
const char* str,
const char *fmt, va_list args);
1026 int _dosprnt(
const char *fmt, va_list args,
char *obuf);
1027 int _intsprnt(
const char *fmt, va_list args,
char *obuf);
1029 char* float2string(
float f,
char *s,
int width,
int precision);
1030 float string2float(
char *s,
char **end);