请选择 进入手机版 | 继续访问电脑版
查看: 1007|回复: 0

[原创] 如何在KEIL上基于LPC55S69上部署arm2D!(看完也没惊喜~_~)

[复制链接]
  • TA的每日心情
    奋斗
    11 小时前
  • 签到天数: 1912 天

    [LV.Master]伴坛终老

    61

    主题

    1万

    帖子

    3

    版主

    Rank: 7Rank: 7Rank: 7

    积分
    16999
    最后登录
    2024-3-29
    发表于 2022-6-29 21:51:57 | 显示全部楼层 |阅读模式
    本帖最后由 流水源 于 2022-6-29 21:53 编辑

        首先安装下面2个KEIL PACK包。一个ARM2D,一个perf_counter。
    1.png

       其次以一个带LCD的可以正常绘图的例程为基础,开始添加ARM2D。
    如下图添加ARM2D。
    A1.png

    如下图添加perf_counter。
    3.png


    再就是CMSIS包,需要添加DSP库。
    4.png


    添加pack完成后的样子。

    A2.png

    下一步配置ARM2D的arm2d_cfg.h和disp lcd的
    7.png 13.png

    下面lcd驱动函数实现下图的绘图函数。
    8.png 10.png


    用户应用文件添加相关头文件。
    9.png

    然后主函数添加初始化。
    11.png

    用户文件添加时间测量函数

    1. /*============================ IMPLEMENTATION ================================*/
    2. static int64_t s_lTimestap;

    3. __OVERRIDE_WEAK
    4. void arm_2d_helper_perf_counter_start(void)
    5. {
    6.     s_lTimestap = get_system_ticks();
    7. }

    8. __OVERRIDE_WEAK
    9. int32_t arm_2d_helper_perf_counter_stop(void)
    10. {
    11.     return (int32_t)(get_system_ticks() - s_lTimestap);
    12. }

    复制代码
    1. #include "stdio.h"
    2. #include "fsl_device_registers.h"
    3. #include "fsl_debug_console.h"
    4. #include "pin_mux.h"
    5. #include "clock_config.h"
    6. #include "board.h"
    7. #include "peripherals.h"
    8. #include "fsl_power.h"

    9. #include "lcd_driver.h"
    10. #include "arm_2d.h"
    11. #include "arm_2d_helper.h"
    12. #include "perf_counter.h"
    13. #include "arm_2d_disp_adapter_0.h"
    14. /*******************************************************************************
    15. * Definitions
    16. ******************************************************************************/

    17. //static const uint8_t c_bmpClockFace[];

    18. /*******************************************************************************
    19. * Prototypes
    20. ******************************************************************************/
    21. void SysTick_Handler(void)
    22. {
    23.    
    24. }

    25. int fputc(int ch,FILE *f)
    26. {
    27.         return ch;
    28. }
    29. /*============================ IMPLEMENTATION ================================*/
    30. static int64_t s_lTimestap;

    31. __OVERRIDE_WEAK
    32. void arm_2d_helper_perf_counter_start(void)
    33. {
    34.     s_lTimestap = get_system_ticks();
    35. }

    36. __OVERRIDE_WEAK
    37. int32_t arm_2d_helper_perf_counter_stop(void)
    38. {
    39.     return (int32_t)(get_system_ticks() - s_lTimestap);
    40. }


    41. /*!
    42. * @brief Main function
    43. */
    44. int main(void)
    45. {
    46.     char ch;
    47.     /* Init board hardware. */
    48.     /* set BOD VBAT level to 1.65V */
    49.     POWER_SetBodVbatLevel(kPOWER_BodVbatLevel1650mv, kPOWER_BodHystLevel50mv, false);
    50.     /* attach main clock divide to FLEXCOMM0 (debug console) */
    51.     CLOCK_AttachClk(BOARD_DEBUG_UART_CLK_ATTACH);
    52.         
    53.     BOARD_InitBootPins();
    54.     BOARD_InitBootClocks();
    55.     BOARD_InitBootPeripherals();
    56.     BOARD_InitDebugConsole();
    57.    
    58.     SysTick_Config(SystemCoreClock/1000);
    59.     init_cycle_counter(true);   //初始化  perf_counter
    60.    
    61.     lcd_init(); //LCD初始化
    62.     PRINTF("hello world.\r\n");
    63. //    Disp0_DrawBitmap(0,0,200,190,c_bmpClockFace);    //测试LCD绘图函数。
    64.    
    65.     arm_irq_safe {
    66.         arm_2d_init(); // 初始化 arm-2d
    67.     }
    68.     // 初始化 Display Adapter 0
    69.     disp_adapter0_init();
    70.    
    71.     while (1)
    72.     {
    73.         disp_adapter0_task();
    74. //        ch = GETCHAR();
    75. //        PUTCHAR(ch);
    76.     }
    77. }
    复制代码


    编译,下载
    12.png

    下载 后的效果
    A3.jpg





    5.png
    6.png
    该会员没有填写今日想说内容.
    回复

    使用道具 举报

    您需要登录后才可以回帖 注册/登录

    本版积分规则

    关闭

    站长推荐上一条 /4 下一条

    Archiver|手机版|小黑屋|恩智浦技术社区

    GMT+8, 2024-3-29 20:51 , Processed in 0.122445 second(s), 20 queries , MemCache On.

    Powered by Discuz! X3.4

    Copyright © 2001-2021, Tencent Cloud.

    快速回复 返回顶部 返回列表