GPIO_P5)    return1; //¿Õ²Ù×÷ if(GPIOx->Mode>GPIO_OUT_PP) return2; //´íÎó if(GPIO==GPIO_P0) {  if(GPIOx->Mode==GPIO_PullUp)  P0M1&=~GPIOx->Pin, P0M0&=~GPIOx->Pin; //ÉÏÀ­×¼Ë«Ïò¿Ú  if(GPIOx->Mode==GPIO_HighZ)  P0M1|= GPIOx->Pin, P0M0&=~GPIOx->Pin; //¸¡¿ÕÊäÈë  if(GPIOx->Mode==GPIO_OUT_OD)  P0M1|= GPIOx->Pin, P0M0|= GPIOx->Pin; //¿ªÂ©Êä³ö  if(GPIOx->Mode==GPIO_OUT_PP)  P0M1&=~GPIOx->Pin, P0M0|= GPIOx->Pin; //ÍÆÍìÊä³ö } if(GPIO==GPIO_P1) {  if(GPIOx->Mode==GP-IMDN开发者社群-imdn.cn"> GPIO_P5)    return1; //¿Õ²Ù×÷ if(GPIOx->Mode>GPIO_OUT_PP) return2; //´íÎó if(GPIO==GPIO_P0) {  if(GPIOx->Mode==GPIO_PullUp)  P0M1&=~GPIOx->Pin, P0M0&=~GPIOx->Pin; //ÉÏÀ­×¼Ë«Ïò¿Ú  if(GPIOx->Mode==GPIO_HighZ)  P0M1|= GPIOx->Pin, P0M0&=~GPIOx->Pin; //¸¡¿ÕÊäÈë  if(GPIOx->Mode==GPIO_OUT_OD)  P0M1|= GPIOx->Pin, P0M0|= GPIOx->Pin; //¿ªÂ©Êä³ö  if(GPIOx->Mode==GPIO_OUT_PP)  P0M1&=~GPIOx->Pin, P0M0|= GPIOx->Pin; //ÍÆÍìÊä³ö } if(GPIO==GPIO_P1) {  if(GPIOx->Mode==GP - IMDN开发者社群-imdn.cn">
登录
首页 » C » 单片机gpio初始化 gpio.c

单片机gpio初始化 gpio.c

于 2022-03-01 发布 文件大小:1.27 kB
0 137
下载积分: 2 下载次数: 1

代码说明:

#include "GPIO.h"u8 GPIO_Inilize(u8 GPIO, GPIO_InitTypeDef *GPIOx){ if(GPIO > GPIO_P5)    return 1; //¿Õ²Ù×÷ if(GPIOx->Mode > GPIO_OUT_PP) return 2; //´íÎó if(GPIO == GPIO_P0) {  if(GPIOx->Mode == GPIO_PullUp)  P0M1 &= ~GPIOx->Pin, P0M0 &= ~GPIOx->Pin;  //ÉÏÀ­×¼Ë«Ïò¿Ú  if(GPIOx->Mode == GPIO_HighZ)  P0M1 |=  GPIOx->Pin, P0M0 &= ~GPIOx->Pin;  //¸¡¿ÕÊäÈë  if(GPIOx->Mode == GPIO_OUT_OD)  P0M1 |=  GPIOx->Pin, P0M0 |=  GPIOx->Pin;  //¿ªÂ©Êä³ö  if(GPIOx->Mode == GPIO_OUT_PP)  P0M1 &= ~GPIOx->Pin, P0M0 |=  GPIOx->Pin;  //ÍÆÍìÊä³ö } if(GPIO == GPIO_P1) {  if(GPIOx->Mode == GP

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • adblib2
    在VC6中使用的数据库开发包, 含测试例子(VC6 used in the database development kits, containing test case)
    2005-01-30 22:01:58下载
    积分:1
  • 02
    说明:  主題:如何检测文件是否已经发生更改? 請使用Visual C++, compile後直接執行即可。 (Subject: how to detect whether changes have occurred? Please use the Visual C++, Compile directly to the Executive.)
    2008-11-13 11:54:55下载
    积分:1
  • lcd12864_KS0108
    液晶128*64(KS0108)并行驱动,有详细的注释,对初学者有用(LCD 128* 64 (KS0108) parallel-driven, detailed notes, useful for beginners)
    2007-05-14 20:43:24下载
    积分:1
  • myauto
    vc6+vs2005环境,股票自动交易软件。目前支持通达信版本交易,凡交易平台使用通达信的券商都可使用。实现为使用窗口句柄抓取交易界面窗口完成。使用时需要先打开交易软件,否则无法找到。(vc6+vs2005 environment, stock automated trading software. Currently supports accessible letter version of the transaction, where the trading platform accessible letter broker can be used. To achieve completion of the trading interface window for the window handle to crawl. Need to open the trading software, otherwise it is impossible to find.)
    2011-06-28 14:22:01下载
    积分:1
  • 这是一个简单的字棋游戏,采用了α-β-修剪算法。
    这是一个简单的一字棋游戏,采用阿尔法贝塔剪枝算法做成的。-This is a simple word chess game, using Alpha Beta pruning algorithm are made.
    2022-02-05 03:07:23下载
    积分:1
  • 这是一个圆的控件!C#写的,也是一个不错的控件
    这是一个圆的控件!C#写的,也是一个不错的控件-This is a circle of control! C# to write, and it is a good control
    2023-02-10 06:30:02下载
    积分:1
  • MemoryFile
    这是一本关于Windows下内存映射文件相关内容的书籍, 通过它可以操作文件,它的速度是I/O操作的20倍,及其适合大文件的操作(This is a book about Windows memory mapping document of relevant books, through which it can file, its speed is I/O operation20 times, and is suitable for large files )
    2012-06-14 15:59:44下载
    积分:1
  • 串口通信程序
    一个很好的COM口通讯类(An uart mfc example)
    2020-06-26 10:00:02下载
    积分:1
  • My-clock
    本程序为单片机红外遥控液晶万年历程序。本程序包括ds1302时钟部分,ds18b20部分,红外遥控等部分(The program for the infrared remote control MCU LCD calendar program. The program including of ds1302 clock parts, ds18b20 part, infrared remote part)
    2013-04-14 16:01:38下载
    积分:1
  • 玩家PK
    #include #include #include #include #include #include using namespace std; class Role { protected: int hp,ce,de,fa; int flag; string nn; public: Role(string n, int h, int c, int d, int f):nn(n),hp(h),ce(c),de(d),fa(f) {} ~Role() {} void combat(Role &an) { if(fa>an.fa) { flag=1; loop2: cout
    2022-08-02 18:23:20下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载