• 大小: 7.34MB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-09-26
  • 语言: 其他
  • 标签: AC1090  AC1505C  源码  

资源简介

AC1090杰里源码,AC1505C源码

资源截图

代码片段和文件信息

/*--------------------------------------------------------------------------*/
/**@file    clock.c
   @brief   时钟模块接口函数
   @details
   @author  bingquan Cai
   @date    2012-8-30
   @note    AC109N
*/
/*----------------------------------------------------------------------------*/

#include “clock.h“
#include “main.h“
#include “RTC_API.h“
#include “IRTC.h“
#include “iic.h“
#include “dac.h“

_no_init u16 _data pll_nrpll_nf;
_no_init u8 _data system_clk;

/*----------------------------------------------------------------------------*/
/** @brief: P05 输出控制函数
    @param: cfg:输出各种时钟
    @return:void
    @author:Juntham
    @note:  void P05_config(u8 cfg)
*/
/*----------------------------------------------------------------------------*/
_near_func void P05_config(u8 cfg) AT(COMMON_CODE)
{
    u8 temp;
    
    if (cfg == P05_NORMAL_IO)
    {
        CLK_CON2 &= ~BIT(4);
    }
    else
    {
        temp = CLK_CON2 & 0xf3;
        CLK_CON2 = temp | cfg | BIT(4);
        //P0HD |= BIT(5);
        P0DIR &= ~BIT(5);
    }
}
/*----------------------------------------------------------------------------*/
/** @brief: HTC 模块控制函数
    @param: on_off:开/关控制位
    @return:void
    @author:Juntham
    @note:  void htc_control(bool on_off)
*/
/*----------------------------------------------------------------------------*/
_near_func static void htc_control(bool on_off) AT(COMMON_CODE)
{
    if (on_off)
    {
        HTC_CON |=  BIT(6)|BIT(5);
        HTC_CON &=  ~BIT(7);
        delay8(100);
        HTC_CON |=  BIT(7);
    }
    else
    {
        HTC_CON &=  ~BIT(7);
        HTC_CON &=  ~BIT(6);
    }
}

/*----------------------------------------------------------------------------*/
/** @brief: PLL 系数配置
    @param: nr:PLL 参数
    @param: nf:PLL 参数
    @return:void
    @author:Juntham
    @note:  void pll_nrnf_cfg(u16 nr u16 nf)
*/
/*----------------------------------------------------------------------------*/
_near_func void pll_nrnf_cfg(u16 nr u16 nf) AT(COMMON_CODE)
{
    pll_nr = nr;        //14bit有效
    pll_nf = nf;        //10bit有效
    
    PLL_CON2 = pll_nf >> 2;
    PLL_CON1 = ((pll_nf & 0x03) << 6) | (pll_nr >> 8);
    PLL_CON0 = pll_nr & 0xff;
    delay8(200);
}

/*----------------------------------------------------------------------------*/
/** @brief: PLL输入时钟选择
    @param: 0:32768(RTC) 1:HTC 2:1M~24M(RTC)3:1M~24M(P00P01)
    @return:void
    @author:Juntham
    @note:  void pll_in_sel(u8 sel)
*/
/*----------------------------------------------------------------------------*/
_near_func static void pll_in_sel(u8 sel) AT(COMMON_CODE)
{
    u8 tmp = CLK_CON0;
    
    tmp &= ~(BIT(4) | BIT(5));
    tmp |= sel;
    CLK_CON0 = tmp;        //config PLL enable PLL
}

/*----------------------------------------------------------------------------*/
/** @brief: PLL开关
    @param: 0:关闭PLL,1:打开PLL
    @return:
    @author:Juntham
    @note:  void pll

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

     文件      76804  2013-09-06 14:00  AC109N_SDKv320_Release\AC109N SDK  v320 更新版本说明.pdf

     文件       4027  2013-09-02 14:27  AC109N_SDKv320_Release\AC109N_SDK\Debug\Obj\SDK_AC109N.pbd

     文件      24576  2013-09-02 14:27  AC109N_SDKv320_Release\AC109N_SDK\Hex.exe

     文件      28672  2013-09-02 14:27  AC109N_SDKv320_Release\AC109N_SDK\link_hex2L\bsp.exe

     文件        121  2013-09-02 14:27  AC109N_SDKv320_Release\AC109N_SDK\link_hex2L\download.bat

     文件        655  2013-09-02 14:27  AC109N_SDKv320_Release\AC109N_SDK\link_hex2L\image.cfg

     文件       1616  2013-09-06 13:56  AC109N_SDKv320_Release\AC109N_SDK\link_hex2L\info.txt

     文件      40960  2013-09-02 14:27  AC109N_SDKv320_Release\AC109N_SDK\link_hex2L\isd_download.exe

     文件        104  2013-09-02 14:27  AC109N_SDKv320_Release\AC109N_SDK\link_hex2L\make.bat

     文件      45056  2013-09-02 14:27  AC109N_SDKv320_Release\AC109N_SDK\link_hex2L\Maker.exe

     文件     126832  2013-09-02 14:27  AC109N_SDKv320_Release\AC109N_SDK\link_hex2L\myoutotp.bin.fw

     文件      28672  2013-09-02 14:27  AC109N_SDKv320_Release\AC109N_SDK\link_hex6L\bsp.exe

     文件        111  2013-09-02 14:27  AC109N_SDKv320_Release\AC109N_SDK\link_hex6L\download.bat

     文件        655  2013-09-02 14:27  AC109N_SDKv320_Release\AC109N_SDK\link_hex6L\image.cfg

     文件       1616  2013-09-06 13:56  AC109N_SDKv320_Release\AC109N_SDK\link_hex6L\info.txt

     文件      40960  2013-09-02 14:27  AC109N_SDKv320_Release\AC109N_SDK\link_hex6L\isd_download.exe

     文件         69  2013-09-02 14:27  AC109N_SDKv320_Release\AC109N_SDK\link_hex6L\make.bat

     文件      45056  2013-09-02 14:27  AC109N_SDKv320_Release\AC109N_SDK\link_hex6L\Maker.exe

     文件      64608  2014-02-13 09:51  AC109N_SDKv320_Release\AC109N_SDK\link_hex6L\myoutotp.bin.fw

     文件        158  2013-09-02 14:27  AC109N_SDKv320_Release\AC109N_SDK\make_debug.bat

     文件        115  2013-09-06 08:57  AC109N_SDKv320_Release\AC109N_SDK\make_lib_debug.bat

     文件        114  2013-09-06 08:57  AC109N_SDKv320_Release\AC109N_SDK\make_lib_release.bat

     文件        156  2013-09-02 14:27  AC109N_SDKv320_Release\AC109N_SDK\make_release.bat

     文件       6271  2014-02-13 09:51  AC109N_SDKv320_Release\AC109N_SDK\Release\List\adc_page.lst

     文件       6013  2014-02-13 09:51  AC109N_SDKv320_Release\AC109N_SDK\Release\List\adc_page.s51

     文件     307003  2014-02-13 09:51  AC109N_SDKv320_Release\AC109N_SDK\Release\List\app.map

     文件      26497  2014-02-13 09:51  AC109N_SDKv320_Release\AC109N_SDK\Release\List\break_point.lst

     文件      17547  2014-02-13 09:51  AC109N_SDKv320_Release\AC109N_SDK\Release\List\break_point.s51

     文件      10321  2014-02-13 09:51  AC109N_SDKv320_Release\AC109N_SDK\Release\List\cd002.lst

     文件       9233  2014-02-13 09:51  AC109N_SDKv320_Release\AC109N_SDK\Release\List\cexit.lst

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

评论

共有 条评论