Changes between Version 22 and Version 23 of library_stdio
- Timestamp:
- Oct 28, 2014, 12:36:22 PM (10 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
library_stdio
v22 v23 50 50 The GIET_VM allows an user task to use a private TTY terminal, or to display log message on a shared TTY terminal. 51 51 52 === unsigned int '''giet_tty_open'''() ===53 This function allocates a private terminal to the calling task, and re turns the terminal index. This index is registered in the task context. Exit if no TTY terminal.52 === void '''giet_tty_start'''() === 53 This function allocates a private terminal to the calling task, and registers the terminal index in the task context. Task exit if no TTY terminal available. 54 54 55 55 === void '''giet_tty_printf'''( char* format, ... ) === … … 62 62 * %c : char 63 63 * %s : string 64 65 Exit if private terminal index not defined, or in case of illegal format. 64 Task exit if private terminal index not defined, or in case of illegal format. 66 65 67 66 === void '''giet_tty_getc'''( char* byte ) === 68 This blocking function fetches a single character from the private terminal that must have been allocated to the calling task in the application mapping. It uses the TTY_RX_IRQ interrupt, and the associated kernel buffer. 69 70 Exit if private TTY index not defined. 67 This blocking function fetches a single character from the private terminal that must have been allocated to the calling task in the application mapping. It uses the TTY_RX_IRQ interrupt, and the associated kernel buffer. Task exit if private TTY index not defined. 71 68 72 69 === void '''giet_tty_getw'''( unsigned int* val ) === 73 70 This blocking function fetches a string of decimal characters (most significant digit first) to build a 32-bits unsigned integer from the private TTY terminal that must have been allocated to the calling task in the application mapping. It uses the TTY_RX_IRQ interrupt, and the associated kernel buffer. 74 The non-blocking system function _tty_read is called several times, and the decimal characters are written in a 32 characters buffer until a <LF> character is read. It ignores non-decimal characters, and displays an echo 75 system function) for each decimal character. The <DEL> character is interpreted, and previous characters can be cancelled. When the <LF> character is received, the string is converted to an unsigned int value. If the number of decimal digit is too large for the 32 bits range, the zero value is returned. 76 77 Exit if private TTY index not defined. 71 The non-blocking system function _tty_read is called several times, and the decimal characters are written in a 32 characters buffer until a <LF> character is read. It ignores non-decimal characters, and displays an echo for each decimal character. The <DEL> character is interpreted, and previous characters can be cancelled. When the <LF> character is received, the string is converted to an unsigned int value. If the number of decimal digit is too large for the 32 bits range, the zero value is returned. 72 Task exit if private TTY index not defined. 78 73 79 74 === void '''giet_tty_gets'''( char* buf, unsigned int bufsize ) === … … 81 76 It uses the TTY_RX_IRQ interrupt, and the associated kernel buffer. 82 77 Up to (bufsize - 1) characters (including the non printable characters) are copied into buffer, and the string is completed by a NUL character. The <LF> character is interpreted, and the function close the string with a NUL character if <LF> is read. The <DEL> character is interpreted, and the corresponding character(s) are removed from the target buffer. It does not provide an echo. 83 84 Exit if private TTY index not defined. 78 Task exit if private TTY index not defined. 85 79 86 80 === void '''giet_shr_printf'''( char* format, ... ) === 87 This function print formated text on the shared terminal arbitrarily allocated by the kernel. It takes the TTY lock88 for exclusive access. It supports the same formats as the giet_tty_printf() function.81 This function print formated text on a shared terminal arbitrarily allocated by the kernel. It takes the TTY lock for exclusive access. It supports the same formats as the giet_tty_printf() function. 82 Task exit in case of illegal format. 89 83 90 Exit in case of illegal format. 84 == __4) Timer related system calls__ == 85 86 The GIET_VM allows an user task to activate a private timer channel, generating periodical IRQs. This timer is allocated in the external multi-timers peripheral. 87 88 === void '''giet_timer_start'''( unsigned int period ) 89 This function allocates a private user timer to the calling task, registers the channel index 90 in the task context, and activates the timer. 91 Task exit if no timer channel available 92 93 === void '''giet_timer_stop'''( ) === 94 This function stops the private user timer allocated to the calling task. 91 95 92 96 == __4) File system related system calls__ == … … 95 99 96 100 === int '''giet_fat_open'''( const char* pathname, unsigned int flags ) === 97 Open a file identified by the ''pathname'' argument. The read/write ''flags'' are not supported yet: no effect. 98 Return -1 in case or error. 101 Open a file identified by the ''pathname'' argument. The read/write ''flags'' are not supported yet: no effect. Return -1 in case or error. 99 102 100 103 === void '''giet_fat_read'''( unsigned int fd, void* buffer, unsigned int count, unsigned int offset ) ===