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 178
下载积分: 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 个回复

  • sm3Phmac
    基于国密算法SM3实现HMAC,输入密钥和消息,可产生HASH验证码,C环境下调试成功(Based on the countries close algorithm realization SM3 HMAC, input key and news, can produce HASH verification code, C environment debugging success)
    2020-12-29 09:49:00下载
    积分:1
  • Assignment1
    stm32连接机智云的小代码,可用云平台控制led的代码。(Stm32 connects the small code of tact cloud, which can control the led code with the cloud platform.)
    2018-03-06 08:32:43下载
    积分:1
  • Chinese-Convert-Pro-3.5.1-Final
    Nothing to do, we need to learn how to trick something on the webs
    2014-01-09 01:53:33下载
    积分:1
  • 用户界面的使用的程序
    用户界面的使用的程序-user interface procedures for the use of
    2023-06-04 05:10:03下载
    积分:1
  • bmp2jpeg&jpegcoding
    bmp转换为jpeg,jpeg压缩的源代码 程序用vc实现了bmp图片转换成jpeg图片(converted to jpeg bmp, jpeg compression source code procedures used vc realized bmp images converted into jpeg photos)
    2020-11-28 10:29:30下载
    积分:1
  • 20060611Access
    简要说明:直接通过DAO读、写Access文件    直接利用DAO来创建、读写Access文件,总的说来,对比上篇<直接通过ODBC读、写Excel文件>来讲,要简单一些。在下面的示例中,我们将用到两种方法:SQL和DAO类涵数来混合实现它们,这样做的目地,我想可以使大家更加方便灵活的运用它们来完成你想要做的东西。在示例程序中默认指定创建数据库名为:Demo.mdb,内部表名为:DemoTable,写入两个字段:名字和年龄,采用和上一篇读写Excel类似的操作,你也可以根据自己需要来动态改变它们。 (Brief Description : DAO directly through reading, writing documents directly using Access to create DAO, Access document literacy, in general, compared to the previous chapter)
    2006-08-29 12:05:09下载
    积分:1
  • very-simple-volume-rendering_puc
    Very Simple Volume Rendering
    2014-11-24 17:52:41下载
    积分:1
  • ccs-practiks
    practica pic usb com matlab este archivo no es propio es un archivo descargado de la web que comparto con ustedes
    2011-05-07 04:28:38下载
    积分:1
  • dbconstruction
    任意阶daubechies小波函数的构造,包括尺度函数和小波函数以及滤波器系数的构造(arbitrary order PG wavelet function, including scaling function and wavelet function and the structure of the filter coefficients)
    2020-11-10 20:19:45下载
    积分:1
  • fibe-Increase-and
    增加文件并发送邮件,Add files and send mail,(Increase the file and send mail, Add files and send mail,)
    2017-04-22 09:49:34下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载