mirror of
https://github.com/ArteryTek/AT32F413_Firmware_Library.git
synced 2026-05-21 09:22:02 +00:00
update version to v2.0.4
This commit is contained in:
@@ -1,17 +1,17 @@
|
||||
/**
|
||||
**************************************************************************
|
||||
* @file at32f413_clock.h
|
||||
* @version v2.0.3
|
||||
* @date 2022-02-11
|
||||
* @version v2.0.4
|
||||
* @date 2022-04-02
|
||||
* @brief header file of clock program
|
||||
**************************************************************************
|
||||
* Copyright notice & Disclaimer
|
||||
*
|
||||
* The software Board Support Package (BSP) that is made available to
|
||||
* download from Artery official website is the copyrighted work of Artery.
|
||||
* Artery authorizes customers to use, copy, and distribute the BSP
|
||||
* software and its related documentation for the purpose of design and
|
||||
* development in conjunction with Artery microcontrollers. Use of the
|
||||
* The software Board Support Package (BSP) that is made available to
|
||||
* download from Artery official website is the copyrighted work of Artery.
|
||||
* Artery authorizes customers to use, copy, and distribute the BSP
|
||||
* software and its related documentation for the purpose of design and
|
||||
* development in conjunction with Artery microcontrollers. Use of the
|
||||
* software is governed by this copyright notice and the following disclaimer.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED ON "AS IS" BASIS WITHOUT WARRANTIES,
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
/**
|
||||
**************************************************************************
|
||||
* @file at32f413_conf.h
|
||||
* @version v2.0.3
|
||||
* @date 2022-02-11
|
||||
* @version v2.0.4
|
||||
* @date 2022-04-02
|
||||
* @brief at32f413 config header file
|
||||
**************************************************************************
|
||||
* Copyright notice & Disclaimer
|
||||
*
|
||||
* The software Board Support Package (BSP) that is made available to
|
||||
* download from Artery official website is the copyrighted work of Artery.
|
||||
* Artery authorizes customers to use, copy, and distribute the BSP
|
||||
* software and its related documentation for the purpose of design and
|
||||
* development in conjunction with Artery microcontrollers. Use of the
|
||||
* The software Board Support Package (BSP) that is made available to
|
||||
* download from Artery official website is the copyrighted work of Artery.
|
||||
* Artery authorizes customers to use, copy, and distribute the BSP
|
||||
* software and its related documentation for the purpose of design and
|
||||
* development in conjunction with Artery microcontrollers. Use of the
|
||||
* software is governed by this copyright notice and the following disclaimer.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED ON "AS IS" BASIS WITHOUT WARRANTIES,
|
||||
@@ -150,7 +150,7 @@ extern "C" {
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
/**
|
||||
**************************************************************************
|
||||
* @file at32f413_int.h
|
||||
* @version v2.0.3
|
||||
* @date 2022-02-11
|
||||
* @version v2.0.4
|
||||
* @date 2022-04-02
|
||||
* @brief header file of main interrupt service routines.
|
||||
**************************************************************************
|
||||
* Copyright notice & Disclaimer
|
||||
*
|
||||
* The software Board Support Package (BSP) that is made available to
|
||||
* download from Artery official website is the copyrighted work of Artery.
|
||||
* Artery authorizes customers to use, copy, and distribute the BSP
|
||||
* software and its related documentation for the purpose of design and
|
||||
* development in conjunction with Artery microcontrollers. Use of the
|
||||
* The software Board Support Package (BSP) that is made available to
|
||||
* download from Artery official website is the copyrighted work of Artery.
|
||||
* Artery authorizes customers to use, copy, and distribute the BSP
|
||||
* software and its related documentation for the purpose of design and
|
||||
* development in conjunction with Artery microcontrollers. Use of the
|
||||
* software is governed by this copyright notice and the following disclaimer.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED ON "AS IS" BASIS WITHOUT WARRANTIES,
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
/**
|
||||
**************************************************************************
|
||||
* @file random.h
|
||||
* @version v2.0.3
|
||||
* @date 2022-02-11
|
||||
* @version v2.0.4
|
||||
* @date 2022-04-02
|
||||
* @brief at32f413 random header file
|
||||
**************************************************************************
|
||||
* Copyright notice & Disclaimer
|
||||
*
|
||||
* The software Board Support Package (BSP) that is made available to
|
||||
* download from Artery official website is the copyrighted work of Artery.
|
||||
* Artery authorizes customers to use, copy, and distribute the BSP
|
||||
* software and its related documentation for the purpose of design and
|
||||
* development in conjunction with Artery microcontrollers. Use of the
|
||||
* The software Board Support Package (BSP) that is made available to
|
||||
* download from Artery official website is the copyrighted work of Artery.
|
||||
* Artery authorizes customers to use, copy, and distribute the BSP
|
||||
* software and its related documentation for the purpose of design and
|
||||
* development in conjunction with Artery microcontrollers. Use of the
|
||||
* software is governed by this copyright notice and the following disclaimer.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED ON "AS IS" BASIS WITHOUT WARRANTIES,
|
||||
@@ -25,7 +25,7 @@
|
||||
*/
|
||||
|
||||
#ifndef __RANDOM_H
|
||||
#define __RANDOM_H
|
||||
#define __RANDOM_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -41,12 +41,12 @@ extern "C" {
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup RTC_asseed_definition
|
||||
/** @defgroup RTC_asseed_definition
|
||||
* @{
|
||||
*/
|
||||
|
||||
/* this define rtc seed for random number gen,*/
|
||||
#define ENABLE_RTC_ASSEED (1)
|
||||
#define ENABLE_RTC_ASSEED (1)
|
||||
|
||||
/**
|
||||
* @}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
/**
|
||||
**************************************************************************
|
||||
* @file readme.txt
|
||||
* @version v2.0.3
|
||||
* @date 2022-02-11
|
||||
* @version v2.0.4
|
||||
* @date 2022-04-02
|
||||
* @brief readme
|
||||
**************************************************************************
|
||||
*/
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
/**
|
||||
**************************************************************************
|
||||
* @file at32f413_clock.c
|
||||
* @version v2.0.3
|
||||
* @date 2022-02-11
|
||||
* @version v2.0.4
|
||||
* @date 2022-04-02
|
||||
* @brief system clock config program
|
||||
**************************************************************************
|
||||
* Copyright notice & Disclaimer
|
||||
*
|
||||
* The software Board Support Package (BSP) that is made available to
|
||||
* download from Artery official website is the copyrighted work of Artery.
|
||||
* Artery authorizes customers to use, copy, and distribute the BSP
|
||||
* software and its related documentation for the purpose of design and
|
||||
* development in conjunction with Artery microcontrollers. Use of the
|
||||
* The software Board Support Package (BSP) that is made available to
|
||||
* download from Artery official website is the copyrighted work of Artery.
|
||||
* Artery authorizes customers to use, copy, and distribute the BSP
|
||||
* software and its related documentation for the purpose of design and
|
||||
* development in conjunction with Artery microcontrollers. Use of the
|
||||
* software is governed by this copyright notice and the following disclaimer.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED ON "AS IS" BASIS WITHOUT WARRANTIES,
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
/* includes ------------------------------------------------------------------*/
|
||||
#include "at32f413_clock.h"
|
||||
|
||||
|
||||
/**
|
||||
* @brief system clock config program
|
||||
* @note the system clock is configured as follow:
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
/**
|
||||
**************************************************************************
|
||||
* @file at32f413_int.c
|
||||
* @version v2.0.3
|
||||
* @date 2022-02-11
|
||||
* @version v2.0.4
|
||||
* @date 2022-04-02
|
||||
* @brief main interrupt service routines.
|
||||
**************************************************************************
|
||||
* Copyright notice & Disclaimer
|
||||
*
|
||||
* The software Board Support Package (BSP) that is made available to
|
||||
* download from Artery official website is the copyrighted work of Artery.
|
||||
* Artery authorizes customers to use, copy, and distribute the BSP
|
||||
* software and its related documentation for the purpose of design and
|
||||
* development in conjunction with Artery microcontrollers. Use of the
|
||||
* The software Board Support Package (BSP) that is made available to
|
||||
* download from Artery official website is the copyrighted work of Artery.
|
||||
* Artery authorizes customers to use, copy, and distribute the BSP
|
||||
* software and its related documentation for the purpose of design and
|
||||
* development in conjunction with Artery microcontrollers. Use of the
|
||||
* software is governed by this copyright notice and the following disclaimer.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED ON "AS IS" BASIS WITHOUT WARRANTIES,
|
||||
@@ -134,9 +134,9 @@ void SysTick_Handler(void)
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
*/
|
||||
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
/**
|
||||
**************************************************************************
|
||||
* @file main.c
|
||||
* @version v2.0.3
|
||||
* @date 2022-02-11
|
||||
* @version v2.0.4
|
||||
* @date 2022-04-02
|
||||
* @brief main program
|
||||
**************************************************************************
|
||||
* Copyright notice & Disclaimer
|
||||
*
|
||||
* The software Board Support Package (BSP) that is made available to
|
||||
* download from Artery official website is the copyrighted work of Artery.
|
||||
* Artery authorizes customers to use, copy, and distribute the BSP
|
||||
* software and its related documentation for the purpose of design and
|
||||
* development in conjunction with Artery microcontrollers. Use of the
|
||||
* The software Board Support Package (BSP) that is made available to
|
||||
* download from Artery official website is the copyrighted work of Artery.
|
||||
* Artery authorizes customers to use, copy, and distribute the BSP
|
||||
* software and its related documentation for the purpose of design and
|
||||
* development in conjunction with Artery microcontrollers. Use of the
|
||||
* software is governed by this copyright notice and the following disclaimer.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED ON "AS IS" BASIS WITHOUT WARRANTIES,
|
||||
@@ -57,10 +57,10 @@ int main(void)
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
*/
|
||||
|
||||
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
/**
|
||||
**************************************************************************
|
||||
* @file random.c
|
||||
* @version v2.0.3
|
||||
* @date 2022-02-11
|
||||
* @version v2.0.4
|
||||
* @date 2022-04-02
|
||||
* @brief set of firmware functions to random function
|
||||
**************************************************************************
|
||||
* Copyright notice & Disclaimer
|
||||
*
|
||||
* The software Board Support Package (BSP) that is made available to
|
||||
* download from Artery official website is the copyrighted work of Artery.
|
||||
* Artery authorizes customers to use, copy, and distribute the BSP
|
||||
* software and its related documentation for the purpose of design and
|
||||
* development in conjunction with Artery microcontrollers. Use of the
|
||||
* The software Board Support Package (BSP) that is made available to
|
||||
* download from Artery official website is the copyrighted work of Artery.
|
||||
* Artery authorizes customers to use, copy, and distribute the BSP
|
||||
* software and its related documentation for the purpose of design and
|
||||
* development in conjunction with Artery microcontrollers. Use of the
|
||||
* software is governed by this copyright notice and the following disclaimer.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED ON "AS IS" BASIS WITHOUT WARRANTIES,
|
||||
@@ -27,7 +27,7 @@
|
||||
#include "at32f413_board.h"
|
||||
#include "random.h"
|
||||
#include "stdio.h"
|
||||
#include <stdlib.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
/** @addtogroup UTILITIES_examples
|
||||
* @{
|
||||
@@ -49,7 +49,7 @@ int get_uid_for_seed (void)
|
||||
{
|
||||
uint32_t id[3] = {0};
|
||||
uint32_t uid_one_word;
|
||||
|
||||
|
||||
/* get uid */
|
||||
id[0] = *(int*)DEVICE_ID_ADDR1;
|
||||
id[2] = *(int*)(DEVICE_ID_ADDR1+8);
|
||||
@@ -68,22 +68,22 @@ void rtc_init_for_seed (void)
|
||||
/* enable pwc and bpr clocks */
|
||||
crm_periph_clock_enable(CRM_PWC_PERIPH_CLOCK, TRUE);
|
||||
crm_periph_clock_enable(CRM_BPR_PERIPH_CLOCK, TRUE);
|
||||
|
||||
|
||||
/* allow access to bpr domain */
|
||||
pwc_battery_powered_domain_access(TRUE);
|
||||
|
||||
if (bpr_data_read(BPR_DATA1) != 0x5051)
|
||||
{
|
||||
|
||||
if (bpr_data_read(BPR_DATA1) != 0x5051)
|
||||
{
|
||||
/* reset bpr domain */
|
||||
bpr_reset();
|
||||
|
||||
|
||||
/* enable the lext osc */
|
||||
crm_clock_source_enable(CRM_CLOCK_SOURCE_LEXT, TRUE);
|
||||
/* wait lext is ready */
|
||||
while(crm_flag_get(CRM_LEXT_STABLE_FLAG) == RESET);
|
||||
/* select the rtc clock source */
|
||||
crm_rtc_clock_select(CRM_RTC_CLOCK_LEXT);
|
||||
|
||||
|
||||
/* enable rtc clock */
|
||||
crm_rtc_clock_enable(TRUE);
|
||||
|
||||
@@ -92,10 +92,10 @@ void rtc_init_for_seed (void)
|
||||
|
||||
/* wait for the register write to complete */
|
||||
rtc_wait_config_finish();
|
||||
|
||||
|
||||
/* set rtc divider: set rtc period to 1sec */
|
||||
rtc_divider_set(32767);
|
||||
|
||||
|
||||
/* wait for the register write to complete */
|
||||
rtc_wait_config_finish();
|
||||
|
||||
@@ -108,11 +108,11 @@ void rtc_init_for_seed (void)
|
||||
rtc_wait_update_finish();
|
||||
|
||||
/* wait for the register write to complete */
|
||||
rtc_wait_config_finish();
|
||||
rtc_wait_config_finish();
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief random number test
|
||||
@@ -121,12 +121,12 @@ void rtc_init_for_seed (void)
|
||||
*/
|
||||
void randnum_test( void)
|
||||
{
|
||||
#if ENABLE_RTC_ASSEED
|
||||
#if ENABLE_RTC_ASSEED
|
||||
rtc_init_for_seed();
|
||||
|
||||
/* set uid and rtc as seed for random */
|
||||
srand(rtc_counter_get()+get_uid_for_seed());
|
||||
#else
|
||||
|
||||
/* set uid and rtc as seed for random */
|
||||
srand(rtc_counter_get()+get_uid_for_seed());
|
||||
#else
|
||||
/* set only uid as seed for random */
|
||||
srand(get_uid_for_seed());
|
||||
#endif
|
||||
@@ -135,13 +135,13 @@ void randnum_test( void)
|
||||
{
|
||||
delay_ms(500);
|
||||
printf("%d\r\n",rand());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user