46 #ifndef __SimpleTEXT__
47 #define __SimpleTEXT__
49 #include <propeller.h>
56 #if !defined(__PROPELLER_32BIT_DOUBLES__)
57 #error "This library requires 32bit doubles"
61 #define TERM_NAME_LEN 20
62 #define TERM_COG_LEN 7
81 #define getStopCOGID(id) ((id)-(1))
82 #define setStopCOGID(id) ((id)+(1))
273 int print(
const char *format, ...) __attribute__((format (printf, 1, 2)));
316 int scan(const
char *fmt, ...) __attribute__((format (printf, 1, 2)));
333 int sprint(
char *buffer, const
char *format, ...) __attribute__((format (printf, 2, 3)));
349 int sscan(const
char *buffer, const
char *fmt, ...) __attribute__((format (printf, 2, 3)));
373 int dprint(
text_t* device, const
char *format, ...) __attribute__((format (printf, 2, 3)));
391 int dscan(
text_t* device, const
char *fmt, ...) __attribute__((format (printf, 2, 3)));
414 int printi(const
char *format, ...) __attribute__((format (printf, 1, 2)));
430 int scani(const
char *fmt, ...) __attribute__((format (printf, 1, 2)));
450 int dprinti(
text_t* device, const
char *format, ...) __attribute__((format (printf, 2, 3)));
469 int dscani(
text_t* device, const
char *fmt, ...) __attribute__((format (printf, 2, 3)));
487 int sprinti(
char *buffer, const
char *format, ...) __attribute__((format (printf, 2, 3)));
504 int sscani(const
char *buffer, const
char *fmt, ...) __attribute__((format (printf, 2, 3)));
518 void putChar(
char c);
526 int putStr(const
char* str);
534 void putDec(
int value);
543 void putFloat(
float value);
551 void putBin(
int value);
560 void putHex(
int value);
570 int putStrLen(
char* str,
int width);
580 void putDecLen(
int value,
int width);
593 void putFloatPrecision(
float value,
int width,
int precision);
604 void putBinLen(
int value,
int digits);
615 void putHexLen(
int value,
int digits);
623 int putln(const
char* str);
632 int putLine(const
char* str);
672 float getFloat(
void);
693 char *getStr(
char *buffer,
int max);
712 void writeChar(
text_t *device,
char c);
723 int writeStr(
text_t *device,
char* str);
734 void writeDec(
text_t *device,
int value);
746 void writeFloat(
text_t *device,
float value);
758 void writeBin(
text_t *device,
int value);
770 void writeHex(
text_t *device,
int value);
797 void writeDecLen(
text_t *device,
int value,
int width);
813 void writeFloatPrecision(
text_t *device,
float value,
int width,
int precision);
827 void writeBinLen(
text_t *device,
int value,
int digits);
841 void writeHexLen(
text_t *device,
int value,
int digits);
852 int writeLine(
text_t *device,
char* str);
871 int readChar(
text_t *device);
886 char *readStr(
text_t *device,
char *buffer,
int max);
897 int readDec(
text_t *device);
908 float readFloat(
text_t *device);
919 int readBin(
text_t *device);
930 int readHex(
text_t *device);
956 void simpleterm_close(
void);
978 terminal *simpleterm_reopen(
int rxpin,
int txpin,
int mode,
int baud);
988 static inline
void simpleterm_set(
text_t *ptr)
1000 terminal *simpleterm_pointer(
void);
1012 int printNumber(
text_t *p,
unsigned long u,
int base,
int width,
int fill_char);
1013 char* _safe_gets(
text_t *term,
char* origBuf,
int count);
1014 const char* _scanf_getf(
const char *str,
float* dst);
1015 const char* _scanf_getl(
const char *str,
int* dst,
int base,
unsigned width,
int isSigned);
1017 int SPUTC(
int c,
char *buf);
1018 int SPUTS(
char *s,
char *obuf);
1019 int SPUTL(
unsigned long u,
int base,
int width,
int fill_char,
char *obuf);
1022 int _doscanf(
const char* str,
const char *fmt, va_list args);
1023 int _intscanf(
const char* str,
const char *fmt, va_list args);
1024 int _dosprnt(
const char *fmt, va_list args,
char *obuf);
1025 int _intsprnt(
const char *fmt, va_list args,
char *obuf);
1027 char* float2string(
float f,
char *s,
int width,
int precision);
1028 float string2float(
char *s,
char **end);