void delay_us(uint16_t Nus){ uint8_t i = 32; while(Nus--){ while(i--) ; } } /*! * [url=home.php?mod=space&uid=247401]@brief[/url] main函数 * * @param none * [url=home.php?mod=space&uid=266161]@return[/url] int */ int main(void) { InitDelay(); InitDebug(); GPIO_LedInit(); GPIO_KeyInit(); TIMER_PrdInit(); printf("Hi This is GPIO Basic Demo !\r\n"); uint32_t i = 0; while (1) { //GPIO_ScanKeyInput(); //GPIO_ToggleLedPrd(); for(i = 0; i < 200; i++){ LED1_OFF; LED2_OFF; delay_us(i); LED1_ON;LED2_ON;delay_us(200-i); } for(i = 0; i < 200; i++){ LED1_ON;LED2_ON;delay_us(i); LED1_OFF;LED2_OFF;delay_us(200-i); } } } 代码目录结构: 复制M:\AUTOCHIP\01_GPIO_BASIC │ demo.uvguix.yshu │ demo.uvoptx │ demo.uvprojx │ EventRecorderStub.scvd │ JLinkLog.txt │ JLinkSettings.ini │ ├─Listings │ Demo.map │ startup_ac7802x.lst │ ├─Objects │ ac7802x_debugout.crf │ ac7802x_debugout.d │ ac7802x_debugout.o │ ac780x_ckgen.crf │ ac780x_ckgen.d │ ac780x_ckgen.o │ ac780x_eflash.crf │ ac780x_eflash.d │ ac780x_eflash.o │ ac780x_gpio.crf │ ac780x_gpio.d │ ac780x_gpio.o │ ac780x_pwm.crf │ ac780x_pwm.d │ ac780x_pwm.o │ ac780x_spm.crf │ ac780x_spm.d │ ac780x_spm.o │ ac780x_timer.crf │ ac780x_timer.d │ ac780x_timer.o │ ac780x_uart.crf │ ac780x_uart.d │ ac780x_uart.o │ Demo.axf │ Demo.build_log.htm │ Demo.htm │ Demo.lnp │ Demo.sct │ demo_Demo.dep │ ExtDll.iex │ gpio.crf │ gpio.d │ gpio.o │ main.crf │ main.d │ main.o │ startup_ac7802x.d │ startup_ac7802x.o │ system_ac7802x.crf │ system_ac7802x.d │ system_ac7802x.o │ timer.crf │ timer.d │ timer.o │ ├─RTE │ ├─Board_Support │ │ └─AC78022MBQA │ │ ac7802x_debugout.c │ │ │ ├─Device │ │ └─AC78022MBQA │ │ device_assert.h │ │ startup_ac7802x.s │ │ system_ac7802x.c │ │ system_ac7802x.h │ │ │ └─_Demo │ RTE_Components.h │ └─User gpio.c gpio.h main.c timer.c timer.h 效果展示:
M:\AUTOCHIP\01_GPIO_BASIC │ demo.uvguix.yshu │ demo.uvoptx │ demo.uvprojx │ EventRecorderStub.scvd │ JLinkLog.txt │ JLinkSettings.ini │ ├─Listings │ Demo.map │ startup_ac7802x.lst │ ├─Objects │ ac7802x_debugout.crf │ ac7802x_debugout.d │ ac7802x_debugout.o │ ac780x_ckgen.crf │ ac780x_ckgen.d │ ac780x_ckgen.o │ ac780x_eflash.crf │ ac780x_eflash.d │ ac780x_eflash.o │ ac780x_gpio.crf │ ac780x_gpio.d │ ac780x_gpio.o │ ac780x_pwm.crf │ ac780x_pwm.d │ ac780x_pwm.o │ ac780x_spm.crf │ ac780x_spm.d │ ac780x_spm.o │ ac780x_timer.crf │ ac780x_timer.d │ ac780x_timer.o │ ac780x_uart.crf │ ac780x_uart.d │ ac780x_uart.o │ Demo.axf │ Demo.build_log.htm │ Demo.htm │ Demo.lnp │ Demo.sct │ demo_Demo.dep │ ExtDll.iex │ gpio.crf │ gpio.d │ gpio.o │ main.crf │ main.d │ main.o │ startup_ac7802x.d │ startup_ac7802x.o │ system_ac7802x.crf │ system_ac7802x.d │ system_ac7802x.o │ timer.crf │ timer.d │ timer.o │ ├─RTE │ ├─Board_Support │ │ └─AC78022MBQA │ │ ac7802x_debugout.c │ │ │ ├─Device │ │ └─AC78022MBQA │ │ device_assert.h │ │ startup_ac7802x.s │ │ system_ac7802x.c │ │ system_ac7802x.h │ │ │ └─_Demo │ RTE_Components.h │ └─User gpio.c gpio.h main.c timer.c timer.h 效果展示:
收藏0 举报
本版积分规则 发表回复 回帖并转播 回帖后跳转到最后一页
69
293
2
扫码关注 21ic 官方微信
扫码关注嵌入式微处理器
扫码关注电源系统设计
扫码关注21ic项目外包
扫码浏览21ic手机版
本站介绍 | 申请友情链接 | 欢迎投稿 | 隐私声明 | 广告业务 | 网站地图 | 联系我们 | 诚聘英才
京公网安备 11010802024343号