Skip to content

Commit

Permalink
lrvnano: update peripheral.md
Browse files Browse the repository at this point in the history
  • Loading branch information
wu-yue-yu committed Jan 26, 2024
1 parent ee79d02 commit e814740
Showing 1 changed file with 55 additions and 0 deletions.
55 changes: 55 additions & 0 deletions docs/hardware/zh/lichee/RV_Nano/5_peripheral.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ update:
author: 0x754C
---

## 引脚分布
![](./../assets/RV_Nano/intro/RV_Nano_3.jpg)

## 连接到板子

### UART0
Expand Down Expand Up @@ -90,6 +93,58 @@ echo '#!/bin/sh' > /etc/rc.local
reboot
```

## Audio

licheerv nano 支持录音和播放,使用标准 ALSA 工具可以进行录音、播放等操作。

### 录音

首先设置麦克风音量,范围:0-24
```shell
amixer -Dhw:0 cset name='ADC Capture Volume' 24
```

设置完成后开始录音:
```shell
arecord -Dhw:0,0 -d 3 -r 48000 -f S16_LE -t wav test.wav & > /dev/null &
```

### 播放

```shell
./aplay -D hw:1,0 -f S16_LE test.wav
```

## I2C

插针上引出了 I2C1 和 I2C3,将设备连接到其上即可。

使用前需要先正确设置 PINMUX:
```shell
# I2C1
devmem 0x030010D0 32 0x2
devmem 0x030010DC 32 0x2
# I2C3
devmem 0x030010E4 32 0x2
devmem 0x030010E0 32 0x2
```

然后可以使用 i2c-tools 进行 i2c 外设的操作,镜像中已经预装。

## ADC

插针上引出了一路 ADC,使用的是 ADC1。

首先选择 ADC channel,这里以 ADC1 为例:
```shell
echo 1 > /sys/class/cvi-saradc/cvi-saradc0/device/cv_saradc
```

读取 ADC1 的值:
```shell
cat /sys/class/cvi-saradc/cvi-saradc0/device/cv_saradc
```

## LCD

将屏幕的排线接到板子的MIPI接口,注意线序
Expand Down

0 comments on commit e814740

Please sign in to comment.