• 大小: 7.05MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-09-24
  • 语言: 其他
  • 标签: K60;OLED;  

资源简介

飞思卡尔智能车设计大赛基于K60的OLED显示程序,用IAR进行编程。

资源截图

代码片段和文件信息

//-------------------------------------------------------------------------*
// 文件名:start.c                                                          *
// 说  明: CPU启动后进行系统配置                                           *
//-------------------------------------------------------------------------*

//头文件
#include “common.h“
#include “wdog.h“
//#include “sysinit.h“

#pragma section = “.data“
#pragma section = “.data_init“
#pragma section = “.bss“
#pragma section = “CodeRelocate“
#pragma section = “CodeRelocateRam“ 

//内部函数声明
//-------------------------------------------------------------------------*
//函数名: common_startup                                                   *
//功  能: 复制中断向量表到RAM中                                            * 
//参  数: 无    *
//说  明: 将ROM中的初始化数据拷贝到RAM中                                   *
//-------------------------------------------------------------------------*
void common_startup(void);

//-------------------------------------------------------------------------*
//函数名: start                                                            *
//功  能: 系统启动                                                         * 
//参  数: 无    *
//说  明: 无                                                               *
//-------------------------------------------------------------------------*
void start(void)
{
    //关闭看门狗
    wdog_disable();
    //复制中断向量表到RAM中
    common_startup();
    //进入主函数
    main();
}


//-------------------------------------------------------------------------*
//函数名: common_startup                                                   *
//功  能: 复制中断向量表到RAM中                                            * 
//参  数: 无    *
//说  明: 将ROM中的初始化数据拷贝到RAM中                                   *
//-------------------------------------------------------------------------*
void common_startup(void)
{
    /* Declare a counter we‘ll use in all of the copy loops */
    uint32 n;
 
 
    /* Addresses for VECTOR_TABLE and VECTOR_RAM come from the linker file */  
    extern uint32 __VECTOR_TABLE[];
    extern uint32 __VECTOR_RAM[];

    /* Copy the vector table to RAM */
    if (__VECTOR_RAM != __VECTOR_TABLE)
    {
        for (n = 0; n < 0x410; n++)
            __VECTOR_RAM[n] = __VECTOR_TABLE[n];
    }
    /* Point the VTOR to the new copy of the vector table */
    write_vtor((uint32)__VECTOR_RAM);    
    
    /* Get the addresses for the .data section (initialized data section) */
    uint8* data_ram = __section_begin(“.data“);
    uint8* data_rom = __section_begin(“.data_init“);
    uint8* data_rom_end = __section_end(“.data_init“);
    
    /* Copy initialized data from ROM to RAM */
    n = data_rom_end - data_rom;
    while (n--)
      *data_ram++ = *data_rom++;
 
 
    /* Get the addresses for the .bss section (zero-initialized data) */
    uint8* bss_start = __section_begin(“.bss“);
    uint8* bss_end = __section_end(“.bss“

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2017-12-08 20:12  LQ_K60_OLED\
     目录           0  2017-12-08 20:11  LQ_K60_OLED\Debug\
     目录           0  2017-12-08 20:13  LQ_K60_OLED\Debug\Exe\
     文件      146556  2017-12-08 20:13  LQ_K60_OLED\Debug\Exe\c.out
     文件       15411  2017-12-08 20:13  LQ_K60_OLED\Debug\Exe\c.sim
     文件       15368  2017-12-08 20:13  LQ_K60_OLED\Debug\Exe\LQ_K60.bin
     目录           0  2017-12-08 20:11  LQ_K60_OLED\Debug\List\
     目录           0  2017-12-08 20:13  LQ_K60_OLED\Debug\Obj\
     文件       17331  2017-12-08 20:12  LQ_K60_OLED\Debug\Obj\ADC.o
     文件      930549  2017-12-08 20:11  LQ_K60_OLED\Debug\Obj\ADC.pbi
     文件       11224  2017-12-08 20:11  LQ_K60_OLED\Debug\Obj\ADC.pbi.cout
     文件       16102  2017-12-08 20:12  LQ_K60_OLED\Debug\Obj\common.o
     文件      927600  2017-12-08 20:11  LQ_K60_OLED\Debug\Obj\common.pbi
     文件       11227  2017-12-08 20:11  LQ_K60_OLED\Debug\Obj\common.pbi.cout
     文件        1975  2017-12-08 20:12  LQ_K60_OLED\Debug\Obj\crt0.o
     文件        9616  2017-12-08 20:12  LQ_K60_OLED\Debug\Obj\DAC.o
     文件      926657  2017-12-08 20:11  LQ_K60_OLED\Debug\Obj\DAC.pbi
     文件       11224  2017-12-08 20:11  LQ_K60_OLED\Debug\Obj\DAC.pbi.cout
     文件       20375  2017-12-08 20:12  LQ_K60_OLED\Debug\Obj\DMA.o
     文件      934790  2017-12-08 20:11  LQ_K60_OLED\Debug\Obj\DMA.pbi
     文件       11224  2017-12-08 20:11  LQ_K60_OLED\Debug\Obj\DMA.pbi.cout
     文件       24772  2017-12-08 20:12  LQ_K60_OLED\Debug\Obj\FTM.o
     文件      944906  2017-12-08 20:11  LQ_K60_OLED\Debug\Obj\FTM.pbi
     文件       11224  2017-12-08 20:11  LQ_K60_OLED\Debug\Obj\FTM.pbi.cout
     文件       31270  2017-12-08 20:12  LQ_K60_OLED\Debug\Obj\GPIO.o
     文件      931865  2017-12-08 20:11  LQ_K60_OLED\Debug\Obj\GPIO.pbi
     文件       11225  2017-12-08 20:11  LQ_K60_OLED\Debug\Obj\GPIO.pbi.cout
     文件       16582  2017-12-08 20:12  LQ_K60_OLED\Debug\Obj\I2C.o
     文件      932608  2017-12-08 20:12  LQ_K60_OLED\Debug\Obj\I2C.pbi
     文件       11224  2017-12-08 20:12  LQ_K60_OLED\Debug\Obj\I2C.pbi.cout
     文件       28362  2017-12-08 20:12  LQ_K60_OLED\Debug\Obj\Lptmr.o
............此处省略101个文件信息

评论

共有 条评论

相关资源