• 大小: 8.53M
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2024-06-14
  • 语言: C/C++
  • 标签: 技术  

资源简介

SKY6610T 是一款超低功耗,ARM Cortex M0内核,flash高达128KB,10KB sram的高性价比mcu,附件资料可满足嵌入式工程师学习和开发需要

资源截图

代码片段和文件信息

/******************************************************************************
 * @Filename     : system_SKY6610T.c
 *
 * @Version      : V1.0
 * @Subversion   : $
 * @Last modified: 02/20/2017 9:12:34
 * @Modified by  : Chen Bo
 *
 * @Brief        :
 *
 * Copyright (C) 2017 SKYRELAY Technology co.Ltd All rights reserved.
 *****************************************************************************/

#include 
#include “SKY6610T.h“

uint32_t cpu_clk     = SYS_CLK;   //33MHz
uint32_t hclk        = (SYS_CLK / 4);
uint32_t pclk        = (SYS_CLK / 8);
uint32_t iclk        = (SYS_CLK / 2);
uint32_t wdt_clk     = WDT_CLK;
uint32_t rtc_clk     = RTC_CLK;

uint32_t Caliber_Sysclk(void)
{
    uint32_t cpu_clk;
    uint32_t clb_val;
    uint32_t dsrc_en = 0;
    dsrc_en = ((SYSC->CLK_EN) & (SYSC_DSRC_EN_Msk));
    if (dsrc_en == 0)
    {
        SYSC->CLK_EN |= SYSC_DSRC_EN_Msk;         //enable dsrc module
    }
    SW_Delay_us(2000);
    DSRC->DSRC_WAKEUP5 &= ~BIT2;
    SYSC->CALIB |= SYSC_CALIB_TRIGER_Msk;         //start caliber
    SW_Delay_us(10);                              //wait 10us
    clb_val = (SYSC->CALIB &= SYSC_CALIB_OUT_Msk);
    cpu_clk = 128000 * clb_val;
    if (dsrc_en == 0)
    {
        SYSC->CLK_EN &= ~SYSC_DSRC_EN_Msk;        //disable dsrc module
    }
    return cpu_clk;
}

uint32_t Caliber_32K_RC(void)
{
    uint32_t cnt_val;
    uint32_t ret_val;
    WDT_Reset();
    SysTick->LOAD = 0xffffff;
    SysTick->VAL  = 0;
    WDT_Open(100 DIS_INTR);
    SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk | SysTick_CTRL_ENABLE_Msk;
    while (!WDT_GET_INT_FLAG);
    cnt_val = SysTick->VAL;
    WDT_Reset();
    ret_val = (hclk * 16 / ((0xffffff - cnt_val) + 1)) * 100; //16---WDT count 16 step every counter value
    return ret_val;
}

uint32_t SysGet_HCLKFreq(void)
{
    return ((cpu_clk * (((SYSC->CLK_DIV & SYSC_CPU_CLK_MULTI_Msk) >> SYSC_CPU_CLK_MULTI_Pos) + 1)) / ((SYSC->CLK_DIV & SYSC_CPU_CLK_DIV_Msk) + 1));
}

//num < 100
void System_Clock_Update(void)
{
    cpu_clk     = Caliber_Sysclk();
    hclk        = SysGet_HCLKFreq();
    pclk        = (hclk / 2);
    iclk        = (cpu_clk / 2);
}

void Set_SysClk(uint8_t u8Mul uint8_t u8Div)
{
    SET_SYSC_CLK(u8Mul u8Div);
    System_Clock_Update();
}

void System_Reset(void)
{
    SYSC->RST &= (~SYSC_SYS_SRSTN_Msk);
    SYSC->RST |= SYSC_SYS_SRSTN_Msk;
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件      12756  2019-05-15 17:11  sw\FlashConifg\SKY6610T_Flash.flm

     文件       1227  2019-05-13 11:42  sw\SKY6610T_startup_cm0\Library\CMSIS\Include\arm_common_tables.h

     文件     255867  2019-05-13 11:42  sw\SKY6610T_startup_cm0\Library\CMSIS\Include\arm_math.h

     文件      32139  2019-05-13 11:42  sw\SKY6610T_startup_cm0\Library\CMSIS\Include\core_cm0.h

     文件      39428  2019-05-13 11:42  sw\SKY6610T_startup_cm0\Library\CMSIS\Include\core_cm0plus.h

     文件      98950  2019-05-13 11:42  sw\SKY6610T_startup_cm0\Library\CMSIS\Include\core_cm3.h

     文件     108260  2019-05-13 11:42  sw\SKY6610T_startup_cm0\Library\CMSIS\Include\core_cm4.h

     文件      21323  2019-05-13 11:42  sw\SKY6610T_startup_cm0\Library\CMSIS\Include\core_cm4_simd.h

     文件      15924  2019-05-13 11:42  sw\SKY6610T_startup_cm0\Library\CMSIS\Include\core_cmFunc.h

     文件      17305  2019-05-13 11:42  sw\SKY6610T_startup_cm0\Library\CMSIS\Include\core_cmInstr.h

     文件      40737  2019-05-13 11:42  sw\SKY6610T_startup_cm0\Library\CMSIS\Include\core_sc000.h

     文件      97329  2019-05-13 11:42  sw\SKY6610T_startup_cm0\Library\CMSIS\Include\core_sc300.h

     文件     103050  2019-07-20 17:57  sw\SKY6610T_startup_cm0\Library\Device\SkyRelay\SKY6610T\Include\SKY6610T.h

     文件       2050  2019-07-20 17:57  sw\SKY6610T_startup_cm0\Library\Device\SkyRelay\SKY6610T\Include\system_SKY6610T.h

     文件       7837  2019-05-14 11:54  sw\SKY6610T_startup_cm0\Library\Device\SkyRelay\SKY6610T\Source\ARM\startup_SKY6610T.s

     文件       2452  2019-05-14 11:54  sw\SKY6610T_startup_cm0\Library\Device\SkyRelay\SKY6610T\Source\system_SKY6610T.c

     文件       2799  2019-05-14 11:07  sw\SKY6610T_startup_cm0\Library\StdDriver\Include\adc.h

     文件        829  2019-05-14 11:07  sw\SKY6610T_startup_cm0\Library\StdDriver\Include\delay.h

     文件       6867  2019-05-13 11:42  sw\SKY6610T_startup_cm0\Library\StdDriver\Include\dsrc.h

     文件       3404  2019-05-14 11:07  sw\SKY6610T_startup_cm0\Library\StdDriver\Include\efc.h

     文件      19489  2019-05-14 11:07  sw\SKY6610T_startup_cm0\Library\StdDriver\Include\gpio.h

     文件       3776  2019-07-20 17:57  sw\SKY6610T_startup_cm0\Library\StdDriver\Include\pmu.h

     文件       4414  2019-05-14 11:07  sw\SKY6610T_startup_cm0\Library\StdDriver\Include\pwm.h

     文件       4620  2019-05-14 11:07  sw\SKY6610T_startup_cm0\Library\StdDriver\Include\qtimer.h

     文件       1287  2019-07-20 17:57  sw\SKY6610T_startup_cm0\Library\StdDriver\Include\rtc.h

     文件       1913  2019-05-14 11:07  sw\SKY6610T_startup_cm0\Library\StdDriver\Include\sm4.h

     文件       7948  2019-05-14 11:07  sw\SKY6610T_startup_cm0\Library\StdDriver\Include\spi.h

     文件      10627  2019-05-14 11:07  sw\SKY6610T_startup_cm0\Library\StdDriver\Include\tag.h

     文件       3622  2019-05-14 11:07  sw\SKY6610T_startup_cm0\Library\StdDriver\Include\uart.h

     文件      10655  2019-05-14 11:07  sw\SKY6610T_startup_cm0\Library\StdDriver\Include\usart.h

............此处省略85个文件信息

评论

共有 条评论