小菜最近在看TFTLCD液晶屏模块,对于快速IO和慢速IO很是不解。为什么只是赋值方式的不同,速度就相差一倍呢?
俺也都不到答案,特来麻烦论坛的朋友了。求详细解答,最好能从硬件的实现角度来分析有什么不同。谢谢大家。
/*********************************华丽的分割线**************************************/
//如果使用快速IO,则定义下句,如果不使用,则去掉即可!
//使用快速IO,刷屏速率可以达到28帧每秒!
//普通IO,只能14帧每秒!
#if LCD_FAST_IO==1 //快速IO
#define LCD_CS_SET GPIOC->BSRR=1<<9 //片选端口 PC9
#define LCD_RS_SET GPIOC->BSRR=1<<8 //数据/命令 PC8
#define LCD_WR_SET GPIOC->BSRR=1<<7 //写数据 PC7
#define LCD_RD_SET GPIOC->BSRR=1<<6 //读数据 PC6
#define LCD_CS_CLR GPIOC->BRR=1<<9 //片选端口 PC9
#define LCD_RS_CLR GPIOC->BRR=1<<8 //数据/命令 PC8
#define LCD_WR_CLR GPIOC->BRR=1<<7 //写数据 PC7
#define LCD_RD_CLR GPIOC->BRR=1<<6 //读数据 PC6
#else //慢速IO
#define LCD_CS  Cout(9) //片选端口 PC9
#define LCD_RS  Cout(8) //数据/命令 PC8
#define LCD_WR  Cout(7) //写数据 PC7
#define LCD_RD  Cout(6) //读数据 PC6
#endif
/*********************************华丽的分割线**************************************/
|