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

  • carlocation20061010
    一款用VC++写的车牌定位系统,对理解和研究图像文字识别有很好的参考价值。(write the license plate positioning systems, and research to understand images and text identification of value.)
    2007-05-26 16:34:22下载
    积分:1
  • rc4
    实现RC4流密码算法,对文件进行加密,并将加密的内容以文件形式输出,控制台调用。(Achieve RC4 stream cipher algorithm, to encrypt files and encrypt the contents of the output file format, called the console.)
    2020-11-24 16:49:33下载
    积分:1
  • 简单的模拟远程控制
    一个简单的远程控制(不算远控,只能算SOCKET编程吧),SDK..。代码没有优化,懒得调试。 只有远程信息查看,进程管理,文件管理 这个纯粹只是当时熟悉SOCKET的同步阻塞模型编的(真正的远控不是这样的),而且,没有加dll注入,自启动。。 
    2017-08-03下载
    积分:1
  • cpp_200715
    说明:  通过一个C++例子,来学习C++的重载。这里面包括几个重载的例子(Through a C + + example, to learn C + + overload. There are several examples of overloading)
    2020-08-03 15:14:16下载
    积分:1
  • 5PS2MOUSE1
    51单片机模拟PS2鼠标KEIL C51程序,单片片机采用STC12C系列,代码注释详细, (51 single-chip analog PS2 mouse KEIL C51 program, a single piece of machine with STC12C series of code comments in detail,)
    2012-08-20 06:52:01下载
    积分:1
  • C# WINFORM form realization of an instance by value, summed up the pass values o...
    实现C# WINFORM窗体传值的实例,总结了传值的几种方式并附带实例和说明-C# WINFORM form realization of an instance by value, summed up the pass values of a number of ways and comes with examples and illustrations
    2022-02-14 12:42:28下载
    积分:1
  • ESP8255 红外发送、接收
    ESP 系列 ESP8266 模块,红外发送接收 Demo 程序。 程序中包含有,环形队列的实现及使用,红外的控制,是一个十分不错的示例程序。
    2022-03-04 00:58:45下载
    积分:1
  • perceptron_test
    神经网络中的感知机的学习算法的c语言程序源代码(neural network of Perceptron learning algorithm in C language source code)
    2006-10-13 15:55:20下载
    积分:1
  • 红龙摄像头源码
    基于stm32平台实现ov7670摄像头图像数据采集的源码,优化到20帧的速率
    2023-08-31 14:35:06下载
    积分:1
  • Demo
    在对话框中加载菜单,VC++精选编程源码,很好的参考。(In the dialog box to load the menu, select VC++ programming source code, a good reference.)
    2013-12-03 09:27:56下载
    积分:1
  • 696518资源总数
  • 105559会员总数
  • 1今日下载