io.c
来自「isp1161驱动代码是我下载并该动后而成,还有点缺点,但对你可能有点帮助」· C语言 代码 · 共 39 行
C
39 行
extern unsigned char PacketBuffer[32];void setpio(int ioport,int ch){ *(unsigned int*)0x01802000&=~(1<<ioport);//将此端口设为输出口 if(ch==0) { *(unsigned int*)0x01802004&=~(1<<ioport); //0 输出为0 } else if(ch==1) { *(unsigned int*)0x01802004|=1<<ioport; //1 输出为1 }}char readpio(int ioport) { int t; *(unsigned int*)0x01802004&=~(1<<ioport); //0 输出为0 *(unsigned int*)0x01802000|=(1<<ioport);//将此端口设为输入口 if((*(unsigned int*)0x01802008&=(1<<ioport))==0) { return 0; } else { return 1; }}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?