translate i2c pcm spi uart to zh

This commit is contained in:
Villivateur Von 2022-01-21 14:42:00 +08:00
parent 87173bf481
commit ad9000109c
5 changed files with 32 additions and 33 deletions

View File

@ -1,16 +1,16 @@
strings:
- default_desc: '树莓派及其扩展板的引脚定义导航站'
- default_title: '树莓派引脚定义'
- title_suffix: ' at Raspberry Pi GPIO Pinout'
- title_suffix: ' - 由树莓派引脚定义导航站解释'
- home: '主页'
- boards: '开发板'
- details: '详情'
- group_other: '其他'
- form_undefined: '未定义'
- pin_header: '{} '
- type_hat: 'HAT form-factor'
- type_phat: 'pHAT form-factor'
- type_classic: 'Classic form-factor'
- pin_header: '{} 个排针'
- type_hat: 'HAT 形态'
- type_phat: 'pHAT 形态'
- type_classic: '经典形态'
- eeprom_detect: 'EEPROM 产品编号'
- eeprom_setup: 'EEPROM 自动配置'
- uses_i2c: '使用 I2C 通讯'
@ -18,7 +18,7 @@ strings:
- uses_5v_and_3v3: '需要 5v 及 3v3 供电'
- uses_5v: '需要 5v 供电'
- uses_3v3: '需要 3v3 供电'
- uses_n_gpio_pins: '使用 GPIO 引脚 {}'
- uses_n_gpio_pins: '使用了 {} 个 GPIO 引脚'
- bcm_pin_rev1_pi: '在初版很久以前的树莓派上的GPIO/BCM 引脚 {}'
- physical_pin_n: '{} 号物理引脚'
- wiring_pi_pin: 'Wiring Pi {} 号引脚'

View File

@ -23,22 +23,22 @@ pin:
direction: both
active: high
-->
# I2C - Inter Integrated Circuit
# I2C - 集成电路总线
GPIO 2 and GPIO 3 - the Raspberry Pi's I2C1 pins - allow for two-wire communication with a variety of external sensors and devices.
GPIO 2 和 GPIO 3 是树莓派 I2C1 的引脚。它们可以与各种支持两线制的外设传感器连接。
The I2C pins include a fixed 1.8 kΩ pull-up resistor to 3.3v. They are not suitable for use as general purpose IO where a pull-up might interfere.
树莓派的 I2C 引脚自带一个 1.8kΩ 的上拉电阻,上拉到 3.3V。因此,如果把这个引脚当成普通 GPIO 来用的话,要注意这个上拉电阻是否有影响。
I2C is a multi-drop bus, multiple devices can be connected to these same two pins. Each device has its own unique I2C address.
I2C 是一个多节点的总线,这两根引脚上可以连接多个设备,每个设备有唯一的 I2C 地址。
You can verify the address of connected I2C peripherals with a simple one-liner:
你可以通过下面的代码快速检测连在树莓派 I2C 总线上的设备地址:
```bash
sudo apt-get install i2c-tools
sudo i2cdetect -y 1
```
You can then access I2C from Python using the smbus library:
如果用 Python 的话,可以通过 smbus 库来实现 I2C 访问:
```python
import smbus
@ -48,4 +48,4 @@ bus = smbus.SMBus(DEVICE_BUS)
bus.write_byte_data(DEVICE_ADDR, 0x00, 0x01)
```
GPIO 0 and GPIO 1 - I2C0 - can be used as an alternate I2C bus, but are typically used by the system to read the HAT EEPROM.
GPIO 0 和 GPIO 1 是 I2C0 的引脚,可以作为另一个 I2C 总线来用,但它们通常用来读写树莓派盖板上的 EEPROM。

View File

@ -14,6 +14,6 @@ pin:
'bcm21':
name: DOUT
-->
# PCM - Pulse-code Modulation
# PCM - 脉冲编码调制
PCM (Pulse-code Modulation) is a digital representation of sampled analog. On the Raspberry Pi it's a form of digital audio output which can be understood by a DAC for high quality sound.
PCM(脉冲编码调制)是一种模拟信号的数字化方法。在树莓派上,它是一种数字音频输出形式。其输出可以被 DAC 解析为高质量音频。

View File

@ -45,23 +45,21 @@ pin:
'40':
name: SPI1 SCLK
-->
# SPI - Serial Peripheral Interface
# SPI - 串行外设接口
---
### SPI0 pins are GPIO 7, 8, 9, 10, 11
### SPI1 pins are GPIO 16, 17, 18, 19, 20, 21
### SPI0 的引脚是 GPIO 7, 8, 9, 10, 11
### SPI1 的引脚是 GPIO 16, 17, 18, 19, 20, 21
---
Known as the four-wire serial bus, SPI lets you attach multiple compatible devices to a single set of pins by assigning them different chip-select pins.
SPI 是一个四线制的总线,通过切换片选引脚,可以用同一套数据引脚来访问多个不同的外设。
To talk to an SPI device, you assert its corresponding chip-select pin.
默认情况下,树莓派允许用户使用 SPI0 及其片选引脚 CE0GPIO 8和 CE1GPIO 7
By default the Pi allows you to use SPI0 with chip select pins on CE0 on GPIO 8 and CE1 on GPIO 7.
You can enable SPI1 with a dtoverlay configured in "/boot/config.txt", for example:
如果要启用 SPI你需要在 `/boot/config.txt` 中加一行 dtoverlay 的配置,比如:
```
dtoverlay=spi1-3cs
```
For full details of the SPI dtoverlays (and others) see [the Raspberry Pi dtoverlay README](https://raw.githubusercontent.com/raspberrypi/firmware/master/boot/overlays/README)
关于树莓派 SPI dtoverlays 的详情,请访问 [树莓派 dtoverlay 介绍](https://raw.githubusercontent.com/raspberrypi/firmware/master/boot/overlays/README)

View File

@ -80,22 +80,23 @@ pin:
direction: input
active: high
-->
# UART - Universal Asynchronous Receiver/Transmitter
# UART - 通用异步收发器
---
### UART pins in BCM mode are: 14, 15
### UART pins in WiringPi are: 15, 16
### BCM 模式下的 UART 引脚: 14, 15
### Wiring Pi 模式下的 UART 引脚: 15, 16
---
UART is an asynchronous serial communication protocol, meaning that it takes bytes of data and transmits the individual bits in a sequential fashion.
Asynchronous transmission allows data to be transmitted without the sender having to send a clock signal to the receiver. Instead, the sender and receiver agree on timing parameters in advance and special bits called 'start bits' are added to each word and used to synchronize the sending and receiving units.
UART 是一个异步的串行通讯协议,也就是说,它按顺序一个一个地发送或接受比特位。
UART is commonly used on the Pi as a convenient way to control it over the GPIO, or access the kernel boot messages from the serial console (enabled by default).
异步通信意味着无需独立的时钟同步线,发送方即可发送数据给接收方。二者需要使用相同的时钟参数(波特率),并且发送方需要在每个字节前添加一个特殊的“起始位”,这样才能实现通讯。
It can also be used as a way to interface an Arduino, bootloaded ATmega, ESP8266, etc with your Pi. Be careful with logic-levels between the devices though, for example the Pi is 3.3v and the Arduino is 5v. Connect the two and you might conjure up some magic blue smoke.
通常,我们可以通过 UART 串口终端来直接控制树莓派,或者读取内核启动信息,而且这个功能是默认开启的。
Raspberry Pi 2/3 have two UARTs, uart1 and uart0. Raspberry Pi 4 has four additional UARTs available. Only uart0/1 is enabled over GPIO pin 14/15 by default. The additional UARTs can be enabled through the device tree overlays.
UART 同样可以与 Arduino、ESP866 等其他单片机设备进行通讯,但要注意双方的 UART 逻辑电平高低。比如,树莓派 UART 是 3.3V 的,而传统 Arduino 是 5V 的,如果把两者的 UART 直接连在一起,说不定你的树莓派就要冒烟了。
Assuming you have WiringPi-Python installed, the following python example opens the Pi's UART at 9600baud and puts 'hello world'
树莓派 2 代和 3 代有两个 UART分别是 UART0 和 UART1。树莓派 4 有四个额外的 UART 接口,但只有 UART0 和 UART1 是默认启用的GPIO 引脚 14 和 15。其他的 UART 可以通过修改设备描述树启用。
如果你安装了 WiringPi-Python可以参考下列 python 代码。它以 9600 的波特率打开了树莓派的 UART并输出 `hello world`
```python
import wiringpi