亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? stdio.h

?? 在WinAVR下的ST7565圖形點陣的驅動程序
?? H
?? 第 1 頁 / 共 3 頁
字號:
/* Copyright (c) 2002, 2005, 2007 Joerg Wunsch
   All rights reserved.

   Portions of documentation Copyright (c) 1990, 1991, 1993
   The Regents of the University of California.

   All rights reserved.

   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions are met:

   * Redistributions of source code must retain the above copyright
     notice, this list of conditions and the following disclaimer.

   * Redistributions in binary form must reproduce the above copyright
     notice, this list of conditions and the following disclaimer in
     the documentation and/or other materials provided with the
     distribution.

   * Neither the name of the copyright holders nor the names of
     contributors may be used to endorse or promote products derived
     from this software without specific prior written permission.

  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
  LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  POSSIBILITY OF SUCH DAMAGE.

  $Id: stdio.h,v 1.29.2.1 2008/02/23 08:59:27 dmix Exp $
*/

#ifndef _STDIO_H_
#define	_STDIO_H_ 1

#ifndef __ASSEMBLER__

#include <inttypes.h>
#include <stdarg.h>

#define __need_NULL
#define __need_size_t
#include <stddef.h>

/** \file */
/** \defgroup avr_stdio <stdio.h>: Standard IO facilities
    \code #include <stdio.h> \endcode

    <h3>Introduction to the Standard IO facilities</h3>

    This file declares the standard IO facilities that are implemented
    in \c avr-libc.  Due to the nature of the underlying hardware,
    only a limited subset of standard IO is implemented.  There is no
    actual file implementation available, so only device IO can be
    performed.  Since there's no operating system, the application
    needs to provide enough details about their devices in order to
    make them usable by the standard IO facilities.

    Due to space constraints, some functionality has not been
    implemented at all (like some of the \c printf conversions that
    have been left out).  Nevertheless, potential users of this
    implementation should be warned: the \c printf and \c scanf families of functions, although
    usually associated with presumably simple things like the
    famous "Hello, world!" program, are actually fairly complex
    which causes their inclusion to eat up a fair amount of code space.
    Also, they are not fast due to the nature of interpreting the
    format string at run-time.  Whenever possible, resorting to the
    (sometimes non-standard) predetermined conversion facilities that are
    offered by avr-libc will usually cost much less in terms of speed
    and code size.

    <h3>Tunable options for code size vs. feature set</h3>

    In order to allow programmers a code size vs. functionality tradeoff,
    the function vfprintf() which is the heart of the printf family can be
    selected in different flavours using linker options.  See the
    documentation of vfprintf() for a detailed description.  The same
    applies to vfscanf() and the \c scanf family of functions.

    <h3>Outline of the chosen API</h3>

    The standard streams \c stdin, \c stdout, and \c stderr are
    provided, but contrary to the C standard, since avr-libc has no
    knowledge about applicable devices, these streams are not already
    pre-initialized at application startup.  Also, since there is no
    notion of "file" whatsoever to avr-libc, there is no function
    \c fopen() that could be used to associate a stream to some device.
    (See \ref stdio_note1 "note 1".)  Instead, the function \c fdevopen()
    is provided to associate a stream to a device, where the device
    needs to provide a function to send a character, to receive a
    character, or both.  There is no differentiation between "text" and
    "binary" streams inside avr-libc.  Character \c \\n is sent
    literally down to the device's \c put() function.  If the device
    requires a carriage return (\c \\r) character to be sent before
    the linefeed, its \c put() routine must implement this (see
    \ref stdio_note2 "note 2").

    As an alternative method to fdevopen(), the macro
    fdev_setup_stream() might be used to setup a user-supplied FILE
    structure.

    It should be noted that the automatic conversion of a newline
    character into a carriage return - newline sequence breaks binary
    transfers.  If binary transfers are desired, no automatic
    conversion should be performed, but instead any string that aims
    to issue a CR-LF sequence must use <tt>"\r\n"</tt> explicitly.

    For convenience, the first call to \c fdevopen() that opens a
    stream for reading will cause the resulting stream to be aliased
    to \c stdin.  Likewise, the first call to \c fdevopen() that opens
    a stream for writing will cause the resulting stream to be aliased
    to both, \c stdout, and \c stderr.  Thus, if the open was done
    with both, read and write intent, all three standard streams will
    be identical.  Note that these aliases are indistinguishable from
    each other, thus calling \c fclose() on such a stream will also
    effectively close all of its aliases (\ref stdio_note3 "note 3").

    It is possible to tie additional user data to a stream, using
    fdev_set_udata().  The backend put and get functions can then
    extract this user data using fdev_get_udata(), and act
    appropriately.  For example, a single put function could be used
    to talk to two different UARTs that way, or the put and get
    functions could keep internal state between calls there.

    <h3>Format strings in flash ROM</h3>

    All the \c printf and \c scanf family functions come in two flavours: the
    standard name, where the format string is expected to be in
    SRAM, as well as a version with the suffix "_P" where the format
    string is expected to reside in the flash ROM.  The macro
    \c PSTR (explained in \ref avr_pgmspace) becomes very handy
    for declaring these format strings.

    \anchor stdio_without_malloc
    <h3>Running stdio without malloc()</h3>

    By default, fdevopen() requires malloc().  As this is often
    not desired in the limited environment of a microcontroller, an
    alternative option is provided to run completely without malloc().

    The macro fdev_setup_stream() is provided to prepare a
    user-supplied FILE buffer for operation with stdio.

    <h4>Example</h4>

    \code
    #include <stdio.h>

    static int uart_putchar(char c, FILE *stream);

    static FILE mystdout = FDEV_SETUP_STREAM(uart_putchar, NULL,
                                             _FDEV_SETUP_WRITE);

    static int
    uart_putchar(char c, FILE *stream)
    {

      if (c == '\n')
        uart_putchar('\r', stream);
      loop_until_bit_is_set(UCSRA, UDRE);
      UDR = c;
      return 0;
    }

    int
    main(void)
    {
      init_uart();
      stdout = &mystdout;
      printf("Hello, world!\n");

      return 0;
    }
    \endcode

    This example uses the initializer form FDEV_SETUP_STREAM() rather
    than the function-like fdev_setup_stream(), so all data
    initialization happens during C start-up.

    If streams initialized that way are no longer needed, they can be
    destroyed by first calling the macro fdev_close(), and then
    destroying the object itself.  No call to fclose() should be
    issued for these streams.  While calling fclose() itself is
    harmless, it will cause an undefined reference to free() and thus
    cause the linker to link the malloc module into the application.

    <h3>Notes</h3>

    \anchor stdio_note1 \par Note 1:
    It might have been possible to implement a device abstraction that
    is compatible with \c fopen() but since this would have required
    to parse a string, and to take all the information needed either
    out of this string, or out of an additional table that would need to be
    provided by the application, this approach was not taken.

    \anchor stdio_note2 \par Note 2:
    This basically follows the Unix approach: if a device such as a
    terminal needs special handling, it is in the domain of the
    terminal device driver to provide this functionality.  Thus, a
    simple function suitable as \c put() for \c fdevopen() that talks
    to a UART interface might look like this:

    \code
    int
    uart_putchar(char c, FILE *stream)
    {

      if (c == '\n')
        uart_putchar('\r');
      loop_until_bit_is_set(UCSRA, UDRE);
      UDR = c;
      return 0;
    }
    \endcode

    \anchor stdio_note3 \par Note 3:
    This implementation has been chosen because the cost of maintaining
    an alias is considerably smaller than the cost of maintaining full
    copies of each stream.  Yet, providing an implementation that offers
    the complete set of standard streams was deemed to be useful.  Not
    only that writing \c printf() instead of <tt>fprintf(mystream, ...)</tt>
    saves typing work, but since avr-gcc needs to resort to pass all
    arguments of variadic functions on the stack (as opposed to passing
    them in registers for functions that take a fixed number of
    parameters), the ability to pass one parameter less by implying
    \c stdin will also save some execution time.
*/

#if !defined(__DOXYGEN__)

/*
 * This is an internal structure of the library that is subject to be
 * changed without warnings at any time.  Please do *never* reference
 * elements of it beyond by using the official interfaces provided.
 */
struct __file {
	char	*buf;		/* buffer pointer */
	unsigned char unget;	/* ungetc() buffer */
	uint8_t	flags;		/* flags, see below */
#define __SRD	0x0001		/* OK to read */
#define __SWR	0x0002		/* OK to write */
#define __SSTR	0x0004		/* this is an sprintf/snprintf string */
#define __SPGM	0x0008		/* fmt string is in progmem */
#define __SERR	0x0010		/* found error */
#define __SEOF	0x0020		/* found EOF */
#define __SUNGET 0x040		/* ungetc() happened */
#define __SMALLOC 0x80		/* handle is malloc()ed */
#if 0
/* possible future extensions, will require uint16_t flags */
#define __SRW	0x0100		/* open for reading & writing */
#define __SLBF	0x0200		/* line buffered */
#define __SNBF	0x0400		/* unbuffered */
#define __SMBF	0x0800		/* buf is from malloc */
#endif
	int	size;		/* size of buffer */
	int	len;		/* characters read or written so far */
	int	(*put)(char, struct __file *);	/* function to write one char to device */
	int	(*get)(struct __file *);	/* function to read one char from device */
	void	*udata;		/* User defined and accessible data. */
};

#endif /* not __DOXYGEN__ */

/*@{*/
/**
   \c FILE is the opaque structure that is passed around between the
   various standard IO functions.
*/
#define FILE	struct __file

/**
   Stream that will be used as an input stream by the simplified
   functions that don't take a \c stream argument.

   The first stream opened with read intent using \c fdevopen()
   will be assigned to \c stdin.
*/
#define stdin (__iob[0])

/**
   Stream that will be used as an output stream by the simplified
   functions that don't take a \c stream argument.

   The first stream opened with write intent using \c fdevopen()
   will be assigned to both, \c stdin, and \c stderr.
*/
#define stdout (__iob[1])

/**
   Stream destined for error output.  Unless specifically assigned,
   identical to \c stdout.

   If \c stderr should point to another stream, the result of
   another \c fdevopen() must be explicitly assigned to it without
   closing the previous \c stderr (since this would also close
   \c stdout).
*/
#define stderr (__iob[2])

/**
   \c EOF declares the value that is returned by various standard IO
   functions in case of an error.  Since the AVR platform (currently)
   doesn't contain an abstraction for actual files, its origin as
   "end of file" is somewhat meaningless here.
*/
#define EOF	(-1)

/** This macro inserts a pointer to user defined data into a FILE
    stream object.

    The user data can be useful for tracking state in the put and get
    functions supplied to the fdevopen() function. */
#define fdev_set_udata(stream, u) do { (stream)->udata = u; } while(0)

/** This macro retrieves a pointer to user defined data from a FILE

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品成人免费| 精品国产不卡一区二区三区| 国产精品久久毛片a| 国产高清视频一区| 国产精品三级电影| 97精品国产97久久久久久久久久久久 | 国产精品久久三区| 91视频com| 亚洲国产欧美在线人成| 制服视频三区第一页精品| 美国欧美日韩国产在线播放| 精品成人私密视频| 9l国产精品久久久久麻豆| 亚洲精品成a人| 91精品国产综合久久香蕉麻豆| 麻豆精品视频在线观看免费| 国产欧美日韩不卡免费| 色呦呦国产精品| 丝袜美腿高跟呻吟高潮一区| 亚洲精品一区二区三区福利| 不卡的看片网站| 亚洲国产美国国产综合一区二区 | 欧美精品在线观看一区二区| 久久爱www久久做| √…a在线天堂一区| 欧美久久一二三四区| 狠狠色狠狠色综合| 亚洲免费在线观看视频| 欧美一级欧美三级| 成年人网站91| 美女网站一区二区| 亚洲欧美国产77777| 日韩欧美一级二级三级久久久| 成人丝袜高跟foot| 日本在线观看不卡视频| 国产精品久久久久aaaa樱花| 欧美一区二区黄| 91在线免费播放| 狠狠色综合色综合网络| 夜夜嗨av一区二区三区四季av| 2024国产精品| 欧美精品777| 色综合天天综合网天天看片| 精彩视频一区二区三区| 亚洲影院在线观看| 国产精品三级av| 欧美变态口味重另类| 欧美午夜精品理论片a级按摩| 国产麻豆视频精品| 日韩专区欧美专区| 一区二区三区成人| 国产欧美日韩在线视频| 国产精品国产三级国产aⅴ原创 | 91亚洲国产成人精品一区二区三| 麻豆成人综合网| 亚洲成国产人片在线观看| 中文字幕制服丝袜一区二区三区| 精品成人免费观看| 欧美电影在哪看比较好| 91福利区一区二区三区| 成人黄页毛片网站| 国产成人精品免费一区二区| 久久精品国产99久久6| 日本视频一区二区| 亚洲国产一区二区三区| 成人免费一区二区三区视频 | 成人免费va视频| 狠狠色丁香婷婷综合| 麻豆免费精品视频| 日本不卡不码高清免费观看| 午夜电影一区二区三区| 婷婷激情综合网| 午夜电影网一区| 日韩精品乱码免费| 日韩av电影免费观看高清完整版在线观看| 一区二区三区欧美亚洲| 亚洲精品中文在线观看| 亚洲色图欧美激情| 国产精品资源在线看| 久久福利视频一区二区| 精品一区二区三区在线观看国产 | 久久久国产精品麻豆 | 国产精品污www在线观看| 久久色.com| 久久久久久久久伊人| 26uuu色噜噜精品一区| 久久久99精品免费观看不卡| 久久精品亚洲精品国产欧美| 中文字幕va一区二区三区| 国产亚洲精久久久久久| 国产精品久久99| 一个色妞综合视频在线观看| 午夜久久久久久久久久一区二区| 奇米影视7777精品一区二区| 另类小说一区二区三区| 国产成人午夜精品影院观看视频 | 日本不卡中文字幕| 久久99日本精品| 国产91高潮流白浆在线麻豆| 91片黄在线观看| 欧美美女一区二区| 精品国产亚洲一区二区三区在线观看 | 欧美一级日韩一级| 久久久久久亚洲综合影院红桃| 国产精品美女久久久久高潮| 一区二区三区在线视频观看| 秋霞成人午夜伦在线观看| 91精品欧美综合在线观看最新| 日韩美女在线视频| 欧美激情一区在线观看| 亚洲一区二区3| 黑人巨大精品欧美一区| 成人免费福利片| 欧美精品丝袜久久久中文字幕| 久久综合给合久久狠狠狠97色69| 日韩理论片网站| 久久精品99久久久| 99国产精品国产精品毛片| 欧美精品1区2区| 中文字幕一区二区三区精华液| 丝袜诱惑亚洲看片| 99久久精品国产导航| 日韩一区二区电影网| 自拍偷拍亚洲激情| 国产一区二区三区香蕉| 色噜噜狠狠成人网p站| 久久婷婷久久一区二区三区| 一区二区三区在线视频播放| 国产精品一区二区免费不卡| 欧美色网站导航| 欧美激情一区三区| 久久av资源站| 欧美精品乱码久久久久久| 中文字幕中文字幕一区二区| 精品一区二区久久久| 欧美日韩在线播放一区| 综合久久综合久久| 国产精品综合视频| 欧美一区二区久久| 亚洲成a人v欧美综合天堂| 白白色 亚洲乱淫| 久久久久久黄色| 美腿丝袜一区二区三区| 欧美日韩小视频| 亚洲黄色av一区| 99久久婷婷国产综合精品电影| 精品成人在线观看| 美脚の诱脚舐め脚责91 | 国产精品久久久久久久久晋中| 久久99精品国产麻豆婷婷洗澡| 欧美专区亚洲专区| 国产精品不卡视频| 丁香激情综合国产| 国产午夜亚洲精品理论片色戒 | 欧美成人精精品一区二区频| 亚洲观看高清完整版在线观看| 97aⅴ精品视频一二三区| 欧美激情一区二区三区全黄 | 中文字幕欧美日韩一区| 国内国产精品久久| 日韩视频123| 日本va欧美va瓶| 欧美一区二区美女| 老鸭窝一区二区久久精品| 欧美精品九九99久久| 天天操天天色综合| 欧美巨大另类极品videosbest | 蜜臀精品一区二区三区在线观看 | 一本色道久久加勒比精品 | 亚洲一级二级三级在线免费观看| 91美女在线看| 亚洲精品欧美专区| 欧美午夜一区二区三区免费大片| 亚洲国产成人tv| 欧美精品色一区二区三区| 日韩精品三区四区| 亚洲免费观看高清完整| 在线日韩一区二区| 午夜欧美电影在线观看| 日韩精品一区二区三区中文精品| 久久成人久久爱| 国产亚洲成av人在线观看导航| 丰满岳乱妇一区二区三区| 国产精品夫妻自拍| 欧美性欧美巨大黑白大战| 日韩有码一区二区三区| 精品国产乱码久久久久久闺蜜 | 国产sm精品调教视频网站| 国产精品久久久久久久久久久免费看| 99国产精品久久久久久久久久久| 一二三四社区欧美黄| 91精品国产入口| 国产成人亚洲精品青草天美| 亚洲情趣在线观看| 91精品国产综合久久久久久| 国内精品国产成人国产三级粉色| 国产精品福利av| 欧美一区二区三区在线看| 国产精品69毛片高清亚洲| 亚洲另类春色国产|