ARM LPC1751 引脚配置为 I/O
如何配置一个引脚用于输入,另一个引脚用于输出?
如果我没记错的话,这可以通过控制未连接到外围功能的设备引脚的 GPIO 寄存器来完成。
How can I configure one pin for input and another for the output?
If I am not wrong this could be done with GPIO registers that controlls device pins that are not connected to peripherical functions.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
请参阅 UM10360.PDF,第 9 章:GPIO。在那里您可以找到 FIOxDIR 方向寄存器的描述,以及用于查询、设置和清除 GPIO 引脚的寄存器。
我还强烈建议您查看 NXP 为 175x/176x 提供的 CMSIS 标准外设驱动程序库,请查看 微控制器支持文档。编辑:这个库中有很多示例代码。
Look in UM10360.PDF, Chapter 9: GPIO. There you can find the description for the FIOxDIR direction registers, as well as the reigisters for querying, setting and clearing GPIO pins.
I also strongly recommend looking at the CMSIS Standard Peripherial Driver Library that NXP offers for 175x/176x, look in microcontroller support documents. Edit: There are lots of sample code in this Library.
https://github.com/dwelch67
我有许多基于 lpc 的示例。您正在寻找 IODIR 寄存器,具体取决于 LPC 的端口和风格,现在有他们所谓的快速 I/O 寄存器。位位置中的 1 表示该引脚是输出,零表示输入。
https://github.com/dwelch67
I have a number of lpc based examples. You are looking for the IODIR register, depending on the port and flavor of LPC, there are now what they call fast I/O registers. a one in a bit location means that pin is an output, a zero an input.