Wiring Pi:GPIO Interface library for the Raspberry Pi
关于
WiringPi是一个基于PIN的访问GPIO的库,这个库是使用C语言编写的,用在BCM2835,BCM2836以及BCM2837的板子上,可以用在所有的树莓派的开发板上,他是基于GNU LGPLv3的许可,然后可以用在C,C++还有BASIC语言上,这个设计好像Arduino的“Wiring”系统,可以用在C/C++项目中,是一个初学者的工具
WiringPi设计在用32位的树莓派上,它不支持其他的任何平台,或者是跨平台编辑的版本,还有其他的操作系统,虽然有的人试过这么做,但是我还没有使用过
原生的树莓派有26个引脚,支持GPIO连接,有8个I/O pin脚,他们可以被编辑成数字输出或者输入,他们其中的两个(40pin和26pin)可以设计为PWM输出,它还有两线制的I2C接口和4显示的SPI接口(如果有第二选择的线,那么就一共需要5根线),还有UART的串口输出
最近有一些变化如下:
- The original model B with the 26-pin GPIO connector.
- The model B, Revision 1.1 Raspberry Pi has an additional 4 GPIO lines
on a separate connector which you have to solder onto the board. - The model A which is essentially the same as the model B v1.1 but
without the USB hub and ethernet connector. - The model A+ and B+ Raspberry Pi’s represents 2 years of research,
development and testing and now features a single 40-pin GPIO
connector with 28 usable GPIO pins and 4 USB sockets. (No USB or
Ethernet on the A+) - The model B v2 features a quad-core Arm A7 processor with 1GB of RAM.
Same GPIO. - The model Zero is a souped-up (1GHz) cut down Pi A+. 40-pin GPIO
connector and very little else. $5 price tag. - The model B v3 features a quad-core Arm A8 processor (64-bits) with
the same RAM and GPIO as the model 2, however it also features
on-board Wi-Fi and Bluetooth. Still the same $35 price tag. - The model Zero-W is adds on-board Wi-Fi, Bluetooth and the Pi camera
connector to the existing model Zero board.
当不适用总线形式的传输的时候,I2C,SPI还有URAT的接口可以都可以使用通用的GPIO的引脚来实现数据发送
WiringPi包含一些命令行的方式来用在程序中,并且可以设置GPIO的PIN脚,你可以在SHELL中使用它来读写pin脚的内容
WiringPi是可以拓展的,可以使用WiringPi来使用模拟量,可以使用面包板来拓展,