ESP8266 ILI9341 display support code with printf sources, wire-frame viewer and custom fonts
1.0
ESP8266ILI9341DisplayProject
|
Math IO functions, and verious conversion code with floating point support. More...
Go to the source code of this file.
Data Structures | |
struct | _printf_t |
undefine any potential macro version of these functions More... | |
union | f_t |
format specifier flags More... | |
Macros | |
#define | MEMSPACE |
#define | __memx |
#define | WEAK_ATR __attribute__((weak)) |
Typedefs | |
typedef struct _printf_t | printf_t |
undefine any potential macro version of these functions More... | |
Functions | |
int | putchar (int c) |
put a character to stdout See fdevopen() sets stream->put get for TTY devices More... | |
MEMSPACE int | atodigit (int c, int radix) |
Convert ASCII character to radix based digit , or -1. More... | |
MEMSPACE long | atoh (const char *p) |
Convert ASCII hex string to long integer. More... | |
MEMSPACE long | aton (char *str, int base) |
Convert ASCII string to number in a given base. More... | |
MEMSPACE int | mul10str (uint8_t *str, int size) |
Fast multiply number of any size by 10. More... | |
MEMSPACE long | strtol (const char *nptr, char **endptr, int base) |
Convert ASCII string to number in a given base. More... | |
MEMSPACE long long | strtoll (const char *nptr, char **endptr, int base) |
Convert ASCII string to number in a given base. More... | |
MEMSPACE int | atoi (const char *str) |
Convert ASCII string to number in base 10. More... | |
MEMSPACE long | atol (const char *str) |
Convert ASCII string to number in base 10. More... | |
MEMSPACE double | iexp (double num, int exp) |
MEMSPACE double | scale10 (double num, int *exp) |
MEMSPACE double | strtod (const char *nptr, char **endptr) |
MEMSPACE double | atof (const char *str) |
MEMSPACE size_t WEAK_ATR | strlen (const char *str) |
String Length. More... | |
MEMSPACE int WEAK_ATR | isdigit (int c) |
test if a character is a digit More... | |
MEMSPACE void WEAK_ATR | reverse (char *str) |
Reverse a string in place Example: abcdef -> fedcba. More... | |
MEMSPACE void WEAK_ATR | strupper (char *str) |
UPPERCASE a string. More... | |
MEMSPACE int | bin2num (uint8_t *str, int strmax, int nummin, int base, uint8_t *nump, int numsize, int sign_ch) |
Convert an unsigned number (numsize bytes in size) to ASCII in specified base Notes: No limit except available memory on number size. More... | |
MEMSPACE void | pch_init (char *str, int max) |
Initialize character buffer with limits. More... | |
MEMSPACE int | pch (char ch) |
Put character in buffer with limits. More... | |
MEMSPACE int | pch_ind (void) |
Return current index of character buffer with limits. More... | |
MEMSPACE int | pch_max_ind (void) |
Return maximum valid index for character buffer. More... | |
MEMSPACE void | print_flags (f_t f) |
print flags set in t_t structure More... | |
MEMSPACE int | p_ntoa (uint8_t *nump, int numsize, char *str, int strmax, int radix, int width, int prec, f_t f) |
Convert number an base 2 .. 16 to ASCII with optional sign Notes: 1) Numbers can be any number of digits long - limited only by memory available To print negative numbers convert to positive before calling this function and set f.b.neg 2) Warning: as with printf width and prec are only minimum sizes - results can be bigger We assume all numbers are positive: More... | |
MEMSPACE int | p_ftoa (double val, char *str, int max, int width, int prec, f_t f) |
MEMSPACE int | p_etoa (double val, char *str, int max, int width, int prec, f_t f) |
MEMSPACE void | _puts_pad (printf_t *fn, char *s, int width, int count, int left) |
MEMSPACE void | _printf_fn (printf_t *fn, __memx const char *fmt, va_list va) |
vsnprintf function More... | |
MEMSPACE void | _putc_buffer_fn (struct _printf_t *p, char ch) |
_putc_buffer_fn - character output to a string buffer Used by snprintf and vsnprintf You can make _printf_fn call this helper for each character More... | |
MEMSPACE int | vsnprintf (char *str, size_t size, const char *format, va_list va) |
vsnprintf function More... | |
MEMSPACE int | snprintf (char *str, size_t size, const char *format,...) |
snprintf function More... | |
MEMSPACE int | printf (const char *format,...) |
int | sscanf (const char *strp, const char *fmt,...) |
Math IO functions, and verious conversion code with floating point support.
This is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.
Definition in file mathio.h.
#define __memx |
Definition at line 38 of file mathio.h.
Referenced by _printf_fn(), and snprintf().
#define WEAK_ATR __attribute__((weak)) |
undefine any potential macro version of these functions
We let printf use user defined I/O functions
vsnprintf function
[out] | fn | output character function pointer |
[in] | fmt | printf forat string |
[in] | va | va_list arguments |
Calling Variadic Functions
Definition at line 741 of file printf.c.
Referenced by fprintf(), snprintf(), tft_printf(), uart0_printf(), vsnprintf(), and vsock_printf().
_putc_buffer_fn - character output to a string buffer Used by snprintf and vsnprintf You can make _printf_fn call this helper for each character
[in] | *p | structure with pointers and buffer to be written to |
[in] | ch | character to place in buffer |
Definition at line 1103 of file printf.c.
Referenced by snprintf(), and vsnprintf().
Definition at line 683 of file printf.c.
Referenced by _printf_fn().
MEMSPACE int atodigit | ( | int | c, |
int | radix | ||
) |
MEMSPACE long atoh | ( | const char * | p | ) |
MEMSPACE int atoi | ( | const char * | str | ) |
MEMSPACE long atol | ( | const char * | str | ) |
Convert ASCII string to number in base 10.
[in] | str | string |
Definition at line 295 of file mathio.c.
Referenced by fatfs_tests().
MEMSPACE long aton | ( | char * | str, |
int | base | ||
) |
MEMSPACE int bin2num | ( | uint8_t * | str, |
int | strmax, | ||
int | nummin, | ||
int | base, | ||
uint8_t * | nump, | ||
int | numsize, | ||
int | sign_ch | ||
) |
Convert an unsigned number (numsize bytes in size) to ASCII in specified base Notes: No limit except available memory on number size.
[out] | str | ASCII number string result |
[in] | strmax | maximum size of str in bytes |
[in] | nummin | minimum number of digits to display |
[in] | *nump | Pointer to binary number |
[in] | numsize | size of binary number in bytes |
[in] | sign_ch | sign of binary number return converted number string numsize in bytes |
Definition at line 139 of file printf.c.
Referenced by p_ntoa().
test if a character is a digit
[in] | c | character |
Definition at line 48 of file stringsup.c.
Referenced by _printf_fn(), and atol().
Referenced by _printf_fn(), and p_ntoa().
Referenced by _printf_fn(), and p_ntoa().
MEMSPACE int p_ntoa | ( | uint8_t * | nump, |
int | numsize, | ||
char * | str, | ||
int | strmax, | ||
int | radix, | ||
int | width, | ||
int | prec, | ||
f_t | f | ||
) |
Convert number an base 2 .. 16 to ASCII with optional sign Notes: 1) Numbers can be any number of digits long - limited only by memory available To print negative numbers convert to positive before calling this function and set f.b.neg 2) Warning: as with printf width and prec are only minimum sizes - results can be bigger We assume all numbers are positive:
[in] | nump | number pointer |
[in] | numsize | number size in bytes |
[out] | *str | string result |
[in] | strmax | strmaximum length of string result |
[in] | radix | Radix may be 2 .. 16 |
[in] | width | Width of result padded if needed |
[in] | prec | minumum number of digits, zero padded if needed |
[in] | f | flags f.b.left justify left f.b.plus display + for positive number, - for negative numbers f.b.space display ' ' for positive, - for negative f.b.zero pad with zeros if needed f.b.alt Alternate display form - work in progress f.b.width Width of result - pad if required f.b.prec Zero padd to prec if sepcified f.b.neg Sign of number is negative |
Definition at line 314 of file printf.c.
Referenced by _printf_fn().
MEMSPACE int pch | ( | char | ch | ) |
MEMSPACE int pch_ind | ( | void | ) |
MEMSPACE void pch_init | ( | char * | str, |
int | max | ||
) |
MEMSPACE int pch_max_ind | ( | void | ) |
MEMSPACE int printf | ( | const char * | format, |
... | |||
) |
Referenced by abort(), arg_name(), arg_value(), buffer_read_open(), cal_dex_dump_hex(), calloc(), cat(), clock_elapsed_end(), copy(), cordic_quad(), create_connection(), delete_connection(), DeleteRowCol(), Determinant(), display_clock(), display_ipv4(), display_ts(), dump_stat(), fatfs_filinfo_list(), fatfs_help(), fatfs_ls(), fatfs_status(), fatfs_tests(), fgetc(), find_connection(), font_attr(), fputc(), free(), hexdump(), html_msg(), html_status(), http_value(), init_done(), init_timers(), initialize_clock(), Invert(), led_off(), led_on(), logfile(), loop(), loop_task(), ls(), ls_info(), lseek(), main(), malloc(), MatAlloc(), MATCHARGS(), MatFree(), MatMul(), MatPrint(), MatRead(), MatWrite(), mkfs(), mmc_init(), mmc_install_timer(), mmc_test(), mmc_test_timeout(), ms_init(), next_arg(), normalize(), ntp_setup(), parse_http_request(), perror(), posix_help(), posix_tests(), print_dst(), print_dst_gmt(), print_flags(), PrintRam(), PrintXYZ(), process_args(), put_rc(), rtc_init(), rtc_read(), rtc_write(), rwbuf_create(), safecalloc(), safefree(), select(), send_message(), sep(), servertest_setup(), set_timers(), setdate(), setdate_r(), setup(), setup_networking(), snprintf(), spi_begin(), spi_end(), sum(), tcp_accept(), test_types(), testpage(), tft_FillPolyLine(), tft_floodline(), tft_push_xy(), timetests(), tm2epoch(), upload(), usage(), user_help(), user_init(), user_tasks(), user_tests(), wait_send(), web_data_connect_callback(), web_data_disconnect_callback(), web_data_error_callback(), web_data_receive_callback(), web_data_sent_callback(), web_sep(), wifi_event_cb(), and write_buffer().
int putchar | ( | int | c | ) |
put a character to stdout See fdevopen() sets stream->put get for TTY devices
[in] | stream | POSIX stream pointer. |
Definition at line 351 of file posix.c.
Referenced by fatfs_ls(), hexdump(), snprintf(), and write_buffer().
Reverse a string in place Example: abcdef -> fedcba.
[in] | str | string |
Definition at line 231 of file stringsup.c.
Referenced by bin2num().
int sscanf | ( | const char * | strp, |
const char * | fmt, | ||
... | |||
) |
Referenced by main(), MatRead(), ReadBdf(), and setdate_r().
String Length.
[in] | str | string |
Definition at line 146 of file stringsup.c.
Referenced by _printf_fn(), arg_name(), arg_value(), cat(), escape(), fatfs_ls(), fatfs_scan_files(), get_date(), html_msg(), logfile(), ls(), main(), MATCH(), match_headers(), MATCH_LEN(), match_token(), MATCHI(), MATCHI_LEN(), mctime(), next_arg(), p_ntoa(), parse_http_request(), process_args(), ReadBdf(), readdir(), reverse(), send_message(), snprintf(), stralloc(), token(), trim_tail(), upload(), and vsnprintf().
MEMSPACE long strtol | ( | const char * | nptr, |
char ** | endptr, | ||
int | base | ||
) |
Convert ASCII string to number in a given base.
[in] | nptr | string |
[in] | endptr | pointer to string pointer return value |
[in] | base | radix |
Definition at line 136 of file mathio.c.
Referenced by atoh(), atoi(), atol(), aton(), get_value(), main(), posix_tests(), and setdate_r().
MEMSPACE long long strtoll | ( | const char * | nptr, |
char ** | endptr, | ||
int | base | ||
) |
UPPERCASE a string.
[in] | str | string |
Definition at line 253 of file stringsup.c.
Referenced by _printf_fn().
vsnprintf function
[out] | str | string buffer for result |
[in] | size | maximum length of converted string |
[in] | format | printf forat string |
[in] | va | va_list list of arguments |
Definition at line 1135 of file printf.c.
Referenced by html_msg(), and snprintf().