46 #ifndef __SimpleTEXT__
47 #define __SimpleTEXT__
49 #include <propeller.h>
56 #if !defined(__PROPELLER_32BIT_DOUBLES__)
57 #error "This library requires 32bit doubles"
60 #define TERM_NAME_LEN 20
61 #define TERM_COG_LEN 7
67 int cogid[TERM_COG_LEN];
71 #define getStopCOGID(id) ((id)-(1))
72 #define setStopCOGID(id) ((id)+(1))
263 int print(
const char *format, ...) __attribute__((format (printf, 1, 2)));
306 int scan(const
char *fmt, ...) __attribute__((format (printf, 1, 2)));
323 int sprint(
char *buffer, const
char *format, ...) __attribute__((format (printf, 2, 3)));
339 int sscan(const
char *buffer, const
char *fmt, ...) __attribute__((format (printf, 2, 3)));
363 int dprint(
text_t* device, const
char *format, ...) __attribute__((format (printf, 2, 3)));
381 int dscan(
text_t* device, const
char *fmt, ...) __attribute__((format (printf, 2, 3)));
404 int printi(const
char *format, ...) __attribute__((format (printf, 1, 2)));
420 int scani(const
char *fmt, ...) __attribute__((format (printf, 1, 2)));
440 int dprinti(
text_t* device, const
char *format, ...) __attribute__((format (printf, 2, 3)));
459 int dscani(
text_t* device, const
char *fmt, ...) __attribute__((format (printf, 2, 3)));
477 int sprinti(
char *buffer, const
char *format, ...) __attribute__((format (printf, 2, 3)));
494 int sscani(const
char *buffer, const
char *fmt, ...) __attribute__((format (printf, 2, 3)));
508 void putChar(
char c);
516 int putStr(const
char* str);
524 void putDec(
int value);
533 void putFloat(
float value);
541 void putBin(
int value);
550 void putHex(
int value);
560 int putStrLen(
char* str,
int width);
570 void putDecLen(
int value,
int width);
583 void putFloatPrecision(
float value,
int width,
int precision);
594 void putBinLen(
int value,
int digits);
605 void putHexLen(
int value,
int digits);
613 int putln(const
char* str);
622 int putLine(const
char* str);
662 float getFloat(
void);
683 char *getStr(
char *buffer,
int max);
702 void writeChar(
text_t *device,
char c);
713 int writeStr(
text_t *device,
char* str);
724 void writeDec(
text_t *device,
int value);
736 void writeFloat(
text_t *device,
float value);
748 void writeBin(
text_t *device,
int value);
760 void writeHex(
text_t *device,
int value);
787 void writeDecLen(
text_t *device,
int value,
int width);
803 void writeFloatPrecision(
text_t *device,
float value,
int width,
int precision);
817 void writeBinLen(
text_t *device,
int value,
int digits);
831 void writeHexLen(
text_t *device,
int value,
int digits);
842 int writeLine(
text_t *device,
char* str);
861 int readChar(
text_t *device);
876 char *readStr(
text_t *device,
char *buffer,
int max);
887 int readDec(
text_t *device);
898 float readFloat(
text_t *device);
909 int readBin(
text_t *device);
920 int readHex(
text_t *device);
947 void simpleterm_close(
void);
955 terminal *simpleterm_pointer(
void);
964 static inline
void simpleterm_set(
text_t *ptr)
981 int printNumber(
text_t *p,
unsigned long u,
int base,
int width,
int fill_char);
982 char* _safe_gets(
text_t *term,
char* origBuf,
int count);
983 const char* _scanf_getf(
const char *str,
float* dst);
984 const char* _scanf_getl(
const char *str,
int* dst,
int base,
unsigned width,
int isSigned);
986 int SPUTC(
int c,
char *buf);
987 int SPUTS(
char *s,
char *obuf);
988 int SPUTL(
unsigned long u,
int base,
int width,
int fill_char,
char *obuf);
991 int _doscanf(
const char* str,
const char *fmt, va_list args);
992 int _intscanf(
const char* str,
const char *fmt, va_list args);
993 int _dosprnt(
const char *fmt, va_list args,
char *obuf);
994 int _intsprnt(
const char *fmt, va_list args,
char *obuf);
996 char* float2string(
float f,
char *s,
int width,
int precision);
997 float string2float(
char *s,
char **end);