Skip to content

Commit 3e2dbda

Browse files
add comment about spi mode parameter. (#5)
1 parent 2201aea commit 3e2dbda

File tree

6 files changed

+20
-0
lines changed

6 files changed

+20
-0
lines changed

img/spi_mode0.png

8.85 KB
Loading

img/spi_mode1.png

8.81 KB
Loading

img/spi_mode2.png

8.84 KB
Loading

img/spi_mode3.png

8.8 KB
Loading

mruby_io_SPI_en.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,16 @@ spi = SPI.new()
3333
spi = SPI.new( unit:1, frequency:10_000_000 )
3434
```
3535

36+
mode parameter
37+
38+
| mode | CPOL | CPHA | Idle state clock polarity | Sampling timming | |
39+
|:----:|:----:|:----:|:-------------------------:|:----------------:|-|
40+
| 0 | 0 | 0 | Low | Rising edge |![mode0](img/spi_mode0.png)|
41+
| 1 | 0 | 1 | Low | Falling edge |![mode1](img/spi_mode1.png)|
42+
| 2 | 1 | 0 | High | Falling edge |![mode2](img/spi_mode2.png)|
43+
| 3 | 1 | 1 | High | Rising edge |![mode3](img/spi_mode3.png)|
44+
45+
3646
Device-specific
3747

3848
- Not all parameters may be supported.

mruby_io_SPI_ja.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,16 @@ spi = SPI.new()
3333
spi = SPI.new( unit:1, frequency:10_000_000 )
3434
```
3535

36+
モードパラメータ
37+
38+
| mode | CPOL | CPHA | Idle state clock polarity | Sampling timming | |
39+
|:----:|:----:|:----:|:-------------------------:|:----------------:|-|
40+
| 0 | 0 | 0 | Low | Rising edge |![mode0](img/spi_mode0.png)|
41+
| 1 | 0 | 1 | Low | Falling edge |![mode1](img/spi_mode1.png)|
42+
| 2 | 1 | 0 | High | Falling edge |![mode2](img/spi_mode2.png)|
43+
| 3 | 1 | 1 | High | Rising edge |![mode3](img/spi_mode3.png)|
44+
45+
3646
機種依存
3747

3848
- 全てのパラメータがサポートされているとは限らない。

0 commit comments

Comments
 (0)