Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions docs/common/dev/_gpio.mdx
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import { PreView } from "@site/src/utils/docs";

GPIO 简介
## GPIO 简介

通用输入/输出(GPIO)是集成电路或电子电路(如 MCU/MPU)电路板上的非专用数字信号引脚,可用作输入或输出,或同时用作输入和输出,并可由软件控制。

### 准备
## 准备

<ul>
<li>一块 {props.product_name}</li>
<li>一个 LED 灯</li>
</ul>

### 连接
## 连接

<p>
如图所示,连接 {props.product_name} 的 PIN_{props.gpio_pin}
Expand All @@ -23,9 +23,9 @@ GPIO 简介
style={{ width: "80%" }}
/>

### 测试
## 测试

#### 输入测试
### 输入测试

将 {props.gpio_pin} 接地或者接 3.3V,

Expand All @@ -37,7 +37,7 @@ GPIO 简介

如果接的是地,该命令输出 0,如果接的是 3.3V,该命令输出 1。

#### 输出测试
### 输出测试

<PreView params={{ model: props.model, gpio_pin: props.gpio_pin }}>
{`
Expand Down
10 changes: 5 additions & 5 deletions docs/common/dev/_i2c.mdx
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
I2C 简介
## I2C 简介

I2C(Inter-Integrated Circuit;发音为 "eye-squared-see "或 "eye-two-see"),又称 I2C 或 IIC,是飞利浦半导体公司于 1982 年发明的一种同步、多控制器/多目标(历史上称为主/从)、单端、串行通信总线。

### 准备
## 准备

<ul>
<li>一块 {props.product_name}</li>
<li>一个 OLED </li>
</ul>

### 开启 Overlay
## 开启 Overlay

<p>
请参照<a href="../../radxa-os/rsetup#overlays">设备树配置</a>启用 I2C 相关
Overlay, eg: "Enable {props.i2c_overlay_name}"。
</p>

### 连接
## 连接

<p>按照以下方式连接 {props.product_name} 和 OLED </p>

Expand Down Expand Up @@ -50,7 +50,7 @@ I2C(Inter-Integrated Circuit;发音为 "eye-squared-see "或 "eye-two-see"

<img src={props.i2c_connection} alt="i2c connection" style={{ width: "80%" }} />

### 测试
## 测试

- 打开终端,在终端中输入以下命令安装 python3-periphery 的 Python 库

Expand Down
22 changes: 11 additions & 11 deletions docs/common/dev/_pico-fan.mdx
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { PreView } from "@site/src/utils/docs";

##### 风扇
## 风扇

本段示例旨在为用户提供一个 {props.product_name} CPU 与 MCU RP2040 通信的例子,通过获取 {props.product_name} CPU 的温度,当达到指定温度时,让风扇转起来。

###### 1. 连接
### 连接

将风扇的 pwm 引脚连接到 PIN_3, 风扇 VCC 连接 {props.product_name} 的 VCC, 风扇 GND 连接 {props.product_name} 的 GND

###### 2. {props.product_name} 安装所需要的 Python 库
### {props.product_name} 安装所需要的 Python 库

```bash
pip install pyserial psutil
Expand All @@ -17,7 +17,7 @@ sudo apt-get install stress
sudo apt-get install minicom
```

###### 3. 在 {props.product_name} 上新建一个 Temperature.py 的文件,内容如下:
### 在 {props.product_name} 上新建一个 Temperature.py 的文件,内容如下:

<details>

Expand Down Expand Up @@ -60,7 +60,7 @@ sudo apt-get install minicom

</details>

###### 4. 在 pico-examples/pwm/CMakeLists.txt 里面添加一个 pwm_fan 的目录
### 在 pico-examples/pwm/CMakeLists.txt 里面添加一个 pwm_fan 的目录

:::tip
关于 pico-examples 如何使用请参考上面 pico-sdk/pico-examples 部分
Expand All @@ -86,7 +86,7 @@ sudo apt-get install minicom

</details>

###### 5. 在 pico-examples/pwm/pwm_fan/ 目录下新建一个 CMakeLists.txt, 内容如下:
### 在 pico-examples/pwm/pwm_fan/ 目录下新建一个 CMakeLists.txt, 内容如下:

<details>

Expand All @@ -111,7 +111,7 @@ sudo apt-get install minicom

</details>

###### 6. 在 pico-examples/pwm/pwm_fan/ 目录下新建一个 pwm_fan.c,内容如下:
### 在 pico-examples/pwm/pwm_fan/ 目录下新建一个 pwm_fan.c,内容如下:

<details>

Expand Down Expand Up @@ -188,7 +188,7 @@ sudo apt-get install minicom

</details>

###### 7. 编译
### 编译

{" "}

Expand Down Expand Up @@ -225,20 +225,20 @@ sudo apt-get install minicom

成功编译后,在 build/pwm/pwm_fan 目录下会产生一个名为 pwm_fan.uf2 的文件

###### 8. 烧录
### 烧录

- <a href={props.flash_url}>重启 RP2040</a>
- 将 pwm_fan.uf2 文件拖入到 RP2040 中,待 RP2040 消失后, 程序开始读取 /dev/ttyS0 的消息

###### 9. 板端运行 Temperature.py
### 板端运行 Temperature.py

```bash
sudo python3 Temperature.py
```

程序成功运行的话,该程序会获取 {props.product_name} 当前温度,将温度发送到串口 /dev/ttyS0,并格式化输出温度,如 "CPU Temperature: 42.0°C"

###### 10. 板端运行 minicom
### 板端运行 minicom

```bash
sudo minicom -D /dev/ttyS0 -b 115200
Expand Down
8 changes: 4 additions & 4 deletions docs/common/dev/_pico-gpio-controlled-by-intel.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ import { PreView } from "@site/src/utils/docs";

该实例目的是通过 Intel CPU 去控制 RP2040 的 GPIO 资源,诠释 Intel CPU 与 RP2040 的 Uart 通信。

#### Intel CPU 通过 Uart 去控制 40-PIN 上的 GPIO
## Intel CPU 通过 Uart 去控制 40-PIN 上的 GPIO

##### 1. 准备
### 准备

- 一块 {props.product_name}

- 一个 LED

##### 2. 连接
### 连接

<table>
<tr>
Expand Down Expand Up @@ -42,7 +42,7 @@ import { PreView } from "@site/src/utils/docs";

:::

##### 3. 测试
### 测试

- 将以下代码替换 pico-examples/uart/hello_uart/hello_uart.c

Expand Down
8 changes: 4 additions & 4 deletions docs/common/dev/_pico-gpio.mdx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { PreView } from "@site/src/utils/docs";

#### GPIO
## GPIO

##### 1. 准备
### 准备

- 一块 {props.product_name}
- 一个 LED

##### 2. 连接
### 连接

<table>
<tr>
Expand Down Expand Up @@ -39,7 +39,7 @@ import { PreView } from "@site/src/utils/docs";

:::

##### 3. 测试
### 测试

- 将以下代码替换 pico-examples/blink/blink.c

Expand Down
8 changes: 4 additions & 4 deletions docs/common/dev/_pico-i2c.mdx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { PreView } from "@site/src/utils/docs";

#### I2C
## I2C

##### 1. 准备
### 准备

- 一块 {props.product_name}
- 一个 I2C OLED 1306

##### 2. 连接
### 连接

<table>
<tr>
Expand Down Expand Up @@ -44,7 +44,7 @@ import { PreView } from "@site/src/utils/docs";

:::

##### 3. 测试
### 测试

- 将以下代码替换 pico-examples/i2c/lcd_1602_i2c/lcd_1602_i2c.c

Expand Down
2 changes: 1 addition & 1 deletion docs/common/dev/_pico-mcp2515.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { PreView } from "@site/src/utils/docs";

#### MCP2515
## MCP2515

- 准备

Expand Down
8 changes: 4 additions & 4 deletions docs/common/dev/_pico-poe-fan.mdx
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
import { PreView } from "@site/src/utils/docs";
import { Image } from "@site/src/utils/docs";

#### PoE FAN
## PoE FAN

##### 1. 准备
### 准备

- 一块 {props.product_name}
- 一个 {props.poe_name}

##### 2. 连接
### 连接

如图所示,将 {props.poe_name} 安装在 {props.product_name} 上:

<img src={props.poe_img} style={{ width: "60%" }} alt="POE Img" />

##### 3. 测试
### 测试

- 将以下代码替换 pico-examples/pio/onewire/onewire.c

Expand Down
8 changes: 4 additions & 4 deletions docs/common/dev/_pico-pwm.mdx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { PreView } from "@site/src/utils/docs";

#### PWM
## PWM

##### 1. 准备
### 准备

- 一块 {props.product_name}
- 一个 LED

##### 2. 连接
### 连接

<table>
<tr>
Expand Down Expand Up @@ -38,7 +38,7 @@ import { PreView } from "@site/src/utils/docs";

:::

##### 3. 测试
### 测试

- 将以下代码替换 pico-examples/pwm/led_fade/pwm_led_fade.c

Expand Down
4 changes: 2 additions & 2 deletions docs/common/dev/_pico-sdk-example.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
### PICO-SDK
## PICO-SDK

1. 简介

Expand Down Expand Up @@ -30,7 +30,7 @@
git submodule update --init
```

### PICO-EXAMPLES
## PICO-EXAMPLES

1. 简介

Expand Down
6 changes: 3 additions & 3 deletions docs/common/dev/_pico-sdk-windows.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
### 安装必要工具
## 安装必要工具

- [Git for Windows](https://github.com/git-for-windows/git/releases/download/v2.47.1.windows.1/Git-2.47.1-64-bit.exe)

Expand Down Expand Up @@ -48,7 +48,7 @@

- [Python3 for Windows](https://www.python.org/downloads/windows/)

### 设置环境变量
## 设置环境变量

- 在搜索栏搜索 "编辑系统环境"

Expand Down Expand Up @@ -84,7 +84,7 @@
alt="pico path env"
/>

### 构建编译
## 构建编译

打开 git bash, 进入到 pico-examples/build 目录下,执行以下命令进行构建编译

Expand Down
2 changes: 1 addition & 1 deletion docs/common/dev/_pico-uart.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { PreView } from "@site/src/utils/docs";

##### UART
### UART

- 将以下代码替换 pico-examples/uart/hello_uart/hello_uart.c

Expand Down
10 changes: 5 additions & 5 deletions docs/common/dev/_pwm.mdx
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import { PreView } from "@site/src/utils/docs";

PWM 简介
## PWM 简介

脉宽调制(PWM)是一种调制技术,可产生可变宽度的脉冲来表示模拟输入信号的幅度。
对于高振幅信号,输出开关晶体管更多时间处于导通状态,而对于低振幅信号,输出开关晶体管更多时间处于关断状态。

### 准备
## 准备

<ul>
<li>一块 {props.product_name}</li>
<li>一个 LED 灯</li>
</ul>

### 开启 Overlay
## 开启 Overlay

<p>
请参照<a href="../../radxa-os/rsetup#overlays">设备树配置</a>启用 PWM 相关 Overlay。
Expand All @@ -21,15 +21,15 @@ eg: "Enable {props.pwm_name}"。

</p>

### 连接
## 连接

<p>
如图所示,连接 {props.product_name} 的 {props.pwm_pin}
</p>

<img src={props.pwm_connection} alt="pwm connection" style={{ width: "80%" }} />

### 测试
## 测试

- 打开终端,在终端中输入以下命令安装 python3-periphery 的 Python 库

Expand Down
Loading
Loading