[DemoCode下载] 采用 PlatformIO 的 N76E003开发示例

[复制链接]
921|0
 楼主| dongnanxibei 发表于 2024-6-23 20:48 | 显示全部楼层 |阅读模式
n76e003_platformio-main.zip (21.76 KB, 下载次数: 0)
  1. /*
  2. * N76E003 GPIOs toggle.
  3. *
  4. * arad.rgb@gmail.com
  5. */
  6. #include "N76E003.h"
  7. #include "SFR_Macro.h"
  8. #include "Function_define.h"
  9. #include "Common.h"
  10. #include "Delay.h"

  11. void main(void)
  12. {
  13.         Set_All_GPIO_Quasi_Mode;        // Reset all GPIOs to inputs

  14.         P0M1 = P1M1 = 0x00;                        // set P0.0-P0.7 and P1.0-P1.7 GPIOs to PushPull
  15.         P0M2 = P1M2 = 0xff;

  16.         P30_PushPull_Mode;                        // set P3.0 to PushPull

  17.         while(1) {                                        // Toggle GPIOs every 100ms
  18.                 P0 ^= 0xff;
  19.                 P1 = ~P1;
  20.                 P30 = !P30;
  21.                 Timer0_Delay1ms(1000);
  22.         }
  23. }
  1. [platformio]
  2. default_envs = n76e003

  3. [env:n76e003]
  4. platform_packages = platformio/tool-stcgal@^1.110.0 ; may not work for linux
  5. platform = https://github.com/arduino12/platform-intel_mcs51.git
  6. board = n76e003
  7. build_flags = -DFOSC_160000
  8. upload_protocol = custom
  9. extra_scripts = extra_script.py


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

本版积分规则

225

主题

3848

帖子

18

粉丝
快速回复 在线客服 返回列表 返回顶部