mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2026-10-14 12:57:45 +08:00
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,9 @@
|
||||
# files format check exclude path, please follow the instructions below to modify;
|
||||
# If you need to exclude an entire folder, add the folder path in dir_path;
|
||||
# If you need to exclude a file, add the path to the file in file_path.
|
||||
|
||||
file_path:
|
||||
|
||||
|
||||
dir_path:
|
||||
- libraries
|
||||
@@ -0,0 +1,23 @@
|
||||
mainmenu "RT-Thread Project Configuration"
|
||||
|
||||
config BSP_DIR
|
||||
string
|
||||
option env="BSP_ROOT"
|
||||
default "."
|
||||
|
||||
config RTT_DIR
|
||||
string
|
||||
option env="RTT_ROOT"
|
||||
default "../.."
|
||||
|
||||
config PKGS_DIR
|
||||
string
|
||||
option env="PKGS_ROOT"
|
||||
default "packages"
|
||||
|
||||
source "$RTT_DIR/Kconfig"
|
||||
source "$PKGS_DIR/Kconfig"
|
||||
source "board/Kconfig"
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,155 @@
|
||||
/******************************************************************************
|
||||
* Copyright (C) 2017, Huada Semiconductor Co.,Ltd All rights reserved.
|
||||
*
|
||||
* This software is owned and published by:
|
||||
* Huada Semiconductor Co.,Ltd ("HDSC").
|
||||
*
|
||||
* BY DOWNLOADING, INSTALLING OR USING THIS SOFTWARE, YOU AGREE TO BE BOUND
|
||||
* BY ALL THE TERMS AND CONDITIONS OF THIS AGREEMENT.
|
||||
*
|
||||
* This software contains source code for use with HDSC
|
||||
* components. This software is licensed by HDSC to be adapted only
|
||||
* for use in systems utilizing HDSC components. HDSC shall not be
|
||||
* responsible for misuse or illegal use of this software for devices not
|
||||
* supported herein. HDSC is providing this software "AS IS" and will
|
||||
* not be responsible for issues arising from incorrect user implementation
|
||||
* of the software.
|
||||
*
|
||||
* Disclaimer:
|
||||
* HDSC MAKES NO WARRANTY, EXPRESS OR IMPLIED, ARISING BY LAW OR OTHERWISE,
|
||||
* REGARDING THE SOFTWARE (INCLUDING ANY ACOOMPANYING WRITTEN MATERIALS),
|
||||
* ITS PERFORMANCE OR SUITABILITY FOR YOUR INTENDED USE, INCLUDING,
|
||||
* WITHOUT LIMITATION, THE IMPLIED WARRANTY OF MERCHANTABILITY, THE IMPLIED
|
||||
* WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE OR USE, AND THE IMPLIED
|
||||
* WARRANTY OF NONINFRINGEMENT.
|
||||
* HDSC SHALL HAVE NO LIABILITY (WHETHER IN CONTRACT, WARRANTY, TORT,
|
||||
* NEGLIGENCE OR OTHERWISE) FOR ANY DAMAGES WHATSOEVER (INCLUDING, WITHOUT
|
||||
* LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION,
|
||||
* LOSS OF BUSINESS INFORMATION, OR OTHER PECUNIARY LOSS) ARISING FROM USE OR
|
||||
* INABILITY TO USE THE SOFTWARE, INCLUDING, WITHOUT LIMITATION, ANY DIRECT,
|
||||
* INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES OR LOSS OF DATA,
|
||||
* SAVINGS OR PROFITS,
|
||||
* EVEN IF Disclaimer HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
* YOU ASSUME ALL RESPONSIBILITIES FOR SELECTION OF THE SOFTWARE TO ACHIEVE YOUR
|
||||
* INTENDED RESULTS, AND FOR THE INSTALLATION OF, USE OF, AND RESULTS OBTAINED
|
||||
* FROM, THE SOFTWARE.
|
||||
*
|
||||
* This software may be replicated in part or whole for the licensed use,
|
||||
* with the restriction that this Disclaimer and Copyright notice must be
|
||||
* included with each copy of this software, whether used in part or whole,
|
||||
* at all times.
|
||||
*/
|
||||
/******************************************************************************/
|
||||
/** \file base_types.h
|
||||
**
|
||||
** base type common define.
|
||||
** @link SampleGroup Some description @endlink
|
||||
**
|
||||
** - 2018-03-09 1.0 Lux First version.
|
||||
**
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __BASE_TYPES_H__
|
||||
#define __BASE_TYPES_H__
|
||||
|
||||
/*****************************************************************************/
|
||||
/* Include files */
|
||||
/*****************************************************************************/
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include <assert.h>
|
||||
|
||||
|
||||
/*****************************************************************************/
|
||||
/* Global pre-processor symbols/macros ('#define') */
|
||||
/*****************************************************************************/
|
||||
#ifndef TRUE
|
||||
/** Value is true (boolean_t type) */
|
||||
#define TRUE ((boolean_t) 1u)
|
||||
#endif
|
||||
|
||||
#ifndef FALSE
|
||||
/** Value is false (boolean_t type) */
|
||||
#define FALSE ((boolean_t) 0u)
|
||||
#endif
|
||||
|
||||
#if defined (__ICCARM__)
|
||||
#define __WEAKDEF __WEAK __ATTRIBUTES
|
||||
#elif defined (__CC_ARM)
|
||||
#define __WEAKDEF __weak
|
||||
#else
|
||||
#error "unsupported compiler!!"
|
||||
#endif
|
||||
|
||||
/** Returns the minimum value out of two values */
|
||||
#define MINIMUM( X, Y ) ((X) < (Y) ? (X) : (Y))
|
||||
|
||||
/** Returns the maximum value out of two values */
|
||||
#define MAXIMUM( X, Y ) ((X) > (Y) ? (X) : (Y))
|
||||
|
||||
/** Returns the dimension of an array */
|
||||
#define ARRAY_SZ( X ) (sizeof(X) / sizeof((X)[0]))
|
||||
|
||||
#ifdef __DEBUG_ASSERT
|
||||
#define ASSERT(x) do{ assert((x)> 0u) ; }while(0);
|
||||
#else
|
||||
#define ASSERT(x) {}
|
||||
#endif
|
||||
/******************************************************************************
|
||||
* Global type definitions
|
||||
******************************************************************************/
|
||||
|
||||
/** logical datatype (only values are TRUE and FALSE) */
|
||||
typedef uint8_t boolean_t;
|
||||
|
||||
/** single precision floating point number (4 byte) */
|
||||
typedef float float32_t;
|
||||
|
||||
/** double precision floating point number (8 byte) */
|
||||
typedef double float64_t;
|
||||
|
||||
/** ASCII character for string generation (8 bit) */
|
||||
typedef char char_t;
|
||||
|
||||
/** function pointer type to void/void function */
|
||||
typedef void (*func_ptr_t)(void);
|
||||
|
||||
/** function pointer type to void/uint8_t function */
|
||||
typedef void (*func_ptr_arg1_t)(uint8_t u8Param);
|
||||
|
||||
/** generic error codes */
|
||||
typedef enum en_result
|
||||
{
|
||||
Ok = 0u, ///< No error
|
||||
Error = 1u, ///< Non-specific error code
|
||||
ErrorAddressAlignment = 2u, ///< Address alignment does not match
|
||||
ErrorAccessRights = 3u, ///< Wrong mode (e.g. user/system) mode is set
|
||||
ErrorInvalidParameter = 4u, ///< Provided parameter is not valid
|
||||
ErrorOperationInProgress = 5u, ///< A conflicting or requested operation is still in progress
|
||||
ErrorInvalidMode = 6u, ///< Operation not allowed in current mode
|
||||
ErrorUninitialized = 7u, ///< Module (or part of it) was not initialized properly
|
||||
ErrorBufferFull = 8u, ///< Circular buffer can not be written because the buffer is full
|
||||
ErrorTimeout = 9u, ///< Time Out error occurred (e.g. I2C arbitration lost, Flash time-out, etc.)
|
||||
ErrorNotReady = 10u, ///< A requested final state is not reached
|
||||
OperationInProgress = 11u ///< Indicator for operation in progress
|
||||
} en_result_t;
|
||||
|
||||
|
||||
/*****************************************************************************/
|
||||
/* Global variable declarations ('extern', definition in C source) */
|
||||
/*****************************************************************************/
|
||||
|
||||
/*****************************************************************************/
|
||||
/* Global function prototypes ('extern', definition in C source) */
|
||||
/*****************************************************************************/
|
||||
|
||||
#endif /* __BASE_TYPES_H__ */
|
||||
|
||||
/******************************************************************************/
|
||||
/* EOF (not truncated) */
|
||||
/******************************************************************************/
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,120 @@
|
||||
/******************************************************************************
|
||||
* Copyright (C) 2017, Huada Semiconductor Co.,Ltd All rights reserved.
|
||||
*
|
||||
* This software is owned and published by:
|
||||
* Huada Semiconductor Co.,Ltd ("HDSC").
|
||||
*
|
||||
* BY DOWNLOADING, INSTALLING OR USING THIS SOFTWARE, YOU AGREE TO BE BOUND
|
||||
* BY ALL THE TERMS AND CONDITIONS OF THIS AGREEMENT.
|
||||
*
|
||||
* This software contains source code for use with HDSC
|
||||
* components. This software is licensed by HDSC to be adapted only
|
||||
* for use in systems utilizing HDSC components. HDSC shall not be
|
||||
* responsible for misuse or illegal use of this software for devices not
|
||||
* supported herein. HDSC is providing this software "AS IS" and will
|
||||
* not be responsible for issues arising from incorrect user implementation
|
||||
* of the software.
|
||||
*
|
||||
* Disclaimer:
|
||||
* HDSC MAKES NO WARRANTY, EXPRESS OR IMPLIED, ARISING BY LAW OR OTHERWISE,
|
||||
* REGARDING THE SOFTWARE (INCLUDING ANY ACOOMPANYING WRITTEN MATERIALS),
|
||||
* ITS PERFORMANCE OR SUITABILITY FOR YOUR INTENDED USE, INCLUDING,
|
||||
* WITHOUT LIMITATION, THE IMPLIED WARRANTY OF MERCHANTABILITY, THE IMPLIED
|
||||
* WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE OR USE, AND THE IMPLIED
|
||||
* WARRANTY OF NONINFRINGEMENT.
|
||||
* HDSC SHALL HAVE NO LIABILITY (WHETHER IN CONTRACT, WARRANTY, TORT,
|
||||
* NEGLIGENCE OR OTHERWISE) FOR ANY DAMAGES WHATSOEVER (INCLUDING, WITHOUT
|
||||
* LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION,
|
||||
* LOSS OF BUSINESS INFORMATION, OR OTHER PECUNIARY LOSS) ARISING FROM USE OR
|
||||
* INABILITY TO USE THE SOFTWARE, INCLUDING, WITHOUT LIMITATION, ANY DIRECT,
|
||||
* INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES OR LOSS OF DATA,
|
||||
* SAVINGS OR PROFITS,
|
||||
* EVEN IF Disclaimer HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
* YOU ASSUME ALL RESPONSIBILITIES FOR SELECTION OF THE SOFTWARE TO ACHIEVE YOUR
|
||||
* INTENDED RESULTS, AND FOR THE INSTALLATION OF, USE OF, AND RESULTS OBTAINED
|
||||
* FROM, THE SOFTWARE.
|
||||
*
|
||||
* This software may be replicated in part or whole for the licensed use,
|
||||
* with the restriction that this Disclaimer and Copyright notice must be
|
||||
* included with each copy of this software, whether used in part or whole,
|
||||
* at all times.
|
||||
*/
|
||||
/******************************************************************************/
|
||||
/** \file stkhc32l13x.h
|
||||
**
|
||||
** stk board common define.
|
||||
** @link SampleGroup Some description @endlink
|
||||
**
|
||||
** - 2018-03-09 1.0 Lux First version.
|
||||
**
|
||||
******************************************************************************/
|
||||
#ifndef __BOARD_STKHC32L13X_H__
|
||||
#define __BOARD_STKHC32L13X_H__
|
||||
|
||||
///< STK GPIO DEFINE
|
||||
///< USER KEY
|
||||
#define STK_USER_PORT GpioPortD
|
||||
#define STK_USER_PIN GpioPin4
|
||||
|
||||
///< LED
|
||||
#define STK_LED_PORT GpioPortD
|
||||
#define STK_LED_PIN GpioPin5
|
||||
|
||||
///< XTH
|
||||
#define SYSTEM_XTH (32*1000*1000u) ///< 32MHz
|
||||
|
||||
#define STK_XTHI_PORT GpioPortD
|
||||
#define STK_XTHI_PIN GpioPin0
|
||||
#define STK_XTHO_PORT GpioPortD
|
||||
#define STK_XTHO_PIN GpioPin1
|
||||
|
||||
///< XTL
|
||||
#define SYSTEM_XTL (32768u) ///< 32768Hz
|
||||
#define STK_XTLI_PORT GpioPortC
|
||||
#define STK_XTLI_PIN GpioPin14
|
||||
#define STK_XTLO_PORT GpioPortC
|
||||
#define STK_XTLO_PIN GpioPin15
|
||||
|
||||
///< LCD
|
||||
#define STK_LCD_COM0_PORT GpioPortA
|
||||
#define STK_LCD_COM0_PIN GpioPin9
|
||||
#define STK_LCD_COM1_PORT GpioPortA
|
||||
#define STK_LCD_COM1_PIN GpioPin10
|
||||
#define STK_LCD_COM2_PORT GpioPortA
|
||||
#define STK_LCD_COM2_PIN GpioPin11
|
||||
#define STK_LCD_COM3_PORT GpioPortA
|
||||
#define STK_LCD_COM3_PIN GpioPin12
|
||||
#define STK_LCD_SEG0_PORT GpioPortA
|
||||
#define STK_LCD_SEG0_PIN GpioPin8
|
||||
#define STK_LCD_SEG1_PORT GpioPortC
|
||||
#define STK_LCD_SEG1_PIN GpioPin9
|
||||
#define STK_LCD_SEG2_PORT GpioPortC
|
||||
#define STK_LCD_SEG2_PIN GpioPin8
|
||||
#define STK_LCD_SEG3_PORT GpioPortC
|
||||
#define STK_LCD_SEG3_PIN GpioPin7
|
||||
#define STK_LCD_SEG4_PORT GpioPortC
|
||||
#define STK_LCD_SEG4_PIN GpioPin6
|
||||
#define STK_LCD_SEG5_PORT GpioPortB
|
||||
#define STK_LCD_SEG5_PIN GpioPin15
|
||||
#define STK_LCD_SEG6_PORT GpioPortB
|
||||
#define STK_LCD_SEG6_PIN GpioPin14
|
||||
#define STK_LCD_SEG7_PORT GpioPortB
|
||||
#define STK_LCD_SEG7_PIN GpioPin13
|
||||
|
||||
///< I2C EEPROM
|
||||
#define EVB_I2C0_EEPROM_SCL_PORT GpioPortB
|
||||
#define EVB_I2C0_EEPROM_SCL_PIN GpioPin6
|
||||
#define EVB_I2C0_EEPROM_SDA_PORT GpioPortB
|
||||
#define EVB_I2C0_EEPROM_SDA_PIN GpioPin7
|
||||
|
||||
///< SPI0
|
||||
#define EVB_SPI0_FLASH_CS_PORT GpioPortE
|
||||
#define EVB_SPI0_FLASH_CS_PIN GpioPin12
|
||||
#define EVB_SPI0_FLASH_SCK_PORT GpioPortE
|
||||
#define EVB_SPI0_FLASH_SCK_PIN GpioPin13
|
||||
#define EVB_SPI0_FLASH_MISO_PORT GpioPortE
|
||||
#define EVB_SPI0_FLASH_MISO_PIN GpioPin14
|
||||
#define EVB_SPI0_FLASH_MOSI_PORT GpioPortE
|
||||
#define EVB_SPI0_FLASH_MOSI_PIN GpioPin15
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,76 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (C) 2018, Huada Semiconductor Co.,Ltd All rights reserved.
|
||||
*
|
||||
* This software is owned and published by:
|
||||
* Huada Semiconductor Co.,Ltd ("HDSC").
|
||||
*
|
||||
* BY DOWNLOADING, INSTALLING OR USING THIS SOFTWARE, YOU AGREE TO BE BOUND
|
||||
* BY ALL THE TERMS AND CONDITIONS OF THIS AGREEMENT.
|
||||
*
|
||||
* This software contains source code for use with HDSC
|
||||
* components. This software is licensed by HDSC to be adapted only
|
||||
* for use in systems utilizing HDSC components. HDSC shall not be
|
||||
* responsible for misuse or illegal use of this software for devices not
|
||||
* supported herein. HDSC is providing this software "AS IS" and will
|
||||
* not be responsible for issues arising from incorrect user implementation
|
||||
* of the software.
|
||||
*
|
||||
* Disclaimer:
|
||||
* HDSC MAKES NO WARRANTY, EXPRESS OR IMPLIED, ARISING BY LAW OR OTHERWISE,
|
||||
* REGARDING THE SOFTWARE (INCLUDING ANY ACOOMPANYING WRITTEN MATERIALS),
|
||||
* ITS PERFORMANCE OR SUITABILITY FOR YOUR INTENDED USE, INCLUDING,
|
||||
* WITHOUT LIMITATION, THE IMPLIED WARRANTY OF MERCHANTABILITY, THE IMPLIED
|
||||
* WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE OR USE, AND THE IMPLIED
|
||||
* WARRANTY OF NONINFRINGEMENT.
|
||||
* HDSC SHALL HAVE NO LIABILITY (WHETHER IN CONTRACT, WARRANTY, TORT,
|
||||
* NEGLIGENCE OR OTHERWISE) FOR ANY DAMAGES WHATSOEVER (INCLUDING, WITHOUT
|
||||
* LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION,
|
||||
* LOSS OF BUSINESS INFORMATION, OR OTHER PECUNIARY LOSS) ARISING FROM USE OR
|
||||
* INABILITY TO USE THE SOFTWARE, INCLUDING, WITHOUT LIMITATION, ANY DIRECT,
|
||||
* INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES OR LOSS OF DATA,
|
||||
* SAVINGS OR PROFITS,
|
||||
* EVEN IF Disclaimer HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
* YOU ASSUME ALL RESPONSIBILITIES FOR SELECTION OF THE SOFTWARE TO ACHIEVE YOUR
|
||||
* INTENDED RESULTS, AND FOR THE INSTALLATION OF, USE OF, AND RESULTS OBTAINED
|
||||
* FROM, THE SOFTWARE.
|
||||
*
|
||||
* This software may be replicated in part or whole for the licensed use,
|
||||
* with the restriction that this Disclaimer and Copyright notice must be
|
||||
* included with each copy of this software, whether used in part or whole,
|
||||
* at all times.
|
||||
*/
|
||||
/******************************************************************************/
|
||||
/** \file ddl_device.h
|
||||
**
|
||||
** Device define
|
||||
** @link SampleGroup Some description @endlink
|
||||
**
|
||||
** - 2018-04-15
|
||||
**
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef __DDL_DEVICE_H__
|
||||
#define __DDL_DEVICE_H__
|
||||
|
||||
/**
|
||||
*******************************************************************************
|
||||
** \brief Global device series definition
|
||||
**
|
||||
** \note
|
||||
******************************************************************************/
|
||||
#define DDL_MCU_SERIES DDL_DEVICE_SERIES_HC32L13X
|
||||
|
||||
|
||||
/**
|
||||
*******************************************************************************
|
||||
** \brief Global package definition
|
||||
**
|
||||
** \note This definition is used for device package settings
|
||||
******************************************************************************/
|
||||
#define DDL_MCU_PACKAGE DDL_DEVICE_PACKAGE_HC_K
|
||||
|
||||
#endif /* __DDL_DEVICE_H__ */
|
||||
|
||||
/*******************************************************************************
|
||||
* EOF (not truncated)
|
||||
******************************************************************************/
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,107 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (C) 2018, Huada Semiconductor Co.,Ltd All rights reserved.
|
||||
*
|
||||
* This software is owned and published by:
|
||||
* Huada Semiconductor Co.,Ltd ("HDSC").
|
||||
*
|
||||
* BY DOWNLOADING, INSTALLING OR USING THIS SOFTWARE, YOU AGREE TO BE BOUND
|
||||
* BY ALL THE TERMS AND CONDITIONS OF THIS AGREEMENT.
|
||||
*
|
||||
* This software contains source code for use with HDSC
|
||||
* components. This software is licensed by HDSC to be adapted only
|
||||
* for use in systems utilizing HDSC components. HDSC shall not be
|
||||
* responsible for misuse or illegal use of this software for devices not
|
||||
* supported herein. HDSC is providing this software "AS IS" and will
|
||||
* not be responsible for issues arising from incorrect user implementation
|
||||
* of the software.
|
||||
*
|
||||
* Disclaimer:
|
||||
* HDSC MAKES NO WARRANTY, EXPRESS OR IMPLIED, ARISING BY LAW OR OTHERWISE,
|
||||
* REGARDING THE SOFTWARE (INCLUDING ANY ACOOMPANYING WRITTEN MATERIALS),
|
||||
* ITS PERFORMANCE OR SUITABILITY FOR YOUR INTENDED USE, INCLUDING,
|
||||
* WITHOUT LIMITATION, THE IMPLIED WARRANTY OF MERCHANTABILITY, THE IMPLIED
|
||||
* WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE OR USE, AND THE IMPLIED
|
||||
* WARRANTY OF NONINFRINGEMENT.
|
||||
* HDSC SHALL HAVE NO LIABILITY (WHETHER IN CONTRACT, WARRANTY, TORT,
|
||||
* NEGLIGENCE OR OTHERWISE) FOR ANY DAMAGES WHATSOEVER (INCLUDING, WITHOUT
|
||||
* LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION,
|
||||
* LOSS OF BUSINESS INFORMATION, OR OTHER PECUNIARY LOSS) ARISING FROM USE OR
|
||||
* INABILITY TO USE THE SOFTWARE, INCLUDING, WITHOUT LIMITATION, ANY DIRECT,
|
||||
* INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES OR LOSS OF DATA,
|
||||
* SAVINGS OR PROFITS,
|
||||
* EVEN IF Disclaimer HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
* YOU ASSUME ALL RESPONSIBILITIES FOR SELECTION OF THE SOFTWARE TO ACHIEVE YOUR
|
||||
* INTENDED RESULTS, AND FOR THE INSTALLATION OF, USE OF, AND RESULTS OBTAINED
|
||||
* FROM, THE SOFTWARE.
|
||||
*
|
||||
* This software may be replicated in part or whole for the licensed use,
|
||||
* with the restriction that this Disclaimer and Copyright notice must be
|
||||
* included with each copy of this software, whether used in part or whole,
|
||||
* at all times.
|
||||
*/
|
||||
/******************************************************************************/
|
||||
/** \file system_hc32l136.h
|
||||
**
|
||||
** A detailed description is available at
|
||||
** @link SampleGroup Some description @endlink
|
||||
**
|
||||
** - 2018-03-09 1.0 Lux First version.
|
||||
**
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __SYSTEM_HC32L136_H__
|
||||
#define __SYSTEM_HC32L136_H__
|
||||
|
||||
/******************************************************************************/
|
||||
/* Include files */
|
||||
/******************************************************************************/
|
||||
#include <stdint.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/******************************************************************************/
|
||||
/* Global pre-processor symbols/macros ('define') */
|
||||
/******************************************************************************/
|
||||
#define HWWD_DISABLE (1)
|
||||
|
||||
|
||||
|
||||
/**
|
||||
******************************************************************************
|
||||
** \brief Clock Setup macro definition
|
||||
**
|
||||
** - 0: CLOCK_SETTING_NONE - User provides own clock setting in application
|
||||
** - 1: CLOCK_SETTING_CMSIS -
|
||||
******************************************************************************/
|
||||
#define CLOCK_SETTING_NONE 0u
|
||||
#define CLOCK_SETTING_CMSIS 1u
|
||||
|
||||
|
||||
/******************************************************************************/
|
||||
/* */
|
||||
/* START OF USER SETTINGS HERE */
|
||||
/* =========================== */
|
||||
/* */
|
||||
/* All lines with '<<<' can be set by user. */
|
||||
/* */
|
||||
/******************************************************************************/
|
||||
|
||||
/******************************************************************************/
|
||||
/* Global function prototypes ('extern', definition in C source) */
|
||||
/******************************************************************************/
|
||||
|
||||
|
||||
extern uint32_t SystemCoreClock; // System Clock Frequency (Core Clock)
|
||||
extern void SystemInit (void); // Initialize the system
|
||||
extern void SystemCoreClockUpdate (void); // Update SystemCoreClock variable
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __SYSTEM_HC32L136_H__ */
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,111 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (C) 2019, Huada Semiconductor Co.,Ltd All rights reserved.
|
||||
*
|
||||
* This software is owned and published by:
|
||||
* Huada Semiconductor Co.,Ltd ("HDSC").
|
||||
*
|
||||
* BY DOWNLOADING, INSTALLING OR USING THIS SOFTWARE, YOU AGREE TO BE BOUND
|
||||
* BY ALL THE TERMS AND CONDITIONS OF THIS AGREEMENT.
|
||||
*
|
||||
* This software contains source code for use with HDSC
|
||||
* components. This software is licensed by HDSC to be adapted only
|
||||
* for use in systems utilizing HDSC components. HDSC shall not be
|
||||
* responsible for misuse or illegal use of this software for devices not
|
||||
* supported herein. HDSC is providing this software "AS IS" and will
|
||||
* not be responsible for issues arising from incorrect user implementation
|
||||
* of the software.
|
||||
*
|
||||
* Disclaimer:
|
||||
* HDSC MAKES NO WARRANTY, EXPRESS OR IMPLIED, ARISING BY LAW OR OTHERWISE,
|
||||
* REGARDING THE SOFTWARE (INCLUDING ANY ACOOMPANYING WRITTEN MATERIALS),
|
||||
* ITS PERFORMANCE OR SUITABILITY FOR YOUR INTENDED USE, INCLUDING,
|
||||
* WITHOUT LIMITATION, THE IMPLIED WARRANTY OF MERCHANTABILITY, THE IMPLIED
|
||||
* WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE OR USE, AND THE IMPLIED
|
||||
* WARRANTY OF NONINFRINGEMENT.
|
||||
* HDSC SHALL HAVE NO LIABILITY (WHETHER IN CONTRACT, WARRANTY, TORT,
|
||||
* NEGLIGENCE OR OTHERWISE) FOR ANY DAMAGES WHATSOEVER (INCLUDING, WITHOUT
|
||||
* LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION,
|
||||
* LOSS OF BUSINESS INFORMATION, OR OTHER PECUNIARY LOSS) ARISING FROM USE OR
|
||||
* INABILITY TO USE THE SOFTWARE, INCLUDING, WITHOUT LIMITATION, ANY DIRECT,
|
||||
* INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES OR LOSS OF DATA,
|
||||
* SAVINGS OR PROFITS,
|
||||
* EVEN IF Disclaimer HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
* YOU ASSUME ALL RESPONSIBILITIES FOR SELECTION OF THE SOFTWARE TO ACHIEVE YOUR
|
||||
* INTENDED RESULTS, AND FOR THE INSTALLATION OF, USE OF, AND RESULTS OBTAINED
|
||||
* FROM, THE SOFTWARE.
|
||||
*
|
||||
* This software may be replicated in part or whole for the licensed use,
|
||||
* with the restriction that this Disclaimer and Copyright notice must be
|
||||
* included with each copy of this software, whether used in part or whole,
|
||||
* at all times.
|
||||
*/
|
||||
/******************************************************************************/
|
||||
/** \file system_hc32l13x.h
|
||||
**
|
||||
** A detailed description is available at
|
||||
** @link SampleGroup Some description @endlink
|
||||
**
|
||||
** - 2019-03-01 1.0 Lux First version.
|
||||
**
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __SYSTEM_HC32L13X_H__
|
||||
#define __SYSTEM_HC32L13X_H__
|
||||
|
||||
/******************************************************************************/
|
||||
/* Include files */
|
||||
/******************************************************************************/
|
||||
#include <stdint.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/******************************************************************************/
|
||||
/* Global pre-processor symbols/macros ('define') */
|
||||
/******************************************************************************/
|
||||
#define HWWD_DISABLE (1)
|
||||
|
||||
|
||||
|
||||
/**
|
||||
******************************************************************************
|
||||
** \brief Clock Setup macro definition
|
||||
**
|
||||
** - 0: CLOCK_SETTING_NONE - User provides own clock setting in application
|
||||
** - 1: CLOCK_SETTING_CMSIS -
|
||||
******************************************************************************/
|
||||
#define CLOCK_SETTING_NONE 0u
|
||||
#define CLOCK_SETTING_CMSIS 1u
|
||||
|
||||
|
||||
/******************************************************************************/
|
||||
/* */
|
||||
/* START OF USER SETTINGS HERE */
|
||||
/* =========================== */
|
||||
/* */
|
||||
/* All lines with '<<<' can be set by user. */
|
||||
/* */
|
||||
/******************************************************************************/
|
||||
|
||||
/******************************************************************************/
|
||||
/* Global function prototypes ('extern', definition in C source) */
|
||||
/******************************************************************************/
|
||||
|
||||
|
||||
extern uint32_t SystemCoreClock; // System Clock Frequency (Core Clock)
|
||||
extern void SystemInit (void); // Initialize the system
|
||||
extern void SystemCoreClockUpdate (void); // Update SystemCoreClock variable
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __SYSTEM_HC32L13X_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,107 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (C) 2018, Huada Semiconductor Co.,Ltd All rights reserved.
|
||||
*
|
||||
* This software is owned and published by:
|
||||
* Huada Semiconductor Co.,Ltd ("HDSC").
|
||||
*
|
||||
* BY DOWNLOADING, INSTALLING OR USING THIS SOFTWARE, YOU AGREE TO BE BOUND
|
||||
* BY ALL THE TERMS AND CONDITIONS OF THIS AGREEMENT.
|
||||
*
|
||||
* This software contains source code for use with HDSC
|
||||
* components. This software is licensed by HDSC to be adapted only
|
||||
* for use in systems utilizing HDSC components. HDSC shall not be
|
||||
* responsible for misuse or illegal use of this software for devices not
|
||||
* supported herein. HDSC is providing this software "AS IS" and will
|
||||
* not be responsible for issues arising from incorrect user implementation
|
||||
* of the software.
|
||||
*
|
||||
* Disclaimer:
|
||||
* HDSC MAKES NO WARRANTY, EXPRESS OR IMPLIED, ARISING BY LAW OR OTHERWISE,
|
||||
* REGARDING THE SOFTWARE (INCLUDING ANY ACOOMPANYING WRITTEN MATERIALS),
|
||||
* ITS PERFORMANCE OR SUITABILITY FOR YOUR INTENDED USE, INCLUDING,
|
||||
* WITHOUT LIMITATION, THE IMPLIED WARRANTY OF MERCHANTABILITY, THE IMPLIED
|
||||
* WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE OR USE, AND THE IMPLIED
|
||||
* WARRANTY OF NONINFRINGEMENT.
|
||||
* HDSC SHALL HAVE NO LIABILITY (WHETHER IN CONTRACT, WARRANTY, TORT,
|
||||
* NEGLIGENCE OR OTHERWISE) FOR ANY DAMAGES WHATSOEVER (INCLUDING, WITHOUT
|
||||
* LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION,
|
||||
* LOSS OF BUSINESS INFORMATION, OR OTHER PECUNIARY LOSS) ARISING FROM USE OR
|
||||
* INABILITY TO USE THE SOFTWARE, INCLUDING, WITHOUT LIMITATION, ANY DIRECT,
|
||||
* INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES OR LOSS OF DATA,
|
||||
* SAVINGS OR PROFITS,
|
||||
* EVEN IF Disclaimer HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
* YOU ASSUME ALL RESPONSIBILITIES FOR SELECTION OF THE SOFTWARE TO ACHIEVE YOUR
|
||||
* INTENDED RESULTS, AND FOR THE INSTALLATION OF, USE OF, AND RESULTS OBTAINED
|
||||
* FROM, THE SOFTWARE.
|
||||
*
|
||||
* This software may be replicated in part or whole for the licensed use,
|
||||
* with the restriction that this Disclaimer and Copyright notice must be
|
||||
* included with each copy of this software, whether used in part or whole,
|
||||
* at all times.
|
||||
*/
|
||||
/******************************************************************************/
|
||||
/** \file system_hc32l136.h
|
||||
**
|
||||
** A detailed description is available at
|
||||
** @link SampleGroup Some description @endlink
|
||||
**
|
||||
** - 2018-03-09 1.0 Lux First version.
|
||||
**
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __SYSTEM_HC32L136_H__
|
||||
#define __SYSTEM_HC32L136_H__
|
||||
|
||||
/******************************************************************************/
|
||||
/* Include files */
|
||||
/******************************************************************************/
|
||||
#include <stdint.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/******************************************************************************/
|
||||
/* Global pre-processor symbols/macros ('define') */
|
||||
/******************************************************************************/
|
||||
#define HWWD_DISABLE (1)
|
||||
|
||||
|
||||
|
||||
/**
|
||||
******************************************************************************
|
||||
** \brief Clock Setup macro definition
|
||||
**
|
||||
** - 0: CLOCK_SETTING_NONE - User provides own clock setting in application
|
||||
** - 1: CLOCK_SETTING_CMSIS -
|
||||
******************************************************************************/
|
||||
#define CLOCK_SETTING_NONE 0u
|
||||
#define CLOCK_SETTING_CMSIS 1u
|
||||
|
||||
|
||||
/******************************************************************************/
|
||||
/* */
|
||||
/* START OF USER SETTINGS HERE */
|
||||
/* =========================== */
|
||||
/* */
|
||||
/* All lines with '<<<' can be set by user. */
|
||||
/* */
|
||||
/******************************************************************************/
|
||||
|
||||
/******************************************************************************/
|
||||
/* Global function prototypes ('extern', definition in C source) */
|
||||
/******************************************************************************/
|
||||
|
||||
|
||||
extern uint32_t SystemCoreClock; // System Clock Frequency (Core Clock)
|
||||
extern void SystemInit (void); // Initialize the system
|
||||
extern void SystemCoreClockUpdate (void); // Update SystemCoreClock variable
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __SYSTEM_HC32L136_H__ */
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,91 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (C) 2019, Huada Semiconductor Co.,Ltd All rights reserved.
|
||||
*
|
||||
* This software is owned and published by:
|
||||
* Huada Semiconductor Co.,Ltd ("HDSC").
|
||||
*
|
||||
* BY DOWNLOADING, INSTALLING OR USING THIS SOFTWARE, YOU AGREE TO BE BOUND
|
||||
* BY ALL THE TERMS AND CONDITIONS OF THIS AGREEMENT.
|
||||
*
|
||||
* This software contains source code for use with HDSC
|
||||
* components. This software is licensed by HDSC to be adapted only
|
||||
* for use in systems utilizing HDSC components. HDSC shall not be
|
||||
* responsible for misuse or illegal use of this software for devices not
|
||||
* supported herein. HDSC is providing this software "AS IS" and will
|
||||
* not be responsible for issues arising from incorrect user implementation
|
||||
* of the software.
|
||||
*
|
||||
* Disclaimer:
|
||||
* HDSC MAKES NO WARRANTY, EXPRESS OR IMPLIED, ARISING BY LAW OR OTHERWISE,
|
||||
* REGARDING THE SOFTWARE (INCLUDING ANY ACOOMPANYING WRITTEN MATERIALS),
|
||||
* ITS PERFORMANCE OR SUITABILITY FOR YOUR INTENDED USE, INCLUDING,
|
||||
* WITHOUT LIMITATION, THE IMPLIED WARRANTY OF MERCHANTABILITY, THE IMPLIED
|
||||
* WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE OR USE, AND THE IMPLIED
|
||||
* WARRANTY OF NONINFRINGEMENT.
|
||||
* HDSC SHALL HAVE NO LIABILITY (WHETHER IN CONTRACT, WARRANTY, TORT,
|
||||
* NEGLIGENCE OR OTHERWISE) FOR ANY DAMAGES WHATSOEVER (INCLUDING, WITHOUT
|
||||
* LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION,
|
||||
* LOSS OF BUSINESS INFORMATION, OR OTHER PECUNIARY LOSS) ARISING FROM USE OR
|
||||
* INABILITY TO USE THE SOFTWARE, INCLUDING, WITHOUT LIMITATION, ANY DIRECT,
|
||||
* INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES OR LOSS OF DATA,
|
||||
* SAVINGS OR PROFITS,
|
||||
* EVEN IF Disclaimer HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
* YOU ASSUME ALL RESPONSIBILITIES FOR SELECTION OF THE SOFTWARE TO ACHIEVE YOUR
|
||||
* INTENDED RESULTS, AND FOR THE INSTALLATION OF, USE OF, AND RESULTS OBTAINED
|
||||
* FROM, THE SOFTWARE.
|
||||
*
|
||||
* This software may be replicated in part or whole for the licensed use,
|
||||
* with the restriction that this Disclaimer and Copyright notice must be
|
||||
* included with each copy of this software, whether used in part or whole,
|
||||
* at all times.
|
||||
*/
|
||||
/******************************************************************************/
|
||||
/** \file system_hc32l13x.c
|
||||
**
|
||||
** System clock initialization.
|
||||
** @link SampleGroup Some description @endlink
|
||||
**
|
||||
** - 2019-03-01 1.0 Lux First version.
|
||||
**
|
||||
******************************************************************************/
|
||||
|
||||
/******************************************************************************/
|
||||
/* Include files */
|
||||
/******************************************************************************/
|
||||
#include "base_types.h"
|
||||
#include "hc32l136.h"
|
||||
#include "system_hc32l13x.h"
|
||||
#include "sysctrl.h"
|
||||
|
||||
/**
|
||||
******************************************************************************
|
||||
** System Clock Frequency (Core Clock) Variable according CMSIS
|
||||
******************************************************************************/
|
||||
uint32_t SystemCoreClock = 4000000;
|
||||
|
||||
|
||||
//add clock source.
|
||||
void SystemCoreClockUpdate (void) // Update SystemCoreClock variable
|
||||
{
|
||||
SystemCoreClock = Sysctrl_GetHClkFreq();
|
||||
}
|
||||
|
||||
/**
|
||||
******************************************************************************
|
||||
** \brief Setup the microcontroller system. Initialize the System and update
|
||||
** the SystemCoreClock variable.
|
||||
**
|
||||
** \param none
|
||||
** \return none
|
||||
******************************************************************************/
|
||||
void SystemInit(void)
|
||||
{
|
||||
SystemCoreClockUpdate();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
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,39 @@
|
||||
/**************************************************************************//**
|
||||
* @file cmsis_version.h
|
||||
* @brief CMSIS Core(M) Version definitions
|
||||
* @version V5.0.3
|
||||
* @date 24. June 2019
|
||||
******************************************************************************/
|
||||
/*
|
||||
* Copyright (c) 2009-2019 ARM Limited. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the License); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an AS IS BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#if defined ( __ICCARM__ )
|
||||
#pragma system_include /* treat file as system include file for MISRA check */
|
||||
#elif defined (__clang__)
|
||||
#pragma clang system_header /* treat file as system include file */
|
||||
#endif
|
||||
|
||||
#ifndef __CMSIS_VERSION_H
|
||||
#define __CMSIS_VERSION_H
|
||||
|
||||
/* CMSIS Version definitions */
|
||||
#define __CM_CMSIS_VERSION_MAIN ( 5U) /*!< [31:16] CMSIS Core(M) main version */
|
||||
#define __CM_CMSIS_VERSION_SUB ( 3U) /*!< [15:0] CMSIS Core(M) sub version */
|
||||
#define __CM_CMSIS_VERSION ((__CM_CMSIS_VERSION_MAIN << 16U) | \
|
||||
__CM_CMSIS_VERSION_SUB ) /*!< CMSIS Core(M) version number */
|
||||
#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
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,70 @@
|
||||
/******************************************************************************
|
||||
* @file tz_context.h
|
||||
* @brief Context Management for Armv8-M TrustZone
|
||||
* @version V1.0.1
|
||||
* @date 10. January 2018
|
||||
******************************************************************************/
|
||||
/*
|
||||
* Copyright (c) 2017-2018 Arm Limited. All rights reserved.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the License); you may
|
||||
* not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an AS IS BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#if defined ( __ICCARM__ )
|
||||
#pragma system_include /* treat file as system include file for MISRA check */
|
||||
#elif defined (__clang__)
|
||||
#pragma clang system_header /* treat file as system include file */
|
||||
#endif
|
||||
|
||||
#ifndef TZ_CONTEXT_H
|
||||
#define TZ_CONTEXT_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#ifndef TZ_MODULEID_T
|
||||
#define TZ_MODULEID_T
|
||||
/// \details Data type that identifies secure software modules called by a process.
|
||||
typedef uint32_t TZ_ModuleId_t;
|
||||
#endif
|
||||
|
||||
/// \details TZ Memory ID identifies an allocated memory slot.
|
||||
typedef uint32_t TZ_MemoryId_t;
|
||||
|
||||
/// Initialize secure context memory system
|
||||
/// \return execution status (1: success, 0: error)
|
||||
uint32_t TZ_InitContextSystem_S (void);
|
||||
|
||||
/// Allocate context memory for calling secure software modules in TrustZone
|
||||
/// \param[in] module identifies software modules called from non-secure mode
|
||||
/// \return value != 0 id TrustZone memory slot identifier
|
||||
/// \return value 0 no memory available or internal error
|
||||
TZ_MemoryId_t TZ_AllocModuleContext_S (TZ_ModuleId_t module);
|
||||
|
||||
/// Free context memory that was previously allocated with \ref TZ_AllocModuleContext_S
|
||||
/// \param[in] id TrustZone memory slot identifier
|
||||
/// \return execution status (1: success, 0: error)
|
||||
uint32_t TZ_FreeModuleContext_S (TZ_MemoryId_t id);
|
||||
|
||||
/// Load secure context (called on RTOS thread context switch)
|
||||
/// \param[in] id TrustZone memory slot identifier
|
||||
/// \return execution status (1: success, 0: error)
|
||||
uint32_t TZ_LoadContext_S (TZ_MemoryId_t id);
|
||||
|
||||
/// Store secure context (called on RTOS thread context switch)
|
||||
/// \param[in] id TrustZone memory slot identifier
|
||||
/// \return execution status (1: success, 0: error)
|
||||
uint32_t TZ_StoreContext_S (TZ_MemoryId_t id);
|
||||
|
||||
#endif // TZ_CONTEXT_H
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,108 @@
|
||||
/******************************************************************************
|
||||
* Copyright (C) 2016, Huada Semiconductor Co.,Ltd All rights reserved.
|
||||
*
|
||||
* This software is owned and published by:
|
||||
* Huada Semiconductor Co.,Ltd ("HDSC").
|
||||
*
|
||||
* BY DOWNLOADING, INSTALLING OR USING THIS SOFTWARE, YOU AGREE TO BE BOUND
|
||||
* BY ALL THE TERMS AND CONDITIONS OF THIS AGREEMENT.
|
||||
*
|
||||
* This software contains source code for use with HDSC
|
||||
* components. This software is licensed by HDSC to be adapted only
|
||||
* for use in systems utilizing HDSC components. HDSC shall not be
|
||||
* responsible for misuse or illegal use of this software for devices not
|
||||
* supported herein. HDSC is providing this software "AS IS" and will
|
||||
* not be responsible for issues arising from incorrect user implementation
|
||||
* of the software.
|
||||
*
|
||||
* Disclaimer:
|
||||
* HDSC MAKES NO WARRANTY, EXPRESS OR IMPLIED, ARISING BY LAW OR OTHERWISE,
|
||||
* REGARDING THE SOFTWARE (INCLUDING ANY ACOOMPANYING WRITTEN MATERIALS),
|
||||
* ITS PERFORMANCE OR SUITABILITY FOR YOUR INTENDED USE, INCLUDING,
|
||||
* WITHOUT LIMITATION, THE IMPLIED WARRANTY OF MERCHANTABILITY, THE IMPLIED
|
||||
* WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE OR USE, AND THE IMPLIED
|
||||
* WARRANTY OF NONINFRINGEMENT.
|
||||
* HDSC SHALL HAVE NO LIABILITY (WHETHER IN CONTRACT, WARRANTY, TORT,
|
||||
* NEGLIGENCE OR OTHERWISE) FOR ANY DAMAGES WHATSOEVER (INCLUDING, WITHOUT
|
||||
* LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION,
|
||||
* LOSS OF BUSINESS INFORMATION, OR OTHER PECUNIARY LOSS) ARISING FROM USE OR
|
||||
* INABILITY TO USE THE SOFTWARE, INCLUDING, WITHOUT LIMITATION, ANY DIRECT,
|
||||
* INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES OR LOSS OF DATA,
|
||||
* SAVINGS OR PROFITS,
|
||||
* EVEN IF Disclaimer HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
* YOU ASSUME ALL RESPONSIBILITIES FOR SELECTION OF THE SOFTWARE TO ACHIEVE YOUR
|
||||
* INTENDED RESULTS, AND FOR THE INSTALLATION OF, USE OF, AND RESULTS OBTAINED
|
||||
* FROM, THE SOFTWARE.
|
||||
*
|
||||
* This software may be replicated in part or whole for the licensed use,
|
||||
* with the restriction that this Disclaimer and Copyright notice must be
|
||||
* included with each copy of this software, whether used in part or whole,
|
||||
* at all times.
|
||||
*/
|
||||
/******************************************************************************/
|
||||
/** \file crc.h
|
||||
**
|
||||
** CRC 数据结构及API声明.
|
||||
**
|
||||
** - 2016-05-04 LuX V1.0.
|
||||
**
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __CRC_H__
|
||||
#define __CRC_H__
|
||||
|
||||
/******************************************************************************
|
||||
* Include files
|
||||
******************************************************************************/
|
||||
#include "ddl.h"
|
||||
#include "interrupts_hc32l136.h"
|
||||
/* C binding of definitions if building with C++ compiler */
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
/**
|
||||
******************************************************************************
|
||||
** \defgroup CrcGroup Cyclic Redundancy Check (CRC)
|
||||
**
|
||||
******************************************************************************/
|
||||
//@{
|
||||
|
||||
/******************************************************************************
|
||||
* Global type definitions
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
* Global definitions
|
||||
******************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
* Local type definitions ('typedef')
|
||||
******************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
* Global variable definitions ('extern')
|
||||
******************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
* Global function prototypes (definition in C source)
|
||||
******************************************************************************/
|
||||
//AES 加密
|
||||
en_result_t AES_Encrypt(uint32_t* pu32Data, uint32_t *pu32Key, uint32_t *pu32Cipher);
|
||||
//AES 解密
|
||||
en_result_t AES_Decrypt(uint32_t *pu32Cipher, uint32_t *pu32Key, uint32_t* pu32Plaintext);
|
||||
|
||||
|
||||
//@} // CRC Group
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __CRC_H__ */
|
||||
/******************************************************************************
|
||||
* EOF (not truncated)
|
||||
******************************************************************************/
|
||||
|
||||
@@ -0,0 +1,109 @@
|
||||
/******************************************************************************
|
||||
* Copyright (C) 2018, Huada Semiconductor Co.,Ltd All rights reserved.
|
||||
*
|
||||
* This software is owned and published by:
|
||||
* Huada Semiconductor Co.,Ltd ("HDSC").
|
||||
*
|
||||
* BY DOWNLOADING, INSTALLING OR USING THIS SOFTWARE, YOU AGREE TO BE BOUND
|
||||
* BY ALL THE TERMS AND CONDITIONS OF THIS AGREEMENT.
|
||||
*
|
||||
* This software contains source code for use with HDSC
|
||||
* components. This software is licensed by HDSC to be adapted only
|
||||
* for use in systems utilizing HDSC components. HDSC shall not be
|
||||
* responsible for misuse or illegal use of this software for devices not
|
||||
* supported herein. HDSC is providing this software "AS IS" and will
|
||||
* not be responsible for issues arising from incorrect user implementation
|
||||
* of the software.
|
||||
*
|
||||
* Disclaimer:
|
||||
* HDSC MAKES NO WARRANTY, EXPRESS OR IMPLIED, ARISING BY LAW OR OTHERWISE,
|
||||
* REGARDING THE SOFTWARE (INCLUDING ANY ACOOMPANYING WRITTEN MATERIALS),
|
||||
* ITS PERFORMANCE OR SUITABILITY FOR YOUR INTENDED USE, INCLUDING,
|
||||
* WITHOUT LIMITATION, THE IMPLIED WARRANTY OF MERCHANTABILITY, THE IMPLIED
|
||||
* WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE OR USE, AND THE IMPLIED
|
||||
* WARRANTY OF NONINFRINGEMENT.
|
||||
* HDSC SHALL HAVE NO LIABILITY (WHETHER IN CONTRACT, WARRANTY, TORT,
|
||||
* NEGLIGENCE OR OTHERWISE) FOR ANY DAMAGES WHATSOEVER (INCLUDING, WITHOUT
|
||||
* LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION,
|
||||
* LOSS OF BUSINESS INFORMATION, OR OTHER PECUNIARY LOSS) ARISING FROM USE OR
|
||||
* INABILITY TO USE THE SOFTWARE, INCLUDING, WITHOUT LIMITATION, ANY DIRECT,
|
||||
* INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES OR LOSS OF DATA,
|
||||
* SAVINGS OR PROFITS,
|
||||
* EVEN IF Disclaimer HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
* YOU ASSUME ALL RESPONSIBILITIES FOR SELECTION OF THE SOFTWARE TO ACHIEVE YOUR
|
||||
* INTENDED RESULTS, AND FOR THE INSTALLATION OF, USE OF, AND RESULTS OBTAINED
|
||||
* FROM, THE SOFTWARE.
|
||||
*
|
||||
* This software may be replicated in part or whole for the licensed use,
|
||||
* with the restriction that this Disclaimer and Copyright notice must be
|
||||
* included with each copy of this software, whether used in part or whole,
|
||||
* at all times.
|
||||
*/
|
||||
/******************************************************************************/
|
||||
/** \file bgr.h
|
||||
**
|
||||
** BGR 数据结构及API声明.
|
||||
**
|
||||
** - 2018-04-21 LuX V1.0.
|
||||
**
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __CRC_H__
|
||||
#define __CRC_H__
|
||||
|
||||
/******************************************************************************
|
||||
* Include files
|
||||
******************************************************************************/
|
||||
#include "ddl.h"
|
||||
|
||||
/* C binding of definitions if building with C++ compiler */
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
/**
|
||||
******************************************************************************
|
||||
** \defgroup BGR
|
||||
**
|
||||
******************************************************************************/
|
||||
//@{
|
||||
|
||||
/******************************************************************************
|
||||
* Global type definitions
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
* Global definitions
|
||||
******************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
* Local type definitions ('typedef')
|
||||
******************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
* Global variable definitions ('extern')
|
||||
******************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
* Global function prototypes (definition in C source)
|
||||
******************************************************************************/
|
||||
///<内部温度传感器使能/关闭
|
||||
en_result_t Bgr_TempSensorEnable(void);
|
||||
en_result_t Bgr_TempSensorDisable(void);
|
||||
///<BGR使能/关闭
|
||||
en_result_t Bgr_BgrEnable(void);
|
||||
en_result_t Bgr_BgrDisable(void);
|
||||
|
||||
//@} // BGR Group
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __BGR_H__ */
|
||||
/******************************************************************************
|
||||
* EOF (not truncated)
|
||||
******************************************************************************/
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,120 @@
|
||||
/******************************************************************************
|
||||
* Copyright (C) 2016, Huada Semiconductor Co.,Ltd All rights reserved.
|
||||
*
|
||||
* This software is owned and published by:
|
||||
* Huada Semiconductor Co.,Ltd ("HDSC").
|
||||
*
|
||||
* BY DOWNLOADING, INSTALLING OR USING THIS SOFTWARE, YOU AGREE TO BE BOUND
|
||||
* BY ALL THE TERMS AND CONDITIONS OF THIS AGREEMENT.
|
||||
*
|
||||
* This software contains source code for use with HDSC
|
||||
* components. This software is licensed by HDSC to be adapted only
|
||||
* for use in systems utilizing HDSC components. HDSC shall not be
|
||||
* responsible for misuse or illegal use of this software for devices not
|
||||
* supported herein. HDSC is providing this software "AS IS" and will
|
||||
* not be responsible for issues arising from incorrect user implementation
|
||||
* of the software.
|
||||
*
|
||||
* Disclaimer:
|
||||
* HDSC MAKES NO WARRANTY, EXPRESS OR IMPLIED, ARISING BY LAW OR OTHERWISE,
|
||||
* REGARDING THE SOFTWARE (INCLUDING ANY ACOOMPANYING WRITTEN MATERIALS),
|
||||
* ITS PERFORMANCE OR SUITABILITY FOR YOUR INTENDED USE, INCLUDING,
|
||||
* WITHOUT LIMITATION, THE IMPLIED WARRANTY OF MERCHANTABILITY, THE IMPLIED
|
||||
* WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE OR USE, AND THE IMPLIED
|
||||
* WARRANTY OF NONINFRINGEMENT.
|
||||
* HDSC SHALL HAVE NO LIABILITY (WHETHER IN CONTRACT, WARRANTY, TORT,
|
||||
* NEGLIGENCE OR OTHERWISE) FOR ANY DAMAGES WHATSOEVER (INCLUDING, WITHOUT
|
||||
* LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION,
|
||||
* LOSS OF BUSINESS INFORMATION, OR OTHER PECUNIARY LOSS) ARISING FROM USE OR
|
||||
* INABILITY TO USE THE SOFTWARE, INCLUDING, WITHOUT LIMITATION, ANY DIRECT,
|
||||
* INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES OR LOSS OF DATA,
|
||||
* SAVINGS OR PROFITS,
|
||||
* EVEN IF Disclaimer HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
* YOU ASSUME ALL RESPONSIBILITIES FOR SELECTION OF THE SOFTWARE TO ACHIEVE YOUR
|
||||
* INTENDED RESULTS, AND FOR THE INSTALLATION OF, USE OF, AND RESULTS OBTAINED
|
||||
* FROM, THE SOFTWARE.
|
||||
*
|
||||
* This software may be replicated in part or whole for the licensed use,
|
||||
* with the restriction that this Disclaimer and Copyright notice must be
|
||||
* included with each copy of this software, whether used in part or whole,
|
||||
* at all times.
|
||||
*/
|
||||
/******************************************************************************/
|
||||
/** \file crc.h
|
||||
**
|
||||
** CRC 数据结构及API声明.
|
||||
**
|
||||
** - 2016-05-04 LuX V1.0.
|
||||
**
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __CRC_H__
|
||||
#define __CRC_H__
|
||||
|
||||
/******************************************************************************
|
||||
* Include files
|
||||
******************************************************************************/
|
||||
#include "sysctrl.h"
|
||||
|
||||
/* C binding of definitions if building with C++ compiler */
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
/**
|
||||
******************************************************************************
|
||||
** \defgroup CrcGroup Cyclic Redundancy Check (CRC)
|
||||
**
|
||||
******************************************************************************/
|
||||
//@{
|
||||
|
||||
/******************************************************************************
|
||||
* Global type definitions
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
* Global definitions
|
||||
******************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
* Local type definitions ('typedef')
|
||||
******************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
* Global variable definitions ('extern')
|
||||
******************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
* Global function prototypes (definition in C source)
|
||||
******************************************************************************/
|
||||
//CRC16 编码值获取
|
||||
uint16_t CRC16_Get8(uint8_t* pu8Data, uint32_t u32Len);
|
||||
uint16_t CRC16_Get16(uint16_t* pu16Data, uint32_t u32Len);
|
||||
uint16_t CRC16_Get32(uint32_t* pu32Data, uint32_t u32Len);
|
||||
//CRC16 校验
|
||||
en_result_t CRC16_Check8(uint8_t* pu8Data, uint32_t u32Len, uint16_t u16CRC);
|
||||
en_result_t CRC16_Check16(uint16_t* pu16Data, uint32_t u32Len, uint16_t u16CRC);
|
||||
en_result_t CRC16_Check32(uint32_t* pu32Data, uint32_t u32Len, uint16_t u16CRC);
|
||||
|
||||
|
||||
//CRC32 编码值获取
|
||||
uint32_t CRC32_Get8(uint8_t* pu8Data, uint32_t u32Len);
|
||||
uint32_t CRC32_Get16(uint16_t* pu16Data, uint32_t u32Len);
|
||||
uint32_t CRC32_Get32(uint32_t* pu32Data, uint32_t u32Len);
|
||||
//CRC32 校验
|
||||
en_result_t CRC32_Check8(uint8_t* pu8Data, uint32_t u32Len, uint32_t u32CRC);
|
||||
en_result_t CRC32_Check16(uint16_t* pu16Data, uint32_t u32Len, uint32_t u32CRC);
|
||||
en_result_t CRC32_Check32(uint32_t* pu32Data, uint32_t u32Len, uint32_t u32CRC);
|
||||
//@} // CRC Group
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __CRC_H__ */
|
||||
/******************************************************************************
|
||||
* EOF (not truncated)
|
||||
******************************************************************************/
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,129 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (C) 2018, Huada Semiconductor Co.,Ltd All rights reserved.
|
||||
*
|
||||
* This software is owned and published by:
|
||||
* Huada Semiconductor Co.,Ltd ("HDSC").
|
||||
*
|
||||
* BY DOWNLOADING, INSTALLING OR USING THIS SOFTWARE, YOU AGREE TO BE BOUND
|
||||
* BY ALL THE TERMS AND CONDITIONS OF THIS AGREEMENT.
|
||||
*
|
||||
* This software contains source code for use with HDSC
|
||||
* components. This software is licensed by HDSC to be adapted only
|
||||
* for use in systems utilizing HDSC components. HDSC shall not be
|
||||
* responsible for misuse or illegal use of this software for devices not
|
||||
* supported herein. HDSC is providing this software "AS IS" and will
|
||||
* not be responsible for issues arising from incorrect user implementation
|
||||
* of the software.
|
||||
*
|
||||
* Disclaimer:
|
||||
* HDSC MAKES NO WARRANTY, EXPRESS OR IMPLIED, ARISING BY LAW OR OTHERWISE,
|
||||
* REGARDING THE SOFTWARE (INCLUDING ANY ACOOMPANYING WRITTEN MATERIALS),
|
||||
* ITS PERFORMANCE OR SUITABILITY FOR YOUR INTENDED USE, INCLUDING,
|
||||
* WITHOUT LIMITATION, THE IMPLIED WARRANTY OF MERCHANTABILITY, THE IMPLIED
|
||||
* WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE OR USE, AND THE IMPLIED
|
||||
* WARRANTY OF NONINFRINGEMENT.
|
||||
* HDSC SHALL HAVE NO LIABILITY (WHETHER IN CONTRACT, WARRANTY, TORT,
|
||||
* NEGLIGENCE OR OTHERWISE) FOR ANY DAMAGES WHATSOEVER (INCLUDING, WITHOUT
|
||||
* LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION,
|
||||
* LOSS OF BUSINESS INFORMATION, OR OTHER PECUNIARY LOSS) ARISING FROM USE OR
|
||||
* INABILITY TO USE THE SOFTWARE, INCLUDING, WITHOUT LIMITATION, ANY DIRECT,
|
||||
* INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES OR LOSS OF DATA,
|
||||
* SAVINGS OR PROFITS,
|
||||
* EVEN IF Disclaimer HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
* YOU ASSUME ALL RESPONSIBILITIES FOR SELECTION OF THE SOFTWARE TO ACHIEVE YOUR
|
||||
* INTENDED RESULTS, AND FOR THE INSTALLATION OF, USE OF, AND RESULTS OBTAINED
|
||||
* FROM, THE SOFTWARE.
|
||||
*
|
||||
* This software may be replicated in part or whole for the licensed use,
|
||||
* with the restriction that this Disclaimer and Copyright notice must be
|
||||
* included with each copy of this software, whether used in part or whole,
|
||||
* at all times.
|
||||
*/
|
||||
/******************************************************************************/
|
||||
/** \file debug.h
|
||||
**
|
||||
** Headerfile for DEBUG functions
|
||||
** @link Debug Group Some description @endlink
|
||||
**
|
||||
** History:
|
||||
** - 2018-04-15 Lux First Version
|
||||
**
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __DEBUG_H__
|
||||
#define __DEBUG_H__
|
||||
|
||||
/*******************************************************************************
|
||||
* Include files
|
||||
******************************************************************************/
|
||||
#include "ddl.h"
|
||||
#include "interrupts_hc32l136.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
/**
|
||||
******************************************************************************
|
||||
** \defgroup DebugGroup (DEBUG)
|
||||
**
|
||||
******************************************************************************/
|
||||
//@{
|
||||
|
||||
/**
|
||||
*******************************************************************************
|
||||
** function prototypes.
|
||||
******************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
* Global type definitions
|
||||
******************************************************************************/
|
||||
/**
|
||||
*******************************************************************************
|
||||
** \brief 调试模式下各模块工作状态类型定义
|
||||
** \note
|
||||
******************************************************************************/
|
||||
typedef enum en_debug_module_active
|
||||
{
|
||||
DebugTim0 = 0x001u, ///< TIM0
|
||||
DebugTim1 = 0x002u, ///< TIM1
|
||||
DebugTim2 = 0x004u, ///< TIM2
|
||||
DebugLpTim = 0x008u, ///< LPTIM
|
||||
DebugTim4 = 0x010u, ///< TIM4
|
||||
DebugTim5 = 0x020u, ///< TIM5
|
||||
DebugTim6 = 0x040u, ///< TIM6
|
||||
DebugPca = 0x080u, ///< PCA
|
||||
DebugWdt = 0x100u, ///< WDT
|
||||
DebugRtc = 0x200u, ///< RTC
|
||||
DebugTick = 0x400u, ///< TICK
|
||||
DebugTim3 = 0x800u, ///< TIM3
|
||||
}en_debug_module_active_t;
|
||||
|
||||
/*******************************************************************************
|
||||
* Global definitions
|
||||
******************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
* Global variable declarations ('extern', definition in C source)
|
||||
******************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
* Global function prototypes (definition in C source)
|
||||
******************************************************************************/
|
||||
///< 在SWD调试界面下,使能模块功能
|
||||
en_result_t Debug_ActiveEnable(en_debug_module_active_t enModule);
|
||||
///< 在SWD调试界面下,暂停模块功能
|
||||
en_result_t Debug_ActiveDisable(en_debug_module_active_t enModule);
|
||||
|
||||
//@} // Debug Group
|
||||
|
||||
#ifdef __cplusplus
|
||||
#endif
|
||||
|
||||
#endif /* __DEBUG_H__ */
|
||||
/*******************************************************************************
|
||||
* EOF (not truncated)
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,196 @@
|
||||
/*************************************************************************************
|
||||
* Copyright (C) 2016, Huada Semiconductor Co.,Ltd All rights reserved.
|
||||
*
|
||||
* This software is owned and published by:
|
||||
* Huada Semiconductor Co.,Ltd ("HDSC").
|
||||
*
|
||||
* BY DOWNLOADING, INSTALLING OR USING THIS SOFTWARE, YOU AGREE TO BE BOUND
|
||||
* BY ALL THE TERMS AND CONDITIONS OF THIS AGREEMENT.
|
||||
*
|
||||
* This software contains source code for use with HDSC
|
||||
* components. This software is licensed by HDSC to be adapted only
|
||||
* for use in systems utilizing HDSC components. HDSC shall not be
|
||||
* responsible for misuse or illegal use of this software for devices not
|
||||
* supported herein. HDSC is providing this software "AS IS" and will
|
||||
* not be responsible for issues arising from incorrect user implementation
|
||||
* of the software.
|
||||
*
|
||||
* Disclaimer:
|
||||
* HDSC MAKES NO WARRANTY, EXPRESS OR IMPLIED, ARISING BY LAW OR OTHERWISE,
|
||||
* REGARDING THE SOFTWARE (INCLUDING ANY ACOOMPANYING WRITTEN MATERIALS),
|
||||
* ITS PERFORMANCE OR SUITABILITY FOR YOUR INTENDED USE, INCLUDING,
|
||||
* WITHOUT LIMITATION, THE IMPLIED WARRANTY OF MERCHANTABILITY, THE IMPLIED
|
||||
* WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE OR USE, AND THE IMPLIED
|
||||
* WARRANTY OF NONINFRINGEMENT.
|
||||
* HDSC SHALL HAVE NO LIABILITY (WHETHER IN CONTRACT, WARRANTY, TORT,
|
||||
* NEGLIGENCE OR OTHERWISE) FOR ANY DAMAGES WHATSOEVER (INCLUDING, WITHOUT
|
||||
* LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION,
|
||||
* LOSS OF BUSINESS INFORMATION, OR OTHER PECUNIARY LOSS) ARISING FROM USE OR
|
||||
* INABILITY TO USE THE SOFTWARE, INCLUDING, WITHOUT LIMITATION, ANY DIRECT,
|
||||
* INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES OR LOSS OF DATA,
|
||||
* SAVINGS OR PROFITS,
|
||||
* EVEN IF Disclaimer HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
* YOU ASSUME ALL RESPONSIBILITIES FOR SELECTION OF THE SOFTWARE TO ACHIEVE YOUR
|
||||
* INTENDED RESULTS, AND FOR THE INSTALLATION OF, USE OF, AND RESULTS OBTAINED
|
||||
* FROM, THE SOFTWARE.
|
||||
*
|
||||
* This software may be replicated in part or whole for the licensed use,
|
||||
* with the restriction that this Disclaimer and Copyright notice must be
|
||||
* included with each copy of this software, whether used in part or whole,
|
||||
* at all times.
|
||||
*/
|
||||
/******************************************************************************/
|
||||
/** \file flash.h
|
||||
**
|
||||
** FLASH 数据结构及API声明.
|
||||
**
|
||||
** - 2017-05-02 LuX V1.0
|
||||
**
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __FLASH_H__
|
||||
#define __FLASH_H__
|
||||
|
||||
/******************************************************************************/
|
||||
/* Include files */
|
||||
/******************************************************************************/
|
||||
#include "ddl.h"
|
||||
|
||||
/* C binding of definitions if building with C++ compiler */
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
/**
|
||||
******************************************************************************
|
||||
** \defgroup FlashGroup Flash Controller (Flash)
|
||||
**
|
||||
**
|
||||
******************************************************************************/
|
||||
//@{
|
||||
|
||||
/******************************************************************************
|
||||
* Global type definitions
|
||||
******************************************************************************/
|
||||
/**
|
||||
******************************************************************************
|
||||
** \brief Flash中断类型重定义
|
||||
*****************************************************************************/
|
||||
typedef enum en_flash_int_type
|
||||
{
|
||||
FlashPCInt = 1u, ///<擦写PC地址报警中断
|
||||
FlashSlockInt = 0u, ///<擦写保护报警中断
|
||||
} en_flash_int_type_t;
|
||||
|
||||
|
||||
/**
|
||||
******************************************************************************
|
||||
** \brief Flash读等待周期类型重定义
|
||||
*****************************************************************************/
|
||||
typedef enum en_flash_waitcycle
|
||||
{
|
||||
FlashWaitCycle0 = 0u, ///< 读等待周期设置为0(当HCLK小于等于24MHz时)
|
||||
FlashWaitCycle1 = 1u, ///< 读等待周期设置为1(当HCLK大于24MHz时必须至少为1)
|
||||
FlashWaitCycle2 = 2u, ///< 读等待周期设置为2(当HCK大于48MHz时必须至少为2)
|
||||
} en_flash_waitcycle_t;
|
||||
|
||||
/**
|
||||
******************************************************************************
|
||||
** \brief Flash擦写保护范围重定义
|
||||
*****************************************************************************/
|
||||
typedef enum en_flash_sector_lock
|
||||
{
|
||||
FlashSector0_3 = 0x00000001u, ///<Sector0_3
|
||||
FlashSector4_7 = 0x00000002u, ///<Sector4_7
|
||||
FlashSector8_11 = 0x00000004u, ///<Sector8_11
|
||||
FlashSector12_15 = 0x00000008u, ///<Sector12_15
|
||||
FlashSector16_19 = 0x00000010u, ///<Sector16_19
|
||||
FlashSector20_23 = 0x00000020u, ///<Sector20_23
|
||||
FlashSector24_27 = 0x00000040u, ///<Sector24_27
|
||||
FlashSector28_31 = 0x00000080u, ///<Sector28_31
|
||||
FlashSector32_35 = 0x00000100u, ///<Sector32_35
|
||||
FlashSector36_39 = 0x00000200u, ///<Sector36_39
|
||||
FlashSector40_43 = 0x00000400u, ///<Sector40_43
|
||||
FlashSector44_47 = 0x00000800u, ///<Sector44_47
|
||||
FlashSector48_51 = 0x00001000u, ///<Sector48_51
|
||||
FlashSector52_55 = 0x00002000u, ///<Sector52_55
|
||||
FlashSector56_59 = 0x00004000u, ///<Sector56_59
|
||||
FlashSector60_63 = 0x00008000u, ///<Sector60_63
|
||||
FlashSector64_67 = 0x00010000u, ///<Sector64_67
|
||||
FlashSector68_71 = 0x00020000u, ///<Sector68_71
|
||||
FlashSector72_75 = 0x00040000u, ///<Sector72_75
|
||||
FlashSector76_79 = 0x00080000u, ///<Sector76_79
|
||||
FlashSector80_83 = 0x00100000u, ///<Sector80_83
|
||||
FlashSector84_87 = 0x00200000u, ///<Sector84_87
|
||||
FlashSector88_91 = 0x00400000u, ///<Sector88_91
|
||||
FlashSector92_95 = 0x00800000u, ///<Sector92_95
|
||||
FlashSector96_99 = 0x01000000u, ///<Sector96_99
|
||||
FlashSector100_103 = 0x02000000u, ///<Sector100_103
|
||||
FlashSector104_107 = 0x04000000u, ///<Sector104_107
|
||||
FlashSector108_111 = 0x08000000u, ///<Sector108_111
|
||||
FlashSector112_115 = 0x10000000u, ///<Sector112_115
|
||||
FlashSector116_119 = 0x20000000u, ///<Sector116_119
|
||||
FlashSector120_123 = 0x40000000u, ///<Sector120_123
|
||||
FlashSector124_127 = (int)0x80000000u, ///<Sector124_127
|
||||
FlashSectorAll = (int)0xFFFFFFFFu, ///<SectorAll
|
||||
} en_flash_sector_lock_t;
|
||||
|
||||
/**
|
||||
******************************************************************************
|
||||
** \brief Redefinition of FLASH register structure
|
||||
******************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
* Global definitions
|
||||
******************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
* Local type definitions ('typedef')
|
||||
******************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
* Global variable definitions ('extern')
|
||||
******************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
* Global function prototypes (definition in C source)
|
||||
******************************************************************************/
|
||||
///<Flash 初始化配置(中断函数、编程时间参数及休眠模式配置)
|
||||
en_result_t Flash_Init(func_ptr_t pfnFlashCb, uint8_t u8FreqCfg, boolean_t bDpstbEn);
|
||||
|
||||
///<Flash 页/全片擦除
|
||||
en_result_t Flash_SectorErase(uint32_t u32SectorAddr);
|
||||
en_result_t Flash_ChipErase(void);
|
||||
|
||||
///<Flash 字节/半字/字写
|
||||
en_result_t Flash_WriteByte(uint32_t u32Addr, uint8_t u8Data);
|
||||
en_result_t Flash_WriteHalfWord(uint32_t u32Addr, uint16_t u16Data);
|
||||
en_result_t Flash_WriteWord(uint32_t u32Addr, uint32_t u32Data);
|
||||
|
||||
///<Flash 编程保护加锁/解锁
|
||||
en_result_t Flash_Lock(en_flash_sector_lock_t enFlashSector);
|
||||
en_result_t Flash_Unlock(en_flash_sector_lock_t enFlashSector);
|
||||
|
||||
///<Flash 读等待周期设定
|
||||
en_result_t Flash_WaitCycle(en_flash_waitcycle_t enWaitCycle);
|
||||
|
||||
///<中断相关函数
|
||||
///<中断使能/禁止
|
||||
en_result_t Flash_EnableIrq(en_flash_int_type_t enFlashIntType);
|
||||
en_result_t Flash_DisableIrq(en_flash_int_type_t enFlashIntType);
|
||||
///<中断标志获取
|
||||
boolean_t Flash_GetIntFlag(en_flash_int_type_t enFlashIntType);
|
||||
///<中断标志清除
|
||||
en_result_t Flash_ClearIntFlag(en_flash_int_type_t enFlashIntType);
|
||||
|
||||
//@} // FlashGroup
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __FLASH_H__ */
|
||||
/******************************************************************************/
|
||||
/* EOF (not truncated) */
|
||||
/******************************************************************************/
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,119 @@
|
||||
/******************************************************************************
|
||||
* Copyright (C) 2016, Huada Semiconductor Co.,Ltd All rights reserved.
|
||||
*
|
||||
* This software is owned and published by:
|
||||
* Huada Semiconductor Co.,Ltd ("HDSC").
|
||||
*
|
||||
* BY DOWNLOADING, INSTALLING OR USING THIS SOFTWARE, YOU AGREE TO BE BOUND
|
||||
* BY ALL THE TERMS AND CONDITIONS OF THIS AGREEMENT.
|
||||
*
|
||||
* This software contains source code for use with HDSC
|
||||
* components. This software is licensed by HDSC to be adapted only
|
||||
* for use in systems utilizing HDSC components. HDSC shall not be
|
||||
* responsible for misuse or illegal use of this software for devices not
|
||||
* supported herein. HDSC is providing this software "AS IS" and will
|
||||
* not be responsible for issues arising from incorrect user implementation
|
||||
* of the software.
|
||||
*
|
||||
* Disclaimer:
|
||||
* HDSC MAKES NO WARRANTY, EXPRESS OR IMPLIED, ARISING BY LAW OR OTHERWISE,
|
||||
* REGARDING THE SOFTWARE (INCLUDING ANY ACOOMPANYING WRITTEN MATERIALS),
|
||||
* ITS PERFORMANCE OR SUITABILITY FOR YOUR INTENDED USE, INCLUDING,
|
||||
* WITHOUT LIMITATION, THE IMPLIED WARRANTY OF MERCHANTABILITY, THE IMPLIED
|
||||
* WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE OR USE, AND THE IMPLIED
|
||||
* WARRANTY OF NONINFRINGEMENT.
|
||||
* HDSC SHALL HAVE NO LIABILITY (WHETHER IN CONTRACT, WARRANTY, TORT,
|
||||
* NEGLIGENCE OR OTHERWISE) FOR ANY DAMAGES WHATSOEVER (INCLUDING, WITHOUT
|
||||
* LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION,
|
||||
* LOSS OF BUSINESS INFORMATION, OR OTHER PECUNIARY LOSS) ARISING FROM USE OR
|
||||
* INABILITY TO USE THE SOFTWARE, INCLUDING, WITHOUT LIMITATION, ANY DIRECT,
|
||||
* INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES OR LOSS OF DATA,
|
||||
* SAVINGS OR PROFITS,
|
||||
* EVEN IF Disclaimer HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
* YOU ASSUME ALL RESPONSIBILITIES FOR SELECTION OF THE SOFTWARE TO ACHIEVE YOUR
|
||||
* INTENDED RESULTS, AND FOR THE INSTALLATION OF, USE OF, AND RESULTS OBTAINED
|
||||
* FROM, THE SOFTWARE.
|
||||
*
|
||||
* This software may be replicated in part or whole for the licensed use,
|
||||
* with the restriction that this Disclaimer and Copyright notice must be
|
||||
* included with each copy of this software, whether used in part or whole,
|
||||
* at all times.
|
||||
*/
|
||||
/******************************************************************************/
|
||||
/** \file crc.h
|
||||
**
|
||||
** CRC 数据结构及API声明.
|
||||
**
|
||||
** - 2016-05-04 LuX V1.0.
|
||||
**
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __CRC_H__
|
||||
#define __HDIV_H__
|
||||
|
||||
/******************************************************************************
|
||||
* Include files
|
||||
******************************************************************************/
|
||||
#include "ddl.h"
|
||||
#include "interrupts_hc32l136.h"
|
||||
|
||||
/* C binding of definitions if building with C++ compiler */
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
/**
|
||||
******************************************************************************
|
||||
** \defgroup CrcGroup Cyclic Redundancy Check (CRC)
|
||||
**
|
||||
******************************************************************************/
|
||||
//@{
|
||||
|
||||
/******************************************************************************
|
||||
* Global type definitions
|
||||
******************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
* Global definitions
|
||||
******************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
* Local type definitions ('typedef')
|
||||
******************************************************************************/
|
||||
typedef struct stc_div_unsigned_result
|
||||
{
|
||||
uint32_t Quotient;
|
||||
uint32_t Remainder;
|
||||
}stc_div_unsigned_result_t;
|
||||
|
||||
typedef struct stc_div_signed_result
|
||||
{
|
||||
int32_t Quotient;
|
||||
int32_t Remainder;
|
||||
}stc_div_signed_result_t;
|
||||
/******************************************************************************
|
||||
* Global variable definitions ('extern')
|
||||
******************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
* Global function prototypes (definition in C source)
|
||||
******************************************************************************/
|
||||
//HDIV
|
||||
en_result_t Hdiv_Unsigned(uint32_t Dividend,uint16_t Divisor,stc_div_unsigned_result_t* stcDivResult);
|
||||
en_result_t Hdiv_Signed(int32_t Dividend,int16_t Divisor,stc_div_signed_result_t* stcDivResult);
|
||||
|
||||
boolean_t Hdiv_GetEndState(void);
|
||||
boolean_t Hdiv_GetZeroState(void);
|
||||
|
||||
//@} // CRC Group
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __CRC_H__ */
|
||||
/******************************************************************************
|
||||
* EOF (not truncated)
|
||||
******************************************************************************/
|
||||
|
||||
@@ -0,0 +1,167 @@
|
||||
/******************************************************************************
|
||||
* Copyright (C) 2017, Huada Semiconductor Co.,Ltd All rights reserved.
|
||||
*
|
||||
* This software is owned and published by:
|
||||
* Huada Semiconductor Co.,Ltd ("HDSC").
|
||||
*
|
||||
* BY DOWNLOADING, INSTALLING OR USING THIS SOFTWARE, YOU AGREE TO BE BOUND
|
||||
* BY ALL THE TERMS AND CONDITIONS OF THIS AGREEMENT.
|
||||
*
|
||||
* This software contains source code for use with HDSC
|
||||
* components. This software is licensed by HDSC to be adapted only
|
||||
* for use in systems utilizing HDSC components. HDSC shall not be
|
||||
* responsible for misuse or illegal use of this software for devices not
|
||||
* supported herein. HDSC is providing this software "AS IS" and will
|
||||
* not be responsible for issues arising from incorrect user implementation
|
||||
* of the software.
|
||||
*
|
||||
* Disclaimer:
|
||||
* HDSC MAKES NO WARRANTY, EXPRESS OR IMPLIED, ARISING BY LAW OR OTHERWISE,
|
||||
* REGARDING THE SOFTWARE (INCLUDING ANY ACOOMPANYING WRITTEN MATERIALS),
|
||||
* ITS PERFORMANCE OR SUITABILITY FOR YOUR INTENDED USE, INCLUDING,
|
||||
* WITHOUT LIMITATION, THE IMPLIED WARRANTY OF MERCHANTABILITY, THE IMPLIED
|
||||
* WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE OR USE, AND THE IMPLIED
|
||||
* WARRANTY OF NONINFRINGEMENT.
|
||||
* HDSC SHALL HAVE NO LIABILITY (WHETHER IN CONTRACT, WARRANTY, TORT,
|
||||
* NEGLIGENCE OR OTHERWISE) FOR ANY DAMAGES WHATSOEVER (INCLUDING, WITHOUT
|
||||
* LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION,
|
||||
* LOSS OF BUSINESS INFORMATION, OR OTHER PECUNIARY LOSS) ARISING FROM USE OR
|
||||
* INABILITY TO USE THE SOFTWARE, INCLUDING, WITHOUT LIMITATION, ANY DIRECT,
|
||||
* INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES OR LOSS OF DATA,
|
||||
* SAVINGS OR PROFITS,
|
||||
* EVEN IF Disclaimer HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
* YOU ASSUME ALL RESPONSIBILITIES FOR SELECTION OF THE SOFTWARE TO ACHIEVE YOUR
|
||||
* INTENDED RESULTS, AND FOR THE INSTALLATION OF, USE OF, AND RESULTS OBTAINED
|
||||
* FROM, THE SOFTWARE.
|
||||
*
|
||||
* This software may be replicated in part or whole for the licensed use,
|
||||
* with the restriction that this Disclaimer and Copyright notice must be
|
||||
* included with each copy of this software, whether used in part or whole,
|
||||
* at all times.
|
||||
*/
|
||||
/*****************************************************************************/
|
||||
/** \file i2c.h
|
||||
**
|
||||
** Headerfile for I2C functions
|
||||
**
|
||||
**
|
||||
** History:
|
||||
** - 2018-03-1 CJ First Version
|
||||
**
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef __I2C_H__
|
||||
#define __I2C_H__
|
||||
|
||||
#include "ddl.h"
|
||||
#include "interrupts_hc32l136.h"
|
||||
|
||||
/**
|
||||
*******************************************************************************
|
||||
** \defgroup I2cGroup Inter-Integrated Circuit (I2C)
|
||||
**
|
||||
**
|
||||
******************************************************************************/
|
||||
//@{
|
||||
|
||||
/******************************************************************************/
|
||||
/* Global pre-processor symbols/macros ('#define') */
|
||||
/******************************************************************************/
|
||||
/******************************************************************************
|
||||
* Global type definitions
|
||||
******************************************************************************/
|
||||
/**
|
||||
******************************************************************************
|
||||
** \brief I2C通道选择
|
||||
*****************************************************************************/
|
||||
typedef enum en_i2c_channel
|
||||
{
|
||||
I2C0 = 0,///<通道0
|
||||
I2C1 = 1,///<通道1
|
||||
}en_i2c_channel_t;
|
||||
/**
|
||||
******************************************************************************
|
||||
** \brief I2C功能配置
|
||||
*****************************************************************************/
|
||||
typedef enum en_i2c_func
|
||||
{
|
||||
I2cMode_En = 0, ///<I2C模块使能
|
||||
I2cStart_En = 1, ///<开始信号
|
||||
I2cStop_En = 2, ///<结束信号
|
||||
I2cAck_En = 3, ///<应答信号
|
||||
I2cHlm_En = 4, ///<高速使能
|
||||
I2cBaud_En = 5, ///<波特率使能
|
||||
}en_i2c_func_t;
|
||||
/**
|
||||
******************************************************************************
|
||||
** \brief I2C从机地址配置
|
||||
*****************************************************************************/
|
||||
typedef struct stc_i2c_addr
|
||||
{
|
||||
uint8_t Addr; ///<从机模式地址
|
||||
uint8_t Gc; ///<广播地址使能
|
||||
|
||||
}stc_i2c_addr_t;
|
||||
/**
|
||||
******************************************************************************
|
||||
** \brief I2C初始化配置结构
|
||||
*****************************************************************************/
|
||||
typedef struct stc_i2c_config
|
||||
{
|
||||
en_i2c_func_t enFunc; ///<功能使能
|
||||
uint8_t u8Tm; ///<波特率计数器配置
|
||||
stc_i2c_addr_t stcSlaveAddr;///<从机地址
|
||||
func_ptr_t pfnI2c0Cb; ///<中断服务函数指针
|
||||
func_ptr_t pfnI2c1Cb;
|
||||
boolean_t bTouchNvic; ///<是否使能NVIC
|
||||
}stc_i2c_config_t;
|
||||
|
||||
/******************************************************************************
|
||||
* Global variable declarations ('extern', definition in C source)
|
||||
*****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
* Global function prototypes (definition in C source)
|
||||
*****************************************************************************/
|
||||
//I2C初始化函数
|
||||
en_result_t I2C_Init(en_i2c_channel_t enCh,stc_i2c_config_t *pstcI2CCfg);
|
||||
//I2C模块关闭函数
|
||||
en_result_t I2C_DeInit(en_i2c_channel_t enCh);
|
||||
//设置波特率配置寄存器
|
||||
en_result_t I2C_SetBaud(en_i2c_channel_t enCh,uint8_t u8Tm);
|
||||
//I2C功能设置函数
|
||||
en_result_t I2C_SetFunc(en_i2c_channel_t enCh,en_i2c_func_t enFunc);
|
||||
//I2C功能清除函数
|
||||
en_result_t I2C_ClearFunc(en_i2c_channel_t enCh,en_i2c_func_t enFunc);
|
||||
//获取中断标记SI
|
||||
boolean_t I2C_GetIrq(en_i2c_channel_t enCh);
|
||||
//清除中断标记SI
|
||||
en_result_t I2C_ClearIrq(en_i2c_channel_t enCh);
|
||||
//获取状态
|
||||
uint8_t I2C_GetState(en_i2c_channel_t enCh);
|
||||
//写从机地址函数
|
||||
en_result_t I2C_WriteSlaveAddr(en_i2c_channel_t enCh,stc_i2c_addr_t *pstcSlaveAddr);
|
||||
//主发送函数
|
||||
en_result_t I2C_MasterWriteData(en_i2c_channel_t enCh,uint8_t u8DevAddr,uint8_t u8Addr,uint8_t *pu8Data,uint32_t u32Len);
|
||||
//从发送函数
|
||||
en_result_t I2C_SlaveWriteData(en_i2c_channel_t enCh,uint8_t *pu8Data,uint32_t *u32Len);
|
||||
//字节写函数
|
||||
en_result_t I2C_WriteByte(en_i2c_channel_t enCh,uint8_t u8Data);
|
||||
//主接收函数
|
||||
en_result_t I2C_MasterReadData(en_i2c_channel_t enCh,uint8_t u8DevAddr,uint8_t *pu8Data,uint8_t u8Addr,uint32_t u32Len);
|
||||
//主接收函数
|
||||
en_result_t I2C_SlaveReadData(en_i2c_channel_t enCh,uint8_t *pu8Data,uint32_t *pu32Len);
|
||||
//字节读函数
|
||||
uint8_t I2C_ReadByte(en_i2c_channel_t enCh);
|
||||
|
||||
//@} // I2cGroup
|
||||
|
||||
#ifdef __cplusplus
|
||||
#endif
|
||||
|
||||
#endif /* __I2C_H__ */
|
||||
/******************************************************************************
|
||||
* EOF (not truncated)
|
||||
*****************************************************************************/
|
||||
|
||||
|
||||
@@ -0,0 +1,103 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (C) 2018, Huada Semiconductor Co.,Ltd All rights reserved.
|
||||
*
|
||||
* This software is owned and published by:
|
||||
* Huada Semiconductor Co.,Ltd ("HDSC").
|
||||
*
|
||||
* BY DOWNLOADING, INSTALLING OR USING THIS SOFTWARE, YOU AGREE TO BE BOUND
|
||||
* BY ALL THE TERMS AND CONDITIONS OF THIS AGREEMENT.
|
||||
*
|
||||
* This software contains source code for use with HDSC
|
||||
* components. This software is licensed by HDSC to be adapted only
|
||||
* for use in systems utilizing HDSC components. HDSC shall not be
|
||||
* responsible for misuse or illegal use of this software for devices not
|
||||
* supported herein. HDSC is providing this software "AS IS" and will
|
||||
* not be responsible for issues arising from incorrect user implementation
|
||||
* of the software.
|
||||
*
|
||||
* Disclaimer:
|
||||
* HDSC MAKES NO WARRANTY, EXPRESS OR IMPLIED, ARISING BY LAW OR OTHERWISE,
|
||||
* REGARDING THE SOFTWARE (INCLUDING ANY ACOOMPANYING WRITTEN MATERIALS),
|
||||
* ITS PERFORMANCE OR SUITABILITY FOR YOUR INTENDED USE, INCLUDING,
|
||||
* WITHOUT LIMITATION, THE IMPLIED WARRANTY OF MERCHANTABILITY, THE IMPLIED
|
||||
* WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE OR USE, AND THE IMPLIED
|
||||
* WARRANTY OF NONINFRINGEMENT.
|
||||
* HDSC SHALL HAVE NO LIABILITY (WHETHER IN CONTRACT, WARRANTY, TORT,
|
||||
* NEGLIGENCE OR OTHERWISE) FOR ANY DAMAGES WHATSOEVER (INCLUDING, WITHOUT
|
||||
* LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION,
|
||||
* LOSS OF BUSINESS INFORMATION, OR OTHER PECUNIARY LOSS) ARISING FROM USE OR
|
||||
* INABILITY TO USE THE SOFTWARE, INCLUDING, WITHOUT LIMITATION, ANY DIRECT,
|
||||
* INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES OR LOSS OF DATA,
|
||||
* SAVINGS OR PROFITS,
|
||||
* EVEN IF Disclaimer HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
* YOU ASSUME ALL RESPONSIBILITIES FOR SELECTION OF THE SOFTWARE TO ACHIEVE YOUR
|
||||
* INTENDED RESULTS, AND FOR THE INSTALLATION OF, USE OF, AND RESULTS OBTAINED
|
||||
* FROM, THE SOFTWARE.
|
||||
*
|
||||
* This software may be replicated in part or whole for the licensed use,
|
||||
* with the restriction that this Disclaimer and Copyright notice must be
|
||||
* included with each copy of this software, whether used in part or whole,
|
||||
* at all times.
|
||||
*/
|
||||
/******************************************************************************/
|
||||
/** \file interrupts_hc32l136.h
|
||||
**
|
||||
** Interrupt common define.
|
||||
** @link IRQGroup Some description @endlink
|
||||
**
|
||||
** - 2018-04-15 1.0 Lux First version.
|
||||
**
|
||||
******************************************************************************/
|
||||
#ifndef __INTERRUPTS_HC32L136_H__
|
||||
#define __INTERRUPTS_HC32L136_H__
|
||||
|
||||
/******************************************************************************/
|
||||
/* Include files */
|
||||
/******************************************************************************/
|
||||
|
||||
/* C binding of definitions if building with C++ compiler */
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
/******************************************************************************/
|
||||
/* Global pre-processor symbols/macros ('#define') */
|
||||
/******************************************************************************/
|
||||
|
||||
#define DDL_IRQ_LEVEL_DEFAULT 3u
|
||||
|
||||
/******************************************************************************
|
||||
* Global type definitions
|
||||
******************************************************************************/
|
||||
/**
|
||||
*******************************************************************************
|
||||
** \brief 中断优先级数据类型定义
|
||||
** \note
|
||||
******************************************************************************/
|
||||
typedef enum en_irq_level
|
||||
{
|
||||
IrqLevel0 = 0u, ///< 优先级0
|
||||
IrqLevel1 = 1u, ///< 优先级1
|
||||
IrqLevel2 = 2u, ///< 优先级2
|
||||
IrqLevel3 = 3u, ///< 优先级3
|
||||
} en_irq_level_t;
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
* Global function prototypes (definition in C source)
|
||||
******************************************************************************/
|
||||
///< 系统中断使能开关
|
||||
void EnableNvic(IRQn_Type enIrq, en_irq_level_t enLevel, boolean_t bEn);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* __INTERRUPTS_HC32L136_H__ */
|
||||
|
||||
/******************************************************************************
|
||||
* EOF (not truncated)
|
||||
******************************************************************************/
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,147 @@
|
||||
/******************************************************************************
|
||||
* Copyright (C) 2017, Huada Semiconductor Co.,Ltd All rights reserved.
|
||||
*
|
||||
* This software is owned and published by:
|
||||
* Huada Semiconductor Co.,Ltd ("HDSC").
|
||||
*
|
||||
* BY DOWNLOADING, INSTALLING OR USING THIS SOFTWARE, YOU AGREE TO BE BOUND
|
||||
* BY ALL THE TERMS AND CONDITIONS OF THIS AGREEMENT.
|
||||
*
|
||||
* This software contains source code for use with HDSC
|
||||
* components. This software is licensed by HDSC to be adapted only
|
||||
* for use in systems utilizing HDSC components. HDSC shall not be
|
||||
* responsible for misuse or illegal use of this software for devices not
|
||||
* supported herein. HDSC is providing this software "AS IS" and will
|
||||
* not be responsible for issues arising from incorrect user implementation
|
||||
* of the software.
|
||||
*
|
||||
* Disclaimer:
|
||||
* HDSC MAKES NO WARRANTY, EXPRESS OR IMPLIED, ARISING BY LAW OR OTHERWISE,
|
||||
* REGARDING THE SOFTWARE (INCLUDING ANY ACOOMPANYING WRITTEN MATERIALS),
|
||||
* ITS PERFORMANCE OR SUITABILITY FOR YOUR INTENDED USE, INCLUDING,
|
||||
* WITHOUT LIMITATION, THE IMPLIED WARRANTY OF MERCHANTABILITY, THE IMPLIED
|
||||
* WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE OR USE, AND THE IMPLIED
|
||||
* WARRANTY OF NONINFRINGEMENT.
|
||||
* HDSC SHALL HAVE NO LIABILITY (WHETHER IN CONTRACT, WARRANTY, TORT,
|
||||
* NEGLIGENCE OR OTHERWISE) FOR ANY DAMAGES WHATSOEVER (INCLUDING, WITHOUT
|
||||
* LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION,
|
||||
* LOSS OF BUSINESS INFORMATION, OR OTHER PECUNIARY LOSS) ARISING FROM USE OR
|
||||
* INABILITY TO USE THE SOFTWARE, INCLUDING, WITHOUT LIMITATION, ANY DIRECT,
|
||||
* INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES OR LOSS OF DATA,
|
||||
* SAVINGS OR PROFITS,
|
||||
* EVEN IF Disclaimer HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
* YOU ASSUME ALL RESPONSIBILITIES FOR SELECTION OF THE SOFTWARE TO ACHIEVE YOUR
|
||||
* INTENDED RESULTS, AND FOR THE INSTALLATION OF, USE OF, AND RESULTS OBTAINED
|
||||
* FROM, THE SOFTWARE.
|
||||
*
|
||||
* This software may be replicated in part or whole for the licensed use,
|
||||
* with the restriction that this Disclaimer and Copyright notice must be
|
||||
* included with each copy of this software, whether used in part or whole,
|
||||
* at all times.
|
||||
*/
|
||||
/*****************************************************************************/
|
||||
/** \file lpm.h
|
||||
**
|
||||
** Lpm 数据结构及API声明
|
||||
**
|
||||
**
|
||||
** History:
|
||||
** - 2017-06-06 Lux V1.0
|
||||
**
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef __LPM_H__
|
||||
#define __LPM_H__
|
||||
|
||||
/*****************************************************************************
|
||||
* Include files
|
||||
*****************************************************************************/
|
||||
#include "ddl.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
/**
|
||||
*******************************************************************************
|
||||
** \defgroup LpmGroup Low Power Management (LPM)
|
||||
**
|
||||
**
|
||||
******************************************************************************/
|
||||
//@{
|
||||
|
||||
/******************************************************************************
|
||||
** Global pre-processor symbols/macros ('#define')
|
||||
******************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
* Global type definitions
|
||||
******************************************************************************/
|
||||
|
||||
/**
|
||||
******************************************************************************
|
||||
** \brief 事件挂起使能枚举重定义 (SEVONPEND)
|
||||
*****************************************************************************/
|
||||
typedef enum en_lpm_sevonpend
|
||||
{
|
||||
SevPndDisable = 0u, ///< 事件挂起禁止
|
||||
SevPndEnable = 1u, ///< 事件挂起使能
|
||||
}en_lpm_sevonpend_t;
|
||||
|
||||
/**
|
||||
******************************************************************************
|
||||
** \brief 深度睡眠使能枚举重定义 (SLEEPDEEP)
|
||||
*****************************************************************************/
|
||||
typedef enum en_lpm_sleepdeep
|
||||
{
|
||||
SlpDpDisable = 0u, ///< 深度睡眠禁止
|
||||
SlpDpEnable = 1u, ///< 深度睡眠使能
|
||||
}en_lpm_sleepdeep_t;
|
||||
|
||||
/**
|
||||
******************************************************************************
|
||||
** \brief 异常退出进睡眠使能枚举重定义 (SLEEPONEXIT)
|
||||
*****************************************************************************/
|
||||
typedef enum en_lpm_sleeponexit
|
||||
{
|
||||
SlpExtDisable = 0u, ///< 异常退出进睡眠禁止
|
||||
SlpExtEnable = 1u, ///< 异常退出进睡眠使能
|
||||
}en_lpm_sleeponexit_t;
|
||||
|
||||
/**
|
||||
******************************************************************************
|
||||
** \brief Low Power Mode 配置结构体定义
|
||||
*****************************************************************************/
|
||||
typedef struct stc_lpm_config
|
||||
{
|
||||
en_lpm_sevonpend_t enSEVONPEND; ///< 使能:每次新中断会产生一个事件,如果使用WFE休眠,则可用于唤醒处理器.
|
||||
en_lpm_sleepdeep_t enSLEEPDEEP; ///< 使能:执行WFI进入深度休眠;不使能:执行WFI进入休眠.
|
||||
en_lpm_sleeponexit_t enSLEEPONEXIT; ///< 使能:退出异常处理并返回时,处理器自动进入休眠模式;不使能:该特性禁止.
|
||||
}stc_lpm_config_t;
|
||||
|
||||
/******************************************************************************
|
||||
* Global variable declarations ('extern', definition in C source)
|
||||
*****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
* Global function prototypes (definition in C source)
|
||||
*****************************************************************************/
|
||||
///<功能配置及操作函数
|
||||
///<低功耗模式配置
|
||||
en_result_t Lpm_Config(stc_lpm_config_t* pstcConfig);
|
||||
///<进入低功耗模式
|
||||
void Lpm_GotoLpmMode(void);
|
||||
|
||||
//@} // LpmGroup
|
||||
|
||||
#ifdef __cplusplus
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* __LPM_H__ */
|
||||
/******************************************************************************
|
||||
* EOF (not truncated)
|
||||
*****************************************************************************/
|
||||
|
||||
|
||||
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,166 @@
|
||||
/******************************************************************************
|
||||
* Copyright (C) 2018, Huada Semiconductor Co.,Ltd All rights reserved.
|
||||
*
|
||||
* This software is owned and published by:
|
||||
* Huada Semiconductor Co.,Ltd ("HDSC").
|
||||
*
|
||||
* BY DOWNLOADING, INSTALLING OR USING THIS SOFTWARE, YOU AGREE TO BE BOUND
|
||||
* BY ALL THE TERMS AND CONDITIONS OF THIS AGREEMENT.
|
||||
*
|
||||
* This software contains source code for use with HDSC
|
||||
* components. This software is licensed by HDSC to be adapted only
|
||||
* for use in systems utilizing HDSC components. HDSC shall not be
|
||||
* responsible for misuse or illegal use of this software for devices not
|
||||
* supported herein. HDSC is providing this software "AS IS" and will
|
||||
* not be responsible for issues arising from incorrect user implementation
|
||||
* of the software.
|
||||
*
|
||||
* Disclaimer:
|
||||
* HDSC MAKES NO WARRANTY, EXPRESS OR IMPLIED, ARISING BY LAW OR OTHERWISE,
|
||||
* REGARDING THE SOFTWARE (INCLUDING ANY ACOOMPANYING WRITTEN MATERIALS),
|
||||
* ITS PERFORMANCE OR SUITABILITY FOR YOUR INTENDED USE, INCLUDING,
|
||||
* WITHOUT LIMITATION, THE IMPLIED WARRANTY OF MERCHANTABILITY, THE IMPLIED
|
||||
* WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE OR USE, AND THE IMPLIED
|
||||
* WARRANTY OF NONINFRINGEMENT.
|
||||
* HDSC SHALL HAVE NO LIABILITY (WHETHER IN CONTRACT, WARRANTY, TORT,
|
||||
* NEGLIGENCE OR OTHERWISE) FOR ANY DAMAGES WHATSOEVER (INCLUDING, WITHOUT
|
||||
* LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION,
|
||||
* LOSS OF BUSINESS INFORMATION, OR OTHER PECUNIARY LOSS) ARISING FROM USE OR
|
||||
* INABILITY TO USE THE SOFTWARE, INCLUDING, WITHOUT LIMITATION, ANY DIRECT,
|
||||
* INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES OR LOSS OF DATA,
|
||||
* SAVINGS OR PROFITS,
|
||||
* EVEN IF Disclaimer HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
* YOU ASSUME ALL RESPONSIBILITIES FOR SELECTION OF THE SOFTWARE TO ACHIEVE YOUR
|
||||
* INTENDED RESULTS, AND FOR THE INSTALLATION OF, USE OF, AND RESULTS OBTAINED
|
||||
* FROM, THE SOFTWARE.
|
||||
*
|
||||
* This software may be replicated in part or whole for the licensed use,
|
||||
* with the restriction that this Disclaimer and Copyright notice must be
|
||||
* included with each copy of this software, whether used in part or whole,
|
||||
* at all times.
|
||||
*/
|
||||
/******************************************************************************/
|
||||
/** \file reset.h
|
||||
**
|
||||
** Headerfile for reset functions
|
||||
**
|
||||
**
|
||||
** History:
|
||||
** - 2018-04-21 Lux First Version
|
||||
**
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __RESET_H__
|
||||
#define __RESET_H__
|
||||
|
||||
/******************************************************************************
|
||||
* Include files
|
||||
******************************************************************************/
|
||||
#include "ddl.h"
|
||||
#include "interrupts_hc32l136.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
/**
|
||||
******************************************************************************
|
||||
** \defgroup ResetGroup Reset (RST)
|
||||
**
|
||||
******************************************************************************/
|
||||
//@{
|
||||
|
||||
/**
|
||||
*******************************************************************************
|
||||
** function prototypes.
|
||||
******************************************************************************/
|
||||
|
||||
/*******************************************************************************
|
||||
* Global definitions
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
/**
|
||||
*******************************************************************************
|
||||
** \brief 外设复位控制类型定义
|
||||
** \note
|
||||
******************************************************************************/
|
||||
typedef enum
|
||||
{
|
||||
ResetUart0 = 0x00000001u, ///< 串口0
|
||||
ResetUart1 = 0x00000002u, ///< 串口1
|
||||
ResetLpUart0 = 0x00000004u, ///< 低功耗串口0
|
||||
ResetLpUart1 = 0x00000008u, ///< 低功耗串口1
|
||||
ResetI2c0 = 0x00000010u, ///< I2C0
|
||||
ResetI2c1 = 0x00000020u, ///< I2C1
|
||||
ResetSpi0 = 0x00000040u, ///< SPI0
|
||||
ResetSpi1 = 0x00000080u, ///< SPI1
|
||||
ResetBaseTim = 0x00000100u, ///< BASETIM
|
||||
ResetLpTim = 0x00000200u, ///< LPTIM
|
||||
ResetAdvTim = 0x00000400u, ///< ADVTIM
|
||||
ResetTim3 = 0x00000800u, ///< TIM3
|
||||
ResetOpa = 0x00002000u, ///< OPA
|
||||
ResetPca = 0x00004000u, ///< PCA
|
||||
ResetAdc = 0x00010000u, ///< ADC
|
||||
ResetVc = 0x00020000u, ///< VC
|
||||
ResetRng = 0x00040000u, ///< RNG
|
||||
ResetPcnt = 0x00080000u, ///< PCNT
|
||||
ResetRtc = 0x00100000u, ///< RTC
|
||||
ResetTrim = 0x00200000u, ///< TRIM
|
||||
ResetLcd = 0x00400000u, ///< LCD
|
||||
ResetTick = 0x01000000u, ///< TICK
|
||||
ResetSwd = 0x02000000u, ///< SWD
|
||||
ResetCrc = 0x04000000u, ///< CRC
|
||||
ResetAes = 0x08000000u, ///< AES
|
||||
ResetGpio = 0x10000000u, ///< GPIO
|
||||
ResetDma = 0x20000000u, ///< DMA
|
||||
ResetDiv = 0x40000000u, ///< DIV
|
||||
}en_reset_peripheral_t;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
*******************************************************************************
|
||||
** \brief 复位源(标识)显示
|
||||
**
|
||||
** \note
|
||||
******************************************************************************/
|
||||
typedef struct
|
||||
{
|
||||
uint8_t u8Por5V :1; ///< 5V启动复位
|
||||
uint8_t u8Por1_5V :1; ///< 1.5V启动复位
|
||||
uint8_t u8Lvd :1; ///< 低电压检测复位
|
||||
uint8_t u8Wdt :1; ///< 看门狗复位
|
||||
uint8_t u8Pca :1; ///< PCA复位
|
||||
uint8_t u8Lockup :1; ///< 系统异常复位
|
||||
uint8_t u8Sysreq :1; ///< 软件复位
|
||||
uint8_t u8RSTB :1; ///< RESET脚 复位
|
||||
}stc_reset_cause_t;
|
||||
|
||||
/*******************************************************************************
|
||||
* Global variable declarations ('extern', definition in C source)
|
||||
******************************************************************************/
|
||||
|
||||
/*******************************************************************************
|
||||
* Global function prototypes (definition in C source)
|
||||
******************************************************************************/
|
||||
///< 获得复位源
|
||||
en_result_t Reset_GetCause(stc_reset_cause_t *pstcOut);
|
||||
///< 清除复位源
|
||||
en_result_t Reset_Clear(stc_reset_cause_t stcval);
|
||||
///< 外设模块复位控制
|
||||
en_result_t Reset_SetPeripheralReset(en_reset_peripheral_t enPeri,boolean_t bFlag);
|
||||
|
||||
//@} // ResetGroup
|
||||
|
||||
#ifdef __cplusplus
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* __RESET_H__ */
|
||||
/*******************************************************************************
|
||||
* EOF (not truncated)
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
@@ -0,0 +1,108 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (C) 2018, Huada Semiconductor Co.,Ltd All rights reserved.
|
||||
*
|
||||
* This software is owned and published by:
|
||||
* Huada Semiconductor Co.,Ltd ("HDSC").
|
||||
*
|
||||
* BY DOWNLOADING, INSTALLING OR USING THIS SOFTWARE, YOU AGREE TO BE BOUND
|
||||
* BY ALL THE TERMS AND CONDITIONS OF THIS AGREEMENT.
|
||||
*
|
||||
* This software contains source code for use with HDSC
|
||||
* components. This software is licensed by HDSC to be adapted only
|
||||
* for use in systems utilizing HDSC components. HDSC shall not be
|
||||
* responsible for misuse or illegal use of this software for devices not
|
||||
* supported herein. HDSC is providing this software "AS IS" and will
|
||||
* not be responsible for issues arising from incorrect user implementation
|
||||
* of the software.
|
||||
*
|
||||
* Disclaimer:
|
||||
* HDSC MAKES NO WARRANTY, EXPRESS OR IMPLIED, ARISING BY LAW OR OTHERWISE,
|
||||
* REGARDING THE SOFTWARE (INCLUDING ANY ACOOMPANYING WRITTEN MATERIALS),
|
||||
* ITS PERFORMANCE OR SUITABILITY FOR YOUR INTENDED USE, INCLUDING,
|
||||
* WITHOUT LIMITATION, THE IMPLIED WARRANTY OF MERCHANTABILITY, THE IMPLIED
|
||||
* WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE OR USE, AND THE IMPLIED
|
||||
* WARRANTY OF NONINFRINGEMENT.
|
||||
* HDSC SHALL HAVE NO LIABILITY (WHETHER IN CONTRACT, WARRANTY, TORT,
|
||||
* NEGLIGENCE OR OTHERWISE) FOR ANY DAMAGES WHATSOEVER (INCLUDING, WITHOUT
|
||||
* LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION,
|
||||
* LOSS OF BUSINESS INFORMATION, OR OTHER PECUNIARY LOSS) ARISING FROM USE OR
|
||||
* INABILITY TO USE THE SOFTWARE, INCLUDING, WITHOUT LIMITATION, ANY DIRECT,
|
||||
* INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES OR LOSS OF DATA,
|
||||
* SAVINGS OR PROFITS,
|
||||
* EVEN IF Disclaimer HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
* YOU ASSUME ALL RESPONSIBILITIES FOR SELECTION OF THE SOFTWARE TO ACHIEVE YOUR
|
||||
* INTENDED RESULTS, AND FOR THE INSTALLATION OF, USE OF, AND RESULTS OBTAINED
|
||||
* FROM, THE SOFTWARE.
|
||||
*
|
||||
* This software may be replicated in part or whole for the licensed use,
|
||||
* with the restriction that this Disclaimer and Copyright notice must be
|
||||
* included with each copy of this software, whether used in part or whole,
|
||||
* at all times.
|
||||
*/
|
||||
/******************************************************************************/
|
||||
/** \file rng.h
|
||||
**
|
||||
** Headerfile for RNG functions
|
||||
** @link RNG Group Some description @endlink
|
||||
**
|
||||
** History:
|
||||
** - 2018-04-15 Lux First Version
|
||||
**
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __RNG_H__
|
||||
#define __RNG_H__
|
||||
|
||||
/*******************************************************************************
|
||||
* Include files
|
||||
******************************************************************************/
|
||||
#include "ddl.h"
|
||||
#include "interrupts_hc32l136.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
/**
|
||||
******************************************************************************
|
||||
** \defgroup RngGroup (RNG)
|
||||
**
|
||||
******************************************************************************/
|
||||
//@{
|
||||
|
||||
/**
|
||||
*******************************************************************************
|
||||
** function prototypes.
|
||||
******************************************************************************/
|
||||
|
||||
/*******************************************************************************
|
||||
* Global definitions
|
||||
******************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
* Global variable declarations ('extern', definition in C source)
|
||||
******************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
* Global function prototypes (definition in C source)
|
||||
******************************************************************************/
|
||||
///< 随机数初始化(上电第一次生成随机数)
|
||||
en_result_t Rng_Init(void);
|
||||
///< 生成随机数(非上电第一次生成随机数)
|
||||
en_result_t Rng_Generate(void);
|
||||
///< 获取64bits随机数(执行随机数初始化或生成随机数函数后可使用该函数获取随机数值)
|
||||
uint32_t Rng_GetData0(void);
|
||||
uint32_t Rng_GetData1(void);
|
||||
|
||||
//@} // Rng Group
|
||||
|
||||
#ifdef __cplusplus
|
||||
#endif
|
||||
|
||||
#endif /* __RNG_H__ */
|
||||
/*******************************************************************************
|
||||
* EOF (not truncated)
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
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,186 @@
|
||||
/******************************************************************************
|
||||
* Copyright (C) 2018, Huada Semiconductor Co.,Ltd All rights reserved.
|
||||
*
|
||||
* This software is owned and published by:
|
||||
* Huada Semiconductor Co.,Ltd ("HDSC").
|
||||
*
|
||||
* BY DOWNLOADING, INSTALLING OR USING THIS SOFTWARE, YOU AGREE TO BE BOUND
|
||||
* BY ALL THE TERMS AND CONDITIONS OF THIS AGREEMENT.
|
||||
*
|
||||
* This software contains source code for use with HDSC
|
||||
* components. This software is licensed by HDSC to be adapted only
|
||||
* for use in systems utilizing HDSC components. HDSC shall not be
|
||||
* responsible for misuse or illegal use of this software for devices not
|
||||
* supported herein. HDSC is providing this software "AS IS" and will
|
||||
* not be responsible for issues arising from incorrect user implementation
|
||||
* of the software.
|
||||
*
|
||||
* Disclaimer:
|
||||
* HDSC MAKES NO WARRANTY, EXPRESS OR IMPLIED, ARISING BY LAW OR OTHERWISE,
|
||||
* REGARDING THE SOFTWARE (INCLUDING ANY ACOOMPANYING WRITTEN MATERIALS),
|
||||
* ITS PERFORMANCE OR SUITABILITY FOR YOUR INTENDED USE, INCLUDING,
|
||||
* WITHOUT LIMITATION, THE IMPLIED WARRANTY OF MERCHANTABILITY, THE IMPLIED
|
||||
* WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE OR USE, AND THE IMPLIED
|
||||
* WARRANTY OF NONINFRINGEMENT.
|
||||
* HDSC SHALL HAVE NO LIABILITY (WHETHER IN CONTRACT, WARRANTY, TORT,
|
||||
* NEGLIGENCE OR OTHERWISE) FOR ANY DAMAGES WHATSOEVER (INCLUDING, WITHOUT
|
||||
* LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION,
|
||||
* LOSS OF BUSINESS INFORMATION, OR OTHER PECUNIARY LOSS) ARISING FROM USE OR
|
||||
* INABILITY TO USE THE SOFTWARE, INCLUDING, WITHOUT LIMITATION, ANY DIRECT,
|
||||
* INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES OR LOSS OF DATA,
|
||||
* SAVINGS OR PROFITS,
|
||||
* EVEN IF Disclaimer HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
* YOU ASSUME ALL RESPONSIBILITIES FOR SELECTION OF THE SOFTWARE TO ACHIEVE YOUR
|
||||
* INTENDED RESULTS, AND FOR THE INSTALLATION OF, USE OF, AND RESULTS OBTAINED
|
||||
* FROM, THE SOFTWARE.
|
||||
*
|
||||
* This software may be replicated in part or whole for the licensed use,
|
||||
* with the restriction that this Disclaimer and Copyright notice must be
|
||||
* included with each copy of this software, whether used in part or whole,
|
||||
* at all times.
|
||||
*/
|
||||
/*****************************************************************************/
|
||||
/** \file trim.h
|
||||
**
|
||||
** TRIM 数据结构及API声明
|
||||
**
|
||||
**
|
||||
** History:
|
||||
** - 2018-04-21 Lux V1.0
|
||||
**
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef __TRIM_H__
|
||||
#define __TRIM_H__
|
||||
|
||||
/*****************************************************************************
|
||||
* Include files
|
||||
*****************************************************************************/
|
||||
#include "ddl.h"
|
||||
#include "interrupts_hc32l136.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
/**
|
||||
******************************************************************************
|
||||
** \defgroup TrimGroup Clock Trimming (TRIM)
|
||||
**
|
||||
******************************************************************************/
|
||||
//@{
|
||||
|
||||
/******************************************************************************
|
||||
** Global pre-processor symbols/macros ('#define')
|
||||
******************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
* Global type definitions
|
||||
******************************************************************************/
|
||||
|
||||
/**
|
||||
******************************************************************************
|
||||
** \brief 监测模式使能枚举重定义 (MON_EN)
|
||||
*****************************************************************************/
|
||||
typedef enum en_trim_monitor
|
||||
{
|
||||
TrimMonDisable = 0u, ///< 禁止
|
||||
TrimMonEnable = 1u, ///< 使能
|
||||
}en_trim_monitor_t;
|
||||
|
||||
/**
|
||||
******************************************************************************
|
||||
** \brief 待校准/监测时钟选择枚举重定义 (CALCLK_SEL)
|
||||
*****************************************************************************/
|
||||
typedef enum en_trim_calclksel
|
||||
{
|
||||
TrimCalRCH = 0u, ///< RCH
|
||||
TrimCalXTH = 1u, ///< XTH
|
||||
TrimCalRCL = 2u, ///< RCL
|
||||
TrimCalXTL = 3u, ///< XTL
|
||||
TrimCalPLL = 4u, ///< PLL
|
||||
}en_trim_calclksel_t;
|
||||
|
||||
/**
|
||||
******************************************************************************
|
||||
** \brief 参考时钟选择枚举重定义 (REFCLK_SEL)
|
||||
*****************************************************************************/
|
||||
typedef enum en_trim_refclksel
|
||||
{
|
||||
TrimRefRCH = 0u, ///< RCH
|
||||
TrimRefXTH = 1u, ///< XTH
|
||||
TrimRefRCL = 2u, ///< RCL
|
||||
TrimRefXTL = 3u, ///< XTL
|
||||
TrimRefIRC10K = 4u, ///< IRC10K
|
||||
TrimRefExtClk = 5u, ///< 外部输入时钟
|
||||
}en_trim_refclksel_t;
|
||||
|
||||
/**
|
||||
******************************************************************************
|
||||
** \brief 中断标志类型枚举重定义
|
||||
*****************************************************************************/
|
||||
typedef enum en_trim_inttype
|
||||
{
|
||||
TrimStop = 0u, ///< 参考计数器停止标志
|
||||
TrimCalCntOf = 1u, ///< 校准计数器溢出标志
|
||||
TrimXTLFault = 2u, ///< XTL 失效标志
|
||||
TrimXTHFault = 3u, ///< XTH 失效标志
|
||||
TrimPLLFault = 4u, ///< PLL 失效标志
|
||||
}en_trim_inttype_t;
|
||||
|
||||
/**
|
||||
******************************************************************************
|
||||
** \brief TRIM 配置结构体定义
|
||||
*****************************************************************************/
|
||||
typedef struct stc_trim_config
|
||||
{
|
||||
en_trim_monitor_t enMON; ///< 监测模式使能
|
||||
en_trim_calclksel_t enCALCLK; ///< 校准时钟选择
|
||||
uint32_t u32CalCon; ///< 校准计数器溢出值配置
|
||||
en_trim_refclksel_t enREFCLK; ///< 参考时钟选择
|
||||
uint32_t u32RefCon; ///< 参考计数器初值配置
|
||||
|
||||
func_ptr_t pfnTrimCb; ///< TRIM 中断服务回调函数[void function(void)]
|
||||
}stc_trim_config_t;
|
||||
|
||||
/******************************************************************************
|
||||
* Global variable declarations ('extern', definition in C source)
|
||||
*****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
* Global function prototypes (definition in C source)
|
||||
*****************************************************************************/
|
||||
///<<功能配置及操作函数
|
||||
///<Trim 配置及初始化
|
||||
en_result_t Trim_Init(stc_trim_config_t* pstcConfig);
|
||||
///<校准/监测启动/停止
|
||||
en_result_t Trim_Run(void);
|
||||
en_result_t Trim_Stop(void);
|
||||
|
||||
///<参考计数器计数值获取
|
||||
uint32_t Trim_RefCntGet(void);
|
||||
///<校准计数器计数值获取
|
||||
uint32_t Trim_CalCntGet(void);
|
||||
|
||||
///<中断操作相关函数
|
||||
///中断使能/禁止
|
||||
en_result_t Trim_EnableIrq(void);
|
||||
en_result_t Trim_DisableIrq(void);
|
||||
///<中断标志获取
|
||||
boolean_t Trim_GetIntFlag(en_trim_inttype_t enIntType);
|
||||
///<中断标志清除
|
||||
en_result_t Trim_ClearIntFlag(en_trim_inttype_t enIntType);
|
||||
|
||||
//@} // TrimGroup
|
||||
|
||||
#ifdef __cplusplus
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* __TRIM_H__ */
|
||||
/******************************************************************************
|
||||
* EOF (not truncated)
|
||||
*****************************************************************************/
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,127 @@
|
||||
/******************************************************************************
|
||||
* Copyright (C) 2017, Huada Semiconductor Co.,Ltd All rights reserved.
|
||||
*
|
||||
* This software is owned and published by:
|
||||
* Huada Semiconductor Co.,Ltd ("HDSC").
|
||||
*
|
||||
* BY DOWNLOADING, INSTALLING OR USING THIS SOFTWARE, YOU AGREE TO BE BOUND
|
||||
* BY ALL THE TERMS AND CONDITIONS OF THIS AGREEMENT.
|
||||
*
|
||||
* This software contains source code for use with HDSC
|
||||
* components. This software is licensed by HDSC to be adapted only
|
||||
* for use in systems utilizing HDSC components. HDSC shall not be
|
||||
* responsible for misuse or illegal use of this software for devices not
|
||||
* supported herein. HDSC is providing this software "AS IS" and will
|
||||
* not be responsible for issues arising from incorrect user implementation
|
||||
* of the software.
|
||||
*
|
||||
* Disclaimer:
|
||||
* HDSC MAKES NO WARRANTY, EXPRESS OR IMPLIED, ARISING BY LAW OR OTHERWISE,
|
||||
* REGARDING THE SOFTWARE (INCLUDING ANY ACOOMPANYING WRITTEN MATERIALS),
|
||||
* ITS PERFORMANCE OR SUITABILITY FOR YOUR INTENDED USE, INCLUDING,
|
||||
* WITHOUT LIMITATION, THE IMPLIED WARRANTY OF MERCHANTABILITY, THE IMPLIED
|
||||
* WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE OR USE, AND THE IMPLIED
|
||||
* WARRANTY OF NONINFRINGEMENT.
|
||||
* HDSC SHALL HAVE NO LIABILITY (WHETHER IN CONTRACT, WARRANTY, TORT,
|
||||
* NEGLIGENCE OR OTHERWISE) FOR ANY DAMAGES WHATSOEVER (INCLUDING, WITHOUT
|
||||
* LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION,
|
||||
* LOSS OF BUSINESS INFORMATION, OR OTHER PECUNIARY LOSS) ARISING FROM USE OR
|
||||
* INABILITY TO USE THE SOFTWARE, INCLUDING, WITHOUT LIMITATION, ANY DIRECT,
|
||||
* INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES OR LOSS OF DATA,
|
||||
* SAVINGS OR PROFITS,
|
||||
* EVEN IF Disclaimer HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
* YOU ASSUME ALL RESPONSIBILITIES FOR SELECTION OF THE SOFTWARE TO ACHIEVE YOUR
|
||||
* INTENDED RESULTS, AND FOR THE INSTALLATION OF, USE OF, AND RESULTS OBTAINED
|
||||
* FROM, THE SOFTWARE.
|
||||
*
|
||||
* This software may be replicated in part or whole for the licensed use,
|
||||
* with the restriction that this Disclaimer and Copyright notice must be
|
||||
* included with each copy of this software, whether used in part or whole,
|
||||
* at all times.
|
||||
*/
|
||||
/*****************************************************************************/
|
||||
/** \file wdt.h
|
||||
**
|
||||
** Headerfile for WDT functions
|
||||
**
|
||||
**
|
||||
** History:
|
||||
** - 2017-05-10 Cathy First Version
|
||||
**
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef __WDT_H__
|
||||
#define __WDT_H__
|
||||
|
||||
#include "ddl.h"
|
||||
#include "interrupts_hc32l136.h"
|
||||
|
||||
/**
|
||||
******************************************************************************
|
||||
** \defgroup WdtGroup Watchdog Timer (WDT)
|
||||
**
|
||||
******************************************************************************/
|
||||
//@{
|
||||
|
||||
/******************************************************************************/
|
||||
/* Global pre-processor symbols/macros ('#define') */
|
||||
/******************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
* Global type definitions
|
||||
******************************************************************************/
|
||||
/**
|
||||
******************************************************************************
|
||||
** \brief wdt溢出后复位或中断配置
|
||||
*****************************************************************************/
|
||||
typedef enum en_wdt_reset
|
||||
{
|
||||
WRESET_EN = 0,///<复位使能
|
||||
WINT_EN = 1,///<中断使能
|
||||
}en_wdt_reset_t;
|
||||
/**
|
||||
******************************************************************************
|
||||
** \brief wdt当前运行状态
|
||||
*****************************************************************************/
|
||||
|
||||
typedef enum en_wdt_status
|
||||
{
|
||||
Stop_Mode = 0,///<停止模块
|
||||
Run_Mode = 1,///<正常运行模式
|
||||
}en_wdt_status_t;
|
||||
|
||||
/**
|
||||
******************************************************************************
|
||||
** \brief wdt总体配置,定时时间 、中断函数等
|
||||
*****************************************************************************/
|
||||
|
||||
typedef struct stc_wdt_config
|
||||
{
|
||||
uint8_t u8LoadValue; ///<溢出时间
|
||||
en_wdt_reset_t enResetEnable; ///<中断或复位使能
|
||||
func_ptr_t pfnWdtIrqCb; ///<中断服务接口函数
|
||||
} stc_wdt_config_t;
|
||||
//wdt初始化
|
||||
en_result_t Wdt_Init(stc_wdt_config_t* pstcConfig);
|
||||
void Wdt_DeInit(void);
|
||||
|
||||
//wdt开始和停止
|
||||
en_result_t Wdt_Start(void);
|
||||
|
||||
//wdt溢出时间设置及当前计数时间、状态读取
|
||||
void Wdt_WriteWdtLoad(uint8_t u8LoadValue);
|
||||
uint8_t Wdt_ReadWdtValue(void);
|
||||
uint8_t Wdt_ReadwdtStatus(void);
|
||||
|
||||
//喂狗处理
|
||||
void Wdt_Feed(void);
|
||||
|
||||
//@} // WdtGroup
|
||||
|
||||
#ifdef __cplusplus
|
||||
#endif
|
||||
|
||||
#endif /* __WDT_H__ */
|
||||
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,176 @@
|
||||
/******************************************************************************
|
||||
*Copyright(C)2017, Huada Semiconductor Co.,Ltd All rights reserved.
|
||||
*
|
||||
* This software is owned and published by:
|
||||
* Huada Semiconductor Co.,Ltd("HDSC").
|
||||
*
|
||||
* BY DOWNLOADING, INSTALLING OR USING THIS SOFTWARE, YOU AGREE TO BE BOUND
|
||||
* BY ALL THE TERMS AND CONDITIONS OF THIS AGREEMENT.
|
||||
*
|
||||
* This software contains source code for use with HDSC
|
||||
* components. This software is licensed by HDSC to be adapted only
|
||||
* for use in systems utilizing HDSC components. HDSC shall not be
|
||||
* responsible for misuse or illegal use of this software for devices not
|
||||
* supported herein. HDSC is providing this software "AS IS" and will
|
||||
* not be responsible for issues arising from incorrect user implementation
|
||||
* of the software.
|
||||
*
|
||||
* Disclaimer:
|
||||
* HDSC MAKES NO WARRANTY, EXPRESS OR IMPLIED, ARISING BY LAW OR OTHERWISE,
|
||||
* REGARDING THE SOFTWARE (INCLUDING ANY ACOOMPANYING WRITTEN MATERIALS),
|
||||
* ITS PERFORMANCE OR SUITABILITY FOR YOUR INTENDED USE, INCLUDING,
|
||||
* WITHOUT LIMITATION, THE IMPLIED WARRANTY OF MERCHANTABILITY, THE IMPLIED
|
||||
* WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE OR USE, AND THE IMPLIED
|
||||
* WARRANTY OF NONINFRINGEMENT.
|
||||
* HDSC SHALL HAVE NO LIABILITY (WHETHER IN CONTRACT, WARRANTY, TORT,
|
||||
* NEGLIGENCE OR OTHERWISE) FOR ANY DAMAGES WHATSOEVER (INCLUDING, WITHOUT
|
||||
* LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION,
|
||||
* LOSS OF BUSINESS INFORMATION, OR OTHER PECUNIARY LOSS) ARISING FROM USE OR
|
||||
* INABILITY TO USE THE SOFTWARE, INCLUDING, WITHOUT LIMITATION, ANY DIRECT,
|
||||
* INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES OR LOSS OF DATA,
|
||||
* SAVINGS OR PROFITS,
|
||||
* EVEN IF Disclaimer HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
* YOU ASSUME ALL RESPONSIBILITIES FOR SELECTION OF THE SOFTWARE TO ACHIEVE YOUR
|
||||
* INTENDED RESULTS, AND FOR THE INSTALLATION OF, USE OF, AND RESULTS OBTAINED
|
||||
* FROM, THE SOFTWARE.
|
||||
*
|
||||
* This software may be replicated in part or whole for the licensed use,
|
||||
* with the restriction that this Disclaimer and Copyright notice must be
|
||||
* included with each copy of this software, whether used in part or whole,
|
||||
* at all times.
|
||||
*/
|
||||
|
||||
/** \file crc.c
|
||||
**
|
||||
** Common API of crc.
|
||||
** @link crcGroup Some description @endlink
|
||||
**
|
||||
** - 2017-05-16
|
||||
**
|
||||
******************************************************************************/
|
||||
|
||||
/*******************************************************************************
|
||||
* Include files
|
||||
******************************************************************************/
|
||||
#include "aes.h"
|
||||
/**
|
||||
*******************************************************************************
|
||||
** \addtogroup CrcGroup
|
||||
******************************************************************************/
|
||||
//@{
|
||||
|
||||
/*******************************************************************************
|
||||
* Local pre-processor symbols/macros ('#define')
|
||||
******************************************************************************/
|
||||
|
||||
/*******************************************************************************
|
||||
* Global variable definitions (declared in header file with 'extern')
|
||||
******************************************************************************/
|
||||
|
||||
/*******************************************************************************
|
||||
* Local type definitions ('typedef')
|
||||
******************************************************************************/
|
||||
|
||||
/*******************************************************************************
|
||||
* Local variable definitions ('static')
|
||||
******************************************************************************/
|
||||
|
||||
/*******************************************************************************
|
||||
* Local function prototypes ('static')
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function implementation - global ('extern') and local ('static')
|
||||
******************************************************************************/
|
||||
/**
|
||||
* \brief
|
||||
* ADC初始化
|
||||
*
|
||||
* \param [in] pu32Data 待加密数据
|
||||
* \param [in] pu32Key 加密KEY
|
||||
* \param [out] pu32Cipher 加密后数据
|
||||
*
|
||||
* \retval en_result_t Ok: 配置成功
|
||||
* \retval en_result_t ErrorInvalidParameter: 无效参数
|
||||
*/
|
||||
en_result_t AES_Encrypt(uint32_t* pu32Data, uint32_t *pu32Key, uint32_t *pu32Cipher)
|
||||
{
|
||||
if ((NULL == pu32Data)||(NULL == pu32Key)||(NULL == pu32Cipher))
|
||||
{
|
||||
return ErrorInvalidParameter;
|
||||
}
|
||||
|
||||
//Key config
|
||||
M0P_AES->KEY0 = pu32Key[0];
|
||||
M0P_AES->KEY1 = pu32Key[1];
|
||||
M0P_AES->KEY2 = pu32Key[2];
|
||||
M0P_AES->KEY3 = pu32Key[3];
|
||||
|
||||
//Data config
|
||||
M0P_AES->DATA0 = pu32Data[0];
|
||||
M0P_AES->DATA1 = pu32Data[1];
|
||||
M0P_AES->DATA2 = pu32Data[2];
|
||||
M0P_AES->DATA3 = pu32Data[3];
|
||||
|
||||
M0P_AES->CR_f.MODE = 0;//Encry
|
||||
M0P_AES->CR_f.START = 1;
|
||||
while(M0P_AES->CR_f.START == 1)
|
||||
{
|
||||
;
|
||||
}
|
||||
pu32Cipher[0] = M0P_AES->DATA0;
|
||||
pu32Cipher[1] = M0P_AES->DATA1;
|
||||
pu32Cipher[2] = M0P_AES->DATA2;
|
||||
pu32Cipher[3] = M0P_AES->DATA3;
|
||||
return Ok;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* \brief
|
||||
* ADC初始化
|
||||
*
|
||||
* \param [in] pu32Cipher 待解密数据
|
||||
* \param [in] pu32Key 加密KEY
|
||||
* \param [out] pu32Data 解密后数据
|
||||
*
|
||||
* \retval en_result_t Ok: 配置成功
|
||||
* \retval en_result_t ErrorInvalidParameter: 无效参数
|
||||
*/
|
||||
en_result_t AES_Decrypt(uint32_t *pu32Cipher,uint32_t *pu32Key, uint32_t* pu32Plaintext)
|
||||
{
|
||||
if ((NULL == pu32Plaintext)||(NULL == pu32Key)||(NULL == pu32Cipher))
|
||||
{
|
||||
return ErrorInvalidParameter;
|
||||
}
|
||||
|
||||
//Key config
|
||||
M0P_AES->KEY0 = pu32Key[0];
|
||||
M0P_AES->KEY1 = pu32Key[1];
|
||||
M0P_AES->KEY2 = pu32Key[2];
|
||||
M0P_AES->KEY3 = pu32Key[3];
|
||||
|
||||
//Data config
|
||||
M0P_AES->DATA0 = pu32Cipher[0];
|
||||
M0P_AES->DATA1 = pu32Cipher[1];
|
||||
M0P_AES->DATA2 = pu32Cipher[2];
|
||||
M0P_AES->DATA3 = pu32Cipher[3];
|
||||
|
||||
M0P_AES->CR_f.MODE = 1;//UnEncry
|
||||
M0P_AES->CR_f.START = 1;
|
||||
while(M0P_AES->CR_f.START == 1)
|
||||
{
|
||||
;
|
||||
}
|
||||
pu32Plaintext[0] = M0P_AES->DATA0;
|
||||
pu32Plaintext[1] = M0P_AES->DATA1;
|
||||
pu32Plaintext[2] = M0P_AES->DATA2;
|
||||
pu32Plaintext[3] = M0P_AES->DATA3;
|
||||
return Ok;
|
||||
}
|
||||
//@} // CrcGroup
|
||||
|
||||
/*******************************************************************************
|
||||
* EOF (not truncated)
|
||||
******************************************************************************/
|
||||
@@ -0,0 +1,155 @@
|
||||
/******************************************************************************
|
||||
*Copyright(C)2018, Huada Semiconductor Co.,Ltd All rights reserved.
|
||||
*
|
||||
* This software is owned and published by:
|
||||
* Huada Semiconductor Co.,Ltd("HDSC").
|
||||
*
|
||||
* BY DOWNLOADING, INSTALLING OR USING THIS SOFTWARE, YOU AGREE TO BE BOUND
|
||||
* BY ALL THE TERMS AND CONDITIONS OF THIS AGREEMENT.
|
||||
*
|
||||
* This software contains source code for use with HDSC
|
||||
* components. This software is licensed by HDSC to be adapted only
|
||||
* for use in systems utilizing HDSC components. HDSC shall not be
|
||||
* responsible for misuse or illegal use of this software for devices not
|
||||
* supported herein. HDSC is providing this software "AS IS" and will
|
||||
* not be responsible for issues arising from incorrect user implementation
|
||||
* of the software.
|
||||
*
|
||||
* Disclaimer:
|
||||
* HDSC MAKES NO WARRANTY, EXPRESS OR IMPLIED, ARISING BY LAW OR OTHERWISE,
|
||||
* REGARDING THE SOFTWARE (INCLUDING ANY ACOOMPANYING WRITTEN MATERIALS),
|
||||
* ITS PERFORMANCE OR SUITABILITY FOR YOUR INTENDED USE, INCLUDING,
|
||||
* WITHOUT LIMITATION, THE IMPLIED WARRANTY OF MERCHANTABILITY, THE IMPLIED
|
||||
* WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE OR USE, AND THE IMPLIED
|
||||
* WARRANTY OF NONINFRINGEMENT.
|
||||
* HDSC SHALL HAVE NO LIABILITY (WHETHER IN CONTRACT, WARRANTY, TORT,
|
||||
* NEGLIGENCE OR OTHERWISE) FOR ANY DAMAGES WHATSOEVER (INCLUDING, WITHOUT
|
||||
* LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION,
|
||||
* LOSS OF BUSINESS INFORMATION, OR OTHER PECUNIARY LOSS) ARISING FROM USE OR
|
||||
* INABILITY TO USE THE SOFTWARE, INCLUDING, WITHOUT LIMITATION, ANY DIRECT,
|
||||
* INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES OR LOSS OF DATA,
|
||||
* SAVINGS OR PROFITS,
|
||||
* EVEN IF Disclaimer HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
* YOU ASSUME ALL RESPONSIBILITIES FOR SELECTION OF THE SOFTWARE TO ACHIEVE YOUR
|
||||
* INTENDED RESULTS, AND FOR THE INSTALLATION OF, USE OF, AND RESULTS OBTAINED
|
||||
* FROM, THE SOFTWARE.
|
||||
*
|
||||
* This software may be replicated in part or whole for the licensed use,
|
||||
* with the restriction that this Disclaimer and Copyright notice must be
|
||||
* included with each copy of this software, whether used in part or whole,
|
||||
* at all times.
|
||||
*/
|
||||
|
||||
/** \file bgr.c
|
||||
**
|
||||
** Common API of bgr.
|
||||
** @link flashGroup Some description @endlink
|
||||
**
|
||||
** - 2018-05-08
|
||||
**
|
||||
******************************************************************************/
|
||||
|
||||
/*******************************************************************************
|
||||
* Include files
|
||||
******************************************************************************/
|
||||
#include "bgr.h"
|
||||
/**
|
||||
*******************************************************************************
|
||||
** \addtogroup FlashGroup
|
||||
******************************************************************************/
|
||||
//@{
|
||||
|
||||
/*******************************************************************************
|
||||
* Local pre-processor symbols/macros ('#define')
|
||||
******************************************************************************/
|
||||
|
||||
/*******************************************************************************
|
||||
* Global variable definitions (declared in header file with 'extern')
|
||||
******************************************************************************/
|
||||
|
||||
/*******************************************************************************
|
||||
* Local type definitions ('typedef')
|
||||
******************************************************************************/
|
||||
|
||||
/*******************************************************************************
|
||||
* Local variable definitions ('static')
|
||||
******************************************************************************/
|
||||
|
||||
/*******************************************************************************
|
||||
* Local function prototypes ('static')
|
||||
******************************************************************************/
|
||||
|
||||
/*******************************************************************************
|
||||
* Function implementation - global ('extern') and local ('static')
|
||||
******************************************************************************/
|
||||
|
||||
/**
|
||||
*****************************************************************************
|
||||
** \brief BGR 使能
|
||||
**
|
||||
**
|
||||
** \retval TRUE or FALSE
|
||||
*****************************************************************************/
|
||||
en_result_t Bgr_BgrEnable(void)
|
||||
{
|
||||
Sysctrl_SetPeripheralGate(SysctrlPeripheralAdcBgr, TRUE);
|
||||
M0P_BGR->CR_f.BGR_EN = TRUE;
|
||||
|
||||
delay10us(2);
|
||||
|
||||
return Ok;
|
||||
}
|
||||
|
||||
/**
|
||||
*****************************************************************************
|
||||
** \brief BGR 禁止
|
||||
**
|
||||
**
|
||||
** \retval TRUE or FALSE
|
||||
*****************************************************************************/
|
||||
en_result_t Bgr_BgrDisable(void)
|
||||
{
|
||||
Sysctrl_SetPeripheralGate(SysctrlPeripheralAdcBgr, TRUE);
|
||||
M0P_BGR->CR_f.BGR_EN = FALSE;
|
||||
|
||||
return Ok;
|
||||
}
|
||||
|
||||
/**
|
||||
*****************************************************************************
|
||||
** \brief BGR 温度传感器使能
|
||||
**
|
||||
**
|
||||
** \retval TRUE or FALSE
|
||||
*****************************************************************************/
|
||||
en_result_t Bgr_TempSensorEnable(void)
|
||||
{
|
||||
Sysctrl_SetPeripheralGate(SysctrlPeripheralAdcBgr, TRUE);
|
||||
M0P_BGR->CR_f.TS_EN = TRUE;
|
||||
|
||||
delay10us(2);
|
||||
|
||||
return Ok;
|
||||
}
|
||||
|
||||
/**
|
||||
*****************************************************************************
|
||||
** \brief BGR 温度传感器禁止
|
||||
**
|
||||
**
|
||||
** \retval TRUE or FALSE
|
||||
*****************************************************************************/
|
||||
en_result_t Bgr_TempSensorDisable(void)
|
||||
{
|
||||
Sysctrl_SetPeripheralGate(SysctrlPeripheralAdcBgr, TRUE);
|
||||
M0P_BGR->CR_f.TS_EN = FALSE;
|
||||
|
||||
return Ok;
|
||||
}
|
||||
|
||||
|
||||
//@} // BgrGroup
|
||||
|
||||
/*******************************************************************************
|
||||
* EOF (not truncated)
|
||||
******************************************************************************/
|
||||
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,119 @@
|
||||
/******************************************************************************
|
||||
*Copyright(C)2018, Huada Semiconductor Co.,Ltd All rights reserved.
|
||||
*
|
||||
* This software is owned and published by:
|
||||
* Huada Semiconductor Co.,Ltd("HDSC").
|
||||
*
|
||||
* BY DOWNLOADING, INSTALLING OR USING THIS SOFTWARE, YOU AGREE TO BE BOUND
|
||||
* BY ALL THE TERMS AND CONDITIONS OF THIS AGREEMENT.
|
||||
*
|
||||
* This software contains source code for use with HDSC
|
||||
* components. This software is licensed by HDSC to be adapted only
|
||||
* for use in systems utilizing HDSC components. HDSC shall not be
|
||||
* responsible for misuse or illegal use of this software for devices not
|
||||
* supported herein. HDSC is providing this software "AS IS" and will
|
||||
* not be responsible for issues arising from incorrect user implementation
|
||||
* of the software.
|
||||
*
|
||||
* Disclaimer:
|
||||
* HDSC MAKES NO WARRANTY, EXPRESS OR IMPLIED, ARISING BY LAW OR OTHERWISE,
|
||||
* REGARDING THE SOFTWARE (INCLUDING ANY ACOOMPANYING WRITTEN MATERIALS),
|
||||
* ITS PERFORMANCE OR SUITABILITY FOR YOUR INTENDED USE, INCLUDING,
|
||||
* WITHOUT LIMITATION, THE IMPLIED WARRANTY OF MERCHANTABILITY, THE IMPLIED
|
||||
* WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE OR USE, AND THE IMPLIED
|
||||
* WARRANTY OF NONINFRINGEMENT.
|
||||
* HDSC SHALL HAVE NO LIABILITY (WHETHER IN CONTRACT, WARRANTY, TORT,
|
||||
* NEGLIGENCE OR OTHERWISE) FOR ANY DAMAGES WHATSOEVER (INCLUDING, WITHOUT
|
||||
* LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION,
|
||||
* LOSS OF BUSINESS INFORMATION, OR OTHER PECUNIARY LOSS) ARISING FROM USE OR
|
||||
* INABILITY TO USE THE SOFTWARE, INCLUDING, WITHOUT LIMITATION, ANY DIRECT,
|
||||
* INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES OR LOSS OF DATA,
|
||||
* SAVINGS OR PROFITS,
|
||||
* EVEN IF Disclaimer HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
* YOU ASSUME ALL RESPONSIBILITIES FOR SELECTION OF THE SOFTWARE TO ACHIEVE YOUR
|
||||
* INTENDED RESULTS, AND FOR THE INSTALLATION OF, USE OF, AND RESULTS OBTAINED
|
||||
* FROM, THE SOFTWARE.
|
||||
*
|
||||
* This software may be replicated in part or whole for the licensed use,
|
||||
* with the restriction that this Disclaimer and Copyright notice must be
|
||||
* included with each copy of this software, whether used in part or whole,
|
||||
* at all times.
|
||||
*/
|
||||
|
||||
/** \file debug.c
|
||||
**
|
||||
** Common API of debug.
|
||||
** @link flashGroup Some description @endlink
|
||||
**
|
||||
** - 2018-05-08
|
||||
**
|
||||
******************************************************************************/
|
||||
|
||||
/*******************************************************************************
|
||||
* Include files
|
||||
******************************************************************************/
|
||||
#include "debug.h"
|
||||
/**
|
||||
*******************************************************************************
|
||||
** \addtogroup FlashGroup
|
||||
******************************************************************************/
|
||||
//@{
|
||||
|
||||
/*******************************************************************************
|
||||
* Local pre-processor symbols/macros ('#define')
|
||||
******************************************************************************/
|
||||
|
||||
/*******************************************************************************
|
||||
* Global variable definitions (declared in header file with 'extern')
|
||||
******************************************************************************/
|
||||
|
||||
/*******************************************************************************
|
||||
* Local type definitions ('typedef')
|
||||
******************************************************************************/
|
||||
|
||||
/*******************************************************************************
|
||||
* Local variable definitions ('static')
|
||||
******************************************************************************/
|
||||
|
||||
/*******************************************************************************
|
||||
* Local function prototypes ('static')
|
||||
******************************************************************************/
|
||||
|
||||
/*******************************************************************************
|
||||
* Function implementation - global ('extern') and local ('static')
|
||||
******************************************************************************/
|
||||
|
||||
/**
|
||||
*****************************************************************************
|
||||
** \brief 调试模式下模块功能使能
|
||||
**
|
||||
**
|
||||
** \retval TRUE or FALSE
|
||||
*****************************************************************************/
|
||||
en_result_t Debug_ActiveEnable(en_debug_module_active_t enModule)
|
||||
{
|
||||
M0P_DEBUG_ACTIVE->DEBUG_ACTIVE &= ~enModule;
|
||||
|
||||
return Ok;
|
||||
}
|
||||
|
||||
/**
|
||||
*****************************************************************************
|
||||
** \brief 调试模式下模块功能暂停
|
||||
**
|
||||
**
|
||||
** \retval TRUE or FALSE
|
||||
*****************************************************************************/
|
||||
en_result_t Debug_ActiveDisable(en_debug_module_active_t enModule)
|
||||
{
|
||||
M0P_DEBUG_ACTIVE->DEBUG_ACTIVE |= enModule;
|
||||
|
||||
return Ok;
|
||||
}
|
||||
|
||||
|
||||
//@} // BgrGroup
|
||||
|
||||
/*******************************************************************************
|
||||
* EOF (not truncated)
|
||||
******************************************************************************/
|
||||
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,176 @@
|
||||
/******************************************************************************
|
||||
*Copyright(C)2017, Huada Semiconductor Co.,Ltd All rights reserved.
|
||||
*
|
||||
* This software is owned and published by:
|
||||
* Huada Semiconductor Co.,Ltd("HDSC").
|
||||
*
|
||||
* BY DOWNLOADING, INSTALLING OR USING THIS SOFTWARE, YOU AGREE TO BE BOUND
|
||||
* BY ALL THE TERMS AND CONDITIONS OF THIS AGREEMENT.
|
||||
*
|
||||
* This software contains source code for use with HDSC
|
||||
* components. This software is licensed by HDSC to be adapted only
|
||||
* for use in systems utilizing HDSC components. HDSC shall not be
|
||||
* responsible for misuse or illegal use of this software for devices not
|
||||
* supported herein. HDSC is providing this software "AS IS" and will
|
||||
* not be responsible for issues arising from incorrect user implementation
|
||||
* of the software.
|
||||
*
|
||||
* Disclaimer:
|
||||
* HDSC MAKES NO WARRANTY, EXPRESS OR IMPLIED, ARISING BY LAW OR OTHERWISE,
|
||||
* REGARDING THE SOFTWARE (INCLUDING ANY ACOOMPANYING WRITTEN MATERIALS),
|
||||
* ITS PERFORMANCE OR SUITABILITY FOR YOUR INTENDED USE, INCLUDING,
|
||||
* WITHOUT LIMITATION, THE IMPLIED WARRANTY OF MERCHANTABILITY, THE IMPLIED
|
||||
* WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE OR USE, AND THE IMPLIED
|
||||
* WARRANTY OF NONINFRINGEMENT.
|
||||
* HDSC SHALL HAVE NO LIABILITY (WHETHER IN CONTRACT, WARRANTY, TORT,
|
||||
* NEGLIGENCE OR OTHERWISE) FOR ANY DAMAGES WHATSOEVER (INCLUDING, WITHOUT
|
||||
* LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION,
|
||||
* LOSS OF BUSINESS INFORMATION, OR OTHER PECUNIARY LOSS) ARISING FROM USE OR
|
||||
* INABILITY TO USE THE SOFTWARE, INCLUDING, WITHOUT LIMITATION, ANY DIRECT,
|
||||
* INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES OR LOSS OF DATA,
|
||||
* SAVINGS OR PROFITS,
|
||||
* EVEN IF Disclaimer HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
* YOU ASSUME ALL RESPONSIBILITIES FOR SELECTION OF THE SOFTWARE TO ACHIEVE YOUR
|
||||
* INTENDED RESULTS, AND FOR THE INSTALLATION OF, USE OF, AND RESULTS OBTAINED
|
||||
* FROM, THE SOFTWARE.
|
||||
*
|
||||
* This software may be replicated in part or whole for the licensed use,
|
||||
* with the restriction that this Disclaimer and Copyright notice must be
|
||||
* included with each copy of this software, whether used in part or whole,
|
||||
* at all times.
|
||||
*/
|
||||
|
||||
/** \file crc.c
|
||||
**
|
||||
** Common API of crc.
|
||||
** @link crcGroup Some description @endlink
|
||||
**
|
||||
** - 2017-05-16
|
||||
**
|
||||
******************************************************************************/
|
||||
|
||||
/*******************************************************************************
|
||||
* Include files
|
||||
******************************************************************************/
|
||||
#include "ddl.h"
|
||||
#include "hdiv.h"
|
||||
/**
|
||||
*******************************************************************************
|
||||
** \addtogroup CrcGroup
|
||||
******************************************************************************/
|
||||
//@{
|
||||
|
||||
/*******************************************************************************
|
||||
* Local pre-processor symbols/macros ('#define')
|
||||
******************************************************************************/
|
||||
|
||||
/*******************************************************************************
|
||||
* Global variable definitions (declared in header file with 'extern')
|
||||
******************************************************************************/
|
||||
|
||||
/*******************************************************************************
|
||||
* Local type definitions ('typedef')
|
||||
******************************************************************************/
|
||||
|
||||
/*******************************************************************************
|
||||
* Local variable definitions ('static')
|
||||
******************************************************************************/
|
||||
|
||||
/*******************************************************************************
|
||||
* Local function prototypes ('static')
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function implementation - global ('extern') and local ('static')
|
||||
******************************************************************************/
|
||||
/**
|
||||
* \brief
|
||||
* HDIV 有符号除法
|
||||
*
|
||||
* \param [in] Dividend 被除数
|
||||
* \param [in] Dividsor 除数
|
||||
* \param [out] stcDivResult 商和余数
|
||||
*
|
||||
* \retval en_result_t Ok: 配置成功
|
||||
* \retval en_result_t ErrorInvalidParameter: 无效参数
|
||||
*/
|
||||
en_result_t Hdiv_Unsigned(uint32_t Dividend,uint16_t Divisor,stc_div_unsigned_result_t* stcDivResult)
|
||||
{
|
||||
M0P_HDIV->SIGN_f.SIGN = 0;
|
||||
if(NULL == stcDivResult)
|
||||
{
|
||||
return ErrorInvalidParameter;
|
||||
}
|
||||
(M0P_HDIV ->DIVIDEND) = Dividend;
|
||||
(M0P_HDIV ->DIVISOR) = Divisor;
|
||||
|
||||
if(Hdiv_GetZeroState() == TRUE)
|
||||
{
|
||||
return ErrorInvalidParameter;
|
||||
}
|
||||
|
||||
while(Hdiv_GetEndState() != TRUE)
|
||||
{
|
||||
;
|
||||
}
|
||||
|
||||
stcDivResult->Quotient = M0P_HDIV->QUOTIENT_f.QUOTIENT;
|
||||
stcDivResult->Remainder = M0P_HDIV ->REMAINDER_f.REMAINDER;
|
||||
return Ok;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* \brief
|
||||
* HDIV 无符号除法
|
||||
*
|
||||
* \param [in] Dividend 被除数
|
||||
* \param [in] Dividsor 除数
|
||||
* \param [out] stcDivResult 商和余数
|
||||
*
|
||||
* \retval en_result_t Ok: 配置成功
|
||||
* \retval en_result_t ErrorInvalidParameter: 无效参数
|
||||
*/
|
||||
en_result_t Hdiv_Signed(int32_t Dividend,int16_t Divisor,stc_div_signed_result_t* stcDivResult)
|
||||
{
|
||||
|
||||
__IO uint32_t * pDivdend = &(M0P_HDIV ->DIVIDEND);
|
||||
__IO uint32_t * pDivsor = &(M0P_HDIV ->DIVISOR);
|
||||
if(NULL == stcDivResult)
|
||||
{
|
||||
return ErrorInvalidParameter;
|
||||
}
|
||||
M0P_HDIV->SIGN_f.SIGN = 1;
|
||||
*(__IO int32_t *)pDivdend = Dividend;
|
||||
*(__IO int16_t *)pDivsor = Divisor;
|
||||
|
||||
if(Hdiv_GetZeroState() == TRUE)
|
||||
{
|
||||
return ErrorInvalidParameter;
|
||||
}
|
||||
|
||||
while(Hdiv_GetEndState() != TRUE)
|
||||
{
|
||||
;
|
||||
}
|
||||
|
||||
stcDivResult->Quotient = M0P_HDIV->QUOTIENT_f.QUOTIENT;
|
||||
stcDivResult->Remainder = M0P_HDIV ->REMAINDER_f.REMAINDER;
|
||||
return Ok;
|
||||
}
|
||||
|
||||
boolean_t Hdiv_GetEndState(void)
|
||||
{
|
||||
return M0P_HDIV->STAT_f.END;
|
||||
}
|
||||
|
||||
boolean_t Hdiv_GetZeroState(void)
|
||||
{
|
||||
return M0P_HDIV->STAT_f.ZERO;
|
||||
}
|
||||
//@} // CrcGroup
|
||||
|
||||
/*******************************************************************************
|
||||
* EOF (not truncated)
|
||||
******************************************************************************/
|
||||
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,134 @@
|
||||
/******************************************************************************
|
||||
*Copyright(C)2017, Huada Semiconductor Co.,Ltd All rights reserved.
|
||||
*
|
||||
* This software is owned and published by:
|
||||
* Huada Semiconductor Co.,Ltd("HDSC").
|
||||
*
|
||||
* BY DOWNLOADING, INSTALLING OR USING THIS SOFTWARE, YOU AGREE TO BE BOUND
|
||||
* BY ALL THE TERMS AND CONDITIONS OF THIS AGREEMENT.
|
||||
*
|
||||
* This software contains source code for use with HDSC
|
||||
* components. This software is licensed by HDSC to be adapted only
|
||||
* for use in systems utilizing HDSC components. HDSC shall not be
|
||||
* responsible for misuse or illegal use of this software for devices not
|
||||
* supported herein. HDSC is providing this software "AS IS" and will
|
||||
* not be responsible for issues arising from incorrect user implementation
|
||||
* of the software.
|
||||
*
|
||||
* Disclaimer:
|
||||
* HDSC MAKES NO WARRANTY, EXPRESS OR IMPLIED, ARISING BY LAW OR OTHERWISE,
|
||||
* REGARDING THE SOFTWARE (INCLUDING ANY ACOOMPANYING WRITTEN MATERIALS),
|
||||
* ITS PERFORMANCE OR SUITABILITY FOR YOUR INTENDED USE, INCLUDING,
|
||||
* WITHOUT LIMITATION, THE IMPLIED WARRANTY OF MERCHANTABILITY, THE IMPLIED
|
||||
* WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE OR USE, AND THE IMPLIED
|
||||
* WARRANTY OF NONINFRINGEMENT.
|
||||
* HDSC SHALL HAVE NO LIABILITY (WHETHER IN CONTRACT, WARRANTY, TORT,
|
||||
* NEGLIGENCE OR OTHERWISE) FOR ANY DAMAGES WHATSOEVER (INCLUDING, WITHOUT
|
||||
* LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION,
|
||||
* LOSS OF BUSINESS INFORMATION, OR OTHER PECUNIARY LOSS) ARISING FROM USE OR
|
||||
* INABILITY TO USE THE SOFTWARE, INCLUDING, WITHOUT LIMITATION, ANY DIRECT,
|
||||
* INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES OR LOSS OF DATA,
|
||||
* SAVINGS OR PROFITS,
|
||||
* EVEN IF Disclaimer HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
* YOU ASSUME ALL RESPONSIBILITIES FOR SELECTION OF THE SOFTWARE TO ACHIEVE YOUR
|
||||
* INTENDED RESULTS, AND FOR THE INSTALLATION OF, USE OF, AND RESULTS OBTAINED
|
||||
* FROM, THE SOFTWARE.
|
||||
*
|
||||
* This software may be replicated in part or whole for the licensed use,
|
||||
* with the restriction that this Disclaimer and Copyright notice must be
|
||||
* included with each copy of this software, whether used in part or whole,
|
||||
* at all times.
|
||||
*/
|
||||
|
||||
/** \file lpm.c
|
||||
**
|
||||
** Common API of lpm.
|
||||
** @link LpmGroup Some description @endlink
|
||||
**
|
||||
** - 2017-06-06
|
||||
**
|
||||
******************************************************************************/
|
||||
|
||||
/*******************************************************************************
|
||||
* Include files
|
||||
******************************************************************************/
|
||||
#include "lpm.h"
|
||||
/**
|
||||
*******************************************************************************
|
||||
** \addtogroup LpmGroup
|
||||
******************************************************************************/
|
||||
//@{
|
||||
|
||||
/*******************************************************************************
|
||||
* Local pre-processor symbols/macros ('#define')
|
||||
******************************************************************************/
|
||||
|
||||
/*******************************************************************************
|
||||
* Global variable definitions (declared in header file with 'extern')
|
||||
******************************************************************************/
|
||||
#define IS_VALID_SEVONPEND(x) (SevPndDisable == (x) ||\
|
||||
SevPndEnable == (x))
|
||||
#define IS_VALID_SLEEPDEEP(x) (SlpDpDisable == (x) ||\
|
||||
SlpDpEnable == (x))
|
||||
#define IS_VALID_SLEEPONEXIT(x) (SlpExtDisable == (x) ||\
|
||||
SlpExtEnable == (x))
|
||||
|
||||
/*******************************************************************************
|
||||
* Local type definitions ('typedef')
|
||||
******************************************************************************/
|
||||
|
||||
/*******************************************************************************
|
||||
* Local variable definitions ('static')
|
||||
******************************************************************************/
|
||||
|
||||
/*******************************************************************************
|
||||
* Local function prototypes ('static')
|
||||
******************************************************************************/
|
||||
|
||||
/*******************************************************************************
|
||||
* Function implementation - global ('extern') and local ('static')
|
||||
******************************************************************************/
|
||||
/**
|
||||
*****************************************************************************
|
||||
** \brief 低功耗模式配置
|
||||
**
|
||||
**
|
||||
** \param [in] pstcConfig 低功耗模式配置结构体指针
|
||||
**
|
||||
** \retval Ok or Error
|
||||
*****************************************************************************/
|
||||
en_result_t Lpm_Config(stc_lpm_config_t* pstcConfig)
|
||||
{
|
||||
en_result_t enResult = Error;
|
||||
|
||||
ASSERT(IS_VALID_SEVONPEND(pstcConfig->enSEVONPEND));
|
||||
ASSERT(IS_VALID_SLEEPDEEP(pstcConfig->enSLEEPDEEP));
|
||||
ASSERT(IS_VALID_SLEEPONEXIT(pstcConfig->enSLEEPONEXIT));
|
||||
|
||||
SCB->SCR = pstcConfig->enSEVONPEND ? (SCB->SCR | SCB_SCR_SEVONPEND_Msk) : (SCB->SCR & ~SCB_SCR_SEVONPEND_Msk);
|
||||
SCB->SCR = pstcConfig->enSLEEPDEEP ? (SCB->SCR | SCB_SCR_SLEEPDEEP_Msk) : (SCB->SCR & ~SCB_SCR_SLEEPDEEP_Msk);
|
||||
SCB->SCR = pstcConfig->enSLEEPONEXIT ? (SCB->SCR | SCB_SCR_SLEEPONEXIT_Msk) : (SCB->SCR & ~SCB_SCR_SLEEPONEXIT_Msk);
|
||||
|
||||
enResult = Ok;
|
||||
|
||||
return enResult;
|
||||
}
|
||||
|
||||
/**
|
||||
*****************************************************************************
|
||||
** \brief 进入睡眠模式
|
||||
**
|
||||
**
|
||||
**
|
||||
** \retval NULL
|
||||
*****************************************************************************/
|
||||
void Lpm_GotoLpmMode(void)
|
||||
{
|
||||
__WFI();
|
||||
}
|
||||
|
||||
//@} // LpmGroup
|
||||
|
||||
/*******************************************************************************
|
||||
* EOF (not truncated)
|
||||
******************************************************************************/
|
||||
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,163 @@
|
||||
/******************************************************************************
|
||||
*Copyright(C)2017, Huada Semiconductor Co.,Ltd All rights reserved.
|
||||
*
|
||||
* This software is owned and published by:
|
||||
* Huada Semiconductor Co.,Ltd("HDSC").
|
||||
*
|
||||
* BY DOWNLOADING, INSTALLING OR USING THIS SOFTWARE, YOU AGREE TO BE BOUND
|
||||
* BY ALL THE TERMS AND CONDITIONS OF THIS AGREEMENT.
|
||||
*
|
||||
* This software contains source code for use with HDSC
|
||||
* components. This software is licensed by HDSC to be adapted only
|
||||
* for use in systems utilizing HDSC components. HDSC shall not be
|
||||
* responsible for misuse or illegal use of this software for devices not
|
||||
* supported herein. HDSC is providing this software "AS IS" and will
|
||||
* not be responsible for issues arising from incorrect user implementation
|
||||
* of the software.
|
||||
*
|
||||
* Disclaimer:
|
||||
* HDSC MAKES NO WARRANTY, EXPRESS OR IMPLIED, ARISING BY LAW OR OTHERWISE,
|
||||
* REGARDING THE SOFTWARE (INCLUDING ANY ACOOMPANYING WRITTEN MATERIALS),
|
||||
* ITS PERFORMANCE OR SUITABILITY FOR YOUR INTENDED USE, INCLUDING,
|
||||
* WITHOUT LIMITATION, THE IMPLIED WARRANTY OF MERCHANTABILITY, THE IMPLIED
|
||||
* WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE OR USE, AND THE IMPLIED
|
||||
* WARRANTY OF NONINFRINGEMENT.
|
||||
* HDSC SHALL HAVE NO LIABILITY (WHETHER IN CONTRACT, WARRANTY, TORT,
|
||||
* NEGLIGENCE OR OTHERWISE) FOR ANY DAMAGES WHATSOEVER (INCLUDING, WITHOUT
|
||||
* LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION,
|
||||
* LOSS OF BUSINESS INFORMATION, OR OTHER PECUNIARY LOSS) ARISING FROM USE OR
|
||||
* INABILITY TO USE THE SOFTWARE, INCLUDING, WITHOUT LIMITATION, ANY DIRECT,
|
||||
* INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES OR LOSS OF DATA,
|
||||
* SAVINGS OR PROFITS,
|
||||
* EVEN IF Disclaimer HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
* YOU ASSUME ALL RESPONSIBILITIES FOR SELECTION OF THE SOFTWARE TO ACHIEVE YOUR
|
||||
* INTENDED RESULTS, AND FOR THE INSTALLATION OF, USE OF, AND RESULTS OBTAINED
|
||||
* FROM, THE SOFTWARE.
|
||||
*
|
||||
* This software may be replicated in part or whole for the licensed use,
|
||||
* with the restriction that this Disclaimer and Copyright notice must be
|
||||
* included with each copy of this software, whether used in part or whole,
|
||||
* at all times.
|
||||
*/
|
||||
|
||||
/** \file reset.c
|
||||
**
|
||||
** Common API of reset.
|
||||
** @link resetGroup Some description @endlink
|
||||
**
|
||||
** - 2017-05-04
|
||||
**
|
||||
******************************************************************************/
|
||||
|
||||
/*******************************************************************************
|
||||
* Include files
|
||||
******************************************************************************/
|
||||
#include "reset.h"
|
||||
|
||||
/**
|
||||
*******************************************************************************
|
||||
** \addtogroup ResetGroup
|
||||
******************************************************************************/
|
||||
//@{
|
||||
|
||||
/*******************************************************************************
|
||||
* Local pre-processor symbols/macros ('#define')
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Global variable definitions (declared in header file with 'extern')
|
||||
******************************************************************************/
|
||||
|
||||
/*******************************************************************************
|
||||
* Local type definitions ('typedef')
|
||||
******************************************************************************/
|
||||
|
||||
/*******************************************************************************
|
||||
* Local variable definitions ('static')
|
||||
******************************************************************************/
|
||||
|
||||
/*******************************************************************************
|
||||
* Local function prototypes ('static')
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
* Function implementation - global ('extern') and local ('static')
|
||||
******************************************************************************/
|
||||
|
||||
/**
|
||||
*******************************************************************************
|
||||
** \brief 获取复位源类型.
|
||||
**
|
||||
** \param [out] pstcOut 复位源类型列表
|
||||
**
|
||||
** \retval Ok 操作成功
|
||||
** 其他 操作失败
|
||||
******************************************************************************/
|
||||
en_result_t Reset_GetCause(stc_reset_cause_t *pstcOut)
|
||||
{
|
||||
uint8_t u8val = 0;
|
||||
if (NULL == pstcOut)
|
||||
{
|
||||
return ErrorInvalidParameter;
|
||||
}
|
||||
|
||||
u8val = M0P_RESET->RESET_FLAG;
|
||||
|
||||
*pstcOut = *((stc_reset_cause_t*)&u8val);
|
||||
return Ok;
|
||||
}
|
||||
|
||||
/**
|
||||
*******************************************************************************
|
||||
** \brief 清除复位源类型.
|
||||
**
|
||||
** \param [in] stcval 复位源类型列表,每种类型对应的比特位写“0”清除,写“1”无效
|
||||
**
|
||||
** \retval Ok 操作成功
|
||||
** 其他 操作失败
|
||||
******************************************************************************/
|
||||
en_result_t Reset_Clear(stc_reset_cause_t stcval)
|
||||
{
|
||||
uint8_t u8val = *((uint8_t*)&stcval);
|
||||
|
||||
M0P_RESET->RESET_FLAG = u8val;
|
||||
|
||||
return Ok;
|
||||
}
|
||||
|
||||
/**
|
||||
*******************************************************************************
|
||||
** \brief 设置外设复位源开关.
|
||||
**
|
||||
** \param [in] enPeri 复位源类型列表
|
||||
** \param [in] bFlag 复位开关
|
||||
**
|
||||
** \retval Ok 操作成功
|
||||
** 其他 操作失败
|
||||
******************************************************************************/
|
||||
en_result_t Reset_SetPeripheralReset(en_reset_peripheral_t enPeri, boolean_t bFlag)
|
||||
{
|
||||
|
||||
bFlag = !!bFlag;
|
||||
|
||||
if(TRUE == bFlag)
|
||||
{
|
||||
M0P_RESET->PREI_RESET |= (uint32_t)enPeri;
|
||||
}
|
||||
else
|
||||
{
|
||||
M0P_RESET->PREI_RESET &= ~(uint32_t)enPeri;
|
||||
}
|
||||
|
||||
return Ok;
|
||||
}
|
||||
|
||||
//@} // ResetGroup
|
||||
|
||||
/*******************************************************************************
|
||||
* EOF (not truncated)
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
@@ -0,0 +1,191 @@
|
||||
/******************************************************************************
|
||||
*Copyright(C)2018, Huada Semiconductor Co.,Ltd All rights reserved.
|
||||
*
|
||||
* This software is owned and published by:
|
||||
* Huada Semiconductor Co.,Ltd("HDSC").
|
||||
*
|
||||
* BY DOWNLOADING, INSTALLING OR USING THIS SOFTWARE, YOU AGREE TO BE BOUND
|
||||
* BY ALL THE TERMS AND CONDITIONS OF THIS AGREEMENT.
|
||||
*
|
||||
* This software contains source code for use with HDSC
|
||||
* components. This software is licensed by HDSC to be adapted only
|
||||
* for use in systems utilizing HDSC components. HDSC shall not be
|
||||
* responsible for misuse or illegal use of this software for devices not
|
||||
* supported herein. HDSC is providing this software "AS IS" and will
|
||||
* not be responsible for issues arising from incorrect user implementation
|
||||
* of the software.
|
||||
*
|
||||
* Disclaimer:
|
||||
* HDSC MAKES NO WARRANTY, EXPRESS OR IMPLIED, ARISING BY LAW OR OTHERWISE,
|
||||
* REGARDING THE SOFTWARE (INCLUDING ANY ACOOMPANYING WRITTEN MATERIALS),
|
||||
* ITS PERFORMANCE OR SUITABILITY FOR YOUR INTENDED USE, INCLUDING,
|
||||
* WITHOUT LIMITATION, THE IMPLIED WARRANTY OF MERCHANTABILITY, THE IMPLIED
|
||||
* WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE OR USE, AND THE IMPLIED
|
||||
* WARRANTY OF NONINFRINGEMENT.
|
||||
* HDSC SHALL HAVE NO LIABILITY (WHETHER IN CONTRACT, WARRANTY, TORT,
|
||||
* NEGLIGENCE OR OTHERWISE) FOR ANY DAMAGES WHATSOEVER (INCLUDING, WITHOUT
|
||||
* LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION,
|
||||
* LOSS OF BUSINESS INFORMATION, OR OTHER PECUNIARY LOSS) ARISING FROM USE OR
|
||||
* INABILITY TO USE THE SOFTWARE, INCLUDING, WITHOUT LIMITATION, ANY DIRECT,
|
||||
* INDIRECT, INCIDENTAL, SPECIAL OR CONSEQUENTIAL DAMAGES OR LOSS OF DATA,
|
||||
* SAVINGS OR PROFITS,
|
||||
* EVEN IF Disclaimer HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
* YOU ASSUME ALL RESPONSIBILITIES FOR SELECTION OF THE SOFTWARE TO ACHIEVE YOUR
|
||||
* INTENDED RESULTS, AND FOR THE INSTALLATION OF, USE OF, AND RESULTS OBTAINED
|
||||
* FROM, THE SOFTWARE.
|
||||
*
|
||||
* This software may be replicated in part or whole for the licensed use,
|
||||
* with the restriction that this Disclaimer and Copyright notice must be
|
||||
* included with each copy of this software, whether used in part or whole,
|
||||
* at all times.
|
||||
*/
|
||||
|
||||
/** \file rng.c
|
||||
**
|
||||
** Common API of rng.
|
||||
** @link flashGroup Some description @endlink
|
||||
**
|
||||
** - 2018-05-08
|
||||
**
|
||||
******************************************************************************/
|
||||
|
||||
/*******************************************************************************
|
||||
* Include files
|
||||
******************************************************************************/
|
||||
#include "rng.h"
|
||||
/**
|
||||
*******************************************************************************
|
||||
** \addtogroup FlashGroup
|
||||
******************************************************************************/
|
||||
//@{
|
||||
|
||||
/*******************************************************************************
|
||||
* Local pre-processor symbols/macros ('#define')
|
||||
******************************************************************************/
|
||||
|
||||
/*******************************************************************************
|
||||
* Global variable definitions (declared in header file with 'extern')
|
||||
******************************************************************************/
|
||||
|
||||
/*******************************************************************************
|
||||
* Local type definitions ('typedef')
|
||||
******************************************************************************/
|
||||
|
||||
/*******************************************************************************
|
||||
* Local variable definitions ('static')
|
||||
******************************************************************************/
|
||||
|
||||
/*******************************************************************************
|
||||
* Local function prototypes ('static')
|
||||
******************************************************************************/
|
||||
|
||||
/*******************************************************************************
|
||||
* Function implementation - global ('extern') and local ('static')
|
||||
******************************************************************************/
|
||||
|
||||
/**
|
||||
*****************************************************************************
|
||||
** \brief 随机数初始化(上电第一次生成随机数)
|
||||
**
|
||||
**
|
||||
** \retval TRUE or FALSE
|
||||
*****************************************************************************/
|
||||
en_result_t Rng_Init(void)
|
||||
{
|
||||
//==>>生成64bits随机数(上电第一次)
|
||||
M0P_RNG->CR_f.RNGCIR_EN = 1;
|
||||
//模式配置0
|
||||
M0P_RNG->MODE_f.LOAD = 1;
|
||||
M0P_RNG->MODE_f.FDBK = 1;
|
||||
M0P_RNG->MODE_f.CNT = 6;
|
||||
//生成随机数0
|
||||
M0P_RNG->CR_f.RNG_RUN = 1;
|
||||
while(M0P_RNG->CR_f.RNG_RUN)
|
||||
{
|
||||
;
|
||||
}
|
||||
|
||||
//模式配置1
|
||||
M0P_RNG->MODE_f.LOAD = 0;
|
||||
M0P_RNG->MODE_f.FDBK = 0;
|
||||
M0P_RNG->MODE_f.CNT = 4;
|
||||
//生成随机数1
|
||||
M0P_RNG->CR_f.RNG_RUN = 1;
|
||||
while(M0P_RNG->CR_f.RNG_RUN)
|
||||
{
|
||||
;
|
||||
}
|
||||
|
||||
//关闭随机源电路,节省功耗
|
||||
M0P_RNG->CR_f.RNGCIR_EN = 0;
|
||||
|
||||
return Ok;
|
||||
}
|
||||
|
||||
/**
|
||||
*****************************************************************************
|
||||
** \brief 生成随机数(非上电第一次生成随机数)
|
||||
**
|
||||
**
|
||||
** \retval TRUE or FALSE
|
||||
*****************************************************************************/
|
||||
en_result_t Rng_Generate(void)
|
||||
{
|
||||
//==>>生成64bits随机数(非上电第一次生成)
|
||||
M0P_RNG->CR_f.RNGCIR_EN = 1;
|
||||
|
||||
//模式配置0
|
||||
M0P_RNG->MODE_f.LOAD = 0;
|
||||
M0P_RNG->MODE_f.FDBK = 1;
|
||||
M0P_RNG->MODE_f.CNT = 6;
|
||||
//生成随机数0
|
||||
M0P_RNG->CR_f.RNG_RUN = 1;
|
||||
while(M0P_RNG->CR_f.RNG_RUN)
|
||||
{
|
||||
;
|
||||
}
|
||||
|
||||
//模式配置1
|
||||
M0P_RNG->MODE_f.FDBK = 0;
|
||||
M0P_RNG->MODE_f.CNT = 4;
|
||||
M0P_RNG->MODE_f.CNT = 4;
|
||||
//生成随机数1
|
||||
M0P_RNG->CR_f.RNG_RUN = 1;
|
||||
while(M0P_RNG->CR_f.RNG_RUN)
|
||||
{
|
||||
;
|
||||
}
|
||||
|
||||
//关闭随机源电路,节省功耗
|
||||
M0P_RNG->CR_f.RNGCIR_EN = 0;
|
||||
|
||||
return Ok;
|
||||
}
|
||||
|
||||
/**
|
||||
*****************************************************************************
|
||||
** \brief 随机数获取
|
||||
**
|
||||
** \retval data0
|
||||
*****************************************************************************/
|
||||
uint32_t Rng_GetData0(void)
|
||||
{
|
||||
return M0P_RNG->DATA0;
|
||||
}
|
||||
|
||||
/**
|
||||
*****************************************************************************
|
||||
** \brief 随机数获取
|
||||
**
|
||||
** \retval data1
|
||||
*****************************************************************************/
|
||||
uint32_t Rng_GetData1(void)
|
||||
{
|
||||
return M0P_RNG->DATA1;
|
||||
}
|
||||
|
||||
//@} // RngGroup
|
||||
|
||||
/*******************************************************************************
|
||||
* EOF (not truncated)
|
||||
******************************************************************************/
|
||||
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
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user