L 1 "..\..\src\app\P6A\p6a_demo.c"
N/*******************************************************************************
N*
N* File:         p6a_demo.c
N* Description:  系统测试文件
N* Version:      V0.1
N* Date:         2020-02-22
N* Author:       Tempest
N *******************************************************************************/
N#include "p6a_demo.h"
L 1 "..\..\src\app\P6A\p6a_demo.h" 1
N/*******************************************************************************
N* Copyright (C) 2019-2022, TAU Systems (R),All Rights Reserved.
N*
N* File:        Mi12Lite.h
N* Description  XiaoMi 12 Lite file
N* Version      V0.1
N* Date         2023-06-25
N* Author       Jaya
N*******************************************************************************/
N#ifndef __MI12_LITE_DEMO_H__
N#define __MI12_LITE_DEMO_H__
N
N
N#define PANEL_INIT_CODE_ARRAY		 1
N#define DDIC_FPS_SETTING		 1
N
N
N
Nvoid google_p6a_demo(void);
N
N#endif 
L 10 "..\..\src\app\P6A\p6a_demo.c" 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    VPRE1_IRQn                    =   18,
N    I2C2_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/* ================      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#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 <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 35 "C:\Users\Markin\AppData\Local\Arm\Packs\ARM\CMSIS\5.5.1\CMSIS\Core\Include\core_cm0.h" 2
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.<br>
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: '{...}'.<br>
N     Unions are used for effective representation of core registers.
N
N   \li Advisory Rule 19.7, Function-like macro defined.<br>
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 <stdint.h>
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 <cmsis_iccarm.h>
S
S
S/*
S * TI Arm Compiler
S */
S#elif defined ( __TI_ARM__ )
S  #include <cmsis_ccs.h>
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 <cmsis_csm.h>
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    <strong>IO Type Qualifiers</strong> 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 <b>__Vendor_SysTickConfig</b> is set to 1, then the
N           function <b>SysTick_Config</b> is not included. In this case, the file <b><i>device</i>.h</b>
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 122 "..\..\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 123 "..\..\src\sdk\include\M0\ArmCM0.h" 2
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 11 "..\..\src\app\P6A\p6a_demo.c" 2
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"
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 <math.h> 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
N#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 *            同一结构体成员的偏移可能是不一样的
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 对齐因素，必须为2的乘方
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 uint32_t status_t;
N
N/* \brief 通用回调函数指针定义 */
Ntypedef void (*fcb_type)(void *data);
N
Ntypedef void (*uart_trans_cb)(status_t status, void *user_data);
N
Ntypedef void (*flash_trans_cb)(status_t status, void *user_data);
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    STATUS_GROUP_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 UART状态枚举定义
N*
N*/
Ntypedef enum
N{
N    STATUS_UART_TX_BUSY              = MAKE_STATUS(STATUS_GROUP_UART, 0),  /*!< Transmitter is busy. */
X    STATUS_UART_TX_BUSY              = ((((STATUS_GROUP_UART)*100) + (0))),   
N    STATUS_UART_RX_BUSY              = MAKE_STATUS(STATUS_GROUP_UART, 1),  /*!< Receiver is busy. */
X    STATUS_UART_RX_BUSY              = ((((STATUS_GROUP_UART)*100) + (1))),   
N    STATUS_UART_TX_IDLE              = MAKE_STATUS(STATUS_GROUP_UART, 2),  /*!< USART transmitter is idle. */
X    STATUS_UART_TX_IDLE              = ((((STATUS_GROUP_UART)*100) + (2))),   
N    STATUS_UART_RX_IDLE              = MAKE_STATUS(STATUS_GROUP_UART, 3),  /*!< USART receiver is idle. */
X    STATUS_UART_RX_IDLE              = ((((STATUS_GROUP_UART)*100) + (3))),   
N    STATUS_UART_TX_ERR               = MAKE_STATUS(STATUS_GROUP_UART, 7),  /*!< Error happens on txFIFO. */
X    STATUS_UART_TX_ERR               = ((((STATUS_GROUP_UART)*100) + (7))),   
N    STATUS_UART_RX_ERR               = MAKE_STATUS(STATUS_GROUP_UART, 9),  /*!< Error happens on rxFIFO. */
X    STATUS_UART_RX_ERR               = ((((STATUS_GROUP_UART)*100) + (9))),   
N    STATUS_UART_RX_RING_BUFF_OVERRUN = MAKE_STATUS(STATUS_GROUP_UART, 8),  /*!< Error happens on rx ring buffer */
X    STATUS_UART_RX_RING_BUFF_OVERRUN = ((((STATUS_GROUP_UART)*100) + (8))),   
N    STATUS_UART_NOISE_ERR            = MAKE_STATUS(STATUS_GROUP_UART, 10), /*!< USART noise error. */
X    STATUS_UART_NOISE_ERR            = ((((STATUS_GROUP_UART)*100) + (10))),  
N    STATUS_UART_FRAMING_ERR          = MAKE_STATUS(STATUS_GROUP_UART, 11), /*!< USART framing error. */
X    STATUS_UART_FRAMING_ERR          = ((((STATUS_GROUP_UART)*100) + (11))),  
N    STATUS_UART_PARITY_ERR           = MAKE_STATUS(STATUS_GROUP_UART, 12), /*!< USART parity error. */
X    STATUS_UART_PARITY_ERR           = ((((STATUS_GROUP_UART)*100) + (12))),  
N    STATUS_UART_BAUDRATE_NOT_SPT     = MAKE_STATUS(STATUS_GROUP_UART, 13), /*!< Baudrate is not support in current clock source */
X    STATUS_UART_BAUDRATE_NOT_SPT     = ((((STATUS_GROUP_UART)*100) + (13))),  
N} uart_status_e;
N
N/*!
N * @brief timer状态
N */
Ntypedef enum
N{
N    STATUS_TIMER_IDLE            = MAKE_STATUS(STATUS_GROUP_TIMER, 0),    /*!< 空闲 */
X    STATUS_TIMER_IDLE            = ((((STATUS_GROUP_TIMER)*100) + (0))),     
N    STATUS_TIMER_RUNNING         = MAKE_STATUS(STATUS_GROUP_TIMER, 1),    /*!< 运行中 */
X    STATUS_TIMER_RUNNING         = ((((STATUS_GROUP_TIMER)*100) + (1))),     
N    STATUS_TIMER_TIMEOUT         = MAKE_STATUS(STATUS_GROUP_TIMER, 2),    /*!< 超时 */
X    STATUS_TIMER_TIMEOUT         = ((((STATUS_GROUP_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    DETECT_DOUBLE_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/*!
N * @brief I2C Index
N * @note
N */
Ntypedef enum
N{
N    I2C_INDEX_0,
N    I2C_INDEX_1,
N    I2C_INDEX_2,
N    I2C_INDEX_MAX
N} i2c_index_e;
N
N/*!
N * @brief DMA channel type
N * @note
N */
Ntypedef enum
N{
N    AHB_DMA_CH0,
N    AHB_DMA_CH1,
N    AHB_DMA_CH2,
N    AHB_DMA_CH3,
N    AHB_DMA_CH4,
N    AHB_DMA_CH5,
N    AHB_DMA_CH6,
N    AHB_DMA_CH7,
N    AHB_DMA_CH_NUM
N} dma_channel_type_e;
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
N/**
N* @brief The reversal types of the bit order of the input/output data
N*/
Ntypedef enum
N{
N    CRC_REV_NO_TRANSPOSE = 0,               /*!< No transposition */
N    CRC_REV_ONLY_BITS_TRANSPOSE,            /*!< Bits in bytes are transposed; bytes are not transposed */
N    CRC_REV_BOTH_TRANSPOSE,                 /*!< Both bits in bytes and bytes are transposed */
N    CRC_REV_ONLY_BYTES_TRANSPOSE,           /*!< Only bytes are transposed; no bits in a byte are transposed */
N} crc_reversal_type_e;
N
N/**
N* @brief Complement Read Of CRC Data Register
N*/
Ntypedef enum
N{
N    CRC_FXOR_DISABLE = 0,                   /*!< No XOR on reading */
N    CRC_FXOR_ENABLE,                        /*!< Invert or complement the read value of the CRC Data register */
N} crc_fxor_function_e;
N
N/**
N* @brief width of CRC protocol (polynomial)
N*/
Ntypedef enum
N{
N    CRC_16_BIT_PROTOCOL = 0,               /*!< 0: 16-bit CRC protocol */
N    CRC_32_BIT_PROTOCOL,                   /*!< 1: 32-bit CRC protocol */
N} crc_protocol_type_e;
N
N/*******************************************************************************
N* 4.Global variable extern declarations
N*******************************************************************************/
N
N#endif
N
L 12 "..\..\src\app\P6A\p6a_demo.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 <stdint.h>
N#include <string.h>
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 <stddef.h> */
N  #else
N    typedef unsigned int size_t;   /* see <stddef.h> */
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 <stddef.h> */
S  #else
S    typedef unsigned int size_t;   /* see <stddef.h> */
S  #endif
N#endif
N
N#undef NULL
N#define NULL 0                   /* see <stddef.h> */
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<void *>(memchr(const_cast<const void *>(__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<char *>(strchr(const_cast<const char *>(__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<char *>(strpbrk(const_cast<const char *>(__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<char *>(strrchr(const_cast<const char *>(__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<char *>(strstr(const_cast<const char *>(__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 <string.h>.
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 <string.h>.
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 19 "..\..\src\common\tau_log.h" 2
N#include <stdarg.h>
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. <stdio.h> 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"
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#define LOG_BUF_SIZE             (256)     /* 配置打印缓存的大小 */
N
N/*
N * Using the following three macros for conveniently logging.
N */
N#define TAU_LOGD(format,...)                                                  \
N    do {                                                                      \
N        tau_log_printf(kLOG_LEVEL_DBG, "[%s] (%04d) " format, LOG_TAG, __LINE__, ##__VA_ARGS__); \
N    } while (0)
X#define TAU_LOGD(format,...)                                                      do {                                                                              tau_log_printf(kLOG_LEVEL_DBG, "[%s] (%04d) " format, LOG_TAG, __LINE__, ##__VA_ARGS__);     } while (0)
N
N#define TAU_LOGI(format,...)                                                  \
N    do {                                                                      \
N        tau_log_printf(kLOG_LEVEL_INF, "[%s] (%04d) " format, LOG_TAG, __LINE__, ##__VA_ARGS__); \
N    } while (0)
X#define TAU_LOGI(format,...)                                                      do {                                                                              tau_log_printf(kLOG_LEVEL_INF, "[%s] (%04d) " format, LOG_TAG, __LINE__, ##__VA_ARGS__);     } while (0)
N
N#define TAU_LOGE(format,...)                                                  \
N    do {                                                                      \
N        tau_log_printf(kLOG_LEVEL_ERR, "[%s] (%04d) " format, LOG_TAG, __LINE__, ##__VA_ARGS__); \
N    } while (0)
X#define TAU_LOGE(format,...)                                                      do {                                                                              tau_log_printf(kLOG_LEVEL_ERR, "[%s] (%04d) " format, LOG_TAG, __LINE__, ##__VA_ARGS__);     } while (0)
N
N/*******************************************************************************
N* 3.Global structures, unions and enumerations using typedef
N*******************************************************************************/
N/**
N* @brief log打印等级枚举
N*
N*/
Ntypedef enum
N{
N    kLOG_LEVEL_DBG = 0,
N    kLOG_LEVEL_INF,
N    kLOG_LEVEL_ERR,
N    kLOG_LEVEL_NONE      /* 不打印任何参数 */
N} log_level_e;
N
N/**
N* @brief log打印端口枚举
N*
N*/
Ntypedef enum
N{
N    LOG_PORT_UART0,     /* 使用串口输出打印 */
N    LOG_PORT_UART1,     /* 使用串口输出打印 */
N    LOG_PORT_SWD,       /* 使用swd输出打印 */
N    LOG_PORT_UNKNOWN
N} log_port_e;
N
N/*******************************************************************************
N* 4.Global variable extern declarations
N*******************************************************************************/
N
N/*******************************************************************************
N* 5.Global function prototypes
N*******************************************************************************/
N/**
N* @brief  初始化log系统
N* @param  baud_rate 波特率
N* @param  log_port 打印端口选择
N* @retval none
N*/
Nvoid tau_log_init(uint32_t baud_rate, log_port_e log_port);
N
N/**
N* @brief  初始化log系统
N* @param  baud_rate 波特率
N* @param  log_port 打印端口选择
N* @retval none
N*/
Nvoid tau_log_printf(log_level_e log_lv, const char *fmt, ...);
N
N#endif
L 13 "..\..\src\app\P6A\p6a_demo.c" 2
N#include "tau_operations.h"
L 1 "..\..\src\common\tau_operations.h" 1
N/*******************************************************************************
N*
N*
N* File:        tau_operations.h
N* Description  位操作与字节操作相关定义头文件
N* Version      V0.1
N* Date         2020-09-07
N* Author       lzy
N *******************************************************************************/
N#ifndef __TAU_BYTEOPS_H
N#define __TAU_BYTEOPS_H
N
N/**
N * \name 通用位常数定义
N * @{
N */
N
N/** \brief 长整数位数 */
N#ifndef TAU_BITS_PER_LONG
N#define TAU_BITS_PER_LONG       32
N#endif
N
N/** \brief 字节位数 */
N#define TAU_BITS_PER_BYTE       8
N
N/** @} */
N
N
N/******************************************************************************/
N
N/**
N * \name 通用位操作
N * @{
N */
N
N/** \brief bit移位
N * TAU_BIT(2) is 0x4
N */
N#define TAU_BIT(bit)                  (1u << (bit))
N
N/** \brief 值移位
N * TAU_SBF(0xFF, 8) is 0xff00
N */
N#define TAU_SBF(value, field)         ((value) << (field))
N
N/** \brief bit置位
N * TAU_BIT_SET(0, 8) is 0x100
N */
N#define TAU_BIT_SET(data, bit)        ((data) |= TAU_BIT(bit))
N
N/** \brief bit清零
N * TAU_BIT_CLR(0xFF, 2) is 0xfb
N */
N#define TAU_BIT_CLR(data, bit)        ((data) &= ~TAU_BIT(bit))
N
N/** \brief bit置位, 根据 mask 指定的位
N * TAU_BIT_SET_MASK(0xF0F0, 0xF00) is 0xfff0
N */
N#define TAU_BIT_SET_MASK(data, mask)  ((data) |= (mask))
N
N/** \brief bit清零, 根据 mask 指定的位
N * TAU_BIT_CLR_MASK(0xFFFF, 0xFF00) is 0xff
N */
N#define TAU_BIT_CLR_MASK(data, mask)  ((data) &= ~(mask))
N
N/** \brief bit翻转
N * TAU_BIT_TOGGLE(0xFFFF, 0) is 0xfffe
N * TAU_BIT_TOGGLE(0x0000, 1) is 0x2
N */
N#define TAU_BIT_TOGGLE(data, bit)     ((data) ^= TAU_BIT(bit))
N
N/** \brief bit修改
N * TAU_BIT_MODIFY(0, 8, 1) is 0x100
N * TAU_BIT_MODIFY(0xFFFF, 1, 0) is 0xfffd
N */
N#define TAU_BIT_MODIFY(data, bit, value) \
N    ((value) ? TAU_BIT_SET(data, bit) : TAU_BIT_CLR(data, bit))
X#define TAU_BIT_MODIFY(data, bit, value)     ((value) ? TAU_BIT_SET(data, bit) : TAU_BIT_CLR(data, bit))
N
N/** \brief 测试bit是否置位
N * TAU_BIT_ISSET(0xF0F1, 1) is 0
N * TAU_BIT_ISSET(0xF0F2, 1) is 2
N */
N#define TAU_BIT_ISSET(data, bit)      ((data) & TAU_BIT(bit))
N
N/** \brief 获取bit值
N * TAU_BIT_GET(0xF0F1, 1) is 0
N * TAU_BIT_GET(0xF0F2, 1) is 1
N */
N#define TAU_BIT_GET(data, bit)        (TAU_BIT_ISSET(data, bit) ? 1 : 0)
N
N/** \brief 检测bit值
N * TAU_BIT_CHECK(0xF5FF, 4) is 1
N */
N#define TAU_BIT_CHECK(data, bit)  \
N    (((data) & TAU_BIT(bit)) ? 1 : 0)
X#define TAU_BIT_CHECK(data, bit)      (((data) & TAU_BIT(bit)) ? 1 : 0)
N
N/** \brief 获取 n bits 掩码值
N * TAU_BITS_MASK(2) is 0x3
N */
N#define TAU_BITS_MASK(n)              (~((~0u) << (n)))
N
N/** \brief 获取位段值
N * TAU_BITS_GET(0xF5FF, 0x0F00, 8) is 0x5
N */
N#define TAU_BITS_GET(data, mask, pos)  \
N    (((data) & (mask)) >> (pos))
X#define TAU_BITS_GET(data, mask, pos)      (((data) & (mask)) >> (pos))
N
N/** \brief 获取位段值
N * TAU_BITS_CHECK(0xF5FF, 0x0F00) is 1
N */
N#define TAU_BITS_CHECK(data, mask)  \
N    (((data) & (mask)) ? 1 : 0)
X#define TAU_BITS_CHECK(data, mask)      (((data) & (mask)) ? 1 : 0)
N
N/** \brief 修改位段值
N * TAU_BITS_MODIFY(0xF5FF, 0x0FF0, 0x8A0) is 0xF8AF
N*/
N#define TAU_BITS_MODIFY(data, clear_mask, set_mask) \
N    (data) = (((data) & (~(clear_mask))) | (set_mask))
X#define TAU_BITS_MODIFY(data, clear_mask, set_mask)     (data) = (((data) & (~(clear_mask))) | (set_mask))
N
N/** \brief 设置位段值
N * TAU_WRITE_REG32(0x05FF, 0xFFFA) is 0xFFFA
N*/
N#define TAU_WRITE_REG32(data, value) ((data) = (value))
N
N/** \brief 设置位段值
N * TAU_RAED_REG32(0x05FF) is 0x05FF
N*/
N#define TAU_RAED_REG32(data) (data)
N
N
N/** @} */
N
N/******************************************************************************/
N
N/**
N * \brief 取2-byte整数的高位byte
N *
N * \par 示例
N * \code
N *  uint16_t a = 0x1234;
N *  uint16_t b;
N *
N *  b = TAU_MSB(a);  //b=0x12
N * \endcode
N */
N#define TAU_MSB(x)       (((x) >> 8) & 0xff)
N
N/**
N * \brief 取2-byte整数的低位byte
N *
N * \par 示例
N * \code
N *  uint16_t a = 0x1234;
N *  uint16_t b;
N *
N *  b = TAU_LSB(a);  //b=0x34
N * \endcode
N */
N#define TAU_LSB(x)       ((x) & 0xff)
N
N/**
N * \brief 取2-word整数的高位word
N *
N * \par 示例
N * \code
N *  uint32_t a = 0x12345678;
N *  uint32_t b;
N *
N *  b = TAU_MSW(a);  //b=0x1234
N * \endcode
N */
N#define TAU_MSW(x)       (((x) >> 16) & 0xffff)
N
N/**
N * \brief 取2-word整数的低位word
N *
N * \par 示例
N * \code
N *  uint32_t a = 0x12345678;
N *  uint32_t b;
N *
N *  b = TAU_LSW(a);  //b=0x5678
N * \endcode
N */
N#define TAU_LSW(x)       ((x) & 0xffff)
N
N/**
N * \brief 交换32-bit整数的高位word和低位word
N *
N * \par 示例
N * \code
N *  uint32_t a = 0x12345678;
N *  uint32_t b;
N *
N *  b = TAU_WORDSWAP(a); //b=0x56781234
N * \endcode
N */
N#define TAU_WORDSWAP(x)  (TAU_MSW(x) | (TAU_LSW(x) << 16))
N
N/**
N * \brief 交换32-bit整数的字节顺序
N *
N * \par 示例
N * \code
N *  uint32_t a = 0x12345678;
N *  uint32_t b;
N *
N *  b = TAU_LONGSWAP(a); //b=0x78563412
N * \endcode
N */
N#define TAU_LONGSWAP(x)  ((TAU_LLSB(x) << 24) | \
N                          (TAU_LNLSB(x) << 16) | \
N                          (TAU_LNMSB(x) << 8)  | \
N                          (TAU_LMSB(x)))
X#define TAU_LONGSWAP(x)  ((TAU_LLSB(x) << 24) |                           (TAU_LNLSB(x) << 16) |                           (TAU_LNMSB(x) << 8)  |                           (TAU_LMSB(x)))
N
N#define TAU_LLSB(x)      ((x) & 0xff)                    /**< \brief 取32bit整数第1个字节 */
N#define TAU_LNLSB(x)     (((x) >> 8) & 0xff)             /**< \brief 取32bit整数第2个字节 */
N#define TAU_LNMSB(x)     (((x) >> 16) & 0xff)            /**< \brief 取32bit整数第3个字节 */
N#define TAU_LMSB(x)      (((x) >> 24) & 0xff)            /**< \brief 取32bit整数第4个字节 */
N#define TAU_LNSB(x,n)    (((x) >> ((n) * 8) ) & 0xff)      /**< \brief 取32bit整数第n个字节 ,参数 0 - 3*/
N
N/**
N * @}
N */
N
N#endif /* __TAU_BYTEOPS_H */
N
N/* end of file */
N
L 14 "..\..\src\app\P6A\p6a_demo.c" 2
N#include "tau_common.h"
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 16 "..\..\src\app\P6A\p6a_demo.c" 2
N#include "hal_dsi_rx_ctrl.h"
L 1 "..\..\src\sdk\include\hal_dsi_rx_ctrl.h" 1
N/*******************************************************************************
N*
N*
N* File:         hal_dsi_rx_ctrl.h
N* Description:  hal mipi dsi rx path control 头文件
N* Version:      V0.1
N* Date:         2021-04-06
N* Author:       lzy
N *******************************************************************************/
N#ifndef __HAL_DSI_RX_CTRL_H__
N#define __HAL_DSI_RX_CTRL_H__
N
N/*******************************************************************************
N* 1.Included files
N*******************************************************************************/
N#include "tau_dsi_datatype.h"
L 1 "..\..\src\common\tau_dsi_datatype.h" 1
N/*******************************************************************************
N*
N*
N* File:         tau_dsi_datatype.h
N* Description:  mipi dsi 通用头文件
N* Version:      V0.1
N* Date:         2021-01-13
N* Author:       lzy
N *******************************************************************************/
N
N#ifndef __MIPI_DSI_COMMON_H__
N#define __MIPI_DSI_COMMON_H__
N
N/*******************************************************************************
N* 1.Included files
N*******************************************************************************/
N#include "tau_common.h"
N
N/*******************************************************************************
N* 2.Global constant and macro definitions using #define
N*******************************************************************************/
N#define DSC_PPS_SIZE 128
N
N/*******************************************************************************
N* 3.Global structures, unions and enumerations using typedef
N*******************************************************************************/
N/**
N* @brief  Data Types for Peripheral-sourced Packets,From Mipi DSI Spec
N*/
Ntypedef enum
N{
N    DSI_ACK_DT_ERROR                 = 0x02,
N    DSI_ACK_DT_EOTP                  = 0x08,
N    DSI_ACK_DT_GEN_SHORT_RESPONSE_1B = 0x11,
N    DSI_ACK_DT_GEN_SHORT_RESPONSE_2B = 0x12,
N    DSI_ACK_DT_GEN_LONG_RESPONSE     = 0x1A,
N    DSI_ACK_DT_DCS_LONG_RESPONSE     = 0x1C,
N    DSI_ACK_DT_DCS_SHORT_RESPONSE_1B = 0x21,
N    DSI_ACK_DT_DCS_SHORT_RESPONSE_2B = 0x22,
N    DSI_ACK_DT_MAX
N} dsi_ack_data_type_e;
N
N/**
N* @brief Software handle data types
N*/
Ntypedef enum
N{
N    DSI_RECV_DT_PPS                   = 0x0A,   //Picture Parameter Set
N    DSI_RECV_DT_GEN_WRITE_1B          = 0x13,   //Generic Short WRITE, 1 parameter
N    DSI_RECV_DT_GEN_WRITE_2B          = 0x23,   //Generic Short WRITE, 2 parameters
N    DSI_RECV_DT_GEN_READ_0B           = 0x04,   //Generic READ, no parameters
N    DSI_RECV_DT_GEN_READ_1B           = 0x14,   //Generic READ, 1 parameter
N    DSI_RECV_DT_GEN_READ_2B           = 0x24,   //Generic READ, 2 parameters
N    DSI_RECV_DT_DCS_WRITE_0B          = 0x05,   //DCS Short WRITE, no parameters
N    DSI_RECV_DT_DCS_WRITE_1B          = 0x15,   //DCS Short WRITE, 1 parameter
N    DSI_RECV_DT_DCS_READ_0B           = 0x06,   //DCS READ, no parameters
N    DSI_RECV_DT_GEN_WRITE_LONG        = 0x29,   //Generic Long Write
N    DSI_RECV_DT_DCS_WRITE_LONG        = 0x39,   //DCS Long Write/write_LUT Command Packet
N    DSI_RECV_DT_MAX
N} dsi_data_type_e;
N
Ntypedef enum
N{
N    DCS_ENTER_IDLE_MODE       = 0x39,
N    DCS_ENTER_INVERT_MODE     = 0x21,
N    DCS_ENTER_NORMAL_MODE     = 0x13,
N    DCS_ENTER_PARTIAL_MODE    = 0x12,
N    DCS_ENTER_SLEEP_MODE      = 0x10,
N    DCS_EXIT_IDLE_MODE        = 0x38,
N    DCS_EXIT_INVERT_MODE      = 0x20,
N    DCS_EXIT_SLEEP_MODE       = 0x11,
N    DCS_GET_3D_CONTROL        = 0x3F,
N    DCS_GET_ADDRESS_MODE      = 0x0B,
N    DCS_GET_BLUE_CHANNEL      = 0x08,
N    DCS_GET_COMPRESSION_MODE  = 0x03,
N    DCS_GET_DIAGNOSTIC_RESULT = 0x0F,
N    DCS_GET_DISPLAY_MODE      = 0x0D,
N    DCS_GET_GREEN_CHANNEL     = 0x07,
N    DCS_GET_PIXEL_FORMAT      = 0x0C,
N    DCS_GET_POWER_MODE        = 0x0A,
N    DCS_GET_RED_CHANNEL       = 0x06,
N    DCS_GET_SCANLINE          = 0x45,
N    DCS_GET_SIGNAL_MODE       = 0x0E,
N    DCS_NOP                   = 0x00,
N    DCS_READ_DDB_CONTINUE     = 0xA8,
N    DCS_READ_DDB_START        = 0xA1,
N    DCS_READ_MEMORY_CONTINUE  = 0x3E,
N    DCS_READ_MEMORY_START     = 0x2E,
N    DCS_SET_3D_CONTROL        = 0x3D,
N    DCS_SET_ADDRESS_MODE      = 0x36,
N    DCS_SET_COLUMN_ADDRESS    = 0x2A,
N    DCS_SET_DISPLAY_OFF       = 0x28,
N    DCS_SET_DISPLAY_ON        = 0x29,
N    DCS_SET_GAMMA_CURVE       = 0x26,
N    DCS_SET_PAGE_ADDRESS      = 0x2B,
N    DCS_SET_PARTIAL_COLUMNS   = 0x31,
N    DCS_SET_PARTIAL_ROWS      = 0x30,
N    DCS_SET_PIXEL_FORMAT      = 0x3A,
N    DCS_SET_SCROLL_AREA       = 0x33,
N    DCS_SET_SCROLL_START      = 0x37,
N    DCS_SET_TEAR_OFF          = 0x34,
N    DCS_SET_TEAR_ON           = 0x35,
N    DCS_SET_TEAR_SCANLINE     = 0x44,
N    DCS_SET_VSYNC_TIMING      = 0x40,
N    DCS_SOFT_RESET            = 0x01,
N    DCS_WRITE_LUT             = 0x2D,
N    DCS_WRITE_MEMORY_CONTINUE = 0x3C,
N    DCS_WRITE_MEMORY_START    = 0x2C
N} dsi_dcs_cmd_type_e;
N
N/**
N* @brief  video data transfer mode
N*/
Ntypedef enum
N{
N    DSI_DATA_VIDEO_MODE = 0,
N    DSI_DATA_CMD_MODE   = 1,
N    DSI_DATA_MODE_MAX
N} dsi_video_data_mode_e;
N
N/**
N* @brief  dsi virtual channel
N*/
Ntypedef enum
N{
N    DSI_VC_0 = 0,
N    DSI_VC_1 = 1,
N    DSI_VC_2 = 2,
N    DSI_VC_3 = 3,
N    DSI_VC_MAX
N} dsi_virtual_channel_e;
N
N/**
N* @brief  video data mode
N*/
Ntypedef enum
N{
N    DSI_FRAME_RATE_60HZ  = 0,
N    DSI_FRAME_RATE_90HZ  = 1,
N    DSI_FRAME_RATE_120HZ = 2,
N    DSI_FRAME_RATE_144HZ = 3,
N    DSI_FRAME_RATE_160HZ = 4,
N    DSI_FRAME_RATE_MAX
N} dsi_video_frame_rate_e;
N
N/**
N* @brief  dsi rx color coding
N*/
Ntypedef enum
N{
N    DSI_RGB565               = 1,
N    DSI_RGB666               = 2,    /*!< 18 bbp(18bits per pixel) */
N    DSI_RGB666_LOOSELY       = 3,    /*!< 24 bbp(24bits per pixel) */
N    DSI_RGB888               = 4,    /*!< 24 bbp(24bits per pixel) */
N    DSI_RGB10_10_10          = 5,
N    DSI_RGB12_12_12          = 6,
N    DSI_YCbCr422_16          = 7,
N    DSI_PENTILE_16           = DSI_YCbCr422_16,
N    DSI_YCbCr422_20_LOOSELY  = 8,
N    DSI_YCbCr422_24          = 9,
N    DSI_YCbCr420_12          = 10,
N    DSI_DSC_STREAM           = 11,
N    DSI_COLOR_CODE_MAX
N} dsi_color_code_e;
N
N/**
N* @brief  dsi endianness type
N*/
Ntypedef enum
N{
N    DPI_ENDIAN_RGB = 0,
N    DPI_ENDIAN_BGR
N} dsi_endianness_e;
N
N/**
N* @brief  mipi lane number
N*/
Ntypedef enum
N{
N    DSI_LANE_1 = 1,
N    DSI_LANE_2 = 2,
N    DSI_LANE_3 = 3,
N    DSI_LANE_4 = 4,
N    DSI_LANE_NUME_MAX
N} dsi_lane_nume_e;
N
N/**
N* @brief video mode
N*/
Ntypedef enum
N{
N    DSI_NONBURST_PULSE = 0,
N    DSI_NONBURST_EVENT = 1,
N    DSI_BURST_MODE     = 2,
N    DSI_VIDEO_MODE_MAX
N} dsi_video_mode_type_e;
N
N/**
N* @brief panel init cmd transfer type
N*/
Ntypedef enum
N{
N    DSI_CMD_TX_HS = 0,
N    DSI_CMD_TX_LP = 1
N} dsi_tx_cmd_tx_type_e;
N
N/**
N* @brief  angle of rotation
N*/
Ntypedef enum
N{
N    VIDOE_ROT_ANGLE_0    = 0, /* 不旋转       */
N    VIDOE_ROT_ANGLE_90   = 1, /* 旋转90度     */
N    VIDOE_ROT_ANGLE_180  = 2, /* 旋转180度 */
N    VIDOE_ROT_ANGLE_270  = 3, /* 转转270度 */
N    VIDOE_ROT_ANGLE_MAX
N} video_rotate_angle_e;
N
N/**
N* @brief mipi rx lane swap
N软件配置                        PIN28&PIN27         PIN26&PIN25         PIN24&PIN23             PIN22&PIN21         PIN20&PIN19
NRX_LANE_SWAP_0123           D0P&D0N             D1P&D1N             CLKP&CLKN               D2P&D2N             D3P&D3N
NRX_LANE_SWAP_3210           D3P&D3N             D2P&D2N             CLKP&CLKN               D1P&D1N             D0P&D0N
NRX_LANE_SWAP_2103(default)  D2P&D2N             D1P&D1N             CLKP&CLKN               D0P&D0N             D3P&D3N
NRX_LANE_SWAP_3012           D3P&D3N             D0P&D0N             CLKP&CLKN               D1P&D1N             D2P&D2N
N*/
Ntypedef enum
N{
N    RX_LANE_SWAP_0123  = 0x0,
N    RX_LANE_SWAP_3210  = 0x1,
N    RX_LANE_SWAP_2103  = 0x2,
N    RX_LANE_SWAP_DEFAULT_ORDER = 0x2,   /* 默认原理图为2103顺序 */
N    RX_LANE_SWAP_3012  = 0x3,
N    RX_LANE_SWAP_MAX
N} dsi_rx_lane_swap_e;
N
N/**
N* @brief mipi P/N lane swap flag
N* eg: pn_swap = RX_LANE_0_PN_SWAP | RX_LANE_CLK_PN_SWAP;
N* 表示 lane0 与 CLK 的P跟N交换，其他lane不变。
N* 注意这里的lane表示的是进行完lane swap的lane,如lane swap配置RX_LANE_SWAP_3012,再配置RX_LANE_0_PN_SWAP则表示PIN26&PIN25进行PN交换,由D0P&D0N变成D0N&D0P
N*/
Ntypedef enum
N{
N    RX_LANE_0_PN_SWAP = 0x1,
N    RX_LANE_1_PN_SWAP = 0x2,
N    RX_LANE_2_PN_SWAP = 0x4,
N    RX_LANE_3_PN_SWAP = 0x8,
N    RX_LANE_CLK_PN_SWAP = 0x10
N} dsi_rx_lane_pn_swap_e;
N
N/**
N* @brief error processing level
N*/
Ntypedef enum
N{
N    ERR_HANDLE_NONE  = 0,
N    ERR_HANDLE_L1  = 1,
N    ERR_HANDLE_L2  = 2,
N    ERR_HANDLE_L3  = 3,
N    ERR_HANDLE_MAX
N} hal_err_handle_level_e;
N
N/**
N* @brief flow control mode
N*/
Ntypedef enum
N{
N    FC_AUTO_MODE        = 0,         /* 自动匹配模式,根据base info配置匹配1-4 */
N    FC_V2V_NORMAL_MODE  = 1,         /* Video to Video 模式转换 */
N    FC_V2C_NORMAL_MODE  = 2,         /* Video to Command 模式转换 */
N    FC_C2V_NORMAL_MODE  = 3,         /* Command to Video 模式转换 */
N    FC_C2C_NORMAL_MODE  = 4,         /* Command to Command 模式转换 */
N    FC_PRO_MOTION_MODE  = 6,         /* 自适应帧率转换(LTPO模式) */
N    FC_PRO_MOTION_MODE_2  = 5,         /* 自适应帧率转换(LTPO模式) */
N    FC_PRO_MOTION_WITH_PU_MODE = 7,  /* 自适应帧率带PU */
N    FC_V2V_AUTO_SYCN_MODE = 8,       /* Video to Video 软件同步 */
N    FC_V2V_DIRECT_MODE   = 9,        /* Video to Video 直通模式 */
N    FC_MODE_MAX
N} flow_control_mode_e;
N
N/**
N* @brief  transform 基本信息
N*/
Ntypedef struct
N{
N    uint16_t top;
N    uint16_t bottom;
N    uint16_t left;
N    uint16_t right;
N    bool     enable;
X    _Bool     enable;
N} pic_edge_info_t;
N
N/**
N* @brief  transform 基本信息
N*/
Ntypedef struct
N{
N    uint32_t src_w;                     /* mipi rx 接收的 width        */
N    uint32_t src_h;                     /* mipi rx 接收的 height       */
N    uint32_t dst_w;                     /* mipi tx 发送的 width        */
N    uint32_t dst_h;                     /* mipi tx 发送的 height       */
N    dsi_video_frame_rate_e src_frate;   /* mipi rx 接收的frame rate */
N    dsi_video_data_mode_e  src_mode;    /* mipi rx 接收video 数据传输模式(video/cmd mode) */
N    dsi_video_data_mode_e  dst_mode;    /* mipi tx 输出video 数据传输模式(video/cmd mode) */
N    uint16_t pn_swap;                   /* mipi P/N swap标志位, rx可配置/tx暂不支持   */
N} dsi_base_trans_info_t;
N
N/**
N* @brief  transform 基本信息
N*/
Ntypedef struct
N{
N    bool     mirror_en;                       /* 对video 做水平镜像标志位 */
X    _Bool     mirror_en;                        
N    bool     pu_optimize;                     /* 用于优化PU显示效果，默认为false;true:优化PU显示显示效果,高功耗;false:普通PU模式,低功耗 */
X    _Bool     pu_optimize;                      
N    video_rotate_angle_e   rot_angle;         /* 对video 做旋转的角度 */
N    flow_control_mode_e    flow_control_mode; /* 图像数据流控制模式 */
N    pic_edge_info_t        crop_info;         /* 图像边缘裁剪配置 not impletmented */
N    pic_edge_info_t        blank_info;        /* 图像边缘补黑配置 not impletmented */
N    bool                   bw_optimize;       /* 带宽自动检查,默认打开 */
X    _Bool                   bw_optimize;        
N    uint8_t                pq_type;           /* picture quality,参数为 pq_type_e */
N} dsi_base_extra_info_t;
N
N/**
N* @brief  ccm系数
N*/
Ntypedef struct
N{
N    uint32_t coef_c00;
N    uint32_t coef_c01;
N    uint32_t coef_c02;
N    uint32_t coef_c10;
N    uint32_t coef_c11;
N    uint32_t coef_c12;
N    uint32_t coef_c20;
N    uint32_t coef_c21;
N    uint32_t coef_c22;
N} ccm_coef_t;
N
N/**
N* @brief hight performan mode level
N*/
Ntypedef enum
N{
N    HIGHT_PERFORMAN_NONE  = 0,
N    HIGHT_PERFORMAN_L1  = 1,
N    HIGHT_PERFORMAN_L2  = 2,
N    HIGHT_PERFORMAN_MAX
N} hight_performan_mode_e;
N
N/**
N* @brief  TX False color去伪彩参数结构体
N*/
Ntypedef struct
N{
N    uint16_t edgemedslope;
N    uint16_t desatslope;
N} dsi_tx_fc_t;
N
N/**
N* @brief  TX 边缘增强参数结构体
N*/
Ntypedef struct
N{
N    bool     y_enh_method;
X    _Bool     y_enh_method;
N    uint8_t  enhance_str;
N    uint16_t enhance_slope;
N    uint16_t boundscale_low;
N    uint16_t boundscale_high;
N} dsi_tx_edge_enh_t;
N
N/**
N* @brief  TX 边缘检测参数结构体
N*/
Ntypedef struct
N{
N    uint8_t  edge_thr;
N    bool     use_large_kernel;
X    _Bool     use_large_kernel;
N} dsi_tx_edge_dect_t;
N
N/**
N* @brief  TX bcsa 参数结构体
N*/
Ntypedef struct
N{
N    int8_t   brightness; /* 亮度调整,   范围-127 - 127 */
N    uint16_t contrast;   /* 对比度调整,范围0 - 4095 */
N    uint16_t saturation; /* 饱和度调整,范围0 - 4095 */
N} dsi_tx_bcs_t;
N
N/**
N* @brief  partial display 参数结构体
N*/
Ntypedef struct
N{
N    uint32_t    st_line;    /*部分显示起始行位置*/
N    uint32_t    st_col;     /*部分显示起始列位置*/
N    uint32_t    end_line;   /*部分显示结束行位置*/
N    uint32_t    end_col;    /*部分显示结束列位置*/
N    uint8_t     value_r;    /*部分显示背景色R值*/
N    uint8_t     value_g;    /*部分显示背景色G值*/
N    uint8_t     value_b;    /*部分显示背景色B值*/
N} dsi_tx_par_dis_t;
N
N#endif //__MIPI_DSI_COMMON_H__
L 17 "..\..\src\sdk\include\hal_dsi_rx_ctrl.h" 2
N#include "tau_common.h"
N#include "tau_log.h"
N
N/*******************************************************************************
N* 2.Global constant and macro definitions using #define
N*******************************************************************************/
N#define RX_DCS_QUEUE_MAX_SIZE 20  /* DCS存储队列长度 */
N
N/*******************************************************************************
N* 3.Global structures, unions and enumerations using typedef
N*******************************************************************************/
Ntypedef struct hal_dcs_execute_entry_t hal_dcs_execute_entry_t;
N
Ntypedef struct hal_dcs_packet_t hal_dcs_packet_t;
N
Ntypedef struct hal_dsi_rx_ctrl_handle_t hal_dsi_rx_ctrl_handle_t;
N
N/* DCS CMD 回调函数, 注册进cus_dcs_entry_table里, 匹配对应的DCS 后回调*/
Ntypedef bool (*hal_dsi_rx_ctrl_dcs_execute)(hal_dsi_rx_ctrl_handle_t *rx_handle, hal_dcs_packet_t *dcs_packet);
Xtypedef _Bool (*hal_dsi_rx_ctrl_dcs_execute)(hal_dsi_rx_ctrl_handle_t *rx_handle, hal_dcs_packet_t *dcs_packet);
N
N/* AP 读cmd 回调, 需要快速回CMD 时可注册, 为NULL 时DSC 读指令与写指令经过parse后由cus_dcs_entry_table回调 */
Ntypedef bool (*hal_dsi_rx_ctrl_read_entry)(uint8_t data_type, uint8_t dcs_cmd, uint8_t param);
Xtypedef _Bool (*hal_dsi_rx_ctrl_read_entry)(uint8_t data_type, uint8_t dcs_cmd, uint8_t param);
N
N/* AP PPS 更新回调,参数为PPS 以及从PPS 里解析出来的picture width/height, 用于分辨率切换, 不注册该接口时内部处理PPS */
Ntypedef bool (*hal_dsi_rx_ctrl_pps_entry)(uint8_t *pps, uint8_t size, uint32_t pic_width, uint32_t pic_height);
Xtypedef _Bool (*hal_dsi_rx_ctrl_pps_entry)(uint8_t *pps, uint8_t size, uint32_t pic_width, uint32_t pic_height);
N
N/**
N* @brief hal_rx_event_e select
N*/
Ntypedef enum hal_rx_event_e
N{
N    HAL_RX_FS_EVENT     = 0x1,    /* Frame start event         */
N    HAL_RX_LINE_EVENT   = 0x2,    /* Frame receive line event  */
N    HAL_RX_END_EVENT    = 0x4,    /* Frame end event           */
N} hal_rx_event_e;
N
N/**
N* @brief rx pq filter index
N* 默认使用linear,特殊场景使用OPT filter
N* RX_FLT_OPT_0最模糊,边缘最平滑,index越大越清晰,边缘锯齿会加重
N*/
Ntypedef enum
N{
N    RX_FLT_OPT_0    = 0,
N    RX_FLT_OPT_1    = 1,
N    RX_FLT_OPT_2    = 2,
N    RX_FLT_OPT_3    = 3,
N    RX_FLT_OPT_4    = 4,
N    RX_FLT_OPT_5    = 5,
N    RX_FLT_OPT_6    = 6,
N    RX_FLT_OPT_7    = 7,
N    RX_FLT_OPT_8    = 8,
N    RX_FLT_OPT_9    = 9,
N    RX_FLT_OPT_10   = 10,
N    RX_FLT_LINEAR   = 11,
N    RX_FLT_MAX
N} hal_dsi_rx_pq_filter_e;
N
N/* RX debug 回调函数,用于获取frame start 等功能debug */
Ntypedef void (*hal_dsi_rx_ctrl_event_entry)(hal_rx_event_e event, void *data);
N
N/**
N* @brief  dsi rx ctrl handle struct
N*/
Ntypedef struct hal_dsi_rx_ctrl_handle_t
N{
N    dsi_base_trans_info_t            base_info;                 /* mipi video 转换基本信息 */
N    dsi_base_extra_info_t            extra_info;                /* 新增旋转、镜像配置 */
N    dsi_color_code_e                 rx_color_mode;             /* 输入color mode */
N    dsi_lane_nume_e                  rx_lanes;                  /* mipi data lane */
N    dsi_video_mode_type_e            rx_nonburst_models;        /* transmission packet sequences */
N    bool                             compress_en;               /* DSC 压缩标志 */
X    _Bool                             compress_en;                
N    uint32_t                         rx_hsclk_rate;             /* mipi 高速信号lane rate */
N    uint8_t                          rx_dsc_pps[DSC_PPS_SIZE];  /* DSC 压缩PPS参数 */
X    uint8_t                          rx_dsc_pps[128];   
N    const hal_dcs_execute_entry_t    *cus_dcs_entry_table;      /* DCS处理函数列表 */
N    hal_dsi_rx_ctrl_read_entry       rx_dcs_read_entry;         /* Host读指令数据函数,为NULL时由rx_dcs_queue注册cmd处理 */
N    hal_dsi_rx_ctrl_pps_entry        pps_update_entry;          /* PPS Update 时回调函数,用于分辨率切换更新PPS,为NULL时内部处理 */
N    bool                             used;                      /* handle使用标志位 */
X    _Bool                             used;                       
N    hal_err_handle_level_e           err_handler_level;         /* RX接收错误的时候对模块做reset等级, 等级越高reset模块越多 */
N    uint8_t                          rx_strength;               /* 用于调节RX信号强度，仅适用于开启内阻校准模式，档位0~7，默认3 */
N    hight_performan_mode_e           hight_performan_mode;      /* 高性能模式等级,参考hight_performan_mode_e */
N    dsi_rx_lane_swap_e               rx_lane_swap;              /* lane swap default order is 2103*/
N    hal_dsi_rx_pq_filter_e           rx_pq_index;               /* 画质调整滤波器,默认为linear最优效果,特殊场景使用OPT filter */
N} hal_dsi_rx_ctrl_handle_t;
N
N/**
N* @brief  DCS command execute entry
N*/
Ntypedef struct hal_dcs_execute_entry_t
N{
N    uint32_t dcs_command;                      /* DCS command */
N    hal_dsi_rx_ctrl_dcs_execute execute_func;  /* command 对应处理函数 */
N    bool immediately_func;                     /* 执行机制:true-在中断里立即执行,false-加入DCS队列异步执行 */
X    _Bool immediately_func;                      
N} hal_dcs_execute_entry_t;
N
N/**
N* @brief  存储 DCS packet 结构体
N*/
Ntypedef struct hal_dcs_packet_t
N{
N    uint32_t data_type;                        /* data type */
N    uint32_t dcs_command;                      /* dcs command */
N    uint32_t param_length;                     /* dcs param length */
N    uint8_t *packet_param;                     /* dcs param */
N    uint16_t crc_data;                         /* dcs crc */
N    const hal_dcs_execute_entry_t *dcs_execute_entry;  /* dcs packet 处理函数入口*/
N} hal_dcs_packet_t;
N
N/**
N* @brief video mode 下 RX pattern参数结构体
N*/
Ntypedef struct
N{
N    uint32_t                  ipi_pg_hsa;
N    uint32_t                  ipi_pg_hbp;
N    uint32_t                  ipi_pg_hfp;
N    uint32_t                  ipi_pg_vsa;
N    uint32_t                  ipi_pg_vbp;
N    uint32_t                  ipi_pg_vfp;
N    uint32_t                  frame_rate;
N} hal_dsi_rx_ipi_pg_t;
N
N
N/**
N* @brief dcs command filter select
N*/
Ntypedef enum
N{
N    HAL_RX_DCS_FILTER_0 = 0x0,
N    HAL_RX_DCS_FILTER_1 = 0x1,
N    HAL_RX_DCS_FILTER_2 = 0x2,
N    HAL_RX_DCS_FILTER_3 = 0x3,
N    HAL_RX_DCS_FILTER_4 = 0x4,
N    HAL_RX_DCS_FILTER_5 = 0x5,
N    HAL_RX_DCS_FILTER_6 = 0x6,
N    HAL_RX_DCS_FILTER_7 = 0x7,
N    HAL_RX_DCS_FILTER_8 = 0x8,
N    HAL_RX_DCS_FILTER_9 = 0x9,
N    HAL_RX_DCS_FILTER_A = 0xA,
N    HAL_RX_DCS_FILTER_B = 0xB,
N    HAL_RX_DCS_FILTER_MAX
N} hal_rx_dcs_filter_sel_e;
N
N
N/**
N* @brief dcs command filter select
N*/
Ntypedef enum
N{
N    HAL_RX_QRESP_CODE0 = 0,
N    HAL_RX_QRESP_CODE1 = 1,
N    HAL_RX_QRESP_CODE2 = 2,
N    HAL_RX_QRESP_CODE3 = 3,
N    HAL_RX_QRESP_CODE4 = 4,
N    HAL_RX_QRESP_CODE5 = 5,
N    HAL_RX_QRESP_CODE6 = 6,
N    HAL_RX_QRESP_CODE7 = 7,
N    HAL_RX_QRESP_MAX
N} hal_rx_dcs_qresp_e;
N
N/**
N* @brief  pentile source color format
N*/
Ntypedef enum
N{
N    PENTILE_SRC_FORMAT_RGB           = 0x0,
N    PENTILE_SRC_FORMAT_BGR           = 0x1,
N    PENTILE_SRC_FORMAT_RGBG_BGRG     = 0x8,
N    PENTILE_SRC_FORMAT_GBGR_GRGB     = 0x9,
N    PENTILE_SRC_FORMAT_BGRG_RGBG     = 0xA,
N    PENTILE_SRC_FORMAT_GRGB_GBGR     = 0xB,
N    PENTILE_SRC_FORMAT_RGBG_RGBG     = 0xC,
N    PENTILE_SRC_FORMAT_GBGR_GBGR     = 0xD,
N    PENTILE_SRC_FORMAT_BGRG_BGRG     = 0xE,
N    PENTILE_SRC_FORMAT_GRGB_GRGB     = 0xF,
N    PENTILE_SRC_FORMAT_MAX
N} pentile_src_format_e;
N
N/**
N* @brief 设置RX CLK
N*/
Ntypedef enum
N{
N    RX_CLK_100M   = 0,
N    RX_CLK_150M   = 1,
N    RX_CLK_200M   = 2,
N    RX_CLK_300M   = 3,
N    RX_CLK_40M   = 4,
N    RX_CLK_80M   = 5,
N    RX_CLK_MAX
N} hal_rx_clk_e;
N
N/**
N* @brief pq_type_e select
N*/
Ntypedef enum
N{
N    PQ_TYPE_DEFAULT     = 0x0,
N    PQ_TYPE_LIMIT       = 0x1,
N    PQ_TYPE_MAX
N} pq_type_e;
N
N/**
N* @brief 线的粗细
N*/
Ntypedef enum
N{
N    LINE_WEIGHT_FINE = 0,
N    LINE_WEIGHT_MEDIUM = 1,
N    LINE_WEIGHT_BOLD = 2,
N    LINE_WEIGHT_MAX
N} line_weight_e;
N
N/*******************************************************************************
N* 4.Global variable extern declarations
N*******************************************************************************/
N
N/*******************************************************************************
N* 5.Global function prototypes
N*******************************************************************************/
N
N/**
N* @brief  创建dsi rx ctrl handle (释放时需调用hal_dsi_rx_ctrl_release_handle)
N* @param  none
N* @retval dsi rx handle
N*/
Nhal_dsi_rx_ctrl_handle_t *hal_dsi_rx_ctrl_create_handle(void);
N
N/**
N* @brief  释放dsi rx ctrl handle
N* @param  rx_ctrl_handle: dsi rx handle
N* @retval true/false
N*/
Nbool hal_dsi_rx_ctrl_release_handle(hal_dsi_rx_ctrl_handle_t *rx_ctrl_handle);
X_Bool hal_dsi_rx_ctrl_release_handle(hal_dsi_rx_ctrl_handle_t *rx_ctrl_handle);
N
N/**
N* @brief  设置rx ctrl handle 里的 PPS 参数
N* @param  rx_ctrl_handle: dsi rx handle
N* @param  pps: pps 参数
N* @param  pps_size: pps 参数长度
N* @retval true/false
N*/
Nbool hal_dsi_rx_ctrl_pre_init_pps(hal_dsi_rx_ctrl_handle_t *rx_ctrl_handle, uint8_t pps[], uint32_t pps_size);
X_Bool hal_dsi_rx_ctrl_pre_init_pps(hal_dsi_rx_ctrl_handle_t *rx_ctrl_handle, uint8_t pps[], uint32_t pps_size);
N
N/**
N* @brief  初始化dsi rx 模块
N* @param  rx_ctrl_handle: dsi rx handle
N* @retval true/false
N*/
Nbool hal_dsi_rx_ctrl_init(hal_dsi_rx_ctrl_handle_t *rx_ctrl_handle);
X_Bool hal_dsi_rx_ctrl_init(hal_dsi_rx_ctrl_handle_t *rx_ctrl_handle);
N
N/**
N* @brief  dsi rx 模块去初始化
N* @param  rx_ctrl_handle: dsi rx handle
N* @retval true/false
N*/
Nbool hal_dsi_rx_ctrl_deinit(hal_dsi_rx_ctrl_handle_t *rx_ctrl_handle);
X_Bool hal_dsi_rx_ctrl_deinit(hal_dsi_rx_ctrl_handle_t *rx_ctrl_handle);
N
N/**
N* @brief  启动dsi rx
N* @param  rx_ctrl_handle: dsi rx handle
N* @retval true/false
N*/
Nbool hal_dsi_rx_ctrl_start(hal_dsi_rx_ctrl_handle_t *rx_ctrl_handle);
X_Bool hal_dsi_rx_ctrl_start(hal_dsi_rx_ctrl_handle_t *rx_ctrl_handle);
N
N/**
N* @brief  重新配置dsi rx参数并恢复状态 (debug使用, 重新配置rx_ctrl_handle参数后调用该接口重启)
N* @param  rx_ctrl_handle: dsi rx handle
N* @retval true/false
N*/
Nbool hal_dsi_rx_ctrl_restart(hal_dsi_rx_ctrl_handle_t *rx_ctrl_handle);
X_Bool hal_dsi_rx_ctrl_restart(hal_dsi_rx_ctrl_handle_t *rx_ctrl_handle);
N
N/**
N* @brief  停止dsi rx
N* @param  rx_ctrl_handle: dsi rx handle
N* @retval true/false
N*/
Nbool hal_dsi_rx_ctrl_stop(hal_dsi_rx_ctrl_handle_t *rx_ctrl_handle);
X_Bool hal_dsi_rx_ctrl_stop(hal_dsi_rx_ctrl_handle_t *rx_ctrl_handle);
N
N/**
N* @brief  手动设置RX clk,一般RX CLK 由底层自动计算,用于特殊video mode场景出现FIFO FULL情况调试使用
N* @param  rxbr_clk: rx clk, 需要大于hs_lane_rate/8
N* @retval true/false
N*/
Nbool hal_dsi_rx_ctrl_set_rx_clk(hal_dsi_rx_ctrl_handle_t *rx_ctrl_handle, hal_rx_clk_e rxbr_clk);
X_Bool hal_dsi_rx_ctrl_set_rx_clk(hal_dsi_rx_ctrl_handle_t *rx_ctrl_handle, hal_rx_clk_e rxbr_clk);
N
N/**
N* @brief  发送 MIPI HOST的读响应 CMD
N* @param  rx_ctrl_handle: dsi rx handle
N* @param  data_type: data type
N* @param  vc:        virtual channel
N* @param  cmd_count: ack command 的长度
N* @param  ...      : 需要发送的command(数量与cmd_count 配置一致)
N* @retval true/false
N*/
Nbool hal_dsi_rx_ctrl_send_ack_cmd(hal_dsi_rx_ctrl_handle_t *rx_ctrl_handle, dsi_ack_data_type_e data_type, dsi_virtual_channel_e vc, uint8_t cmd_count, ...);
X_Bool hal_dsi_rx_ctrl_send_ack_cmd(hal_dsi_rx_ctrl_handle_t *rx_ctrl_handle, dsi_ack_data_type_e data_type, dsi_virtual_channel_e vc, uint8_t cmd_count, ...);
N
N/**
N* @brief  使用数组方式回复短包,与hal_dsi_rx_ctrl_send_ack_cmd功能一致
N* @param  rx_ctrl_handle: dsi rx handle
N* @param  data_size: 数组长度,固定为4
N* @param  data: 回复cmd数据,数据排列有严格规定:
N* data[0]:DI(data type)
N* data[1]:data 0
N* data[2]:data 1
N* data[3]:内部pkt type,短包固定为0
N* @retval true/false
N*/
Nbool hal_dsi_rx_ctrl_ack_short_cmd(hal_dsi_rx_ctrl_handle_t *rx_ctrl_handle, uint8_t data_size, uint8_t data[]);
X_Bool hal_dsi_rx_ctrl_ack_short_cmd(hal_dsi_rx_ctrl_handle_t *rx_ctrl_handle, uint8_t data_size, uint8_t data[]);
N
N/**
N* @brief  使用数组方式回复长包,与hal_dsi_rx_ctrl_send_ack_cmd功能一致
N* @param  rx_ctrl_handle: dsi rx handle
N* @param  data_size: 数组长度,为Word Count + header长度 (header固定为4)
N* @param  data: 回复cmd数据,数据排列有严格规定:
N* data[0]:DI(data type)
N* data[1]:wc 0 (Word Count 低八位)
N* data[2]:wc 1 (Word Count 高八位)
N* data[3]:内部pkt type,长包固定为1
N* data[N]:长包数据
N* @retval true/false
N*/
Nbool hal_dsi_rx_ctrl_ack_long_cmd(hal_dsi_rx_ctrl_handle_t *rx_ctrl_handle, uint32_t data_size, uint8_t data[]);
X_Bool hal_dsi_rx_ctrl_ack_long_cmd(hal_dsi_rx_ctrl_handle_t *rx_ctrl_handle, uint32_t data_size, uint8_t data[]);
N
N/**
N* @brief  异步处理DSC接口,执行cus_dcs_entry_table里对应DCS immediately_func为false的函数
N* @param  rx_ctrl_handle: dsi rx handle
N* @retval true - 正常处理1个DSC , false - 无DSC 处理
N*/
Nbool hal_dsi_rx_ctrl_dcs_async_handler(hal_dsi_rx_ctrl_handle_t *rx_ctrl_handle);
X_Bool hal_dsi_rx_ctrl_dcs_async_handler(hal_dsi_rx_ctrl_handle_t *rx_ctrl_handle);
N
N/**
N* @brief  使用硬件filter丢弃不需要处理的CMD,避免MCU资源被无效CMD占用
N* @param  rx_ctrl_handle: dsi rx handle
N* @param  filter_number: filter 编号(0-7)
N* @param  cmd_start: 需要丢弃command code起始位
N* @param  cmd_end: 需要丢弃command code终止位
N* @retval true/false
N*/
Nbool hal_dsi_rx_ctrl_set_hw_cmd_filter(hal_dsi_rx_ctrl_handle_t *rx_ctrl_handle,
X_Bool hal_dsi_rx_ctrl_set_hw_cmd_filter(hal_dsi_rx_ctrl_handle_t *rx_ctrl_handle,
N                                       hal_rx_dcs_filter_sel_e filter_number,
N                                       uint32_t cmd_start, uint32_t cmd_end);
N
N/**
N* @brief  使用内置pattern代替mipi输入(用于测试)
N* @param  rx_ctrl_handle: dsi rx handle
N* @param  pg_orient: pattern 方向(0:Vertical mode ; 1:Horizontal mode)
N* @param  enable: 开启/关闭pattern
N* @param  frame_rate: pattern 帧率
N* @retval true/false
N*/
Nbool hal_dsi_rx_ctrl_enable_test_pattern(hal_dsi_rx_ctrl_handle_t *rx_ctrl_handle, uint8_t pg_orient, bool enable, int frame_rate);
X_Bool hal_dsi_rx_ctrl_enable_test_pattern(hal_dsi_rx_ctrl_handle_t *rx_ctrl_handle, uint8_t pg_orient, _Bool enable, int frame_rate);
N
N
N/**
N* @brief  获取AP 配置 BTA回复数据最大size
N* @param  rx_ctrl_handle: dsi rx handle
N* @retval 返回数据大小
N*/
Nuint32_t hal_dsi_rx_ctrl_get_max_ret_size(hal_dsi_rx_ctrl_handle_t *rx_ctrl_handle);
N
N/**
N* @brief  获取AP Compression Mode Command配置,默认为0,谨慎使用
N* @param  rx_ctrl_handle: dsi rx handle
N* @retval AP 配置compressen_en
N*/
Nbool hal_dsi_rx_ctrl_get_compressen_en(hal_dsi_rx_ctrl_handle_t *rx_ctrl_handle);
X_Bool hal_dsi_rx_ctrl_get_compressen_en(hal_dsi_rx_ctrl_handle_t *rx_ctrl_handle);
N
N/**
N* @brief  输入分辨率切换接口
N* @param  rx_ctrl_handle: dsi rx handle
N* @retval true/false
N*/
Nbool hal_dsi_rx_ctrl_toggle_resolution(hal_dsi_rx_ctrl_handle_t *rx_ctrl_handle);
X_Bool hal_dsi_rx_ctrl_toggle_resolution(hal_dsi_rx_ctrl_handle_t *rx_ctrl_handle);
N
N/**
N* @brief  配置 RX escape clk
N* @param  rx_ctrl_handle: dsi rx handle
N* @param  esc_clk: escape clk 单位Hz,10000000时回CMD为10Mhz
N* @retval true/false
N*/
Nbool hal_dsi_rx_ctrl_set_cus_esc_clk(hal_dsi_rx_ctrl_handle_t *rx_ctrl_handle, uint32_t esc_clk);
X_Bool hal_dsi_rx_ctrl_set_cus_esc_clk(hal_dsi_rx_ctrl_handle_t *rx_ctrl_handle, uint32_t esc_clk);
N
N/**
N* @brief  自动计算并配置硬件filter
N* @param  rx_ctrl_handle: dsi rx handle
N* @param  enable: 启动/关闭 硬件filter
N* @retval true/false
N*/
Nbool hal_dsi_rx_ctrl_set_auto_hw_filter(hal_dsi_rx_ctrl_handle_t *rx_ctrl_handle, bool enable);
X_Bool hal_dsi_rx_ctrl_set_auto_hw_filter(hal_dsi_rx_ctrl_handle_t *rx_ctrl_handle, _Bool enable);
N
N/*
N* @brief  输入帧率修改(针对video mode)
N* @param  rx_ctrl_handle: dsi rx handle
N* @param  frame_rate：frame rate
N*/
Nbool hal_dsi_rx_ctrl_toggle_input_frame_rate(hal_dsi_rx_ctrl_handle_t *rx_ctrl_handle, dsi_video_frame_rate_e frame_rate);
X_Bool hal_dsi_rx_ctrl_toggle_input_frame_rate(hal_dsi_rx_ctrl_handle_t *rx_ctrl_handle, dsi_video_frame_rate_e frame_rate);
N
N/*
N* @brief  注册写命令的回调函数,用于特殊命令序列时写命令的处理.
N          可配合hal_dsi_rx_ctrl_set_auto_hw_filter关闭hw filter用于获取所有软件CMD
N* @param  rx_ctrl_handle: dsi rx handle
N* @param  写命令处理函数
N* @retval none
N*/
Nvoid hal_dsi_rx_ctrl_register_write_cmd_entry(hal_dsi_rx_ctrl_handle_t *rx_ctrl_handle, hal_dsi_rx_ctrl_dcs_execute execute_func);
N
N/**
N* @brief  配置硬件自动回复命令
N*         最大回复长度64,AP需要配置set_max_return_size后并且对比一直才会自动回复,不需要软件再参与
N*         应用于所有回复固定数据的场景
N* @param  RXBR: registers struct
N* @param  qresp_number: qresp 编号(0-7)
N* @param  data_type: 需要回复的读命令的datatype
N* @param  cmd_code: 需要回复的读命令
N* @param  cmd_count: 需要回复的命令的大小,长包最大size为64,与set_max_return_size一致才会回复
N* @param  ...: 需要回复的参数
N* @retval true/false
N*/
Nbool hal_dsi_rx_ctrl_set_auto_ack(hal_dsi_rx_ctrl_handle_t *rx_ctrl_handle, hal_rx_dcs_qresp_e qresp_number,  dsi_ack_data_type_e data_type, uint32_t cmd_code, uint8_t cmd_count, ...);
X_Bool hal_dsi_rx_ctrl_set_auto_ack(hal_dsi_rx_ctrl_handle_t *rx_ctrl_handle, hal_rx_dcs_qresp_e qresp_number,  dsi_ack_data_type_e data_type, uint32_t cmd_code, uint8_t cmd_count, ...);
N
N/*
N* @brief  初始化画点模式
N* @param  rx_ctrl_handle: dsi rx handle
N* @param  draw_en: 画点模式使能
N* @param  pxl_init_en: 是否对全屏数据赋值,true:使用init_value赋值,false:使用上一帧数据作为初始值
N* @param  color_mode: 画点模式数据源格式见dsi_color_code_e
N* @param  init_value: 全屏初始化数据,bit[23:16]--R，bit[15:8]--G，bit[7:0]--B
N* @retval none
N*/
Nvoid hal_dsi_rx_ctrl_draw_mode_init(hal_dsi_rx_ctrl_handle_t *rx_ctrl_handle, bool draw_en, bool pxl_init_en, dsi_color_code_e color_mode, uint32_t init_value);
Xvoid hal_dsi_rx_ctrl_draw_mode_init(hal_dsi_rx_ctrl_handle_t *rx_ctrl_handle, _Bool draw_en, _Bool pxl_init_en, dsi_color_code_e color_mode, uint32_t init_value);
N
N/*
N* @brief  配置像素颜色
N* @param  rx_ctrl_handle: dsi rx handle
N* @param  x: 像素点的x 坐标
N* @param  y: 像素点的y 坐标
N* @param  red_data: 像素点R分量
N* @param  green_data: 像素点G分量
N* @param  blue_data: 像素点B分量
N* @retval none
N*/
Nvoid hal_dsi_rx_ctrl_set_pixel_data(hal_dsi_rx_ctrl_handle_t *rx_ctrl_handle, int x, int y, uint8_t red_data, uint8_t green_data, uint8_t blue_data);
N
N
N/**
N* @brief  video mode下强制将数据设置为特定的color mode,具体type见dsi_color_code_e
N* @param  rx_ctrl_handle: dsi rx handle
N* @param  enable: 使能强制数据模式
N* @param  frc_vid_code: 强制的数据格式
N* @retval none
N*/
Nvoid hal_dsi_rx_ctrl_force_video_crtl(hal_dsi_rx_ctrl_handle_t *rx_ctrl_handle, bool enable, dsi_color_code_e frc_vid_code);
Xvoid hal_dsi_rx_ctrl_force_video_crtl(hal_dsi_rx_ctrl_handle_t *rx_ctrl_handle, _Bool enable, dsi_color_code_e frc_vid_code);
N
N/**
N* @brief  注册RX 事件回调函数
N* @param  rx_ctrl_handle: dsi rx handle
N* @param  event_cb: 回调函数
N* @param  event_mask: 接收事件掩码,见hal_rx_event_e(eg:HAL_RX_FS_EVENT|HAL_RX_LINE_EVENT)
N* @param  enable: 事件回调开关
N* @param  user_data: 预留扩展参数,不同事件事件配置不同参数
N* @retval none
N*/
Nvoid hal_dsi_rx_ctrl_register_callback(hal_dsi_rx_ctrl_handle_t *rx_ctrl_handle, hal_dsi_rx_ctrl_event_entry event_cb, uint32_t event_mask, bool enable, void *user_data);
Xvoid hal_dsi_rx_ctrl_register_callback(hal_dsi_rx_ctrl_handle_t *rx_ctrl_handle, hal_dsi_rx_ctrl_event_entry event_cb, uint32_t event_mask, _Bool enable, void *user_data);
N
N/**
N* @brief  配置是否打开长包CRC检查
N* @param  rx_ctrl_handle: dsi rx handle
N* @param  enable: 开启或者屏蔽CRC检测
N* @retval none
N*/
Nvoid hal_dsi_rx_ctrl_set_check_crc(hal_dsi_rx_ctrl_handle_t *rx_ctrl_handle, bool enable);
Xvoid hal_dsi_rx_ctrl_set_check_crc(hal_dsi_rx_ctrl_handle_t *rx_ctrl_handle, _Bool enable);
N
N/**
N* @brief  配置rx log 等级
N* @param  rx_drv_level: rx log等级见枚举log_level_e
N* @retval none
N*/
Nvoid hal_dsi_rx_ctrl_set_log_level(log_level_e rx_drv_level);
N
N/**
N * @brief   带颜色画线函数(直线、斜线)
N * @param   x1,y1   起点坐标
N * @param   x2,y2   终点坐标
N * @param  red_data: 像素点R分量
N * @param  green_data: 像素点G分量
N * @param  blue_data: 像素点B分量
N * @param  line_weight: 线粗
N * @return  none
N */
Nvoid hal_dsi_rx_ctrl_draw_line(hal_dsi_rx_ctrl_handle_t *rx_ctrl_handle, uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2,  uint8_t red_data, uint8_t green_data, uint8_t blue_data, line_weight_e line_weight);
N
N/**
N * @brief   设置需要获取pixel的坐标
N * @param  cap_x: 抓取pixel的x坐标
N * @param  cap_y: 抓取pixel的y坐标
N * @return  none
N */
Nvoid hal_dsi_rx_ctrl_set_cap_pixel_pos(hal_dsi_rx_ctrl_handle_t *rx_ctrl_handle, uint16_t x0, uint16_t y0);
N
N/**
N * @brief   获取指定坐标颜色,必须先设置获取颜色的坐标
N * @return  返回指定坐标颜色
N */
Nuint32_t hal_dsi_rx_ctrl_get_cap_pixel_color(hal_dsi_rx_ctrl_handle_t *rx_ctrl_handle);
N
N#endif //__HAL_DSI_RX_CTRL_H__
L 17 "..\..\src\app\P6A\p6a_demo.c" 2
N#include "hal_dsi_tx_ctrl.h"
L 1 "..\..\src\sdk\include\hal_dsi_tx_ctrl.h" 1
N/*******************************************************************************
N*
N*
N* File:         hal_dsi_tx_ctrl.h
N* Description:  hal mipi dsi tx 头文件
N* Version:      V0.1
N* Date:         2021-04-23
N* Author:       jaya
N *******************************************************************************/
N#ifndef __HAL_DSI_TX_CTRL_H__
N#define __HAL_DSI_TX_CTRL_H__
N
N/*******************************************************************************
N* 1.Included files
N*******************************************************************************/
N#include "tau_dsi_datatype.h"
N#include "tau_device_datatype.h"
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：         2023-07-27
N* Author：       kevin
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    /*以GPIO命名PIN*/
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_GPIO7,
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_GPIO15,
N    IO_PAD_GPIO16,
N    IO_PAD_GPIO17,
N    IO_PAD_GPIO18,
N    IO_PAD_GPIO19,
N    IO_PAD_GPIO20,
N    IO_PAD_GPIO21,
N    IO_PAD_GPIO22,
N    IO_PAD_GPIO23,
N    IO_PAD_GPIO24,
N    IO_PAD_GPIO25,
N
N    /*以实际PAD NAME命名PIN*/
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_GPIO7,
N    IO_PAD_AP_PWMEN     = IO_PAD_GPIO8,
N    IO_PAD_AP_SPIS_CLK  = IO_PAD_GPIO9,
N    IO_PAD_AP_SPIS_CSN  = 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_IO0    = IO_PAD_GPIO13,
N    IO_PAD_TD_FC_IO1    = IO_PAD_GPIO14,
N    IO_PAD_SWD_CLK      = IO_PAD_GPIO15,
N    IO_PAD_SWD_DIO      = IO_PAD_GPIO16,
N    IO_PAD_AP_RSTN      = IO_PAD_GPIO17,
N    IO_PAD_UART0_TX     = IO_PAD_GPIO18,
N    IO_PAD_TD_SPIM_CLK  = IO_PAD_GPIO19,
N    IO_PAD_TD_SPIM_CSN  = IO_PAD_GPIO20,
N    IO_PAD_AP_TPRSTN    = IO_PAD_GPIO21,
N    IO_PAD_TD_INT       = IO_PAD_GPIO22,
N    IO_PAD_TD_TP_RESX   = IO_PAD_GPIO23,
N    IO_PAD_UART1_TX     = IO_PAD_GPIO24,
N    IO_PAD_UART0_RX     = IO_PAD_GPIO25,
N
N    IO_PAD_MAX,
N
N
N    /*以实际引脚序号命名PIN*/
N    IO_PIN_1            = IO_PAD_SWD_CLK,
N    IO_PIN_2            = IO_PAD_UART0_TX,
N    IO_PIN_3            = IO_PAD_SWD_DIO,
N    IO_PIN_4            = IO_PAD_TD_SPIM_MOSI,
N    IO_PIN_5            = IO_PAD_TD_SPIM_CLK,
N    IO_PIN_6            = IO_PAD_TD_SPIM_CSN,
N    IO_PIN_7            = IO_PAD_TD_SPIM_MISO,
N    IO_PIN_8            = IO_PAD_TD_RSTN,
N    IO_PIN_9            = IO_PAD_TD_FC_CSN,
N    IO_PIN_10           = IO_PAD_TD_FC_CLK,
N    IO_PIN_11           = IO_PAD_TD_FC_IO0,
N    IO_PIN_12           = IO_PAD_TD_FC_IO1,
N    IO_PIN_13           = IO_PAD_TD_TP_RESX,
N    IO_PIN_14           = IO_PAD_UART1_TX,
N    IO_PIN_15           = IO_PAD_AP_SWIRE,
N    IO_PIN_16           = IO_PAD_AP_INT,
N    IO_PIN_17           = IO_PAD_AP_PWMEN,
N    IO_PIN_18           = IO_PAD_AP_TPRSTN,
N
N    IO_PIN_29           = IO_PAD_AP_TE,
N    IO_PIN_30           = IO_PAD_AP_SPIS_MISO,
N    IO_PIN_31           = IO_PAD_AP_SPIS_CSN,
N    IO_PIN_32           = IO_PAD_AP_SPIS_CLK,
N    IO_PIN_33           = IO_PAD_AP_SPIS_MOSI,
N    IO_PIN_34           = IO_PAD_AP_RSTN,
N    IO_PIN_35           = IO_PAD_TD_INT,
N    IO_PIN_36           = IO_PAD_UART0_RX,
N
N} io_pad_e;
N
N
N/*
N芯片引脚        |    默认mode               |   可选mode
N----------------------------------------------------------------
NIO_PIN_1    |    IO_PAD_SWCLK,        |   PIN1_MODE_SWDCLK
N            |                         |   PIN1_MODE_GPIO15
N----------------------------------------------------------------
NIO_PIN_2    |    IO_PAD_UART0_TX,     |   PIN2_MODE_UART0_TX
N            |                         |   PIN2_MODE_PWMO
N            |                         |   PIN2_MODE_GPIO18
N            |                         |   PIN2_MODE_PWMI
N            |                         |   PIN2_MODE_TEAR1
N----------------------------------------------------------------
NIO_PIN_3    |    IO_PAD_SWDIO,        |   PIN3_MODE_SWDIO
N            |                         |   PIN3_MODE_GPIO16
N----------------------------------------------------------------
NIO_PIN_4    |    IO_PAD_TD_SPIM_MOSI, |   PIN4_MODE_SPIM_MOSI
N            |                         |   PIN4_MODE_I2C02_SDA
N            |                         |   PIN4_MODE_GPIO6
N            |                         |   PIN4_MODE_UART0_TX
N----------------------------------------------------------------
NIO_PIN_5    |    IO_PAD_TD_SPIM_CLK,  |   PIN5_MODE_SPIM_SCLK
N            |                         |   PIN5_MODE_I2C1_SCL
N            |                         |   PIN5_MODE_GPIO19
N----------------------------------------------------------------
NIO_PIN_6    |    IO_PAD_TD_SPIM_CSN,  |   PIN6_MODE_SPIM_CSN
N            |                         |   PIN6_MODE_I2C1_SDA
N            |                         |   PIN6_MODE_GPIO20
N----------------------------------------------------------------
NIO_PIN_7    |    IO_PAD_TD_SPIM_MISO, |   PIN7_MODE_SPIM_MISO
N            |                         |   PIN7_MODE_I2C02_SCL
N            |                         |   PIN7_MODE_GPIO5
N----------------------------------------------------------------
NIO_PIN_8    |    IO_PAD_TD_RSTN,      |   PIN8_MODE_GPIO7
N            |                         |   PIN8_MODE_I2C02_SDA
N----------------------------------------------------------------
NIO_PIN_9    |    IO_PAD_TD_FC_CSN,    |   PIN9_MODE_TSPIS_CSN
N            |                         |   PIN9_MODE_GPIO12
N----------------------------------------------------------------
NIO_PIN_10   |    IO_PAD_TD_FC_CLK,    |   PIN10_MODE_TSPIS_CLK
N            |                         |   PIN10_MODE_GPIO11
N----------------------------------------------------------------
NIO_PIN_11   |    IO_PAD_TD_FC_IO0,    |   PIN11_MODE_TSPIS_IO0
N            |                         |   PIN11_MODE_GPIO13
N            |                         |   PIN11_MODE_I2C02_SDA
N----------------------------------------------------------------
NIO_PIN_12   |    IO_PAD_TD_FC_IO1,    |   PIN12_MODE_TSPIS_IO1
N            |                         |   PIN12_MODE_GPIO14
N            |                         |   PIN12_MODE_I2C02_SCL
N----------------------------------------------------------------
NIO_PIN_13   |    IO_PAD_TD_TP_RESX,   |   PIN13_MODE_GPIO23
N            |                         |   PIN13_MODE_PWMO
N            |                         |   PIN13_MODE_UART1_RX
N            |                         |   PIN13_MODE_UART1_RX
N----------------------------------------------------------------
NIO_PIN_14   |    IO_PAD_UART1_TX,     |   PIN14_MODE_GPIO24
N            |                         |   PIN14_MODE_UART0_RX
N            |                         |   PIN14_MODE_UART1_TX
N            |                         |
N----------------------------------------------------------------
NIO_PIN_15   |    IO_PAD_AP_SWIRE,     |   PIN15_MODE_SWIRE
N            |                         |   PIN15_MODE_PWMO
N            |                         |   PIN15_MODE_GPIO4
N----------------------------------------------------------------
NIO_PIN_16   |    IO_PAD_AP_INT,       |   PIN16_MODE_GPIO2
N----------------------------------------------------------------
NIO_PIN_17   |    IO_PAD_AP_PWMEN,     |   PIN17_MODE_UART0_RX
N            |                         |   PIN17_MODE_GPIO8
N            |                         |   PIN17_MODE_PWMO
N----------------------------------------------------------------
NIO_PIN_18   |    IO_PAD_AP_TPRSTN,    |   PIN18_MODE_UART0_RX
N            |                         |   PIN18_MODE_GPIO21
N            |                         |   PIN18_MODE_I2C02_SCL
N----------------------------------------------------------------
NIO_PIN_29   |    IO_PAD_AP_TE,        |   PIN29_MODE_JTAG_TRSTN
N            |                         |   PIN29_MODE_TEAR
N            |                         |   PIN29_MODE_GPIO3
N----------------------------------------------------------------
NIO_PIN_30   |    IO_PAD_AP_SPIS_MISO, |  PIN30_MODE_JTAG_TDO
N            |                         |  PIN30_MODE_SPIS_MISO
N            |                         |  PIN30_MODE_GPIO0
N            |                         |  PIN30_MODE_UART0_RX
N            |                         |  PIN30_MODE_I2C1_SCL
N----------------------------------------------------------------
NIO_PIN_31   |    IO_PAD_AP_SPIS_CSN,  |  PIN31_MODE_JTAG_TMS
N            |                         |  PIN31_MODE_SPIS_CSN
N            |                         |  PIN31_MODE_GPIO10
N            |                         |  PIN31_MODE_I2C02_SDA
N----------------------------------------------------------------
NIO_PIN_32   |    IO_PAD_AP_SPIS_CLK,  |  PIN32_MODE_JTAG_TCK
N            |                         |  PIN32_MODE_SPIS_SCLK
N            |                         |  PIN32_MODE_GPIO9
N            |                         |  PIN32_MODE_I2C02_SCL
N----------------------------------------------------------------
NIO_PIN_33   |    IO_PAD_AP_SPIS_MOSI, |  PIN33_MODE_JTAG_TDI
N            |                         |  PIN33_MODE_SPIS_MOSI
N            |                         |  PIN33_MODE_GPIO1
N            |                         |  PIN33_MODE_UART0_TX
N            |                         |  PIN33_MODE_I2C1_SDA_0
N----------------------------------------------------------------
NIO_PIN_34   |    IO_PAD_AP_RSTN,      |  PIN34_MODE_GPIO17
N----------------------------------------------------------------
NIO_PIN_35   |    IO_PAD_TD_INT,       |  PIN35_MODE_GPIO22
N----------------------------------------------------------------
NIO_PIN_36   |    IO_PAD_UART0_RX,     |  PIN36_MODE_UART0_RX
N            |                         |  PIN36_MODE_PWMO
N            |                         |  PIN36_MODE_GPIO25
N----------------------------------------------------------------
N*/
N
N
N/**
N* @brief  PIN1 IO_PAD_SWD_CLK 可选的mode
N*/
Ntypedef enum
N{
N    PIN1_MODE_SWDCLK        = 0,
N    PIN1_MODE_GPIO15        = 2,
N} pin1_mode_e;
N
N
N/**
N* @brief  PIN2 PAD_UART0_TX可选的mode
N*/
Ntypedef enum
N{
N    PIN2_MODE_UART0_TX     = 0,
N    PIN2_MODE_PWMO         = 1,
N    PIN2_MODE_GPIO18       = 2,
N    PIN2_MODE_PWMI         = 3,
N    PIN2_MODE_TEAR1        = 4,
N} pin2_mode_e;
N
N/**
N* @brief  PIN3 IO_PAD_SWD_DIO 可选的mode
N*/
Ntypedef enum
N{
N    PIN3_MODE_SWDIO        = 0,
N    PIN3_MODE_GPIO16       = 2,
N} pin3_mode_e;
N
N
N/**
N* @brief  PIN4 PAD_TD_SPIM_MOSI可选的mode
N*/
Ntypedef enum
N{
N    PIN4_MODE_SPIM_MOSI    = 0,
N    PIN4_MODE_I2C02_SDA    = 1,
N    PIN4_MODE_GPIO6        = 2,
N    PIN4_MODE_UART0_TX     = 3,
N} pin4_mode_e;
N
N/**
N* @brief  PIN5 PAD_TD_SPIM_CLK可选的mode
N*/
Ntypedef enum
N{
N    PIN5_MODE_SPIM_SCLK    = 0,
N    PIN5_MODE_I2C1_SCL     = 1,
N    PIN5_MODE_GPIO19       = 2,
N} pin5_mode_e;
N
N/**
N* @brief  PIN6 PAD_TD_SPIM_CSN可选的mode
N*/
Ntypedef enum
N{
N    PIN6_MODE_SPIM_CSN     = 0,
N    PIN6_MODE_I2C1_SDA     = 1,
N    PIN6_MODE_GPIO20       = 2,
N} pin6_mode_e;
N
N/**
N* @brief  PIN7 PAD_TD_SPIM_MISO可选的mode
N*/
Ntypedef enum
N{
N    PIN7_MODE_SPIM_MISO    = 0,
N    PIN7_MODE_I2C02_SCL    = 1,
N    PIN7_MODE_GPIO5        = 2,
N} pin7_mode_e;
N
N/**
N* @brief  PIN8 PAD_TD_RSTN可选的mode
N*/
Ntypedef enum
N{
N    PIN8_MODE_GPIO7        = 2,
N    PIN8_MODE_I2C02_SDA    = 3,
N} pin8_mode_e;
N
N/**
N* @brief  PIN9 PAD_TD_FC_CSN可选的mode
N*/
Ntypedef enum
N{
N    PIN9_MODE_TSPIS_CSN    = 0,
N    PIN9_MODE_GPIO12       = 2,
N} pin9_mode_e;
N
N/**
N* @brief  PIN10 PAD_TD_FC_CLK可选的mode
N*/
Ntypedef enum
N{
N    PIN10_MODE_TSPIS_CLK    = 0,
N    PIN10_MODE_GPIO11       = 2,
N} pin10_mode_e;
N
N
N/**
N* @brief  PIN11 PAD_TD_FC_IO0可选的mode
N*/
Ntypedef enum
N{
N    PIN11_MODE_TSPIS_IO0    = 0,
N    PIN11_MODE_GPIO13       = 2,
N    PIN11_MODE_I2C02_SDA    = 3,
N} pin11_mode_e;
N
N/**
N* @brief  PIN12 PAD_TD_FC_IO1可选的mode
N*/
Ntypedef enum
N{
N    PIN12_MODE_TSPIS_IO1    = 0,
N    PIN12_MODE_GPIO14       = 2,
N    PIN12_MODE_I2C02_SCL    = 3,
N} pin12_mode_e;
N
N/**
N* @brief  PIN13 PAD_TD_TP_RESX可选的mode
N*/
Ntypedef enum
N{
N    PIN13_MODE_GPIO23       = 2,
N    PIN13_MODE_PWMO         = 3,
N    PIN13_MODE_UART1_RX     = 4,
N} pin13_mode_e;
N
N/**
N* @brief  PIN14 PAD_UART1_TX可选的mode
N*/
Ntypedef enum
N{
N    PIN14_MODE_GPIO24       = 2,
N    PIN14_MODE_UART0_RX     = 3,
N    PIN14_MODE_UART1_TX     = 4,
N} pin14_mode_e;
N
N
N
N/**
N* @brief  PIN15 PAD_AP_SWIRE可选的mode
N*/
Ntypedef enum
N{
N    PIN15_MODE_SWIRE        = 0,
N    PIN15_MODE_PWMO         = 1,
N    PIN15_MODE_GPIO4        = 2,
N} pin15_mode_e;
N
N/**
N* @brief  PIN16 IO_PAD_AP_INT 可选的mode
N*/
Ntypedef enum
N{
N    PIN16_MODE_GPIO2        = 2,
N} pin16_mode_e;
N
N/**
N* @brief  PIN17 PAD_AP_PWMEN可选的mode
N*/
Ntypedef enum
N{
N    PIN17_MODE_UART0_RX    = 1,
N    PIN17_MODE_GPIO8       = 2,
N    PIN17_MODE_PWMO        = 3,
N} pin17_mode_e;
N
N/**
N* @brief  PIN18 IO_PAD_AP_TPRSTN 可选的mode
N*/
Ntypedef enum
N{
N    PIN18_MODE_UART0_RX    = 0,
N    PIN18_MODE_GPIO21      = 2,
N    PIN18_MODE_I2C02_SCL   = 3,
N} pin18_mode_e;
N
N
N//----------
N
N/**
N* @brief  PIN29 IO_PAD_AP_TE 可选的mode
N*/
Ntypedef enum
N{
N    PIN29_MODE_JTAG_TRSTN   = 0,
N    PIN29_MODE_TEAR         = 1,
N    PIN29_MODE_GPIO3        = 2,
N} pin29_mode_e;
N
N
N/**
N* @brief  PIN30 IO_PAD_AP_SPIS_MISO 可选的mode
N*/
Ntypedef enum
N{
N    PIN30_MODE_JTAG_TDO     = 0,
N    PIN30_MODE_SPIS_MISO    = 1,
N    PIN30_MODE_GPIO0        = 2,
N    PIN30_MODE_UART0_RX     = 3,
N    PIN30_MODE_I2C1_SCL     = 6,
N} pin30_mode_e;
N
N/**
N* @brief  PIN31 IO_PAD_AP_SPIS_CSN 可选的mode
N*/
Ntypedef enum
N{
N    PIN31_MODE_JTAG_TMS    = 0,
N    PIN31_MODE_SPIS_CSN    = 1,
N    PIN31_MODE_GPIO10      = 2,
N    PIN31_MODE_I2C02_SDA   = 3,
N} pin31_mode_e;
N
N/**
N* @brief  PIN32 IO_PAD_AP_SPIS_CLK 可选的mode
N*/
Ntypedef enum
N{
N    PIN32_MODE_JTAG_TCK    = 0,
N    PIN32_MODE_SPIS_SCLK   = 1,
N    PIN32_MODE_GPIO9       = 2,
N    PIN32_MODE_I2C02_SCL   = 3,
N} pin32_mode_e;
N
N/**
N* @brief  PIN33 IO_PAD_AP_SPIS_MOSI 可选的mode
N*/
Ntypedef enum
N{
N    PIN33_MODE_JTAG_TDI     = 0,
N    PIN33_MODE_SPIS_MOSI    = 1,
N    PIN33_MODE_GPIO1        = 2,
N    PIN33_MODE_UART0_TX     = 3,
N    PIN33_MODE_I2C1_SDA_0   = 6,
N} pin33_mode_e;
N
N/**
N* @brief  PIN34 PAD_AP_RST可选的mode
N*/
Ntypedef enum
N{
N    PIN34_MODE_GPIO17       = 2,
N} pin34_mode_e;
N
N
N/**
N* @brief  PIN35 PAD_TD_INT可选的mode
N*/
Ntypedef enum
N{
N    PIN35_MODE_GPIO22       = 2,
N} pin35_mode_e;
N
N
N/**
N* @brief  PIN36 PAD_UART_RX可选的mode
N*/
Ntypedef enum
N{
N    PIN36_MODE_UART0_RX    = 0,
N    PIN36_MODE_PWMO        = 1,
N    PIN36_MODE_GPIO25       = 2,
N} pin36_mode_e;
N
N
N
N//-------------------------------------------------------------------------
N/**
N* @brief  PAD_SFC_CLK可选的mode    内部PAD
N*/
Ntypedef enum
N{
N    IO_MODE_INTER_FC_CLK = 0,
N    IO_MODE_TSPIS_CLK_EN = 2,
N} pad_sfc_clk_mode_e;
N
N/**
N* @brief  PAD_SFC_CSN可选的mode     内部PAD
N*/
Ntypedef enum
N{
N    IO_MODE_INTER_FC_CSN = 0,
N    IO_MODE_TSPIS_CSN_EN = 2,
N} pad_sfc_csn_mode_e;
N
N/**
N* @brief  PAD_SFC_IO0可选的mode     内部PAD
N*/
Ntypedef enum
N{
N    IO_MODE_INTER_FC_IO0 = 0,
N    IO_MODE_TSPIS_IO0_EN = 2,
N} pad_sfc_io0_mode_e;
N
N/**
N* @brief  PAD_SFC_IO1可选的mode     内部PAD
N*/
Ntypedef enum
N{
N    IO_MODE_INTER_FC_IO1 = 0,
N    IO_MODE_TSPIS_IO1_EN = 2,
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    IO_IOE_NONE
N} gpio_ioe_e;
N
N/**
N* @brief  GPIO level
N*/
Ntypedef enum
N{
N    IO_LVL_LOW = 0,
N    IO_LVL_HIGH,
N    IO_LVL_NONE
N} gpio_level_e;
N
N/*******************************************************************************
N* 3.Global structures, unions and enumerations using typedef
N*******************************************************************************/
N/**
N* @brief  PAD与MODE的MAP结构体
N*/
Ntypedef struct
N{
N    io_pad_e          pad;
N    uint8_t           mode;
N    gpio_ioe_e        ioe;
N    gpio_level_e      lvl;
N} io_pad_attr_t;
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  pad：GPIO序号，参考枚举类型gpio_pad_e
N* @param  trig：4种中断触发方式，参考枚举类型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  pad：GPIO序号，参考枚举类型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  pad：GPIO序号，参考枚举类型gpio_pad_e
N* @param  state：开关控制
N* @retval 无
N*/
Nvoid hal_gpio_ctrl_eint(io_pad_e pad, bool state);
Xvoid hal_gpio_ctrl_eint(io_pad_e pad, _Bool state);
N
N/**
N* @brief  获取GPIO中断类型
N* @param  pad：GPIO序号，参考枚举类型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  pad：GPIO序号，参考枚举类型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  pad：GPIO序号，参考枚举类型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  配置指定PAD为GPIO mode，方向为input
N* @param  pad：GPIO序号，参考枚举类型gpio_pad_e
N* @retval 无
N*/
Nvoid hal_gpio_init_input(io_pad_e pad);
N
N/**
N* @brief  读取输入电平
N* @param  pad：GPIO序号，参考枚举类型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  pad：GPIO序号，参考枚举类型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  设置io 为高阻态
N* @param  pad：GPIO序号，参考枚举类型gpio_pad_e
N* @retval 无
N*/
Nvoid hal_gpio_set_high_impedance(io_pad_e pad);
N
N/**
N* @brief  获取指定PAD的默认上拉、下拉状态
N* @param  pad：GPIO序号，参考枚举类型gpio_pad_e
N* @param  up_enable：默认上拉状态
N* @param  down_enable：默认下拉状态
N* @retval 无
N*/
Nvoid hal_gpio_get_pull_state(io_pad_e pad, bool *up_enable, bool *down_enable);
Xvoid hal_gpio_get_pull_state(io_pad_e pad, _Bool *up_enable, _Bool *down_enable);
N
N/**
N* @brief  配置指定PAD的默认上拉、下拉状态
N* @param  pad：GPIO序号，参考枚举类型gpio_pad_e
N* @param  up_enable：默认上拉状态
N* @param  down_enable：默认下拉状态
N* @retval 无
N*/
Nvoid hal_gpio_set_pull_state(io_pad_e pad, bool up_enable, bool down_enable);
Xvoid hal_gpio_set_pull_state(io_pad_e pad, _Bool up_enable, _Bool down_enable);
N
N/**
N* @brief  配置指定PAD是否为施密特触发
N* @param  pad：GPIO序号，参考枚举类型gpio_pad_e
N* @param  st_enable：1为施密特触发，0为正常触发
N* @retval 无
N*/
Nvoid hal_gpio_set_schmitt_trigger(io_pad_e pad, bool st_enable);
Xvoid hal_gpio_set_schmitt_trigger(io_pad_e pad, _Bool st_enable);
N
N/**
N* @brief  配置指定PAD的驱动能力
N* @param  pad：GPIO序号，参考枚举类型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  pad：GPIO序号，参考枚举类型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/**
N* @brief  批量设置IO参数
N* @param  attrs: PAD属性
N* @param  size: 数组成员个数
N* @retval 无
N*/
Nvoid hal_gpio_config_pad(io_pad_attr_t *attrs, uint8_t size);
N
N#endif /* __HAL_GPIO_H__ */
L 19 "..\..\src\sdk\include\hal_dsi_tx_ctrl.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/**
N* @brief  blank display configure type
N*/
Ntypedef struct
N{
N    uint16_t     st_col;           /* 补黑区域起始坐标，RGBG格式以子像素计数*/
N    uint16_t     width;            /* 补黑区域宽度，RGBG格式以子像素计数*/
N    uint8_t      remap_en;         /* 补黑区域是否参与子像素重排*/
N    uint8_t      blank_en;         /* 补黑区域开关*/
N} blank_disp_t;
N
N/**
N* @brief  pentile remap rule configuration type in rom code
N*/
Ntypedef uint8_t (remap_rule_t)[24];
N
N/**
N* @brief  客制化MIPI TX参数结构体
N*/
Ntypedef struct
N{
N    bool             pentile_enable;                    /* 是否pentile输出*/
X    _Bool             pentile_enable;                     
N    bool             pentile_reverse_en;                /* 是否打开芯片本身行翻转功能*/
X    _Bool             pentile_reverse_en;                 
N    bool             pentile_24b;                       /* 是否以RGB IC搭配RGBG玻璃*/
X    _Bool             pentile_24b;                        
N    uint32_t         rgb_hact;                          /* RGB IC搭配RGBG玻璃使用时IC水平方向分辨率*/
N    remap_rule_t     *remapl_rule;                      /* RGB IC搭配RGBG玻璃使用时remap规则1*/
N    remap_rule_t     *remapr_rule;                      /* RGB IC搭配RGBG玻璃使用时remap规则2*/
N    blank_disp_t     blank_info0;                       /* 补黑参数配置信息*/
N    blank_disp_t     blank_info1;                       /* 补黑参数配置信息*/
N} dsi_tx_pent_info_t;
N
N/**
N* @brief  MIPI TX clk/data lane是否自动进LP控制枚举类型
N*         不同driver IC spec不同,对Lane rate范围要求也不同
N*         无法点亮时可尝试替换不同的模式
N*/
Ntypedef enum
N{
N    ALWAYS_HS = 0,                     // vid输出默认此模式，仅VSA自动进LP; cmd输出暂不支持此模式
N    ONLY_DATA_LANE_AUTO_LP = 1,        // cmd输出默认此模式，data lane行间自动进LP， clk保持HS
N    CLK_DATA_LANE_AUTO_LP = 2,         // data/clk lane行间自动进LP
N} dsi_tx_lane_lp_e;
N
N/**
N* @brief tx pq filter index
N* 默认使用OPT
N*/
Ntypedef enum
N{
N    TX_FLT_OPT    = 0,
N    TX_FLT_LINEAR = 1,
N    TX_FLT_MAX
N} hal_dsi_tx_pq_filter_e;
N
N/**
N* @brief  客制化MIPI TX参数结构体
N*/
Ntypedef struct
N{
N    dsi_base_trans_info_t     base_info;                 /* mipi video 转换基本信息 */
N    uint32_t                  dpi_vsa;                   /* DPI VSA*/
N    uint32_t                  dpi_vbp;                   /* DPI VBP*/
N    uint32_t                  dpi_vfp;                   /* DPI VFP*/
N    uint32_t                  dpi_hsa;                   /* DPI HSA*/
N    uint32_t                  dpi_hbp;                   /* DPI HBP*/
N    uint32_t                  dpi_hfp;                   /* DPI HFP*/
N    float                     tx_frame_rate;             /* 默认60Hz输出,不建议配置为其他,仅作为debug使用 */
N    uint8_t                   lane_num;                  /* TX 使用的 lane 数量*/
N    bool                      used;                      /* handle使用标志位 内部自动更新状态，不需要操作*/
X    _Bool                      used;                       
N    bool                      lp_exit_lpdt;              /* 每一条LP CMD都退出LPDT */
X    _Bool                      lp_exit_lpdt;               
N    dsi_tx_lane_lp_e          tx_lane_lp;                /* clk/data lane是否自动进LP模式配置 */
N    dsi_virtual_channel_e     channel_id;                /* 虚拟通道ID，默认为0*/
N    dsi_video_mode_type_e     vid_mode;                  /* video输出时选择输出的vid模式种类 */
N    dsi_tx_cmd_tx_type_e      cmd_tx_type;               /* 初始化模式传输命令方式，0:HS; 1:LP */
N    dsi_tx_pent_info_t        pentile_info;              /* pentile屏基本信息 */
N    hal_dsi_tx_pq_filter_e    tx_pq_index;               /* 画质调整滤波器,默认为OPT最优效果 */
N} hal_dsi_tx_ctrl_handle_t;
N
N/**
N* @brief TE 信号产生模式
N*/
Ntypedef enum
N{
N    TE_60HZ_MODE   = 0,
N    TE_USER_MODE   = 1, /* 底层不产生TE, 由hal_dsi_tx_ctrl_gen_a_tear_signal 接口产生 */
N    TE_STOP_MODE   = 1,
N    TE_90HZ_MODE   = 2,
N    TE_120HZ_MODE  = 3,
N    TE_144HZ_MODE  = 4,
N    TE_160HZ_MODE  = 5,
N    TE_MODE_MAX
N} te_mode_e;
N
N/**
N* @brief  dpi tx vpg style
N*/
Ntypedef enum
N{
N    TX_VPG_V_COLOR     = 0,
N    TX_VPG_H_COLOR     = 1,
N    TX_VPG_V_BER       = 2,
N    TX_VPG_FLICKER     = 3,
N    TX_VPG_MAX
N} dsi_tx_vpg_style_e;
N
N/**
N* @brief  MIPI TX初始化
N* @param  tx_ctrl_handle: MIPI TX实例
N* @retval true/false
N*/
Nbool hal_dsi_tx_ctrl_init(hal_dsi_tx_ctrl_handle_t *tx_ctrl_handle);
X_Bool hal_dsi_tx_ctrl_init(hal_dsi_tx_ctrl_handle_t *tx_ctrl_handle);
N
N/**
N* @brief  MIPI TX反初始化
N* @param  tx_ctrl_handle: MIPI TX实例
N* @retval true/false
N*/
Nbool hal_dsi_tx_ctrl_deinit(hal_dsi_tx_ctrl_handle_t *tx_ctrl_handle);
X_Bool hal_dsi_tx_ctrl_deinit(hal_dsi_tx_ctrl_handle_t *tx_ctrl_handle);
N
N/**
N* @brief  MIPI TX创建实例
N* @param  None
N* @retval tx_ctrl_handle: MIPI TX实例
N*/
Nhal_dsi_tx_ctrl_handle_t *hal_dsi_tx_ctrl_create_handle(void);
N
N/**
N* @brief  MIPI TX释放实例
N* @param  tx_ctrl_handle: MIPI TX实例
N* @retval true/false
N*/
Nbool hal_dsi_tx_ctrl_release_handle(hal_dsi_tx_ctrl_handle_t *tx_ctrl_handle);
X_Bool hal_dsi_tx_ctrl_release_handle(hal_dsi_tx_ctrl_handle_t *tx_ctrl_handle);
N
N/**
N* @brief  MIPI TX开始运行
N* @param  tx_ctrl_handle: MIPI TX实例
N* @retval true/false
N*/
Nbool hal_dsi_tx_ctrl_start(hal_dsi_tx_ctrl_handle_t *tx_ctrl_handle);
X_Bool hal_dsi_tx_ctrl_start(hal_dsi_tx_ctrl_handle_t *tx_ctrl_handle);
N
N/**
N* @brief  MIPI TX停止运行
N* @param  tx_ctrl_handle: MIPI TX实例
N* @retval true/false
N*/
Nbool hal_dsi_tx_ctrl_stop(hal_dsi_tx_ctrl_handle_t *tx_ctrl_handle);
X_Bool hal_dsi_tx_ctrl_stop(hal_dsi_tx_ctrl_handle_t *tx_ctrl_handle);
N
N/**
N* @brief  MIPI TX接收命令
N* @param  data_type: 数据类型，参考枚举类型dsi_data_type_e
N* @param  vc: 虚拟通道编号，参考枚举类型dsi_virtual_channel_e
N* @param  cmd: DCS指令
N* @param  size: 读取数据长度
N* @param  data: 数据存放地址
N* @retval None
N*/
Nvoid hal_dsi_tx_ctrl_read_cmd(uint8_t data_type, uint8_t vc, uint8_t cmd, uint8_t size, uint8_t *data);
N
N/**
N* @brief  video高速数据传输时V porch阶段进行bta回读接口
N* @param  data_type: 数据类型，参考枚举类型dsi_data_type_e
N* @param  cmd: DCS指令
N* @param  size: 读取数据长度
N* @param  data: 数据存放地址
N* @retval true-BTA回复获取有效，false-BTA回复未获得
N* @attention 需要考虑V porch时长是否足够size长度的寄存器回读，否则造成TX数据通路出错
N*/
Nbool hal_dsi_tx_ctrl_vporch_bta_opera(uint8_t data_type, uint8_t cmd, uint8_t size, uint8_t *data);
X_Bool hal_dsi_tx_ctrl_vporch_bta_opera(uint8_t data_type, uint8_t cmd, uint8_t size, uint8_t *data);
N
N/**
N* @brief  MIPI TX发送命令
N* @param  data_type: 数据类型，参考枚举类型dsi_data_type_e
N* @param  vc: 虚拟通道编号，参考枚举类型dsi_virtual_channel_e
N* @param  cmd_count: 可变参数个数
N* @param  ...: 可变参数
N* @retval true-command发送正常；false-TX当前状态不能发送command
N*/
Nbool hal_dsi_tx_ctrl_write_cmd(uint8_t data_type, uint8_t vc, uint8_t cmd_count, ...);
X_Bool hal_dsi_tx_ctrl_write_cmd(uint8_t data_type, uint8_t vc, uint8_t cmd_count, ...);
N
N/**
N* @brief  MIPI TX发送命令
N* @param  data_type: 数据类型，参考枚举类型dsi_data_type_e
N* @param  vc: 虚拟通道编号，参考枚举类型dsi_virtual_channel_e
N* @param  size: data个数
N* @param  data: data数组
N* @retval true-command发送正常；false-TX当前状态不能发送command
N*/
Nbool hal_dsi_tx_ctrl_write_array_cmd(uint8_t data_type, uint8_t vc, uint8_t size, const uint8_t *data);
X_Bool hal_dsi_tx_ctrl_write_array_cmd(uint8_t data_type, uint8_t vc, uint8_t size, const uint8_t *data);
N
N/**
N* @brief  切换至 LP cmd发送模式
N* @param  enable: true-进行cmd发送；false-结束LP cmd发送
N* @retval None
N* @attention 应用场景：AP enter sleep后传输发送LP cmd
N*/
Nvoid hal_dsi_tx_ctrl_cmd_mode(bool enable);
Xvoid hal_dsi_tx_ctrl_cmd_mode(_Bool enable);
N
N/**
N* @brief  设置TX escape mode时钟
N* @param  esc_clk: escape clk 单位Hz,10000000时CMD为10Mhz
N* @retval None
N*/
Nvoid hal_dsi_tx_ctrl_set_escape_clock_div(uint32_t esc_clk);
N
N/**
N* @brief  设置RGB或BGR
N* @param  endianness: 选择RGB或BGR显示，参考dsi_endianness_e
N* @attention 接口需要在初始化接口hal_dsi_tx_ctrl_init调用前才能生效
N* @retval None
N*/
Nvoid hal_dsi_tx_ctrl_set_endianness(dsi_endianness_e endianness);
N
N/**
N* @brief  设置CCM参数
N* @param  coef: 客制化参数，参考结构体ccm_coef_t
N* @retval None
N*/
Nvoid hal_dsi_tx_ctrl_set_ccm(ccm_coef_t *ccm);
N
N/**
N* @brief  设置边缘检测算法参数
N* @param  edge_dect_para: 边缘检测算法参数，参考 dsi_tx_edge_dect_t;关闭模块时可以传参NULL
N* @param  edge_dect_en: 是否开启边缘检测模块
N* @retval None
N*/
Nvoid hal_dsi_tx_ctrl_set_edge_dect(dsi_tx_edge_dect_t *edge_dect_para, bool edge_dect_en);
Xvoid hal_dsi_tx_ctrl_set_edge_dect(dsi_tx_edge_dect_t *edge_dect_para, _Bool edge_dect_en);
N
N/**
N* @brief  设置边缘增强效果算法参数
N* @param  edge_enh_para: 边缘增强算法参数，参考 dsi_tx_edge_enh_t;关闭模块时可以传参NULL
N* @param  edge_enh_en: 是否开启边缘增强模块
N* @retval None
N*/
Nvoid hal_dsi_tx_ctrl_set_edge_enhance(dsi_tx_edge_enh_t *edge_enh_para, bool edge_enh_en);
Xvoid hal_dsi_tx_ctrl_set_edge_enhance(dsi_tx_edge_enh_t *edge_enh_para, _Bool edge_enh_en);
N
N/**
N* @brief  设置False Color remove算法参数
N* @param  fc_para: false color参数，参考 dsi_tx_fc_t;关闭模块时可以传参NULL
N* @param  fc_en: 是否开启false color配置模块
N* @retval None
N*/
Nvoid hal_dsi_tx_ctrl_set_fc(dsi_tx_fc_t *fc_para, bool fc_en);
Xvoid hal_dsi_tx_ctrl_set_fc(dsi_tx_fc_t *fc_para, _Bool fc_en);
N
N/**
N* @brief  设置bcs参数
N* @param  bcs_para: 明亮度/对比度/饱和度，参考 dsi_tx_bcs_t;关闭模块时可以传参NULL
N* @param  bcs_en: 是否开启bcs配置模块
N* @retval None
N*/
Nvoid hal_dsi_tx_ctrl_set_bcs(dsi_tx_bcs_t *bcs_para, bool bcs_en);
Xvoid hal_dsi_tx_ctrl_set_bcs(dsi_tx_bcs_t *bcs_para, _Bool bcs_en);
N
N/**
N* @brief  设置复写颜色
N* @param  R: RGB的R分量
N* @param  G: RGB的G分量
N* @param  B: RGB的B分量
N* @retval None
N*/
Nvoid hal_dsi_tx_ctrl_set_overwrite_rgb(uint8_t R, uint8_t G, uint8_t B);
N
N/**
N* @brief  打开overwrite功能
N* @param  enable: true-打开overwrite； false-关闭overwrite
N* @retval None
N*/
Nvoid hal_dsi_tx_ctrl_overwrite_enable(bool enable);
Xvoid hal_dsi_tx_ctrl_overwrite_enable(_Bool enable);
N
N/**
N* @brief  设置部分显示
N* @param  enable: true-打开partial显示； false-关闭partial显示
N* @param  par_disp_cfg display区域和背景色设置，参考 dsi_tx_par_dis_t; 关闭模块功能时可以传参NULL
N* @retval None
N*/
Nvoid hal_dsi_tx_ctrl_partial_disp_enable(bool enable, dsi_tx_par_dis_t *par_disp_cfg);
Xvoid hal_dsi_tx_ctrl_partial_disp_enable(_Bool enable, dsi_tx_par_dis_t *par_disp_cfg);
N
N/**
N* @brief  控制TX VPG的输出
N* @param  vpg_en: 使能VPG
N* @param  style: VPG的样式
N* @param  vpg_hline_adj: false-正常情况使用，true-VPG显示滚动情况下使用
N* @attention vpg_hline_adj此参数只能解决带宽余量相差不大的情况，如果带宽需求超出过多，依然无法解决带宽不足引起的VPG显示滚动问题
N* @retval None
N*/
Nvoid hal_dsi_tx_ctrl_set_vpg(bool vpg_en, dsi_tx_vpg_style_e style, bool vpg_hline_adj);
Xvoid hal_dsi_tx_ctrl_set_vpg(_Bool vpg_en, dsi_tx_vpg_style_e style, _Bool vpg_hline_adj);
N
N/**
N* @brief  配置TE模式
N* @param  tx_ctrl_handle: dsi tx handle
N* @param  te: te mode
N* @retval None
N*/
Nvoid hal_dsi_tx_ctrl_set_tear_mode(hal_dsi_tx_ctrl_handle_t *tx_ctrl_handle, te_mode_e te);
N
N/**
N* @brief  生成一个TE信号
N* @param  None
N* @retval None
N*/
Nvoid hal_dsi_tx_ctrl_gen_a_tear_signal(void);
N
N/**
N* @brief  command mode输出模式下产生一帧数据
N* @param  None
N* @retval None
N*/
Nbool hal_dsi_tx_ctrl_gen_a_frame(void);
X_Bool hal_dsi_tx_ctrl_gen_a_frame(void);
N
N/**
N* @brief  配置输入输出同步行数,用于调整图像撕裂问题
N* @param  tx_ctrl_handle: dsi tx handle
N* @param  line_num:  同步行号,范围1 ~ output height
N* @retval true/false
N*/
Nbool hal_dsi_tx_ctrl_set_cus_sync_line(hal_dsi_tx_ctrl_handle_t *tx_ctrl_handle, uint32_t line_num);
X_Bool hal_dsi_tx_ctrl_set_cus_sync_line(hal_dsi_tx_ctrl_handle_t *tx_ctrl_handle, uint32_t line_num);
N
N/**
N* @brief  获取TX当前显示行号
N* @param  tx_ctrl_handle: dsi tx handle
N* @retval 当前显示行号,包括vsa + vbp + vactive + vfp
N*/
Nuint32_t hal_dsi_tx_ctrl_get_disp_line(hal_dsi_tx_ctrl_handle_t *tx_ctrl_handle);
N
N#endif //__HAL_DSI_TX_CTRL_H__
L 18 "..\..\src\app\P6A\p6a_demo.c" 2
N#include "hal_swire.h"
L 1 "..\..\src\sdk\include\hal_swire.h" 1
N/*******************************************************************************
N*
N*
N* File:          hal_swire.h
N* Description： swire HAL层头文件
N* Version：      V0.1
N* Date：         2021-03-17
N* Author：       jaya
N *******************************************************************************/
N#ifndef __HAL_SWIRE_H__
N#define __HAL_SWIRE_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/*******************************************************************************
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  SWIRE初始化
N* @param  无
N* @retval 无
N*/
Nvoid hal_swire_init(void);
N
N/**
N* @brief  SWIRE去初始化
N* @param  无
N* @retval 无
N*/
Nvoid hal_swire_deinit(void);
N
N/**
N* @brief  配置SWIRE波形
N* @param  start_time：起始时长，单位us
N* @param  stop_time：结束时长，单位us，必须大于300us
N* @param  high_time：高电平时长，单位us
N* @param  low_time：低电平时长，单位us
N* @retval 无
N*/
Nvoid hal_swire_set_waveform(uint32_t start_time, uint32_t stop_time,
N                            uint32_t high_time, uint32_t low_time);
N
N
N/**
N* @brief  配置SWIRE脉冲个数
N* @param  pulse：脉冲数
N* @retval 无
N*/
Nvoid hal_swire_set_pulse(uint32_t pulse);
N
N/**
N* @brief  开关swire输出,不绑定timer的情况下,每次调用hal_swire_set_pulse产生一个swire波形
N* @param  state：开关控制
N* @retval 无
N*/
Nvoid hal_swire_enable(bool state);
Xvoid hal_swire_enable(_Bool state);
N
N/**
N* @brief  配置swire选择的timer
N* @param  timer_num_e index：定时器编号
N* @param  uint32_t ms：超时时间
N* @param  repeat :是否重复
N* @retval 无
N*/
Nvoid hal_swire_set_timer(timer_num_e index, uint32_t ms, bool repeat);
Xvoid hal_swire_set_timer(timer_num_e index, uint32_t ms, _Bool repeat);
N
N/**
N* @brief  注册回调函数,每次swire 发送完成后会产生回调
N* @param  cb_func：回调函数地址
N* @retval 无
N*/
Nvoid hal_swire_register_callback(fcb_type cb_func);
N
N#endif /* __HAL_SWIRE_H__ */
L 19 "..\..\src\app\P6A\p6a_demo.c" 2
N#include "hal_timer.h"
L 1 "..\..\src\sdk\include\hal_timer.h" 1
N/*******************************************************************************
N*
N*
N* File:          hal_timer.h
N* Description： timer HAL层头文件
N* Version：      V0.1
N* Date：         2021-03-16
N* Author：       jaya
N *******************************************************************************/
N#ifndef __HAL_TIMER_H__
N#define __HAL_TIMER_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/*******************************************************************************
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  指定定时器初始化
N* @param  index：实例序号(0~3)，参考枚举类型timer_num_e
N* @retval None
N*/
Nvoid hal_timer_init(timer_num_e index);
N
N/**
N* @brief  指定定时器反初始化
N* @param  index：实例序号(0~3)，参考枚举类型timer_num_e
N* @retval None
N*/
Nvoid hal_timer_deinit(timer_num_e index);
N
N/**
N* @brief  启动指定定时器
N* @param  index：实例序号(0~3)，参考枚举类型timer_num_e
N* @param  ms：超时时间，单位ms。由于应用场景一般是ms级别的，应用开发不需要计数具体时针数，
N              故直接输入时间，在接口内部换算成时钟数进行寄存器设置。
N* @param  cb_func：回调函数地址，不需要则填NULL
N* @param  data：回调函数的参数地址，不需要则填NULL
N* @retval None
N*/
Nvoid hal_timer_start(timer_num_e index, uint32_t ms, fcb_type cb_func, void *data);
N
N/**
N* @brief  启动指定定时器
N* @param  index：实例序号(0~3)，参考枚举类型timer_num_e
N* @param  us：超时时间，单位us。由于应用场景一般是us级别的，应用开发不需要计数具体时针数，
N              故直接输入时间，在接口内部换算成时钟数进行寄存器设置。
N* @param  cb_func：回调函数地址，不需要则填NULL
N* @param  data：回调函数的参数地址，不需要则填NULL
N* @retval None
N*/
Nvoid hal_timer_start_ex(timer_num_e index, uint32_t us, fcb_type cb_func, void *data);
N
N/**
N* @brief  停止指定定时器
N* @param  index：实例序号(0~3)，参考枚举类型timer_num_e
N* @retval None
N*/
Nvoid hal_timer_stop(timer_num_e index);
N
N/**
N* @brief  设置定时器是否循环超时
N* @param  index：实例序号(0~3)，参考枚举类型timer_num_e
N* @param  bool enable：循环超时使能
N* @retval None
N*/
Nvoid hal_timer_set_repeat(timer_num_e index, bool repeat);
Xvoid hal_timer_set_repeat(timer_num_e index, _Bool repeat);
N
N/**
N* @brief  获取指定指示器状态
N* @param  index：实例序号(0~3)，参考枚举类型timer_num_e
N* @retval 参考timer_status_e
N*/
Ntimer_status_e hal_timer_get_status(timer_num_e index);
N
N#endif /* __HAL_TIMER_H__ */
L 20 "..\..\src\app\P6A\p6a_demo.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#include "hal_gpio.h"
N#include "tau_log.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* @brief 系统时钟配置
N*/
Ntypedef enum
N{
N    HAL_SYSCLK_80M  = 80000000,
N    HAL_SYSCLK_100M = 100000000,
N    HAL_SYSCLK_150M = 150000000
N} hal_system_clk_e;
N
N/*******************************************************************************
N* 4.Global variable extern declarations
N*******************************************************************************/
N
N/*******************************************************************************
N* 5.Global function prototypes
N*******************************************************************************/
N
N/**
N* @brief  system 初始化
N* @param  sysclk:系统时钟
N* @retval none
N*/
Nvoid hal_system_init(hal_system_clk_e sysclk);
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  reset chip
N* @param  none
N* @retval none
N*/
Nvoid hal_system_reset_chip(void);
N
N/**
N* @brief  获取上位机设置的debug state(debug only)
N* @param  none
N* @retval debug state
N*/
Nuint32_t hal_system_get_debug_state(void);
N
N/**
N* @brief  clear debug state(debug only)
N* @param  none
N* @retval none
N*/
Nvoid hal_system_clear_debug_state(void);
N
N/**
N* @brief 更新MCU时钟
N* @param  sysclk:系统时钟
N* @retval true/false
N*/
Nbool hal_system_updata_sysclk(hal_system_clk_e sysclk);
X_Bool hal_system_updata_sysclk(hal_system_clk_e sysclk);
N
N#endif //__HAL_SYSTEM_H__
L 21 "..\..\src\app\P6A\p6a_demo.c" 2
N#include "hal_gpio.h"
N#include "test_cfg_global.h"
L 1 "..\..\src\app\test_cfg_global.h" 1
N/*******************************************************************************
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/* 模块demo 宏定义 */
N#define _MODULE_DEMO_ENABLE                0
N#define _MODULE_DEMO_TIMER_EN              0
N#define _MODULE_DEMO_DSI_TX_EN             0
N#define _MODULE_DEMO_DSI_RX_EN             0
N#define _MODULE_DEMO_PWM_EN                0
N#define _MODULE_DEMO_SWIRE_EN              0
N#define _MODULE_DEMO_WDG_EN                0
N#define _MODULE_DEMO_GPIO_EN               0
N#define _MODULE_DEMO_I2C_EN                0
N#define _MODULE_DEMO_SPI_EN                0
N#define _MODULE_DEMO_PWR_EN				   0
N/* ap demo 宏定义 */
N#define _DEMO_GOOGLE_P6A_EN         1
N
N
N#if _DEMO_GOOGLE_P6A_EN
X#if 1
N    #include "p6a_demo.h"
N#endif
N#endif
N
L 23 "..\..\src\app\P6A\p6a_demo.c" 2
N#include "hal_pwr.h"
L 1 "..\..\src\sdk\include\hal_pwr.h" 1
N/*******************************************************************************
N*
N*
N* File:         hal_pwr.h
N* Description： pwr hal层头文件
N* Version：      V0.1
N* Date：         2023-07-21
N* Author：       lyw
N *******************************************************************************/
N#ifndef __HAL_PWR_H__
N#define __HAL_PWR_H__
N
N/*******************************************************************************
N* 1.Included files
N*******************************************************************************/
N#include "tau_device_datatype.h"
N#include "tau_common.h"
N#include "hal_gpio.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* @brief IC主供电电源选择
N*/
Ntypedef enum
N{
N    PWR_SEL_IOV18           = 0,           /* IC选择IOV18主供电(默认值)          */
N    PWR_SEL_TP18            = 1,           /* IC选择TP18主供电                */
N    PWR_SEL_VCC             = 2,           /* IC选择VCC主供电                 */
N    PWR_SEL_VDD13CP         = 3,           /* IC选择VDD13CP外接电源主供电*/
N} pwr_main_power_sel_e;
N
N/**
N* @brief Sleep mode 供电模式
N*/
Ntypedef enum
N{
N    PWR_SLEEP_IN_NON               = 0,           /* Sleep Mode期间无外部供电(默认值) */
N    PWR_SLEEP_IN_TP18              = 1,           /* Sleep Mode期间TP18有电,其他电源掉电或不存在 */
N    PWR_SLEEP_IN_VCC               = 2,           /* Sleep Mode期间VCC有电,其他电源掉电或不存在 */
N    PWR_SLEEP_IN_VCC_TP18          = 3,           /* Sleep Mode期间TP18与VCC有电,其他电源掉电或不存在 */
N    PWR_SLEEP_IN_IOV18             = 4,           /* Sleep Mode期间IOV18有电,其他电源掉电或不存在 */
N    PWR_SLEEP_IN_IOV18_TP18        = 5,           /* Sleep Mode期间IOV18与TP18有电,其他电源掉电或不存在 */
N    PWR_SLEEP_IN_IOV18_VCC         = 6,           /* Sleep Mode期间IOV18与VCC有电,其他电源掉电或不存在 */
N    PWR_SLEEP_IN_IOV18_VCC_TP18    = 7,           /* Sleep Mode期间IOV18、TP18、VCC均有电,其他电源掉电或不存在 */
N} pwr_sleep_power_sel_e;
N
N/**
N* @brief sleep mode 唤醒沿配置
N*/
Ntypedef enum
N{
N    WUP_RISING_EDGE  = 2,  /* 上升沿唤醒 */
N    WUP_FALLING_EDGE = 3   /* 下降沿唤醒 */
N} pwr_wakeup_trigger_e;
N
N/**
N* @brief 软件启动原因
N*/
Ntypedef enum
N{
N    RF_POWER_ON             = 0,  /* Power On,正常上电 */
N    RF_CORE_RST             = 1,  /* 软件reset, 调用NVIC_SystemReset产生reset */
N    RF_WDT_RST              = 2,  /* WDT reset */
N    RF_CHIP_RST             = 3,  /* Chip reset,调用hal_system_reset_chip产生的reset */
N    RF_APRSTN_WAKEUP        = 4,  /* deep sleep mode 下AP_RSTN reset  */
N    RF_TDINT_WAKEUP         = 5   /* deep sleep mode 下TD_INT reset  */
N} pwr_reset_flag_e;
N
N/**
N* @brief pwr sleep mode type
N* 不同sleep mode具体应用场景见《PWR说明文档》
N*/
Ntypedef enum
N{
N    PWR_NORMAL_SLEEP_MODE  = 0, /* 待机下需要处理外设(I2C)等事件使用,调用hal_pwr_enter_normal_sleep_mode 进入,hal_pwr_exit_sleep_mode退出 */
N    PWR_STOP_SLEEP_MODE    = 1, /* 待机下需要通过任意GPIO唤醒时使用此模式,进入之前关闭所有模块以及MCU,通过hal_pwr_set_stop_sleep_wakeup_pin 注册GPIO中唤醒源,调用hal_pwr_enter_stop_sleep_mode 进入,hal_pwr_exit_sleep_mode退出 */
N    PWR_DEEP_SLEEP_MODE    = 2  /* 待机下只需要通过AP RSTN跟TD INT引脚唤醒使用时使用此模式,调用hal_pwr_enter_deep_sleep_mode 唤醒后重启,通过hal_pwr_get_reset_flag确定唤醒源 */
N} pwr_sleep_mode_e;
N
N/*! @brief HV LDO输出电压配置*/
Ntypedef enum _pwr_hv_ldo_e
N{
N    HV_LDO_0            = 0,    /*1.20V*/
N    HV_LDO_1            = 1,    /*1.26V*/
N    HV_LDO_2            = 2,    /*1.32V*/
N    HV_LDO_3            = 3,    /*1.38V*/
N    HV_LDO_4            = 4,    /*1.44V*/
N    HV_LDO_5            = 5,    /*1.50V*/
N    HV_LDO_6            = 6,    /*1.56V*/
N    HV_LDO_7            = 7,    /*1.62V*/
N    HV_LDO_8            = 8,    /*1.68V*/
N    HV_LDO_9            = 9,    /*1.74V*/
N    HV_LDO_10            = 10,    /*1.80V*/
N    HV_LDO_11            = 11,    /*1.86V*/
N    HV_LDO_12            = 12,    /*2.04V*/
N    HV_LDO_13            = 13,    /*2.46V*/
N    HV_LDO_14            = 14,    /*3.00V*/
N    HV_LDO_15            = 15,    /*3.30V*/
N} pwr_hv_ldo_e;
N
N/*! @brief LDO 13S输出电压配置*/
Ntypedef enum _pwr_ldo_13s_e
N{
N    LDO_13S_0            = 0,    /*1.22V*/
N    LDO_13S_1            = 1,    /*1.25V*/
N    LDO_13S_2            = 2,    /*1.27V*/
N    LDO_13S_3            = 3,    /*1.30V*/
N    LDO_13S_4            = 4,    /*1.33V*/
N    LDO_13S_5            = 5,    /*1.37V*/
N    LDO_13S_6            = 6,    /*1.40V*/
N    LDO_13S_7            = 7,    /*1.43V*/
N} pwr_ldo_13s_e;
N
N/*! @brief LDO 18S输出电压配置*/
Ntypedef enum _pwr_ldo_18s_e
N{
N    LDO_18S_0            = 0,    /*1.61V*/
N    LDO_18S_1            = 1,    /*1.64V*/
N    LDO_18S_2            = 2,    /*1.67V*/
N    LDO_18S_3            = 3,    /*1.70V*/
N    LDO_18S_4            = 4,    /*1.74V*/
N    LDO_18S_5            = 5,    /*1.77V*/
N    LDO_18S_6            = 6,    /*1.80V*/
N    LDO_18S_7            = 7,    /*1.83V*/
N} pwr_ldo_18s_e;
N
N/*! @brief PWR PVD index */
Ntypedef enum
N{
N    PVD_IOVCC          = 3,
N    PVD_VCI            = 15,
N} pwr_pvd_index_e;
N
N/*******************************************************************************
N* 4.Global variable extern declarations
N*******************************************************************************/
N
N/*******************************************************************************
N* 5.Global function prototypes
N*******************************************************************************/
N/**
N* @brief  IC主供电选择,如果是配置vcc主供电，可通过hal_pwr_get_vcc_power_ready获取电源状态
N*         注:上电只能配置一次,不可随意切换
N* @param  power_sel 主供电选择,见枚举描述
N* @retval none
N*/
Nvoid hal_pwr_set_main_power(pwr_main_power_sel_e power_sel);
N
N/**
N* @brief  获取VCC电源稳定状态,使用hal_pwr_set_main_power切换电源后,通过此接口获取电源稳定状态
N* eg: 使用hal_pwr_set_main_power切换至VCC主供电,在VCC电源接口上电之前,此接口返回值为false
N* @param  None
N* @retval true-电源切换完成 false-电源未切换完成
N*/
Nbool hal_pwr_get_vcc_power_ready(void);
X_Bool hal_pwr_get_vcc_power_ready(void);
N
N/**
N* @brief  配置VCC开关,芯片启动默认打开VCC CP,不存在VCC的情况下可关闭
N* @param  enable: true:打开CP, false:关闭CP
N* @retval none
N*/
Nvoid hal_pwr_set_vcc_enable(bool enable);
Xvoid hal_pwr_set_vcc_enable(_Bool enable);
N
N/**
N* @brief  sleep mode 期间电源情况配置
N* 调用sleep mode之前配置,根据配置情况在sleep mode自动切换电源
N* exit sleep mode后切换回hal_pwr_set_main_power的电源
N* @param  powerin =000 息屏期间状态，IOV18掉电0，VCC掉电0，TP18也掉电0；
N* @retval none
N*/
Nvoid hal_pwr_set_sleep_mode_power(pwr_sleep_power_sel_e power_sel);
N
N/**
N* @brief  进入normal sleep mode 模式（详细使用方法见《PWR说明文档》）
N*         待机下需要处理外设(I2C)等事件使用,图像通路关闭,MCU&外设正常运行
N*         调用hal_pwr_exit_sleep_mode退出
N* @param  none
N* @retval bool true/false
N*/
Nbool hal_pwr_enter_normal_sleep_mode(void);
X_Bool hal_pwr_enter_normal_sleep_mode(void);
N
N/**
N* @brief  进入stop sleep mode 模式（详细使用方法见《PWR说明文档》）
N*         待机下需要通过任意GPIO唤醒时使用此模式，进入之前关闭所有模块,通过hal_pwr_set_stop_sleep_wakeup_pin 注册GPIO中唤醒源。
N*         调用此接口后MCU会停止运行,等待中断唤醒后该函数才返回,调用hal_pwr_exit_sleep_mode真正退出stop sleep mode
N* @param  none
N* @retval io_pad_e:唤醒接口
N*/
Nio_pad_e hal_pwr_enter_stop_sleep_mode(void);
N
N/**
N* @brief  注册 stop sleep mode 唤醒IO （详细使用方法见文档）
N* @param  pad ：Pin name
N* @param  trig：唤醒触发模式
N* @retval true/false
N*/
Nbool hal_pwr_set_stop_sleep_wakeup_pin(io_pad_e pad, pwr_wakeup_trigger_e trig);
X_Bool hal_pwr_set_stop_sleep_wakeup_pin(io_pad_e pad, pwr_wakeup_trigger_e trig);
N
N/**
N* @brief  进入deep sleep mode 模式, 等待AP_RSTN 或者TD_INT 唤醒
N*         待机下只需要通过AP RSTN跟TD INT引脚唤醒使用时使用此模式，唤醒后重启,通过hal_pwr_get_reset_flag确定唤醒源
N*         注意, 如果需要使用deep sleep mode,TD INT引脚不能悬空,必须有上拉或者下拉保证确定电平,否则会导致误唤醒
N* @param  polarity true:上升沿唤醒 false:下降沿唤醒
N* @retval none
N*/
Nvoid hal_pwr_enter_deep_sleep_mode(pwr_wakeup_trigger_e ap_rstn_trig, pwr_wakeup_trigger_e td_int_trig);
N
N/**
N* @brief 退出sleep mode, normal/stop sleep mode都需要通过此接口退出
N* @param  none
N* @retval true/false
N*/
Nbool hal_pwr_exit_sleep_mode(void);
X_Bool hal_pwr_exit_sleep_mode(void);
N
N/**
N* @brief  获取系统复位原因
N* @param  none
N* @retval reset flag,见pwr_reset_flag_e
N*/
Npwr_reset_flag_e hal_pwr_get_reset_flag(void);
N
N/**
N* @brief  打开ELVCC作为供电电源
N* @param  none
N* @retval
N*/
Nvoid hal_pwr_elvcc_ldo_en(bool enable);
Xvoid hal_pwr_elvcc_ldo_en(_Bool enable);
N
N
N/**
N* @brief
N* @param  HV LDO输出电压配置
N          =0000：1.20V，
N          =0001：1.26V，
N          =0010：1.32V，
N          =0011：1.38V，
N          =0100：1.44V，
N          =0101：1.50V，
N          =0110：1.56V，
N          =0111：1.62V，
N          =1000：1.68V，
N          =1001：1.74V，
N          =1010：1.80V，
N          =1011：1.86V，
N          =1100：2.04V，
N          =1101：2.46V，
N          =1110：3.00V，
N          =1111：3.30V
N* @retval none
N*/
Nvoid hal_pwr_elvcc_vol_set(pwr_hv_ldo_e voltage);
N
N/**
N* @brief
N* @param  LDO18_S模块使能控制，=0关闭，默认关闭；=1开启
N* @retval none
N*/
Nvoid hal_pwr_ldo18s_en(bool enable);
Xvoid hal_pwr_ldo18s_en(_Bool enable);
N
N
N/**
N* @brief
N* @param  LDO18_S输出电压配置，
N         000=1.61V
N         001=1.64V
N         010=1.67V
N         011=1.70V
N         100=1.74V
N         101=1.77V
N         110=1.80V
N         111=1.83V
N* @retval none
N*/
Nvoid hal_pwr_ldo18s_set(pwr_ldo_18s_e voltage);
N
N/**
N* @brief
N* @param  LDO13_S模块使能控制，=0关闭，默认关闭；=1开启
N* @retval none
N*/
Nvoid hal_pwr_ldo13s_en(bool enable);
Xvoid hal_pwr_ldo13s_en(_Bool enable);
N
N
N/**
N* @brief
N* @param  LDO13_S输出电压配置，
N          000=1.22V,
N          001=1.25V,
N          010=1.27V,
N          011=1.30V,
N          100=1.33V，
N          101=1.37V，
N          110=1.40V，
N          111=1.43V
N* @retval none
N*/
Nvoid hal_pwr_ldo13s_set(pwr_ldo_13s_e voltage);
N
N/**
N* @brief PVD(电源检查)开关接口,
N*        PVD默认均为打开,注意!电源切换(如主供电切换,进出sleep mode)必须打开PVD!
N* @param index:  PVD选择 IOVCC/VCI
N* @param enable: PVD开关
N* @retval none
N*/
Nvoid hal_pwr_set_pvd(pwr_pvd_index_e index, bool enable);
Xvoid hal_pwr_set_pvd(pwr_pvd_index_e index, _Bool enable);
N
N/**
N* @brief 使能TP18给VDD18供电
N* @warning info!!!  1:进入休眠的电源要选择TP18供电 eg：  hal_pwr_set_sleep_mode_power(PWR_SLEEP_IN_TP18);
N* @warning info!!!  2:唤醒之后，关闭改使能 eg：  hal_pwr_sw_tp18_en(DISENABLE);
N* @param enable:
N* @retval none
N*/
Nvoid hal_pwr_sw_tp18_en(bool enable);
Xvoid hal_pwr_sw_tp18_en(_Bool enable);
N
N
N
N#endif /* __HAL_PWR_H__ */
L 24 "..\..\src\app\P6A\p6a_demo.c" 2
N#include "hal_pwm.h"
L 1 "..\..\src\sdk\include\hal_pwm.h" 1
N/*******************************************************************************
N*
N*
N* File:          hal_pwm.h
N* Description： pwm HAL层头文件
N* Version：      V0.1
N* Date：         2021-03-17
N* Author：       jaya
N *******************************************************************************/
N#ifndef __HAL_PWM_H__
N#define __HAL_PWM_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/*******************************************************************************
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  pwm 初始化
N* @param  frequency: PWM 频率 < 30000 (30K)
N* @param  duty_step: 占空比调试阶数,与硬件相关,不能超过硬件限制（建议配置255）
N          最大阶数 = (1000000000/130)/frequency，常见如下
N           frequency, max step(最大step可配置)
N          { 30000,      255 }
N          { 4000,       1923}
N          { 3000,       2564}
N* @retval true/false
N*/
Nbool hal_pwm_init(uint32_t frequency, uint32_t duty_step);
X_Bool hal_pwm_init(uint32_t frequency, uint32_t duty_step);
N
N/**
N* @brief  pwm 启动停止控制
N* @param  enable: 启动/停止
N* @retval none
N*/
Nvoid hal_pwm_enable(bool enable);
Xvoid hal_pwm_enable(_Bool enable);
N
N/**
N* @brief  pwm 设置占空比
N* @param  duty_ratio: 占空比,范围为0 - duty_step(hal_pwm_init配置的参数)
N* @retval none
N*/
Nvoid hal_pwm_set_duty(uint32_t duty_ratio);
N
N/**
N* @brief  pwm 配置从elvcc直接输出背光电源
N* @param  enable: ELVCC输出启停
N* @retval none
N*/
Nbool hal_pwm_set_elvcc_output(bool enable);
X_Bool hal_pwm_set_elvcc_output(_Bool enable);
N
N/**
N* @brief 配置elvcc PWM 驱动背光能力,范围 0 - 15, capactiy为15时驱动能力最强,ELVCC输出电流最大
N* @param capacity: 0 - 15,hal_pwm_set_elvcc_output配置时会恢复默认值15
N* @retval none
N*/
Nvoid hal_pwm_set_elvcc_capacity(uint8_t capacity);
N
N/**
N* @brief  pwm 去初始化
N* @param  none
N* @retval true/false
N*/
Nbool hal_pwm_deinit(void);
X_Bool hal_pwm_deinit(void);
N
N#endif /* __HAL_PWM_H__ */
L 25 "..\..\src\app\P6A\p6a_demo.c" 2
N#include <stdio.h>
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 <stddef.h> */
N  #else
N    typedef unsigned int size_t;   /* see <stddef.h> */
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 <stddef.h> */
N
N/* ANSI forbids va_list to be defined here */
N/* keep in step with <stdarg.h> and <wchar.h> */
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, then
N    *          the entire string was successfully formatted; if the return is
N    *          >=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 26 "..\..\src\app\P6A\p6a_demo.c" 2
N
N#ifdef LOG_TAG
N#undef LOG_TAG
N#endif
N#define LOG_TAG "p6a"
N
N#if _DEMO_GOOGLE_P6A_EN
X#if 1
N
N/******************** FEATURE开关 ********************/
N#define TOUCH_ENABLE                   false    /* Touch转换开关 */
N#define RX_START_WITHOUT_RST           true    /* 不等待AP RESET直接启动RX,仅作为调试使用 */
N#define RX_WAIT_TEAR_ON                false     /* 等待AP_TEAR_ON */
N#define RX_RESOLUTION_CHANGE_ENABLE    true     /* 支持分辨率切换开关, AP存在分辨率切换时需要打开 */
N#define RX_READ_HW_ACK                 false    /* AP DCS读命令使用硬件回复 */
N#define TX_START_AFTER_APRST           false    /* 等待AP_reset 后做Panel初始化, 用于热拔插电源不稳定导致初始化失败 */
N#define TX_USE_CMD_MODE                false    /* command mode输出开关 配置为True时需要把TD TE与 AP TE 接一起*/
N#define TX_CMD_MODE_WITHOUT_TE         false    /* 屏端TE直接输出给AP,Scaler不看TE信号,AP每输入一帧输出一帧(C2C 60Hz->60Hz) */
N#define AP_SWIRE_OUTPUT                false     /* swire信号输出,OLED项目配置 */
N#define ANALOG_PWM_OUTPUT              false     /* 模拟PWM 调光开关 */
N#define SHARE_FLASH_ENABLE             false    /* 共享flash开关 */
N/*****************************************************/
N
N/******************** 输出屏幕选择 ********************/
N#define AMOLED_ICNA3511                1                   /* 4lane FHD Panel */
N/*****************************************************/
N
N/****************** 系统相关参数配置 ******************/
N#define MAIN_POWER_SELECT              PWR_SEL_VCC           /* 主供电电源选择 */
N#define SLEEP_MODE_POWER               PWR_SLEEP_IN_IOV18 //PWR_SLEEP_IN_TP18     /* 息屏电源选择 */
N#define SLEEP_MODE_SELECT              PWR_NORMAL_SLEEP_MODE //PWR_DEEP_SLEEP_MODE //PWR_NORMAL_SLEEP_MODE //   /* sleep mode 配置 */
N#define SWIRE_DEFAULT_PULSE            37 // 31                    /* SWIRE 波形配置 */ 2.6
N#define PWM_FREQUENCY                  30000                 /* PWM输出频率30Khz */
N#define PWM_DUTY_STEP                  255                   /* PWM调光阶数255阶 */
N/*****************************************************/
N
N/********************RX 基本参数配置*******************/
N//AP MIPI数据信息
N/* 输入分辨率 */
N#define INPUT_WIDTH  1080
N#define INPUT_HEIGHT 2400
N/* 输入 MIPI lane rate,需要正确配置,可50M step调整 */
N#define INPUT_MIPI_LANE_RATE 1450000000
N/* 输入图像格式 */
N#define INPUT_COLOR_MODE DSI_RGB888
N/* 输出数据格式(DSI_DATA_CMD_MODE , DSI_DATA_VIDEO_MODE) */
N#define INPUT_DATA_MODE DSI_DATA_CMD_MODE
N/* 输入mipi lane数量(DSI_RX_LANE_x     x为1-4) */
N#define INPUT_MIPI_LANE_NUM DSI_LANE_4
N/* 输入为video mode 时数据格式 */
N#define INPUT_VIDEO_MODEL DSI_NONBURST_EVENT
N/* 输入虚拟通道(0-3) */
N#define INPUT_VC DSI_VC_0
N/* 输入的帧率(60/90/120/144Hz) */
N#define INPUT_FRAME_RATE DSI_FRAME_RATE_60HZ
N/* 输入数据是否DSC压缩 */
N#define INPUT_COMPRESS true
N/*****************************************************/
N
N/********************TX 基本参数配置*******************/
N#if AMOLED_ICNA3511
X#if 1
N//输出MIPI数据信息
N/* 输出分辨率配置 */
N#define OUTPUT_WIDTH     1044
N#define OUTPUT_HEIGHT    2260
N/* 输出虚拟通道(0-3) */
N#define OUTPUT_VC DSI_VC_0
N/* 输出mipi lane数量(DSI_RX_LANE_x     x为1-4) */
N#define OUTPUT_LANE_NUMBER DSI_LANE_4
N/* 输出数据格式(DSI_DATA_CMD_MODE , DSI_DATA_VIDEO_MODE) */
N#if TX_USE_CMD_MODE
X#if 0
S#define OUTPUT_DATA_MODE DSI_DATA_CMD_MODE
N#else
N#define OUTPUT_DATA_MODE DSI_DATA_VIDEO_MODE
N#endif
N/* 输出为video mode时的数据格式 */
N#define OUTPUT_VIDEO_MODEL DSI_BURST_MODE
N/* 输出 VSA */
N#define OUTPUT_VSA  2  //2
N/* 输出 VBP */
N#define OUTPUT_VBP  8   //8
N/* 输出 VBP */
N#define OUTPUT_VFP  62 //62
N/* 输出 VSA */
N#define OUTPUT_HSA  2   //2
N/* 输出 HBP */
N#define OUTPUT_HBP  28
N/* 输出 HFP */
N#define OUTPUT_HFP  168  //168
N/* 初始化模式命令传输类型 LP/HS */
N#define TX_INIT_TYPE            DSI_CMD_TX_LP
N#endif
N/******************************************************/
N
N#if TOUCH_ENABLE
X#if 0
S#include "app_tp_transfer.h"
N#endif
N
N/* 全局handle */
Nstatic hal_dsi_rx_ctrl_handle_t *g_rx_ctrl_handle = NULL;
Xstatic hal_dsi_rx_ctrl_handle_t *g_rx_ctrl_handle = 0;
Nstatic hal_dsi_tx_ctrl_handle_t *g_tx_ctrl_handle = NULL;
Xstatic hal_dsi_tx_ctrl_handle_t *g_tx_ctrl_handle = 0;
N
N/* 屏初始化完成标志位 */
Nstatic bool panel_display_done = false;
Xstatic _Bool panel_display_done = 0;
Nstatic bool sg_system_resume = false;
Xstatic _Bool sg_system_resume = 0;
Nstatic bool sg_system_suspend = false;
Xstatic _Bool sg_system_suspend = 0;
Nstatic bool sg_exit_idle_mode_flag = false;
Xstatic _Bool sg_exit_idle_mode_flag = 0;
N
Nstatic volatile bool g_resolution_change = false;
Xstatic volatile _Bool g_resolution_change = 0;
Nstatic uint32_t pps_renew_flag = 0;
Nstatic uint32_t pwr_rst_flag = 0;
N
N#if RX_WAIT_TEAR_ON
X#if 0
Sstatic bool sg_ap_set_tear_on = false;
N#endif
N#if TX_START_AFTER_APRST
X#if 0
Sstatic bool sg_tx_start_in_process = false;
N#endif
N
N/* soft swire */
N#define AVDD_EN                 ( IO_PIN_15 )
N#define SWIRE_EN                ( IO_PIN_17 )
N#define SWIRE_MAX_NUM           ( 10 )
N#define SWIRE_DEFAULT_NUM       ( 37 )  // 43 对应ELVSS -2.2V  35 对应 ELVSS -3V
N#define SOFT_SWIRE_TIMER        ( TIMER_NUM3 )
Nuint8_t s_swire_pwm_counter     = 0;
N
Nuint16_t rd_51_val,rd_51_val2;
N
N/* AP reset 回调函数声明 */
Nstatic void ap_rstn_pull_high_cb(void *data);
Nstatic void ap_rstn_pull_down_cb(void *data);
Nstatic void app_mipi_rx_start_cb(void *data);
Nstatic void soft_swire_init(void);
N
N/*************************DCS 命令处理函数 BEGIN*************************/
N#if RX_READ_HW_ACK
X#if 0
S/**
S* @brief  配置AP硬件回读
S* @param  none
S* @retval none
S*/
Sstatic void app_set_dcs_hw_ack()
S{
S    hal_dsi_rx_ctrl_set_auto_ack(g_rx_ctrl_handle, HAL_RX_QRESP_CODE0, DSI_ACK_DT_DCS_SHORT_RESPONSE_1B, 0xFA, 1, 0x00);
S}
N#endif
N/**
N* @brief  ap 读回调函数
N* @param  handler：rx_ctrl_handle
N*         dcs_packet: dcs 命令
N* @retval true/false
N*/
Nstatic bool ap_dcs_read(uint8_t data_type, uint8_t dcs_cmd, uint8_t param)
Xstatic _Bool ap_dcs_read(uint8_t data_type, uint8_t dcs_cmd, uint8_t param)
N{
N 	if (dcs_cmd == 0x04)
N	{
N		hal_dsi_rx_ctrl_send_ack_cmd(g_rx_ctrl_handle,
N									 DSI_ACK_DT_DCS_LONG_RESPONSE,
N									 DSI_VC_0,
N									 3, 0x8A,0x80,0x00);
N	}
N	else if (dcs_cmd == 0xa1)
N	{
N		hal_dsi_rx_ctrl_send_ack_cmd(g_rx_ctrl_handle,
N									 DSI_ACK_DT_DCS_LONG_RESPONSE,
N									 DSI_VC_0,
N									 13, 0x0C,0x12,0x0C,0xBF,0x00,0x00,0xB7,0x1A,0x14,0x38,0x11,0x20,0x21);
N	}
N	else if (dcs_cmd == 0xDA)
N	{
N		hal_dsi_rx_ctrl_send_ack_cmd(g_rx_ctrl_handle,
N									 DSI_ACK_DT_DCS_SHORT_RESPONSE_1B,
N									 DSI_VC_0,
N									 1, 0x8A);
N	}
N	else if (dcs_cmd == 0xDB)
N	{
N		hal_dsi_rx_ctrl_send_ack_cmd(g_rx_ctrl_handle,
N									 DSI_ACK_DT_DCS_SHORT_RESPONSE_1B,
N									 DSI_VC_0,
N									 1, 0x80);
N	}
N	else if (dcs_cmd == 0xDC)
N	{
N		hal_dsi_rx_ctrl_send_ack_cmd(g_rx_ctrl_handle,
N									 DSI_ACK_DT_DCS_SHORT_RESPONSE_1B,
N									 DSI_VC_0,
N									 1, 0x00);
N	}
N	else if (dcs_cmd == 0xD8)
N	{
N		hal_dsi_rx_ctrl_send_ack_cmd(g_rx_ctrl_handle,
N									 DSI_ACK_DT_DCS_LONG_RESPONSE,
N									 DSI_VC_0,
N									 5, 0x0C,0xAC,0x84,0xBE,0xFB);
N	}
N	else
N	{
N		uint32_t return_size = hal_dsi_rx_ctrl_get_max_ret_size(g_rx_ctrl_handle);
N		hal_dsi_rx_ctrl_send_ack_cmd(g_rx_ctrl_handle,
N									 DSI_ACK_DT_DCS_SHORT_RESPONSE_1B,
N									 DSI_VC_0,
N									 1, 0);
N		TAU_LOGD("r[%x] [%d] err!!!!!!\n", dcs_cmd, return_size);
X		do { tau_log_printf(kLOG_LEVEL_DBG, "[%s] (%04d) " "r[%x] [%d] err!!!!!!\n", "p6a", 229,dcs_cmd, return_size); } while (0);
N	}
N	
N//	TAU_LOGD("r %x\n",dcs_cmd);
N	return true;	
X	return 1;	
N}
N
Nuint8_t pps[128] = {0x11,0x00,0x00,0x89,0x30,0x80,0x09,0x60,0x04,0x38,0x00,0x30,0x02,0x1C,0x02,0x1C,
N                        0x02,0x00,0x02,0x0E,0x00,0x20,0x04,0xA6,0x00,0x07,0x00,0x0C,0x02,0x0B,0x02,0x1F,
N                        0x18,0x00,0x10,0xF0,0x03,0x0C,0x20,0x00,0x06,0x0B,0x0B,0x33,0x0E,0x1C,0x2A,0x38,
N                        0x46,0x54,0x62,0x69,0x70,0x77,0x79,0x7B,0x7D,0x7E,0x01,0x02,0x01,0x00,0x09,0x40,
N                        0x09,0xBE,0x19,0xFC,0x19,0xFA,0x19,0xF8,0x1A,0x38,0x1A,0x78,0x1A,0xB6,0x2A,0xF6,
N                        0x2B,0x34,0x2B,0x74,0x3B,0x74,0x6B,0xF4,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
N                        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
N                        0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
N
N
N#if RX_RESOLUTION_CHANGE_ENABLE
X#if 1
N/* PPS update callback 用于分辨率切换case */
Nstatic bool pps_update_handle(uint8_t *pps, uint8_t size, uint32_t pic_width, uint32_t pic_height)
Xstatic _Bool pps_update_handle(uint8_t *pps, uint8_t size, uint32_t pic_width, uint32_t pic_height)
N{
N	
N    /* AVDD 上电, 用于解决息屏开屏PPS不更新问题 */
N //   hal_gpio_set_output_data(IO_PAD_AP_PWMEN, IO_LVL_HIGH);
N    if (pic_width != g_rx_ctrl_handle->base_info.src_w || pic_height != g_rx_ctrl_handle->base_info.src_h)
N    {
N        hal_dsi_tx_ctrl_set_tear_mode(g_tx_ctrl_handle, TE_USER_MODE);
N        /* PPS Update 且分辨率发生变化 */
N        g_rx_ctrl_handle->base_info.src_w = pic_width;
N        g_rx_ctrl_handle->base_info.src_h = pic_height;
N        /* 注意部分基板更新PPS前不发 Compression Mode Command的情况 */
N        g_rx_ctrl_handle->compress_en = true;  
X        g_rx_ctrl_handle->compress_en = 1;  
N		if(pic_width > 720)
N		{
N			g_tx_ctrl_handle->base_info.src_w = pic_width;
N			g_tx_ctrl_handle->base_info.src_h = pic_height;
N		}
N//		hal_dsi_rx_ctrl_pre_init_pps(g_rx_ctrl_handle, pps, 128);
N		hal_dsi_rx_ctrl_toggle_resolution(g_rx_ctrl_handle);
N    }
N	    hal_dsi_tx_ctrl_set_tear_mode(g_tx_ctrl_handle, TE_60HZ_MODE);
N    //TAU_LOGD("PPS Update[%d][%d] [%d][%d]\n", pic_width, pic_height, g_rx_ctrl_handle->base_info.src_w, g_rx_ctrl_handle->base_info.src_h);
N    return true;
X    return 1;
N}
N#endif
N
N
N
N/**
N* @brief  ap display on处理函数
N* @param  handler：rx_ctrl_handle
N*         dcs_packet: dcs 命令
N* @retval true/false
N*/
Nstatic bool ap_dcs_set_display_on(hal_dsi_rx_ctrl_handle_t *handler, hal_dcs_packet_t *dcs_packet)
Xstatic _Bool ap_dcs_set_display_on(hal_dsi_rx_ctrl_handle_t *handler, hal_dcs_packet_t *dcs_packet)
N{
N//    TAU_LOGD("disp on");
N//	if (start_display_on == false){
N		hal_dsi_tx_ctrl_write_cmd(0x05, 0, 2, 0x29);
N//	}
N    TAU_LOGD("disp on \n");
X    do { tau_log_printf(kLOG_LEVEL_DBG, "[%s] (%04d) " "disp on \n", "p6a", 289); } while (0);
N    return true;
X    return 1;
N}
N
N
N/**
N* @brief  ap display off处理函数
N* @param  handler：rx_ctrl_handle
N*         dcs_packet: dcs 命令
N* @retval true/false
N*/
Nstatic bool ap_dcs_set_display_off(hal_dsi_rx_ctrl_handle_t *handler, hal_dcs_packet_t *dcs_packet)
Xstatic _Bool ap_dcs_set_display_off(hal_dsi_rx_ctrl_handle_t *handler, hal_dcs_packet_t *dcs_packet)
N{
N#if ANALOG_PWM_OUTPUT
X#if 0
S    hal_pwm_enable(false);
N#endif
N
N    TAU_LOGD("disp off %d\n", panel_display_done);
X    do { tau_log_printf(kLOG_LEVEL_DBG, "[%s] (%04d) " "disp off %d\n", "p6a", 306,panel_display_done); } while (0);
N    return true;
X    return 1;
N}
N
N
N/*****************************************************************************
N*GPIO发送swire波形
N*flag:  =0, SWIRE=0;  =1,仅发送SWIRE信号; =2, 先置高再发SWIRE信号
N*num: 发几个脉冲
N*注意FLAG=1时无GPIO初始化!!!!!!
N*****************************************************************************/
Nvoid Gpio_swire_output(uint8_t flag, uint8_t num)
N{
N	uint8_t ii;
N
N	if (flag)
N	{
N		if (flag ==2)
N		{
N			hal_gpio_init_output(IO_PAD_AP_SWIRE, IO_LVL_HIGH);	  
N			delayMs(2);
N		}
N		for (ii =0; ii< num; ii++)
N		{
N			hal_gpio_set_output_data(IO_PAD_AP_SWIRE, IO_LVL_LOW);
N			delayUs(10);
N			hal_gpio_set_output_data(IO_PAD_AP_SWIRE, IO_LVL_HIGH);
N			delayUs(9);
N		}
N	}
N	else
N	{
N		hal_gpio_init_output(IO_PAD_AP_SWIRE, IO_LVL_LOW);	  
N	}
N}
N
N
N
N/**
N* @brief  ap enter sleep mode处理函数
N* @param  handler：rx_ctrl_handle
N*         dcs_packet: dcs 命令
N* @retval true/false
N*/
Nstatic bool ap_dcs_set_enter_sleep_mode(hal_dsi_rx_ctrl_handle_t *handler, hal_dcs_packet_t *dcs_packet)
Xstatic _Bool ap_dcs_set_enter_sleep_mode(hal_dsi_rx_ctrl_handle_t *handler, hal_dcs_packet_t *dcs_packet)
N{	
N#if 1
N//	delayMs(12); 
N	hal_dsi_tx_ctrl_write_cmd(0x05, 0, 1, 0x28);
N	delayMs(80);  //40
N//	hal_dsi_tx_ctrl_write_cmd(0x05, 0, 1, 0x10);	
N//	delayMs(80); //80
N	hal_gpio_init_output(SWIRE_EN, IO_LVL_LOW);
X	hal_gpio_init_output(( IO_PIN_17 ), IO_LVL_LOW);
N	hal_timer_deinit(SOFT_SWIRE_TIMER);
X	hal_timer_deinit(( TIMER_NUM3 ));
N	hal_timer_stop(SOFT_SWIRE_TIMER);	
X	hal_timer_stop(( TIMER_NUM3 ));	
N	    /* FIXME set tear on*/
N    hal_dsi_tx_ctrl_set_tear_mode(g_tx_ctrl_handle, TE_STOP_MODE);
N	delayMs(41);
N	hal_dsi_tx_ctrl_write_cmd(0x05, 0, 1, 0x10);
N    delayMs(20);	
N	    /* AVDD_EN close*/
N	 hal_gpio_init_output( AVDD_EN, IO_LVL_LOW ); //  SWIRE close 
X	 hal_gpio_init_output( ( IO_PIN_15 ), IO_LVL_LOW ); 
N#if AP_SWIRE_OUTPUT
X#if 0
S    /* Swire close */
S   hal_swire_enable(false);
N#endif
N#endif
N    /* Wait AP reset down*/
N //   hal_gpio_set_ap_reset_int(ENABLE, ap_rstn_pull_down_cb, DETECT_LOW_LVL);
N// TAU_LOGD("enter sleep mode\n");
N// delayMs(500);
N    return true;
X    return 1;
N}
N
N/**
N* @brief  ap exit sleep mode处理函数
N* @param  handler：rx_ctrl_handle
N*         dcs_packet: dcs 命令
N* @retval true/false
N*/
Nstatic bool ap_dcs_set_exit_sleep_mode(hal_dsi_rx_ctrl_handle_t *handler, hal_dcs_packet_t *dcs_packet)
Xstatic _Bool ap_dcs_set_exit_sleep_mode(hal_dsi_rx_ctrl_handle_t *handler, hal_dcs_packet_t *dcs_packet)
N{
N//#if AP_SWIRE_OUTPUT
N//    /* AVDD 上电, 用于解决息屏开屏PPS不更新问题 */
N    hal_gpio_set_output_data(AVDD_EN, IO_LVL_HIGH);
X    hal_gpio_set_output_data(( IO_PIN_15 ), IO_LVL_HIGH);
N//#endif
N
N#if TX_START_AFTER_APRST
X#if 0
S    if (panel_display_done == false)
S    {
S        sg_tx_start_in_process = true;
S    }
N#endif
N
N    TAU_LOGD("exit sleep mode \n");
X    do { tau_log_printf(kLOG_LEVEL_DBG, "[%s] (%04d) " "exit sleep mode \n", "p6a", 400); } while (0);
N
N    return true;
X    return 1;
N}
N
N
N
N/**
N* @brief  调光处理函数
N* @param  handler：rx_ctrl_handle
N*         dcs_packet: dcs 命令
N* @retval true/false
N*/
N
Nuint8_t value_51H,value_51L;
Nstatic bool reg53_E8_fg=0;
Xstatic _Bool reg53_E8_fg=0;
Nstatic bool ap_dcs_set_backlight(hal_dsi_rx_ctrl_handle_t *handler, hal_dcs_packet_t *dcs_packet)
Xstatic _Bool ap_dcs_set_backlight(hal_dsi_rx_ctrl_handle_t *handler, hal_dcs_packet_t *dcs_packet)
N{	
N	//手机端0x04~7FF(2043) 映射0xFFF
N#if 0
S	value_51H = dcs_packet->packet_param[0];
S	value_51L = dcs_packet->packet_param[1];
S	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 3, 0x51, value_51H, value_51L);
N#else
N		rd_51_val = dcs_packet->packet_param[0];
N	rd_51_val <<=8;
N	rd_51_val |= dcs_packet->packet_param[1];
N
N//	rd_51_val2 = (rd_51_val-0x04)*4091/2043+0x04;   //0xFFF max
N	if(rd_51_val == 0x00) {
N	
N	  rd_51_val2 = 0x04; 
N	
N	}
N	else if((rd_51_val >0x00)&&(rd_51_val <= 0x7FF) ){
N	
N	  rd_51_val2 = (rd_51_val-0x04)*4091/2043+0x04;   //0xFFF max
N	
N	}
N	else if(rd_51_val >=0x7FF) {
N	
N	  rd_51_val2 = 0xFFF; 
N	
N	}
N		hal_dsi_tx_ctrl_write_cmd(0x39, 0, 3, 0x51, rd_51_val2>>8, rd_51_val2&0x00FF);
N#endif
N//	 TAU_LOGD("AP_51[0x%04X],IC_51[0x%04X]\n",rd_51_val,rd_51_val2);	
N    return true;
X    return 1;
N}
N
N#if RX_WAIT_TEAR_ON
X#if 0
S/**
S* @brief  ap set tear on 处理函数
S* @param  handler：rx_ctrl_handle
S*         dcs_packet: dcs 命令
S* @retval true/false
S*/
Sstatic bool ap_dcs_set_tear_on(hal_dsi_rx_ctrl_handle_t *handler, hal_dcs_packet_t *dcs_packet)
S{
S    TAU_LOGD("ap_set_tear_on\n");
S    sg_ap_set_tear_on = true;
S    if (panel_display_done == false)
S    {
S        TAU_LOGD("gen a tear\n");
S        hal_dsi_tx_ctrl_gen_a_tear_signal();
S    }
S    else
S    {
S        hal_dsi_tx_ctrl_set_tear_mode(g_tx_ctrl_handle, TE_60HZ_MODE);
S    }
S    return true;
S}
S
S/**
S* @brief  ap set tear off 处理函数
S* @param  handler：rx_ctrl_handle
S*         dcs_packet: dcs 命令
S* @retval true/false
S*/
Sstatic bool ap_dcs_set_tear_off(hal_dsi_rx_ctrl_handle_t *handler, hal_dcs_packet_t *dcs_packet)
S{
S    TAU_LOGD("ap_set_tear_off \n");
S    sg_ap_set_tear_on = false;
S    hal_dsi_tx_ctrl_set_tear_mode(g_tx_ctrl_handle, TE_USER_MODE);
S    return true;
S}
N#endif
N
N/**
N* @brief  护眼模式回调函数
N* @param  rx_ctrl_handle: dsi rx handle;
N*         dcs packet: dcs_packet
N* @retval true/false
N*/
Nstatic bool ap_dcs_set_exit_idle_mode(hal_dsi_rx_ctrl_handle_t *handler, hal_dcs_packet_t *dcs_packet)
Xstatic _Bool ap_dcs_set_exit_idle_mode(hal_dsi_rx_ctrl_handle_t *handler, hal_dcs_packet_t *dcs_packet)
N{
N    sg_exit_idle_mode_flag = true;
X    sg_exit_idle_mode_flag = 1;
N    hal_dsi_rx_ctrl_set_hw_cmd_filter(g_rx_ctrl_handle, HAL_RX_DCS_FILTER_B, 0x2C, 0x2C);
N    TAU_LOGD("exit idle mode,skip 0x2C\n");
X    do { tau_log_printf(kLOG_LEVEL_DBG, "[%s] (%04d) " "exit idle mode,skip 0x2C\n", "p6a", 498); } while (0);
N    return true;
X    return 1;
N}
N
N#define TE_TIMER    TIMER_NUM2
Nstatic void soft_te_timer_cb(void *data)
N{
N    /*
N        S8 的屏接的是TP1.8V, AC 启动后需要等到TP1.8 起来后再初始化屏, 所以在TP 起来前需要通过软件产生TE给手机，避免手机卡死
N    */
N//    if (panel_display_done == false)
N//    {
N        hal_dsi_tx_ctrl_gen_a_tear_signal();
N        hal_timer_start(TE_TIMER, 16, soft_te_timer_cb, NULL);
X        hal_timer_start(TIMER_NUM2, 16, soft_te_timer_cb, 0);
N//    }
N//    else
N//    {
N//        hal_dsi_rx_ctrl_set_hw_tear_mode(g_rx_ctrl_handle);
N//    }
N}
N
Nstatic void soft_te_timer_init()
N{
N//    TAU_LOGD("soft_te_timer_init");
N    hal_dsi_tx_ctrl_set_tear_mode(g_tx_ctrl_handle,TE_USER_MODE);
N    hal_timer_init(TE_TIMER);
X    hal_timer_init(TIMER_NUM2);
N    hal_timer_start(TE_TIMER, 1, soft_te_timer_cb, NULL);
X    hal_timer_start(TIMER_NUM2, 1, soft_te_timer_cb, 0);
N}
N
N/**
N* @brief  帧率切换处理函数
N* @param  handler：rx_ctrl_handle
N*         dcs_packet: dcs 命令
N* @retval true/false
N*/
Nstatic bool ap_dcs_set_frame_change(hal_dsi_rx_ctrl_handle_t *handler, hal_dcs_packet_t *dcs_packet)
Xstatic _Bool ap_dcs_set_frame_change(hal_dsi_rx_ctrl_handle_t *handler, hal_dcs_packet_t *dcs_packet)
N{
N    if (dcs_packet->param_length == 1)
N    {
N        if (dcs_packet->packet_param[0] == 0x01)
N        {
N		//	hal_dsi_tx_ctrl_set_tear_mode(g_tx_ctrl_handle,TE_USER_MODE);
N            hal_dsi_tx_ctrl_set_tear_mode(g_tx_ctrl_handle, TE_60HZ_MODE);
N        }
N        else 
N        {
N		//	soft_te_timer_init();
N           hal_dsi_tx_ctrl_set_tear_mode(g_tx_ctrl_handle, TE_120HZ_MODE);
N        }
N    }
N//    TAU_LOGD("frame_change %x ,size %d, data %d\n", dcs_packet->dcs_command, dcs_packet->param_length, dcs_packet->packet_param[0]);
N    return true;
X    return 1;
N}
N
Nstatic bool ap_set_FPS_53(hal_dsi_rx_ctrl_handle_t *handler, hal_dcs_packet_t *dcs_packet)
Xstatic _Bool ap_set_FPS_53(hal_dsi_rx_ctrl_handle_t *handler, hal_dcs_packet_t *dcs_packet)
N{
N	uint8_t value_b1 =0;	
N	
N    value_b1 =  dcs_packet->packet_param[0]; 
N
N	if(value_b1 == 0x38)  // AP FPS ON
N	{
N    if(rd_51_val2>=0x88F){ //DFF
N         hal_dsi_tx_ctrl_write_cmd( 0x39, 0, 4, 0x97, 0x11, 0x8F,0xFF);   // DDIC FPS ON
N	}
N//	else if((rd_51_val >0xBFF)&&(rd_51_val <= 0xDFF) ){
N//         hal_dsi_tx_ctrl_write_cmd( 0x39, 0, 4, 0x97, 0x11, 0x8E,0xAF);   // DDIC FPS ON
N//	}
N//	 else if((rd_51_val >0xA8F)&&(rd_51_val <= 0xBFF) ){
N//         hal_dsi_tx_ctrl_write_cmd( 0x39, 0, 4, 0x97, 0x11, 0x8C,0xFF);   // DDIC FPS ON
N//	}
N//	  else if((rd_51_val >0x88F)&&(rd_51_val <= 0xA8F) ){
N//         hal_dsi_tx_ctrl_write_cmd( 0x39, 0, 4, 0x97, 0x11, 0x8B,0xFF);   // DDIC FPS ON
N//	}
N	  else if((rd_51_val >0x6FF)&&(rd_51_val <= 0x88F) ){
N         hal_dsi_tx_ctrl_write_cmd( 0x39, 0, 4, 0x97, 0x11, 0x89,0x8F);   // DDIC FPS ON
N	}
N	 else if((rd_51_val >0x4FF)&&(rd_51_val <= 0x6FF) ){
N         hal_dsi_tx_ctrl_write_cmd( 0x39, 0, 4, 0x97, 0x11, 0x86,0xFF);   // DDIC FPS ON
N	}
N	 else{
N         hal_dsi_tx_ctrl_write_cmd( 0x39, 0, 4, 0x97,0x11, 0x83,0xFF);   // DDIC FPS ON
N	}
N	}
N	else if(value_b1 == 0x28)  // AP FPS OFF
N	{
N
N  //       hal_dsi_tx_ctrl_write_cmd( 0x39, 0, 4, 0x97, 0x00, (rd_51_val2>>8), rd_51_val2&0xFF);// DDIC FPS OFF
N    if(rd_51_val2>=0xDFF){
N         hal_dsi_tx_ctrl_write_cmd( 0x39, 0, 4, 0x97, 0x00, 0x0F,0xFF);   // DDIC FPS OFF
N	}
N	else if((rd_51_val >0xBFF)&&(rd_51_val <= 0xDFF) ){
N         hal_dsi_tx_ctrl_write_cmd( 0x39, 0, 4, 0x97, 0x00, 0x0D,0x8F);  
N	}
N	 else if((rd_51_val >0xA8F)&&(rd_51_val <= 0xBFF) ){
N         hal_dsi_tx_ctrl_write_cmd( 0x39, 0, 4, 0x97, 0x00, 0x0B,0x8F);  
N	}
N	  else if((rd_51_val >0x88F)&&(rd_51_val <= 0xA8F) ){
N         hal_dsi_tx_ctrl_write_cmd( 0x39, 0, 4, 0x97, 0x00, 0x09,0xFF);  
N	}
N	  else if((rd_51_val >0x6FF)&&(rd_51_val <= 0x88F) ){
N         hal_dsi_tx_ctrl_write_cmd( 0x39, 0, 4, 0x97, 0x00, 0x07,0x8F);  
N	}
N	 else if((rd_51_val >0x4FF)&&(rd_51_val <= 0x6FF) ){
N         hal_dsi_tx_ctrl_write_cmd( 0x39, 0, 4, 0x97, 0x00, 0x05,0xFF);  
N	}
N	 else{
N         hal_dsi_tx_ctrl_write_cmd( 0x39, 0, 4, 0x97,0x00, 0x02,0xFF);   
N	}
N        
N	}
N
N//   	TAU_LOGD("REG53[%x]", value_b1);
N    return true;
X    return 1;
N}
N
N
N/*************************DCS 命令处理函数 END*************************/
N
N/* 客制化DCS command 处理函数表格 */
Nstatic const hal_dcs_execute_entry_t g_cus_rx_dcs_execute_table[] =
N{
N    {DCS_SET_DISPLAY_ON, ap_dcs_set_display_on, false},
X    {DCS_SET_DISPLAY_ON, ap_dcs_set_display_on, 0},
N    {DCS_SET_DISPLAY_OFF, ap_dcs_set_display_off, true},
X    {DCS_SET_DISPLAY_OFF, ap_dcs_set_display_off, 1},
N    {0x51, ap_dcs_set_backlight, true},
X    {0x51, ap_dcs_set_backlight, 1},
N	{0x53, ap_set_FPS_53, true},  //B1
X	{0x53, ap_set_FPS_53, 1},  
N    {DCS_ENTER_SLEEP_MODE, ap_dcs_set_enter_sleep_mode, true},
X    {DCS_ENTER_SLEEP_MODE, ap_dcs_set_enter_sleep_mode, 1},
N    {DCS_EXIT_SLEEP_MODE, ap_dcs_set_exit_sleep_mode, true},
X    {DCS_EXIT_SLEEP_MODE, ap_dcs_set_exit_sleep_mode, 1},
N//   {0x60, ap_dcs_set_frame_change, true},
N#if RX_WAIT_TEAR_ON
X#if 0
S    {DCS_SET_TEAR_ON, ap_dcs_set_tear_on, true},
S    {DCS_SET_TEAR_OFF, ap_dcs_set_tear_off, true},
N#endif
N  //  {0x38, ap_dcs_set_exit_idle_mode, true},
N    {0, NULL, false}                        //{0,NULL,false} 数组最后一个固定成员，作为table结尾的判断标准
X    {0, 0, 0}                        
N};
N
N/**
N* @brief  panel reset
N* @param  none
N* @retval none
N*/
Nstatic void app_tx_panel_reset(void)
N{
N#if SHARE_FLASH_ENABLE
X#if 0
S    hal_flash_share_mode(true);
N#endif
N    hal_gpio_set_output_data(IO_PAD_TD_RSTN, IO_LVL_HIGH);
N    delayMs(10);
N    hal_gpio_set_output_data(IO_PAD_TD_RSTN, IO_LVL_LOW);
N    delayMs(10);
N    hal_gpio_set_output_data(IO_PAD_TD_RSTN, IO_LVL_HIGH);
N//		hal_gpio_init_output(AVDD_EN, IO_LVL_HIGH);	
N    delayMs(50);
N
N}
N
Nstatic void send_panel_init_code(uint32_t size, uint8_t* data)
N{
N    uint32_t data_offeset = 0;
N    uint8_t data_type;
N    uint8_t vc;
N    uint8_t data_size;
N    uint8_t* p_data;
N
N    while(data_offeset < size)
N    {
N        data_type = data[data_offeset];
N        vc = data[data_offeset + 1];
N        data_size = data[data_offeset + 2];
N        p_data = &data[data_offeset + 3];
N        hal_dsi_tx_ctrl_write_array_cmd(data_type, vc, data_size, p_data);
N        data_offeset = data_offeset + data_size + 3;
N        delayUs( 100 );
N    }
N}
N
Nconst uint8_t panel_init_code[] =
N{
N0x39, 0, 3, 0x9C, 0xA5, 0xA5,
N0x39, 0, 3, 0xFD, 0x5A, 0x5A,
N0x39, 0, 2, 0x9F, 0x0F,
N0x39, 0, 2, 0xB3, 0x00,	
N0x39, 0, 2, 0x9F, 0x01,
N0x39, 0, 4, 0xB2, 0x51, 0x04, 0x69,
N0x39, 0, 36, 0xB3, 0x01, 0x6F, 0x00, 0x0A, 0x2E, 0x00, 0x01, 0x6F, 0x00, 0x0A, 0x2E, 0x00, 0x01, 0x6F, 0x00, 0x0A, 0x2E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x6F, 0x00, 0x0A, 0x14, 0x44, 0x1C, 0x1C, 0x1C, 0x18, 0x1C,
N0x39, 0, 3, 0xD9, 0x01, 0x1F,
N0x39, 0, 4, 0xCF, 0x01, 0x00, 0x00,
N0x39, 0, 2, 0xD0, 0x01,
N0x39, 0, 2, 0xD3, 0x00,
N0x39, 0, 2, 0xD5, 0x03,
N0x39, 0, 2, 0x9F, 0x02,
N0x39, 0, 26, 0xB2, 0x00, 0xC1, 0x32, 0x10, 0x11, 0x12, 0x12, 0x00, 0x08, 0x78, 0x21, 0x11, 0x14, 0x13, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x21, 0x21, 0x11, 0x1A,	//power sequence
N0x39, 0, 2, 0xB3, 0x0B,
N0x39, 0, 14, 0xB4, 0x00, 0x00, 0x8F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,  
N0x39, 0, 7, 0xB5, 0x00, 0x2F, 0x2F, 0x2F, 0x2F, 0x2F,
N0x39, 0, 20, 0xB6, 0x01, 0x00, 0x00, 0x11, 0x11, 0x11, 0x1C, 0x08, 0x1C, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21,
N0x39, 0, 17, 0xB7, 0x00, 0x10, 0x15, 0x12, 0x10, 0x15, 0x00, 0x06, 0x03, 0x03, 0x06, 0x03, 0x03, 0x06, 0x03, 0x03,	
N0x39, 0, 14, 0xB8, 0x00, 0x00, 0x00, 0x73, 0x2D, 0x73, 0x2D, 0x73, 0x2D, 0x73, 0x2D, 0x73, 0x2D,
N0x39, 0, 9, 0xB9, 0x00, 0x00, 0x50, 0x00, 0x00, 0x17, 0x17, 0x00,
N0x39, 0, 9, 0xBA, 0x08, 0xFF, 0x36, 0x03, 0x36, 0x03, 0x11, 0x01,
N0x39, 0, 26, 0xBB, 0x00, 0xCD, 0x0F, 0xC3, 0x64, 0x00, 0xCD, 0x0F, 0xC3, 0x64, 0x00, 0xCD, 0x0F, 0xC3, 0x64, 0x00, 0xCD, 0x0F, 0xC3, 0x64, 0x00, 0xCD, 0x64, 0x6E, 0x64,
N0x39, 0, 6, 0xBE, 0x5F, 0x16, 0x04, 0x5F, 0x75,
N0x39, 0, 6, 0xBF, 0x08, 0x00, 0x10, 0x10, 0x08,
N0x39, 0, 17, 0xC1, 0x23, 0x00, 0x24, 0x00, 0x05, 0x00, 0x3D, 0x21, 0x00, 0x3D, 0x00, 0x01, 0x00, 0x3D, 0x00, 0x22,
N0x39, 0, 17, 0xC2, 0x23, 0x00, 0x24, 0x00, 0x05, 0x00, 0x3D, 0x21, 0x00, 0x3D, 0x00, 0x01, 0x00, 0x3D, 0x00, 0x22,
N0x39, 0, 8, 0xC3, 0x11, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00,
N0x39, 0, 17, 0xC4, 0x00, 0x05, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, 0x1f, 0x00, 0x00, 0x08,
N0x39, 0, 27, 0xC5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
N0x39, 0, 27, 0xC6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x05, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, 0x55, 0x00, 0x01, 0x00,
N0x39, 0, 14, 0xC7, 0x00, 0x1A, 0x25, 0x24, 0x20, 0x00, 0x24, 0x20, 0x24, 0x20, 0x00, 0x20, 0x20,
N0x39, 0, 14, 0xC8, 0x00, 0x35, 0x1A, 0x20, 0x20, 0x00, 0x20, 0x20, 0x20, 0x20, 0x00, 0x00, 0x00,
N0x39, 0, 27, 0xC9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
N0x39, 0, 27, 0xCA, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
N0x39, 0, 27, 0xCB, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
N0x39, 0, 27, 0xCC, 0x04, 0x3A, 0x3B, 0x1A, 0xCD, 0x00, 0x1A, 0xCD, 0x1A, 0xCD, 0x00, 0x44, 0xBF, 0x00, 0x19, 0xBA, 0x20, 0x68, 0x00, 0x24, 0x68, 0x00, 0x00, 0x00, 0x24, 0x6B,
N0x39, 0, 25, 0xCD, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
N0x39, 0, 25, 0xCE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
N0x39, 0, 25, 0xCF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
N0x39, 0, 25, 0xD0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
N0x39, 0, 25, 0xD1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
N0x39, 0, 17, 0xD2, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x09, 0x00, 0x00, 0x09, 0x00, 0x00, 0x09, 0x00, 0x00, 0x09, 0x00,
N0x39, 0, 17, 0xD3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
N0x39, 0, 15, 0xD7, 0x44, 0x01, 0x3F, 0x24, 0x56, 0x24, 0x56, 0x01, 0x11, 0x99, 0x0A, 0x00, 0x00, 0x03,
N0x39, 0, 26, 0xD8, 0x00, 0x00, 0xC5, 0x9F, 0x40, 0x00, 0x00, 0xC5, 0x9F, 0x40, 0x00, 0x00, 0xC5, 0x9F, 0x40, 0x00, 0x00, 0xC5, 0x9F, 0x40, 0x00, 0x00, 0xC5, 0x00, 0x00,
N0x39, 0, 12, 0xD9, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
N0x39, 0, 6, 0xE1, 0x00, 0x00, 0x00, 0x00, 0x00,
N0x39, 0, 26, 0xE2, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
N0x39, 0, 13, 0xE3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
N0x39, 0, 9, 0xE7, 0x80, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x22,
N0x39, 0, 12, 0xEE, 0x00, 0x00, 0x00, 0xBB, 0x58, 0x08, 0xA2, 0x50, 0x88, 0x88, 0x29,
N0x39, 0, 6, 0xEF, 0x00, 0x80, 0x82, 0x80, 0x85,
N0x39, 0, 2, 0x9F, 0x03,
N0x39, 0, 33, 0xB2, 0x11, 0x00, 0x00, 0x89, 0x30, 0x80, 0x09, 0x60, 0x04, 0x38, 0x00, 0x0C, 0x04, 0x38, 0x04, 0x38, 0x02, 0x00, 0x03, 0x1C, 0x00, 0x20, 0x01, 0x7E, 0x00, 0x0F, 0x00, 0x0C, 0x08, 0xBB, 0x04, 0x3D,
N0x39, 0, 33, 0xB3, 0x18, 0x00, 0x10, 0xF0, 0x03, 0x0C, 0x20, 0x00, 0x06, 0x0B, 0x0B, 0x33, 0x0E, 0x1C, 0x2A, 0x38, 0x46, 0x54, 0x62, 0x69, 0x70, 0x77, 0x79, 0x7B, 0x7D, 0x7E, 0x01, 0x02, 0x01, 0x00, 0x09, 0x40,
N0x39, 0, 25, 0xB4, 0x09, 0xBE, 0x19, 0xFC, 0x19, 0xFA, 0x19, 0xF8, 0x1A, 0x38, 0x1A, 0x78, 0x1A, 0xB6, 0x2A, 0xF6, 0x2B, 0x34, 0x2B, 0x74, 0x3B, 0x74, 0x6B, 0xF4,
N0x39, 0, 2, 0xC0, 0x11,
N0x39, 0, 2, 0x9F, 0x04,
N0x39, 0, 3, 0xB2, 0x01, 0x80,
N0x39, 0, 19, 0xB3, 0x00, 0x00, 0x10, 0x00, 0x30, 0x50, 0x00, 0x70, 0x90, 0x00, 0xB0, 0xF0, 0x11, 0x30, 0x70, 0x12, 0xF0, 0xF0,
N0x39, 0, 21, 0xB4, 0x34, 0xF0, 0xF0, 0x56, 0xF0, 0xF0, 0x78, 0xF0, 0xF0, 0xAB, 0xF0, 0xF0, 0xCD, 0xF0, 0xF0, 0xEF, 0xF0, 0xF0, 0x0F, 0xFF,
N0x39, 0, 7, 0xB6, 0x11, 0x00, 0x00, 0x0F, 0xF0, 0x10,
N0x39, 0, 3, 0xBA, 0x10, 0x00,
N0x39, 0, 5, 0xC4, 0x00, 0x10, 0x00, 0x00,
N0x39, 0, 20, 0xC5, 0x00, 0x20, 0x88, 0xC1, 0xB2, 0xB2, 0x32, 0x00, 0x4E, 0x56, 0x35, 0x22, 0x22, 0x2A, 0x05, 0x3F, 0x00, 0x20, 0x0F,
N0x39, 0, 13, 0xC6, 0x4B, 0x00, 0x90, 0x00, 0x02, 0xD5, 0x00, 0x02, 0xCB, 0x01, 0x10, 0x43,
N0x39, 0, 5, 0xC8, 0x2B, 0x2B, 0x00, 0x00,
N0x39, 0, 21, 0xC9, 0x0D, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x23, 0x23, 0x23, 0x23, 0x23, 0x23, 0x23, 0x23, 0x1F, 0x1F,
N0x39, 0, 21, 0xCA, 0x0D, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x23, 0x23, 0x23, 0x23, 0x23, 0x23, 0x23, 0x23, 0x1F, 0x1F,
N0x39, 0, 21, 0xCB, 0x0D, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x23, 0x23, 0x23, 0x23, 0x23, 0x23, 0x23, 0x23, 0x1F, 0x1F,
N0x39, 0, 21, 0xCC, 0x0D, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x23, 0x23, 0x23, 0x23, 0x23, 0x23, 0x23, 0x23, 0x1F, 0x1F,
N0x39, 0, 21, 0xCD, 0x21, 0x21, 0x21, 0x21, 0x21, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x1C, 0x1C,
N0x39, 0, 21, 0xCE, 0x21, 0x21, 0x21, 0x21, 0x21, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x1C, 0x1C,
N0x39, 0, 21, 0xCF, 0x21, 0x21, 0x21, 0x21, 0x21, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x1C, 0x1C,
N0x39, 0, 21, 0xD0, 0x21, 0x21, 0x21, 0x21, 0x21, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x1C, 0x1C,
N0x39, 0, 21, 0xD1, 0x21, 0x21, 0x21, 0x21, 0x21, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x1C, 0x1C,
N0x39, 0, 21, 0xD2, 0x21, 0x21, 0x21, 0x21, 0x21, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x1C, 0x1C,
N0x39, 0, 21, 0xD3, 0x21, 0x21, 0x21, 0x21, 0x21, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x1C, 0x1C,
N0x39, 0, 21, 0xD4, 0x21, 0x21, 0x21, 0x21, 0x21, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x1C, 0x1C,
N0x39, 0, 14, 0xB5, 0x11, 0x17, 0x27, 0x1C, 0xd0, 0x00, 0x64, 0x64, 0x00, 0x16, 0xD1, 0x89, 0x0B,
N0x39, 0, 10, 0xF8, 0x3E, 0xAA, 0xAA, 0x00, 0x00, 0x00, 0x00, 0x00, 0xAA,
N0x39, 0, 10, 0xF9, 0xE3, 0x00, 0x00, 0x00, 0xBB, 0xBB, 0xDD, 0x00, 0x00,
N0x39, 0, 10, 0xFA, 0x3E, 0xAA, 0xAA, 0x00, 0x00, 0x00, 0x00, 0x00, 0xAA,
N0x39, 0, 2, 0xB9, 0x90,
N0x39, 0, 2, 0x9F, 0x05,
N0x39, 0, 7, 0xB2, 0x24, 0x20, 0x05, 0x0F, 0xFF, 0xFF,
N0x39, 0, 9, 0xB3, 0xA0, 0x00, 0x28, 0x00, 0x00, 0x00, 0x3F, 0xFF,
N0x39, 0, 13, 0xB4, 0x00, 0x60, 0x0E, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x66, 0x8F,
N0x39, 0, 21, 0xB5, 0x0F, 0xFF, 0x07, 0xFF, 0x03, 0x33, 0x01, 0x47, 0x01, 0x46, 0x00, 0xC0, 0x00, 0x62, 0x00, 0x31, 0x00, 0x18, 0x00, 0x08,
N0x39, 0, 21, 0xB6, 0x0F, 0xFF, 0x07, 0xFF, 0x03, 0x33, 0x00, 0x00, 0x0F, 0xFF, 0x07, 0xFF, 0x03, 0x33, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00,
N0x39, 0, 16, 0xB9, 0x71, 0x20, 0x05, 0x78, 0x70, 0x5A, 0x3C, 0x78, 0x70, 0x5A, 0x3C, 0x78, 0x70, 0x5A, 0x3C,
N0x39, 0, 2, 0x9F, 0x06,
N0x39, 0, 41, 0xB2, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
N0x39, 0, 41, 0xB3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
N0x39, 0, 21, 0xB4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
N0x39, 0, 41, 0xB5, 0x01, 0xFF, 0x01, 0xFF, 0x01, 0xFF, 0x01, 0xFF, 0x01, 0xFF, 0x01, 0xFF, 0x01, 0xFF, 0x01, 0xFF, 0x01, 0xFF, 0x01, 0xFF, 0x01, 0xFF, 0x01, 0xFF, 0x01, 0xFF, 0x01, 0xFF, 0x01, 0xFF, 0x01, 0xFF, 0x01, 0xFF, 0x01, 0xFF, 0x01, 0xFF, 0x01, 0xFF,
N0x39, 0, 41, 0xB6, 0x01, 0xFF, 0x01, 0xFF, 0x01, 0xFF, 0x01, 0xFF, 0x01, 0xFF, 0x01, 0xFF, 0x01, 0xFF, 0x01, 0xFF, 0x01, 0xFF, 0x01, 0xFF, 0x01, 0xFF, 0x01, 0xFF, 0x01, 0xFF, 0x01, 0xFF, 0x01, 0xFF, 0x01, 0xFF, 0x01, 0xFF, 0x01, 0xFF, 0x01, 0xFF, 0x01, 0xFF,
N0x39, 0, 21, 0xB7, 0x01, 0xFF, 0x01, 0xFF, 0x01, 0xFF, 0x01, 0xFF, 0x01, 0xFF, 0x01, 0xFF, 0x01, 0xFF, 0x01, 0xFF, 0x01, 0xFF, 0x01, 0xFF,
N0x39, 0, 2, 0x9F, 0x04,
N0x39, 0, 19, 0xB3, 0x00, 0x00, 0x10, 0x00, 0x30, 0x50, 0x00, 0x70, 0xF0, 0x11, 0x70, 0xF0, 0x23, 0xF0, 0xF0, 0x46, 0xF0, 0xF0,
N0x39, 0, 21, 0xB4, 0x8A, 0xF0, 0xF0, 0xCE, 0xF0, 0xF0, 0xFF, 0xF0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0xFF,
N0x39, 0, 2, 0x9F, 0x05,
N0x39, 0, 21, 0xB5, 0x0F, 0xFF, 0x07, 0xFF, 0x03, 0x33, 0x01, 0x47, 0x01, 0x46, 0x00, 0xCD, 0x00, 0x66, 0x00, 0x3A, 0x00, 0x14, 0x00, 0x08,
N0x39, 0, 21, 0xB6, 0x0F, 0xFF, 0x07, 0xFF, 0x03, 0x33, 0x00, 0x00, 0x0F, 0xFE, 0x07, 0x5F, 0x01, 0x64, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00,
N0x39, 0, 2, 0x9F, 0x05,
N0x39, 0, 2, 0xF9, 0x80,
N0x39, 0, 4, 0xFF, 0x00, 0x00, 0x01,
N0x39, 0, 2, 0x9F, 0x06,
N0x39, 0, 3, 0xFF, 0x00, 0x01,
N0x39, 0, 5, 0xFE, 0x01, 0x00, 0x00, 0x00,
N0x39, 0, 22, 0xF1, 0x00, 0x00, 0x01, 0x00, 0x02, 0x03, 0x02, 0x04, 0xBD, 0x33, 0x62, 0xD5, 0x44, 0x7E, 0xFC, 0x56, 0x69, 0x1C, 0x67, 0xAD, 0x30,
N0x39, 0, 18, 0xF2, 0x78, 0xA5, 0x17, 0x88, 0x4E, 0x4E, 0x88, 0x4E, 0x4E, 0x88, 0x4E, 0x4E, 0x88, 0x4E, 0x4E, 0x80, 0x4E,
N0x39, 0, 22, 0xF3, 0x00, 0x00, 0x01, 0x00, 0x02, 0x03, 0x02, 0xD5, 0x9D, 0x33, 0x31, 0x9F, 0x44, 0x3D, 0xB5, 0x55, 0x1D, 0xC3, 0x66, 0x4E, 0xC7,
N0x39, 0, 18, 0xF4, 0x77, 0x33, 0x9B, 0x77, 0xCE, 0xCE, 0x77, 0xCE, 0xCE, 0x77, 0xCE, 0xCE, 0x77, 0xCE, 0xCE, 0x70, 0xCE,
N0x39, 0, 22, 0xF5, 0x12, 0xAB, 0x0F, 0x22, 0x10, 0x11, 0x23, 0x89, 0x8C, 0x44, 0x25, 0x9D, 0x55, 0x4E, 0xD6, 0x67, 0x4D, 0x0B, 0x78, 0xAC, 0x3D,
N0x39, 0, 18, 0xF6, 0x89, 0xC1, 0x3E, 0x99, 0x7C, 0x7C, 0x99, 0x7C, 0x7C, 0x99, 0x7C, 0x7C, 0x99, 0x7C, 0x7C, 0x90, 0x7C,
N0x39, 0, 2, 0xFF, 0x01,
N0x39, 0, 5, 0xFE, 0x01, 0x01, 0x00, 0x00,
N0x39, 0, 22, 0xF1, 0x00, 0x00, 0x01, 0x00, 0x02, 0x03, 0x02, 0x04, 0x4B, 0x33, 0x05, 0x76, 0x44, 0x19, 0x92, 0x45, 0xF5, 0x9A, 0x66, 0x20, 0x93,
N0x39, 0, 18, 0xF2, 0x67, 0xFB, 0x5C, 0x77, 0x8C, 0x8C, 0x77, 0x8C, 0x8C, 0x77, 0x8C, 0x8C, 0x77, 0x8C, 0x8C, 0x70, 0x8C,
N0x39, 0, 22, 0xF3, 0x00, 0x00, 0x01, 0x00, 0x02, 0x03, 0x02, 0x04, 0x3E, 0x23, 0xDD, 0x45, 0x34, 0xDF, 0x51, 0x45, 0xAF, 0x49, 0x56, 0xC6, 0x33,
N0x39, 0, 18, 0xF4, 0x66, 0x97, 0xF0, 0x77, 0x1B, 0x1B, 0x77, 0x1B, 0x1B, 0x77, 0x1B, 0x1B, 0x77, 0x1B, 0x1B, 0x70, 0x1B,
N0x39, 0, 22, 0xF5, 0x11, 0x51, 0xB5, 0x11, 0xB6, 0xB7, 0x23, 0x35, 0x35, 0x34, 0xCD, 0x3C, 0x45, 0xE2, 0x63, 0x56, 0xCF, 0x7F, 0x77, 0x10, 0x90,
N0x39, 0, 18, 0xF6, 0x88, 0x04, 0x6D, 0x88, 0xA2, 0xA2, 0x88, 0xA2, 0xA2, 0x88, 0xA2, 0xA2, 0x88, 0xA2, 0xA2, 0x80, 0xA2,
N0x39, 0, 2, 0xFF, 0x01,
N0x39, 0, 5, 0xFE, 0x01, 0x02, 0x00, 0x00,
N0x39, 0, 22, 0xF1, 0x00, 0x00, 0x01, 0x00, 0x02, 0x03, 0x01, 0x04, 0x71, 0x23, 0x9F, 0x14, 0x34, 0xB3, 0x27, 0x45, 0x86, 0x1E, 0x56, 0x97, 0x02,
N0x39, 0, 18, 0xF2, 0x66, 0x60, 0xB4, 0x66, 0xDF, 0xDF, 0x66, 0xDF, 0xDF, 0x66, 0xDF, 0xDF, 0x66, 0xDF, 0xDF, 0x60, 0xDF,
N0x39, 0, 22, 0xF3, 0x00, 0x00, 0x01, 0x00, 0x02, 0x03, 0x01, 0x04, 0xC4, 0x22, 0x81, 0xEB, 0x33, 0x7F, 0xEC, 0x44, 0x44, 0xD2, 0x55, 0x47, 0xAA,
N0x39, 0, 18, 0xF4, 0x66, 0x04, 0x54, 0x66, 0x7A, 0x7A, 0x66, 0x7A, 0x7A, 0x66, 0x7A, 0x7A, 0x66, 0x7A, 0x7A, 0x60, 0x7A,
N0x39, 0, 22, 0xF5, 0x00, 0x20, 0x84, 0x00, 0x85, 0x86, 0x12, 0xCD, 0xE1, 0x33, 0x72, 0xDE, 0x44, 0x7B, 0xF2, 0x55, 0x57, 0xF9, 0x66, 0x7E, 0xEF,
N0x39, 0, 18, 0xF6, 0x77, 0x56, 0xB5, 0x77, 0xE2, 0xE2, 0x77, 0xE2, 0xE2, 0x77, 0xE2, 0xE2, 0x77, 0xE2, 0xE2, 0x70, 0xE2,
N0x39, 0, 2, 0xFF, 0x01,
N0x39, 0, 5, 0xFE, 0x01, 0x03, 0x00, 0x00,
N0x39, 0, 22, 0xF1, 0x00, 0x00, 0x01, 0x00, 0x02, 0x03, 0x00, 0x04, 0x05, 0x12, 0x8B, 0x66, 0x33, 0x14, 0x85, 0x34, 0xDE, 0x65, 0x45, 0xD2, 0x2D,
N0x39, 0, 18, 0xF2, 0x55, 0x7E, 0xC9, 0x55, 0xEA, 0xEA, 0x55, 0xEA, 0xEA, 0x55, 0xEA, 0xEA, 0x55, 0xEA, 0xEA, 0x50, 0xEA,
N0x39, 0, 22, 0xF3, 0x00, 0x00, 0x01, 0x00, 0x02, 0x03, 0x00, 0x04, 0x05, 0x12, 0xCB, 0x53, 0x23, 0xEB, 0x51, 0x34, 0xA3, 0x24, 0x44, 0x8D, 0xE2,
N0x39, 0, 18, 0xF4, 0x55, 0x30, 0x74, 0x55, 0x95, 0x95, 0x55, 0x95, 0x95, 0x55, 0x95, 0x95, 0x55, 0x95, 0x95, 0x50, 0x95,
N0x39, 0, 22, 0xF5, 0x00, 0x00, 0x3D, 0x00, 0x3E, 0x3F, 0x02, 0x40, 0x52, 0x23, 0xE3, 0x4A, 0x34, 0xDE, 0x4B, 0x45, 0xA3, 0x33, 0x56, 0xA8, 0x0E,
N0x39, 0, 18, 0xF6, 0x66, 0x63, 0xB2, 0x66, 0xD8, 0xD8, 0x66, 0xD8, 0xD8, 0x66, 0xD8, 0xD8, 0x66, 0xD8, 0xD8, 0x60, 0xD8,
N0x39, 0, 2, 0xFF, 0x01,
N0x39, 0, 5, 0xFE, 0x01, 0x04, 0x00, 0x00,
N0x39, 0, 22, 0xF1, 0x00, 0x00, 0x01, 0x00, 0x02, 0x03, 0x00, 0x04, 0x05, 0x02, 0x65, 0x47, 0x33, 0x25, 0xA4, 0x44, 0x08, 0x9E, 0x55, 0x13, 0x78,
N0x39, 0, 18, 0xF2, 0x56, 0xD2, 0x22, 0x66, 0x48, 0x48, 0x66, 0x48, 0x48, 0x66, 0x48, 0x48, 0x66, 0x48, 0x48, 0x60, 0x48,
N0x39, 0, 22, 0xF3, 0x00, 0x00, 0x01, 0x00, 0x02, 0x03, 0x00, 0x04, 0x05, 0x02, 0xAC, 0x07, 0x23, 0xE2, 0x64, 0x34, 0xC5, 0x56, 0x45, 0xC7, 0x25,
N0x39, 0, 18, 0xF4, 0x55, 0x7A, 0xC7, 0x55, 0xE9, 0xE9, 0x55, 0xE9, 0xE9, 0x55, 0xE9, 0xE9, 0x55, 0xE9, 0xE9, 0x50, 0xE9,
N0x39, 0, 22, 0xF5, 0x00, 0x00, 0x3A, 0x00, 0x3B, 0x3C, 0x02, 0x3D, 0x27, 0x23, 0xE3, 0x5F, 0x44, 0x04, 0x7E, 0x45, 0xE0, 0x7C, 0x56, 0xFB, 0x67,
N0x39, 0, 18, 0xF6, 0x67, 0xC6, 0x1E, 0x77, 0x44, 0x44, 0x77, 0x44, 0x44, 0x77, 0x44, 0x44, 0x77, 0x44, 0x44, 0x70, 0x44,
N0x39, 0, 2, 0xFF, 0x01,	
N0x39, 0, 5, 0xFE, 0x01, 0x05, 0x00, 0x00,
N0x39, 0, 22, 0xF1, 0x00, 0x00, 0x01, 0x00, 0x02, 0x03, 0x00, 0x04, 0x05, 0x00, 0x06, 0x07, 0x23, 0x09, 0x39, 0x34, 0xC6, 0x78, 0x45, 0xFB, 0x64,
N0x39, 0, 18, 0xF2, 0x56, 0xC3, 0x16, 0x66, 0x3E, 0x3E, 0x66, 0x3E, 0x3E, 0x66, 0x3E, 0x3E, 0x66, 0x3E, 0x3E, 0x60, 0x3E,
N0x39, 0, 22, 0xF3, 0x00, 0x00, 0x01, 0x00, 0x02, 0x03, 0x00, 0x04, 0x05, 0x00, 0x06, 0x07, 0x23, 0x6E, 0x25, 0x34, 0x9D, 0x3F, 0x45, 0xB6, 0x1C,
N0x39, 0, 18, 0xF4, 0x55, 0x72, 0xC1, 0x55, 0xE5, 0xE5, 0x55, 0xE5, 0xE5, 0x55, 0xE5, 0xE5, 0x55, 0xE5, 0xE5, 0x50, 0xE5,
N0x39, 0, 22, 0xF5, 0x00, 0x00, 0x01, 0x00, 0x02, 0x03, 0x00, 0x04, 0x05, 0x12, 0xE5, 0xF9, 0x34, 0xD7, 0x61, 0x45, 0xCB, 0x6F, 0x56, 0xF2, 0x62,
N0x39, 0, 18, 0xF6, 0x67, 0xC2, 0x18, 0x77, 0x41, 0x41, 0x77, 0x41, 0x41, 0x77, 0x41, 0x41, 0x77, 0x41, 0x41, 0x70, 0x41,
N0x39, 0, 2, 0xFF, 0x01,
N0x39, 0, 5, 0xFE, 0x01, 0x06, 0x00, 0x00,
N0x39, 0, 22, 0xF1, 0x00, 0x00, 0x01, 0x00, 0x02, 0x03, 0x00, 0x04, 0x05, 0x00, 0x06, 0x07, 0x01, 0x08, 0xE6, 0x34, 0x26, 0x18, 0x45, 0xAA, 0x1B,
N0x39, 0, 18, 0xF2, 0x55, 0x7C, 0xD2, 0x55, 0xFC, 0xFC, 0x55, 0xFC, 0xFC, 0x55, 0xFC, 0xFC, 0x55, 0xFC, 0xFC, 0x50, 0xFC,
N0x39, 0, 22, 0xF3, 0x00, 0x00, 0x01, 0x00, 0x02, 0x03, 0x00, 0x04, 0x05, 0x00, 0x06, 0x07, 0x02, 0x3D, 0x75, 0x33, 0x21, 0xE7, 0x44, 0x6C, 0xD4,
N0x39, 0, 18, 0xF4, 0x55, 0x30, 0x81, 0x55, 0xA6, 0xA6, 0x55, 0xA6, 0xA6, 0x55, 0xA6, 0xA6, 0x55, 0xA6, 0xA6, 0x50, 0xA6,
N0x39, 0, 22, 0xF5, 0x00, 0x00, 0x01, 0x00, 0x02, 0x03, 0x00, 0x04, 0x05, 0x11, 0xC9, 0xCA, 0x34, 0x64, 0x0F, 0x45, 0x82, 0x30, 0x56, 0xB9, 0x29,
N0x39, 0, 18, 0xF6, 0x66, 0x8A, 0xDD, 0x77, 0x06, 0x06, 0x77, 0x06, 0x06, 0x77, 0x06, 0x06, 0x77, 0x06, 0x06, 0x70, 0x06,
N0x39, 0, 2, 0xFF, 0x01,
N0x39, 0, 5, 0xFE, 0x01, 0x07, 0x00, 0x00,
N0x39, 0, 22, 0xF1, 0x00, 0x00, 0x01, 0x00, 0x02, 0x03, 0x00, 0x04, 0x05, 0x00, 0x06, 0x07, 0x00, 0x08, 0x09, 0x13, 0x7B, 0x9B, 0x44, 0x56, 0xD3,
N0x39, 0, 18, 0xF2, 0x55, 0x3E, 0x9B, 0x55, 0xC5, 0xC5, 0x55, 0xC5, 0xC5, 0x55, 0xC5, 0xC5, 0x55, 0xC5, 0xC5, 0x50, 0xC5,
N0x39, 0, 22, 0xF3, 0x00, 0x00, 0x01, 0x00, 0x02, 0x03, 0x00, 0x04, 0x05, 0x00, 0x06, 0x07, 0x00, 0x08, 0xDC, 0x23, 0x6F, 0x83, 0x44, 0x21, 0x93,
N0x39, 0, 18, 0xF4, 0x45, 0xF4, 0x4E, 0x55, 0x73, 0x73, 0x55, 0x73, 0x73, 0x55, 0x73, 0x73, 0x55, 0x73, 0x73, 0x50, 0x73,
N0x39, 0, 22, 0xF5, 0x00, 0x00, 0x01, 0x00, 0x02, 0x03, 0x00, 0x04, 0x05, 0x00, 0x06, 0x07, 0x33, 0x17, 0xAE, 0x44, 0x3A, 0xF9, 0x55, 0x8B, 0xFF,
N0x39, 0, 18, 0xF6, 0x66, 0x62, 0xB8, 0x66, 0xE0, 0xE0, 0x66, 0xE0, 0xE0, 0x66, 0xE0, 0xE0, 0x66, 0xE0, 0xE0, 0x60, 0xE0,
N0x39, 0, 2, 0xFF, 0x01,
N0x39, 0, 5, 0xFE, 0x01, 0x08, 0x00, 0x00,
N0x39, 0, 22, 0xF1, 0x00, 0x00, 0x01, 0x00, 0x02, 0x03, 0x00, 0x04, 0x05, 0x00, 0x06, 0x07, 0x00, 0x08, 0x09, 0x00, 0x0A, 0x0B, 0x23, 0xB5, 0xAF,
N0x39, 0, 18, 0xF2, 0x44, 0x38, 0xA1, 0x44, 0xCD, 0xCD, 0x44, 0xCD, 0xCD, 0x44, 0xCD, 0xCD, 0x44, 0xCD, 0xCD, 0x40, 0xCD,
N0x39, 0, 22, 0xF3, 0x00, 0x00, 0x01, 0x00, 0x02, 0x03, 0x00, 0x04, 0x05, 0x00, 0x06, 0x07, 0x00, 0x08, 0x09, 0x01, 0x0A, 0xC0, 0x23, 0xF3, 0x98,
N0x39, 0, 18, 0xF4, 0x44, 0x0C, 0x65, 0x44, 0x8F, 0x8F, 0x44, 0x8F, 0x8F, 0x44, 0x8F, 0x8F, 0x44, 0x8F, 0x8F, 0x40, 0x8F,
N0x39, 0, 22, 0xF5, 0x00, 0x00, 0x01, 0x00, 0x02, 0x03, 0x00, 0x04, 0x05, 0x00, 0x06, 0x07, 0x01, 0x08, 0x82, 0x34, 0x2E, 0x12, 0x45, 0xB0, 0x2C,
N0x39, 0, 18, 0xF6, 0x55, 0x93, 0xEC, 0x66, 0x13, 0x13, 0x66, 0x13, 0x13, 0x66, 0x13, 0x13, 0x66, 0x13, 0x13, 0x60, 0x13,
N0x39, 0, 2, 0xFF, 0x01,
N0x39, 0, 5, 0xFE, 0x01, 0x09, 0x00, 0x00,
N0x39, 0, 22, 0xF1, 0x00, 0x00, 0x01, 0x00, 0x02, 0x03, 0x00, 0x04, 0x05, 0x00, 0x06, 0x07, 0x00, 0x08, 0x09, 0x00, 0x0A, 0x0B, 0x00, 0x0C, 0x0D,
N0x39, 0, 18, 0xF2, 0x23, 0x73, 0x5A, 0x33, 0xA3, 0xA3, 0x33, 0xA3, 0xA3, 0x33, 0xA3, 0xA3, 0x33, 0xA3, 0xA3, 0x30, 0xA3,
N0x39, 0, 22, 0xF3, 0x00, 0x00, 0x01, 0x00, 0x02, 0x03, 0x00, 0x04, 0x05, 0x00, 0x06, 0x07, 0x00, 0x08, 0x09, 0x00, 0x0A, 0x0B, 0x02, 0x0C, 0x0A,
N0x39, 0, 18, 0xF4, 0x23, 0xDC, 0x60, 0x33, 0x94, 0x94, 0x33, 0x94, 0x94, 0x33, 0x94, 0x94, 0x33, 0x94, 0x94, 0x30, 0x94,
N0x39, 0, 22, 0xF5, 0x00, 0x00, 0x01, 0x00, 0x02, 0x03, 0x00, 0x04, 0x05, 0x00, 0x06, 0x07, 0x00, 0x08, 0x09, 0x03, 0x0A, 0x03, 0x34, 0xBB, 0x51,
N0x39, 0, 18, 0xF6, 0x45, 0xBE, 0x1D, 0x55, 0x47, 0x47, 0x55, 0x47, 0x47, 0x55, 0x47, 0x47, 0x55, 0x47, 0x47, 0x50, 0x47,
N0x39, 0, 2, 0xFF, 0x01,
N0x39, 0, 2, 0x9F, 0x05,
N0x39, 0, 2, 0xF9, 0x00,
N0x39, 0, 4, 0xFF, 0x00, 0x00, 0x00,
N0x39, 0, 2, 0x9F, 0x06,
N0x39, 0, 3, 0xFF, 0x00, 0x00,
N0x39, 0, 2, 0x9F, 0x07,
N0x39, 0, 8, 0xB2, 0x10, 0x20, 0x20, 0x20, 0x02, 0x00, 0x99,
N0x39, 0, 8, 0xB3, 0x10, 0x10, 0x10, 0x10, 0x02, 0x00, 0x99,
N0x39, 0, 8, 0xB4, 0x10, 0x10, 0x10, 0x10, 0x02, 0x00, 0x99,
N0x39, 0, 8, 0xB5, 0x10, 0x10, 0x10, 0x10, 0x02, 0x00, 0x99,
N0x39, 0, 8, 0xB6, 0x04, 0x04, 0x04, 0x04, 0x02, 0x02, 0x64,
N0x39, 0, 8, 0xB7, 0x10, 0x10, 0x10, 0x10, 0x02, 0x00, 0x99,
N0x39, 0, 8, 0xB8, 0x10, 0x10, 0x10, 0x10, 0x02, 0x00, 0x99,
N0x39, 0, 17, 0xB9, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10,
N0x39, 0, 17, 0xBA, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10,
N0x39, 0, 17, 0xBB, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10,
N0x39, 0, 17, 0xBC, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10,
N0x39, 0, 17, 0xBD, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10,
N0x39, 0, 17, 0xBE, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10,
N0x39, 0, 17, 0xBF, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10,
N0x39, 0, 16, 0xC0, 0x00, 0x99, 0x99, 0x00, 0x99, 0x99, 0x00, 0x64, 0x3F, 0x00, 0x25, 0x17, 0x00, 0x10, 0x0C,
N0x39, 0, 16, 0xC1, 0x00, 0x99, 0x99, 0x00, 0x99, 0x99, 0x00, 0x64, 0x3F, 0x00, 0x25, 0x17, 0x00, 0x10, 0x0C,
N0x39, 0, 16, 0xC2, 0x00, 0x99, 0x99, 0x00, 0x99, 0x99, 0x00, 0x64, 0x3F, 0x00, 0x25, 0x17, 0x00, 0x10, 0x0C,
N0x39, 0, 16, 0xC3, 0x00, 0x99, 0x99, 0x00, 0x99, 0x99, 0x00, 0x64, 0x3F, 0x00, 0x25, 0x17, 0x00, 0x10, 0x0C,
N0x39, 0, 7, 0xC4, 0x22, 0x58, 0x58, 0x22, 0x58, 0x58,
N0x39, 0, 7, 0xC5, 0x00, 0x99, 0x99, 0x00, 0x99, 0x99,
N0x39, 0, 4, 0xC6, 0x00, 0xC8, 0xC8,
N0x39, 0, 2, 0x9F, 0x0F,
N0x39, 0, 2, 0xF8, 0x00,
N0x39, 0, 2, 0x9F, 0x0A,
N0x39, 0, 8, 0xB2, 0x1F, 0x00, 0x00, 0x20, 0x01, 0x10, 0x00,
N0x39, 0, 46, 0xB8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, 0x00, 0x10, 0x10, 0x00, 0x00, 0x10, 0x10, 0x00, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0x00, 0x00,
N0x39, 0, 43, 0xB9, 0x00, 0x00, 0x00, 0x00, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0x00, 0x00,
N0x39, 0, 43, 0xBA, 0x10, 0x10, 0x00, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, 0x00, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0x00, 0x00,
N0x39, 0, 2, 0x9F, 0x0B,
N0x15, 0, 9, 0xB2, 0x01, 0x2F, 0x4F, 0x00, 0x00, 0x00, 0x00, 0x00,
N0x15, 0, 54, 0xB9, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x70, 0x24, 0x0A, 0x6A, 0x13, 0x9A, 0xFA, 0x48, 0x14, 0xDA, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
N0x15, 0, 54, 0xBA, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x20, 0x20, 0x0A, 0x32, 0x00, 0x00, 0x00, 0x48, 0x38, 0xE8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
N0x15, 0, 20, 0xC8, 0x0F, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x08, 0x08, 0x08, 0x08, 0x00, 0x80, 0x80, 0x80, 0x80,	
N0x39, 0, 2, 0x48, 0x03,         
N0x39, 0, 3, 0x51, 0x00, 0x00,
N0x39, 0, 2, 0x53, 0xE0,
N0x39, 0, 1, 0x35,
N//0x39, 0, 3, 0x51, 0x03, 0x40
N};
N
N/**
N* @brief  panel init
N* @param  none
N* @retval none
N*/
Nstatic void app_init_panel(void)
N{
N    /* reset panel*/
N    app_tx_panel_reset();
N//	 send_panel_init_code( sizeof( panel_init_code ), panel_init_code );
N
N#if 1
N//2023-12-11
N    //#######Initial Code Start#########
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 3, 0x9C, 0xA5, 0xA5);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 3, 0xFD, 0x5A, 0x5A);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 2, 0x9F, 0x0F);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 2, 0xB3, 0x00);	//OTP Reload Enable
N	//##========================Group 1 Timing=============================
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 2, 0x9F, 0x01);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 4, 0xB2, 0x51, 0x04, 0x69);	//1044*2260 6.0
N	////NOR:60Hz
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 36, 0xB3, 0x01, 0x6F, 0x00, 0x0A, 0x2E, 0x00, 0x01, 0x6F, 0x00, 0x0A, 0x2E, 0x00, 0x01, 0x6F, 0x00, 0x0A, 0x2E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x6F, 0x00, 0x0A, 0x14, 0x44, 0x1C, 0x1C, 0x1C, 0x18, 0x1C);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 3, 0xD9, 0x01, 0x1F);	//For demura MEM and MIPI
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 4, 0xCF, 0x01, 0x00, 0x00);	//AOD MEM no reset
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 2, 0xD0, 0x01);		//TMC MODE
N//    hal_dsi_tx_ctrl_write_cmd(0x39, 0, 2, 0xD3, 0x01);	// command mode 0x01
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 2, 0xD3, 0x00);		// video mode 需要关闭 encoder 3x disable
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 2, 0xD5, 0x03);		// video mode RAM bypass
N	//##========================Group 2 PWR&GOA=============================
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 2, 0x9F, 0x02);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 26, 0xB2, 0x00, 0xC1, 0x32, 0x10, 0x11, 0x12, 0x12, 0x00, 0x08, 0x78, 0x21, 0x11, 0x14, 0x13, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x21, 0x21, 0x11, 0x1A);	//power sequence
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 2, 0xB3, 0x0B);   //OSC128 & OSC155 Enable
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 14, 0xB4, 0x00, 0x00, 0x8F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00); //VDD_EXT_CONT=1,VDD_VEXT_SEL=00(1.15V)0A(1.1)0F(1.05) VDDL=1.15V  
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 7, 0xB5, 0x00, 0x2F, 0x2F, 0x2F, 0x2F, 0x2F);    //VGH=7.7V setting  20220825
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 20, 0xB6, 0x01, 0x00, 0x00, 0x11, 0x11, 0x11, 0x1C, 0x08, 0x1C, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21);
N//	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 17, 0xB7, 0x00, 0x10, 0x00, 0x12, 0x10, 0x15, 0x00, 0x06, 0x06, 0x07, 0x06, 0x06, 0x07, 0x06, 0x06, 0x07);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 17, 0xB7, 0x00, 0x10, 0x15, 0x12, 0x10, 0x15, 0x00, 0x06, 0x03, 0x03, 0x06, 0x03, 0x03, 0x06, 0x03, 0x03);
N	
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 14, 0xB8, 0x00, 0x00, 0x00, 0x73, 0x2D, 0x73, 0x2D, 0x73, 0x2D, 0x73, 0x2D, 0x73, 0x2D);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 9, 0xB9, 0x00, 0x00, 0x50, 0x00, 0x00, 0x17, 0x17, 0x00);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 9, 0xBA, 0x08, 0xFF, 0x36, 0x03, 0x36, 0x03, 0x11, 0x01);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 26, 0xBB, 0x00, 0xCD, 0x0F, 0xC3, 0x64, 0x00, 0xCD, 0x0F, 0xC3, 0x64, 0x00, 0xCD, 0x0F, 0xC3, 0x64, 0x00, 0xCD, 0x0F, 0xC3, 0x64, 0x00, 0xCD, 0x64, 0x6E, 0x64);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 6, 0xBE, 0x5F, 0x16, 0x04, 0x5F, 0x75);  //IP Gating ON/Off
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 6, 0xBF, 0x08, 0x00, 0x10, 0x10, 0x08);  //TE 60 Porch
N    //##========================GOA & SOURCE Fixed by Pinchao=============================
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 17, 0xC1, 0x23, 0x00, 0x24, 0x00, 0x05, 0x00, 0x3D, 0x21, 0x00, 0x3D, 0x00, 0x01, 0x00, 0x3D, 0x00, 0x22);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 17, 0xC2, 0x23, 0x00, 0x24, 0x00, 0x05, 0x00, 0x3D, 0x21, 0x00, 0x3D, 0x00, 0x01, 0x00, 0x3D, 0x00, 0x22);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 8, 0xC3, 0x11, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 17, 0xC4, 0x00, 0x05, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, 0x1f, 0x00, 0x00, 0x08);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 27, 0xC5, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 27, 0xC6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x05, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, 0x55, 0x00, 0x01, 0x00);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 14, 0xC7, 0x00, 0x1A, 0x25, 0x24, 0x20, 0x00, 0x24, 0x20, 0x24, 0x20, 0x00, 0x20, 0x20);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 14, 0xC8, 0x00, 0x35, 0x1A, 0x20, 0x20, 0x00, 0x20, 0x20, 0x20, 0x20, 0x00, 0x00, 0x00);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 27, 0xC9, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 27, 0xCA, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 27, 0xCB, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);
N	//hal_dsi_tx_ctrl_write_cmd(0x39, 0, 27, 0xCC, 0x04, 0x1A, 0x1B, 0x1A, 0xCD, 0x00, 0x1A, 0xCD, 0x1A, 0xCD, 0x00, 0x24, 0x9F, 0x00, 0x19, 0xBA, 0x20, 0x68, 0x00, 0x24, 0x68, 0x00, 0x00, 0x00, 0x24, 0x6B);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 27, 0xCC, 0x04, 0x3A, 0x3B, 0x1A, 0xCD, 0x00, 0x1A, 0xCD, 0x1A, 0xCD, 0x00, 0x44, 0xBF, 0x00, 0x19, 0xBA, 0x20, 0x68, 0x00, 0x24, 0x68, 0x00, 0x00, 0x00, 0x24, 0x6B);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 25, 0xCD, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 25, 0xCE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 25, 0xCF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 25, 0xD0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 25, 0xD1, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);
N//    hal_dsi_tx_ctrl_write_cmd(0x39, 0, 25, 0xD1, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x00, 0x00, 0x00, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x00, 0x00);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 17, 0xD2, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x09, 0x00, 0x00, 0x09, 0x00, 0x00, 0x09, 0x00, 0x00, 0x09, 0x00);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 17, 0xD3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 15, 0xD7, 0x44, 0x01, 0x3F, 0x24, 0x56, 0x24, 0x56, 0x01, 0x11, 0x99, 0x0A, 0x00, 0x00, 0x03);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 26, 0xD8, 0x00, 0x00, 0xC5, 0x9F, 0x40, 0x00, 0x00, 0xC5, 0x9F, 0x40, 0x00, 0x00, 0xC5, 0x9F, 0x40, 0x00, 0x00, 0xC5, 0x9F, 0x40, 0x00, 0x00, 0xC5, 0x00, 0x00);
N//	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 12, 0xD9, 0x10, 0x00, 0x33, 0x00, 0x33, 0x00, 0x33, 0x00, 0x33, 0x00, 0x30);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 12, 0xD9, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);
N	
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 6, 0xE1, 0x00, 0x00, 0x00, 0x00, 0x00);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 26, 0xE2, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 13, 0xE3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 9, 0xE7, 0x80, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x22);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 12, 0xEE, 0x00, 0x00, 0x00, 0xBB, 0x58, 0x08, 0xA2, 0x50, 0x88, 0x88, 0x29);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 6, 0xEF, 0x00, 0x80, 0x82, 0x80, 0x85);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 2, 0x9F, 0x03);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 33, 0xB2, 0x11, 0x00, 0x00, 0x89, 0x30, 0x80, 0x09, 0x60, 0x04, 0x38, 0x00, 0x0C, 0x04, 0x38, 0x04, 0x38, 0x02, 0x00, 0x03, 0x1C, 0x00, 0x20, 0x01, 0x7E, 0x00, 0x0F, 0x00, 0x0C, 0x08, 0xBB, 0x04, 0x3D);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 33, 0xB3, 0x18, 0x00, 0x10, 0xF0, 0x03, 0x0C, 0x20, 0x00, 0x06, 0x0B, 0x0B, 0x33, 0x0E, 0x1C, 0x2A, 0x38, 0x46, 0x54, 0x62, 0x69, 0x70, 0x77, 0x79, 0x7B, 0x7D, 0x7E, 0x01, 0x02, 0x01, 0x00, 0x09, 0x40);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 25, 0xB4, 0x09, 0xBE, 0x19, 0xFC, 0x19, 0xFA, 0x19, 0xF8, 0x1A, 0x38, 0x1A, 0x78, 0x1A, 0xB6, 0x2A, 0xF6, 0x2B, 0x34, 0x2B, 0x74, 0x3B, 0x74, 0x6B, 0xF4);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 2, 0xC0, 0x11);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 2, 0x9F, 0x04);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 3, 0xB2, 0x01, 0x80);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 19, 0xB3, 0x00, 0x00, 0x10, 0x00, 0x30, 0x50, 0x00, 0x70, 0x90, 0x00, 0xB0, 0xF0, 0x11, 0x30, 0x70, 0x12, 0xF0, 0xF0);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 21, 0xB4, 0x34, 0xF0, 0xF0, 0x56, 0xF0, 0xF0, 0x78, 0xF0, 0xF0, 0xAB, 0xF0, 0xF0, 0xCD, 0xF0, 0xF0, 0xEF, 0xF0, 0xF0, 0x0F, 0xFF);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 7, 0xB6, 0x11, 0x00, 0x00, 0x0F, 0xF0, 0x10);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 3, 0xBA, 0x10, 0x00);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 5, 0xC4, 0x00, 0x10, 0x00, 0x00);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 20, 0xC5, 0x00, 0x20, 0x88, 0xC1, 0xB2, 0xB2, 0x32, 0x00, 0x4E, 0x56, 0x35, 0x22, 0x22, 0x2A, 0x05, 0x3F, 0x00, 0x20, 0x0F);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 13, 0xC6, 0x4B, 0x00, 0x90, 0x00, 0x02, 0xD5, 0x00, 0x02, 0xCB, 0x01, 0x10, 0x43);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 5, 0xC8, 0x2B, 0x2B, 0x00, 0x00);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 21, 0xC9, 0x0D, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x23, 0x23, 0x23, 0x23, 0x23, 0x23, 0x23, 0x23, 0x1F, 0x1F);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 21, 0xCA, 0x0D, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x23, 0x23, 0x23, 0x23, 0x23, 0x23, 0x23, 0x23, 0x1F, 0x1F);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 21, 0xCB, 0x0D, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x23, 0x23, 0x23, 0x23, 0x23, 0x23, 0x23, 0x23, 0x1F, 0x1F);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 21, 0xCC, 0x0D, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x23, 0x23, 0x23, 0x23, 0x23, 0x23, 0x23, 0x23, 0x1F, 0x1F);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 21, 0xCD, 0x21, 0x21, 0x21, 0x21, 0x21, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x1C, 0x1C);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 21, 0xCE, 0x21, 0x21, 0x21, 0x21, 0x21, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x1C, 0x1C);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 21, 0xCF, 0x21, 0x21, 0x21, 0x21, 0x21, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x1C, 0x1C);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 21, 0xD0, 0x21, 0x21, 0x21, 0x21, 0x21, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x1C, 0x1C);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 21, 0xD1, 0x21, 0x21, 0x21, 0x21, 0x21, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x1C, 0x1C);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 21, 0xD2, 0x21, 0x21, 0x21, 0x21, 0x21, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x1C, 0x1C);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 21, 0xD3, 0x21, 0x21, 0x21, 0x21, 0x21, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x1C, 0x1C);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 21, 0xD4, 0x21, 0x21, 0x21, 0x21, 0x21, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x21, 0x1C, 0x1C);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 14, 0xB5, 0x11, 0x17, 0x27, 0x1C, 0xd0, 0x00, 0x64, 0x64, 0x00, 0x16, 0xD1, 0x89, 0x0B);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 10, 0xF8, 0x3E, 0xAA, 0xAA, 0x00, 0x00, 0x00, 0x00, 0x00, 0xAA);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 10, 0xF9, 0xE3, 0x00, 0x00, 0x00, 0xBB, 0xBB, 0xDD, 0x00, 0x00);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 10, 0xFA, 0x3E, 0xAA, 0xAA, 0x00, 0x00, 0x00, 0x00, 0x00, 0xAA);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 2, 0xB9, 0x90);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 2, 0x9F, 0x05);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 7, 0xB2, 0x24, 0x20, 0x05, 0x0F, 0xFF, 0xFF);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 9, 0xB3, 0xA0, 0x00, 0x28, 0x00, 0x00, 0x00, 0x3F, 0xFF);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 13, 0xB4, 0x00, 0x60, 0x0E, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x66, 0x8F);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 21, 0xB5, 0x0F, 0xFF, 0x07, 0xFF, 0x03, 0x33, 0x01, 0x47, 0x01, 0x46, 0x00, 0xC0, 0x00, 0x62, 0x00, 0x31, 0x00, 0x18, 0x00, 0x08);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 21, 0xB6, 0x0F, 0xFF, 0x07, 0xFF, 0x03, 0x33, 0x00, 0x00, 0x0F, 0xFF, 0x07, 0xFF, 0x03, 0x33, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 16, 0xB9, 0x71, 0x20, 0x05, 0x78, 0x70, 0x5A, 0x3C, 0x78, 0x70, 0x5A, 0x3C, 0x78, 0x70, 0x5A, 0x3C);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 2, 0x9F, 0x06);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 41, 0xB2, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 41, 0xB3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 21, 0xB4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 41, 0xB5, 0x01, 0xFF, 0x01, 0xFF, 0x01, 0xFF, 0x01, 0xFF, 0x01, 0xFF, 0x01, 0xFF, 0x01, 0xFF, 0x01, 0xFF, 0x01, 0xFF, 0x01, 0xFF, 0x01, 0xFF, 0x01, 0xFF, 0x01, 0xFF, 0x01, 0xFF, 0x01, 0xFF, 0x01, 0xFF, 0x01, 0xFF, 0x01, 0xFF, 0x01, 0xFF, 0x01, 0xFF);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 41, 0xB6, 0x01, 0xFF, 0x01, 0xFF, 0x01, 0xFF, 0x01, 0xFF, 0x01, 0xFF, 0x01, 0xFF, 0x01, 0xFF, 0x01, 0xFF, 0x01, 0xFF, 0x01, 0xFF, 0x01, 0xFF, 0x01, 0xFF, 0x01, 0xFF, 0x01, 0xFF, 0x01, 0xFF, 0x01, 0xFF, 0x01, 0xFF, 0x01, 0xFF, 0x01, 0xFF, 0x01, 0xFF);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 21, 0xB7, 0x01, 0xFF, 0x01, 0xFF, 0x01, 0xFF, 0x01, 0xFF, 0x01, 0xFF, 0x01, 0xFF, 0x01, 0xFF, 0x01, 0xFF, 0x01, 0xFF, 0x01, 0xFF);
N
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 2, 0x9F, 0x04);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 19, 0xB3, 0x00, 0x00, 0x10, 0x00, 0x30, 0x50, 0x00, 0x70, 0xF0, 0x11, 0x70, 0xF0, 0x23, 0xF0, 0xF0, 0x46, 0xF0, 0xF0);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 21, 0xB4, 0x8A, 0xF0, 0xF0, 0xCE, 0xF0, 0xF0, 0xFF, 0xF0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0F, 0xFF);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 2, 0x9F, 0x05);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 21, 0xB5, 0x0F, 0xFF, 0x07, 0xFF, 0x03, 0x33, 0x01, 0x47, 0x01, 0x46, 0x00, 0xCD, 0x00, 0x66, 0x00, 0x3A, 0x00, 0x14, 0x00, 0x08);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 21, 0xB6, 0x0F, 0xFF, 0x07, 0xFF, 0x03, 0x33, 0x00, 0x00, 0x0F, 0xFE, 0x07, 0x5F, 0x01, 0x64, 0x00, 0x00, 0x0F, 0xFF, 0x00, 0x00);
N
N	//--------------------------------------------------------------
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 2, 0x9F, 0x05);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 2, 0xF9, 0x80);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 4, 0xFF, 0x00, 0x00, 0x01);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 2, 0x9F, 0x06);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 3, 0xFF, 0x00, 0x01);
N	//--------------------------------------------------------------
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 5, 0xFE, 0x01, 0x00, 0x00, 0x00);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 22, 0xF1, 0x00, 0x00, 0x01, 0x00, 0x02, 0x03, 0x02, 0x04, 0xBD, 0x33, 0x62, 0xD5, 0x44, 0x7E, 0xFC, 0x56, 0x69, 0x1C, 0x67, 0xAD, 0x30);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 18, 0xF2, 0x78, 0xA5, 0x17, 0x88, 0x4E, 0x4E, 0x88, 0x4E, 0x4E, 0x88, 0x4E, 0x4E, 0x88, 0x4E, 0x4E, 0x80, 0x4E);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 22, 0xF3, 0x00, 0x00, 0x01, 0x00, 0x02, 0x03, 0x02, 0xD5, 0x9D, 0x33, 0x31, 0x9F, 0x44, 0x3D, 0xB5, 0x55, 0x1D, 0xC3, 0x66, 0x4E, 0xC7);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 18, 0xF4, 0x77, 0x33, 0x9B, 0x77, 0xCE, 0xCE, 0x77, 0xCE, 0xCE, 0x77, 0xCE, 0xCE, 0x77, 0xCE, 0xCE, 0x70, 0xCE);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 22, 0xF5, 0x12, 0xAB, 0x0F, 0x22, 0x10, 0x11, 0x23, 0x89, 0x8C, 0x44, 0x25, 0x9D, 0x55, 0x4E, 0xD6, 0x67, 0x4D, 0x0B, 0x78, 0xAC, 0x3D);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 18, 0xF6, 0x89, 0xC1, 0x3E, 0x99, 0x7C, 0x7C, 0x99, 0x7C, 0x7C, 0x99, 0x7C, 0x7C, 0x99, 0x7C, 0x7C, 0x90, 0x7C);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 2, 0xFF, 0x01);
N	delayMs(1);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 5, 0xFE, 0x01, 0x01, 0x00, 0x00);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 22, 0xF1, 0x00, 0x00, 0x01, 0x00, 0x02, 0x03, 0x02, 0x04, 0x4B, 0x33, 0x05, 0x76, 0x44, 0x19, 0x92, 0x45, 0xF5, 0x9A, 0x66, 0x20, 0x93);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 18, 0xF2, 0x67, 0xFB, 0x5C, 0x77, 0x8C, 0x8C, 0x77, 0x8C, 0x8C, 0x77, 0x8C, 0x8C, 0x77, 0x8C, 0x8C, 0x70, 0x8C);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 22, 0xF3, 0x00, 0x00, 0x01, 0x00, 0x02, 0x03, 0x02, 0x04, 0x3E, 0x23, 0xDD, 0x45, 0x34, 0xDF, 0x51, 0x45, 0xAF, 0x49, 0x56, 0xC6, 0x33);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 18, 0xF4, 0x66, 0x97, 0xF0, 0x77, 0x1B, 0x1B, 0x77, 0x1B, 0x1B, 0x77, 0x1B, 0x1B, 0x77, 0x1B, 0x1B, 0x70, 0x1B);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 22, 0xF5, 0x11, 0x51, 0xB5, 0x11, 0xB6, 0xB7, 0x23, 0x35, 0x35, 0x34, 0xCD, 0x3C, 0x45, 0xE2, 0x63, 0x56, 0xCF, 0x7F, 0x77, 0x10, 0x90);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 18, 0xF6, 0x88, 0x04, 0x6D, 0x88, 0xA2, 0xA2, 0x88, 0xA2, 0xA2, 0x88, 0xA2, 0xA2, 0x88, 0xA2, 0xA2, 0x80, 0xA2);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 2, 0xFF, 0x01);
N	delayMs(1);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 5, 0xFE, 0x01, 0x02, 0x00, 0x00);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 22, 0xF1, 0x00, 0x00, 0x01, 0x00, 0x02, 0x03, 0x01, 0x04, 0x71, 0x23, 0x9F, 0x14, 0x34, 0xB3, 0x27, 0x45, 0x86, 0x1E, 0x56, 0x97, 0x02);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 18, 0xF2, 0x66, 0x60, 0xB4, 0x66, 0xDF, 0xDF, 0x66, 0xDF, 0xDF, 0x66, 0xDF, 0xDF, 0x66, 0xDF, 0xDF, 0x60, 0xDF);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 22, 0xF3, 0x00, 0x00, 0x01, 0x00, 0x02, 0x03, 0x01, 0x04, 0xC4, 0x22, 0x81, 0xEB, 0x33, 0x7F, 0xEC, 0x44, 0x44, 0xD2, 0x55, 0x47, 0xAA);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 18, 0xF4, 0x66, 0x04, 0x54, 0x66, 0x7A, 0x7A, 0x66, 0x7A, 0x7A, 0x66, 0x7A, 0x7A, 0x66, 0x7A, 0x7A, 0x60, 0x7A);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 22, 0xF5, 0x00, 0x20, 0x84, 0x00, 0x85, 0x86, 0x12, 0xCD, 0xE1, 0x33, 0x72, 0xDE, 0x44, 0x7B, 0xF2, 0x55, 0x57, 0xF9, 0x66, 0x7E, 0xEF);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 18, 0xF6, 0x77, 0x56, 0xB5, 0x77, 0xE2, 0xE2, 0x77, 0xE2, 0xE2, 0x77, 0xE2, 0xE2, 0x77, 0xE2, 0xE2, 0x70, 0xE2);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 2, 0xFF, 0x01);
N	delayMs(1);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 5, 0xFE, 0x01, 0x03, 0x00, 0x00);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 22, 0xF1, 0x00, 0x00, 0x01, 0x00, 0x02, 0x03, 0x00, 0x04, 0x05, 0x12, 0x8B, 0x66, 0x33, 0x14, 0x85, 0x34, 0xDE, 0x65, 0x45, 0xD2, 0x2D);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 18, 0xF2, 0x55, 0x7E, 0xC9, 0x55, 0xEA, 0xEA, 0x55, 0xEA, 0xEA, 0x55, 0xEA, 0xEA, 0x55, 0xEA, 0xEA, 0x50, 0xEA);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 22, 0xF3, 0x00, 0x00, 0x01, 0x00, 0x02, 0x03, 0x00, 0x04, 0x05, 0x12, 0xCB, 0x53, 0x23, 0xEB, 0x51, 0x34, 0xA3, 0x24, 0x44, 0x8D, 0xE2);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 18, 0xF4, 0x55, 0x30, 0x74, 0x55, 0x95, 0x95, 0x55, 0x95, 0x95, 0x55, 0x95, 0x95, 0x55, 0x95, 0x95, 0x50, 0x95);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 22, 0xF5, 0x00, 0x00, 0x3D, 0x00, 0x3E, 0x3F, 0x02, 0x40, 0x52, 0x23, 0xE3, 0x4A, 0x34, 0xDE, 0x4B, 0x45, 0xA3, 0x33, 0x56, 0xA8, 0x0E);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 18, 0xF6, 0x66, 0x63, 0xB2, 0x66, 0xD8, 0xD8, 0x66, 0xD8, 0xD8, 0x66, 0xD8, 0xD8, 0x66, 0xD8, 0xD8, 0x60, 0xD8);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 2, 0xFF, 0x01);
N	delayMs(1);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 5, 0xFE, 0x01, 0x04, 0x00, 0x00);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 22, 0xF1, 0x00, 0x00, 0x01, 0x00, 0x02, 0x03, 0x00, 0x04, 0x05, 0x02, 0x65, 0x47, 0x33, 0x25, 0xA4, 0x44, 0x08, 0x9E, 0x55, 0x13, 0x78);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 18, 0xF2, 0x56, 0xD2, 0x22, 0x66, 0x48, 0x48, 0x66, 0x48, 0x48, 0x66, 0x48, 0x48, 0x66, 0x48, 0x48, 0x60, 0x48);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 22, 0xF3, 0x00, 0x00, 0x01, 0x00, 0x02, 0x03, 0x00, 0x04, 0x05, 0x02, 0xAC, 0x07, 0x23, 0xE2, 0x64, 0x34, 0xC5, 0x56, 0x45, 0xC7, 0x25);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 18, 0xF4, 0x55, 0x7A, 0xC7, 0x55, 0xE9, 0xE9, 0x55, 0xE9, 0xE9, 0x55, 0xE9, 0xE9, 0x55, 0xE9, 0xE9, 0x50, 0xE9);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 22, 0xF5, 0x00, 0x00, 0x3A, 0x00, 0x3B, 0x3C, 0x02, 0x3D, 0x27, 0x23, 0xE3, 0x5F, 0x44, 0x04, 0x7E, 0x45, 0xE0, 0x7C, 0x56, 0xFB, 0x67);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 18, 0xF6, 0x67, 0xC6, 0x1E, 0x77, 0x44, 0x44, 0x77, 0x44, 0x44, 0x77, 0x44, 0x44, 0x77, 0x44, 0x44, 0x70, 0x44);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 2, 0xFF, 0x01);
N	delayMs(1);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 5, 0xFE, 0x01, 0x05, 0x00, 0x00);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 22, 0xF1, 0x00, 0x00, 0x01, 0x00, 0x02, 0x03, 0x00, 0x04, 0x05, 0x00, 0x06, 0x07, 0x23, 0x09, 0x39, 0x34, 0xC6, 0x78, 0x45, 0xFB, 0x64);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 18, 0xF2, 0x56, 0xC3, 0x16, 0x66, 0x3E, 0x3E, 0x66, 0x3E, 0x3E, 0x66, 0x3E, 0x3E, 0x66, 0x3E, 0x3E, 0x60, 0x3E);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 22, 0xF3, 0x00, 0x00, 0x01, 0x00, 0x02, 0x03, 0x00, 0x04, 0x05, 0x00, 0x06, 0x07, 0x23, 0x6E, 0x25, 0x34, 0x9D, 0x3F, 0x45, 0xB6, 0x1C);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 18, 0xF4, 0x55, 0x72, 0xC1, 0x55, 0xE5, 0xE5, 0x55, 0xE5, 0xE5, 0x55, 0xE5, 0xE5, 0x55, 0xE5, 0xE5, 0x50, 0xE5);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 22, 0xF5, 0x00, 0x00, 0x01, 0x00, 0x02, 0x03, 0x00, 0x04, 0x05, 0x12, 0xE5, 0xF9, 0x34, 0xD7, 0x61, 0x45, 0xCB, 0x6F, 0x56, 0xF2, 0x62);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 18, 0xF6, 0x67, 0xC2, 0x18, 0x77, 0x41, 0x41, 0x77, 0x41, 0x41, 0x77, 0x41, 0x41, 0x77, 0x41, 0x41, 0x70, 0x41);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 2, 0xFF, 0x01);
N	delayMs(1);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 5, 0xFE, 0x01, 0x06, 0x00, 0x00);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 22, 0xF1, 0x00, 0x00, 0x01, 0x00, 0x02, 0x03, 0x00, 0x04, 0x05, 0x00, 0x06, 0x07, 0x01, 0x08, 0xE6, 0x34, 0x26, 0x18, 0x45, 0xAA, 0x1B);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 18, 0xF2, 0x55, 0x7C, 0xD2, 0x55, 0xFC, 0xFC, 0x55, 0xFC, 0xFC, 0x55, 0xFC, 0xFC, 0x55, 0xFC, 0xFC, 0x50, 0xFC);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 22, 0xF3, 0x00, 0x00, 0x01, 0x00, 0x02, 0x03, 0x00, 0x04, 0x05, 0x00, 0x06, 0x07, 0x02, 0x3D, 0x75, 0x33, 0x21, 0xE7, 0x44, 0x6C, 0xD4);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 18, 0xF4, 0x55, 0x30, 0x81, 0x55, 0xA6, 0xA6, 0x55, 0xA6, 0xA6, 0x55, 0xA6, 0xA6, 0x55, 0xA6, 0xA6, 0x50, 0xA6);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 22, 0xF5, 0x00, 0x00, 0x01, 0x00, 0x02, 0x03, 0x00, 0x04, 0x05, 0x11, 0xC9, 0xCA, 0x34, 0x64, 0x0F, 0x45, 0x82, 0x30, 0x56, 0xB9, 0x29);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 18, 0xF6, 0x66, 0x8A, 0xDD, 0x77, 0x06, 0x06, 0x77, 0x06, 0x06, 0x77, 0x06, 0x06, 0x77, 0x06, 0x06, 0x70, 0x06);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 2, 0xFF, 0x01);
N	delayMs(1);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 5, 0xFE, 0x01, 0x07, 0x00, 0x00);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 22, 0xF1, 0x00, 0x00, 0x01, 0x00, 0x02, 0x03, 0x00, 0x04, 0x05, 0x00, 0x06, 0x07, 0x00, 0x08, 0x09, 0x13, 0x7B, 0x9B, 0x44, 0x56, 0xD3);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 18, 0xF2, 0x55, 0x3E, 0x9B, 0x55, 0xC5, 0xC5, 0x55, 0xC5, 0xC5, 0x55, 0xC5, 0xC5, 0x55, 0xC5, 0xC5, 0x50, 0xC5);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 22, 0xF3, 0x00, 0x00, 0x01, 0x00, 0x02, 0x03, 0x00, 0x04, 0x05, 0x00, 0x06, 0x07, 0x00, 0x08, 0xDC, 0x23, 0x6F, 0x83, 0x44, 0x21, 0x93);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 18, 0xF4, 0x45, 0xF4, 0x4E, 0x55, 0x73, 0x73, 0x55, 0x73, 0x73, 0x55, 0x73, 0x73, 0x55, 0x73, 0x73, 0x50, 0x73);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 22, 0xF5, 0x00, 0x00, 0x01, 0x00, 0x02, 0x03, 0x00, 0x04, 0x05, 0x00, 0x06, 0x07, 0x33, 0x17, 0xAE, 0x44, 0x3A, 0xF9, 0x55, 0x8B, 0xFF);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 18, 0xF6, 0x66, 0x62, 0xB8, 0x66, 0xE0, 0xE0, 0x66, 0xE0, 0xE0, 0x66, 0xE0, 0xE0, 0x66, 0xE0, 0xE0, 0x60, 0xE0);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 2, 0xFF, 0x01);
N	delayMs(1);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 5, 0xFE, 0x01, 0x08, 0x00, 0x00);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 22, 0xF1, 0x00, 0x00, 0x01, 0x00, 0x02, 0x03, 0x00, 0x04, 0x05, 0x00, 0x06, 0x07, 0x00, 0x08, 0x09, 0x00, 0x0A, 0x0B, 0x23, 0xB5, 0xAF);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 18, 0xF2, 0x44, 0x38, 0xA1, 0x44, 0xCD, 0xCD, 0x44, 0xCD, 0xCD, 0x44, 0xCD, 0xCD, 0x44, 0xCD, 0xCD, 0x40, 0xCD);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 22, 0xF3, 0x00, 0x00, 0x01, 0x00, 0x02, 0x03, 0x00, 0x04, 0x05, 0x00, 0x06, 0x07, 0x00, 0x08, 0x09, 0x01, 0x0A, 0xC0, 0x23, 0xF3, 0x98);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 18, 0xF4, 0x44, 0x0C, 0x65, 0x44, 0x8F, 0x8F, 0x44, 0x8F, 0x8F, 0x44, 0x8F, 0x8F, 0x44, 0x8F, 0x8F, 0x40, 0x8F);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 22, 0xF5, 0x00, 0x00, 0x01, 0x00, 0x02, 0x03, 0x00, 0x04, 0x05, 0x00, 0x06, 0x07, 0x01, 0x08, 0x82, 0x34, 0x2E, 0x12, 0x45, 0xB0, 0x2C);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 18, 0xF6, 0x55, 0x93, 0xEC, 0x66, 0x13, 0x13, 0x66, 0x13, 0x13, 0x66, 0x13, 0x13, 0x66, 0x13, 0x13, 0x60, 0x13);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 2, 0xFF, 0x01);
N	delayMs(1);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 5, 0xFE, 0x01, 0x09, 0x00, 0x00);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 22, 0xF1, 0x00, 0x00, 0x01, 0x00, 0x02, 0x03, 0x00, 0x04, 0x05, 0x00, 0x06, 0x07, 0x00, 0x08, 0x09, 0x00, 0x0A, 0x0B, 0x00, 0x0C, 0x0D);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 18, 0xF2, 0x23, 0x73, 0x5A, 0x33, 0xA3, 0xA3, 0x33, 0xA3, 0xA3, 0x33, 0xA3, 0xA3, 0x33, 0xA3, 0xA3, 0x30, 0xA3);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 22, 0xF3, 0x00, 0x00, 0x01, 0x00, 0x02, 0x03, 0x00, 0x04, 0x05, 0x00, 0x06, 0x07, 0x00, 0x08, 0x09, 0x00, 0x0A, 0x0B, 0x02, 0x0C, 0x0A);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 18, 0xF4, 0x23, 0xDC, 0x60, 0x33, 0x94, 0x94, 0x33, 0x94, 0x94, 0x33, 0x94, 0x94, 0x33, 0x94, 0x94, 0x30, 0x94);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 22, 0xF5, 0x00, 0x00, 0x01, 0x00, 0x02, 0x03, 0x00, 0x04, 0x05, 0x00, 0x06, 0x07, 0x00, 0x08, 0x09, 0x03, 0x0A, 0x03, 0x34, 0xBB, 0x51);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 18, 0xF6, 0x45, 0xBE, 0x1D, 0x55, 0x47, 0x47, 0x55, 0x47, 0x47, 0x55, 0x47, 0x47, 0x55, 0x47, 0x47, 0x50, 0x47);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 2, 0xFF, 0x01);
N	delayMs(1);
N
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 2, 0x9F, 0x05);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 2, 0xF9, 0x00);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 4, 0xFF, 0x00, 0x00, 0x00);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 2, 0x9F, 0x06);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 3, 0xFF, 0x00, 0x00);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 2, 0x9F, 0x07);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 8, 0xB2, 0x10, 0x20, 0x20, 0x20, 0x02, 0x00, 0x99);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 8, 0xB3, 0x10, 0x10, 0x10, 0x10, 0x02, 0x00, 0x99);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 8, 0xB4, 0x10, 0x10, 0x10, 0x10, 0x02, 0x00, 0x99);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 8, 0xB5, 0x10, 0x10, 0x10, 0x10, 0x02, 0x00, 0x99);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 8, 0xB6, 0x04, 0x04, 0x04, 0x04, 0x02, 0x02, 0x64);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 8, 0xB7, 0x10, 0x10, 0x10, 0x10, 0x02, 0x00, 0x99);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 8, 0xB8, 0x10, 0x10, 0x10, 0x10, 0x02, 0x00, 0x99);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 17, 0xB9, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 17, 0xBA, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 17, 0xBB, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 17, 0xBC, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 17, 0xBD, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 17, 0xBE, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 17, 0xBF, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 16, 0xC0, 0x00, 0x99, 0x99, 0x00, 0x99, 0x99, 0x00, 0x64, 0x3F, 0x00, 0x25, 0x17, 0x00, 0x10, 0x0C);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 16, 0xC1, 0x00, 0x99, 0x99, 0x00, 0x99, 0x99, 0x00, 0x64, 0x3F, 0x00, 0x25, 0x17, 0x00, 0x10, 0x0C);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 16, 0xC2, 0x00, 0x99, 0x99, 0x00, 0x99, 0x99, 0x00, 0x64, 0x3F, 0x00, 0x25, 0x17, 0x00, 0x10, 0x0C);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 16, 0xC3, 0x00, 0x99, 0x99, 0x00, 0x99, 0x99, 0x00, 0x64, 0x3F, 0x00, 0x25, 0x17, 0x00, 0x10, 0x0C);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 7, 0xC4, 0x22, 0x58, 0x58, 0x22, 0x58, 0x58);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 7, 0xC5, 0x00, 0x99, 0x99, 0x00, 0x99, 0x99);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 4, 0xC6, 0x00, 0xC8, 0xC8);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 2, 0x9F, 0x0F);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 2, 0xF8, 0x00);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 2, 0x9F, 0x0A);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 8, 0xB2, 0x1F, 0x00, 0x00, 0x20, 0x01, 0x10, 0x00);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 46, 0xB8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, 0x00, 0x10, 0x10, 0x00, 0x00, 0x10, 0x10, 0x00, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0x00, 0x00);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 43, 0xB9, 0x00, 0x00, 0x00, 0x00, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0x00, 0x00);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 43, 0xBA, 0x10, 0x10, 0x00, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, 0x00, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0x00, 0x00);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 2, 0x9F, 0x0B);
N	hal_dsi_tx_ctrl_write_cmd(0x15, 0, 9, 0xB2, 0x01, 0x2F, 0x4F, 0x00, 0x00, 0x00, 0x00, 0x00);
N	hal_dsi_tx_ctrl_write_cmd(0x15, 0, 54, 0xB9, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x70, 0x24, 0x0A, 0x6A, 0x13, 0x9A, 0xFA, 0x48, 0x14, 0xDA, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);
N	hal_dsi_tx_ctrl_write_cmd(0x15, 0, 54, 0xBA, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x20, 0x20, 0x0A, 0x32, 0x00, 0x00, 0x00, 0x48, 0x38, 0xE8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00);
N	hal_dsi_tx_ctrl_write_cmd(0x15, 0, 20, 0xC8, 0x0F, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x08, 0x08, 0x08, 0x08, 0x00, 0x80, 0x80, 0x80, 0x80);
N
N//	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 2, 0x9F, 0x04);
N//	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 3, 0xB9, 0x91, 0x11);
N	
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 2, 0x48, 0x03);          // 0x00 command mode; 0x03 video mode
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 3, 0x51, 0x00, 0x00);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 2, 0x53, 0xE8);
N	hal_dsi_tx_ctrl_write_cmd(0x39, 0, 1, 0x35);
N	
N	
N/*****FPS***/	
Nhal_dsi_tx_ctrl_write_cmd(0x39,0,2,0x9F,0x6);
Nhal_dsi_tx_ctrl_write_cmd(0x39,0,41,0xCD,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0);
Nhal_dsi_tx_ctrl_write_cmd(0x39,0,41,0xCE,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0);
Nhal_dsi_tx_ctrl_write_cmd(0x39,0,21,0xCF,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0);
Nhal_dsi_tx_ctrl_write_cmd(0x39,0,41,0xD0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0);
Nhal_dsi_tx_ctrl_write_cmd(0x39,0,41,0xD1,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0);
Nhal_dsi_tx_ctrl_write_cmd(0x39,0,21,0xD2,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0);
Nhal_dsi_tx_ctrl_write_cmd(0x39,0,41,0xD3,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0);
Nhal_dsi_tx_ctrl_write_cmd(0x39,0,41,0xD4,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0);
Nhal_dsi_tx_ctrl_write_cmd(0x39,0,21,0xD5,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0);
Nhal_dsi_tx_ctrl_write_cmd(0x39,0,41,0xD6,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0);
Nhal_dsi_tx_ctrl_write_cmd(0x39,0,41,0xD7,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0);
Nhal_dsi_tx_ctrl_write_cmd(0x39,0,21,0xD8,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0);
Nhal_dsi_tx_ctrl_write_cmd(0x39,0,41,0xD9,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0);
Nhal_dsi_tx_ctrl_write_cmd(0x39,0,41,0xDA,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0);
Nhal_dsi_tx_ctrl_write_cmd(0x39,0,21,0xDB,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0);
Nhal_dsi_tx_ctrl_write_cmd(0x39,0,41,0xDC,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0);
Nhal_dsi_tx_ctrl_write_cmd(0x39,0,41,0xDD,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0);
Nhal_dsi_tx_ctrl_write_cmd(0x39,0,21,0xDE,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0,0x8,0x0);
N
N///FPS BC CTRL///
Nhal_dsi_tx_ctrl_write_cmd(0x39,0,2,0x9F,0x5);
Nhal_dsi_tx_ctrl_write_cmd(0x39,0,13,0xB4,0x0,0x60,0xE,0x38,0x0,0x0,0x0,0x0,0x0,0x0,0x22,0x8F); //HONOR
N
N/// FPS CTRL ///
Nhal_dsi_tx_ctrl_write_cmd(0x39,0,2,0x9F,0x4);
Nhal_dsi_tx_ctrl_write_cmd(0x39,0,14,0xB5,0x11,0x17,0x26,0x0A,0x50,0x0,0x71,0x71,0x37,0x2A,0x71,0x2D,0xC1); ////R51 0F FF && Black AA pattern && Circle Lv. 1000nits  700 620 790
Nhal_dsi_tx_ctrl_write_cmd(0x39,0,18,0xE0,0x0,0x4F,0xFF,0xFF,0xFF,0x3F,0xFF,0xFF,0xFF,0x3F,0xFF,0xFF,0xFF,0x3F,0xFF,0xFF,0xFF);
N
N//RF8 1E C0 C0 E0 00 00 00 00 E0
N//RF9 E3 00 00 00 F0 C0 C0 00 00
N//RFA 1E C0 C0 E0 00 00 00 00 E0
N
Nhal_dsi_tx_ctrl_write_cmd(0x39,0,10,0xF8,0x3E,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0);
Nhal_dsi_tx_ctrl_write_cmd(0x39,0,10,0xF9,0xE3,0x0,0x0,0x0,0xC0,0x90,0x60,0x0,0x0);
Nhal_dsi_tx_ctrl_write_cmd(0x39,0,10,0xFA,0xFF,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0);
N
N//FRC OFF FPS FIRST LINE
Nhal_dsi_tx_ctrl_write_cmd(0x39,0,2,0x9F,0x0A);
Nhal_dsi_tx_ctrl_write_cmd(0x39,0,2,0xED,0x00);
N    //Bist mode
N//    hal_dsi_tx_ctrl_write_cmd(0x39, 0, 2, 0x9F, 0x01);
N//    hal_dsi_tx_ctrl_write_cmd(0x39, 0, 3, 0xC6, 0x01, 0x11);        //循环：0x01, 0x11; 单色：0x03, 0x13
N//    hal_dsi_tx_ctrl_write_cmd(0x39, 0, 2, 0x9F, 0x01);
N//    hal_dsi_tx_ctrl_write_cmd(0x39, 0, 3, 0xC6, 0x03, 0x0F);        //循环：0x01, 0x11; 单色：0x03, 0x13
N//    uint8_t read_array[1];
N//    hal_dsi_tx_ctrl_read_cmd(0x06, 0, 0xDA, 1, read_array);
N//    TAU_LOGD("0xDA: %02x\n", &read_array[1]);  
N//	TAU_LOGD("Panel init!\n\r");
N   // delayMs(180);
N//	hal_dsi_tx_ctrl_write_cmd(0x05, 0, 1, 0x11);
N	delayMs(60); //30
N	
N#endif
N}
N
N#if TX_CMD_MODE_WITHOUT_TE
X#if 0
S/**
S* @brief  MIPI RX事件处理函数,demo code 用于command mode 输出发送数据（模式1）
S* @param  event:RX事件
S* @param  data: user data
S* @retval none
S*/
Sstatic void app_rx_event_cb(hal_rx_event_e event, void *data)
S{
S    if (panel_display_done && event == HAL_RX_LINE_EVENT)
S    {
S        hal_dsi_tx_ctrl_gen_a_frame();
S    }
S}
N#endif
N
N#if TX_USE_CMD_MODE
X#if 0
S/**
S* @brief  TE引脚作为GPIO 输入回调函数,demo code 用于command mode 输出发送数据（模式2）
S* @param  none
S* @retval none
S*/
Sstatic void app_tx_cmd_panel_te_cb(void *data)
S{
S    if (panel_display_done)
S    {
S        //delayUs(25); /* 撕裂调试 */
S        hal_dsi_tx_ctrl_gen_a_frame();
S    }
S}
S
S/**
S* @brief  注册屏端TE信号输入引脚回调函数
S* @param  pad :TE输入pad
S* @param  trig:触发中断沿配置
S* @retval none
S*/
Sstatic void app_tx_cmd_app_init_panel_te_int(io_pad_e pad, sys_cfg_trigger_e trig)
S{
S    /*1.关闭中断*/
S    hal_gpio_ctrl_eint(pad, DISABLE);
S
S    /*2.中断初始化*/
S    hal_gpio_init_eint(pad, trig);
S
S    /*3.注册回调*/
S    hal_gpio_reg_eint_cb(pad, app_tx_cmd_panel_te_cb);
S
S    /*4.使能中断*/
S    hal_gpio_ctrl_eint(pad, ENABLE);
S}
N#endif
N
N/**
N* @brief  mipi rx 初始化
N* @param  none
N* @retval none
N*/
Nstatic void app_mipi_rx_init(void)
N{
N    if (g_rx_ctrl_handle == NULL)
X    if (g_rx_ctrl_handle == 0)
N    {
N        /* 创建rx   ctrl handle */
N        g_rx_ctrl_handle = hal_dsi_rx_ctrl_create_handle();
N    }
N    /* 配置参数 */
N    g_rx_ctrl_handle->base_info.src_w = INPUT_WIDTH;
X    g_rx_ctrl_handle->base_info.src_w = 1080;
N    g_rx_ctrl_handle->base_info.src_h = INPUT_HEIGHT;
X    g_rx_ctrl_handle->base_info.src_h = 2400;
N    g_rx_ctrl_handle->base_info.dst_w = OUTPUT_WIDTH;
X    g_rx_ctrl_handle->base_info.dst_w = 1044;
N    g_rx_ctrl_handle->base_info.dst_h = OUTPUT_HEIGHT;
X    g_rx_ctrl_handle->base_info.dst_h = 2260;
N    g_rx_ctrl_handle->base_info.src_frate = INPUT_FRAME_RATE;
X    g_rx_ctrl_handle->base_info.src_frate = DSI_FRAME_RATE_60HZ;
N    g_rx_ctrl_handle->base_info.src_mode = INPUT_DATA_MODE;
X    g_rx_ctrl_handle->base_info.src_mode = DSI_DATA_CMD_MODE;
N    g_rx_ctrl_handle->base_info.dst_mode = OUTPUT_DATA_MODE;
X    g_rx_ctrl_handle->base_info.dst_mode = DSI_DATA_VIDEO_MODE;
N    g_rx_ctrl_handle->rx_color_mode = INPUT_COLOR_MODE;
X    g_rx_ctrl_handle->rx_color_mode = DSI_RGB888;
N    g_rx_ctrl_handle->rx_lanes = INPUT_MIPI_LANE_NUM;
X    g_rx_ctrl_handle->rx_lanes = DSI_LANE_4;
N    g_rx_ctrl_handle->rx_nonburst_models = INPUT_VIDEO_MODEL; /* 可不配置 */
X    g_rx_ctrl_handle->rx_nonburst_models = DSI_NONBURST_EVENT;  
N    g_rx_ctrl_handle->compress_en = INPUT_COMPRESS;
X    g_rx_ctrl_handle->compress_en = 1;
N    g_rx_ctrl_handle->rx_hsclk_rate = INPUT_MIPI_LANE_RATE;
X    g_rx_ctrl_handle->rx_hsclk_rate = 1450000000;
N    g_rx_ctrl_handle->cus_dcs_entry_table = g_cus_rx_dcs_execute_table; /* 注册 DCS处理列表 */
N    g_rx_ctrl_handle->rx_dcs_read_entry = ap_dcs_read; /* 注册dsc read 回调函数,可选,此函数为空时由cus_dcs_entry_table执行 */
N	g_rx_ctrl_handle->hight_performan_mode=HIGHT_PERFORMAN_L2;
N
N#if RX_RESOLUTION_CHANGE_ENABLE
X#if 1
N    g_rx_ctrl_handle->pps_update_entry = pps_update_handle;
N#endif
N	g_rx_ctrl_handle->extra_info.crop_info.enable=1;
N	g_rx_ctrl_handle->extra_info.crop_info.top =15;  //4 8 的倍数
N	g_rx_ctrl_handle->extra_info.crop_info.right =2;  //4 8 的倍数
N
N
N    /* 提前预置PPS,  AP 有PPS cmd也会更新 */
N    if (g_rx_ctrl_handle->compress_en == true)
X    if (g_rx_ctrl_handle->compress_en == 1)
N    {
N        hal_dsi_rx_ctrl_pre_init_pps(g_rx_ctrl_handle, pps, 128);
N    }
N
N
N    /* 初始化rx ctrl */
N    hal_dsi_rx_ctrl_init(g_rx_ctrl_handle);
N	
N
N#if RX_READ_HW_ACK
X#if 0
S    /* 配置硬件回复 */
S    app_set_dcs_hw_ack();
N#endif
N
N#if TX_CMD_MODE_WITHOUT_TE
X#if 0
S    /* 注册接收一帧帧头事件回调,每接收一帧数据TX再往外发一帧 */
S    //hal_dsi_rx_ctrl_register_callback(g_rx_ctrl_handle, app_rx_event_cb, HAL_RX_FS_EVENT, true, NULL);
S    /* 注册接收第0行数据事件,接收到数据后再往外发送数据,确保不撕裂 */
S    uint32_t line = 0;
S    hal_dsi_rx_ctrl_register_callback(g_rx_ctrl_handle, app_rx_event_cb, HAL_RX_LINE_EVENT, true, &line);
N#endif
N
N#if RX_START_WITHOUT_RST
X#if 1
N    /* 等待ap reset置位再启动rx,否则容易收到错误数据 */
N    hal_dsi_rx_ctrl_start(g_rx_ctrl_handle);
N#else
S    /* 注册RX start callback,确认RX LP11时再启动RX,防止接收错误数据 */
S    hal_gpio_set_ap_reset_int(ENABLE, app_mipi_rx_start_cb, DETECT_HIGH_LVL);
N#endif
N	TAU_LOGD("rx init!\n\r");
X	do { tau_log_printf(kLOG_LEVEL_DBG, "[%s] (%04d) " "rx init!\n\r", "p6a", 1370); } while (0);
N}
N
N/**
N* @brief  mipi tx 初始化
N* @param  none
N* @retval none
N*/
Nstatic void app_mipi_tx_init(void)
N{
N    if (g_tx_ctrl_handle == NULL)
X    if (g_tx_ctrl_handle == 0)
N    {
N        g_tx_ctrl_handle = hal_dsi_tx_ctrl_create_handle();
N    }
N    g_tx_ctrl_handle->channel_id = OUTPUT_VC;
X    g_tx_ctrl_handle->channel_id = DSI_VC_0;
N    g_tx_ctrl_handle->lane_num = OUTPUT_LANE_NUMBER;
X    g_tx_ctrl_handle->lane_num = DSI_LANE_4;
N    g_tx_ctrl_handle->vid_mode = OUTPUT_VIDEO_MODEL;
X    g_tx_ctrl_handle->vid_mode = DSI_BURST_MODE;
N    g_tx_ctrl_handle->cmd_tx_type = TX_INIT_TYPE;
X    g_tx_ctrl_handle->cmd_tx_type = DSI_CMD_TX_LP;
N    g_tx_ctrl_handle->dpi_vsa = OUTPUT_VSA;
X    g_tx_ctrl_handle->dpi_vsa = 2;
N    g_tx_ctrl_handle->dpi_vbp = OUTPUT_VBP;
X    g_tx_ctrl_handle->dpi_vbp = 8;
N    g_tx_ctrl_handle->dpi_vfp = OUTPUT_VFP;
X    g_tx_ctrl_handle->dpi_vfp = 62;
N    g_tx_ctrl_handle->dpi_hsa = OUTPUT_HSA;
X    g_tx_ctrl_handle->dpi_hsa = 2;
N    g_tx_ctrl_handle->dpi_hbp = OUTPUT_HBP;
X    g_tx_ctrl_handle->dpi_hbp = 28;
N    g_tx_ctrl_handle->dpi_hfp = OUTPUT_HFP;
X    g_tx_ctrl_handle->dpi_hfp = 168;
N    g_tx_ctrl_handle->base_info.src_w = INPUT_WIDTH;
X    g_tx_ctrl_handle->base_info.src_w = 1080;
N    g_tx_ctrl_handle->base_info.src_h = INPUT_HEIGHT;
X    g_tx_ctrl_handle->base_info.src_h = 2400;
N    g_tx_ctrl_handle->base_info.dst_w = OUTPUT_WIDTH;
X    g_tx_ctrl_handle->base_info.dst_w = 1044;
N    g_tx_ctrl_handle->base_info.dst_h = OUTPUT_HEIGHT;
X    g_tx_ctrl_handle->base_info.dst_h = 2260;
N    g_tx_ctrl_handle->base_info.src_frate = INPUT_FRAME_RATE;
X    g_tx_ctrl_handle->base_info.src_frate = DSI_FRAME_RATE_60HZ;
N    g_tx_ctrl_handle->base_info.src_mode = INPUT_DATA_MODE;
X    g_tx_ctrl_handle->base_info.src_mode = DSI_DATA_CMD_MODE;
N    g_tx_ctrl_handle->base_info.dst_mode = OUTPUT_DATA_MODE;
X    g_tx_ctrl_handle->base_info.dst_mode = DSI_DATA_VIDEO_MODE;
N	g_tx_ctrl_handle->tx_frame_rate=58;
N
N    hal_dsi_tx_ctrl_init(g_tx_ctrl_handle);
N//	hal_dsi_tx_ctrl_set_cus_sync_line(g_tx_ctrl_handle,1200);  //1200
N
N    /* FIXME set tear on*/
N    hal_dsi_tx_ctrl_set_tear_mode(g_tx_ctrl_handle, TE_60HZ_MODE);
N
N    /* AP 没有发送数据时默认的显示颜色, 量产为0 0 0(黑色), 配置其他颜色仅为debug使用 */
N    hal_dsi_tx_ctrl_set_overwrite_rgb(0x00, 0x00, 0x00);
N	TAU_LOGD("tx init!\n\r");
X	do { tau_log_printf(kLOG_LEVEL_DBG, "[%s] (%04d) " "tx init!\n\r", "p6a", 1411); } while (0);
N}
N
N#if !RX_START_WITHOUT_RST
X#if !1
S/**
S* @brief  mipi rx start函数,开启AP RSTN等待启动配置后使用
S* @param  none
S* @retval none
S*/
Sstatic void app_mipi_rx_start_cb(void *data)
S{
S    /* RX start */
S    hal_dsi_rx_ctrl_start(g_rx_ctrl_handle);
S    /* close cb */
S    hal_gpio_set_ap_reset_int(DISABLE, NULL, DETECT_HIGH_LVL);
S    TAU_LOGD("rx start\n");
S}
N#endif
N
Nvoid Panel_CCM(void)
N{
N	ccm_coef_t ccm;
N	ccm.coef_c00 = 255;	// 260
N	ccm.coef_c01 = 0;
N	ccm.coef_c02 = 0;
N	ccm.coef_c10 = 0;
N	ccm.coef_c11 = 246;	// 247
N	ccm.coef_c12 = 0;
N	ccm.coef_c20 = 0;
N	ccm.coef_c21 = 0;
N	ccm.coef_c22 = 247;  //248
N
N	hal_dsi_tx_ctrl_set_ccm(&ccm);
N}
N
Nstatic void soft_swire_start(uint8_t pulse)
N{
N	do
N	{
N		hal_gpio_init_output( SWIRE_EN, IO_LVL_LOW  ); // 3us
X		hal_gpio_init_output( ( IO_PIN_17 ), IO_LVL_LOW  ); 
N		delayUs(10);
N		hal_gpio_init_output( SWIRE_EN, IO_LVL_HIGH ); // 3us
X		hal_gpio_init_output( ( IO_PIN_17 ), IO_LVL_HIGH ); 
N		delayUs(10);
N	}while(pulse--);
N}
N
Nstatic void soft_swire_timer_callback(void *data)
N{
N	s_swire_pwm_counter++;
N	if( s_swire_pwm_counter < SWIRE_MAX_NUM )
X	if( s_swire_pwm_counter < ( 10 ) )
N	{
N		soft_swire_start(SWIRE_DEFAULT_NUM);
X		soft_swire_start(( 37 ));
N		hal_timer_start(SOFT_SWIRE_TIMER, 16, soft_swire_timer_callback, NULL);
X		hal_timer_start(( TIMER_NUM3 ), 16, soft_swire_timer_callback, 0);
N	}
N	else
N	{
N		hal_timer_deinit(SOFT_SWIRE_TIMER);
X		hal_timer_deinit(( TIMER_NUM3 ));
N		hal_timer_stop(SOFT_SWIRE_TIMER);	
X		hal_timer_stop(( TIMER_NUM3 ));	
N		hal_gpio_init_output(SWIRE_EN, IO_LVL_HIGH);
X		hal_gpio_init_output(( IO_PIN_17 ), IO_LVL_HIGH);
N	}
N}
N
Nstatic void soft_swire_init(void)
N{
N	hal_gpio_init_output(SWIRE_EN, IO_LVL_HIGH);
X	hal_gpio_init_output(( IO_PIN_17 ), IO_LVL_HIGH);
N	delayMs(2);
N	s_swire_pwm_counter = 0;
N	soft_swire_start(SWIRE_DEFAULT_NUM);
X	soft_swire_start(( 37 ));
N	hal_timer_init(SOFT_SWIRE_TIMER);
X	hal_timer_init(( TIMER_NUM3 ));
N    hal_timer_start(SOFT_SWIRE_TIMER, 16, soft_swire_timer_callback, NULL);
X    hal_timer_start(( TIMER_NUM3 ), 16, soft_swire_timer_callback, 0);
N}
N
N
N/**
N* @brief  mipi tx 启动
N* @param  none
N* @retval none
N*/
Nstatic void app_mipi_tx_start(void)
N{
N	/* Init panel */
N	app_init_panel();
N	hal_dsi_tx_ctrl_write_cmd(0x05, 0, 1, 0x11);
N	delayMs(80); //30
N	/* TX start */
N	hal_dsi_tx_ctrl_start(g_tx_ctrl_handle);
N    delayMs(50); //50
N	hal_gpio_init_output(AVDD_EN, IO_LVL_HIGH);	
X	hal_gpio_init_output(( IO_PIN_15 ), IO_LVL_HIGH);	
N    delayMs(10); //10
N	soft_swire_init();
N//	hal_gpio_init_output(SWIRE_EN, IO_LVL_HIGH);
N#if AP_SWIRE_OUTPUT
X#if 0
S    hal_swire_enable(true);
S    hal_swire_set_pulse(41);
N#endif	
N    panel_display_done = true;
X    panel_display_done = 1;
N    delayMs(50); //30	
N    /* Display on */
N    hal_dsi_tx_ctrl_write_cmd(0x05, 0, 1, 0x29);	
N#if AP_SWIRE_OUTPUT
X#if 0
S     hal_swire_set_pulse(SWIRE_DEFAULT_PULSE);
N#endif
N    TAU_LOGD("tx_start \n");
X    do { tau_log_printf(kLOG_LEVEL_DBG, "[%s] (%04d) " "tx_start \n", "p6a", 1513); } while (0);
N}
N
N/**
N* @brief  ap rstn 拉高中断回调,用于息屏唤醒
N* @param  none
N* @retval none
N*/
Nstatic void ap_rstn_pull_high_cb(void *data)
N{
N    /* system resume begin */
N    sg_system_resume = true;
X    sg_system_resume = 1;
N    /* 关闭AP reset检查     */
N    hal_gpio_set_ap_reset_int(DISABLE, NULL, DETECT_RISING_EDGE);
X    hal_gpio_set_ap_reset_int(DISABLE, 0, DETECT_RISING_EDGE);
N}
N
N/**
N* @brief  ap rstn 拉高中断回调,用于息屏待机
N* @param  none
N* @retval none
N*/
Nstatic void ap_rstn_pull_down_cb(void *data)
N{
N	 TAU_LOGD("ap_rstn_pull_down_cb\n");
X	 do { tau_log_printf(kLOG_LEVEL_DBG, "[%s] (%04d) " "ap_rstn_pull_down_cb\n", "p6a", 1536); } while (0);
N    sg_system_suspend = true;
X    sg_system_suspend = 1;
N    /* 关闭AP reset检查     */
N    hal_gpio_set_ap_reset_int(DISABLE, NULL, DETECT_RISING_EDGE);
X    hal_gpio_set_ap_reset_int(DISABLE, 0, DETECT_RISING_EDGE);
N//    TAU_LOGD("ap_rstn_pull_down_cb\n");
N}
N
N/**
N* @brief  GPIO初始化配置,根据实际原理图提前配置IO功能以及状态,默认功能可不配置
N*         TP相关I2C/SPI 在tp_transfer.c,也可以挪到此函数初始化
N* @param  none
N* @retval none
N*/
Nvoid app_gpio_init(void)
N{
N    io_pad_attr_t attrs[] =
N    {
N        {IO_PIN_8,  PIN8_MODE_GPIO7,     IO_IOE_OUTPUT, IO_LVL_LOW},/* PIN_8(TD_RSTN), GPIO,输出,低电平 */
N        {IO_PIN_17, PIN17_MODE_GPIO8,   IO_IOE_OUTPUT, IO_LVL_LOW}, /* PIN_17(PWMEN), GPIO,输出,低电平 */
N		 {IO_PIN_15, PIN15_MODE_GPIO4,   IO_IOE_OUTPUT, IO_LVL_LOW}, /* PIN_15(ASWIRE), GPIO,输出,低电平 */
N   //     {IO_PIN_16, PIN16_MODE_GPIO2,   IO_IOE_OUTPUT, IO_LVL_LOW}, /* PIN_16(AP_INT),GPIO,输出,低电平 */
N#if (TX_USE_CMD_MODE & (!TX_CMD_MODE_WITHOUT_TE))
X#if (0 & (!0))
S        {IO_PIN_29, PIN29_MODE_GPIO3,   IO_IOE_INPUT, IO_LVL_NONE}, /* PIN_29(AP_TE), GPIO,输入 */
N#else
N        {IO_PIN_29, PIN29_MODE_TEAR,    IO_IOE_NONE, IO_LVL_NONE},  /* PIN_29(AP_TE), 硬件TEAR输出模式 */
N#endif
N    };
N    uint8_t size = sizeof(attrs) / sizeof(io_pad_attr_t);
N    hal_gpio_config_pad(attrs, size);
N}
N
N
N/**
N* @brief  显示相关模块初始化,包括MIPI RX/TX/PWM/SWIRE/GPIO等
N* @param  none
N* @retval none
N*/
Nvoid app_display_init(void)
N{
N    /* mipi rx初始化 */
N    app_mipi_rx_init();
N    /* VCC 主供电,等待VCC Power Ready,此时RX初始化完成可以响应MIPI命令 */
N    if (MAIN_POWER_SELECT == PWR_SEL_VCC)
X    if (PWR_SEL_VCC == PWR_SEL_VCC)
N    {
N		
N        while (hal_pwr_get_vcc_power_ready() == false);
X        while (hal_pwr_get_vcc_power_ready() == 0);
N    }
N
N    /* GPIO 初始化   */
N    app_gpio_init();
N//TAU_LOGD("app_gpio_init \n");
N    /* 背光初始化      */
N#if AP_SWIRE_OUTPUT
X#if 0
S    hal_swire_init();   /*  swire init */
S    hal_swire_set_timer(TIMER_NUM0, 17, true); /* swire连续发送,绑定timer进行发送 */
N#endif
N#if ANALOG_PWM_OUTPUT
X#if 0
S    if (hal_pwm_init(PWM_FREQUENCY, PWM_DUTY_STEP))
S    {
S        hal_pwm_enable(true);
S        hal_pwm_set_elvcc_output(true);
S    }
N#endif
N
N    /* mipi tx 初始化*/
N    app_mipi_tx_init();
N//	soft_te_timer_init();
N#if TX_START_AFTER_APRST
X#if 0
S    TAU_LOGD("wait exit sleep mode\n");
N#else
N    app_mipi_tx_start();
N#endif
N}
N
N/**
N* @brief  系统resume
N* @param  sleep_mode: sleep 模式
N* @retval none
N*/
Nstatic void app_system_resume(pwr_sleep_mode_e sleep_mode)
N{
N    /* 退出sleep mode, 电源切换 */
N    hal_pwr_exit_sleep_mode();
N
N    /* display resume */
N    app_display_init();
N
N#if TOUCH_ENABLE
X#if 0
S    /* touch resume */
S    app_tp_write_other_operations(NULL, 0);
N#endif
N    TAU_LOGD("system resume\n");
X    do { tau_log_printf(kLOG_LEVEL_DBG, "[%s] (%04d) " "system resume\n", "p6a", 1627); } while (0);
N}
N
N/**
N* @brief  系统suspend,进入sleep mode
N* @param  sleep_mode: sleep 模式
N* @retval none
N*/
Nstatic void app_system_suspend(pwr_sleep_mode_e sleep_mode)
N{
N//	TAU_LOGD("SLEEP_MODE\n");
N    /* 关闭图像通路 */
N    hal_dsi_tx_ctrl_stop(g_tx_ctrl_handle);
N    hal_dsi_tx_ctrl_deinit(g_tx_ctrl_handle);
N    hal_dsi_rx_ctrl_stop(g_rx_ctrl_handle);
N    hal_dsi_rx_ctrl_deinit(g_rx_ctrl_handle);
N
N    /* Tear拉低 */
N    hal_gpio_init_output(IO_PAD_AP_TE, IO_LVL_LOW);
N    panel_display_done = false;
X    panel_display_done = 0;
N#if RX_WAIT_TEAR_ON
X#if 0
S    sg_ap_set_tear_on = false;
N#endif
N
N    /* 关闭外设 比如Swire/I2C/Flash 等 */
N#if AP_SWIRE_OUTPUT
X#if 0
S    hal_swire_deinit();
N#endif
N#if ANALOG_PWM_OUTPUT
X#if 0
S    hal_pwm_deinit();
N#endif
N
N#if SHARE_FLASH_ENABLE
X#if 0
S    hal_flash_share_mode(false);
N#endif
N
N    /* 切换TP18 供电 */
N    hal_pwr_set_sleep_mode_power(SLEEP_MODE_POWER);
X    hal_pwr_set_sleep_mode_power(PWR_SLEEP_IN_IOV18);
N
N    if (sleep_mode == PWR_NORMAL_SLEEP_MODE)
N    {
N        /* normal sleep mode, MCU可以正常工作 */
N        hal_gpio_set_ap_reset_int(ENABLE, ap_rstn_pull_high_cb, DETECT_HIGH_LVL);
N        hal_pwr_enter_normal_sleep_mode();
N		TAU_LOGD("PWR_NORMAL_SLEEP_MODE\n");
X		do { tau_log_printf(kLOG_LEVEL_DBG, "[%s] (%04d) " "PWR_NORMAL_SLEEP_MODE\n", "p6a", 1671); } while (0);
N    }
N    else if (sleep_mode == PWR_STOP_SLEEP_MODE)
N    {
N		TAU_LOGD("PWR_STOP_SLEEP_MODE\n");
X		do { tau_log_printf(kLOG_LEVEL_DBG, "[%s] (%04d) " "PWR_STOP_SLEEP_MODE\n", "p6a", 1675); } while (0);
N
N        /* 注册对应 wakeup IO */
N        hal_pwr_set_stop_sleep_wakeup_pin(IO_PAD_AP_RSTN, WUP_RISING_EDGE);
N        //hal_pwr_set_stop_sleep_wakeup_pin(IO_PAD_AP_SPIS_CSN, WUP_FALLING_EDGE);
N        //hal_pwr_set_stop_sleep_wakeup_pin(IO_PAD_TD_INT, WUP_FALLING_EDGE);
N        io_pad_e wakeup_io = hal_pwr_enter_stop_sleep_mode();
N        if (wakeup_io == IO_PAD_AP_RSTN)
N        {
N            sg_system_resume = true;
X            sg_system_resume = 1;
N        }
N        else
N        {
N            /* Not impletmented */
N            TAU_LOGD("wakeup_io %d FIXME touch wakeup convert to AP\n", wakeup_io);
X            do { tau_log_printf(kLOG_LEVEL_DBG, "[%s] (%04d) " "wakeup_io %d FIXME touch wakeup convert to AP\n", "p6a", 1689,wakeup_io); } while (0);
N            hal_gpio_set_ap_reset_int(ENABLE, ap_rstn_pull_high_cb, DETECT_HIGH_LVL);
N        }
N    }
N    else
N    {
N        /* deep sleep mode,配置AP RSTN 上升沿,TD INT 下降沿唤醒 */
N        hal_pwr_enter_deep_sleep_mode(WUP_RISING_EDGE, WUP_FALLING_EDGE);
N				TAU_LOGD("PWR_DEEP_SLEEP_MODE\n");
X				do { tau_log_printf(kLOG_LEVEL_DBG, "[%s] (%04d) " "PWR_DEEP_SLEEP_MODE\n", "p6a", 1697); } while (0);
N    }
N
N}
N
N/**
N* @brief  系统process处理函数,处理待机唤醒等
N* @param  none
N* @retval none
N*/
Nstatic void app_system_process(void)
N{
N
N    if (sg_system_suspend)
N    {
N		TAU_LOGD("app_system_process\n");
X		do { tau_log_printf(kLOG_LEVEL_DBG, "[%s] (%04d) " "app_system_process\n", "p6a", 1712); } while (0);
N        /* 系统进入sleep mode */
N        app_system_suspend(SLEEP_MODE_SELECT);
X        app_system_suspend(PWR_NORMAL_SLEEP_MODE);
N        sg_system_suspend = false;
X        sg_system_suspend = 0;
N    }
N
N    if (sg_system_resume)
N    {
N        /* 系统退出sleep mode */
N        app_system_resume(SLEEP_MODE_SELECT);
X        app_system_resume(PWR_NORMAL_SLEEP_MODE);
N        sg_system_resume = false;
X        sg_system_resume = 0;
N    }
N
N#if TX_START_AFTER_APRST
X#if 0
S    if (sg_tx_start_in_process)
S    {
S        app_mipi_tx_start();
S        sg_tx_start_in_process = false;
S    }
N#endif
N}
N
N
N
N/**
N* @brief  P6A demo 主函数
N* @param  none
N* @retval none
N*/
Nvoid google_p6a_demo(void)
N{
N    /* 电源选择,上电只需要选择一次 */
N    hal_pwr_set_main_power(MAIN_POWER_SELECT);        /* 切换供电*/
X    hal_pwr_set_main_power(PWR_SEL_VCC);         
N    /* 显示模块初始 */
N    app_display_init();
N    /* touch 相关模块初始化 */
N#if TOUCH_ENABLE
X#if 0
S    /* TP 初始化 */
S    app_tp_init();
S    app_tp_phone_clear_reset_on();
S    /* 与屏的TP 模块通讯并初始化 */
S    app_tp_transfer_screen_start();
N#endif
N
N    TAU_LOGD("p6a demo init done \n");
X    do { tau_log_printf(kLOG_LEVEL_DBG, "[%s] (%04d) " "p6a demo init done \n", "p6a", 1756); } while (0);
N
N    while (1)
N    {
N		
N		///hal_dsi_tx_ctrl_set_vpg(1, TX_VPG_H_COLOR, true);
N#if TOUCH_ENABLE
X#if 0
S        /* 等待屏TP中断上报做TP协议转换,注意接口实现不可阻塞!否则会影响sleep mode */
S        app_tp_transfer_screen_int();
N#endif
N        /* DCS 命令异步处理 */
N        while (hal_dsi_rx_ctrl_dcs_async_handler(g_rx_ctrl_handle));
N
N        /* 系统事件处理(sleep mode) */
N  //     app_system_process();
N    }
N}
N#endif
W "..\..\src\app\P6A\p6a_demo.c" 131 13 variable "sg_exit_idle_mode_flag"  was set but never used
W "..\..\src\app\P6A\p6a_demo.c" 134 17 variable "pps_renew_flag"  was declared but never referenced
W "..\..\src\app\P6A\p6a_demo.c" 135 17 variable "pwr_rst_flag"  was declared but never referenced
W "..\..\src\app\P6A\p6a_demo.c" 1534 13 function "ap_rstn_pull_down_cb"  was declared but never referenced
W "..\..\src\app\P6A\p6a_demo.c" 157 13 function "app_mipi_rx_start_cb"  was declared but never referenced
W "..\..\src\app\P6A\p6a_demo.c" 415 13 variable "reg53_E8_fg"  was declared but never referenced
W "..\..\src\app\P6A\p6a_demo.c" 494 13 function "ap_dcs_set_exit_idle_mode"  was declared but never referenced
W "..\..\src\app\P6A\p6a_demo.c" 519 13 function "soft_te_timer_init"  was declared but never referenced
W "..\..\src\app\P6A\p6a_demo.c" 533 13 function "ap_dcs_set_frame_change"  was declared but never referenced
W "..\..\src\app\P6A\p6a_demo.c" 655 13 function "send_panel_init_code"  was declared but never referenced
W "..\..\src\app\P6A\p6a_demo.c" 1707 13 function "app_system_process"  was declared but never referenced
