mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2026-10-28 08:37:57 +08:00
Support Nuvoton NuMaker-IOT-M487 and NuMaker-PFM-M487 boards.
This commit is contained in:
1 parent
d7d6dbe774
commit
c04c19a6f1
322 files changed
+190536
No files matched your search
@@ -0,0 +1,7 @@
|
||||
# Nuvoton BSP descriptions
|
||||
Current supported BSP shown in below table:
|
||||
|
||||
| **BSP folder** | **Board name** |
|
||||
|:------------------------- |:-------------------------- |
|
||||
| [numaker-iot-m487](numaker-iot-m487) | Nuvoton NuMaker-IoT-m487 |
|
||||
| [numaker-pfm-m487](numaker-pfm-m487) | Nuvoton NuMaker-PFM-m487 |
|
||||
@@ -0,0 +1,2 @@
|
||||
config SOC_FAMILY_NUMICRO
|
||||
bool
|
||||
@@ -0,0 +1,136 @@
|
||||
/* ----------------------------------------------------------------------
|
||||
* Copyright (C) 2010-2014 ARM Limited. All rights reserved.
|
||||
*
|
||||
* $Date: 19. October 2015
|
||||
* $Revision: V.1.4.5 a
|
||||
*
|
||||
* Project: CMSIS DSP Library
|
||||
* Title: arm_common_tables.h
|
||||
*
|
||||
* Description: This file has extern declaration for common tables like Bitreverse, reciprocal etc which are used across different functions
|
||||
*
|
||||
* Target Processor: Cortex-M4/Cortex-M3
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* - Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* - Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
* - Neither the name of ARM LIMITED nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this
|
||||
* software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
* -------------------------------------------------------------------- */
|
||||
|
||||
#ifndef _ARM_COMMON_TABLES_H
|
||||
#define _ARM_COMMON_TABLES_H
|
||||
|
||||
#include "arm_math.h"
|
||||
|
||||
extern const uint16_t armBitRevTable[1024];
|
||||
extern const q15_t armRecipTableQ15[64];
|
||||
extern const q31_t armRecipTableQ31[64];
|
||||
/* extern const q31_t realCoefAQ31[1024]; */
|
||||
/* extern const q31_t realCoefBQ31[1024]; */
|
||||
extern const float32_t twiddleCoef_16[32];
|
||||
extern const float32_t twiddleCoef_32[64];
|
||||
extern const float32_t twiddleCoef_64[128];
|
||||
extern const float32_t twiddleCoef_128[256];
|
||||
extern const float32_t twiddleCoef_256[512];
|
||||
extern const float32_t twiddleCoef_512[1024];
|
||||
extern const float32_t twiddleCoef_1024[2048];
|
||||
extern const float32_t twiddleCoef_2048[4096];
|
||||
extern const float32_t twiddleCoef_4096[8192];
|
||||
#define twiddleCoef twiddleCoef_4096
|
||||
extern const q31_t twiddleCoef_16_q31[24];
|
||||
extern const q31_t twiddleCoef_32_q31[48];
|
||||
extern const q31_t twiddleCoef_64_q31[96];
|
||||
extern const q31_t twiddleCoef_128_q31[192];
|
||||
extern const q31_t twiddleCoef_256_q31[384];
|
||||
extern const q31_t twiddleCoef_512_q31[768];
|
||||
extern const q31_t twiddleCoef_1024_q31[1536];
|
||||
extern const q31_t twiddleCoef_2048_q31[3072];
|
||||
extern const q31_t twiddleCoef_4096_q31[6144];
|
||||
extern const q15_t twiddleCoef_16_q15[24];
|
||||
extern const q15_t twiddleCoef_32_q15[48];
|
||||
extern const q15_t twiddleCoef_64_q15[96];
|
||||
extern const q15_t twiddleCoef_128_q15[192];
|
||||
extern const q15_t twiddleCoef_256_q15[384];
|
||||
extern const q15_t twiddleCoef_512_q15[768];
|
||||
extern const q15_t twiddleCoef_1024_q15[1536];
|
||||
extern const q15_t twiddleCoef_2048_q15[3072];
|
||||
extern const q15_t twiddleCoef_4096_q15[6144];
|
||||
extern const float32_t twiddleCoef_rfft_32[32];
|
||||
extern const float32_t twiddleCoef_rfft_64[64];
|
||||
extern const float32_t twiddleCoef_rfft_128[128];
|
||||
extern const float32_t twiddleCoef_rfft_256[256];
|
||||
extern const float32_t twiddleCoef_rfft_512[512];
|
||||
extern const float32_t twiddleCoef_rfft_1024[1024];
|
||||
extern const float32_t twiddleCoef_rfft_2048[2048];
|
||||
extern const float32_t twiddleCoef_rfft_4096[4096];
|
||||
|
||||
|
||||
/* floating-point bit reversal tables */
|
||||
#define ARMBITREVINDEXTABLE__16_TABLE_LENGTH ((uint16_t)20 )
|
||||
#define ARMBITREVINDEXTABLE__32_TABLE_LENGTH ((uint16_t)48 )
|
||||
#define ARMBITREVINDEXTABLE__64_TABLE_LENGTH ((uint16_t)56 )
|
||||
#define ARMBITREVINDEXTABLE_128_TABLE_LENGTH ((uint16_t)208 )
|
||||
#define ARMBITREVINDEXTABLE_256_TABLE_LENGTH ((uint16_t)440 )
|
||||
#define ARMBITREVINDEXTABLE_512_TABLE_LENGTH ((uint16_t)448 )
|
||||
#define ARMBITREVINDEXTABLE1024_TABLE_LENGTH ((uint16_t)1800)
|
||||
#define ARMBITREVINDEXTABLE2048_TABLE_LENGTH ((uint16_t)3808)
|
||||
#define ARMBITREVINDEXTABLE4096_TABLE_LENGTH ((uint16_t)4032)
|
||||
|
||||
extern const uint16_t armBitRevIndexTable16[ARMBITREVINDEXTABLE__16_TABLE_LENGTH];
|
||||
extern const uint16_t armBitRevIndexTable32[ARMBITREVINDEXTABLE__32_TABLE_LENGTH];
|
||||
extern const uint16_t armBitRevIndexTable64[ARMBITREVINDEXTABLE__64_TABLE_LENGTH];
|
||||
extern const uint16_t armBitRevIndexTable128[ARMBITREVINDEXTABLE_128_TABLE_LENGTH];
|
||||
extern const uint16_t armBitRevIndexTable256[ARMBITREVINDEXTABLE_256_TABLE_LENGTH];
|
||||
extern const uint16_t armBitRevIndexTable512[ARMBITREVINDEXTABLE_512_TABLE_LENGTH];
|
||||
extern const uint16_t armBitRevIndexTable1024[ARMBITREVINDEXTABLE1024_TABLE_LENGTH];
|
||||
extern const uint16_t armBitRevIndexTable2048[ARMBITREVINDEXTABLE2048_TABLE_LENGTH];
|
||||
extern const uint16_t armBitRevIndexTable4096[ARMBITREVINDEXTABLE4096_TABLE_LENGTH];
|
||||
|
||||
/* fixed-point bit reversal tables */
|
||||
#define ARMBITREVINDEXTABLE_FIXED___16_TABLE_LENGTH ((uint16_t)12 )
|
||||
#define ARMBITREVINDEXTABLE_FIXED___32_TABLE_LENGTH ((uint16_t)24 )
|
||||
#define ARMBITREVINDEXTABLE_FIXED___64_TABLE_LENGTH ((uint16_t)56 )
|
||||
#define ARMBITREVINDEXTABLE_FIXED__128_TABLE_LENGTH ((uint16_t)112 )
|
||||
#define ARMBITREVINDEXTABLE_FIXED__256_TABLE_LENGTH ((uint16_t)240 )
|
||||
#define ARMBITREVINDEXTABLE_FIXED__512_TABLE_LENGTH ((uint16_t)480 )
|
||||
#define ARMBITREVINDEXTABLE_FIXED_1024_TABLE_LENGTH ((uint16_t)992 )
|
||||
#define ARMBITREVINDEXTABLE_FIXED_2048_TABLE_LENGTH ((uint16_t)1984)
|
||||
#define ARMBITREVINDEXTABLE_FIXED_4096_TABLE_LENGTH ((uint16_t)4032)
|
||||
|
||||
extern const uint16_t armBitRevIndexTable_fixed_16[ARMBITREVINDEXTABLE_FIXED___16_TABLE_LENGTH];
|
||||
extern const uint16_t armBitRevIndexTable_fixed_32[ARMBITREVINDEXTABLE_FIXED___32_TABLE_LENGTH];
|
||||
extern const uint16_t armBitRevIndexTable_fixed_64[ARMBITREVINDEXTABLE_FIXED___64_TABLE_LENGTH];
|
||||
extern const uint16_t armBitRevIndexTable_fixed_128[ARMBITREVINDEXTABLE_FIXED__128_TABLE_LENGTH];
|
||||
extern const uint16_t armBitRevIndexTable_fixed_256[ARMBITREVINDEXTABLE_FIXED__256_TABLE_LENGTH];
|
||||
extern const uint16_t armBitRevIndexTable_fixed_512[ARMBITREVINDEXTABLE_FIXED__512_TABLE_LENGTH];
|
||||
extern const uint16_t armBitRevIndexTable_fixed_1024[ARMBITREVINDEXTABLE_FIXED_1024_TABLE_LENGTH];
|
||||
extern const uint16_t armBitRevIndexTable_fixed_2048[ARMBITREVINDEXTABLE_FIXED_2048_TABLE_LENGTH];
|
||||
extern const uint16_t armBitRevIndexTable_fixed_4096[ARMBITREVINDEXTABLE_FIXED_4096_TABLE_LENGTH];
|
||||
|
||||
/* Tables for Fast Math Sine and Cosine */
|
||||
extern const float32_t sinTable_f32[FAST_MATH_TABLE_SIZE + 1];
|
||||
extern const q31_t sinTable_q31[FAST_MATH_TABLE_SIZE + 1];
|
||||
extern const q15_t sinTable_q15[FAST_MATH_TABLE_SIZE + 1];
|
||||
|
||||
#endif /* ARM_COMMON_TABLES_H */
|
||||
@@ -0,0 +1,79 @@
|
||||
/* ----------------------------------------------------------------------
|
||||
* Copyright (C) 2010-2014 ARM Limited. All rights reserved.
|
||||
*
|
||||
* $Date: 19. March 2015
|
||||
* $Revision: V.1.4.5
|
||||
*
|
||||
* Project: CMSIS DSP Library
|
||||
* Title: arm_const_structs.h
|
||||
*
|
||||
* Description: This file has constant structs that are initialized for
|
||||
* user convenience. For example, some can be given as
|
||||
* arguments to the arm_cfft_f32() function.
|
||||
*
|
||||
* Target Processor: Cortex-M4/Cortex-M3
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* - Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* - Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
* - Neither the name of ARM LIMITED nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this
|
||||
* software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
* -------------------------------------------------------------------- */
|
||||
|
||||
#ifndef _ARM_CONST_STRUCTS_H
|
||||
#define _ARM_CONST_STRUCTS_H
|
||||
|
||||
#include "arm_math.h"
|
||||
#include "arm_common_tables.h"
|
||||
|
||||
extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len16;
|
||||
extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len32;
|
||||
extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len64;
|
||||
extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len128;
|
||||
extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len256;
|
||||
extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len512;
|
||||
extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len1024;
|
||||
extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len2048;
|
||||
extern const arm_cfft_instance_f32 arm_cfft_sR_f32_len4096;
|
||||
|
||||
extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len16;
|
||||
extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len32;
|
||||
extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len64;
|
||||
extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len128;
|
||||
extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len256;
|
||||
extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len512;
|
||||
extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len1024;
|
||||
extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len2048;
|
||||
extern const arm_cfft_instance_q31 arm_cfft_sR_q31_len4096;
|
||||
|
||||
extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len16;
|
||||
extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len32;
|
||||
extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len64;
|
||||
extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len128;
|
||||
extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len256;
|
||||
extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len512;
|
||||
extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len1024;
|
||||
extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len2048;
|
||||
extern const arm_cfft_instance_q15 arm_cfft_sR_q15_len4096;
|
||||
|
||||
#endif
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,87 @@
|
||||
/**************************************************************************//**
|
||||
* @file core_cmFunc.h
|
||||
* @brief CMSIS Cortex-M Core Function Access Header File
|
||||
* @version V4.30
|
||||
* @date 20. October 2015
|
||||
******************************************************************************/
|
||||
/* Copyright (c) 2009 - 2015 ARM LIMITED
|
||||
|
||||
All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
- Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
- Neither the name of ARM nor the names of its contributors may be used
|
||||
to endorse or promote products derived from this software without
|
||||
specific prior written permission.
|
||||
*
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
---------------------------------------------------------------------------*/
|
||||
|
||||
|
||||
#if defined ( __ICCARM__ )
|
||||
#pragma system_include /* treat file as system include file for MISRA check */
|
||||
#elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)
|
||||
#pragma clang system_header /* treat file as system include file */
|
||||
#endif
|
||||
|
||||
#ifndef __CORE_CMFUNC_H
|
||||
#define __CORE_CMFUNC_H
|
||||
|
||||
|
||||
/* ########################### Core Function Access ########################### */
|
||||
/** \ingroup CMSIS_Core_FunctionInterface
|
||||
\defgroup CMSIS_Core_RegAccFunctions CMSIS Core Register Access Functions
|
||||
@{
|
||||
*/
|
||||
|
||||
/*------------------ RealView Compiler -----------------*/
|
||||
#if defined ( __CC_ARM )
|
||||
#include "cmsis_armcc.h"
|
||||
|
||||
/*------------------ ARM Compiler V6 -------------------*/
|
||||
#elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)
|
||||
#include "cmsis_armcc_V6.h"
|
||||
|
||||
/*------------------ GNU Compiler ----------------------*/
|
||||
#elif defined ( __GNUC__ )
|
||||
#include "cmsis_gcc.h"
|
||||
|
||||
/*------------------ ICC Compiler ----------------------*/
|
||||
#elif defined ( __ICCARM__ )
|
||||
#include <cmsis_iar.h>
|
||||
|
||||
/*------------------ TI CCS Compiler -------------------*/
|
||||
#elif defined ( __TMS470__ )
|
||||
#include <cmsis_ccs.h>
|
||||
|
||||
/*------------------ TASKING Compiler ------------------*/
|
||||
#elif defined ( __TASKING__ )
|
||||
/*
|
||||
* The CMSIS functions have been implemented as intrinsics in the compiler.
|
||||
* Please use "carm -?i" to get an up to date list of all intrinsics,
|
||||
* Including the CMSIS ones.
|
||||
*/
|
||||
|
||||
/*------------------ COSMIC Compiler -------------------*/
|
||||
#elif defined ( __CSMC__ )
|
||||
#include <cmsis_csm.h>
|
||||
|
||||
#endif
|
||||
|
||||
/*@} end of CMSIS_Core_RegAccFunctions */
|
||||
|
||||
#endif /* __CORE_CMFUNC_H */
|
||||
@@ -0,0 +1,87 @@
|
||||
/**************************************************************************//**
|
||||
* @file core_cmInstr.h
|
||||
* @brief CMSIS Cortex-M Core Instruction Access Header File
|
||||
* @version V4.30
|
||||
* @date 20. October 2015
|
||||
******************************************************************************/
|
||||
/* Copyright (c) 2009 - 2015 ARM LIMITED
|
||||
|
||||
All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
- Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
- Neither the name of ARM nor the names of its contributors may be used
|
||||
to endorse or promote products derived from this software without
|
||||
specific prior written permission.
|
||||
*
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
---------------------------------------------------------------------------*/
|
||||
|
||||
|
||||
#if defined ( __ICCARM__ )
|
||||
#pragma system_include /* treat file as system include file for MISRA check */
|
||||
#elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)
|
||||
#pragma clang system_header /* treat file as system include file */
|
||||
#endif
|
||||
|
||||
#ifndef __CORE_CMINSTR_H
|
||||
#define __CORE_CMINSTR_H
|
||||
|
||||
|
||||
/* ########################## Core Instruction Access ######################### */
|
||||
/** \defgroup CMSIS_Core_InstructionInterface CMSIS Core Instruction Interface
|
||||
Access to dedicated instructions
|
||||
@{
|
||||
*/
|
||||
|
||||
/*------------------ RealView Compiler -----------------*/
|
||||
#if defined ( __CC_ARM )
|
||||
#include "cmsis_armcc.h"
|
||||
|
||||
/*------------------ ARM Compiler V6 -------------------*/
|
||||
#elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)
|
||||
#include "cmsis_armcc_V6.h"
|
||||
|
||||
/*------------------ GNU Compiler ----------------------*/
|
||||
#elif defined ( __GNUC__ )
|
||||
#include "cmsis_gcc.h"
|
||||
|
||||
/*------------------ ICC Compiler ----------------------*/
|
||||
#elif defined ( __ICCARM__ )
|
||||
#include <cmsis_iar.h>
|
||||
|
||||
/*------------------ TI CCS Compiler -------------------*/
|
||||
#elif defined ( __TMS470__ )
|
||||
#include <cmsis_ccs.h>
|
||||
|
||||
/*------------------ TASKING Compiler ------------------*/
|
||||
#elif defined ( __TASKING__ )
|
||||
/*
|
||||
* The CMSIS functions have been implemented as intrinsics in the compiler.
|
||||
* Please use "carm -?i" to get an up to date list of all intrinsics,
|
||||
* Including the CMSIS ones.
|
||||
*/
|
||||
|
||||
/*------------------ COSMIC Compiler -------------------*/
|
||||
#elif defined ( __CSMC__ )
|
||||
#include <cmsis_csm.h>
|
||||
|
||||
#endif
|
||||
|
||||
/*@}*/ /* end of group CMSIS_Core_InstructionInterface */
|
||||
|
||||
#endif /* __CORE_CMINSTR_H */
|
||||
@@ -0,0 +1,96 @@
|
||||
/**************************************************************************//**
|
||||
* @file core_cmSimd.h
|
||||
* @brief CMSIS Cortex-M SIMD Header File
|
||||
* @version V4.30
|
||||
* @date 20. October 2015
|
||||
******************************************************************************/
|
||||
/* Copyright (c) 2009 - 2015 ARM LIMITED
|
||||
|
||||
All rights reserved.
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
- Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
- Neither the name of ARM nor the names of its contributors may be used
|
||||
to endorse or promote products derived from this software without
|
||||
specific prior written permission.
|
||||
*
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
---------------------------------------------------------------------------*/
|
||||
|
||||
|
||||
#if defined ( __ICCARM__ )
|
||||
#pragma system_include /* treat file as system include file for MISRA check */
|
||||
#elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)
|
||||
#pragma clang system_header /* treat file as system include file */
|
||||
#endif
|
||||
|
||||
#ifndef __CORE_CMSIMD_H
|
||||
#define __CORE_CMSIMD_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
/* ################### Compiler specific Intrinsics ########################### */
|
||||
/** \defgroup CMSIS_SIMD_intrinsics CMSIS SIMD Intrinsics
|
||||
Access to dedicated SIMD instructions
|
||||
@{
|
||||
*/
|
||||
|
||||
/*------------------ RealView Compiler -----------------*/
|
||||
#if defined ( __CC_ARM )
|
||||
#include "cmsis_armcc.h"
|
||||
|
||||
/*------------------ ARM Compiler V6 -------------------*/
|
||||
#elif defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)
|
||||
#include "cmsis_armcc_V6.h"
|
||||
|
||||
/*------------------ GNU Compiler ----------------------*/
|
||||
#elif defined ( __GNUC__ )
|
||||
#include "cmsis_gcc.h"
|
||||
|
||||
/*------------------ ICC Compiler ----------------------*/
|
||||
#elif defined ( __ICCARM__ )
|
||||
#include <cmsis_iar.h>
|
||||
|
||||
/*------------------ TI CCS Compiler -------------------*/
|
||||
#elif defined ( __TMS470__ )
|
||||
#include <cmsis_ccs.h>
|
||||
|
||||
/*------------------ TASKING Compiler ------------------*/
|
||||
#elif defined ( __TASKING__ )
|
||||
/*
|
||||
* The CMSIS functions have been implemented as intrinsics in the compiler.
|
||||
* Please use "carm -?i" to get an up to date list of all intrinsics,
|
||||
* Including the CMSIS ones.
|
||||
*/
|
||||
|
||||
/*------------------ COSMIC Compiler -------------------*/
|
||||
#elif defined ( __CSMC__ )
|
||||
#include <cmsis_csm.h>
|
||||
|
||||
#endif
|
||||
|
||||
/*@} end of group CMSIS_SIMD_intrinsics */
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __CORE_CMSIMD_H */
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,16 @@
|
||||
import rtconfig
|
||||
Import('RTT_ROOT')
|
||||
from building import *
|
||||
|
||||
# get current directory
|
||||
cwd = GetCurrentDir()
|
||||
|
||||
# The set of source files associated with this SConscript file.
|
||||
src = Split("""
|
||||
""")
|
||||
|
||||
path = [cwd + '/Include',]
|
||||
|
||||
group = DefineGroup('CMSIS', src, depend = [''], CPPPATH = path)
|
||||
|
||||
Return('group')
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,17 @@
|
||||
/**************************************************************************//**
|
||||
* @file NuMicro.h
|
||||
* @version V1.00
|
||||
* @brief NuMicro peripheral access layer header file.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
* @copyright (C) 2017-2020 Nuvoton Technology Corp. All rights reserved.
|
||||
*****************************************************************************/
|
||||
#ifndef __NUMICRO_H__
|
||||
#define __NUMICRO_H__
|
||||
|
||||
#include "nutool_clkcfg.h"
|
||||
#include "M480.h"
|
||||
|
||||
#endif /* __NUMICRO_H__ */
|
||||
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,150 @@
|
||||
/**************************************************************************//**
|
||||
* @file crc_reg.h
|
||||
* @version V1.00
|
||||
* @brief CRC register definition header file
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
* @copyright (C) 2017-2020 Nuvoton Technology Corp. All rights reserved.
|
||||
*****************************************************************************/
|
||||
#ifndef __CRC_REG_H__
|
||||
#define __CRC_REG_H__
|
||||
|
||||
#if defined ( __CC_ARM )
|
||||
#pragma anon_unions
|
||||
#endif
|
||||
|
||||
/**
|
||||
@addtogroup REGISTER Control Register
|
||||
@{
|
||||
*/
|
||||
|
||||
/**
|
||||
@addtogroup CRC Cyclic Redundancy Check Controller(CRC)
|
||||
Memory Mapped Structure for CRC Controller
|
||||
@{ */
|
||||
|
||||
typedef struct
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* @var CRC_T::CTL
|
||||
* Offset: 0x00 CRC Control Register
|
||||
* ---------------------------------------------------------------------------------------------------
|
||||
* |Bits |Field |Descriptions
|
||||
* | :----: | :----: | :---- |
|
||||
* |[0] |CRCEN |CRC Channel Enable Bit
|
||||
* | | |0 = No effect.
|
||||
* | | |1 = CRC operation Enabled.
|
||||
* |[1] |CHKSINIT |Checksum Initialization
|
||||
* | | |0 = No effect.
|
||||
* | | |1 = Initial checksum value by auto reload CRC_SEED register value to CRC_CHECKSUM register value.
|
||||
* | | |Note: This bit will be cleared automatically.
|
||||
* |[24] |DATREV |Write Data Bit Order Reverse
|
||||
* | | |This bit is used to enable the bit order reverse function per byte for write data value in CRC_DAT register.
|
||||
* | | |0 = Bit order reversed for CRC write data in Disabled.
|
||||
* | | |1 = Bit order reversed for CRC write data in Enabled (per byte).
|
||||
* | | |Note: If the write data is 0xAABBCCDD, the bit order reverse for CRC write data in is 0x55DD33BB.
|
||||
* |[25] |CHKSREV |Checksum Bit Order Reverse
|
||||
* | | |This bit is used to enable the bit order reverse function for checksum result in CRC_CHECKSUM register.
|
||||
* | | |0 = Bit order reverse for CRC checksum Disabled.
|
||||
* | | |1 = Bit order reverse for CRC checksum Enabled.
|
||||
* | | |Note: If the checksum result is 0xDD7B0F2E, the bit order reverse for CRC checksum is 0x74F0DEBB.
|
||||
* |[26] |DATFMT |Write Data 1's Complement
|
||||
* | | |This bit is used to enable the 1's complement function for write data value in CRC_DAT register.
|
||||
* | | |0 = 1's complement for CRC writes data in Disabled.
|
||||
* | | |1 = 1's complement for CRC writes data in Enabled.
|
||||
* |[27] |CHKSFMT |Checksum 1's Complement
|
||||
* | | |This bit is used to enable the 1's complement function for checksum result in CRC_CHECKSUM register.
|
||||
* | | |0 = 1's complement for CRC checksum Disabled.
|
||||
* | | |1 = 1's complement for CRC checksum Enabled.
|
||||
* |[29:28] |DATLEN |CPU Write Data Length
|
||||
* | | |This field indicates the write data length.
|
||||
* | | |00 = Data length is 8-bit mode.
|
||||
* | | |01 = Data length is 16-bit mode.
|
||||
* | | |1x = Data length is 32-bit mode.
|
||||
* | | |Note: When the write data length is 8-bit mode, the valid data in CRC_DAT register is only DATA[7:0] bits; if the write data length is 16-bit mode, the valid data in CRC_DAT register is only DATA[15:0]
|
||||
* |[31:30] |CRCMODE |CRC Polynomial Mode
|
||||
* | | |This field indicates the CRC operation polynomial mode.
|
||||
* | | |00 = CRC-CCITT Polynomial mode.
|
||||
* | | |01 = CRC-8 Polynomial mode.
|
||||
* | | |10 = CRC-16 Polynomial mode.
|
||||
* | | |11 = CRC-32 Polynomial mode.
|
||||
* @var CRC_T::DAT
|
||||
* Offset: 0x04 CRC Write Data Register
|
||||
* ---------------------------------------------------------------------------------------------------
|
||||
* |Bits |Field |Descriptions
|
||||
* | :----: | :----: | :---- |
|
||||
* |[31:0] |DATA |CRC Write Data Bits
|
||||
* | | |User can write data directly by CPU mode or use PDMA function to write data to this field to perform CRC operation.
|
||||
* | | |Note: When the write data length is 8-bit mode, the valid data in CRC_DAT register is only DATA[7:0] bits; if the write data length is 16-bit mode, the valid data in CRC_DAT register is only DATA[15:0].
|
||||
* @var CRC_T::SEED
|
||||
* Offset: 0x08 CRC Seed Register
|
||||
* ---------------------------------------------------------------------------------------------------
|
||||
* |Bits |Field |Descriptions
|
||||
* | :----: | :----: | :---- |
|
||||
* |[31:0] |SEED |CRC Seed Value
|
||||
* | | |This field indicates the CRC seed value.
|
||||
* | | |Note: This field will be reloaded as checksum initial value (CRC_CHECKSUM register) after perform CHKSINIT (CRC_CTL[1]).
|
||||
* @var CRC_T::CHECKSUM
|
||||
* Offset: 0x0C CRC Checksum Register
|
||||
* ---------------------------------------------------------------------------------------------------
|
||||
* |Bits |Field |Descriptions
|
||||
* | :----: | :----: | :---- |
|
||||
* |[31:0] |CHECKSUM |CRC Checksum Results
|
||||
* | | |This field indicates the CRC checksum result.
|
||||
*/
|
||||
__IO uint32_t CTL; /*!< [0x0000] CRC Control Register */
|
||||
__IO uint32_t DAT; /*!< [0x0004] CRC Write Data Register */
|
||||
__IO uint32_t SEED; /*!< [0x0008] CRC Seed Register */
|
||||
__I uint32_t CHECKSUM; /*!< [0x000c] CRC Checksum Register */
|
||||
|
||||
} CRC_T;
|
||||
|
||||
/**
|
||||
@addtogroup CRC_CONST CRC Bit Field Definition
|
||||
Constant Definitions for CRC Controller
|
||||
@{ */
|
||||
|
||||
#define CRC_CTL_CRCEN_Pos (0) /*!< CRC_T::CTL: CRCEN Position */
|
||||
#define CRC_CTL_CRCEN_Msk (0x1ul << CRC_CTL_CRCEN_Pos) /*!< CRC_T::CTL: CRCEN Mask */
|
||||
|
||||
#define CRC_CTL_CHKSINIT_Pos (1) /*!< CRC_T::CTL: CHKSINIT Position */
|
||||
#define CRC_CTL_CHKSINIT_Msk (0x1ul << CRC_CTL_CHKSINIT_Pos) /*!< CRC_T::CTL: CHKSINIT Mask */
|
||||
|
||||
#define CRC_CTL_DATREV_Pos (24) /*!< CRC_T::CTL: DATREV Position */
|
||||
#define CRC_CTL_DATREV_Msk (0x1ul << CRC_CTL_DATREV_Pos) /*!< CRC_T::CTL: DATREV Mask */
|
||||
|
||||
#define CRC_CTL_CHKSREV_Pos (25) /*!< CRC_T::CTL: CHKSREV Position */
|
||||
#define CRC_CTL_CHKSREV_Msk (0x1ul << CRC_CTL_CHKSREV_Pos) /*!< CRC_T::CTL: CHKSREV Mask */
|
||||
|
||||
#define CRC_CTL_DATFMT_Pos (26) /*!< CRC_T::CTL: DATFMT Position */
|
||||
#define CRC_CTL_DATFMT_Msk (0x1ul << CRC_CTL_DATFMT_Pos) /*!< CRC_T::CTL: DATFMT Mask */
|
||||
|
||||
#define CRC_CTL_CHKSFMT_Pos (27) /*!< CRC_T::CTL: CHKSFMT Position */
|
||||
#define CRC_CTL_CHKSFMT_Msk (0x1ul << CRC_CTL_CHKSFMT_Pos) /*!< CRC_T::CTL: CHKSFMT Mask */
|
||||
|
||||
#define CRC_CTL_DATLEN_Pos (28) /*!< CRC_T::CTL: DATLEN Position */
|
||||
#define CRC_CTL_DATLEN_Msk (0x3ul << CRC_CTL_DATLEN_Pos) /*!< CRC_T::CTL: DATLEN Mask */
|
||||
|
||||
#define CRC_CTL_CRCMODE_Pos (30) /*!< CRC_T::CTL: CRCMODE Position */
|
||||
#define CRC_CTL_CRCMODE_Msk (0x3ul << CRC_CTL_CRCMODE_Pos) /*!< CRC_T::CTL: CRCMODE Mask */
|
||||
|
||||
#define CRC_DAT_DATA_Pos (0) /*!< CRC_T::DAT: DATA Position */
|
||||
#define CRC_DAT_DATA_Msk (0xfffffffful << CRC_DAT_DATA_Pos) /*!< CRC_T::DAT: DATA Mask */
|
||||
|
||||
#define CRC_SEED_SEED_Pos (0) /*!< CRC_T::SEED: SEED Position */
|
||||
#define CRC_SEED_SEED_Msk (0xfffffffful << CRC_SEED_SEED_Pos) /*!< CRC_T::SEED: SEED Mask */
|
||||
|
||||
#define CRC_CHECKSUM_CHECKSUM_Pos (0) /*!< CRC_T::CHECKSUM: CHECKSUM Position */
|
||||
#define CRC_CHECKSUM_CHECKSUM_Msk (0xfffffffful << CRC_CHECKSUM_CHECKSUM_Pos) /*!< CRC_T::CHECKSUM: CHECKSUM Mask */
|
||||
|
||||
/**@}*/ /* CRC_CONST */
|
||||
/**@}*/ /* end of CRC register group */
|
||||
/**@}*/ /* end of REGISTER group */
|
||||
|
||||
#if defined ( __CC_ARM )
|
||||
#pragma no_anon_unions
|
||||
#endif
|
||||
|
||||
#endif /* __CRC_REG_H__ */
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,76 @@
|
||||
/**************************************************************************//**
|
||||
* @file system_M480.h
|
||||
* @version V1.00
|
||||
* @brief CMSIS Cortex-M4 Core Peripheral Access Layer Header File for M480
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
* @copyright (C) 2017-2020 Nuvoton Technology Corp. All rights reserved.
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef __SYSTEM_M480_H__
|
||||
#define __SYSTEM_M480_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Define clocks
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef __HSI
|
||||
#define __HSI (12000000UL) /*!< PLL default output is 50MHz */
|
||||
#endif
|
||||
|
||||
#ifndef __HXT
|
||||
#define __HXT (12000000UL) /*!< External Crystal Clock Frequency */
|
||||
#endif
|
||||
|
||||
#ifndef __LXT
|
||||
#define __LXT (32768UL) /*!< External Crystal Clock Frequency 32.768KHz */
|
||||
#endif
|
||||
|
||||
#define __HIRC (12000000UL) /*!< Internal 12M RC Oscillator Frequency */
|
||||
#define __LIRC (10000UL) /*!< Internal 10K RC Oscillator Frequency */
|
||||
#define __SYS_OSC_CLK ( ___HSI) /* Main oscillator frequency */
|
||||
|
||||
|
||||
#define __SYSTEM_CLOCK (1UL*__HXT)
|
||||
|
||||
extern uint32_t SystemCoreClock; /*!< System Clock Frequency (Core Clock) */
|
||||
extern uint32_t CyclesPerUs; /*!< Cycles per micro second */
|
||||
extern uint32_t PllClock; /*!< PLL Output Clock Frequency */
|
||||
|
||||
|
||||
/**
|
||||
* Initialize the system
|
||||
*
|
||||
* @param none
|
||||
* @return none
|
||||
*
|
||||
* @brief Setup the micro controller system.
|
||||
* Initialize the System and update the SystemCoreClock variable.
|
||||
*/
|
||||
extern void SystemInit (void);
|
||||
|
||||
/**
|
||||
* Update SystemCoreClock variable
|
||||
*
|
||||
* @param none
|
||||
* @return none
|
||||
*
|
||||
* @brief Updates the SystemCoreClock with current core Clock
|
||||
* retrieved from cpu registers.
|
||||
*/
|
||||
extern void SystemCoreClockUpdate (void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __SYSTEM_M480_H__ */
|
||||
|
||||
/*** (C) COPYRIGHT 2016 Nuvoton Technology Corp. ***/
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,138 @@
|
||||
/**************************************************************************//**
|
||||
* @file trng_reg.h
|
||||
* @version V1.00
|
||||
* @brief TRNG register definition header file
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
* @copyright (C) 2017-2020 Nuvoton Technology Corp. All rights reserved.
|
||||
*****************************************************************************/
|
||||
#ifndef __TRNG_REG_H__
|
||||
#define __TRNG_REG_H__
|
||||
|
||||
/** @addtogroup REGISTER Control Register
|
||||
|
||||
@{
|
||||
|
||||
*/
|
||||
|
||||
/*---------------------- True Random Number Generator -------------------------*/
|
||||
/**
|
||||
@addtogroup TRNG True Random Number Generator(TRNG)
|
||||
Memory Mapped Structure for TRNG Controller
|
||||
@{ */
|
||||
|
||||
typedef struct
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* @var TRNG_T::CTL
|
||||
* Offset: 0x00 TRNG Control Register and Status
|
||||
* ---------------------------------------------------------------------------------------------------
|
||||
* |Bits |Field |Descriptions
|
||||
* | :----: | :----: | :---- |
|
||||
* |[0] |TRNGEN |Random Number Generator Enable Bit
|
||||
* | | |This bit can be set to 1 only after ACT (TRNG_ACT[7]) bit was set to 1 and READY (TRNG_CTL[7]) bit became 1.
|
||||
* | | |0 = TRNG disabled.
|
||||
* | | |1 = TRNG enabled.
|
||||
* | | |Note: TRNGEN is an enable bit of digital part
|
||||
* | | |When TRNG is not required to generate random number, TRNGEN bit and ACT (TRNG_ACT[7]) bit should be set to 0 to reduce power consumption.
|
||||
* |[1] |DVIF |Data Valid (Read Only)
|
||||
* | | |0 = Data is not valid. Reading from RNGD returns 0x00000000.
|
||||
* | | |1 = Data is valid. A valid random number can be read form RNGD.
|
||||
* | | |This bit is cleared to u20180u2019 by read TRNG_DATA.
|
||||
* |[5:2] |CLKP |Clock Prescaler
|
||||
* | | |The CLKP is the peripheral clock frequency range for the selected value , the CLKP must higher than or equal to the actual peripheral clock frequency (for correct random bit generation)
|
||||
* | | |To change the CLKP contents, first set TRNGEN bit to 0 and then change CLKP; finally, set TRNGEN bit to 1 to re-enable the TRNG module.
|
||||
* | | |0000 = 80 ~ 100 MHz.
|
||||
* | | |0001 = 60 ~ 80 MHz.
|
||||
* | | |0010 = 50 ~60 MHz.
|
||||
* | | |0011 = 40 ~50 MHz.
|
||||
* | | |0100 = 30 ~40 MHz.
|
||||
* | | |0101 = 25 ~30 MHz.
|
||||
* | | |0110 = 20 ~25 MHz.
|
||||
* | | |0111 = 15 ~20 MHz.
|
||||
* | | |1000 = 12 ~15 MHz.
|
||||
* | | |1001 = 9 ~12 MHz.
|
||||
* | | |1010 = 7 ~9 MHz.
|
||||
* | | |1011 = 6 ~7 MHz.
|
||||
* | | |1100 = 5 ~6 MHz.
|
||||
* | | |1101 = 4 ~5 MHz.
|
||||
* | | |1111 = Reserved.
|
||||
* |[6] |DVIEN |Data Valid Interrupt Enable Bit
|
||||
* | | |0 = Interrupt disabled..
|
||||
* | | |1 = Interrupt enabled.
|
||||
* |[7] |READY |Random Number Generator Ready (Read Only)
|
||||
* | | |After ACT (TRNG_ACT[7]) bit is set, the READY bit become to 1 after a delay of 90us~120us.
|
||||
* | | |0 = RNG is not ready or was not activated.
|
||||
* | | |1 = RNG is ready to be enabled..
|
||||
* |[31:8] |Reversed |Reversed
|
||||
* @var TRNG_T::DATA
|
||||
* Offset: 0x04 TRNG Data Register
|
||||
* ---------------------------------------------------------------------------------------------------
|
||||
* |Bits |Field |Descriptions
|
||||
* | :----: | :----: | :---- |
|
||||
* |[7:0] |DATA |Random Number Generator Data (Read Only)
|
||||
* | | |The DATA store the random number generated by TRNG and can be read only once.
|
||||
* @var TRNG_T::ACT
|
||||
* Offset: 0x0C TRNG Activation Register
|
||||
* ---------------------------------------------------------------------------------------------------
|
||||
* |Bits |Field |Descriptions
|
||||
* | :----: | :----: | :---- |
|
||||
* |[6:0] |VER |TRNG Version
|
||||
* | | |TRNG version number is dependent on TRNG module.
|
||||
* | | |0x02:(Current Version Number)
|
||||
* |[7] |ACT |Random Number Generator Activation
|
||||
* | | |After enable the ACT bit, it will active the TRNG module and wait the READY (TRNG_CTL[7]) bit to become 1.
|
||||
* | | |0 = TRNG inactive.
|
||||
* | | |1 = TRNG active.
|
||||
* | | |Note: ACT is an enable bit of analog part
|
||||
* | | |When TRNG is not required to generate random number, TRNGEN (TRNG_CTL[0]) bit and ACT bit should be set to 0 to reduce power consumption.
|
||||
*/
|
||||
__IO uint32_t CTL; /*!< [0x0000] TRNG Control Register and Status */
|
||||
__I uint32_t DATA; /*!< [0x0004] TRNG Data Register */
|
||||
/// @cond HIDDEN_SYMBOLS
|
||||
__I uint32_t RESERVE0[1];
|
||||
/// @endcond //HIDDEN_SYMBOLS
|
||||
__IO uint32_t ACT; /*!< [0x000c] TRNG Activation Register */
|
||||
|
||||
} TRNG_T;
|
||||
|
||||
/**
|
||||
@addtogroup TRNG_CONST TRNG Bit Field Definition
|
||||
Constant Definitions for TRNG Controller
|
||||
@{ */
|
||||
|
||||
#define TRNG_CTL_TRNGEN_Pos (0) /*!< TRNG_T::CTL: TRNGEN Position */
|
||||
#define TRNG_CTL_TRNGEN_Msk (0x1ul << TRNG_CTL_TRNGEN_Pos) /*!< TRNG_T::CTL: TRNGEN Mask */
|
||||
|
||||
#define TRNG_CTL_DVIF_Pos (1) /*!< TRNG_T::CTL: DVIF Position */
|
||||
#define TRNG_CTL_DVIF_Msk (0x1ul << TRNG_CTL_DVIF_Pos) /*!< TRNG_T::CTL: DVIF Mask */
|
||||
|
||||
#define TRNG_CTL_CLKP_Pos (2) /*!< TRNG_T::CTL: CLKP Position */
|
||||
#define TRNG_CTL_CLKP_Msk (0xful << TRNG_CTL_CLKP_Pos) /*!< TRNG_T::CTL: CLKP Mask */
|
||||
|
||||
#define TRNG_CTL_DVIEN_Pos (6) /*!< TRNG_T::CTL: DVIEN Position */
|
||||
#define TRNG_CTL_DVIEN_Msk (0x1ul << TRNG_CTL_DVIEN_Pos) /*!< TRNG_T::CTL: DVIEN Mask */
|
||||
|
||||
#define TRNG_CTL_READY_Pos (7) /*!< TRNG_T::CTL: READY Position */
|
||||
#define TRNG_CTL_READY_Msk (0x1ul << TRNG_CTL_READY_Pos) /*!< TRNG_T::CTL: READY Mask */
|
||||
|
||||
#define TRNG_CTL_Reversed_Pos (8) /*!< TRNG_T::CTL: Reversed Position */
|
||||
#define TRNG_CTL_Reversed_Msk (0xfffffful << TRNG_CTL_Reversed_Pos) /*!< TRNG_T::CTL: Reversed Mask */
|
||||
|
||||
#define TRNG_DATA_DATA_Pos (0) /*!< TRNG_T::DATA: DATA Position */
|
||||
#define TRNG_DATA_DATA_Msk (0xfful << TRNG_DATA_DATA_Pos) /*!< TRNG_T::DATA: DATA Mask */
|
||||
|
||||
#define TRNG_ACT_VER_Pos (0) /*!< TRNG_T::ACT: VER Position */
|
||||
#define TRNG_ACT_VER_Msk (0x7ful << TRNG_ACT_VER_Pos) /*!< TRNG_T::ACT: VER Mask */
|
||||
|
||||
#define TRNG_ACT_ACT_Pos (7) /*!< TRNG_T::ACT: ACT Position */
|
||||
#define TRNG_ACT_ACT_Msk (0x1ul << TRNG_ACT_ACT_Pos) /*!< TRNG_T::ACT: ACT Mask */
|
||||
|
||||
/**@}*/ /* TRNG_CONST */
|
||||
/**@}*/ /* end of TRNG register group */
|
||||
/**@}*/ /* end of REGISTER group */
|
||||
|
||||
|
||||
#endif /* __TRNG_REG_H__ */
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,183 @@
|
||||
/**************************************************************************//**
|
||||
* @file wdt_reg.h
|
||||
* @version V1.00
|
||||
* @brief WDT register definition header file
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
* @copyright (C) 2017-2020 Nuvoton Technology Corp. All rights reserved.
|
||||
*****************************************************************************/
|
||||
#ifndef __WDT_REG_H__
|
||||
#define __WDT_REG_H__
|
||||
|
||||
#if defined ( __CC_ARM )
|
||||
#pragma anon_unions
|
||||
#endif
|
||||
|
||||
/**
|
||||
@addtogroup REGISTER Control Register
|
||||
@{
|
||||
*/
|
||||
|
||||
/**
|
||||
@addtogroup WDT Watch Dog Timer Controller(WDT)
|
||||
Memory Mapped Structure for WDT Controller
|
||||
@{ */
|
||||
|
||||
typedef struct
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* @var WDT_T::CTL
|
||||
* Offset: 0x00 WDT Control Register
|
||||
* ---------------------------------------------------------------------------------------------------
|
||||
* |Bits |Field |Descriptions
|
||||
* | :----: | :----: | :---- |
|
||||
* |[0] |RSTCNT |Reset WDT Up Counter (Write Protect)
|
||||
* | | |0 = No effect.
|
||||
* | | |1 = Reset the internal 18-bit WDT up counter value.
|
||||
* | | |Note1: This bit is write protected. Refer to the SYS_REGLCTL register.
|
||||
* | | |Note2: This bit will be automatically cleared by hardware.
|
||||
* |[1] |RSTEN |WDT Time-out Reset Enable Control (Write Protect)
|
||||
* | | |Setting this bit will enable the WDT time-out reset function If the WDT up counter value has not been cleared after the specific WDT reset delay period expires.
|
||||
* | | |0 = WDT time-out reset function Disabled.
|
||||
* | | |1 = WDT time-out reset function Enabled.
|
||||
* | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register.
|
||||
* |[2] |RSTF |WDT Time-out Reset Flag
|
||||
* | | |This bit indicates the system has been reset by WDT time-out reset or not.
|
||||
* | | |0 = WDT time-out reset did not occur.
|
||||
* | | |1 = WDT time-out reset occurred.
|
||||
* | | |Note: This bit is cleared by writing 1 to it.
|
||||
* |[3] |IF |WDT Time-out Interrupt Flag
|
||||
* | | |This bit will set to 1 while WDT up counter value reaches the selected WDT time-out interval
|
||||
* | | |0 = WDT time-out interrupt did not occur.
|
||||
* | | |1 = WDT time-out interrupt occurred.
|
||||
* | | |Note: This bit is cleared by writing 1 to it.
|
||||
* |[4] |WKEN |WDT Time-out Wake-up Function Control (Write Protect)
|
||||
* | | |If this bit is set to 1, while WDT time-out interrupt flag IF (WDT_CTL[3]) is generated to 1 and interrupt enable bit INTEN (WDT_CTL[6]) is enabled, the WDT time-out interrupt signal will generate a wake-up trigger event to chip.
|
||||
* | | |0 = Wake-up trigger event Disabled if WDT time-out interrupt signal generated.
|
||||
* | | |1 = Wake-up trigger event Enabled if WDT time-out interrupt signal generated.
|
||||
* | | |Note1: This bit is write protected. Refer to the SYS_REGLCTL register.
|
||||
* | | |Note2: Chip can be woken-up by WDT time-out interrupt signal generated only if WDT clock source is selected to 10 kHz internal low speed RC oscillator (LIRC) or LXT.
|
||||
* |[5] |WKF |WDT Time-out Wake-up Flag (Write Protect)
|
||||
* | | |This bit indicates the interrupt wake-up flag status of WDT
|
||||
* | | |0 = WDT does not cause chip wake-up.
|
||||
* | | |1 = Chip wake-up from Idle or Power-down mode if WDT time-out interrupt signal generated.
|
||||
* | | |Note1: This bit is write protected. Refer to the SYS_REGLCTL register.
|
||||
* | | |Note2: This bit is cleared by writing 1 to it.
|
||||
* |[6] |INTEN |WDT Time-out Interrupt Enable Control (Write Protect)
|
||||
* | | |If this bit is enabled, the WDT time-out interrupt signal is generated and inform to CPU.
|
||||
* | | |0 = WDT time-out interrupt Disabled.
|
||||
* | | |1 = WDT time-out interrupt Enabled.
|
||||
* | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register.
|
||||
* |[7] |WDTEN |WDT Enable Control (Write Protect)
|
||||
* | | |0 = WDT Disabled (This action will reset the internal up counter value).
|
||||
* | | |1 = WDT Enabled.
|
||||
* | | |Note1: This bit is write protected. Refer to the SYS_REGLCTL register.
|
||||
* | | |Note2: If CWDTEN[2:0] (combined by Config0[31] and Config0[4:3]) bits is not configure to 111, this bit is forced as 1 and user cannot change this bit to 0.
|
||||
* |[10:8] |TOUTSEL |WDT Time-out Interval Selection (Write Protect)
|
||||
* | | |These three bits select the time-out interval period for the WDT.
|
||||
* | | |000 = 24 * WDT_CLK.
|
||||
* | | |001 = 26 * WDT_CLK.
|
||||
* | | |010 = 28 * WDT_CLK.
|
||||
* | | |011 = 210 * WDT_CLK.
|
||||
* | | |100 = 212 * WDT_CLK.
|
||||
* | | |101 = 214 * WDT_CLK.
|
||||
* | | |110 = 216 * WDT_CLK.
|
||||
* | | |111 = 218 * WDT_CLK.
|
||||
* | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register.
|
||||
* |[30] |SYNC |WDT Enable Control SYNC Flag Indicator (Read Only)
|
||||
* | | |If user execute enable/disable WDTEN (WDT_CTL[7]), this flag can be indicated enable/disable WDTEN function is completed or not.
|
||||
* | | |0 = Set WDTEN bit is completed.
|
||||
* | | |1 = Set WDTEN bit is synchronizing and not become active yet..
|
||||
* | | |Note: Perform enable or disable WDTEN bit needs 2 * WDT_CLK period to become active.
|
||||
* |[31] |ICEDEBUG |ICE Debug Mode Acknowledge Disable Control (Write Protect)
|
||||
* | | |0 = ICE debug mode acknowledgement affects WDT counting.
|
||||
* | | |WDT up counter will be held while CPU is held by ICE.
|
||||
* | | |1 = ICE debug mode acknowledgement Disabled.
|
||||
* | | |WDT up counter will keep going no matter CPU is held by ICE or not.
|
||||
* | | |Note: This bit is write protected. Refer to the SYS_REGLCTL register.
|
||||
* @var WDT_T::ALTCTL
|
||||
* Offset: 0x04 WDT Alternative Control Register
|
||||
* ---------------------------------------------------------------------------------------------------
|
||||
* |Bits |Field |Descriptions
|
||||
* | :----: | :----: | :---- |
|
||||
* |[1:0] |RSTDSEL |WDT Reset Delay Selection (Write Protect)
|
||||
* | | |When WDT time-out happened, user has a time named WDT Reset Delay Period to clear WDT counter by setting RSTCNT (WDT_CTL[0]) to prevent WDT time-out reset happened
|
||||
* | | |User can select a suitable setting of RSTDSEL for different WDT Reset Delay Period.
|
||||
* | | |00 = WDT Reset Delay Period is 1026 * WDT_CLK.
|
||||
* | | |01 = WDT Reset Delay Period is 130 * WDT_CLK.
|
||||
* | | |10 = WDT Reset Delay Period is 18 * WDT_CLK.
|
||||
* | | |11 = WDT Reset Delay Period is 3 * WDT_CLK.
|
||||
* | | |Note1: This bit is write protected. Refer to the SYS_REGLCTL register.
|
||||
* | | |Note2: This register will be reset to 0 if WDT time-out reset happened.
|
||||
* @var WDT_T::RSTCNT
|
||||
* Offset: 0x08 WDT Reset Counter Register
|
||||
* ---------------------------------------------------------------------------------------------------
|
||||
* |Bits |Field |Descriptions
|
||||
* | :----: | :----: | :---- |
|
||||
* |[31:0] |RSTCNT |WDT Reset Counter Register
|
||||
* | | |Writing 0x00005AA5 to this field will reset the internal 18-bit WDT up counter value to 0.
|
||||
* | | |Note: Perform RSTCNT to reset counter needs 2 * WDT_CLK period to become active.
|
||||
* | | |Note: RSTCNT (WDT_CTL[0]) bit is a write protected bit
|
||||
* | | |RSTCNT (WDT_RSTCNT[31:0]) bits are not write protected.
|
||||
*/
|
||||
__IO uint32_t CTL; /*!< [0x0000] WDT Control Register */
|
||||
__IO uint32_t ALTCTL; /*!< [0x0004] WDT Alternative Control Register */
|
||||
__O uint32_t RSTCNT; /*!< [0x0008] WDT Reset Counter Register */
|
||||
|
||||
} WDT_T;
|
||||
|
||||
/**
|
||||
@addtogroup WDT_CONST WDT Bit Field Definition
|
||||
Constant Definitions for WDT Controller
|
||||
@{ */
|
||||
|
||||
#define WDT_CTL_RSTCNT_Pos (0) /*!< WDT_T::CTL: RSTCNT Position */
|
||||
#define WDT_CTL_RSTCNT_Msk (0x1ul << WDT_CTL_RSTCNT_Pos) /*!< WDT_T::CTL: RSTCNT Mask */
|
||||
|
||||
#define WDT_CTL_RSTEN_Pos (1) /*!< WDT_T::CTL: RSTEN Position */
|
||||
#define WDT_CTL_RSTEN_Msk (0x1ul << WDT_CTL_RSTEN_Pos) /*!< WDT_T::CTL: RSTEN Mask */
|
||||
|
||||
#define WDT_CTL_RSTF_Pos (2) /*!< WDT_T::CTL: RSTF Position */
|
||||
#define WDT_CTL_RSTF_Msk (0x1ul << WDT_CTL_RSTF_Pos) /*!< WDT_T::CTL: RSTF Mask */
|
||||
|
||||
#define WDT_CTL_IF_Pos (3) /*!< WDT_T::CTL: IF Position */
|
||||
#define WDT_CTL_IF_Msk (0x1ul << WDT_CTL_IF_Pos) /*!< WDT_T::CTL: IF Mask */
|
||||
|
||||
#define WDT_CTL_WKEN_Pos (4) /*!< WDT_T::CTL: WKEN Position */
|
||||
#define WDT_CTL_WKEN_Msk (0x1ul << WDT_CTL_WKEN_Pos) /*!< WDT_T::CTL: WKEN Mask */
|
||||
|
||||
#define WDT_CTL_WKF_Pos (5) /*!< WDT_T::CTL: WKF Position */
|
||||
#define WDT_CTL_WKF_Msk (0x1ul << WDT_CTL_WKF_Pos) /*!< WDT_T::CTL: WKF Mask */
|
||||
|
||||
#define WDT_CTL_INTEN_Pos (6) /*!< WDT_T::CTL: INTEN Position */
|
||||
#define WDT_CTL_INTEN_Msk (0x1ul << WDT_CTL_INTEN_Pos) /*!< WDT_T::CTL: INTEN Mask */
|
||||
|
||||
#define WDT_CTL_WDTEN_Pos (7) /*!< WDT_T::CTL: WDTEN Position */
|
||||
#define WDT_CTL_WDTEN_Msk (0x1ul << WDT_CTL_WDTEN_Pos) /*!< WDT_T::CTL: WDTEN Mask */
|
||||
|
||||
#define WDT_CTL_TOUTSEL_Pos (8) /*!< WDT_T::CTL: TOUTSEL Position */
|
||||
#define WDT_CTL_TOUTSEL_Msk (0x7ul << WDT_CTL_TOUTSEL_Pos) /*!< WDT_T::CTL: TOUTSEL Mask */
|
||||
|
||||
#define WDT_CTL_SYNC_Pos (30) /*!< WDT_T::CTL: SYNC Position */
|
||||
#define WDT_CTL_SYNC_Msk (0x1ul << WDT_CTL_SYNC_Pos) /*!< WDT_T::CTL: SYNC Mask */
|
||||
|
||||
#define WDT_CTL_ICEDEBUG_Pos (31) /*!< WDT_T::CTL: ICEDEBUG Position */
|
||||
#define WDT_CTL_ICEDEBUG_Msk (0x1ul << WDT_CTL_ICEDEBUG_Pos) /*!< WDT_T::CTL: ICEDEBUG Mask */
|
||||
|
||||
#define WDT_ALTCTL_RSTDSEL_Pos (0) /*!< WDT_T::ALTCTL: RSTDSEL Position */
|
||||
#define WDT_ALTCTL_RSTDSEL_Msk (0x3ul << WDT_ALTCTL_RSTDSEL_Pos) /*!< WDT_T::ALTCTL: RSTDSEL Mask */
|
||||
|
||||
#define WDT_RSTCNT_RSTCNT_Pos (0) /*!< WDT_T::RSTCNT: RSTCNT Position */
|
||||
#define WDT_RSTCNT_RSTCNT_Msk (0xfffffffful << WDT_RSTCNT_RSTCNT_Pos) /*!< WDT_T::RSTCNT: RSTCNT Mask */
|
||||
|
||||
/**@}*/ /* WDT_CONST */
|
||||
/**@}*/ /* end of WDT register group */
|
||||
/**@}*/ /* end of REGISTER group */
|
||||
|
||||
#if defined ( __CC_ARM )
|
||||
#pragma no_anon_unions
|
||||
#endif
|
||||
|
||||
#endif /* __WDT_REG_H__ */
|
||||
@@ -0,0 +1,149 @@
|
||||
/**************************************************************************//**
|
||||
* @file wwdt_reg.h
|
||||
* @version V1.00
|
||||
* @brief WWDT register definition header file
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
* @copyright (C) 2017-2020 Nuvoton Technology Corp. All rights reserved.
|
||||
*****************************************************************************/
|
||||
#ifndef __WWDT_REG_H__
|
||||
#define __WWDT_REG_H__
|
||||
|
||||
#if defined ( __CC_ARM )
|
||||
#pragma anon_unions
|
||||
#endif
|
||||
|
||||
/**
|
||||
@addtogroup REGISTER Control Register
|
||||
@{
|
||||
*/
|
||||
|
||||
/**
|
||||
@addtogroup WWDT Window Watchdog Timer(WWDT)
|
||||
Memory Mapped Structure for WWDT Controller
|
||||
@{ */
|
||||
|
||||
typedef struct
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* @var WWDT_T::RLDCNT
|
||||
* Offset: 0x00 WWDT Reload Counter Register
|
||||
* ---------------------------------------------------------------------------------------------------
|
||||
* |Bits |Field |Descriptions
|
||||
* | :----: | :----: | :---- |
|
||||
* |[31:0] |RLDCNT |WWDT Reload Counter Register
|
||||
* | | |Writing 0x00005AA5 to this register will reload the WWDT counter value to 0x3F.
|
||||
* | | |Note: User can only write WWDT_RLDCNT register to reload WWDT counter value when current WWDT counter value between 0 and CMPDAT (WWDT_CTL[21:16])
|
||||
* | | |If user writes WWDT_RLDCNT when current WWDT counter value is larger than CMPDAT , WWDT reset signal will generate immediately.
|
||||
* @var WWDT_T::CTL
|
||||
* Offset: 0x04 WWDT Control Register
|
||||
* ---------------------------------------------------------------------------------------------------
|
||||
* |Bits |Field |Descriptions
|
||||
* | :----: | :----: | :---- |
|
||||
* |[0] |WWDTEN |WWDT Enable Control Bit
|
||||
* | | |Set this bit to enable WWDT counter counting.
|
||||
* | | |0 = WWDT counter is stopped.
|
||||
* | | |1 = WWDT counter is starting counting.
|
||||
* |[1] |INTEN |WWDT Interrupt Enable Control Bit
|
||||
* | | |If this bit is enabled, the WWDT counter compare match interrupt signal is generated and inform to CPU.
|
||||
* | | |0 = WWDT counter compare match interrupt Disabled.
|
||||
* | | |1 = WWDT counter compare match interrupt Enabled.
|
||||
* |[11:8] |PSCSEL |WWDT Counter Prescale Period Selection
|
||||
* | | |0000 = Pre-scale is 1; Max time-out period is 1 * 64 * WWDT_CLK.
|
||||
* | | |0001 = Pre-scale is 2; Max time-out period is 2 * 64 * WWDT_CLK.
|
||||
* | | |0010 = Pre-scale is 4; Max time-out period is 4 * 64 * WWDT_CLK.
|
||||
* | | |0011 = Pre-scale is 8; Max time-out period is 8 * 64 * WWDT_CLK.
|
||||
* | | |0100 = Pre-scale is 16; Max time-out period is 16 * 64 * WWDT_CLK.
|
||||
* | | |0101 = Pre-scale is 32; Max time-out period is 32 * 64 * WWDT_CLK.
|
||||
* | | |0110 = Pre-scale is 64; Max time-out period is 64 * 64 * WWDT_CLK.
|
||||
* | | |0111 = Pre-scale is 128; Max time-out period is 128 * 64 * WWDT_CLK.
|
||||
* | | |1000 = Pre-scale is 192; Max time-out period is 192 * 64 * WWDT_CLK.
|
||||
* | | |1001 = Pre-scale is 256; Max time-out period is 256 * 64 * WWDT_CLK.
|
||||
* | | |1010 = Pre-scale is 384; Max time-out period is 384 * 64 * WWDT_CLK.
|
||||
* | | |1011 = Pre-scale is 512; Max time-out period is 512 * 64 * WWDT_CLK.
|
||||
* | | |1100 = Pre-scale is 768; Max time-out period is 768 * 64 * WWDT_CLK.
|
||||
* | | |1101 = Pre-scale is 1024; Max time-out period is 1024 * 64 * WWDT_CLK.
|
||||
* | | |1110 = Pre-scale is 1536; Max time-out period is 1536 * 64 * WWDT_CLK.
|
||||
* | | |1111 = Pre-scale is 2048; Max time-out period is 2048 * 64 * WWDT_CLK.
|
||||
* |[21:16] |CMPDAT |WWDT Window Compare Register
|
||||
* | | |Set this register to adjust the valid reload window.
|
||||
* | | |Note: User can only write WWDT_RLDCNT register to reload WWDT counter value when current WWDT counter value between 0 and CMPDAT
|
||||
* | | |If user writes WWDT_RLDCNT register when current WWDT counter value larger than CMPDAT, WWDT reset signal will generate immediately.
|
||||
* |[31] |ICEDEBUG |ICE Debug Mode Acknowledge Disable Control
|
||||
* | | |0 = ICE debug mode acknowledgement effects WWDT counting.
|
||||
* | | |WWDT down counter will be held while CPU is held by ICE.
|
||||
* | | |1 = ICE debug mode acknowledgement Disabled.
|
||||
* | | |WWDT down counter will keep going no matter CPU is held by ICE or not.
|
||||
* @var WWDT_T::STATUS
|
||||
* Offset: 0x08 WWDT Status Register
|
||||
* ---------------------------------------------------------------------------------------------------
|
||||
* |Bits |Field |Descriptions
|
||||
* | :----: | :----: | :---- |
|
||||
* |[0] |WWDTIF |WWDT Compare Match Interrupt Flag
|
||||
* | | |This bit indicates the interrupt flag status of WWDT while WWDT counter value matches CMPDAT (WWDT_CTL[21:16]).
|
||||
* | | |0 = No effect.
|
||||
* | | |1 = WWDT counter value matches CMPDAT.
|
||||
* | | |Note: This bit is cleared by writing 1 to it.
|
||||
* |[1] |WWDTRF |WWDT Timer-out Reset Flag
|
||||
* | | |This bit indicates the system has been reset by WWDT time-out reset or not.
|
||||
* | | |0 = WWDT time-out reset did not occur.
|
||||
* | | |1 = WWDT time-out reset occurred.
|
||||
* | | |Note: This bit is cleared by writing 1 to it.
|
||||
* @var WWDT_T::CNT
|
||||
* Offset: 0x0C WWDT Counter Value Register
|
||||
* ---------------------------------------------------------------------------------------------------
|
||||
* |Bits |Field |Descriptions
|
||||
* | :----: | :----: | :---- |
|
||||
* |[5:0] |CNTDAT |WWDT Counter Value
|
||||
* | | |CNTDAT will be updated continuously to monitor 6-bit WWDT down counter value.
|
||||
*/
|
||||
__O uint32_t RLDCNT; /*!< [0x0000] WWDT Reload Counter Register */
|
||||
__IO uint32_t CTL; /*!< [0x0004] WWDT Control Register */
|
||||
__IO uint32_t STATUS; /*!< [0x0008] WWDT Status Register */
|
||||
__I uint32_t CNT; /*!< [0x000c] WWDT Counter Value Register */
|
||||
|
||||
} WWDT_T;
|
||||
|
||||
/**
|
||||
@addtogroup WWDT_CONST WWDT Bit Field Definition
|
||||
Constant Definitions for WWDT Controller
|
||||
@{ */
|
||||
|
||||
#define WWDT_RLDCNT_RLDCNT_Pos (0) /*!< WWDT_T::RLDCNT: RLDCNT Position */
|
||||
#define WWDT_RLDCNT_RLDCNT_Msk (0xfffffffful << WWDT_RLDCNT_RLDCNT_Pos) /*!< WWDT_T::RLDCNT: RLDCNT Mask */
|
||||
|
||||
#define WWDT_CTL_WWDTEN_Pos (0) /*!< WWDT_T::CTL: WWDTEN Position */
|
||||
#define WWDT_CTL_WWDTEN_Msk (0x1ul << WWDT_CTL_WWDTEN_Pos) /*!< WWDT_T::CTL: WWDTEN Mask */
|
||||
|
||||
#define WWDT_CTL_INTEN_Pos (1) /*!< WWDT_T::CTL: INTEN Position */
|
||||
#define WWDT_CTL_INTEN_Msk (0x1ul << WWDT_CTL_INTEN_Pos) /*!< WWDT_T::CTL: INTEN Mask */
|
||||
|
||||
#define WWDT_CTL_PSCSEL_Pos (8) /*!< WWDT_T::CTL: PSCSEL Position */
|
||||
#define WWDT_CTL_PSCSEL_Msk (0xful << WWDT_CTL_PSCSEL_Pos) /*!< WWDT_T::CTL: PSCSEL Mask */
|
||||
|
||||
#define WWDT_CTL_CMPDAT_Pos (16) /*!< WWDT_T::CTL: CMPDAT Position */
|
||||
#define WWDT_CTL_CMPDAT_Msk (0x3ful << WWDT_CTL_CMPDAT_Pos) /*!< WWDT_T::CTL: CMPDAT Mask */
|
||||
|
||||
#define WWDT_CTL_ICEDEBUG_Pos (31) /*!< WWDT_T::CTL: ICEDEBUG Position */
|
||||
#define WWDT_CTL_ICEDEBUG_Msk (0x1ul << WWDT_CTL_ICEDEBUG_Pos) /*!< WWDT_T::CTL: ICEDEBUG Mask */
|
||||
|
||||
#define WWDT_STATUS_WWDTIF_Pos (0) /*!< WWDT_T::STATUS: WWDTIF Position */
|
||||
#define WWDT_STATUS_WWDTIF_Msk (0x1ul << WWDT_STATUS_WWDTIF_Pos) /*!< WWDT_T::STATUS: WWDTIF Mask */
|
||||
|
||||
#define WWDT_STATUS_WWDTRF_Pos (1) /*!< WWDT_T::STATUS: WWDTRF Position */
|
||||
#define WWDT_STATUS_WWDTRF_Msk (0x1ul << WWDT_STATUS_WWDTRF_Pos) /*!< WWDT_T::STATUS: WWDTRF Mask */
|
||||
|
||||
#define WWDT_CNT_CNTDAT_Pos (0) /*!< WWDT_T::CNT: CNTDAT Position */
|
||||
#define WWDT_CNT_CNTDAT_Msk (0x3ful << WWDT_CNT_CNTDAT_Pos) /*!< WWDT_T::CNT: CNTDAT Mask */
|
||||
|
||||
/**@}*/ /* WWDT_CONST */
|
||||
/**@}*/ /* end of WWDT register group */
|
||||
/**@}*/ /* end of REGISTER group */
|
||||
|
||||
#if defined ( __CC_ARM )
|
||||
#pragma no_anon_unions
|
||||
#endif
|
||||
|
||||
#endif /* __WWDT_REG_H__ */
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,110 @@
|
||||
/**************************************************************************//**
|
||||
* @file system_M480.c
|
||||
* @version V1.000
|
||||
* @brief CMSIS Cortex-M4 Core Peripheral Access Layer Source File for M480
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
* @copyright (C) 2017-2020 Nuvoton Technology Corp. All rights reserved.
|
||||
*****************************************************************************/
|
||||
|
||||
#include "NuMicro.h"
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
DEFINES
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Clock Variable definitions
|
||||
*----------------------------------------------------------------------------*/
|
||||
uint32_t SystemCoreClock = __SYSTEM_CLOCK; /*!< System Clock Frequency (Core Clock)*/
|
||||
uint32_t CyclesPerUs = (__HSI / 1000000UL); /* Cycles per micro second */
|
||||
uint32_t PllClock = __HSI; /*!< PLL Output Clock Frequency */
|
||||
uint32_t gau32ClkSrcTbl[] = {__HXT, __LXT, 0UL, __LIRC, 0UL, 0UL, 0UL, __HIRC};
|
||||
|
||||
/*----------------------------------------------------------------------------
|
||||
Clock functions
|
||||
*----------------------------------------------------------------------------*/
|
||||
void SystemCoreClockUpdate (void) /* Get Core Clock Frequency */
|
||||
{
|
||||
uint32_t u32Freq, u32ClkSrc;
|
||||
uint32_t u32HclkDiv;
|
||||
|
||||
/* Update PLL Clock */
|
||||
PllClock = CLK_GetPLLClockFreq();
|
||||
|
||||
u32ClkSrc = CLK->CLKSEL0 & CLK_CLKSEL0_HCLKSEL_Msk;
|
||||
|
||||
if(u32ClkSrc == CLK_CLKSEL0_HCLKSEL_PLL)
|
||||
{
|
||||
/* Use PLL clock */
|
||||
u32Freq = PllClock;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Use the clock sources directly */
|
||||
u32Freq = gau32ClkSrcTbl[u32ClkSrc];
|
||||
}
|
||||
|
||||
u32HclkDiv = (CLK->CLKDIV0 & CLK_CLKDIV0_HCLKDIV_Msk) + 1UL;
|
||||
|
||||
/* Update System Core Clock */
|
||||
SystemCoreClock = u32Freq / u32HclkDiv;
|
||||
|
||||
|
||||
//if(SystemCoreClock == 0)
|
||||
// __BKPT(0);
|
||||
|
||||
CyclesPerUs = (SystemCoreClock + 500000UL) / 1000000UL;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Set PF.2 and PF.3 to input mode
|
||||
* @param None
|
||||
* @return None
|
||||
* @details GPIO default state could be configured as input or quasi through user config.
|
||||
* To use HXT, PF.2 and PF.3 must not set as quasi mode. This function changes
|
||||
* PF.2 and PF.3 to input mode no matter which mode they are working at.
|
||||
*/
|
||||
static __INLINE void HXTInit(void)
|
||||
{
|
||||
PF->MODE &= ~(GPIO_MODE_MODE2_Msk | GPIO_MODE_MODE3_Msk);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Initialize the System
|
||||
*
|
||||
* @param none
|
||||
* @return none
|
||||
*/
|
||||
void SystemInit (void)
|
||||
{
|
||||
/* Add your system initialize code here.
|
||||
Do not use global variables because this function is called before
|
||||
reaching pre-main. RW section maybe overwritten afterwards. */
|
||||
|
||||
|
||||
/* FPU settings ------------------------------------------------------------*/
|
||||
#if (__FPU_PRESENT == 1U) && (__FPU_USED == 1U)
|
||||
SCB->CPACR |= ((3UL << 10*2) | /* set CP10 Full Access */
|
||||
(3UL << 11*2) ); /* set CP11 Full Access */
|
||||
#endif
|
||||
|
||||
/* Set access cycle for CPU @ 192MHz */
|
||||
FMC->CYCCTL = (FMC->CYCCTL & ~FMC_CYCCTL_CYCLE_Msk) | (8 << FMC_CYCCTL_CYCLE_Pos);
|
||||
/* Configure power down bias, must set 1 before entering power down mode.
|
||||
So set it at the very beginning */
|
||||
CLK->LDOCTL |= CLK_LDOCTL_PDBIASEN_Msk;
|
||||
/* Hand over the control of PF.4~11 I/O function from RTC module to GPIO module */
|
||||
CLK->APBCLK0 |= CLK_APBCLK0_RTCCKEN_Msk;
|
||||
RTC->GPIOCTL0 &= ~(RTC_GPIOCTL0_CTLSEL0_Msk | RTC_GPIOCTL0_CTLSEL1_Msk |
|
||||
RTC_GPIOCTL0_CTLSEL2_Msk | RTC_GPIOCTL0_CTLSEL3_Msk);
|
||||
RTC->GPIOCTL1 &= ~(RTC_GPIOCTL1_CTLSEL4_Msk | RTC_GPIOCTL1_CTLSEL5_Msk |
|
||||
RTC_GPIOCTL1_CTLSEL6_Msk | RTC_GPIOCTL1_CTLSEL7_Msk);
|
||||
CLK->APBCLK0 &= ~CLK_APBCLK0_RTCCKEN_Msk;
|
||||
HXTInit();
|
||||
|
||||
}
|
||||
/*** (C) COPYRIGHT 2016 Nuvoton Technology Corp. ***/
|
||||
@@ -0,0 +1,25 @@
|
||||
import rtconfig
|
||||
Import('RTT_ROOT')
|
||||
from building import *
|
||||
|
||||
# get current directory
|
||||
cwd = GetCurrentDir()
|
||||
|
||||
# The set of source files associated with this SConscript file.
|
||||
src = Split("""
|
||||
Nuvoton/M480/Source/system_M480.c
|
||||
""")
|
||||
|
||||
# add for startup script
|
||||
if rtconfig.CROSS_TOOL == 'gcc':
|
||||
src = src + ['Nuvoton/M480/Source/GCC/startup_M480.S']
|
||||
elif rtconfig.CROSS_TOOL == 'keil':
|
||||
src = src + ['Nuvoton/M480/Source/ARM/startup_M480.s']
|
||||
elif rtconfig.CROSS_TOOL == 'iar':
|
||||
src = src + ['Nuvoton/M480/Source/IAR/startup_M480.s']
|
||||
|
||||
path = [cwd + '/Nuvoton/M480/Include',]
|
||||
|
||||
group = DefineGroup('m480_device', src, depend = [''], CPPPATH = path)
|
||||
|
||||
Return('group')
|
||||
@@ -0,0 +1,49 @@
|
||||
# M480 Series
|
||||
|
||||
## Supported drivers
|
||||
|
||||
| Peripheral | rt_device_class_type | Device name |
|
||||
| ------ | ---- | :------: |
|
||||
| BPWM | RT_Device_Class_Miscellaneous (PWM) | ***bpwm[0-1]*** |
|
||||
| BPWM (Capture function)| RT_Device_Class_Miscellaneous (Input capture) | ***bpwm[0-1]i[0-5]*** |
|
||||
| CAN | RT_Device_Class_CAN | ***can[0-1]*** |
|
||||
| CLK | RT_Device_Class_PM | ***pm*** |
|
||||
| CRC | RT_Device_Class_Miscellaneous (HW Crypto) | ***hwcryto*** |
|
||||
| CRYPTO | RT_Device_Class_Miscellaneous (HW Crypto) | ***hwcryto*** |
|
||||
| EADC | RT_Device_Class_Miscellaneous (ADC) | ***eadc[0-1]*** |
|
||||
| EBI | N/A | ***N/A*** |
|
||||
| ECAP | RT_Device_Class_Miscellaneous (Input capture) | ***ecap[0-1]i[0-2]*** |
|
||||
| EMAC | RT_Device_Class_NetIf | ***e0*** |
|
||||
| EPWM | RT_Device_Class_Miscellaneous (PWM) | ***epwm[0-1]*** |
|
||||
| EPWM (Capture function) | RT_Device_Class_Miscellaneous (Input capture) | ***epwm[0-1]i[0-5]*** |
|
||||
| FMC | FAL | ***N/A*** |
|
||||
| GPIO | RT_Device_Class_Miscellaneous (Pin) | ***gpio*** |
|
||||
| GPIO | RT_Device_Class_I2CBUS | ***softi2c0[0-1]*** |
|
||||
| HSOTG | RT_Device_Class_USBHost/RT_Device_Class_USBDevice | ***N/A*** |
|
||||
| HSUSBD | RT_Device_Class_USBDevice | ***usbd*** |
|
||||
| I2C | RT_Device_Class_I2CBUS | ***i2c[0-2]*** |
|
||||
| I2S | RT_Device_Class_Sound/RT_Device_Class_Pipe | ***sound0*** |
|
||||
| PDMA | N/A | ***N/A*** |
|
||||
| QEI | RT_Device_Class_Miscellaneous (Pulse encoder) | ***qei[0-1]*** |
|
||||
| QSPI | RT_Device_Class_SPIBUS | ***qspi[0-1]*** |
|
||||
| RTC | RT_Device_Class_RTC | ***rtc*** |
|
||||
| SC (UART function) | RT_Device_Class_Char | ***scuart[0-2]*** |
|
||||
| SDH | RT_Device_Class_Block | ***sdh[0-1]*** |
|
||||
| SPI | RT_Device_Class_SPIBUS | ***spi[0-3]*** |
|
||||
| SPI (I2S function) | RT_Device_Class_Sound/RT_Device_Class_Pipe | ***spii2s[0-3]*** |
|
||||
| TIMER | RT_Device_Class_Timer | ***timer[0-3]*** |
|
||||
| TIMER (Capture function) | RT_Device_Class_Miscellaneous (Input capture) | ***timer[0-3]i0*** |
|
||||
| TIMER (PWM function) | RT_Device_Class_Miscellaneous (PWM) | ***tpwm[0-3]*** |
|
||||
| TRNG | RT_Device_Class_Miscellaneous (HW Crypto) | ***hwcryto*** |
|
||||
| UART | RT_Device_Class_Char | ***uart[0-7]*** |
|
||||
| USBD | RT_Device_Class_USBDevice | ***usbd*** |
|
||||
| USBH, HSUSBH | RT_Device_Class_USBHost | ***usbh*** |
|
||||
| USCI (I2C function) | RT_Device_Class_I2CBUS | ***ui2c[0-1]*** |
|
||||
| USCI (SPI function) | RT_Device_Class_SPIBUS | ***uspi[0-1]*** |
|
||||
| USCI (UART function) | RT_Device_Class_Char | ***uuart[0-1]*** |
|
||||
| WDT | RT_Device_Class_Miscellaneous (Watchdog) | ***wdt*** |
|
||||
|
||||
## Resources
|
||||
* [Download M480 TRM][1]
|
||||
|
||||
[1]: https://www.nuvoton.com/resource-download.jsp?tp_GUID=DA05-M480
|
||||
@@ -0,0 +1,15 @@
|
||||
# RT-Thread building script for bridge
|
||||
|
||||
import os
|
||||
from building import *
|
||||
|
||||
cwd = GetCurrentDir()
|
||||
objs = []
|
||||
list = os.listdir(cwd)
|
||||
|
||||
for d in list:
|
||||
path = os.path.join(cwd, d)
|
||||
if os.path.isfile(os.path.join(path, 'SConscript')):
|
||||
objs = objs + SConscript(os.path.join(d, 'SConscript'))
|
||||
|
||||
Return('objs')
|
||||
@@ -0,0 +1,26 @@
|
||||
# RT-Thread building script for component
|
||||
Import('rtconfig')
|
||||
from building import *
|
||||
|
||||
cwd = GetCurrentDir()
|
||||
src = []
|
||||
libs = ['']
|
||||
libpath = [cwd + '/lib']
|
||||
cpppath = [cwd + '/inc']
|
||||
|
||||
if GetDepend('BSP_USE_STDDRIVER_SOURCE'):
|
||||
src = Glob('*src/*.c') + Glob('src/*.cpp')
|
||||
group = DefineGroup('m480_stddriver', src, depend = [''], CPPPATH = cpppath)
|
||||
else:
|
||||
if rtconfig.CROSS_TOOL == 'keil':
|
||||
if GetOption('target') == 'mdk4':
|
||||
libs += ['libstddriver_keil4']
|
||||
if GetOption('target') == 'mdk5':
|
||||
libs += ['libstddriver_keil']
|
||||
elif rtconfig.CROSS_TOOL == 'gcc':
|
||||
libs += ['libstddriver_gcc']
|
||||
else:
|
||||
libs += ['libstddriver_iar']
|
||||
group = DefineGroup('m480_stddriver', src, depend = [''], CPPPATH = cpppath, LIBS = libs, LIBPATH = libpath)
|
||||
|
||||
Return('group')
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,192 @@
|
||||
/**************************************************************************//**
|
||||
* @file nu_can.h
|
||||
* @version V2.00
|
||||
* @brief M480 Series CAN Driver Header File
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
* @copyright (C) 2016-2020 Nuvoton Technology Corp. All rights reserved.
|
||||
******************************************************************************/
|
||||
#ifndef __NU_CAN_H__
|
||||
#define __NU_CAN_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
|
||||
/** @addtogroup Standard_Driver Standard Driver
|
||||
@{
|
||||
*/
|
||||
|
||||
/** @addtogroup CAN_Driver CAN Driver
|
||||
@{
|
||||
*/
|
||||
|
||||
/** @addtogroup CAN_EXPORTED_CONSTANTS CAN Exported Constants
|
||||
@{
|
||||
*/
|
||||
/*---------------------------------------------------------------------------------------------------------*/
|
||||
/* CAN Test Mode Constant Definitions */
|
||||
/*---------------------------------------------------------------------------------------------------------*/
|
||||
#define CAN_NORMAL_MODE 0ul /*!< CAN select normal mode \hideinitializer */
|
||||
#define CAN_BASIC_MODE 1ul /*!< CAN select basic mode \hideinitializer */
|
||||
|
||||
/*---------------------------------------------------------------------------------------------------------*/
|
||||
/* Message ID Type Constant Definitions */
|
||||
/*---------------------------------------------------------------------------------------------------------*/
|
||||
#define CAN_STD_ID 0ul /*!< CAN select standard ID \hideinitializer */
|
||||
#define CAN_EXT_ID 1ul /*!< CAN select extended ID \hideinitializer */
|
||||
|
||||
/*---------------------------------------------------------------------------------------------------------*/
|
||||
/* Message Frame Type Constant Definitions */
|
||||
/*---------------------------------------------------------------------------------------------------------*/
|
||||
#define CAN_REMOTE_FRAME 0ul /*!< CAN frame select remote frame \hideinitializer */
|
||||
#define CAN_DATA_FRAME 1ul /*!< CAN frame select data frame \hideinitializer */
|
||||
|
||||
/*@}*/ /* end of group CAN_EXPORTED_CONSTANTS */
|
||||
|
||||
|
||||
/** @addtogroup CAN_EXPORTED_STRUCTS CAN Exported Structs
|
||||
@{
|
||||
*/
|
||||
/**
|
||||
* @details CAN message structure
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
uint32_t IdType; /*!< ID type */
|
||||
uint32_t FrameType; /*!< Frame type */
|
||||
uint32_t Id; /*!< Message ID */
|
||||
uint8_t DLC; /*!< Data length */
|
||||
uint8_t Data[8]; /*!< Data */
|
||||
} STR_CANMSG_T;
|
||||
|
||||
/**
|
||||
* @details CAN mask message structure
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
uint8_t u8Xtd; /*!< Extended ID */
|
||||
uint8_t u8Dir; /*!< Direction */
|
||||
uint32_t u32Id; /*!< Message ID */
|
||||
uint8_t u8IdType; /*!< ID type*/
|
||||
} STR_CANMASK_T;
|
||||
|
||||
/*@}*/ /* end of group CAN_EXPORTED_STRUCTS */
|
||||
|
||||
/** @cond HIDDEN_SYMBOLS */
|
||||
#define MSG(id) (id)
|
||||
/** @endcond HIDDEN_SYMBOLS */
|
||||
|
||||
/** @addtogroup CAN_EXPORTED_FUNCTIONS CAN Exported Functions
|
||||
@{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief Get interrupt status.
|
||||
*
|
||||
* @param[in] can The base address of can module.
|
||||
*
|
||||
* @return CAN module status register value.
|
||||
*
|
||||
* @details Status Interrupt is generated by bits BOff (CAN_STATUS[7]), EWarn (CAN_STATUS[6]),
|
||||
* EPass (CAN_STATUS[5]), RxOk (CAN_STATUS[4]), TxOk (CAN_STATUS[3]), and LEC (CAN_STATUS[2:0]).
|
||||
* \hideinitializer
|
||||
*/
|
||||
#define CAN_GET_INT_STATUS(can) ((can)->STATUS)
|
||||
|
||||
/**
|
||||
* @brief Get specified interrupt pending status.
|
||||
*
|
||||
* @param[in] can The base address of can module.
|
||||
*
|
||||
* @return The source of the interrupt.
|
||||
*
|
||||
* @details If several interrupts are pending, the CAN Interrupt Register will point to the pending interrupt
|
||||
* with the highest priority, disregarding their chronological order.
|
||||
* \hideinitializer
|
||||
*/
|
||||
#define CAN_GET_INT_PENDING_STATUS(can) ((can)->IIDR)
|
||||
|
||||
/**
|
||||
* @brief Disable wake-up function.
|
||||
*
|
||||
* @param[in] can The base address of can module.
|
||||
*
|
||||
* @return None
|
||||
*
|
||||
* @details The macro is used to disable wake-up function.
|
||||
* \hideinitializer
|
||||
*/
|
||||
#define CAN_DISABLE_WAKEUP(can) ((can)->WU_EN = 0ul)
|
||||
|
||||
/**
|
||||
* @brief Enable wake-up function.
|
||||
*
|
||||
* @param[in] can The base address of can module.
|
||||
*
|
||||
* @return None
|
||||
*
|
||||
* @details User can wake-up system when there is a falling edge in the CAN_Rx pin.
|
||||
* \hideinitializer
|
||||
*/
|
||||
#define CAN_ENABLE_WAKEUP(can) ((can)->WU_EN = CAN_WU_EN_WAKUP_EN_Msk)
|
||||
|
||||
/**
|
||||
* @brief Get specified Message Object new data into bit value.
|
||||
*
|
||||
* @param[in] can The base address of can module.
|
||||
* @param[in] u32MsgNum Specified Message Object number, valid value are from 0 to 31.
|
||||
*
|
||||
* @return Specified Message Object new data into bit value.
|
||||
*
|
||||
* @details The NewDat bit (CAN_IFn_MCON[15]) of a specific Message Object can be set/reset by the software through the IFn Message Interface Registers
|
||||
* or by the Message Handler after reception of a Data Frame or after a successful transmission.
|
||||
* \hideinitializer
|
||||
*/
|
||||
#define CAN_GET_NEW_DATA_IN_BIT(can, u32MsgNum) ((u32MsgNum) < 16 ? (can)->NDAT1 & (1 << (u32MsgNum)) : (can)->NDAT2 & (1 << ((u32MsgNum)-16)))
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------------------------------------*/
|
||||
/* Define CAN functions prototype */
|
||||
/*---------------------------------------------------------------------------------------------------------*/
|
||||
uint32_t CAN_SetBaudRate(CAN_T *tCAN, uint32_t u32BaudRate);
|
||||
uint32_t CAN_Open(CAN_T *tCAN, uint32_t u32BaudRate, uint32_t u32Mode);
|
||||
void CAN_Close(CAN_T *tCAN);
|
||||
void CAN_CLR_INT_PENDING_BIT(CAN_T *tCAN, uint8_t u32MsgNum);
|
||||
void CAN_EnableInt(CAN_T *tCAN, uint32_t u32Mask);
|
||||
void CAN_DisableInt(CAN_T *tCAN, uint32_t u32Mask);
|
||||
int32_t CAN_Transmit(CAN_T *tCAN, uint32_t u32MsgNum, STR_CANMSG_T* pCanMsg);
|
||||
int32_t CAN_Receive(CAN_T *tCAN, uint32_t u32MsgNum, STR_CANMSG_T* pCanMsg);
|
||||
int32_t CAN_SetMultiRxMsg(CAN_T *tCAN, uint32_t u32MsgNum, uint32_t u32MsgCount, uint32_t u32IDType, uint32_t u32ID);
|
||||
int32_t CAN_SetRxMsg(CAN_T *tCAN, uint32_t u32MsgNum, uint32_t u32IDType, uint32_t u32ID);
|
||||
int32_t CAN_SetRxMsgAndMsk(CAN_T *tCAN, uint32_t u32MsgNum, uint32_t u32IDType, uint32_t u32ID, uint32_t u32IDMask);
|
||||
int32_t CAN_SetTxMsg(CAN_T *tCAN, uint32_t u32MsgNum, STR_CANMSG_T* pCanMsg);
|
||||
int32_t CAN_TriggerTxMsg(CAN_T *tCAN, uint32_t u32MsgNum);
|
||||
int32_t CAN_BasicSendMsg(CAN_T *tCAN, STR_CANMSG_T* pCanMsg);
|
||||
int32_t CAN_BasicReceiveMsg(CAN_T *tCAN, STR_CANMSG_T* pCanMsg);
|
||||
void CAN_EnterInitMode(CAN_T *tCAN, uint8_t u8Mask);
|
||||
void CAN_EnterTestMode(CAN_T *tCAN, uint8_t u8TestMask);
|
||||
void CAN_LeaveTestMode(CAN_T *tCAN);
|
||||
uint32_t CAN_GetCANBitRate(CAN_T *tCAN);
|
||||
uint32_t CAN_IsNewDataReceived(CAN_T *tCAN, uint8_t u8MsgObj);
|
||||
void CAN_LeaveInitMode(CAN_T *tCAN);
|
||||
int32_t CAN_SetRxMsgObjAndMsk(CAN_T *tCAN, uint8_t u8MsgObj, uint8_t u8idType, uint32_t u32id, uint32_t u32idmask, uint8_t u8singleOrFifoLast);
|
||||
int32_t CAN_SetRxMsgObj(CAN_T *tCAN, uint8_t u8MsgObj, uint8_t u8idType, uint32_t u32id, uint8_t u8singleOrFifoLast);
|
||||
void CAN_WaitMsg(CAN_T *tCAN);
|
||||
int32_t CAN_ReadMsgObj(CAN_T *tCAN, uint8_t u8MsgObj, uint8_t u8Release, STR_CANMSG_T* pCanMsg);
|
||||
|
||||
/*@}*/ /* end of group CAN_EXPORTED_FUNCTIONS */
|
||||
|
||||
/*@}*/ /* end of group CAN_Driver */
|
||||
|
||||
/*@}*/ /* end of group Standard_Driver */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /*__NU_CAN_H__ */
|
||||
|
||||
/*** (C) COPYRIGHT 2016 Nuvoton Technology Corp. ***/
|
||||
@@ -0,0 +1,167 @@
|
||||
/**************************************************************************//**
|
||||
* @file nu_ccap.h
|
||||
* @version V1.00
|
||||
* @brief M480 Series CCAP Driver Header File
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
* @copyright (C) 2016-2020 Nuvoton Technology Corp. All rights reserved.
|
||||
******************************************************************************/
|
||||
#ifndef __NU_CCAP_H__
|
||||
#define __NU_CCAP_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
/** @addtogroup Standard_Driver Standard Driver
|
||||
@{
|
||||
*/
|
||||
|
||||
/** @addtogroup CCAP_Driver CCAP Driver
|
||||
@{
|
||||
*/
|
||||
|
||||
/** @addtogroup CCAP_EXPORTED_CONSTANTS CCAP Exported Constants
|
||||
@{
|
||||
*/
|
||||
|
||||
/*---------------------------------------------------------------------------------------------------------*/
|
||||
/* CTL constant definitions */
|
||||
/*---------------------------------------------------------------------------------------------------------*/
|
||||
#define CCAP_CTL_CCAPEN (1ul<<CCAP_CTL_CCAPEN_Pos) /*!< CCAP CTL setting for enabling capture engine mode \hideinitializer */
|
||||
#define CCAP_CTL_ADDRSW (1ul<<CCAP_CTL_ADDRSW_Pos) /*!< CCAP CTL setting for packet buffer address switch \hideinitializer */
|
||||
#define CCAP_CTL_PKTEN (1ul<<CCAP_CTL_PKTEN_Pos) /*!< CCAP CTL setting for enabling packet output mode \hideinitializer */
|
||||
#define CCAP_CTL_PLNEN (1ul<<CCAP_CTL_PLNEN_Pos) /*!< CCAP CTL setting for enabling planar output mode \hideinitializer */
|
||||
#define CCAP_CTL_SHUTTER (1ul<<CCAP_CTL_SHUTTER_Pos) /*!< CCAP CTL setting for enabling shutter mode \hideinitializer */
|
||||
#define CCAP_CTL_UPDATE (1ul<<CCAP_CTL_UPDATE_Pos) /*!< CCAP CTL setting for enabling update register at new frame \hideinitializer */
|
||||
#define CCAP_CTL_RESET (1ul<<CCAP_CTL_VPRST_Pos) /*!< CCAP CTL setting for capture reset \hideinitializer */
|
||||
#define CCAP_CTL_MY8_MY4 (0ul<<CCAP_CTL_MY8_MY4_Pos) /*!< CCAP CTL setting for 4-bit data I/O interface with Mono \hideinitializer */
|
||||
#define CCAP_CTL_MY8_MY8 (1ul<<CCAP_CTL_MY8_MY4_Pos) /*!< CCAP CTL setting for 8-bit data I/O interface with Mono \hideinitializer */
|
||||
|
||||
/*---------------------------------------------------------------------------------------------------------*/
|
||||
/* PAR constant definitions */
|
||||
/*---------------------------------------------------------------------------------------------------------*/
|
||||
#define CCAP_PAR_INFMT_YUV422 (0ul<<CCAP_PAR_INFMT_Pos) /*!< CCAP PAR setting for Sensor Input Data YUV422 Format \hideinitializer */
|
||||
#define CCAP_PAR_INFMT_RGB565 (1ul<<CCAP_PAR_INFMT_Pos) /*!< CCAP PAR setting for Sensor Input Data RGB565 Format \hideinitializer */
|
||||
|
||||
#define CCAP_PAR_SENTYPE_CCIR601 (0ul<<CCAP_PAR_SENTYPE_Pos) /*!< CCAP PAR setting for Sensor Input CCIR601 Type \hideinitializer */
|
||||
#define CCAP_PAR_SENTYPE_CCIR656 (1ul<<CCAP_PAR_SENTYPE_Pos) /*!< CCAP PAR setting for Sensor Input CCIR656 Type \hideinitializer */
|
||||
|
||||
#define CCAP_PAR_INDATORD_YUYV (0x0ul<<CCAP_PAR_INDATORD_Pos) /*!< CCAP PAR setting for Sensor Input Data Order, YUYV \hideinitializer */
|
||||
#define CCAP_PAR_INDATORD_YVYU (0x1ul<<CCAP_PAR_INDATORD_Pos) /*!< CCAP PAR setting for Sensor Input Data Order, YVYU \hideinitializer */
|
||||
#define CCAP_PAR_INDATORD_UYVY (0x2ul<<CCAP_PAR_INDATORD_Pos) /*!< CCAP PAR setting for Sensor Input Data Order, UYVY \hideinitializer */
|
||||
#define CCAP_PAR_INDATORD_VYUY (0x3ul<<CCAP_PAR_INDATORD_Pos) /*!< CCAP PAR setting for Sensor Input Data Order, VYUY \hideinitializer */
|
||||
|
||||
#define CCAP_PAR_INDATORD_RGGB (0x0ul<<CCAP_PAR_INDATORD_Pos) /*!< CCAP PAR setting for Sensor Input Data Order, 0byte: R[0:4] G[5:8], 1byte G[0:2] R[3:8] \hideinitializer */
|
||||
#define CCAP_PAR_INDATORD_BGGR (0x1ul<<CCAP_PAR_INDATORD_Pos) /*!< CCAP PAR setting for Sensor Input Data Order, 0byte: b[0:4] G[5:8], 1byte G[0:2] R[3:8] \hideinitializer */
|
||||
#define CCAP_PAR_INDATORD_GBRG (0x2ul<<CCAP_PAR_INDATORD_Pos) /*!< CCAP PAR setting for Sensor Input Data Order, 0byte: G[0:3] G[4:8], 1byte G[0:4] G[5:8] \hideinitializer */
|
||||
#define CCAP_PAR_INDATORD_GRBG (0x3ul<<CCAP_PAR_INDATORD_Pos) /*!< CCAP PAR setting for Sensor Input Data Order, 0byte: G[0:3] G[4:8], 1byte G[0:4] G[5:8] \hideinitializer */
|
||||
|
||||
#define CCAP_PAR_OUTFMT_YUV422 (0x0ul<<CCAP_PAR_OUTFMT_Pos) /*!< CCAP PAR setting for Image Data YUV422 Format Output to System Memory \hideinitializer */
|
||||
#define CCAP_PAR_OUTFMT_ONLY_Y (0x1ul<<CCAP_PAR_OUTFMT_Pos) /*!< CCAP PAR setting for Image Data ONLY_Y Format Output to System Memory \hideinitializer */
|
||||
#define CCAP_PAR_OUTFMT_RGB555 (0x2ul<<CCAP_PAR_OUTFMT_Pos) /*!< CCAP PAR setting for Image Data RGB555 Format Output to System Memory \hideinitializer */
|
||||
#define CCAP_PAR_OUTFMT_RGB565 (0x3ul<<CCAP_PAR_OUTFMT_Pos) /*!< CCAP PAR setting for Image Data RGB565 Format Output to System Memory \hideinitializer */
|
||||
|
||||
#define CCAP_PAR_PLNFMT_YUV422 (0x0ul<<CCAP_PAR_PLNFMT_Pos) /*!< CCAP PAR setting for Planar Output YUV422 Format \hideinitializer */
|
||||
#define CCAP_PAR_PLNFMT_YUV420 (0x1ul<<CCAP_PAR_PLNFMT_Pos) /*!< CCAP PAR setting for Planar Output YUV420 Format \hideinitializer */
|
||||
|
||||
#define CCAP_PAR_VSP_LOW (0x0ul<<CCAP_PAR_VSP_Pos) /*!< CCAP PAR setting for Sensor Vsync Polarity \hideinitializer */
|
||||
#define CCAP_PAR_VSP_HIGH (0x1ul<<CCAP_PAR_VSP_Pos) /*!< CCAP PAR setting for Sensor Vsync Polarity \hideinitializer */
|
||||
#define CCAP_PAR_HSP_LOW (0x0ul<<CCAP_PAR_HSP_Pos) /*!< CCAP PAR setting for Sensor Hsync Polarity \hideinitializer */
|
||||
#define CCAP_PAR_HSP_HIGH (0x1ul<<CCAP_PAR_HSP_Pos) /*!< CCAP PAR setting for Sensor Hsync Polarity \hideinitializer */
|
||||
#define CCAP_PAR_PCLKP_LOW (0x0ul<<CCAP_PAR_PCLKP_Pos) /*!< CCAP PAR setting for Sensor Pixel Clock Polarity \hideinitializer */
|
||||
#define CCAP_PAR_PCLKP_HIGH (0x1ul<<CCAP_PAR_PCLKP_Pos) /*!< CCAP PAR setting for Sensor Pixel Clock Polarity \hideinitializer */
|
||||
|
||||
/*---------------------------------------------------------------------------------------------------------*/
|
||||
/* INT constant definitions */
|
||||
/*---------------------------------------------------------------------------------------------------------*/
|
||||
#define CCAP_INT_VIEN_ENABLE (0x1ul<<CCAP_INT_VIEN_Pos) /*!< VININT setting for Frame End Interrupt enable \hideinitializer */
|
||||
#define CCAP_INT_MEIEN_ENABLE (0x1ul<<CCAP_INT_MEIEN_Pos) /*!< VININT setting for Bus Master Transfer Error Interrupt enable \hideinitializer */
|
||||
#define CCAP_INT_ADDRMIEN_ENABLE (0x1ul<<CCAP_INT_ADDRMIEN_Pos) /*!< VININT setting for Memory Address Match Interrupt enable \hideinitializer */
|
||||
#define CCAP_INT_MDIEN_ENABLE (0x1ul<<CCAP_INT_MDIEN_Pos) /*!< VININT setting for Motion Detection Output Finish Interrupt Enable enable \hideinitializer */
|
||||
|
||||
|
||||
static uint32_t u32EscapeFrame = 0;
|
||||
/*---------------------------------------------------------------------------------------------------------*/
|
||||
/* Define Error Code */
|
||||
/*---------------------------------------------------------------------------------------------------------*/
|
||||
#define CCAP_INVALID_INT ((int32_t)(0xFFFFFFFF-1))
|
||||
#define CCAP_INVALID_BUF ((int32_t)(0xFFFFFFFF-2))
|
||||
#define CCAP_INVALID_PIPE ((int32_t)(0xFFFFFFFF-3))
|
||||
|
||||
|
||||
/*@}*/ /* end of group NUC472_442_CCAP_EXPORTED_CONSTANTS */
|
||||
|
||||
|
||||
|
||||
/** @addtogroup CCAP_EXPORTED_FUNCTIONS CCAP Exported Functions
|
||||
@{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief Is CCAP module Enable
|
||||
*
|
||||
* @return FALSE(Enable) or TRUE(Disable)
|
||||
*
|
||||
* @details Check Camera Capture Interface module Enable or Disable
|
||||
* \hideinitializer
|
||||
*/
|
||||
#define CCAP_IS_STOPPED() ((CCAP->CTL & CCAP_CTL_CCAPEN_Msk)?0:1)
|
||||
|
||||
/**
|
||||
* @brief Clear CCAP flag
|
||||
*
|
||||
* @param[in] u32IntMask interrupt flags settings. It could be
|
||||
* - \ref CCAP_INT_VINTF_Msk
|
||||
* - \ref CCAP_INT_MEINTF_Msk
|
||||
* - \ref CCAP_INT_ADDRMINTF_Msk
|
||||
* - \ref CCAP_INT_MDINTF_Msk
|
||||
*
|
||||
* @return TRUE(Enable) or FALSE(Disable)
|
||||
*
|
||||
* @details Clear Image Capture Interface interrupt flag
|
||||
* \hideinitializer
|
||||
*/
|
||||
#define CCAP_CLR_INT_FLAG(u32IntMask) (CCAP->INT |=u32IntMask)
|
||||
|
||||
/**
|
||||
* @brief Get CCAP Interrupt status
|
||||
*
|
||||
* @return TRUE(Enable) or FALSE(Disable)
|
||||
*
|
||||
* @details Get Image Capture Interface interrupt status.
|
||||
* \hideinitializer
|
||||
*/
|
||||
#define CCAP_GET_INT_STS() (CCAP->INT)
|
||||
|
||||
void CCAP_Open(uint32_t u32InFormat, uint32_t u32OutFormet);
|
||||
void CCAP_SetCroppingWindow(uint32_t u32VStart,uint32_t u32HStart, uint32_t u32Height, uint32_t u32Width);
|
||||
void CCAP_SetPacketBuf(uint32_t u32Address );
|
||||
void CCAP_Close(void);
|
||||
void CCAP_EnableInt(uint32_t u32IntMask);
|
||||
void CCAP_DisableInt(uint32_t u32IntMask);
|
||||
void CCAP_Start(void);
|
||||
void CCAP_Stop(uint32_t u32FrameComplete);
|
||||
void CCAP_SetPacketScaling(uint32_t u32VNumerator, uint32_t u32VDenominator, uint32_t u32HNumerator, uint32_t u32HDenominator);
|
||||
void CCAP_SetPacketStride(uint32_t u32Stride );
|
||||
void CCAP_EnableMono(uint32_t u32Interface);
|
||||
void CCAP_DisableMono(void);
|
||||
void CCAP_EnableLumaYOne(uint32_t u32th);
|
||||
void CCAP_DisableLumaYOne(void);
|
||||
|
||||
/*@}*/ /* end of group CCAP_EXPORTED_FUNCTIONS */
|
||||
|
||||
|
||||
|
||||
/*@}*/ /* end of group CCAP_Driver */
|
||||
|
||||
/*@}*/ /* end of group Standard_Driver */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif //__NU_CCAP_H__
|
||||
|
||||
/*** (C) COPYRIGHT 2016 Nuvoton Technology Corp. ***/
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,113 @@
|
||||
/**************************************************************************//**
|
||||
* @file nu_crc.h
|
||||
* @version V1.00
|
||||
* @brief M480 series CRC driver header file
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
* @copyright (C) 2016-2020 Nuvoton Technology Corp. All rights reserved.
|
||||
*****************************************************************************/
|
||||
#ifndef __NU_CRC_H__
|
||||
#define __NU_CRC_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
|
||||
/** @addtogroup Standard_Driver Standard Driver
|
||||
@{
|
||||
*/
|
||||
|
||||
/** @addtogroup CRC_Driver CRC Driver
|
||||
@{
|
||||
*/
|
||||
|
||||
/** @addtogroup CRC_EXPORTED_CONSTANTS CRC Exported Constants
|
||||
@{
|
||||
*/
|
||||
/*---------------------------------------------------------------------------------------------------------*/
|
||||
/* CRC Polynomial Mode Constant Definitions */
|
||||
/*---------------------------------------------------------------------------------------------------------*/
|
||||
#define CRC_CCITT (0UL << CRC_CTL_CRCMODE_Pos) /*!<CRC Polynomial Mode - CCITT \hideinitializer */
|
||||
#define CRC_8 (1UL << CRC_CTL_CRCMODE_Pos) /*!<CRC Polynomial Mode - CRC8 \hideinitializer */
|
||||
#define CRC_16 (2UL << CRC_CTL_CRCMODE_Pos) /*!<CRC Polynomial Mode - CRC16 \hideinitializer */
|
||||
#define CRC_32 (3UL << CRC_CTL_CRCMODE_Pos) /*!<CRC Polynomial Mode - CRC32 \hideinitializer */
|
||||
|
||||
/*---------------------------------------------------------------------------------------------------------*/
|
||||
/* Checksum, Write data Constant Definitions */
|
||||
/*---------------------------------------------------------------------------------------------------------*/
|
||||
#define CRC_CHECKSUM_COM (CRC_CTL_CHKSFMT_Msk) /*!<CRC Checksum Complement \hideinitializer */
|
||||
#define CRC_CHECKSUM_RVS (CRC_CTL_CHKSREV_Msk) /*!<CRC Checksum Reverse \hideinitializer */
|
||||
#define CRC_WDATA_COM (CRC_CTL_DATFMT_Msk) /*!<CRC Write Data Complement \hideinitializer */
|
||||
#define CRC_WDATA_RVS (CRC_CTL_DATREV_Msk) /*!<CRC Write Data Reverse \hideinitializer */
|
||||
|
||||
/*---------------------------------------------------------------------------------------------------------*/
|
||||
/* CPU Write Data Length Constant Definitions */
|
||||
/*---------------------------------------------------------------------------------------------------------*/
|
||||
#define CRC_CPU_WDATA_8 (0UL << CRC_CTL_DATLEN_Pos) /*!<CRC CPU Write Data length is 8-bit \hideinitializer */
|
||||
#define CRC_CPU_WDATA_16 (1UL << CRC_CTL_DATLEN_Pos) /*!<CRC CPU Write Data length is 16-bit \hideinitializer */
|
||||
#define CRC_CPU_WDATA_32 (2UL << CRC_CTL_DATLEN_Pos) /*!<CRC CPU Write Data length is 32-bit \hideinitializer */
|
||||
|
||||
/*@}*/ /* end of group CRC_EXPORTED_CONSTANTS */
|
||||
|
||||
|
||||
/** @addtogroup CRC_EXPORTED_FUNCTIONS CRC Exported Functions
|
||||
@{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief Set CRC Seed Value
|
||||
*
|
||||
* @param[in] u32Seed Seed value
|
||||
*
|
||||
* @return None
|
||||
*
|
||||
* @details This macro is used to set CRC seed value.
|
||||
*
|
||||
* @note User must to perform CRC_CHKSINIT(CRC_CTL[1] CRC Engine Reset) to reload the new seed value
|
||||
* to CRC controller.
|
||||
* \hideinitializer
|
||||
*/
|
||||
#define CRC_SET_SEED(u32Seed) do{ CRC->SEED = (u32Seed); CRC->CTL |= CRC_CTL_CHKSINIT_Msk; }while(0)
|
||||
|
||||
/**
|
||||
* @brief Get CRC Seed Value
|
||||
*
|
||||
* @param None
|
||||
*
|
||||
* @return CRC seed value
|
||||
*
|
||||
* @details This macro gets the current CRC seed value.
|
||||
* \hideinitializer
|
||||
*/
|
||||
#define CRC_GET_SEED() (CRC->SEED)
|
||||
|
||||
/**
|
||||
* @brief CRC Write Data
|
||||
*
|
||||
* @param[in] u32Data Write data
|
||||
*
|
||||
* @return None
|
||||
*
|
||||
* @details User can write data directly to CRC Write Data Register(CRC_DAT) by this macro to perform CRC operation.
|
||||
* \hideinitializer
|
||||
*/
|
||||
#define CRC_WRITE_DATA(u32Data) (CRC->DAT = (u32Data))
|
||||
|
||||
void CRC_Open(uint32_t u32Mode, uint32_t u32Attribute, uint32_t u32Seed, uint32_t u32DataLen);
|
||||
uint32_t CRC_GetChecksum(void);
|
||||
|
||||
/*@}*/ /* end of group CRC_EXPORTED_FUNCTIONS */
|
||||
|
||||
/*@}*/ /* end of group CRC_Driver */
|
||||
|
||||
/*@}*/ /* end of group Standard_Driver */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
/*** (C) COPYRIGHT 2016 Nuvoton Technology Corp. ***/
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
Loaded 100 of 322 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user