L 1 "..\src\app\main.c" N#include L 1 "C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdio.h" 1 N/* stdio.h: ANSI 'C' (X3J11 Oct 88) library header, section 4.9 */ N/* Copyright (C) Codemist Ltd., 1988-1993 */ N/* Copyright 1991-1998 ARM Limited. All rights reserved. */ N N/* N * RCS $Revision$ N * Checkin $Date$ N * Revising $Author: sdouglas $ N */ N N/* N * stdio.h declares two types, several macros, and many functions for N * performing input and output. For a discussion on Streams and Files N * refer to sections 4.9.2 and 4.9.3 in the above ANSI draft, or to a N * modern textbook on C. N */ N N#ifndef __stdio_h N#define __stdio_h N#define __ARMCLIB_VERSION 5060037 N N/* N * Depending on compiler version __int64 or __INT64_TYPE__ should be defined. N */ N#ifndef __int64 N #ifdef __INT64_TYPE__ S #define __int64 __INT64_TYPE__ N #endif N /* On some architectures neither of these may be defined - if so, fall N through and error out if used. */ N#endif N N N#define _ARMABI __declspec(__nothrow) N N #ifndef __STDIO_DECLS N #define __STDIO_DECLS N N #undef __CLIBNS N #ifdef __cplusplus S namespace std { S #define __CLIBNS ::std:: S extern "C" { N #else /* ndef __cplusplus */ N #define __CLIBNS N #endif /* ndef __cplusplus */ N N#if defined(__cplusplus) || !defined(__STRICT_ANSI__) || !defined(__size_t) X#if 0L || !0L || !0L N /* always defined in C++ and non-strict C for consistency of debug info */ N #if __sizeof_ptr == 8 X #if 4 == 8 S typedef unsigned long size_t; /* see */ N #else N typedef unsigned int size_t; /* see */ N #endif N #if !defined(__cplusplus) && defined(__STRICT_ANSI__) X #if !0L && 0L S #define __size_t 1 N #endif N#endif N N#undef NULL N#define NULL 0 /* see */ N N/* ANSI forbids va_list to be defined here */ N/* keep in step with and */ N#if !defined(__va_list) && (defined(__cplusplus) || !defined(__STRICT_ANSI__) || !defined(__va_list_defined)) X#if !0L && (0L || !0L || !0L) N/* always defined in C++ and non-strict C for consistency of debug info */ N #ifdef __clang__ S typedef __builtin_va_list __va_list; N #else N typedef struct __va_list __va_list; N #endif N #if !defined(__cplusplus) && defined(__STRICT_ANSI__) X #if !0L && 0L S #define __va_list_defined 1 N #endif N#endif N N /* N * If the compiler supports signalling nans as per N965 then it N * will define __SUPPORT_SNAN__, in which case a user may define N * _WANT_SNAN in order to obtain compliant versions of the printf N * and scanf families of functions N */ N#if defined(__SUPPORT_SNAN__) && defined(_WANT_SNAN) X#if 0L && 0L S#pragma import(__use_snan) N#endif N Ntypedef struct __fpos_t_struct { N unsigned __int64 __pos; N /* N * this structure is equivalent to an mbstate_t, but we're not N * allowed to actually define the type name `mbstate_t' within N * stdio.h N */ N struct { N unsigned int __state1, __state2; N } __mbstate; N} fpos_t; N /* N * fpos_t is an object capable of recording all information needed to N * specify uniquely every position within a file. N */ N N#define _SYS_OPEN 16 N /* _SYS_OPEN defines a limit on the number of open files that is imposed N * by this C library N */ N Ntypedef struct __FILE FILE; N /* N * FILE is an object capable of recording all information needed to control N * a stream, such as its file position indicator, a pointer to its N * associated buffer, an error indicator that records whether a read/write N * error has occurred and an end-of-file indicator that records whether the N * end-of-file has been reached. N * Its structure is not made known to library clients. N */ N N#if defined(__STRICT_ANSI__) && !__FILE_INCOMPLETE X#if 0L && !__FILE_INCOMPLETE Sstruct __FILE { S union { S long __FILE_alignment; S#ifdef __TARGET_ARCH_AARCH64 S char __FILE_size[136]; S#else /* __TARGET_ARCH_AARCH64 */ S char __FILE_size[84]; S#endif /* __TARGET_ARCH_AARCH64 */ S } __FILE_opaque; S}; S /* S * FILE must be an object type (C99 - 7.19.1) and an object type fully S * describes an object [including its static size] (C99 - 6.2.5). S * This definition is a placeholder which matches the struct __FILE in S * size and alignment as used internally by libc. S */ N#endif N N Nextern FILE __stdin, __stdout, __stderr; Nextern FILE *__aeabi_stdin, *__aeabi_stdout, *__aeabi_stderr; N N#if _AEABI_PORTABILITY_LEVEL != 0 || (!defined _AEABI_PORTABILITY_LEVEL && __DEFAULT_AEABI_PORTABILITY_LEVEL != 0) X#if _AEABI_PORTABILITY_LEVEL != 0 || (!0L && __DEFAULT_AEABI_PORTABILITY_LEVEL != 0) S#define stdin (__CLIBNS __aeabi_stdin) S /* pointer to a FILE object associated with standard input stream */ S#define stdout (__CLIBNS __aeabi_stdout) S /* pointer to a FILE object associated with standard output stream */ S#define stderr (__CLIBNS __aeabi_stderr) S /* pointer to a FILE object associated with standard error stream */ Sextern const int __aeabi_IOFBF; S#define _IOFBF (__CLIBNS __aeabi_IOFBF) Sextern const int __aeabi_IONBF; S#define _IONBF (__CLIBNS __aeabi_IONBF) Sextern const int __aeabi_IOLBF; S#define _IOLBF (__CLIBNS __aeabi_IOLBF) Sextern const int __aeabi_BUFSIZ; S#define BUFSIZ (__CLIBNS __aeabi_BUFSIZ) Sextern const int __aeabi_FOPEN_MAX; S#define FOPEN_MAX (__CLIBNS __aeabi_FOPEN_MAX) Sextern const int __aeabi_TMP_MAX; S#define TMP_MAX (__CLIBNS __aeabi_TMP_MAX) Sextern const int __aeabi_FILENAME_MAX; S#define FILENAME_MAX (__CLIBNS __aeabi_FILENAME_MAX) Sextern const int __aeabi_L_tmpnam; S#define L_tmpnam (__CLIBNS __aeabi_L_tmpnam) N#else N#define stdin (&__CLIBNS __stdin) N /* pointer to a FILE object associated with standard input stream */ N#define stdout (&__CLIBNS __stdout) N /* pointer to a FILE object associated with standard output stream */ N#define stderr (&__CLIBNS __stderr) N /* pointer to a FILE object associated with standard error stream */ N N#define _IOFBF 0x100 /* fully buffered IO */ N#define _IOLBF 0x200 /* line buffered IO */ N#define _IONBF 0x400 /* unbuffered IO */ N N /* Various default file IO buffer sizes */ N#define BUFSIZ (512) /* system buffer size (as used by setbuf) */ N N#define FOPEN_MAX _SYS_OPEN N /* N * an integral constant expression that is the minimum number of files that N * this implementation guarantees can be open simultaneously. N */ N N#define FILENAME_MAX 256 N /* N * an integral constant expression that is the size of an array of char N * large enough to hold the longest filename string N */ N#define L_tmpnam FILENAME_MAX N /* N * an integral constant expression that is the size of an array of char N * large enough to hold a temporary file name string generated by the N * tmpnam function. N */ N#define TMP_MAX 256 N /* N * an integral constant expression that is the minimum number of unique N * file names that shall be generated by the tmpnam function. N */ N N#endif N N#define EOF (-1) N /* N * negative integral constant, indicates end-of-file, that is, no more input N * from a stream. N */ N N#define SEEK_SET 0 /* start of stream (see fseek) */ N#define SEEK_CUR 1 /* current position in stream (see fseek) */ N#define SEEK_END 2 /* end of stream (see fseek) */ N N /* N * _IOBIN is the flag passed to _sys_write to denote a binary N * file. N */ N#define _IOBIN 0x04 /* binary stream */ N N#define __STDIN_BUFSIZ (64) /* default stdin buffer size */ N#define __STDOUT_BUFSIZ (64) /* default stdout buffer size */ N#define __STDERR_BUFSIZ (16) /* default stderr buffer size */ N Nextern _ARMABI int remove(const char * /*filename*/) __attribute__((__nonnull__(1))); Xextern __declspec(__nothrow) int remove(const char * ) __attribute__((__nonnull__(1))); N /* N * causes the file whose name is the string pointed to by filename to be N * removed. Subsequent attempts to open the file will fail, unless it is N * created anew. If the file is open, the behaviour of the remove function N * is implementation-defined. N * Returns: zero if the operation succeeds, nonzero if it fails. N */ Nextern _ARMABI int rename(const char * /*old*/, const char * /*new*/) __attribute__((__nonnull__(1,2))); Xextern __declspec(__nothrow) int rename(const char * , const char * ) __attribute__((__nonnull__(1,2))); N /* N * causes the file whose name is the string pointed to by old to be N * henceforth known by the name given by the string pointed to by new. The N * file named old is effectively removed. If a file named by the string N * pointed to by new exists prior to the call of the rename function, the N * behaviour is implementation-defined. N * Returns: zero if the operation succeeds, nonzero if it fails, in which N * case if the file existed previously it is still known by its N * original name. N */ Nextern _ARMABI FILE *tmpfile(void); Xextern __declspec(__nothrow) FILE *tmpfile(void); N /* N * creates a temporary binary file that will be automatically removed when N * it is closed or at program termination. The file is opened for update. N * Returns: a pointer to the stream of the file that it created. If the file N * cannot be created, a null pointer is returned. N */ Nextern _ARMABI char *tmpnam(char * /*s*/); Xextern __declspec(__nothrow) char *tmpnam(char * ); N /* N * generates a string that is not the same as the name of an existing file. N * The tmpnam function generates a different string each time it is called, N * up to TMP_MAX times. If it is called more than TMP_MAX times, the N * behaviour is implementation-defined. N * Returns: If the argument is a null pointer, the tmpnam function leaves N * its result in an internal static object and returns a pointer to N * that object. Subsequent calls to the tmpnam function may modify N * the same object. if the argument is not a null pointer, it is N * assumed to point to an array of at least L_tmpnam characters; N * the tmpnam function writes its result in that array and returns N * the argument as its value. N */ N Nextern _ARMABI int fclose(FILE * /*stream*/) __attribute__((__nonnull__(1))); Xextern __declspec(__nothrow) int fclose(FILE * ) __attribute__((__nonnull__(1))); N /* N * causes the stream pointed to by stream to be flushed and the associated N * file to be closed. Any unwritten buffered data for the stream are N * delivered to the host environment to be written to the file; any unread N * buffered data are discarded. The stream is disassociated from the file. N * If the associated buffer was automatically allocated, it is deallocated. N * Returns: zero if the stream was succesfully closed, or nonzero if any N * errors were detected or if the stream was already closed. N */ Nextern _ARMABI int fflush(FILE * /*stream*/); Xextern __declspec(__nothrow) int fflush(FILE * ); N /* N * If the stream points to an output or update stream in which the most N * recent operation was output, the fflush function causes any unwritten N * data for that stream to be delivered to the host environment to be N * written to the file. If the stream points to an input or update stream, N * the fflush function undoes the effect of any preceding ungetc operation N * on the stream. N * Returns: nonzero if a write error occurs. N */ Nextern _ARMABI FILE *fopen(const char * __restrict /*filename*/, Xextern __declspec(__nothrow) FILE *fopen(const char * __restrict , N const char * __restrict /*mode*/) __attribute__((__nonnull__(1,2))); N /* N * opens the file whose name is the string pointed to by filename, and N * associates a stream with it. N * The argument mode points to a string beginning with one of the following N * sequences: N * "r" open text file for reading N * "w" create text file for writing, or truncate to zero length N * "a" append; open text file or create for writing at eof N * "rb" open binary file for reading N * "wb" create binary file for writing, or truncate to zero length N * "ab" append; open binary file or create for writing at eof N * "r+" open text file for update (reading and writing) N * "w+" create text file for update, or truncate to zero length N * "a+" append; open text file or create for update, writing at eof N * "r+b"/"rb+" open binary file for update (reading and writing) N * "w+b"/"wb+" create binary file for update, or truncate to zero length N * "a+b"/"ab+" append; open binary file or create for update, writing at eof N * N * Opening a file with read mode ('r' as the first character in the mode N * argument) fails if the file does not exist or cannot be read. N * Opening a file with append mode ('a' as the first character in the mode N * argument) causes all subsequent writes to be forced to the current end of N * file, regardless of intervening calls to the fseek function. In some N * implementations, opening a binary file with append mode ('b' as the N * second or third character in the mode argument) may initially position N * the file position indicator beyond the last data written, because of the N * NUL padding. N * When a file is opened with update mode ('+' as the second or third N * character in the mode argument), both input and output may be performed N * on the associated stream. However, output may not be directly followed N * by input without an intervening call to the fflush fuction or to a file N * positioning function (fseek, fsetpos, or rewind), and input be not be N * directly followed by output without an intervening call to the fflush N * fuction or to a file positioning function, unless the input operation N * encounters end-of-file. Opening a file with update mode may open or N * create a binary stream in some implementations. When opened, a stream N * is fully buffered if and only if it does not refer to an interactive N * device. The error and end-of-file indicators for the stream are N * cleared. N * Returns: a pointer to the object controlling the stream. If the open N * operation fails, fopen returns a null pointer. N */ Nextern _ARMABI FILE *freopen(const char * __restrict /*filename*/, Xextern __declspec(__nothrow) FILE *freopen(const char * __restrict , N const char * __restrict /*mode*/, N FILE * __restrict /*stream*/) __attribute__((__nonnull__(2,3))); N /* N * opens the file whose name is the string pointed to by filename and N * associates the stream pointed to by stream with it. The mode argument is N * used just as in the fopen function. N * The freopen function first attempts to close any file that is associated N * with the specified stream. Failure to close the file successfully is N * ignored. The error and end-of-file indicators for the stream are cleared. N * Returns: a null pointer if the operation fails. Otherwise, freopen N * returns the value of the stream. N */ Nextern _ARMABI void setbuf(FILE * __restrict /*stream*/, Xextern __declspec(__nothrow) void setbuf(FILE * __restrict , N char * __restrict /*buf*/) __attribute__((__nonnull__(1))); N /* N * Except that it returns no value, the setbuf function is equivalent to the N * setvbuf function invoked with the values _IOFBF for mode and BUFSIZ for N * size, or (if buf is a null pointer), with the value _IONBF for mode. N * Returns: no value. N */ Nextern _ARMABI int setvbuf(FILE * __restrict /*stream*/, Xextern __declspec(__nothrow) int setvbuf(FILE * __restrict , N char * __restrict /*buf*/, N int /*mode*/, size_t /*size*/) __attribute__((__nonnull__(1))); N /* N * may be used after the stream pointed to by stream has been associated N * with an open file but before it is read or written. The argument mode N * determines how stream will be buffered, as follows: _IOFBF causes N * input/output to be fully buffered; _IOLBF causes output to be line N * buffered (the buffer will be flushed when a new-line character is N * written, when the buffer is full, or when input is requested); _IONBF N * causes input/output to be completely unbuffered. If buf is not the null N * pointer, the array it points to may be used instead of an automatically N * allocated buffer (the buffer must have a lifetime at least as great as N * the open stream, so the stream should be closed before a buffer that has N * automatic storage duration is deallocated upon block exit). The argument N * size specifies the size of the array. The contents of the array at any N * time are indeterminate. N * Returns: zero on success, or nonzero if an invalid value is given for N * mode or size, or if the request cannot be honoured. N */ N#pragma __printf_args Nextern _ARMABI int fprintf(FILE * __restrict /*stream*/, Xextern __declspec(__nothrow) int fprintf(FILE * __restrict , N const char * __restrict /*format*/, ...) __attribute__((__nonnull__(1,2))); N /* N * writes output to the stream pointed to by stream, under control of the N * string pointed to by format that specifies how subsequent arguments are N * converted for output. If there are insufficient arguments for the format, N * the behaviour is undefined. If the format is exhausted while arguments N * remain, the excess arguments are evaluated but otherwise ignored. The N * fprintf function returns when the end of the format string is reached. N * The format shall be a multibyte character sequence, beginning and ending N * in its initial shift state. The format is composed of zero or more N * directives: ordinary multibyte characters (not %), which are copied N * unchanged to the output stream; and conversion specifiers, each of which N * results in fetching zero or more subsequent arguments. Each conversion N * specification is introduced by the character %. For a description of the N * available conversion specifiers refer to section 4.9.6.1 in the ANSI N * draft mentioned at the start of this file or to any modern textbook on C. N * The minimum value for the maximum number of characters producable by any N * single conversion is at least 509. N * Returns: the number of characters transmitted, or a negative value if an N * output error occurred. N */ N#pragma __printf_args Nextern _ARMABI int _fprintf(FILE * __restrict /*stream*/, Xextern __declspec(__nothrow) int _fprintf(FILE * __restrict , N const char * __restrict /*format*/, ...) __attribute__((__nonnull__(1,2))); N /* N * is equivalent to fprintf, but does not support floating-point formats. N * You can use instead of fprintf to improve code size. N * Returns: as fprintf. N */ N#pragma __printf_args Nextern _ARMABI int printf(const char * __restrict /*format*/, ...) __attribute__((__nonnull__(1))); Xextern __declspec(__nothrow) int printf(const char * __restrict , ...) __attribute__((__nonnull__(1))); N /* N * is equivalent to fprintf with the argument stdout interposed before the N * arguments to printf. N * Returns: the number of characters transmitted, or a negative value if an N * output error occurred. N */ N#pragma __printf_args Nextern _ARMABI int _printf(const char * __restrict /*format*/, ...) __attribute__((__nonnull__(1))); Xextern __declspec(__nothrow) int _printf(const char * __restrict , ...) __attribute__((__nonnull__(1))); N /* N * is equivalent to printf, but does not support floating-point formats. N * You can use instead of printf to improve code size. N * Returns: as printf. N */ N#pragma __printf_args Nextern _ARMABI int sprintf(char * __restrict /*s*/, const char * __restrict /*format*/, ...) __attribute__((__nonnull__(1,2))); Xextern __declspec(__nothrow) int sprintf(char * __restrict , const char * __restrict , ...) __attribute__((__nonnull__(1,2))); N /* N * is equivalent to fprintf, except that the argument s specifies an array N * into which the generated output is to be written, rather than to a N * stream. A null character is written at the end of the characters written; N * it is not counted as part of the returned sum. N * Returns: the number of characters written to the array, not counting the N * terminating null character. N */ N#pragma __printf_args Nextern _ARMABI int _sprintf(char * __restrict /*s*/, const char * __restrict /*format*/, ...) __attribute__((__nonnull__(1,2))); Xextern __declspec(__nothrow) int _sprintf(char * __restrict , const char * __restrict , ...) __attribute__((__nonnull__(1,2))); N /* N * is equivalent to sprintf, but does not support floating-point formats. N * You can use instead of sprintf to improve code size. N * Returns: as sprintf. N */ N N#pragma __printf_args Nextern _ARMABI int __ARM_snprintf(char * __restrict /*s*/, size_t /*n*/, Xextern __declspec(__nothrow) int __ARM_snprintf(char * __restrict , size_t , N const char * __restrict /*format*/, ...) __attribute__((__nonnull__(3))); N N#if !defined(__STRICT_ANSI__) || (defined(__STDC_VERSION__) && 199901L <= __STDC_VERSION__) || (defined(__cplusplus) && 201103L <= __cplusplus) X#if !0L || (1L && 199901L <= 199901L) || (0L && 201103L <= __cplusplus) N#pragma __printf_args Nextern _ARMABI int snprintf(char * __restrict /*s*/, size_t /*n*/, Xextern __declspec(__nothrow) int snprintf(char * __restrict , size_t , N const char * __restrict /*format*/, ...) __attribute__((__nonnull__(3))); N /* N * is equivalent to fprintf, except that the argument s specifies an array N * into which the generated output is to be written, rather than to a N * stream. The argument n specifies the size of the output array, so as to N * avoid overflowing the buffer. N * A null character is written at the end of the characters written, even N * if the formatting was not completed; it is not counted as part of the N * returned sum. At most n characters of the output buffer are used, N * _including_ the null character. N * Returns: the number of characters that would have been written to the N * array, not counting the terminating null character, if the N * array had been big enough. So if the return is >=0 and =n, the string was truncated (but there is still a null char N * at the end of what was written); if the return is <0, there was N * an error. N */ N#endif N#pragma __printf_args Nextern _ARMABI int _snprintf(char * __restrict /*s*/, size_t /*n*/, Xextern __declspec(__nothrow) int _snprintf(char * __restrict , size_t , N const char * __restrict /*format*/, ...) __attribute__((__nonnull__(3))); N /* N * is equivalent to snprintf, but does not support floating-point formats. N * You can use instead of snprintf to improve code size. N * Returns: as snprintf. N */ N#pragma __scanf_args Nextern _ARMABI int fscanf(FILE * __restrict /*stream*/, Xextern __declspec(__nothrow) int fscanf(FILE * __restrict , N const char * __restrict /*format*/, ...) __attribute__((__nonnull__(1,2))); N /* N * reads input from the stream pointed to by stream, under control of the N * string pointed to by format that specifies the admissible input sequences N * and how thay are to be converted for assignment, using subsequent N * arguments as pointers to the objects to receive the converted input. If N * there are insufficient arguments for the format, the behaviour is N * undefined. If the format is exhausted while arguments remain, the excess N * arguments are evaluated but otherwise ignored. N * The format is composed of zero or more directives: one or more N * white-space characters; an ordinary character (not %); or a conversion N * specification. Each conversion specification is introduced by the N * character %. For a description of the available conversion specifiers N * refer to section 4.9.6.2 in the ANSI draft mentioned at the start of this N * file, or to any modern textbook on C. N * If end-of-file is encountered during input, conversion is terminated. If N * end-of-file occurs before any characters matching the current directive N * have been read (other than leading white space, where permitted), N * execution of the current directive terminates with an input failure; N * otherwise, unless execution of the current directive is terminated with a N * matching failure, execution of the following directive (if any) is N * terminated with an input failure. N * If conversions terminates on a conflicting input character, the offending N * input character is left unread in the input strem. Trailing white space N * (including new-line characters) is left unread unless matched by a N * directive. The success of literal matches and suppressed asignments is N * not directly determinable other than via the %n directive. N * Returns: the value of the macro EOF if an input failure occurs before any N * conversion. Otherwise, the fscanf function returns the number of N * input items assigned, which can be fewer than provided for, or N * even zero, in the event of an early conflict between an input N * character and the format. N */ N#pragma __scanf_args Nextern _ARMABI int _fscanf(FILE * __restrict /*stream*/, Xextern __declspec(__nothrow) int _fscanf(FILE * __restrict , N const char * __restrict /*format*/, ...) __attribute__((__nonnull__(1,2))); N /* N * is equivalent to fscanf, but does not support floating-point formats. N * You can use instead of fscanf to improve code size. N * Returns: as fscanf. N */ N#pragma __scanf_args Nextern _ARMABI int scanf(const char * __restrict /*format*/, ...) __attribute__((__nonnull__(1))); Xextern __declspec(__nothrow) int scanf(const char * __restrict , ...) __attribute__((__nonnull__(1))); N /* N * is equivalent to fscanf with the argument stdin interposed before the N * arguments to scanf. N * Returns: the value of the macro EOF if an input failure occurs before any N * conversion. Otherwise, the scanf function returns the number of N * input items assigned, which can be fewer than provided for, or N * even zero, in the event of an early matching failure. N */ N#pragma __scanf_args Nextern _ARMABI int _scanf(const char * __restrict /*format*/, ...) __attribute__((__nonnull__(1))); Xextern __declspec(__nothrow) int _scanf(const char * __restrict , ...) __attribute__((__nonnull__(1))); N /* N * is equivalent to scanf, but does not support floating-point formats. N * You can use instead of scanf to improve code size. N * Returns: as scanf. N */ N#pragma __scanf_args Nextern _ARMABI int sscanf(const char * __restrict /*s*/, Xextern __declspec(__nothrow) int sscanf(const char * __restrict , N const char * __restrict /*format*/, ...) __attribute__((__nonnull__(1,2))); N /* N * is equivalent to fscanf except that the argument s specifies a string N * from which the input is to be obtained, rather than from a stream. N * Reaching the end of the string is equivalent to encountering end-of-file N * for the fscanf function. N * Returns: the value of the macro EOF if an input failure occurs before any N * conversion. Otherwise, the scanf function returns the number of N * input items assigned, which can be fewer than provided for, or N * even zero, in the event of an early matching failure. N */ N#pragma __scanf_args Nextern _ARMABI int _sscanf(const char * __restrict /*s*/, Xextern __declspec(__nothrow) int _sscanf(const char * __restrict , N const char * __restrict /*format*/, ...) __attribute__((__nonnull__(1,2))); N /* N * is equivalent to sscanf, but does not support floating-point formats. N * You can use instead of sscanf to improve code size. N * Returns: as sscanf. N */ N#if !defined(__STRICT_ANSI__) || (defined(__STDC_VERSION__) && 199901L <= __STDC_VERSION__) || (defined(__cplusplus) && 201103L <= __cplusplus) X#if !0L || (1L && 199901L <= 199901L) || (0L && 201103L <= __cplusplus) N/* C99 additions */ Nextern _ARMABI int vfscanf(FILE * __restrict /*stream*/, const char * __restrict /*format*/, __va_list) __attribute__((__nonnull__(1,2))); Xextern __declspec(__nothrow) int vfscanf(FILE * __restrict , const char * __restrict , __va_list) __attribute__((__nonnull__(1,2))); Nextern _ARMABI int vscanf(const char * __restrict /*format*/, __va_list) __attribute__((__nonnull__(1))); Xextern __declspec(__nothrow) int vscanf(const char * __restrict , __va_list) __attribute__((__nonnull__(1))); Nextern _ARMABI int vsscanf(const char * __restrict /*s*/, const char * __restrict /*format*/, __va_list) __attribute__((__nonnull__(1,2))); Xextern __declspec(__nothrow) int vsscanf(const char * __restrict , const char * __restrict , __va_list) __attribute__((__nonnull__(1,2))); N#endif Nextern _ARMABI int _vfscanf(FILE * __restrict /*stream*/, const char * __restrict /*format*/, __va_list) __attribute__((__nonnull__(1,2))); Xextern __declspec(__nothrow) int _vfscanf(FILE * __restrict , const char * __restrict , __va_list) __attribute__((__nonnull__(1,2))); Nextern _ARMABI int _vscanf(const char * __restrict /*format*/, __va_list) __attribute__((__nonnull__(1))); Xextern __declspec(__nothrow) int _vscanf(const char * __restrict , __va_list) __attribute__((__nonnull__(1))); Nextern _ARMABI int _vsscanf(const char * __restrict /*s*/, const char * __restrict /*format*/, __va_list) __attribute__((__nonnull__(1,2))); Xextern __declspec(__nothrow) int _vsscanf(const char * __restrict , const char * __restrict , __va_list) __attribute__((__nonnull__(1,2))); Nextern _ARMABI int __ARM_vsscanf(const char * __restrict /*s*/, const char * __restrict /*format*/, __va_list) __attribute__((__nonnull__(1,2))); Xextern __declspec(__nothrow) int __ARM_vsscanf(const char * __restrict , const char * __restrict , __va_list) __attribute__((__nonnull__(1,2))); N Nextern _ARMABI int vprintf(const char * __restrict /*format*/, __va_list /*arg*/) __attribute__((__nonnull__(1))); Xextern __declspec(__nothrow) int vprintf(const char * __restrict , __va_list ) __attribute__((__nonnull__(1))); N /* N * is equivalent to printf, with the variable argument list replaced by arg, N * which has been initialised by the va_start macro (and possibly subsequent N * va_arg calls). The vprintf function does not invoke the va_end function. N * Returns: the number of characters transmitted, or a negative value if an N * output error occurred. N */ Nextern _ARMABI int _vprintf(const char * __restrict /*format*/, __va_list /*arg*/) __attribute__((__nonnull__(1))); Xextern __declspec(__nothrow) int _vprintf(const char * __restrict , __va_list ) __attribute__((__nonnull__(1))); N /* N * is equivalent to vprintf, but does not support floating-point formats. N * You can use instead of vprintf to improve code size. N * Returns: as vprintf. N */ Nextern _ARMABI int vfprintf(FILE * __restrict /*stream*/, Xextern __declspec(__nothrow) int vfprintf(FILE * __restrict , N const char * __restrict /*format*/, __va_list /*arg*/) __attribute__((__nonnull__(1,2))); N /* N * is equivalent to fprintf, with the variable argument list replaced by N * arg, which has been initialised by the va_start macro (and possibly N * subsequent va_arg calls). The vfprintf function does not invoke the N * va_end function. N * Returns: the number of characters transmitted, or a negative value if an N * output error occurred. N */ Nextern _ARMABI int vsprintf(char * __restrict /*s*/, Xextern __declspec(__nothrow) int vsprintf(char * __restrict , N const char * __restrict /*format*/, __va_list /*arg*/) __attribute__((__nonnull__(1,2))); N /* N * is equivalent to sprintf, with the variable argument list replaced by N * arg, which has been initialised by the va_start macro (and possibly N * subsequent va_arg calls). The vsprintf function does not invoke the N * va_end function. N * Returns: the number of characters written in the array, not counting the N * terminating null character. N */ Nextern _ARMABI int __ARM_vsnprintf(char * __restrict /*s*/, size_t /*n*/, Xextern __declspec(__nothrow) int __ARM_vsnprintf(char * __restrict , size_t , N const char * __restrict /*format*/, __va_list /*arg*/) __attribute__((__nonnull__(3))); N#if !defined(__STRICT_ANSI__) || (defined(__STDC_VERSION__) && 199901L <= __STDC_VERSION__) || (defined(__cplusplus) && 201103L <= __cplusplus) X#if !0L || (1L && 199901L <= 199901L) || (0L && 201103L <= __cplusplus) Nextern _ARMABI int vsnprintf(char * __restrict /*s*/, size_t /*n*/, Xextern __declspec(__nothrow) int vsnprintf(char * __restrict , size_t , N const char * __restrict /*format*/, __va_list /*arg*/) __attribute__((__nonnull__(3))); N /* N * is equivalent to snprintf, with the variable argument list replaced by N * arg, which has been initialised by the va_start macro (and possibly N * subsequent va_arg calls). The vsprintf function does not invoke the N * va_end function. N * Returns: the number of characters that would have been written in the N * array, not counting the terminating null character. As N * snprintf. N */ N#endif Nextern _ARMABI int _vsprintf(char * __restrict /*s*/, Xextern __declspec(__nothrow) int _vsprintf(char * __restrict , N const char * __restrict /*format*/, __va_list /*arg*/) __attribute__((__nonnull__(1,2))); N /* N * is equivalent to vsprintf, but does not support floating-point formats. N * You can use instead of vsprintf to improve code size. N * Returns: as vsprintf. N */ Nextern _ARMABI int _vfprintf(FILE * __restrict /*stream*/, Xextern __declspec(__nothrow) int _vfprintf(FILE * __restrict , N const char * __restrict /*format*/, __va_list /*arg*/) __attribute__((__nonnull__(1,2))); N /* N * is equivalent to vfprintf, but does not support floating-point formats. N * You can use instead of vfprintf to improve code size. N * Returns: as vfprintf. N */ Nextern _ARMABI int _vsnprintf(char * __restrict /*s*/, size_t /*n*/, Xextern __declspec(__nothrow) int _vsnprintf(char * __restrict , size_t , N const char * __restrict /*format*/, __va_list /*arg*/) __attribute__((__nonnull__(3))); N /* N * is equivalent to vsnprintf, but does not support floating-point formats. N * You can use instead of vsnprintf to improve code size. N * Returns: as vsnprintf. N */ N#if !defined(__STRICT_ANSI__) X#if !0L N#pragma __printf_args Nextern _ARMABI int asprintf(char ** /*strp*/, const char * __restrict /*format*/, ...) __attribute__((__nonnull__(2))); Xextern __declspec(__nothrow) int asprintf(char ** , const char * __restrict , ...) __attribute__((__nonnull__(2))); Nextern _ARMABI int vasprintf(char ** /*strp*/, const char * __restrict /*format*/, __va_list /*arg*/) __attribute__((__nonnull__(2))); Xextern __declspec(__nothrow) int vasprintf(char ** , const char * __restrict , __va_list ) __attribute__((__nonnull__(2))); N#endif N#pragma __printf_args Nextern _ARMABI int __ARM_asprintf(char ** /*strp*/, const char * __restrict /*format*/, ...) __attribute__((__nonnull__(2))); Xextern __declspec(__nothrow) int __ARM_asprintf(char ** , const char * __restrict , ...) __attribute__((__nonnull__(2))); Nextern _ARMABI int __ARM_vasprintf(char ** /*strp*/, const char * __restrict /*format*/, __va_list /*arg*/) __attribute__((__nonnull__(2))); Xextern __declspec(__nothrow) int __ARM_vasprintf(char ** , const char * __restrict , __va_list ) __attribute__((__nonnull__(2))); N /* N * dynamically allocates a buffer of the right size for the N * formatted string, and returns it in (*strp). Formal return value N * is the same as any other printf variant, except that it returns N * -1 if the buffer could not be allocated. N * N * (The functions with __ARM_ prefixed names are identical to the N * ones without, but are available in all compilation modes without N * violating user namespace.) N */ N Nextern _ARMABI int fgetc(FILE * /*stream*/) __attribute__((__nonnull__(1))); Xextern __declspec(__nothrow) int fgetc(FILE * ) __attribute__((__nonnull__(1))); N /* N * obtains the next character (if present) as an unsigned char converted to N * an int, from the input stream pointed to by stream, and advances the N * associated file position indicator (if defined). N * Returns: the next character from the input stream pointed to by stream. N * If the stream is at end-of-file, the end-of-file indicator is N * set and fgetc returns EOF. If a read error occurs, the error N * indicator is set and fgetc returns EOF. N */ Nextern _ARMABI char *fgets(char * __restrict /*s*/, int /*n*/, Xextern __declspec(__nothrow) char *fgets(char * __restrict , int , N FILE * __restrict /*stream*/) __attribute__((__nonnull__(1,3))); N /* N * reads at most one less than the number of characters specified by n from N * the stream pointed to by stream into the array pointed to by s. No N * additional characters are read after a new-line character (which is N * retained) or after end-of-file. A null character is written immediately N * after the last character read into the array. N * Returns: s if successful. If end-of-file is encountered and no characters N * have been read into the array, the contents of the array remain N * unchanged and a null pointer is returned. If a read error occurs N * during the operation, the array contents are indeterminate and a N * null pointer is returned. N */ Nextern _ARMABI int fputc(int /*c*/, FILE * /*stream*/) __attribute__((__nonnull__(2))); Xextern __declspec(__nothrow) int fputc(int , FILE * ) __attribute__((__nonnull__(2))); N /* N * writes the character specified by c (converted to an unsigned char) to N * the output stream pointed to by stream, at the position indicated by the N * asociated file position indicator (if defined), and advances the N * indicator appropriately. If the file position indicator is not defined, N * the character is appended to the output stream. N * Returns: the character written. If a write error occurs, the error N * indicator is set and fputc returns EOF. N */ Nextern _ARMABI int fputs(const char * __restrict /*s*/, FILE * __restrict /*stream*/) __attribute__((__nonnull__(1,2))); Xextern __declspec(__nothrow) int fputs(const char * __restrict , FILE * __restrict ) __attribute__((__nonnull__(1,2))); N /* N * writes the string pointed to by s to the stream pointed to by stream. N * The terminating null character is not written. N * Returns: EOF if a write error occurs; otherwise it returns a nonnegative N * value. N */ Nextern _ARMABI int getc(FILE * /*stream*/) __attribute__((__nonnull__(1))); Xextern __declspec(__nothrow) int getc(FILE * ) __attribute__((__nonnull__(1))); N /* N * is equivalent to fgetc except that it may be implemented as an unsafe N * macro (stream may be evaluated more than once, so the argument should N * never be an expression with side-effects). N * Returns: the next character from the input stream pointed to by stream. N * If the stream is at end-of-file, the end-of-file indicator is N * set and getc returns EOF. If a read error occurs, the error N * indicator is set and getc returns EOF. N */ N#ifdef __cplusplus S inline int getchar() { return getc(stdin); } N#else N #define getchar() getc(stdin) N extern _ARMABI int (getchar)(void); X extern __declspec(__nothrow) int (getchar)(void); N#endif N /* N * is equivalent to getc with the argument stdin. N * Returns: the next character from the input stream pointed to by stdin. N * If the stream is at end-of-file, the end-of-file indicator is N * set and getchar returns EOF. If a read error occurs, the error N * indicator is set and getchar returns EOF. N */ Nextern _ARMABI char *gets(char * /*s*/) __attribute__((__nonnull__(1))); Xextern __declspec(__nothrow) char *gets(char * ) __attribute__((__nonnull__(1))); N /* N * reads characters from the input stream pointed to by stdin into the array N * pointed to by s, until end-of-file is encountered or a new-line character N * is read. Any new-line character is discarded, and a null character is N * written immediately after the last character read into the array. N * Returns: s if successful. If end-of-file is encountered and no characters N * have been read into the array, the contents of the array remain N * unchanged and a null pointer is returned. If a read error occurs N * during the operation, the array contents are indeterminate and a N * null pointer is returned. N */ Nextern _ARMABI int putc(int /*c*/, FILE * /*stream*/) __attribute__((__nonnull__(2))); Xextern __declspec(__nothrow) int putc(int , FILE * ) __attribute__((__nonnull__(2))); N /* N * is equivalent to fputc except that it may be implemented as aan unsafe N * macro (stream may be evaluated more than once, so the argument should N * never be an expression with side-effects). N * Returns: the character written. If a write error occurs, the error N * indicator is set and putc returns EOF. N */ N#ifdef __cplusplus S inline int putchar(int __c) { return putc(__c, stdout); } N#else N #define putchar(c) putc(c, stdout) N extern _ARMABI int (putchar)(int /*c*/); X extern __declspec(__nothrow) int (putchar)(int ); N#endif N /* N * is equivalent to putc with the second argument stdout. N * Returns: the character written. If a write error occurs, the error N * indicator is set and putc returns EOF. N */ Nextern _ARMABI int puts(const char * /*s*/) __attribute__((__nonnull__(1))); Xextern __declspec(__nothrow) int puts(const char * ) __attribute__((__nonnull__(1))); N /* N * writes the string pointed to by s to the stream pointed to by stdout, and N * appends a new-line character to the output. The terminating null N * character is not written. N * Returns: EOF if a write error occurs; otherwise it returns a nonnegative N * value. N */ Nextern _ARMABI int ungetc(int /*c*/, FILE * /*stream*/) __attribute__((__nonnull__(2))); Xextern __declspec(__nothrow) int ungetc(int , FILE * ) __attribute__((__nonnull__(2))); N /* N * pushes the character specified by c (converted to an unsigned char) back N * onto the input stream pointed to by stream. The character will be N * returned by the next read on that stream. An intervening call to the N * fflush function or to a file positioning function (fseek, fsetpos, N * rewind) discards any pushed-back characters. The extern _ARMABIal storage N * corresponding to the stream is unchanged. N * One character pushback is guaranteed. If the unget function is called too N * many times on the same stream without an intervening read or file N * positioning operation on that stream, the operation may fail. N * If the value of c equals that of the macro EOF, the operation fails and N * the input stream is unchanged. N * A successful call to the ungetc function clears the end-of-file N * indicator. The value of the file position indicator after reading or N * discarding all pushed-back characters shall be the same as it was before N * the characters were pushed back. For a text stream, the value of the file N * position indicator after a successful call to the ungetc function is N * unspecified until all pushed-back characters are read or discarded. For a N * binary stream, the file position indicator is decremented by each N * successful call to the ungetc function; if its value was zero before a N * call, it is indeterminate after the call. N * Returns: the character pushed back after conversion, or EOF if the N * operation fails. N */ N Nextern _ARMABI size_t fread(void * __restrict /*ptr*/, Xextern __declspec(__nothrow) size_t fread(void * __restrict , N size_t /*size*/, size_t /*nmemb*/, FILE * __restrict /*stream*/) __attribute__((__nonnull__(1,4))); N /* N * reads into the array pointed to by ptr, up to nmemb members whose size is N * specified by size, from the stream pointed to by stream. The file N * position indicator (if defined) is advanced by the number of characters N * successfully read. If an error occurs, the resulting value of the file N * position indicator is indeterminate. If a partial member is read, its N * value is indeterminate. The ferror or feof function shall be used to N * distinguish between a read error and end-of-file. N * Returns: the number of members successfully read, which may be less than N * nmemb if a read error or end-of-file is encountered. If size or N * nmemb is zero, fread returns zero and the contents of the array N * and the state of the stream remain unchanged. N */ N Nextern _ARMABI size_t __fread_bytes_avail(void * __restrict /*ptr*/, Xextern __declspec(__nothrow) size_t __fread_bytes_avail(void * __restrict , N size_t /*count*/, FILE * __restrict /*stream*/) __attribute__((__nonnull__(1,3))); N /* N * reads into the array pointed to by ptr, up to count characters from the N * stream pointed to by stream. The file position indicator (if defined) N * is advanced by the number of characters successfully read. If an error N * occurs, the resulting value of the file position indicator is N * indeterminate. The ferror or feof function shall be used to N * distinguish between a read error and end-of-file. The call will block N * only if no characters are available. N * Returns: the number of characters successfully read, which may be less than N * count. If count is zero, __fread_bytes_avail returns zero and N * the contents of the array and the state of the stream remain N * unchanged. N */ N Nextern _ARMABI size_t fwrite(const void * __restrict /*ptr*/, Xextern __declspec(__nothrow) size_t fwrite(const void * __restrict , N size_t /*size*/, size_t /*nmemb*/, FILE * __restrict /*stream*/) __attribute__((__nonnull__(1,4))); N /* N * writes, from the array pointed to by ptr up to nmemb members whose size N * is specified by size, to the stream pointed to by stream. The file N * position indicator (if defined) is advanced by the number of characters N * successfully written. If an error occurs, the resulting value of the file N * position indicator is indeterminate. N * Returns: the number of members successfully written, which will be less N * than nmemb only if a write error is encountered. N */ N Nextern _ARMABI int fgetpos(FILE * __restrict /*stream*/, fpos_t * __restrict /*pos*/) __attribute__((__nonnull__(1,2))); Xextern __declspec(__nothrow) int fgetpos(FILE * __restrict , fpos_t * __restrict ) __attribute__((__nonnull__(1,2))); N /* N * stores the current value of the file position indicator for the stream N * pointed to by stream in the object pointed to by pos. The value stored N * contains unspecified information usable by the fsetpos function for N * repositioning the stream to its position at the time of the call to the N * fgetpos function. N * Returns: zero, if successful. Otherwise nonzero is returned and the N * integer expression errno is set to an implementation-defined N * nonzero value. N */ Nextern _ARMABI int fseek(FILE * /*stream*/, long int /*offset*/, int /*whence*/) __attribute__((__nonnull__(1))); Xextern __declspec(__nothrow) int fseek(FILE * , long int , int ) __attribute__((__nonnull__(1))); N /* N * sets the file position indicator for the stream pointed to by stream. N * For a binary stream, the new position is at the signed number of N * characters specified by offset away from the point specified by whence. N * The specified point is the beginning of the file for SEEK_SET, the N * current position in the file for SEEK_CUR, or end-of-file for SEEK_END. N * A binary stream need not meaningfully support fseek calls with a whence N * value of SEEK_END. N * For a text stream, either offset shall be zero, or offset shall be a N * value returned by an earlier call to the ftell function on the same N * stream and whence shall be SEEK_SET. N * The fseek function clears the end-of-file indicator and undoes any N * effects of the ungetc function on the same stream. After an fseek call, N * the next operation on an update stream may be either input or output. N * Returns: nonzero only for a request that cannot be satisfied. N */ Nextern _ARMABI int fsetpos(FILE * __restrict /*stream*/, const fpos_t * __restrict /*pos*/) __attribute__((__nonnull__(1,2))); Xextern __declspec(__nothrow) int fsetpos(FILE * __restrict , const fpos_t * __restrict ) __attribute__((__nonnull__(1,2))); N /* N * sets the file position indicator for the stream pointed to by stream N * according to the value of the object pointed to by pos, which shall be a N * value returned by an earlier call to the fgetpos function on the same N * stream. N * The fsetpos function clears the end-of-file indicator and undoes any N * effects of the ungetc function on the same stream. After an fsetpos call, N * the next operation on an update stream may be either input or output. N * Returns: zero, if successful. Otherwise nonzero is returned and the N * integer expression errno is set to an implementation-defined N * nonzero value. N */ Nextern _ARMABI long int ftell(FILE * /*stream*/) __attribute__((__nonnull__(1))); Xextern __declspec(__nothrow) long int ftell(FILE * ) __attribute__((__nonnull__(1))); N /* N * obtains the current value of the file position indicator for the stream N * pointed to by stream. For a binary stream, the value is the number of N * characters from the beginning of the file. For a text stream, the file N * position indicator contains unspecified information, usable by the fseek N * function for returning the file position indicator to its position at the N * time of the ftell call; the difference between two such return values is N * not necessarily a meaningful measure of the number of characters written N * or read. N * Returns: if successful, the current value of the file position indicator. N * On failure, the ftell function returns -1L and sets the integer N * expression errno to an implementation-defined nonzero value. N */ Nextern _ARMABI void rewind(FILE * /*stream*/) __attribute__((__nonnull__(1))); Xextern __declspec(__nothrow) void rewind(FILE * ) __attribute__((__nonnull__(1))); N /* N * sets the file position indicator for the stream pointed to by stream to N * the beginning of the file. It is equivalent to N * (void)fseek(stream, 0L, SEEK_SET) N * except that the error indicator for the stream is also cleared. N * Returns: no value. N */ N Nextern _ARMABI void clearerr(FILE * /*stream*/) __attribute__((__nonnull__(1))); Xextern __declspec(__nothrow) void clearerr(FILE * ) __attribute__((__nonnull__(1))); N /* N * clears the end-of-file and error indicators for the stream pointed to by N * stream. These indicators are cleared only when the file is opened or by N * an explicit call to the clearerr function or to the rewind function. N * Returns: no value. N */ N Nextern _ARMABI int feof(FILE * /*stream*/) __attribute__((__nonnull__(1))); Xextern __declspec(__nothrow) int feof(FILE * ) __attribute__((__nonnull__(1))); N /* N * tests the end-of-file indicator for the stream pointed to by stream. N * Returns: nonzero iff the end-of-file indicator is set for stream. N */ Nextern _ARMABI int ferror(FILE * /*stream*/) __attribute__((__nonnull__(1))); Xextern __declspec(__nothrow) int ferror(FILE * ) __attribute__((__nonnull__(1))); N /* N * tests the error indicator for the stream pointed to by stream. N * Returns: nonzero iff the error indicator is set for stream. N */ Nextern _ARMABI void perror(const char * /*s*/); Xextern __declspec(__nothrow) void perror(const char * ); N /* N * maps the error number in the integer expression errno to an error N * message. It writes a sequence of characters to the standard error stream N * thus: first (if s is not a null pointer and the character pointed to by N * s is not the null character), the string pointed to by s followed by a N * colon and a space; then an appropriate error message string followed by N * a new-line character. The contents of the error message strings are the N * same as those returned by the strerror function with argument errno, N * which are implementation-defined. N * Returns: no value. N */ N Nextern _ARMABI int _fisatty(FILE * /*stream*/ ) __attribute__((__nonnull__(1))); Xextern __declspec(__nothrow) int _fisatty(FILE * ) __attribute__((__nonnull__(1))); N /* Returns 1 if the stream is tty (stdin), 0 otherwise. Not ANSI compliant. N */ N Nextern _ARMABI void __use_no_semihosting_swi(void); Xextern __declspec(__nothrow) void __use_no_semihosting_swi(void); Nextern _ARMABI void __use_no_semihosting(void); Xextern __declspec(__nothrow) void __use_no_semihosting(void); N /* N * Referencing either of these symbols will cause a link-time N * error if any library functions that use semihosting SWI N * calls are also present in the link, i.e. you define it if N * you want to make sure you haven't accidentally used any such N * SWIs. N */ N N #ifdef __cplusplus S } /* extern "C" */ S } /* namespace std */ N #endif N #endif /* __STDIO_DECLS */ N N #if _AEABI_PORTABILITY_LEVEL != 0 && !defined _AEABI_PORTABLE X #if _AEABI_PORTABILITY_LEVEL != 0 && !0L S #define _AEABI_PORTABLE N #endif N N #if defined(__cplusplus) && !defined(__STDIO_NO_EXPORTS) X #if 0L && !0L S using ::std::size_t; S using ::std::fpos_t; S using ::std::FILE; S using ::std::remove; S using ::std::rename; S using ::std::tmpfile; S using ::std::tmpnam; S using ::std::fclose; S using ::std::fflush; S using ::std::fopen; S using ::std::freopen; S using ::std::setbuf; S using ::std::setvbuf; S using ::std::fprintf; S using ::std::_fprintf; S using ::std::printf; S using ::std::_printf; S using ::std::sprintf; S using ::std::_sprintf; S #if !defined(__STRICT_ANSI__) || (defined(__STDC_VERSION__) && 199901L <= __STDC_VERSION__) || (defined(__cplusplus) && 201103L <= __cplusplus) S using ::std::snprintf; S using ::std::vsnprintf; S using ::std::vfscanf; S using ::std::vscanf; S using ::std::vsscanf; S #endif S using ::std::_snprintf; S using ::std::_vsnprintf; S#if !defined(__STRICT_ANSI__) S using ::std::asprintf; S using ::std::vasprintf; S#endif S using ::std::__ARM_asprintf; S using ::std::__ARM_vasprintf; S using ::std::__ARM_vsnprintf; S using ::std::__ARM_snprintf; S using ::std::__ARM_vsscanf; S using ::std::fscanf; S using ::std::_fscanf; S using ::std::scanf; S using ::std::_scanf; S using ::std::sscanf; S using ::std::_sscanf; S using ::std::_vfscanf; S using ::std::_vscanf; S using ::std::_vsscanf; S using ::std::vprintf; S using ::std::_vprintf; S using ::std::vfprintf; S using ::std::_vfprintf; S using ::std::vsprintf; S using ::std::_vsprintf; S using ::std::fgetc; S using ::std::fgets; S using ::std::fputc; S using ::std::fputs; S using ::std::getc; S using ::std::getchar; S using ::std::gets; S using ::std::putc; S using ::std::putchar; S using ::std::puts; S using ::std::ungetc; S using ::std::fread; S using ::std::__fread_bytes_avail; S using ::std::fwrite; S using ::std::fgetpos; S using ::std::fseek; S using ::std::fsetpos; S using ::std::ftell; S using ::std::rewind; S using ::std::clearerr; S using ::std::feof; S using ::std::ferror; S using ::std::perror; S using ::std::_fisatty; S using ::std::__use_no_semihosting_swi; S using ::std::__use_no_semihosting; N #endif N N#endif /* ndef __stdio_h */ N N/* end of stdio.h */ N L 2 "..\src\app\main.c" 2 N#include L 1 "C:\Keil_v5\ARM\ARMCC\Bin\..\include\string.h" 1 N/* string.h: ANSI 'C' (X3J11 Oct 88) library header, section 4.11 */ N/* Copyright (C) Codemist Ltd., 1988-1993. */ N/* Copyright 1991-1993 ARM Limited. All rights reserved. */ N/* version 0.04 */ N N/* N * RCS $Revision$ N * Checkin $Date$ N */ N N/* N * string.h declares one type and several functions, and defines one macro N * useful for manipulating character arrays and other objects treated as N * character arrays. Various methods are used for determining the lengths of N * the arrays, but in all cases a char * or void * argument points to the N * initial (lowest addresses) character of the array. If an array is written N * beyond the end of an object, the behaviour is undefined. N */ N N#ifndef __string_h N#define __string_h N#define __ARMCLIB_VERSION 5060037 N N#define _ARMABI __declspec(__nothrow) N N #ifndef __STRING_DECLS N #define __STRING_DECLS N N #undef __CLIBNS N N #ifdef __cplusplus S namespace std { S #define __CLIBNS std:: S extern "C" { N #else N #define __CLIBNS N #endif /* __cplusplus */ N N#if defined(__cplusplus) || !defined(__STRICT_ANSI__) X#if 0L || !0L N /* unconditional in C++ and non-strict C for consistency of debug info */ N #if __sizeof_ptr == 8 X #if 4 == 8 S typedef unsigned long size_t; /* see */ N #else N typedef unsigned int size_t; /* see */ N #endif N#elif !defined(__size_t) X#elif !0L S #define __size_t 1 S #if __sizeof_ptr == 8 S typedef unsigned long size_t; /* see */ S #else S typedef unsigned int size_t; /* see */ S #endif N#endif N N#undef NULL N#define NULL 0 /* see */ N Nextern _ARMABI void *memcpy(void * __restrict /*s1*/, Xextern __declspec(__nothrow) void *memcpy(void * __restrict , N const void * __restrict /*s2*/, size_t /*n*/) __attribute__((__nonnull__(1,2))); N /* N * copies n characters from the object pointed to by s2 into the object N * pointed to by s1. If copying takes place between objects that overlap, N * the behaviour is undefined. N * Returns: the value of s1. N */ Nextern _ARMABI void *memmove(void * /*s1*/, Xextern __declspec(__nothrow) void *memmove(void * , N const void * /*s2*/, size_t /*n*/) __attribute__((__nonnull__(1,2))); N /* N * copies n characters from the object pointed to by s2 into the object N * pointed to by s1. Copying takes place as if the n characters from the N * object pointed to by s2 are first copied into a temporary array of n N * characters that does not overlap the objects pointed to by s1 and s2, N * and then the n characters from the temporary array are copied into the N * object pointed to by s1. N * Returns: the value of s1. N */ Nextern _ARMABI char *strcpy(char * __restrict /*s1*/, const char * __restrict /*s2*/) __attribute__((__nonnull__(1,2))); Xextern __declspec(__nothrow) char *strcpy(char * __restrict , const char * __restrict ) __attribute__((__nonnull__(1,2))); N /* N * copies the string pointed to by s2 (including the terminating nul N * character) into the array pointed to by s1. If copying takes place N * between objects that overlap, the behaviour is undefined. N * Returns: the value of s1. N */ Nextern _ARMABI char *strncpy(char * __restrict /*s1*/, const char * __restrict /*s2*/, size_t /*n*/) __attribute__((__nonnull__(1,2))); Xextern __declspec(__nothrow) char *strncpy(char * __restrict , const char * __restrict , size_t ) __attribute__((__nonnull__(1,2))); N /* N * copies not more than n characters (characters that follow a null N * character are not copied) from the array pointed to by s2 into the array N * pointed to by s1. If copying takes place between objects that overlap, N * the behaviour is undefined. N * Returns: the value of s1. N */ N Nextern _ARMABI char *strcat(char * __restrict /*s1*/, const char * __restrict /*s2*/) __attribute__((__nonnull__(1,2))); Xextern __declspec(__nothrow) char *strcat(char * __restrict , const char * __restrict ) __attribute__((__nonnull__(1,2))); N /* N * appends a copy of the string pointed to by s2 (including the terminating N * null character) to the end of the string pointed to by s1. The initial N * character of s2 overwrites the null character at the end of s1. N * Returns: the value of s1. N */ Nextern _ARMABI char *strncat(char * __restrict /*s1*/, const char * __restrict /*s2*/, size_t /*n*/) __attribute__((__nonnull__(1,2))); Xextern __declspec(__nothrow) char *strncat(char * __restrict , const char * __restrict , size_t ) __attribute__((__nonnull__(1,2))); N /* N * appends not more than n characters (a null character and characters that N * follow it are not appended) from the array pointed to by s2 to the end of N * the string pointed to by s1. The initial character of s2 overwrites the N * null character at the end of s1. A terminating null character is always N * appended to the result. N * Returns: the value of s1. N */ N N/* N * The sign of a nonzero value returned by the comparison functions is N * determined by the sign of the difference between the values of the first N * pair of characters (both interpreted as unsigned char) that differ in the N * objects being compared. N */ N Nextern _ARMABI int memcmp(const void * /*s1*/, const void * /*s2*/, size_t /*n*/) __attribute__((__nonnull__(1,2))); Xextern __declspec(__nothrow) int memcmp(const void * , const void * , size_t ) __attribute__((__nonnull__(1,2))); N /* N * compares the first n characters of the object pointed to by s1 to the N * first n characters of the object pointed to by s2. N * Returns: an integer greater than, equal to, or less than zero, according N * as the object pointed to by s1 is greater than, equal to, or N * less than the object pointed to by s2. N */ Nextern _ARMABI int strcmp(const char * /*s1*/, const char * /*s2*/) __attribute__((__nonnull__(1,2))); Xextern __declspec(__nothrow) int strcmp(const char * , const char * ) __attribute__((__nonnull__(1,2))); N /* N * compares the string pointed to by s1 to the string pointed to by s2. N * Returns: an integer greater than, equal to, or less than zero, according N * as the string pointed to by s1 is greater than, equal to, or N * less than the string pointed to by s2. N */ Nextern _ARMABI int strncmp(const char * /*s1*/, const char * /*s2*/, size_t /*n*/) __attribute__((__nonnull__(1,2))); Xextern __declspec(__nothrow) int strncmp(const char * , const char * , size_t ) __attribute__((__nonnull__(1,2))); N /* N * compares not more than n characters (characters that follow a null N * character are not compared) from the array pointed to by s1 to the array N * pointed to by s2. N * Returns: an integer greater than, equal to, or less than zero, according N * as the string pointed to by s1 is greater than, equal to, or N * less than the string pointed to by s2. N */ Nextern _ARMABI int strcasecmp(const char * /*s1*/, const char * /*s2*/) __attribute__((__nonnull__(1,2))); Xextern __declspec(__nothrow) int strcasecmp(const char * , const char * ) __attribute__((__nonnull__(1,2))); N /* N * compares the string pointed to by s1 to the string pointed to by s2, N * case-insensitively as defined by the current locale. N * Returns: an integer greater than, equal to, or less than zero, according N * as the string pointed to by s1 is greater than, equal to, or N * less than the string pointed to by s2. N */ Nextern _ARMABI int strncasecmp(const char * /*s1*/, const char * /*s2*/, size_t /*n*/) __attribute__((__nonnull__(1,2))); Xextern __declspec(__nothrow) int strncasecmp(const char * , const char * , size_t ) __attribute__((__nonnull__(1,2))); N /* N * compares not more than n characters (characters that follow a null N * character are not compared) from the array pointed to by s1 to the array N * pointed to by s2, case-insensitively as defined by the current locale. N * Returns: an integer greater than, equal to, or less than zero, according N * as the string pointed to by s1 is greater than, equal to, or N * less than the string pointed to by s2. N */ Nextern _ARMABI int strcoll(const char * /*s1*/, const char * /*s2*/) __attribute__((__nonnull__(1,2))); Xextern __declspec(__nothrow) int strcoll(const char * , const char * ) __attribute__((__nonnull__(1,2))); N /* N * compares the string pointed to by s1 to the string pointed to by s2, both N * interpreted as appropriate to the LC_COLLATE category of the current N * locale. N * Returns: an integer greater than, equal to, or less than zero, according N * as the string pointed to by s1 is greater than, equal to, or N * less than the string pointed to by s2 when both are interpreted N * as appropriate to the current locale. N */ N Nextern _ARMABI size_t strxfrm(char * __restrict /*s1*/, const char * __restrict /*s2*/, size_t /*n*/) __attribute__((__nonnull__(2))); Xextern __declspec(__nothrow) size_t strxfrm(char * __restrict , const char * __restrict , size_t ) __attribute__((__nonnull__(2))); N /* N * transforms the string pointed to by s2 and places the resulting string N * into the array pointed to by s1. The transformation function is such that N * if the strcmp function is applied to two transformed strings, it returns N * a value greater than, equal to or less than zero, corresponding to the N * result of the strcoll function applied to the same two original strings. N * No more than n characters are placed into the resulting array pointed to N * by s1, including the terminating null character. If n is zero, s1 is N * permitted to be a null pointer. If copying takes place between objects N * that overlap, the behaviour is undefined. N * Returns: The length of the transformed string is returned (not including N * the terminating null character). If the value returned is n or N * more, the contents of the array pointed to by s1 are N * indeterminate. N */ N N N#ifdef __cplusplus Sextern _ARMABI const void *memchr(const void * /*s*/, int /*c*/, size_t /*n*/) __attribute__((__nonnull__(1))); Sextern "C++" void *memchr(void * __s, int __c, size_t __n) __attribute__((__nonnull__(1))); Sextern "C++" inline void *memchr(void * __s, int __c, size_t __n) S { return const_cast(memchr(const_cast(__s), __c, __n)); } N#else Nextern _ARMABI void *memchr(const void * /*s*/, int /*c*/, size_t /*n*/) __attribute__((__nonnull__(1))); Xextern __declspec(__nothrow) void *memchr(const void * , int , size_t ) __attribute__((__nonnull__(1))); N#endif N /* N * locates the first occurence of c (converted to an unsigned char) in the N * initial n characters (each interpreted as unsigned char) of the object N * pointed to by s. N * Returns: a pointer to the located character, or a null pointer if the N * character does not occur in the object. N */ N N#ifdef __cplusplus Sextern _ARMABI const char *strchr(const char * /*s*/, int /*c*/) __attribute__((__nonnull__(1))); Sextern "C++" char *strchr(char * __s, int __c) __attribute__((__nonnull__(1))); Sextern "C++" inline char *strchr(char * __s, int __c) S { return const_cast(strchr(const_cast(__s), __c)); } N#else Nextern _ARMABI char *strchr(const char * /*s*/, int /*c*/) __attribute__((__nonnull__(1))); Xextern __declspec(__nothrow) char *strchr(const char * , int ) __attribute__((__nonnull__(1))); N#endif N /* N * locates the first occurence of c (converted to an char) in the string N * pointed to by s (including the terminating null character). N * Returns: a pointer to the located character, or a null pointer if the N * character does not occur in the string. N */ N Nextern _ARMABI size_t strcspn(const char * /*s1*/, const char * /*s2*/) __attribute__((__nonnull__(1,2))); Xextern __declspec(__nothrow) size_t strcspn(const char * , const char * ) __attribute__((__nonnull__(1,2))); N /* N * computes the length of the initial segment of the string pointed to by s1 N * which consists entirely of characters not from the string pointed to by N * s2. The terminating null character is not considered part of s2. N * Returns: the length of the segment. N */ N N#ifdef __cplusplus Sextern _ARMABI const char *strpbrk(const char * /*s1*/, const char * /*s2*/) __attribute__((__nonnull__(1,2))); Sextern "C++" char *strpbrk(char * __s1, const char * __s2) __attribute__((__nonnull__(1,2))); Sextern "C++" inline char *strpbrk(char * __s1, const char * __s2) S { return const_cast(strpbrk(const_cast(__s1), __s2)); } N#else Nextern _ARMABI char *strpbrk(const char * /*s1*/, const char * /*s2*/) __attribute__((__nonnull__(1,2))); Xextern __declspec(__nothrow) char *strpbrk(const char * , const char * ) __attribute__((__nonnull__(1,2))); N#endif N /* N * locates the first occurence in the string pointed to by s1 of any N * character from the string pointed to by s2. N * Returns: returns a pointer to the character, or a null pointer if no N * character form s2 occurs in s1. N */ N N#ifdef __cplusplus Sextern _ARMABI const char *strrchr(const char * /*s*/, int /*c*/) __attribute__((__nonnull__(1))); Sextern "C++" char *strrchr(char * __s, int __c) __attribute__((__nonnull__(1))); Sextern "C++" inline char *strrchr(char * __s, int __c) S { return const_cast(strrchr(const_cast(__s), __c)); } N#else Nextern _ARMABI char *strrchr(const char * /*s*/, int /*c*/) __attribute__((__nonnull__(1))); Xextern __declspec(__nothrow) char *strrchr(const char * , int ) __attribute__((__nonnull__(1))); N#endif N /* N * locates the last occurence of c (converted to a char) in the string N * pointed to by s. The terminating null character is considered part of N * the string. N * Returns: returns a pointer to the character, or a null pointer if c does N * not occur in the string. N */ N Nextern _ARMABI size_t strspn(const char * /*s1*/, const char * /*s2*/) __attribute__((__nonnull__(1,2))); Xextern __declspec(__nothrow) size_t strspn(const char * , const char * ) __attribute__((__nonnull__(1,2))); N /* N * computes the length of the initial segment of the string pointed to by s1 N * which consists entirely of characters from the string pointed to by S2 N * Returns: the length of the segment. N */ N N#ifdef __cplusplus Sextern _ARMABI const char *strstr(const char * /*s1*/, const char * /*s2*/) __attribute__((__nonnull__(1,2))); Sextern "C++" char *strstr(char * __s1, const char * __s2) __attribute__((__nonnull__(1,2))); Sextern "C++" inline char *strstr(char * __s1, const char * __s2) S { return const_cast(strstr(const_cast(__s1), __s2)); } N#else Nextern _ARMABI char *strstr(const char * /*s1*/, const char * /*s2*/) __attribute__((__nonnull__(1,2))); Xextern __declspec(__nothrow) char *strstr(const char * , const char * ) __attribute__((__nonnull__(1,2))); N#endif N /* N * locates the first occurence in the string pointed to by s1 of the N * sequence of characters (excluding the terminating null character) in the N * string pointed to by s2. N * Returns: a pointer to the located string, or a null pointer if the string N * is not found. N */ N Nextern _ARMABI char *strtok(char * __restrict /*s1*/, const char * __restrict /*s2*/) __attribute__((__nonnull__(2))); Xextern __declspec(__nothrow) char *strtok(char * __restrict , const char * __restrict ) __attribute__((__nonnull__(2))); Nextern _ARMABI char *_strtok_r(char * /*s1*/, const char * /*s2*/, char ** /*ptr*/) __attribute__((__nonnull__(2,3))); Xextern __declspec(__nothrow) char *_strtok_r(char * , const char * , char ** ) __attribute__((__nonnull__(2,3))); N#ifndef __STRICT_ANSI__ Nextern _ARMABI char *strtok_r(char * /*s1*/, const char * /*s2*/, char ** /*ptr*/) __attribute__((__nonnull__(2,3))); Xextern __declspec(__nothrow) char *strtok_r(char * , const char * , char ** ) __attribute__((__nonnull__(2,3))); N#endif N /* N * A sequence of calls to the strtok function breaks the string pointed to N * by s1 into a sequence of tokens, each of which is delimited by a N * character from the string pointed to by s2. The first call in the N * sequence has s1 as its first argument, and is followed by calls with a N * null pointer as their first argument. The separator string pointed to by N * s2 may be different from call to call. N * The first call in the sequence searches for the first character that is N * not contained in the current separator string s2. If no such character N * is found, then there are no tokens in s1 and the strtok function returns N * a null pointer. If such a character is found, it is the start of the N * first token. N * The strtok function then searches from there for a character that is N * contained in the current separator string. If no such character is found, N * the current token extends to the end of the string pointed to by s1, and N * subsequent searches for a token will fail. If such a character is found, N * it is overwritten by a null character, which terminates the current N * token. The strtok function saves a pointer to the following character, N * from which the next search for a token will start. N * Each subsequent call, with a null pointer as the value for the first N * argument, starts searching from the saved pointer and behaves as N * described above. N * Returns: pointer to the first character of a token, or a null pointer if N * there is no token. N * N * strtok_r() is a common extension which works exactly like N * strtok(), but instead of storing its state in a hidden N * library variable, requires the user to pass in a pointer to a N * char * variable which will be used instead. Any sequence of N * calls to strtok_r() passing the same char ** pointer should N * behave exactly like the corresponding sequence of calls to N * strtok(). This means that strtok_r() can safely be used in N * multi-threaded programs, and also that you can tokenise two N * strings in parallel. N */ N Nextern _ARMABI void *memset(void * /*s*/, int /*c*/, size_t /*n*/) __attribute__((__nonnull__(1))); Xextern __declspec(__nothrow) void *memset(void * , int , size_t ) __attribute__((__nonnull__(1))); N /* N * copies the value of c (converted to an unsigned char) into each of the N * first n charactes of the object pointed to by s. N * Returns: the value of s. N */ Nextern _ARMABI char *strerror(int /*errnum*/); Xextern __declspec(__nothrow) char *strerror(int ); N /* N * maps the error number in errnum to an error message string. N * Returns: a pointer to the string, the contents of which are N * implementation-defined. The array pointed to shall not be N * modified by the program, but may be overwritten by a N * subsequent call to the strerror function. N */ Nextern _ARMABI size_t strlen(const char * /*s*/) __attribute__((__nonnull__(1))); Xextern __declspec(__nothrow) size_t strlen(const char * ) __attribute__((__nonnull__(1))); N /* N * computes the length of the string pointed to by s. N * Returns: the number of characters that precede the terminating null N * character. N */ N Nextern _ARMABI size_t strlcpy(char * /*dst*/, const char * /*src*/, size_t /*len*/) __attribute__((__nonnull__(1,2))); Xextern __declspec(__nothrow) size_t strlcpy(char * , const char * , size_t ) __attribute__((__nonnull__(1,2))); N /* N * copies the string src into the string dst, using no more than N * len bytes of dst. Always null-terminates dst _within the N * length len (i.e. will copy at most len-1 bytes of string plus N * a NUL), unless len is actually zero. N * N * Return value is the length of the string that _would_ have N * been written, i.e. the length of src. Thus, the operation N * succeeded without truncation if and only if ret < len; N * otherwise, the value in ret tells you how big to make dst if N * you decide to reallocate it. (That value does _not_ include N * the NUL.) N * N * This is a BSD-derived library extension, which we are N * permitted to declare in a standard header because ISO defines N * function names beginning with 'str' as reserved for future N * expansion of . N */ N Nextern _ARMABI size_t strlcat(char * /*dst*/, const char * /*src*/, size_t /*len*/) __attribute__((__nonnull__(1,2))); Xextern __declspec(__nothrow) size_t strlcat(char * , const char * , size_t ) __attribute__((__nonnull__(1,2))); N /* N * concatenates the string src to the string dst, using no more N * than len bytes of dst. Always null-terminates dst _within the N * length len (i.e. will copy at most len-1 bytes of string plus N * a NUL), unless len is actually zero. N * N * Return value is the length of the string that _would_ have N * been written, i.e. the length of src plus the original length N * of dst. Thus, the operation succeeded without truncation if N * and only if ret < len; otherwise, the value in ret tells you N * how big to make dst if you decide to reallocate it. (That N * value does _not_ include the NUL.) N * N * If no NUL is encountered within the first len bytes of dst, N * then the length of dst is considered to have been equal to N * len for the purposes of the return value (as if there were a N * NUL at dst[len]). Thus, the return value in this case is len N * + strlen(src). N * N * This is a BSD-derived library extension, which we are N * permitted to declare in a standard header because ISO defines N * function names beginning with 'str' as reserved for future N * expansion of . N */ N Nextern _ARMABI void _membitcpybl(void * /*dest*/, const void * /*src*/, int /*destoffset*/, int /*srcoffset*/, size_t /*nbits*/) __attribute__((__nonnull__(1,2))); Xextern __declspec(__nothrow) void _membitcpybl(void * , const void * , int , int , size_t ) __attribute__((__nonnull__(1,2))); Nextern _ARMABI void _membitcpybb(void * /*dest*/, const void * /*src*/, int /*destoffset*/, int /*srcoffset*/, size_t /*nbits*/) __attribute__((__nonnull__(1,2))); Xextern __declspec(__nothrow) void _membitcpybb(void * , const void * , int , int , size_t ) __attribute__((__nonnull__(1,2))); Nextern _ARMABI void _membitcpyhl(void * /*dest*/, const void * /*src*/, int /*destoffset*/, int /*srcoffset*/, size_t /*nbits*/) __attribute__((__nonnull__(1,2))); Xextern __declspec(__nothrow) void _membitcpyhl(void * , const void * , int , int , size_t ) __attribute__((__nonnull__(1,2))); Nextern _ARMABI void _membitcpyhb(void * /*dest*/, const void * /*src*/, int /*destoffset*/, int /*srcoffset*/, size_t /*nbits*/) __attribute__((__nonnull__(1,2))); Xextern __declspec(__nothrow) void _membitcpyhb(void * , const void * , int , int , size_t ) __attribute__((__nonnull__(1,2))); Nextern _ARMABI void _membitcpywl(void * /*dest*/, const void * /*src*/, int /*destoffset*/, int /*srcoffset*/, size_t /*nbits*/) __attribute__((__nonnull__(1,2))); Xextern __declspec(__nothrow) void _membitcpywl(void * , const void * , int , int , size_t ) __attribute__((__nonnull__(1,2))); Nextern _ARMABI void _membitcpywb(void * /*dest*/, const void * /*src*/, int /*destoffset*/, int /*srcoffset*/, size_t /*nbits*/) __attribute__((__nonnull__(1,2))); Xextern __declspec(__nothrow) void _membitcpywb(void * , const void * , int , int , size_t ) __attribute__((__nonnull__(1,2))); Nextern _ARMABI void _membitmovebl(void * /*dest*/, const void * /*src*/, int /*destoffset*/, int /*srcoffset*/, size_t /*nbits*/) __attribute__((__nonnull__(1,2))); Xextern __declspec(__nothrow) void _membitmovebl(void * , const void * , int , int , size_t ) __attribute__((__nonnull__(1,2))); Nextern _ARMABI void _membitmovebb(void * /*dest*/, const void * /*src*/, int /*destoffset*/, int /*srcoffset*/, size_t /*nbits*/) __attribute__((__nonnull__(1,2))); Xextern __declspec(__nothrow) void _membitmovebb(void * , const void * , int , int , size_t ) __attribute__((__nonnull__(1,2))); Nextern _ARMABI void _membitmovehl(void * /*dest*/, const void * /*src*/, int /*destoffset*/, int /*srcoffset*/, size_t /*nbits*/) __attribute__((__nonnull__(1,2))); Xextern __declspec(__nothrow) void _membitmovehl(void * , const void * , int , int , size_t ) __attribute__((__nonnull__(1,2))); Nextern _ARMABI void _membitmovehb(void * /*dest*/, const void * /*src*/, int /*destoffset*/, int /*srcoffset*/, size_t /*nbits*/) __attribute__((__nonnull__(1,2))); Xextern __declspec(__nothrow) void _membitmovehb(void * , const void * , int , int , size_t ) __attribute__((__nonnull__(1,2))); Nextern _ARMABI void _membitmovewl(void * /*dest*/, const void * /*src*/, int /*destoffset*/, int /*srcoffset*/, size_t /*nbits*/) __attribute__((__nonnull__(1,2))); Xextern __declspec(__nothrow) void _membitmovewl(void * , const void * , int , int , size_t ) __attribute__((__nonnull__(1,2))); Nextern _ARMABI void _membitmovewb(void * /*dest*/, const void * /*src*/, int /*destoffset*/, int /*srcoffset*/, size_t /*nbits*/) __attribute__((__nonnull__(1,2))); Xextern __declspec(__nothrow) void _membitmovewb(void * , const void * , int , int , size_t ) __attribute__((__nonnull__(1,2))); N /* N * Copies or moves a piece of memory from one place to another, N * with one-bit granularity. So you can start or finish a copy N * part way through a byte, and you can copy between regions N * with different alignment within a byte. N * N * All these functions have the same prototype: two void * N * pointers for destination and source, then two integers N * giving the bit offset from those pointers, and finally the N * number of bits to copy. N * N * Just like memcpy and memmove, the "cpy" functions copy as N * fast as they can in the assumption that the memory regions N * do not overlap, while the "move" functions cope correctly N * with overlap. N * N * Treating memory as a stream of individual bits requires N * defining a convention about what order those bits are N * considered to be arranged in. The above functions support N * multiple conventions: N * N * - the "bl" functions consider the unit of memory to be the N * byte, and consider the bits within each byte to be N * arranged in little-endian fashion, so that the LSB comes N * first. (For example, membitcpybl(a,b,0,7,1) would copy N * the MSB of the byte at b to the LSB of the byte at a.) N * N * - the "bb" functions consider the unit of memory to be the N * byte, and consider the bits within each byte to be N * arranged in big-endian fashion, so that the MSB comes N * first. N * N * - the "hl" functions consider the unit of memory to be the N * 16-bit halfword, and consider the bits within each word N * to be arranged in little-endian fashion. N * N * - the "hb" functions consider the unit of memory to be the N * 16-bit halfword, and consider the bits within each word N * to be arranged in big-endian fashion. N * N * - the "wl" functions consider the unit of memory to be the N * 32-bit word, and consider the bits within each word to be N * arranged in little-endian fashion. N * N * - the "wb" functions consider the unit of memory to be the N * 32-bit word, and consider the bits within each word to be N * arranged in big-endian fashion. N */ N N #ifdef __cplusplus S } /* extern "C" */ S } /* namespace std */ N #endif /* __cplusplus */ N #endif /* __STRING_DECLS */ N N #ifdef __cplusplus S #ifndef __STRING_NO_EXPORTS S using ::std::size_t; S using ::std::memcpy; S using ::std::memmove; S using ::std::strcpy; S using ::std::strncpy; S using ::std::strcat; S using ::std::strncat; S using ::std::memcmp; S using ::std::strcmp; S using ::std::strncmp; S using ::std::strcasecmp; S using ::std::strncasecmp; S using ::std::strcoll; S using ::std::strxfrm; S using ::std::memchr; S using ::std::strchr; S using ::std::strcspn; S using ::std::strpbrk; S using ::std::strrchr; S using ::std::strspn; S using ::std::strstr; S using ::std::strtok; S#ifndef __STRICT_ANSI__ S using ::std::strtok_r; S#endif S using ::std::_strtok_r; S using ::std::memset; S using ::std::strerror; S using ::std::strlen; S using ::std::strlcpy; S using ::std::strlcat; S using ::std::_membitcpybl; S using ::std::_membitcpybb; S using ::std::_membitcpyhl; S using ::std::_membitcpyhb; S using ::std::_membitcpywl; S using ::std::_membitcpywb; S using ::std::_membitmovebl; S using ::std::_membitmovebb; S using ::std::_membitmovehl; S using ::std::_membitmovehb; S using ::std::_membitmovewl; S using ::std::_membitmovewb; S #endif /* __STRING_NO_EXPORTS */ N #endif /* __cplusplus */ N N#endif N N/* end of string.h */ N L 3 "..\src\app\main.c" 2 N#include L 1 "C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdlib.h" 1 N/* stdlib.h: ANSI draft (X3J11 May 88) library header, section 4.10 */ N/* Copyright (C) Codemist Ltd., 1988-1993. */ N/* Copyright 1991-1998,2014 ARM Limited. All rights reserved. */ N/* N * RCS $Revision$ N * Checkin $Date$ N * Revising $Author: agrant $ N */ N N/* N * stdlib.h declares four types, several general purpose functions, N * and defines several macros. N */ N N#ifndef __stdlib_h N#define __stdlib_h N#define __ARMCLIB_VERSION 5060037 N N#if defined(__clang__) || (defined(__ARMCC_VERSION) && !defined(__STRICT_ANSI__)) X#if 0L || (1L && !0L) N /* armclang and non-strict armcc allow 'long long' in system headers */ N #define __LONGLONG long long N#else S /* strict armcc has '__int64' */ S #define __LONGLONG __int64 N#endif N N#define _ARMABI __declspec(__nothrow) N#define _ARMABI_PURE __declspec(__nothrow) __attribute__((const)) N#define _ARMABI_NORETURN __declspec(__nothrow) __declspec(__noreturn) N#define _ARMABI_THROW N N #ifndef __STDLIB_DECLS N #define __STDLIB_DECLS N N /* N * Some of these declarations are new in C99. To access them in C++ N * you can use -D__USE_C99_STDLIB (or -D__USE_C99ALL). N */ N #ifndef __USE_C99_STDLIB N #if defined(__USE_C99_ALL) || (defined(__STDC_VERSION__) && 199901L <= __STDC_VERSION__) || (defined(__cplusplus) && 201103L <= __cplusplus) X #if 0L || (1L && 199901L <= 199901L) || (0L && 201103L <= __cplusplus) N #define __USE_C99_STDLIB 1 N #endif N #endif N N #undef __CLIBNS N N #ifdef __cplusplus S namespace std { S #define __CLIBNS ::std:: S extern "C" { N #else N #define __CLIBNS N #endif /* __cplusplus */ N N#if defined(__cplusplus) || !defined(__STRICT_ANSI__) X#if 0L || !0L N /* unconditional in C++ and non-strict C for consistency of debug info */ N #if __sizeof_ptr == 8 X #if 4 == 8 S typedef unsigned long size_t; /* see */ N #else N typedef unsigned int size_t; /* see */ N #endif N#elif !defined(__size_t) X#elif !0L S #define __size_t 1 S #if __sizeof_ptr == 8 S typedef unsigned long size_t; /* see */ S #else S typedef unsigned int size_t; /* see */ S #endif N#endif N N#undef NULL N#define NULL 0 /* see */ N N#ifndef __cplusplus /* wchar_t is a builtin type for C++ */ N #if !defined(__STRICT_ANSI__) X #if !0L N /* unconditional in non-strict C for consistency of debug info */ N #if defined(__WCHAR32) || (defined(__ARM_SIZEOF_WCHAR_T) && __ARM_SIZEOF_WCHAR_T == 4) X #if 0L || (0L && __ARM_SIZEOF_WCHAR_T == 4) S typedef unsigned int wchar_t; /* see */ N #else N typedef unsigned short wchar_t; /* see */ N #endif N #elif !defined(__wchar_t) X #elif !0L S #define __wchar_t 1 S #if defined(__WCHAR32) || (defined(__ARM_SIZEOF_WCHAR_T) && __ARM_SIZEOF_WCHAR_T == 4) S typedef unsigned int wchar_t; /* see */ S #else S typedef unsigned short wchar_t; /* see */ S #endif N #endif N#endif N Ntypedef struct div_t { int quot, rem; } div_t; N /* type of the value returned by the div function. */ Ntypedef struct ldiv_t { long int quot, rem; } ldiv_t; N /* type of the value returned by the ldiv function. */ N#if !defined(__STRICT_ANSI__) || __USE_C99_STDLIB X#if !0L || 1 Ntypedef struct lldiv_t { __LONGLONG quot, rem; } lldiv_t; Xtypedef struct lldiv_t { long long quot, rem; } lldiv_t; N /* type of the value returned by the lldiv function. */ N#endif N N#ifdef __EXIT_FAILURE S# define EXIT_FAILURE __EXIT_FAILURE S /* S * an integral expression which may be used as an argument to the exit S * function to return unsuccessful termination status to the host S * environment. S */ N#else N# define EXIT_FAILURE 1 /* unixoid */ N#endif N#define EXIT_SUCCESS 0 N /* N * an integral expression which may be used as an argument to the exit N * function to return successful termination status to the host N * environment. N */ N N /* N * Defining __USE_ANSI_EXAMPLE_RAND at compile time switches to N * the example implementation of rand() and srand() provided in N * the ANSI C standard. This implementation is very poor, but is N * provided for completeness. N */ N#ifdef __USE_ANSI_EXAMPLE_RAND S#define srand _ANSI_srand S#define rand _ANSI_rand S#define RAND_MAX 0x7fff N#else N#define RAND_MAX 0x7fffffff N#endif N /* N * RAND_MAX: an integral constant expression, the value of which N * is the maximum value returned by the rand function. N */ Nextern _ARMABI int __aeabi_MB_CUR_MAX(void); Xextern __declspec(__nothrow) int __aeabi_MB_CUR_MAX(void); N#define MB_CUR_MAX ( __aeabi_MB_CUR_MAX() ) N /* N * a positive integer expression whose value is the maximum number of bytes N * in a multibyte character for the extended character set specified by the N * current locale (category LC_CTYPE), and whose value is never greater N * than MB_LEN_MAX. N */ N N /* N * If the compiler supports signalling nans as per N965 then it N * will define __SUPPORT_SNAN__, in which case a user may define N * _WANT_SNAN in order to obtain a compliant version of the strtod N * family of functions. N */ N#if defined(__SUPPORT_SNAN__) && defined(_WANT_SNAN) X#if 0L && 0L S#pragma import(__use_snan) N#endif N Nextern _ARMABI double atof(const char * /*nptr*/) __attribute__((__nonnull__(1))); Xextern __declspec(__nothrow) double atof(const char * ) __attribute__((__nonnull__(1))); N /* N * converts the initial part of the string pointed to by nptr to double N * representation. N * Returns: the converted value. N */ Nextern _ARMABI int atoi(const char * /*nptr*/) __attribute__((__nonnull__(1))); Xextern __declspec(__nothrow) int atoi(const char * ) __attribute__((__nonnull__(1))); N /* N * converts the initial part of the string pointed to by nptr to int N * representation. N * Returns: the converted value. N */ Nextern _ARMABI long int atol(const char * /*nptr*/) __attribute__((__nonnull__(1))); Xextern __declspec(__nothrow) long int atol(const char * ) __attribute__((__nonnull__(1))); N /* N * converts the initial part of the string pointed to by nptr to long int N * representation. N * Returns: the converted value. N */ N#if !defined(__STRICT_ANSI__) || __USE_C99_STDLIB X#if !0L || 1 Nextern _ARMABI __LONGLONG atoll(const char * /*nptr*/) __attribute__((__nonnull__(1))); Xextern __declspec(__nothrow) long long atoll(const char * ) __attribute__((__nonnull__(1))); N /* N * converts the initial part of the string pointed to by nptr to N * long long int representation. N * Returns: the converted value. N */ N#endif N Nextern _ARMABI double strtod(const char * __restrict /*nptr*/, char ** __restrict /*endptr*/) __attribute__((__nonnull__(1))); Xextern __declspec(__nothrow) double strtod(const char * __restrict , char ** __restrict ) __attribute__((__nonnull__(1))); N /* N * converts the initial part of the string pointed to by nptr to double N * representation. First it decomposes the input string into three parts: N * an initial, possibly empty, sequence of white-space characters (as N * specified by the isspace function), a subject sequence resembling a N * floating point constant; and a final string of one or more unrecognised N * characters, including the terminating null character of the input string. N * Then it attempts to convert the subject sequence to a floating point N * number, and returns the result. A pointer to the final string is stored N * in the object pointed to by endptr, provided that endptr is not a null N * pointer. N * Returns: the converted value if any. If no conversion could be performed, N * zero is returned. If the correct value is outside the range of N * representable values, plus or minus HUGE_VAL is returned N * (according to the sign of the value), and the value of the macro N * ERANGE is stored in errno. If the correct value would cause N * underflow, zero is returned and the value of the macro ERANGE is N * stored in errno. N */ N#if !defined(__STRICT_ANSI__) || __USE_C99_STDLIB X#if !0L || 1 Nextern _ARMABI float strtof(const char * __restrict /*nptr*/, char ** __restrict /*endptr*/) __attribute__((__nonnull__(1))); Xextern __declspec(__nothrow) float strtof(const char * __restrict , char ** __restrict ) __attribute__((__nonnull__(1))); Nextern _ARMABI long double strtold(const char * __restrict /*nptr*/, char ** __restrict /*endptr*/) __attribute__((__nonnull__(1))); Xextern __declspec(__nothrow) long double strtold(const char * __restrict , char ** __restrict ) __attribute__((__nonnull__(1))); N /* N * same as strtod, but return float and long double respectively. N */ N#endif Nextern _ARMABI long int strtol(const char * __restrict /*nptr*/, Xextern __declspec(__nothrow) long int strtol(const char * __restrict , N char ** __restrict /*endptr*/, int /*base*/) __attribute__((__nonnull__(1))); N /* N * converts the initial part of the string pointed to by nptr to long int N * representation. First it decomposes the input string into three parts: N * an initial, possibly empty, sequence of white-space characters (as N * specified by the isspace function), a subject sequence resembling an N * integer represented in some radix determined by the value of base, and a N * final string of one or more unrecognised characters, including the N * terminating null character of the input string. Then it attempts to N * convert the subject sequence to an integer, and returns the result. N * If the value of base is 0, the expected form of the subject sequence is N * that of an integer constant (described in ANSI Draft, section 3.1.3.2), N * optionally preceded by a '+' or '-' sign, but not including an integer N * suffix. If the value of base is between 2 and 36, the expected form of N * the subject sequence is a sequence of letters and digits representing an N * integer with the radix specified by base, optionally preceded by a plus N * or minus sign, but not including an integer suffix. The letters from a N * (or A) through z (or Z) are ascribed the values 10 to 35; only letters N * whose ascribed values are less than that of the base are permitted. If N * the value of base is 16, the characters 0x or 0X may optionally precede N * the sequence of letters and digits following the sign if present. N * A pointer to the final string is stored in the object N * pointed to by endptr, provided that endptr is not a null pointer. N * Returns: the converted value if any. If no conversion could be performed, N * zero is returned and nptr is stored in *endptr. N * If the correct value is outside the range of N * representable values, LONG_MAX or LONG_MIN is returned N * (according to the sign of the value), and the value of the N * macro ERANGE is stored in errno. N */ Nextern _ARMABI unsigned long int strtoul(const char * __restrict /*nptr*/, Xextern __declspec(__nothrow) unsigned long int strtoul(const char * __restrict , N char ** __restrict /*endptr*/, int /*base*/) __attribute__((__nonnull__(1))); N /* N * converts the initial part of the string pointed to by nptr to unsigned N * long int representation. First it decomposes the input string into three N * parts: an initial, possibly empty, sequence of white-space characters (as N * determined by the isspace function), a subject sequence resembling an N * unsigned integer represented in some radix determined by the value of N * base, and a final string of one or more unrecognised characters, N * including the terminating null character of the input string. Then it N * attempts to convert the subject sequence to an unsigned integer, and N * returns the result. If the value of base is zero, the expected form of N * the subject sequence is that of an integer constant (described in ANSI N * Draft, section 3.1.3.2), optionally preceded by a '+' or '-' sign, but N * not including an integer suffix. If the value of base is between 2 and N * 36, the expected form of the subject sequence is a sequence of letters N * and digits representing an integer with the radix specified by base, N * optionally preceded by a '+' or '-' sign, but not including an integer N * suffix. The letters from a (or A) through z (or Z) stand for the values N * 10 to 35; only letters whose ascribed values are less than that of the N * base are permitted. If the value of base is 16, the characters 0x or 0X N * may optionally precede the sequence of letters and digits following the N * sign, if present. A pointer to the final string is stored in the object N * pointed to by endptr, provided that endptr is not a null pointer. N * Returns: the converted value if any. If no conversion could be performed, N * zero is returned and nptr is stored in *endptr. N * If the correct value is outside the range of N * representable values, ULONG_MAX is returned, and the value of N * the macro ERANGE is stored in errno. N */ N N/* C90 reserves all names beginning with 'str' */ Nextern _ARMABI __LONGLONG strtoll(const char * __restrict /*nptr*/, Xextern __declspec(__nothrow) long long strtoll(const char * __restrict , N char ** __restrict /*endptr*/, int /*base*/) N __attribute__((__nonnull__(1))); N /* N * as strtol but returns a long long int value. If the correct value is N * outside the range of representable values, LLONG_MAX or LLONG_MIN is N * returned (according to the sign of the value), and the value of the N * macro ERANGE is stored in errno. N */ Nextern _ARMABI unsigned __LONGLONG strtoull(const char * __restrict /*nptr*/, Xextern __declspec(__nothrow) unsigned long long strtoull(const char * __restrict , N char ** __restrict /*endptr*/, int /*base*/) N __attribute__((__nonnull__(1))); N /* N * as strtoul but returns an unsigned long long int value. If the correct N * value is outside the range of representable values, ULLONG_MAX is returned, N * and the value of the macro ERANGE is stored in errno. N */ N Nextern _ARMABI int rand(void); Xextern __declspec(__nothrow) int rand(void); N /* N * Computes a sequence of pseudo-random integers in the range 0 to RAND_MAX. N * Uses an additive generator (Mitchell & Moore) of the form: N * Xn = (X[n-24] + X[n-55]) MOD 2^31 N * This is described in section 3.2.2 of Knuth, vol 2. It's period is N * in excess of 2^55 and its randomness properties, though unproven, are N * conjectured to be good. Empirical testing since 1958 has shown no flaws. N * Returns: a pseudo-random integer. N */ Nextern _ARMABI void srand(unsigned int /*seed*/); Xextern __declspec(__nothrow) void srand(unsigned int ); N /* N * uses its argument as a seed for a new sequence of pseudo-random numbers N * to be returned by subsequent calls to rand. If srand is then called with N * the same seed value, the sequence of pseudo-random numbers is repeated. N * If rand is called before any calls to srand have been made, the same N * sequence is generated as when srand is first called with a seed value N * of 1. N */ N Nstruct _rand_state { int __x[57]; }; Nextern _ARMABI int _rand_r(struct _rand_state *); Xextern __declspec(__nothrow) int _rand_r(struct _rand_state *); Nextern _ARMABI void _srand_r(struct _rand_state *, unsigned int); Xextern __declspec(__nothrow) void _srand_r(struct _rand_state *, unsigned int); Nstruct _ANSI_rand_state { int __x[1]; }; Nextern _ARMABI int _ANSI_rand_r(struct _ANSI_rand_state *); Xextern __declspec(__nothrow) int _ANSI_rand_r(struct _ANSI_rand_state *); Nextern _ARMABI void _ANSI_srand_r(struct _ANSI_rand_state *, unsigned int); Xextern __declspec(__nothrow) void _ANSI_srand_r(struct _ANSI_rand_state *, unsigned int); N /* N * Re-entrant variants of both flavours of rand, which operate on N * an explicitly supplied state buffer. N */ N Nextern _ARMABI void *calloc(size_t /*nmemb*/, size_t /*size*/); Xextern __declspec(__nothrow) void *calloc(size_t , size_t ); N /* N * allocates space for an array of nmemb objects, each of whose size is N * 'size'. The space is initialised to all bits zero. N * Returns: either a null pointer or a pointer to the allocated space. N */ Nextern _ARMABI void free(void * /*ptr*/); Xextern __declspec(__nothrow) void free(void * ); N /* N * causes the space pointed to by ptr to be deallocated (i.e., made N * available for further allocation). If ptr is a null pointer, no action N * occurs. Otherwise, if ptr does not match a pointer earlier returned by N * calloc, malloc or realloc or if the space has been deallocated by a call N * to free or realloc, the behaviour is undefined. N */ Nextern _ARMABI void *malloc(size_t /*size*/); Xextern __declspec(__nothrow) void *malloc(size_t ); N /* N * allocates space for an object whose size is specified by 'size' and whose N * value is indeterminate. N * Returns: either a null pointer or a pointer to the allocated space. N */ Nextern _ARMABI void *realloc(void * /*ptr*/, size_t /*size*/); Xextern __declspec(__nothrow) void *realloc(void * , size_t ); N /* N * changes the size of the object pointed to by ptr to the size specified by N * size. The contents of the object shall be unchanged up to the lesser of N * the new and old sizes. If the new size is larger, the value of the newly N * allocated portion of the object is indeterminate. If ptr is a null N * pointer, the realloc function behaves like a call to malloc for the N * specified size. Otherwise, if ptr does not match a pointer earlier N * returned by calloc, malloc or realloc, or if the space has been N * deallocated by a call to free or realloc, the behaviour is undefined. N * If the space cannot be allocated, the object pointed to by ptr is N * unchanged. If size is zero and ptr is not a null pointer, the object it N * points to is freed. N * Returns: either a null pointer or a pointer to the possibly moved N * allocated space. N */ N#if !defined(__STRICT_ANSI__) X#if !0L Nextern _ARMABI int posix_memalign(void ** /*ret*/, size_t /*alignment*/, size_t /*size*/); Xextern __declspec(__nothrow) int posix_memalign(void ** , size_t , size_t ); N /* N * allocates space for an object of size 'size', aligned to a N * multiple of 'alignment' (which must be a power of two and at N * least 4). N * N * On success, a pointer to the allocated object is stored in N * *ret, and zero is returned. On failure, the return value is N * either ENOMEM (allocation failed because no suitable piece of N * memory was available) or EINVAL (the 'alignment' parameter was N * invalid). N */ N#endif Ntypedef int (*__heapprt)(void *, char const *, ...); Nextern _ARMABI void __heapstats(int (* /*dprint*/)(void * /*param*/, Xextern __declspec(__nothrow) void __heapstats(int (* )(void * , N char const * /*format*/, ...), N void * /*param*/) __attribute__((__nonnull__(1))); N /* N * reports current heap statistics (eg. number of free blocks in N * the free-list). Output is as implementation-defined free-form N * text, provided via the dprint function. `param' gives an N * extra data word to pass to dprint. You can call N * __heapstats(fprintf,stdout) by casting fprintf to the above N * function type; the typedef `__heapprt' is provided for this N * purpose. N * N * `dprint' will not be called while the heap is being examined, N * so it can allocate memory itself without trouble. N */ Nextern _ARMABI int __heapvalid(int (* /*dprint*/)(void * /*param*/, Xextern __declspec(__nothrow) int __heapvalid(int (* )(void * , N char const * /*format*/, ...), N void * /*param*/, int /*verbose*/) __attribute__((__nonnull__(1))); N /* N * performs a consistency check on the heap. Errors are reported N * through dprint, like __heapstats. If `verbose' is nonzero, N * full diagnostic information on the heap state is printed out. N * N * This routine probably won't work if the heap isn't a N * contiguous chunk (for example, if __user_heap_extend has been N * overridden). N * N * `dprint' may be called while the heap is being examined or N * even in an invalid state, so it must perform no memory N * allocation. In particular, if `dprint' calls (or is) a stdio N * function, the stream it outputs to must already have either N * been written to or been setvbuf'ed, or else the system will N * allocate buffer space for it on the first call to dprint. N */ Nextern _ARMABI_NORETURN void abort(void); Xextern __declspec(__nothrow) __declspec(__noreturn) void abort(void); N /* N * causes abnormal program termination to occur, unless the signal SIGABRT N * is being caught and the signal handler does not return. Whether open N * output streams are flushed or open streams are closed or temporary N * files removed is implementation-defined. N * An implementation-defined form of the status 'unsuccessful termination' N * is returned to the host environment by means of a call to N * raise(SIGABRT). N */ N Nextern _ARMABI int atexit(void (* /*func*/)(void)) __attribute__((__nonnull__(1))); Xextern __declspec(__nothrow) int atexit(void (* )(void)) __attribute__((__nonnull__(1))); N /* N * registers the function pointed to by func, to be called without its N * arguments at normal program termination. It is possible to register at N * least 32 functions. N * Returns: zero if the registration succeeds, nonzero if it fails. N */ N#if defined(__EDG__) && !defined(__GNUC__) X#if 1L && !1L S#define __LANGUAGE_LINKAGE_CHANGES_FUNCTION_TYPE N#endif N#if defined(__cplusplus) && defined(__LANGUAGE_LINKAGE_CHANGES_FUNCTION_TYPE) X#if 0L && 0L S /* atexit that takes a ptr to a function with C++ linkage S * but not in GNU mode S */ S typedef void (* __C_exitfuncptr)(); S extern "C++" S inline int atexit(void (* __func)()) { S return atexit((__C_exitfuncptr)__func); S } N#endif N N Nextern _ARMABI_NORETURN void exit(int /*status*/); Xextern __declspec(__nothrow) __declspec(__noreturn) void exit(int ); N /* N * causes normal program termination to occur. If more than one call to the N * exit function is executed by a program, the behaviour is undefined. N * First, all functions registered by the atexit function are called, in the N * reverse order of their registration. N * Next, all open output streams are flushed, all open streams are closed, N * and all files created by the tmpfile function are removed. N * Finally, control is returned to the host environment. If the value of N * status is zero or EXIT_SUCCESS, an implementation-defined form of the N * status 'successful termination' is returned. If the value of status is N * EXIT_FAILURE, an implementation-defined form of the status N * 'unsuccessful termination' is returned. Otherwise the status returned N * is implementation-defined. N */ N Nextern _ARMABI_NORETURN void _Exit(int /*status*/); Xextern __declspec(__nothrow) __declspec(__noreturn) void _Exit(int ); N /* N * causes normal program termination to occur. No functions registered N * by the atexit function are called. N * In this implementation, all open output streams are flushed, all N * open streams are closed, and all files created by the tmpfile function N * are removed. N * Control is returned to the host environment. The status returned to N * the host environment is determined in the same way as for 'exit'. N */ N Nextern _ARMABI char *getenv(const char * /*name*/) __attribute__((__nonnull__(1))); Xextern __declspec(__nothrow) char *getenv(const char * ) __attribute__((__nonnull__(1))); N /* N * searches the environment list, provided by the host environment, for a N * string that matches the string pointed to by name. The set of environment N * names and the method for altering the environment list are N * implementation-defined. N * Returns: a pointer to a string associated with the matched list member. N * The array pointed to shall not be modified by the program, but N * may be overwritten by a subsequent call to the getenv function. N * If the specified name cannot be found, a null pointer is N * returned. N */ N Nextern _ARMABI int system(const char * /*string*/); Xextern __declspec(__nothrow) int system(const char * ); N /* N * passes the string pointed to by string to the host environment to be N * executed by a command processor in an implementation-defined manner. N * A null pointer may be used for string, to inquire whether a command N * processor exists. N * N * Returns: If the argument is a null pointer, the system function returns N * non-zero only if a command processor is available. If the N * argument is not a null pointer, the system function returns an N * implementation-defined value. N */ N Nextern _ARMABI_THROW void *bsearch(const void * /*key*/, const void * /*base*/, Xextern void *bsearch(const void * , const void * , N size_t /*nmemb*/, size_t /*size*/, N int (* /*compar*/)(const void *, const void *)) __attribute__((__nonnull__(1,2,5))); N /* N * searches an array of nmemb objects, the initial member of which is N * pointed to by base, for a member that matches the object pointed to by N * key. The size of each member of the array is specified by size. N * The contents of the array shall be in ascending sorted order according to N * a comparison function pointed to by compar, which is called with two N * arguments that point to the key object and to an array member, in that N * order. The function shall return an integer less than, equal to, or N * greater than zero if the key object is considered, respectively, to be N * less than, to match, or to be greater than the array member. N * Returns: a pointer to a matching member of the array, or a null pointer N * if no match is found. If two members compare as equal, which N * member is matched is unspecified. N */ N#if defined(__cplusplus) && defined(__LANGUAGE_LINKAGE_CHANGES_FUNCTION_TYPE) X#if 0L && 0L S /* bsearch that takes a ptr to a function with C++ linkage S * but not in GNU mode S */ S typedef int (* __C_compareprocptr)(const void *, const void *); S extern "C++" S void *bsearch(const void * __key, const void * __base, S size_t __nmemb, size_t __size, S int (* __compar)(const void *, const void *)) __attribute__((__nonnull__(1,2,5))); S extern "C++" S inline void *bsearch(const void * __key, const void * __base, S size_t __nmemb, size_t __size, S int (* __compar)(const void *, const void *)) { S return bsearch(__key, __base, __nmemb, __size, (__C_compareprocptr)__compar); S } N#endif N N Nextern _ARMABI_THROW void qsort(void * /*base*/, size_t /*nmemb*/, size_t /*size*/, Xextern void qsort(void * , size_t , size_t , N int (* /*compar*/)(const void *, const void *)) __attribute__((__nonnull__(1,4))); N /* N * sorts an array of nmemb objects, the initial member of which is pointed N * to by base. The size of each object is specified by size. N * The contents of the array shall be in ascending order according to a N * comparison function pointed to by compar, which is called with two N * arguments that point to the objects being compared. The function shall N * return an integer less than, equal to, or greater than zero if the first N * argument is considered to be respectively less than, equal to, or greater N * than the second. If two members compare as equal, their order in the N * sorted array is unspecified. N */ N N#if defined(__cplusplus) && defined(__LANGUAGE_LINKAGE_CHANGES_FUNCTION_TYPE) X#if 0L && 0L S /* qsort that takes a ptr to a function with C++ linkage S * but not in GNU mode S */ S extern "C++" S void qsort(void * __base, size_t __nmemb, size_t __size, S int (* __compar)(const void *, const void *)) __attribute__((__nonnull__(1,4))); S extern "C++" S inline void qsort(void * __base, size_t __nmemb, size_t __size, S int (* __compar)(const void *, const void *)) { S qsort(__base, __nmemb, __size, (__C_compareprocptr)__compar); S } N#endif N Nextern _ARMABI_PURE int abs(int /*j*/); Xextern __declspec(__nothrow) __attribute__((const)) int abs(int ); N /* N * computes the absolute value of an integer j. If the result cannot be N * represented, the behaviour is undefined. N * Returns: the absolute value. N */ N Nextern _ARMABI_PURE div_t div(int /*numer*/, int /*denom*/); Xextern __declspec(__nothrow) __attribute__((const)) div_t div(int , int ); N /* N * computes the quotient and remainder of the division of the numerator N * numer by the denominator denom. If the division is inexact, the resulting N * quotient is the integer of lesser magnitude that is the nearest to the N * algebraic quotient. If the result cannot be represented, the behaviour is N * undefined; otherwise, quot * denom + rem shall equal numer. N * Returns: a structure of type div_t, comprising both the quotient and the N * remainder. the structure shall contain the following members, N * in either order. N * int quot; int rem; N */ Nextern _ARMABI_PURE long int labs(long int /*j*/); Xextern __declspec(__nothrow) __attribute__((const)) long int labs(long int ); N /* N * computes the absolute value of an long integer j. If the result cannot be N * represented, the behaviour is undefined. N * Returns: the absolute value. N */ N#ifdef __cplusplus S extern "C++" inline _ARMABI_PURE long abs(long int x) { return labs(x); } N#endif N Nextern _ARMABI_PURE ldiv_t ldiv(long int /*numer*/, long int /*denom*/); Xextern __declspec(__nothrow) __attribute__((const)) ldiv_t ldiv(long int , long int ); N /* N * computes the quotient and remainder of the division of the numerator N * numer by the denominator denom. If the division is inexact, the sign of N * the resulting quotient is that of the algebraic quotient, and the N * magnitude of the resulting quotient is the largest integer less than the N * magnitude of the algebraic quotient. If the result cannot be represented, N * the behaviour is undefined; otherwise, quot * denom + rem shall equal N * numer. N * Returns: a structure of type ldiv_t, comprising both the quotient and the N * remainder. the structure shall contain the following members, N * in either order. N * long int quot; long int rem; N */ N#ifdef __cplusplus S extern "C++" inline _ARMABI_PURE ldiv_t div(long int __numer, long int __denom) { S return ldiv(__numer, __denom); S } N#endif N N#if !defined(__STRICT_ANSI__) || __USE_C99_STDLIB X#if !0L || 1 Nextern _ARMABI_PURE __LONGLONG llabs(__LONGLONG /*j*/); Xextern __declspec(__nothrow) __attribute__((const)) long long llabs(long long ); N /* N * computes the absolute value of a long long integer j. If the N * result cannot be represented, the behaviour is undefined. N * Returns: the absolute value. N */ N#ifdef __cplusplus S extern "C++" inline _ARMABI_PURE __LONGLONG abs(__LONGLONG x) { return llabs(x); } N#endif N Nextern _ARMABI_PURE lldiv_t lldiv(__LONGLONG /*numer*/, __LONGLONG /*denom*/); Xextern __declspec(__nothrow) __attribute__((const)) lldiv_t lldiv(long long , long long ); N /* N * computes the quotient and remainder of the division of the numerator N * numer by the denominator denom. If the division is inexact, the sign of N * the resulting quotient is that of the algebraic quotient, and the N * magnitude of the resulting quotient is the largest integer less than the N * magnitude of the algebraic quotient. If the result cannot be represented, N * the behaviour is undefined; otherwise, quot * denom + rem shall equal N * numer. N * Returns: a structure of type lldiv_t, comprising both the quotient and the N * remainder. the structure shall contain the following members, N * in either order. N * long long quot; long long rem; N */ N#ifdef __cplusplus S extern "C++" inline _ARMABI_PURE lldiv_t div(__LONGLONG __numer, __LONGLONG __denom) { S return lldiv(__numer, __denom); S } N#endif N#endif N N#if !(__ARM_NO_DEPRECATED_FUNCTIONS) N/* N * ARM real-time divide functions for guaranteed performance N */ Ntypedef struct __sdiv32by16 { int quot, rem; } __sdiv32by16; Ntypedef struct __udiv32by16 { unsigned int quot, rem; } __udiv32by16; N /* used int so that values return in separate regs, although 16-bit */ Ntypedef struct __sdiv64by32 { int rem, quot; } __sdiv64by32; N N__value_in_regs extern _ARMABI_PURE __sdiv32by16 __rt_sdiv32by16( X__value_in_regs extern __declspec(__nothrow) __attribute__((const)) __sdiv32by16 __rt_sdiv32by16( N int /*numer*/, N short int /*denom*/); N /* N * Signed divide: (16-bit quot), (16-bit rem) = (32-bit) / (16-bit) N */ N__value_in_regs extern _ARMABI_PURE __udiv32by16 __rt_udiv32by16( X__value_in_regs extern __declspec(__nothrow) __attribute__((const)) __udiv32by16 __rt_udiv32by16( N unsigned int /*numer*/, N unsigned short /*denom*/); N /* N * Unsigned divide: (16-bit quot), (16-bit rem) = (32-bit) / (16-bit) N */ N__value_in_regs extern _ARMABI_PURE __sdiv64by32 __rt_sdiv64by32( X__value_in_regs extern __declspec(__nothrow) __attribute__((const)) __sdiv64by32 __rt_sdiv64by32( N int /*numer_h*/, unsigned int /*numer_l*/, N int /*denom*/); N /* N * Signed divide: (32-bit quot), (32-bit rem) = (64-bit) / (32-bit) N */ N#endif N N/* N * ARM floating-point mask/status function (for both hardfp and softfp) N */ Nextern _ARMABI unsigned int __fp_status(unsigned int /*mask*/, unsigned int /*flags*/); Xextern __declspec(__nothrow) unsigned int __fp_status(unsigned int , unsigned int ); N /* N * mask and flags are bit-fields which correspond directly to the N * floating point status register in the FPE/FPA and fplib. N * __fp_status returns the current value of the status register, N * and also sets the writable bits of the word N * (the exception control and flag bytes) to: N * N * new = (old & ~mask) ^ flags; N */ N#define __fpsr_IXE 0x100000 N#define __fpsr_UFE 0x80000 N#define __fpsr_OFE 0x40000 N#define __fpsr_DZE 0x20000 N#define __fpsr_IOE 0x10000 N N#define __fpsr_IXC 0x10 N#define __fpsr_UFC 0x8 N#define __fpsr_OFC 0x4 N#define __fpsr_DZC 0x2 N#define __fpsr_IOC 0x1 N N/* N * Multibyte Character Functions. N * The behaviour of the multibyte character functions is affected by the N * LC_CTYPE category of the current locale. For a state-dependent encoding, N * each function is placed into its initial state by a call for which its N * character pointer argument, s, is a null pointer. Subsequent calls with s N * as other than a null pointer cause the internal state of the function to be N * altered as necessary. A call with s as a null pointer causes these functions N * to return a nonzero value if encodings have state dependency, and a zero N * otherwise. After the LC_CTYPE category is changed, the shift state of these N * functions is indeterminate. N */ Nextern _ARMABI int mblen(const char * /*s*/, size_t /*n*/); Xextern __declspec(__nothrow) int mblen(const char * , size_t ); N /* N * If s is not a null pointer, the mblen function determines the number of N * bytes compromising the multibyte character pointed to by s. Except that N * the shift state of the mbtowc function is not affected, it is equivalent N * to mbtowc((wchar_t *)0, s, n); N * Returns: If s is a null pointer, the mblen function returns a nonzero or N * zero value, if multibyte character encodings, respectively, do N * or do not have state-dependent encodings. If s is not a null N * pointer, the mblen function either returns a 0 (if s points to a N * null character), or returns the number of bytes that compromise N * the multibyte character (if the next n of fewer bytes form a N * valid multibyte character), or returns -1 (they do not form a N * valid multibyte character). N */ Nextern _ARMABI int mbtowc(wchar_t * __restrict /*pwc*/, Xextern __declspec(__nothrow) int mbtowc(wchar_t * __restrict , N const char * __restrict /*s*/, size_t /*n*/); N /* N * If s is not a null pointer, the mbtowc function determines the number of N * bytes that compromise the multibyte character pointed to by s. It then N * determines the code for value of type wchar_t that corresponds to that N * multibyte character. (The value of the code corresponding to the null N * character is zero). If the multibyte character is valid and pwc is not a N * null pointer, the mbtowc function stores the code in the object pointed N * to by pwc. At most n bytes of the array pointed to by s will be examined. N * Returns: If s is a null pointer, the mbtowc function returns a nonzero or N * zero value, if multibyte character encodings, respectively, do N * or do not have state-dependent encodings. If s is not a null N * pointer, the mbtowc function either returns a 0 (if s points to N * a null character), or returns the number of bytes that N * compromise the converted multibyte character (if the next n of N * fewer bytes form a valid multibyte character), or returns -1 N * (they do not form a valid multibyte character). N */ Nextern _ARMABI int wctomb(char * /*s*/, wchar_t /*wchar*/); Xextern __declspec(__nothrow) int wctomb(char * , wchar_t ); N /* N * determines the number of bytes need to represent the multibyte character N * corresponding to the code whose value is wchar (including any change in N * shift state). It stores the multibyte character representation in the N * array object pointed to by s (if s is not a null pointer). At most N * MB_CUR_MAX characters are stored. If the value of wchar is zero, the N * wctomb function is left in the initial shift state). N * Returns: If s is a null pointer, the wctomb function returns a nonzero or N * zero value, if multibyte character encodings, respectively, do N * or do not have state-dependent encodings. If s is not a null N * pointer, the wctomb function returns a -1 if the value of wchar N * does not correspond to a valid multibyte character, or returns N * the number of bytes that compromise the multibyte character N * corresponding to the value of wchar. N */ N N/* N * Multibyte String Functions. N * The behaviour of the multibyte string functions is affected by the LC_CTYPE N * category of the current locale. N */ Nextern _ARMABI size_t mbstowcs(wchar_t * __restrict /*pwcs*/, Xextern __declspec(__nothrow) size_t mbstowcs(wchar_t * __restrict , N const char * __restrict /*s*/, size_t /*n*/) __attribute__((__nonnull__(2))); N /* N * converts a sequence of multibyte character that begins in the initial N * shift state from the array pointed to by s into a sequence of N * corresponding codes and stores not more than n codes into the array N * pointed to by pwcs. No multibyte character that follow a null character N * (which is converted into a code with value zero) will be examined or N * converted. Each multibyte character is converted as if by a call to N * mbtowc function, except that the shift state of the mbtowc function is N * not affected. No more than n elements will be modified in the array N * pointed to by pwcs. If copying takes place between objects that overlap, N * the behaviour is undefined. N * Returns: If an invalid multibyte character is encountered, the mbstowcs N * function returns (size_t)-1. Otherwise, the mbstowcs function N * returns the number of array elements modified, not including N * a terminating zero code, if any. N */ Nextern _ARMABI size_t wcstombs(char * __restrict /*s*/, Xextern __declspec(__nothrow) size_t wcstombs(char * __restrict , N const wchar_t * __restrict /*pwcs*/, size_t /*n*/) __attribute__((__nonnull__(2))); N /* N * converts a sequence of codes that correspond to multibyte characters N * from the array pointed to by pwcs into a sequence of multibyte N * characters that begins in the initial shift state and stores these N * multibyte characters into the array pointed to by s, stopping if a N * multibyte character would exceed the limit of n total bytes or if a N * null character is stored. Each code is converted as if by a call to the N * wctomb function, except that the shift state of the wctomb function is N * not affected. No more than n elements will be modified in the array N * pointed to by s. If copying takes place between objects that overlap, N * the behaviour is undefined. N * Returns: If a code is encountered that does not correspond to a valid N * multibyte character, the wcstombs function returns (size_t)-1. N * Otherwise, the wcstombs function returns the number of bytes N * modified, not including a terminating null character, if any. N */ N Nextern _ARMABI void __use_realtime_heap(void); Xextern __declspec(__nothrow) void __use_realtime_heap(void); Nextern _ARMABI void __use_realtime_division(void); Xextern __declspec(__nothrow) void __use_realtime_division(void); Nextern _ARMABI void __use_two_region_memory(void); Xextern __declspec(__nothrow) void __use_two_region_memory(void); Nextern _ARMABI void __use_no_heap(void); Xextern __declspec(__nothrow) void __use_no_heap(void); Nextern _ARMABI void __use_no_heap_region(void); Xextern __declspec(__nothrow) void __use_no_heap_region(void); N Nextern _ARMABI char const *__C_library_version_string(void); Xextern __declspec(__nothrow) char const *__C_library_version_string(void); Nextern _ARMABI int __C_library_version_number(void); Xextern __declspec(__nothrow) int __C_library_version_number(void); N N #ifdef __cplusplus S } /* extern "C" */ S } /* namespace std */ N #endif /* __cplusplus */ N #endif /* __STDLIB_DECLS */ N N #if _AEABI_PORTABILITY_LEVEL != 0 && !defined _AEABI_PORTABLE X #if _AEABI_PORTABILITY_LEVEL != 0 && !0L S #define _AEABI_PORTABLE N #endif N N #ifdef __cplusplus S #ifndef __STDLIB_NO_EXPORTS S #if !defined(__STRICT_ANSI__) || __USE_C99_STDLIB S using ::std::atoll; S using ::std::lldiv_t; S #endif /* !defined(__STRICT_ANSI__) || __USE_C99_STDLIB */ S using ::std::div_t; S using ::std::ldiv_t; S using ::std::atof; S using ::std::atoi; S using ::std::atol; S using ::std::strtod; S#if !defined(__STRICT_ANSI__) || __USE_C99_STDLIB S using ::std::strtof; S using ::std::strtold; S#endif S using ::std::strtol; S using ::std::strtoul; S using ::std::strtoll; S using ::std::strtoull; S using ::std::rand; S using ::std::srand; S using ::std::_rand_state; S using ::std::_rand_r; S using ::std::_srand_r; S using ::std::_ANSI_rand_state; S using ::std::_ANSI_rand_r; S using ::std::_ANSI_srand_r; S using ::std::calloc; S using ::std::free; S using ::std::malloc; S using ::std::realloc; S#if !defined(__STRICT_ANSI__) S using ::std::posix_memalign; S#endif S using ::std::__heapprt; S using ::std::__heapstats; S using ::std::__heapvalid; S using ::std::abort; S using ::std::atexit; S using ::std::exit; S using ::std::_Exit; S using ::std::getenv; S using ::std::system; S using ::std::bsearch; S using ::std::qsort; S using ::std::abs; S using ::std::div; S using ::std::labs; S using ::std::ldiv; S #if !defined(__STRICT_ANSI__) || __USE_C99_STDLIB S using ::std::llabs; S using ::std::lldiv; S #endif /* !defined(__STRICT_ANSI__) || __USE_C99_STDLIB */ S#if !(__ARM_NO_DEPRECATED_FUNCTIONS) S using ::std::__sdiv32by16; S using ::std::__udiv32by16; S using ::std::__sdiv64by32; S using ::std::__rt_sdiv32by16; S using ::std::__rt_udiv32by16; S using ::std::__rt_sdiv64by32; S#endif S using ::std::__fp_status; S using ::std::mblen; S using ::std::mbtowc; S using ::std::wctomb; S using ::std::mbstowcs; S using ::std::wcstombs; S using ::std::__use_realtime_heap; S using ::std::__use_realtime_division; S using ::std::__use_two_region_memory; S using ::std::__use_no_heap; S using ::std::__use_no_heap_region; S using ::std::__C_library_version_string; S using ::std::__C_library_version_number; S using ::std::size_t; S using ::std::__aeabi_MB_CUR_MAX; S #endif /* __STDLIB_NO_EXPORTS */ N #endif /* __cplusplus */ N N#undef __LONGLONG N N#endif /* __stdlib_h */ N N/* end of stdlib.h */ L 4 "..\src\app\main.c" 2 N#include "test_cfg_global.h" L 1 "..\src\app\test_cfg_global.h" 1 N/******************************************************************************* N* Copyright (C) 2019-2022, 518 Systems (R),All Rights Reserved. N* N* File: test_cfg_global.h N* Description ȫͷļ N* Version V0.1 N* Date 2021-05-01 N* Author kevin N *******************************************************************************/ N N#ifndef __TEST_GLOBAL_CONFIG_H__ N#define __TEST_GLOBAL_CONFIG_H__ N/******************************************************************************* N* 1.Included files N*******************************************************************************/ N N/******************************************************************************* N* 2.Global constant and macro definitions using #define N*******************************************************************************/ N N#define _TEST_TIMER_EN 0 N#define _TEST_DSI_TX_EN 0 N#define _TEST_DSI_RX_EN 0 N#define _TEST_PWM_EN 0 N#define _TEST_SWIRE_EN 0 N#define _TEST_WDG_EN 0 N#define _TEST_GPIO_EN 0 N#define _TEST_I2C_EN 0 N#define _TEST_SPI_EN 0 N N#define _DEMO_S8_EN 1 N#define _DEMO_S8P_EN 0 N#if _TEST_TIMER_EN X#if 0 S #include "test_hal_timer.h" N#endif N N#if _TEST_I2C_EN X#if 0 S #include "test_hal_i2c.h" N#endif N N#if _TEST_SPI_EN X#if 0 S #include "test_hal_spi.h" N#endif N N#if _TEST_DSI_TX_EN X#if 0 S #include "test_hal_dsi_tx.h" N#endif N N#if _TEST_DSI_RX_EN X#if 0 S #include "test_hal_dsi_rx.h" N#endif N N#if _TEST_PWM_EN X#if 0 S #include "test_hal_pwm.h" N#endif N N#if _TEST_SWIRE_EN X#if 0 S #include "test_hal_swire.h" N#endif N N#if _TEST_WDG_EN X#if 0 S #include "test_hal_wdg.h" N#endif N N#if _TEST_GPIO_EN X#if 0 S #include "test_hal_gpio.h" N#endif N N#if _TEST_I2C_TP_EN S #include "test_hal_i2c_tp.h" N#endif N N#if _DEMO_S8_EN X#if 1 N #include "ap_demo.h" L 1 "..\src\app\demo\ap_demo.h" 1 N/******************************************************************************* N* N* N* File: s8_demo.h N* Description: s8ͷļ N* Version: V0.1 N* Date: 2021-02-22 N* Author: Tempest N *******************************************************************************/ N N#ifndef __AP_DEMO_H__ N#define __AP_DEMO_H__ N N//#define DISABLE_TDDI_I2C_FUNCTION N//#define USE_WL518_INTERNAL_FLASH N N N/* ͬѡѡѡ1*/ N#define USE_FOR_SUMSUNG_S21 N//#define USE_FOR_SUMSUNG_S20PLUS N//#define USE_FOR_OPPO_RENO3_PRO N N N#ifdef USE_FOR_SUMSUNG_S20PLUS S#define AMOLED_NT37701_VNOX667 1 S S#define USE_FOR_S10_BLUE_MODE //S10ģʽ S#define ADD_PANEL_DISPLAY_MODE //Ļģʽܡƽ⹦ N#endif N N#ifdef USE_FOR_SUMSUNG_S21 N#define LCD_FT8719_DU48 0 N#define AMOLED_NT37701_HX628 1 N N#define PANEL_INIT_CODE_ARRAY 1 N N#define G_PHONE_INT_DEFAULT_LOW N N#define USE_FOR_S10_BLUE_MODE //S10ģʽ N#define ADD_PANEL_DISPLAY_MODE //Ļģʽܡƽ⹦ N#define ADD_TIMER3_FUNCTION N#define ENABLE_TP_SLEEP N N#define USE_FILTER_20220513 N#endif N N#ifdef USE_FOR_OPPO_RENO3_PRO S#define AMOLED_NT37701_HX655 1 N#endif N N/** N* @brief test system N* @param none N* @retval none N*/ Nvoid ap_demo(void); Nvoid app_tp_I2C_init(void); N#endif L 75 "..\src\app\test_cfg_global.h" 2 N #include "app_tp_for_custom_s8.h" L 1 "..\src\app\demo\app_tp_for_custom_s8.h" 1 N/******************************************************************************* N* N* N* File: app_tp_for_custom.h N* Description tp Э鴦ļضõĺ N* Version V0.1 N* Date 2021-10-14 N* Author zhanghz N*******************************************************************************/ N#ifndef __APP_TP_FOR_CUSTOM_S8_H__ N#define __APP_TP_FOR_CUSTOM_S8_H__ N#include "test_cfg_global.h" L 1 "..\src\app\test_cfg_global.h" 1 N/******************************************************************************* N* Copyright (C) 2019-2022, 518 Systems (R),All Rights Reserved. N* N* File: test_cfg_global.h N* Description ȫͷļ N* Version V0.1 N* Date 2021-05-01 N* Author kevin N *******************************************************************************/ N N#ifndef __TEST_GLOBAL_CONFIG_H__ S#define __TEST_GLOBAL_CONFIG_H__ S/******************************************************************************* S* 1.Included files S*******************************************************************************/ S S/******************************************************************************* S* 2.Global constant and macro definitions using #define S*******************************************************************************/ S S#define _TEST_TIMER_EN 0 S#define _TEST_DSI_TX_EN 0 S#define _TEST_DSI_RX_EN 0 S#define _TEST_PWM_EN 0 S#define _TEST_SWIRE_EN 0 S#define _TEST_WDG_EN 0 S#define _TEST_GPIO_EN 0 S#define _TEST_I2C_EN 0 S#define _TEST_SPI_EN 0 S S#define _DEMO_S8_EN 1 S#define _DEMO_S8P_EN 0 S#if _TEST_TIMER_EN S #include "test_hal_timer.h" S#endif S S#if _TEST_I2C_EN S #include "test_hal_i2c.h" S#endif S S#if _TEST_SPI_EN S #include "test_hal_spi.h" S#endif S S#if _TEST_DSI_TX_EN S #include "test_hal_dsi_tx.h" S#endif S S#if _TEST_DSI_RX_EN S #include "test_hal_dsi_rx.h" S#endif S S#if _TEST_PWM_EN S #include "test_hal_pwm.h" S#endif S S#if _TEST_SWIRE_EN S #include "test_hal_swire.h" S#endif S S#if _TEST_WDG_EN S #include "test_hal_wdg.h" S#endif S S#if _TEST_GPIO_EN S #include "test_hal_gpio.h" S#endif S S#if _TEST_I2C_TP_EN S #include "test_hal_i2c_tp.h" S#endif S S#if _DEMO_S8_EN S #include "ap_demo.h" S #include "app_tp_for_custom_s8.h" S#endif S S#if _DEMO_S8P_EN S #include "s8p_demo.h" S #include "app_tp_for_custom_s8p.h" S#endif S N#endif N L 13 "..\src\app\demo\app_tp_for_custom_s8.h" 2 N N#include "string.h" N#include "tau_device_datatype.h" L 1 "..\src\common\tau_device_datatype.h" 1 N/******************************************************************************* N * N * N * File: tau_device_datatype.h N * Description device datatype N * Version V0.1 N * Date 2020-12-04 N * Author kevin N *******************************************************************************/ N N#ifndef _TAU_DEVICE_DATATYPE_H_ N#define _TAU_DEVICE_DATATYPE_H_ N N N/******************************************************************************* N* 1.Included files N*******************************************************************************/ N N#include "stdint.h" L 1 "C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdint.h" 1 N/* Copyright (C) ARM Ltd., 1999,2014 */ N/* All rights reserved */ N N/* N * RCS $Revision$ N * Checkin $Date$ N * Revising $Author: agrant $ N */ N N#ifndef __stdint_h N#define __stdint_h N#define __ARMCLIB_VERSION 5060037 N N #ifdef __INT64_TYPE__ S /* armclang predefines '__INT64_TYPE__' and '__INT64_C_SUFFIX__' */ S #define __INT64 __INT64_TYPE__ N #else N /* armcc has builtin '__int64' which can be used in --strict mode */ N #define __INT64 __int64 N #define __INT64_C_SUFFIX__ ll N #endif N #define __PASTE2(x, y) x ## y N #define __PASTE(x, y) __PASTE2(x, y) N #define __INT64_C(x) __ESCAPE__(__PASTE(x, __INT64_C_SUFFIX__)) N #define __UINT64_C(x) __ESCAPE__(__PASTE(x ## u, __INT64_C_SUFFIX__)) N #if defined(__clang__) || (defined(__ARMCC_VERSION) && !defined(__STRICT_ANSI__)) X #if 0L || (1L && !0L) N /* armclang and non-strict armcc allow 'long long' in system headers */ N #define __LONGLONG long long N #else S /* strict armcc has '__int64' */ S #define __LONGLONG __int64 N #endif N N #ifndef __STDINT_DECLS N #define __STDINT_DECLS N N #undef __CLIBNS N N #ifdef __cplusplus S namespace std { S #define __CLIBNS std:: S extern "C" { N #else N #define __CLIBNS N #endif /* __cplusplus */ N N N/* N * 'signed' is redundant below, except for 'signed char' and if N * the typedef is used to declare a bitfield. N */ N N /* 7.18.1.1 */ N N /* exact-width signed integer types */ Ntypedef signed char int8_t; Ntypedef signed short int int16_t; Ntypedef signed int int32_t; Ntypedef signed __INT64 int64_t; Xtypedef signed __int64 int64_t; N N /* exact-width unsigned integer types */ Ntypedef unsigned char uint8_t; Ntypedef unsigned short int uint16_t; Ntypedef unsigned int uint32_t; Ntypedef unsigned __INT64 uint64_t; Xtypedef unsigned __int64 uint64_t; N N /* 7.18.1.2 */ N N /* smallest type of at least n bits */ N /* minimum-width signed integer types */ Ntypedef signed char int_least8_t; Ntypedef signed short int int_least16_t; Ntypedef signed int int_least32_t; Ntypedef signed __INT64 int_least64_t; Xtypedef signed __int64 int_least64_t; N N /* minimum-width unsigned integer types */ Ntypedef unsigned char uint_least8_t; Ntypedef unsigned short int uint_least16_t; Ntypedef unsigned int uint_least32_t; Ntypedef unsigned __INT64 uint_least64_t; Xtypedef unsigned __int64 uint_least64_t; N N /* 7.18.1.3 */ N N /* fastest minimum-width signed integer types */ Ntypedef signed int int_fast8_t; Ntypedef signed int int_fast16_t; Ntypedef signed int int_fast32_t; Ntypedef signed __INT64 int_fast64_t; Xtypedef signed __int64 int_fast64_t; N N /* fastest minimum-width unsigned integer types */ Ntypedef unsigned int uint_fast8_t; Ntypedef unsigned int uint_fast16_t; Ntypedef unsigned int uint_fast32_t; Ntypedef unsigned __INT64 uint_fast64_t; Xtypedef unsigned __int64 uint_fast64_t; N N /* 7.18.1.4 integer types capable of holding object pointers */ N#if __sizeof_ptr == 8 X#if 4 == 8 Stypedef signed __INT64 intptr_t; Stypedef unsigned __INT64 uintptr_t; N#else Ntypedef signed int intptr_t; Ntypedef unsigned int uintptr_t; N#endif N N /* 7.18.1.5 greatest-width integer types */ Ntypedef signed __LONGLONG intmax_t; Xtypedef signed long long intmax_t; Ntypedef unsigned __LONGLONG uintmax_t; Xtypedef unsigned long long uintmax_t; N N N#if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) X#if !0L || 0L N N /* 7.18.2.1 */ N N /* minimum values of exact-width signed integer types */ N#define INT8_MIN -128 N#define INT16_MIN -32768 N#define INT32_MIN (~0x7fffffff) /* -2147483648 is unsigned */ N#define INT64_MIN __INT64_C(~0x7fffffffffffffff) /* -9223372036854775808 is unsigned */ N N /* maximum values of exact-width signed integer types */ N#define INT8_MAX 127 N#define INT16_MAX 32767 N#define INT32_MAX 2147483647 N#define INT64_MAX __INT64_C(9223372036854775807) N N /* maximum values of exact-width unsigned integer types */ N#define UINT8_MAX 255 N#define UINT16_MAX 65535 N#define UINT32_MAX 4294967295u N#define UINT64_MAX __UINT64_C(18446744073709551615) N N /* 7.18.2.2 */ N N /* minimum values of minimum-width signed integer types */ N#define INT_LEAST8_MIN -128 N#define INT_LEAST16_MIN -32768 N#define INT_LEAST32_MIN (~0x7fffffff) N#define INT_LEAST64_MIN __INT64_C(~0x7fffffffffffffff) N N /* maximum values of minimum-width signed integer types */ N#define INT_LEAST8_MAX 127 N#define INT_LEAST16_MAX 32767 N#define INT_LEAST32_MAX 2147483647 N#define INT_LEAST64_MAX __INT64_C(9223372036854775807) N N /* maximum values of minimum-width unsigned integer types */ N#define UINT_LEAST8_MAX 255 N#define UINT_LEAST16_MAX 65535 N#define UINT_LEAST32_MAX 4294967295u N#define UINT_LEAST64_MAX __UINT64_C(18446744073709551615) N N /* 7.18.2.3 */ N N /* minimum values of fastest minimum-width signed integer types */ N#define INT_FAST8_MIN (~0x7fffffff) N#define INT_FAST16_MIN (~0x7fffffff) N#define INT_FAST32_MIN (~0x7fffffff) N#define INT_FAST64_MIN __INT64_C(~0x7fffffffffffffff) N N /* maximum values of fastest minimum-width signed integer types */ N#define INT_FAST8_MAX 2147483647 N#define INT_FAST16_MAX 2147483647 N#define INT_FAST32_MAX 2147483647 N#define INT_FAST64_MAX __INT64_C(9223372036854775807) N N /* maximum values of fastest minimum-width unsigned integer types */ N#define UINT_FAST8_MAX 4294967295u N#define UINT_FAST16_MAX 4294967295u N#define UINT_FAST32_MAX 4294967295u N#define UINT_FAST64_MAX __UINT64_C(18446744073709551615) N N /* 7.18.2.4 */ N N /* minimum value of pointer-holding signed integer type */ N#if __sizeof_ptr == 8 X#if 4 == 8 S#define INTPTR_MIN INT64_MIN N#else N#define INTPTR_MIN INT32_MIN N#endif N N /* maximum value of pointer-holding signed integer type */ N#if __sizeof_ptr == 8 X#if 4 == 8 S#define INTPTR_MAX INT64_MAX N#else N#define INTPTR_MAX INT32_MAX N#endif N N /* maximum value of pointer-holding unsigned integer type */ N#if __sizeof_ptr == 8 X#if 4 == 8 S#define UINTPTR_MAX UINT64_MAX N#else N#define UINTPTR_MAX UINT32_MAX N#endif N N /* 7.18.2.5 */ N N /* minimum value of greatest-width signed integer type */ N#define INTMAX_MIN __ESCAPE__(~0x7fffffffffffffffll) N N /* maximum value of greatest-width signed integer type */ N#define INTMAX_MAX __ESCAPE__(9223372036854775807ll) N N /* maximum value of greatest-width unsigned integer type */ N#define UINTMAX_MAX __ESCAPE__(18446744073709551615ull) N N /* 7.18.3 */ N N /* limits of ptrdiff_t */ N#if __sizeof_ptr == 8 X#if 4 == 8 S#define PTRDIFF_MIN INT64_MIN S#define PTRDIFF_MAX INT64_MAX N#else N#define PTRDIFF_MIN INT32_MIN N#define PTRDIFF_MAX INT32_MAX N#endif N N /* limits of sig_atomic_t */ N#define SIG_ATOMIC_MIN (~0x7fffffff) N#define SIG_ATOMIC_MAX 2147483647 N N /* limit of size_t */ N#if __sizeof_ptr == 8 X#if 4 == 8 S#define SIZE_MAX UINT64_MAX N#else N#define SIZE_MAX UINT32_MAX N#endif N N /* limits of wchar_t */ N /* NB we have to undef and redef because they're defined in both N * stdint.h and wchar.h */ N#undef WCHAR_MIN N#undef WCHAR_MAX N N#if defined(__WCHAR32) || (defined(__ARM_SIZEOF_WCHAR_T) && __ARM_SIZEOF_WCHAR_T == 4) X#if 0L || (0L && __ARM_SIZEOF_WCHAR_T == 4) S #define WCHAR_MIN 0 S #define WCHAR_MAX 0xffffffffU N#else N #define WCHAR_MIN 0 N #define WCHAR_MAX 65535 N#endif N N /* limits of wint_t */ N#define WINT_MIN (~0x7fffffff) N#define WINT_MAX 2147483647 N N#endif /* __STDC_LIMIT_MACROS */ N N#if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS) X#if !0L || 0L N N /* 7.18.4.1 macros for minimum-width integer constants */ N#define INT8_C(x) (x) N#define INT16_C(x) (x) N#define INT32_C(x) (x) N#define INT64_C(x) __INT64_C(x) N N#define UINT8_C(x) (x ## u) N#define UINT16_C(x) (x ## u) N#define UINT32_C(x) (x ## u) N#define UINT64_C(x) __UINT64_C(x) N N /* 7.18.4.2 macros for greatest-width integer constants */ N#define INTMAX_C(x) __ESCAPE__(x ## ll) N#define UINTMAX_C(x) __ESCAPE__(x ## ull) N N#endif /* __STDC_CONSTANT_MACROS */ N N #ifdef __cplusplus S } /* extern "C" */ S } /* namespace std */ N #endif /* __cplusplus */ N #endif /* __STDINT_DECLS */ N N #ifdef __cplusplus S #ifndef __STDINT_NO_EXPORTS S using ::std::int8_t; S using ::std::int16_t; S using ::std::int32_t; S using ::std::int64_t; S using ::std::uint8_t; S using ::std::uint16_t; S using ::std::uint32_t; S using ::std::uint64_t; S using ::std::int_least8_t; S using ::std::int_least16_t; S using ::std::int_least32_t; S using ::std::int_least64_t; S using ::std::uint_least8_t; S using ::std::uint_least16_t; S using ::std::uint_least32_t; S using ::std::uint_least64_t; S using ::std::int_fast8_t; S using ::std::int_fast16_t; S using ::std::int_fast32_t; S using ::std::int_fast64_t; S using ::std::uint_fast8_t; S using ::std::uint_fast16_t; S using ::std::uint_fast32_t; S using ::std::uint_fast64_t; S using ::std::intptr_t; S using ::std::uintptr_t; S using ::std::intmax_t; S using ::std::uintmax_t; S #endif N #endif /* __cplusplus */ N N#undef __INT64 N#undef __LONGLONG N N#endif /* __stdint_h */ N N/* end of stdint.h */ L 20 "..\src\common\tau_device_datatype.h" 2 N#include "tau_common.h" L 1 "..\src\common\tau_common.h" 1 N/******************************************************************************* N* N* N* File: tau_common.h N* Description ͨضͷļ N* Version V0.1 N* Date 2020-09-07 N* Author lzy N *******************************************************************************/ N N#ifndef __TAU_COMMON_H N#define __TAU_COMMON_H N N/******************************************************************************* N* 1.Included files N*******************************************************************************/ N#include "stdint.h" N#include "math.h" L 1 "C:\Keil_v5\ARM\ARMCC\Bin\..\include\math.h" 1 N/* N * math.h: ANSI 'C' (X3J11 Oct 88) library header, section 4.5 N * Copyright (C) Codemist Ltd., 1988 N * Copyright 1991-1998,2004-2006,2014 ARM Limited. All rights reserved N */ N N/* N * RCS $Revision$ Codemist 0.03 N * Checkin $Date$ N * Revising $Author: statham $ N */ N N/* N * Parts of this file are based upon fdlibm: N * N * ==================================================== N * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. N * N * Developed at SunSoft, a Sun Microsystems, Inc. business. N * Permission to use, copy, modify, and distribute this N * software is freely granted, provided that this notice N * is preserved. N * ==================================================== N */ N N#ifndef __math_h N#define __math_h N#define __ARMCLIB_VERSION 5060037 N N#if defined(__clang__) || (defined(__ARMCC_VERSION) && !defined(__STRICT_ANSI__)) X#if 0L || (1L && !0L) N /* armclang and non-strict armcc allow 'long long' in system headers */ N #define __LONGLONG long long N#else S /* strict armcc has '__int64' */ S #define __LONGLONG __int64 N#endif N N/* N * Some of these declarations are new in C99. To access them in C++ N * you can use -D__USE_C99_MATH (or -D__USE_C99_ALL). N */ N#ifndef __USE_C99_MATH N #if defined(__USE_C99_ALL) || (defined(__STDC_VERSION__) && 199901L <= __STDC_VERSION__) || (defined(__cplusplus) && 201103L <= __cplusplus) X #if 0L || (1L && 199901L <= 199901L) || (0L && 201103L <= __cplusplus) N #define __USE_C99_MATH 1 N #endif N#endif N N#define _ARMABI __declspec(__nothrow) N#ifdef __TARGET_ARCH_AARCH64 S# define _ARMABI_SOFTFP __declspec(__nothrow) N#else N# define _ARMABI_SOFTFP __declspec(__nothrow) __attribute__((__pcs__("aapcs"))) N# define __HAVE_LONGDOUBLE 1 N#endif N#define _ARMABI_PURE __declspec(__nothrow) __attribute__((const)) N#ifdef __FP_FENV_EXCEPTIONS S# define _ARMABI_FPEXCEPT _ARMABI N#else N# define _ARMABI_FPEXCEPT _ARMABI __attribute__((const)) N#endif N N#ifdef __cplusplus S#define _ARMABI_INLINE inline S#define _ARMABI_INLINE_DEF inline N#elif defined __GNUC__ || defined _USE_STATIC_INLINE X#elif 1L || 0L N#define _ARMABI_INLINE static __inline N#define _ARMABI_INLINE_DEF static __inline N#elif (defined(__STDC_VERSION__) && 199901L <= __STDC_VERSION__) X#elif (1L && 199901L <= 199901L) S#define _ARMABI_INLINE inline S#define _ARMABI_INLINE_DEF static inline S#else S#define _ARMABI_INLINE __inline S#define _ARMABI_INLINE_DEF __inline N#endif N N#ifdef __TARGET_ARCH_AARCH64 S# define _SOFTFP N#else N# define _SOFTFP __attribute__((__pcs__("aapcs"))) N#endif N N /* N * If the compiler supports signalling nans as per N965 then it N * will define __SUPPORT_SNAN__, in which case a user may define N * _WANT_SNAN in order to obtain the nans function, as well as the N * FP_NANS and FP_NANQ classification macros. N */ N#if defined(__SUPPORT_SNAN__) && defined(_WANT_SNAN) X#if 0L && 0L S#pragma import(__use_snan) N#endif N N/* N * Macros for our inline functions down below. N * unsigned& __FLT(float x) - returns the bit pattern of x N * unsigned& __HI(double x) - returns the bit pattern of the high part of x N * (high part has exponent & sign bit in it) N * unsigned& __LO(double x) - returns the bit pattern of the low part of x N * N * We can assign to __FLT, __HI, and __LO and the appropriate bits get set in N * the floating point variable used. N * N * __HI & __LO are affected by the endianness and the target FPU. N */ N#define __FLT(x) (*(unsigned *)&(x)) N#if defined(__ARM_BIG_ENDIAN) || defined(__BIG_ENDIAN) X#if 0L || 0L S# define __LO(x) (*(1 + (unsigned *)&(x))) S# define __HI(x) (*(unsigned *)&(x)) N#else /* !defined(__ARM_BIG_ENDIAN) && !defined(__BIG_ENDIAN) */ N# define __HI(x) (*(1 + (unsigned *)&(x))) N# define __LO(x) (*(unsigned *)&(x)) N#endif /* !defined(__ARM_BIG_ENDIAN) && !defined(__BIG_ENDIAN) */ N N# ifndef __MATH_DECLS N# define __MATH_DECLS N N N/* N * A set of functions that we don't actually want to put in the standard N * namespace ever. These are all called by the C99 macros. As they're N * not specified by any standard they can't belong in ::std::. The N * macro #defines are below amongst the standard function declarations. N * We only include these if we actually need them later on N */ N#if !defined(__STRICT_ANSI__) || defined(__USE_C99_MATH) X#if !0L || 1L N# ifdef __cplusplus S extern "C" { N# endif /* __cplusplus */ N Nextern _SOFTFP unsigned __ARM_dcmp4(double /*x*/, double /*y*/); Xextern __attribute__((__pcs__("aapcs"))) unsigned __ARM_dcmp4(double , double ); Nextern _SOFTFP unsigned __ARM_fcmp4(float /*x*/, float /*y*/); Xextern __attribute__((__pcs__("aapcs"))) unsigned __ARM_fcmp4(float , float ); N /* N * Compare x and y and return the CPSR in r0. These means we can test for N * result types with bit pattern matching. N * N * These are a copy of the declarations in rt_fp.h keep in sync. N */ N Nextern _ARMABI_SOFTFP int __ARM_fpclassifyf(float /*x*/); Xextern __declspec(__nothrow) __attribute__((__pcs__("aapcs"))) int __ARM_fpclassifyf(float ); Nextern _ARMABI_SOFTFP int __ARM_fpclassify(double /*x*/); Xextern __declspec(__nothrow) __attribute__((__pcs__("aapcs"))) int __ARM_fpclassify(double ); N /* Classify x into NaN, infinite, normal, subnormal, zero */ N /* Used by fpclassify macro */ N N_ARMABI_INLINE_DEF _ARMABI_SOFTFP int __ARM_isfinitef(float __x) Xstatic __inline __declspec(__nothrow) __attribute__((__pcs__("aapcs"))) int __ARM_isfinitef(float __x) N{ N return ((__FLT(__x) >> 23) & 0xff) != 0xff; X return (((*(unsigned *)&(__x)) >> 23) & 0xff) != 0xff; N} N_ARMABI_INLINE_DEF _ARMABI_SOFTFP int __ARM_isfinite(double __x) Xstatic __inline __declspec(__nothrow) __attribute__((__pcs__("aapcs"))) int __ARM_isfinite(double __x) N{ N return ((__HI(__x) >> 20) & 0x7ff) != 0x7ff; X return (((*(1 + (unsigned *)&(__x))) >> 20) & 0x7ff) != 0x7ff; N} N /* Return 1 if __x is finite, 0 otherwise */ N /* Used by isfinite macro */ N N_ARMABI_INLINE_DEF _ARMABI_SOFTFP int __ARM_isinff(float __x) Xstatic __inline __declspec(__nothrow) __attribute__((__pcs__("aapcs"))) int __ARM_isinff(float __x) N{ N return (__FLT(__x) << 1) == 0xff000000; X return ((*(unsigned *)&(__x)) << 1) == 0xff000000; N} N_ARMABI_INLINE_DEF _ARMABI_SOFTFP int __ARM_isinf(double __x) Xstatic __inline __declspec(__nothrow) __attribute__((__pcs__("aapcs"))) int __ARM_isinf(double __x) N{ N return ((__HI(__x) << 1) == 0xffe00000) && (__LO(__x) == 0); X return (((*(1 + (unsigned *)&(__x))) << 1) == 0xffe00000) && ((*(unsigned *)&(__x)) == 0); N} N /* Return 1 if __x is infinite, 0 otherwise */ N /* Used by isinf macro */ N N_ARMABI_INLINE_DEF _ARMABI_SOFTFP int __ARM_islessgreaterf(float __x, float __y) Xstatic __inline __declspec(__nothrow) __attribute__((__pcs__("aapcs"))) int __ARM_islessgreaterf(float __x, float __y) N{ N unsigned __f = __ARM_fcmp4(__x, __y) >> 28; N return (__f == 8) || (__f == 2); /* Just N set or Just Z set */ N} N_ARMABI_INLINE_DEF _ARMABI_SOFTFP int __ARM_islessgreater(double __x, double __y) Xstatic __inline __declspec(__nothrow) __attribute__((__pcs__("aapcs"))) int __ARM_islessgreater(double __x, double __y) N{ N unsigned __f = __ARM_dcmp4(__x, __y) >> 28; N return (__f == 8) || (__f == 2); /* Just N set or Just Z set */ N} N /* N * Compare __x and __y and return 1 if __x < __y or __x > __y, 0 otherwise N * Used by islessgreater macro N */ N N_ARMABI_INLINE_DEF _ARMABI_SOFTFP int __ARM_isnanf(float __x) Xstatic __inline __declspec(__nothrow) __attribute__((__pcs__("aapcs"))) int __ARM_isnanf(float __x) N{ N return (0x7f800000 - (__FLT(__x) & 0x7fffffff)) >> 31; X return (0x7f800000 - ((*(unsigned *)&(__x)) & 0x7fffffff)) >> 31; N} N_ARMABI_INLINE_DEF _ARMABI_SOFTFP int __ARM_isnan(double __x) Xstatic __inline __declspec(__nothrow) __attribute__((__pcs__("aapcs"))) int __ARM_isnan(double __x) N{ N unsigned __xf = __HI(__x) | ((__LO(__x) == 0) ? 0 : 1); X unsigned __xf = (*(1 + (unsigned *)&(__x))) | (((*(unsigned *)&(__x)) == 0) ? 0 : 1); N return (0x7ff00000 - (__xf & 0x7fffffff)) >> 31; N} N /* Return 1 if __x is a NaN, 0 otherwise */ N /* Used by isnan macro */ N N_ARMABI_INLINE_DEF _ARMABI_SOFTFP int __ARM_isnormalf(float __x) Xstatic __inline __declspec(__nothrow) __attribute__((__pcs__("aapcs"))) int __ARM_isnormalf(float __x) N{ N unsigned __xe = (__FLT(__x) >> 23) & 0xff; X unsigned __xe = ((*(unsigned *)&(__x)) >> 23) & 0xff; N return (__xe != 0xff) && (__xe != 0); N} N_ARMABI_INLINE_DEF _ARMABI_SOFTFP int __ARM_isnormal(double __x) Xstatic __inline __declspec(__nothrow) __attribute__((__pcs__("aapcs"))) int __ARM_isnormal(double __x) N{ N unsigned __xe = (__HI(__x) >> 20) & 0x7ff; X unsigned __xe = ((*(1 + (unsigned *)&(__x))) >> 20) & 0x7ff; N return (__xe != 0x7ff) && (__xe != 0); N} N /* Return 1 if __x is a normalised number, 0 otherwise */ N /* used by isnormal macro */ N N_ARMABI_INLINE_DEF _ARMABI_SOFTFP int __ARM_signbitf(float __x) Xstatic __inline __declspec(__nothrow) __attribute__((__pcs__("aapcs"))) int __ARM_signbitf(float __x) N{ N return __FLT(__x) >> 31; X return (*(unsigned *)&(__x)) >> 31; N} N_ARMABI_INLINE_DEF _ARMABI_SOFTFP int __ARM_signbit(double __x) Xstatic __inline __declspec(__nothrow) __attribute__((__pcs__("aapcs"))) int __ARM_signbit(double __x) N{ N return __HI(__x) >> 31; X return (*(1 + (unsigned *)&(__x))) >> 31; N} N /* Return signbit of __x */ N /* Used by signbit macro */ N N# ifdef __cplusplus S } /* extern "C" */ N# endif /* __cplusplus */ N#endif /* Strict ANSI */ N N# undef __CLIBNS N N# ifdef __cplusplus S namespace std { S# define __CLIBNS ::std:: S extern "C" { N# else N# define __CLIBNS N# endif /* __cplusplus */ N N N#ifndef __has_builtin N #define __has_builtin(x) 0 N#endif N N#if !defined(__STRICT_ANSI__) || defined(__USE_C99_MATH) X#if !0L || 1L N /* C99 additions */ N typedef float float_t; N typedef double double_t; N#if __has_builtin(__builtin_inf) X#if 0 S# define HUGE_VALF __builtin_inff() S# define HUGE_VALL __builtin_infl() S# define INFINITY __builtin_inff() S# define NAN __builtin_nanf("") N# else N# define HUGE_VALF ((float)__INFINITY__) N# define HUGE_VALL ((long double)__INFINITY__) N# define INFINITY ((float)__INFINITY__) N# define NAN (__ESCAPE__(0f_7FC00000)) N#endif N N# define MATH_ERRNO 1 N# define MATH_ERREXCEPT 2 Nextern const int math_errhandling; N#endif N#if __has_builtin(__builtin_inf) X#if 0 S# define HUGE_VAL __builtin_inf() N#else N# define HUGE_VAL ((double)__INFINITY__) N#endif N Nextern _ARMABI double acos(double /*x*/); Xextern __declspec(__nothrow) double acos(double ); N /* computes the principal value of the arc cosine of x */ N /* a domain error occurs for arguments not in the range -1 to 1 */ N /* Returns: the arc cosine in the range 0 to Pi. */ Nextern _ARMABI double asin(double /*x*/); Xextern __declspec(__nothrow) double asin(double ); N /* computes the principal value of the arc sine of x */ N /* a domain error occurs for arguments not in the range -1 to 1 */ N /* and -HUGE_VAL is returned. */ N /* Returns: the arc sine in the range -Pi/2 to Pi/2. */ N Nextern _ARMABI_PURE double atan(double /*x*/); Xextern __declspec(__nothrow) __attribute__((const)) double atan(double ); N /* computes the principal value of the arc tangent of x */ N /* Returns: the arc tangent in the range -Pi/2 to Pi/2. */ N Nextern _ARMABI double atan2(double /*y*/, double /*x*/); Xextern __declspec(__nothrow) double atan2(double , double ); N /* computes the principal value of the arc tangent of y/x, using the */ N /* signs of both arguments to determine the quadrant of the return value */ N /* a domain error occurs if both args are zero, and -HUGE_VAL returned. */ N /* Returns: the arc tangent of y/x, in the range -Pi to Pi. */ N Nextern _ARMABI double cos(double /*x*/); Xextern __declspec(__nothrow) double cos(double ); N /* computes the cosine of x (measured in radians). A large magnitude */ N /* argument may yield a result with little or no significance. */ N /* a domain error occurs for infinite input (C 7.12.1 footnote 196). */ N /* Returns: the cosine value. */ Nextern _ARMABI double sin(double /*x*/); Xextern __declspec(__nothrow) double sin(double ); N /* computes the sine of x (measured in radians). A large magnitude */ N /* argument may yield a result with little or no significance. */ N /* a domain error occurs for infinite input (C 7.12.1 footnote 196). */ N /* Returns: the sine value. */ N Nextern void __use_accurate_range_reduction(void); N /* reference this to select the larger, slower, but more accurate */ N /* range reduction in sin, cos and tan */ N Nextern _ARMABI double tan(double /*x*/); Xextern __declspec(__nothrow) double tan(double ); N /* computes the tangent of x (measured in radians). A large magnitude */ N /* argument may yield a result with little or no significance */ N /* Returns: the tangent value. */ N /* if range error; returns HUGE_VAL. */ N Nextern _ARMABI double cosh(double /*x*/); Xextern __declspec(__nothrow) double cosh(double ); N /* computes the hyperbolic cosine of x. A range error occurs if the */ N /* magnitude of x is too large. */ N /* Returns: the hyperbolic cosine value. */ N /* if range error; returns HUGE_VAL. */ Nextern _ARMABI double sinh(double /*x*/); Xextern __declspec(__nothrow) double sinh(double ); N /* computes the hyperbolic sine of x. A range error occurs if the */ N /* magnitude of x is too large. */ N /* Returns: the hyperbolic sine value. */ N /* if range error; returns -HUGE_VAL or HUGE_VAL depending */ N /* on the sign of the argument */ N Nextern _ARMABI_PURE double tanh(double /*x*/); Xextern __declspec(__nothrow) __attribute__((const)) double tanh(double ); N /* computes the hyperbolic tangent of x. */ N /* Returns: the hyperbolic tangent value. */ N Nextern _ARMABI double exp(double /*x*/); Xextern __declspec(__nothrow) double exp(double ); N /* computes the exponential function of x. A range error occurs if the */ N /* magnitude of x is too large. */ N /* Returns: the exponential value. */ N /* if underflow range error; 0 is returned. */ N /* if overflow range error; HUGE_VAL is returned. */ N Nextern _ARMABI double frexp(double /*value*/, int * /*exp*/) __attribute__((__nonnull__(2))); Xextern __declspec(__nothrow) double frexp(double , int * ) __attribute__((__nonnull__(2))); N /* breaks a floating-point number into a normalised fraction and an */ N /* integral power of 2. It stores the integer in the int object pointed */ N /* to by exp. */ N /* Returns: the value x, such that x is a double with magnitude in the */ N /* interval 0.5 to 1.0 or zero, and value equals x times 2 raised to the */ N /* power *exp. If value is zero, both parts of the result are zero. */ N Nextern _ARMABI double ldexp(double /*x*/, int /*exp*/); Xextern __declspec(__nothrow) double ldexp(double , int ); N /* multiplies a floating-point number by an integral power of 2. */ N /* A range error may occur. */ N /* Returns: the value of x times 2 raised to the power of exp. */ N /* if range error; HUGE_VAL is returned. */ Nextern _ARMABI double log(double /*x*/); Xextern __declspec(__nothrow) double log(double ); N /* computes the natural logarithm of x. A domain error occurs if the */ N /* argument is negative, and -HUGE_VAL is returned. A range error occurs */ N /* if the argument is zero. */ N /* Returns: the natural logarithm. */ N /* if range error; -HUGE_VAL is returned. */ Nextern _ARMABI double log10(double /*x*/); Xextern __declspec(__nothrow) double log10(double ); N /* computes the base-ten logarithm of x. A domain error occurs if the */ N /* argument is negative. A range error occurs if the argument is zero. */ N /* Returns: the base-ten logarithm. */ Nextern _ARMABI double modf(double /*value*/, double * /*iptr*/) __attribute__((__nonnull__(2))); Xextern __declspec(__nothrow) double modf(double , double * ) __attribute__((__nonnull__(2))); N /* breaks the argument value into integral and fraction parts, each of */ N /* which has the same sign as the argument. It stores the integral part */ N /* as a double in the object pointed to by iptr. */ N /* Returns: the signed fractional part of value. */ N Nextern _ARMABI double pow(double /*x*/, double /*y*/); Xextern __declspec(__nothrow) double pow(double , double ); N /* computes x raised to the power of y. A domain error occurs if x is */ N /* zero and y is less than or equal to zero, or if x is negative and y */ N /* is not an integer, and -HUGE_VAL returned. A range error may occur. */ N /* Returns: the value of x raised to the power of y. */ N /* if underflow range error; 0 is returned. */ N /* if overflow range error; HUGE_VAL is returned. */ Nextern _ARMABI double sqrt(double /*x*/); Xextern __declspec(__nothrow) double sqrt(double ); N /* computes the non-negative square root of x. A domain error occurs */ N /* if the argument is negative, and -HUGE_VAL returned. */ N /* Returns: the value of the square root. */ N N#if defined(__TARGET_FPU_VFP_DOUBLE) && !defined(__TARGET_FPU_SOFTVFP) X#if 0L && !1L S _ARMABI_INLINE double _sqrt(double __x) { return __sqrt(__x); } N#else N _ARMABI_INLINE double _sqrt(double __x) { return sqrt(__x); } X static __inline double _sqrt(double __x) { return sqrt(__x); } N#endif N#if defined(__TARGET_FPU_VFP_SINGLE) && !defined(__TARGET_FPU_SOFTVFP) X#if 0L && !1L S _ARMABI_INLINE float _sqrtf(float __x) { return __sqrtf(__x); } N#else N _ARMABI_INLINE float _sqrtf(float __x) { return (float)sqrt(__x); } X static __inline float _sqrtf(float __x) { return (float)sqrt(__x); } N#endif N /* With VFP, _sqrt and _sqrtf should expand inline as the native VFP square root N * instructions. They will not behave like the C sqrt() function, because N * they will report unusual values as IEEE exceptions (in fpmodes which N * support IEEE exceptions) rather than in errno. These function names N * are not specified in any standard. */ N Nextern _ARMABI_PURE double ceil(double /*x*/); Xextern __declspec(__nothrow) __attribute__((const)) double ceil(double ); N /* computes the smallest integer not less than x. */ N /* Returns: the smallest integer not less than x, expressed as a double. */ Nextern _ARMABI_PURE double fabs(double /*x*/); Xextern __declspec(__nothrow) __attribute__((const)) double fabs(double ); N /* computes the absolute value of the floating-point number x. */ N /* Returns: the absolute value of x. */ N Nextern _ARMABI_PURE double floor(double /*d*/); Xextern __declspec(__nothrow) __attribute__((const)) double floor(double ); N /* computes the largest integer not greater than x. */ N /* Returns: the largest integer not greater than x, expressed as a double */ N Nextern _ARMABI double fmod(double /*x*/, double /*y*/); Xextern __declspec(__nothrow) double fmod(double , double ); N /* computes the floating-point remainder of x/y. */ N /* Returns: the value x - i * y, for some integer i such that, if y is */ N /* nonzero, the result has the same sign as x and magnitude */ N /* less than the magnitude of y. If y is zero, a domain error */ N /* occurs and -HUGE_VAL is returned. */ N N /* Additional Mathlib functions not defined by the ANSI standard. N * Not guaranteed, and not necessarily very well tested. N * C99 requires the user to include to use these functions N * declaring them "by hand" is not sufficient N * N * The above statement is not completely true now. Some of the above N * C99 functionality has been added as per the Standard, and (where N * necessary) old Mathlib functionality withdrawn/changed. Before N * including this header #define __ENABLE_MATHLIB_LEGACY if you want to N * re-enable the legacy functionality. N */ N N#if !defined(__STRICT_ANSI__) || defined(__USE_C99_MATH) X#if !0L || 1L N Nextern _ARMABI double acosh(double /*x*/); Xextern __declspec(__nothrow) double acosh(double ); N /* N * Inverse cosh. EDOM if argument < 1.0 N */ Nextern _ARMABI double asinh(double /*x*/); Xextern __declspec(__nothrow) double asinh(double ); N /* N * Inverse sinh. N */ Nextern _ARMABI double atanh(double /*x*/); Xextern __declspec(__nothrow) double atanh(double ); N /* N * Inverse tanh. EDOM if |argument| > 1.0 N */ Nextern _ARMABI double cbrt(double /*x*/); Xextern __declspec(__nothrow) double cbrt(double ); N /* N * Cube root. N */ N_ARMABI_INLINE _ARMABI_PURE double copysign(double __x, double __y) Xstatic __inline __declspec(__nothrow) __attribute__((const)) double copysign(double __x, double __y) N /* N * Returns x with sign bit replaced by sign of y. N */ N{ N __HI(__x) = (__HI(__x) & 0x7fffffff) | (__HI(__y) & 0x80000000); X (*(1 + (unsigned *)&(__x))) = ((*(1 + (unsigned *)&(__x))) & 0x7fffffff) | ((*(1 + (unsigned *)&(__y))) & 0x80000000); N return __x; N} N_ARMABI_INLINE _ARMABI_PURE float copysignf(float __x, float __y) Xstatic __inline __declspec(__nothrow) __attribute__((const)) float copysignf(float __x, float __y) N /* N * Returns x with sign bit replaced by sign of y. N */ N{ N __FLT(__x) = (__FLT(__x) & 0x7fffffff) | (__FLT(__y) & 0x80000000); X (*(unsigned *)&(__x)) = ((*(unsigned *)&(__x)) & 0x7fffffff) | ((*(unsigned *)&(__y)) & 0x80000000); N return __x; N} Nextern _ARMABI double erf(double /*x*/); Xextern __declspec(__nothrow) double erf(double ); N /* N * Error function. (2/sqrt(pi)) * integral from 0 to x of exp(-t*t) dt. N */ Nextern _ARMABI double erfc(double /*x*/); Xextern __declspec(__nothrow) double erfc(double ); N /* N * 1-erf(x). (More accurate than just coding 1-erf(x), for large x.) N */ Nextern _ARMABI double expm1(double /*x*/); Xextern __declspec(__nothrow) double expm1(double ); N /* N * exp(x)-1. (More accurate than just coding exp(x)-1, for small x.) N */ N#define fpclassify(x) \ N ((sizeof(x) == sizeof(float)) ? \ N __ARM_fpclassifyf(x) : __ARM_fpclassify(x)) X#define fpclassify(x) ((sizeof(x) == sizeof(float)) ? __ARM_fpclassifyf(x) : __ARM_fpclassify(x)) N /* N * Classify a floating point number into one of the following values: N */ N#define FP_ZERO (0) N#define FP_SUBNORMAL (4) N#define FP_NORMAL (5) N#define FP_INFINITE (3) N#define FP_NAN (7) N N#if defined(_WANT_SNAN) && defined(__SUPPORT_SNAN__) X#if 0L && 0L S/* S * Note that we'll never classify a number as FP_NAN, as all NaNs will S * be either FP_NANQ or FP_NANS S */ S# define FP_NANQ (8) S# define FP_NANS (9) N#endif N N Nextern _ARMABI double hypot(double /*x*/, double /*y*/); Xextern __declspec(__nothrow) double hypot(double , double ); N /* N * sqrt(x*x+y*y), ie the length of the vector (x,y) or the N * hypotenuse of a right triangle whose other two sides are x N * and y. Won't overflow unless the _answer_ is too big, even N * if the intermediate x*x+y*y is too big. N */ Nextern _ARMABI int ilogb(double /*x*/); Xextern __declspec(__nothrow) int ilogb(double ); N /* N * Exponent of x (returns 0 for 1.0, 1 for 2.0, -1 for 0.5, etc.) N */ Nextern _ARMABI int ilogbf(float /*x*/); Xextern __declspec(__nothrow) int ilogbf(float ); N /* N * Like ilogb but takes a float N */ Nextern _ARMABI int ilogbl(long double /*x*/); Xextern __declspec(__nothrow) int ilogbl(long double ); N /* N * Exponent of x (returns 0 for 1.0, 1 for 2.0, -1 for 0.5, etc.) N */ N#define FP_ILOGB0 (-0x7fffffff) /* ilogb(0) == -INT_MAX */ N#define FP_ILOGBNAN ( 0x80000000) /* ilogb(NAN) == INT_MIN */ N N#define isfinite(x) \ N ((sizeof(x) == sizeof(float)) \ N ? __ARM_isfinitef(x) \ N : __ARM_isfinite(x)) X#define isfinite(x) ((sizeof(x) == sizeof(float)) ? __ARM_isfinitef(x) : __ARM_isfinite(x)) N /* N * Returns true if x is a finite number, size independent. N */ N N#define isgreater(x, y) \ N (((sizeof(x) == sizeof(float)) && (sizeof(y) == sizeof(float))) \ N ? ((__ARM_fcmp4((x), (y)) & 0xf0000000) == 0x20000000) \ N : ((__ARM_dcmp4((x), (y)) & 0xf0000000) == 0x20000000)) X#define isgreater(x, y) (((sizeof(x) == sizeof(float)) && (sizeof(y) == sizeof(float))) ? ((__ARM_fcmp4((x), (y)) & 0xf0000000) == 0x20000000) : ((__ARM_dcmp4((x), (y)) & 0xf0000000) == 0x20000000)) N /* N * Returns true if x > y, throws no exceptions except on Signaling NaNs N * N * We want the C not set but the Z bit clear, V must be clear N */ N N#define isgreaterequal(x, y) \ N (((sizeof(x) == sizeof(float)) && (sizeof(y) == sizeof(float))) \ N ? ((__ARM_fcmp4((x), (y)) & 0x30000000) == 0x20000000) \ N : ((__ARM_dcmp4((x), (y)) & 0x30000000) == 0x20000000)) X#define isgreaterequal(x, y) (((sizeof(x) == sizeof(float)) && (sizeof(y) == sizeof(float))) ? ((__ARM_fcmp4((x), (y)) & 0x30000000) == 0x20000000) : ((__ARM_dcmp4((x), (y)) & 0x30000000) == 0x20000000)) N /* N * Returns true if x >= y, throws no exceptions except on Signaling NaNs N * N * We just need to see if the C bit is set or not and ensure V clear N */ N N#define isinf(x) \ N ((sizeof(x) == sizeof(float)) \ N ? __ARM_isinff(x) \ N : __ARM_isinf(x)) X#define isinf(x) ((sizeof(x) == sizeof(float)) ? __ARM_isinff(x) : __ARM_isinf(x)) N /* N * Returns true if x is an infinity, size independent. N */ N N#define isless(x, y) \ N (((sizeof(x) == sizeof(float)) && (sizeof(y) == sizeof(float))) \ N ? ((__ARM_fcmp4((x), (y)) & 0xf0000000) == 0x80000000) \ N : ((__ARM_dcmp4((x), (y)) & 0xf0000000) == 0x80000000)) X#define isless(x, y) (((sizeof(x) == sizeof(float)) && (sizeof(y) == sizeof(float))) ? ((__ARM_fcmp4((x), (y)) & 0xf0000000) == 0x80000000) : ((__ARM_dcmp4((x), (y)) & 0xf0000000) == 0x80000000)) N /* N * Returns true if x < y, throws no exceptions except on Signaling NaNs N * N * We're less than if N is set, V clear N */ N N#define islessequal(x, y) \ N (((sizeof(x) == sizeof(float)) && (sizeof(y) == sizeof(float))) \ N ? ((__ARM_fcmp4((x), (y)) & 0xc0000000) != 0) \ N : ((__ARM_dcmp4((x), (y)) & 0xc0000000) != 0)) X#define islessequal(x, y) (((sizeof(x) == sizeof(float)) && (sizeof(y) == sizeof(float))) ? ((__ARM_fcmp4((x), (y)) & 0xc0000000) != 0) : ((__ARM_dcmp4((x), (y)) & 0xc0000000) != 0)) N /* N * Returns true if x <= y, throws no exceptions except on Signaling NaNs N * N * We're less than or equal if one of N or Z is set, V clear N */ N N#define islessgreater(x, y) \ N (((sizeof(x) == sizeof(float)) && (sizeof(y) == sizeof(float))) \ N ? __ARM_islessgreaterf((x), (y)) \ N : __ARM_islessgreater((x), (y))) X#define islessgreater(x, y) (((sizeof(x) == sizeof(float)) && (sizeof(y) == sizeof(float))) ? __ARM_islessgreaterf((x), (y)) : __ARM_islessgreater((x), (y))) N /* N * Returns true if x <> y, throws no exceptions except on Signaling NaNs N * Unfortunately this test is too complicated to do in a macro without N * evaluating x & y twice. Shame really... N */ N N#define isnan(x) \ N ((sizeof(x) == sizeof(float)) \ N ? __ARM_isnanf(x) \ N : __ARM_isnan(x)) X#define isnan(x) ((sizeof(x) == sizeof(float)) ? __ARM_isnanf(x) : __ARM_isnan(x)) N /* N * Returns TRUE if x is a NaN. N */ N N#define isnormal(x) \ N ((sizeof(x) == sizeof(float)) \ N ? __ARM_isnormalf(x) \ N : __ARM_isnormal(x)) X#define isnormal(x) ((sizeof(x) == sizeof(float)) ? __ARM_isnormalf(x) : __ARM_isnormal(x)) N /* N * Returns TRUE if x is a NaN. N */ N N#define isunordered(x, y) \ N (((sizeof(x) == sizeof(float)) && (sizeof(y) == sizeof(float))) \ N ? ((__ARM_fcmp4((x), (y)) & 0x10000000) == 0x10000000) \ N : ((__ARM_dcmp4((x), (y)) & 0x10000000) == 0x10000000)) X#define isunordered(x, y) (((sizeof(x) == sizeof(float)) && (sizeof(y) == sizeof(float))) ? ((__ARM_fcmp4((x), (y)) & 0x10000000) == 0x10000000) : ((__ARM_dcmp4((x), (y)) & 0x10000000) == 0x10000000)) N /* N * Returns true if x ? y, throws no exceptions except on Signaling NaNs N * Unordered occurs if and only if the V bit is set N */ N Nextern _ARMABI double lgamma (double /*x*/); Xextern __declspec(__nothrow) double lgamma (double ); N /* N * The log of the absolute value of the gamma function of x. The sign N * of the gamma function of x is returned in the global `signgam'. N */ Nextern _ARMABI double log1p(double /*x*/); Xextern __declspec(__nothrow) double log1p(double ); N /* N * log(1+x). (More accurate than just coding log(1+x), for small x.) N */ Nextern _ARMABI double logb(double /*x*/); Xextern __declspec(__nothrow) double logb(double ); N /* N * Like ilogb but returns a double. N */ Nextern _ARMABI float logbf(float /*x*/); Xextern __declspec(__nothrow) float logbf(float ); N /* N * Like logb but takes and returns float N */ Nextern _ARMABI long double logbl(long double /*x*/); Xextern __declspec(__nothrow) long double logbl(long double ); N /* N * Like logb but takes and returns long double N */ Nextern _ARMABI double nextafter(double /*x*/, double /*y*/); Xextern __declspec(__nothrow) double nextafter(double , double ); N /* N * Returns the next representable number after x, in the N * direction toward y. N */ Nextern _ARMABI float nextafterf(float /*x*/, float /*y*/); Xextern __declspec(__nothrow) float nextafterf(float , float ); N /* N * Returns the next representable number after x, in the N * direction toward y. N */ Nextern _ARMABI long double nextafterl(long double /*x*/, long double /*y*/); Xextern __declspec(__nothrow) long double nextafterl(long double , long double ); N /* N * Returns the next representable number after x, in the N * direction toward y. N */ Nextern _ARMABI double nexttoward(double /*x*/, long double /*y*/); Xextern __declspec(__nothrow) double nexttoward(double , long double ); N /* N * Returns the next representable number after x, in the N * direction toward y. N */ Nextern _ARMABI float nexttowardf(float /*x*/, long double /*y*/); Xextern __declspec(__nothrow) float nexttowardf(float , long double ); N /* N * Returns the next representable number after x, in the N * direction toward y. N */ Nextern _ARMABI long double nexttowardl(long double /*x*/, long double /*y*/); Xextern __declspec(__nothrow) long double nexttowardl(long double , long double ); N /* N * Returns the next representable number after x, in the N * direction toward y. N */ Nextern _ARMABI double remainder(double /*x*/, double /*y*/); Xextern __declspec(__nothrow) double remainder(double , double ); N /* N * Returns the remainder of x by y, in the IEEE 754 sense. N */ Nextern _ARMABI_FPEXCEPT double rint(double /*x*/); Xextern __declspec(__nothrow) __attribute__((const)) double rint(double ); N /* N * Rounds x to an integer, in the IEEE 754 sense. N */ Nextern _ARMABI double scalbln(double /*x*/, long int /*n*/); Xextern __declspec(__nothrow) double scalbln(double , long int ); N /* N * Compute x times 2^n quickly. N */ Nextern _ARMABI float scalblnf(float /*x*/, long int /*n*/); Xextern __declspec(__nothrow) float scalblnf(float , long int ); N /* N * Compute x times 2^n quickly. N */ Nextern _ARMABI long double scalblnl(long double /*x*/, long int /*n*/); Xextern __declspec(__nothrow) long double scalblnl(long double , long int ); N /* N * Compute x times 2^n quickly. N */ Nextern _ARMABI double scalbn(double /*x*/, int /*n*/); Xextern __declspec(__nothrow) double scalbn(double , int ); N /* N * Compute x times 2^n quickly. N */ Nextern _ARMABI float scalbnf(float /*x*/, int /*n*/); Xextern __declspec(__nothrow) float scalbnf(float , int ); N /* N * Compute x times 2^n quickly. N */ Nextern _ARMABI long double scalbnl(long double /*x*/, int /*n*/); Xextern __declspec(__nothrow) long double scalbnl(long double , int ); N /* N * Compute x times 2^n quickly. N */ N#define signbit(x) \ N ((sizeof(x) == sizeof(float)) \ N ? __ARM_signbitf(x) \ N : __ARM_signbit(x)) X#define signbit(x) ((sizeof(x) == sizeof(float)) ? __ARM_signbitf(x) : __ARM_signbit(x)) N /* N * Returns the signbit of x, size independent macro N */ N#endif N N/* C99 float versions of functions. math.h has always reserved these N identifiers for this purpose (7.13.4). */ Nextern _ARMABI_PURE float _fabsf(float); /* old ARM name */ Xextern __declspec(__nothrow) __attribute__((const)) float _fabsf(float); N_ARMABI_INLINE _ARMABI_PURE float fabsf(float __f) { return _fabsf(__f); } Xstatic __inline __declspec(__nothrow) __attribute__((const)) float fabsf(float __f) { return _fabsf(__f); } Nextern _ARMABI float sinf(float /*x*/); Xextern __declspec(__nothrow) float sinf(float ); Nextern _ARMABI float cosf(float /*x*/); Xextern __declspec(__nothrow) float cosf(float ); Nextern _ARMABI float tanf(float /*x*/); Xextern __declspec(__nothrow) float tanf(float ); Nextern _ARMABI float acosf(float /*x*/); Xextern __declspec(__nothrow) float acosf(float ); Nextern _ARMABI float asinf(float /*x*/); Xextern __declspec(__nothrow) float asinf(float ); Nextern _ARMABI float atanf(float /*x*/); Xextern __declspec(__nothrow) float atanf(float ); Nextern _ARMABI float atan2f(float /*y*/, float /*x*/); Xextern __declspec(__nothrow) float atan2f(float , float ); Nextern _ARMABI float sinhf(float /*x*/); Xextern __declspec(__nothrow) float sinhf(float ); Nextern _ARMABI float coshf(float /*x*/); Xextern __declspec(__nothrow) float coshf(float ); Nextern _ARMABI float tanhf(float /*x*/); Xextern __declspec(__nothrow) float tanhf(float ); Nextern _ARMABI float expf(float /*x*/); Xextern __declspec(__nothrow) float expf(float ); Nextern _ARMABI float logf(float /*x*/); Xextern __declspec(__nothrow) float logf(float ); Nextern _ARMABI float log10f(float /*x*/); Xextern __declspec(__nothrow) float log10f(float ); Nextern _ARMABI float powf(float /*x*/, float /*y*/); Xextern __declspec(__nothrow) float powf(float , float ); Nextern _ARMABI float sqrtf(float /*x*/); Xextern __declspec(__nothrow) float sqrtf(float ); Nextern _ARMABI float ldexpf(float /*x*/, int /*exp*/); Xextern __declspec(__nothrow) float ldexpf(float , int ); Nextern _ARMABI float frexpf(float /*value*/, int * /*exp*/) __attribute__((__nonnull__(2))); Xextern __declspec(__nothrow) float frexpf(float , int * ) __attribute__((__nonnull__(2))); Nextern _ARMABI_PURE float ceilf(float /*x*/); Xextern __declspec(__nothrow) __attribute__((const)) float ceilf(float ); Nextern _ARMABI_PURE float floorf(float /*x*/); Xextern __declspec(__nothrow) __attribute__((const)) float floorf(float ); Nextern _ARMABI float fmodf(float /*x*/, float /*y*/); Xextern __declspec(__nothrow) float fmodf(float , float ); Nextern _ARMABI float modff(float /*value*/, float * /*iptr*/) __attribute__((__nonnull__(2))); Xextern __declspec(__nothrow) float modff(float , float * ) __attribute__((__nonnull__(2))); N N/* C99 long double versions of functions. */ N/* (also need to have 'using' declarations below) */ N#define _ARMDEFLD1(f) \ N _ARMABI long double f##l(long double /*x*/) X#define _ARMDEFLD1(f) _ARMABI long double f##l(long double ) N N#define _ARMDEFLD1P(f, T) \ N _ARMABI long double f##l(long double /*x*/, T /*p*/) X#define _ARMDEFLD1P(f, T) _ARMABI long double f##l(long double , T ) N N#define _ARMDEFLD2(f) \ N _ARMABI long double f##l(long double /*x*/, long double /*y*/) X#define _ARMDEFLD2(f) _ARMABI long double f##l(long double , long double ) N N/* N * Long double versions of C89 functions can be defined N * unconditionally, because C89 reserved these names in "future N * library directions". N */ N_ARMDEFLD1(acos); X__declspec(__nothrow) long double acosl(long double ); N_ARMDEFLD1(asin); X__declspec(__nothrow) long double asinl(long double ); N_ARMDEFLD1(atan); X__declspec(__nothrow) long double atanl(long double ); N_ARMDEFLD2(atan2); X__declspec(__nothrow) long double atan2l(long double , long double ); N_ARMDEFLD1(ceil); X__declspec(__nothrow) long double ceill(long double ); N_ARMDEFLD1(cos); X__declspec(__nothrow) long double cosl(long double ); N_ARMDEFLD1(cosh); X__declspec(__nothrow) long double coshl(long double ); N_ARMDEFLD1(exp); X__declspec(__nothrow) long double expl(long double ); N_ARMDEFLD1(fabs); X__declspec(__nothrow) long double fabsl(long double ); N_ARMDEFLD1(floor); X__declspec(__nothrow) long double floorl(long double ); N_ARMDEFLD2(fmod); X__declspec(__nothrow) long double fmodl(long double , long double ); N_ARMDEFLD1P(frexp, int*) __attribute__((__nonnull__(2))); X__declspec(__nothrow) long double frexpl(long double , int* ) __attribute__((__nonnull__(2))); N_ARMDEFLD1P(ldexp, int); X__declspec(__nothrow) long double ldexpl(long double , int ); N_ARMDEFLD1(log); X__declspec(__nothrow) long double logl(long double ); N_ARMDEFLD1(log10); X__declspec(__nothrow) long double log10l(long double ); N_ARMABI long double modfl(long double /*x*/, long double * /*p*/) __attribute__((__nonnull__(2))); X__declspec(__nothrow) long double modfl(long double , long double * ) __attribute__((__nonnull__(2))); N_ARMDEFLD2(pow); X__declspec(__nothrow) long double powl(long double , long double ); N_ARMDEFLD1(sin); X__declspec(__nothrow) long double sinl(long double ); N_ARMDEFLD1(sinh); X__declspec(__nothrow) long double sinhl(long double ); N_ARMDEFLD1(sqrt); X__declspec(__nothrow) long double sqrtl(long double ); N_ARMDEFLD1(tan); X__declspec(__nothrow) long double tanl(long double ); N_ARMDEFLD1(tanh); X__declspec(__nothrow) long double tanhl(long double ); N N#if !defined(__STRICT_ANSI__) || defined(__USE_C99_MATH) X#if !0L || 1L N N/* N * C99 float and long double versions of extra-C89 functions. N */ Nextern _ARMABI float acoshf(float /*x*/); Xextern __declspec(__nothrow) float acoshf(float ); N_ARMDEFLD1(acosh); X__declspec(__nothrow) long double acoshl(long double ); Nextern _ARMABI float asinhf(float /*x*/); Xextern __declspec(__nothrow) float asinhf(float ); N_ARMDEFLD1(asinh); X__declspec(__nothrow) long double asinhl(long double ); Nextern _ARMABI float atanhf(float /*x*/); Xextern __declspec(__nothrow) float atanhf(float ); N_ARMDEFLD1(atanh); X__declspec(__nothrow) long double atanhl(long double ); N_ARMDEFLD2(copysign); X__declspec(__nothrow) long double copysignl(long double , long double ); Nextern _ARMABI float cbrtf(float /*x*/); Xextern __declspec(__nothrow) float cbrtf(float ); N_ARMDEFLD1(cbrt); X__declspec(__nothrow) long double cbrtl(long double ); Nextern _ARMABI float erff(float /*x*/); Xextern __declspec(__nothrow) float erff(float ); N_ARMDEFLD1(erf); X__declspec(__nothrow) long double erfl(long double ); Nextern _ARMABI float erfcf(float /*x*/); Xextern __declspec(__nothrow) float erfcf(float ); N_ARMDEFLD1(erfc); X__declspec(__nothrow) long double erfcl(long double ); Nextern _ARMABI float expm1f(float /*x*/); Xextern __declspec(__nothrow) float expm1f(float ); N_ARMDEFLD1(expm1); X__declspec(__nothrow) long double expm1l(long double ); Nextern _ARMABI float log1pf(float /*x*/); Xextern __declspec(__nothrow) float log1pf(float ); N_ARMDEFLD1(log1p); X__declspec(__nothrow) long double log1pl(long double ); Nextern _ARMABI float hypotf(float /*x*/, float /*y*/); Xextern __declspec(__nothrow) float hypotf(float , float ); N_ARMDEFLD2(hypot); X__declspec(__nothrow) long double hypotl(long double , long double ); Nextern _ARMABI float lgammaf(float /*x*/); Xextern __declspec(__nothrow) float lgammaf(float ); N_ARMDEFLD1(lgamma); X__declspec(__nothrow) long double lgammal(long double ); Nextern _ARMABI float remainderf(float /*x*/, float /*y*/); Xextern __declspec(__nothrow) float remainderf(float , float ); N_ARMDEFLD2(remainder); X__declspec(__nothrow) long double remainderl(long double , long double ); Nextern _ARMABI float rintf(float /*x*/); Xextern __declspec(__nothrow) float rintf(float ); N_ARMDEFLD1(rint); X__declspec(__nothrow) long double rintl(long double ); N N#endif N N#if (defined(__clang__) && !defined(__STRICT_ANSI)) || defined(__USE_C99_MATH) X#if (0L && !0L) || 1L N/* N * Functions new in C99. N */ Nextern _ARMABI double exp2(double /*x*/); /* * 2.^x. */ Xextern __declspec(__nothrow) double exp2(double ); Nextern _ARMABI float exp2f(float /*x*/); Xextern __declspec(__nothrow) float exp2f(float ); N_ARMDEFLD1(exp2); X__declspec(__nothrow) long double exp2l(long double ); Nextern _ARMABI double fdim(double /*x*/, double /*y*/); Xextern __declspec(__nothrow) double fdim(double , double ); Nextern _ARMABI float fdimf(float /*x*/, float /*y*/); Xextern __declspec(__nothrow) float fdimf(float , float ); N_ARMDEFLD2(fdim); X__declspec(__nothrow) long double fdiml(long double , long double ); N#ifdef __FP_FAST_FMA S#define FP_FAST_FMA N#endif N#ifdef __FP_FAST_FMAF S#define FP_FAST_FMAF N#endif N#ifdef __FP_FAST_FMAL S#define FP_FAST_FMAL N#endif Nextern _ARMABI double fma(double /*x*/, double /*y*/, double /*z*/); Xextern __declspec(__nothrow) double fma(double , double , double ); Nextern _ARMABI float fmaf(float /*x*/, float /*y*/, float /*z*/); Xextern __declspec(__nothrow) float fmaf(float , float , float ); N#ifdef __HAVE_LONGDOUBLE N_ARMABI_INLINE _ARMABI long double fmal(long double __x, long double __y, long double __z) \ N { return (long double)fma((double)__x, (double)__y, (double)__z); } Xstatic __inline __declspec(__nothrow) long double fmal(long double __x, long double __y, long double __z) { return (long double)fma((double)__x, (double)__y, (double)__z); } N#endif Nextern _ARMABI_FPEXCEPT double fmax(double /*x*/, double /*y*/); Xextern __declspec(__nothrow) __attribute__((const)) double fmax(double , double ); Nextern _ARMABI_FPEXCEPT float fmaxf(float /*x*/, float /*y*/); Xextern __declspec(__nothrow) __attribute__((const)) float fmaxf(float , float ); N_ARMDEFLD2(fmax); X__declspec(__nothrow) long double fmaxl(long double , long double ); Nextern _ARMABI_FPEXCEPT double fmin(double /*x*/, double /*y*/); Xextern __declspec(__nothrow) __attribute__((const)) double fmin(double , double ); Nextern _ARMABI_FPEXCEPT float fminf(float /*x*/, float /*y*/); Xextern __declspec(__nothrow) __attribute__((const)) float fminf(float , float ); N_ARMDEFLD2(fmin); X__declspec(__nothrow) long double fminl(long double , long double ); Nextern _ARMABI double log2(double /*x*/); /* * log base 2 of x. */ Xextern __declspec(__nothrow) double log2(double ); Nextern _ARMABI float log2f(float /*x*/); Xextern __declspec(__nothrow) float log2f(float ); N_ARMDEFLD1(log2); X__declspec(__nothrow) long double log2l(long double ); Nextern _ARMABI long lrint(double /*x*/); Xextern __declspec(__nothrow) long lrint(double ); Nextern _ARMABI long lrintf(float /*x*/); Xextern __declspec(__nothrow) long lrintf(float ); N#ifdef __HAVE_LONGDOUBLE N_ARMABI_INLINE _ARMABI long lrintl(long double __x) \ N { return lrint((double)__x); } Xstatic __inline __declspec(__nothrow) long lrintl(long double __x) { return lrint((double)__x); } N#endif Nextern _ARMABI __LONGLONG llrint(double /*x*/); Xextern __declspec(__nothrow) long long llrint(double ); Nextern _ARMABI __LONGLONG llrintf(float /*x*/); Xextern __declspec(__nothrow) long long llrintf(float ); N#ifdef __HAVE_LONGDOUBLE N_ARMABI_INLINE _ARMABI __LONGLONG llrintl(long double __x) \ N { return llrint((double)__x); } Xstatic __inline __declspec(__nothrow) long long llrintl(long double __x) { return llrint((double)__x); } N#endif Nextern _ARMABI long lround(double /*x*/); Xextern __declspec(__nothrow) long lround(double ); Nextern _ARMABI long lroundf(float /*x*/); Xextern __declspec(__nothrow) long lroundf(float ); N#ifdef __HAVE_LONGDOUBLE N_ARMABI_INLINE _ARMABI long lroundl(long double __x) \ N { return lround((double)__x); } Xstatic __inline __declspec(__nothrow) long lroundl(long double __x) { return lround((double)__x); } N#endif Nextern _ARMABI __LONGLONG llround(double /*x*/); Xextern __declspec(__nothrow) long long llround(double ); Nextern _ARMABI __LONGLONG llroundf(float /*x*/); Xextern __declspec(__nothrow) long long llroundf(float ); N#ifdef __HAVE_LONGDOUBLE N_ARMABI_INLINE _ARMABI __LONGLONG llroundl(long double __x) \ N { return llround((double)__x); } Xstatic __inline __declspec(__nothrow) long long llroundl(long double __x) { return llround((double)__x); } N#endif Nextern _ARMABI_PURE double nan(const char */*tagp*/); Xextern __declspec(__nothrow) __attribute__((const)) double nan(const char * ); Nextern _ARMABI_PURE float nanf(const char */*tagp*/); Xextern __declspec(__nothrow) __attribute__((const)) float nanf(const char * ); N#ifdef __HAVE_LONGDOUBLE N_ARMABI_INLINE _ARMABI_PURE long double nanl(const char *__t) \ N { return (long double)nan(__t); } Xstatic __inline __declspec(__nothrow) __attribute__((const)) long double nanl(const char *__t) { return (long double)nan(__t); } N#endif N#if defined(_WANT_SNAN) && defined(__SUPPORT_SNAN__) X#if 0L && 0L Sextern _ARMABI_PURE double nans(const char */*tagp*/); Sextern _ARMABI_PURE float nansf(const char */*tagp*/); S#ifdef __HAVE_LONGDOUBLE S_ARMABI_INLINE _ARMABI_FPEXCEPT long double nansl(const char *__t) \ S { return (long double)nans(__t); } X_ARMABI_INLINE _ARMABI_FPEXCEPT long double nansl(const char *__t) { return (long double)nans(__t); } S#endif N#endif Nextern _ARMABI_FPEXCEPT double nearbyint(double /*x*/); Xextern __declspec(__nothrow) __attribute__((const)) double nearbyint(double ); Nextern _ARMABI_FPEXCEPT float nearbyintf(float /*x*/); Xextern __declspec(__nothrow) __attribute__((const)) float nearbyintf(float ); N_ARMDEFLD1(nearbyint); X__declspec(__nothrow) long double nearbyintl(long double ); Nextern double remquo(double /*x*/, double /*y*/, int */*quo*/); Nextern float remquof(float /*x*/, float /*y*/, int */*quo*/); N#ifdef __HAVE_LONGDOUBLE N_ARMABI_INLINE long double remquol(long double __x, long double __y, int *__q) \ N { return (long double)remquo((double)__x, (double)__y, __q); } Xstatic __inline long double remquol(long double __x, long double __y, int *__q) { return (long double)remquo((double)__x, (double)__y, __q); } N#endif Nextern _ARMABI_FPEXCEPT double round(double /*x*/); Xextern __declspec(__nothrow) __attribute__((const)) double round(double ); Nextern _ARMABI_FPEXCEPT float roundf(float /*x*/); Xextern __declspec(__nothrow) __attribute__((const)) float roundf(float ); N_ARMDEFLD1(round); X__declspec(__nothrow) long double roundl(long double ); Nextern _ARMABI double tgamma(double /*x*/); /* * The gamma function of x. */ Xextern __declspec(__nothrow) double tgamma(double ); Nextern _ARMABI float tgammaf(float /*x*/); Xextern __declspec(__nothrow) float tgammaf(float ); N_ARMDEFLD1(tgamma); X__declspec(__nothrow) long double tgammal(long double ); Nextern _ARMABI_FPEXCEPT double trunc(double /*x*/); Xextern __declspec(__nothrow) __attribute__((const)) double trunc(double ); Nextern _ARMABI_FPEXCEPT float truncf(float /*x*/); Xextern __declspec(__nothrow) __attribute__((const)) float truncf(float ); N_ARMDEFLD1(trunc); X__declspec(__nothrow) long double truncl(long double ); N#endif N N#undef _ARMDEFLD1 N#undef _ARMDEFLD1P N#undef _ARMDEFLD2 N N#if defined(__cplusplus) && ((!defined(__STRICT_ANSI__) || defined(__USE_C99_MATH)) || defined(__ARMCOMPILER_LIBCXX)) X#if 0L && ((!0L || 1L) || 0L) S extern "C++" { S inline int (fpclassify)(double __x) { return fpclassify(__x); } S inline bool (isfinite)(double __x) { return isfinite(__x); } S inline bool (isgreater)(double __x, double __y) { return isgreater(__x, __y); } S inline bool (isgreaterequal)(double __x, double __y) { return isgreaterequal(__x, __y); } S inline bool (isinf)(double __x) { return isinf(__x); } S inline bool (isless)(double __x, double __y) { return isless(__x, __y); } S inline bool (islessequal)(double __x, double __y) { return islessequal(__x, __y); } S inline bool (islessgreater)(double __x, double __y) { return islessgreater(__x, __y); } S inline bool (isnan)(double __x) { return isnan(__x); } S inline bool (isnormal)(double __x) { return isnormal(__x); } S inline bool (isunordered)(double __x, double __y) { return isunordered(__x, __y); } S S } N#endif N N#if defined(__cplusplus) && !defined(__ARMCOMPILER_LIBCXX) X#if 0L && !0L S extern "C++" { S inline float abs(float __x) { return fabsf(__x); } S inline float acos(float __x) { return acosf(__x); } S inline float asin(float __x) { return asinf(__x); } S inline float atan(float __x) { return atanf(__x); } S inline float atan2(float __y, float __x) { return atan2f(__y,__x); } S inline float ceil(float __x) { return ceilf(__x); } S inline float cos(float __x) { return cosf(__x); } S inline float cosh(float __x) { return coshf(__x); } S inline float exp(float __x) { return expf(__x); } S inline float fabs(float __x) { return fabsf(__x); } S inline float floor(float __x) { return floorf(__x); } S inline float fmod(float __x, float __y) { return fmodf(__x, __y); } S float frexp(float __x, int* __exp) __attribute__((__nonnull__(2))); S inline float frexp(float __x, int* __exp) { return frexpf(__x, __exp); } S inline float ldexp(float __x, int __exp) { return ldexpf(__x, __exp);} S inline float log(float __x) { return logf(__x); } S inline float log10(float __x) { return log10f(__x); } S float modf(float __x, float* __iptr) __attribute__((__nonnull__(2))); S inline float modf(float __x, float* __iptr) { return modff(__x, __iptr); } S inline float pow(float __x, float __y) { return powf(__x,__y); } S inline float pow(float __x, int __y) { return powf(__x, (float)__y); } S inline float sin(float __x) { return sinf(__x); } S inline float sinh(float __x) { return sinhf(__x); } S inline float sqrt(float __x) { return sqrtf(__x); } S inline float _sqrt(float __x) { return _sqrtf(__x); } S inline float tan(float __x) { return tanf(__x); } S inline float tanh(float __x) { return tanhf(__x); } S S inline double abs(double __x) { return fabs(__x); } S inline double pow(double __x, int __y) S { return pow(__x, (double) __y); } S S#ifdef __HAVE_LONGDOUBLE S inline long double abs(long double __x) S { return (long double)fabsl(__x); } S inline long double acos(long double __x) S { return (long double)acosl(__x); } S inline long double asin(long double __x) S { return (long double)asinl(__x); } S inline long double atan(long double __x) S { return (long double)atanl(__x); } S inline long double atan2(long double __y, long double __x) S { return (long double)atan2l(__y, __x); } S inline long double ceil(long double __x) S { return (long double)ceill( __x); } S inline long double cos(long double __x) S { return (long double)cosl(__x); } S inline long double cosh(long double __x) S { return (long double)coshl(__x); } S inline long double exp(long double __x) S { return (long double)expl(__x); } S inline long double fabs(long double __x) S { return (long double)fabsl(__x); } S inline long double floor(long double __x) S { return (long double)floorl(__x); } S inline long double fmod(long double __x, long double __y) S { return (long double)fmodl(__x, __y); } S long double frexp(long double __x, int* __p) __attribute__((__nonnull__(2))); S inline long double frexp(long double __x, int* __p) S { return (long double)frexpl(__x, __p); } S inline long double ldexp(long double __x, int __exp) S { return (long double)ldexpl(__x, __exp); } S inline long double log(long double __x) S { return (long double)logl(__x); } S inline long double log10(long double __x) S { return (long double)log10l(__x); } S long double modf(long double __x, long double* __p) __attribute__((__nonnull__(2))); S inline long double modf(long double __x, long double* __p) S { return (long double)modfl(__x, __p); } S inline long double pow(long double __x, long double __y) S { return (long double)powl(__x, __y); } S inline long double pow(long double __x, int __y) S { return (long double)powl(__x, __y); } S inline long double sin(long double __x) S { return (long double)sinl(__x); } S inline long double sinh(long double __x) S { return (long double)sinhl(__x); } S inline long double sqrt(long double __x) S { return (long double)sqrtl(__x); } S inline long double _sqrt(long double __x) S { return (long double)_sqrt((double) __x); } S inline long double tan(long double __x) S { return (long double)tanl(__x); } S inline long double tanh(long double __x) S { return (long double)tanhl(__x); } S#endif S S#if !defined(__STRICT_ANSI__) || defined(__USE_C99_MATH) S inline float acosh(float __x) { return acoshf(__x); } S inline float asinh(float __x) { return asinhf(__x); } S inline float atanh(float __x) { return atanhf(__x); } S inline float cbrt(float __x) { return cbrtf(__x); } S inline float erf(float __x) { return erff(__x); } S inline float erfc(float __x) { return erfcf(__x); } S inline float expm1(float __x) { return expm1f(__x); } S inline float log1p(float __x) { return log1pf(__x); } S inline float hypot(float __x, float __y) { return hypotf(__x, __y); } S inline float lgamma(float __x) { return lgammaf(__x); } S inline float remainder(float __x, float __y) { return remainderf(__x, __y); } S inline float rint(float __x) { return rintf(__x); } S#endif S S#ifdef __USE_C99_MATH S inline float exp2(float __x) { return exp2f(__x); } S inline float fdim(float __x, float __y) { return fdimf(__x, __y); } S inline float fma(float __x, float __y, float __z) { return fmaf(__x, __y, __z); } S inline float fmax(float __x, float __y) { return fmaxf(__x, __y); } S inline float fmin(float __x, float __y) { return fminf(__x, __y); } S inline float log2(float __x) { return log2f(__x); } S inline _ARMABI long lrint(float __x) { return lrintf(__x); } S inline _ARMABI __LONGLONG llrint(float __x) { return llrintf(__x); } S inline _ARMABI long lround(float __x) { return lroundf(__x); } S inline _ARMABI __LONGLONG llround(float __x) { return llroundf(__x); } S inline _ARMABI_FPEXCEPT float nearbyint(float __x) { return nearbyintf(__x); } S inline float remquo(float __x, float __y, int *__q) { return remquof(__x, __y, __q); } S inline _ARMABI_FPEXCEPT float round(float __x) { return roundf(__x); } S inline float tgamma(float __x) { return tgammaf(__x); } S inline _ARMABI_FPEXCEPT float trunc(float __x) { return truncf(__x); } S S inline int (fpclassify)(float __x) { return fpclassify(__x); } S inline bool (isfinite)(float __x) { return isfinite(__x); } S inline bool (isgreater)(float __x, float __y) { return isgreater(__x, __y); } S inline bool (isgreaterequal)(float __x, float __y) { return isgreaterequal(__x, __y); } S inline bool (isinf)(float __x) { return isinf(__x); } S inline bool (isless)(float __x, float __y) { return isless(__x, __y); } S inline bool (islessequal)(float __x, float __y) { return islessequal(__x, __y); } S inline bool (islessgreater)(float __x, float __y) { return islessgreater(__x, __y); } S inline bool (isnan)(float __x) { return isnan(__x); } S inline bool (isnormal)(float __x) { return isnormal(__x); } S inline bool (isunordered)(float __x, float __y) { return isunordered(__x, __y); } S S#ifdef __HAVE_LONGDOUBLE S inline long double acosh(long double __x) { return acoshl(__x); } S inline long double asinh(long double __x) { return asinhl(__x); } S inline long double atanh(long double __x) { return atanhl(__x); } S inline long double cbrt(long double __x) { return cbrtl(__x); } S inline long double erf(long double __x) { return erfl(__x); } S inline long double erfc(long double __x) { return erfcl(__x); } S inline long double expm1(long double __x) { return expm1l(__x); } S inline long double log1p(long double __x) { return log1pl(__x); } S inline long double hypot(long double __x, long double __y) { return hypotl(__x, __y); } S inline long double lgamma(long double __x) { return lgammal(__x); } S inline long double remainder(long double __x, long double __y) { return remainderl(__x, __y); } S inline long double rint(long double __x) { return rintl(__x); } S inline long double exp2(long double __x) { return exp2l(__x); } S inline long double fdim(long double __x, long double __y) { return fdiml(__x, __y); } S inline long double fma(long double __x, long double __y, long double __z) { return fmal(__x, __y, __z); } S inline long double fmax(long double __x, long double __y) { return fmaxl(__x, __y); } S inline long double fmin(long double __x, long double __y) { return fminl(__x, __y); } S inline long double log2(long double __x) { return log2l(__x); } S inline _ARMABI long lrint(long double __x) { return lrintl(__x); } S inline _ARMABI __LONGLONG llrint(long double __x) { return llrintl(__x); } S inline _ARMABI long lround(long double __x) { return lroundl(__x); } S inline _ARMABI __LONGLONG llround(long double __x) { return llroundl(__x); } S inline _ARMABI_FPEXCEPT long double nearbyint(long double __x) { return nearbyintl(__x); } S inline long double remquo(long double __x, long double __y, int *__q) { return remquol(__x, __y, __q); } S inline _ARMABI_FPEXCEPT long double round(long double __x) { return roundl(__x); } S inline long double tgamma(long double __x) { return tgammal(__x); } S inline _ARMABI_FPEXCEPT long double trunc(long double __x) { return truncl(__x); } S inline int (fpclassify)(long double __x) { return fpclassify(__x); } S inline bool (isfinite)(long double __x) { return isfinite(__x); } S inline bool (isgreater)(long double __x, long double __y) { return isgreater(__x, __y); } S inline bool (isgreaterequal)(long double __x, long double __y) { return isgreaterequal(__x, __y); } S inline bool (isinf)(long double __x) { return isinf(__x); } S inline bool (isless)(long double __x, long double __y) { return isless(__x, __y); } S inline bool (islessequal)(long double __x, long double __y) { return islessequal(__x, __y); } S inline bool (islessgreater)(long double __x, long double __y) { return islessgreater(__x, __y); } S inline bool (isnan)(long double __x) { return isnan(__x); } S inline bool (isnormal)(long double __x) { return isnormal(__x); } S inline bool (isunordered)(long double __x, long double __y) { return isunordered(__x, __y); } S#endif S S#undef fpclassify S#undef isfinite S#undef isgreater S#undef isgreaterequal S#undef isinf S#undef isless S#undef islessequal S#undef islessgreater S#undef isnan S#undef isnormal S#undef isunordered S S#endif S S } N#endif N N #ifdef __cplusplus S } /* extern "C" */ S } /* namespace std */ N #endif N #endif /* __MATH_DECLS */ N N #if _AEABI_PORTABILITY_LEVEL != 0 && !defined _AEABI_PORTABLE X #if _AEABI_PORTABILITY_LEVEL != 0 && !0L S #define _AEABI_PORTABLE N #endif N N #if defined(__cplusplus) && !defined(__MATH_NO_EXPORTS) X #if 0L && !0L S using ::std::__use_accurate_range_reduction; S #ifndef __ARMCOMPILER_LIBCXX S using ::std::abs; S #endif S using ::std::acos; S using ::std::asin; S using ::std::atan2; S using ::std::atan; S using ::std::ceil; S using ::std::cos; S using ::std::cosh; S using ::std::exp; S using ::std::fabs; S using ::std::floor; S using ::std::fmod; S using ::std::frexp; S using ::std::ldexp; S using ::std::log10; S using ::std::log; S using ::std::modf; S using ::std::pow; S using ::std::sin; S using ::std::sinh; S using ::std::sqrt; S using ::std::_sqrt; S using ::std::_sqrtf; S using ::std::tan; S using ::std::tanh; S using ::std::_fabsf; S /* C99 float and long double versions in already-C89-reserved namespace */ S using ::std::acosf; S using ::std::acosl; S using ::std::asinf; S using ::std::asinl; S using ::std::atan2f; S using ::std::atan2l; S using ::std::atanf; S using ::std::atanl; S using ::std::ceilf; S using ::std::ceill; S using ::std::cosf; S using ::std::coshf; S using ::std::coshl; S using ::std::cosl; S using ::std::expf; S using ::std::expl; S using ::std::fabsf; S using ::std::fabsl; S using ::std::floorf; S using ::std::floorl; S using ::std::fmodf; S using ::std::fmodl; S using ::std::frexpf; S using ::std::frexpl; S using ::std::ldexpf; S using ::std::ldexpl; S using ::std::log10f; S using ::std::log10l; S using ::std::logf; S using ::std::logl; S using ::std::modff; S using ::std::modfl; S using ::std::powf; S using ::std::powl; S using ::std::sinf; S using ::std::sinhf; S using ::std::sinhl; S using ::std::sinl; S using ::std::sqrtf; S using ::std::sqrtl; S using ::std::tanf; S using ::std::tanhf; S using ::std::tanhl; S using ::std::tanl; S #if !defined(__STRICT_ANSI__) || defined(__USE_C99_MATH) S /* C99 additions which for historical reasons appear in non-strict mode */ S using ::std::acosh; S using ::std::asinh; S using ::std::atanh; S using ::std::cbrt; S using ::std::copysign; S using ::std::copysignf; S using ::std::erf; S using ::std::erfc; S using ::std::expm1; S using ::std::hypot; S using ::std::ilogb; S using ::std::ilogbf; S using ::std::ilogbl; S using ::std::lgamma; S using ::std::log1p; S using ::std::logb; S using ::std::logbf; S using ::std::logbl; S using ::std::nextafter; S using ::std::nextafterf; S using ::std::nextafterl; S using ::std::nexttoward; S using ::std::nexttowardf; S using ::std::nexttowardl; S using ::std::remainder; S using ::std::rint; S using ::std::scalbln; S using ::std::scalblnf; S using ::std::scalblnl; S using ::std::scalbn; S using ::std::scalbnf; S using ::std::scalbnl; S using ::std::math_errhandling; S using ::std::acoshf; S using ::std::acoshl; S using ::std::asinhf; S using ::std::asinhl; S using ::std::atanhf; S using ::std::atanhl; S using ::std::copysignl; S using ::std::cbrtf; S using ::std::cbrtl; S using ::std::erff; S using ::std::erfl; S using ::std::erfcf; S using ::std::erfcl; S using ::std::expm1f; S using ::std::expm1l; S using ::std::log1pf; S using ::std::log1pl; S using ::std::hypotf; S using ::std::hypotl; S using ::std::lgammaf; S using ::std::lgammal; S using ::std::remainderf; S using ::std::remainderl; S using ::std::rintf; S using ::std::rintl; S /* New in C99. */ S using ::std::float_t; S using ::std::double_t; S #endif S #if (defined(__clang__) && !defined(__STRICT_ANSI)) || defined(__USE_C99_MATH) S /* Functions new in C99. */ S using ::std::exp2; S using ::std::exp2f; S using ::std::exp2l; S using ::std::fdim; S using ::std::fdimf; S using ::std::fdiml; S using ::std::fma; S using ::std::fmaf; S#ifdef __HAVE_LONGDOUBLE S using ::std::fmal; S#endif S using ::std::fmax; S using ::std::fmaxf; S using ::std::fmaxl; S using ::std::fmin; S using ::std::fminf; S using ::std::fminl; S using ::std::log2; S using ::std::log2f; S using ::std::log2l; S using ::std::lrint; S using ::std::lrintf; S#ifdef __HAVE_LONGDOUBLE S using ::std::lrintl; S#endif S using ::std::llrint; S using ::std::llrintf; S#ifdef __HAVE_LONGDOUBLE S using ::std::llrintl; S#endif S using ::std::lround; S using ::std::lroundf; S#ifdef __HAVE_LONGDOUBLE S using ::std::lroundl; S#endif S using ::std::llround; S using ::std::llroundf; S#ifdef __HAVE_LONGDOUBLE S using ::std::llroundl; S#endif S using ::std::nan; S using ::std::nanf; S#ifdef __HAVE_LONGDOUBLE S using ::std::nanl; S#endif S using ::std::nearbyint; S using ::std::nearbyintf; S using ::std::nearbyintl; S using ::std::remquo; S using ::std::remquof; S#ifdef __HAVE_LONGDOUBLE S using ::std::remquol; S#endif S using ::std::round; S using ::std::roundf; S using ::std::roundl; S using ::std::tgamma; S using ::std::tgammaf; S using ::std::tgammal; S using ::std::trunc; S using ::std::truncf; S using ::std::truncl; S #endif S S #if !defined(__STRICT_ANSI__) || defined(__USE_C99_MATH) S using ::std::fpclassify; S using ::std::isfinite; S using ::std::isgreater; S using ::std::isgreaterequal; S using ::std::isinf; S using ::std::isless; S using ::std::islessequal; S using ::std::islessgreater; S using ::std::isnan; S using ::std::isnormal; S using ::std::isunordered; S #endif N #endif N N#undef __LONGLONG N N#endif /* __math_h */ N N/* end of math.h */ L 19 "..\src\common\tau_common.h" 2 N N/******************************************************************************* N* 2.Global constant and macro definitions using #define N*******************************************************************************/ N/** N * \name ͨó N * @{ N */ N//#define ENABLE 1 N//#define DISABLE 0 N N#define ON 1 N#define OFF 0 N N#define NONE 0 N#define EOS '\0' N N/* N#ifndef TRUE N#define TRUE 1 N#endif N N#ifndef FALSE N#define FALSE 0 N#endif N*/ N N#ifndef __cplusplus N #define true 1 N #define false 0 N #define bool _Bool N#endif /* ifndef __cplusplus */ N N#ifndef NULL S #define NULL ((void *)0) N#endif N N#define TAU_LITTLE_ENDIAN 1234 /**< \brief Сģʽ */ N#define TAU_BIG_ENDIAN 3412 /**< \brief ģʽ */ N N/** @} */ N N/******************************************************************************/ N N/** N * \name ú궨 N * @{ N */ N N#ifdef __cplusplus S #define __I volatile /*!< Defines 'read only' permissions */ N#else N #define __I volatile const /*!< Defines 'read only' permissions */ N#endif N#define __O volatile /*!< Defines 'write only' permissions */ N#define __IO volatile /*!< Defines 'read / write' permissions */ N N#define TAU_INLINE inline N#define TAU_STATIC_INLINE static inline N#define TAU_STATIC static N#define TAU_CONST const N#define TAU_EXTERN extern N N#define MIN(x, y) (((x) < (y)) ? (x) : (y)) N#define MAX(x, y) (((x) > (y)) ? (x) : (y)) N N/** N * \brief ṹԱƫ N * \attention ͬƽ̨ϣڳԱСڴԭ N * ͬһṹԱƫƿDzһ N * N * \par ʾ N * \code N * struct my_struct { N * int m1; N * char m2; N * }; N * int offset_m2; N * N * offset_m2 = TAU_OFFSET(struct my_struct, m2); N * \endcode N */ N#define TAU_OFFSET(structure, member) ((uint32_t)(&(((structure *)0)->member))) N N/** @} */ N N/** N * \brief ͨṹԱָȡýṹԱĽṹ N * N * \param ptr ָṹԱָ N * \param type ṹ N * \param member ṹиóԱ N * N * \par ʾ N * \code N * struct my_struct = { N * int m1; N * char m2; N * }; N * struct my_struct my_st; N * char *p_m2 = &my_st.m2; N * struct my_struct *p_st = TAU_CONTAINER_OF(p_m2, struct my_struct, m2); N * \endcode N */ N#define TAU_CONTAINER_OF(ptr, type, member) \ N ((type *)((char *)(ptr)-TAU_OFFSET(type, member))) X#define TAU_CONTAINER_OF(ptr, type, member) ((type *)((char *)(ptr)-TAU_OFFSET(type, member))) N N/** N * \brief ṹԱĴС N * N * \code N * struct a = { N * uint32_t m1; N * uint32_t m2; N * }; N * int size_m2; N * N * size_m2 = TAU_MEMBER_SIZE(a, m2); //size_m2 = 4 N * \endcode N */ N#define TAU_MEMBER_SIZE(structure, member) (sizeof(((structure *)0)->member)) N N/** N * \brief Ԫظ N * N * \code N * int a[] = {0, 1, 2, 3}; N * int element_a = TAU_NELEMENTS(a); // element_a = 4 N * \endcode N */ N#define TAU_NELEMENTS(array) (sizeof(array) / sizeof((array)[0])) N N/** N * \brief N * N * \param x N * \param align N * N * \code N * int size = TAU_ROUND_UP(15, 4); // size = 16 N * \endcode N */ N#define TAU_ROUND_UP(x, align) (((int)(x)/(align))*(align) + (((int)(x)%(align)) ? (align) : 0)) N N/** N * \brief N * N * \param x N * \param align N * N * \code N * int size = TAU_ROUND_DOWN(15, 4); // size = 12 N * \endcode N */ N#define TAU_ROUND_DOWN(x, align) (((int)(x)/(align))*(align)) N N/** \brief */ N#define TAU_DIV_ROUND_UP(n, d) (((n) + (d)-1) / (d)) N N/** N * \brief Ƿ N * N * \param x N * \param align أΪ2ij˷ N * N * \code N * if (TAU_ALIGNED(x, 4) { N * ; // x N * } else { N * ; // x N * } N * \endcode N */ N#define TAU_ALIGNED(x, align) (((int)(x) & (align - 1)) == 0) N N/** \brief 1ֽBCDתΪ16 */ N#define TAU_BCD_TO_HEX(val) (((val)&0x0f) + ((val) >> 4) * 10) N N/** \brief 1ֽ16תΪBCD */ N#define TAU_HEX_TO_BCD(val) ((((val) / 10) << 4) + (val) % 10) N N/** N * \brief ȡ N */ N#define TAU_CEIL(val) ceil(val) N N N/*! @brief Construct the version number for drivers. */ N#define MAKE_VERSION(major, minor, bugfix) (((major) << 16) | ((minor) << 8) | (bugfix)) N N N/******************************************************************************* N* 3.Global structures, unions and enumerations using typedef N*******************************************************************************/ N/* \brief ͨûصָ붨 */ Ntypedef void (*fcb_type)(void *data); N N#endif /* __TAU_COMMON_H */ L 21 "..\src\common\tau_device_datatype.h" 2 N N/******************************************************************************* N* 2.Global constant and macro definitions using #define N*******************************************************************************/ N N/******************************************************************************* N* 3.Global structures, unions and enumerations using typedef N*******************************************************************************/ N/*! @brief ״̬ */ N#define MAKE_STATUS(group, code) ((((group)*100) + (code))) N N/******************************************************************************* N* 3.Global structures, unions and enumerations using typedef N*******************************************************************************/ N/*! @brief ״ֵ̬ */ Nenum _status_groups N{ N STATUS_GROUP_GENERIC = 0, N STATUS_GROUP_I2C = 1, N STATUS_GROUP_UART = 2, N STATUS_GROUP_SPI = 3, N kStatusGroup_Timer = 4, N}; N N/*! @brief ״̬ */ Nenum _generic_status N{ N STATUS_SUCCESS = MAKE_STATUS(STATUS_GROUP_GENERIC, 0), X STATUS_SUCCESS = ((((STATUS_GROUP_GENERIC)*100) + (0))), N STATUS_FAIL = MAKE_STATUS(STATUS_GROUP_GENERIC, 1), X STATUS_FAIL = ((((STATUS_GROUP_GENERIC)*100) + (1))), N STATUS_READ_ONLY = MAKE_STATUS(STATUS_GROUP_GENERIC, 2), X STATUS_READ_ONLY = ((((STATUS_GROUP_GENERIC)*100) + (2))), N STATUS_OUT_OF_RANGE = MAKE_STATUS(STATUS_GROUP_GENERIC, 3), X STATUS_OUT_OF_RANGE = ((((STATUS_GROUP_GENERIC)*100) + (3))), N STATUS_INVALID_ARGUMENT = MAKE_STATUS(STATUS_GROUP_GENERIC, 4), X STATUS_INVALID_ARGUMENT = ((((STATUS_GROUP_GENERIC)*100) + (4))), N STATUS_TIME_OUT = MAKE_STATUS(STATUS_GROUP_GENERIC, 5), X STATUS_TIME_OUT = ((((STATUS_GROUP_GENERIC)*100) + (5))), N STATUS_NO_TRANSFER_IN_PROGRESS = MAKE_STATUS(STATUS_GROUP_GENERIC, 6), X STATUS_NO_TRANSFER_IN_PROGRESS = ((((STATUS_GROUP_GENERIC)*100) + (6))), N}; N N/*! N * @brief timer״̬ N */ Ntypedef enum N{ N TIMER_STATUS_IDLE = MAKE_STATUS(kStatusGroup_Timer, 0), /*!< */ X TIMER_STATUS_IDLE = ((((kStatusGroup_Timer)*100) + (0))), N TIMER_STATUS_RUNNING = MAKE_STATUS(kStatusGroup_Timer, 1), /*!< */ X TIMER_STATUS_RUNNING = ((((kStatusGroup_Timer)*100) + (1))), N TIMER_STATUS_TIMEOUT = MAKE_STATUS(kStatusGroup_Timer, 2), /*!< ʱ */ X TIMER_STATUS_TIMEOUT = ((((kStatusGroup_Timer)*100) + (2))), N} timer_status_e; N N/*! N * @brief system¼(ж/λ)ģʽ N */ Ntypedef enum N{ N DETECT_HIGH_LVL = 0, N DETECT_LOW_LVL, N DETECT_RISING_EDGE, N DETECT_FALLING_EDGE N} sys_cfg_trigger_e; N N/** N* @brief GPIO interrupt type N*/ Ntypedef enum N{ N TIMER_NUM0 = 0, N TIMER_NUM1, N TIMER_NUM2, N TIMER_NUM3, N TIMER_NUM_MAX N} timer_num_e; N N/** N* @brief GPIO interrupt type N*/ Ntypedef enum N{ N GPIO_INT_EXTI_INT0 = 0, N GPIO_INT_EXTI_INT1, N GPIO_INT_EXTI_INT2, N GPIO_INT_EXTI_INT3, N GPIO_INT_EXTI_INT4, N GPIO_INT_EXTI_INT5, N GPIO_INT_EXTI_INT6, N GPIO_INT_EXTI_INT7, N GPIO_INT_MAX N} gpio_int_e; N N/*! @brief PWMIж */ Ntypedef enum _pwm_int_type N{ N PWM_INT_HIGH_OVERFLOW = 0, N PWM_INT_LOW_OVERFLOW, N PWM_INT_TOTAL_OVERFLOW, N PWM_INT_HIGH_DONE, N PWM_INT_LOW_DONE, N PWM_INT_TOTAL_DONE, N PWM_INT_MAX N} pwm_int_type_e; N N/** N* @brief I2C chose N*/ Ntypedef enum N{ N I2C_SELECT_0 = 0, //slave N I2C_SELECT_1, //master N} i2c_select_e; N N/*! N * @brief ٶ N * @note N */ Ntypedef enum _i2c_rate N{ N I2C_RATE_STANDARD = 1, //100kHz N I2C_RATE_FAST, //400kHz N I2C_RATE_HIGH, //1MHz N} i2c_rate_e; N N/*! @brief DMA channel type */ Ntypedef enum N{ N DMA_CH0 = 0, /*!< SPIM */ N DMA_CH1 = 1, /*!< IIC0 */ N DMA_CH2 = 2, /*!< SPIS */ N DMA_CH3 = 3, /*!< IIC1 */ N DMA_CH4 = 4, /*!< SPI FLASH */ N DMA_CH5 = 5, /*!< UART */ N} dma_channel_e; N N N/*! @brief Type used for all status and error return values. */ N Ntypedef enum N{ N DISABLE = 0, N ENABLE = !DISABLE N} function_state_e; N/*!< @brief ڷ״̬ʹ */ Ntypedef int32_t status_t; N N N N/******************************************************************************* N* 4.Global variable extern declarations N*******************************************************************************/ N N#endif N L 16 "..\src\app\demo\app_tp_for_custom_s8.h" 2 N#include "tau_common.h" N#include "app_tp_transfer.h" L 1 "..\src\app\demo\app_tp_transfer.h" 1 N/******************************************************************************* N* N* N* File: app_tp_transfer.h N* Description touch I2C/SPI ͨغ N* Version V0.1 N* Date 2021-10-14 N* Author zhanghz N*******************************************************************************/ N#ifndef __APP_TP_TRANSFER_H__ N#define __APP_TP_TRANSFER_H__ N N#include "string.h" N#include "tau_device_datatype.h" N#include "tau_common.h" N N#define SCREEN_TRANSFER_WRITE false //յscreen ioжϣ֮ö N#define SCREEN_TRANSFER_READ true //յscreen ioжϣ֮Ҫ N N#define ST_TP_SCAN_POINT_NUMBER_MAX 6 N Ntypedef struct N{ N uint8_t tp_point_buffer[ST_TP_SCAN_POINT_NUMBER_MAX]; // ���յ� TP ���㣬���ڼ�¼������Ϣ X uint8_t tp_point_buffer[6]; N uint8_t tp_read_point_counter; // ͳ�Ʊ�����ֵ N uint8_t tp_point_up_error_flag; // �����ͷ��쳣��־ N uint32_t tp_point_error_time_counter; // ������ʱ�� N} st_tp_scan_data; N N N/************************************************************************** N* @name : ap_tp_calibration N* @brief : ����У׼���� N* @param[in] : N* @return : N* @retval : N**************************************************************************/ Nvoid ap_tp_calibration(void); N N/************************************************************************** N* @name : app_tp_screen_init N* @brief : screen IO 䣬ʼʼ N* @param[in] : N* @return : N* @retval : N**************************************************************************/ Nvoid app_tp_screen_init(void); N N/************************************************************************** N* @name : app_tp_init N* @brief : ʼͨ N* @param[in] : N* @return : N* @retval : N**************************************************************************/ Nvoid app_tp_init(void); N N/************************************************************************** N* @name : app_tp_transfer_screen_int N* @brief : screenжϺ󣬰flowдscreenЭת N* @param[in] : N* @return : N* @retval : N**************************************************************************/ Nvoid app_tp_transfer_screen_int(void); N N/************************************************************************** N* @name : app_tp_transfer_screen_start N* @brief : flowдscreenʼʼ N* @param[in] : N* @return : N* @retval : N**************************************************************************/ Nvoid app_tp_transfer_screen_start(void); N N/************************************************************************** N* @name : app_tp_phone_reset_on N* @brief : ȡֻλźŵ״̬ N* @param[in] : N* @return : N* @retval : N**************************************************************************/ Nbool app_tp_phone_reset_on(void); X_Bool app_tp_phone_reset_on(void); N N/************************************************************************** N* @name : app_tp_phone_clear_reset_on N* @brief : ֻλźŵ״̬ N* @param[in] : N* @return : N* @retval : N**************************************************************************/ Nvoid app_tp_phone_clear_reset_on(void); N N/************************************************************************** N* @name : app_tp_s_write N* @brief : ͨŷʽ÷txbufferе N* @param[in] :txbuffer: buffer ͷַ N* @param[in] :buffer_size: buffer N* @return : N* @retval : N**************************************************************************/ Nvoid app_tp_s_write(const uint8_t *txbuffer, size_t buffer_size); N N/************************************************************************** N* @name : app_tp_enter_sleep_on N* @brief : ȡ tp ͨ״̬ N* @param[in] : N* @return : N* @retval : N**************************************************************************/ Nbool app_tp_enter_sleep_on(void); X_Bool app_tp_enter_sleep_on(void); N N#endif N L 18 "..\src\app\demo\app_tp_for_custom_s8.h" 2 N#include "hal_gpio.h" L 1 "..\src\sdk\include\hal_gpio.h" 1 N/******************************************************************************* N* N* N* File: hal_gpio.h N* Description gpio HALͷļ N* Version V0.1 N* Date 2021-03-17 N* Author wuc N *******************************************************************************/ N#ifndef __HAL_GPIO_H__ N#define __HAL_GPIO_H__ N N/******************************************************************************* N* 1.Included files N*******************************************************************************/ N#include "tau_device_datatype.h" N#include "tau_common.h" N N/******************************************************************************* N* 2.Global constant and macro definitions using #define N*******************************************************************************/ N/** N* @brief GPIO pin N*/ Ntypedef enum N{ N /*GPIOPIN*/ N IO_PAD_GPIO0 = 0, N IO_PAD_GPIO1, N IO_PAD_GPIO2, N IO_PAD_GPIO3, N IO_PAD_GPIO4, N IO_PAD_GPIO5, N IO_PAD_GPIO6, N IO_PAD_RESV, N IO_PAD_GPIO8, N IO_PAD_GPIO9, N IO_PAD_GPIO10, N IO_PAD_GPIO11, N IO_PAD_GPIO12, N IO_PAD_GPIO13, N IO_PAD_GPIO14, N IO_PAD_RESV1, N IO_PAD_RESV2, N IO_PAD_GPIO17, N IO_PAD_GPIO18, N IO_PAD_GPIO19, N IO_PAD_GPIO20, N IO_PAD_GPIO21, N N /*ʵPAD NAMEPIN*/ N IO_PAD_AP_SPIS_MISO = IO_PAD_GPIO0, N IO_PAD_AP_SPIS_MOSI = IO_PAD_GPIO1, N IO_PAD_AP_INT = IO_PAD_GPIO2, N IO_PAD_AP_TE = IO_PAD_GPIO3, N IO_PAD_AP_SWIRE = IO_PAD_GPIO4, N IO_PAD_TD_SPIM_MISO = IO_PAD_GPIO5, N IO_PAD_TD_SPIM_MOSI = IO_PAD_GPIO6, N IO_PAD_TD_RSTN = IO_PAD_RESV, N IO_PAD_TD_TPRSTN = IO_PAD_GPIO8, N IO_PAD_TD_INT = IO_PAD_GPIO9, N IO_PAD_TD_LEDPWM = IO_PAD_GPIO10, N IO_PAD_TD_FC_CLK = IO_PAD_GPIO11, N IO_PAD_TD_FC_CSN = IO_PAD_GPIO12, N IO_PAD_TD_FC_MISO = IO_PAD_GPIO13, N IO_PAD_TD_FC_MOSI = IO_PAD_GPIO14, N IO_PAD_UART_RX = IO_PAD_GPIO17, N IO_PAD_UART_TX = IO_PAD_GPIO18, N IO_PAD_PWMEN = IO_PAD_GPIO19, N IO_PAD_ADCIN = IO_PAD_GPIO20, N IO_PAD_AP_TPRSTN = IO_PAD_GPIO21, N N IO_PAD_AP_SPIS_CLK, N IO_PAD_AP_SPIS_CSN, N IO_PAD_TD_SPIM_CLK, N IO_PAD_TD_SPIM_CSN, N IO_PAD_SFC_CLK, N IO_PAD_SFC_CSN, N IO_PAD_SFC_IO0, N IO_PAD_SFC_IO1, N N IO_PAD_MAX, N N /*ʵBALLPIN*/ N IO_PIN_A1 = IO_PAD_TD_TPRSTN, N IO_PIN_A2 = IO_PAD_TD_FC_CSN, N IO_PIN_A3 = IO_PAD_TD_SPIM_MISO, N IO_PIN_A4 = IO_PAD_TD_SPIM_CLK, N IO_PIN_A5 = IO_PAD_PWMEN, N IO_PIN_A6 = IO_PAD_ADCIN, N IO_PIN_A7 = IO_PAD_AP_INT, N IO_PIN_A8 = IO_PAD_AP_SPIS_MOSI, N IO_PIN_B1 = IO_PAD_TD_FC_CLK, N IO_PIN_B2 = IO_PAD_TD_FC_MISO, N IO_PIN_B3 = IO_PAD_TD_SPIM_MOSI, N IO_PIN_B4 = IO_PAD_TD_SPIM_CSN, N IO_PIN_B5 = IO_PAD_AP_SWIRE, N IO_PIN_B7 = IO_PAD_AP_SPIS_MISO, N IO_PIN_B8 = IO_PAD_AP_SPIS_CSN, N IO_PIN_C1 = IO_PAD_TD_FC_MOSI, N IO_PIN_C2 = IO_PAD_TD_LEDPWM, N IO_PIN_C4 = IO_PAD_UART_TX, N IO_PIN_C5 = IO_PAD_UART_RX, N IO_PIN_C6 = IO_PAD_AP_TE, N IO_PIN_D1 = IO_PAD_TD_RSTN, N IO_PIN_D2 = IO_PAD_TD_INT, N IO_PIN_D7 = IO_PAD_AP_TPRSTN, N IO_PIN_D8 = IO_PAD_AP_SPIS_CLK, N} io_pad_e; N N/** N* @brief PAD_AP_SPIS_CLKѡmode N*/ Ntypedef enum N{ N IO_MODE_JTAG_TCK = 0, N IO_MODE_SPIS_SCLK = 1, N IO_MODE_I2C0_SCL = 3, N} pad_ap_spis_clk_mode_e; N N/** N* @brief PAD_AP_SPIS_CSNѡmode N*/ Ntypedef enum N{ N IO_MODE_JTAG_TRSTN = 0, N IO_MODE_SPIS_CSN = 1, N IO_MODE_I2C0_SDA = 3, N} pad_ap_spis_csn_mode_e; N N/** N* @brief PAD_AP_SPIS_MISOѡmode N*/ Ntypedef enum N{ N IO_MODE_JTAG_TDO = 0, N IO_MODE_SPIS_MISO = 1, N IO_MODE_GPIO0 = 2, N IO_MODE_UART_RX_AP = 3, N IO_MODE_SPIM_MISO_AP = 4, N} pad_ap_spis_miso_mode_e; N N/** N* @brief PAD_AP_SPIS_MOSIѡmode N*/ Ntypedef enum N{ N IO_MODE_JTAG_TMS = 0, N IO_MODE_SPIS_MOSI = 1, N IO_MODE_GPIO1 = 2, N IO_MODE_UART_TX_AP = 3, N IO_MODE_SPIM_MOSI_AP = 4, N} pad_ap_spis_mosi_mode_e; N N/** N* @brief PAD_AP_TPRSTNѡmode N*/ Ntypedef enum N{ N IO_MODE_JTAG_TDI = 0, N IO_MODE_GPIO21 = 2, N} pad_ap_tprstn_mode_e; N N/** N* @brief PAD_AP_INTѡmode N*/ Ntypedef enum N{ N IO_MODE_GPIO2 = 2, N} pad_ap_int_mode_e; N N/** N* @brief PAD_AP_TEѡmode N*/ Ntypedef enum N{ N IO_MODE_TEAR = 0, N IO_MODE_GPIO3 = 2, N} pad_ap_te_mode_e; N N/** N* @brief PAD_AP_SWIREѡmode N*/ Ntypedef enum N{ N IO_MODE_SWIRE = 0, N IO_MODE_PWMO = 1, N IO_MODE_GPIO4 = 2, N} pad_ap_swire_mode_e; N N/** N* @brief PAD_TD_SPIM_CLKѡmode N*/ Ntypedef enum N{ N IO_MODE_SPIM_SCLK = 0, N IO_MODE_I2C1_SCL = 1, N} pad_td_spim_clk_mode_e; N N/** N* @brief PAD_TD_SPIM_CSNѡmode N*/ Ntypedef enum N{ N IO_MODE_SPIM_CSN = 0, N IO_MODE_I2C1_SDA = 1, N} pad_td_spim_csn_mode_e; N N/** N* @brief PAD_TD_SPIM_MISOѡmode N*/ Ntypedef enum N{ N IO_MODE_SPIM_MISO = 0, N#if defined(ISP_568) || defined(ISP_368) X#if 1L || 0L N IO_MODE_PWMO1 = 1, N#endif N IO_MODE_GPIO5 = 2, N} pad_td_spim_miso_mode_e; N N/** N* @brief PAD_TD_SPIM_MOSIѡmode N*/ Ntypedef enum N{ N IO_MODE_SPIM_MOSI = 0, N IO_MODE_GPIO6 = 2, N} pad_td_spim_mosi_mode_e; N N/** N* @brief PAD_TD_TPRSTNѡmode N*/ Ntypedef enum N{ N IO_MODE_GPIO8 = 2, N} pad_td_tprstn_mode_e; N N/** N* @brief PAD_TD_INTѡmode N*/ Ntypedef enum N{ N IO_MODE_GPIO9_FUNC = 0, N IO_MODE_GPIO9 = 2, N} pad_td_int_mode_e; N N/** N* @brief PAD_TD_LEDPWMѡmode N*/ Ntypedef enum N{ N IO_MODE_PWMI = 0, N#if defined(ISP_568) || defined(ISP_368) X#if 1L || 0L N IO_MODE_PWMO2 = 1, N#endif N IO_MODE_GPIO10 = 2, N} pad_td_ledpwm_mode_e; N N/** N* @brief PAD_TD_FC_CLKѡmode N*/ Ntypedef enum N{ N IO_MODE_TSPIS_CLK = 0, N IO_MODE_GPIO11 = 2, N} pad_td_fc_clk_mode_e; N N/** N* @brief PAD_TD_FC_CSNѡmode N*/ Ntypedef enum N{ N IO_MODE_TSPIS_CSN = 0, N IO_MODE_GPIO12 = 2, N} pad_td_fc_csn_mode_e; N N/** N* @brief PAD_TD_FC_MISOѡmode N*/ Ntypedef enum N{ N IO_MODE_TSPIS_MISO = 0, N IO_MODE_GPIO13 = 2, N} pad_td_fc_miso_mode_e; N N/** N* @brief PAD_TD_FC_MOSIѡmode N*/ Ntypedef enum N{ N IO_MODE_TSPIS_MOSI = 0, N IO_MODE_GPIO14 = 2, N} pad_td_fc_mosi_mode_e; N N/** N* @brief PAD_UART_RXѡmode N*/ Ntypedef enum N{ N IO_MODE_UART_RX = 0, N IO_MODE_GPIO17 = 2, N} pad_uart_rx_mode_e; N N/** N* @brief PAD_UART_TXѡmode N*/ Ntypedef enum N{ N IO_MODE_UART_TX = 0, N IO_MODE_GPIO18 = 2, N} pad_uart_tx_mode_e; N N/** N* @brief PAD_PWMENѡmode N*/ Ntypedef enum N{ N IO_MODE_GPIO19 = 2, N} pad_pwmen_mode_e; N N/** N* @brief PAD_ADCINѡmode N*/ Ntypedef enum N{ N IO_MODE_GPIO20 = 2, N} pad_adcin_mode_e; N N/** N* @brief PAD_SFC_CLKѡmode N*/ Ntypedef enum N{ N IO_MODE_INTER_FLS_CLK = 0, N IO_MODE_EXT_FLS_CLK = 1, N} pad_sfc_clk_mode_e; N N/** N* @brief PAD_SFC_CSNѡmode N*/ Ntypedef enum N{ N IO_MODE_INTER_FLS_CSN = 0, N IO_MODE_EXT_FLS_CSN = 1, N} pad_sfc_csn_mode_e; N N/** N* @brief PAD_SFC_IO0ѡmode N*/ Ntypedef enum N{ N IO_MODE_INTER_FLS_IO0 = 0, N IO_MODE_EXT_FLS_MISO = 1, N} pad_sfc_io0_mode_e; N N/** N* @brief PAD_SFC_IO1ѡmode N*/ Ntypedef enum N{ N IO_MODE_INTER_FLS_IO1 = 0, N IO_MODE_EXT_FLS_MOSI = 1, N} pad_sfc_io1_mode_e; N N/** N* @brief PADѹת N*/ Ntypedef enum N{ N IO_SLEW_RATE_SLOW = 0, N IO_SLEW_RATE_FAST = 1, N} pad_slew_rate_e; N N/******************************************************************************* N* IOE N*******************************************************************************/ N/** N* @brief GPIO io N*/ Ntypedef enum N{ N IO_IOE_INPUT = 0, N IO_IOE_OUTPUT N} gpio_ioe_direct_e; N N/** N* @brief GPIO level N*/ Ntypedef enum N{ N IO_LVL_LOW = 0, N IO_LVL_HIGH N} gpio_level_e; N N/******************************************************************************* N* 3.Global structures, unions and enumerations using typedef N*******************************************************************************/ N N/******************************************************************************* N* 4.Global variable extern declarations N*******************************************************************************/ N N/******************************************************************************* N* 5.Global function prototypes N*******************************************************************************/ N/** N* @brief ָPADΪGPIO modeΪinputָжϴʽ N* @param padGPIOţοögpio_pad_e N* @param trig4жϴʽοösys_cfg_trigger_e N* @retval N*/ Nvoid hal_gpio_init_eint(io_pad_e pad, sys_cfg_trigger_e trig); N N/** N* @brief עGPIOжϻص N* @param padGPIOţοögpio_pad_e N* @param cb_funcصַ N* @param dataصַ N* @retval N*/ Nvoid hal_gpio_reg_eint_cb(io_pad_e pad, fcb_type cb_func); N N/** N* @brief GPIOж N* @param padGPIOţοögpio_pad_e N* @param stateؿ N* @retval N*/ Nvoid hal_gpio_ctrl_eint(io_pad_e pad, function_state_e state); N N/** N* @brief ȡGPIOж N* @param padGPIOţοögpio_pad_e N* @retval N*/ Ngpio_int_e hal_gpio_get_int_type(io_pad_e pad); N N/** N* @brief ָPADΪGPIO modeΪoutputָʼƽ N* @param padGPIOţοögpio_pad_e N* @param lvlʼƽοögpio_level_e N* @retval N*/ Nvoid hal_gpio_init_output(io_pad_e pad, gpio_level_e lvl); N N/** N* @brief װӿ N* @param padGPIOţοögpio_pad_e N* @param lvlʼƽοögpio_level_e N* @retval N*/ Nvoid hal_gpio_set_output_data(io_pad_e pad, gpio_level_e lvl); N N/** N* @brief װӿչ֧ͬʱ֪ͨIOƽ N* @param pad1GPIOţοögpio_pad_e N* @param pad1_lvlõƽοögpio_level_e N* @param pad2GPIOţοögpio_pad_e N* @param pad2_lvlõƽοögpio_level_e N* @retval N*/ Nvoid hal_gpio_set_output_data_ex(io_pad_e pad1, gpio_level_e pad1_lvl, io_pad_e pad2, gpio_level_e pad2_lvl); N N/** N* @brief ָPADΪGPIO modeΪinput N* @param padGPIOţοögpio_pad_e N* @retval N*/ Nvoid hal_gpio_init_input(io_pad_e pad); N N/** N* @brief ȡƽ N* @param padGPIOţοögpio_pad_e N* @retval N*/ Ngpio_level_e hal_gpio_get_input_data(io_pad_e pad); N N/** N* @brief io mode N* @param padGPIOţοögpio_pad_e N* @param modeģʽοPADӦmodeö N* @retval N*/ Nvoid hal_gpio_set_mode(io_pad_e pad, uint8_t mode); N N/** N* @brief ȡָPADĬ״̬ N* @param padGPIOţοögpio_pad_e N* @param up_enableĬ״̬ N* @param down_enableĬ״̬ N* @retval N*/ Nvoid hal_gpio_get_pull_state(io_pad_e pad, function_state_e *up_enable, function_state_e *down_enable); N N/** N* @brief ָPADĬ״̬ N* @param padGPIOţοögpio_pad_e N* @param up_enableĬ״̬ N* @param down_enableĬ״̬ N* @retval N*/ Nvoid hal_gpio_set_pull_state(io_pad_e pad, function_state_e up_enable, function_state_e down_enable); N N/** N* @brief ָPADǷΪʩش N* @param padGPIOţοögpio_pad_e N* @param st_enable1Ϊʩش0Ϊ N* @retval N*/ Nvoid hal_gpio_set_schmitt_trigger(io_pad_e pad, function_state_e st_enable); N N/** N* @brief ָPAD N* @param padGPIOţοögpio_pad_e N* @param strengthǿȣȡֵΪ0~3 N* @retval N*/ Nvoid hal_gpio_set_driving_strength(io_pad_e pad, uint8_t strength); N N/** N* @brief ָPADĵѹת N* @param padGPIOţοögpio_pad_e N* @param rateǿȣȡֵΪ0~3 N* @retval N*/ Nvoid hal_gpio_set_slew_rate(io_pad_e pad, pad_slew_rate_e rate); N N/** N* @brief AP_RSTNж N* @param enable: жϿ N* @param cb_funcص N* @param trigģʽ N* @retval N*/ Nvoid hal_gpio_set_ap_reset_int(bool enable, fcb_type cb_func, sys_cfg_trigger_e trig); Xvoid hal_gpio_set_ap_reset_int(_Bool enable, fcb_type cb_func, sys_cfg_trigger_e trig); N N#endif /* __HAL_GPIO_H__ */ L 19 "..\src\app\demo\app_tp_for_custom_s8.h" 2 N N#define AP_TP_TRANSFER 1 N N#if AMOLED_NT37280 S #define PHONE_SLAVE_TRANSFER_I2C 1 //1:ʾֻоƬ֮䣬touch ݲ I2C ͨţ S #define PHONE_SLAVE_TRANSFER_SPI 0 //1:ʾֻоƬ֮䣬touch ݲ SPI ͨţ S #define SCREEN_MASTER_TRANSFER_I2C 0 //1:ʾĻоƬ֮䣬touch ݲ I2C ͨţ S #define SCREEN_MASTER_TRANSFER_SPI 1 //1:ʾĻоƬ֮䣬touch ݲ SPI ͨţ S#elif LCD_HX83112A S #define PHONE_SLAVE_TRANSFER_I2C 1 //1:ʾֻоƬ֮䣬touch ݲ I2C ͨţ S #define PHONE_SLAVE_TRANSFER_SPI 0 //1:ʾֻоƬ֮䣬touch ݲ SPI ͨţ S #define SCREEN_MASTER_TRANSFER_I2C 0 //1:ʾĻоƬ֮䣬touch ݲ I2C ͨţ S #define SCREEN_MASTER_TRANSFER_SPI 0 //1:ʾĻоƬ֮䣬touch ݲ SPI ͨţ N#else // #if LCD_TD4310 N #define PHONE_SLAVE_TRANSFER_I2C 1 //1:ʾֻоƬ֮䣬touch ݲ I2C ͨţ N #define PHONE_SLAVE_TRANSFER_SPI 0 //1:ʾֻоƬ֮䣬touch ݲ SPI ͨţ N #define SCREEN_MASTER_TRANSFER_I2C 1 //1:ʾĻоƬ֮䣬touch ݲ I2C ͨţ N #define SCREEN_MASTER_TRANSFER_SPI 0 //1:ʾĻоƬ֮䣬touch ݲ SPI ͨţ N#endif N N#ifdef USE_FOR_SUMSUNG_S21 N#define CHIP_I2C_ADDRESS 0x48 //оƬ I2C ӻַ.I2Cַ N#define SCREEN_I2C_ADDRESS 0x49 //Ļ I2C ӻַ N N#elif defined(USE_FOR_SUMSUNG_S9PLUS) X#elif 0L S#define CHIP_I2C_ADDRESS 0x48 //оƬ I2C ӻַ S#define SCREEN_I2C_ADDRESS 0x20 //Ļ I2C ӻַ S S#else S#define CHIP_I2C_ADDRESS 0x48 //оƬ I2C ӻַ S#define SCREEN_I2C_ADDRESS 0x49 //Ļ I2C ӻַ N#endif N N#define CHIP_I2C_ADDR_BITS I2C_ADDR_BITS_7 //Ļ I2C ַλ 7/10ĬΪ7 N#define SCREEN_I2C_ADDR_BITS I2C_ADDR_BITS_7 //Ļ I2C ַλ 7/10ĬΪ7 N#define I2C_MASTER_SPEED 400000 // I2C ͨ 800000 N N#define SPI_MASTER_SPEED 10000000 // SPI ͨ N N#define BUFFER_SIZE_MAX 200 // bufrer ֽ N N#define INPUT_WIDTH_VALUE 1440 //ԭװ X ֵֵ N#define INPUT_HEIGHT_VALUE 3200 //ԭװ Y ֵֵ N N#if LCD_FT8006S_TRULY59 S#define OUTPUT_WIDTH_VALUE 720 //ά X ֵֵ S#define OUTPUT_HEIGHT_VALUE 1520 //ά Y ֵֵ S N#else N#define OUTPUT_WIDTH_VALUE 1080 //ά X ֵֵ N#define OUTPUT_HEIGHT_VALUE 2400 //ά Y ֵֵ N#endif N N N#define SCREEN_TRANSFER_WRITE false //յscreen ioжϣ֮ö N#define SCREEN_TRANSFER_READ true //յscreen ioжϣ֮Ҫ N Ntypedef enum N{ N I2C_ADDR_BITS_7 = 7, N I2C_ADDR_BITS_10 = 10 N} en_I2C_ADDR_BITS_mdoe; N Ntypedef struct N{ N uint8_t *buffer; //յscreen ioжϺͨŵķbufferָ N size_t txbuffer_size; // buffer ݳȣҪʱĿǰֻ֧4ֽ N size_t rxbuffer_size; //֮Ҫصݳ N bool read_flag; //true յscreen ioжϣ֮Ҫ X _Bool read_flag; N} st_screen_data; N Ntypedef struct N{ N const uint8_t *buffer; //ͨŵķbufferָ N size_t txbuffer_size; // buffer ݳȣҪʱĿǰֻ֧4ֽ N size_t rxbuffer_size; //֮Ҫصݳ N bool read_flag; //true յscreen ioжϣ֮Ҫ X _Bool read_flag; N} st_screen_const_data; N Ntypedef struct N{ N uint8_t reg_size; //bufferĸ N size_t write_back_size; //Ҫ͵ݳ N const uint8_t *reg_data; //buffer N const uint8_t *write_back; //bufer N} st_reg_const_data; N Ntypedef struct N{ N uint8_t reg_size; //bufferĸ N size_t write_back_size; //Ҫ͵ݳ N uint8_t *reg_data; //buffer N uint8_t *write_back; //bufer N} st_reg_data; N Nextern io_pad_e g_screen_input_rst_pad; Nextern io_pad_e g_screen_input_int_pad; Nextern io_pad_e g_phone_input_rst_pad; Nextern io_pad_e g_phone_output_int_pad; N Nextern uint8_t phone_start_flag; Nextern uint8_t phone_touch_flag; Nextern const uint8_t screen_reg_int_data_size; Nextern const uint8_t screen_reg_start_data_size; Nextern st_screen_data screen_reg_int_data[]; Nextern st_screen_const_data screen_reg_start_data[]; N//extern st_reg_const_data phone_reg_const_data[]; N N/************************************************************************** N* @name : app_tp_screen_analysis_const N* @brief : screen start ׶ݽɿͻ N* @param[in] : N* @return : N* @retval : N**************************************************************************/ Nuint8_t app_tp_screen_analysis_const(uint8_t transfer_now, uint8_t *rxbuffer, size_t data_size); N N/************************************************************************** N* @name : app_tp_screen_analysis_int N* @brief : screen IOжϺ ݽɿͻ N* @param[in] : N* @return : N* @retval : N**************************************************************************/ Nuint8_t app_tp_screen_analysis_int(uint8_t transfer_now, uint8_t *rxbuffer, size_t data_size); N N/************************************************************************** N* @name : app_tp_phone_analysis_data N* @brief : phone ݽɿͻ N* @param[in] : N* @return : N* @retval : N**************************************************************************/ Nvoid app_tp_phone_analysis_data(uint8_t *rxbuffer, size_t rxbuffer_size, const uint8_t **txbuffer, size_t *txbuffer_size); N N N#endif N L 76 "..\src\app\test_cfg_global.h" 2 N#endif N N#if _DEMO_S8P_EN X#if 0 S #include "s8p_demo.h" S #include "app_tp_for_custom_s8p.h" N#endif N N#endif N L 5 "..\src\app\main.c" 2 N#include "tau_log.h" L 1 "..\src\common\tau_log.h" 1 N/******************************************************************************* N* N* N* File: tau_log.h N* Description log file N* Version V0.1 N* Date 2020-12-08 N* Author linyw N*******************************************************************************/ N#ifndef _TAU_LOG_H_ N#define _TAU_LOG_H_ N N N/******************************************************************************* N* 1.Included files N*******************************************************************************/ N#include N#include N#include L 1 "C:\Keil_v5\ARM\ARMCC\Bin\..\include\stdarg.h" 1 N/* stdarg.h: ANSI 'C' (X3J11 Oct 88) library header, section 4.8 */ N/* Copyright (C) Codemist Ltd., 1988 */ N/* Copyright (C) ARM Ltd., 1991-1999. All rights reserved */ N N/* N * RCS $Revision$ N * Checkin $Date$ N * Revising $Author: agrant $ N */ N N#ifndef __stdarg_h N#define __stdarg_h N#define __ARMCLIB_VERSION 5060037 N N #ifndef __STDARG_DECLS N #define __STDARG_DECLS N N #undef __CLIBNS N N #ifdef __cplusplus S namespace std { S #define __CLIBNS ::std:: S extern "C" { N #else N #define __CLIBNS N #endif /* __cplusplus */ N N/* N * stdarg.h declares a type and defines macros for advancing through a N * list of arguments whose number and types are not known to the called N * function when it is translated. A function may be called with a variable N * number of arguments of differing types. Its parameter list contains one or N * more parameters. The rightmost parameter plays a special role in the access N * mechanism, and will be called parmN in this description. N */ N N/* N.B. is required to declare vfprintf() without defining */ N/* va_list. Clearly the type __va_list there must keep in step. */ N#ifdef __clang__ S typedef __builtin_va_list va_list; S #define va_start(ap, param) __builtin_va_start(ap, param) S #define va_end(ap) __builtin_va_end(ap) S #define va_arg(ap, type) __builtin_va_arg(ap, type) S #if __STDC_VERSION__ >= 199900L || __cplusplus >= 201103L || !defined(__STRICT_ANSI__) S #define va_copy(dest, src) __builtin_va_copy(dest, src) S #endif N#else N #ifdef __TARGET_ARCH_AARCH64 S typedef struct __va_list { S void *__stack; S void *__gr_top; S void *__vr_top; S int __gr_offs; S int __vr_offs; S } va_list; N #else N typedef struct __va_list { void *__ap; } va_list; N #endif N /* N * an array type suitable for holding information needed by the macro va_arg N * and the function va_end. The called function shall declare a variable N * (referred to as ap) having type va_list. The variable ap may be passed as N * an argument to another function. N * Note: va_list is an array type so that when an object of that type N * is passed as an argument it gets passed by reference. N */ N #define va_start(ap, parmN) __va_start(ap, parmN) N N /* N * The va_start macro shall be executed before any access to the unnamed N * arguments. The parameter ap points to an object that has type va_list. N * The va_start macro initialises ap for subsequent use by va_arg and N * va_end. The parameter parmN is the identifier of the rightmost parameter N * in the variable parameter list in the function definition (the one just N * before the '...'). If the parameter parmN is declared with the register N * storage class an error is given. N * If parmN is a narrow type (char, short, float) an error is given in N * strict ANSI mode, or a warning otherwise. N * Returns: no value. N */ N #define va_arg(ap, type) __va_arg(ap, type) N N /* N * The va_arg macro expands to an expression that has the type and value of N * the next argument in the call. The parameter ap shall be the same as the N * va_list ap initialised by va_start. Each invocation of va_arg modifies N * ap so that successive arguments are returned in turn. The parameter N * 'type' is a type name such that the type of a pointer to an object that N * has the specified type can be obtained simply by postfixing a * to N * 'type'. If type is a narrow type, an error is given in strict ANSI N * mode, or a warning otherwise. If the type is an array or function type, N * an error is given. N * In non-strict ANSI mode, 'type' is allowed to be any expression. N * Returns: The first invocation of the va_arg macro after that of the N * va_start macro returns the value of the argument after that N * specified by parmN. Successive invocations return the values of N * the remaining arguments in succession. N * The result is cast to 'type', even if 'type' is narrow. N */ N N#define __va_copy(dest, src) ((void)((dest) = (src))) N N#if !defined(__STRICT_ANSI__) || (defined(__STDC_VERSION__) && 199901L <= __STDC_VERSION__) || (defined(__cplusplus) && 201103L <= __cplusplus) X#if !0L || (1L && 199901L <= 199901L) || (0L && 201103L <= __cplusplus) N /* va_copy is in C99 and non-strict C90 and non-strict C++ N * __va_copy is always present. N */ N #define va_copy(dest, src) ((void)((dest) = (src))) N N /* The va_copy macro makes the va_list dest be a copy of N * the va_list src, as if the va_start macro had been applied N * to it followed by the same sequence of uses of the va_arg N * macro as had previously been used to reach the present state N * of src. N */ N#endif N N#define va_end(ap) __va_end(ap) N /* N * The va_end macro facilitates a normal return from the function whose N * variable argument list was referenced by the expansion of va_start that N * initialised the va_list ap. If the va_end macro is not invoked before N * the return, the behaviour is undefined. N * Returns: no value. N */ N#endif /* __clang__ */ N N #ifdef __cplusplus S } /* extern "C" */ S } /* namespace std */ N #endif /* __cplusplus */ N N #ifdef __GNUC__ N /* be cooperative with glibc */ N typedef __CLIBNS va_list __gnuc_va_list; X typedef va_list __gnuc_va_list; N #define __GNUC_VA_LIST N #undef __need___va_list N #endif N N #endif /* __STDARG_DECLS */ N N #ifdef __cplusplus S #ifndef __STDARG_NO_EXPORTS S using ::std::va_list; S #endif N #endif /* __cplusplus */ N#endif N N/* end of stdarg.h */ N L 20 "..\src\common\tau_log.h" 2 N#include "ArmCM0.h" L 1 "..\src\sdk\include\M0\ArmCM0.h" 1 N/**************************************************************************//** N * @file ARMCM0.h N * @brief CMSIS Core Peripheral Access Layer Header File for N * ARMCM0 Device N * @version V5.3.1 N * @date 09. July 2018 N ******************************************************************************/ N/* N * Copyright (c) 2009-2018 Arm Limited. All rights reserved. N * N * SPDX-License-Identifier: Apache-2.0 N * N * Licensed under the Apache License, Version 2.0 (the License); you may N * not use this file except in compliance with the License. N * You may obtain a copy of the License at N * N * www.apache.org/licenses/LICENSE-2.0 N * N * Unless required by applicable law or agreed to in writing, software N * distributed under the License is distributed on an AS IS BASIS, WITHOUT N * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. N * See the License for the specific language governing permissions and N * limitations under the License. N */ N N#ifndef ARMCM0_H N#define ARMCM0_H N N#ifdef __cplusplus Sextern "C" { N#endif N N N/* ------------------------- Interrupt Number Definition ------------------------ */ N Ntypedef enum IRQn N{ N /* ------------------- Processor Exceptions Numbers ----------------------------- */ N NonMaskableInt_IRQn = -14, /* 2 Non Maskable Interrupt */ N HardFault_IRQn = -13, /* 3 HardFault Interrupt */ N SVCall_IRQn = -5, /* 11 SV Call Interrupt */ N PendSV_IRQn = -2, /* 14 Pend SV Interrupt */ N SysTick_IRQn = -1, /* 15 System Tick Interrupt */ N N /* ------------------- Processor Interrupt Numbers ------------------------------ */ N VIDC_IRQn = 0, N LCDC_IRQn = 1, N MIPI_RX_IRQn = 2, N MIPI_TX_IRQn = 3, N MEMC_IRQn = 4, N VPRE_IRQn = 5, N FLSCTRL_IRQn = 6, N DMA_IRQn = 7, N TIMER0_IRQn = 8, N TIMER1_IRQn = 9, N TIMER2_IRQn = 10, N TIMER3_IRQn = 11, N WDG_IRQn = 12, N UART_IRQn = 13, N I2C0_IRQn = 14, N I2C1_IRQn = 15, N SPIS_IRQn = 16, N SPIM_IRQn = 17, N ADC_IRQn = 18, N PWMDET_IRQn = 19, N OTP_IRQn = 20, N SWIRE_IRQn = 21, N PVD_IRQn = 22, N AP_NRESET_IRQn = 23, N EXTI_INT0_IRQn = 24, N EXTI_INT1_IRQn = 25, N EXTI_INT2_IRQn = 26, N EXTI_INT3_IRQn = 27, N EXTI_INT4_IRQn = 28, N EXTI_INT5_IRQn = 29, N EXTI_INT6_IRQn = 30, N EXTI_INT7_IRQn = 31 N /* Interrupts 10 .. 31 are left out */ N} IRQn_Type; N N N N N/* ================================================================================ */ N/* ================ Processor and Core Peripheral Section ================ */ N/* ================================================================================ */ N N/* ------- Start of section using anonymous unions and disabling warnings ------- */ N#if defined (__CC_ARM) X#if 1L N#pragma push N#pragma anon_unions N#elif defined (__ICCARM__) X#elif 0L S#pragma language=extended S#elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) S#pragma clang diagnostic push S#pragma clang diagnostic ignored "-Wc11-extensions" S#pragma clang diagnostic ignored "-Wreserved-id-macro" S#elif defined (__GNUC__) S/* anonymous unions are enabled by default */ S#elif defined (__TMS470__) S/* anonymous unions are enabled by default */ S#elif defined (__TASKING__) S#pragma warning 586 S#elif defined (__CSMC__) S/* anonymous unions are enabled by default */ S#else S#warning Not supported compiler type N#endif N N/* -------- Configuration of Core Peripherals ----------------------------------- */ N#define __CM0_REV 0x0000U /* Core revision r0p0 */ N#define __MPU_PRESENT 0U /* no MPU present */ N#define __VTOR_PRESENT 0U /* no VTOR present */ N#define __NVIC_PRIO_BITS 2U /* Number of Bits used for Priority Levels */ //20220228 N#define __Vendor_SysTickConfig 0U /* Set to 1 if different SysTick Config is used */ N N#define __FPU_PRESENT 0U /* Set to 1 if FPU is present */ N#define __FPU_DP 0U /* single precision FPU */ N#define __ICACHE_PRESENT 0U /* Set to 1 if I-CACHE is present */ N#define __DCACHE_PRESENT 0U /* Set to 1 if D-CACHE is present */ N#define __DSP_PRESENT 0U /* no DSP extension present */ N N#define FPGA_MODE 0 N#define EDA_MODE 0 N#define EXTERN_24M 0 N#define CPU_CLK_100M 0 N N#include "core_cm0.h" /* Processor and core peripherals */ L 1 "C:\Users\Markin\AppData\Local\Arm\Packs\ARM\CMSIS\5.5.1\CMSIS\Core\Include\core_cm0.h" 1 N/**************************************************************************//** N * @file core_cm0.h N * @brief CMSIS Cortex-M0 Core Peripheral Access Layer Header File N * @version V5.0.6 N * @date 13. March 2019 N ******************************************************************************/ N/* N * Copyright (c) 2009-2019 Arm Limited. All rights reserved. N * N * SPDX-License-Identifier: Apache-2.0 N * N * Licensed under the Apache License, Version 2.0 (the License); you may N * not use this file except in compliance with the License. N * You may obtain a copy of the License at N * N * www.apache.org/licenses/LICENSE-2.0 N * N * Unless required by applicable law or agreed to in writing, software N * distributed under the License is distributed on an AS IS BASIS, WITHOUT N * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. N * See the License for the specific language governing permissions and N * limitations under the License. N */ N N#if defined ( __ICCARM__ ) X#if 0L S #pragma system_include /* treat file as system include file for MISRA check */ S#elif defined (__clang__) X#elif 0L S #pragma clang system_header /* treat file as system include file */ N#endif N N#ifndef __CORE_CM0_H_GENERIC N#define __CORE_CM0_H_GENERIC N N#include N N#ifdef __cplusplus S extern "C" { N#endif N N/** N \page CMSIS_MISRA_Exceptions MISRA-C:2004 Compliance Exceptions N CMSIS violates the following MISRA-C:2004 rules: N N \li Required Rule 8.5, object/function definition in header file.
N Function definitions in header files are used to allow 'inlining'. N N \li Required Rule 18.4, declaration of union type or object of union type: '{...}'.
N Unions are used for effective representation of core registers. N N \li Advisory Rule 19.7, Function-like macro defined.
N Function-like macros are used to allow more efficient code. N */ N N N/******************************************************************************* N * CMSIS definitions N ******************************************************************************/ N/** N \ingroup Cortex_M0 N @{ N */ N N#include "cmsis_version.h" L 1 "C:\Users\Markin\AppData\Local\Arm\Packs\ARM\CMSIS\5.5.1\CMSIS\Core\Include\cmsis_version.h" 1 N/**************************************************************************//** N * @file cmsis_version.h N * @brief CMSIS Core(M) Version definitions N * @version V5.0.2 N * @date 19. April 2017 N ******************************************************************************/ N/* N * Copyright (c) 2009-2017 ARM Limited. All rights reserved. N * N * SPDX-License-Identifier: Apache-2.0 N * N * Licensed under the Apache License, Version 2.0 (the License); you may N * not use this file except in compliance with the License. N * You may obtain a copy of the License at N * N * www.apache.org/licenses/LICENSE-2.0 N * N * Unless required by applicable law or agreed to in writing, software N * distributed under the License is distributed on an AS IS BASIS, WITHOUT N * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. N * See the License for the specific language governing permissions and N * limitations under the License. N */ N N#if defined ( __ICCARM__ ) X#if 0L S #pragma system_include /* treat file as system include file for MISRA check */ S#elif defined (__clang__) X#elif 0L S #pragma clang system_header /* treat file as system include file */ N#endif N N#ifndef __CMSIS_VERSION_H N#define __CMSIS_VERSION_H N N/* CMSIS Version definitions */ N#define __CM_CMSIS_VERSION_MAIN ( 5U) /*!< [31:16] CMSIS Core(M) main version */ N#define __CM_CMSIS_VERSION_SUB ( 1U) /*!< [15:0] CMSIS Core(M) sub version */ N#define __CM_CMSIS_VERSION ((__CM_CMSIS_VERSION_MAIN << 16U) | \ N __CM_CMSIS_VERSION_SUB ) /*!< CMSIS Core(M) version number */ X#define __CM_CMSIS_VERSION ((__CM_CMSIS_VERSION_MAIN << 16U) | __CM_CMSIS_VERSION_SUB ) N#endif L 64 "C:\Users\Markin\AppData\Local\Arm\Packs\ARM\CMSIS\5.5.1\CMSIS\Core\Include\core_cm0.h" 2 N N/* CMSIS CM0 definitions */ N#define __CM0_CMSIS_VERSION_MAIN (__CM_CMSIS_VERSION_MAIN) /*!< \deprecated [31:16] CMSIS HAL main version */ N#define __CM0_CMSIS_VERSION_SUB (__CM_CMSIS_VERSION_SUB) /*!< \deprecated [15:0] CMSIS HAL sub version */ N#define __CM0_CMSIS_VERSION ((__CM0_CMSIS_VERSION_MAIN << 16U) | \ N __CM0_CMSIS_VERSION_SUB ) /*!< \deprecated CMSIS HAL version number */ X#define __CM0_CMSIS_VERSION ((__CM0_CMSIS_VERSION_MAIN << 16U) | __CM0_CMSIS_VERSION_SUB ) N N#define __CORTEX_M (0U) /*!< Cortex-M Core */ N N/** __FPU_USED indicates whether an FPU is used or not. N This core does not support an FPU at all N*/ N#define __FPU_USED 0U N N#if defined ( __CC_ARM ) X#if 1L N #if defined __TARGET_FPU_VFP X #if 0L S #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" N #endif N N#elif defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) X#elif 1L && (5060750 >= 6010050) S #if defined __ARM_FP S #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" S #endif S S#elif defined ( __GNUC__ ) S #if defined (__VFP_FP__) && !defined(__SOFTFP__) S #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" S #endif S S#elif defined ( __ICCARM__ ) S #if defined __ARMVFP__ S #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" S #endif S S#elif defined ( __TI_ARM__ ) S #if defined __TI_VFP_SUPPORT__ S #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" S #endif S S#elif defined ( __TASKING__ ) S #if defined __FPU_VFP__ S #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" S #endif S S#elif defined ( __CSMC__ ) S #if ( __CSMC__ & 0x400U) S #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)" S #endif S N#endif N N#include "cmsis_compiler.h" /* CMSIS compiler specific defines */ L 1 "C:\Users\Markin\AppData\Local\Arm\Packs\ARM\CMSIS\5.5.1\CMSIS\Core\Include\cmsis_compiler.h" 1 N/**************************************************************************//** N * @file cmsis_compiler.h N * @brief CMSIS compiler generic header file N * @version V5.1.0 N * @date 09. October 2018 N ******************************************************************************/ N/* N * Copyright (c) 2009-2018 Arm Limited. All rights reserved. N * N * SPDX-License-Identifier: Apache-2.0 N * N * Licensed under the Apache License, Version 2.0 (the License); you may N * not use this file except in compliance with the License. N * You may obtain a copy of the License at N * N * www.apache.org/licenses/LICENSE-2.0 N * N * Unless required by applicable law or agreed to in writing, software N * distributed under the License is distributed on an AS IS BASIS, WITHOUT N * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. N * See the License for the specific language governing permissions and N * limitations under the License. N */ N N#ifndef __CMSIS_COMPILER_H N#define __CMSIS_COMPILER_H N N#include N N/* N * Arm Compiler 4/5 N */ N#if defined ( __CC_ARM ) X#if 1L N #include "cmsis_armcc.h" L 1 "C:\Users\Markin\AppData\Local\Arm\Packs\ARM\CMSIS\5.5.1\CMSIS\Core\Include\cmsis_armcc.h" 1 N/**************************************************************************//** N * @file cmsis_armcc.h N * @brief CMSIS compiler ARMCC (Arm Compiler 5) header file N * @version V5.0.5 N * @date 14. December 2018 N ******************************************************************************/ N/* N * Copyright (c) 2009-2018 Arm Limited. All rights reserved. N * N * SPDX-License-Identifier: Apache-2.0 N * N * Licensed under the Apache License, Version 2.0 (the License); you may N * not use this file except in compliance with the License. N * You may obtain a copy of the License at N * N * www.apache.org/licenses/LICENSE-2.0 N * N * Unless required by applicable law or agreed to in writing, software N * distributed under the License is distributed on an AS IS BASIS, WITHOUT N * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. N * See the License for the specific language governing permissions and N * limitations under the License. N */ N N#ifndef __CMSIS_ARMCC_H N#define __CMSIS_ARMCC_H N N N#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION < 400677) X#if 1L && (5060750 < 400677) S #error "Please use Arm Compiler Toolchain V4.0.677 or later!" N#endif N N/* CMSIS compiler control architecture macros */ N#if ((defined (__TARGET_ARCH_6_M ) && (__TARGET_ARCH_6_M == 1)) || \ N (defined (__TARGET_ARCH_6S_M ) && (__TARGET_ARCH_6S_M == 1)) ) X#if ((0L && (__TARGET_ARCH_6_M == 1)) || (1L && (1 == 1)) ) N #define __ARM_ARCH_6M__ 1 N#endif N N#if (defined (__TARGET_ARCH_7_M ) && (__TARGET_ARCH_7_M == 1)) X#if (0L && (__TARGET_ARCH_7_M == 1)) S #define __ARM_ARCH_7M__ 1 N#endif N N#if (defined (__TARGET_ARCH_7E_M) && (__TARGET_ARCH_7E_M == 1)) X#if (0L && (__TARGET_ARCH_7E_M == 1)) S #define __ARM_ARCH_7EM__ 1 N#endif N N /* __ARM_ARCH_8M_BASE__ not applicable */ N /* __ARM_ARCH_8M_MAIN__ not applicable */ N N/* CMSIS compiler control DSP macros */ N#if ((defined (__ARM_ARCH_7EM__) && (__ARM_ARCH_7EM__ == 1)) ) X#if ((0L && (__ARM_ARCH_7EM__ == 1)) ) S #define __ARM_FEATURE_DSP 1 N#endif N N/* CMSIS compiler specific defines */ N#ifndef __ASM N #define __ASM __asm N#endif N#ifndef __INLINE N #define __INLINE __inline N#endif N#ifndef __STATIC_INLINE N #define __STATIC_INLINE static __inline N#endif N#ifndef __STATIC_FORCEINLINE N #define __STATIC_FORCEINLINE static __forceinline N#endif N#ifndef __NO_RETURN N #define __NO_RETURN __declspec(noreturn) N#endif N#ifndef __USED N #define __USED __attribute__((used)) N#endif N#ifndef __WEAK N #define __WEAK __attribute__((weak)) N#endif N#ifndef __PACKED N #define __PACKED __attribute__((packed)) N#endif N#ifndef __PACKED_STRUCT N #define __PACKED_STRUCT __packed struct N#endif N#ifndef __PACKED_UNION N #define __PACKED_UNION __packed union N#endif N#ifndef __UNALIGNED_UINT32 /* deprecated */ N #define __UNALIGNED_UINT32(x) (*((__packed uint32_t *)(x))) N#endif N#ifndef __UNALIGNED_UINT16_WRITE N #define __UNALIGNED_UINT16_WRITE(addr, val) ((*((__packed uint16_t *)(addr))) = (val)) N#endif N#ifndef __UNALIGNED_UINT16_READ N #define __UNALIGNED_UINT16_READ(addr) (*((const __packed uint16_t *)(addr))) N#endif N#ifndef __UNALIGNED_UINT32_WRITE N #define __UNALIGNED_UINT32_WRITE(addr, val) ((*((__packed uint32_t *)(addr))) = (val)) N#endif N#ifndef __UNALIGNED_UINT32_READ N #define __UNALIGNED_UINT32_READ(addr) (*((const __packed uint32_t *)(addr))) N#endif N#ifndef __ALIGNED N #define __ALIGNED(x) __attribute__((aligned(x))) N#endif N#ifndef __RESTRICT N #define __RESTRICT __restrict N#endif N N/* ########################### Core Function Access ########################### */ N/** \ingroup CMSIS_Core_FunctionInterface N \defgroup CMSIS_Core_RegAccFunctions CMSIS Core Register Access Functions N @{ N */ N N/** N \brief Enable IRQ Interrupts N \details Enables IRQ interrupts by clearing the I-bit in the CPSR. N Can only be executed in Privileged modes. N */ N/* intrinsic void __enable_irq(); */ N N N/** N \brief Disable IRQ Interrupts N \details Disables IRQ interrupts by setting the I-bit in the CPSR. N Can only be executed in Privileged modes. N */ N/* intrinsic void __disable_irq(); */ N N/** N \brief Get Control Register N \details Returns the content of the Control Register. N \return Control Register value N */ N__STATIC_INLINE uint32_t __get_CONTROL(void) Xstatic __inline uint32_t __get_CONTROL(void) N{ N register uint32_t __regControl __ASM("control"); X register uint32_t __regControl __asm("control"); N return(__regControl); N} N N N/** N \brief Set Control Register N \details Writes the given value to the Control Register. N \param [in] control Control Register value to set N */ N__STATIC_INLINE void __set_CONTROL(uint32_t control) Xstatic __inline void __set_CONTROL(uint32_t control) N{ N register uint32_t __regControl __ASM("control"); X register uint32_t __regControl __asm("control"); N __regControl = control; N} N N N/** N \brief Get IPSR Register N \details Returns the content of the IPSR Register. N \return IPSR Register value N */ N__STATIC_INLINE uint32_t __get_IPSR(void) Xstatic __inline uint32_t __get_IPSR(void) N{ N register uint32_t __regIPSR __ASM("ipsr"); X register uint32_t __regIPSR __asm("ipsr"); N return(__regIPSR); N} N N N/** N \brief Get APSR Register N \details Returns the content of the APSR Register. N \return APSR Register value N */ N__STATIC_INLINE uint32_t __get_APSR(void) Xstatic __inline uint32_t __get_APSR(void) N{ N register uint32_t __regAPSR __ASM("apsr"); X register uint32_t __regAPSR __asm("apsr"); N return(__regAPSR); N} N N N/** N \brief Get xPSR Register N \details Returns the content of the xPSR Register. N \return xPSR Register value N */ N__STATIC_INLINE uint32_t __get_xPSR(void) Xstatic __inline uint32_t __get_xPSR(void) N{ N register uint32_t __regXPSR __ASM("xpsr"); X register uint32_t __regXPSR __asm("xpsr"); N return(__regXPSR); N} N N N/** N \brief Get Process Stack Pointer N \details Returns the current value of the Process Stack Pointer (PSP). N \return PSP Register value N */ N__STATIC_INLINE uint32_t __get_PSP(void) Xstatic __inline uint32_t __get_PSP(void) N{ N register uint32_t __regProcessStackPointer __ASM("psp"); X register uint32_t __regProcessStackPointer __asm("psp"); N return(__regProcessStackPointer); N} N N N/** N \brief Set Process Stack Pointer N \details Assigns the given value to the Process Stack Pointer (PSP). N \param [in] topOfProcStack Process Stack Pointer value to set N */ N__STATIC_INLINE void __set_PSP(uint32_t topOfProcStack) Xstatic __inline void __set_PSP(uint32_t topOfProcStack) N{ N register uint32_t __regProcessStackPointer __ASM("psp"); X register uint32_t __regProcessStackPointer __asm("psp"); N __regProcessStackPointer = topOfProcStack; N} N N N/** N \brief Get Main Stack Pointer N \details Returns the current value of the Main Stack Pointer (MSP). N \return MSP Register value N */ N__STATIC_INLINE uint32_t __get_MSP(void) Xstatic __inline uint32_t __get_MSP(void) N{ N register uint32_t __regMainStackPointer __ASM("msp"); X register uint32_t __regMainStackPointer __asm("msp"); N return(__regMainStackPointer); N} N N N/** N \brief Set Main Stack Pointer N \details Assigns the given value to the Main Stack Pointer (MSP). N \param [in] topOfMainStack Main Stack Pointer value to set N */ N__STATIC_INLINE void __set_MSP(uint32_t topOfMainStack) Xstatic __inline void __set_MSP(uint32_t topOfMainStack) N{ N register uint32_t __regMainStackPointer __ASM("msp"); X register uint32_t __regMainStackPointer __asm("msp"); N __regMainStackPointer = topOfMainStack; N} N N N/** N \brief Get Priority Mask N \details Returns the current state of the priority mask bit from the Priority Mask Register. N \return Priority Mask value N */ N__STATIC_INLINE uint32_t __get_PRIMASK(void) Xstatic __inline uint32_t __get_PRIMASK(void) N{ N register uint32_t __regPriMask __ASM("primask"); X register uint32_t __regPriMask __asm("primask"); N return(__regPriMask); N} N N N/** N \brief Set Priority Mask N \details Assigns the given value to the Priority Mask Register. N \param [in] priMask Priority Mask N */ N__STATIC_INLINE void __set_PRIMASK(uint32_t priMask) Xstatic __inline void __set_PRIMASK(uint32_t priMask) N{ N register uint32_t __regPriMask __ASM("primask"); X register uint32_t __regPriMask __asm("primask"); N __regPriMask = (priMask); N} N N N#if ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ N (defined (__ARM_ARCH_7EM__) && (__ARM_ARCH_7EM__ == 1)) ) X#if ((0L && (__ARM_ARCH_7M__ == 1)) || (0L && (__ARM_ARCH_7EM__ == 1)) ) S S/** S \brief Enable FIQ S \details Enables FIQ interrupts by clearing the F-bit in the CPSR. S Can only be executed in Privileged modes. S */ S#define __enable_fault_irq __enable_fiq S S S/** S \brief Disable FIQ S \details Disables FIQ interrupts by setting the F-bit in the CPSR. S Can only be executed in Privileged modes. S */ S#define __disable_fault_irq __disable_fiq S S S/** S \brief Get Base Priority S \details Returns the current value of the Base Priority register. S \return Base Priority register value S */ S__STATIC_INLINE uint32_t __get_BASEPRI(void) S{ S register uint32_t __regBasePri __ASM("basepri"); S return(__regBasePri); S} S S S/** S \brief Set Base Priority S \details Assigns the given value to the Base Priority register. S \param [in] basePri Base Priority value to set S */ S__STATIC_INLINE void __set_BASEPRI(uint32_t basePri) S{ S register uint32_t __regBasePri __ASM("basepri"); S __regBasePri = (basePri & 0xFFU); S} S S S/** S \brief Set Base Priority with condition S \details Assigns the given value to the Base Priority register only if BASEPRI masking is disabled, S or the new value increases the BASEPRI priority level. S \param [in] basePri Base Priority value to set S */ S__STATIC_INLINE void __set_BASEPRI_MAX(uint32_t basePri) S{ S register uint32_t __regBasePriMax __ASM("basepri_max"); S __regBasePriMax = (basePri & 0xFFU); S} S S S/** S \brief Get Fault Mask S \details Returns the current value of the Fault Mask register. S \return Fault Mask register value S */ S__STATIC_INLINE uint32_t __get_FAULTMASK(void) S{ S register uint32_t __regFaultMask __ASM("faultmask"); S return(__regFaultMask); S} S S S/** S \brief Set Fault Mask S \details Assigns the given value to the Fault Mask register. S \param [in] faultMask Fault Mask value to set S */ S__STATIC_INLINE void __set_FAULTMASK(uint32_t faultMask) S{ S register uint32_t __regFaultMask __ASM("faultmask"); S __regFaultMask = (faultMask & (uint32_t)1U); S} S N#endif /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ N (defined (__ARM_ARCH_7EM__) && (__ARM_ARCH_7EM__ == 1)) ) */ X#endif N N N/** N \brief Get FPSCR N \details Returns the current value of the Floating Point Status/Control register. N \return Floating Point Status/Control register value N */ N__STATIC_INLINE uint32_t __get_FPSCR(void) Xstatic __inline uint32_t __get_FPSCR(void) N{ N#if ((defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)) && \ N (defined (__FPU_USED ) && (__FPU_USED == 1U)) ) X#if ((1L && (0U == 1U)) && (1L && (0U == 1U)) ) S register uint32_t __regfpscr __ASM("fpscr"); S return(__regfpscr); N#else N return(0U); N#endif N} N N N/** N \brief Set FPSCR N \details Assigns the given value to the Floating Point Status/Control register. N \param [in] fpscr Floating Point Status/Control value to set N */ N__STATIC_INLINE void __set_FPSCR(uint32_t fpscr) Xstatic __inline void __set_FPSCR(uint32_t fpscr) N{ N#if ((defined (__FPU_PRESENT) && (__FPU_PRESENT == 1U)) && \ N (defined (__FPU_USED ) && (__FPU_USED == 1U)) ) X#if ((1L && (0U == 1U)) && (1L && (0U == 1U)) ) S register uint32_t __regfpscr __ASM("fpscr"); S __regfpscr = (fpscr); N#else N (void)fpscr; N#endif N} N N N/*@} end of CMSIS_Core_RegAccFunctions */ N N N/* ########################## Core Instruction Access ######################### */ N/** \defgroup CMSIS_Core_InstructionInterface CMSIS Core Instruction Interface N Access to dedicated instructions N @{ N*/ N N/** N \brief No Operation N \details No Operation does nothing. This instruction can be used for code alignment purposes. N */ N#define __NOP __nop N N N/** N \brief Wait For Interrupt N \details Wait For Interrupt is a hint instruction that suspends execution until one of a number of events occurs. N */ N#define __WFI __wfi N N N/** N \brief Wait For Event N \details Wait For Event is a hint instruction that permits the processor to enter N a low-power state until one of a number of events occurs. N */ N#define __WFE __wfe N N N/** N \brief Send Event N \details Send Event is a hint instruction. It causes an event to be signaled to the CPU. N */ N#define __SEV __sev N N N/** N \brief Instruction Synchronization Barrier N \details Instruction Synchronization Barrier flushes the pipeline in the processor, N so that all instructions following the ISB are fetched from cache or memory, N after the instruction has been completed. N */ N#define __ISB() do {\ N __schedule_barrier();\ N __isb(0xF);\ N __schedule_barrier();\ N } while (0U) X#define __ISB() do { __schedule_barrier(); __isb(0xF); __schedule_barrier(); } while (0U) N N/** N \brief Data Synchronization Barrier N \details Acts as a special kind of Data Memory Barrier. N It completes when all explicit memory accesses before this instruction complete. N */ N#define __DSB() do {\ N __schedule_barrier();\ N __dsb(0xF);\ N __schedule_barrier();\ N } while (0U) X#define __DSB() do { __schedule_barrier(); __dsb(0xF); __schedule_barrier(); } while (0U) N N/** N \brief Data Memory Barrier N \details Ensures the apparent order of the explicit memory operations before N and after the instruction, without ensuring their completion. N */ N#define __DMB() do {\ N __schedule_barrier();\ N __dmb(0xF);\ N __schedule_barrier();\ N } while (0U) X#define __DMB() do { __schedule_barrier(); __dmb(0xF); __schedule_barrier(); } while (0U) N N N/** N \brief Reverse byte order (32 bit) N \details Reverses the byte order in unsigned integer value. For example, 0x12345678 becomes 0x78563412. N \param [in] value Value to reverse N \return Reversed value N */ N#define __REV __rev N N N/** N \brief Reverse byte order (16 bit) N \details Reverses the byte order within each halfword of a word. For example, 0x12345678 becomes 0x34127856. N \param [in] value Value to reverse N \return Reversed value N */ N#ifndef __NO_EMBEDDED_ASM N__attribute__((section(".rev16_text"))) __STATIC_INLINE __ASM uint32_t __REV16(uint32_t value) X__attribute__((section(".rev16_text"))) static __inline __asm uint32_t __REV16(uint32_t value) N{ N rev16 r0, r0 N bx lr N} N#endif N N N/** N \brief Reverse byte order (16 bit) N \details Reverses the byte order in a 16-bit value and returns the signed 16-bit result. For example, 0x0080 becomes 0x8000. N \param [in] value Value to reverse N \return Reversed value N */ N#ifndef __NO_EMBEDDED_ASM N__attribute__((section(".revsh_text"))) __STATIC_INLINE __ASM int16_t __REVSH(int16_t value) X__attribute__((section(".revsh_text"))) static __inline __asm int16_t __REVSH(int16_t value) N{ N revsh r0, r0 N bx lr N} N#endif N N N/** N \brief Rotate Right in unsigned value (32 bit) N \details Rotate Right (immediate) provides the value of the contents of a register rotated by a variable number of bits. N \param [in] op1 Value to rotate N \param [in] op2 Number of Bits to rotate N \return Rotated value N */ N#define __ROR __ror N N N/** N \brief Breakpoint N \details Causes the processor to enter Debug state. N Debug tools can use this to investigate system state when the instruction at a particular address is reached. N \param [in] value is ignored by the processor. N If required, a debugger can use it to store additional information about the breakpoint. N */ N#define __BKPT(value) __breakpoint(value) N N N/** N \brief Reverse bit order of value N \details Reverses the bit order of the given value. N \param [in] value Value to reverse N \return Reversed value N */ N#if ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ N (defined (__ARM_ARCH_7EM__) && (__ARM_ARCH_7EM__ == 1)) ) X#if ((0L && (__ARM_ARCH_7M__ == 1)) || (0L && (__ARM_ARCH_7EM__ == 1)) ) S #define __RBIT __rbit N#else N__attribute__((always_inline)) __STATIC_INLINE uint32_t __RBIT(uint32_t value) X__attribute__((always_inline)) static __inline uint32_t __RBIT(uint32_t value) N{ N uint32_t result; N uint32_t s = (4U /*sizeof(v)*/ * 8U) - 1U; /* extra shift needed at end */ N N result = value; /* r will be reversed bits of v; first get LSB of v */ N for (value >>= 1U; value != 0U; value >>= 1U) N { N result <<= 1U; N result |= value & 1U; N s--; N } N result <<= s; /* shift when v's highest bits are zero */ N return result; N} N#endif N N N/** N \brief Count leading zeros N \details Counts the number of leading zeros of a data value. N \param [in] value Value to count the leading zeros N \return number of leading zeros in value N */ N#define __CLZ __clz N N N#if ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ N (defined (__ARM_ARCH_7EM__) && (__ARM_ARCH_7EM__ == 1)) ) X#if ((0L && (__ARM_ARCH_7M__ == 1)) || (0L && (__ARM_ARCH_7EM__ == 1)) ) S S/** S \brief LDR Exclusive (8 bit) S \details Executes a exclusive LDR instruction for 8 bit value. S \param [in] ptr Pointer to data S \return value of type uint8_t at (*ptr) S */ S#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION < 5060020) S #define __LDREXB(ptr) ((uint8_t ) __ldrex(ptr)) S#else S #define __LDREXB(ptr) _Pragma("push") _Pragma("diag_suppress 3731") ((uint8_t ) __ldrex(ptr)) _Pragma("pop") S#endif S S S/** S \brief LDR Exclusive (16 bit) S \details Executes a exclusive LDR instruction for 16 bit values. S \param [in] ptr Pointer to data S \return value of type uint16_t at (*ptr) S */ S#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION < 5060020) S #define __LDREXH(ptr) ((uint16_t) __ldrex(ptr)) S#else S #define __LDREXH(ptr) _Pragma("push") _Pragma("diag_suppress 3731") ((uint16_t) __ldrex(ptr)) _Pragma("pop") S#endif S S S/** S \brief LDR Exclusive (32 bit) S \details Executes a exclusive LDR instruction for 32 bit values. S \param [in] ptr Pointer to data S \return value of type uint32_t at (*ptr) S */ S#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION < 5060020) S #define __LDREXW(ptr) ((uint32_t ) __ldrex(ptr)) S#else S #define __LDREXW(ptr) _Pragma("push") _Pragma("diag_suppress 3731") ((uint32_t ) __ldrex(ptr)) _Pragma("pop") S#endif S S S/** S \brief STR Exclusive (8 bit) S \details Executes a exclusive STR instruction for 8 bit values. S \param [in] value Value to store S \param [in] ptr Pointer to location S \return 0 Function succeeded S \return 1 Function failed S */ S#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION < 5060020) S #define __STREXB(value, ptr) __strex(value, ptr) S#else S #define __STREXB(value, ptr) _Pragma("push") _Pragma("diag_suppress 3731") __strex(value, ptr) _Pragma("pop") S#endif S S S/** S \brief STR Exclusive (16 bit) S \details Executes a exclusive STR instruction for 16 bit values. S \param [in] value Value to store S \param [in] ptr Pointer to location S \return 0 Function succeeded S \return 1 Function failed S */ S#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION < 5060020) S #define __STREXH(value, ptr) __strex(value, ptr) S#else S #define __STREXH(value, ptr) _Pragma("push") _Pragma("diag_suppress 3731") __strex(value, ptr) _Pragma("pop") S#endif S S S/** S \brief STR Exclusive (32 bit) S \details Executes a exclusive STR instruction for 32 bit values. S \param [in] value Value to store S \param [in] ptr Pointer to location S \return 0 Function succeeded S \return 1 Function failed S */ S#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION < 5060020) S #define __STREXW(value, ptr) __strex(value, ptr) S#else S #define __STREXW(value, ptr) _Pragma("push") _Pragma("diag_suppress 3731") __strex(value, ptr) _Pragma("pop") S#endif S S S/** S \brief Remove the exclusive lock S \details Removes the exclusive lock which is created by LDREX. S */ S#define __CLREX __clrex S S S/** S \brief Signed Saturate S \details Saturates a signed value. S \param [in] value Value to be saturated S \param [in] sat Bit position to saturate to (1..32) S \return Saturated value S */ S#define __SSAT __ssat S S S/** S \brief Unsigned Saturate S \details Saturates an unsigned value. S \param [in] value Value to be saturated S \param [in] sat Bit position to saturate to (0..31) S \return Saturated value S */ S#define __USAT __usat S S S/** S \brief Rotate Right with Extend (32 bit) S \details Moves each bit of a bitstring right by one bit. S The carry input is shifted in at the left end of the bitstring. S \param [in] value Value to rotate S \return Rotated value S */ S#ifndef __NO_EMBEDDED_ASM S__attribute__((section(".rrx_text"))) __STATIC_INLINE __ASM uint32_t __RRX(uint32_t value) S{ S rrx r0, r0 S bx lr S} S#endif S S S/** S \brief LDRT Unprivileged (8 bit) S \details Executes a Unprivileged LDRT instruction for 8 bit value. S \param [in] ptr Pointer to data S \return value of type uint8_t at (*ptr) S */ S#define __LDRBT(ptr) ((uint8_t ) __ldrt(ptr)) S S S/** S \brief LDRT Unprivileged (16 bit) S \details Executes a Unprivileged LDRT instruction for 16 bit values. S \param [in] ptr Pointer to data S \return value of type uint16_t at (*ptr) S */ S#define __LDRHT(ptr) ((uint16_t) __ldrt(ptr)) S S S/** S \brief LDRT Unprivileged (32 bit) S \details Executes a Unprivileged LDRT instruction for 32 bit values. S \param [in] ptr Pointer to data S \return value of type uint32_t at (*ptr) S */ S#define __LDRT(ptr) ((uint32_t ) __ldrt(ptr)) S S S/** S \brief STRT Unprivileged (8 bit) S \details Executes a Unprivileged STRT instruction for 8 bit values. S \param [in] value Value to store S \param [in] ptr Pointer to location S */ S#define __STRBT(value, ptr) __strt(value, ptr) S S S/** S \brief STRT Unprivileged (16 bit) S \details Executes a Unprivileged STRT instruction for 16 bit values. S \param [in] value Value to store S \param [in] ptr Pointer to location S */ S#define __STRHT(value, ptr) __strt(value, ptr) S S S/** S \brief STRT Unprivileged (32 bit) S \details Executes a Unprivileged STRT instruction for 32 bit values. S \param [in] value Value to store S \param [in] ptr Pointer to location S */ S#define __STRT(value, ptr) __strt(value, ptr) S N#else /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ N (defined (__ARM_ARCH_7EM__) && (__ARM_ARCH_7EM__ == 1)) ) */ X#else N N/** N \brief Signed Saturate N \details Saturates a signed value. N \param [in] value Value to be saturated N \param [in] sat Bit position to saturate to (1..32) N \return Saturated value N */ N__attribute__((always_inline)) __STATIC_INLINE int32_t __SSAT(int32_t val, uint32_t sat) X__attribute__((always_inline)) static __inline int32_t __SSAT(int32_t val, uint32_t sat) N{ N if ((sat >= 1U) && (sat <= 32U)) N { N const int32_t max = (int32_t)((1U << (sat - 1U)) - 1U); N const int32_t min = -1 - max ; N if (val > max) N { N return max; N } N else if (val < min) N { N return min; N } N } N return val; N} N N/** N \brief Unsigned Saturate N \details Saturates an unsigned value. N \param [in] value Value to be saturated N \param [in] sat Bit position to saturate to (0..31) N \return Saturated value N */ N__attribute__((always_inline)) __STATIC_INLINE uint32_t __USAT(int32_t val, uint32_t sat) X__attribute__((always_inline)) static __inline uint32_t __USAT(int32_t val, uint32_t sat) N{ N if (sat <= 31U) N { N const uint32_t max = ((1U << sat) - 1U); N if (val > (int32_t)max) N { N return max; N } N else if (val < 0) N { N return 0U; N } N } N return (uint32_t)val; N} N N#endif /* ((defined (__ARM_ARCH_7M__ ) && (__ARM_ARCH_7M__ == 1)) || \ N (defined (__ARM_ARCH_7EM__) && (__ARM_ARCH_7EM__ == 1)) ) */ X#endif N N/*@}*/ /* end of group CMSIS_Core_InstructionInterface */ N N N/* ################### Compiler specific Intrinsics ########################### */ N/** \defgroup CMSIS_SIMD_intrinsics CMSIS SIMD Intrinsics N Access to dedicated SIMD instructions N @{ N*/ N N#if ((defined (__ARM_ARCH_7EM__) && (__ARM_ARCH_7EM__ == 1)) ) X#if ((0L && (__ARM_ARCH_7EM__ == 1)) ) S S#define __SADD8 __sadd8 S#define __QADD8 __qadd8 S#define __SHADD8 __shadd8 S#define __UADD8 __uadd8 S#define __UQADD8 __uqadd8 S#define __UHADD8 __uhadd8 S#define __SSUB8 __ssub8 S#define __QSUB8 __qsub8 S#define __SHSUB8 __shsub8 S#define __USUB8 __usub8 S#define __UQSUB8 __uqsub8 S#define __UHSUB8 __uhsub8 S#define __SADD16 __sadd16 S#define __QADD16 __qadd16 S#define __SHADD16 __shadd16 S#define __UADD16 __uadd16 S#define __UQADD16 __uqadd16 S#define __UHADD16 __uhadd16 S#define __SSUB16 __ssub16 S#define __QSUB16 __qsub16 S#define __SHSUB16 __shsub16 S#define __USUB16 __usub16 S#define __UQSUB16 __uqsub16 S#define __UHSUB16 __uhsub16 S#define __SASX __sasx S#define __QASX __qasx S#define __SHASX __shasx S#define __UASX __uasx S#define __UQASX __uqasx S#define __UHASX __uhasx S#define __SSAX __ssax S#define __QSAX __qsax S#define __SHSAX __shsax S#define __USAX __usax S#define __UQSAX __uqsax S#define __UHSAX __uhsax S#define __USAD8 __usad8 S#define __USADA8 __usada8 S#define __SSAT16 __ssat16 S#define __USAT16 __usat16 S#define __UXTB16 __uxtb16 S#define __UXTAB16 __uxtab16 S#define __SXTB16 __sxtb16 S#define __SXTAB16 __sxtab16 S#define __SMUAD __smuad S#define __SMUADX __smuadx S#define __SMLAD __smlad S#define __SMLADX __smladx S#define __SMLALD __smlald S#define __SMLALDX __smlaldx S#define __SMUSD __smusd S#define __SMUSDX __smusdx S#define __SMLSD __smlsd S#define __SMLSDX __smlsdx S#define __SMLSLD __smlsld S#define __SMLSLDX __smlsldx S#define __SEL __sel S#define __QADD __qadd S#define __QSUB __qsub S S#define __PKHBT(ARG1,ARG2,ARG3) ( ((((uint32_t)(ARG1)) ) & 0x0000FFFFUL) | \ S ((((uint32_t)(ARG2)) << (ARG3)) & 0xFFFF0000UL) ) X#define __PKHBT(ARG1,ARG2,ARG3) ( ((((uint32_t)(ARG1)) ) & 0x0000FFFFUL) | ((((uint32_t)(ARG2)) << (ARG3)) & 0xFFFF0000UL) ) S S#define __PKHTB(ARG1,ARG2,ARG3) ( ((((uint32_t)(ARG1)) ) & 0xFFFF0000UL) | \ S ((((uint32_t)(ARG2)) >> (ARG3)) & 0x0000FFFFUL) ) X#define __PKHTB(ARG1,ARG2,ARG3) ( ((((uint32_t)(ARG1)) ) & 0xFFFF0000UL) | ((((uint32_t)(ARG2)) >> (ARG3)) & 0x0000FFFFUL) ) S S#define __SMMLA(ARG1,ARG2,ARG3) ( (int32_t)((((int64_t)(ARG1) * (ARG2)) + \ S ((int64_t)(ARG3) << 32U) ) >> 32U)) X#define __SMMLA(ARG1,ARG2,ARG3) ( (int32_t)((((int64_t)(ARG1) * (ARG2)) + ((int64_t)(ARG3) << 32U) ) >> 32U)) S N#endif /* ((defined (__ARM_ARCH_7EM__) && (__ARM_ARCH_7EM__ == 1)) ) */ N/*@} end of group CMSIS_SIMD_intrinsics */ N N N#endif /* __CMSIS_ARMCC_H */ L 35 "C:\Users\Markin\AppData\Local\Arm\Packs\ARM\CMSIS\5.5.1\CMSIS\Core\Include\cmsis_compiler.h" 2 N N N/* N * Arm Compiler 6.6 LTM (armclang) N */ N#elif defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) && (__ARMCC_VERSION < 6100100) X#elif 1L && (5060750 >= 6010050) && (5060750 < 6100100) S #include "cmsis_armclang_ltm.h" S S /* S * Arm Compiler above 6.10.1 (armclang) S */ S#elif defined (__ARMCC_VERSION) && (__ARMCC_VERSION >= 6100100) S #include "cmsis_armclang.h" S S S/* S * GNU Compiler S */ S#elif defined ( __GNUC__ ) S #include "cmsis_gcc.h" S S S/* S * IAR Compiler S */ S#elif defined ( __ICCARM__ ) S #include S S S/* S * TI Arm Compiler S */ S#elif defined ( __TI_ARM__ ) S #include S S #ifndef __ASM S #define __ASM __asm S #endif S #ifndef __INLINE S #define __INLINE inline S #endif S #ifndef __STATIC_INLINE S #define __STATIC_INLINE static inline S #endif S #ifndef __STATIC_FORCEINLINE S #define __STATIC_FORCEINLINE __STATIC_INLINE S #endif S #ifndef __NO_RETURN S #define __NO_RETURN __attribute__((noreturn)) S #endif S #ifndef __USED S #define __USED __attribute__((used)) S #endif S #ifndef __WEAK S #define __WEAK __attribute__((weak)) S #endif S #ifndef __PACKED S #define __PACKED __attribute__((packed)) S #endif S #ifndef __PACKED_STRUCT S #define __PACKED_STRUCT struct __attribute__((packed)) S #endif S #ifndef __PACKED_UNION S #define __PACKED_UNION union __attribute__((packed)) S #endif S #ifndef __UNALIGNED_UINT32 /* deprecated */ S struct __attribute__((packed)) T_UINT32 { uint32_t v; }; S #define __UNALIGNED_UINT32(x) (((struct T_UINT32 *)(x))->v) S #endif S #ifndef __UNALIGNED_UINT16_WRITE S __PACKED_STRUCT T_UINT16_WRITE { uint16_t v; }; S #define __UNALIGNED_UINT16_WRITE(addr, val) (void)((((struct T_UINT16_WRITE *)(void*)(addr))->v) = (val)) S #endif S #ifndef __UNALIGNED_UINT16_READ S __PACKED_STRUCT T_UINT16_READ { uint16_t v; }; S #define __UNALIGNED_UINT16_READ(addr) (((const struct T_UINT16_READ *)(const void *)(addr))->v) S #endif S #ifndef __UNALIGNED_UINT32_WRITE S __PACKED_STRUCT T_UINT32_WRITE { uint32_t v; }; S #define __UNALIGNED_UINT32_WRITE(addr, val) (void)((((struct T_UINT32_WRITE *)(void *)(addr))->v) = (val)) S #endif S #ifndef __UNALIGNED_UINT32_READ S __PACKED_STRUCT T_UINT32_READ { uint32_t v; }; S #define __UNALIGNED_UINT32_READ(addr) (((const struct T_UINT32_READ *)(const void *)(addr))->v) S #endif S #ifndef __ALIGNED S #define __ALIGNED(x) __attribute__((aligned(x))) S #endif S #ifndef __RESTRICT S #define __RESTRICT __restrict S #endif S S S/* S * TASKING Compiler S */ S#elif defined ( __TASKING__ ) S /* S * The CMSIS functions have been implemented as intrinsics in the compiler. S * Please use "carm -?i" to get an up to date list of all intrinsics, S * Including the CMSIS ones. S */ S S #ifndef __ASM S #define __ASM __asm S #endif S #ifndef __INLINE S #define __INLINE inline S #endif S #ifndef __STATIC_INLINE S #define __STATIC_INLINE static inline S #endif S #ifndef __STATIC_FORCEINLINE S #define __STATIC_FORCEINLINE __STATIC_INLINE S #endif S #ifndef __NO_RETURN S #define __NO_RETURN __attribute__((noreturn)) S #endif S #ifndef __USED S #define __USED __attribute__((used)) S #endif S #ifndef __WEAK S #define __WEAK __attribute__((weak)) S #endif S #ifndef __PACKED S #define __PACKED __packed__ S #endif S #ifndef __PACKED_STRUCT S #define __PACKED_STRUCT struct __packed__ S #endif S #ifndef __PACKED_UNION S #define __PACKED_UNION union __packed__ S #endif S #ifndef __UNALIGNED_UINT32 /* deprecated */ S struct __packed__ T_UINT32 { uint32_t v; }; S #define __UNALIGNED_UINT32(x) (((struct T_UINT32 *)(x))->v) S #endif S #ifndef __UNALIGNED_UINT16_WRITE S __PACKED_STRUCT T_UINT16_WRITE { uint16_t v; }; S #define __UNALIGNED_UINT16_WRITE(addr, val) (void)((((struct T_UINT16_WRITE *)(void *)(addr))->v) = (val)) S #endif S #ifndef __UNALIGNED_UINT16_READ S __PACKED_STRUCT T_UINT16_READ { uint16_t v; }; S #define __UNALIGNED_UINT16_READ(addr) (((const struct T_UINT16_READ *)(const void *)(addr))->v) S #endif S #ifndef __UNALIGNED_UINT32_WRITE S __PACKED_STRUCT T_UINT32_WRITE { uint32_t v; }; S #define __UNALIGNED_UINT32_WRITE(addr, val) (void)((((struct T_UINT32_WRITE *)(void *)(addr))->v) = (val)) S #endif S #ifndef __UNALIGNED_UINT32_READ S __PACKED_STRUCT T_UINT32_READ { uint32_t v; }; S #define __UNALIGNED_UINT32_READ(addr) (((const struct T_UINT32_READ *)(const void *)(addr))->v) S #endif S #ifndef __ALIGNED S #define __ALIGNED(x) __align(x) S #endif S #ifndef __RESTRICT S #warning No compiler specific solution for __RESTRICT. __RESTRICT is ignored. S #define __RESTRICT S #endif S S S/* S * COSMIC Compiler S */ S#elif defined ( __CSMC__ ) S #include S S #ifndef __ASM S #define __ASM _asm S #endif S #ifndef __INLINE S #define __INLINE inline S #endif S #ifndef __STATIC_INLINE S #define __STATIC_INLINE static inline S #endif S #ifndef __STATIC_FORCEINLINE S #define __STATIC_FORCEINLINE __STATIC_INLINE S #endif S #ifndef __NO_RETURN S // NO RETURN is automatically detected hence no warning here S #define __NO_RETURN S #endif S #ifndef __USED S #warning No compiler specific solution for __USED. __USED is ignored. S #define __USED S #endif S #ifndef __WEAK S #define __WEAK __weak S #endif S #ifndef __PACKED S #define __PACKED @packed S #endif S #ifndef __PACKED_STRUCT S #define __PACKED_STRUCT @packed struct S #endif S #ifndef __PACKED_UNION S #define __PACKED_UNION @packed union S #endif S #ifndef __UNALIGNED_UINT32 /* deprecated */ S @packed struct T_UINT32 { uint32_t v; }; S #define __UNALIGNED_UINT32(x) (((struct T_UINT32 *)(x))->v) S #endif S #ifndef __UNALIGNED_UINT16_WRITE S __PACKED_STRUCT T_UINT16_WRITE { uint16_t v; }; S #define __UNALIGNED_UINT16_WRITE(addr, val) (void)((((struct T_UINT16_WRITE *)(void *)(addr))->v) = (val)) S #endif S #ifndef __UNALIGNED_UINT16_READ S __PACKED_STRUCT T_UINT16_READ { uint16_t v; }; S #define __UNALIGNED_UINT16_READ(addr) (((const struct T_UINT16_READ *)(const void *)(addr))->v) S #endif S #ifndef __UNALIGNED_UINT32_WRITE S __PACKED_STRUCT T_UINT32_WRITE { uint32_t v; }; S #define __UNALIGNED_UINT32_WRITE(addr, val) (void)((((struct T_UINT32_WRITE *)(void *)(addr))->v) = (val)) S #endif S #ifndef __UNALIGNED_UINT32_READ S __PACKED_STRUCT T_UINT32_READ { uint32_t v; }; S #define __UNALIGNED_UINT32_READ(addr) (((const struct T_UINT32_READ *)(const void *)(addr))->v) S #endif S #ifndef __ALIGNED S #warning No compiler specific solution for __ALIGNED. __ALIGNED is ignored. S #define __ALIGNED(x) S #endif S #ifndef __RESTRICT S #warning No compiler specific solution for __RESTRICT. __RESTRICT is ignored. S #define __RESTRICT S #endif S S S#else S #error Unknown compiler. N#endif N N N#endif /* __CMSIS_COMPILER_H */ N L 116 "C:\Users\Markin\AppData\Local\Arm\Packs\ARM\CMSIS\5.5.1\CMSIS\Core\Include\core_cm0.h" 2 N N N#ifdef __cplusplus S} N#endif N N#endif /* __CORE_CM0_H_GENERIC */ N N#ifndef __CMSIS_GENERIC N N#ifndef __CORE_CM0_H_DEPENDANT N#define __CORE_CM0_H_DEPENDANT N N#ifdef __cplusplus S extern "C" { N#endif N N/* check device defines and use defaults */ N#if defined __CHECK_DEVICE_DEFINES X#if 0L S #ifndef __CM0_REV S #define __CM0_REV 0x0000U S #warning "__CM0_REV not defined in device header file; using default!" S #endif S S #ifndef __NVIC_PRIO_BITS S #define __NVIC_PRIO_BITS 2U S #warning "__NVIC_PRIO_BITS not defined in device header file; using default!" S #endif S S #ifndef __Vendor_SysTickConfig S #define __Vendor_SysTickConfig 0U S #warning "__Vendor_SysTickConfig not defined in device header file; using default!" S #endif N#endif N N/* IO definitions (access restrictions to peripheral registers) */ N/** N \defgroup CMSIS_glob_defs CMSIS Global Defines N N IO Type Qualifiers are used N \li to specify the access to peripheral variables. N \li for automatic generation of peripheral register debug information. N*/ N#ifdef __cplusplus S #define __I volatile /*!< Defines 'read only' permissions */ N#else N #define __I volatile const /*!< Defines 'read only' permissions */ N#endif N#define __O volatile /*!< Defines 'write only' permissions */ N#define __IO volatile /*!< Defines 'read / write' permissions */ N N/* following defines should be used for structure members */ N#define __IM volatile const /*! Defines 'read only' structure member permissions */ N#define __OM volatile /*! Defines 'write only' structure member permissions */ N#define __IOM volatile /*! Defines 'read / write' structure member permissions */ N N/*@} end of group Cortex_M0 */ N N N N/******************************************************************************* N * Register Abstraction N Core Register contain: N - Core Register N - Core NVIC Register N - Core SCB Register N - Core SysTick Register N ******************************************************************************/ N/** N \defgroup CMSIS_core_register Defines and Type Definitions N \brief Type definitions and defines for Cortex-M processor based devices. N*/ N N/** N \ingroup CMSIS_core_register N \defgroup CMSIS_CORE Status and Control Registers N \brief Core Register type definitions. N @{ N */ N N/** N \brief Union type to access the Application Program Status Register (APSR). N */ Ntypedef union N{ N struct N { N uint32_t _reserved0:28; /*!< bit: 0..27 Reserved */ N uint32_t V:1; /*!< bit: 28 Overflow condition code flag */ N uint32_t C:1; /*!< bit: 29 Carry condition code flag */ N uint32_t Z:1; /*!< bit: 30 Zero condition code flag */ N uint32_t N:1; /*!< bit: 31 Negative condition code flag */ N } b; /*!< Structure used for bit access */ N uint32_t w; /*!< Type used for word access */ N} APSR_Type; N N/* APSR Register Definitions */ N#define APSR_N_Pos 31U /*!< APSR: N Position */ N#define APSR_N_Msk (1UL << APSR_N_Pos) /*!< APSR: N Mask */ N N#define APSR_Z_Pos 30U /*!< APSR: Z Position */ N#define APSR_Z_Msk (1UL << APSR_Z_Pos) /*!< APSR: Z Mask */ N N#define APSR_C_Pos 29U /*!< APSR: C Position */ N#define APSR_C_Msk (1UL << APSR_C_Pos) /*!< APSR: C Mask */ N N#define APSR_V_Pos 28U /*!< APSR: V Position */ N#define APSR_V_Msk (1UL << APSR_V_Pos) /*!< APSR: V Mask */ N N N/** N \brief Union type to access the Interrupt Program Status Register (IPSR). N */ Ntypedef union N{ N struct N { N uint32_t ISR:9; /*!< bit: 0.. 8 Exception number */ N uint32_t _reserved0:23; /*!< bit: 9..31 Reserved */ N } b; /*!< Structure used for bit access */ N uint32_t w; /*!< Type used for word access */ N} IPSR_Type; N N/* IPSR Register Definitions */ N#define IPSR_ISR_Pos 0U /*!< IPSR: ISR Position */ N#define IPSR_ISR_Msk (0x1FFUL /*<< IPSR_ISR_Pos*/) /*!< IPSR: ISR Mask */ N N N/** N \brief Union type to access the Special-Purpose Program Status Registers (xPSR). N */ Ntypedef union N{ N struct N { N uint32_t ISR:9; /*!< bit: 0.. 8 Exception number */ N uint32_t _reserved0:15; /*!< bit: 9..23 Reserved */ N uint32_t T:1; /*!< bit: 24 Thumb bit (read 0) */ N uint32_t _reserved1:3; /*!< bit: 25..27 Reserved */ N uint32_t V:1; /*!< bit: 28 Overflow condition code flag */ N uint32_t C:1; /*!< bit: 29 Carry condition code flag */ N uint32_t Z:1; /*!< bit: 30 Zero condition code flag */ N uint32_t N:1; /*!< bit: 31 Negative condition code flag */ N } b; /*!< Structure used for bit access */ N uint32_t w; /*!< Type used for word access */ N} xPSR_Type; N N/* xPSR Register Definitions */ N#define xPSR_N_Pos 31U /*!< xPSR: N Position */ N#define xPSR_N_Msk (1UL << xPSR_N_Pos) /*!< xPSR: N Mask */ N N#define xPSR_Z_Pos 30U /*!< xPSR: Z Position */ N#define xPSR_Z_Msk (1UL << xPSR_Z_Pos) /*!< xPSR: Z Mask */ N N#define xPSR_C_Pos 29U /*!< xPSR: C Position */ N#define xPSR_C_Msk (1UL << xPSR_C_Pos) /*!< xPSR: C Mask */ N N#define xPSR_V_Pos 28U /*!< xPSR: V Position */ N#define xPSR_V_Msk (1UL << xPSR_V_Pos) /*!< xPSR: V Mask */ N N#define xPSR_T_Pos 24U /*!< xPSR: T Position */ N#define xPSR_T_Msk (1UL << xPSR_T_Pos) /*!< xPSR: T Mask */ N N#define xPSR_ISR_Pos 0U /*!< xPSR: ISR Position */ N#define xPSR_ISR_Msk (0x1FFUL /*<< xPSR_ISR_Pos*/) /*!< xPSR: ISR Mask */ N N N/** N \brief Union type to access the Control Registers (CONTROL). N */ Ntypedef union N{ N struct N { N uint32_t _reserved0:1; /*!< bit: 0 Reserved */ N uint32_t SPSEL:1; /*!< bit: 1 Stack to be used */ N uint32_t _reserved1:30; /*!< bit: 2..31 Reserved */ N } b; /*!< Structure used for bit access */ N uint32_t w; /*!< Type used for word access */ N} CONTROL_Type; N N/* CONTROL Register Definitions */ N#define CONTROL_SPSEL_Pos 1U /*!< CONTROL: SPSEL Position */ N#define CONTROL_SPSEL_Msk (1UL << CONTROL_SPSEL_Pos) /*!< CONTROL: SPSEL Mask */ N N/*@} end of group CMSIS_CORE */ N N N/** N \ingroup CMSIS_core_register N \defgroup CMSIS_NVIC Nested Vectored Interrupt Controller (NVIC) N \brief Type definitions for the NVIC Registers N @{ N */ N N/** N \brief Structure type to access the Nested Vectored Interrupt Controller (NVIC). N */ Ntypedef struct N{ N __IOM uint32_t ISER[1U]; /*!< Offset: 0x000 (R/W) Interrupt Set Enable Register */ X volatile uint32_t ISER[1U]; N uint32_t RESERVED0[31U]; N __IOM uint32_t ICER[1U]; /*!< Offset: 0x080 (R/W) Interrupt Clear Enable Register */ X volatile uint32_t ICER[1U]; N uint32_t RESERVED1[31U]; N __IOM uint32_t ISPR[1U]; /*!< Offset: 0x100 (R/W) Interrupt Set Pending Register */ X volatile uint32_t ISPR[1U]; N uint32_t RESERVED2[31U]; N __IOM uint32_t ICPR[1U]; /*!< Offset: 0x180 (R/W) Interrupt Clear Pending Register */ X volatile uint32_t ICPR[1U]; N uint32_t RESERVED3[31U]; N uint32_t RESERVED4[64U]; N __IOM uint32_t IP[8U]; /*!< Offset: 0x300 (R/W) Interrupt Priority Register */ X volatile uint32_t IP[8U]; N} NVIC_Type; N N/*@} end of group CMSIS_NVIC */ N N N/** N \ingroup CMSIS_core_register N \defgroup CMSIS_SCB System Control Block (SCB) N \brief Type definitions for the System Control Block Registers N @{ N */ N N/** N \brief Structure type to access the System Control Block (SCB). N */ Ntypedef struct N{ N __IM uint32_t CPUID; /*!< Offset: 0x000 (R/ ) CPUID Base Register */ X volatile const uint32_t CPUID; N __IOM uint32_t ICSR; /*!< Offset: 0x004 (R/W) Interrupt Control and State Register */ X volatile uint32_t ICSR; N uint32_t RESERVED0; N __IOM uint32_t AIRCR; /*!< Offset: 0x00C (R/W) Application Interrupt and Reset Control Register */ X volatile uint32_t AIRCR; N __IOM uint32_t SCR; /*!< Offset: 0x010 (R/W) System Control Register */ X volatile uint32_t SCR; N __IOM uint32_t CCR; /*!< Offset: 0x014 (R/W) Configuration Control Register */ X volatile uint32_t CCR; N uint32_t RESERVED1; N __IOM uint32_t SHP[2U]; /*!< Offset: 0x01C (R/W) System Handlers Priority Registers. [0] is RESERVED */ X volatile uint32_t SHP[2U]; N __IOM uint32_t SHCSR; /*!< Offset: 0x024 (R/W) System Handler Control and State Register */ X volatile uint32_t SHCSR; N} SCB_Type; N N/* SCB CPUID Register Definitions */ N#define SCB_CPUID_IMPLEMENTER_Pos 24U /*!< SCB CPUID: IMPLEMENTER Position */ N#define SCB_CPUID_IMPLEMENTER_Msk (0xFFUL << SCB_CPUID_IMPLEMENTER_Pos) /*!< SCB CPUID: IMPLEMENTER Mask */ N N#define SCB_CPUID_VARIANT_Pos 20U /*!< SCB CPUID: VARIANT Position */ N#define SCB_CPUID_VARIANT_Msk (0xFUL << SCB_CPUID_VARIANT_Pos) /*!< SCB CPUID: VARIANT Mask */ N N#define SCB_CPUID_ARCHITECTURE_Pos 16U /*!< SCB CPUID: ARCHITECTURE Position */ N#define SCB_CPUID_ARCHITECTURE_Msk (0xFUL << SCB_CPUID_ARCHITECTURE_Pos) /*!< SCB CPUID: ARCHITECTURE Mask */ N N#define SCB_CPUID_PARTNO_Pos 4U /*!< SCB CPUID: PARTNO Position */ N#define SCB_CPUID_PARTNO_Msk (0xFFFUL << SCB_CPUID_PARTNO_Pos) /*!< SCB CPUID: PARTNO Mask */ N N#define SCB_CPUID_REVISION_Pos 0U /*!< SCB CPUID: REVISION Position */ N#define SCB_CPUID_REVISION_Msk (0xFUL /*<< SCB_CPUID_REVISION_Pos*/) /*!< SCB CPUID: REVISION Mask */ N N/* SCB Interrupt Control State Register Definitions */ N#define SCB_ICSR_NMIPENDSET_Pos 31U /*!< SCB ICSR: NMIPENDSET Position */ N#define SCB_ICSR_NMIPENDSET_Msk (1UL << SCB_ICSR_NMIPENDSET_Pos) /*!< SCB ICSR: NMIPENDSET Mask */ N N#define SCB_ICSR_PENDSVSET_Pos 28U /*!< SCB ICSR: PENDSVSET Position */ N#define SCB_ICSR_PENDSVSET_Msk (1UL << SCB_ICSR_PENDSVSET_Pos) /*!< SCB ICSR: PENDSVSET Mask */ N N#define SCB_ICSR_PENDSVCLR_Pos 27U /*!< SCB ICSR: PENDSVCLR Position */ N#define SCB_ICSR_PENDSVCLR_Msk (1UL << SCB_ICSR_PENDSVCLR_Pos) /*!< SCB ICSR: PENDSVCLR Mask */ N N#define SCB_ICSR_PENDSTSET_Pos 26U /*!< SCB ICSR: PENDSTSET Position */ N#define SCB_ICSR_PENDSTSET_Msk (1UL << SCB_ICSR_PENDSTSET_Pos) /*!< SCB ICSR: PENDSTSET Mask */ N N#define SCB_ICSR_PENDSTCLR_Pos 25U /*!< SCB ICSR: PENDSTCLR Position */ N#define SCB_ICSR_PENDSTCLR_Msk (1UL << SCB_ICSR_PENDSTCLR_Pos) /*!< SCB ICSR: PENDSTCLR Mask */ N N#define SCB_ICSR_ISRPREEMPT_Pos 23U /*!< SCB ICSR: ISRPREEMPT Position */ N#define SCB_ICSR_ISRPREEMPT_Msk (1UL << SCB_ICSR_ISRPREEMPT_Pos) /*!< SCB ICSR: ISRPREEMPT Mask */ N N#define SCB_ICSR_ISRPENDING_Pos 22U /*!< SCB ICSR: ISRPENDING Position */ N#define SCB_ICSR_ISRPENDING_Msk (1UL << SCB_ICSR_ISRPENDING_Pos) /*!< SCB ICSR: ISRPENDING Mask */ N N#define SCB_ICSR_VECTPENDING_Pos 12U /*!< SCB ICSR: VECTPENDING Position */ N#define SCB_ICSR_VECTPENDING_Msk (0x1FFUL << SCB_ICSR_VECTPENDING_Pos) /*!< SCB ICSR: VECTPENDING Mask */ N N#define SCB_ICSR_VECTACTIVE_Pos 0U /*!< SCB ICSR: VECTACTIVE Position */ N#define SCB_ICSR_VECTACTIVE_Msk (0x1FFUL /*<< SCB_ICSR_VECTACTIVE_Pos*/) /*!< SCB ICSR: VECTACTIVE Mask */ N N/* SCB Application Interrupt and Reset Control Register Definitions */ N#define SCB_AIRCR_VECTKEY_Pos 16U /*!< SCB AIRCR: VECTKEY Position */ N#define SCB_AIRCR_VECTKEY_Msk (0xFFFFUL << SCB_AIRCR_VECTKEY_Pos) /*!< SCB AIRCR: VECTKEY Mask */ N N#define SCB_AIRCR_VECTKEYSTAT_Pos 16U /*!< SCB AIRCR: VECTKEYSTAT Position */ N#define SCB_AIRCR_VECTKEYSTAT_Msk (0xFFFFUL << SCB_AIRCR_VECTKEYSTAT_Pos) /*!< SCB AIRCR: VECTKEYSTAT Mask */ N N#define SCB_AIRCR_ENDIANESS_Pos 15U /*!< SCB AIRCR: ENDIANESS Position */ N#define SCB_AIRCR_ENDIANESS_Msk (1UL << SCB_AIRCR_ENDIANESS_Pos) /*!< SCB AIRCR: ENDIANESS Mask */ N N#define SCB_AIRCR_SYSRESETREQ_Pos 2U /*!< SCB AIRCR: SYSRESETREQ Position */ N#define SCB_AIRCR_SYSRESETREQ_Msk (1UL << SCB_AIRCR_SYSRESETREQ_Pos) /*!< SCB AIRCR: SYSRESETREQ Mask */ N N#define SCB_AIRCR_VECTCLRACTIVE_Pos 1U /*!< SCB AIRCR: VECTCLRACTIVE Position */ N#define SCB_AIRCR_VECTCLRACTIVE_Msk (1UL << SCB_AIRCR_VECTCLRACTIVE_Pos) /*!< SCB AIRCR: VECTCLRACTIVE Mask */ N N/* SCB System Control Register Definitions */ N#define SCB_SCR_SEVONPEND_Pos 4U /*!< SCB SCR: SEVONPEND Position */ N#define SCB_SCR_SEVONPEND_Msk (1UL << SCB_SCR_SEVONPEND_Pos) /*!< SCB SCR: SEVONPEND Mask */ N N#define SCB_SCR_SLEEPDEEP_Pos 2U /*!< SCB SCR: SLEEPDEEP Position */ N#define SCB_SCR_SLEEPDEEP_Msk (1UL << SCB_SCR_SLEEPDEEP_Pos) /*!< SCB SCR: SLEEPDEEP Mask */ N N#define SCB_SCR_SLEEPONEXIT_Pos 1U /*!< SCB SCR: SLEEPONEXIT Position */ N#define SCB_SCR_SLEEPONEXIT_Msk (1UL << SCB_SCR_SLEEPONEXIT_Pos) /*!< SCB SCR: SLEEPONEXIT Mask */ N N/* SCB Configuration Control Register Definitions */ N#define SCB_CCR_STKALIGN_Pos 9U /*!< SCB CCR: STKALIGN Position */ N#define SCB_CCR_STKALIGN_Msk (1UL << SCB_CCR_STKALIGN_Pos) /*!< SCB CCR: STKALIGN Mask */ N N#define SCB_CCR_UNALIGN_TRP_Pos 3U /*!< SCB CCR: UNALIGN_TRP Position */ N#define SCB_CCR_UNALIGN_TRP_Msk (1UL << SCB_CCR_UNALIGN_TRP_Pos) /*!< SCB CCR: UNALIGN_TRP Mask */ N N/* SCB System Handler Control and State Register Definitions */ N#define SCB_SHCSR_SVCALLPENDED_Pos 15U /*!< SCB SHCSR: SVCALLPENDED Position */ N#define SCB_SHCSR_SVCALLPENDED_Msk (1UL << SCB_SHCSR_SVCALLPENDED_Pos) /*!< SCB SHCSR: SVCALLPENDED Mask */ N N/*@} end of group CMSIS_SCB */ N N N/** N \ingroup CMSIS_core_register N \defgroup CMSIS_SysTick System Tick Timer (SysTick) N \brief Type definitions for the System Timer Registers. N @{ N */ N N/** N \brief Structure type to access the System Timer (SysTick). N */ Ntypedef struct N{ N __IOM uint32_t CTRL; /*!< Offset: 0x000 (R/W) SysTick Control and Status Register */ X volatile uint32_t CTRL; N __IOM uint32_t LOAD; /*!< Offset: 0x004 (R/W) SysTick Reload Value Register */ X volatile uint32_t LOAD; N __IOM uint32_t VAL; /*!< Offset: 0x008 (R/W) SysTick Current Value Register */ X volatile uint32_t VAL; N __IM uint32_t CALIB; /*!< Offset: 0x00C (R/ ) SysTick Calibration Register */ X volatile const uint32_t CALIB; N} SysTick_Type; N N/* SysTick Control / Status Register Definitions */ N#define SysTick_CTRL_COUNTFLAG_Pos 16U /*!< SysTick CTRL: COUNTFLAG Position */ N#define SysTick_CTRL_COUNTFLAG_Msk (1UL << SysTick_CTRL_COUNTFLAG_Pos) /*!< SysTick CTRL: COUNTFLAG Mask */ N N#define SysTick_CTRL_CLKSOURCE_Pos 2U /*!< SysTick CTRL: CLKSOURCE Position */ N#define SysTick_CTRL_CLKSOURCE_Msk (1UL << SysTick_CTRL_CLKSOURCE_Pos) /*!< SysTick CTRL: CLKSOURCE Mask */ N N#define SysTick_CTRL_TICKINT_Pos 1U /*!< SysTick CTRL: TICKINT Position */ N#define SysTick_CTRL_TICKINT_Msk (1UL << SysTick_CTRL_TICKINT_Pos) /*!< SysTick CTRL: TICKINT Mask */ N N#define SysTick_CTRL_ENABLE_Pos 0U /*!< SysTick CTRL: ENABLE Position */ N#define SysTick_CTRL_ENABLE_Msk (1UL /*<< SysTick_CTRL_ENABLE_Pos*/) /*!< SysTick CTRL: ENABLE Mask */ N N/* SysTick Reload Register Definitions */ N#define SysTick_LOAD_RELOAD_Pos 0U /*!< SysTick LOAD: RELOAD Position */ N#define SysTick_LOAD_RELOAD_Msk (0xFFFFFFUL /*<< SysTick_LOAD_RELOAD_Pos*/) /*!< SysTick LOAD: RELOAD Mask */ N N/* SysTick Current Register Definitions */ N#define SysTick_VAL_CURRENT_Pos 0U /*!< SysTick VAL: CURRENT Position */ N#define SysTick_VAL_CURRENT_Msk (0xFFFFFFUL /*<< SysTick_VAL_CURRENT_Pos*/) /*!< SysTick VAL: CURRENT Mask */ N N/* SysTick Calibration Register Definitions */ N#define SysTick_CALIB_NOREF_Pos 31U /*!< SysTick CALIB: NOREF Position */ N#define SysTick_CALIB_NOREF_Msk (1UL << SysTick_CALIB_NOREF_Pos) /*!< SysTick CALIB: NOREF Mask */ N N#define SysTick_CALIB_SKEW_Pos 30U /*!< SysTick CALIB: SKEW Position */ N#define SysTick_CALIB_SKEW_Msk (1UL << SysTick_CALIB_SKEW_Pos) /*!< SysTick CALIB: SKEW Mask */ N N#define SysTick_CALIB_TENMS_Pos 0U /*!< SysTick CALIB: TENMS Position */ N#define SysTick_CALIB_TENMS_Msk (0xFFFFFFUL /*<< SysTick_CALIB_TENMS_Pos*/) /*!< SysTick CALIB: TENMS Mask */ N N/*@} end of group CMSIS_SysTick */ N N N/** N \ingroup CMSIS_core_register N \defgroup CMSIS_CoreDebug Core Debug Registers (CoreDebug) N \brief Cortex-M0 Core Debug Registers (DCB registers, SHCSR, and DFSR) are only accessible over DAP and not via processor. N Therefore they are not covered by the Cortex-M0 header file. N @{ N */ N/*@} end of group CMSIS_CoreDebug */ N N N/** N \ingroup CMSIS_core_register N \defgroup CMSIS_core_bitfield Core register bit field macros N \brief Macros for use with bit field definitions (xxx_Pos, xxx_Msk). N @{ N */ N N/** N \brief Mask and shift a bit field value for use in a register bit range. N \param[in] field Name of the register bit field. N \param[in] value Value of the bit field. This parameter is interpreted as an uint32_t type. N \return Masked and shifted value. N*/ N#define _VAL2FLD(field, value) (((uint32_t)(value) << field ## _Pos) & field ## _Msk) N N/** N \brief Mask and shift a register value to extract a bit filed value. N \param[in] field Name of the register bit field. N \param[in] value Value of register. This parameter is interpreted as an uint32_t type. N \return Masked and shifted bit field value. N*/ N#define _FLD2VAL(field, value) (((uint32_t)(value) & field ## _Msk) >> field ## _Pos) N N/*@} end of group CMSIS_core_bitfield */ N N N/** N \ingroup CMSIS_core_register N \defgroup CMSIS_core_base Core Definitions N \brief Definitions for base addresses, unions, and structures. N @{ N */ N N/* Memory mapping of Core Hardware */ N#define SCS_BASE (0xE000E000UL) /*!< System Control Space Base Address */ N#define SysTick_BASE (SCS_BASE + 0x0010UL) /*!< SysTick Base Address */ N#define NVIC_BASE (SCS_BASE + 0x0100UL) /*!< NVIC Base Address */ N#define SCB_BASE (SCS_BASE + 0x0D00UL) /*!< System Control Block Base Address */ N N#define SCB ((SCB_Type *) SCB_BASE ) /*!< SCB configuration struct */ N#define SysTick ((SysTick_Type *) SysTick_BASE ) /*!< SysTick configuration struct */ N#define NVIC ((NVIC_Type *) NVIC_BASE ) /*!< NVIC configuration struct */ N N N/*@} */ N N N N/******************************************************************************* N * Hardware Abstraction Layer N Core Function Interface contains: N - Core NVIC Functions N - Core SysTick Functions N - Core Register Access Functions N ******************************************************************************/ N/** N \defgroup CMSIS_Core_FunctionInterface Functions and Instructions Reference N*/ N N N N/* ########################## NVIC functions #################################### */ N/** N \ingroup CMSIS_Core_FunctionInterface N \defgroup CMSIS_Core_NVICFunctions NVIC Functions N \brief Functions that manage interrupts and exceptions via the NVIC. N @{ N */ N N#ifdef CMSIS_NVIC_VIRTUAL S #ifndef CMSIS_NVIC_VIRTUAL_HEADER_FILE S #define CMSIS_NVIC_VIRTUAL_HEADER_FILE "cmsis_nvic_virtual.h" S #endif S #include CMSIS_NVIC_VIRTUAL_HEADER_FILE N#else N #define NVIC_SetPriorityGrouping __NVIC_SetPriorityGrouping N #define NVIC_GetPriorityGrouping __NVIC_GetPriorityGrouping N #define NVIC_EnableIRQ __NVIC_EnableIRQ N #define NVIC_GetEnableIRQ __NVIC_GetEnableIRQ N #define NVIC_DisableIRQ __NVIC_DisableIRQ N #define NVIC_GetPendingIRQ __NVIC_GetPendingIRQ N #define NVIC_SetPendingIRQ __NVIC_SetPendingIRQ N #define NVIC_ClearPendingIRQ __NVIC_ClearPendingIRQ N/*#define NVIC_GetActive __NVIC_GetActive not available for Cortex-M0 */ N #define NVIC_SetPriority __NVIC_SetPriority N #define NVIC_GetPriority __NVIC_GetPriority N #define NVIC_SystemReset __NVIC_SystemReset N#endif /* CMSIS_NVIC_VIRTUAL */ N N#ifdef CMSIS_VECTAB_VIRTUAL S #ifndef CMSIS_VECTAB_VIRTUAL_HEADER_FILE S #define CMSIS_VECTAB_VIRTUAL_HEADER_FILE "cmsis_vectab_virtual.h" S #endif S #include CMSIS_VECTAB_VIRTUAL_HEADER_FILE N#else N #define NVIC_SetVector __NVIC_SetVector N #define NVIC_GetVector __NVIC_GetVector N#endif /* (CMSIS_VECTAB_VIRTUAL) */ N N#define NVIC_USER_IRQ_OFFSET 16 N N N/* The following EXC_RETURN values are saved the LR on exception entry */ N#define EXC_RETURN_HANDLER (0xFFFFFFF1UL) /* return to Handler mode, uses MSP after return */ N#define EXC_RETURN_THREAD_MSP (0xFFFFFFF9UL) /* return to Thread mode, uses MSP after return */ N#define EXC_RETURN_THREAD_PSP (0xFFFFFFFDUL) /* return to Thread mode, uses PSP after return */ N N N/* Interrupt Priorities are WORD accessible only under Armv6-M */ N/* The following MACROS handle generation of the register offset and byte masks */ N#define _BIT_SHIFT(IRQn) ( ((((uint32_t)(int32_t)(IRQn)) ) & 0x03UL) * 8UL) N#define _SHP_IDX(IRQn) ( (((((uint32_t)(int32_t)(IRQn)) & 0x0FUL)-8UL) >> 2UL) ) N#define _IP_IDX(IRQn) ( (((uint32_t)(int32_t)(IRQn)) >> 2UL) ) N N#define __NVIC_SetPriorityGrouping(X) (void)(X) N#define __NVIC_GetPriorityGrouping() (0U) N N/** N \brief Enable Interrupt N \details Enables a device specific interrupt in the NVIC interrupt controller. N \param [in] IRQn Device specific interrupt number. N \note IRQn must not be negative. N */ N__STATIC_INLINE void __NVIC_EnableIRQ(IRQn_Type IRQn) Xstatic __inline void __NVIC_EnableIRQ(IRQn_Type IRQn) N{ N if ((int32_t)(IRQn) >= 0) N { N NVIC->ISER[0U] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); X ((NVIC_Type *) ((0xE000E000UL) + 0x0100UL) )->ISER[0U] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); N } N} N N N/** N \brief Get Interrupt Enable status N \details Returns a device specific interrupt enable status from the NVIC interrupt controller. N \param [in] IRQn Device specific interrupt number. N \return 0 Interrupt is not enabled. N \return 1 Interrupt is enabled. N \note IRQn must not be negative. N */ N__STATIC_INLINE uint32_t __NVIC_GetEnableIRQ(IRQn_Type IRQn) Xstatic __inline uint32_t __NVIC_GetEnableIRQ(IRQn_Type IRQn) N{ N if ((int32_t)(IRQn) >= 0) N { N return((uint32_t)(((NVIC->ISER[0U] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); X return((uint32_t)(((((NVIC_Type *) ((0xE000E000UL) + 0x0100UL) )->ISER[0U] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); N } N else N { N return(0U); N } N} N N N/** N \brief Disable Interrupt N \details Disables a device specific interrupt in the NVIC interrupt controller. N \param [in] IRQn Device specific interrupt number. N \note IRQn must not be negative. N */ N__STATIC_INLINE void __NVIC_DisableIRQ(IRQn_Type IRQn) Xstatic __inline void __NVIC_DisableIRQ(IRQn_Type IRQn) N{ N if ((int32_t)(IRQn) >= 0) N { N NVIC->ICER[0U] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); X ((NVIC_Type *) ((0xE000E000UL) + 0x0100UL) )->ICER[0U] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); N __DSB(); X do { __schedule_barrier(); __dsb(0xF); __schedule_barrier(); } while (0U); N __ISB(); X do { __schedule_barrier(); __isb(0xF); __schedule_barrier(); } while (0U); N } N} N N N/** N \brief Get Pending Interrupt N \details Reads the NVIC pending register and returns the pending bit for the specified device specific interrupt. N \param [in] IRQn Device specific interrupt number. N \return 0 Interrupt status is not pending. N \return 1 Interrupt status is pending. N \note IRQn must not be negative. N */ N__STATIC_INLINE uint32_t __NVIC_GetPendingIRQ(IRQn_Type IRQn) Xstatic __inline uint32_t __NVIC_GetPendingIRQ(IRQn_Type IRQn) N{ N if ((int32_t)(IRQn) >= 0) N { N return((uint32_t)(((NVIC->ISPR[0U] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); X return((uint32_t)(((((NVIC_Type *) ((0xE000E000UL) + 0x0100UL) )->ISPR[0U] & (1UL << (((uint32_t)IRQn) & 0x1FUL))) != 0UL) ? 1UL : 0UL)); N } N else N { N return(0U); N } N} N N N/** N \brief Set Pending Interrupt N \details Sets the pending bit of a device specific interrupt in the NVIC pending register. N \param [in] IRQn Device specific interrupt number. N \note IRQn must not be negative. N */ N__STATIC_INLINE void __NVIC_SetPendingIRQ(IRQn_Type IRQn) Xstatic __inline void __NVIC_SetPendingIRQ(IRQn_Type IRQn) N{ N if ((int32_t)(IRQn) >= 0) N { N NVIC->ISPR[0U] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); X ((NVIC_Type *) ((0xE000E000UL) + 0x0100UL) )->ISPR[0U] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); N } N} N N N/** N \brief Clear Pending Interrupt N \details Clears the pending bit of a device specific interrupt in the NVIC pending register. N \param [in] IRQn Device specific interrupt number. N \note IRQn must not be negative. N */ N__STATIC_INLINE void __NVIC_ClearPendingIRQ(IRQn_Type IRQn) Xstatic __inline void __NVIC_ClearPendingIRQ(IRQn_Type IRQn) N{ N if ((int32_t)(IRQn) >= 0) N { N NVIC->ICPR[0U] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); X ((NVIC_Type *) ((0xE000E000UL) + 0x0100UL) )->ICPR[0U] = (uint32_t)(1UL << (((uint32_t)IRQn) & 0x1FUL)); N } N} N N N/** N \brief Set Interrupt Priority N \details Sets the priority of a device specific interrupt or a processor exception. N The interrupt number can be positive to specify a device specific interrupt, N or negative to specify a processor exception. N \param [in] IRQn Interrupt number. N \param [in] priority Priority to set. N \note The priority cannot be set for every processor exception. N */ N__STATIC_INLINE void __NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority) Xstatic __inline void __NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority) N{ N if ((int32_t)(IRQn) >= 0) N { N NVIC->IP[_IP_IDX(IRQn)] = ((uint32_t)(NVIC->IP[_IP_IDX(IRQn)] & ~(0xFFUL << _BIT_SHIFT(IRQn))) | X ((NVIC_Type *) ((0xE000E000UL) + 0x0100UL) )->IP[( (((uint32_t)(int32_t)(IRQn)) >> 2UL) )] = ((uint32_t)(((NVIC_Type *) ((0xE000E000UL) + 0x0100UL) )->IP[( (((uint32_t)(int32_t)(IRQn)) >> 2UL) )] & ~(0xFFUL << ( ((((uint32_t)(int32_t)(IRQn)) ) & 0x03UL) * 8UL))) | N (((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL) << _BIT_SHIFT(IRQn))); X (((priority << (8U - 2U)) & (uint32_t)0xFFUL) << ( ((((uint32_t)(int32_t)(IRQn)) ) & 0x03UL) * 8UL))); N } N else N { N SCB->SHP[_SHP_IDX(IRQn)] = ((uint32_t)(SCB->SHP[_SHP_IDX(IRQn)] & ~(0xFFUL << _BIT_SHIFT(IRQn))) | X ((SCB_Type *) ((0xE000E000UL) + 0x0D00UL) )->SHP[( (((((uint32_t)(int32_t)(IRQn)) & 0x0FUL)-8UL) >> 2UL) )] = ((uint32_t)(((SCB_Type *) ((0xE000E000UL) + 0x0D00UL) )->SHP[( (((((uint32_t)(int32_t)(IRQn)) & 0x0FUL)-8UL) >> 2UL) )] & ~(0xFFUL << ( ((((uint32_t)(int32_t)(IRQn)) ) & 0x03UL) * 8UL))) | N (((priority << (8U - __NVIC_PRIO_BITS)) & (uint32_t)0xFFUL) << _BIT_SHIFT(IRQn))); X (((priority << (8U - 2U)) & (uint32_t)0xFFUL) << ( ((((uint32_t)(int32_t)(IRQn)) ) & 0x03UL) * 8UL))); N } N} N N N/** N \brief Get Interrupt Priority N \details Reads the priority of a device specific interrupt or a processor exception. N The interrupt number can be positive to specify a device specific interrupt, N or negative to specify a processor exception. N \param [in] IRQn Interrupt number. N \return Interrupt Priority. N Value is aligned automatically to the implemented priority bits of the microcontroller. N */ N__STATIC_INLINE uint32_t __NVIC_GetPriority(IRQn_Type IRQn) Xstatic __inline uint32_t __NVIC_GetPriority(IRQn_Type IRQn) N{ N N if ((int32_t)(IRQn) >= 0) N { N return((uint32_t)(((NVIC->IP[ _IP_IDX(IRQn)] >> _BIT_SHIFT(IRQn) ) & (uint32_t)0xFFUL) >> (8U - __NVIC_PRIO_BITS))); X return((uint32_t)(((((NVIC_Type *) ((0xE000E000UL) + 0x0100UL) )->IP[ ( (((uint32_t)(int32_t)(IRQn)) >> 2UL) )] >> ( ((((uint32_t)(int32_t)(IRQn)) ) & 0x03UL) * 8UL) ) & (uint32_t)0xFFUL) >> (8U - 2U))); N } N else N { N return((uint32_t)(((SCB->SHP[_SHP_IDX(IRQn)] >> _BIT_SHIFT(IRQn) ) & (uint32_t)0xFFUL) >> (8U - __NVIC_PRIO_BITS))); X return((uint32_t)(((((SCB_Type *) ((0xE000E000UL) + 0x0D00UL) )->SHP[( (((((uint32_t)(int32_t)(IRQn)) & 0x0FUL)-8UL) >> 2UL) )] >> ( ((((uint32_t)(int32_t)(IRQn)) ) & 0x03UL) * 8UL) ) & (uint32_t)0xFFUL) >> (8U - 2U))); N } N} N N N/** N \brief Encode Priority N \details Encodes the priority for an interrupt with the given priority group, N preemptive priority value, and subpriority value. N In case of a conflict between priority grouping and available N priority bits (__NVIC_PRIO_BITS), the smallest possible priority group is set. N \param [in] PriorityGroup Used priority group. N \param [in] PreemptPriority Preemptive priority value (starting from 0). N \param [in] SubPriority Subpriority value (starting from 0). N \return Encoded priority. Value can be used in the function \ref NVIC_SetPriority(). N */ N__STATIC_INLINE uint32_t NVIC_EncodePriority (uint32_t PriorityGroup, uint32_t PreemptPriority, uint32_t SubPriority) Xstatic __inline uint32_t NVIC_EncodePriority (uint32_t PriorityGroup, uint32_t PreemptPriority, uint32_t SubPriority) N{ N uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */ N uint32_t PreemptPriorityBits; N uint32_t SubPriorityBits; N N PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(__NVIC_PRIO_BITS)) ? (uint32_t)(__NVIC_PRIO_BITS) : (uint32_t)(7UL - PriorityGroupTmp); X PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(2U)) ? (uint32_t)(2U) : (uint32_t)(7UL - PriorityGroupTmp); N SubPriorityBits = ((PriorityGroupTmp + (uint32_t)(__NVIC_PRIO_BITS)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(__NVIC_PRIO_BITS)); X SubPriorityBits = ((PriorityGroupTmp + (uint32_t)(2U)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(2U)); N N return ( N ((PreemptPriority & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL)) << SubPriorityBits) | N ((SubPriority & (uint32_t)((1UL << (SubPriorityBits )) - 1UL))) N ); N} N N N/** N \brief Decode Priority N \details Decodes an interrupt priority value with a given priority group to N preemptive priority value and subpriority value. N In case of a conflict between priority grouping and available N priority bits (__NVIC_PRIO_BITS) the smallest possible priority group is set. N \param [in] Priority Priority value, which can be retrieved with the function \ref NVIC_GetPriority(). N \param [in] PriorityGroup Used priority group. N \param [out] pPreemptPriority Preemptive priority value (starting from 0). N \param [out] pSubPriority Subpriority value (starting from 0). N */ N__STATIC_INLINE void NVIC_DecodePriority (uint32_t Priority, uint32_t PriorityGroup, uint32_t* const pPreemptPriority, uint32_t* const pSubPriority) Xstatic __inline void NVIC_DecodePriority (uint32_t Priority, uint32_t PriorityGroup, uint32_t* const pPreemptPriority, uint32_t* const pSubPriority) N{ N uint32_t PriorityGroupTmp = (PriorityGroup & (uint32_t)0x07UL); /* only values 0..7 are used */ N uint32_t PreemptPriorityBits; N uint32_t SubPriorityBits; N N PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(__NVIC_PRIO_BITS)) ? (uint32_t)(__NVIC_PRIO_BITS) : (uint32_t)(7UL - PriorityGroupTmp); X PreemptPriorityBits = ((7UL - PriorityGroupTmp) > (uint32_t)(2U)) ? (uint32_t)(2U) : (uint32_t)(7UL - PriorityGroupTmp); N SubPriorityBits = ((PriorityGroupTmp + (uint32_t)(__NVIC_PRIO_BITS)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(__NVIC_PRIO_BITS)); X SubPriorityBits = ((PriorityGroupTmp + (uint32_t)(2U)) < (uint32_t)7UL) ? (uint32_t)0UL : (uint32_t)((PriorityGroupTmp - 7UL) + (uint32_t)(2U)); N N *pPreemptPriority = (Priority >> SubPriorityBits) & (uint32_t)((1UL << (PreemptPriorityBits)) - 1UL); N *pSubPriority = (Priority ) & (uint32_t)((1UL << (SubPriorityBits )) - 1UL); N} N N N N/** N \brief Set Interrupt Vector N \details Sets an interrupt vector in SRAM based interrupt vector table. N The interrupt number can be positive to specify a device specific interrupt, N or negative to specify a processor exception. N Address 0 must be mapped to SRAM. N \param [in] IRQn Interrupt number N \param [in] vector Address of interrupt handler function N */ N__STATIC_INLINE void __NVIC_SetVector(IRQn_Type IRQn, uint32_t vector) Xstatic __inline void __NVIC_SetVector(IRQn_Type IRQn, uint32_t vector) N{ N uint32_t vectors = 0x0U; N (* (int *) (vectors + ((int32_t)IRQn + NVIC_USER_IRQ_OFFSET) * 4)) = vector; X (* (int *) (vectors + ((int32_t)IRQn + 16) * 4)) = vector; N} N N N/** N \brief Get Interrupt Vector N \details Reads an interrupt vector from interrupt vector table. N The interrupt number can be positive to specify a device specific interrupt, N or negative to specify a processor exception. N \param [in] IRQn Interrupt number. N \return Address of interrupt handler function N */ N__STATIC_INLINE uint32_t __NVIC_GetVector(IRQn_Type IRQn) Xstatic __inline uint32_t __NVIC_GetVector(IRQn_Type IRQn) N{ N uint32_t vectors = 0x0U; N return (uint32_t)(* (int *) (vectors + ((int32_t)IRQn + NVIC_USER_IRQ_OFFSET) * 4)); X return (uint32_t)(* (int *) (vectors + ((int32_t)IRQn + 16) * 4)); N} N N N/** N \brief System Reset N \details Initiates a system reset request to reset the MCU. N */ N__NO_RETURN __STATIC_INLINE void __NVIC_SystemReset(void) X__declspec(noreturn) static __inline void __NVIC_SystemReset(void) N{ N __DSB(); /* Ensure all outstanding memory accesses included X do { __schedule_barrier(); __dsb(0xF); __schedule_barrier(); } while (0U); N buffered write are completed before reset */ N SCB->AIRCR = ((0x5FAUL << SCB_AIRCR_VECTKEY_Pos) | X ((SCB_Type *) ((0xE000E000UL) + 0x0D00UL) )->AIRCR = ((0x5FAUL << 16U) | N SCB_AIRCR_SYSRESETREQ_Msk); X (1UL << 2U)); N __DSB(); /* Ensure completion of memory access */ X do { __schedule_barrier(); __dsb(0xF); __schedule_barrier(); } while (0U); N N for(;;) /* wait until reset */ N { N __NOP(); X __nop(); N } N} N N/*@} end of CMSIS_Core_NVICFunctions */ N N N/* ########################## FPU functions #################################### */ N/** N \ingroup CMSIS_Core_FunctionInterface N \defgroup CMSIS_Core_FpuFunctions FPU Functions N \brief Function that provides FPU type. N @{ N */ N N/** N \brief get FPU type N \details returns the FPU type N \returns N - \b 0: No FPU N - \b 1: Single precision FPU N - \b 2: Double + Single precision FPU N */ N__STATIC_INLINE uint32_t SCB_GetFPUType(void) Xstatic __inline uint32_t SCB_GetFPUType(void) N{ N return 0U; /* No FPU */ N} N N N/*@} end of CMSIS_Core_FpuFunctions */ N N N N/* ################################## SysTick function ############################################ */ N/** N \ingroup CMSIS_Core_FunctionInterface N \defgroup CMSIS_Core_SysTickFunctions SysTick Functions N \brief Functions that configure the System. N @{ N */ N N#if defined (__Vendor_SysTickConfig) && (__Vendor_SysTickConfig == 0U) X#if 1L && (0U == 0U) N N/** N \brief System Tick Configuration N \details Initializes the System Timer and its interrupt, and starts the System Tick Timer. N Counter is in free running mode to generate periodic interrupts. N \param [in] ticks Number of ticks between two interrupts. N \return 0 Function succeeded. N \return 1 Function failed. N \note When the variable __Vendor_SysTickConfig is set to 1, then the N function SysTick_Config is not included. In this case, the file device.h N must contain a vendor-specific implementation of this function. N */ N__STATIC_INLINE uint32_t SysTick_Config(uint32_t ticks) Xstatic __inline uint32_t SysTick_Config(uint32_t ticks) N{ N if ((ticks - 1UL) > SysTick_LOAD_RELOAD_Msk) X if ((ticks - 1UL) > (0xFFFFFFUL )) N { N return (1UL); /* Reload value impossible */ N } N N SysTick->LOAD = (uint32_t)(ticks - 1UL); /* set reload register */ X ((SysTick_Type *) ((0xE000E000UL) + 0x0010UL) )->LOAD = (uint32_t)(ticks - 1UL); N NVIC_SetPriority (SysTick_IRQn, (1UL << __NVIC_PRIO_BITS) - 1UL); /* set Priority for Systick Interrupt */ X __NVIC_SetPriority (SysTick_IRQn, (1UL << 2U) - 1UL); N SysTick->VAL = 0UL; /* Load the SysTick Counter Value */ X ((SysTick_Type *) ((0xE000E000UL) + 0x0010UL) )->VAL = 0UL; N SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk | X ((SysTick_Type *) ((0xE000E000UL) + 0x0010UL) )->CTRL = (1UL << 2U) | N SysTick_CTRL_TICKINT_Msk | X (1UL << 1U) | N SysTick_CTRL_ENABLE_Msk; /* Enable SysTick IRQ and SysTick Timer */ X (1UL ); N return (0UL); /* Function successful */ N} N N#endif N N/*@} end of CMSIS_Core_SysTickFunctions */ N N N N N#ifdef __cplusplus S} N#endif N N#endif /* __CORE_CM0_H_DEPENDANT */ N N#endif /* __CMSIS_GENERIC */ L 129 "..\src\sdk\include\M0\ArmCM0.h" 2 N#include "system_ARMCM0.h" /* System Header */ L 1 "C:\Users\Markin\AppData\Local\Arm\Packs\ARM\CMSIS\5.5.1\Device\ARM\ARMCM0\Include\system_ARMCM0.h" 1 N/**************************************************************************//** N * @file system_ARMCM0.h N * @brief CMSIS Device System Header File for N * ARMCM0 Device N * @version V5.3.1 N * @date 09. July 2018 N ******************************************************************************/ N/* N * Copyright (c) 2009-2018 Arm Limited. All rights reserved. N * N * SPDX-License-Identifier: Apache-2.0 N * N * Licensed under the Apache License, Version 2.0 (the License); you may N * not use this file except in compliance with the License. N * You may obtain a copy of the License at N * N * www.apache.org/licenses/LICENSE-2.0 N * N * Unless required by applicable law or agreed to in writing, software N * distributed under the License is distributed on an AS IS BASIS, WITHOUT N * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. N * See the License for the specific language governing permissions and N * limitations under the License. N */ N N#ifndef SYSTEM_ARMCM0_H N#define SYSTEM_ARMCM0_H N N#ifdef __cplusplus Sextern "C" { N#endif N Nextern uint32_t SystemCoreClock; /*!< System Clock Frequency (Core Clock) */ N N N/** N \brief Setup the microcontroller system. N N Initialize the System and update the SystemCoreClock variable. N */ Nextern void SystemInit (void); N N N/** N \brief Update SystemCoreClock variable. N N Updates the SystemCoreClock with current core Clock retrieved from cpu registers. N */ Nextern void SystemCoreClockUpdate (void); N N#ifdef __cplusplus S} N#endif N N#endif /* SYSTEM_ARMCM0_H */ L 130 "..\src\sdk\include\M0\ArmCM0.h" 2 N N/*---------------------------------------------------------------------------- N Define clocks N *----------------------------------------------------------------------------*/ N#define XTAL (500000000UL) /* Oscillator frequency */ N N#if FPGA_MODE X#if 0 S#define SYSTEM_CLOCK (33300000U) N#else N/* 使用外部晶振时,系统时钟只能是100M,不使用外部晶振时,系统时钟可以是100M/80M*/ N#if EXTERN_24M X#if 0 S#define SYSTEM_CLOCK (100000000U) N#else N#if CPU_CLK_100M X#if 0 S#define SYSTEM_CLOCK (100000000U) N#else N#define SYSTEM_CLOCK (80000000U) N#endif N#endif N#endif N N/* -------- End of section using anonymous unions and disabling warnings -------- */ N#if defined (__CC_ARM) X#if 1L N#pragma pop N#elif defined (__ICCARM__) X#elif 0L S/* leave anonymous unions enabled */ S#elif (defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)) S#pragma clang diagnostic pop S#elif defined (__GNUC__) S/* anonymous unions are enabled by default */ S#elif defined (__TMS470__) S/* anonymous unions are enabled by default */ S#elif defined (__TASKING__) S#pragma warning restore S#elif defined (__CSMC__) S/* anonymous unions are enabled by default */ S#else S#warning Not supported compiler type N#endif N N/* In HS mode and when the DMA is used, all variables and data structures dealing N with the DMA during the transaction process should be 4-bytes aligned */ N#define DMA_WORD_ALIGN_EN N#ifdef DMA_WORD_ALIGN_EN N#if defined (__GNUC__) /* GNU Compiler */ X#if 1L N#define __ALIGN_END __attribute__ ((aligned (4))) N#define __ALIGN_BEGIN N#else S#define __ALIGN_END S#if defined (__CC_ARM) /* ARM Compiler */ S#define __ALIGN_BEGIN __align(4) S#elif defined (__ICCARM__) /* IAR Compiler */ S#define __ALIGN_BEGIN S#elif defined (__TASKING__) /* TASKING Compiler */ S#define __ALIGN_BEGIN __align(4) S#endif /* __CC_ARM */ N#endif /* __GNUC__ */ N#else S S#define __ALIGN_BEGIN S#define __ALIGN_END S S#define __ALIGN_END_1 __attribute__ ((aligned (1))) N#endif /* DMA_WORD_ALIGN_EN */ N N/* __packed keyword used to decrease the data type alignment to 1-byte */ N#if defined (__CC_ARM) /* ARM Compiler */ X#if 1L N#define __packed __packed N#elif defined (__ICCARM__) /* IAR Compiler */ X#elif 0L S#define __packed __packed S#elif defined ( __GNUC__ ) /* GNU Compiler */ S#define __packed __attribute__ ((__packed__)) S#define __weak __attribute__((weak)) S#elif defined (__TASKING__) /* TASKING Compiler */ S#define __packed __unaligned N#endif /* __CC_ARM */ N N#ifdef __cplusplus S} N#endif N N#endif /* ARMCM0_H */ L 21 "..\src\common\tau_log.h" 2 N N/******************************************************************************* N* 2.Global constant and macro definitions using #define N*******************************************************************************/ N N#ifdef LOG_TAG S #undef LOG_TAG N#endif N#define LOG_TAG "tau_log" N#define LOG_CURREN_LEVEL kLOG_LEVEL_DBG /* ôӡȼ TODO:ÿģôӡȼ */ N N/* N * Using the following three macros for conveniently logging. N */ N#if EDA_MODE X#if 0 S#define TAU_LOGD(format,...) S#define TAU_LOGI(format,...) S#define TAU_LOGE(format,...) N#else N#define TAU_LOGD(format,...) \ N do { \ N if (LOG_CURREN_LEVEL <= kLOG_LEVEL_DBG) { \ N LOG_printf("[%s] (%04d) " format, LOG_TAG, __LINE__, ##__VA_ARGS__); \ N }; \ N } while (0) X#define TAU_LOGD(format,...) do { if (LOG_CURREN_LEVEL <= kLOG_LEVEL_DBG) { LOG_printf("[%s] (%04d) " format, LOG_TAG, __LINE__, ##__VA_ARGS__); }; } while (0) N N N#define TAU_LOGI(format,...) \ N do { \ N if (LOG_CURREN_LEVEL <= kLOG_LEVEL_INF) { \ N LOG_printf("[%s] (%04d) " format, LOG_TAG, __LINE__, ##__VA_ARGS__); \ N }; \ N } while (0) X#define TAU_LOGI(format,...) do { if (LOG_CURREN_LEVEL <= kLOG_LEVEL_INF) { LOG_printf("[%s] (%04d) " format, LOG_TAG, __LINE__, ##__VA_ARGS__); }; } while (0) N N#define TAU_LOGE(format,...) \ N do { \ N if (LOG_CURREN_LEVEL <= kLOG_LEVEL_ERR) { \ N LOG_printf("error [%s] (%04d) " format, LOG_TAG, __LINE__, ##__VA_ARGS__); \ N }; \ N } while (0) X#define TAU_LOGE(format,...) do { if (LOG_CURREN_LEVEL <= kLOG_LEVEL_ERR) { LOG_printf("error [%s] (%04d) " format, LOG_TAG, __LINE__, ##__VA_ARGS__); }; } while (0) N#endif N N/******************************************************************************* N* 3.Global structures, unions and enumerations using typedef N*******************************************************************************/ Ntypedef enum N{ N kLOG_LEVEL_DBG = 0, N kLOG_LEVEL_INF, N kLOG_LEVEL_ERR, N kLOG_LEVEL_NONE /* ӡκβ */ N} log_level_t; N N/******************************************************************************* N* 4.Global variable extern declarations N*******************************************************************************/ N N/******************************************************************************* N* 5.Global function prototypes N*******************************************************************************/ Nvoid LOG_printf(const char *fmt, ...); N N#endif L 6 "..\src\app\main.c" 2 N#include "hal_system.h" L 1 "..\src\sdk\include\hal_system.h" 1 N/******************************************************************************* N* N* N* File: hal_system.h N* Description hal 通用系统接口头文件 N* Version V0.1 N* Date 2021-05-21 N* Author lzy N *******************************************************************************/ N#ifndef __HAL_SYSTEM_H__ N#define __HAL_SYSTEM_H__ N/******************************************************************************* N* 1.Included files N*******************************************************************************/ N#include "tau_common.h" N N/******************************************************************************* N* 2.Global constant and macro definitions using #define N*******************************************************************************/ N N/******************************************************************************* N* 3.Global structures, unions and enumerations using typedef N*******************************************************************************/ N N/******************************************************************************* N* 4.Global variable extern declarations N*******************************************************************************/ N N/******************************************************************************* N* 5.Global function prototypes N*******************************************************************************/ N N/** N* @brief system 初始化 N* @param none N* @retval none N*/ Nvoid hal_system_init(uint32_t sysclk); N N/** N* @brief system 初始化 console N* @param baud_rate 波特率 N* @retval none N*/ Nvoid hal_system_init_console(uint32_t baud_rate); N N/** N* @brief mcu进入idle模式,等待中断唤醒 N* @param disable_systick: 进入idle时是否关闭systick(退出idle 恢复systick) N* @retval none N*/ Nvoid hal_system_idle_mode(bool disable_systick); Xvoid hal_system_idle_mode(_Bool disable_systick); N N/** N* @brief 注册systick回调函数 N* @param cb_func:回调函数地址 N* @retval 无 N*/ Nvoid hal_system_register_systick_cb(fcb_type cb_func); N N/** N* @brief 启动sys tickt N* @param ms: sys tickt 间隔, 范围1-10ms N* @retval true/false N*/ Nbool hal_system_enable_systick(uint8_t ms); X_Bool hal_system_enable_systick(uint8_t ms); N N/** N* @brief 获取systickt N* @param none N* @retval 当前systickt值 N*/ Nbool hal_system_disable_systick(void); X_Bool hal_system_disable_systick(void); N N/** N* @brief 获取systickt N* @param none N* @retval 当前systickt值 N*/ Nuint32_t hal_system_get_tick(void); N N/** N* @brief 进入deep sleep mode 模式, 等待AP_RSTN 唤醒 N* @param polarity true:上升沿唤醒, false:下降沿唤醒 N* @retval none N*/ Nvoid hal_system_deep_sleep_mode(bool polarity); Xvoid hal_system_deep_sleep_mode(_Bool polarity); N N/** N* @brief 配置共享flash开关(使用过后注意关闭,常开功耗会增加) N* @param enable:true:可通过F_SPI访问内部flash , false:不可通过F_SPI访问内部flash N* @retval true/false N*/ Nbool hal_system_share_flash_mode(bool enable); X_Bool hal_system_share_flash_mode(_Bool enable); N N/** N* @brief sleep mode 配置 N* @param enable N* @retval none N*/ Nvoid hal_system_sleep_mode(bool enable); Xvoid hal_system_sleep_mode(_Bool enable); N N/** N* @brief reset chip N* @param none N* @retval none N*/ Nvoid hal_system_reset_chip(void); N N/** N* @brief 开关PVD检测 N* @param none N* @retval none N*/ Nvoid hal_system_set_pvd(bool enable); Xvoid hal_system_set_pvd(_Bool enable); N N/** N* @brief VCC电源开关, N* 使用场景: VCC掉电,13D与13M使用外灌电源时,关闭内部VCC供电,防止电源倒灌 N* @param enable: true:打开CP, false:关闭CP N* @retval none N*/ Nvoid hal_system_set_vcc(bool enable); Xvoid hal_system_set_vcc(_Bool enable); N N/** N* @brief 用户字节数组形式从flash读取数据,按页读取,每页1024字节 N* @param *usr_cfg_t_addr(数组首地址), N usr_cfg_t_size(数组大小可以超过1024,可以按页读也可连续跨页读) N flash_page (页0~63) N* @retval bool 无 N*/ Nbool hal_system_flash_read(uint8_t *usr_cfg_t_addr, uint16_t usr_cfg_t_size, uint8_t flash_page); X_Bool hal_system_flash_read(uint8_t *usr_cfg_t_addr, uint16_t usr_cfg_t_size, uint8_t flash_page); N N/** N* @brief 用户字节数组形式存入flash(次数有限,不可频繁写入),按页写入,每页1024字节 N* @param *usr_cfg_t_addr(数组首地址), N usr_cfg_t_size(数组大小可以超过1024,可以按页写也可连续跨页写入), N 推荐按页顺序写入方式,第一次必须从0页开始写入,后续才可1~63任意页写入 N flash_page (写入页0~63) N* @retval bool 校验size是否超出 N*/ Nbool hal_system_flash_write(uint8_t *usr_cfg_t_addr, uint16_t usr_cfg_t_size, uint8_t flash_page); X_Bool hal_system_flash_write(uint8_t *usr_cfg_t_addr, uint16_t usr_cfg_t_size, uint8_t flash_page); N N#if defined(ISP_568) || defined(ISP_368) X#if 1L || 0L N /** N * @brief 控制DPHY内部校准开关 N * @param en: 使能开关 N * @retval none N */ N void hal_system_set_phy_calibration(bool en); X void hal_system_set_phy_calibration(_Bool en); N#endif N N#endif //__HAL_SYSTEM_H__ L 7 "..\src\app\main.c" 2 N#include "board.h" L 1 "..\src\board\board.h" 1 N/******************************************************************************* N* Copyright (C) 2019-2022, 518/568 Systems (R),All Rights Reserved. N* N* File: board.h N* Description: baord 初始化头文件 N* Version: V0.1 N* Date: 2020-01-08 N* Author: lzy N *******************************************************************************/ N N#ifndef __BOARD_H__ N#define __BOARD_H__ N Nvoid board_Init(void); N N#endif L 8 "..\src\app\main.c" 2 N#include "tau_delay.h" L 1 "..\src\common\tau_delay.h" 1 N/** N * File Name: tau_delay.h N * N * N * N * Author: Fortsense 3D Firmware Team N * N * Date: 2020/12/04 N * N * Project: Taurus N * N * Description: N * N * HISTORY: N**/ N#ifndef _DELAY_H_ N#define _DELAY_H_ N#include "stdint.h" N N/** N* @brief delay ms ,2% N* @param ms:delayʱ N* @retval none N*/ Nvoid delayMs(uint32_t ms); N N/** N* @brief delay us ,2% N* @param us:delayʱ N* @retval none N*/ Nvoid delayUs(uint32_t us); N N#endif L 9 "..\src\app\main.c" 2 N N N N//test_cfg_global.h file choice what you want test or completely demo of S8 or S8+ Felix N Nint main() N{ N// hal_system_init(); N board_Init(); N N while (1) N { N#if _DEMO_S8_EN X#if 1 N ap_demo(); N#endif N while (1); N } N}